/* NeugenAI learning platform - one stylesheet, no build step.
   Brand from neugenai.org: navy #212946, gold #f5c518, Lexend Deca + Inter. */

:root {
  --navy: #212946;
  --navy-deep: #111936;
  --indigo: #3f4da8;
  --gold: #f5c518;
  --gold-deep: #ca8a04;

  --bg: #f4f3f0;
  --surface: #ffffff;
  --surface-2: #f8f8f6;
  --ink: #161b2e;
  --ink-2: #4a5068;
  --ink-3: #8a8fa3;
  --line: #e5e4df;
  --line-strong: #d3d2cc;
  --accent: var(--indigo);
  --accent-soft: #eceefb;

  --good: #15803d; --good-soft: #dcfce7;
  --warn: #b45309; --warn-soft: #fef3c7;
  --bad: #b91c1c;  --bad-soft: #fee2e2;
  --info: #1d4ed8; --info-soft: #dbeafe;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(17, 25, 54, .06), 0 4px 14px rgba(17, 25, 54, .05);
  --shadow-lg: 0 10px 40px rgba(17, 25, 54, .12);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", "Noto Sans", "Noto Sans Devanagari", sans-serif;
  --font-display: "Lexend Deca", var(--font);
  --font-mono: "Source Code Pro", ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1224;
    --surface: #151b31;
    --surface-2: #1b2240;
    --ink: #eef0f8;
    --ink-2: #b4b9cf;
    --ink-3: #7c83a0;
    --line: #262e4f;
    --line-strong: #343d63;
    --accent: #8f9bf0;
    --accent-soft: #232b52;
    --good: #4ade80; --good-soft: #10331f;
    --warn: #fbbf24; --warn-soft: #3a2a0a;
    --bad: #f87171;  --bad-soft: #3b1414;
    --info: #93c5fd; --info-soft: #14254a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.25);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.6 var(--font); -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
code, pre, kbd { font-family: var(--font-mono); font-size: .88em; }
:not(pre) > code { background: var(--surface-2); border: 1px solid var(--line); padding: .1em .35em; border-radius: 5px; }
pre { background: var(--navy-deep); color: #e7e9f5; padding: 14px 16px; border-radius: var(--radius-sm); overflow-x: auto; line-height: 1.5; }
pre code { color: inherit; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* --- layout -------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--navy); color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 0 16px; height: 58px; display: flex; align-items: center; gap: 22px; }
/* Brand lockup: parent logo | Learn. --brand-h is the logo height; the rest scales from it
   (Learn's baseline lines up with the wordmark's). */
.brand { --brand-h: 26px; display: flex; align-items: center; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-lg { --brand-h: 34px; align-self: flex-start; }
.brand-logo { height: var(--brand-h); width: auto; display: block; }
.brand-tile { height: 30px; width: 30px; display: none; }
.brand-rule { width: 1px; height: calc(var(--brand-h) * .8); background: rgba(255,255,255,.28); margin: 0 calc(var(--brand-h) * .36) 0 calc(var(--brand-h) * .4); }
.brand-text { font: 500 calc(var(--brand-h) * .7)/1 var(--font-display); color: #e4e7f5; white-space: nowrap; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: #c9cde6; padding: 7px 12px; border-radius: 8px; font-weight: 500; font-size: .92rem; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.07); text-decoration: none; }
.nav a.active { color: #fff; background: rgba(255,255,255,.12); }
.nav-count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 99px; background: var(--gold); color: var(--navy); font-size: .72rem; font-weight: 700; text-align: center; line-height: 18px; margin-left: 2px; }
.nav a { white-space: nowrap; }
.userchip { display: flex; align-items: center; gap: 10px; color: #c9cde6; font-size: .88rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--indigo); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: .85rem; }
.linkbtn { background: none; border: 0; color: #c9cde6; cursor: pointer; font: inherit; padding: 0; white-space: nowrap; }
.linkbtn:hover { color: #fff; }
.mode-pill { white-space: nowrap; font-size: .72rem; padding: 3px 9px; border-radius: 99px; background: rgba(245,197,24,.15); color: var(--gold); border: 1px solid rgba(245,197,24,.35); }

.page { max-width: 1240px; margin: 0 auto; padding: 28px 16px 64px; }
.page-narrow { max-width: 860px; }
.grid { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; align-items: start; }
.split.split-aside-sm { grid-template-columns: minmax(0, 1fr) 320px; }
.stack > * + * { margin-top: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.spacer { flex: 1; }
@media (max-width: 960px) { .userchip .name { display: none; } }
@media (max-width: 1000px) { .split, .split.split-aside-sm { grid-template-columns: minmax(0, 1fr); } .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .cols-2, .cols-3, .cols-4, [data-track-grid] { grid-template-columns: minmax(0, 1fr) !important; }
  .nav a { padding: 7px 8px; }
  .userchip .name, .userchip form, .topbar .brand-rule, .topbar .brand-text, .topbar .brand-logo, .mode-pill { display: none; }   /* log out lives in Settings */
  .brand-tile { display: block; }
  .topbar-inner { gap: 10px; }
  .nav { min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .rail-step { font-size: .7rem; }
  .rail-step:not(.current) .rail-label { visibility: hidden; }
}

/* --- surfaces ------------------------------------------------------------ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card-tight { padding: 14px 16px; }
.card h2, .card h3 { margin-bottom: .6em; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; }
.eyebrow { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin-bottom: 6px; }

.hero {
  background: radial-gradient(1200px 300px at 90% -40%, rgba(245,197,24,.28), transparent 60%),
              linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #fff; border-radius: 18px; padding: 28px; position: relative; overflow: hidden;
}
.hero h1 { color: #fff; margin-bottom: .3em; }
.hero p { color: #c9cde6; max-width: 62ch; }
.hero .chip { background: rgba(255,255,255,.1); color: #e6e8f5; border-color: rgba(255,255,255,.15); }
.hero-glyphs { position: absolute; right: 22px; bottom: 14px; font-family: var(--font-mono); font-size: .8rem; color: rgba(255,255,255,.18); text-align: right; line-height: 1.8; pointer-events: none; }

/* --- stats --------------------------------------------------------------- */
.stat { padding: 16px 18px; }
.stat .label { font-size: .8rem; color: var(--ink-3); font-weight: 500; }
.stat .value { font-family: var(--font-display); font-size: 1.9rem; font-weight: 600; line-height: 1.2; margin-top: 2px; }
.stat .value small { font-size: .9rem; color: var(--ink-3); font-weight: 400; }

/* --- buttons & form ------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font: 600 .9rem var(--font); cursor: pointer;
  transition: background .15s, transform .05s, box-shadow .15s, border-color .15s; text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-deep); border-color: var(--navy-deep); }
@media (prefers-color-scheme: dark) { .btn-primary { background: var(--indigo); border-color: var(--indigo); } .btn-primary:hover { background: #4b5ac0; } }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.btn-gold:hover { background: #ffd83d; border-color: #ffd83d; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 6px 11px; font-size: .82rem; border-radius: 8px; }
.btn-block { width: 100%; }

label { font-weight: 500; font-size: .88rem; display: block; margin-bottom: 5px; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); color: var(--ink); font: .95rem var(--font); transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field { margin-bottom: 14px; }
.field .help { font-size: .8rem; color: var(--ink-3); margin-top: 4px; }
.errorlist { color: var(--bad); font-size: .85rem; margin: 4px 0 0; padding-left: 18px; }

/* --- chips / badges ---------------------------------------------------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 500; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 600; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }
.tone-good { background: var(--good-soft); color: var(--good); }
.tone-warn { background: var(--warn-soft); color: var(--warn); }
.tone-bad { background: var(--bad-soft); color: var(--bad); }
.tone-info { background: var(--info-soft); color: var(--info); }
.tone-muted { background: var(--surface-2); color: var(--ink-3); }
.live::before { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* --- flash messages ------------------------------------------------------ */
.flashes { max-width: 1240px; margin: 16px auto 0; padding: 0 16px; }
.flash { padding: 11px 14px; border-radius: 10px; margin-bottom: 8px; font-size: .92rem; border: 1px solid transparent; }
.flash.success { background: var(--good-soft); color: var(--good); }
.flash.error { background: var(--bad-soft); color: var(--bad); }
.flash.info, .flash.warning { background: var(--info-soft); color: var(--info); }

/* --- tabs ------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab { background: none; border: 0; padding: 10px 14px; font: 600 .9rem var(--font); color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab[aria-selected=true] { color: var(--ink); border-bottom-color: var(--gold-deep); }
.tab .count { font-size: .72rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 0 7px; margin-left: 5px; color: var(--ink-3); }
[role=tabpanel][hidden] { display: none; }

/* --- markdown ------------------------------------------------------------ */
.prose { line-height: 1.7; }
.prose h2 { font-size: 1.15rem; margin-top: 1.6em; }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 1em; }
.prose li { margin: .25em 0; }
.prose table { border-collapse: collapse; margin: 1em 0; width: 100%; font-size: .92rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; }
.prose blockquote { margin: 0 0 1em; padding: 4px 14px; border-left: 3px solid var(--gold); color: var(--ink-2); }
.prose > :last-child { margin-bottom: 0; }

/* --- quest map ------------------------------------------------------------ */
.layer-col { display: flex; flex-direction: column; gap: 14px; }
.layer-head { padding: 4px 2px 2px; }
.layer-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.layer-dot { width: 10px; height: 10px; border-radius: 3px; }
/* Track colours, by position in the course's track list. */
.track-0 { background: #0ea5a4; } .track-1 { background: var(--indigo); } .track-2 { background: var(--gold-deep); }
.track-3 { background: #db2777; } .track-4 { background: #7c3aed; } .track-5 { background: #65a30d; }
.crumbs { color: var(--ink-3); margin: -8px 0 12px; }
.crumbs a { color: var(--ink-2); }
.quest-card { display: block; color: inherit; position: relative; transition: transform .15s, box-shadow .15s, border-color .15s; }
.quest-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.quest-card h3 { font-size: 1.02rem; margin: 8px 0 6px; }
.quest-card p { font-size: .88rem; color: var(--ink-2); margin: 0 0 12px; }
.quest-card.locked { opacity: .6; }
.quest-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.placeholder-card { border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: 18px; color: var(--ink-3); font-size: .88rem; text-align: center; }
.difficulty { letter-spacing: 2px; color: var(--gold-deep); font-size: .8rem; }

/* --- materials ------------------------------------------------------------ */
.material { display: grid; grid-template-columns: 26px 38px minmax(0,1fr); gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); align-items: start; }
.material:first-of-type { border-top: 0; }
.material.done .material-title { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-3); }
.check { appearance: none; width: 22px; height: 22px; border: 2px solid var(--line-strong); border-radius: 7px; cursor: pointer; margin: 2px 0 0; display: grid; place-items: center; transition: all .15s; background: var(--surface); }
.check:checked { background: var(--good); border-color: var(--good); }
.check:checked::after { content: "✓"; color: #fff; font-size: 13px; font-weight: 800; }
.kind-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 1.05rem; background: var(--surface-2); border: 1px solid var(--line); }
.material-title { font-weight: 600; }
.material-why { font-size: .88rem; color: var(--ink-2); margin: 3px 0 0; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); border-radius: 99px; transition: width .3s; }

/* --- tables -------------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.pass { color: var(--good); font-weight: 700; }
.fail { color: var(--bad); font-weight: 700; }

/* --- score bars ---------------------------------------------------------- */
.score-row { padding: 12px 0; border-top: 1px solid var(--line); }
.score-row:first-child { border-top: 0; padding-top: 0; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; margin: 6px 0; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: var(--indigo); }
.bar.good > span { background: var(--good); } .bar.warn > span { background: #f59e0b; } .bar.bad > span { background: var(--bad); }

/* --- pipeline rail ------------------------------------------------------- */
.rail { display: flex; gap: 0; margin: 4px 0 2px; }
.rail-step { flex: 1; position: relative; text-align: center; font-size: .78rem; color: var(--ink-3); padding-top: 26px; min-width: 0; }
.rail-step::before { content: ""; position: absolute; top: 9px; left: 0; right: 0; height: 3px; background: var(--line); }
.rail-step:first-child::before { left: 50%; } .rail-step:last-child::before { right: 50%; }
.rail-step .dot { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); width: 17px; height: 17px; border-radius: 50%; background: var(--surface); border: 3px solid var(--line-strong); z-index: 1; }
.rail-step.done { color: var(--ink-2); } .rail-step.done::before { background: var(--good); }
.rail-step.done .dot { background: var(--good); border-color: var(--good); }
.rail-step.current { color: var(--ink); font-weight: 600; }
.rail-step.current .dot { border-color: var(--gold-deep); background: var(--gold); box-shadow: 0 0 0 5px rgba(245,197,24,.25); animation: pulse 1.6s ease-in-out infinite; }

/* --- timeline -------------------------------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; font-size: .88rem; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: -8px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 0; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--indigo); }

/* --- chat (tutor + defense) ---------------------------------------------- */
.chat { display: flex; flex-direction: column; height: min(72vh, 680px); }
.chat-sticky { position: sticky; top: 76px; }
.chat-head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.bot-avatar { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--gold), var(--gold-deep)); display: grid; place-items: center; color: var(--navy); font-weight: 800; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px 2px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.msg { max-width: 92%; padding: 10px 13px; border-radius: 14px; font-size: .92rem; line-height: 1.55; overflow-wrap: anywhere; }
.msg p:last-child { margin-bottom: 0; }
.msg pre { font-size: .8rem; margin: 8px 0; }
.msg.user { align-self: flex-end; background: var(--navy); color: #fff; border-bottom-right-radius: 5px; }
.msg.user a { color: var(--gold); }
.msg.assistant, .msg.examiner { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg.student { align-self: flex-end; background: var(--navy); color: #fff; border-bottom-right-radius: 5px; }
@media (prefers-color-scheme: dark) { .msg.user, .msg.student { background: var(--indigo); } }
.msg.streaming { white-space: pre-wrap; }
.typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: bounce 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.composer { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.composer textarea { min-height: 44px; max-height: 160px; resize: none; }
.chat-empty { color: var(--ink-3); font-size: .88rem; text-align: center; margin: auto 10px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 12px; }
.suggestion { font-size: .8rem; padding: 6px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.suggestion:hover { border-color: var(--accent); color: var(--accent); }

/* --- dropzone -------------------------------------------------------------- */
.dropzone { border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 26px; text-align: center; transition: all .15s; cursor: pointer; background: var(--surface-2); }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { display: none; }
.dropzone .big { font-size: 1.8rem; }

/* --- code block with copy -------------------------------------------------- */
.cmd { position: relative; }
.cmd pre { margin: 0; padding-right: 64px; }
.copy { position: absolute; top: 8px; right: 8px; font-size: .72rem; padding: 4px 9px; border-radius: 6px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.06); color: #cfd3ea; cursor: pointer; }
.copy:hover { background: rgba(255,255,255,.14); }

/* --- login ------------------------------------------------------------------ */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art {
  background: radial-gradient(800px 400px at 100% 0%, rgba(245,197,24,.25), transparent 60%), linear-gradient(160deg, var(--navy), var(--navy-deep));
  color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; position: relative; overflow: hidden;
}
.auth-art h1 { color: #fff; font-size: clamp(1.8rem, 3.2vw, 2.6rem); max-width: 14ch; }
.auth-art p { color: #c9cde6; max-width: 44ch; }
.loop-demo { list-style: none; padding: 0; margin: 26px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-width: 420px; }
.loop-demo li { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 10px 12px; animation: rise .5s both; }
.loop-demo strong { display: block; font-family: var(--font-display); color: var(--gold); }
.loop-demo span { font-size: .78rem; color: #aab1d6; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.auth-form { display: grid; place-items: center; padding: 32px 20px; }
.auth-form .card { width: 100%; max-width: 420px; padding: 30px; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 22px 20px; min-height: 0; gap: 12px; }
  /* Phones: keep the brand and headline, get the form above the fold. */
  .auth-art p, .auth-art .loop-demo, .auth-art .eyebrow { display: none; }
  .auth-art h1 { font-size: 1.5rem; margin: 0; max-width: none; }
  .auth-form { padding: 20px 16px 32px; }
}

/* --- misc ---------------------------------------------------------------- */
.empty { text-align: center; padding: 34px 20px; color: var(--ink-3); }
.empty .big { font-size: 2.2rem; margin-bottom: 6px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: .9rem; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain > li { padding: 10px 0; border-top: 1px solid var(--line); }
.list-plain > li:first-child { border-top: 0; padding-top: 0; }
.callout { border-radius: var(--radius-sm); padding: 12px 14px; font-size: .9rem; border: 1px solid var(--line); background: var(--surface-2); }
.callout.gold { background: rgba(245,197,24,.12); border-color: rgba(202,138,4,.35); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }   /* honeypot */
.footer { text-align: center; font-size: .8rem; color: var(--ink-3); padding: 30px 16px; }
details > summary { cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--ink-2); }
details[open] > summary { margin-bottom: 8px; }

/* --- course people (roster, student, transcript) ------------------------------ */
a.tab { text-decoration: none; }
.course-tabs { margin-top: 4px; }
.filter-chips .chip { text-decoration: none; }
.filter-chips .chip strong { color: var(--ink); }
.chip.chip-on { border-color: var(--gold-deep); background: rgba(245,197,24,.14); color: var(--ink); }
.roster td { vertical-align: top; }
.roster-reason { max-width: 26ch; margin-top: 3px; }
.transcript { display: flex; flex-direction: column; gap: 10px; }
.transcript .msg { max-width: min(92%, 70ch); }
.transcript-day { align-self: center; margin: 6px 0 2px; }
.mentor-notice { font-size: .75rem; color: var(--ink-3); text-align: center; margin: 6px 0 0; }

/* --- notifications bell ------------------------------------------------------ */
.bell { position: relative; color: #c9cee8; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; flex: none; }
.bell:hover { color: #fff; background: rgba(255,255,255,.08); }
.bell-count { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--gold); color: var(--navy); font: 700 .66rem/17px var(--font); text-align: center; }
.tab .count.count-new { background: var(--gold); border-color: var(--gold-deep); color: var(--navy); }
.announcement-banner { display: block; margin-top: 12px; text-decoration: none; color: var(--ink); }
.notif { display: flex; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.notif:last-child { border-bottom: 0; }
.notif.unread { font-weight: 600; }
.notif.unread::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--gold-deep); }
.notif:not(.unread)::before { content: ""; flex: none; width: 8px; }
.announcement { scroll-margin-top: 80px; }
.announcement.is-new { border-color: var(--gold-deep); }
.opt { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 0 0 8px; flex-wrap: wrap; }
.opt input { width: auto; }
.ai-draft { background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 14px; }
.ai-draft label { font-weight: 600; }

/* --- forum ---------------------------------------------------------------------- */
.thread-row { display: flex; justify-content: space-between; gap: 14px; padding: 13px 6px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.thread-row:last-child { border-bottom: 0; }
.thread-row:hover .thread-title { color: var(--accent); }
.thread-main { min-width: 0; }
.thread-title { font-weight: 600; overflow-wrap: anywhere; }
.thread-main .chip { margin-left: 4px; }
.thread-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
@media (max-width: 560px) { .thread-row { flex-direction: column; } .thread-stats { flex-direction: row; align-items: center; gap: 10px; } }
.posts { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.post { scroll-margin-top: 80px; }
.post .prose { margin-top: 10px; overflow-wrap: anywhere; }
.post-head { align-items: flex-start; }
.post-ai { border-left: 3px solid var(--gold-deep); }
.post-accepted { border-color: var(--good); box-shadow: 0 0 0 1px var(--good); }
.post-held { opacity: .85; border-style: dashed; }
.post-actions { margin-top: 10px; gap: 14px; }
.post-actions .linkbtn.is-on { color: var(--accent); font-weight: 600; }
.report > summary { list-style: none; cursor: pointer; }
.report > summary::-webkit-details-marker { display: none; }
.report[open] { flex-basis: 100%; }
.replies-head { margin: 8px 0 -2px; text-transform: uppercase; letter-spacing: .04em; }
.thread-actions { margin-top: 12px; }
.similar { margin-top: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.similar ul { margin: 6px 0 0; }
.mod-preview { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; margin-top: 8px; }
.summary-card .prose { margin-top: 8px; }
.post-actions .linkbtn, .post-actions .report > summary { color: var(--ink-2); }
.post-actions .linkbtn:hover { color: var(--accent); }
main .linkbtn { color: var(--accent); }
main .linkbtn:hover { color: var(--accent); text-decoration: underline; }

/* --- course path (numbered steps in stages) ------------------------------------- */
.chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip.chip-wrap { white-space: normal; text-overflow: clip; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course-path { min-width: 0; }
.next-up { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--ink); text-decoration: none; border-color: var(--gold-deep); background: linear-gradient(0deg, rgba(245,197,24,.08), rgba(245,197,24,.08)), var(--surface); margin-bottom: 18px; }
.next-up:hover { text-decoration: none; box-shadow: var(--shadow-lg); }
.next-up h2 { margin: 2px 0 4px; font-size: 1.2rem; }
.next-up p { margin: 0; }
.next-up > div { min-width: 0; }
.next-up .btn { flex: none; }
.next-up.done { border-color: var(--good); background: var(--surface); }
.mentor-note { margin: -8px 0 16px; }
.path-stage { margin-bottom: 22px; }
.path-stage-head { margin: 0 0 10px 46px; }
.path-stage-head h2 { margin: 0; font-size: 1.15rem; }
.path-stage-head p { margin: 2px 0 0; }
.path-steps { list-style: none; margin: 0; padding: 0; }
.path-step { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding-bottom: 12px; }
.path-step::before { content: ""; position: absolute; left: 16px; top: 34px; bottom: 0; width: 2px; background: var(--line); }
.path-step:last-child::before { display: none; }
.step-num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .9rem; background: var(--surface); border: 2px solid var(--line-strong); color: var(--ink-2); position: relative; z-index: 1; margin-top: 10px; }
.path-step.is-mastered .step-num { background: var(--good); border-color: var(--good); color: #fff; }
.path-step.is-active .step-num { border-color: var(--indigo); color: var(--indigo); }
.path-step.is-next .step-num { background: var(--gold); border-color: var(--gold-deep); color: var(--navy); box-shadow: 0 0 0 4px rgba(245,197,24,.25); }
.path-step.is-soon .step-num { border-style: dashed; color: var(--ink-3); }
.step-card { display: block; min-width: 0; color: inherit; text-decoration: none; padding: 14px 16px; transition: box-shadow .15s, border-color .15s; }
a.step-card:hover { text-decoration: none; box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.path-step.is-next .step-card { border-color: var(--gold-deep); }
.path-step.is-locked .step-card { opacity: .7; }
.step-card.soon { border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: 10px 16px; }
.step-card.soon h3 { margin: 2px 0 0; font-size: .98rem; color: var(--ink-2); }
.step-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 8px; min-width: 0; }
.step-track { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--ink-3); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-card h3 { margin: 6px 0 4px; font-size: 1.02rem; overflow-wrap: anywhere; }
.step-card p { margin: 0 0 10px; font-size: .88rem; color: var(--ink-2); }
.step-card .step-lock { margin: 8px 0 0; }
.quest-meta .difficulty { letter-spacing: 1px; }
.track-legend li { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.track-legend .layer-dot { flex: none; margin-top: 5px; }
@media (max-width: 560px) {
  .next-up { flex-direction: column; align-items: stretch; }
  .next-up .btn { text-align: center; justify-content: center; }
  .path-step { grid-template-columns: 26px minmax(0, 1fr); gap: 8px; }
  .step-num { width: 26px; height: 26px; font-size: .78rem; }
  .path-step::before { left: 12px; top: 30px; }
  .path-stage-head { margin-left: 34px; }
}

/* --- submission screenshots ----------------------------------------------------- */
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.shots a { display: flex; flex-direction: column; gap: 4px; text-decoration: none; min-width: 0; }
.shots img { width: 100%; height: 110px; object-fit: cover; object-position: top; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.shots span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
