/* VANTA — interface base
   Sem frameworks, fontes externas, analytics ou JavaScript obrigatório. */

:root {
    color-scheme: dark;
    --bg: #07090d;
    --panel: #0d1118;
    --panel-2: #111722;
    --panel-3: #151d2a;
    --line: #212b3a;
    --line-soft: #17202d;
    --text: #f3f6fb;
    --muted: #8e9bad;
    --muted-2: #657286;
    --accent: #7c9cff;
    --accent-strong: #a6baff;
    --success: #60d394;
    --warning: #f3bf69;
    --danger: #ff7b86;
    --shadow: 0 24px 80px rgba(0, 0, 0, .36);
    --radius: 18px;
    --radius-sm: 12px;
    font-family:
        Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 15% 10%, rgba(124, 156, 255, .09), transparent 31rem),
        radial-gradient(circle at 85% 90%, rgba(96, 211, 148, .05), transparent 26rem),
        var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.55;
}

a {
    color: var(--accent-strong);
}

button,
input {
    font: inherit;
}

button,
.button {
    min-height: 46px;
    border: 1px solid rgba(124, 156, 255, .55);
    border-radius: 12px;
    padding: 0 18px;
    background:
        linear-gradient(180deg, rgba(124, 156, 255, .22), rgba(124, 156, 255, .12));
    color: var(--text);
    font-weight: 700;
    letter-spacing: .02em;
    cursor: pointer;
    transition:
        transform .15s ease,
        border-color .15s ease,
        background .15s ease;
}

button:hover {
    border-color: var(--accent);
    background:
        linear-gradient(180deg, rgba(124, 156, 255, .3), rgba(124, 156, 255, .16));
}

button:active {
    transform: translateY(1px);
}

button.secondary {
    border-color: var(--line);
    background: rgba(255, 255, 255, .025);
    color: var(--muted);
}

button.danger {
    border-color: rgba(255, 123, 134, .32);
    background: rgba(255, 123, 134, .06);
    color: #ffc2c7;
}

input {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0 14px;
    outline: none;
    background: #090d13;
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .02);
}

input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(124, 156, 255, .12);
}

label {
    display: block;
    margin-bottom: 7px;
    color: #c3cbd7;
    font-size: 13px;
    font-weight: 700;
}

.shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .18em;
}

.wordmark::before {
    content: "";
    width: 9px;
    height: 9px;
    border: 2px solid var(--accent);
    border-radius: 3px;
    transform: rotate(45deg);
    box-shadow: 0 0 18px rgba(124, 156, 255, .45);
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent-strong);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 13px;
}

.notice {
    margin: 0 0 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 13px 14px;
    background: rgba(255, 255, 255, .025);
    color: #cbd2dc;
}

.notice.error {
    border-color: rgba(255, 123, 134, .28);
    background: rgba(255, 123, 134, .055);
    color: #ffc0c6;
}

.notice.success {
    border-color: rgba(96, 211, 148, .25);
    background: rgba(96, 211, 148, .055);
    color: #a9edc8;
}

.auth-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 28px 0;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(380px, .75fr);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: rgba(10, 14, 20, .9);
    box-shadow: var(--shadow);
}

.auth-intro {
    position: relative;
    min-height: 610px;
    padding: 52px;
    border-right: 1px solid var(--line-soft);
    background:
        linear-gradient(140deg, rgba(124, 156, 255, .08), transparent 42%),
        linear-gradient(320deg, rgba(96, 211, 148, .035), transparent 45%),
        #0a0e15;
}

.auth-intro h1 {
    max-width: 650px;
    margin: 110px 0 18px;
    font-size: clamp(38px, 6vw, 72px);
    line-height: .98;
    letter-spacing: -.045em;
}

.auth-intro p {
    max-width: 560px;
    color: var(--muted);
    font-size: 16px;
}

.security-strip {
    position: absolute;
    right: 52px;
    bottom: 48px;
    left: 52px;
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.security-chip {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 10px;
    background: rgba(255, 255, 255, .025);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
}

.auth-card {
    align-self: center;
    padding: 48px;
}

.auth-card h2 {
    margin: 0 0 9px;
    font-size: 30px;
    letter-spacing: -.025em;
}

.auth-card > .muted {
    margin-top: 0;
    margin-bottom: 28px;
}

.field {
    margin-bottom: 17px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 23px;
}

.form-actions button {
    flex: 1;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid rgba(33, 43, 58, .85);
    background: rgba(7, 9, 13, .86);
    backdrop-filter: blur(18px);
}

.topbar-inner {
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.topbar-meta {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--success);
    box-shadow: 0 0 16px rgba(96, 211, 148, .5);
}

.dashboard {
    padding: 42px 0 70px;
}

.hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.hero h1 {
    margin: 0 0 8px;
    font-size: clamp(32px, 5vw, 54px);
    letter-spacing: -.04em;
}

.hero p {
    max-width: 680px;
    margin: 0;
    color: var(--muted);
}

.identity-box {
    min-width: 240px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    background: rgba(255, 255, 255, .02);
}

.identity-box strong {
    display: block;
    margin-top: 3px;
    font-size: 17px;
    letter-spacing: .04em;
}

.grid {
    display: grid;
    gap: 16px;
}

.stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 16px;
}

.stat {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .025), transparent),
        var(--panel);
}

.stat .label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.stat .value {
    display: block;
    margin-top: 8px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -.03em;
}

.stat.disabled .value {
    color: var(--muted-2);
    font-size: 16px;
}

.content-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
}

.panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 21px;
    background: var(--panel);
    box-shadow: 0 12px 38px rgba(0, 0, 0, .14);
}

.panel + .panel {
    margin-top: 16px;
}

.panel h2,
.panel h3 {
    margin-top: 0;
    letter-spacing: -.02em;
}

.panel h2 {
    margin-bottom: 7px;
    font-size: 21px;
}

.panel h3 {
    font-size: 16px;
}

.credential-card {
    margin-bottom: 16px;
    border-color: rgba(96, 211, 148, .3);
    background:
        linear-gradient(140deg, rgba(96, 211, 148, .055), transparent 65%),
        var(--panel);
}

.credential-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.credential-item {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    background: #090d13;
}

.credential-item span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.credential-item code {
    overflow-wrap: anywhere;
    color: #dbe4f1;
    font-size: 12px;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line-soft);
    border-radius: 13px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 670px;
}

th,
td {
    padding: 12px 13px;
    border-bottom: 1px solid var(--line-soft);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

td {
    color: #cbd3de;
    font-size: 13px;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 8px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.badge.ok {
    border-color: rgba(96, 211, 148, .2);
    background: rgba(96, 211, 148, .05);
    color: #9ee8be;
}

.badge.pending {
    border-color: rgba(243, 191, 105, .22);
    background: rgba(243, 191, 105, .05);
    color: #edc781;
}

.events {
    list-style: none;
    margin: 0;
    padding: 0;
}

.events li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line-soft);
}

.events li:last-child {
    border-bottom: 0;
}

.events strong {
    font-size: 12px;
}

.events time {
    color: var(--muted-2);
    font-size: 11px;
}

.footer-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}

@media (max-width: 900px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-intro {
        min-height: 280px;
        padding: 34px;
        border-right: 0;
        border-bottom: 1px solid var(--line-soft);
    }

    .auth-intro h1 {
        margin-top: 68px;
        font-size: 44px;
    }

    .security-strip {
        position: static;
        margin-top: 28px;
    }

    .auth-card {
        padding: 34px;
    }

    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .credential-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .shell {
        width: min(100% - 20px, 1180px);
    }

    .auth-page {
        padding: 10px 0;
        place-items: stretch;
    }

    .auth-shell {
        border-radius: 18px;
    }

    .auth-intro {
        min-height: auto;
        padding: 26px 22px;
    }

    .auth-intro h1 {
        margin-top: 46px;
        font-size: 38px;
    }

    .auth-card {
        padding: 28px 22px;
    }

    .hero {
        display: block;
    }

    .identity-box {
        margin-top: 18px;
    }

    .stats {
        grid-template-columns: 1fr 1fr;
    }

    .topbar-meta .username {
        display: none;
    }

    .dashboard {
        padding-top: 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
/* Dashboard do usuario */

.user-dashboard {
    max-width: 1040px;
}

.user-hero {
    margin-bottom: 34px;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.action-card {
    display: flex;
    min-height: 300px;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .022), transparent),
        var(--panel);
    box-shadow: 0 14px 42px rgba(0, 0, 0, .13);
}

.action-card.primary-action {
    border-color: rgba(124, 156, 255, .34);
    background:
        radial-gradient(circle at 100% 0%, rgba(124, 156, 255, .11), transparent 15rem),
        linear-gradient(180deg, rgba(124, 156, 255, .035), transparent),
        var(--panel);
}

.action-card h2 {
    margin: 0 0 8px;
    font-size: 23px;
    letter-spacing: -.025em;
}

.action-card p:not(.eyebrow) {
    margin: 0;
    color: var(--muted);
}

.action-card button[disabled] {
    cursor: not-allowed;
    opacity: .52;
    border-color: var(--line);
    background: rgba(255, 255, 255, .02);
    color: var(--muted);
}

.action-icon {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #090d13;
    color: var(--accent-strong);
    font-size: 22px;
    font-weight: 400;
}

.privacy-panel,
.session-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin-top: 16px;
}

.privacy-copy {
    max-width: 540px;
}

.privacy-copy h2,
.session-panel h2 {
    margin-bottom: 7px;
}

.privacy-facts {
    display: flex;
    max-width: 360px;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.session-panel form {
    flex: 0 0 auto;
}

@media (max-width: 850px) {
    .action-grid {
        grid-template-columns: 1fr;
    }

    .action-card {
        min-height: 230px;
    }

    .privacy-panel,
    .session-panel {
        align-items: flex-start;
        flex-direction: column;
    }

    .privacy-facts {
        justify-content: flex-start;
    }
}

/* Criacao de salas */

select {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0 13px;
    outline: none;
    background: #090d13;
    color: var(--text);
    font: inherit;
}

select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(124, 156, 255, .12);
}

.room-create-form {
    display: grid;
    gap: 10px;
}

.room-create-form label {
    margin-bottom: -3px;
}

.open-rooms-panel {
    margin-bottom: 16px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.section-heading h2 {
    margin-bottom: 0;
}

.room-list {
    display: grid;
    gap: 10px;
}

.room-row {
    display: grid;
    grid-template-columns: minmax(170px, .8fr) minmax(260px, 1.4fr) auto;
    align-items: center;
    gap: 18px;
    border: 1px solid var(--line-soft);
    border-radius: 13px;
    padding: 14px;
    background: #090d13;
}

.room-row > div:first-child {
    display: grid;
    gap: 3px;
}

.room-row-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.room-phase-note {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 9px;
    color: var(--muted-2);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
    white-space: nowrap;
}

@media (max-width: 850px) {
    .room-row {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .room-phase-note {
        width: fit-content;
    }
}

/* Convite de entrada */

.invite-card {
    margin-bottom: 16px;
    border-color: rgba(124, 156, 255, .32);
    background:
        radial-gradient(circle at 100% 0%, rgba(124, 156, 255, .09), transparent 18rem),
        var(--panel);
}

.invite-url {
    margin-top: 16px;
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 14px;
    background: #090d13;
}

.invite-url span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.invite-url code {
    display: block;
    overflow-wrap: anywhere;
    color: #dbe4f1;
    font-size: 12px;
    user-select: all;
}

.invite-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 12px;
}

.room-row-invite {
    grid-template-columns:
        minmax(170px, .75fr)
        minmax(260px, 1.35fr)
        minmax(160px, auto);
}

.room-invite-form {
    display: flex;
    justify-content: flex-end;
}

.room-invite-form button {
    width: 100%;
    min-width: 160px;
}

@media (max-width: 850px) {
    .room-row-invite {
        grid-template-columns: 1fr;
    }

    .room-invite-form {
        justify-content: flex-start;
    }

    .room-invite-form button {
        width: auto;
    }
}

/* Entrada por convite */

.action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.join-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 28px 0;
}

.join-card {
    width: min(620px, 100%);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 38px;
    background:
        radial-gradient(circle at 100% 0%, rgba(124, 156, 255, .09), transparent 19rem),
        var(--panel);
    box-shadow: var(--shadow);
}

.join-card h1 {
    margin: 12px 0 10px;
    font-size: clamp(34px, 7vw, 54px);
    letter-spacing: -.04em;
}

.join-eyebrow {
    margin-top: 52px;
}

.invite-state {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 22px 0;
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 13px 14px;
    background: #090d13;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.invite-state.ready {
    border-color: rgba(96, 211, 148, .24);
    color: #a9edc8;
}

.invite-state.invalid .status-dot {
    background: var(--danger);
    box-shadow: 0 0 16px rgba(255, 123, 134, .45);
}

.join-auth-box {
    margin-top: 18px;
    border-top: 1px solid var(--line-soft);
    padding-top: 22px;
}

.join-auth-box h2 {
    margin: 0 0 7px;
}

.join-summary {
    display: grid;
    gap: 3px;
    margin-top: 20px;
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 14px;
    background: #090d13;
}

.join-summary strong {
    font-size: 19px;
    letter-spacing: .09em;
}

.join-help {
    margin-top: 28px;
    border-top: 1px solid var(--line-soft);
    padding-top: 18px;
}

@media (max-width: 620px) {
    .join-shell {
        place-items: stretch;
        padding: 10px 0;
    }

    .join-card {
        border-radius: 18px;
        padding: 28px 22px;
    }

    .join-eyebrow {
        margin-top: 38px;
    }
}

/* Chat */

.wordmark-link {
    text-decoration: none;
}

.room-actions {
    display: grid;
    gap: 8px;
}

.room-actions .button,
.room-actions button {
    width: 100%;
}

.room-screen {
    padding: 38px 0 70px;
}

.room-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
}

.room-head > div:first-child {
    max-width: 760px;
}

.room-head h1 {
    margin: 0 0 8px;
    font-size: clamp(34px, 5vw, 56px);
    letter-spacing: -.04em;
}

.room-head p {
    margin-bottom: 0;
}

.room-status-box {
    min-width: 190px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 15px 17px;
    background: var(--panel);
}

.room-status-box strong {
    display: block;
    margin: 3px 0;
    font-size: 18px;
    letter-spacing: .04em;
}

.room-status-active {
    color: var(--success);
}

.room-status-waiting {
    color: var(--warning);
}

.room-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 16px;
}

.room-chat-shell {
    display: grid;
    min-height: 640px;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    background:
        radial-gradient(circle at 50% 32%, rgba(124, 156, 255, .045), transparent 24rem),
        var(--panel);
    box-shadow: 0 18px 55px rgba(0, 0, 0, .16);
}

.room-chat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--line-soft);
    padding: 15px 18px;
}

.room-chat-top > div {
    display: grid;
    gap: 2px;
}

.room-chat-empty {
    display: grid;
    max-width: 560px;
    place-items: center;
    align-self: center;
    justify-self: center;
    padding: 35px;
    text-align: center;
}

.room-chat-empty h2 {
    margin: 2px 0 8px;
    font-size: 27px;
    letter-spacing: -.025em;
}

.room-chat-empty p {
    margin: 0;
    color: var(--muted);
}

.room-lock-mark {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    margin-bottom: 18px;
    border: 1px solid rgba(124, 156, 255, .35);
    border-radius: 18px;
    background: rgba(124, 156, 255, .055);
    color: var(--accent-strong);
    font-size: 27px;
    transform: rotate(45deg);
}


.room-composer-disabled {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-top: 1px solid var(--line-soft);
    padding: 14px 16px;
    background: #090d13;
}

.room-composer-disabled > div {
    display: grid;
    gap: 2px;
}

.room-composer-disabled strong {
    color: #cbd3de;
    font-size: 13px;
}

.room-composer-disabled button {
    cursor: not-allowed;
    opacity: .45;
}

.room-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.room-sidebar .panel {
    margin: 0;
}

.participant-list {
    display: grid;
    gap: 9px;
}

.participant-row {
    display: grid;
    grid-template-columns: 38px 1fr auto;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    padding: 10px;
    background: #090d13;
}

.participant-row > div {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.participant-row strong {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.participant-avatar {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 900;
}

.room-facts {
    margin: 0;
}

.room-facts > div {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line-soft);
}

.room-facts > div:last-child {
    border-bottom: 0;
}

.room-facts dt {
    color: var(--muted-2);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.room-facts dd {
    margin: 0;
    color: #cbd3de;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.room-back {
    width: 100%;
}

.room-empty-state {
    max-width: 650px;
    margin: 12vh auto 0;
    text-align: center;
}

.room-empty-state h1 {
    margin: 0 0 8px;
    font-size: clamp(36px, 7vw, 64px);
    letter-spacing: -.045em;
}

.room-empty-state .button {
    margin-top: 20px;
}

@media (max-width: 900px) {
    .room-layout {
        grid-template-columns: 1fr;
    }

    .room-chat-shell {
        min-height: 560px;
    }

    .room-sidebar {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .room-back {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    .room-head {
        display: block;
    }

    .room-status-box {
        margin-top: 18px;
    }

    .room-sidebar {
        grid-template-columns: 1fr;
    }

    .room-back {
        grid-column: auto;
    }

    .room-chat-shell {
        min-height: 520px;
        border-radius: 18px;
    }

    .room-chat-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .room-chat-empty {
        padding: 26px 18px;
    }

    .room-composer-disabled {
        align-items: flex-start;
        flex-direction: column;
    }

    .room-composer-disabled button {
        width: 100%;
    }
}

/* Estado da chave local */

.crypto-state {
    margin: 12px 0 0;
}

.crypto-state.success {
    border-color: rgba(96, 211, 148, .25);
    background: rgba(96, 211, 148, .055);
    color: #a9edc8;
}

.crypto-state.error {
    border-color: rgba(255, 123, 134, .28);
    background: rgba(255, 123, 134, .055);
    color: #ffc0c6;
}

.room-key-state {
    margin-top: 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.room-key-state.room-key-ok {
    border-color: rgba(96, 211, 148, .24);
    background: rgba(96, 211, 148, .04);
    color: #9ee8be;
}

.room-key-state.room-key-missing {
    border-color: rgba(255, 123, 134, .25);
    background: rgba(255, 123, 134, .04);
    color: #ffc0c6;
}

/* Criptografia local */

.room-key-state.room-key-error {
    border-color: rgba(255, 123, 134, .28);
    background: rgba(255, 123, 134, .055);
    color: #ffc0c6;
}

.crypto-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.crypto-facts span {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 8px;
    background: #090d13;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
}

.crypto-facts-panel h2 {
    margin-bottom: 12px;
}

/* PATCH — robustez do fluxo de convite */

.invite-state.checking .status-dot {
    background: var(--warning);
    box-shadow: 0 0 16px rgba(243, 191, 105, .42);
}

.action-link.is-disabled {
    pointer-events: none;
    cursor: not-allowed;
    opacity: .48;
    border-color: var(--line);
    background: rgba(255, 255, 255, .02);
    color: var(--muted);
}

.invite-login-context {
    margin-bottom: 22px;
    border-color: rgba(124, 156, 255, .28);
    background: rgba(124, 156, 255, .05);
}

/* Compositor */

.room-chat-system {
    padding-bottom: 24px;
}

.room-send-status {
    width: 100%;
    margin-top: 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    background: #090d13;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.room-send-status.ok {
    border-color: rgba(96, 211, 148, .24);
    background: rgba(96, 211, 148, .04);
    color: #9ee8be;
}

.room-send-status.error {
    border-color: rgba(255, 123, 134, .25);
    background: rgba(255, 123, 134, .04);
    color: #ffc0c6;
}

.room-send-status.working {
    border-color: rgba(243, 191, 105, .24);
    background: rgba(243, 191, 105, .04);
    color: #edc781;
}

.room-composer {
    display: grid;
    gap: 10px;
    border-top: 1px solid var(--line-soft);
    padding: 14px 16px 16px;
    background: #090d13;
}

.room-composer textarea {
    width: 100%;
    min-height: 82px;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 12px 13px;
    outline: none;
    background: #070a0f;
    color: var(--text);
    font: inherit;
    line-height: 1.5;
}

.room-composer textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(124, 156, 255, .12);
}

.room-composer textarea:disabled {
    cursor: not-allowed;
    opacity: .52;
}

.room-composer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.room-composer-bar .over-limit {
    color: var(--danger);
}

.room-composer-bar button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

@media (max-width: 620px) {
    .room-composer-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .room-composer-bar button {
        width: 100%;
    }
}

/* Conexao do chat */

.room-poll-status {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 9px;
    margin-top: 9px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 9px 11px;
    background: #090d13;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
}

.room-poll-status.ready {
    border-color: rgba(96, 211, 148, .2);
    color: #9ee8be;
}

.room-poll-status.waiting .status-dot {
    background: var(--warning);
    box-shadow: 0 0 16px rgba(243, 191, 105, .4);
}

.room-poll-status.error {
    border-color: rgba(255, 123, 134, .23);
    color: #ffc0c6;
}

.room-poll-status.error .status-dot {
    background: var(--danger);
    box-shadow: 0 0 16px rgba(255, 123, 134, .4);
}

.encrypted-stream {
    display: grid;
    align-content: start;
    gap: 8px;
    min-height: 130px;
    max-height: 250px;
    overflow-y: auto;
    border-top: 1px solid var(--line-soft);
    padding: 12px 16px;
    background: rgba(7, 10, 15, .55);
}

.encrypted-stream-empty {
    display: grid;
    min-height: 90px;
    place-items: center;
    text-align: center;
}

.encrypted-envelope {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    padding: 10px 12px;
    background: #090d13;
}

.encrypted-envelope > div {
    display: grid;
    gap: 2px;
}

.encrypted-envelope strong {
    font-size: 12px;
}

@media (max-width: 620px) {
    .encrypted-envelope {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* Mensagens */

.message-stream {
    display: flex;
    min-height: 220px;
    max-height: 430px;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    border-top: 1px solid var(--line-soft);
    padding: 16px;
    background:
        linear-gradient(
            180deg,
            rgba(7, 10, 15, .38),
            rgba(7, 10, 15, .68)
        );
}

.message-stream-empty {
    display: grid;
    min-height: 160px;
    place-items: center;
    text-align: center;
}

.chat-message {
    width: fit-content;
    max-width: min(78%, 620px);
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 10px 12px;
    background: #0a0e15;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}

.chat-message.own {
    align-self: flex-end;
    border-color: rgba(124, 156, 255, .28);
    background:
        linear-gradient(
            145deg,
            rgba(124, 156, 255, .075),
            rgba(124, 156, 255, .025)
        ),
        #0a0e15;
}

.chat-message.peer {
    align-self: flex-start;
}

.chat-message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 5px;
}

.chat-message-header strong {
    font-size: 11px;
    letter-spacing: .025em;
}

.chat-message p {
    margin: 0;
    color: #edf2f8;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.55;
}

@media (max-width: 620px) {
    .chat-message {
        max-width: 92%;
    }

    .chat-message-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }
}

/* Confirmacao de entrega */

.message-delivery-state {
    display: block;
    margin-top: 6px;
    color: var(--muted-2);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .035em;
    text-align: right;
    text-transform: uppercase;
}

.message-delivery-state.delivered {
    color: var(--success);
}

.chat-message.own .message-delivery-state::before {
    content: "● ";
    font-size: 7px;
    vertical-align: 1px;
}

/* Encerramento da sala */

.room-danger-zone {
    border-color: rgba(255, 123, 134, .24);
    background:
        linear-gradient(
            145deg,
            rgba(255, 123, 134, .045),
            transparent 60%
        ),
        var(--panel);
}

.room-danger-zone h2 {
    margin-bottom: 7px;
}

.room-danger-zone .danger {
    width: 100%;
    margin-top: 12px;
}

.room-destroy-status {
    min-height: 0;
    margin-top: 10px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.room-destroy-status:empty {
    display: none;
}

.room-destroy-status.ok {
    color: var(--success);
}

.room-destroy-status.error {
    color: #ffc0c6;
}

.room-destroy-status.working {
    color: var(--warning);
}

/* Limpeza local */

.room-local-exit {
    border-color: rgba(124, 156, 255, .2);
}

.room-local-exit h2 {
    margin-bottom: 7px;
}

.room-local-exit .secondary {
    width: 100%;
    margin-top: 12px;
}

.room-local-exit-status {
    margin-top: 9px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.room-local-exit-status:empty {
    display: none;
}

.room-local-exit-status.ok {
    color: var(--success);
}

.room-local-exit-status.error {
    color: #ffc0c6;
}

.room-back-note {
    margin: -8px 4px 0;
    text-align: center;
    line-height: 1.45;
}

/* Expiracao automatica */


/* Anexos e envio por Enter */

.room-composer-help {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.room-composer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.room-composer-actions button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.attachment-card {
    display: grid;
    gap: 7px;
    min-width: min(320px, 70vw);
    margin-top: 4px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    padding: 10px;
    background: rgba(0, 0, 0, .16);
}

.attachment-name {
    overflow-wrap: anywhere;
    font-size: 12px;
}

.attachment-open,
.attachment-download-ready {
    width: fit-content;
    margin-top: 3px;
}

.attachment-preview {
    display: block;
    max-width: min(100%, 520px);
    max-height: 420px;
    border: 1px solid var(--line);
    border-radius: 10px;
    object-fit: contain;
    background: #070a0f;
}

@media (max-width: 620px) {
    .room-composer-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .room-composer-actions button,
    .attachment-download-ready {
        width: 100%;
    }

    .attachment-card {
        min-width: 0;
        width: 100%;
    }
}


/* Chat simplificado */

.chat-screen {
    width: min(980px, calc(100% - 32px));
    padding: 16px 0 24px;
}

.chat-app {
    position: relative;
    display: grid;
    height: calc(100vh - 104px);
    height: calc(100dvh - 104px);
    min-height: 560px;
    max-height: 900px;
    grid-template-rows:
        auto
        auto
        minmax(0, 1fr)
        auto;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--panel);
    box-shadow: 0 18px 55px rgba(0, 0, 0, .18);
}

.chat-header {
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line-soft);
    padding: 12px 14px 12px 18px;
    background: rgba(9, 13, 19, .86);
}

.chat-room-info {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.chat-room-info > strong {
    overflow: hidden;
    color: var(--text);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-room-meta {
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-room-tools {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 12px;
}

.room-poll-status.chat-connection {
    width: auto;
    margin: 0;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}

.room-poll-status.chat-connection.ready {
    color: var(--muted);
}

.chat-options {
    position: relative;
}

.chat-options > summary {
    min-height: 38px;
    list-style: none;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 9px 11px;
    background: rgba(255, 255, 255, .025);
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    cursor: pointer;
    user-select: none;
}

.chat-options > summary::-webkit-details-marker {
    display: none;
}

.chat-options[open] > summary {
    border-color: rgba(124, 156, 255, .42);
    color: var(--text);
}

.chat-options-panel {
    position: absolute;
    z-index: 30;
    top: calc(100% + 8px);
    right: 0;
    display: grid;
    width: min(300px, calc(100vw - 32px));
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px;
    background: #0b1017;
    box-shadow: var(--shadow);
}

.chat-option-link {
    display: flex;
    min-height: 42px;
    align-items: center;
    border-radius: 10px;
    padding: 0 11px;
    color: #cbd3de;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.chat-option-link:hover {
    background: rgba(255, 255, 255, .035);
}

.chat-option-divider {
    height: 1px;
    margin: 2px 0;
    background: var(--line-soft);
}

.chat-option-button {
    width: 100%;
    min-height: 42px;
    text-align: left;
}

.chat-option-note {
    margin: -2px 3px 2px;
    color: var(--muted-2);
    font-size: 10px;
    line-height: 1.4;
}

.chat-system-stack {
    display: grid;
    gap: 0;
    background: #090d13;
}

.chat-system-status {
    margin: 10px 14px 0;
}

.chat-system-status:empty,
.room-key-state.room-key-ok,
.room-send-status.ok {
    display: none;
}

.chat-system-stack:empty {
    display: none;
}

.message-stream {
    min-height: 0;
    max-height: none;
    border-top: 0;
    padding: 18px;
    scroll-behavior: smooth;
}

.message-stream-empty {
    min-height: 100%;
}

.chat-message {
    max-width: min(76%, 620px);
    border-radius: 16px;
    padding: 9px 11px;
    box-shadow: none;
}

.chat-message-header {
    margin-bottom: 4px;
}

.chat-message-header strong {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.chat-message-header .small {
    color: var(--muted-2);
    font-size: 10px;
}

.message-delivery-state {
    margin-top: 4px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.chat-message.own .message-delivery-state::before {
    content: "";
}

.scroll-latest {
    position: absolute;
    z-index: 12;
    right: 18px;
    bottom: 96px;
    min-height: 34px;
    border-color: var(--line);
    border-radius: 999px;
    padding: 0 12px;
    background: #111722;
    color: #cbd3de;
    font-size: 11px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
}

.room-composer {
    gap: 8px;
    padding: 10px 12px 12px;
}

.room-composer textarea {
    min-height: 52px;
    max-height: 130px;
    resize: none;
    border-radius: 14px;
    padding: 13px 14px;
}

.room-composer-bar {
    display: grid;
    grid-template-columns:
        auto
        minmax(0, 1fr)
        auto
        auto;
    gap: 9px;
}

.composer-shortcut {
    align-self: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-counter {
    align-self: center;
    white-space: nowrap;
}

.message-counter:empty {
    display: none;
}

.composer-attach,
.composer-send {
    min-height: 40px;
    padding: 0 14px;
    font-size: 11px;
}

.attachment-card {
    min-width: min(300px, 68vw);
}

.attachment-open,
.attachment-download-ready {
    min-height: 38px;
    padding: 0 12px;
    font-size: 11px;
}

.room-local-exit-status,
.room-destroy-status {
    margin: 2px 3px 0;
}

@media (max-width: 700px) {
    .chat-screen {
        width: 100%;
        padding: 0;
    }

    .chat-app {
        height: calc(100vh - 62px);
        height: calc(100dvh - 62px);
        min-height: 480px;
        max-height: none;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    .chat-header {
        min-height: 62px;
        gap: 9px;
        padding: 9px 10px 9px 13px;
    }

    .chat-room-meta {
        max-width: 58vw;
    }

    .chat-room-tools {
        gap: 8px;
    }

    .room-poll-status.chat-connection > span:last-child {
        display: none;
    }

    .chat-options > summary {
        min-height: 36px;
        padding: 8px 9px;
    }

    .message-stream {
        padding: 12px;
    }

    .chat-message {
        max-width: 88%;
    }

    .chat-message-header {
        align-items: center;
        flex-direction: row;
        gap: 10px;
    }

    .room-composer {
        padding: 9px 10px 10px;
    }

    .room-composer-bar {
        grid-template-columns:
            auto
            minmax(0, 1fr)
            auto;
    }

    .composer-shortcut {
        display: none;
    }

    .message-counter {
        justify-self: end;
    }

    .composer-attach,
    .composer-send {
        min-height: 40px;
        padding: 0 12px;
    }

    .scroll-latest {
        right: 12px;
        bottom: 90px;
    }

    .attachment-card {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 420px) {
    .chat-room-meta {
        max-width: 50vw;
    }

    .chat-message {
        max-width: 92%;
    }

    .message-counter {
        display: none;
    }

    .room-composer-bar {
        grid-template-columns:
            auto
            1fr;
    }

    .composer-send {
        justify-self: stretch;
    }
}

/* ARKAEL — fase de configuracao visual, sem interferencia no protocolo do chat. */
body.brand-theme--navy {
    --bg: #060b17;
    --panel: #0c1425;
    --panel-2: #101b30;
    --panel-3: #15213a;
    --line: #25314b;
    --line-soft: #192640;
    --accent: #709cff;
    --accent-strong: #b6caff;
    background:
        radial-gradient(circle at 12% 8%, rgba(30, 74, 160, .15), transparent 34rem),
        radial-gradient(circle at 88% 90%, rgba(40, 67, 125, .075), transparent 32rem),
        var(--bg);
}
body.brand-theme--slate {
    --bg: #090b0e;
    --panel: #11151a;
    --panel-2: #171c23;
    --panel-3: #202833;
    --line: #303844;
    --line-soft: #202833;
    --accent: #a5b4ce;
    --accent-strong: #e1e8f5;
}
body.brand-theme--steel {
    --bg: #071018;
    --panel: #101d27;
    --panel-2: #152733;
    --panel-3: #1b3241;
    --line: #294355;
    --line-soft: #1d3444;
    --accent: #64bad7;
    --accent-strong: #b1e8ef;
}

.brand-lockup {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    vertical-align: middle;
    text-decoration: none;
    border-radius: 10px;
}
.brand-lockup img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
}
.brand-lockup--full { width: 152px; }
.brand-lockup--crest { width: 39px; height: 39px; }
.brand-lockup--blue {
    background: #f7f4ed;
    padding: 7px;
}
.brand-lockup--blue.brand-lockup--crest { width: 45px; height: 45px; }
.auth-intro .brand-lockup--full {
    width: clamp(180px, 22vw, 285px);
}
.auth-intro .brand-lockup--crest { width: 78px; height: 78px; }
.auth-intro h1 { margin-top: 86px; }
.join-card .brand-lockup--full { width: 168px; margin-bottom: 14px; }
.join-card .brand-lockup--crest { width: 62px; height: 62px; margin-bottom: 16px; }
.topbar .brand-lockup:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 5px; }

/* Painel de identidade: controles nativos, sem JavaScript ou CSS inline. */
.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 30px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}
.admin-tabs a {
    padding: 10px 17px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
    text-decoration: none;
}
.admin-tabs a:hover, .admin-tabs a[aria-current="page"] {
    border-color: var(--line);
    color: var(--text);
    background: rgba(255, 255, 255, .045);
}
.brand-settings-hero { margin-bottom: 25px; }
.brand-settings-panel { margin: 0 0 18px; padding: 26px; }
.brand-settings-panel h2 { margin-top: 0; }
.brand-settings-panel > .muted { margin-bottom: 22px; }
.brand-assets-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
    margin: 20px 0 24px;
}
.brand-asset-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 6px;
}
.brand-asset-card strong { font-size: 12px; font-weight: 700; }
.brand-asset-card .small { font-size: 11px; }
.brand-asset-frame {
    display: flex;
    min-width: 0;
    height: 150px;
    align-items: center;
    justify-content: center;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #050d1e;
}
.brand-asset-frame--light { background: #f7f4ed; }
.brand-asset-frame img { display: block; width: 100%; max-height: 112px; object-fit: contain; }
.brand-upload-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.brand-upload-form .field { flex: 1 1 230px; margin: 0; }
.brand-upload-form button { flex: 0 1 auto; }
.brand-settings-panel select,
.brand-settings-panel textarea,
.brand-settings-panel input[type="file"] {
    display: block;
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 11px 14px;
    outline: none;
    background: #090d13;
    color: var(--text);
    font: inherit;
}
.brand-settings-panel textarea { min-height: 100px; resize: vertical; }
.brand-settings-panel input[type="file"] { padding: 9px; font-size: 12px; }
.brand-settings-panel select:focus,
.brand-settings-panel textarea:focus,
.brand-settings-panel input[type="file"]:focus { border-color: var(--accent); }
.brand-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.brand-settings-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.brand-settings-actions .button.secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-color: var(--line);
    background: rgba(255, 255, 255, .025);
    color: var(--muted);
    text-decoration: none;
}
@media (max-width: 900px) {
    .brand-assets-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
    .brand-form-grid { grid-template-columns: 1fr; }
    .brand-settings-panel { padding: 18px; }
    .brand-assets-grid { gap: 10px; }
    .brand-asset-frame { height: 128px; padding: 12px; }
    .brand-lockup--full { width: 118px; }
    .auth-intro .brand-lockup--full { width: 205px; }
    .auth-intro .brand-lockup--crest { width: 65px; height: 65px; }
    .auth-intro h1 { margin-top: 34px; }
    .brand-upload-form button { width: 100%; }
    .brand-settings-actions > * { width: 100%; }
}

/* ========================================================================== 
   ARKAEL / STRATEGIC INTERFACE — PHASE: VISUAL MODERNIZATION
   Visual-only additive layer. Existing rules, markup, forms, hooks,
   authentication, chat protocol, message behavior and brand settings retained.
   No external fonts, scripts, assets or network requests.
   ========================================================================== */

/* 01 / DESIGN SYSTEM — three existing, administrator-selectable palettes. */
body {
    --bg: #07101d;
    --panel: #0d1929;
    --panel-2: #121f31;
    --panel-3: #1a2b41;
    --line: #293a50;
    --line-soft: #203047;
    --text: #eef3f8;
    --muted: #9aaabe;
    --muted-2: #70849c;
    --accent: #86a8d4;
    --accent-strong: #d1e1f2;
    --success: #79c4a8;
    --warning: #e6bc7c;
    --danger: #e88991;
    --shadow: 0 28px 80px rgba(0, 3, 12, .48);
    --radius: 10px;
    --radius-sm: 7px;
    --operational-blue: rgba(121, 163, 212, .42);
    --grid-ink: rgba(130, 163, 198, .035);
    --surface-recessed: #091421;
    --focus-halo: rgba(134, 168, 212, .17);
    color: var(--text);
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse at 72% -12%, rgba(43, 85, 133, .17), transparent 46%),
        radial-gradient(ellipse at 0% 86%, rgba(39, 78, 117, .07), transparent 50%),
        linear-gradient(to right, var(--grid-ink) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-ink) 1px, transparent 1px);
    background-size: auto, auto, 80px 80px, 80px 80px;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

body.brand-theme--navy {
    --bg: #07101d;
    --panel: #0d1929;
    --panel-2: #121f31;
    --panel-3: #1a2b41;
    --line: #293a50;
    --line-soft: #203047;
    --accent: #86a8d4;
    --accent-strong: #d1e1f2;
    --operational-blue: rgba(121, 163, 212, .42);
    --grid-ink: rgba(130, 163, 198, .035);
    --surface-recessed: #091421;
    --focus-halo: rgba(134, 168, 212, .17);
    background-image:
        radial-gradient(ellipse at 72% -12%, rgba(43, 85, 133, .17), transparent 46%),
        radial-gradient(ellipse at 0% 86%, rgba(39, 78, 117, .07), transparent 50%),
        linear-gradient(to right, var(--grid-ink) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-ink) 1px, transparent 1px);
    background-size: auto, auto, 80px 80px, 80px 80px;
}

body.brand-theme--slate {
    --bg: #0c1118;
    --panel: #141c26;
    --panel-2: #1a2530;
    --panel-3: #253442;
    --line: #334251;
    --line-soft: #283541;
    --accent: #b2c1d0;
    --accent-strong: #ebf0f6;
    --operational-blue: rgba(172, 191, 211, .36);
    --grid-ink: rgba(162, 175, 193, .027);
    --surface-recessed: #101822;
    --focus-halo: rgba(172, 191, 211, .15);
    background-image:
        radial-gradient(ellipse at 72% -12%, rgba(99, 113, 133, .11), transparent 46%),
        linear-gradient(to right, var(--grid-ink) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-ink) 1px, transparent 1px);
    background-size: auto, 80px 80px, 80px 80px;
}

body.brand-theme--steel {
    --bg: #08141b;
    --panel: #11222a;
    --panel-2: #172b34;
    --panel-3: #203743;
    --line: #2c4753;
    --line-soft: #213a46;
    --accent: #80b9c4;
    --accent-strong: #cfeced;
    --operational-blue: rgba(119, 181, 192, .39);
    --grid-ink: rgba(141, 192, 197, .028);
    --surface-recessed: #0b1a22;
    --focus-halo: rgba(128, 185, 196, .16);
    background-image:
        radial-gradient(ellipse at 72% -12%, rgba(45, 116, 128, .15), transparent 46%),
        linear-gradient(to right, var(--grid-ink) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-ink) 1px, transparent 1px);
    background-size: auto, 80px 80px, 80px 80px;
}

::selection { background: rgba(137, 171, 210, .28); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: var(--accent-strong); text-underline-offset: 3px; }
a:hover { color: #fff; }
h1, h2, h3 { color: #f2f5fa; text-wrap: balance; }
button, input, select, textarea { font-family: inherit; }
button, .button, input, select, textarea { transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease, color .15s ease; }

/* Restrained command buttons. Keep native behavior, names and handlers. */
button, .button {
    min-height: 43px;
    border: 1px solid rgba(153, 186, 220, .53);
    border-radius: 6px;
    padding: 0 17px;
    color: #f5f8fc;
    background: linear-gradient(180deg, #2a4668 0%, #203855 100%);
    box-shadow: inset 0 1px 0 rgba(245, 249, 255, .08);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .085em;
    text-transform: uppercase;
}
button:hover:not(:disabled), .button:hover {
    border-color: var(--accent-strong);
    color: #fff;
    background: linear-gradient(180deg, #345579 0%, #274361 100%);
}
button.secondary, .button.secondary {
    border-color: var(--line);
    color: #c9d5e3;
    background: rgba(255, 255, 255, .022);
    box-shadow: none;
}
button.secondary:hover:not(:disabled), .button.secondary:hover {
    border-color: var(--operational-blue);
    background: rgba(142, 174, 211, .09);
    color: #fff;
}
button.danger, .button.danger {
    border-color: rgba(232, 137, 145, .35);
    background: rgba(232, 137, 145, .065);
    color: #f0acb1;
    box-shadow: none;
}
button.danger:hover:not(:disabled) { border-color: rgba(232, 137, 145, .64); background: rgba(232, 137, 145, .11); }
button:disabled, .button[aria-disabled="true"] { box-shadow: none; cursor: not-allowed; filter: saturate(.65); }
input, select, textarea,
.brand-settings-panel select,
.brand-settings-panel textarea,
.brand-settings-panel input[type="file"] {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-recessed);
    color: var(--text);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .15);
}
input:focus, select:focus, textarea:focus,
.brand-settings-panel select:focus,
.brand-settings-panel textarea:focus,
.brand-settings-panel input[type="file"]:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-halo);
}
input::placeholder, textarea::placeholder { color: #71849b; opacity: 1; }
label { color: #becbd9; font-size: 12px; font-weight: 650; letter-spacing: .015em; }

.shell { width: min(1230px, calc(100% - 64px)); }
.eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent-strong);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .19em;
}
.eyebrow::before { content: ""; display: inline-block; flex: 0 0 16px; height: 1px; background: var(--accent); }
.small { font-size: 12px; }
.muted { color: var(--muted); }
.notice {
    border-radius: 6px;
    background: rgba(15, 31, 49, .9);
    border-left: 2px solid var(--accent);
    font-size: 12px;
}
.notice.error { border-left-color: var(--danger); }
.notice.success { border-left-color: var(--success); }
.badge {
    border-radius: 4px;
    border-color: var(--line);
    padding: 5px 8px;
    color: #a6b8cd;
    background: rgba(141, 173, 209, .035);
    font-size: 10px;
    line-height: 1.3;
    letter-spacing: .075em;
    text-transform: uppercase;
}
.badge.ok { border-color: rgba(121, 196, 168, .33); background: rgba(121, 196, 168, .07); color: #9cd9c0; }
.badge.pending { border-color: rgba(230, 188, 124, .29); background: rgba(230, 188, 124, .075); color: #e9c68d; }
.status-dot { width: 7px; height: 7px; flex: 0 0 7px; background: var(--success); box-shadow: 0 0 0 3px rgba(121, 196, 168, .1); }

/* 02 / AUTHENTICATION — controlled, architectural entry point. */
.auth-page { padding: 38px 0; }
.auth-page .auth-shell {
    width: min(1250px, 100%);
    grid-template-columns: minmax(0, 1.1fr) minmax(380px, .72fr);
    border: 1px solid #34465c;
    border-radius: 9px;
    background: #0c1625;
    box-shadow: 0 46px 100px rgba(0, 2, 9, .55), 0 0 0 1px rgba(4, 11, 19, .7);
}
.auth-intro {
    isolation: isolate;
    overflow: hidden;
    min-height: 640px;
    padding: 52px 56px;
    border-right: 1px solid #304055;
    background:
        radial-gradient(ellipse at 105% 49%, rgba(55, 97, 150, .14), transparent 53%),
        linear-gradient(145deg, rgba(24, 45, 68, .16), transparent 48%),
        #0b1829;
}
.auth-intro::before {
    content: "";
    pointer-events: none;
    position: absolute;
    z-index: 0;
    width: 750px;
    height: 750px;
    top: 28%;
    left: 33%;
    border: 1px solid rgba(130, 169, 211, .11);
    border-radius: 50%;
    background:
        repeating-radial-gradient(circle at center, transparent 0 82px, rgba(134, 168, 212, .115) 83px, transparent 84px, transparent 112px),
        linear-gradient(90deg, transparent calc(50% - .5px), rgba(146, 176, 207, .13) 50%, transparent calc(50% + .5px)),
        linear-gradient(0deg, transparent calc(50% - .5px), rgba(146, 176, 207, .13) 50%, transparent calc(50% + .5px));
    opacity: .52;
}
.auth-intro::after {
    content: "";
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    height: 4px;
    width: 126px;
    background: linear-gradient(90deg, var(--accent), transparent);
}
.auth-intro > :not(.security-strip) { position: relative; z-index: 1; }
.auth-intro .brand-lockup--full { width: clamp(170px, 19vw, 252px); }
.auth-intro .brand-lockup--crest { width: 78px; height: 78px; }
.auth-intro h1 {
    max-width: 620px;
    margin: 129px 0 24px;
    font-size: clamp(38px, 4.5vw, 65px);
    font-weight: 620;
    line-height: 1.04;
    letter-spacing: -.046em;
}
.auth-intro > p {
    max-width: 510px;
    color: #9cacbf;
    font-size: 14px;
    line-height: 1.75;
}
.security-strip { z-index: 1; right: 56px; bottom: 42px; left: 56px; gap: 8px; }
.security-chip {
    border-color: rgba(143, 173, 204, .25);
    border-radius: 4px;
    background: rgba(6, 17, 31, .52);
    color: #a9bed2;
    font-size: 9px;
    line-height: 1.2;
    padding: 8px 10px;
    letter-spacing: .095em;
}
.security-chip::before { content: "/"; margin-right: 8px; color: var(--accent); }
.auth-card { padding: clamp(30px, 4.2vw, 62px); }
.auth-card .eyebrow { margin-bottom: 15px; }
.auth-card h2 { font-size: 32px; font-weight: 630; letter-spacing: -.038em; }
.auth-card > .muted { margin-bottom: 30px; max-width: 330px; line-height: 1.75; font-size: 13px; }
.auth-card .field { margin-bottom: 20px; }
.auth-card .field label { margin-bottom: 8px; }
.auth-card input { min-height: 52px; padding-inline: 15px; }
.auth-card .form-actions { margin-top: 26px; }
.auth-card .form-actions button { min-height: 48px; }
.auth-card form + form { margin-top: 12px; }

/* 03 / TOP BAR + SHELL — instrument-panel navigation. */
.topbar {
    border-bottom: 1px solid var(--line);
    background: rgba(6, 14, 25, .95);
    box-shadow: 0 8px 30px rgba(1, 6, 16, .12);
    backdrop-filter: blur(17px);
}
.topbar::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--operational-blue), transparent);
    opacity: .48;
    pointer-events: none;
}
.topbar-inner { min-height: 74px; }
.topbar .brand-lockup--crest { width: 45px; height: 45px; }
.topbar .brand-lockup--full { width: 158px; }
.brand-lockup { border-radius: 3px; }
.brand-lockup--blue { background: #f2f0eb; border-radius: 3px; }
.topbar-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #b0c0d0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.topbar-meta .username {
    padding: 8px 0 8px 13px;
    border-left: 1px solid var(--line);
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 11px;
    font-weight: 500;
    color: #d3dce9;
    letter-spacing: .025em;
    text-transform: none;
}
.dashboard { padding-top: 49px; padding-bottom: 84px; }
.hero { align-items: center; margin-bottom: 31px; }
.hero h1 { margin-bottom: 11px; font-size: clamp(32px, 3.8vw, 48px); font-weight: 620; line-height: 1.13; letter-spacing: -.045em; }
.hero p:not(.eyebrow) { max-width: 700px; font-size: 13px; line-height: 1.8; }
.identity-box {
    min-width: 246px;
    padding: 18px 20px 17px;
    border-color: var(--line);
    border-left: 2px solid var(--accent);
    border-radius: 5px;
    background: linear-gradient(110deg, rgba(137, 173, 215, .055), transparent), var(--panel);
}
.identity-box > .small:first-child { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.identity-box strong { color: #edf3fa; font-size: 17px; font-weight: 640; overflow-wrap: anywhere; }
.panel, .stat, .action-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(154deg, rgba(255, 255, 255, .016), transparent 38%), var(--panel);
    box-shadow: 0 12px 30px rgba(0, 4, 13, .12);
}
.panel { padding: 25px 27px; }
.panel h2 { font-size: 19px; font-weight: 630; }
.panel h3 { font-size: 15px; font-weight: 650; }

/* 04 / DASHBOARD — task-driven layout. */
.user-dashboard { max-width: 1150px; }
.user-hero { margin-bottom: 34px; }
.action-grid { gap: 13px; margin-bottom: 18px; }
.action-card {
    position: relative;
    overflow: hidden;
    min-height: 308px;
    padding: 24px;
    gap: 21px;
}
.action-card::before {
    content: "";
    pointer-events: none;
    position: absolute;
    top: -1px;
    right: -1px;
    width: 43px;
    height: 43px;
    border-top: 2px solid var(--operational-blue);
    border-right: 2px solid var(--operational-blue);
    opacity: .75;
}
.action-card.primary-action {
    border-color: rgba(134, 168, 212, .51);
    background: linear-gradient(150deg, rgba(61, 107, 163, .13), transparent 65%), var(--panel);
}
.action-card.primary-action::before { border-color: var(--accent); opacity: 1; }
.action-icon {
    width: 42px;
    height: 42px;
    border-radius: 5px;
    background: #12263e;
    border-color: rgba(124, 166, 211, .3);
    color: #c4dbf4;
    font-size: 21px;
    font-weight: 350;
}
.action-card h2 { color: #edf3fa; font-size: 21px; font-weight: 630; line-height: 1.25; }
.action-card p:not(.eyebrow) { font-size: 12px; line-height: 1.7; }
.action-card .eyebrow { margin-bottom: 8px; }
.action-card .room-create-form { gap: 9px; }
.action-card .room-create-form label { font-size: 11px; }
.action-card .room-create-form select { min-height: 42px; }
.action-card .room-create-form button,
.action-card > .action-link { min-height: 43px; width: 100%; }
.action-card button[disabled] { width: 100%; }
.open-rooms-panel { margin-bottom: 18px; }
.room-list { gap: 9px; }
.room-row {
    gap: 15px;
    padding: 16px 18px;
    border-radius: 5px;
    background: rgba(8, 19, 32, .6);
}
.room-row:hover { background: rgba(31, 51, 74, .42); border-color: rgba(134, 168, 212, .33); }
.room-row > div:first-child strong { font-size: 13px; font-weight: 690; color: #e6eef8; }
.room-row > div:first-child .small { font-size: 11px; }
.room-actions { gap: 8px; }
.room-actions .button, .room-actions button { min-height: 40px; }
.room-phase-note { border-radius: 4px; }
.invite-card { border-color: rgba(134, 168, 212, .5); background: linear-gradient(110deg, rgba(134, 168, 212, .06), transparent), var(--panel); }
.invite-url {
    border-radius: 5px;
    border-left: 2px solid var(--accent);
    background: var(--surface-recessed);
}
.invite-url code, .credential-item code { color: #dbe8f6; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.privacy-panel, .session-panel { padding-block: 23px; gap: 18px; }
.privacy-panel p.muted, .session-panel p.muted { font-size: 12px; line-height: 1.7; }

/* 05 / ADMIN — compact oversight, clear information density. */
.admin-tabs {
    gap: 4px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 34px;
    padding-bottom: 0;
}
.admin-tabs a {
    padding: 14px 17px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    color: #9bacc1;
    background: transparent;
    font-size: 11px;
    font-weight: 740;
    letter-spacing: .075em;
    text-transform: uppercase;
}
.admin-tabs a:hover, .admin-tabs a[aria-current="page"] {
    border: 0;
    border-bottom: 2px solid var(--accent);
    color: #f1f5fa;
    background: linear-gradient(0deg, rgba(114, 158, 207, .085), transparent 74%);
}
.stats { gap: 13px; margin-bottom: 19px; }
.stat { position: relative; min-height: 138px; padding: 22px 23px; overflow: hidden; }
.stat::after {
    content: ""; position: absolute; top: 0; right: 0;
    width: 34px; height: 34px;
    border-top: 1px solid var(--operational-blue);
    border-right: 1px solid var(--operational-blue);
}
.stat .label { font-size: 10px; color: #a3b3c5; font-weight: 690; letter-spacing: .09em; }
.stat .value { margin-top: 14px; font-size: 35px; color: #e7f0fb; font-weight: 600; font-variant-numeric: tabular-nums; }
.content-grid { gap: 18px; }
.credential-card { border-color: rgba(121, 196, 168, .36); background: linear-gradient(115deg, rgba(121, 196, 168, .065), transparent), var(--panel); }
.credential-grid { gap: 12px; }
.credential-item { border-radius: 5px; background: var(--surface-recessed); }
.table-wrap { border-radius: 5px; }
th, td { padding: 14px 13px; border-color: var(--line-soft); }
th { color: #a1b4ca; font-size: 10px; letter-spacing: .09em; }
td { color: #d2dce8; font-size: 12px; }
tbody tr:hover { background: rgba(111, 150, 196, .045); }
.events li { gap: 14px; border-color: var(--line-soft); padding-block: 13px; }
.events strong { color: #dce6f1; font-weight: 630; }
.events time { color: #8da1b8; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

/* 06 / IDENTITY SETTINGS — visual preview without replacing any control. */
.brand-settings-panel { padding: 28px; }
.brand-assets-grid { gap: 14px; }
.brand-asset-card { gap: 8px; }
.brand-asset-card strong { color: #e3eaf2; font-weight: 660; }
.brand-asset-frame {
    height: 164px;
    border-color: #34465a;
    border-radius: 6px;
    background: #081326;
}
.brand-asset-frame--light { background: #f2f0eb; }
.brand-asset-frame img { max-height: 119px; }
.brand-upload-form { gap: 14px; }
.brand-settings-panel input[type="file"] { background: var(--surface-recessed); }
.brand-settings-panel input[type="file"]::file-selector-button {
    margin-right: 13px;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 9px 12px;
    color: var(--accent-strong);
    background: var(--panel-2);
    cursor: pointer;
}
.brand-settings-actions { gap: 10px; }
.brand-settings-actions .button.secondary { border-radius: 6px; }

/* 07 / INVITATION REVIEW — visually connected to the authentication system. */
.join-shell { min-height: 100vh; }
.join-card {
    position: relative;
    overflow: hidden;
    border: 1px solid #32465d;
    border-radius: 8px;
    padding: 43px 47px;
    background:
        radial-gradient(circle at 100% 0%, rgba(79, 128, 181, .11), transparent 17rem),
        var(--panel);
    box-shadow: var(--shadow);
}
.join-card::before {
    content: ""; position: absolute; top: 0; left: 0; width: 88px; height: 3px;
    background: linear-gradient(90deg, var(--accent), transparent);
    pointer-events: none;
}
.join-card .brand-lockup--crest { width: 66px; height: 66px; }
.join-card .brand-lockup--full { width: 170px; }
.join-card h1 { font-size: clamp(35px, 4.5vw, 48px); font-weight: 620; line-height: 1.14; }
.join-card > p.muted { font-size: 13px; line-height: 1.75; }
.invite-state { border-radius: 5px; background: var(--surface-recessed); font-size: 12px; }
.join-summary { border-radius: 5px; background: var(--surface-recessed); }
.join-summary strong { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-variant-numeric: tabular-nums; }
.join-help { font-size: 12px; }

/* 08 / ENCRYPTED ROOM — premium secure communications workspace. */
.chat-screen { width: min(1110px, calc(100% - 64px)); padding: 24px 0 28px; }
.chat-app {
    min-height: 510px;
    height: calc(100vh - 125px);
    height: calc(100dvh - 125px);
    max-height: 980px;
    border: 1px solid #34465b;
    border-radius: 8px;
    background: #0b1625;
    box-shadow: 0 24px 80px rgba(0, 4, 14, .39);
}
.chat-header {
    min-height: 79px;
    padding: 14px 22px;
    border-bottom: 1px solid #2a3c50;
    background: linear-gradient(95deg, #14273d, #0e1b2b 75%);
}
.chat-room-info { gap: 5px; }
.chat-room-info > strong { font-size: 15px; font-weight: 660; letter-spacing: .018em; }
.chat-room-info > strong::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 10px; background: var(--accent); transform: rotate(45deg); vertical-align: 2px; }
.chat-room-meta { font-size: 11px; color: #9fb0c5; }
.chat-room-tools { gap: 18px; }
.room-poll-status.chat-connection { gap: 10px; font-size: 10px; letter-spacing: .045em; }
.chat-options > summary {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-radius: 5px;
    padding: 0 13px;
    border-color: #3b516b;
    background: rgba(255, 255, 255, .025);
    color: #d8e4f2;
    font-size: 10px;
    letter-spacing: .095em;
}
.chat-options > summary::after { content: "⌄"; color: #a7c1dd; font-size: 17px; line-height: 1; margin-top: -5px; }
.chat-options[open] > summary { border-color: var(--accent); background: rgba(111, 153, 203, .1); }
.chat-options-panel {
    width: min(322px, calc(100vw - 32px));
    gap: 9px;
    border: 1px solid #3c516b;
    border-radius: 7px;
    padding: 14px;
    background: #132236;
    box-shadow: 0 22px 62px rgba(0, 3, 12, .6);
}
.chat-option-link { border-radius: 4px; color: #e1eaf5; }
.chat-option-link:hover { background: rgba(161, 189, 223, .09); }
.chat-option-button { min-height: 42px; text-transform: none; letter-spacing: .01em; font-size: 12px; font-weight: 630; }
.chat-option-note { color: #a4b3c4; }
.chat-system-stack { background: #101f30; }
.chat-system-status { border-radius: 5px; }
.message-stream {
    padding: 24px 26px;
    gap: 13px;
    background-image:
        radial-gradient(ellipse at 50% 10%, rgba(41, 76, 117, .07), transparent 65%),
        linear-gradient(to right, rgba(125, 156, 194, .028) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(125, 156, 194, .028) 1px, transparent 1px);
    background-size: auto, 64px 64px, 64px 64px;
    scrollbar-color: #3a536f #111e2d;
    scrollbar-width: thin;
}
.message-stream-empty { position: relative; gap: 17px; color: #859ab2; }
.message-stream-empty::before {
    content: "";
    display: block;
    width: 62px;
    height: 62px;
    border: 1px solid rgba(130, 173, 215, .23);
    border-radius: 50%;
    background:
        linear-gradient(to right, transparent calc(50% - .5px), rgba(130, 173, 215, .3) 50%, transparent calc(50% + .5px)),
        linear-gradient(to bottom, transparent calc(50% - .5px), rgba(130, 173, 215, .3) 50%, transparent calc(50% + .5px)),
        radial-gradient(circle, rgba(130, 173, 215, .21) 0 3px, transparent 3.5px),
        rgba(21, 39, 59, .4);
    box-shadow: 0 0 0 15px rgba(130, 173, 215, .025);
}
/* Important: JS toggles the native hidden attribute as messages arrive. */
.message-stream-empty[hidden], .scroll-latest[hidden], [data-client-flash][hidden] { display: none !important; }
.chat-message {
    max-width: min(77%, 660px);
    border: 1px solid #31435a;
    border-radius: 9px 9px 9px 3px;
    padding: 12px 15px;
    background: #172538;
    box-shadow: 0 4px 13px rgba(0, 5, 14, .14);
}
.chat-message.peer { border-color: #31435a; background: #182638; }
.chat-message.own {
    border-color: #40617f;
    border-radius: 9px 9px 3px 9px;
    background: linear-gradient(135deg, #233e5c, #1a304a);
}
.chat-message-header { margin-bottom: 6px; }
.chat-message-header strong { color: #b5c9e0; font-size: 10px; font-weight: 700; }
.chat-message-header .small { color: #a1b2c7; font-size: 10px; }
.chat-message p { color: #f1f5fa; font-size: 13px; line-height: 1.65; }
.message-delivery-state { color: #a5b8cd; font-size: 10px; }
.message-delivery-state.delivered { color: #98d9bf; }
.scroll-latest { bottom: 100px; border-radius: 5px; background: #263f5a; color: #f2f7fd; }
.room-composer {
    border-top: 1px solid #2c4056;
    gap: 9px;
    padding: 13px 19px 16px;
    background: linear-gradient(180deg, #142339, #111f31);
}
.room-composer textarea {
    min-height: 53px;
    max-height: 145px;
    border-color: #3b5169;
    border-radius: 5px;
    padding: 12px 14px;
    background: #091625;
    color: #eff4f9;
    font-size: 13px;
    line-height: 1.5;
}
.room-composer textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-halo); }
.room-composer-bar { gap: 12px; }
.composer-attach { min-height: 38px; }
.composer-send { min-height: 38px; border-color: rgba(157, 188, 222, .63); }
.composer-shortcut { font-size: 10px; }
.message-counter { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; }
.attachment-card { border-radius: 5px; border-color: #405570; background: rgba(5, 16, 28, .22); }
.attachment-preview { border-radius: 5px; }

/* 09 / ADAPTIVE LAYOUT — all controls remain reachable at narrow widths. */
@media (max-width: 1050px) {
    .auth-intro { padding: 42px; }
    .security-strip { left: 42px; right: 42px; }
    .auth-intro h1 { font-size: clamp(37px, 4.6vw, 56px); }
    .auth-card { padding: 37px; }
    .brand-assets-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .auth-page .auth-shell { grid-template-columns: 1fr; }
    .auth-intro { min-height: 285px; padding: 36px; border-right: 0; border-bottom: 1px solid var(--line); }
    .auth-intro h1 { margin-top: 45px; font-size: clamp(34px, 5vw, 48px); }
    .auth-intro::before { width: 440px; height: 440px; top: -80px; left: 58%; }
    .security-strip { position: relative; inset: auto; margin-top: 25px; }
    .auth-card { padding: 37px; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .content-grid { grid-template-columns: 1fr; }
    .action-grid { grid-template-columns: 1fr; }
    .action-card { min-height: 215px; }
    .room-row, .room-row-invite { grid-template-columns: 1fr; }
    .room-actions { width: 100%; }
    .room-actions .button, .room-invite-form, .room-invite-form button { width: 100%; }
}
@media (max-width: 700px) {
    .shell { width: min(100% - 28px, 1230px); }
    .topbar-inner { min-height: 66px; }
    .topbar-meta { gap: 8px; }
    .topbar-meta .username { display: none; }
    .dashboard { padding-top: 31px; padding-bottom: 52px; }
    .hero { display: block; }
    .identity-box { margin-top: 19px; }
    .panel { padding: 20px; }
    .chat-screen { width: 100%; padding: 0; }
    .chat-app {
        min-height: 0;
        height: calc(100vh - 66px);
        height: calc(100dvh - 66px);
        max-height: none;
        border: 0;
        border-radius: 0;
    }
    .chat-header { min-height: 66px; padding: 10px 13px; gap: 8px; }
    .chat-room-info > strong { font-size: 13px; }
    .chat-room-meta { font-size: 10px; max-width: min(46vw, 280px); }
    .chat-room-tools { gap: 9px; }
    .chat-options > summary { min-height: 37px; padding-inline: 11px; }
    .message-stream { padding: 16px 13px; }
    .chat-message { max-width: 89%; padding: 10px 12px; }
    .room-composer { padding: 10px 12px 12px; }
    .room-composer-bar { gap: 7px; }
    .composer-attach, .composer-send { min-height: 39px; padding: 0 12px; }
}
@media (max-width: 620px) {
    .auth-page { padding: 10px 0; place-items: stretch; }
    .auth-page .auth-shell { width: 100%; border-radius: 6px; }
    .auth-intro { padding: 27px 24px; min-height: auto; }
    .auth-intro h1 { margin-top: 35px; font-size: clamp(32px, 8vw, 43px); }
    .auth-intro > p { font-size: 13px; }
    .security-strip { gap: 7px; }
    .security-chip { padding: 7px 8px; font-size: 9px; }
    .auth-card { padding: 31px 24px; }
    .auth-card h2 { font-size: 27px; }
    .topbar .brand-lockup--crest { width: 40px; height: 40px; }
    .hero h1 { font-size: 34px; }
    .stats { gap: 9px; }
    .stat { min-height: 110px; padding: 17px; }
    .stat .value { font-size: 28px; }
    .brand-settings-panel { padding: 19px; }
    .brand-form-grid { grid-template-columns: 1fr; }
    .brand-asset-frame { height: 132px; padding: 11px; }
    .brand-assets-grid { gap: 11px; }
    .brand-upload-form button { width: 100%; }
    .join-shell { padding: 12px 0; }
    .join-card { padding: 28px 23px; border-radius: 6px; }
    .join-card h1 { font-size: 35px; }
    .chat-room-tools .room-poll-status.chat-connection > span:last-child { display: none; }
    .room-composer-bar { grid-template-columns: auto minmax(0, 1fr) auto; }
    .composer-shortcut { display: none; }
    .message-counter { justify-self: end; }
}
@media (max-width: 420px) {
    .shell { width: calc(100% - 20px); }
    .auth-intro { padding: 24px 21px; }
    .auth-card { padding: 28px 21px; }
    .hero h1 { font-size: 30px; }
    .brand-assets-grid { grid-template-columns: 1fr 1fr; }
    .brand-asset-frame { height: 105px; }
    .admin-tabs a { padding: 12px 9px; font-size: 10px; }
    .topbar .brand-lockup--full { width: 123px; }
    .chat-room-meta { max-width: 41vw; }
    .chat-header { padding-inline: 9px; }
    .chat-options > summary { font-size: 9px; padding-inline: 9px; gap: 6px; }
    .chat-options > summary::after { font-size: 15px; }
    .chat-message { max-width: 93%; }
    .message-counter { display: none; }
    .room-composer-bar { grid-template-columns: auto 1fr; }
    .composer-send { justify-self: stretch; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* 10 / PALETTE CONTINUITY — existing admin choices affect every workspace. */
body.brand-theme--slate button:not(.secondary):not(.danger),
body.brand-theme--slate .button:not(.secondary):not(.danger) {
    border-color: #697c90;
    background: linear-gradient(180deg, #405366, #304254);
}
body.brand-theme--slate button:not(.secondary):not(.danger):hover:not(:disabled),
body.brand-theme--slate .button:not(.secondary):not(.danger):hover {
    border-color: #b3c6d6;
    background: linear-gradient(180deg, #51667b, #395168);
}
body.brand-theme--slate .auth-page .auth-shell { border-color: #435463; background: #151d27; }
body.brand-theme--slate .auth-intro { border-color: #435463; background: radial-gradient(ellipse at 105% 49%, rgba(130, 148, 165, .10), transparent 53%), #131d27; }
body.brand-theme--slate .topbar { background: rgba(11, 17, 24, .96); }
body.brand-theme--slate .action-icon { background: #1e2b37; border-color: #3b5267; }
body.brand-theme--slate .brand-asset-frame:not(.brand-asset-frame--light) { background: #0b1520; }
body.brand-theme--slate .join-card { border-color: #475969; }
body.brand-theme--slate .chat-app { border-color: #435463; background: #131c27; }
body.brand-theme--slate .chat-header { border-color: #394b5b; background: linear-gradient(95deg, #263848, #1b2835 75%); }
body.brand-theme--slate .chat-options-panel { border-color: #51667c; background: #202f3d; }
body.brand-theme--slate .message-stream { background-color: #131e2a; }
body.brand-theme--slate .chat-message.peer { border-color: #405365; background: #21303e; }
body.brand-theme--slate .chat-message.own { border-color: #60788d; background: linear-gradient(135deg, #344c61, #2b4052); }
body.brand-theme--slate .room-composer { border-color: #415669; background: linear-gradient(180deg, #243443, #1b2b38); }
body.brand-theme--slate .room-composer textarea { border-color: #506579; background: #111d29; }

body.brand-theme--steel button:not(.secondary):not(.danger),
body.brand-theme--steel .button:not(.secondary):not(.danger) {
    border-color: #6eafb8;
    background: linear-gradient(180deg, #296472, #20505e);
}
body.brand-theme--steel button:not(.secondary):not(.danger):hover:not(:disabled),
body.brand-theme--steel .button:not(.secondary):not(.danger):hover {
    border-color: #a6e1e8;
    background: linear-gradient(180deg, #347788, #28616f);
}
body.brand-theme--steel .auth-page .auth-shell { border-color: #325664; background: #12252e; }
body.brand-theme--steel .auth-intro { border-color: #305460; background: radial-gradient(ellipse at 105% 49%, rgba(69, 142, 157, .12), transparent 53%), #0e212c; }
body.brand-theme--steel .topbar { background: rgba(7, 20, 27, .95); }
body.brand-theme--steel .action-icon { background: #163844; border-color: #356e7b; color: #ccebf0; }
body.brand-theme--steel .join-card { border-color: #345764; }
body.brand-theme--steel .chat-app { border-color: #365c6a; background: #0e232e; }
body.brand-theme--steel .chat-header { border-color: #305260; background: linear-gradient(95deg, #173b49, #112b36 75%); }
body.brand-theme--steel .chat-options-panel { border-color: #376674; background: #183641; }
body.brand-theme--steel .message-stream { background-color: #0e2430; }
body.brand-theme--steel .chat-message.peer { border-color: #2a5463; background: #193743; }
body.brand-theme--steel .chat-message.own { border-color: #387b88; background: linear-gradient(135deg, #245260, #1c3f50); }
body.brand-theme--steel .room-composer { border-color: #305868; background: linear-gradient(180deg, #183846, #132f3b); }
body.brand-theme--steel .room-composer textarea { border-color: #39717f; background: #0b2029; }

/* ============================================================================
   ARKAEL / CONSOLE EDITION — REFINAMENTO DO PAINEL ADMINISTRATIVO
   Apenas regras CSS adicionais. Escopo: main.dashboard administrativo.
   Preservados HTML/PHP, JS, autenticacao, chat, rotas, dados e eventos.
   Paletas originais do administrador continuam operantes.
   ============================================================================ */

/* 01 — Superficie do console, com o minimo de textura de fundo. */
body:has(> .dashboard:not(.user-dashboard)) {
    --console-line: color-mix(in srgb, var(--accent) 22%, transparent);
    --console-edge: color-mix(in srgb, var(--accent) 36%, transparent);
    --console-glow: color-mix(in srgb, var(--accent) 8%, transparent);
    --console-surface: color-mix(in srgb, var(--panel) 94%, var(--bg));
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse at 74% 15%, var(--console-glow), transparent 44%),
        linear-gradient(90deg, color-mix(in srgb, var(--accent) 1.45%, transparent) 1px, transparent 1px),
        linear-gradient(0deg, color-mix(in srgb, var(--accent) 1.45%, transparent) 1px, transparent 1px);
    background-size: auto, 96px 96px, 96px 96px;
}
body:has(> .dashboard:not(.user-dashboard)) .topbar {
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 94%, black);
    box-shadow: none;
}
body:has(> .dashboard:not(.user-dashboard)) .topbar-inner {
    min-height: 70px;
}
body:has(> .dashboard:not(.user-dashboard)) .topbar .brand-lockup--crest {
    gap: 17px;
    width: auto;
    min-height: 46px;
}
body:has(> .dashboard:not(.user-dashboard)) .topbar .brand-lockup--crest img {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    object-fit: contain;
}
body:has(> .dashboard:not(.user-dashboard)) .topbar .brand-lockup--crest::after {
    content: "ÁREA RESTRITA";
    display: flex;
    align-items: center;
    min-height: 29px;
    padding-left: 17px;
    border-left: 1px solid var(--line);
    color: var(--muted);
    font-size: 10px;
    font-weight: 750;
    line-height: 1.4;
    letter-spacing: .135em;
    white-space: nowrap;
}
/* Nao associar ponto verde a ADMIN: e decorativo, nao mede conexao. */
body:has(> .dashboard:not(.user-dashboard)) .topbar-meta .status-dot {
    background: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent);
}
body:has(> .dashboard:not(.user-dashboard)) .topbar-meta {
    color: #bac6d4;
    letter-spacing: .11em;
}
body:has(> .dashboard:not(.user-dashboard)) .topbar-meta .username {
    color: #d9e1ec;
    border-left-color: var(--line);
}

/* 02 — Ritmo mais contido, uma hierarquia consistente. */
.dashboard:not(.user-dashboard) {
    width: min(1312px, calc(100% - 70px));
    padding-top: 28px;
    padding-bottom: 76px;
}
.dashboard:not(.user-dashboard) .admin-tabs {
    gap: 5px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--line);
}
.dashboard:not(.user-dashboard) .admin-tabs a {
    position: relative;
    min-height: 45px;
    padding: 13px 16px 14px;
    font-size: 10px;
    letter-spacing: .11em;
    font-weight: 750;
    color: #aabaca;
    transition: color .15s ease, background .15s ease;
}
.dashboard:not(.user-dashboard) .admin-tabs a[aria-current="page"] {
    color: #f2f5f9;
    border-bottom-color: var(--accent);
    background: linear-gradient(0deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 72%);
}
.dashboard:not(.user-dashboard) .admin-tabs a:focus-visible {
    outline-offset: -3px;
}
.dashboard:not(.user-dashboard) > .hero {
    align-items: center;
    gap: 32px;
    margin: 0 0 21px;
    padding: 3px 0 30px;
    border-bottom: 1px solid var(--line-soft);
}
.dashboard:not(.user-dashboard) > .hero > div:first-child { min-width: 0; }
.dashboard:not(.user-dashboard) > .hero .eyebrow {
    margin-bottom: 10px;
    color: var(--accent-strong);
    font-size: 10px;
    letter-spacing: .19em;
}
.dashboard:not(.user-dashboard) > .hero h1 {
    margin: 0 0 10px;
    font-size: clamp(30px, 3vw, 39px);
    line-height: 1.13;
    font-weight: 640;
    letter-spacing: -.04em;
}
.dashboard:not(.user-dashboard) > .hero p:not(.eyebrow) {
    max-width: 665px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.7;
}
/* Identidade deixa de ser um card flutuante: integra-se ao bloco de apresentacao. */
.dashboard:not(.user-dashboard) > .hero .identity-box {
    flex: 0 0 222px;
    min-width: 0;
    margin: 0;
    padding: 10px 0 10px 21px;
    border: 0;
    border-left: 1px solid var(--console-edge);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.dashboard:not(.user-dashboard) > .hero .identity-box > .small:first-child {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 760;
    letter-spacing: .135em;
}
.dashboard:not(.user-dashboard) > .hero .identity-box strong {
    margin: 0 0 4px;
    color: #eaf0f8;
    font-size: 17px;
    font-weight: 650;
    line-height: 1.25;
    letter-spacing: .01em;
}
.dashboard:not(.user-dashboard) > .hero .identity-box > .small:last-child {
    color: #8fa3b8;
    font-size: 11px;
}

/* 03 — Telemetria compacta: valores sao os mesmos, apenas o desenho muda. */
.dashboard:not(.user-dashboard) .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
    margin-bottom: 17px;
}
.dashboard:not(.user-dashboard) .stat {
    position: relative;
    min-height: 113px;
    padding: 18px 20px 17px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--console-surface);
    box-shadow: none;
    transition: border-color .18s ease;
}
.dashboard:not(.user-dashboard) .stat::after {
    top: -1px;
    right: 19px;
    width: 38px;
    height: 2px;
    border: 0;
    background: var(--accent);
    opacity: .65;
}
.dashboard:not(.user-dashboard) .stat .label {
    display: block;
    margin-bottom: 11px;
    color: #a5b7ca;
    font-size: 9px;
    font-weight: 770;
    line-height: 1.45;
    letter-spacing: .115em;
}
.dashboard:not(.user-dashboard) .stat .value {
    margin-top: 0;
    color: #edf3fb;
    font-size: 34px;
    font-weight: 590;
    line-height: 1.12;
    letter-spacing: -.037em;
    font-variant-numeric: tabular-nums;
}

/* 04 — Modulos de trabalho: densidade util, limites precisos, acao localizada. */
.dashboard:not(.user-dashboard) .content-grid {
    grid-template-columns: minmax(0, 1.62fr) minmax(320px, .78fr);
    gap: 17px;
    align-items: start;
}
.dashboard:not(.user-dashboard) .content-grid > div,
.dashboard:not(.user-dashboard) .content-grid > aside { min-width: 0; }
.dashboard:not(.user-dashboard) .panel {
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 25px 26px;
    background: var(--console-surface);
    box-shadow: none;
}
.dashboard:not(.user-dashboard) .panel + .panel { margin-top: 17px; }
.dashboard:not(.user-dashboard) .panel h2 {
    margin: 0 0 11px;
    color: #eff3f9;
    font-size: 18px;
    font-weight: 640;
    letter-spacing: -.025em;
    line-height: 1.35;
}
.dashboard:not(.user-dashboard) .panel > .eyebrow {
    margin: 0 0 14px;
    font-size: 9px;
    letter-spacing: .17em;
}
.dashboard:not(.user-dashboard) .panel > .muted,
.dashboard:not(.user-dashboard) .panel > .small.muted {
    color: #a1b1c4;
    font-size: 12px;
    line-height: 1.75;
}
.dashboard:not(.user-dashboard) .content-grid > div > .panel:first-child .form-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 19px;
}
.dashboard:not(.user-dashboard) .content-grid > div > .panel:first-child .form-actions button {
    flex: 0 1 auto;
    width: auto;
    min-width: 273px;
    min-height: 42px;
    padding-inline: 19px;
    border-color: color-mix(in srgb, var(--accent) 53%, transparent);
    border-radius: 4px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 20%, var(--panel-2)), var(--panel-2));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
    color: #f5f8fd;
    font-size: 10px;
    letter-spacing: .09em;
}
.dashboard:not(.user-dashboard) .content-grid > div > .panel:first-child .form-actions button:hover:not(:disabled) {
    border-color: var(--accent-strong);
    background: color-mix(in srgb, var(--accent) 26%, var(--panel-2));
}
.dashboard:not(.user-dashboard) .content-grid .panel > .eyebrow + h2 {
    margin-top: 0;
}
.dashboard:not(.user-dashboard) .events li {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line-soft);
}
.dashboard:not(.user-dashboard) .events li:first-child { padding-top: 4px; }
.dashboard:not(.user-dashboard) .events li:last-child { padding-bottom: 0; border-bottom: 0; }
.dashboard:not(.user-dashboard) .events strong {
    display: flex;
    gap: 10px;
    align-items: center;
    min-width: 0;
    overflow-wrap: anywhere;
    color: #dbe7f3;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 11px;
    font-weight: 620;
    letter-spacing: .015em;
}
.dashboard:not(.user-dashboard) .events strong::before {
    content: "";
    width: 5px;
    height: 5px;
    flex: 0 0 5px;
    border: 1px solid var(--accent);
    transform: rotate(45deg);
    opacity: .8;
}
.dashboard:not(.user-dashboard) .events time {
    display: block;
    padding-left: 15px;
    color: #8fa5bb;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 10px;
    line-height: 1.5;
    letter-spacing: -.01em;
    overflow-wrap: anywhere;
}
.dashboard:not(.user-dashboard) .table-wrap {
    border-radius: 4px;
    scrollbar-color: var(--line) transparent;
}
.dashboard:not(.user-dashboard) th { color: #abc0d5; }
.dashboard:not(.user-dashboard) td { color: #d3dce9; }
.dashboard:not(.user-dashboard) tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.dashboard:not(.user-dashboard) .credential-card {
    border-color: color-mix(in srgb, var(--success) 40%, var(--line));
    background: linear-gradient(135deg, color-mix(in srgb, var(--success) 5%, transparent), transparent 60%), var(--panel);
}
.dashboard:not(.user-dashboard) .credential-grid { gap: 11px; }
.dashboard:not(.user-dashboard) .credential-item { min-width: 0; }
.dashboard:not(.user-dashboard) .footer-actions { margin-top: 23px; }
.dashboard:not(.user-dashboard) .footer-actions button { min-height: 41px; border-radius: 4px; }

/* 05 — Configuracoes: os mesmos controles, com desenho mais conciso. */
.dashboard:not(.user-dashboard) .brand-settings-hero { margin-bottom: 22px; }
.dashboard:not(.user-dashboard) .brand-settings-panel {
    margin-bottom: 17px;
    padding: 25px 26px;
}
.dashboard:not(.user-dashboard) .brand-settings-panel .section-heading { gap: 16px; }
.dashboard:not(.user-dashboard) .brand-assets-grid { gap: 13px; margin: 17px 0 22px; }
.dashboard:not(.user-dashboard) .brand-asset-card {
    min-width: 0;
    border-radius: 5px;
    gap: 7px;
}
.dashboard:not(.user-dashboard) .brand-asset-frame {
    height: 136px;
    border-color: var(--line);
    border-radius: 4px;
}
.dashboard:not(.user-dashboard) .brand-asset-frame img { max-height: 97px; }
.dashboard:not(.user-dashboard) .brand-asset-card strong { font-size: 12px; }
.dashboard:not(.user-dashboard) .brand-upload-form { align-items: end; }
.dashboard:not(.user-dashboard) .brand-upload-form button,
.dashboard:not(.user-dashboard) .brand-settings-actions button,
.dashboard:not(.user-dashboard) .brand-settings-panel > form button {
    min-height: 43px;
    border-radius: 4px;
}
.dashboard:not(.user-dashboard) .brand-settings-panel input,
.dashboard:not(.user-dashboard) .brand-settings-panel select,
.dashboard:not(.user-dashboard) .brand-settings-panel textarea {
    border-radius: 4px;
}
.dashboard:not(.user-dashboard) .brand-settings-actions { margin-top: 22px; }
.dashboard:not(.user-dashboard) .brand-settings-actions .button { min-height: 43px; border-radius: 4px; }

/* 06 — Responsividade sem mudar estados ou comportamento de formularios. */
@media (max-width: 1100px) {
    .dashboard:not(.user-dashboard) { width: min(100% - 48px, 1312px); }
    .dashboard:not(.user-dashboard) .content-grid {
        grid-template-columns: minmax(0, 1.4fr) minmax(285px, .9fr);
    }
    .dashboard:not(.user-dashboard) .brand-assets-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 800px) {
    .dashboard:not(.user-dashboard) { width: calc(100% - 36px); padding-top: 22px; }
    .dashboard:not(.user-dashboard) .content-grid { grid-template-columns: minmax(0, 1fr); }
    .dashboard:not(.user-dashboard) .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard:not(.user-dashboard) .content-grid > aside { display: grid; gap: 16px; }
    .dashboard:not(.user-dashboard) .content-grid > aside > .panel { margin-top: 0; }
    .dashboard:not(.user-dashboard) > .hero .identity-box { flex-basis: 190px; }
    .dashboard:not(.user-dashboard) .panel { padding: 22px; }
}
@media (max-width: 620px) {
    body:has(> .dashboard:not(.user-dashboard)) .topbar .brand-lockup--crest { gap: 10px; }
    body:has(> .dashboard:not(.user-dashboard)) .topbar .brand-lockup--crest img { width: 38px; height: 38px; flex-basis: 38px; }
    body:has(> .dashboard:not(.user-dashboard)) .topbar .brand-lockup--crest::after { font-size: 9px; padding-left: 10px; letter-spacing: .07em; }
    .dashboard:not(.user-dashboard) { width: calc(100% - 28px); padding-top: 18px; padding-bottom: 45px; }
    .dashboard:not(.user-dashboard) .admin-tabs { margin-bottom: 23px; }
    .dashboard:not(.user-dashboard) .admin-tabs a { padding: 12px 11px; font-size: 9px; letter-spacing: .05em; }
    .dashboard:not(.user-dashboard) > .hero { display: block; margin-bottom: 17px; padding-bottom: 22px; }
    .dashboard:not(.user-dashboard) > .hero h1 { font-size: clamp(28px, 7vw, 34px); }
    .dashboard:not(.user-dashboard) > .hero .identity-box {
        margin-top: 19px;
        border-left-color: var(--console-edge);
        padding: 8px 0 8px 16px;
    }
    .dashboard:not(.user-dashboard) .stats { gap: 9px; }
    .dashboard:not(.user-dashboard) .stat { min-height: 106px; padding: 14px 14px; }
    .dashboard:not(.user-dashboard) .stat::after { right: 13px; width: 26px; }
    .dashboard:not(.user-dashboard) .stat .label { min-height: 26px; font-size: 9px; margin-bottom: 5px; }
    .dashboard:not(.user-dashboard) .stat .value { font-size: 30px; }
    .dashboard:not(.user-dashboard) .panel { padding: 19px; }
    .dashboard:not(.user-dashboard) .brand-settings-panel { padding: 19px; }
    .dashboard:not(.user-dashboard) .brand-asset-frame { height: 119px; }
    .dashboard:not(.user-dashboard) .content-grid > div > .panel:first-child .form-actions button { width: 100%; min-width: 0; }
    .dashboard:not(.user-dashboard) .content-grid > aside { gap: 13px; }
}
@media (max-width: 390px) {
    body:has(> .dashboard:not(.user-dashboard)) .topbar .brand-lockup--crest::after { display: none; }
    .dashboard:not(.user-dashboard) { width: calc(100% - 22px); }
    .dashboard:not(.user-dashboard) .admin-tabs { gap: 0; }
    .dashboard:not(.user-dashboard) .admin-tabs a { padding-inline: 8px; font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
    .dashboard:not(.user-dashboard) .stat,
    .dashboard:not(.user-dashboard) .admin-tabs a { transition: none; }
}
