/* Training Meet — design system. Plain CSS, no build step needed. */

:root {
    --font-sans: 'Onest', ui-sans-serif, system-ui, sans-serif;

    --paper: #f4f6f7;
    --surface: #ffffff;
    --ink: #1c2430;
    --ink-soft: #3a4553;
    --muted: #6b7684;
    --faint: #9aa4b0;
    --line: #e3e7ea;
    --line-soft: #eef1f3;

    --pine: #0f7b5f;
    --pine-deep: #0a5c47;
    --pine-soft: #e4f3ee;
    --onair: #e5484d;
    --onair-soft: #fdecec;
    --amber: #b26b00;
    --amber-soft: #fdf3e1;
    --ocean: #2a64a5;
    --ocean-soft: #e7eff9;
    --plum: #7547b8;
    --plum-soft: #f1eafb;
    --rose: #c03b67;
    --rose-soft: #fbe9ef;
    --slate: #56606c;
    --slate-soft: #edf0f2;

    --radius-panel: 22px;
    --radius-control: 12px;

    --ease-out-soft: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font-sans); }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
img, svg { display: block; }
table { border-collapse: collapse; }
[hidden] { display: none !important; }


    html {
        -webkit-font-smoothing: antialiased;
        text-rendering: optimizeLegibility;
    }
    body {
        background: var(--paper);
        color: var(--ink);
        font-size: 15px;
        line-height: 1.6;
    }
    h1, h2, h3, h4 {
        line-height: 1.2;
        letter-spacing: -0.015em;
        color: var(--ink);
    }
    ::selection {
        background: var(--pine-soft);
        color: var(--pine-deep);
    }
    :focus-visible {
        outline: 2px solid var(--pine);
        outline-offset: 2px;
        border-radius: 6px;
    }



    /* ---------- Page scaffolding ---------- */
    .page-title {
        font-size: 1.85rem;
        font-weight: 650;
        letter-spacing: -0.025em;
    }
    .page-sub {
        color: var(--muted);
        margin-top: 0.35rem;
        max-width: 62ch;
    }
    .section-title {
        font-size: 1.05rem;
        font-weight: 600;
    }
    .panel {
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--radius-panel);
    }
    .panel-pad {
        padding: 1.75rem;
    }
    @media (max-width: 640px) {
        .panel-pad { padding: 1.25rem; }
    }

    /* ---------- Buttons ---------- */
    .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        height: 2.75rem;
        padding: 0 1.15rem;
        border-radius: var(--radius-control);
        font-weight: 550;
        font-size: 0.925rem;
        white-space: nowrap;
        border: 1px solid transparent;
        transition: background-color 0.18s, border-color 0.18s, color 0.18s, transform 0.12s var(--ease-out-soft), box-shadow 0.18s;
        cursor: pointer;
        user-select: none;
    }
    .btn:active:not(:disabled) { transform: scale(0.97); }
    .btn:disabled, .btn[aria-busy='true'] { opacity: 0.6; cursor: not-allowed; }
    .btn svg { width: 1.1rem; height: 1.1rem; flex-shrink: 0; }
    .btn-sm { height: 2.25rem; padding: 0 0.85rem; font-size: 0.85rem; border-radius: 10px; }
    .btn-lg { height: 3.25rem; padding: 0 1.5rem; font-size: 1rem; }

    .btn-primary { background: var(--pine); color: #fff; }
    .btn-primary:hover:not(:disabled) { background: var(--pine-deep); box-shadow: 0 6px 18px -8px rgb(15 123 95 / 0.55); }
    .btn-quiet { background: var(--surface); color: var(--ink); border-color: var(--line); }
    .btn-quiet:hover:not(:disabled) { border-color: #cfd5da; background: #fafbfb; }
    .btn-ghost { background: transparent; color: var(--ink-soft); }
    .btn-ghost:hover:not(:disabled) { background: var(--line-soft); color: var(--ink); }
    .btn-danger { background: var(--onair); color: #fff; }
    .btn-danger:hover:not(:disabled) { background: #cc3a3f; }
    .btn-icon { width: 2.5rem; padding: 0; }

    .spinner {
        width: 1rem;
        height: 1rem;
        border-radius: 999px;
        border: 2px solid currentColor;
        border-right-color: transparent;
        animation: spin 0.7s linear infinite;
    }

    /* ---------- Forms ---------- */
    .field { display: flex; flex-direction: column; gap: 0.45rem; }
    .field-label { font-size: 0.875rem; font-weight: 550; color: var(--ink-soft); }
    .field-label .opt { color: var(--faint); font-weight: 400; }
    .field-hint { font-size: 0.8rem; color: var(--muted); }
    .field-error {
        font-size: 0.8rem;
        color: var(--onair);
        display: flex;
        align-items: center;
        gap: 0.35rem;
        animation: rise 0.25s var(--ease-out-soft);
    }
    .input {
        width: 100%;
        height: 2.9rem;
        padding: 0 0.95rem;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--radius-control);
        color: var(--ink);
        font-size: 0.95rem;
        transition: border-color 0.18s, box-shadow 0.18s, background-color 0.18s;
    }
    textarea.input { height: auto; min-height: 7rem; padding: 0.75rem 0.95rem; line-height: 1.55; resize: vertical; }
    select.input {
        appearance: none;
        padding-right: 2.5rem;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='%236b7684'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 0.85rem center;
        background-size: 1rem;
    }
    .input::placeholder { color: var(--faint); }
    .input:hover { border-color: #cfd5da; }
    .input:focus { outline: none; border-color: var(--pine); box-shadow: 0 0 0 4px rgb(15 123 95 / 0.12); }
    .input[aria-invalid='true'] { border-color: var(--onair); box-shadow: 0 0 0 4px rgb(229 72 77 / 0.1); }
    .input-valid { border-color: #9fd3c2; }

    .check {
        appearance: none;
        width: 1.15rem;
        height: 1.15rem;
        border: 1.5px solid #c3cad1;
        border-radius: 6px;
        background: #fff center / 0.8rem no-repeat;
        transition: background-color 0.15s, border-color 0.15s;
        cursor: pointer;
        flex-shrink: 0;
    }
    .check:checked {
        background-color: var(--pine);
        border-color: var(--pine);
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='3.5' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m5 13 4 4L19 7'/%3E%3C/svg%3E");
    }

    /* Segmented control (radio group) */
    .segmented { display: inline-flex; padding: 4px; gap: 4px; background: var(--line-soft); border-radius: 14px; }
    .segmented label { position: relative; }
    .segmented input { position: absolute; opacity: 0; pointer-events: none; }
    .segmented span {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        height: 2.35rem;
        padding: 0 1rem;
        border-radius: 10px;
        font-size: 0.875rem;
        font-weight: 550;
        color: var(--muted);
        cursor: pointer;
        transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
    }
    .segmented input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgb(28 36 48 / 0.12); }
    .segmented input:focus-visible + span { outline: 2px solid var(--pine); outline-offset: 1px; }

    /* Day chips for repeat */
    .daychip { position: relative; }
    .daychip input { position: absolute; opacity: 0; }
    .daychip span {
        display: grid;
        place-items: center;
        width: 2.75rem;
        height: 2.75rem;
        border-radius: 999px;
        border: 1px solid var(--line);
        font-size: 0.85rem;
        font-weight: 550;
        color: var(--muted);
        cursor: pointer;
        transition: all 0.2s var(--ease-out-soft);
    }
    .daychip input:checked + span { background: var(--pine); border-color: var(--pine); color: #fff; transform: scale(1.04); }
    .daychip input:focus-visible + span { outline: 2px solid var(--pine); outline-offset: 2px; }

    /* ---------- Pills & badges ---------- */
    .pill {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        height: 1.65rem;
        padding: 0 0.65rem;
        border-radius: 999px;
        font-size: 0.775rem;
        font-weight: 600;
        white-space: nowrap;
    }
    .pill-upcoming { background: var(--ocean-soft); color: var(--ocean); }
    .pill-live { background: var(--onair-soft); color: var(--onair); }
    .pill-ended { background: var(--slate-soft); color: var(--slate); }
    .pill-cancelled { background: var(--amber-soft); color: var(--amber); }
    .pill-ready { background: var(--pine-soft); color: var(--pine); }
    .pill-pending { background: var(--amber-soft); color: var(--amber); }

    .onair-dot {
        position: relative;
        width: 0.5rem;
        height: 0.5rem;
        border-radius: 999px;
        background: var(--onair);
    }
    .onair-dot::after {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: inherit;
        background: inherit;
        animation: pulse-ring 1.8s var(--ease-out-soft) infinite;
    }

    /* Topic colour swatches */
    .tone-pine { --tone: var(--pine); --tone-soft: var(--pine-soft); }
    .tone-ocean { --tone: var(--ocean); --tone-soft: var(--ocean-soft); }
    .tone-plum { --tone: var(--plum); --tone-soft: var(--plum-soft); }
    .tone-amber { --tone: var(--amber); --tone-soft: var(--amber-soft); }
    .tone-rose { --tone: var(--rose); --tone-soft: var(--rose-soft); }
    .tone-slate { --tone: var(--slate); --tone-soft: var(--slate-soft); }
    .tone-chip { background: var(--tone-soft); color: var(--tone); }
    .tone-bar { background: var(--tone); }

    /* Avatars */
    .avatar {
        display: grid;
        place-items: center;
        width: 2.4rem;
        height: 2.4rem;
        border-radius: 999px;
        font-size: 0.8rem;
        font-weight: 650;
        color: hsl(var(--hue) 45% 30%);
        background: hsl(var(--hue) 60% 92%);
        flex-shrink: 0;
    }
    .avatar-stack { display: flex; }
    .avatar-stack .avatar { width: 2rem; height: 2rem; font-size: 0.7rem; border: 2px solid #fff; margin-left: -0.5rem; }
    .avatar-stack .avatar:first-child { margin-left: 0; }

    /* ---------- Lists / tables ---------- */
    .list-row {
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 1.1rem 1.5rem;
        border-top: 1px solid var(--line-soft);
        transition: background-color 0.15s;
    }
    .list-row:first-child { border-top: 0; }
    a.list-row:hover, .list-row.is-link:hover { background: #fafbfb; }

    .table { width: 100%; font-size: 0.9rem; }
    .table th {
        text-align: left;
        font-weight: 550;
        font-size: 0.8rem;
        color: var(--muted);
        padding: 0.9rem 1.5rem;
        border-bottom: 1px solid var(--line);
        white-space: nowrap;
    }
    .table td { padding: 1rem 1.5rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
    .table tr:last-child td { border-bottom: 0; }
    .table tbody tr { transition: background-color 0.15s; }
    .table tbody tr:hover { background: #fafbfb; }

    /* Tabs */
    .tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
    .tab {
        position: relative;
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.85rem 0.9rem;
        font-size: 0.9rem;
        font-weight: 550;
        color: var(--muted);
        white-space: nowrap;
        transition: color 0.15s;
    }
    .tab:hover { color: var(--ink); }
    .tab[aria-current='page'], .tab[aria-selected='true'] { color: var(--ink); }
    .tab[aria-current='page']::after, .tab[aria-selected='true']::after {
        content: '';
        position: absolute;
        left: 0.6rem;
        right: 0.6rem;
        bottom: -1px;
        height: 2px;
        border-radius: 2px;
        background: var(--pine);
        animation: grow-x 0.3s var(--ease-out-soft);
    }
    .tab .count { font-size: 0.75rem; color: var(--faint); font-weight: 500; }

    /* Empty states */
    .empty { text-align: center; padding: 4rem 1.5rem; }
    .empty-icon {
        width: 3.5rem;
        height: 3.5rem;
        margin: 0 auto 1.25rem;
        display: grid;
        place-items: center;
        border-radius: 18px;
        background: var(--pine-soft);
        color: var(--pine);
    }
    .empty-icon svg { width: 1.6rem; height: 1.6rem; }

    /* Code / link box */
    .linkbox {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.4rem 0.4rem 0.4rem 1rem;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: var(--paper);
    }
    .linkbox code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: inherit; font-size: 0.9rem; color: var(--ink-soft); }

    /* Sidebar nav */
    .nav-link {
        display: flex;
        align-items: center;
        gap: 0.8rem;
        height: 2.75rem;
        padding: 0 0.85rem;
        border-radius: 12px;
        font-size: 0.925rem;
        font-weight: 500;
        color: var(--ink-soft);
        transition: background-color 0.15s, color 0.15s;
    }
    .nav-link svg { width: 1.2rem; height: 1.2rem; color: var(--faint); transition: color 0.15s; }
    .nav-link:hover { background: var(--line-soft); color: var(--ink); }
    .nav-link[aria-current='page'] { background: var(--pine-soft); color: var(--pine-deep); font-weight: 600; }
    .nav-link[aria-current='page'] svg { color: var(--pine); }

    /* Toasts */
    .toast {
        pointer-events: auto;
        display: flex;
        align-items: flex-start;
        gap: 0.75rem;
        width: min(24rem, calc(100vw - 2rem));
        padding: 0.95rem 1rem;
        border-radius: 16px;
        background: var(--ink);
        color: #fff;
        box-shadow: 0 18px 40px -18px rgb(28 36 48 / 0.55);
        font-size: 0.9rem;
    }
    .toast-icon { width: 1.5rem; height: 1.5rem; border-radius: 999px; display: grid; place-items: center; flex-shrink: 0; }
    .toast-icon svg { width: 0.9rem; height: 0.9rem; }
    .toast-success .toast-icon { background: #34b48c; }
    .toast-error .toast-icon { background: var(--onair); }
    .toast-info .toast-icon { background: #4b8ad6; }
    .toast-warning .toast-icon { background: #e0a43a; }
    .toast-progress { position: absolute; left: 1rem; right: 1rem; bottom: 6px; height: 2px; border-radius: 2px; background: rgb(255 255 255 / 0.15); overflow: hidden; }
    .toast-progress i { display: block; height: 100%; background: rgb(255 255 255 / 0.5); transform-origin: left; animation: shrink-x linear forwards; }

    /* Alert banners */
    .alert { display: flex; gap: 0.75rem; padding: 1rem 1.15rem; border-radius: 16px; font-size: 0.9rem; }
    .alert svg { width: 1.2rem; height: 1.2rem; flex-shrink: 0; margin-top: 0.1rem; }
    .alert-error { background: var(--onair-soft); color: #9f2a2e; }
    .alert-warning { background: var(--amber-soft); color: #7a4a00; }
    .alert-info { background: var(--ocean-soft); color: #1f4b7c; }
    .alert-success { background: var(--pine-soft); color: var(--pine-deep); }

    /* Modal */
    .modal-backdrop { position: fixed; inset: 0; background: rgb(28 36 48 / 0.35); backdrop-filter: blur(3px); z-index: 60; }
    .modal-wrap { position: fixed; inset: 0; z-index: 61; display: grid; place-items: center; padding: 1rem; overflow-y: auto; }
    .modal { width: 100%; max-width: 30rem; background: #fff; border-radius: 24px; padding: 1.75rem; box-shadow: 0 30px 80px -30px rgb(28 36 48 / 0.5); }

    /* Dropdown */
    .menu { position: absolute; z-index: 40; min-width: 13rem; padding: 0.4rem; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 45px -20px rgb(28 36 48 / 0.35); }
    .menu-item { display: flex; align-items: center; gap: 0.65rem; width: 100%; padding: 0.6rem 0.75rem; border-radius: 10px; font-size: 0.9rem; color: var(--ink-soft); text-align: left; transition: background-color 0.12s; }
    .menu-item svg { width: 1.05rem; height: 1.05rem; color: var(--faint); }
    .menu-item:hover { background: var(--line-soft); color: var(--ink); }
    .menu-item.danger { color: var(--onair); }
    .menu-item.danger svg { color: var(--onair); }

    /* Stat */
    .stat-value { font-size: 2.1rem; font-weight: 650; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
    .stat-label { font-size: 0.85rem; color: var(--muted); margin-top: 0.5rem; }

    /* ---------- On-air rail (dashboard signature) ---------- */
    .rail { position: relative; height: 7.5rem; }
    .rail-track { position: absolute; left: 0; right: 0; top: 2.25rem; height: 3.25rem; border-radius: 14px; background: repeating-linear-gradient(90deg, var(--line-soft) 0 1px, transparent 1px calc(100% / 12)); border: 1px dashed var(--line); }
    .rail-block {
        position: absolute;
        top: 2.25rem;
        height: 3.25rem;
        min-width: 0.6rem;
        padding: 0.45rem 0.65rem;
        border-radius: 12px;
        background: var(--tone-soft);
        border: 1px solid color-mix(in srgb, var(--tone) 25%, transparent);
        color: var(--tone);
        overflow: hidden;
        font-size: 0.75rem;
        font-weight: 600;
        line-height: 1.25;
        transition: transform 0.2s var(--ease-out-soft), box-shadow 0.2s;
        transform-origin: left center;
        animation: rail-in 0.7s var(--ease-out-soft) backwards;
    }
    .rail-block:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -14px color-mix(in srgb, var(--tone) 70%, transparent); z-index: 2; }
    .rail-block.is-live { background: var(--onair-soft); border-color: rgb(229 72 77 / 0.35); color: var(--onair); }
    .rail-now { position: absolute; top: 1.4rem; bottom: 1.1rem; width: 2px; background: var(--onair); border-radius: 2px; z-index: 3; transition: left 1s linear; }
    .rail-now::before { content: ''; position: absolute; top: -4px; left: -4px; width: 10px; height: 10px; border-radius: 999px; background: var(--onair); box-shadow: 0 0 0 4px rgb(229 72 77 / 0.18); }
    .rail-hours { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--faint); font-variant-numeric: tabular-nums; }


/* ------------------------------------------------------------------
   Motion
------------------------------------------------------------------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes reveal { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes shrink-x { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes rail-in { from { opacity: 0; transform: scaleX(0.2); } to { opacity: 1; transform: none; } }
@keyframes pulse-ring { 0% { transform: scale(1); opacity: 0.7; } 100% { transform: scale(3); opacity: 0; } }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-5px); } 40%, 60% { transform: translateX(5px); } }
@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }
@keyframes bell { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(14deg); } 40% { transform: rotate(-12deg); } 60% { transform: rotate(8deg); } 80% { transform: rotate(-4deg); } }

/* One orchestrated entrance per page: direct children of [data-reveal] rise in sequence. */
[data-reveal] > * { animation: reveal 0.6s var(--ease-out-soft) backwards; }
[data-reveal] > *:nth-child(1) { animation-delay: 0.02s; }
[data-reveal] > *:nth-child(2) { animation-delay: 0.08s; }
[data-reveal] > *:nth-child(3) { animation-delay: 0.14s; }
[data-reveal] > *:nth-child(4) { animation-delay: 0.2s; }
[data-reveal] > *:nth-child(5) { animation-delay: 0.26s; }
[data-reveal] > *:nth-child(n + 6) { animation-delay: 0.32s; }

.animate-shake { animation: shake 0.45s; }
.animate-pop { animation: pop 0.45s var(--ease-spring); }
.animate-bell { animation: bell 0.8s ease-in-out; transform-origin: top center; }

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

/* ------------------------------------------------------------------
   Small layout utilities
------------------------------------------------------------------- */
.row { display: flex; align-items: center; }
.row-top { display: flex; align-items: flex-start; }
.between { justify-content: space-between; }
.center { justify-content: center; }
.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; }
.grow { flex: 1; min-width: 0; }
.shrink-0 { flex-shrink: 0; }
.gap-1 { gap: 0.25rem; } .gap-2 { gap: 0.5rem; } .gap-3 { gap: 0.75rem; } .gap-4 { gap: 1rem; } .gap-5 { gap: 1.25rem; } .gap-6 { gap: 1.5rem; } .gap-8 { gap: 2rem; } .gap-10 { gap: 2.5rem; }
.mt-1 { margin-top: 0.25rem; } .mt-2 { margin-top: 0.5rem; } .mt-3 { margin-top: 0.75rem; } .mt-4 { margin-top: 1rem; } .mt-6 { margin-top: 1.5rem; } .mt-8 { margin-top: 2rem; } .mt-10 { margin-top: 2.5rem; } .mt-12 { margin-top: 3rem; }
.mb-2 { margin-bottom: 0.5rem; } .mb-4 { margin-bottom: 1rem; } .mb-6 { margin-bottom: 1.5rem; }
.ml-auto { margin-left: auto; }
.w-full { width: 100%; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 0.85rem; }
.tiny { font-size: 0.775rem; }
.strong { font-weight: 600; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nums { font-variant-numeric: tabular-nums; }
.overflow-x { overflow-x: auto; }
.grid { display: grid; gap: 1.5rem; }
.grid-2 { display: grid; gap: 1.25rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 1.25rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: 1.25rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .grid-2, .grid-4 { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } .hide-sm { display: none !important; } }
@media (min-width: 641px) { .show-sm { display: none !important; } }
.divider { height: 1px; background: var(--line); border: 0; margin: 1.75rem 0; }

/* ------------------------------------------------------------------
   Admin shell
------------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 16.5rem minmax(0, 1fr); min-height: 100vh; }
.sidebar {
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column; gap: 2rem;
    padding: 1.75rem 1.1rem;
    background: var(--surface);
    border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 0.7rem; padding: 0 0.6rem; font-weight: 650; font-size: 1.05rem; letter-spacing: -0.02em; }
.brand-mark { position: relative; width: 2.1rem; height: 2.1rem; border-radius: 11px; background: var(--pine); display: grid; place-items: center; color: #fff; }
.brand-mark svg { width: 1.15rem; height: 1.15rem; }
.brand-mark .onair-dot { position: absolute; top: -2px; right: -2px; border: 2px solid #fff; width: 0.7rem; height: 0.7rem; }
.nav { display: flex; flex-direction: column; gap: 0.2rem; }
.nav-group { font-size: 0.75rem; font-weight: 550; color: var(--faint); padding: 1rem 0.85rem 0.4rem; }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 0.6rem 0; border-top: 1px solid var(--line-soft); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 1rem;
    height: 4.5rem; padding: 0 2.5rem;
    background: color-mix(in srgb, var(--paper) 85%, transparent);
    backdrop-filter: blur(10px);
}
.content { width: 100%; max-width: 76rem; margin: 0 auto; padding: 1rem 2.5rem 5rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 2.25rem; }
.back-link { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.875rem; color: var(--muted); margin-bottom: 1rem; transition: color 0.15s, gap 0.2s; }
.back-link:hover { color: var(--ink); gap: 0.6rem; }
.back-link svg { width: 1rem; height: 1rem; }

.menu-toggle { display: none; }
.sidebar-scrim { display: none; }
@media (max-width: 1024px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; z-index: 50; left: 0; width: 17rem; transform: translateX(-100%); transition: transform 0.3s var(--ease-out-soft); box-shadow: 20px 0 50px -30px rgb(28 36 48 / 0.4); }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgb(28 36 48 / 0.3); animation: fade 0.25s; }
    .menu-toggle { display: inline-flex; }
    .topbar, .content { padding-left: 1.25rem; padding-right: 1.25rem; }
}
@keyframes fade { from { opacity: 0; } }

/* Notification bell */
.bell { position: relative; }
.bell-badge {
    position: absolute; top: 4px; right: 4px;
    min-width: 1.1rem; height: 1.1rem; padding: 0 0.3rem;
    border-radius: 999px; background: var(--onair); color: #fff;
    font-size: 0.65rem; font-weight: 700; display: grid; place-items: center;
    border: 2px solid var(--paper);
}
.bell-panel { right: 0; top: calc(100% + 0.5rem); width: min(23rem, calc(100vw - 2rem)); padding: 0; }
.bell-item { display: flex; gap: 0.75rem; padding: 0.9rem 1.1rem; border-top: 1px solid var(--line-soft); font-size: 0.875rem; }
.bell-item.unread { background: #f8fbfa; }
.bell-item .dot { width: 0.5rem; height: 0.5rem; border-radius: 999px; background: var(--pine); margin-top: 0.45rem; flex-shrink: 0; }

/* details-based dropdowns */
details.dropdown { position: relative; }
details.dropdown > summary { list-style: none; }
details.dropdown > summary::-webkit-details-marker { display: none; }
details.dropdown[open] > .menu { animation: menu-in 0.18s var(--ease-out-soft); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) scale(0.98); } }
.menu.right { right: 0; top: calc(100% + 0.4rem); }

/* Toast stack */
.toasts { position: fixed; z-index: 80; right: 1.25rem; bottom: 1.25rem; display: flex; flex-direction: column; gap: 0.6rem; pointer-events: none; }
.toast { position: relative; animation: toast-in 0.45s var(--ease-spring); }
.toast.leaving { animation: toast-out 0.3s var(--ease-out-soft) forwards; }
.toast button { margin-left: auto; color: rgb(255 255 255 / 0.55); transition: color 0.15s; }
.toast button:hover { color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }
@media (max-width: 640px) { .toasts { left: 1rem; right: 1rem; align-items: center; } }

/* Modal motion */
.modal-backdrop { animation: fade 0.2s; }
.modal { animation: modal-in 0.35s var(--ease-spring); }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(0.96); } }
dialog.dialog { border: 0; padding: 0; background: transparent; max-width: none; max-height: none; width: 100%; height: 100%; }
dialog.dialog::backdrop { background: rgb(28 36 48 / 0.35); backdrop-filter: blur(3px); }
dialog.dialog[open] .modal { animation: modal-in 0.35s var(--ease-spring); }
dialog.dialog .modal-wrap { position: static; min-height: 100%; }

/* ------------------------------------------------------------------
   Sign-in
------------------------------------------------------------------- */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); min-height: 100vh; }
.auth-form { width: 100%; max-width: 27rem; margin: 0 auto; padding: 3.5rem 1.5rem; display: flex; flex-direction: column; justify-content: center; }
.auth-art { position: relative; margin: 1rem; border-radius: 28px; background: var(--pine-deep); overflow: hidden; display: grid; place-items: center; padding: 3rem; }
.auth-art::before { content: ''; position: absolute; inset: 0; background: radial-gradient(60% 50% at 70% 20%, rgb(52 180 140 / 0.35), transparent 70%), radial-gradient(50% 40% at 10% 90%, rgb(15 123 95 / 0.6), transparent 70%); }
.auth-art-inner { position: relative; width: 100%; max-width: 28rem; }
.auth-screen { padding: 1.25rem; border-radius: 22px; background: rgb(255 255 255 / 0.08); border: 1px solid rgb(255 255 255 / 0.14); backdrop-filter: blur(6px); animation: float 7s ease-in-out infinite; }
.auth-screen-body { margin: 1.1rem 0; aspect-ratio: 16 / 9; border-radius: 14px; background: rgb(255 255 255 / 0.92); padding: 1.25rem; display: flex; flex-direction: column; gap: 0.65rem; }
.auth-screen-body span { display: block; height: 0.65rem; border-radius: 99px; background: var(--line); width: 40%; }
.auth-screen-body span:first-child { height: 1rem; background: var(--pine-soft); width: 50%; margin-bottom: 0.4rem; }
.auth-people .avatar { width: 2rem; height: 2rem; font-size: 0.68rem; border: 2px solid rgb(255 255 255 / 0.25); margin-left: -0.55rem; }
.auth-people .avatar:first-child { margin-left: 0; }
.auth-quote { margin-top: 2rem; color: rgb(255 255 255 / 0.88); font-size: 1.15rem; line-height: 1.5; max-width: 30ch; letter-spacing: -0.01em; }
@keyframes float { 50% { transform: translateY(-8px); } }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-art { display: none; } }

/* Dashboard */
.dash-cols { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .dash-cols { grid-template-columns: 1fr; } }
.live-strip { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; border-color: rgb(229 72 77 / 0.25); background: linear-gradient(90deg, var(--onair-soft), #fff 45%); }
.datechip { width: 3.1rem; height: 3.3rem; border-radius: 14px; background: var(--tone-soft); color: var(--tone); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; flex-shrink: 0; }
.datechip span { font-size: 0.68rem; font-weight: 600; }
.datechip strong { font-size: 1.2rem; font-weight: 650; }

/* Topics */
.topic-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); }
.topic-card { position: relative; padding: 1.6rem 1.6rem 1.5rem 1.85rem; overflow: visible; transition: border-color 0.2s, transform 0.25s var(--ease-out-soft); }
.topic-card:hover { border-color: color-mix(in srgb, var(--tone) 35%, var(--line)); }
.topic-bar { position: absolute; left: 0; top: 1.5rem; bottom: 1.5rem; width: 4px; border-radius: 0 4px 4px 0; }
.topic-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; }
.swatch span:first-of-type { display: block; width: 2.25rem; height: 2.25rem; border-radius: 999px; background: var(--tone); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); transition: box-shadow 0.2s, transform 0.2s var(--ease-spring); }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--tone); transform: scale(1.08); }
.swatch input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Lists, filters, forms */
.filters { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.search { position: relative; flex: 1; min-width: 14rem; max-width: 26rem; }
.search svg { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); width: 1.1rem; height: 1.1rem; color: var(--faint); pointer-events: none; }
.search .input { padding-left: 2.6rem; }
.thumb { width: 2.75rem; height: 2.75rem; border-radius: 12px; background: var(--pine-soft); color: var(--pine); display: grid; place-items: center; flex-shrink: 0; }
.thumb svg { width: 1rem; height: 1rem; }
.form-cols { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr) 20rem; align-items: start; }
@media (max-width: 1024px) { .form-cols { grid-template-columns: 1fr; } }
.tip li { position: relative; padding-left: 1rem; }
.tip li::before { content: ''; position: absolute; left: 0; top: 0.6em; width: 5px; height: 5px; border-radius: 99px; background: var(--pine); }

/* Meeting form */
.summary-col { position: sticky; top: 5.5rem; }
@media (max-width: 1024px) { .summary-col { position: static; } }
.summary { border-color: color-mix(in srgb, var(--pine) 20%, var(--line)); }
.toggle-row { display: flex; align-items: flex-start; gap: 0.9rem; cursor: pointer; }
.switch {
    appearance: none; flex-shrink: 0; position: relative;
    width: 2.6rem; height: 1.5rem; border-radius: 999px;
    background: #cdd3d9; cursor: pointer; transition: background-color 0.2s;
}
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 1.125rem; height: 1.125rem; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.2); transition: transform 0.25s var(--ease-spring); }
.switch:checked { background: var(--pine); }
.switch:checked::after { transform: translateX(1.1rem); }
.switch:focus-visible { outline: 2px solid var(--pine); outline-offset: 2px; }

/* Meetings list */
.day-head { display: flex; gap: 0.6rem; align-items: baseline; font-size: 0.95rem; font-weight: 600; margin: 0 0 0.75rem 0.25rem; }
.day-head .muted { font-weight: 400; font-size: 0.875rem; }
.meeting-row { gap: 1.1rem; }
.time-col { width: 3.5rem; display: flex; flex-direction: column; line-height: 1.15; }
.time-col strong { font-size: 1.05rem; font-weight: 650; }
.time-col span { font-size: 0.75rem; color: var(--muted); }
.tone-line { width: 3px; align-self: stretch; border-radius: 3px; }

/* Meeting detail */
.share { display: flex; gap: 2.5rem; align-items: center; flex-wrap: wrap; }
.share-countdown { min-width: 12rem; }
.cd { font-size: 2.4rem; font-weight: 650; letter-spacing: -0.03em; line-height: 1.1; margin-top: 0.25rem; }
.facts { display: flex; flex-direction: column; }
.facts > div { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 1rem; padding: 0.95rem 0; border-top: 1px solid var(--line-soft); font-size: 0.925rem; }
.facts > div:first-child { border-top: 0; padding-top: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
@media (max-width: 640px) { .facts > div { grid-template-columns: 1fr; gap: 0.2rem; } .share { gap: 1.5rem; } }
.btn.is-copied { background: var(--pine-deep); }

/* Display names */
.name-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.5rem; padding: 0 1rem 1.25rem; }
.name-chip { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.4rem 0.4rem 0.5rem; border: 1px solid var(--line-soft); border-radius: 14px; transition: opacity 0.2s, background-color 0.15s; }
.name-chip:hover { background: #fafbfb; }
.name-chip .avatar { width: 2rem; height: 2rem; font-size: 0.7rem; }
.name-chip.is-off { opacity: 0.45; }
.name-chip.is-off .grow { text-decoration: line-through; }

/* ------------------------------------------------------------------
   Public pages
------------------------------------------------------------------- */
.public-top { display: flex; align-items: center; justify-content: space-between; max-width: 72rem; margin: 0 auto; padding: 1.5rem; }
.public-top .brand { padding: 0; }
.public-main { max-width: 72rem; margin: 0 auto; padding: 1.5rem 1.5rem 5rem; }

.home { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 4rem; align-items: center; min-height: calc(100vh - 12rem); }
.home-title { font-size: clamp(2.2rem, 4.5vw, 3.4rem); font-weight: 650; letter-spacing: -0.035em; line-height: 1.06; max-width: 15ch; }
.code-form { display: flex; gap: 0.75rem; align-items: flex-start; max-width: 34rem; }
.code-input { position: relative; }
.code-input svg { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); width: 1.2rem; height: 1.2rem; color: var(--faint); }
.input-lg { height: 3.25rem; padding-left: 2.85rem; font-size: 1rem; }
.home-art { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.tile { border-radius: 20px; background: #fff; border: 1px solid var(--line); animation: reveal 0.7s var(--ease-out-soft) backwards; }
.tile-main { grid-column: span 2; aspect-ratio: 16 / 8.5; padding: 1.25rem; background: var(--pine-deep); border-color: var(--pine-deep); display: flex; flex-direction: column; justify-content: space-between; }
.tile-lines { display: flex; flex-direction: column; gap: 0.6rem; padding: 1.25rem; background: rgb(255 255 255 / 0.94); border-radius: 12px; }
.tile-lines i { display: block; height: 0.6rem; border-radius: 99px; background: var(--line); }
.tile-lines i:first-child { height: 0.9rem; width: 45%; background: var(--pine-soft); }
.tile-person { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; aspect-ratio: 16 / 10; color: var(--muted); }
.tile-person .avatar { width: 3rem; height: 3rem; font-size: 1rem; }
@media (max-width: 900px) { .home { grid-template-columns: 1fr; gap: 3rem; min-height: 0; padding-top: 2rem; } .code-form { flex-direction: column; } .code-form .btn { width: 100%; } }

.meet { display: grid; grid-template-columns: minmax(0, 1fr) 25rem; gap: 4rem; align-items: start; padding-top: 1.5rem; }
.meet-title { font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 650; letter-spacing: -0.035em; line-height: 1.08; margin-top: 1.25rem; max-width: 20ch; }
.meet-facts { display: flex; flex-direction: column; gap: 1.1rem; margin-top: 2.25rem; }
.meet-facts li { display: flex; gap: 1rem; font-size: 0.95rem; line-height: 1.5; }
.meet-facts svg { width: 2.6rem; height: 2.6rem; padding: 0.65rem; border-radius: 12px; background: #fff; border: 1px solid var(--line); color: var(--pine); flex-shrink: 0; }
.meet-count { margin-top: 2.5rem; }
.cd-boxes { display: flex; gap: 0.6rem; margin-top: 0.6rem; }
.cd-boxes > span { display: flex; flex-direction: column; align-items: center; min-width: 4.4rem; padding: 0.8rem 0.5rem 0.6rem; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.cd-boxes b { font-size: 1.85rem; font-weight: 650; letter-spacing: -0.03em; line-height: 1; }
.cd-boxes i { font-style: normal; font-size: 0.72rem; color: var(--muted); margin-top: 0.35rem; }
.meet-desc { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--line); color: var(--ink-soft); max-width: 62ch; }
.meet-card-wrap { position: sticky; top: 1.5rem; }
.meet-card { padding: 2rem; box-shadow: 0 30px 60px -40px rgb(28 36 48 / 0.35); }
.done-badge { width: 2rem; height: 2rem; border-radius: 999px; background: var(--pine); color: #fff; display: grid; place-items: center; }
.done-badge svg { width: 1rem; height: 1rem; }
.join-btn { box-shadow: 0 12px 28px -14px rgb(15 123 95 / 0.8); }
.known-btn { display: flex; align-items: center; gap: 0.85rem; width: 100%; padding: 0.85rem 1rem; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); transition: border-color 0.15s, background-color 0.15s, transform 0.12s; }
.known-btn:hover { border-color: var(--pine); background: var(--pine-soft); }
.known-btn:active { transform: scale(0.99); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 900px) { .meet { grid-template-columns: 1fr; gap: 2.5rem; padding-top: 0; } .meet-card-wrap { position: static; } .meet-card { padding: 1.5rem; } .cd-boxes > span { min-width: 0; flex: 1; } }

/* Error pages */
.error-page { max-width: 34rem; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; text-align: center; padding: 2rem 1.5rem; }
.error-code { font-size: 5.5rem; font-weight: 700; letter-spacing: -0.05em; line-height: 1; margin: 2.5rem 0 1rem; color: var(--pine); opacity: 0.18; }
.toasts[popover] { margin: 0; inset: auto 1.25rem 1.25rem auto; border: 0; padding: 0; background: transparent; overflow: visible; }
@media (max-width: 640px) { .toasts[popover] { inset: auto 1rem 1rem 1rem; } }

/* ------------------------------------------------------------------
   Video upload & recording
------------------------------------------------------------------- */
.dropzone {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem;
    padding: 2.75rem 1.5rem; text-align: center; cursor: pointer;
    border: 1.5px dashed #c9d0d6; border-radius: 18px; background: var(--paper);
    transition: border-color 0.2s, background-color 0.2s, transform 0.2s var(--ease-out-soft);
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--pine); background: #f6faf8; }
.dropzone.is-over { border-color: var(--pine); background: var(--pine-soft); transform: scale(1.01); }
.dropzone.has-file { border-style: solid; border-color: #9fd3c2; background: #f6faf8; }
.dropzone.is-invalid { border-color: var(--onair); background: var(--onair-soft); }
.dropzone-icon { width: 3.25rem; height: 3.25rem; border-radius: 16px; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); color: var(--pine); margin-bottom: 0.5rem; }
.dropzone-icon svg { width: 1.4rem; height: 1.4rem; }
.bar { height: 8px; border-radius: 99px; background: var(--line-soft); overflow: hidden; margin-top: 0.6rem; }
.bar i { display: block; height: 100%; width: 0; background: var(--pine); border-radius: inherit; transition: width 0.4s var(--ease-out-soft); }
.bar.is-indeterminate i { width: 35%; animation: indeterminate 1.4s ease-in-out infinite; }
@keyframes indeterminate { 0% { transform: translateX(-110%); } 100% { transform: translateX(310%); } }
.upload-progress { padding: 1.1rem 1.2rem; border-radius: 16px; background: var(--paper); animation: rise 0.3s var(--ease-out-soft); }
.player { position: relative; aspect-ratio: 16 / 9; background: #0e1419; border-radius: 16px; overflow: hidden; }
.player video { width: 100%; height: 100%; display: block; background: #0e1419; }
.convert { display: flex; gap: 1.25rem; align-items: flex-start; padding: 0.5rem 0; }
.convert-icon { width: 3.25rem; height: 3.25rem; border-radius: 16px; background: var(--pine-soft); color: var(--pine); display: grid; place-items: center; flex-shrink: 0; }

/* Recorder */
.rec { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr) 22rem; align-items: start; }
@media (max-width: 1100px) { .rec { grid-template-columns: 1fr; } }
.rec-side { display: flex; flex-direction: column; gap: 1.25rem; position: sticky; top: 5.5rem; }
@media (max-width: 1100px) { .rec-side { position: static; } }
.stage { position: relative; aspect-ratio: 16 / 9; border-radius: 22px; overflow: hidden; background: radial-gradient(120% 90% at 30% 10%, #1d3a31, #0d1714 70%); }
.stage video { width: 100%; height: 100%; object-fit: contain; display: block; background: #0d1714; }
.stage-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #fff; padding: 2rem; }
.stage-hint .dropzone-icon { background: rgb(255 255 255 / 0.08); border-color: rgb(255 255 255 / 0.15); color: #fff; }
.cam-preview { width: min(14rem, 40%); aspect-ratio: 1; border-radius: 999px; overflow: hidden; margin: 0 auto 1.25rem; border: 3px solid rgb(255 255 255 / 0.85); box-shadow: 0 20px 50px -20px rgb(0 0 0 / 0.6); animation: pop 0.45s var(--ease-spring); }
.cam-preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.stage-count { position: absolute; inset: 0; display: grid; place-items: center; background: rgb(13 23 20 / 0.55); backdrop-filter: blur(4px); }
.stage-count span { font-size: 7rem; font-weight: 700; color: #fff; letter-spacing: -0.05em; animation: count-pop 1s var(--ease-out-soft) infinite; }
@keyframes count-pop { 0% { transform: scale(1.4); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; transform: scale(0.9); } }
.stage-badge { position: absolute; left: 1rem; top: 1rem; display: inline-flex; align-items: center; gap: 0.55rem; height: 2.1rem; padding: 0 0.85rem; border-radius: 999px; background: rgb(0 0 0 / 0.55); color: #fff; font-size: 0.85rem; font-weight: 600; backdrop-filter: blur(6px); }
.stage-badge.is-paused .onair-dot { background: #e0a43a; }
.stage-badge.is-paused .onair-dot::after { animation: none; }
.rec-upload { display: flex; justify-content: space-between; gap: 1rem; padding: 0.85rem 0.25rem 0; color: var(--ink-soft); }
.rec-timer { font-size: 3rem; font-weight: 650; letter-spacing: -0.04em; line-height: 1; }
.rec-dot { width: 0.8rem; height: 0.8rem; border-radius: 999px; background: #fff; box-shadow: 0 0 0 3px rgb(255 255 255 / 0.3); }
.stop-square { width: 0.75rem; height: 0.75rem; border-radius: 3px; background: #fff; }
.source { display: flex; flex-direction: column; gap: 0.6rem; padding: 0.9rem; border-radius: 14px; background: var(--paper); }
.source .input { height: 2.5rem; font-size: 0.85rem; }
.meter { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--pine); border-radius: inherit; transition: width 0.08s linear; }
.rec[data-state='recording'] .rec-side { top: 1rem; }
.fit-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
details.advanced { border-top: 1px solid var(--line-soft); padding-top: 1.25rem; }
details.advanced > summary { list-style: none; display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer; font-size: 0.875rem; font-weight: 550; color: var(--muted); }
details.advanced > summary::-webkit-details-marker { display: none; }
details.advanced > summary:hover { color: var(--ink); }
.advanced-chev { width: 1rem !important; height: 1rem !important; transition: transform 0.2s var(--ease-out-soft); }
details.advanced[open] .advanced-chev { transform: rotate(90deg); }

/* ------------------------------------------------------------------
   Meeting room (dark, Meet-style)
------------------------------------------------------------------- */
.room-body {
    --r-bg: #111916; --r-tile: #1b2521; --r-tile-2: #233029; --r-text: #e9efec; --r-muted: #9db0a7;
    --r-btn: #2a3732; --r-btn-hover: #354640; --r-line: rgb(255 255 255 / 0.08);
    background: var(--r-bg); color: var(--r-text); height: 100vh; height: 100dvh; overflow: hidden;
}
.room-body .muted-l { color: var(--r-muted); }

/* Green room */
.lobby { height: 100%; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: center; gap: 3rem; padding: 2rem clamp(1rem, 5vw, 5rem); background: #f4f6f7; color: var(--ink); }
.lobby-preview { display: flex; justify-content: center; }
.lobby-tile { position: relative; width: 100%; max-width: 46rem; aspect-ratio: 16 / 9; border-radius: 20px; background: #202a26; display: grid; place-items: center; overflow: hidden; animation: reveal 0.6s var(--ease-out-soft); }
.lobby-tile .tile-name { position: absolute; left: 1rem; top: 1rem; color: #fff; font-size: 0.9rem; font-weight: 500; }
.lobby-devices { position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%); display: flex; gap: 0.75rem; }
.dev-btn { width: 3rem; height: 3rem; border-radius: 999px; display: grid; place-items: center; background: #ea4335; color: #fff; }
.dev-btn svg { width: 1.2rem; height: 1.2rem; }
.lobby-side { text-align: center; }
.lobby-title { font-size: clamp(1.75rem, 3vw, 2.25rem); font-weight: 500; letter-spacing: -0.02em; color: var(--ink); }
.lobby-meeting { color: var(--muted); margin-top: 0.5rem; }
.lobby-who { display: flex; align-items: center; justify-content: center; gap: 0.75rem; margin-top: 1.5rem; min-height: 2rem; color: var(--ink-soft); }
.lobby-join { margin-top: 1.75rem; min-width: 12rem; border-radius: 999px; }
.lobby-note { color: var(--muted); max-width: 32ch; margin: 1.25rem auto 0; }
@media (max-width: 900px) { .lobby { grid-template-columns: 1fr; gap: 1.75rem; align-content: center; } }

/* Room layout */
.room { height: 100%; display: flex; flex-direction: column; }
.room-main { flex: 1; min-height: 0; display: flex; gap: 1rem; padding: 1rem 1rem 0; }
.stage-area { flex: 1; min-width: 0; display: flex; gap: 1rem; }
.present-tile { position: relative; flex: 1; min-width: 0; border-radius: 14px; overflow: hidden; background: #0b100e; display: grid; place-items: center; }
.present-tile video { width: 100%; height: 100%; object-fit: contain; background: #0b100e; pointer-events: none; }
.present-label { position: absolute; left: 0.85rem; bottom: 0.8rem; display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.7rem 0.35rem 0.4rem; border-radius: 8px; background: rgb(0 0 0 / 0.45); font-size: 0.85rem; font-weight: 500; backdrop-filter: blur(6px); }
.present-ico { width: 1.5rem; height: 1.5rem; border-radius: 6px; display: grid; place-items: center; background: var(--pine); }
.present-ico svg { width: 0.9rem; height: 0.9rem; }
.tile-btn { position: absolute; width: 2.5rem; height: 2.5rem; border-radius: 999px; display: grid; place-items: center; background: rgb(0 0 0 / 0.45); color: #fff; opacity: 0; transition: opacity 0.2s, background-color 0.15s; }
.tile-btn svg { width: 1.15rem; height: 1.15rem; }
.present-tile:hover .tile-btn, .tile-btn:focus-visible { opacity: 1; }
.tile-btn:hover { background: rgb(0 0 0 / 0.7); }
.present-full { right: 0.75rem; top: 0.75rem; }
.present-tile:fullscreen { border-radius: 0; }

.watermark { position: absolute; left: 10%; top: 12%; z-index: 2; font-size: 0.8rem; font-weight: 500; color: rgb(255 255 255 / 0.2); text-shadow: 0 1px 2px rgb(0 0 0 / 0.25); white-space: nowrap; pointer-events: none; user-select: none; transition: left 2.5s ease-in-out, top 2.5s ease-in-out; }

.stage-overlay { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; padding: 1.5rem; }
.stage-overlay[data-waiting], .stage-overlay[data-problem] { background: radial-gradient(80% 70% at 50% 40%, #1d2a25, #0d1311); }
.stage-overlay[data-sound] { background: rgb(0 0 0 / 0.35); }
.overlay-card { text-align: center; max-width: 26rem; animation: rise 0.4s var(--ease-out-soft); }
.overlay-title { font-size: 1.1rem; font-weight: 500; margin-top: 1rem; }
.overlay-sub { color: var(--r-muted); font-size: 0.9rem; margin-top: 0.35rem; }

.tiles { width: 15.5rem; display: flex; flex-direction: column; gap: 0.75rem; overflow: hidden; }
.ptile { position: relative; flex: 0 0 auto; aspect-ratio: 16 / 10; border-radius: 12px; background: var(--r-tile); display: grid; place-items: center; animation: tile-in 0.45s var(--ease-out-soft); }
.ptile .avatar { width: 3.75rem; height: 3.75rem; font-size: 1.15rem; }
.ptile-name { position: absolute; left: 0.6rem; bottom: 0.5rem; right: 2.2rem; font-size: 0.78rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgb(0 0 0 / 0.5); }
.ptile-mic { position: absolute; right: 0.5rem; top: 0.5rem; width: 1.6rem; height: 1.6rem; border-radius: 999px; display: grid; place-items: center; background: rgb(0 0 0 / 0.35); color: #fff; }
.ptile-mic svg { width: 0.85rem; height: 0.85rem; }
.ptile-hand { position: absolute; left: 0.5rem; top: 0.5rem; font-size: 1rem; animation: pop 0.45s var(--ease-spring); }
.ptile-more { color: var(--r-muted); font-size: 0.9rem; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.ptile-more .avatar-stack .avatar { border-color: var(--r-tile); }
@keyframes tile-in { from { opacity: 0; transform: scale(0.94); } }

.reactions-layer { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.float-react { position: absolute; bottom: 3.5rem; display: flex; flex-direction: column; align-items: center; gap: 0.2rem; animation: float-up 3.6s ease-out forwards; }
.float-react b { font-size: 2.2rem; line-height: 1; filter: drop-shadow(0 4px 8px rgb(0 0 0 / 0.3)); }
.float-react span { font-size: 0.7rem; padding: 0.1rem 0.45rem; border-radius: 99px; background: rgb(0 0 0 / 0.5); white-space: nowrap; }
@keyframes float-up { 0% { opacity: 0; transform: translateY(20px) scale(0.6); } 12% { opacity: 1; transform: translateY(0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-55vh); } }

/* Side panel */
.panel-side { width: 22rem; flex-shrink: 0; display: flex; flex-direction: column; background: #fff; color: var(--ink); border-radius: 14px; overflow: hidden; animation: panel-in 0.3s var(--ease-out-soft); }
@keyframes panel-in { from { opacity: 0; transform: translateX(24px); } }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0.75rem 0.5rem 1.4rem; }
.panel-title { font-size: 1.1rem; font-weight: 500; }
.panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0.5rem 1.4rem 1.25rem; }
.panel-body .muted-l { color: var(--muted); }
.panel-section { font-size: 0.75rem; font-weight: 600; color: var(--muted); margin: 1.4rem 0 0.6rem; }
.people { display: flex; flex-direction: column; }
.people li { display: flex; align-items: center; gap: 0.8rem; padding: 0.55rem 0; font-size: 0.9rem; animation: rise 0.3s var(--ease-out-soft); }
.people .avatar { width: 2.25rem; height: 2.25rem; font-size: 0.75rem; }
.people .tag { font-size: 0.75rem; color: var(--muted); }
.people svg { width: 1rem; height: 1rem; color: var(--faint); margin-left: auto; flex-shrink: 0; }
.chat { display: flex; flex-direction: column; padding-bottom: 0; }
.chat-note { padding: 0.75rem 0.9rem; border-radius: 10px; background: var(--paper); color: var(--muted); text-align: center; }
.chat-list { flex: 1; display: flex; flex-direction: column; gap: 1rem; padding: 1.1rem 0; }
.chat-list li { animation: rise 0.25s var(--ease-out-soft); }
.chat-meta { display: flex; gap: 0.5rem; align-items: baseline; font-size: 0.8rem; }
.chat-meta strong { font-weight: 600; }
.chat-meta .host-badge { font-size: 0.68rem; padding: 0.05rem 0.4rem; border-radius: 99px; background: var(--pine-soft); color: var(--pine-deep); font-weight: 600; }
.chat-meta time { color: var(--faint); font-size: 0.72rem; }
.chat-body { font-size: 0.9rem; margin-top: 0.2rem; word-wrap: break-word; color: var(--ink-soft); }
.chat-form { position: sticky; bottom: 0; display: flex; align-items: center; gap: 0.25rem; margin: 0 -0.4rem; padding: 0.6rem 0 1rem; background: #fff; }
.chat-input { flex: 1; height: 2.9rem; padding: 0 1.1rem; border: 0; border-radius: 999px; background: var(--paper); font-size: 0.9rem; }
.chat-input:focus { outline: 2px solid var(--pine); }
.chat-off { text-align: center; color: var(--muted); padding: 1rem 0 1.4rem; }
.linkbox.dark { background: var(--paper); }

/* Bottom bar */
.room-bar { position: relative; z-index: 10; flex-shrink: 0; height: 5rem; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; padding: 0 1.25rem; }
.bar-left { display: flex; gap: 0.6rem; align-items: center; font-size: 0.95rem; min-width: 0; color: var(--r-text); }
.bar-sep { color: var(--r-muted); }
.bar-center { display: flex; gap: 0.6rem; align-items: center; }
.bar-right { display: flex; gap: 0.25rem; justify-content: flex-end; }
.round-btn { position: relative; width: 2.9rem; height: 2.9rem; border-radius: 999px; display: grid; place-items: center; background: var(--r-btn); color: var(--r-text); transition: background-color 0.15s, transform 0.12s; }
.round-btn svg { width: 1.3rem; height: 1.3rem; }
.round-btn:hover { background: var(--r-btn-hover); }
.round-btn:active { transform: scale(0.94); }
.round-btn.is-off { background: #ea4335; color: #fff; }
.round-btn.is-off:hover { background: #d33426; }
.round-btn.is-on { background: #a8c7fa; color: #062e6f; }
.round-btn.leave { width: 3.9rem; border-radius: 999px; background: #ea4335; color: #fff; }
.round-btn.leave:hover { background: #d33426; }
.round-btn.ghost { background: transparent; }
.round-btn.ghost:hover { background: var(--r-btn); }
.round-btn.ghost.is-active { color: #a8c7fa; }
.round-btn.sm { width: 2.5rem; height: 2.5rem; background: transparent; color: var(--ink-soft); }
.round-btn.sm:hover { background: var(--line-soft); }
.round-btn.sm.send { color: var(--pine); }
.bar-badge { position: absolute; top: -0.15rem; right: -0.15rem; min-width: 1.25rem; height: 1.25rem; padding: 0 0.3rem; border-radius: 99px; background: #3c4a44; color: #fff; font-size: 0.68rem; display: grid; place-items: center; }
.bar-dot { position: absolute; top: 0.55rem; right: 0.55rem; width: 0.55rem; height: 0.55rem; border-radius: 99px; background: #a8c7fa; animation: pop 0.4s var(--ease-spring); }
.react-wrap { position: relative; }
.react-pop { z-index: 50; position: absolute; bottom: calc(100% + 0.75rem); left: 50%; transform: translateX(-50%); display: flex; gap: 0.15rem; padding: 0.4rem; border-radius: 999px; background: var(--r-tile-2); box-shadow: 0 12px 30px -10px rgb(0 0 0 / 0.6); animation: menu-in 0.2s var(--ease-out-soft); }
.react-pop button { width: 2.6rem; height: 2.6rem; border-radius: 999px; font-size: 1.35rem; transition: transform 0.15s var(--ease-spring), background-color 0.15s; }
.react-pop button:hover { background: rgb(255 255 255 / 0.1); transform: scale(1.18); }

/* Left / ended */
.left-screen { height: 100%; display: grid; place-items: center; background: #f4f6f7; color: var(--ink); text-align: center; padding: 1.5rem; }

@media (max-width: 1100px) { .tiles { width: 12rem; } }
@media (max-width: 800px) {
    .room-main { padding: 0.5rem 0.5rem 0; }
    .stage-area { flex-direction: column; gap: 0.5rem; }
    .present-tile { flex: 0 0 auto; width: 100%; aspect-ratio: 16 / 9; }
    .tiles { width: auto; flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 0.5rem; }
    .ptile .avatar { width: 3rem; height: 3rem; font-size: 0.95rem; }
    .panel-side { position: fixed; inset: 0; z-index: 40; width: auto; border-radius: 0; }
    .room-bar { grid-template-columns: auto 1fr; height: 4.5rem; padding: 0 0.6rem; gap: 0.4rem; }
    .bar-left { display: none; }
    .bar-center { gap: 0.4rem; }
    .round-btn { width: 2.6rem; height: 2.6rem; }
    .round-btn.leave { width: 3.3rem; }
    .bar-right { gap: 0; }
}

/* Host room tab */
.host-chat { display: flex; flex-direction: column; min-height: 32rem; overflow: hidden; }
.host-list { flex: 1; max-height: 34rem; overflow-y: auto; padding: 0 1.5rem; display: flex; flex-direction: column; }
.host-list li { padding: 0.85rem 0; border-top: 1px solid var(--line-soft); animation: rise 0.25s var(--ease-out-soft); }
.host-list li:first-child { border-top: 0; }
.host-list li.is-host { background: linear-gradient(90deg, var(--pine-soft), transparent 60%); margin: 0 -1.5rem; padding-left: 1.5rem; padding-right: 1.5rem; }
.host-list li.is-hidden p { text-decoration: line-through; color: var(--faint); }
.host-form { display: flex; gap: 0.6rem; padding: 1rem 1.5rem 1.25rem; border-top: 1px solid var(--line); }
.online-list { max-height: 26rem; overflow-y: auto; }
.online-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 1.5rem; border-top: 1px solid var(--line-soft); }
.online-row.has-hand { background: var(--amber-soft); }
