/* OmniAlera Olùkọ́ — adire indigo + kola amber */
:root {
  --bg: #f3f5fa;
  --surface: #ffffff;
  --surface-2: #e9edf7;
  --line: #d5dbeb;
  --ink: #121a38;
  --ink-2: #4a5475;
  --ink-3: #6f7896;
  --indigo: #3552b8;
  --indigo-deep: #1e2f6b;
  --indigo-soft: #dfe5f8;
  --amber: #e0962f;
  --amber-ink: #8a5208;
  --amber-soft: #fbecd4;
  --good: #1f8a5b;
  --good-soft: #dcf3e8;
  --bad: #c0472f;
  --bad-soft: #f9e0da;
  --stage: #ffffff;
  --term-bg: #0f1633;
  --term-ink: #d7e0ff;
  --shadow: 0 1px 2px rgba(18, 26, 56, .06), 0 8px 24px rgba(18, 26, 56, .06);
  --radius: 14px;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d1330; --surface: #151d44; --surface-2: #1c2656; --line: #2a3670;
    --ink: #e8ecf8; --ink-2: #b3bcdc; --ink-3: #8a94bb;
    --indigo: #8ea6ff; --indigo-deep: #c8d4ff; --indigo-soft: #24306a;
    --amber: #f2b551; --amber-ink: #f6c877; --amber-soft: #3a2e1a;
    --good: #5ccf97; --good-soft: #163a2e; --bad: #ff8a73; --bad-soft: #3e1f1d;
    --stage: #111a3f; --term-bg: #070b1f; --term-ink: #d7e0ff;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1330; --surface: #151d44; --surface-2: #1c2656; --line: #2a3670;
  --ink: #e8ecf8; --ink-2: #b3bcdc; --ink-3: #8a94bb;
  --indigo: #8ea6ff; --indigo-deep: #c8d4ff; --indigo-soft: #24306a;
  --amber: #f2b551; --amber-ink: #f6c877; --amber-soft: #3a2e1a;
  --good: #5ccf97; --good-soft: #163a2e; --bad: #ff8a73; --bad-soft: #3e1f1d;
  --stage: #111a3f; --term-bg: #070b1f; --term-ink: #d7e0ff;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.25);
}

* { box-sizing: border-box; }
html, body { background: var(--bg); color: var(--ink); }
body { margin: 0; font: 16px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
a { color: var(--indigo); }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.12; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.5rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 650; }
h3 { font-size: 1.2rem; font-weight: 650; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 6px; }
.mono { font-family: var(--mono); }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.eyebrow { font: 600 .75rem/1 var(--body); text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); }
.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 20px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- Buttons & chips ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 10px 16px; border-radius: 999px; font-weight: 700; cursor: pointer; text-decoration: none; transition: transform .12s, background .12s, border-color .12s; }
.btn:hover { border-color: var(--indigo); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--indigo-deep); color: var(--bg); border-color: var(--indigo-deep); }
:root[data-theme="dark"] .btn.primary { color: #0d1330; }
.btn.amber { background: var(--amber); color: #1b1203; border-color: var(--amber); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 12px; font-size: .875rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700;
  background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip.indigo { background: var(--indigo-soft); color: var(--indigo); }
.chip.amber { background: var(--amber-soft); color: var(--amber-ink); }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.code { font-family: var(--mono); font-size: .8rem; font-weight: 600; letter-spacing: .02em; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-name { font: 700 1.15rem/1 var(--display); }
.brand-name small { display: block; font: 600 .62rem/1.2 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.nav { display: flex; gap: 4px; }
.nav a { padding: 8px 12px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 700; font-size: .95rem; }
.nav a.active, .nav a:hover { color: var(--ink); background: var(--surface-2); }
.menu-btn { display: none; }
@media (max-width: 860px) {
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; background: var(--surface); padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .nav.open { display: flex; }
  .menu-btn { display: inline-flex; }
  .topbar .hide-sm { display: none; }
}

.banner { background: var(--amber-soft); color: var(--amber-ink); font-size: .9rem; }
.banner .wrap { padding-block: 8px; }

main { min-height: 70vh; }
.page { padding-block: 32px 64px; display: flex; flex-direction: column; gap: 28px; }

/* ---------- Home ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 12% 20%, color-mix(in srgb, var(--indigo) 14%, transparent), transparent 42%),
    var(--bg); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 40px; align-items: center; padding-block: 48px 56px; }
.hero-copy { display: flex; flex-direction: column; gap: 20px; }
.hero-copy h1 em { font-style: normal; color: var(--indigo); }
.hero-copy .lede { font-size: 1.15rem; color: var(--ink-2); max-width: 36em; }
.hero-stats { display: flex; gap: 28px; flex-wrap: wrap; }
.hero-stats b { display: block; font: 700 1.6rem/1 var(--display); font-variant-numeric: tabular-nums; }
.hero-stats span { font-size: .85rem; color: var(--ink-3); }
.adire { position: absolute; inset: 0; pointer-events: none; opacity: .5; }
@media (max-width: 920px) { .hero .wrap { grid-template-columns: 1fr; } }

.section-head { display: flex; flex-direction: column; gap: 8px; max-width: 46em; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.feature .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--indigo-soft); color: var(--indigo); }
.feature p { color: var(--ink-2); font-size: .95rem; }
@media (max-width: 900px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }

.providers { display: flex; flex-wrap: wrap; gap: 8px; }
.provider-pill { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 700; font-size: .9rem; text-decoration: none; color: var(--ink); }
.provider-pill span { color: var(--ink-3); font-weight: 600; margin-left: 4px; font-variant-numeric: tabular-nums; }

/* ---------- Pricing ---------- */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.plan.featured { border: 2px solid var(--indigo); box-shadow: var(--shadow); }
.plan .price { font: 700 2.4rem/1 var(--display); font-variant-numeric: tabular-nums; }
.plan .price small { font: 600 .9rem var(--body); color: var(--ink-3); }
.plan ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--ink-2); }
.plan .btn { justify-content: center; margin-top: auto; }
@media (max-width: 860px) { .plans { grid-template-columns: 1fr; } }

/* ---------- Catalog ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.input, select.input { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.input:focus { border-color: var(--indigo); outline: none; }
.seg { display: inline-flex; background: var(--surface-2); padding: 3px; border-radius: 999px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.cert-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px;
  text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
.cert-card:hover { border-color: var(--indigo); transform: translateY(-2px); }
.cert-card h4 { font: 700 1rem/1.3 var(--body); }
.cert-card .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.provider-label { font-size: .78rem; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; }

/* ---------- Cert page ---------- */
.cert-head { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.facts { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.facts div b { display: block; font: 700 1.2rem/1.2 var(--display); font-variant-numeric: tabular-nums; }
.facts div span { font-size: .8rem; color: var(--ink-3); }
.domain-bars { display: flex; flex-direction: column; gap: 12px; }
.dbar { display: grid; grid-template-columns: minmax(0, 1fr) 56px; gap: 4px 12px; align-items: center; }
.dbar .track { grid-column: 1 / -1; height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.dbar .fill { height: 100%; background: var(--indigo); border-radius: 99px; }
.dbar .pct { text-align: right; font: 700 .9rem var(--mono); font-variant-numeric: tabular-nums; }
.actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.action { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 6px; cursor: pointer; text-align: left; }
.action:hover { border-color: var(--indigo); }
.action p { color: var(--ink-2); font-size: .9rem; }
@media (max-width: 900px) { .cert-head { grid-template-columns: 1fr; } .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .actions { grid-template-columns: 1fr; } }

.outline { display: flex; flex-direction: column; gap: 14px; }
.outline-domain { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.outline-domain header { display: flex; gap: 10px; align-items: center; padding: 14px 16px; background: var(--surface-2); }
.topic { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.topic:hover { background: var(--indigo-soft); }
.topic .t { flex: 1; min-width: 0; }
.topic .t b { display: block; font-weight: 700; }
.topic .t span { font-size: .88rem; color: var(--ink-2); }

/* ---------- Classroom ---------- */
.classroom { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; padding-block: 20px 48px; }
.class-side { display: flex; flex-direction: column; gap: 12px; align-self: start; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 80px); max-height: calc(100vh - 100px); overflow: auto; }
.scene-list { display: flex; flex-direction: column; gap: 2px; }
.scene-list button { display: flex; gap: 10px; align-items: center; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; text-align: left; cursor: pointer; color: var(--ink-2); font-size: .92rem; }
.scene-list button .n { font: 600 .75rem var(--mono); color: var(--ink-3); width: 20px; flex: none; }
.scene-list button.on { background: var(--indigo-soft); color: var(--ink); font-weight: 700; }
.scene-list button.done .n { color: var(--good); }
.class-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.theatre { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.theatre-top { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.theatre-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 440px; }
.presenter { border-right: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; background:
  radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--indigo) 12%, transparent), transparent 70%), var(--surface); }
.presenter .who { text-align: center; }
.presenter .who b { font: 700 1.05rem var(--display); display: block; }
.presenter .who span { font-size: .8rem; color: var(--ink-3); }
.presenter video { width: 100%; border-radius: 12px; }
.stage-wrap { position: relative; padding: 18px; min-width: 0; background: var(--stage); }
.captions { padding: 12px 16px; border-top: 1px solid var(--line); min-height: 56px; font-size: 1.02rem; color: var(--ink); background: var(--surface); }
.captions .spoken { color: var(--ink); }
.captions .unspoken { color: var(--ink-3); }
.controls { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.progress { flex: 1; min-width: 100px; height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--amber); width: 0; transition: width .3s; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink); flex: none; }
.icon-btn.big { width: 48px; height: 48px; background: var(--indigo-deep); border-color: var(--indigo-deep); color: var(--bg); }
.icon-btn:hover { border-color: var(--indigo); }
@media (max-width: 980px) {
  .classroom { grid-template-columns: 1fr; }
  .class-side { position: static; max-height: none; }
}
@media (max-width: 720px) {
  .theatre-body { grid-template-columns: 1fr; }
  .presenter { border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; justify-content: flex-start; padding: 12px; }
  .presenter .avatar { width: 92px !important; }
  .presenter .who { text-align: left; }
}

/* Avatar */
.avatar { width: 180px; max-width: 100%; aspect-ratio: 1; }
.avatar svg { width: 100%; height: 100%; display: block; }
.avatar .ring { transform-origin: 100px 100px; animation: spin 40s linear infinite; }
.avatar.speaking .halo { opacity: 1; }
.avatar .halo { opacity: 0; transition: opacity .3s; }
.avatar .eyes { transform-origin: 100px 92px; animation: blink 5s infinite; }
.avatar .head { transform-origin: 100px 150px; transition: transform .4s; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 0%, 95%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
@media (prefers-reduced-motion: reduce) { .avatar .ring, .avatar .eyes { animation: none; } }

/* ---------- Stage surfaces ---------- */
.scene-title { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.talk-card { display: flex; flex-direction: column; gap: 16px; padding: 8px 4px; }
.talk-card h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
.bullets { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.bullets li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); opacity: .35; transform: translateY(4px); transition: opacity .4s, transform .4s; }
.bullets li.show { opacity: 1; transform: none; }
.bullets li::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--amber); flex: none; margin-top: 8px; transform: rotate(45deg); }
.tips li::before { background: var(--indigo); }
.diagram { width: 100%; overflow-x: auto; }
.diagram svg { display: block; min-width: 520px; width: 100%; height: auto; }

.win { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); position: relative; }
.win-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: .82rem; font-weight: 700; color: var(--ink-2); }
.win-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); display: inline-block; }
.win-bar .sim { margin-left: auto; font-weight: 600; color: var(--ink-3); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.console { display: grid; grid-template-columns: 150px minmax(0, 1fr); min-height: 320px; }
.console nav { border-right: 1px solid var(--line); padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; background: var(--surface); }
.console nav [data-t] { padding: 7px 10px; border-radius: 6px; font-size: .85rem; color: var(--ink-2); }
.console nav [data-t].cur { background: var(--indigo-soft); color: var(--indigo); font-weight: 700; }
.console .pane { padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.console .crumbs { font-size: .78rem; color: var(--ink-3); }
.console h3 { font-size: 1.15rem; }
.fields { display: grid; gap: 10px; }
.field { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 10px; align-items: center; font-size: .9rem; }
.field label { color: var(--ink-2); font-weight: 700; }
.fake-input { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; min-height: 36px; background: var(--bg); font-family: var(--mono); font-size: .85rem; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; overflow: hidden; }
.fake-input.focus { border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-soft); }
.fake-input .caret { width: 2px; height: 16px; background: var(--indigo); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.toggle { width: 40px; height: 22px; border-radius: 99px; background: var(--line); position: relative; flex: none; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .2s; }
.toggle.on { background: var(--good); }
.toggle.on::after { left: 21px; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; }
.fake-btn { padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: .85rem; }
.fake-btn.primary { background: var(--amber); border-color: var(--amber); color: #1b1203; }
.sim-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.sim-table th, .sim-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.sim-table th { color: var(--ink-3); font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
.table-wrap { overflow-x: auto; }
.sim-alert { padding: 10px 12px; border-radius: 8px; font-size: .88rem; font-weight: 700; }
.sim-alert.success { background: var(--good-soft); color: var(--good); }
.sim-alert.info { background: var(--indigo-soft); color: var(--indigo); }
.sim-alert.warning { background: var(--amber-soft); color: var(--amber-ink); }
.sim-alert.error { background: var(--bad-soft); color: var(--bad); }
@media (max-width: 600px) { .console { grid-template-columns: 1fr; } .console nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); } .console nav [data-t] { white-space: nowrap; } .field { grid-template-columns: 1fr; gap: 4px; } }

.terminal { background: var(--term-bg); color: var(--term-ink); font: 13px/1.55 var(--mono); padding: 14px 16px; min-height: 300px; max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.terminal .prompt { color: #7ee2b8; }
.terminal .cmd { color: #ffffff; }
.terminal .out { color: #aab6e8; }
.terminal .comment { color: #6c78a8; }

.sheet-bar { display: flex; gap: 8px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--line); font: 13px var(--mono); background: var(--surface); }
.sheet-bar .ref { min-width: 44px; font-weight: 700; color: var(--indigo); }
.sheet-bar .fx { color: var(--ink-3); font-style: italic; }
.sheet { overflow-x: auto; }
.sheet table { border-collapse: collapse; font: 13px var(--mono); min-width: 100%; }
.sheet th { background: var(--surface-2); color: var(--ink-3); font-weight: 600; padding: 4px 8px; border: 1px solid var(--line); }
.sheet td { border: 1px solid var(--line); padding: 6px 10px; min-width: 96px; height: 34px; text-align: right; font-variant-numeric: tabular-nums; background: var(--surface); }
.sheet td.text { text-align: left; font-family: var(--body); font-weight: 700; color: var(--ink-2); }
.sheet td.sel { outline: 2px solid var(--indigo); outline-offset: -2px; background: var(--indigo-soft); }
.sheet td.flash { background: var(--amber-soft); }

[data-t].hl { box-shadow: 0 0 0 3px var(--amber) !important; border-radius: 8px; }
.cursor { position: absolute; left: 0; top: 0; width: 26px; height: 26px; pointer-events: none; z-index: 5; transition: transform .7s cubic-bezier(.4, .1, .2, 1); filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.ripple { position: absolute; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; border: 3px solid var(--amber); pointer-events: none; z-index: 4; animation: ripple .6s ease-out forwards; }
@keyframes ripple { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { transition: none; } }

.lab-banner { display: flex; gap: 10px; align-items: center; padding: 10px 14px; background: var(--amber-soft); color: var(--amber-ink); border-radius: 10px; font-weight: 700; margin-bottom: 12px; flex-wrap: wrap; }
.lab-mode [data-t] { cursor: pointer; }
.lab-mode [data-t]:hover { box-shadow: 0 0 0 2px var(--indigo-soft); }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* ---------- Questions ---------- */
.qcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.qstem { font-size: 1.08rem; font-weight: 700; line-height: 1.5; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 12px 14px; cursor: pointer; }
.opt:hover { border-color: var(--indigo); }
.opt .letter { width: 26px; height: 26px; border-radius: 7px; background: var(--surface-2); display: grid; place-items: center; font: 700 .8rem var(--mono); flex: none; }
.opt.sel { border-color: var(--indigo); background: var(--indigo-soft); }
.opt.sel .letter { background: var(--indigo); color: var(--bg); }
.opt.right { border-color: var(--good); background: var(--good-soft); }
.opt.right .letter { background: var(--good); color: #fff; }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.wrong .letter { background: var(--bad); color: #fff; }
.opt .note { display: block; font-size: .85rem; color: var(--ink-2); margin-top: 4px; }
.explain { padding: 14px 16px; border-radius: 10px; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.verdict { font: 700 1.05rem var(--display); }
.verdict.good { color: var(--good); }
.verdict.bad { color: var(--bad); }

.exam-bar { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 64px); z-index: 5; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.timer { font: 700 1.2rem var(--mono); font-variant-numeric: tabular-nums; }
.timer.low { color: var(--bad); }
.qnav { display: flex; gap: 4px; flex-wrap: wrap; }
.qnav button { width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg); font: 600 .75rem var(--mono); cursor: pointer; }
.qnav button.answered { background: var(--indigo-soft); border-color: var(--indigo); }
.qnav button.cur { outline: 2px solid var(--amber); }
.qnav button.flag { border-color: var(--amber); border-width: 2px; }

.score-ring { width: 150px; height: 150px; }
.results-head { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }

/* ---------- Dashboard ---------- */
.dash-top { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.stat b { display: block; font: 700 1.8rem/1.1 var(--display); font-variant-numeric: tabular-nums; }
.stat span { font-size: .85rem; color: var(--ink-3); }
@media (max-width: 760px) { .dash-top { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.enrolled { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.enr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.readiness-meter { display: flex; align-items: center; gap: 14px; }
.meter { flex: 1; height: 10px; border-radius: 99px; background: var(--surface-2); position: relative; overflow: hidden; }
.meter > div { height: 100%; border-radius: 99px; background: var(--indigo); }
.meter .pass { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--amber); }

/* ---------- Panels, forms, toasts ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.form { display: flex; flex-direction: column; gap: 12px; max-width: 420px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: .9rem; }
.auth-card { max-width: 440px; margin: 40px auto; }
.err { color: var(--bad); font-weight: 700; font-size: .9rem; }
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 20px); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 700; z-index: 50; box-shadow: var(--shadow); max-width: calc(100% - 32px); }

.chat { display: flex; flex-direction: column; gap: 10px; max-height: 380px; overflow-y: auto; padding: 4px; }
.msg { padding: 10px 14px; border-radius: 14px; max-width: 85%; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: var(--indigo-deep); color: var(--bg); border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.chat-form { display: flex; gap: 8px; }
.chat-form .input { flex: 1; }

.plan-weeks { display: grid; gap: 12px; }
.week { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.week ul { margin: 0; padding-left: 18px; color: var(--ink-2); }

.loading { display: flex; gap: 12px; align-items: center; color: var(--ink-2); padding: 24px 0; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--indigo); animation: spin .8s linear infinite; flex: none; }

footer.site { border-top: 1px solid var(--line); padding-block: 28px; color: var(--ink-3); font-size: .85rem; }
footer.site .wrap { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Fixes: visibility, narrow stages, mobile classroom ---------- */
[hidden] { display: none !important; }
.stage-wrap { container-type: inline-size; }
@container (max-width: 560px) {
  .console { grid-template-columns: 1fr; }
  .console nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .console nav [data-t] { white-space: nowrap; }
  .field { grid-template-columns: 1fr; gap: 4px; }
}
.hero .theatre-body { grid-template-columns: 170px minmax(0, 1fr); }
.hero .presenter .avatar { width: 130px; }
@media (max-width: 720px) { .hero .theatre-body { grid-template-columns: 1fr; } }
@media (max-width: 980px) {
  .class-side { order: 2; }
  .class-main { order: 1; }
  .scene-list { flex-direction: row; overflow-x: auto; gap: 6px; }
  .scene-list button { white-space: nowrap; background: var(--surface); border: 1px solid var(--line); }
}

/* =====================================================================
   Classroom v2: realistic presenter, split / picture-in-picture layouts
   ===================================================================== */
.topbar .nav a { white-space: nowrap; }
#account-slot .btn { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
#lang { max-width: 130px; }
@media (max-width: 1180px) { #lang { display: none; } }

.classroom { grid-template-columns: 250px minmax(0, 1fr); gap: 24px; padding-block: 18px 48px; }
.class-side { top: calc(env(safe-area-inset-top, 0px) + 76px); gap: 14px; }
.back-link { color: var(--ink-2); text-decoration: none; font-weight: 700; }
.back-link:hover { color: var(--indigo); }
.lesson-title { font-size: 1.15rem; line-height: 1.25; }
.scene-list button { width: 100%; }
.scene-list button .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.theatre { border-radius: 20px; }
.theatre-top { padding: 10px 16px; }
.theatre .theatre-body {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, 34%) minmax(0, 1fr);
  min-height: clamp(400px, 58vh, 600px);
}
.theatre .presenter {
  border-right: 1px solid var(--line);
  padding: 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--indigo) 16%, transparent), transparent 70%), var(--surface);
  transition: all .35s ease;
}
.theatre .presenter #presenter, .theatre .presenter .pres-host { width: 100%; max-width: 340px; }
.theatre .presenter .who { text-align: center; }
.theatre .presenter .who b { font: 700 1.1rem var(--display); display: block; }
.theatre .presenter .who span { font-size: .82rem; color: var(--ink-3); }
.theatre .stage-wrap { padding: 22px 26px; overflow: auto; }

/* Demo scenes: the screen takes the whole stage; the instructor floats in the corner */
.theatre.layout-pip .theatre-body { grid-template-columns: minmax(0, 1fr); }
.theatre.layout-pip .presenter {
  position: absolute; right: 16px; bottom: 16px; z-index: 6;
  width: 190px; padding: 0; border: 0; border-radius: 16px; overflow: hidden;
  background: transparent; box-shadow: 0 10px 30px rgba(10, 16, 40, .35);
}
.theatre.layout-pip .presenter #presenter { max-width: none; }
.theatre.layout-pip .presenter .who { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 8px; text-align: left;
  background: linear-gradient(transparent, rgba(6, 10, 30, .75)); }
.theatre.layout-pip .presenter .who b { color: #fff; font-size: .9rem; }
.theatre.layout-pip .presenter .who span { color: rgba(255, 255, 255, .8); font-size: .72rem; }
.theatre.layout-pip .presenter .pres-svg { background: var(--surface); padding: 10px; }
.theatre.layout-pip .stage-wrap { padding-right: 222px; }

/* Presenter media stack */
.pres-media { position: relative; width: 100%; aspect-ratio: 1; border-radius: 18px; overflow: hidden; background: #0c1230; }
.pres-media > img, .pres-media > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s ease; }
.pres-media .pres-portrait { opacity: 1; }
.pres-media[data-state="idle"] .pres-idle,
.pres-media[data-state="talk"] .pres-talk,
.pres-media[data-state="lip"] .pres-lip,
.pres-media[data-state="live"] .pres-live { opacity: 1; }
/* No talking loop yet: keep the listening loop visible while speaking */
.pres-media:not(:has(.pres-talk))[data-state="talk"] .pres-idle { opacity: 1; }
.pres-badge { position: absolute; top: 10px; left: 10px; padding: 3px 9px; border-radius: 999px; background: #d63a2f; color: #fff; font: 700 .72rem var(--body); letter-spacing: .04em; }
.pres-svg .avatar { width: 100%; }
.theatre.layout-pip .pres-media { border-radius: 16px; }

/* Start cover: one clear click that also unlocks sound */
.start-cover { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(3px); }
.start-btn { display: flex; align-items: center; gap: 14px; padding: 14px 22px 14px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); cursor: pointer; text-align: left; color: var(--ink); }
.start-btn b { display: block; font: 700 1.1rem var(--display); }
.start-btn small { color: var(--ink-3); }
.start-btn:hover { border-color: var(--indigo); }

.captions { font-size: 1.05rem; line-height: 1.6; padding: 14px 20px; min-height: 64px; max-height: 8.5em; overflow-y: auto; }
.controls { padding: 10px 16px; }
.controls #speed { padding: 6px 8px; width: auto; }
.talk-card h2 { font-size: clamp(1.35rem, 2.2vw, 1.85rem); }

@media (max-width: 1100px) {
  .classroom { grid-template-columns: minmax(0, 1fr); }
  .class-side { position: static; max-height: none; order: 2; }
  .class-main { order: 1; }
  .scene-list { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .scene-list button { width: auto; white-space: nowrap; background: var(--surface); border: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .theatre .theatre-body { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .theatre .presenter { flex-direction: row; justify-content: flex-start; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px; }
  .theatre .presenter #presenter { width: 96px; flex: none; }
  .theatre .presenter .who { text-align: left; }
  .theatre.layout-pip .presenter { width: 112px; right: 10px; bottom: 10px; }
  .theatre.layout-pip .presenter .who { display: none; }
  .theatre.layout-pip .stage-wrap { padding: 14px 14px 140px; }
  .theatre .stage-wrap { padding: 14px; }
  .hide-sm { display: none; }
  .controls .btn span { display: none; }
}

/* Instructor cards (home + admin) */
.inst-photo { width: 72px; height: 72px; border-radius: 16px; overflow: hidden; flex: none; background: var(--surface-2); }
.inst-photo img, .inst-photo video { width: 100%; height: 100%; object-fit: cover; display: block; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.admin-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
.admin-card .pres-media { border-radius: 12px; }
.admin-card textarea { width: 100%; min-height: 70px; font-size: .82rem; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .92rem; }
.kv b { font-variant-numeric: tabular-nums; }
.hero .theatre .theatre-body { grid-template-columns: 190px minmax(0, 1fr); min-height: 380px; }
.hero .theatre .presenter { padding: 14px; }
@media (max-width: 760px) { .hero .theatre .theatre-body { grid-template-columns: minmax(0, 1fr); } }

.admin-card .row { flex-wrap: wrap; }
