/* =========================================================
   RolHub — integración visual con la barra lateral de Khaos
   ========================================================= */

body#phpbb #rolhub-panel {
    position: fixed;
    z-index: 1300;
    top: 14px;
    left: 84px;
    width: min(430px, calc(100vw - 104px));
    max-height: calc(100vh - 28px);
    max-height: calc(100dvh - 28px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--text);
    background: rgba(7, 7, 7, 0.97);
    border: 1px solid var(--border2-c);
    border-radius: 6px;
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.78), 0 0 0 5px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-6px);
    transform-origin: left center;
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

body#phpbb #rolhub-panel[hidden] {
    display: none !important;
}

body#phpbb #rolhub-panel.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
}

/* Cabecera */
body#phpbb #rolhub-panel .rolhub-panel-header {
    flex: 0 0 auto;
    min-height: 68px;
    padding: 12px 15px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.018);
    border-bottom: 1px solid var(--border1-c);
}

body#phpbb #rolhub-panel .rolhub-panel-mark {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent1);
    font-size: 16px;
    background: var(--dbckg2);
    border: 1px solid var(--border2-c);
    border-radius: 4px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.48);
}

body#phpbb #rolhub-panel .rolhub-panel-heading {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}


body#phpbb #rolhub-panel .rolhub-panel-heading h2 {
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    color: var(--title2) !important;
    font: 700 17px var(--f-titles) !important;
    line-height: 1.35 !important;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 0 !important;
}

body#phpbb #rolhub-panel #rolhub-topic-summary {
    margin-top: 2px;
    color: #696969;
    font: var(--fs-mini) var(--f-mono);
    line-height: 1.3;
    text-transform: uppercase;
}

body#phpbb #rolhub-panel .rolhub-close-btn {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    font-size: 12px;
    background: var(--dbckg2);
    border: 1px solid var(--border2-c);
    border-radius: 3px;
    box-shadow: none;
    cursor: pointer;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

body#phpbb #rolhub-panel .rolhub-close-btn:hover,
body#phpbb #rolhub-panel .rolhub-close-btn:focus-visible {
    color: var(--accent1);
    background: var(--dbckg4);
    border-color: rgba(234, 211, 162, 0.28);
    outline: none;
}

/* Zona desplazable */
body#phpbb #rolhub-panel .rolhub-panel-body {
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

body#phpbb #rolhub-panel .rolhub-topic-list {
    max-height: min(58vh, 560px);
    margin: 0 !important;
    padding: 10px !important;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    list-style: none !important;
    scrollbar-width: thin;
    scrollbar-color: #3a3a3a #0a0a0a;
}

body#phpbb #rolhub-panel .rolhub-topic-list::-webkit-scrollbar {
    width: 5px;
}

body#phpbb #rolhub-panel .rolhub-topic-list::-webkit-scrollbar-track {
    background: #0a0a0a;
    border: 0;
}

body#phpbb #rolhub-panel .rolhub-topic-list::-webkit-scrollbar-thumb {
    background: #3a3a3a;
    border: 0;
    border-radius: 5px;
}

/* Tarjetas */
body#phpbb #rolhub-panel .rolhub-item {
    position: relative;
    width: 100%;
    min-height: 76px;
    margin: 0 0 7px !important;
    padding: 9px 9px 9px 7px !important;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    list-style: none !important;
    color: var(--text);
    background: rgba(255, 255, 255, 0.012);
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-left: 3px solid #282828 !important;
    border-radius: 3px !important;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.36), 0 4px 11px rgba(0, 0, 0, 0.22) !important;
    cursor: grab !important;
    opacity: 1;
    filter: none !important;
    transform: none !important;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease !important;
}

body#phpbb #rolhub-panel .rolhub-item:last-child {
    margin-bottom: 0 !important;
}

body#phpbb #rolhub-panel .rolhub-item:hover {
    z-index: 2;
    background: var(--dbckg4);
    border-top-color: rgba(255, 255, 255, 0.1) !important;
    border-right-color: rgba(255, 255, 255, 0.1) !important;
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.45), 0 7px 16px rgba(0, 0, 0, 0.34) !important;
    filter: none !important;
    transform: none !important;
}

body#phpbb #rolhub-panel .rolhub-level-1 {
    background: rgba(255, 255, 255, 0.01);
    border-left-color: #282828 !important;
}

body#phpbb #rolhub-panel .rolhub-level-2 {
    background: rgba(255, 255, 255, 0.03);
    border-left-color: #777 !important;
}

body#phpbb #rolhub-panel .rolhub-level-3 {
    background: rgba(255, 255, 255, 0.04);
    border-left-color: var(--accent1) !important;
}

body#phpbb #rolhub-panel .rolhub-drag-handle {
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3f3f3f;
    font-size: 10px;
    cursor: grab;
}

body#phpbb #rolhub-panel .rolhub-item:hover .rolhub-drag-handle {
    color: #666;
}

body#phpbb #rolhub-panel .rolhub-item-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

body#phpbb #rolhub-panel .rolhub-item-title-row {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
}

body#phpbb #rolhub-panel .rolhub-item-info-row {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
}

body#phpbb #rolhub-panel .rolhub-topic-link {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    color: var(--title3) !important;
    font: 700 12px var(--f-titles);
    letter-spacing: 0.25px;
    line-height: 1.35;
    text-decoration: none !important;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: none !important;
    transition: color 0.18s ease;
}

body#phpbb #rolhub-panel .rolhub-topic-link:hover,
body#phpbb #rolhub-panel .rolhub-topic-link:focus-visible {
    color: var(--accent1) !important;
    text-shadow: none !important;
    outline: none;
}

body#phpbb #rolhub-panel .rolhub-state-label {
    flex: 0 0 auto;
    padding: 3px 5px;
    color: #555;
    font: 700 7px var(--f-mono);
    line-height: 1;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.045);
    border-radius: 2px;
}

body#phpbb #rolhub-panel .rolhub-level-2 .rolhub-state-label {
    color: #999;
}

body#phpbb #rolhub-panel .rolhub-level-3 .rolhub-state-label {
    color: var(--accent1);
    border-color: rgba(234, 211, 162, 0.18);
}

body#phpbb #rolhub-panel .rolhub-state-label[hidden] {
    display: none !important;
}

body#phpbb #rolhub-panel .rolhub-item.rolhub-is-last-poster .rolhub-state-label {
    color: var(--accent1);
    background: rgba(234, 211, 162, 0.035);
    border-color: rgba(234, 211, 162, 0.2);
    box-shadow: 0 0 8px rgba(234, 211, 162, 0.045);
}

body#phpbb #rolhub-panel .rolhub-item-meta {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    color: #5d5d5d;
    font: 9px var(--f-mono);
    line-height: 1.4;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

body#phpbb #rolhub-panel .rolhub-last-poster {
    color: var(--accent1);
    font-weight: 700;
}

body#phpbb #rolhub-panel .rolhub-meta-separator {
    margin: 0 5px;
    color: #353535;
}

/* Acciones de cada tema */
body#phpbb #rolhub-panel .rolhub-item-actions {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 30px);
    grid-template-rows: repeat(2, 30px);
    gap: 4px;
}

body#phpbb #rolhub-panel .rolhub-action-btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #646464;
    font-size: 12px;
    line-height: 1;
    background: rgba(255, 255, 255, 0.014);
    border: 1px solid rgba(255, 255, 255, 0.045);
    border-radius: 3px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transform: none !important;
    transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

body#phpbb #rolhub-panel .rolhub-action-btn:hover,
body#phpbb #rolhub-panel .rolhub-action-btn:focus-visible {
    color: var(--title2);
    background: var(--dbckg2);
    border-color: rgba(255, 255, 255, 0.12);
    transform: none !important;
    outline: none;
}

body#phpbb #rolhub-panel .rolhub-action-btn.is-active {
    color: var(--accent1);
    border-color: rgba(234, 211, 162, 0.22);
}

body#phpbb #rolhub-panel .rolhub-action-delete {
    color: #806e6e;
}

body#phpbb #rolhub-panel .rolhub-action-delete:hover,
body#phpbb #rolhub-panel .rolhub-action-delete:focus-visible,
body#phpbb #rolhub-panel .rolhub-action-delete.is-active {
    color: #c49494;
    border-color: rgba(196, 148, 148, 0.18);
}

/* Estados secundarios */
body#phpbb #rolhub-panel .rolhub-hidden {
    opacity: 0.42 !important;
}

body#phpbb #rolhub-panel .rolhub-deleted {
    opacity: 0.3 !important;
}

body#phpbb #rolhub-panel .rolhub-deleted .rolhub-topic-link {
    text-decoration: line-through !important;
}

body#phpbb #rolhub-panel .rolhub-item.is-dragging {
    z-index: 20;
    opacity: 0.72 !important;
    cursor: grabbing !important;
    background: var(--dbckg2) !important;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.78), 0 10px 25px rgba(0, 0, 0, 0.48) !important;
    transform: none !important;
}

body#phpbb #rolhub-panel .rolhub-item.drop-top {
    box-shadow: inset 0 3px 0 var(--accent1), 0 5px 12px rgba(0, 0, 0, 0.3) !important;
}

body#phpbb #rolhub-panel .rolhub-item.drop-bottom {
    box-shadow: inset 0 -3px 0 var(--accent1), 0 5px 12px rgba(0, 0, 0, 0.3) !important;
}

/* Mensajes de carga, vacío y error */
body#phpbb #rolhub-panel .rolhub-message {
    min-height: 155px;
    margin: 0 !important;
    padding: 25px !important;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #666;
    text-align: center;
    list-style: none !important;
    background: rgba(255, 255, 255, 0.012);
    border: 1px dashed var(--border2-c);
    border-radius: 3px;
}

body#phpbb #rolhub-panel .rolhub-message > i {
    color: #555;
    font-size: 18px;
}

body#phpbb #rolhub-panel .rolhub-message strong {
    color: var(--title3);
    font: 700 12px var(--f-titles);
}

body#phpbb #rolhub-panel .rolhub-message span {
    max-width: 260px;
    color: #666;
    font: 9px var(--f-mono);
    line-height: 1.55;
    text-transform: uppercase;
}

body#phpbb #rolhub-panel .rolhub-message-error > i,
body#phpbb #rolhub-panel .rolhub-message-error strong {
    color: #b88686;
}

body#phpbb #rolhub-panel .rolhub-loading-icon {
    animation: rolhub-spin 1s linear infinite;
}

@keyframes rolhub-spin {
    to { transform: rotate(360deg); }
}

/* Pie del panel */
body#phpbb #rolhub-panel .rolhub-panel-footer {
    flex: 0 0 auto;
    padding: 9px;
    background: rgba(0, 0, 0, 0.18);
    border-top: 1px solid var(--border1-c);
}

body#phpbb #rolhub-panel .rolhub-save-btn {
    width: 100%;
    min-height: 41px;
    margin: 0 0 8px;
    padding: 8px 12px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--accent1);
    font: 700 10px var(--f-mono);
    letter-spacing: 0.7px;
    text-transform: uppercase;
    background: var(--dbckg2);
    border: 1px solid rgba(234, 211, 162, 0.28);
    border-radius: 3px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.45);
    cursor: pointer;
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

body#phpbb #rolhub-panel .rolhub-save-btn[hidden] {
    display: none !important;
}

body#phpbb #rolhub-panel .rolhub-save-btn.is-dirty {
    color: #17130d;
    background: linear-gradient(180deg, #ead3a2 0%, #caa767 100%);
    border-color: rgba(255, 235, 191, 0.92);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.62), 0 0 16px rgba(234, 211, 162, 0.34);
    animation: rolhub-save-attention 1.8s ease-in-out infinite;
}

body#phpbb #rolhub-panel .rolhub-save-btn.is-dirty > i {
    font-size: 13px;
}

@keyframes rolhub-save-attention {
    0%, 100% {
        box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.62), 0 0 10px rgba(234, 211, 162, 0.22);
    }
    50% {
        box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.62), 0 0 20px rgba(234, 211, 162, 0.48);
    }
}

body#phpbb #rolhub-panel .rolhub-save-btn:hover,
body#phpbb #rolhub-panel .rolhub-save-btn:focus-visible {
    color: var(--title2);
    background: var(--dbckg4);
    border-color: rgba(234, 211, 162, 0.46);
    outline: none;
}

body#phpbb #rolhub-panel .rolhub-save-btn.is-dirty:hover,
body#phpbb #rolhub-panel .rolhub-save-btn.is-dirty:focus-visible {
    color: #0e0c08;
    background: linear-gradient(180deg, #f3dfb4 0%, #d6b777 100%);
    border-color: #f3dfb4;
}

body#phpbb #rolhub-panel .rolhub-save-btn:disabled {
    cursor: wait;
    opacity: 0.45;
}

body#phpbb #rolhub-panel .rolhub-footer-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}

body#phpbb #rolhub-panel .rolhub-control-btn {
    min-width: 0;
    min-height: 55px;
    margin: 0;
    padding: 8px 9px;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    color: var(--text);
    text-align: left;
    background: rgba(255, 255, 255, 0.014);
    border: 1px solid rgba(255, 255, 255, 0.045);
    border-radius: 3px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

body#phpbb #rolhub-panel .rolhub-control-btn > i {
    color: #666;
    font-size: 13px;
    text-align: center;
}

body#phpbb #rolhub-panel .rolhub-control-btn > span {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

body#phpbb #rolhub-panel .rolhub-control-btn strong {
    overflow: hidden;
    color: var(--title3);
    font: 700 9px var(--f-mono);
    line-height: 1.25;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

body#phpbb #rolhub-panel .rolhub-control-btn small {
    overflow: hidden;
    margin-top: 2px;
    color: #595959;
    font: 8px var(--f-mono);
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body#phpbb #rolhub-panel .rolhub-control-btn:hover,
body#phpbb #rolhub-panel .rolhub-control-btn:focus-visible {
    color: var(--title2);
    background: var(--dbckg4);
    border-color: rgba(255, 255, 255, 0.12);
    outline: none;
}

body#phpbb #rolhub-panel .rolhub-control-btn.active,
body#phpbb #rolhub-panel .rolhub-control-btn[aria-pressed="true"] {
    color: var(--accent1);
    border-color: rgba(234, 211, 162, 0.22);
}

body#phpbb #rolhub-panel .rolhub-control-btn.active > i,
body#phpbb #rolhub-panel .rolhub-control-btn[aria-pressed="true"] > i,
body#phpbb #rolhub-panel .rolhub-control-btn.active strong,
body#phpbb #rolhub-panel .rolhub-control-btn[aria-pressed="true"] strong {
    color: var(--accent1);
}

@media (max-width: 700px) {
    body#phpbb #rolhub-panel {
        left: 66px;
        width: calc(100vw - 76px);
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
    }
}

@media (max-width: 520px) {
    body#phpbb #rolhub-panel .rolhub-item {
        grid-template-columns: 14px minmax(0, 1fr);
    }

    body#phpbb #rolhub-panel .rolhub-item-actions {
        grid-column: 2;
        justify-self: end;
        width: auto;
        grid-template-columns: repeat(3, 30px);
        grid-template-rows: repeat(2, 30px);
    }

    body#phpbb #rolhub-panel .rolhub-footer-controls {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    body#phpbb #rolhub-panel,
    body#phpbb #rolhub-panel * {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* =========================================================
   RolHub 1.1 — temas cerrados y zumbidos
   ========================================================= */

body#phpbb #rolhub-panel .rolhub-item > .rolhub-drag-handle,
body#phpbb #rolhub-panel .rolhub-item > .rolhub-item-main,
body#phpbb #rolhub-panel .rolhub-item > .rolhub-item-actions {
    position: relative;
    z-index: 2;
}



body#phpbb #rolhub-panel .rolhub-item.rolhub-closed {
    background: linear-gradient(90deg, rgba(121, 32, 32, 0.12), rgba(255, 255, 255, 0.012) 44%) !important;
    border-left-color: #9e3f3f !important;
}

body#phpbb #rolhub-panel .rolhub-item.rolhub-closed:hover {
    background: linear-gradient(90deg, rgba(121, 32, 32, 0.17), rgba(255, 255, 255, 0.025) 48%) !important;
}


body#phpbb #rolhub-panel .rolhub-item.rolhub-closed .rolhub-state-label {
    color: #c27676;
    border-color: rgba(194, 118, 118, 0.22);
}

body#phpbb #rolhub-panel .rolhub-item.rolhub-closed .rolhub-topic-link {
    color: #9d8d8d !important;
}

body#phpbb #rolhub-panel .rolhub-action-btn:disabled {
    color: #393939;
    cursor: not-allowed;
    opacity: 0.5;
}

body#phpbb #rolhub-panel .rolhub-action-btn:disabled:hover {
    color: #393939;
    background: rgba(255, 255, 255, 0.014);
    border-color: rgba(255, 255, 255, 0.045);
}

body#phpbb #rolhub-panel .r-buzz {
    position: relative;
}

body#phpbb #rolhub-panel .r-buzz.is-active {
    color: var(--accent1);
    background: rgba(234, 211, 162, 0.045);
}

body#phpbb #rolhub-panel .r-buzz.is-sending i {
    animation: rolhub-bell-ring 0.55s linear infinite;
}

body#phpbb #rolhub-panel .rolhub-buzz-counter {
    position: absolute;
    right: 1px;
    bottom: 1px;
    min-width: 14px;
    padding: 1px 2px;
    box-sizing: border-box;
    color: #9b9b9b;
    font: 700 6px/1 var(--f-mono);
    text-align: center;
    background: rgba(0, 0, 0, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.07);
    pointer-events: none;
}

body#phpbb #rolhub-panel .r-buzz.is-active .rolhub-buzz-counter {
    color: var(--accent1);
    border-color: rgba(234, 211, 162, 0.16);
}

body#phpbb #rolhub-panel .rolhub-item.rolhub-buzzing {
    cursor: pointer !important;
    transform-origin: 50% 50%;
    animation: rolhub-card-buzz 0.96s ease-in-out infinite;
}

body#phpbb #rolhub-panel .rolhub-item.rolhub-buzzing::after {
    content: '';
    position: absolute;
    z-index: 1;
    inset: 0;
    border: 1px solid rgba(234, 211, 162, 0.2);
    box-shadow: inset 0 0 21px rgba(234, 211, 162, 0.07), 0 0 18px rgba(234, 211, 162, 0.14);
    opacity: 0.35;
    pointer-events: none;
    animation: rolhub-card-glow 0.96s ease-in-out infinite;
}

body#phpbb #rolhub-panel .rolhub-item.rolhub-buzzing .rolhub-state-label {
    color: var(--accent1);
    border-color: rgba(234, 211, 162, 0.25);
}

body#phpbb #rolhub-panel .rolhub-item.rolhub-buzzing .rolhub-state-label::before {
    content: '\f0f3';
    margin-right: 4px;
    font-family: FontAwesome;
}

body#phpbb #rolhub-panel .rolhub-item.rolhub-buzzing .rolhub-state-label.is-buzz-only::before {
    margin-right: 0;
}

body#phpbb #rolhub-panel .rolhub-item.rolhub-buzz-acknowledging {
    opacity: 0.68 !important;
    animation-play-state: paused;
}

body#phpbb #rolhub-panel .rolhub-item.rolhub-buzz-sent .r-buzz {
    animation: rolhub-buzz-sent-pulse 0.8s ease-out 1;
}

#rolhub-toggle-btn {
    position: relative;
}

#rolhub-toggle-btn.rolhub-has-buzz::after {
    content: '';
    position: absolute;
    z-index: 0;
    inset: 0;
    background: var(--accent1, #d8b56b);
    border-radius: inherit;
    opacity: 0.035;
    pointer-events: none;
    animation: rolhub-toggle-background 1.45s ease-in-out infinite;
}

#rolhub-toggle-btn > .icon,
#rolhub-toggle-btn > i,
#rolhub-toggle-btn .hrol-side-icon {
    position: relative;
    z-index: 2;
}

#rolhub-toggle-btn .rolhub-toggle-buzz-count {
    position: absolute;
    z-index: 8;
    top: 3px;
    right: 3px;
    min-width: 15px;
    height: 15px;
    padding: 0 3px;
    box-sizing: border-box;
    color: #0a0a0a;
    font: 800 8px/15px var(--f-mono, monospace);
    text-align: center;
    background: var(--accent1, #d8b56b);
    border: 1px solid rgba(0, 0, 0, 0.78);
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.42);
    pointer-events: none;
}

#rolhub-toggle-btn .rolhub-toggle-buzz-count[hidden] {
    display: none !important;
}

#rolhub-toggle-btn.rolhub-has-buzz {
    animation: rolhub-toggle-glow 1.45s ease-in-out infinite;
}

#rolhub-toggle-btn.rolhub-has-buzz > .icon,
#rolhub-toggle-btn.rolhub-has-buzz > i,
#rolhub-toggle-btn.rolhub-has-buzz .hrol-side-icon {
    transform-origin: 50% 18%;
    animation: rolhub-bell-ring 0.72s ease-in-out infinite;
}

@keyframes rolhub-card-buzz {
    0%, 100% { translate: 0 0; rotate: 0deg; }
    10% { translate: -2.8px -1px; rotate: -0.78deg; }
    20% { translate: 2.8px 0; rotate: 0.78deg; }
    30% { translate: -2.4px 1px; rotate: -0.68deg; }
    40% { translate: 2.4px -1px; rotate: 0.68deg; }
    50% { translate: -1.8px 1px; rotate: -0.48deg; }
    60% { translate: 1.8px 0; rotate: 0.48deg; }
    72% { translate: -0.8px 0; rotate: -0.2deg; }
    84% { translate: 0 0; rotate: 0deg; }
}

@keyframes rolhub-card-glow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.92; }
}

@keyframes rolhub-bell-ring {
    0%, 100% { transform: rotate(0deg); }
    15% { transform: rotate(10deg); }
    30% { transform: rotate(-9deg); }
    45% { transform: rotate(7deg); }
    60% { transform: rotate(-5deg); }
    75% { transform: rotate(2deg); }
}

@keyframes rolhub-toggle-glow {
    0%, 100% { box-shadow: 0 0 0 rgba(234, 211, 162, 0); }
    50% { box-shadow: 0 0 14px rgba(234, 211, 162, 0.24); }
}

@keyframes rolhub-toggle-background {
    0%, 100% { opacity: 0.035; }
    50% { opacity: 0.14; }
}

@keyframes rolhub-buzz-sent-pulse {
    0% { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35), 0 0 0 0 rgba(234, 211, 162, 0.34); }
    100% { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35), 0 0 0 9px rgba(234, 211, 162, 0); }
}

@media (max-width: 650px) {
    body#phpbb #rolhub-panel .rolhub-footer-controls {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    #rolhub-toggle-btn.rolhub-has-buzz,
    #rolhub-toggle-btn.rolhub-has-buzz::after,
    #rolhub-toggle-btn.rolhub-has-buzz > .icon,
    #rolhub-toggle-btn.rolhub-has-buzz > i,
    #rolhub-toggle-btn.rolhub-has-buzz .hrol-side-icon,
    body#phpbb #rolhub-panel .rolhub-item.rolhub-buzzing,
    body#phpbb #rolhub-panel .rolhub-item.rolhub-buzzing::after,
    body#phpbb #rolhub-panel .r-buzz.is-sending i {
        animation: none !important;
    }

    body#phpbb #rolhub-panel .rolhub-item.rolhub-buzzing {
        box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.36), 0 4px 11px rgba(0, 0, 0, 0.22), 0 0 15px rgba(234, 211, 162, 0.14) !important;
    }

    #rolhub-toggle-btn.rolhub-has-buzz::after {
        opacity: 0.1;
    }
}

/* =========================================================
   RolHub 1.1.2 — confirmación integrada y distribución compacta
   ========================================================= */

body#phpbb #rolhub-panel {
    width: min(448px, calc(100vw - 104px));
}

/* Cinco acciones sin huecos: la campana ocupa las dos filas. */
body#phpbb #rolhub-panel .rolhub-item-actions {
    grid-template-columns: 38px repeat(2, 30px);
    grid-template-rows: repeat(2, 30px);
    gap: 4px;
}

body#phpbb #rolhub-panel .rolhub-item-actions .r-buzz {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 38px;
    min-width: 38px;
    height: 64px;
}

body#phpbb #rolhub-panel .rolhub-item-actions .r-buzz > i {
    font-size: 14px;
}

body#phpbb #rolhub-panel .rolhub-item-actions .r-buzz .rolhub-buzz-counter {
    right: 3px;
    bottom: 4px;
    min-width: 18px;
    padding: 2px 3px;
    font-size: 7px;
}

/* Pie: autosuscripción ancha, ojo y zumbidos como botones cuadrados. */
body#phpbb #rolhub-panel .rolhub-footer-controls {
    grid-template-columns: minmax(0, 1fr) 48px 48px;
    gap: 7px;
}

body#phpbb #rolhub-panel .rolhub-control-btn-icon {
    width: 48px;
    min-width: 48px;
    min-height: 55px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

body#phpbb #rolhub-panel .rolhub-control-btn-icon > i {
    font-size: 15px;
}

/* La confirmación vive dentro de la tarjeta, sin ventanas emergentes. */
body#phpbb #rolhub-panel .rolhub-buzz-send-overlay {
    position: absolute;
    z-index: 8;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 8px 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    overflow: hidden;
    color: var(--title2);
    text-align: center;
    background:
        radial-gradient(circle at 50% 46%, rgba(234, 211, 162, 0.09), transparent 48%),
        rgba(8, 8, 8, 0.965);
    border: 0 !important;
    border-left: 3px solid var(--accent1) !important;
    border-radius: 2px !important;
    box-shadow: inset 0 0 22px rgba(234, 211, 162, 0.045) !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    cursor: pointer;
    transform: none !important;
    transition: opacity 0.16s ease, visibility 0.16s ease, background 0.16s ease;
}

body#phpbb #rolhub-panel .rolhub-buzz-send-overlay:hover,
body#phpbb #rolhub-panel .rolhub-buzz-send-overlay:focus-visible {
    color: var(--title2);
    background:
        radial-gradient(circle at 50% 46%, rgba(234, 211, 162, 0.14), transparent 50%),
        rgba(10, 10, 10, 0.985);
    outline: none;
}

body#phpbb #rolhub-panel .rolhub-buzz-send-overlay > i {
    margin-bottom: 1px;
    color: var(--accent1);
    font-size: 22px;
    transform-origin: 50% 15%;
}

body#phpbb #rolhub-panel .rolhub-buzz-overlay-title {
    max-width: 95%;
    color: var(--title2);
    font: 700 11px/1.25 var(--f-titles);
    letter-spacing: 0.35px;
}

body#phpbb #rolhub-panel .rolhub-buzz-overlay-note {
    max-width: 96%;
    color: #777;
    font: 7px/1.35 var(--f-mono);
    letter-spacing: 0.15px;
    text-transform: uppercase;
}

body#phpbb #rolhub-panel .rolhub-item.rolhub-buzz-confirming {
    cursor: pointer !important;
    border-left-color: var(--accent1) !important;
}

body#phpbb #rolhub-panel .rolhub-item.rolhub-buzz-confirming > .rolhub-drag-handle,
body#phpbb #rolhub-panel .rolhub-item.rolhub-buzz-confirming > .rolhub-item-main,
body#phpbb #rolhub-panel .rolhub-item.rolhub-buzz-confirming > .rolhub-item-actions,

body#phpbb #rolhub-panel .rolhub-item.rolhub-buzz-confirming .rolhub-buzz-send-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

body#phpbb #rolhub-panel .rolhub-item.rolhub-buzz-sending .rolhub-buzz-send-overlay {
    cursor: wait;
}

body#phpbb #rolhub-panel .rolhub-buzz-send-overlay:disabled {
    opacity: 1;
    cursor: wait;
}

body#phpbb #rolhub-panel .rolhub-item.rolhub-buzz-sending .rolhub-buzz-send-overlay > i {
    animation: rolhub-bell-ring 0.55s linear infinite;
}

body#phpbb #rolhub-panel .rolhub-item.rolhub-buzz-send-error .rolhub-buzz-send-overlay {
    border-left-color: #a84b4b !important;
    background:
        radial-gradient(circle at 50% 46%, rgba(168, 75, 75, 0.12), transparent 50%),
        rgba(10, 7, 7, 0.985);
}

body#phpbb #rolhub-panel .rolhub-item.rolhub-buzz-send-error .rolhub-buzz-send-overlay > i,
body#phpbb #rolhub-panel .rolhub-item.rolhub-buzz-send-error .rolhub-buzz-overlay-title {
    color: #c98484;
}

body#phpbb #rolhub-panel .rolhub-item.rolhub-buzz-send-success {
    animation: rolhub-card-sent 0.72s ease-out 1;
}

body#phpbb #rolhub-panel .rolhub-item.rolhub-buzz-send-success .rolhub-buzz-send-overlay {
    border-left-color: var(--accent1) !important;
    box-shadow: inset 0 0 30px rgba(234, 211, 162, 0.095), 0 0 15px rgba(234, 211, 162, 0.12) !important;
}

body#phpbb #rolhub-panel .rolhub-item.rolhub-buzz-send-success .rolhub-buzz-send-overlay > i {
    animation: rolhub-bell-ring 0.6s ease-in-out 1;
}

/* Aviso discreto dentro de una tarjeta si falla la confirmación de lectura. */
body#phpbb #rolhub-panel .rolhub-card-notice {
    position: absolute;
    z-index: 10;
    left: 50%;
    bottom: 7px;
    max-width: calc(100% - 28px);
    padding: 4px 7px;
    box-sizing: border-box;
    overflow: hidden;
    color: var(--accent1);
    font: 700 7px/1.25 var(--f-mono);
    text-align: center;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
    background: rgba(8, 8, 8, 0.94);
    border: 1px solid rgba(234, 211, 162, 0.18);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 3px);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

body#phpbb #rolhub-panel .rolhub-card-notice.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

body#phpbb #rolhub-panel .rolhub-card-notice.is-error {
    color: #c98484;
    border-color: rgba(201, 132, 132, 0.22);
}

/* Candado deliberadamente sobredimensionado y recortado por la tarjeta. */


@keyframes rolhub-card-sent {
    0%, 100% { translate: 0 0; }
    18% { translate: -2px 0; }
    36% { translate: 2px 0; }
    54% { translate: -1px 0; }
    72% { translate: 1px 0; }
}

@media (max-width: 700px) {
    body#phpbb #rolhub-panel {
        width: calc(100vw - 76px);
    }
}

@media (max-width: 520px) {
    body#phpbb #rolhub-panel .rolhub-item-actions {
        grid-template-columns: 38px repeat(2, 30px);
        grid-template-rows: repeat(2, 30px);
    }

    body#phpbb #rolhub-panel .rolhub-footer-controls {
        grid-template-columns: minmax(0, 1fr) 46px 46px;
    }

    body#phpbb #rolhub-panel .rolhub-control-btn-icon {
        width: 46px;
        min-width: 46px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body#phpbb #rolhub-panel .rolhub-item.rolhub-buzz-send-success,
    body#phpbb #rolhub-panel .rolhub-item.rolhub-buzz-sending .rolhub-buzz-send-overlay > i,
    body#phpbb #rolhub-panel .rolhub-item.rolhub-buzz-send-success .rolhub-buzz-send-overlay > i {
        animation: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body#phpbb #rolhub-panel .rolhub-save-btn.is-dirty {
        animation: none;
    }
}
