.icon {
    display: block;
}

.icon.icon-fullscreen {
    width: 22px;
    height: 22px;
}

:root {
    --bg-base: #070d16;
    --panel: rgba(18, 26, 39, 0.9);
    --panel-border: rgba(255, 255, 255, 0.06);
    --text-high: #f6f8fb;
    --text-mid: #9fb1c8;
    --accent: #32c4ff;
    --accent-strong: #1d8ed0;
    --danger: #ff6d83;
    --success: #44d7a8;
    --shadow-soft: 0 18px 36px rgba(4, 10, 22, 0.55);
    --shadow-strong: 0 28px 48px rgba(4, 10, 22, 0.65);
    font-size: 16px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    color: var(--text-high);
    background: radial-gradient(55% 55% at 18% 12%, rgba(50, 196, 255, 0.28), transparent 65%),
                radial-gradient(45% 45% at 82% 8%, rgba(68, 215, 168, 0.24), transparent 60%),
                var(--bg-base);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
body.page-tournaments {
    background: radial-gradient(55% 55% at 20% 12%, rgba(255, 94, 94, 0.32), transparent 65%),
                radial-gradient(45% 45% at 80% 10%, rgba(255, 143, 74, 0.26), transparent 60%),
                linear-gradient(180deg, rgba(46, 8, 16, 0.92), rgba(22, 5, 10, 0.94));
}


.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.6rem 2.3rem;
    background:
        radial-gradient(circle at 12% 20%, rgba(80, 200, 255, 0.2), rgba(9, 15, 24, 0) 45%),
        radial-gradient(circle at 88% 10%, rgba(40, 120, 255, 0.22), rgba(9, 15, 24, 0) 40%),
        rgba(7, 12, 20, 0.86);
    border-bottom: 1px solid rgba(120, 200, 255, 0.18);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 40px rgba(6, 12, 22, 0.45);
    position: relative;
    overflow: hidden;
}

.app-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(90, 210, 255, 0.16), rgba(8, 16, 26, 0));
    opacity: 0.8;
    pointer-events: none;
}

.app-header::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.brand h1 {
    margin: 0;
    font-size: 1.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #e6f4ff;
    text-shadow: 0 0 18px rgba(90, 200, 255, 0.35);
}

.brand .tagline {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.82rem;
    color: rgba(210, 234, 255, 0.72);
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.brand-logo-mobile {
    display: none;
}

.dashboard-shell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
}

.dashboard-logo-top {
    width: min(1000px, 94vw);
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

.dashboard-logo-top__img {
    width: min(360px, 70vw);
    height: auto;
    display: block;
    filter: drop-shadow(0 10px 18px rgba(6, 14, 32, 0.35));
}


.link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    background: rgba(50, 196, 255, 0.14);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.85rem 1.6rem;
    border-radius: 999px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--bg-base);
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    box-shadow: 0 15px 30px rgba(4, 16, 28, 0.45);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease;
    text-decoration: none;
}

.btn:hover,
.btn:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 18px 32px rgba(4, 16, 28, 0.55);
}

.btn:focus-visible {
    outline: 2px solid rgba(50, 196, 255, 0.5);
    outline-offset: 3px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    background: rgba(68, 215, 168, 0.18);
    color: var(--text-high);
    box-shadow: none;
}

.btn-ghost {
    background: transparent;
    color: var(--accent);
    border: 1px solid rgba(50, 196, 255, 0.4);
    box-shadow: none;
}

.app-main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem 1.5rem 4rem;
}

.panel {
    width: min(440px, 95vw);
    padding: 2.4rem 2.2rem;
    background: var(--panel);
    border-radius: 26px;
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow-strong);
    text-align: center;
}

.panel h2 {
    margin: 0;
    font-size: 2rem;
    letter-spacing: 0.06em;
}

.copy {
    margin: 1rem 0 2rem;
    color: var(--text-mid);
    font-size: 1.05rem;
}

#pin-form {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    align-items: stretch;
}

.screen {
    padding: 1.2rem;
    border-radius: 18px;
    background: rgba(6, 12, 22, 0.92);
    border: 1px solid rgba(50, 196, 255, 0.18);
    box-shadow: inset 0 0 24px rgba(50, 196, 255, 0.08);
    min-height: 3.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.screen-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.screen-text.is-hidden {
    opacity: 0;
}

.screen-value {
    font-size: 1.9rem;
    letter-spacing: 0.18em;
}

.screen-hint {
    font-size: 1.1rem;
    letter-spacing: 0.12em;
    color: var(--text-mid);
}

.error {
    margin: -0.4rem 0 0;
    color: var(--danger);
    font-weight: 600;
}

.keypad {
    display: grid;
    gap: 0.85rem;
}

.row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.key {
    padding: 1.05rem 0;
    font-size: 1.5rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(24, 35, 53, 0.95), rgba(13, 21, 34, 0.95));
    color: var(--text-high);
    box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.45), 0 12px 22px rgba(5, 11, 24, 0.46);
    touch-action: manipulation;
}

.key:active {
    transform: translateY(1px) scale(0.99);
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.55), 0 6px 16px rgba(5, 11, 24, 0.45);
    background: linear-gradient(180deg, rgba(20, 30, 45, 0.96), rgba(9, 15, 26, 0.96));
}

.submit {
    padding: 1rem 0;
    font-size: 1.2rem;
    border-radius: 18px;
    border: none;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #041623;
    font-weight: 700;
    letter-spacing: 0.08em;
    box-shadow: 0 20px 34px rgba(50, 196, 255, 0.26);
    cursor: pointer;
}

.submit:active {
    transform: translateY(2px);
}

.submit:disabled {
    background: rgba(50, 196, 255, 0.35);
    color: rgba(4, 22, 35, 0.72);
    box-shadow: none;
    cursor: default;
}

.dashboard {
    width: min(1000px, 94vw);
    display: grid;
    gap: 1.6rem;
    background:
        radial-gradient(circle at 12% 10%, rgba(70, 190, 255, 0.2), rgba(9, 15, 24, 0) 40%),
        radial-gradient(circle at 85% 0%, rgba(40, 120, 255, 0.2), rgba(9, 15, 24, 0) 38%),
        var(--panel);
    padding: 2.8rem;
    border-radius: 30px;
    border: 1px solid rgba(120, 200, 255, 0.2);
    box-shadow: 0 26px 48px rgba(6, 14, 32, 0.55);
    position: relative;
    overflow: hidden;
}


.dashboard::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(80, 200, 255, 0.12), rgba(9, 15, 24, 0));
    opacity: 0.8;
    pointer-events: none;
}

.dashboard::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.dash-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

.dash-head h2 {
    margin: 0;
    font-size: 2.2rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #f2f7ff;
    text-shadow: 0 12px 24px rgba(5, 12, 24, 0.55);
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-mid);
    font-size: 0.85rem;
    margin: 0 0 0.35rem;
}

.badge {
    padding: 0.4rem 1rem;
    border-radius: 999px;
    background: rgba(50, 196, 255, 0.16);
    letter-spacing: 0.2em;
    font-size: 0.78rem;
    text-transform: uppercase;
}

.badge-admin {
    color: var(--success);
    background: rgba(68, 215, 168, 0.18);
}

.dash-copy {
    margin: 0;
    color: var(--text-mid);
    position: relative;
    z-index: 1;
}

.module-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    position: relative;
    z-index: 1;
    justify-content: center;
}

.module-tab {
    border: 1px solid rgba(120, 200, 255, 0.2);
    border-radius: 12px;
    padding: 0.55rem 1rem;
    min-height: 0;
    background: rgba(9, 15, 24, 0.72);
    color: var(--text-mid);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    position: relative;
    overflow: hidden;
}

.module-tab::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(80, 200, 255, 0.1), rgba(9, 15, 24, 0));
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.module-tab__label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.1;
    position: relative;
    z-index: 1;
}

.module-tab__alert {
    display: none;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: #ffbd59;
    box-shadow: 0 0 14px rgba(255, 189, 89, 0.85);
    flex-shrink: 0;
    position: absolute;
    top: 0.2rem;
    right: 0.3rem;
    z-index: 2;
}

.module-tab.has-alert .module-tab__alert {
    display: inline-flex;
    animation: tab-alert-pulse 1.2s ease-in-out infinite;
}

.module-tab.has-alert {
    border-color: rgba(255, 189, 89, 0.8);
    box-shadow: 0 0 18px rgba(255, 189, 89, 0.35);
}

.module-tab:hover,
.module-tab:focus-visible {
    color: #e8f7ff;
    border-color: rgba(120, 200, 255, 0.45);
    transform: translateY(-2px);
}

.module-tab:focus-visible {
    outline: 2px solid rgba(79, 120, 255, 0.7);
    outline-offset: 3px;
}

.module-tab.is-active {
    color: #effbff;
    border-color: rgba(120, 200, 255, 0.85);
    background: linear-gradient(140deg, rgba(80, 200, 255, 0.2), rgba(9, 15, 24, 0.92));
    box-shadow: 0 14px 24px rgba(6, 14, 32, 0.4);
}

.module-tab.is-active::before,
.module-tab:hover::before,
.module-tab:focus-visible::before {
    opacity: 1;
}

.module-tab-panels {
    position: relative;
    z-index: 1;
}

.module-panel {
    display: none;
}

.module-panel.is-active {
    display: block;
}

@keyframes tab-alert-pulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.3); opacity: 1; }
}

.modules {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.6rem;
    position: relative;
    z-index: 1;
}

.module {
    background:
        radial-gradient(circle at 20% 0%, rgba(80, 200, 255, 0.2), rgba(18, 28, 45, 0) 45%),
        linear-gradient(160deg, rgba(16, 26, 40, 0.96), rgba(9, 15, 24, 0.92));
    border: 1px solid rgba(120, 200, 255, 0.18);
    border-radius: 22px;
    padding: 1.7rem 1.7rem 1.9rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-decoration: none;
    color: var(--text-high);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    box-shadow: 0 16px 28px rgba(6, 12, 22, 0.35);
    position: relative;
    overflow: hidden;
}

.module-pending {
    border-color: rgba(255, 189, 89, 0.85);
    box-shadow: 0 0 22px rgba(255, 189, 89, 0.35), 0 16px 28px rgba(6, 12, 22, 0.35);
}

.module::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 24px;
    background: linear-gradient(120deg, rgba(80, 200, 255, 0.4), rgba(20, 60, 120, 0.08));
    opacity: 0.15;
    pointer-events: none;
}

.module:hover,
.module:focus-visible {
    border-color: rgba(79, 160, 255, 0.6);
    transform: translateY(-4px);
    box-shadow: 0 24px 40px rgba(6, 12, 30, 0.55);
}

.module:focus-visible {
    outline: 2px solid rgba(79, 120, 255, 0.7);
    outline-offset: 3px;
}

.module h3 {
    margin: 0;
    font-size: 1.25rem;
    letter-spacing: 0.08em;
}

.module p {
    margin: 0;
    color: var(--text-mid);
}

.module-cta {
    margin-top: auto;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0;
    background: none;
    box-shadow: none;
}

.module-cta::after {
    content: '>';
    font-size: 0.95rem;
    transition: transform 0.15s ease;
}

.module:hover .module-cta::after,
.module:focus-visible .module-cta::after {
    transform: translateX(4px);
}


@media (max-width: 700px) {
    :root { font-size: 17px; }
    .app-header {
        padding: 1.2rem 1.5rem;
        min-height: 72px;
        overflow: visible;
    }
    .panel { padding: 2rem 1.4rem; }
    .dashboard { padding: 2rem 1.4rem; }
}

@media (max-width: 700px) {
    .brand h1 {
        display: none;
    }

    .brand {
        position: absolute;
        left: 0.8rem;
        top: 50%;
        transform: translateY(-50%);
    }

    .brand-logo-mobile {
        display: block;
        width: auto;
        height: 48px;
        max-width: 140px;
        object-fit: contain;
        filter: drop-shadow(0 6px 12px rgba(6, 14, 32, 0.35));
    }

    .app-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .dash-head {
        justify-content: center;
        text-align: center;
    }

    .dash-head .badge {
        margin: 0 auto;
    }

    .dashboard-logo-top {
        margin-bottom: 0.8rem;
    }

    .dashboard-logo-top__img {
        width: min(240px, 80vw);
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
.module-disabled {
    background: rgba(94, 8, 24, 0.92);
    border: 1px solid rgba(255, 112, 112, 0.45);
    color: #ffe9e9;
    cursor: not-allowed;
    pointer-events: none;
}

.module-disabled p {
    color: rgba(255, 233, 233, 0.85);
}

.module-disabled .module-cta {
    color: rgba(255, 186, 186, 0.95);
}

.module-disabled .module-cta::after {
    content: 'x';
    transform: none;
    font-size: 0.9rem;
}
.app-actions {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    position: relative;
}

.app-actions__menu-toggle {
    display: none;
    border: 1px solid rgba(120, 200, 255, 0.22);
    background: rgba(12, 20, 32, 0.75);
    color: var(--text-high);
    border-radius: 999px;
    padding: 0.4rem 1rem;
    font-weight: 600;
    cursor: pointer;
}

.app-actions__list {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

@media (max-width: 700px) {
    .app-actions__menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .app-actions__list {
        position: absolute;
        top: calc(100% + 0.6rem);
        right: 0;
        flex-direction: row;
        align-items: center;
        background: rgba(12, 20, 32, 0.96);
        border: 1px solid rgba(120, 200, 255, 0.18);
        border-radius: 16px;
        padding: 0.5rem 0.6rem;
        box-shadow: var(--shadow-soft);
        gap: 0.5rem;
        display: none;
        z-index: 220;
    }

    .app-actions__list .link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
    }

    .app-actions__list .messaging-launcher {
        width: 44px;
        height: 44px;
    }

    .app-actions.is-open .app-actions__list {
        display: flex;
    }
}

.messaging-shell {
    position: static;
}

.messaging-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(6, 10, 20, 0.75);
    backdrop-filter: blur(3px);
    z-index: 200;
    overflow-y: auto;
}

.messaging-overlay[hidden] {
    display: none;
}

body.messaging-active {
    overflow: hidden;
}

.messaging-launcher {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(71, 90, 133, 0.45);
    color: var(--text-high);
    width: 48px;
    height: 48px;
    padding: 0;
    position: relative;
}

.messaging-launcher .messaging-indicator {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 0 rgba(255, 255, 255, 0);
    transition: box-shadow 0.2s ease, background 0.2s ease;
}

.messaging-launcher[aria-expanded="true"] {
    border-color: var(--accent);
}

.messaging-launcher .icon-mail {
    width: 22px;
    height: 22px;
}

.messaging-launcher .icon-mail {
    width: 22px;
    height: 22px;
}

.icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 0;
    position: relative;
}

.icon-link .icon-back {
    width: 20px;
    height: 20px;
}

.icon-link .sr-only,
.messaging-launcher .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.messaging-launcher.has-unread {
    background: linear-gradient(120deg, #ffcf4a, #ff9600);
    color: #1d1500;
    box-shadow: 0 0 18px rgba(255, 188, 87, 0.65);
}

.messaging-launcher.has-unread .messaging-indicator {
    background: #fff4ce;
    box-shadow: 0 0 14px rgba(255, 220, 125, 0.9);
}

.messaging-panel {
    position: relative;
    width: 860px;
    height: 620px;
    background: rgba(12, 18, 30, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    box-shadow: var(--shadow-strong);
    padding: 1.2rem;
    z-index: 210;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.messaging-panel__actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.messaging-toggle {
    border: 1px solid rgba(12, 25, 45, 0.2);
    background: rgba(50, 196, 255, 0.12);
    color: var(--text-high);
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
}

.messaging-enable.is-on {
    background: rgba(92, 214, 148, 0.16);
    border-color: rgba(92, 214, 148, 0.4);
}

.messaging-enable:not(.is-on) {
    background: rgba(255, 120, 120, 0.16);
    border-color: rgba(255, 120, 120, 0.4);
}

.messaging-panel[hidden] {
    display: none;
}

.messaging-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.messaging-close {
    border: none;
    background: transparent;
    color: var(--text-high);
    font-size: 1.5rem;
    cursor: pointer;
}

.messaging-panel__body {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1rem;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    transition: grid-template-columns 0.2s ease;
}

.messaging-recipients {
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    padding-right: 0.8rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
    transition: opacity 0.2s ease, width 0.2s ease;
}

.messaging-panel.is-collapsed .messaging-panel__body {
    grid-template-columns: 0 1fr;
}

.messaging-panel.is-collapsed .messaging-recipients {
    opacity: 0;
    width: 0;
    padding: 0;
    border: none;
    pointer-events: none;
}

.messaging-recipients__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.6rem;
}

.messaging-recipient-list {
    max-height: none;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
    min-height: 0;
}

.messaging-recipient {
    width: 100%;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    background: rgba(20, 30, 49, 0.8);
    color: var(--text-high);
    padding: 0.65rem 0.75rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.messaging-recipient.is-active {
    border-color: var(--accent);
    background: rgba(50, 196, 255, 0.1);
}

.messaging-recipient-name {
    font-weight: 600;
}

.messaging-recipient-details {
    font-size: 0.85rem;
    color: var(--text-mid);
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
}

.messaging-recipient-preview {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.6);
}

.messaging-unread-badge {
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    font-size: 0.75rem;
    background: #ffcf4a;
    color: #1f1400;
    font-weight: 600;
}

.messaging-thread {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    background: rgba(12, 18, 30, 0.88);
    color: var(--text-high);
    border-radius: 18px;
    padding: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 0;
    height: 100%;
}

.messaging-thread__presence {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-mid);
    display: none;
}

.messaging-messages {
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 14px;
    background: rgba(6, 11, 18, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.04);
    flex: 1;
}

.messaging-bubble {
    max-width: 75%;
    padding: 0.65rem 0.8rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--text-high);
}

.messaging-bubble.is-outgoing {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #031018;
    box-shadow: 0 12px 24px rgba(4, 16, 28, 0.3);
}

.messaging-bubble time {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.65);
}

.messaging-bubble.is-outgoing time {
    color: rgba(3, 9, 16, 0.7);
}

.messaging-form textarea {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem 0.9rem;
    background: rgba(7, 12, 22, 0.95);
    color: var(--text-high);
    font-family: inherit;
    resize: vertical;
    min-height: 70px;
}

.messaging-form textarea:disabled {
    opacity: 0.5;
}

.messaging-form__actions {
    margin-top: 0.6rem;
    text-align: right;
}

.messaging-empty {
    margin: 0;
    color: var(--text-mid);
    font-size: 0.9rem;
}

.messaging-status {
    font-size: 0.8rem;
    color: var(--text-mid);
}

@media (max-width: 720px) {
    .messaging-overlay {
        padding: 1rem;
        align-items: flex-start;
    }

    .messaging-panel {
        width: calc(100vw - 2rem);
        height: calc(100vh - 2rem);
    }

    .messaging-panel__body {
        display: flex;
        flex-direction: column;
        grid-template-columns: 1fr;
    }

    .messaging-recipients {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
        padding-right: 0;
        padding-bottom: 0.8rem;
    }

    .messaging-panel.is-collapsed .messaging-recipients {
        display: none;
    }

    .messaging-panel.is-collapsed .messaging-thread {
        flex: 1;
    }

    .messaging-panel.is-mobile-list .messaging-thread {
        display: none;
    }

    .messaging-panel.is-mobile-thread .messaging-recipients {
        display: none;
    }

    .messaging-thread__head h4,
    .messaging-thread__presence {
        display: none;
    }

    .messaging-toggle {
        display: none;
    }

    .messaging-messages {
        max-height: 240px;
    }

    .messaging-panel.is-mobile-thread .messaging-messages {
        max-height: none;
        flex: 1;
    }

    .messaging-thread {
        width: 100%;
    }

    .messaging-panel.is-collapsed .messaging-thread {
        width: 90%;
        max-width: 90vw;
        align-self: center;
    }

    .messaging-panel.is-mobile-thread .messaging-thread {
        width: 100%;
        max-width: none;
        align-self: stretch;
    }

    .messaging-back {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

.messaging-thread__presence.is-error {
    color: var(--danger);
}



.messaging-thread__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.messaging-thread__head h4 {
    display: none;
}

.messaging-refresh {
    border: 1px solid rgba(12, 25, 45, 0.2);
    background: rgba(50, 196, 255, 0.12);
    color: var(--text-high);
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: none;
}

.messaging-back {
    border: 1px solid rgba(12, 25, 45, 0.2);
    background: rgba(50, 196, 255, 0.12);
    color: var(--text-high);
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
    display: none;
}

.messaging-refresh:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.messaging-thread__presence.is-error {
    color: var(--danger);
}



