/* Educator Hub.
   Sits on top of ../dashboard-new.css (which imports landing-new.css), so the
   header, rail, tabs, cards and footer are the learner dashboard's own. This
   file adds only what the hub needs, namespaced .hub-* / .room-* / .deck-*.

   Theming: the shared stylesheets hard-code their dark colours per component.
   Everything new here reads the --hub-* variables below instead, so a component
   is written once and both themes follow. */

/* ── Tokens ──────────────────────────────────────────────────────────────── */
.hub {
    --hub-surface: #ffffff;
    --hub-surface-2: #f6f3ec;
    --hub-band: #f3f0e9;
    --hub-ink: #18211f;
    /* Both greys clear 4.5:1 on every surface they sit on, the tinted bands
       included; landing-new.css's --text-soft (3.3:1) does not. */
    --hub-muted: #56605b;
    --hub-soft: #66706a;
    --hub-line: rgba(24, 33, 31, 0.12);
    --hub-line-strong: rgba(24, 33, 31, 0.22);
    --hub-accent: #234d6f;
    --hub-btn: #18211f;
    --hub-btn-ink: #fffdf8;
    --hub-track: #ece8df;
    --hub-shadow: 0 20px 40px -18px rgba(30, 42, 36, 0.16);
    --hub-shadow-lg: 0 34px 70px -28px rgba(30, 42, 36, 0.34);
    --hub-radius: 22px;
    --hub-radius-sm: 14px;

    /* Chart slots: one per style, in the fixed order the styles are listed in
       hub-data.js. Light values are the colours the participant's own result
       chart uses; the dark values are the same hues re-stepped for a dark
       card. Both sets pass scripts/validate_palette.js on their surface, the
       light one with labels as the contrast relief. */
    --hub-s1: #4A90E2;
    --hub-s2: #50BFA5;
    --hub-s3: #6A4C93;
    --hub-s4: #FF6B6B;

    /* One accent per section, drawn from the four the site already has, so a
       tab predicts the colour of what it opens (as Assess/Learn/Reflect do). */
    --hub-overview: #234d6f;
    --hub-prepare: #4f6f5d;
    --hub-run: #9d5145;
    --hub-review: #65566f;

    color: var(--hub-ink);
}

.dark .hub {
    --hub-surface: #1F2937;
    --hub-surface-2: #172033;
    --hub-band: #121b30;
    --hub-ink: #F9FAFB;
    --hub-muted: #A7B0BD;
    --hub-soft: #98A2B1;
    --hub-line: #374151;
    --hub-line-strong: #4B5563;
    --hub-accent: #93c5fd;
    --hub-btn: #F9FAFB;
    --hub-btn-ink: #111827;
    --hub-track: #111827;
    --hub-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.55);
    --hub-shadow-lg: 0 34px 70px -28px rgba(0, 0, 0, 0.7);
    --hub-s1: #4A90E2;
    --hub-s2: #3FA98F;
    --hub-s3: #9A7FD1;
    --hub-s4: #E8615F;
    --hub-overview: #7fb3dd;
    --hub-prepare: #8cc0a3;
    --hub-run: #e0998d;
    --hub-review: #b8a6c4;
}

/* ── Base ────────────────────────────────────────────────────────────────── */
.hub h1, .hub h2, .hub h3, .hub h4 { color: var(--hub-ink); }
/* The account's sign-in (onboarding.css) is drawn inside this page: its heading sits on blue, and stays white. */
.hub .fba-auth-aside h2 { color: #fff; }
.hub button, .hub select, .hub input, .hub textarea { font-family: inherit; }
.hub [hidden] { display: none !important; }

.hub :focus-visible {
    outline: 3px solid color-mix(in srgb, var(--hub-accent) 50%, transparent);
    outline-offset: 3px;
}

#hub-main { flex: 1 0 auto; }

/* Which face shows. The attribute is set before first paint (see index.html). */
html[data-hub-access="educator"] #hub-public,
html:not([data-hub-access="educator"]) #hub-app { display: none; }
html:not([data-hub-access="visitor"]) .hub-if-visitor,
html:not([data-hub-access="pending"]) .hub-if-pending,
html:not([data-hub-access="educator"]) .hub-if-educator,
html:not([data-hub-signed="no"]) .hub-if-signedout { display: none !important; }

/* landing-new.css's primary button is ink on ink in dark mode. */
.dark .hub .btn-primary { color: #111827; background: #F9FAFB; box-shadow: none; }
.dark .hub .btn-primary:hover { background: #e5e7eb; }
.dark .hub .btn-secondary:hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.3); }
.hub .btn { font-family: inherit; text-decoration: none; }
.hub .btn i { font-size: 1.25rem; }
.hub-block { width: 100%; }
.hub-btn-sm { min-height: 2.5rem; padding: 0.6rem 1.05rem; font-size: 0.9rem; }
.hub-btn-light { color: #18211f; background: #fffdf8; }
.hub-btn-light:hover { background: #ffffff; }

/* The dashboard keeps these in an inline <style>, which this page doesn't load. */
.dark .dashboard-theme-toggle .sun-icon { opacity: 0; }
.dark .dashboard-theme-toggle .moon-icon { opacity: 1; }

/* Quiet secondary action, used wherever a second button sits beside a primary. */
.hub-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.5rem;
    padding: 0.55rem 0.95rem;
    border: 1px solid var(--hub-line-strong);
    border-radius: 999px;
    background: transparent;
    color: var(--hub-ink);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.hub-ghost:hover {
    border-color: var(--hub-accent);
    background: color-mix(in srgb, var(--hub-accent) 7%, transparent);
}
.hub-ghost i { font-size: 1.05rem; }
/* Named, but not there yet: dimmed, and not a control. */
.hub-ghost.is-soon { border-style: dashed; color: var(--hub-muted); opacity: 0.7; cursor: default; }
.hub-ghost.is-soon:hover { border-color: var(--hub-line-strong); background: transparent; }
.hub-ghost.is-soon small { font-size: 0.74rem; font-weight: 500; }

/* A button that reads as part of its sentence ("Try again"). */
.hub-inline {
    padding: 0;
    border: 0;
    background: none;
    color: var(--hub-accent);
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.hub-icon-btn {
    width: 2.4rem;
    height: 2.4rem;
    flex: none;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--hub-line);
    border-radius: 50%;
    background: var(--hub-surface);
    color: var(--hub-ink);
    font-size: 1.1rem;
    cursor: pointer;
    transition: border-color 0.2s ease;
}
.hub-icon-btn:hover { border-color: var(--hub-line-strong); }

.hub-eyebrow {
    margin: 0 0 0.9rem;
    color: var(--hub-accent);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hub-lede {
    color: var(--hub-muted);
    font-size: clamp(1.02rem, 1.3vw, 1.18rem);
    line-height: 1.6;
}

.hub-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    flex: none;
    border-radius: 3px;
    background: var(--c, var(--hub-accent));
}

/* ── Header additions ────────────────────────────────────────────────────── */
.hub-product {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.7rem;
    border: 1px solid color-mix(in srgb, var(--hub-accent) 28%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--hub-accent) 9%, transparent);
    color: var(--hub-accent);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
}

.hub-header-link {
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    color: var(--hub-muted);
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    transition: color 0.2s ease, background 0.2s ease;
}
.hub-header-link:hover {
    color: var(--hub-ink);
    background: color-mix(in srgb, var(--hub-ink) 7%, transparent);
}
/* "Sign in" is a button that looks like the link beside it. */
button.hub-header-link { border: 0; background: none; font-family: inherit; cursor: pointer; }

.hub .hub-header-cta { min-height: 2.45rem; padding: 0.55rem 1rem; font-size: 0.9rem; }

.hub-header-status,
.hub-cta-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 700;
    white-space: nowrap;
}
.hub-header-status {
    background: color-mix(in srgb, #b88746 16%, transparent);
    color: #7a5520;
}
.dark .hub-header-status { color: #e3bd7c; }


/* ═══════════════════════════════════════════════════════════════════════════
   Face 1 · the public page
   ═══════════════════════════════════════════════════════════════════════════ */
.hub-pending {
    border-bottom: 1px solid color-mix(in srgb, #b88746 30%, transparent);
    background: color-mix(in srgb, #b88746 12%, var(--hub-surface));
}
.hub-pending-inner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding-block: 0.9rem;
    font-size: 0.95rem;
    line-height: 1.5;
}
.hub-pending-inner i { flex: none; margin-top: 0.15rem; font-size: 1.2rem; color: #b88746; }

.hub-hero { padding: clamp(2.5rem, 5vw, 4.5rem) 0 clamp(3rem, 6vw, 5rem); }
.hub-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center;
}
.hub-hero h1 {
    max-width: 13ch;
    font-size: clamp(2.5rem, 5.2vw, 4.2rem);
    line-height: 1.02;
    letter-spacing: -0.035em;
}
.hub-hero .hub-lede { max-width: 56ch; margin-top: 1.25rem; }
.hub-hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.9rem; }
.hub-trust {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-top: 1.6rem;
    color: var(--hub-soft);
    font-size: 0.88rem;
    font-weight: 600;
}
.hub-trust i { flex: none; color: var(--hub-accent); font-size: 1.1rem; }

/* The preview: a small room view, live. */
.hub-frame {
    margin: 0;
    border: 1px solid var(--hub-line);
    border-radius: var(--hub-radius);
    background: var(--hub-surface);
    box-shadow: var(--hub-shadow-lg);
    overflow: hidden;
}
.hub-frame-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--hub-line);
}
.hub-frame-dots { display: inline-flex; gap: 0.35rem; flex: none; }
.hub-frame-dots span { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--hub-line-strong); }
.hub-frame-label {
    overflow: hidden;
    color: var(--hub-soft);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.hub-live {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
    color: var(--hub-muted);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}
.hub-live i {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--hub-run);
    animation: hubPulse 1.8s ease-in-out infinite;
}
.hub-live b { color: var(--hub-ink); font-weight: 700; }
@keyframes hubPulse {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--hub-run) 45%, transparent); }
    50% { box-shadow: 0 0 0 5px transparent; }
}
.hub-frame-body {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    padding: 1rem;
}
.hub-frame-side { display: grid; gap: 0.55rem; }
.hub-frame-qr {
    width: 84px;
    height: 84px;
    padding: 5px;
    border: 1px solid rgba(24, 33, 31, 0.14);
    border-radius: 10px;
    background: #ffffff;
}
.hub-frame-qr img, .hub-frame-qr canvas { display: block; width: 100% !important; height: 100% !important; }
.hub-frame-join { font-size: 0.8rem; font-weight: 700; }
.hub-frame-dist { margin-top: 0.35rem; }

/* Sections */
.hub-section { padding-block: clamp(3rem, 6vw, 5rem); }
.hub-section--alt { border-block: 1px solid var(--hub-line); background: var(--hub-band); }
.hub-section-head { max-width: 44rem; margin-bottom: clamp(1.75rem, 3.5vw, 2.75rem); }
.hub-section-head h2 {
    font-size: clamp(1.9rem, 3.8vw, 2.9rem);
    line-height: 1.06;
    letter-spacing: -0.03em;
}
.hub-section-head .hub-lede { margin-top: 1rem; }
.hub-section-head--center { margin-inline: auto; text-align: center; }

/* Three jobs */
.hub-jobs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; }
.hub-job {
    --job: var(--hub-prepare);
    padding: clamp(1.4rem, 2.4vw, 1.9rem);
    border: 1px solid var(--hub-line);
    border-radius: var(--hub-radius);
    background: var(--hub-surface);
}
.hub-job[data-job="run"] { --job: var(--hub-run); }
.hub-job[data-job="review"] { --job: var(--hub-review); }
.hub-job-icon {
    width: 3rem;
    height: 3rem;
    display: grid;
    place-items: center;
    margin-bottom: 1.1rem;
    border-radius: 0.95rem;
    background: color-mix(in srgb, var(--job) 14%, transparent);
    color: var(--job);
    font-size: 1.5rem;
}
.hub-job h3 { font-size: 1.4rem; line-height: 1.15; letter-spacing: -0.02em; }
.hub-job > p { margin-top: 0.55rem; color: var(--hub-muted); line-height: 1.55; }
.hub-job ul { display: grid; gap: 0.5rem; margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--hub-line); }
.hub-job li {
    position: relative;
    padding-left: 1.4rem;
    font-size: 0.93rem;
    font-weight: 500;
    line-height: 1.4;
}
.hub-job li::before {
    content: "";
    position: absolute;
    left: 0.15rem;
    top: 0.5em;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--job);
}

/* Activity cards (public page and the Run tab) */
.hub-activity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
.hub-act {
    --act: var(--hub-overview);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: clamp(1.25rem, 2vw, 1.6rem);
    border: 1px solid var(--hub-line);
    border-radius: var(--hub-radius);
    background: var(--hub-surface);
    box-shadow: var(--hub-shadow);
}
.hub-act[data-group="reflect"] { --act: var(--hub-review); }
.hub-act-top { display: flex; align-items: flex-start; gap: 1rem; }
.hub-act-text { flex: 1; min-width: 0; }
.hub-act-head { display: flex; align-items: center; gap: 0.75rem; }
.hub-act-icon {
    width: 2.75rem;
    height: 2.75rem;
    flex: none;
    display: grid;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--act, var(--hub-accent)) 22%, transparent);
    border-radius: 13px;
    background: color-mix(in srgb, var(--act, var(--hub-accent)) 12%, transparent);
    color: var(--act, var(--hub-accent));
    font-size: 1.45rem;
}
.hub-act h3 { font-size: 1.14rem; line-height: 1.2; letter-spacing: -0.015em; }
.hub-act-kind {
    margin-top: 0.15rem;
    color: var(--hub-soft);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}
.hub-act-blurb { margin-top: 0.8rem; color: var(--hub-muted); font-size: 0.97rem; line-height: 1.5; }
.hub-act-thumb {
    width: 92px;
    height: 92px;
    flex: none;
    border-radius: 14px;
    overflow: hidden;
    color: var(--hub-ink);
}
.hub-act-thumb svg { display: block; width: 100%; height: 100%; }
.hub-act-thumb--line { border: 1px solid var(--hub-line); background: var(--hub-surface-2); }

.hub-facts { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.hub-facts li {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--hub-line);
    border-radius: 999px;
    color: var(--hub-muted);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}
.hub-facts i { font-size: 0.95rem; color: var(--hub-soft); }

.hub-act-sees { color: var(--hub-muted); font-size: 0.9rem; line-height: 1.5; }
.hub-act-sees strong { color: var(--hub-ink); font-weight: 700; }
.hub-act-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: auto; padding-top: 0.25rem; }

.hub-soon-line { margin-top: 1.4rem; color: var(--hub-soft); font-size: 0.92rem; }
.hub-soon-line strong { color: var(--hub-muted); font-weight: 700; }

/* How it works */
.hub-how {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.1rem;
    margin: 0;
    padding: 0;
    counter-reset: how;
}
.hub-how li {
    position: relative;
    padding: 1.3rem 1.3rem 1.4rem;
    border: 1px solid var(--hub-line);
    border-radius: var(--hub-radius);
    background: var(--hub-surface);
    counter-increment: how;
}
.hub-how li::before {
    content: "0" counter(how);
    display: block;
    margin-bottom: 0.9rem;
    color: var(--hub-run);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
}
.hub-how h3 { font-size: 1.1rem; line-height: 1.2; letter-spacing: -0.01em; }
.hub-how p { margin-top: 0.4rem; color: var(--hub-muted); font-size: 0.93rem; line-height: 1.5; }

/* Who it is for */
.hub-audience {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: start;
}
.hub-audience .hub-section-head { margin-bottom: 0; }
.hub-audience-list { display: grid; gap: 0.9rem; }
.hub-audience-item {
    display: flex;
    gap: 1rem;
    padding: 1.25rem 1.35rem;
    border: 1px solid var(--hub-line);
    border-radius: var(--hub-radius);
    background: var(--hub-surface);
}
.hub-audience-item > i { flex: none; margin-top: 0.1rem; color: var(--hub-accent); font-size: 1.6rem; }
.hub-audience-item h3 { font-size: 1.12rem; line-height: 1.2; letter-spacing: -0.01em; }
.hub-audience-item p { margin-top: 0.35rem; color: var(--hub-muted); font-size: 0.95rem; line-height: 1.5; }

/* Proof. The logos are dark artwork on transparent, so in dark mode they sit
   on a light plate instead of disappearing. */
.hub-logos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: clamp(1.4rem, 3vw, 2.2rem) clamp(1.8rem, 4.5vw, 3.6rem);
    padding: 0.5rem 0;
}
.dark .hub-logos { padding: 1.5rem; border-radius: var(--hub-radius); background: #f4f1ea; }
.hub-logos img {
    width: auto;
    height: calc(var(--s, 1) * clamp(2rem, 3.6vw, 2.7rem));
    max-width: 100%;
    filter: grayscale(1) opacity(0.72);
    transition: filter 0.28s ease;
}
.hub-logos img:hover { filter: none; }

.hub-quote {
    max-width: 46rem;
    margin: clamp(2rem, 4vw, 3rem) auto 0;
    padding: clamp(1.5rem, 3vw, 2.2rem);
    border: 1px solid var(--hub-line);
    border-radius: var(--hub-radius);
    background: var(--hub-surface);
}
.hub-quote blockquote {
    margin: 0;
    font-size: clamp(1.05rem, 1.5vw, 1.25rem);
    line-height: 1.5;
    letter-spacing: -0.005em;
}
.hub-quote blockquote::before {
    content: "\201C";
    display: block;
    margin-bottom: 0.2rem;
    color: var(--hub-accent);
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 0.35;
}
.hub-quote figcaption {
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--hub-line);
    color: var(--hub-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

/* Questions + closing call */
.hub-faq-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: clamp(1.5rem, 4vw, 3.5rem);
    align-items: start;
}
.hub-faq-grid .hub-section-head { margin-bottom: 0; }
.hub-faq details { border-bottom: 1px solid var(--hub-line); }
.hub-faq details:first-child { border-top: 1px solid var(--hub-line); }
.hub-faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.05rem 0.1rem;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}
.hub-faq summary::-webkit-details-marker { display: none; }
.hub-faq summary i { flex: none; color: var(--hub-soft); font-size: 1.1rem; transition: transform 0.25s ease; }
.hub-faq details[open] summary i { transform: rotate(45deg); }
.hub-faq details p { max-width: 60ch; padding: 0 0.1rem 1.15rem; color: var(--hub-muted); line-height: 1.6; }

.hub-cta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2rem;
    align-items: center;
    margin-top: clamp(3rem, 6vw, 4.5rem);
    padding: clamp(1.8rem, 4vw, 3rem);
    border-radius: 1.5rem;
    background: #18211f;
    color: #fffdf8;
}
.dark .hub-cta { border: 1px solid var(--hub-line); background: #1F2937; }
.hub .hub-cta h2 { color: #fffdf8; font-size: clamp(1.8rem, 3.6vw, 2.7rem); line-height: 1.06; letter-spacing: -0.03em; }
.hub-cta .hub-eyebrow { color: rgba(255, 253, 248, 0.66); }
.hub-cta p:not(.hub-eyebrow) { max-width: 54ch; margin-top: 0.85rem; color: rgba(255, 253, 248, 0.8); line-height: 1.6; }
.hub-cta-status { background: rgba(255, 253, 248, 0.12); color: #fffdf8; }
.hub-cta-status i { font-size: 1.1rem; color: #8cc0a3; }

/* ═══════════════════════════════════════════════════════════════════════════
   Face 2 · the workspace
   ═══════════════════════════════════════════════════════════════════════════ */
.dark .hub .dash-rail .dashboard-header p { color: var(--hub-muted); }

/* The primary action of the whole hub. */
.hub-start {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.95rem 1.1rem;
    border: 0;
    border-radius: 16px;
    background: var(--hub-btn);
    color: var(--hub-btn-ink);
    text-align: left;
    cursor: pointer;
    box-shadow: 0 16px 28px -16px rgba(24, 33, 31, 0.55);
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.hub-start:hover { transform: translateY(-1px); box-shadow: 0 20px 32px -16px rgba(24, 33, 31, 0.6); }
.hub-start:active { transform: translateY(0); }
.hub-start > i { flex: none; font-size: 1.7rem; color: #e9a89b; }
.dark .hub-start > i { color: #9d5145; }
.hub-start-text { display: grid; gap: 0.1rem; min-width: 0; }
.hub-start strong { font-size: 0.98rem; font-weight: 700; line-height: 1.2; }
.hub-start small { font-size: 0.78rem; line-height: 1.3; opacity: 0.72; }

.hub-railstats {
    width: 100%;
    margin: 0;
    padding: 0.3rem 1.1rem;
    border: 1px solid var(--hub-line);
    border-radius: 14px;
    background: var(--hub-surface);
}
.hub-railstats div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--hub-line);
}
.hub-railstats div:last-child { border-bottom: 0; }
.hub-railstats dt { color: var(--hub-muted); font-size: 0.84rem; }
.hub-railstats dd { margin: 0; font-size: 0.95rem; font-weight: 700; text-align: right; }

.hub-rail-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--hub-muted);
    font-size: 0.86rem;
    font-weight: 600;
}
.hub-rail-link:hover { color: var(--hub-accent); }
.hub-rail-link i { font-size: 1.05rem; }

/* Tabs: the dashboard's own, with one accent per section. */
.hub-tabs { --tab-on-accent: #ffffff; }
.dark .hub-tabs { --tab-on-accent: #111827; }
.hub-tabs[data-active="overview"] { --tab-accent: var(--hub-overview); }
.hub-tabs[data-active="prepare"] { --tab-accent: var(--hub-prepare); }
.hub-tabs[data-active="run"] { --tab-accent: var(--hub-run); }
.hub-tabs[data-active="review"] { --tab-accent: var(--hub-review); }

.hub .dash-panel[data-panel="overview"] { --card-accent: var(--hub-overview); }
.hub .dash-panel[data-panel="prepare"] { --card-accent: var(--hub-prepare); }
.hub .dash-panel[data-panel="run"] { --card-accent: var(--hub-run); }
.hub .dash-panel[data-panel="review"] { --card-accent: var(--hub-review); }

.hub .dash-section-heading { margin-top: 2.2rem; }
.hub .dash-panel > .dash-section-heading:first-child { margin-top: 0; }

.hub-panel-intro { max-width: 62ch; margin: 0 0 1.3rem; color: var(--hub-muted); font-size: 1rem; line-height: 1.55; }

.hub-more {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.9rem;
    padding: 0.3rem 0;
    border: 0;
    background: none;
    color: var(--hub-accent);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
}
.hub-more i { transition: transform 0.2s ease; }
.hub-more:hover i { transform: translateX(3px); }

/* Overview · quick launch */
.hub-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; }
.hub-quicktile {
    --act: var(--hub-overview);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 1rem 1rem 0.9rem;
    border: 1px solid var(--hub-line);
    border-radius: 18px;
    background: var(--hub-surface);
    color: var(--hub-ink);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s var(--ease), box-shadow 0.2s ease;
}
.hub-quicktile[data-group="reflect"] { --act: var(--hub-review); }
.hub-quicktile:hover {
    border-color: color-mix(in srgb, var(--act) 55%, transparent);
    transform: translateY(-2px);
    box-shadow: var(--hub-shadow);
}
.hub-quicktile .hub-act-icon { margin-bottom: 0.55rem; }
.hub-quick-title { font-size: 0.95rem; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
.hub-quick-meta { color: var(--hub-muted); font-size: 0.8rem; line-height: 1.35; }
.hub-quick-go {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.6rem;
    color: var(--act);
    font-size: 0.82rem;
    font-weight: 700;
}
.hub-quick-go i { transition: transform 0.2s ease; }
.hub-quicktile:hover .hub-quick-go i { transform: translateX(3px); }

/* Overview · recent sessions */
.hub-recent { display: grid; gap: 0.55rem; }
.hub-row {
    --act: var(--hub-overview);
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 15.5rem);
    align-items: center;
    gap: 0.8rem 1.1rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--hub-line);
    border-radius: 16px;
    background: var(--hub-surface);
    color: var(--hub-ink);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease;
}
.hub-row:hover { border-color: color-mix(in srgb, var(--hub-accent) 55%, transparent); }
.hub-row .hub-act-icon { width: 2.4rem; height: 2.4rem; border-radius: 11px; font-size: 1.2rem; }
.hub-row-main { min-width: 0; display: grid; gap: 0.1rem; }
.hub-row-name { overflow: hidden; font-size: 0.93rem; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.hub-row-meta { overflow: hidden; color: var(--hub-muted); font-size: 0.8rem; white-space: nowrap; text-overflow: ellipsis; }
.hub-row-n { font-size: 0.9rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hub-row-n span { color: var(--hub-muted); font-weight: 500; }
.hub-row .hub-result { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.hub-result {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--hub-muted);
    font-size: 0.82rem;
    white-space: nowrap;
}
.hub-result b { color: var(--hub-ink); font-weight: 700; }

/* Overview · news */
.hub-news { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; }
.hub-news button {
    width: 100%;
    display: flex;
    gap: 0.75rem;
    padding: 0.7rem 0.6rem;
    border: 0;
    border-radius: 12px;
    background: none;
    color: var(--hub-ink);
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
}
.hub-news button:hover { background: color-mix(in srgb, var(--hub-ink) 5%, transparent); }
.hub-news i { flex: none; margin-top: 0.1rem; color: var(--hub-prepare); font-size: 1.25rem; }
.hub-news strong { display: block; font-size: 0.93rem; font-weight: 700; line-height: 1.3; }
.hub-news span { display: block; margin-top: 0.1rem; color: var(--hub-muted); font-size: 0.85rem; line-height: 1.45; }

/* Tiles: the dashboard's .card, as a real button. */
.hub-tile {
    --status-color: var(--card-accent, var(--hub-accent));
    width: 100%;
    padding: 0;
    font: inherit;
    text-align: left;
    appearance: none;
}
.hub .hub-tile .card-content p { color: var(--hub-muted); }
.hub-tile .card-footer { color: var(--hub-muted); font-size: 0.82rem; font-weight: 600; }
.hub-tile-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.55rem; min-width: 0; }
.hub-tile-go {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--card-accent, var(--hub-accent));
    font-weight: 700;
    white-space: nowrap;
}
.hub-tiles { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
/* A note that is not ready keeps its place in the row, dimmed. It is not a
   control, so it neither lifts nor takes the pointer. */
.hub .hub-tile--soon { opacity: 0.55; cursor: default; box-shadow: none; }
.hub .hub-tile--soon:hover { transform: none; box-shadow: none; border-color: var(--hub-line); }
.hub .hub-tile--soon:hover::after { opacity: 0; animation: none; }
.hub .hub-tile--soon .card-emoji,
.hub .hub-tile--soon:hover .card-emoji { transform: none; filter: grayscale(1); }
/* Four tiles in a three-column grid strand one on its own row: pair them. */
.hub-tiles[data-count="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Prepare */
.hub-chips, .hub-filter { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.hub-chips { margin-bottom: 0.4rem; }
.hub-filter { margin-bottom: 1rem; }
.hub-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.2rem;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--hub-line-strong);
    border-radius: 999px;
    background: transparent;
    color: var(--hub-muted);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.hub-chip:hover { color: var(--hub-ink); border-color: var(--hub-ink); }
.hub-chip[aria-pressed="true"] { border-color: var(--hub-btn); background: var(--hub-btn); color: var(--hub-btn-ink); }
.hub-chip span { font-size: 0.78rem; font-weight: 700; opacity: 0.65; font-variant-numeric: tabular-nums; }

.hub-readlist { display: grid; gap: 0.6rem; }
.hub-read {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--hub-line);
    border-radius: 18px;
    background: var(--hub-surface);
    color: var(--hub-ink);
    transition: border-color 0.2s ease, transform 0.2s var(--ease);
}
.hub-read:hover { border-color: color-mix(in srgb, var(--hub-prepare) 60%, transparent); transform: translateX(2px); }
.hub-read-icon {
    width: 2.75rem;
    height: 2.75rem;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: color-mix(in srgb, var(--hub-prepare) 13%, transparent);
    color: var(--hub-prepare);
    font-size: 1.4rem;
}
.hub-read-main { flex: 1; min-width: 0; }
.hub-read-kind {
    color: var(--hub-soft);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.hub-read h3 { margin-top: 0.15rem; font-size: 1.02rem; line-height: 1.25; letter-spacing: -0.01em; }
.hub-read p { margin-top: 0.25rem; color: var(--hub-muted); font-size: 0.88rem; line-height: 1.45; }
.hub-read-go { flex: none; color: var(--hub-soft); font-size: 1.2rem; }
.hub-read:hover .hub-read-go { color: var(--hub-prepare); }

.hub-empty { padding: 1.6rem 1.2rem; color: var(--hub-muted); text-align: center; }

/* Run · coming soon */
.hub-soon-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; }
.hub-soon {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    border: 1.5px dashed var(--hub-line-strong);
    border-radius: 18px;
}
.hub-soon i { flex: none; color: var(--hub-soft); font-size: 1.4rem; }
.hub-soon h3 { font-size: 0.98rem; line-height: 1.25; }
.hub-soon p { margin-top: 0.2rem; color: var(--hub-muted); font-size: 0.84rem; line-height: 1.4; }

/* Review */
.hub-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; margin-bottom: 1.4rem; }
.hub-stat {
    padding: 1rem 1.1rem 1.05rem;
    border: 1px solid var(--hub-line);
    border-radius: 16px;
    background: var(--hub-surface);
}
.hub-stat-label { color: var(--hub-muted); font-size: 0.82rem; font-weight: 500; }
/* Proportional figures: tabular digits look loose at this size. */
.hub-stat-value { margin-top: 0.3rem; font-size: 1.9rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.025em; }
.hub-stat-sub { margin-top: 0.25rem; color: var(--hub-soft); font-size: 0.78rem; }

.hub-tablecard {
    border: 1px solid var(--hub-line);
    border-radius: var(--hub-radius);
    background: var(--hub-surface);
    overflow: hidden;
}
.hub-tablecard-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.25rem 0.9rem;
}
.hub-tablecard-head h2 { font-size: 1.15rem; line-height: 1.2; letter-spacing: -0.015em; }
.hub-tablecard-head p { margin-top: 0.2rem; color: var(--hub-muted); font-size: 0.85rem; }

.hub-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.1rem;
    padding: 0 1.25rem 0.9rem;
    color: var(--hub-muted);
    font-size: 0.82rem;
}
.hub-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.hub-legend .hub-key-tick { width: 2px; height: 12px; border-radius: 1px; background: var(--hub-ink); }
.hub-legend .hub-key-bar { width: 16px; height: 8px; border-radius: 0 3px 3px 0; background: var(--hub-accent); }

.hub-table-wrap { overflow-x: auto; }
.hub-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.hub-table th {
    padding: 0.65rem 1.25rem;
    border-block: 1px solid var(--hub-line);
    color: var(--hub-soft);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}
.hub-table td { padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--hub-line); vertical-align: middle; }
.hub-table tbody tr:last-child td { border-bottom: 0; }
.hub-table tbody tr { cursor: pointer; transition: background 0.15s ease; }
.hub-table tbody tr:hover { background: color-mix(in srgb, var(--hub-ink) 4%, transparent); }
.hub-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.hub-table td.num { font-weight: 700; }
.hub-rowbtn {
    display: grid;
    gap: 0.1rem;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.hub-rowbtn strong { font-weight: 600; }
.hub-rowbtn span { display: flex; align-items: center; gap: 0.35rem; color: var(--hub-muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.hub-rowbtn i { color: var(--hub-soft); font-size: 1rem; }
.hub-cell-date { color: var(--hub-muted); white-space: nowrap; }

/* ── Charts ──────────────────────────────────────────────────────────────── */
/* Share of each style in one group. Segments are separated by a 2px gap in the
   surface colour, never by a stroke. */
.hub-mix {
    display: flex;
    gap: 2px;
    width: 100%;
    min-width: 170px;
    height: 12px;
    border-radius: 4px;
    overflow: hidden;
}
.hub-mix i { display: block; min-width: 3px; height: 100%; background: var(--c); transition: filter 0.15s ease; }
.hub-mix i:hover { filter: brightness(1.12); }

/* One bar per style, grown from the left baseline. Counts are always visible,
   so nothing here depends on hover. */
.hub-dist { display: grid; gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
.hub-dist li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.3rem 0.8rem; align-items: baseline; }
.hub-dist-name { display: flex; align-items: center; gap: 0.5rem; min-width: 0; font-size: 0.9rem; font-weight: 600; }
.hub-dist-val { color: var(--hub-muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hub-dist-val b { color: var(--hub-ink); font-weight: 700; }
.hub-dist-bar { grid-column: 1 / -1; height: 10px; border-left: 1px solid var(--hub-line-strong); }
.hub-dist-bar i {
    display: block;
    width: 0;
    height: 100%;
    min-width: 2px;
    border-radius: 0 4px 4px 0;
    background: var(--c);
    transition: width 0.5s var(--ease);
}
.hub-dist--compact { gap: 0.45rem; }
.hub-dist--compact .hub-dist-name { font-size: 0.7rem; }
.hub-dist--compact .hub-dist-val { font-size: 0.7rem; }
.hub-dist--compact .hub-dist-bar { height: 6px; }
.hub-dist--compact .hub-swatch { width: 7px; height: 7px; border-radius: 2px; }

/* A mean on a bounded scale: the track is the scale, in a lighter step of the
   bar's own hue, and the tick is the research sample's average. */
.hub-bars { display: grid; gap: 0.95rem; margin: 0; padding: 0; list-style: none; }
.hub-bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.35rem 1rem; align-items: end; }
.hub-bars-label { font-size: 0.9rem; line-height: 1.4; }
.hub-bars-val { font-size: 0.95rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.hub-bars-track {
    position: relative;
    grid-column: 1 / -1;
    height: 8px;
    border-radius: 0 4px 4px 0;
    background: color-mix(in srgb, var(--hub-accent) 15%, var(--hub-surface));
}
.hub-bars-track i {
    display: block;
    height: 100%;
    border-radius: 0 4px 4px 0;
    background: var(--hub-accent);
}
.hub-bars-track b {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 2px;
    margin-left: -1px;
    border-radius: 1px;
    background: var(--hub-ink);
    box-shadow: 0 0 0 2px var(--hub-surface);
}
.hub-bars-group {
    margin: 1.4rem 0 0.8rem;
    color: var(--hub-soft);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.hub-bars-group:first-child { margin-top: 0; }

/* The four-region matrix. Fills are the instrument's own colours in both
   themes; the labels wear a soft dark halo because white alone is too faint on
   the two lighter regions. They are drawn over the markers. */
.hub-matrix { display: block; width: 100%; height: auto; color: var(--hub-ink); }
.hub-matrix .mx-cell { stroke: var(--hub-surface); stroke-width: 3; stroke-linejoin: round; }
.hub-matrix .mx-labels { pointer-events: none; }
.hub-matrix .mx-label {
    fill: #ffffff;
    font-size: 21px;
    font-weight: 700;
    paint-order: stroke;
    stroke: rgba(16, 24, 32, 0.42);
    stroke-width: 3.5px;
    stroke-linejoin: round;
}
.hub-matrix .mx-axis line { stroke: currentColor; stroke-width: 2; opacity: 0.5; }
.hub-matrix .mx-axis-title { fill: currentColor; font-size: 19px; font-weight: 700; }
.hub-matrix .mx-axis-end { fill: currentColor; font-size: 15px; opacity: 0.65; }
/* Markers: one soft star per participant, on a shade of itself. Sizes come
   from hub.js, which knows how big this matrix draws its marks. */
.hub-matrix .mx-star, .hub-matrix .mx-star-shade { stroke-linejoin: round; }
.hub-matrix .mx-star { fill: #ffffff; stroke: #ffffff; }
.hub-matrix .mx-star-shade { fill: #101820; stroke: #101820; opacity: 0.3; }
.hub-matrix .mx-mark.is-behind { opacity: 0.42; }
.hub-matrix .mx-mark.is-new {
    transform-box: fill-box;
    transform-origin: center;
    animation: hubDot 0.55s var(--ease) both;
}
@keyframes hubDot {
    0% { transform: scale(0); opacity: 0; }
    55% { transform: scale(1.6); opacity: 1; }
    100% { transform: scale(1); }
}

.hub-tip {
    position: fixed;
    z-index: 9000;
    max-width: 240px;
    padding: 0.45rem 0.65rem;
    border-radius: 10px;
    background: #18211f;
    color: #fffdf8;
    font-size: 0.8rem;
    line-height: 1.35;
    pointer-events: none;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}
.dark .hub-tip { background: #F9FAFB; color: #111827; }
.hub-tip strong { display: block; font-size: 0.9rem; font-weight: 700; }
.hub-tip span { opacity: 0.78; }

/* ── Side sheet ──────────────────────────────────────────────────────────── */
.hub-sheet {
    inset: 0 0 0 auto;
    width: min(600px, 100vw);
    max-width: 100vw;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: var(--hub-surface);
    color: var(--hub-ink);
    box-shadow: -30px 0 80px -30px rgba(0, 0, 0, 0.4);
}
.hub-sheet.is-wide { width: min(1080px, 100vw); }
.hub-sheet::backdrop { background: rgba(15, 22, 28, 0.5); }
.hub-sheet[open] { animation: hubSheetIn 0.3s var(--ease); }
@keyframes hubSheetIn { from { transform: translateX(36px); opacity: 0; } }
.hub-sheet-inner { display: flex; flex-direction: column; height: 100%; }
.hub-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.5rem;
    border-bottom: 1px solid var(--hub-line);
}
.hub-sheet-kicker {
    color: var(--hub-soft);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.hub-sheet-body { flex: 1; overflow-y: auto; padding: 1.6rem 1.5rem 2.2rem; overscroll-behavior: contain; }
.hub-sheet-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 1.5rem;
    border-top: 1px solid var(--hub-line);
}
.hub-sheet-foot:empty { display: none; }
.hub-sheet-note { flex: 1 1 100%; color: var(--hub-muted); font-size: 0.85rem; }

/* Sheet content */
.hub-doc-title { display: flex; align-items: center; gap: 0.85rem; }
.hub-doc-title .hub-act-icon { width: 3.1rem; height: 3.1rem; border-radius: 15px; font-size: 1.6rem; }
.hub-doc h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); line-height: 1.1; letter-spacing: -0.025em; }
.hub-doc-lede { margin-top: 1rem; color: var(--hub-muted); font-size: 1.02rem; line-height: 1.6; }
.hub-doc .hub-facts { margin-top: 1rem; }
.hub-doc h3 {
    margin: 2rem 0 0.9rem;
    padding-top: 1.4rem;
    border-top: 1px solid var(--hub-line);
    color: var(--hub-soft);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    line-height: 1.2;
    text-transform: uppercase;
}
.hub-doc p { line-height: 1.6; }
.hub-doc-meta { color: var(--hub-muted); font-size: 0.9rem; }

/* A session's name, and the pencil that edits it in place. */
.hub-doc-name { flex: 1; min-width: 0; }
.hub-doc-nameline { display: flex; align-items: center; gap: 0.35rem; min-width: 0; }
.hub-doc-nameline h2 { min-width: 0; overflow-wrap: anywhere; }
.hub-rename-btn { flex: none; width: 2rem; height: 2rem; color: var(--hub-soft); font-size: 1.05rem; }
.hub-rename-btn:hover { color: var(--hub-ink); }
.hub-rename { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; width: 100%; }
.hub-rename input {
    flex: 1 1 12rem;
    min-width: 0;
    padding: 0.5rem 0.75rem;
    border: 1.5px solid var(--hub-line-strong);
    border-radius: 10px;
    background: var(--hub-surface-2);
    color: var(--hub-ink);
    font: inherit;
    font-size: 1.05rem;
    font-weight: 600;
}
.hub-rename input:focus {
    outline: none;
    border-color: var(--hub-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--hub-accent) 20%, transparent);
}

.hub-styles { display: grid; gap: 0.6rem; }
.hub-styles li { display: flex; gap: 0.7rem; align-items: flex-start; }
.hub-styles .hub-swatch { width: 12px; height: 12px; margin-top: 0.38rem; }
.hub-styles strong { display: block; font-size: 0.95rem; font-weight: 700; }
.hub-styles span { display: block; color: var(--hub-muted); font-size: 0.9rem; line-height: 1.5; }

/* Run of show: a timeline whose rail is the session's clock. */
.hub-steps { display: grid; margin: 0; padding: 0; list-style: none; }
.hub-steps li { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr); gap: 0 1rem; }
.hub-steps-time {
    padding-top: 0.05rem;
    color: var(--hub-soft);
    font-size: 0.8rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}
.hub-steps-body { position: relative; padding: 0 0 1.3rem 1.2rem; border-left: 2px solid var(--hub-line); }
.hub-steps li:last-child .hub-steps-body { padding-bottom: 0.2rem; border-left-color: transparent; }
.hub-steps-body::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 0.3rem;
    width: 12px;
    height: 12px;
    border: 2px solid var(--hub-surface);
    border-radius: 50%;
    background: var(--step, var(--hub-accent));
}
.hub-steps-body strong { display: block; font-size: 0.98rem; font-weight: 700; line-height: 1.3; }
.hub-steps-body p { margin-top: 0.2rem; color: var(--hub-muted); font-size: 0.93rem; line-height: 1.5; }
.hub-steps-ref {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.45rem;
    padding: 0;
    border: 0;
    background: none;
    color: var(--hub-accent);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}
.hub-steps-ref:hover { text-decoration: underline; text-underline-offset: 3px; }

.hub-prompts { display: grid; gap: 0.6rem; margin: 0; padding: 0; list-style: none; counter-reset: prompt; }
.hub-prompts li {
    position: relative;
    padding: 0.9rem 1rem 0.9rem 3rem;
    border-radius: var(--hub-radius-sm);
    background: var(--hub-surface-2);
    font-size: 0.97rem;
    line-height: 1.5;
    counter-increment: prompt;
}
.hub-prompts li::before {
    content: counter(prompt);
    position: absolute;
    left: 0.95rem;
    top: 0.9rem;
    width: 1.5rem;
    height: 1.5rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--hub-btn);
    color: var(--hub-btn-ink);
    font-size: 0.78rem;
    font-weight: 700;
}
.hub-prompts em {
    display: block;
    margin-bottom: 0.15rem;
    color: var(--hub-soft);
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}
/* The closing question is asked once, so it carries no number. */
.hub-prompts--close li { padding-left: 1rem; font-weight: 600; }
.hub-prompts--close li::before { content: none; }

/* A note is either signed off or not, and says which wherever it is listed. */
.hub-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.14rem 0.5rem;
    border: 1px solid;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.3;
    text-transform: none;
    white-space: nowrap;
}
.hub-status i { font-size: 0.85rem; }
.hub-status--final { border-color: color-mix(in srgb, var(--hub-prepare) 45%, transparent); color: var(--hub-prepare); }
.hub-status--soon { border-style: dashed; border-color: var(--hub-line-strong); color: var(--hub-muted); }

/* The teaching note as a document: its reference, its status and the PDF. */
.hub-note {
    display: flex;
    gap: 0.95rem;
    margin-top: 1.4rem;
    padding: 1.05rem 1.15rem 1.15rem;
    border: 1px solid var(--hub-line);
    border-radius: var(--hub-radius-sm);
    background: var(--hub-surface-2);
}
.hub-note--soon { border-style: dashed; background: transparent; }
.hub-note--soon .hub-note-icon, .hub-note--soon .hub-note-sub { color: var(--hub-muted); }
.hub-doc .hub-note--soon .hub-note-sub { font-weight: 500; }
.hub-note-icon { flex: none; color: var(--hub-run); font-size: 2rem; line-height: 1; }
.hub-note-main { flex: 1; min-width: 0; }
.hub-note-id {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem 0.55rem;
    color: var(--hub-soft);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    line-height: 1.3;
    text-transform: uppercase;
}
.hub-note-id .hub-status { letter-spacing: 0.04em; }
.hub-doc .hub-note-sub { margin-top: 0.35rem; font-size: 1rem; font-weight: 600; line-height: 1.4; }
.hub-note-meta { margin-top: 0.2rem; color: var(--hub-muted); font-size: 0.86rem; }
.hub-note-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.85rem; }
.hub-note-terms { margin-top: 0.6rem; color: var(--hub-muted); font-size: 0.8rem; }
.hub-doc .hub-note-terms { line-height: 1.45; }
.hub-note-lock {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
    margin-top: 0.8rem;
    color: var(--hub-muted);
    font-size: 0.88rem;
}
.hub-doc .hub-note-lock { line-height: 1.5; }
.hub-note-lock i { flex: none; margin-top: 0.12rem; color: var(--hub-soft); font-size: 1.05rem; }
.hub-prompts + .hub-note-lock {
    padding: 0.8rem 1rem;
    border: 1px dashed var(--hub-line-strong);
    border-radius: var(--hub-radius-sm);
}

/* Two plans per note: pick one, read its clock. */
.hub-plan-pick { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.1rem; }
.hub-plan-pick .hub-chip { text-align: left; }
.hub-steps-body p:only-of-type { font-variant-numeric: tabular-nums; }

.hub-pairs { display: grid; gap: 0.45rem; }
.hub-pair {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--hub-line);
    border-radius: var(--hub-radius-sm);
    background: none;
    color: var(--hub-ink);
    font-size: 0.93rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease;
}
.hub-pair:hover { border-color: var(--hub-accent); }
.hub-pair i:first-child { flex: none; color: var(--hub-prepare); font-size: 1.2rem; }
.hub-pair span { flex: 1; min-width: 0; }
.hub-pair small { display: block; color: var(--hub-muted); font-size: 0.8rem; font-weight: 500; }
.hub-pair i:last-child { flex: none; color: var(--hub-soft); }

.hub-lessons { display: grid; margin: 0; padding: 0; list-style: none; }
.hub-lessons li { display: flex; gap: 0.75rem; padding: 0.7rem 0; border-bottom: 1px solid var(--hub-line); }
.hub-lessons li:last-child { border-bottom: 0; }
.hub-lessons i { flex: none; margin-top: 0.1rem; color: var(--hub-prepare); font-size: 1.2rem; }
.hub-lessons strong { display: block; font-size: 0.95rem; font-weight: 600; line-height: 1.3; }
.hub-lessons span { display: block; margin-top: 0.1rem; color: var(--hub-muted); font-size: 0.86rem; line-height: 1.45; }
.hub-lessons em {
    margin-left: 0.4rem;
    color: var(--hub-soft);
    font-size: 0.66rem;
    font-style: normal;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}
.hub-unit {
    margin: 1.3rem 0 0.2rem;
    color: var(--hub-soft);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.hub-unit:first-of-type { margin-top: 0; }

/* Session results: the picture on the left, the numbers on the right. */
.hub-results { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr); gap: 2rem; align-items: start; margin-top: 1.5rem; }
.hub-results-fig { margin: 0; }
.hub-results-fig figcaption { margin-top: 0.6rem; color: var(--hub-muted); font-size: 0.82rem; line-height: 1.45; }
.hub-results h3:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.hub-conflict-radar svg { display: block; width: 100%; height: auto; }
.hub-conflict-table { margin-top: 0.5rem; }

/* ── Dialogs ─────────────────────────────────────────────────────────────── */
.hub-modal {
    width: min(540px, calc(100vw - 2rem));
    max-height: calc(100dvh - 2rem);
    padding: clamp(1.4rem, 3vw, 2rem);
    border: 0;
    border-radius: 26px;
    background: var(--hub-surface);
    color: var(--hub-ink);
    box-shadow: var(--hub-shadow-lg);
    overflow: auto;
}
.hub-modal::backdrop { background: rgba(15, 22, 28, 0.55); backdrop-filter: blur(3px); }
.hub-modal[open] { animation: hubModalIn 0.26s var(--ease); }
@keyframes hubModalIn { from { transform: translateY(14px) scale(0.985); opacity: 0; } }
.hub-modal h2 { padding-right: 2.6rem; font-size: 1.45rem; line-height: 1.15; letter-spacing: -0.02em; }
.hub-modal-sub { margin-top: 0.5rem; color: var(--hub-muted); font-size: 0.93rem; line-height: 1.55; }
.hub-modal-close { position: absolute; top: 1rem; right: 1rem; }
.hub-modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.6rem; margin-top: 1.5rem; }

.hub-modal--split { width: min(900px, calc(100vw - 2rem)); padding: 0; }
.hub-modal--split[open] { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.hub-request-aside {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.1rem;
    padding: clamp(1.6rem, 3vw, 2.6rem);
    background:
        radial-gradient(120% 120% at 0% 0%, rgba(255, 255, 255, 0.1), transparent 55%),
        linear-gradient(155deg, #2c597e 0%, #234d6f 45%, #1b3a55 100%);
    color: #f4f1ea;
}
.hub .hub-request-aside h3 { color: #f4f1ea; font-size: 1.45rem; line-height: 1.2; letter-spacing: -0.02em; }
.hub-request-aside > p { color: rgba(244, 241, 234, 0.82); font-size: 0.93rem; line-height: 1.6; }
.hub-request-aside ul { display: grid; gap: 0.8rem; }
.hub-request-aside li { display: flex; gap: 0.6rem; font-size: 0.9rem; line-height: 1.45; }
.hub-request-aside li i { flex: none; margin-top: 0.15rem; color: #9ec8e8; }
.hub-request-main { position: relative; padding: clamp(1.6rem, 3vw, 2.3rem); }
.hub-request-main form > .hub-modal-sub { margin-bottom: 1.3rem; }

.hub-field { margin-top: 1rem; }
.hub-field label, .hub-pick legend {
    display: block;
    margin-bottom: 0.35rem;
    padding: 0;
    font-size: 0.82rem;
    font-weight: 600;
}
.hub-field label span { color: var(--hub-soft); font-weight: 400; }
.hub-field input, .hub-field select, .hub-field textarea {
    display: block;
    width: 100%;
    padding: 0.68rem 0.85rem;
    border: 1.5px solid var(--hub-line-strong);
    border-radius: 10px;
    background: var(--hub-surface-2);
    color: var(--hub-ink);
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.hub-field textarea { resize: vertical; min-height: 4.6rem; }
.hub-field input:focus, .hub-field select:focus, .hub-field textarea:focus {
    outline: none;
    border-color: var(--hub-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--hub-accent) 20%, transparent);
}
.hub-field input::placeholder, .hub-field textarea::placeholder { color: var(--hub-soft); }
/* The account's own email: shown, not asked for. */
.hub-field input[readonly] { border-style: dashed; background: transparent; color: var(--hub-muted); }
.hub-field input[readonly]:focus { border-color: var(--hub-line-strong); box-shadow: none; }
.hub-hint { margin-top: 0.45rem; color: var(--hub-muted); font-size: 0.82rem; line-height: 1.45; }
.hub-form-error { margin-top: 0.9rem; color: #9d5145; font-size: 0.88rem; font-weight: 600; }
.dark .hub-form-error { color: #f0a99d; }
.hub-request-main .hub-block { margin-top: 1.3rem; }

.hub-done-icon {
    width: 3.4rem;
    height: 3.4rem;
    display: grid;
    place-items: center;
    margin-bottom: 1.1rem;
    border-radius: 50%;
    background: color-mix(in srgb, #4f6f5d 16%, transparent);
    color: #4f6f5d;
    font-size: 1.6rem;
}
.dark .hub-done-icon { color: #8cc0a3; }

    margin-top: 0.8rem;
    padding: 0.6rem 0.8rem;
    border: 1.5px dashed #b88746;
    border-radius: 12px;
    background: #fff8ea;
    color: #6b4a14;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

/* Start a session */
.hub-pick { margin: 1.2rem 0 0; padding: 0; border: 0; min-width: 0; }
.hub-pick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.hub-pick-opt { position: relative; display: block; cursor: pointer; }
.hub-pick-opt input { position: absolute; opacity: 0; pointer-events: none; }
.hub-pick-opt span {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    height: 100%;
    padding: 0.65rem 0.75rem;
    border: 1.5px solid var(--hub-line-strong);
    border-radius: 12px;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.25;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.hub-pick-opt i { flex: none; color: var(--hub-soft); font-size: 1.2rem; }
.hub-pick-opt input:checked + span {
    border-color: var(--hub-accent);
    background: color-mix(in srgb, var(--hub-accent) 9%, transparent);
}
.hub-pick-opt input:checked + span i { color: var(--hub-accent); }
.hub-pick-opt input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--hub-accent) 50%, transparent); outline-offset: 2px; }
.hub-code-row { display: flex; gap: 0.5rem; }
.hub-code-row input { width: 7.5rem; font-weight: 700; letter-spacing: 0.18em; text-align: center; font-variant-numeric: tabular-nums; }

/* ── Room view ───────────────────────────────────────────────────────────── */
.hub-room {
    /* Light tokens, pinned: this is what goes on the projector. */
    --hub-surface: #ffffff;
    --hub-surface-2: #f6f3ec;
    --hub-ink: #18211f;
    --hub-muted: #56605b;
    --hub-soft: #66706a;
    --hub-line: rgba(24, 33, 31, 0.12);
    --hub-line-strong: rgba(24, 33, 31, 0.22);
    --hub-accent: #234d6f;
    --hub-btn: #18211f;
    --hub-btn-ink: #fffdf8;
    --hub-track: #ece8df;
    --hub-s1: #4A90E2;
    --hub-s2: #50BFA5;
    --hub-s3: #6A4C93;
    --hub-s4: #FF6B6B;

    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    background: #fbfaf6;
    color: var(--hub-ink);
    color-scheme: light;
}
.hub .hub-room h2 { color: var(--hub-ink); }

.room-bar {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem clamp(1rem, 2vw, 1.75rem);
    border-bottom: 1px solid var(--hub-line);
    background: #ffffff;
}
.room-id { display: flex; align-items: center; gap: 0.8rem; min-width: 0; }
.room-icon {
    width: 2.75rem;
    height: 2.75rem;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: color-mix(in srgb, #234d6f 12%, transparent);
    color: #234d6f;
    font-size: 1.45rem;
}
.room-bar h2 { font-size: 1.12rem; line-height: 1.2; letter-spacing: -0.015em; }
.room-bar p { overflow: hidden; color: var(--hub-muted); font-size: 0.85rem; white-space: nowrap; text-overflow: ellipsis; }
.room-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.45rem; }
/* Demo scaffolding, in the same dashed amber as the bar above the page. */
.room-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.3rem 0.25rem 0.7rem;
    border: 1.5px dashed #b88746;
    border-radius: 999px;
    background: #fff8ea;
    color: #6b4a14;
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
}
.room-tag button {
    padding: 0.32rem 0.6rem;
    border: 0;
    border-radius: 999px;
    background: rgba(184, 135, 70, 0.2);
    color: inherit;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
}
.room-tag button:hover { background: rgba(184, 135, 70, 0.34); }
.room-tag button[aria-pressed="true"] { background: #6b4a14; color: #fff8ea; }
.room-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.4rem;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--hub-line-strong);
    border-radius: 999px;
    background: #ffffff;
    color: var(--hub-ink);
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.room-btn:hover:not(:disabled) { border-color: var(--hub-ink); }
.room-btn:disabled { opacity: 0.4; cursor: default; }
.room-btn i { font-size: 1.05rem; }
.room-btn[aria-pressed="true"], .room-btn--solid, .room-btn--end {
    border-color: #18211f;
    background: #18211f;
    color: #fffdf8;
}
.room-btn--icon { width: 2.4rem; padding: 0; justify-content: center; }

.room-body {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: clamp(290px, 27vw, 430px) minmax(0, 1fr);
}
.room-side {
    display: flex;
    flex-direction: column;
    gap: clamp(1rem, 2.6vh, 1.75rem);
    padding: clamp(1rem, 2.6vh, 1.75rem) clamp(1rem, 1.8vw, 1.75rem);
    border-right: 1px solid var(--hub-line);
    background: #ffffff;
    overflow-y: auto;
}
.room-join { display: flex; align-items: center; gap: 1rem; }
.room-qr-btn {
    position: relative;
    flex: none;
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: none;
    cursor: zoom-in;
    transition: transform 0.2s var(--ease);
}
.room-qr-btn:hover { transform: scale(1.03); }
.room-qr {
    display: block;
    width: clamp(116px, 19vh, 190px);
    aspect-ratio: 1;
    padding: 8px;
    border: 1px solid var(--hub-line);
    border-radius: 16px;
    background: #ffffff;
}
.room-qr img, .room-qr canvas { display: block; width: 100% !important; height: 100% !important; }
/* The corner badge is the affordance: it says the code opens bigger. */
.room-qr-hint {
    position: absolute;
    right: -7px;
    bottom: -7px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #18211f;
    color: #fffdf8;
    font-size: 0.95rem;
    box-shadow: 0 0 0 3px #ffffff;
}
.room-join-title { font-size: clamp(1.15rem, 2.6vh, 1.7rem); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
.room-join-sub { margin-top: 0.25rem; color: var(--hub-muted); font-size: clamp(0.85rem, 1.7vh, 1.05rem); }

.room-debrief { padding: 1.15rem 1.25rem 1.2rem; border-radius: 18px; background: #18211f; color: #fffdf8; }
.room-debrief-step { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.7; }
.room-debrief-text {
    margin: 0.55rem 0 1.1rem;
    font-size: clamp(1.15rem, 2.7vh, 1.7rem);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
}
.room-debrief-nav { display: flex; gap: 0.5rem; }
.room-debrief .room-btn { border-color: rgba(255, 253, 248, 0.3); background: transparent; color: #fffdf8; }
.room-debrief .room-btn--solid { border-color: #fffdf8; background: #fffdf8; color: #18211f; }

.room-count { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.6rem; }
/* The one hero figure of the view. */
.room-count-value { font-size: clamp(3rem, 9vh, 5.5rem); font-weight: 700; line-height: 0.95; letter-spacing: -0.04em; }
.room-count-label { color: var(--hub-muted); font-size: clamp(1rem, 2vh, 1.3rem); font-weight: 500; }
/* The room has lost the backend. It says so, quietly, and keeps trying. */
.room-status {
    flex-basis: 100%;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #9d5145;
    font-size: 0.9rem;
    font-weight: 600;
}
.room-status[hidden] { display: none; }

.room-panel h3 {
    margin-bottom: 0.85rem;
    color: var(--hub-soft);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    line-height: 1.2;
    text-transform: uppercase;
}
.room-panel h3 + h3, .room-panel * + h3 { margin-top: 1.4rem; }
.room-panel .hub-dist-name { font-size: clamp(0.9rem, 1.8vh, 1.1rem); }
.room-panel .hub-dist-val { font-size: clamp(0.85rem, 1.7vh, 1.05rem); }
.room-panel .hub-dist-bar { height: clamp(10px, 1.6vh, 16px); }
.room-panel-muted { color: var(--hub-muted); font-size: 0.92rem; line-height: 1.5; }

/* Conflict carries more in the side panel (three situations and five bars),
   so the join card and the count give some height back to keep it on screen. */
.hub-room[data-kind="rounds"] .room-side { gap: clamp(0.75rem, 1.9vh, 1.3rem); }
.hub-room[data-kind="rounds"] .room-qr { width: clamp(96px, 13vh, 150px); }
.hub-room[data-kind="rounds"] .room-count-value { font-size: clamp(2.4rem, 6.5vh, 4.2rem); }
.hub-room[data-kind="rounds"] .hub-dist { gap: 0.55rem; }

/* Conflict: one row per situation, released in turn. */
.room-rounds { display: grid; }
.room-round {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0;
    border-top: 1px solid var(--hub-line);
    opacity: 0.45;
}
.room-round.is-open, .room-round.is-next { opacity: 1; }
.room-round-name { flex: 1; padding-left: 0.6rem; border-left: 4px solid var(--ctx); font-size: 0.98rem; font-weight: 700; }
.room-round-n { color: var(--hub-muted); font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.room-round-state { min-width: 5.2rem; color: var(--hub-soft); font-size: 0.8rem; text-align: right; }

.room-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    padding: clamp(0.75rem, 2vh, 1.5rem);
}
.room-visual { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; min-height: 0; }
.room-visual > svg.hub-matrix { width: 100%; height: 100%; }
.room-stage.is-concealed .mx-dots { display: none; }
.room-stage.is-concealed .room-conflict { visibility: hidden; }
.room-hidden-note {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.9rem 1.3rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 18px 40px rgba(10, 20, 30, 0.22);
    font-size: clamp(1rem, 2.2vh, 1.3rem);
    font-weight: 600;
    transform: translate(-50%, -50%);
    white-space: nowrap;
}
.room-hidden-note i { font-size: 1.4em; color: var(--hub-soft); }

.room-conflict {
    width: min(100%, 980px);
    max-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5vh;
    overflow: auto;
}
.room-conflict-radar { flex: none; height: clamp(220px, 44vh, 520px); }
.room-conflict-radar svg { width: 100%; height: 100%; }
/* Read from the back of the room. */
.room-conflict .conflict-table { font-size: clamp(13px, 1.7vh, 22px); }
.room-conflict .conflict-table td.score { font-size: clamp(16px, 2.1vh, 28px); }
.room-conflict-note { color: var(--hub-muted); font-size: clamp(12px, 1.5vh, 18px); text-align: center; }

/* ── Justice & Fairness deck ─────────────────────────────────────────────── */
.hub-deck {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0b1116;
    color: #eef3f7;
}
.deck-stage { width: 100%; height: 100%; }
.deck-video { width: 100%; height: 100%; object-fit: contain; background: #000000; }
.deck-pane {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.2vh;
    padding: 16vh 8vw 6vh;
    text-align: center;
}
.deck-eyebrow { color: #50BFA5; font-size: clamp(12px, 1.5vh, 18px); font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.hub .deck-pane h2 { color: #eef3f7; font-size: clamp(28px, 6vh, 68px); line-height: 1.1; letter-spacing: -0.02em; }
.deck-pane p { max-width: 26em; color: #b6c3ce; font-size: clamp(15px, 2.4vh, 28px); line-height: 1.5; }
.deck-pane .deck-note { color: #7f8f9c; font-size: clamp(13px, 1.9vh, 20px); }
.deck-pane ul { display: flex; flex-direction: column; gap: 1.4vh; max-width: 24em; text-align: left; }
.deck-pane li { position: relative; padding-left: 1.2em; color: #dbe5ec; font-size: clamp(15px, 2.5vh, 30px); line-height: 1.4; }
.deck-pane li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 0.45em;
    height: 0.45em;
    border-radius: 50%;
    background: #50BFA5;
}
.deck-qr-btn { padding: 0; border: 0; border-radius: 18px; background: none; cursor: zoom-in; }
.deck-qr {
    display: block;
    width: min(46vh, 440px);
    height: min(46vh, 440px);
    padding: 14px;
    border-radius: 18px;
    background: #ffffff;
}
.deck-qr img, .deck-qr canvas { display: block; width: 100% !important; height: 100% !important; }
/* Pinned to the top: the video's own scrubber lives along its bottom edge. */
.deck-bar {
    position: absolute;
    left: 50%;
    top: 2.5vh;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 92vw;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(12, 20, 27, 0.82);
    backdrop-filter: blur(10px);
    transform: translateX(-50%);
}
.deck-bar button {
    padding: 10px 18px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #eef3f7;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}
.deck-bar button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.2); }
.deck-bar button:disabled { opacity: 0.35; cursor: default; }
.deck-bar .deck-next { background: #50BFA5; color: #06231d; }
.deck-bar .deck-next:hover:not(:disabled) { background: #45a892; }
.deck-bar .deck-exit {
    width: 34px;
    height: 34px;
    padding: 0;
    background: transparent;
    color: rgba(238, 243, 247, 0.55);
    font-size: 17px;
    line-height: 1;
}
.deck-steps { display: flex; gap: 8px; padding: 0 6px; }
.deck-steps span { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.25); transition: background 0.2s ease, width 0.2s ease; }
.deck-steps span.is-active { width: 26px; border-radius: 999px; background: #50BFA5; }

/* ── The QR, full screen ─────────────────────────────────────────────────────
   Sits inside the room or the deck (hub.js moves it), so it still shows when
   the browser itself is in full-screen mode. White whatever the theme: a QR
   needs the contrast. Clicking anywhere puts it away. */
.hub-zoom {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.6vh;
    padding: 4vh 4vw;
    background: #ffffff;
    color: #18211f;
    text-align: center;
    cursor: zoom-out;
}
.hub-zoom-qr { width: min(72vh, 88vw); aspect-ratio: 1; }
.hub-zoom-qr img, .hub-zoom-qr canvas { display: block; width: 100% !important; height: 100% !important; }
.hub-zoom-title { font-size: clamp(1.6rem, 5vh, 3.2rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.hub-zoom-sub { max-width: 40em; color: #56605b; font-size: clamp(1rem, 2.4vh, 1.5rem); line-height: 1.35; }
.hub-zoom-close {
    position: absolute;
    top: 2vh;
    right: 2vw;
    width: 3rem;
    height: 3rem;
    display: grid;
    place-items: center;
    border: 1px solid rgba(24, 33, 31, 0.22);
    border-radius: 50%;
    background: #ffffff;
    color: #18211f;
    font-size: 1.3rem;
    cursor: pointer;
}

/* ── Toast ───────────────────────────────────────────────────────────────── */
.hub-toast {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    z-index: 8000;
    max-width: calc(100vw - 2rem);
    padding: 0.75rem 1.15rem;
    border-radius: 999px;
    background: #18211f;
    color: #fffdf8;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translate(-50%, 12px);
    transition: opacity 0.25s ease, transform 0.25s var(--ease);
    pointer-events: none;
}
.hub-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.dark .hub-toast { background: #F9FAFB; color: #111827; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1080px) {
    .hub-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hub-results { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
    .hub-hero-grid, .hub-audience, .hub-faq-grid { grid-template-columns: 1fr; }
    .hub-hero h1 { max-width: 16ch; }
    .hub-jobs { grid-template-columns: 1fr; }
    .hub-how { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hub-cta { grid-template-columns: 1fr; }
    .hub-news { grid-template-columns: 1fr; }
}

/* The dashboard collapses its rail here; the hub keeps the greeting and the
   primary action, and drops the secondary blocks. */
@media (max-width: 900px) {
    .hub .hub-rail .dashboard-header { display: block; text-align: center; }
    .hub .hub-rail .dashboard-header h1 { font-size: 1.5rem; }
    .hub-rail .hub-railstats, .hub-rail .hub-rail-link { display: none; }
    .hub-rail .hub-start { max-width: 26rem; }
    .hub-activity-grid { grid-template-columns: 1fr; }

    .room-body { grid-template-columns: 1fr; grid-template-rows: auto auto; overflow-y: auto; }
    .room-stage { order: -1; height: min(100vw, 62vh); }
    .room-side { border-right: 0; border-top: 1px solid var(--hub-line); overflow: visible; }
    .room-btn span { display: none; }
    .room-btn { padding-inline: 0.7rem; }
    /* The title gets its own row; the controls sit under it instead of on it. */
    .room-bar { flex-wrap: wrap; gap: 0.6rem; }
    .room-id { flex: 1 1 100%; }
    .room-actions { flex: 1 1 100%; justify-content: flex-start; }
    .room-btn--end { margin-left: auto; }
}

@media (max-width: 700px) {
    a.hub-header-link { display: none; }
    .hub-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hub-soon-grid { grid-template-columns: 1fr; }
    .hub-how { grid-template-columns: 1fr; }
    .hub-act-thumb { width: 72px; height: 72px; }
    .hub-frame-body { grid-template-columns: 1fr; }
    .hub-frame-side { display: none; }
    .hub-modal--split[open] { grid-template-columns: 1fr; }
    /* The form is the job on a phone; the pitch would push it off-screen. */
    .hub-request-aside { display: none; }
    .hub-sheet-body { padding-inline: 1.1rem; }
    .hub-sheet-head, .hub-sheet-foot { padding-inline: 1.1rem; }
    .hub-tiles[data-count="4"] { grid-template-columns: 1fr; }
    .hub-note { flex-direction: column; gap: 0.5rem; }
    .hub-tablecard-head { flex-wrap: wrap; }

    /* The table becomes a stack of cards: five columns don't fit a phone. */
    .hub-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
    .hub-table, .hub-table tbody { display: block; }
    .hub-table tr { display: grid; grid-template-columns: 1fr auto; gap: 0.4rem 1rem; padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--hub-line); }
    .hub-table tbody tr:last-child { border-bottom: 0; }
    .hub-table td { padding: 0; border: 0; }
    .hub-table td:nth-child(1), .hub-table td:nth-child(4) { grid-column: 1 / -1; }
    .hub-table td.num { justify-self: end; }
    .hub-table td.num::after { content: " responses"; color: var(--hub-muted); font-weight: 500; }

    .hub-row { grid-template-columns: auto minmax(0, 1fr) auto; }
    .hub-row .hub-result { grid-column: 2 / -1; }
}

@media (max-width: 460px) {
    .hub-product { display: none; }
    .hub-quick { grid-template-columns: 1fr; }
    .hub-pick-grid { grid-template-columns: 1fr; }
    .hub-steps li { grid-template-columns: 3.6rem minmax(0, 1fr); gap: 0 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
    .hub-live i, .hub-matrix .mx-mark.is-new, .hub-sheet[open], .hub-modal[open] { animation: none; }
    .hub-dist-bar i, .hub-start, .hub-quicktile, .hub-read, .hub-toast { transition: none; }
}
