:root {
    --bg: #070910;
    --bg-elevated: #0c1020;
    --surface: #12182c;
    --surface-2: #1a2238;
    --border: rgba(99, 115, 193, 0.22);
    --muted: #8b95a8;
    --text: #eef1f8;
    --primary: #7c6cf0;
    --primary-hover: #6557e8;
    --secondary: #2a334d;
    --secondary-hover: #343f5e;
    --danger: #f43f5e;
    --success: #34d399;
    --ring: rgba(124, 108, 240, 0.45);
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.45);
    --font: "DM Sans", system-ui, -apple-system, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, monospace;
    --header-h: 64px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .home-feature:hover {
        transform: none;
    }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100dvh;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.55;
    color: var(--text);
    background:
        radial-gradient(1200px 600px at 85% -10%, rgba(124, 108, 240, 0.18), transparent 55%),
        radial-gradient(900px 500px at 10% 0%, rgba(52, 211, 153, 0.08), transparent 50%),
        var(--bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: #b8c4ff;
    text-decoration: none;
    transition: color 0.15s ease;
}
a:hover { color: #e8ecff; text-decoration: underline; }

code {
    font-family: var(--mono);
    font-size: 0.88em;
    background: var(--surface-2);
    padding: 0.15em 0.45em;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: var(--header-h);
    padding: 0 1rem;
    border-bottom: 1px solid var(--border);
    background: rgba(7, 9, 16, 0.78);
    backdrop-filter: blur(14px) saturate(1.2);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 700;
    font-size: 1.125rem;
    letter-spacing: -0.02em;
    color: #fff;
}
.brand:hover { text-decoration: none; color: #fff; }

.brand-mark {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    object-fit: contain;
    display: block;
}

.brand-text { background: linear-gradient(90deg, #fff, #c7d2fe); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.nav-toggle:hover { background: var(--surface-2); border-color: rgba(124, 108, 240, 0.35); }
.nav-toggle:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }

.nav-toggle-bars {
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}

.site-nav {
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    position: absolute;
    right: 0.75rem;
    top: calc(var(--header-h) - 6px);
    min-width: 200px;
    padding: 0.65rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.site-nav.open { display: flex; }

.site-nav-drawer-head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.35rem 0.5rem 0.65rem;
    margin-bottom: 0.35rem;
    border-bottom: 1px solid var(--border);
}
.site-nav-drawer-avatar,
.site-nav-drawer-avatar-fallback {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}
.site-nav-drawer-avatar-fallback {
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #5b4cdb);
    border: 2px solid rgba(255, 255, 255, 0.12);
}
.site-nav-drawer-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-user-desktop {
    display: none;
    align-items: center;
    margin-left: auto;
}

.user-menu {
    position: relative;
}

.user-menu-trigger {
    position: relative;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: linear-gradient(145deg, rgba(124, 108, 240, 0.35), rgba(52, 211, 153, 0.12));
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08), 0 4px 14px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.user-menu-trigger:hover {
    transform: scale(1.04);
    box-shadow: 0 0 0 2px rgba(124, 108, 240, 0.45), 0 6px 18px rgba(0, 0, 0, 0.3);
}
.user-menu-trigger:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--ring), 0 4px 14px rgba(0, 0, 0, 0.25);
}
.user-menu-trigger-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    z-index: 1;
}
.user-menu-trigger-fallback {
    position: relative;
    z-index: 1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #7c6cf0, #34d399);
}

.nav-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 220px;
    padding: 0.45rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    z-index: 160;
}
.nav-dropdown[hidden] {
    display: none !important;
}
.nav-dropdown-head {
    padding: 0.5rem 0.65rem 0.65rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid var(--border);
}
.nav-dropdown-name {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-dropdown-item {
    display: flex;
    width: 100%;
    align-items: center;
    padding: 0.55rem 0.7rem;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text);
    font: inherit;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.12s ease;
}
a.nav-dropdown-item:hover,
button.nav-dropdown-item:hover {
    background: var(--surface-2);
    text-decoration: none;
    color: var(--text);
}
.nav-dropdown-item--accent {
    color: #a5b4fc;
}
.nav-dropdown-item--danger {
    color: #fecdd3;
}
.nav-dropdown-item--danger:hover {
    background: rgba(244, 63, 94, 0.15);
    color: #fff;
}
.nav-dropdown-divider {
    height: 1px;
    margin: 0.35rem 0.25rem;
    background: var(--border);
}
.nav-dropdown-form {
    margin: 0;
}

.nav-link {
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text);
}
.nav-link:hover { background: var(--surface-2); text-decoration: none; }

.nav-form { margin: 0; }

.link-btn {
    background: none;
    border: 0;
    color: #c7d2fe;
    cursor: pointer;
    font: inherit;
    text-align: left;
    width: 100%;
}

/* Cards & layout */
.card {
    background: linear-gradient(165deg, rgba(26, 34, 56, 0.92), rgba(12, 16, 32, 0.95));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.35rem;
    box-shadow: var(--shadow);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { border-color: rgba(124, 108, 240, 0.28); }

.dashboard-grid { display: grid; gap: 1.1rem; margin-bottom: 1.25rem; }

@media (max-width: 640px) {
    body.app-page .container {
        padding-left: max(0.75rem, env(safe-area-inset-left));
        padding-right: max(0.75rem, env(safe-area-inset-right));
    }
    .dashboard-hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    .dashboard-grid {
        gap: 0.85rem;
    }
    .stats-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.5rem;
    }
    .stat-chip {
        padding: 0.65rem 0.7rem;
    }
    .stat-chip strong {
        font-size: 1.15rem;
    }
    .stat-chip span {
        font-size: 0.72rem;
    }
    .card {
        padding: 1rem 1.1rem;
    }
}

.dashboard-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.dashboard-hero h1 { margin: 0; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.03em; }

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.stat-chip {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(18, 24, 44, 0.6);
}
.stat-chip strong { display: block; font-size: 1.35rem; font-weight: 700; color: #fff; }
.stat-chip span { font-size: 0.8rem; color: var(--muted); }

.hero {
    display: grid;
    gap: 1.5rem;
    align-items: stretch;
    padding: 1rem 0 2rem;
}
.hero h1 {
    font-size: clamp(1.85rem, 4.5vw, 3rem);
    line-height: 1.12;
    letter-spacing: -0.035em;
    margin: 0.5rem 0;
}
.hero-card {
    background: linear-gradient(160deg, rgba(124, 108, 240, 0.12), rgba(18, 24, 44, 0.9));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.35rem;
    box-shadow: var(--shadow);
}
.hero-card h3 { margin-top: 0; }
.hero-card ul { margin: 0; padding-left: 1.1rem; color: #c9d2e8; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }

.feature-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    margin-top: 2.5rem;
}
.feature-tile {
    padding: 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(18, 24, 44, 0.55);
}
.feature-tile h3 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.feature-tile p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.trust-strip {
    margin-top: 2.5rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    border: 1px dashed var(--border);
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}

/* Buttons */
.btn {
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.62rem 1.1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-weight: 600;
    font-family: inherit;
    font-size: 0.95rem;
    transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }

.btn-block { width: 100%; margin-top: 0.5rem; }
.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.85rem; }
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #5b4cdb);
    color: #fff;
    box-shadow: 0 4px 18px rgba(124, 108, 240, 0.35);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-hover), #4f42c9); text-decoration: none; color: #fff; }
.btn-secondary {
    background: var(--secondary);
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.btn-secondary:hover { background: var(--secondary-hover); text-decoration: none; color: #fff; }
.btn-danger {
    background: linear-gradient(135deg, var(--danger), #be123c);
    color: #fff;
}
.btn-ghost {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: rgba(124, 108, 240, 0.35); }

/* Forms */
input, select, textarea {
    width: 100%;
    margin-top: 0.4rem;
    margin-bottom: 0.55rem;
    padding: 0.65rem 0.85rem;
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: rgba(124, 108, 240, 0.55);
    box-shadow: 0 0 0 3px var(--ring);
}

.auth-wrap { display: flex; justify-content: center; padding: 1rem 0 2rem; }
.auth-card { width: min(480px, 100%); }
.auth-card form p { margin: 0.35rem 0; }

.muted { color: var(--muted); }
.eyebrow {
    color: #a5b4fc;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--surface-2);
    color: #c7d2fe;
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid var(--border);
}
.pill-active { background: rgba(52, 211, 153, 0.15); color: #6ee7b7; border-color: rgba(52, 211, 153, 0.35); }

.truncate { max-width: min(280px, 40vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.alerts { margin-bottom: 1rem; }
.alert {
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    background: rgba(26, 34, 56, 0.85);
}
.alert--success { border-color: rgba(52, 211, 153, 0.35); color: #a7f3d0; }
.alert--error { border-color: rgba(244, 63, 94, 0.4); color: #fecdd3; }
.alert--info { border-color: rgba(124, 108, 240, 0.35); color: #e0e7ff; }
.alert--warning { border-color: rgba(251, 191, 36, 0.45); color: #fef3c7; }

.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
th, td { text-align: left; padding: 0.85rem 1rem; border-bottom: 1px solid var(--border); }
th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: rgba(0, 0, 0, 0.2); }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: rgba(124, 108, 240, 0.04); }

.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--muted);
}
.empty-state-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(124, 108, 240, 0.25), rgba(52, 211, 153, 0.12));
    border: 1px solid var(--border);
}

/* Meeting room (dark shell only when not using brand light app-page) */
body.room-page:not(.app-page) { background: #050610; }
body.room-page .container { max-width: 1480px; padding-bottom: 1.5rem; }
body.room-page:not(.app-page) .site-header { background: rgba(5, 6, 16, 0.86); }
body.room-page.modal-open { overflow: hidden; }

.room-shell { display: flex; flex-direction: column; gap: 0.65rem; }

/* Meeting room id + host + actions live in .site-header on room pages */
body.room-page .site-header {
    flex-wrap: wrap;
    align-items: center;
    row-gap: 0.5rem;
    column-gap: 0.75rem;
    padding-top: max(0.35rem, env(safe-area-inset-top, 0px));
    padding-bottom: 0.45rem;
}
/* Row 1: brand + nav; row 2: full-width meeting toolbar (stops sidebar sliding under the bar) */
body.room-page .site-header .brand {
    order: 1;
}
body.room-page .site-header .nav-toggle {
    order: 2;
    margin-left: auto;
}
body.room-page .site-header .header-user-desktop {
    order: 3;
}
body.room-page .site-header .header-room-toolbar {
    order: 4;
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}
.header-room-toolbar {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem 0.75rem;
}
.header-room-info {
    min-width: 0;
    flex: 1 1 auto;
}
.header-room-line {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.45rem;
    font-size: 0.8125rem;
    line-height: 1.35;
    font-weight: 600;
}
.header-room-sep {
    color: rgba(148, 163, 184, 0.65);
    font-weight: 500;
    user-select: none;
}
.header-room-info .room-id-code-btn {
    max-width: min(11rem, 42vw);
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
    font-family: var(--mono);
    font-size: inherit;
    font-weight: 600;
    line-height: inherit;
    color: inherit;
    border: 1px solid transparent;
    padding: 0.08em 0.45em;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.header-room-info .room-id-code-btn:hover {
    filter: brightness(1.08);
}
.header-room-info .room-id-code-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--ring);
}
.header-room-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    flex-shrink: 0;
}
body.room-page:not(.app-page) .header-room-info {
    color: #cbd5e1;
}
body.room-page:not(.app-page) .header-room-info strong {
    color: #f8fafc;
}
body.room-page:not(.app-page) .room-meta-count {
    color: #e2e8f0;
}
.room-meta-count {
    font-weight: 600;
}
.header-room-actions .connection-pill {
    flex-shrink: 0;
}
.header-room-btn {
    flex-shrink: 0;
}
.header-room-actions .svg-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.header-room-actions .svg-icon svg {
    width: 1.125rem;
    height: 1.125rem;
    display: block;
}
.header-room-actions .room-layout-toggle .svg-icon svg {
    width: 1.2rem;
    height: 1.2rem;
}
.layout-toggle-icons {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
}
.layout-toggle-icons svg {
    position: absolute;
    inset: 0;
    margin: auto;
}
.room-layout-toggle[data-layout-mode="grid"] .layout-icon-grid { display: none; }
.room-layout-toggle[data-layout-mode="speaker"] .layout-icon-speaker { display: none; }
#sidebarToggle.header-room-btn {
    position: relative;
}
@media (max-width: 900px) {
    .header-room-actions .action-label {
        display: none;
    }
    .header-room-actions .btn-sm {
        padding: 0.45rem 0.55rem;
    }
}
body.room-page:not(.app-page) .header-room-toolbar {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.connection-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
}
.connection-pill::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}
.connection-pill.is-live::before {
    background: var(--success);
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.55);
}
.connection-pill.is-live { color: #a7f3d0; }

.room-body {
    display: grid;
    gap: 1rem;
    align-items: stretch;
}

.room-stage {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
}

/* Stage toolbar: screen-share hint + fullscreen */
.stage-toolbar {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.stage-share-banner:not([hidden]) {
    flex: 1;
    min-width: min(100%, 200px);
}
.stage-share-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.7rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.35;
    color: #e0e7ff;
    background: linear-gradient(135deg, rgba(124, 108, 240, 0.35), rgba(37, 99, 235, 0.22));
    border: 1px solid rgba(124, 108, 240, 0.45);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    animation: stageBannerIn 0.35s ease;
}
@keyframes stageBannerIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
.stage-share-banner-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.25);
    animation: stageSharePulse 1.6s ease-in-out infinite;
}
@keyframes stageSharePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(0.92); }
}
.stage-share-banner-text { min-width: 0; }
.stage-fullscreen-btn {
    flex-shrink: 0;
    margin-left: auto;
    gap: 0.35rem;
}
.stage-fs-icons {
    position: relative;
    width: 1.2rem;
    height: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.stage-fs-icons svg {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 1.15rem;
    height: 1.15rem;
    display: block;
}
.stage-fullscreen-btn[aria-pressed="true"] .stage-fs-expand { display: none; }
.stage-fullscreen-btn:not([aria-pressed="true"]) .stage-fs-collapse { display: none; }
.stage-fullscreen-btn.icon-only {
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0;
    border-radius: 10px;
}

.video-grid {
    --grid-cols: 2;
    position: relative;
    display: grid;
    gap: 0.6rem;
    grid-template-columns: repeat(var(--grid-cols), 1fr);
    grid-auto-rows: 1fr;
    min-height: clamp(360px, 60vh, 720px);
    transition: grid-template-columns 0.25s ease;
}
@media (max-width: 640px) {
    .video-grid { gap: 0.45rem; }
    /* Grid view: compact square tiles (Google Meet–style) */
    .video-grid:not(.is-speaker) {
        min-height: min(56dvh, 480px);
        align-content: start;
    }
    .video-grid:not(.is-speaker):not(.has-screen-share) .video-tile {
        aspect-ratio: 1 / 1;
        min-height: 0;
        border-radius: 12px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    }
    .video-grid:not(.is-speaker):not(.has-screen-share) .video-tile:only-child {
        aspect-ratio: 4 / 3;
        max-height: min(70dvh, 520px);
    }
    .video-grid.has-screen-share:not(.is-speaker) .video-tile:not(.is-screen) {
        aspect-ratio: 1 / 1;
        min-height: 0;
        border-radius: 10px;
    }
}
.video-grid.is-speaker {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
}
.video-grid.is-speaker .video-tile { aspect-ratio: 16 / 9; min-height: 220px; }
.video-grid.is-speaker .video-tile.is-focus {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 9;
    min-height: clamp(360px, 55vh, 540px);
}
/* Legacy PIP: single non-focus tile when filmstrip not active */
.video-grid.is-speaker:not(.has-filmstrip) .video-tile:not(.is-focus) {
    position: absolute;
    bottom: 0.6rem;
    left: 0.6rem;
    width: 180px;
    height: 110px;
    min-height: 110px;
    border-radius: 12px;
    aspect-ratio: 16 / 9;
    z-index: 3;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}
@media (max-width: 640px) {
    .video-grid.is-speaker:not(.has-filmstrip) .video-tile:not(.is-focus) {
        width: 110px;
        height: 70px;
        min-height: 70px;
    }
}

/* Meet-style: speaker view with multiple participants — main stage + scrollable filmstrip */
.video-grid.is-speaker.has-filmstrip {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    min-height: clamp(300px, 52dvh, 640px);
    position: relative;
}
.video-grid.is-speaker.has-filmstrip .video-tile.is-focus {
    flex: 1 1 auto;
    width: 100%;
    min-height: min(52dvh, 480px);
    max-height: 72dvh;
    grid-column: unset;
    position: relative;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}
.video-filmstrip {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.5rem;
    padding: 0.35rem 0.15rem 0.15rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    flex: 0 0 auto;
    max-width: 100%;
    touch-action: pan-x;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.5) transparent;
}
.video-filmstrip::-webkit-scrollbar {
    height: 5px;
}
.video-filmstrip::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.45);
    border-radius: 999px;
}
.video-grid.is-speaker.has-filmstrip .video-filmstrip .video-tile {
    position: relative;
    flex: 0 0 auto;
    width: 88px;
    height: 112px;
    min-width: 88px;
    min-height: 112px;
    aspect-ratio: 3 / 4;
    border-radius: 10px;
    bottom: auto;
    left: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    scroll-snap-align: start;
}
@media (min-width: 641px) {
    .video-grid.is-speaker.has-filmstrip .video-filmstrip .video-tile {
        width: 104px;
        height: 130px;
        min-width: 104px;
        min-height: 130px;
        border-radius: 12px;
    }
}
.video-grid.is-speaker.has-filmstrip .video-filmstrip .video-tile .tile-label {
    font-size: 0.65rem;
    padding: 0.1rem 0.35rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.video-grid.is-speaker.has-filmstrip .video-filmstrip .tile-badges .badge {
    width: 22px;
    height: 22px;
    font-size: 0.65rem;
}

/* Grid mode: spotlight active screen share on top row */
.video-grid.has-screen-share:not(.is-speaker) .video-tile.is-screen {
    grid-column: 1 / -1;
    order: -1;
    min-height: clamp(240px, 52dvh, 620px);
    z-index: 1;
    border-color: rgba(124, 108, 240, 0.65);
    box-shadow:
        0 0 0 1px rgba(124, 108, 240, 0.25),
        0 12px 40px rgba(0, 0, 0, 0.35);
}
.video-grid.has-screen-share:not(.is-speaker) .video-tile:not(.is-screen) {
    order: 0;
}
@media (max-width: 640px) {
    .video-grid.has-screen-share:not(.is-speaker) .video-tile.is-screen {
        min-height: clamp(200px, 48dvh, 520px);
    }
}

/* Speaker view: emphasize focused tile when it is a screen share */
.video-grid.is-speaker.has-screen-share .video-tile.is-focus.is-screen {
    min-height: clamp(380px, 58dvh, 640px);
    border-color: rgba(124, 108, 240, 0.75);
    box-shadow:
        0 0 0 2px rgba(124, 108, 240, 0.35),
        0 16px 48px rgba(0, 0, 0, 0.4);
}

.video-tile {
    position: relative;
    aspect-ratio: 16 / 9;
    min-height: 140px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: linear-gradient(160deg, #1a2140, #0f1425);
    overflow: hidden;
    transition: outline 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    isolation: isolate;
}
.video-tile--local { border-color: rgba(124, 108, 240, 0.35); }
.video-tile.remote { background: linear-gradient(160deg, #1e2544, #12182c); }

.video-tile.is-speaking {
    outline: 2px solid #34d399;
    outline-offset: -2px;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18);
}
.video-tile.is-pinned { border-color: rgba(124, 108, 240, 0.7); }
.video-tile.is-reconnecting { border-color: rgba(251, 191, 36, 0.55); }

.video-tile video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    transition: opacity 0.18s ease;
}
.video-tile video.is-blurred { filter: blur(18px) saturate(1.1); transform: scale(1.06); }
.video-tile video.is-mirrored { transform: scaleX(-1); }
.video-tile video.is-mirrored.is-blurred { transform: scaleX(-1) scale(1.06); }
.video-tile.is-muted-cam video { opacity: 0; }
.video-tile.is-screen video { object-fit: contain; background: #000; }

.video-tile .tile-fallback {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: none;
    place-items: center;
    background:
        radial-gradient(140% 100% at 50% 0%, rgba(124, 108, 240, 0.28), transparent 55%),
        linear-gradient(160deg, #15193a, #080b1a);
}
.video-tile.is-muted-cam:not(.is-screen) .tile-fallback { display: grid; }
.tile-avatar {
    width: clamp(52px, 14%, 96px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: clamp(1.4rem, 4vw, 2.2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #5b4cdb);
    box-shadow: 0 12px 32px rgba(124, 108, 240, 0.35);
    text-transform: uppercase;
}
.video-tile.is-screen .tile-fallback { display: none !important; }

.video-tile .tile-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0.55rem;
    background: linear-gradient(transparent 60%, rgba(0, 0, 0, 0.55));
}
.video-tile .tile-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    align-self: flex-start;
    pointer-events: auto;
}
.video-tile .tile-badges {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.3rem;
    pointer-events: none;
}
.tile-badges .badge {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    display: grid;
    place-items: center;
    font-size: 0.78rem;
    color: #cbd5e1;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.tile-badges .badge-mic::before { content: "🎙"; }
.tile-badges .badge-cam::before { content: "🎥"; }
.tile-badges .badge-screen { display: none; }
.tile-badges .badge-hand { display: none; }
.video-tile.is-hand .tile-badges .badge-hand { display: grid; animation: handBounce 1.2s ease infinite; }
@keyframes handBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
.video-tile.is-screen .tile-badges .badge-screen { display: grid; background: rgba(124, 108, 240, 0.7); color: #fff; border-color: rgba(124, 108, 240, 0.85); }
.video-tile.is-muted-mic .tile-badges .badge-mic { background: rgba(244, 63, 94, 0.85); color: #fff; border-color: rgba(244, 63, 94, 0.6); }
.video-tile.is-muted-mic .tile-badges .badge-mic::before { content: "🚫"; }
.video-tile.is-muted-cam .tile-badges .badge-cam { background: rgba(244, 63, 94, 0.85); color: #fff; border-color: rgba(244, 63, 94, 0.6); }

.tile-status {
    position: absolute;
    z-index: 4;
    top: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.78);
    color: #fde68a;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid rgba(251, 191, 36, 0.4);
    pointer-events: none;
}

.video-tile .tile-pin {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 0;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.video-tile:hover .tile-pin,
.video-tile.is-pinned .tile-pin { opacity: 1; }
.video-tile.is-pinned .tile-pin { background: rgba(124, 108, 240, 0.9); }

.caption-track {
    position: absolute;
    left: 50%;
    bottom: 4.5rem;
    transform: translateX(-50%);
    z-index: 4;
    max-width: min(720px, 90%);
    padding: 0.6rem 1rem;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: #f8fafc;
    font-size: 0.95rem;
    line-height: 1.4;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}
.caption-track.is-on { opacity: 1; }

.reaction-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 5;
}
.reaction-glyph {
    position: absolute;
    bottom: 6rem;
    left: 50%;
    font-size: 2.2rem;
    pointer-events: none;
    animation: floatUp 2.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    --drift: 0px;
}
@keyframes floatUp {
    0%   { opacity: 0; transform: translate(0, 30px) scale(0.7); }
    20%  { opacity: 1; transform: translate(calc(var(--drift) * 0.3), -10px) scale(1.1); }
    100% { opacity: 0; transform: translate(var(--drift), -180px) scale(1); }
}

.control-dock {
    position: sticky;
    bottom: max(0.5rem, env(safe-area-inset-bottom));
    align-self: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    justify-content: center;
    padding: 0.55rem;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(7, 9, 16, 0.82);
    backdrop-filter: blur(12px) saturate(1.4);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
    z-index: 10;
    max-width: 100%;
}
@media (max-width: 640px) {
    .control-dock {
        gap: 0.3rem;
        padding: 0.45rem;
        width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        justify-content: flex-start;
        scroll-snap-type: x mandatory;
    }
    .control-dock::-webkit-scrollbar { display: none; }
    .control-dock > * { scroll-snap-align: center; flex-shrink: 0; }
}
.control-stack { position: relative; display: inline-flex; }
.control-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-width: 64px;
    padding: 0.55rem 0.7rem;
    border: 1px solid transparent;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: #e2e8f0;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s;
}
@media (max-width: 640px) {
    .control-btn {
        min-width: 56px;
        padding: 0.5rem 0.55rem;
        font-size: 0.68rem;
    }
}
.control-btn .icon {
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    line-height: 0;
}
.control-btn .icon .ctl-icon {
    width: 1.35rem;
    height: 1.35rem;
    display: block;
}
.control-btn[data-control="mute"]:not(.is-on) .ctl-icon-mic-off,
.control-btn[data-control="mute"].is-on .ctl-icon-mic-on,
.control-btn[data-host-action="mute_all"]:not(.is-on) .ctl-icon-mic-off,
.control-btn[data-host-action="mute_all"].is-on .ctl-icon-mic-on,
.control-btn[data-control="camera"]:not(.is-on) .ctl-icon-cam-off,
.control-btn[data-control="camera"].is-on .ctl-icon-cam-on {
    display: none;
}
.control-btn[data-control="mute"]:not(.is-on) .ctl-icon-mic-on,
.control-btn[data-control="mute"].is-on .ctl-icon-mic-off,
.control-btn[data-host-action="mute_all"]:not(.is-on) .ctl-icon-mic-on,
.control-btn[data-host-action="mute_all"].is-on .ctl-icon-mic-off,
.control-btn[data-control="camera"]:not(.is-on) .ctl-icon-cam-on,
.control-btn[data-control="camera"].is-on .ctl-icon-cam-off {
    display: block;
}
.control-btn[data-host-action="lock"]:not(.is-on) .ctl-icon-lock-closed,
.control-btn[data-host-action="lock"].is-on .ctl-icon-lock-open {
    display: none;
}
.control-btn[data-host-action="lock"]:not(.is-on) .ctl-icon-lock-open,
.control-btn[data-host-action="lock"].is-on .ctl-icon-lock-closed {
    display: block;
}
@media (max-width: 640px) {
    .control-btn .icon {
        width: 1.35rem;
        height: 1.35rem;
    }
    .control-btn .icon .ctl-icon {
        width: 1.2rem;
        height: 1.2rem;
    }
}
.control-btn:hover { background: rgba(255, 255, 255, 0.08); }
.control-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.control-btn:active { transform: scale(0.96); }
.control-btn.is-on {
    background: rgba(244, 63, 94, 0.18);
    border-color: rgba(244, 63, 94, 0.5);
    color: #fecdd3;
}
[data-control="share"].is-on,
[data-control="record"].is-on,
[data-control="captions"].is-on,
[data-control="raise_hand"].is-on,
[data-control="blur"].is-on {
    background: rgba(124, 108, 240, 0.22);
    border-color: rgba(124, 108, 240, 0.5);
    color: #e0e7ff;
}
.control-dock .control-btn.is-on {
    position: relative;
    z-index: 1;
}
.control-dock .control-btn[data-control="mute"].is-on,
.control-dock .control-btn[data-control="camera"].is-on {
    box-shadow:
        0 0 0 2px rgba(244, 63, 94, 0.5),
        0 6px 22px rgba(244, 63, 94, 0.28);
}
.control-dock [data-control="share"].is-on,
.control-dock [data-control="record"].is-on,
.control-dock [data-control="captions"].is-on,
.control-dock [data-control="raise_hand"].is-on,
.control-dock [data-control="blur"].is-on {
    box-shadow:
        0 0 0 2px rgba(167, 139, 250, 0.55),
        0 6px 24px rgba(124, 108, 240, 0.32);
}
.control-dock .control-btn[data-host-action="lock"].is-on {
    background: rgba(245, 158, 11, 0.22);
    border-color: rgba(251, 191, 36, 0.55);
    color: #fef3c7;
    box-shadow:
        0 0 0 2px rgba(245, 158, 11, 0.45),
        0 6px 22px rgba(245, 158, 11, 0.22);
}
.control-leave {
    background: linear-gradient(135deg, var(--danger), #be123c);
    color: #fff;
}
.control-leave:hover { background: linear-gradient(135deg, #f43f5e, #9f1239); }

.reaction-menu {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    display: none;
    grid-template-columns: repeat(6, auto);
    gap: 0.25rem;
    padding: 0.45rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(7, 9, 16, 0.92);
    box-shadow: var(--shadow-lg);
    z-index: 30;
}
.reaction-menu.is-open { display: grid; transform: translateX(-50%) translateY(0); }
.reaction-menu button {
    border: 0;
    background: transparent;
    font-size: 1.4rem;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.12s ease, transform 0.12s ease;
}
.reaction-menu button:hover { background: rgba(255, 255, 255, 0.08); transform: scale(1.1); }

.room-shortcuts {
    text-align: center;
    font-size: 0.8rem;
    margin: 0;
}

.room-shortcuts kbd {
    display: inline-block;
    padding: 0.12rem 0.4rem;
    margin: 0 0.1rem;
    font-family: var(--mono);
    font-size: 0.72rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.35);
    color: #e2e8f0;
}

/* Sidebar tabs */
.room-side {
    display: flex;
    flex-direction: column;
    min-height: 420px;
    max-height: min(72vh, 760px);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    overscroll-behavior: contain;
}
@media (min-width: 960px) {
    .room-body { grid-template-columns: 1fr minmax(300px, min(400px, 38vw)); }
    .room-side {
        max-height: calc(100dvh - var(--header-h) - 2.5rem - env(safe-area-inset-bottom, 0px));
        align-self: stretch;
        box-shadow:
            0 1px 0 rgba(255, 255, 255, 0.06) inset,
            -6px 0 24px rgba(0, 0, 0, 0.12);
    }
    .tab-close { display: none !important; }
}
@media (max-width: 959px) {
    body.room-page.room-sidebar-open {
        overflow: hidden;
    }
    .room-side {
        position: fixed;
        right: 0;
        top: var(--header-h);
        bottom: 0;
        width: min(400px, 100vw - env(safe-area-inset-left, 0px));
        max-width: 100%;
        transform: translateX(110%);
        z-index: 60;
        border-radius: 16px 0 0 16px;
        border-right: 0;
        box-shadow: -12px 0 48px rgba(0, 0, 0, 0.28);
        max-height: none;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        min-height: 0;
    }
    .room-side.is-open { transform: translateX(0); }
    .room-side .chat-log {
        max-height: none;
        flex: 1 1 auto;
        min-height: min(180px, 40vh);
    }
    .tab-close {
        flex: 0 0 auto;
        margin-left: auto;
        background: transparent;
        color: var(--muted);
        font-size: 1rem;
        min-width: 44px;
        min-height: 44px;
    }
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 59;
    border: 0;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.sidebar-backdrop.is-on { opacity: 1; pointer-events: auto; }
@media (max-width: 959px) {
    .sidebar-backdrop {
        top: var(--header-h);
    }
}
@media (min-width: 960px) {
    .sidebar-backdrop { display: none !important; }
}

.room-stage { display: flex; flex-direction: column; gap: 1rem; min-height: 0; position: relative; }

/* Fullscreen video stage (native API or soft fallback for iOS / strict browsers) */
#videoStage:fullscreen,
#videoStage:-webkit-full-screen,
#videoStage.is-soft-fullscreen {
    width: 100%;
    max-width: 100vw;
    height: 100%;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: max(0.65rem, env(safe-area-inset-top)) max(0.85rem, env(safe-area-inset-right)) max(0.85rem, env(safe-area-inset-bottom)) max(0.85rem, env(safe-area-inset-left));
    overflow: auto;
    background: linear-gradient(165deg, #0c1022 0%, #070a14 55%, #0a0e1a 100%);
    box-shadow: none;
    z-index: 100;
}
#videoStage.is-soft-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 200;
}
#videoStage:fullscreen .video-grid,
#videoStage:-webkit-full-screen .video-grid,
#videoStage.is-soft-fullscreen .video-grid {
    flex: 1 1 auto;
    min-height: min(62dvh, 780px);
}
#videoStage:fullscreen .video-grid.is-speaker.has-filmstrip,
#videoStage:-webkit-full-screen .video-grid.is-speaker.has-filmstrip,
#videoStage.is-soft-fullscreen .video-grid.is-speaker.has-filmstrip {
    min-height: 0;
}
#videoStage:fullscreen .caption-track,
#videoStage:-webkit-full-screen .caption-track,
#videoStage.is-soft-fullscreen .caption-track {
    bottom: max(5rem, calc(env(safe-area-inset-bottom) + 4.5rem));
}
body.room-page.app-page #videoStage:fullscreen,
body.room-page.app-page #videoStage:-webkit-full-screen,
body.room-page.app-page #videoStage.is-soft-fullscreen {
    background: linear-gradient(165deg, #f1f5fb 0%, #e8f1fb 45%, #eef4fc 100%);
}
html.room-stage-soft-fs,
body.room-stage-soft-fs {
    overflow: hidden;
    overscroll-behavior: none;
}

.header-room-info .room-id-pill .room-id-code-btn {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.12);
}
.header-room-info .room-id-pill .room-id-code-btn:hover {
    background: rgba(0, 0, 0, 0.42);
    border-color: rgba(255, 255, 255, 0.2);
    filter: none;
}

.tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.25rem;
    padding: 0.2rem;
    margin: -0.25rem -0.25rem 0.75rem;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.tab {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.55rem 0.5rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.tab:hover { color: var(--text); }
.tabs .tab.tab-close {
    flex: 0 0 auto;
    min-width: 2.75rem;
}
.tab.is-active {
    background: rgba(124, 108, 240, 0.22);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tab-panel { display: none; flex: 1; flex-direction: column; min-height: 0; }
.tab-panel.is-active { display: flex; }

.chat-log {
    flex: 1;
    min-height: 200px;
    max-height: 340px;
    overflow-y: auto;
    padding: 0.65rem;
    margin-bottom: 0.65rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    scroll-behavior: smooth;
}

.chat-row {
    display: flex;
    margin-bottom: 0.55rem;
    animation: chatIn 0.22s ease;
}
@keyframes chatIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
.chat-row--self { justify-content: flex-end; }
.chat-bubble {
    max-width: 92%;
    padding: 0.55rem 0.75rem;
    border-radius: 14px 14px 14px 6px;
    font-size: 0.9rem;
    line-height: 1.45;
    border: 1px solid var(--border);
    background: var(--surface-2);
}
.chat-row--self .chat-bubble {
    border-radius: 14px 14px 6px 14px;
    background: linear-gradient(135deg, rgba(124, 108, 240, 0.35), rgba(91, 76, 219, 0.25));
    border-color: rgba(124, 108, 240, 0.35);
}
.chat-bubble .who { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #a5b4fc; margin-bottom: 0.2rem; }
.chat-bubble a { word-break: break-all; }

.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; align-items: stretch; }
.chat-form input { margin: 0; }
.chat-form .btn { padding: 0.55rem 0.95rem; }
.chat-form .btn .action-label { display: inline; }
@media (max-width: 480px) {
    .chat-form .btn .action-label { display: none; }
    .chat-form .btn { min-width: 44px; }
}

.chat-typing {
    min-height: 1.05rem;
    margin: 0 0 0.45rem;
    font-size: 0.75rem;
    font-style: italic;
    color: var(--muted);
    opacity: 0;
    transition: opacity 0.15s ease;
}
.chat-typing.is-on { opacity: 1; }

.chat-file-form {
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.file-pick {
    position: relative;
    display: block;
    cursor: pointer;
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--muted);
    font-size: 0.85rem;
    text-align: center;
    transition: border-color 0.15s, color 0.15s;
}
.file-pick:hover { border-color: rgba(124, 108, 240, 0.45); color: var(--text); }
.file-pick input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.file-pick-label { pointer-events: none; }
.file-input-wrap input[type="file"] { padding: 0.45rem; font-size: 0.85rem; }

.participants-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.participants-list li {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 0.6rem;
    align-items: center;
    padding: 0.55rem 0.65rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.15);
    transition: border-color 0.15s ease;
}
.participants-list li.is-speaking { border-color: rgba(52, 211, 153, 0.6); }
.participants-list .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #5b4cdb);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.8rem;
}
.participants-list .who { display: flex; flex-direction: column; }
.participants-list .name { font-weight: 600; }
.participants-list .role { font-size: 0.72rem; color: var(--muted); }
.participants-list .status { display: inline-flex; gap: 0.25rem; }
.participants-list .status .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted);
}
.participants-list .status .dot.is-on { background: var(--success); }
.participants-list .status .dot.is-off { background: var(--danger); }
.participants-list .status .dot.is-hand { width: auto; height: auto; background: transparent; font-size: 0.95rem; line-height: 1; }
.participants-list .actions { display: inline-flex; gap: 0.25rem; flex-wrap: wrap; justify-content: flex-end; }
.participants-list .actions .btn { padding: 0.25rem 0.5rem; font-size: 0.7rem; }
.btn.btn-xs { padding: 0.25rem 0.5rem; font-size: 0.72rem; border-radius: 8px; }
.icon-only { width: 38px; height: 38px; padding: 0; display: inline-grid; place-items: center; position: relative; }
.participants-list li.is-self { background: rgba(124, 108, 240, 0.08); }
.participants-list .status .dot.is-screen { background: transparent; font-size: 0.95rem; line-height: 1; width: auto; height: auto; }
.participants-list .status .dot { font-size: 0.78rem; line-height: 1; }
@media (max-width: 480px) {
    .participants-list li {
        grid-template-columns: auto 1fr auto;
    }
    .participants-list .actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
        margin-top: 0.35rem;
    }
}

.tab-badge {
    display: inline-block;
    margin-left: 0.35rem;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 0.68rem;
    line-height: 18px;
    text-align: center;
    font-weight: 700;
}
.tab-badge--host,
.tab-badge.is-waiting {
    background: linear-gradient(135deg, #e8c47a, #b45309);
    color: #0f0b06;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}
#sidebarToggleBadge.is-waiting {
    background: linear-gradient(135deg, #e8c47a, #b45309);
    color: #0f0b06;
}

.host-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.4rem 0 0.6rem; }

.chat-bubble .ts { margin-top: 0.25rem; font-size: 0.65rem; color: var(--muted); }
.chat-bubble .body { white-space: pre-wrap; word-break: break-word; }

.host-panel h4 { margin: 0 0 0.65rem; font-size: 0.95rem; }
.waiting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.65rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: 0.45rem;
    background: rgba(0, 0, 0, 0.15);
}

.hint-box {
    margin-top: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--muted);
    border: 1px dashed var(--border);
}

/* Toasts */
.toast-root {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: min(360px, calc(100vw - 2rem));
    pointer-events: none;
}
.toast {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    background: rgba(18, 24, 44, 0.95);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.9rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast--show { opacity: 1; transform: translateY(0); }
.toast--success { border-color: rgba(52, 211, 153, 0.4); }
.toast--error { border-color: rgba(244, 63, 94, 0.45); }

/* Waiting room */
.waiting-page { min-height: 60dvh; display: flex; align-items: center; justify-content: center; }
.waiting-card { width: min(440px, 100%); text-align: center; }
.waiting-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    animation: spin 0.85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 768px) {
    .site-header--auth .site-nav.site-nav--auth-drawer {
        display: none !important;
    }
    .site-header--auth .site-nav.site-nav--auth-drawer.open {
        display: none !important;
    }
    .site-header--auth .nav-toggle--auth {
        display: none !important;
    }
    .site-header--auth .header-user-desktop {
        display: flex;
    }

    .site-header:not(.site-header--auth) .site-nav {
        display: flex;
        flex-direction: row;
        align-items: center;
        position: static;
        min-width: unset;
        padding: 0;
        background: transparent;
        border: 0;
        box-shadow: none;
        gap: 0.35rem;
    }
    .site-header:not(.site-header--auth) .nav-toggle {
        display: none;
    }
    .nav-link { padding: 0.45rem 0.65rem; }
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
    .hero { grid-template-columns: 1.15fr 0.85fr; align-items: center; }
}

/* === Settings modal ===================================================== */
.modal-root {
    position: fixed;
    inset: 0;
    z-index: 220;
    display: grid;
    place-items: center;
    padding: 1rem;
}
.modal-root[hidden] { display: none !important; }
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    cursor: pointer;
}
.modal-card {
    position: relative;
    width: min(460px, 100%);
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: linear-gradient(165deg, rgba(26, 34, 56, 0.97), rgba(12, 16, 32, 0.99));
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.18s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: none; }
}
.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.15rem 0.4rem;
}
.modal-head h3 { margin: 0; font-size: 1.05rem; }
.modal-body { padding: 0.4rem 1.15rem 1rem; display: flex; flex-direction: column; gap: 0.7rem; }
.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.6rem 1.15rem 1rem;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.18);
}
.field { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; }
.field span { color: var(--muted); }
.field select { margin: 0; }
.field-check { flex-direction: row; align-items: center; gap: 0.5rem; }
.field-check input { width: auto; margin: 0; }

/* === Click-to-enable-audio overlay ====================================== */
.enable-audio-overlay {
    position: absolute;
    z-index: 30;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 1.1rem;
    border-radius: 999px;
    border: 1px solid rgba(124, 108, 240, 0.6);
    background: rgba(7, 9, 16, 0.92);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
    animation: pulseSoft 2.6s ease infinite;
}
.enable-audio-overlay[hidden] { display: none !important; }
.enable-audio-icon { font-size: 1.15rem; }
@keyframes pulseSoft {
    0%, 100% { box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 0 0 rgba(124, 108, 240, 0.45); }
    50% { box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 0 14px rgba(124, 108, 240, 0); }
}

/* === Mobile-first finishing touches ===================================== */
@media (max-width: 640px) {
    body.room-page .container {
        padding-left: max(0.55rem, env(safe-area-inset-left));
        padding-right: max(0.55rem, env(safe-area-inset-right));
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
    }
    .room-shell {
        min-height: calc(100dvh - var(--header-h) - 1.25rem);
        gap: 0.65rem;
    }
    .room-body { min-height: 0; flex: 1; display: flex; flex-direction: column; }
    .room-stage {
        padding: 0.65rem 0.5rem 0.85rem;
        gap: 0.65rem;
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }
    #videoStage.card.room-stage {
        border-radius: 14px;
    }
    .room-shortcuts { display: none; }
    .video-tile:not(.is-screen) { min-height: 0; }
    .room-stage .video-grid {
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
    }
    .reaction-menu { grid-template-columns: repeat(3, auto); }
    .caption-track { bottom: 5.5rem; font-size: 0.85rem; padding: 0.45rem 0.75rem; }
    .modal-card { max-width: calc(100vw - 1rem); }
    .toast-root { right: 0.5rem; bottom: 0.5rem; left: 0.5rem; max-width: none; }
}

/* Pointer & touch tweaks */
@media (hover: none) {
    .video-tile .tile-pin { opacity: 0.6; }
}

/* Reduce motion considerations already in :root */

/* === Home + auth + app shell: logo palette blue + red + white ============ */
body.home-page,
body.auth-page,
body.app-page {
    color-scheme: light;
    --nt-blue: #153e75;
    --nt-blue-bright: #2563eb;
    --nt-red: #d9263e;
    --nt-red-deep: #b31930;
    --bg: #eef4fc;
    --bg-elevated: #ffffff;
    --text: #000000;
    --muted: #262626;
    --border: rgba(27, 74, 140, 0.14);
    --surface: #ffffff;
    --surface-2: #f1f5fb;
    --primary: var(--nt-blue-bright);
    --primary-hover: #1d4ed8;
    --ring: rgba(37, 99, 235, 0.35);
}

body.home-page,
body.auth-page,
body.app-page {
    color: var(--text);
    background:
        radial-gradient(900px 520px at 88% 6%, rgba(217, 38, 61, 0.09), transparent 52%),
        radial-gradient(720px 460px at 2% 78%, rgba(37, 99, 235, 0.11), transparent 52%),
        radial-gradient(520px 360px at 48% -8%, rgba(255, 255, 255, 0.95), transparent 58%),
        linear-gradient(168deg, #fbfcff 0%, #e8f1fb 45%, #f3f7ff 100%);
}

body.home-page a,
body.auth-page a,
body.app-page a {
    color: var(--nt-blue-bright);
    font-weight: 500;
}
body.home-page a:hover,
body.auth-page a:hover,
body.app-page a:hover {
    color: var(--nt-red);
    text-decoration: none;
}

body.home-page .site-header,
body.auth-page .site-header,
body.app-page .site-header {
    background: rgba(255, 255, 255, 0.82);
    border-bottom-color: rgba(27, 74, 140, 0.12);
    backdrop-filter: blur(16px) saturate(1.12);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75) inset;
}

body.home-page .brand,
body.auth-page .brand,
body.app-page .brand {
    color: var(--text);
}
body.home-page .brand:hover,
body.auth-page .brand:hover,
body.app-page .brand:hover {
    color: var(--text);
    text-decoration: none;
}
body.home-page .brand-text,
body.auth-page .brand-text,
body.app-page .brand-text {
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    color: #000;
    font-weight: 800;
    letter-spacing: -0.03em;
}

body.home-page .brand-mark,
body.auth-page .brand-mark,
body.app-page .brand-mark {
    width: 44px;
    height: 44px;
    filter: drop-shadow(0 2px 10px rgba(27, 74, 140, 0.18));
}

body.home-page .nav-link,
body.auth-page .nav-link,
body.app-page .nav-link {
    color: #000;
    font-weight: 600;
}
body.home-page .nav-link:hover,
body.auth-page .nav-link:hover,
body.app-page .nav-link:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--nt-blue-bright);
}
body.home-page .nav-toggle,
body.auth-page .nav-toggle,
body.app-page .nav-toggle {
    background: #fff;
    border-color: rgba(27, 74, 140, 0.18);
    color: var(--text);
}
body.home-page .nav-toggle:hover,
body.auth-page .nav-toggle:hover,
body.app-page .nav-toggle:hover {
    border-color: rgba(37, 99, 235, 0.35);
    background: #f8fafc;
}
body.home-page .site-nav,
body.auth-page .site-nav,
body.app-page .site-nav {
    background: #fff;
    border-color: rgba(27, 74, 140, 0.14);
    box-shadow: 0 14px 44px rgba(15, 23, 42, 0.12);
}

body.home-page .site-nav-drawer-head,
body.auth-page .site-nav-drawer-head,
body.app-page .site-nav-drawer-head {
    border-bottom-color: rgba(27, 74, 140, 0.12);
}

body.home-page .nav-dropdown,
body.auth-page .nav-dropdown,
body.app-page .nav-dropdown {
    background: #fff;
    border-color: rgba(27, 74, 140, 0.14);
    box-shadow: 0 14px 44px rgba(15, 23, 42, 0.14);
}
body.home-page .nav-dropdown-name,
body.auth-page .nav-dropdown-name,
body.app-page .nav-dropdown-name {
    color: #000;
}
body.home-page .nav-dropdown-item,
body.auth-page .nav-dropdown-item,
body.app-page .nav-dropdown-item {
    color: #0f172a;
}
body.home-page a.nav-dropdown-item:hover,
body.home-page button.nav-dropdown-item:hover,
body.auth-page a.nav-dropdown-item:hover,
body.auth-page button.nav-dropdown-item:hover,
body.app-page a.nav-dropdown-item:hover,
body.app-page button.nav-dropdown-item:hover {
    background: rgba(37, 99, 235, 0.08);
    color: #000;
}
body.home-page .nav-dropdown-item--accent,
body.auth-page .nav-dropdown-item--accent,
body.app-page .nav-dropdown-item--accent {
    color: var(--nt-blue-bright);
}
body.home-page .nav-dropdown-item--danger,
body.auth-page .nav-dropdown-item--danger,
body.app-page .nav-dropdown-item--danger {
    color: var(--nt-red);
}
body.home-page .nav-dropdown-item--danger:hover,
body.auth-page .nav-dropdown-item--danger:hover,
body.app-page .nav-dropdown-item--danger:hover {
    background: rgba(217, 38, 61, 0.1);
    color: #991b1b;
}
body.home-page .nav-dropdown-divider,
body.auth-page .nav-dropdown-divider,
body.app-page .nav-dropdown-divider {
    background: rgba(27, 74, 140, 0.12);
}
body.home-page .nav-dropdown-head,
body.auth-page .nav-dropdown-head,
body.app-page .nav-dropdown-head {
    border-bottom-color: rgba(27, 74, 140, 0.12);
}

body.home-page .user-menu-trigger,
body.auth-page .user-menu-trigger,
body.app-page .user-menu-trigger {
    background: linear-gradient(145deg, rgba(37, 99, 235, 0.2), rgba(217, 38, 61, 0.1));
    box-shadow: 0 0 0 2px rgba(27, 74, 140, 0.15), 0 4px 14px rgba(15, 23, 42, 0.1);
}
body.home-page .user-menu-trigger:hover,
body.auth-page .user-menu-trigger:hover,
body.app-page .user-menu-trigger:hover {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35), 0 6px 18px rgba(15, 23, 42, 0.12);
}

body.home-page .link-btn,
body.auth-page .link-btn,
body.app-page .link-btn {
    color: var(--nt-blue-bright);
}
body.home-page .link-btn:hover,
body.auth-page .link-btn:hover,
body.app-page .link-btn:hover {
    color: var(--nt-red);
}

body.home-page .btn-primary,
body.auth-page .btn-primary,
body.app-page .btn-primary {
    background: linear-gradient(135deg, var(--nt-red) 0%, var(--nt-red-deep) 100%);
    box-shadow: 0 4px 18px rgba(217, 38, 61, 0.3);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.04em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
}
body.home-page .btn-primary:hover,
body.auth-page .btn-primary:hover,
body.app-page .btn-primary:hover {
    background: linear-gradient(135deg, #e6334a, #991b2e);
    color: #fff;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.22);
}

body.home-page .alert,
body.auth-page .alert,
body.app-page .alert {
    background: #fff;
    border-color: rgba(27, 74, 140, 0.16);
    color: var(--text);
}
body.home-page .alert--success,
body.auth-page .alert--success,
body.app-page .alert--success {
    border-color: rgba(22, 163, 74, 0.35);
    color: #14532d;
    background: #f0fdf4;
}
body.home-page .alert--error,
body.auth-page .alert--error,
body.app-page .alert--error {
    border-color: rgba(220, 38, 38, 0.35);
    color: #7f1d1d;
    background: #fef2f2;
}
body.home-page .alert--info,
body.auth-page .alert--info,
body.app-page .alert--info {
    border-color: rgba(37, 99, 235, 0.3);
    color: #1e3a5f;
    background: #eff6ff;
}
body.home-page .alert--warning,
body.auth-page .alert--warning,
body.app-page .alert--warning {
    border-color: rgba(217, 119, 6, 0.4);
    color: #78350f;
    background: #fffbeb;
}

/* Login / signup: light card + fields */
body.auth-page .card.auth-card {
    background: linear-gradient(152deg, #fff 0%, #f8fbff 100%);
    border: 1px solid rgba(27, 74, 140, 0.11);
    box-shadow:
        0 4px 6px -1px rgba(15, 23, 42, 0.05),
        0 22px 48px -14px rgba(27, 74, 140, 0.18),
        0 0 0 1px rgba(255, 255, 255, 0.55) inset;
}
body.auth-page .card.auth-card:hover {
    border-color: rgba(37, 99, 235, 0.22);
}

body.auth-page .auth-card h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: #000;
    font-weight: 800;
    letter-spacing: -0.03em;
    font-size: clamp(1.35rem, 3vw, 1.65rem);
}

body.auth-page .auth-card .muted {
    color: #1a1a1a;
    font-weight: 500;
}

body.auth-page .auth-card a {
    font-weight: 600;
}

body.auth-page .auth-card label {
    color: #000;
    font-weight: 600;
    font-size: 0.875rem;
}

body.auth-page .auth-card form ul:not(.errorlist) {
    margin: 0.35rem 0 0.65rem;
    padding-left: 1.15rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: #262626;
}

body.auth-page .auth-card .errorlist {
    margin: 0.35rem 0 0.5rem;
    padding-left: 0;
    list-style: none;
    color: #b91c1c;
    font-size: 0.85rem;
    font-weight: 500;
}

body.auth-page input,
body.auth-page select,
body.auth-page textarea,
body.app-page input,
body.app-page select,
body.app-page textarea {
    background: #fff;
    color: #000;
    border-color: rgba(27, 74, 140, 0.2);
}
body.auth-page input:focus,
body.auth-page select:focus,
body.auth-page textarea:focus,
body.app-page input:focus,
body.app-page select:focus,
body.app-page textarea:focus {
    border-color: rgba(37, 99, 235, 0.55);
    box-shadow: 0 0 0 3px var(--ring);
}

body.auth-page .auth-wrap {
    padding-top: 1.25rem;
}

body.auth-page code,
body.app-page code {
    background: #f1f5f9;
    color: #0f172a;
    border-color: rgba(27, 74, 140, 0.15);
}

.profile-page-title {
    margin: 0 0 0.35rem;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #000;
}
.profile-section {
    margin-top: 1.25rem;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(27, 74, 140, 0.1);
}
.profile-section:first-of-type {
    margin-top: 0.75rem;
    padding-top: 0;
    border-top: 0;
}
.profile-section-title {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    color: #000;
}
.profile-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.35rem;
}
.profile-readonly {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(27, 74, 140, 0.18);
    background: #f1f5f9;
    color: #0f172a;
    font-weight: 600;
    font-family: inherit;
    font-size: 1rem;
    cursor: not-allowed;
}
.profile-avatar-preview {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}
.profile-avatar-img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(37, 99, 235, 0.25);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}
.profile-avatar-fallback {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--nt-blue-bright, #2563eb), var(--nt-red, #d9263e));
    border: 3px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.profile-file-row input[type="file"] {
    width: 100%;
    margin: 0 0 0.75rem;
    padding: 0.5rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px dashed rgba(27, 74, 140, 0.25);
    background: #fff;
}
.profile-form--stack .profile-field {
    margin-bottom: 0.65rem;
}
.profile-form--stack .profile-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.3rem;
}
.profile-form--stack .profile-field input {
    margin: 0;
}
.profile-field-error {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    color: #b91c1c;
}
.profile-back {
    margin-top: 1.5rem;
    margin-bottom: 0;
}

/* Dashboard, waiting room, and other in-app screens */
body.app-page .card {
    background: linear-gradient(152deg, #fff 0%, #f8fbff 100%);
    border: 1px solid rgba(27, 74, 140, 0.11);
    box-shadow:
        0 4px 6px -1px rgba(15, 23, 42, 0.05),
        0 22px 48px -14px rgba(27, 74, 140, 0.16),
        0 0 0 1px rgba(255, 255, 255, 0.55) inset;
}
body.app-page .card:hover {
    border-color: rgba(37, 99, 235, 0.22);
}

body.app-page .dashboard-hero h1 {
    color: #000;
    font-weight: 800;
    letter-spacing: -0.03em;
}

body.app-page .dashboard-hero .eyebrow {
    color: var(--nt-blue-bright);
}

body.app-page .stat-chip {
    background: #fff;
    border-color: rgba(27, 74, 140, 0.12);
}
body.app-page .stat-chip strong {
    color: #000;
}
body.app-page .stat-chip span {
    color: #262626;
}

body.app-page .btn-secondary {
    background: #fff;
    color: #000;
    border: 1px solid rgba(27, 74, 140, 0.25);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}
body.app-page .btn-secondary:hover {
    background: #f1f5fb;
    color: #000;
    border-color: rgba(37, 99, 235, 0.45);
    text-decoration: none;
}

body.app-page .btn-ghost {
    background: rgba(255, 255, 255, 0.75);
    color: #000;
    border-color: rgba(27, 74, 140, 0.2);
}
body.app-page .btn-ghost:hover {
    color: #000;
    background: #fff;
    border-color: rgba(37, 99, 235, 0.35);
    text-decoration: none;
}

body.app-page .pill {
    background: #f1f5f9;
    color: #0f172a;
    border-color: rgba(27, 74, 140, 0.15);
}
body.app-page .pill-active {
    background: rgba(22, 163, 74, 0.12);
    color: #166534;
    border-color: rgba(22, 163, 74, 0.35);
}

body.app-page .table-wrap {
    border-color: rgba(27, 74, 140, 0.12);
    background: #fff;
}
body.app-page table th {
    background: rgba(241, 245, 249, 0.98);
    color: #475569;
    border-bottom-color: rgba(27, 74, 140, 0.12);
}
body.app-page table td {
    color: #0f172a;
    border-bottom-color: rgba(27, 74, 140, 0.1);
}
body.app-page tr:hover td {
    background: rgba(37, 99, 235, 0.06);
}

body.app-page .empty-state {
    color: #262626;
}
body.app-page .empty-state strong {
    color: #000;
}
body.app-page .empty-state-icon {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(217, 38, 61, 0.1));
    border-color: rgba(27, 74, 140, 0.15);
}

body.app-page .waiting-page {
    padding-top: 0.5rem;
}
body.app-page .waiting-card {
    text-align: center;
}
body.app-page .waiting-card h1 {
    color: #000;
    font-weight: 800;
}

body.app-page .card.auth-card {
    background: linear-gradient(152deg, #fff 0%, #f8fbff 100%);
    border: 1px solid rgba(27, 74, 140, 0.11);
    box-shadow:
        0 4px 6px -1px rgba(15, 23, 42, 0.05),
        0 22px 48px -14px rgba(27, 74, 140, 0.18),
        0 0 0 1px rgba(255, 255, 255, 0.55) inset;
}
body.app-page .card.auth-card:hover {
    border-color: rgba(37, 99, 235, 0.22);
}

/* Meeting room + brand light (video tiles stay dark for contrast) */
body.room-page.app-page .header-room-info {
    color: #334155;
}
body.room-page.app-page .header-room-info strong {
    color: #0f172a;
}
body.room-page.app-page .header-room-sep {
    color: #94a3b8;
}
body.room-page.app-page .room-meta-host {
    color: #1e293b;
}
body.room-page.app-page .room-meta-count {
    color: #0f172a;
}
body.room-page.app-page .site-header .header-room-toolbar {
    border-top-color: rgba(27, 74, 140, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
}
body.room-page.app-page .header-room-actions {
    gap: 0.4rem;
}
@media (max-width: 640px) {
    body.room-page.app-page .header-room-actions {
        flex-basis: 100%;
        justify-content: flex-end;
    }
    body.room-page.app-page .header-room-line {
        font-size: 0.78rem;
    }
}
body.room-page.app-page .header-room-info .room-id-pill .room-id-code-btn {
    background: rgba(37, 99, 235, 0.1);
    color: #0f172a;
    border: 1px solid rgba(27, 74, 140, 0.15);
}
body.room-page.app-page .header-room-info .room-id-pill .room-id-code-btn:hover {
    background: rgba(37, 99, 235, 0.16);
    border-color: rgba(27, 74, 140, 0.28);
    filter: none;
}
body.room-page.app-page .connection-pill {
    color: #475569;
}
body.room-page.app-page .connection-pill::before {
    background: #94a3b8;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}
body.room-page.app-page .connection-pill.is-live {
    color: #166534;
}
body.room-page.app-page .connection-pill.is-live::before {
    box-shadow: 0 0 10px rgba(22, 163, 74, 0.45);
}

body.room-page.app-page .video-tile {
    border-color: rgba(27, 74, 140, 0.28);
}
body.room-page.app-page .video-tile--local {
    border-color: rgba(37, 99, 235, 0.55);
}

body.room-page.app-page .stage-share-banner {
    color: #1e3a5f;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(124, 108, 240, 0.12));
    border-color: rgba(37, 99, 235, 0.28);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

body.room-page.app-page .control-dock {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(27, 74, 140, 0.18);
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.1);
    backdrop-filter: blur(14px) saturate(1.2);
}
body.room-page.app-page .control-btn {
    background: rgba(241, 245, 249, 0.95);
    color: #0f172a;
    border: 1px solid rgba(27, 74, 140, 0.12);
}
body.room-page.app-page .control-btn .label {
    color: #0f172a;
    font-weight: 700;
    letter-spacing: 0.01em;
}
body.room-page.app-page .control-btn:hover {
    background: #fff;
    color: #000;
}
body.room-page.app-page .control-btn:hover .label {
    color: #000;
}
body.room-page.app-page .control-btn.is-on {
    background: rgba(217, 38, 61, 0.1);
    border-color: rgba(217, 38, 61, 0.45);
    color: #9f1239;
}
body.room-page.app-page [data-control="share"].is-on,
body.room-page.app-page [data-control="record"].is-on,
body.room-page.app-page [data-control="captions"].is-on,
body.room-page.app-page [data-control="raise_hand"].is-on,
body.room-page.app-page [data-control="blur"].is-on {
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.45);
    color: #1e40af;
}
body.room-page.app-page .control-dock .control-btn[data-control="mute"].is-on,
body.room-page.app-page .control-dock .control-btn[data-control="camera"].is-on {
    box-shadow:
        0 0 0 2px rgba(217, 38, 61, 0.42),
        0 6px 22px rgba(217, 38, 61, 0.2);
}
body.room-page.app-page .control-dock [data-control="share"].is-on,
body.room-page.app-page .control-dock [data-control="record"].is-on,
body.room-page.app-page .control-dock [data-control="captions"].is-on,
body.room-page.app-page .control-dock [data-control="raise_hand"].is-on,
body.room-page.app-page .control-dock [data-control="blur"].is-on {
    box-shadow:
        0 0 0 2px rgba(37, 99, 235, 0.42),
        0 6px 22px rgba(37, 99, 235, 0.22);
}
body.room-page.app-page .control-dock .control-btn[data-host-action="lock"].is-on {
    background: rgba(217, 119, 6, 0.18);
    border-color: rgba(217, 119, 6, 0.55);
    color: #92400e;
    box-shadow:
        0 0 0 2px rgba(217, 119, 6, 0.4),
        0 6px 22px rgba(217, 119, 6, 0.18);
}
body.room-page.app-page .control-dock .control-btn[data-host-action="lock"].is-on .label {
    color: #92400e;
}

body.room-page.app-page .reaction-menu {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(27, 74, 140, 0.15);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
}
body.room-page.app-page .reaction-menu button:hover {
    background: rgba(37, 99, 235, 0.1);
}

body.room-page.app-page .room-shortcuts {
    color: #334155;
}
body.room-page.app-page .room-shortcuts kbd {
    background: #fff;
    border-color: rgba(27, 74, 140, 0.2);
    color: #0f172a;
}

body.room-page.app-page .tabs {
    background: rgba(241, 245, 249, 0.95);
    border-color: rgba(27, 74, 140, 0.12);
}
body.room-page.app-page .tab {
    color: #475569;
}
body.room-page.app-page .tab:hover {
    color: #000;
}
body.room-page.app-page .tab.is-active {
    background: rgba(37, 99, 235, 0.14);
    color: #1e40af;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

body.room-page.app-page .chat-bubble .who {
    color: var(--nt-blue-bright);
}
body.room-page.app-page .chat-row--self .chat-bubble {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(217, 38, 61, 0.08));
    border-color: rgba(37, 99, 235, 0.22);
}
body.room-page.app-page .file-pick {
    background: #fff;
    border-color: rgba(27, 74, 140, 0.22);
    color: #475569;
}
body.room-page.app-page .file-pick:hover {
    color: #000;
    border-color: rgba(37, 99, 235, 0.4);
}

body.room-page.app-page .participants-list li {
    background: #fff;
    border-color: rgba(27, 74, 140, 0.12);
}
body.room-page.app-page .participants-list li.is-self {
    background: rgba(37, 99, 235, 0.06);
}

body.room-page.app-page .room-side {
    border-color: rgba(27, 74, 140, 0.12);
}
@media (max-width: 959px) {
    body.room-page.app-page .room-side {
        background: linear-gradient(180deg, #fff 0%, #f3f7ff 100%);
        box-shadow: -8px 0 40px rgba(15, 23, 42, 0.12);
    }
}

body.room-page.app-page .tab-close {
    color: #475569;
}

body.room-page.app-page .modal-card {
    background: linear-gradient(152deg, #fff 0%, #f8fbff 100%);
    border-color: rgba(27, 74, 140, 0.14);
    color: #000;
}
body.room-page.app-page .modal-head h3 {
    color: #000;
}
body.room-page.app-page .modal-foot {
    background: rgba(241, 245, 249, 0.9);
    border-top-color: rgba(27, 74, 140, 0.12);
}
body.room-page.app-page .modal-card .field span {
    color: #475569;
}

body.room-page.app-page .enable-audio-overlay {
    background: rgba(255, 255, 255, 0.96);
    color: #0f172a;
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 12px 36px rgba(27, 74, 140, 0.18);
}
body.room-page.app-page .enable-audio-overlay:hover {
    border-color: rgba(217, 38, 61, 0.45);
}

body.room-page.app-page .toast {
    background: #fff;
    border-color: rgba(27, 74, 140, 0.16);
    color: #0f172a;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.12);
}

body.room-page.app-page .host-panel h4 {
    color: #000;
}
body.room-page.app-page .waiting-item {
    background: #fff;
    border-color: rgba(27, 74, 140, 0.12);
}
body.room-page.app-page .hint-box {
    background: rgba(241, 245, 249, 0.75);
    color: #475569;
    border-color: rgba(27, 74, 140, 0.2);
}

.home-wrap {
    padding-bottom: 2.5rem;
}

.home-hero {
    display: grid;
    gap: 2rem;
    padding: 0.35rem 0 2.25rem;
    align-items: center;
}

.home-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.85rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #000;
}
.home-eyebrow-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--nt-red), var(--nt-blue-bright));
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.home-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1.06;
    letter-spacing: -0.04em;
    font-weight: 800;
    margin: 0 0 1rem;
    color: #000;
}
.home-title-accent {
    color: #000;
    font-weight: 800;
}

.home-lead {
    margin: 0 0 1.5rem;
    font-size: clamp(1rem, 1.45vw, 1.125rem);
    line-height: 1.65;
    color: #1a1a1a;
    max-width: 36rem;
    font-weight: 500;
}

.home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

.btn-home-cta {
    padding: 0.78rem 1.45rem;
    font-size: 0.9375rem;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--nt-red) 0%, var(--nt-red-deep) 100%);
    color: #fff !important;
    font-weight: 800;
    letter-spacing: 0.03em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
    box-shadow:
        0 6px 24px rgba(217, 38, 61, 0.34),
        0 1px 0 rgba(255, 255, 255, 0.22) inset;
    text-decoration: none !important;
    transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.15s ease;
}
.btn-home-cta:hover {
    filter: brightness(1.06);
    box-shadow: 0 10px 32px rgba(217, 38, 61, 0.38);
    color: #fff !important;
    text-decoration: none !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.btn-home-secondary {
    padding: 0.78rem 1.45rem;
    font-size: 0.9375rem;
    border-radius: 999px;
    background: #fff;
    border: 2px solid rgba(0, 0, 0, 0.12);
    color: #000 !important;
    font-weight: 700;
    letter-spacing: 0.04em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    text-decoration: none !important;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.btn-home-secondary:hover {
    background: #fafafa;
    border-color: rgba(37, 99, 235, 0.45);
    color: #000 !important;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12);
    text-decoration: none !important;
}

.home-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.home-chips li {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #000;
    padding: 0.38rem 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(27, 74, 140, 0.1);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.home-hero-panel {
    position: relative;
    justify-self: center;
    width: 100%;
    max-width: 420px;
}
.home-panel-glow {
    position: absolute;
    inset: -18% -12% -8%;
    background:
        radial-gradient(circle at 45% 35%, rgba(37, 99, 235, 0.22), transparent 55%),
        radial-gradient(circle at 82% 78%, rgba(217, 38, 61, 0.16), transparent 42%);
    filter: blur(1px);
    z-index: 0;
    pointer-events: none;
}
.home-panel {
    position: relative;
    z-index: 1;
    background: linear-gradient(152deg, #fff 0%, #f8fbff 100%);
    border: 1px solid rgba(27, 74, 140, 0.11);
    border-radius: 20px;
    padding: 1.5rem 1.5rem 1.35rem;
    box-shadow:
        0 4px 6px -1px rgba(15, 23, 42, 0.05),
        0 22px 48px -14px rgba(27, 74, 140, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.55) inset;
}
.home-panel-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid rgba(27, 74, 140, 0.1);
}
.home-panel-logo {
    width: 96px;
    height: 96px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 14px rgba(15, 23, 42, 0.12));
}
.home-panel-label {
    margin: 0;
    font-size: 1.22rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #000;
}
.home-panel-sub {
    margin: 0.2rem 0 0;
    font-size: 0.875rem;
    color: #1a1a1a;
    font-weight: 600;
}
.home-panel-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.78rem;
    font-size: 0.94rem;
    line-height: 1.48;
    color: #000;
    font-weight: 500;
}
.home-panel-list li {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
}
.home-check {
    flex-shrink: 0;
    width: 1.35rem;
    height: 1.35rem;
    display: grid;
    place-items: center;
    margin-top: 0.08rem;
    font-size: 0.62rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--nt-blue-bright), var(--nt-blue));
    border-radius: 7px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}

.home-features {
    display: grid;
    gap: 1.1rem;
    grid-template-columns: 1fr;
}
.home-feature {
    background: #fff;
    border: 1px solid rgba(27, 74, 140, 0.1);
    border-radius: 18px;
    padding: 1.35rem 1.45rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}
.home-feature:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 44px -14px rgba(27, 74, 140, 0.22);
    border-color: rgba(37, 99, 235, 0.22);
}
.home-feature h3 {
    margin: 0 0 0.5rem;
    font-size: 1.06rem;
    font-weight: 800;
    color: #000;
    letter-spacing: -0.02em;
}
.home-feature p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #1a1a1a;
    font-weight: 500;
}
.home-feature-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    margin-bottom: 0.95rem;
    line-height: 1;
}
.home-feature-icon--blue {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(37, 99, 235, 0.04));
    color: var(--nt-blue-bright);
    border: 1px solid rgba(37, 99, 235, 0.2);
}
.home-feature-icon--red {
    background: linear-gradient(135deg, rgba(217, 38, 61, 0.14), rgba(217, 38, 61, 0.04));
    border: 1px solid rgba(217, 38, 61, 0.22);
    color: var(--nt-red);
}

.home-band {
    margin-top: 2.75rem;
    border-radius: 22px;
    overflow: hidden;
    background: linear-gradient(118deg, var(--nt-blue) 0%, var(--nt-blue-bright) 36%, #5b7cfa 58%, var(--nt-red) 100%);
    padding: 1px;
    box-shadow: 0 18px 50px -10px rgba(27, 74, 140, 0.38);
}
.home-band-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    text-align: center;
    padding: 2rem 1.5rem;
    border-radius: 21px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.05) 100%);
}
.home-band-text {
    margin: 0;
    font-size: clamp(1.05rem, 2.2vw, 1.22rem);
    font-weight: 600;
    line-height: 1.5;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
    max-width: 36rem;
}
.btn-home-band {
    padding: 0.75rem 1.55rem;
    border-radius: 999px;
    background: #fff;
    color: #000 !important;
    font-weight: 800;
    letter-spacing: 0.04em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    border: none;
    box-shadow: 0 4px 22px rgba(0, 0, 0, 0.14);
    text-decoration: none !important;
    transition: transform 0.12s ease, box-shadow 0.2s ease, color 0.15s ease;
}
.btn-home-band:hover {
    transform: scale(1.03);
    color: #000 !important;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
    text-decoration: none !important;
}

@media (min-width: 768px) {
    body.home-page .brand-mark,
    body.auth-page .brand-mark,
    body.app-page .brand-mark {
        width: 46px;
        height: 46px;
    }
    .home-hero {
        grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
        gap: 2.5rem;
        padding: 0.75rem 0 3rem;
        align-items: center;
    }
    .home-features {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.15rem;
    }
    .home-band-inner {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
        padding: 1.75rem 2.25rem;
    }
    .home-band-text {
        max-width: 32rem;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.nav-link--accent {
    color: #fde68a !important;
    font-weight: 600;
}
.nav-link--accent:hover {
    color: #fef9c3 !important;
}

/* Dashboard — recent rooms */
.recent-rooms-panel {
    padding: 1.35rem 1.4rem 1.25rem;
}
.recent-rooms-head {
    margin-bottom: 1.1rem;
}
.recent-room-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.recent-room-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.85rem 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(12, 16, 32, 0.35);
    transition: border-color 0.15s ease, background 0.15s ease;
}
.recent-room-card:hover {
    border-color: rgba(124, 108, 240, 0.32);
    background: rgba(124, 108, 240, 0.06);
}
.recent-room-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(124, 108, 240, 0.2), rgba(52, 211, 153, 0.08));
    border: 1px solid var(--border);
    color: #c7d2fe;
}
.recent-room-body {
    min-width: 0;
}
.recent-room-primary {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem 0.5rem;
    min-width: 0;
}
.recent-room-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
    word-break: break-word;
}
.recent-room-id {
    font-size: 0.88rem;
    word-break: break-all;
}
.recent-room-id--sub {
    font-size: 0.78rem;
    font-weight: 500;
    opacity: 0.88;
}
.recent-room-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-top: 0.35rem;
}
.recent-room-date {
    font-size: 0.82rem;
}
.recent-room-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
}
.recent-room-archive-form {
    margin: 0;
}
.recent-room-archive-btn {
    color: #fca5a5 !important;
    border-color: rgba(244, 63, 94, 0.25) !important;
}
.recent-room-archive-btn:hover {
    color: #fecaca !important;
    border-color: rgba(244, 63, 94, 0.45) !important;
    background: rgba(244, 63, 94, 0.08) !important;
}
.recent-room-ended {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    padding: 0.45rem 0.65rem;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border);
}

@media (max-width: 640px) {
    .recent-room-card {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
    }
    .recent-room-icon {
        grid-row: 1 / span 2;
    }
    .recent-room-actions {
        grid-column: 2 / -1;
        justify-content: flex-start;
    }
}

/* Recent rooms — host dashboard uses light app shell */
body.app-page .recent-rooms-panel {
    padding: 1.5rem 1.5rem 1.35rem;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    border: 1px solid rgba(27, 74, 140, 0.1);
    box-shadow:
        0 4px 6px -1px rgba(15, 23, 42, 0.04),
        0 22px 48px -18px rgba(27, 74, 140, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.65) inset;
}
body.app-page .recent-rooms-panel:hover {
    border-color: rgba(37, 99, 235, 0.18);
}
body.app-page .recent-rooms-head {
    margin-bottom: 1.2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
body.app-page .recent-rooms-title {
    margin: 0 0 0.4rem;
    font-size: 1.125rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: #0f172a;
}
body.app-page .recent-rooms-lead {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #64748b;
    max-width: 62ch;
}
body.app-page .recent-room-list {
    gap: 0.5rem;
}
body.app-page .recent-room-card {
    position: relative;
    padding: 1rem 1rem 1rem 1.15rem;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.07);
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    overflow: hidden;
    isolation: isolate;
}
body.app-page .recent-room-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: rgba(148, 163, 184, 0.55);
    border-radius: 2px 0 0 2px;
}
body.app-page .recent-room-card--active::before {
    background: linear-gradient(180deg, #4ade80, #16a34a);
}
body.app-page .recent-room-card:hover {
    border-color: rgba(37, 99, 235, 0.22);
    background: #fff;
    box-shadow:
        0 4px 14px rgba(15, 23, 42, 0.07),
        0 0 0 1px rgba(37, 99, 235, 0.06);
}
body.app-page .recent-room-icon {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    border: 1px solid rgba(37, 99, 235, 0.14);
    background: linear-gradient(145deg, rgba(37, 99, 235, 0.12), rgba(37, 99, 235, 0.03));
    color: #2563eb;
}
body.app-page .recent-room-name {
    color: #0f172a;
    font-weight: 700;
    font-size: 1rem;
}
body.app-page .recent-room-id {
    font-size: 0.8125rem;
    color: #0f172a;
}
body.app-page .recent-room-id--sub {
    font-size: 0.75rem;
    color: #475569;
    opacity: 1;
    font-weight: 500;
}
body.app-page .recent-room-meta {
    margin-top: 0.5rem;
}
body.app-page .recent-room-date {
    color: #64748b;
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}
body.app-page .recent-room-ended {
    color: #64748b;
    border-color: rgba(15, 23, 42, 0.1);
    background: #f1f5f9;
}
body.app-page .recent-room-archive-btn {
    color: #b91c1c !important;
    border-color: rgba(220, 38, 38, 0.28) !important;
}
body.app-page .recent-room-archive-btn:hover {
    color: #991b1b !important;
    border-color: rgba(220, 38, 38, 0.45) !important;
    background: rgba(254, 226, 226, 0.9) !important;
}

/* Super admin console — full layout (sidebar + app bar) */
body.console-page {
    /* Admin palette: deep slate + indigo accent + readable grays */
    --cx-bg-deep: #03050c;
    --cx-bg: #070a14;
    --cx-bg-elevated: #0d111f;
    --cx-bg-surface: #12182a;
    --cx-bg-sidebar: #090c16;
    --cx-bg-sidebar-foot: rgba(6, 8, 16, 0.65);
    --cx-border: rgba(124, 132, 188, 0.22);
    --cx-border-soft: rgba(100, 108, 160, 0.12);
    --cx-text: #f0f2fb;
    --cx-text-secondary: #c4c9dc;
    --cx-text-muted: #8b92ab;
    --cx-accent: #9b8cff;
    --cx-accent-soft: rgba(155, 140, 255, 0.14);
    --cx-accent-mid: rgba(155, 140, 255, 0.28);
    --cx-teal: #5eead4;
    --cx-teal-soft: rgba(94, 234, 212, 0.12);
    --cx-link: #b8c4ff;
    --cx-link-hover: #e8ecff;
    --cx-appbar-bg: rgba(11, 14, 26, 0.88);
    --cx-shadow: 0 4px 28px rgba(0, 0, 0, 0.45);

    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    color: var(--cx-text-secondary);
    background:
        radial-gradient(900px 520px at 92% -8%, rgba(99, 102, 241, 0.11), transparent 58%),
        radial-gradient(640px 420px at -5% 105%, rgba(45, 212, 191, 0.07), transparent 52%),
        linear-gradient(165deg, var(--cx-bg-deep) 0%, var(--cx-bg) 45%, #05060f 100%);
}

body.console-page a {
    color: var(--cx-link);
}
body.console-page a:hover {
    color: var(--cx-link-hover);
}

body.console-page .muted {
    color: var(--cx-text-muted) !important;
}

body.console-page strong {
    color: var(--cx-text);
}

body.console-page .console-main-outer {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

body.console-page .console-main-outer > .alerts {
    flex-shrink: 0;
    padding: 0.75rem 1rem 0;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.console-layout {
    flex: 1;
    display: flex;
    min-height: 0;
    position: relative;
    background: transparent;
}

.console-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 180;
    background: rgba(2, 4, 14, 0.68);
    backdrop-filter: blur(5px);
}

.console-sidebar {
    flex-shrink: 0;
    width: 260px;
    display: flex;
    flex-direction: column;
    padding: 1.1rem 0.85rem 1rem;
    border-right: 1px solid var(--cx-border);
    background: linear-gradient(195deg, #0d101f 0%, var(--cx-bg-sidebar) 38%, #060814 100%);
    box-shadow: 4px 0 36px rgba(0, 0, 0, 0.4);
    z-index: 200;
}

.console-sidebar-brand {
    padding: 0 0.5rem 1rem;
    margin-bottom: 0.35rem;
    border-bottom: 1px solid var(--cx-border-soft);
}

.console-sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none !important;
    color: var(--cx-text) !important;
}

.console-sidebar-logo:hover {
    color: var(--cx-text) !important;
}

.console-sidebar-logo-mark {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: linear-gradient(140deg, rgba(155, 140, 255, 0.95), rgba(94, 234, 212, 0.32));
    box-shadow:
        0 0 0 1px rgba(155, 140, 255, 0.4),
        0 10px 28px rgba(99, 102, 241, 0.22);
}

.console-sidebar-logo-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.console-sidebar-logo-name {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.console-sidebar-logo-badge {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--cx-accent);
}

.console-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    padding: 0 0.35rem;
}

.console-nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.58rem 0.7rem;
    border-radius: var(--radius-sm);
    color: var(--cx-text-secondary) !important;
    text-decoration: none !important;
    font-weight: 500;
    font-size: 0.9rem;
    border: 1px solid transparent;
    transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.console-nav-link:hover {
    background: var(--cx-accent-soft);
    color: var(--cx-text) !important;
}

.console-nav-link.is-active {
    background: var(--cx-accent-mid);
    color: var(--cx-text) !important;
    border-color: rgba(155, 140, 255, 0.42);
    box-shadow: 0 0 0 1px rgba(155, 140, 255, 0.1);
}

.console-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    flex-shrink: 0;
    color: var(--cx-text-muted);
}

.console-nav-link.is-active .console-nav-icon,
.console-nav-link:hover .console-nav-icon {
    color: #d4d8ff;
}

.console-nav-icon svg {
    display: block;
}

.console-sidebar-footer {
    margin-top: auto;
    padding: 1rem 0.5rem 0;
    border-top: 1px solid var(--cx-border-soft);
}

.console-sidebar-hint {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--cx-text-muted);
}

.console-workspace {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background:
        linear-gradient(165deg, rgba(155, 140, 255, 0.05) 0%, transparent 38%),
        linear-gradient(210deg, transparent 55%, rgba(45, 212, 191, 0.03) 100%),
        var(--cx-bg-elevated);
}

.console-appbar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 56px;
    padding: 0.55rem 1rem 0.55rem 0.65rem;
    border-bottom: 1px solid var(--cx-border);
    background: var(--cx-appbar-bg);
    backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 90;
}

.console-appbar-start {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.console-drawer-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--cx-border);
    border-radius: var(--radius-sm);
    background: var(--cx-bg-surface);
    color: var(--cx-text-secondary);
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.console-drawer-btn:hover {
    background: rgba(155, 140, 255, 0.1);
    border-color: rgba(155, 140, 255, 0.35);
    color: var(--cx-text);
}

.console-drawer-btn-bars {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 1px;
    background: currentColor;
    box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}

.console-appbar-headings {
    min-width: 0;
}

.console-appbar-eyebrow {
    margin: 0;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--cx-accent);
}

.console-appbar-title {
    margin: 0.1rem 0 0;
    font-size: clamp(1.15rem, 2.2vw, 1.4rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--cx-text);
}

.console-appbar-end {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.45rem;
}

.console-appbar-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none !important;
    border: 1px solid rgba(155, 140, 255, 0.38);
    background: var(--cx-accent-soft);
    color: #e4e8ff !important;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.console-appbar-chip:hover {
    background: rgba(155, 140, 255, 0.24);
    border-color: rgba(180, 168, 255, 0.55);
    color: #fff !important;
}

.console-appbar-chip--ghost {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--cx-border);
    color: var(--cx-text-muted) !important;
}

.console-appbar-chip--ghost:hover {
    color: var(--cx-text-secondary) !important;
    border-color: rgba(155, 140, 255, 0.28);
    background: var(--cx-accent-soft);
}

.console-user-menu {
    margin-left: 0.15rem;
    position: relative;
}

.console-user-trigger {
    border: 1px solid var(--cx-border);
}

.console-nav-dropdown {
    right: 0;
    left: auto;
}

/* Console keeps dark chrome even with body.app-page */
body.console-page .user-menu-trigger {
    background: linear-gradient(145deg, rgba(124, 108, 240, 0.35), rgba(52, 211, 153, 0.12));
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08), 0 4px 14px rgba(0, 0, 0, 0.25);
}
body.console-page .user-menu-trigger:hover {
    box-shadow: 0 0 0 2px rgba(124, 108, 240, 0.45), 0 6px 18px rgba(0, 0, 0, 0.3);
}
body.console-page .nav-dropdown {
    background: var(--cx-bg-surface);
    border-color: var(--cx-border);
    box-shadow: var(--cx-shadow);
}
body.console-page .nav-dropdown-name {
    color: var(--cx-text);
}
body.console-page a.nav-dropdown-item,
body.console-page button.nav-dropdown-item {
    color: var(--cx-text-secondary);
}
body.console-page a.nav-dropdown-item:hover,
body.console-page button.nav-dropdown-item:hover {
    background: rgba(155, 140, 255, 0.1);
    color: var(--cx-text);
}
body.console-page .nav-dropdown-item--accent {
    color: var(--cx-accent);
}
body.console-page .nav-dropdown-item--danger {
    color: #fecdd3;
}
body.console-page .nav-dropdown-item--danger:hover {
    background: rgba(244, 63, 94, 0.15);
    color: #fff;
}
body.console-page .nav-dropdown-divider {
    background: var(--cx-border);
}
body.console-page .nav-dropdown-head {
    border-bottom-color: var(--cx-border-soft);
}

.console-main {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 1.15rem 1.15rem 2.25rem;
    -webkit-overflow-scrolling: touch;
    background: linear-gradient(180deg, rgba(8, 10, 20, 0.35) 0%, transparent 28%), var(--cx-bg);
}

@media (min-width: 901px) {
    .console-main {
        padding: 1.35rem 1.5rem 2.5rem;
    }
}

/* Dashboard & shared console panels */
.console-dash-hero {
    margin-bottom: 1.35rem;
    padding: 1.15rem 1.2rem;
    border-radius: var(--radius);
    border: 1px solid var(--cx-border);
    background: linear-gradient(135deg, rgba(18, 22, 42, 0.92) 0%, rgba(10, 12, 24, 0.96) 100%);
    box-shadow: var(--cx-shadow);
}

.console-dash-hero h2 {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--cx-text);
}

.console-dash-hero p {
    margin: 0;
    font-size: 0.92rem;
    color: var(--cx-text-muted);
    max-width: 52ch;
}

.console-grid--stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 0.9rem;
}

.console-stat {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-height: 118px;
    padding: 1rem 1.05rem;
    border: 1px solid var(--cx-border);
    background: linear-gradient(165deg, rgba(16, 20, 36, 0.95) 0%, rgba(8, 10, 20, 0.98) 100%);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
    position: relative;
    overflow: hidden;
}

.console-stat::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, rgba(155, 140, 255, 0.9), rgba(94, 234, 212, 0.5));
    opacity: 0.9;
}

.console-stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--cx-text-muted);
}

.console-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--cx-text);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.console-stat-meta {
    font-size: 0.82rem;
    margin-top: auto;
    color: var(--cx-text-muted);
}

.console-dash-footnote {
    margin-top: 1.35rem;
    font-size: 0.88rem;
}

.console-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
}

.console-search {
    flex: 1 1 220px;
    max-width: 420px;
    margin: 0 !important;
}

.console-table-wrap {
    margin-bottom: 1rem;
}

.console-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.console-bulk-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
    margin-bottom: 1rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--cx-border, var(--border));
    background: rgba(0, 0, 0, 0.2);
}

.console-bulk-hint {
    font-size: 0.8rem;
    margin: 0;
}

.console-th-check,
.console-td-check {
    width: 2.5rem;
    text-align: center;
    vertical-align: middle;
}

.console-row-check {
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
    accent-color: var(--primary, #7c6cf0);
}

.console-actions-cell {
    white-space: normal;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.console-archive-intro {
    margin: 0 0 1rem;
    max-width: 62ch;
    line-height: 1.5;
}

.console-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    cursor: pointer;
    user-select: none;
}

.console-filter-toggle input {
    width: auto;
    margin: 0;
}

/* Console uses body.app-page: restore dark UI for tables, forms, pills, alerts, buttons */
body.console-page.app-page .console-main-outer > .alerts .alert {
    background: var(--cx-bg-surface);
    border-color: var(--cx-border);
    color: var(--cx-text-secondary);
}
body.console-page.app-page .console-main-outer > .alerts .alert--success {
    border-color: rgba(94, 234, 212, 0.35);
    color: #a7f3d0;
    background: rgba(6, 24, 22, 0.75);
}
body.console-page.app-page .console-main-outer > .alerts .alert--error {
    border-color: rgba(251, 113, 133, 0.4);
    color: #fecdd3;
    background: rgba(30, 10, 16, 0.75);
}
body.console-page.app-page .console-main-outer > .alerts .alert--info {
    border-color: rgba(155, 140, 255, 0.35);
    color: #e0e7ff;
    background: rgba(18, 16, 40, 0.8);
}
body.console-page.app-page .console-main-outer > .alerts .alert--warning {
    border-color: rgba(251, 191, 36, 0.4);
    color: #fef3c7;
    background: rgba(28, 22, 8, 0.8);
}

body.console-page.app-page .console-main input,
body.console-page.app-page .console-main select,
body.console-page.app-page .console-main textarea {
    background: var(--cx-bg-surface);
    color: var(--cx-text);
    border-color: var(--cx-border);
}
body.console-page.app-page .console-main input::placeholder,
body.console-page.app-page .console-main textarea::placeholder {
    color: var(--cx-text-muted);
}
body.console-page.app-page .console-main input:focus,
body.console-page.app-page .console-main select:focus,
body.console-page.app-page .console-main textarea:focus {
    border-color: rgba(155, 140, 255, 0.55);
    box-shadow: 0 0 0 3px rgba(155, 140, 255, 0.2);
}

body.console-page.app-page .console-main .table-wrap {
    background: var(--cx-bg-surface);
    border-color: var(--cx-border);
}
body.console-page.app-page .console-main table th {
    background: rgba(0, 0, 0, 0.38);
    color: var(--cx-text-muted);
    border-bottom-color: var(--cx-border-soft);
}
body.console-page.app-page .console-main table td {
    color: var(--cx-text-secondary);
    border-bottom-color: var(--cx-border-soft);
}
body.console-page.app-page .console-main tr:hover td {
    background: var(--cx-accent-soft);
}

body.console-page.app-page .console-main .pill {
    background: rgba(255, 255, 255, 0.06);
    color: var(--cx-text-secondary);
    border-color: var(--cx-border);
}
body.console-page.app-page .console-main .pill-active {
    background: var(--cx-teal-soft);
    color: #7ee1cc;
    border-color: rgba(94, 234, 212, 0.38);
}

body.console-page.app-page .console-main code {
    background: rgba(0, 0, 0, 0.35);
    color: #d0daf5;
    border-color: var(--cx-border-soft);
}

body.console-page.app-page .console-main .card {
    background: linear-gradient(165deg, rgba(18, 22, 38, 0.96) 0%, rgba(10, 12, 22, 0.99) 100%);
    border-color: var(--cx-border);
    color: var(--cx-text-secondary);
    box-shadow: var(--cx-shadow);
}
body.console-page.app-page .console-main .card h2 {
    color: var(--cx-text);
}
body.console-page.app-page .console-main .card a {
    color: var(--cx-link);
}
body.console-page.app-page .console-main .card a:hover {
    color: var(--cx-link-hover);
}
body.console-page.app-page .console-main .card:hover {
    border-color: rgba(155, 140, 255, 0.32);
}

body.console-page.app-page .console-main .btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--cx-text);
    border: 1px solid var(--cx-border);
    box-shadow: none;
}
body.console-page.app-page .console-main .btn-secondary:hover {
    background: var(--cx-accent-soft);
    color: var(--cx-text);
    border-color: rgba(155, 140, 255, 0.45);
    text-decoration: none;
}

body.console-page.app-page .console-main .btn-ghost {
    background: transparent;
    color: var(--cx-text-muted);
    border-color: var(--cx-border);
}
body.console-page.app-page .console-main .btn-ghost:hover {
    color: var(--cx-text);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(155, 140, 255, 0.3);
    text-decoration: none;
}

body.console-page.app-page .console-main .btn-danger {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.95), #be123c);
    color: #fff;
    border: 1px solid rgba(251, 113, 133, 0.35);
    box-shadow: 0 4px 18px rgba(190, 18, 60, 0.25);
}
body.console-page.app-page .console-main .btn-danger:hover {
    color: #fff;
    filter: brightness(1.06);
    text-decoration: none;
}

@media (max-width: 900px) {
    .console-sidebar-backdrop:not([hidden]) {
        display: block;
    }

    .console-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(280px, 88vw);
        transform: translateX(-102%);
        transition: transform 0.22s ease, visibility 0.22s ease;
        visibility: hidden;
    }

    .console-layout.is-drawer-open .console-sidebar {
        transform: translateX(0);
        visibility: visible;
    }

    .console-drawer-btn {
        display: inline-flex;
    }

    body.console-drawer-open {
        overflow: hidden;
    }
}

