/* ============================================================
   AI Mentor — design tokens
   Warm ink + marigold/terracotta. One cool note (periwinkle) held
   in reserve for "passed" states — a single sharp accent against a
   warm field reads more intentional than an evenly split palette.
   ============================================================ */
:root {
  color-scheme: dark;
  --ink:         #14100e;
  --ink-raised:  #1c1613;
  --ink-panel:   #211a16;
  --ink-sunken:  #0d0a09;
  --border:      #2e241d;
  --border-soft: #241c17;
  --text:        #f4ece1;
  --text-dim:    #ab9c8c;
  --text-faint:  #918476;
  --accent:      #f0a840;
  --accent-hi:   #ffc470;
  --accent-ink:  #241203;
  --accent-2:    #ef6a4c;
  --accent-2-hi: #ff8a6c;
  --cool:        #86a9ff;
  --cool-dim:    #2a3252;
  --radius-lg: 18px;
  --radius-md: 13px;
  --radius-sm: 9px;
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Sora", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--ink); color: var(--text); min-height: 100vh;
  font-family: var(--font-body);
  padding-bottom: 48px;
  position: relative;
  isolation: isolate;
}
::selection { background: var(--accent); color: var(--accent-ink); }
.hidden { display: none !important; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 10px 14px;
  border-radius: var(--radius-sm); background: var(--accent-hi); color: var(--accent-ink);
  font-weight: 700; transform: translateY(-150%); transition: transform .15s; }
.skip-link:focus { transform: translateY(0); }

/* ---------- atmosphere: fixed ambient glow + fine grain ----------
   Two soft radial glows (marigold upper-left, terracotta lower-right)
   plus an SVG-noise grain layer. Fixed + behind everything so it never
   affects scroll layout or the interactive elements above it. */
body::before, body::after { content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none; }
body::before {
  background:
    radial-gradient(760px 520px at 8% -6%, rgba(240,168,64,.16), transparent 60%),
    radial-gradient(680px 520px at 96% 8%, rgba(239,106,76,.12), transparent 58%),
    radial-gradient(900px 700px at 50% 115%, rgba(134,169,255,.07), transparent 60%);
}
body::after {
  opacity: .35; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes floatSlow { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ---------- header ---------- */
.top { display: flex; justify-content: space-between; align-items: center;
  padding: 18px 6vw; border-bottom: 1px solid var(--border-soft); position: sticky; top: 0;
  background: rgba(20,16,14,.82); backdrop-filter: blur(14px) saturate(1.3); z-index: 5; }
.brand { font-family: var(--font-display); font-style: italic; font-weight: 600;
  font-size: 21px; letter-spacing: -.01em; cursor: pointer; color: var(--text);
  transition: color .18s; background: transparent; padding: 6px; }
.brand:hover { color: var(--accent-hi); }
.brand span, h1 span, h2 span { color: var(--accent); font-style: normal; }
.streak { font-size: 14px; color: var(--accent-2-hi); font-weight: 600;
  display: flex; align-items: center; gap: 5px; }
.main-nav { display: flex; align-items: center; gap: 3px; }
.main-nav button { background: transparent; color: var(--text-dim); padding: 8px 12px;
  border-radius: 999px; font-size: 13.5px; font-weight: 600; transition: color .15s, background .15s; }
.main-nav button:hover { color: var(--text); background: var(--ink-raised); }
@media (max-width: 650px) {
  .top { flex-wrap: wrap; gap: 9px; }
  .main-nav { order: 3; width: 100%; justify-content: center; }
}

/* ---------- layout shell ---------- */
.view { max-width: 1080px; margin: 0 auto; padding: 28px 6vw; }

.hero { position: relative; text-align: center; margin: 40px 0 34px; padding-top: 6px; }
.hero::before {
  content: "AI"; position: absolute; top: -46px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-display); font-weight: 700; font-size: clamp(90px, 18vw, 190px);
  color: transparent; -webkit-text-stroke: 1px var(--border); line-height: 1;
  letter-spacing: -.04em; z-index: -1; opacity: .55; user-select: none;
}
h1 { font-family: var(--font-display); font-size: clamp(32px, 5.4vw, 54px); font-weight: 600;
  letter-spacing: -.025em; line-height: 1.14; animation: fadeUp .6s .08s ease-out both; }
h2 { font-family: var(--font-display); font-size: clamp(25px, 4vw, 36px); font-weight: 600;
  margin-bottom: 6px; letter-spacing: -.02em; }
.sub { color: var(--text-dim); margin-top: 16px; font-size: 16.5px; line-height: 1.65;
  max-width: 560px; margin-left: auto; margin-right: auto;
  animation: fadeUp .6s .16s ease-out both; }

.card { background: var(--ink-raised); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 19px; margin: 0 auto 14px; max-width: 560px;
  box-shadow: 0 1px 0 rgba(255,255,255,.02) inset, 0 14px 30px -22px rgba(0,0,0,.6); }
#view-dash .card { max-width: none; }
.k { font-family: var(--font-body); font-size: 11.5px; letter-spacing: .13em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin-bottom: 10px; }
.dim { color: var(--text-dim); line-height: 1.6; }

label { display: block; font-size: 14px; color: var(--text-dim); margin-bottom: 14px; }
input, select, textarea { width: 100%; margin-top: 7px; background: var(--ink-sunken); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 12px;
  font-size: 15px; font-family: var(--font-body); transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; min-height: 88px; line-height: 1.5; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(240,168,64,.16); }
input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; opacity: .58; }
input[type="range"] { padding: 0; accent-color: var(--accent); }

button { cursor: pointer; border: none; border-radius: var(--radius-sm); font-size: 15px;
  font-weight: 600; font-family: var(--font-body); transition: transform .12s, box-shadow .18s, background .15s, color .15s, border-color .15s; }
.primary { background: linear-gradient(155deg, var(--accent-hi), var(--accent) 70%);
  color: var(--accent-ink); padding: 12px 20px; width: 100%;
  box-shadow: 0 8px 20px -8px rgba(240,168,64,.55); }
.primary:hover { transform: translateY(-1px); box-shadow: 0 12px 26px -8px rgba(240,168,64,.65); }
.primary:disabled { opacity: .55; transform: none; box-shadow: none; }
.ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--border); padding: 10px 16px; }
.ghost:hover { color: var(--text); border-color: #43352a; }
.warn { background: linear-gradient(155deg, #3a2416, #2c1a0f); color: var(--accent-2-hi);
  border: 1px solid #4a2e1c; padding: 11px 16px; width: 100%; margin-top: 10px; }
.warn:hover { border-color: var(--accent-2); }
.row-links { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.row { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }

.grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }

.north p { font-family: var(--font-display); font-size: 19px; line-height: 1.5; font-weight: 500; }
.pill { font-size: 11px; border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px;
  color: var(--text-dim); text-transform: none; letter-spacing: 0; font-weight: 600; }
.pill.active { color: var(--accent-hi); border-color: #3a2a12; background: rgba(240,168,64,.08); }
.pill.passed { color: var(--cool); border-color: var(--cool-dim); background: rgba(134,169,255,.08); }
.pill.locked { opacity: .55; }

.tasks { list-style: none; }
.tasks li { padding: 11px 4px; border-bottom: 1px solid var(--border-soft); }
.tasks li:last-child { border-bottom: none; }
.tasks label { display: flex; gap: 11px; align-items: flex-start; margin: 0; color: var(--text); font-size: 15px; }
.tasks input[type="checkbox"] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.tasks .meta { display: block; margin: 4px 0 0 29px; }
.tasks li.done span { text-decoration: line-through; color: var(--text-faint); }
.meta { font-size: 12.5px; color: var(--text-faint); }

.miles { list-style: none; }
.miles li { padding: 13px 4px; border-bottom: 1px solid var(--border-soft); }
.miles li:last-child { border-bottom: none; }
.miles li.locked { opacity: .5; }
.mrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.gatehint { margin-top: 3px; }
.card-title-row, .section-head { display: flex; align-items: center;
  justify-content: space-between; gap: 14px; }
.card-title-row .k { margin-bottom: 0; }
.share-btn { background: transparent; color: var(--accent); border: 1px solid #3a2a12;
  padding: 6px 11px; font-size: 12px; border-radius: 999px; }
.share-btn:hover { background: rgba(240,168,64,.08); }

.weekly-plan { list-style: none; display: grid; gap: 10px; }
.weekly-plan > li { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px;
  background: var(--ink-sunken); transition: border-color .15s; }
.weekly-plan > li:hover { border-color: #3a2e24; }
.weekly-plan > li.empty { color: var(--text-faint); }
.week-head { margin-bottom: 7px; color: var(--text); font-family: var(--font-display); font-size: 16px; }
.weekly-plan p { color: var(--text-dim); font-size: 13px; line-height: 1.5; }
.weekly-plan ul { margin: 8px 0 8px 19px; color: #cbbfb1; font-size: 13px; line-height: 1.5; }
.checkpoint { color: var(--accent-hi); font-size: 12.5px; margin-top: 6px; font-weight: 600; }
.mentor-insight { color: var(--accent-2-hi); font-size: 12.5px; margin-top: 5px; }

/* ---------- curriculum: roadmap content becomes a learning experience ---------- */
.curriculum-heading { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 13px; }
.curriculum-heading .k { margin-bottom: 5px; }
.curriculum-heading .dim { font-size: 13px; }
.curriculum-progress { height: 5px; overflow: hidden; border-radius: 999px;
  background: var(--ink-sunken); margin-bottom: 14px; }
.curriculum-progress span { display: block; width: 0; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--cool), var(--accent)); transition: width .35s ease; }
.curriculum-modules { list-style: none; display: grid; gap: 8px; }
.curriculum-module { position: relative; }
.curriculum-module button { width: 100%; display: grid;
  grid-template-columns: 5px 62px minmax(0, 1fr) auto 18px; align-items: center; gap: 11px;
  min-height: 76px; padding: 12px 13px; text-align: left; color: var(--text);
  background: var(--ink-sunken); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: none; }
.curriculum-module button:hover { border-color: #4a3b2f; transform: translateY(-1px);
  background: #17110e; }
.curriculum-module .module-rail { align-self: stretch; width: 5px; border-radius: 999px;
  background: var(--border); }
.curriculum-module.complete .module-rail { background: var(--cool); }
.curriculum-module.active .module-rail { background: var(--accent);
  box-shadow: 0 0 14px rgba(240,168,64,.42); }
.curriculum-module.active button { border-color: #58401c;
  background: linear-gradient(110deg, rgba(240,168,64,.11), var(--ink-sunken) 58%); }
.curriculum-module.locked button { opacity: .58; }
.module-week { color: var(--text-faint); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; font-weight: 700; }
.module-copy { min-width: 0; }
.module-copy b { display: block; font-family: var(--font-display); font-size: 16px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.module-copy small { display: block; color: var(--text-dim); font-size: 11.5px;
  line-height: 1.4; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.module-state, .module-status { border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 8px; color: var(--text-faint); font-size: 10.5px; font-weight: 700;
  white-space: nowrap; }
.complete .module-state, .module-status.complete { color: var(--cool);
  border-color: var(--cool-dim); background: rgba(134,169,255,.08); }
.active .module-state, .module-status.active { color: var(--accent-hi);
  border-color: #4a3517; background: rgba(240,168,64,.09); }
.module-status.upcoming { color: var(--text-dim); }
.module-status.locked { opacity: .65; }
.module-arrow { color: var(--text-faint); font-size: 17px; transition: transform .15s, color .15s; }
.curriculum-module button:hover .module-arrow { color: var(--accent); transform: translateX(2px); }
.curriculum-empty { padding: 16px; color: var(--text-faint); border: 1px dashed var(--border);
  border-radius: var(--radius-md); font-size: 13px; }

body.drawer-open { overflow: hidden; }
.curriculum-scrim { position: fixed; inset: 0; z-index: 18;
  background: rgba(7,5,4,.7); backdrop-filter: blur(3px); }
.curriculum-drawer { position: fixed; z-index: 19; top: 0; right: 0; bottom: 0;
  width: min(570px, 94vw); overflow-y: auto; padding: 24px 27px 36px;
  background: var(--ink-raised); border-left: 1px solid var(--border);
  box-shadow: -24px 0 70px rgba(0,0,0,.45); animation: drawerIn .22s ease-out both; }
@keyframes drawerIn { from { opacity: 0; transform: translateX(22px); }
  to { opacity: 1; transform: translateX(0); } }
.curriculum-drawer:focus { outline: none; }
.curriculum-drawer-top { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 24px; }
.curriculum-drawer-top .k { margin: 0; }
.drawer-close { width: 34px; height: 34px; border-radius: 50%; color: var(--text-dim);
  background: var(--ink-sunken); border: 1px solid var(--border); font-size: 22px;
  font-weight: 400; line-height: 1; }
.drawer-close:hover { color: var(--text); border-color: #4a3b2f; }
.drawer-status-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.drawer-week { color: var(--text-faint); font-size: 12px; }
.curriculum-drawer h2 { font-size: clamp(30px, 5vw, 42px); line-height: 1.08;
  margin-bottom: 13px; }
.drawer-lede { color: var(--text-dim); font-size: 15px; line-height: 1.65; }
.drawer-section { margin-top: 26px; }
.drawer-section .k, .evidence-card .k { margin-bottom: 12px; }
.objective-list { list-style: none; display: grid; gap: 9px; }
.objective-list li { position: relative; padding-left: 22px; color: #d8cdbf;
  font-size: 14px; line-height: 1.5; }
.objective-list li::before { content: "✓"; position: absolute; left: 0; top: 0;
  color: var(--cool); font-weight: 800; }
.lesson-list { list-style: none; display: grid; gap: 8px; }
.lesson-list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--ink-sunken); }
.lesson-number { flex: 0 0 28px; width: 28px; height: 28px; display: grid;
  place-items: center; border-radius: 50%; background: rgba(240,168,64,.11);
  color: var(--accent-hi); font-size: 11px; font-weight: 800; }
.lesson-list b { display: block; font-size: 13.5px; line-height: 1.45; }
.lesson-list small { display: block; color: var(--text-faint); text-transform: capitalize;
  margin-top: 3px; font-size: 10.5px; }
.lesson-list p { color: var(--text-dim); font-size: 12px; line-height: 1.5; margin-top: 6px; }
.resource-list { display: grid; gap: 8px; }
.resource-entry { min-width: 0; }
.resource-list a, .resource-hint { display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); background: var(--ink-sunken); text-decoration: none;
  font-size: 13px; line-height: 1.4; }
.resource-list a:hover { border-color: var(--accent); color: var(--accent-hi); }
.resource-list a span, .resource-hint span { flex: 0 0 auto; padding: 3px 6px;
  border-radius: 5px; background: rgba(134,169,255,.1); color: var(--cool);
  font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.drawer-empty { color: var(--text-faint); font-size: 13px; line-height: 1.5; }
.evidence-card { margin-top: 26px; padding: 17px; border: 1px solid #4a3517;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(240,168,64,.1), rgba(239,106,76,.05)); }
.evidence-card b { display: block; color: var(--accent-hi); font-size: 14px; line-height: 1.5; }
.evidence-card p { margin-top: 9px; color: var(--text-dim); font-size: 12.5px; line-height: 1.55; }
.curriculum-mentor-cta { margin-top: 20px; }

@media (max-width: 620px) {
  .curriculum-heading { flex-direction: column; }
  .curriculum-module button { grid-template-columns: 4px 54px minmax(0, 1fr) 16px; gap: 9px; }
  .module-state { grid-column: 3; justify-self: start; }
  .module-arrow { grid-column: 4; grid-row: 1 / span 2; }
  .curriculum-drawer { width: 100vw; padding: 20px 18px 30px; }
}

.section-head { margin-bottom: 20px; }
.compact { width: auto; }
.roadmap-list { display: grid; gap: 10px; }
.roadmap-item { width: 100%; display: flex; align-items: center; justify-content: space-between;
  text-align: left; background: var(--ink-raised); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 15px 17px; transition: border-color .15s, transform .12s; }
.roadmap-item.ready:hover { border-color: var(--accent-2); transform: translateY(-1px); }
.roadmap-item:not(.ready) { cursor: default; opacity: .68; }
.roadmap-item b, .roadmap-item em { display: block; }
.roadmap-item em { color: var(--text-faint); font-style: normal; font-size: 12px; margin-top: 3px;
  text-transform: capitalize; }
.shared-card { max-width: none; }

.gate { border-color: #3a2a12; background: linear-gradient(160deg, #241a0c, #1c1310); }
.gate p { margin-bottom: 12px; }

.chat { display: flex; flex-direction: column; height: 72vh; position: sticky; top: 84px; }
.chatlog { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: var(--radius-md); font-size: 14.5px; line-height: 1.5; }
.msg.mentor { background: var(--ink-panel); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.student { background: #26382a; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg em { display: block; font-size: 10.5px; color: var(--text-faint); font-style: normal; margin-top: 3px; }

/* ---------- voice: the front door ---------- */
.voice-cta { display: flex; flex-direction: column; align-items: center; gap: 13px; margin: 10px 0 22px;
  animation: fadeUp .6s .24s ease-out both; }
.voice-language { width: min(100%, 360px); margin: 0; color: var(--text-dim); }
.voice-language span { display: block; margin-bottom: 7px; font-size: 13px; text-align: center; }
.voice-language select { margin: 0; text-align: center; }
.mic-cta { position: relative; display: flex; align-items: center; gap: 16px; padding: 18px 27px;
  text-align: left; overflow: hidden;
  background: linear-gradient(135deg, #2e1c0b 0%, #3a2410 55%, #351f13 100%);
  border: 1px solid #4a3216; border-radius: var(--radius-lg); color: var(--text);
  box-shadow: 0 8px 30px -12px rgba(240,168,64,.35); transition: transform .15s, box-shadow .2s; }
.mic-cta::after { content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .3s;
  background: radial-gradient(140px 90px at 14% 50%, rgba(255,196,112,.28), transparent 70%); }
.mic-cta:hover { transform: translateY(-2px); box-shadow: 0 16px 38px -12px rgba(240,168,64,.5); }
.mic-cta:hover::after { opacity: 1; }
.mic-glyph { font-size: 30px; filter: drop-shadow(0 2px 6px rgba(240,168,64,.4)); }
.mic-copy b { display: block; font-family: var(--font-display); font-size: 18px; letter-spacing: -.01em;
  font-weight: 600; }
.mic-copy em { display: block; font-style: normal; font-size: 12.5px; color: #cbb89a; margin-top: 3px; }
.linky { background: none; color: var(--text-faint); font-size: 13px; font-weight: 500;
  text-decoration: underline; text-underline-offset: 3px; }
.linky:hover { color: var(--text-dim); }

.voice-stage { max-width: 620px; margin: 0 auto; display: flex; flex-direction: column;
  align-items: center; gap: 18px; padding-top: 18px; }
.orb { position: relative; width: 148px; height: 176px; }
.orb-core { position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center;
  font-size: 38px; background: radial-gradient(circle at 32% 28%, #2a201a, var(--ink-sunken) 72%);
  border: 1px solid var(--border); z-index: 2;
  transition: background .3s, border-color .3s, transform .3s, box-shadow .3s; }
.orb-ring { position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  width: 136px; height: 136px; border-radius: 50%; border: 2px solid transparent; }
.orb-bars { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: flex-end; justify-content: center; gap: 4px; height: 20px; z-index: 3;
  opacity: 0; transition: opacity .25s; }
.orb-bars span { width: 3px; height: 14px; border-radius: 3px; background: var(--accent);
  transform-origin: bottom center; animation: eq 1.1s ease-in-out infinite; opacity: .9;
  box-shadow: 0 0 6px currentColor; }
.orb-bars span:nth-child(1) { animation-delay: -0.9s; }
.orb-bars span:nth-child(2) { animation-delay: -0.6s; }
.orb-bars span:nth-child(3) { animation-delay: -1.1s; }
.orb-bars span:nth-child(4) { animation-delay: -0.3s; }
.orb-bars span:nth-child(5) { animation-delay: -0.75s; }
@keyframes eq { 0%, 100% { transform: scaleY(.4); } 50% { transform: scaleY(1.9); } }

.orb.listening .orb-core { background: radial-gradient(circle at 32% 28%, #2a1c10, var(--ink-sunken) 72%);
  border-color: var(--accent-2); transform: translateX(-50%) scale(1.05);
  box-shadow: 0 0 26px -4px rgba(239,106,76,.5); }
.orb.listening .orb-ring { border-color: var(--accent-2); animation: pulse 1.25s ease-out infinite; }
.orb.listening .orb-bars { opacity: 1; }
.orb.listening .orb-bars span { background: var(--accent-2-hi); }
.orb.speaking .orb-core { border-color: var(--accent); box-shadow: 0 0 26px -4px rgba(240,168,64,.5); }
.orb.speaking .orb-ring { border-color: var(--accent); animation: pulse 1.9s ease-out infinite; }
.orb.speaking .orb-bars { opacity: 1; }
.orb.thinking .orb-core { border-color: var(--cool); }
.orb.thinking .orb-ring { border-color: var(--cool); animation: spin 1.4s linear infinite;
  border-top-color: transparent; border-right-color: transparent; }
@keyframes pulse { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(1.4); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

.voice-status { font-size: 15px; color: var(--text-dim); min-height: 22px; text-align: center; font-weight: 500; }
.voice-level { width: 200px; height: 5px; border-radius: 999px; background: var(--ink-sunken);
  overflow: hidden; opacity: 0; transition: opacity .2s; border: 1px solid var(--border-soft); }
.voice-level.on { opacity: 1; }
.voice-level span { display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent-2), var(--accent-hi)); transition: width .08s linear; }

.voice-log { width: 100%; max-height: 42vh; overflow-y: auto; display: flex; flex-direction: column;
  gap: 9px; margin-top: 6px; padding: 4px; }
.plan-progress { width: 100%; padding: 17px 18px; border: 1px solid var(--cool-dim);
  border-radius: var(--radius-md); background: rgba(134,169,255,.06); }
.plan-progress-head { display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 13px; }
.plan-progress-track { height: 5px; overflow: hidden; border-radius: 999px;
  background: var(--ink-sunken); }
.plan-progress-track span { display: block; width: 38%; height: 100%;
  border-radius: inherit; background: linear-gradient(90deg, var(--cool), var(--accent-hi));
  animation: planProgress 1.5s ease-in-out infinite alternate; }
.plan-progress p { margin: 12px 0 5px; font-size: 14px; }
.plan-progress small { color: var(--text-faint); line-height: 1.45; }
.plan-preferences { margin: 15px 0 8px; padding: 13px; border: 1px solid var(--border);
  border-radius: var(--radius-md); background: rgba(255,255,255,.025); }
.plan-preferences > strong { display: block; margin-bottom: 10px; font-size: 13px; }
.plan-preference-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px; margin-bottom: 10px; }
.plan-preference-fields label { font-size: 12px; color: var(--text-dim); }
.plan-preference-fields select { width: 100%; margin-top: 4px; }
#preferenceSaved { margin-left: 8px; font-size: 12px; }
@keyframes planProgress {
  from { transform: translateX(-35%); }
  to { transform: translateX(200%); }
}
.vmsg { max-width: 86%; padding: 11px 15px; border-radius: var(--radius-md); font-size: 15px; line-height: 1.5; }
.vmsg.mentor { background: var(--ink-panel); align-self: flex-start; border-bottom-left-radius: 4px; }
.vmsg.student { background: #26382a; align-self: flex-end; border-bottom-right-radius: 4px; }
.voice-actions { display: flex; gap: 12px; align-items: center; }
.voice-hint { font-size: 12.5px; text-align: center; }

.msg .spk { background: transparent; color: var(--accent); font-size: 13px; padding: 2px 4px;
  margin-top: 2px; opacity: .6; transition: opacity .15s; }
.msg .spk:hover { opacity: 1; }
.chatrow { display: flex; gap: 8px; margin-top: 10px; }
.chatrow input { margin: 0; }
.chatrow button { width: auto; padding: 0 18px; }
.voice-text-row { width: 100%; }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 22px 0; }
@media (max-width: 700px) {
  .compare, .plan-preference-fields { grid-template-columns: 1fr; }
}
.cmp { background: var(--ink-raised); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; }
.cmp.intense { border-color: #3a2a12; }
.cmp .weeks { font-family: var(--font-display); font-size: 42px; font-weight: 600; margin: 6px 0 12px; }
.cmp.light .weeks { color: var(--accent-2-hi); }
.cmp.intense .weeks { color: var(--accent-hi); }
.cmp ol { list-style: none; }
.cmp li { padding: 7px 0; border-bottom: 1px solid var(--border-soft); font-size: 14.5px; color: var(--text-dim); }
.cmp li b { color: var(--text); margin-right: 8px; }
.comparison-notes { grid-column: 1 / -1; }
.comparison-notes p { color: var(--text-dim); margin: 9px 0; line-height: 1.5; }
.compare-target { max-width: 260px; margin-top: 18px; }

.modal { position: fixed; inset: 0; background: rgba(10,7,5,.78); backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 20; padding: 6vw; }
.modal-box { background: var(--ink-raised); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 27px; max-width: 520px; width: 100%; box-shadow: 0 30px 60px -20px rgba(0,0,0,.6); }
.modal-box h3 { font-family: var(--font-display); font-weight: 600; margin-bottom: 10px; font-size: 21px; }
.modal-box .primary { margin-top: 16px; }
.big { font-size: 17px; line-height: 1.55; }
.loading { color: var(--text-dim); text-align: center; padding: 30px 10px; }

/* ---------- catalog-backed onboarding ---------- */
.onboarding-card { max-width: 900px; padding: clamp(19px, 4vw, 34px); }
.form-intro { margin-bottom: 24px; }
.form-intro h2 { max-width: 680px; }
.form-intro .dim { max-width: 700px; }
.catalog-picker { padding: 17px; margin-bottom: 18px; border: 1px solid var(--border);
  border-radius: var(--radius-md); background: var(--ink-sunken); }
.catalog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.catalog-heading label { margin-bottom: 0; color: var(--text); font-weight: 700; }
.catalog-picker > label { margin: 14px 0 0; }
.inline-state { display: block; min-height: 20px; margin-top: 8px; color: var(--text-dim);
  font-size: 12px; line-height: 1.5; }
.inline-state.error, .page-state.error { color: var(--accent-2-hi); }
.track-browser { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  max-height: 340px; overflow-y: auto; margin-top: 12px; padding: 2px; }
.track-card { width: 100%; min-height: 84px; padding: 12px; text-align: left; color: var(--text);
  background: var(--ink-raised); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.track-card:hover { border-color: #514031; transform: translateY(-1px); }
.track-card[aria-pressed="true"] { border-color: var(--accent); background: rgba(240,168,64,.09);
  box-shadow: 0 0 0 2px rgba(240,168,64,.1); }
.track-card b { display: block; line-height: 1.35; }
.track-card span { display: block; margin-top: 6px; color: var(--text-faint); font-size: 11px;
  font-weight: 500; line-height: 1.35; }
.track-preview { margin-bottom: 18px; padding: 18px; border: 1px solid #4a3517;
  border-radius: var(--radius-md); background: linear-gradient(135deg, rgba(240,168,64,.1), rgba(134,169,255,.035)); }
.track-preview-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.track-preview h3 { font-family: var(--font-display); font-size: 24px; margin: 4px 0 8px; }
.track-metrics { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.track-metrics span { padding: 5px 9px; color: var(--text-dim); border: 1px solid var(--border);
  border-radius: 999px; font-size: 11px; }
.specialization-fields { margin-bottom: 18px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.domain-fieldset { margin: 2px 0 18px; padding: 15px; border: 1px solid var(--border);
  border-radius: var(--radius-md); }
.domain-fieldset legend { padding: 0 7px; color: var(--text-dim); font-size: 14px; }
.domain-fieldset:disabled { opacity: .62; }
.choice-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-chip { display: inline-flex; align-items: center; gap: 7px; width: auto; margin: 0;
  padding: 8px 10px; color: var(--text-dim); border: 1px solid var(--border);
  border-radius: 999px; background: var(--ink-sunken); cursor: pointer; }
.choice-chip:has(input:checked) { color: var(--accent-hi); border-color: #57401d;
  background: rgba(240,168,64,.09); }
.choice-chip input { width: 15px; height: 15px; margin: 0; }
.selection-summary { margin: 3px 0 12px; padding: 14px; color: var(--text-dim);
  border-radius: var(--radius-sm); background: rgba(255,255,255,.025); line-height: 1.55; }
.selection-summary strong { color: var(--text); }
.publication-caveat { margin: 0 0 14px; padding: 12px 14px; border-left: 3px solid var(--accent-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: rgba(239,106,76,.07);
  color: #dbc4b8; font-size: 12.5px; line-height: 1.55; }

/* ---------- evidence-first learner dashboard ---------- */
.page-state { padding: 30px 18px; text-align: center; color: var(--text-dim); }
#view-dash.dashboard-pending .grid { visibility: hidden; max-height: 1px; overflow: hidden; }
.identity-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.identity-card h1 { animation: none; font-size: clamp(27px, 4vw, 38px); }
.identity-card .pill { flex: 1 1 260px; max-width: 520px; white-space: normal;
  overflow-wrap: anywhere; line-height: 1.45; }
.progress-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-bottom: 14px; }
.stat-card { min-width: 0; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--ink-raised); }
.stat-card span, .stat-card small { display: block; color: var(--text-faint); font-size: 10.5px;
  line-height: 1.35; }
.stat-card strong { display: block; margin: 5px 0 3px; color: var(--accent-hi);
  font-family: var(--font-display); font-size: 22px; overflow-wrap: anywhere; }
.coach-card { border-color: #4a3517; background: linear-gradient(145deg, rgba(240,168,64,.1), var(--ink-raised) 60%); }
.coach-heading, .evidence-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.coach-heading h2, .evidence-heading h2 { font-size: 24px; }
.done-definition { margin-top: 14px; padding: 13px; border-radius: var(--radius-sm); background: var(--ink-sunken); }
.done-definition strong { color: var(--accent-hi); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.done-definition p { margin-top: 5px; color: #d8cdbf; line-height: 1.5; }
.commitment-form { margin-top: 16px; }
.commitment-form > label { margin-bottom: 0; }
.commitment-form .chatrow { align-items: stretch; }
.commitment-form .primary { min-width: 104px; }
.empty-state { padding: 13px 2px; color: var(--text-faint); font-size: 13px; line-height: 1.5; }
.evidence-form { margin-top: 15px; }
.evidence-history { list-style: none; display: grid; gap: 9px; margin-top: 13px; }
.evidence-item { padding: 13px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--ink-sunken); }
.evidence-item-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.evidence-item h3 { font-size: 14px; line-height: 1.4; }
.evidence-item p { margin-top: 7px; color: var(--text-dim); font-size: 12.5px; line-height: 1.5; }
.evidence-item a { display: inline-block; margin-top: 8px; color: var(--accent-hi); font-size: 12px; }
.evidence-feedback { margin-top: 9px; padding: 9px; border-left: 2px solid var(--cool);
  color: #c8d6ff; background: rgba(134,169,255,.055); font-size: 12px; line-height: 1.5; }
.opportunity-grid { display: grid; gap: 9px; }
.opportunity { padding: 13px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--ink-sunken); }
.opportunity-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.opportunity h3 { font-size: 14px; line-height: 1.4; }
.opportunity p { margin-top: 6px; color: var(--text-dim); font-size: 12px; line-height: 1.5; }
.opportunity ul { margin: 8px 0 0 18px; color: var(--text-dim); font-size: 12px; line-height: 1.5; }
.publication-note { margin-top: 10px; color: var(--accent-2-hi); font-size: 11.5px; line-height: 1.5; }
.provenance { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.provenance span { padding: 3px 7px; border-radius: 999px; border: 1px solid var(--border);
  color: var(--text-faint); font-size: 9.5px; }
.drawer-rubric { display: grid; gap: 7px; list-style: none; }
.drawer-rubric li { padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-dim); font-size: 12.5px; line-height: 1.5; background: var(--ink-sunken); }

@media (max-width: 860px) {
  .chat { position: static; top: auto; height: min(680px, 72vh); }
  .progress-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .track-browser, .field-grid { grid-template-columns: 1fr; }
  .track-browser { max-height: 430px; }
  .track-preview-head, .identity-card, .coach-heading, .evidence-heading,
  .section-head { flex-direction: column; align-items: stretch; }
  .identity-card .pill { max-width: none; }
  .voice-actions, .row { flex-wrap: wrap; justify-content: center; }
  .voice-actions button { min-height: 42px; }
  .module-copy b, .module-copy small { white-space: normal; overflow: visible; text-overflow: clip; }
  .curriculum-module button { min-height: 88px; }
  .commitment-form .chatrow, .chatrow { align-items: stretch; }
  .commitment-form .chatrow { flex-direction: column; }
  .commitment-form .primary { width: 100%; min-height: 44px; }
}

@media (max-width: 430px) {
  .top { padding: 12px 4vw; }
  .main-nav { overflow-x: auto; justify-content: flex-start; padding-bottom: 2px; }
  .main-nav button { flex: 0 0 auto; min-height: 40px; }
  .view { padding-left: 4vw; padding-right: 4vw; }
  .progress-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { padding: 11px; }
  .catalog-picker { padding: 13px; }
  .catalog-heading { align-items: flex-start; flex-direction: column; }
  .voice-text-row { flex-direction: column; }
  .voice-text-row button { width: 100%; min-height: 44px; }
}

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