/* 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;
    }
}
