:root {
  --ink: #162129;
  --muted: #64727b;
  --paper: #f3f6f5;
  --surface: #ffffff;
  --line: #dce4e1;
  --blue: #0c766f;
  --blue-dark: #075e59;
  --yellow: #f2a33a;
  --orange: #dc762f;
  --green: #18845e;
  --red: #c84c43;
  --rail: #13222b;
  --soft: #e8f3f1;
  --shadow: 0 12px 34px rgba(19, 34, 43, .08);
  --font-size: 16px;
  --rail-width: 232px;
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: var(--font-size);
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { color: inherit; }
a { color: var(--blue-dark); }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 65%, white);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 10000;
  background: var(--ink);
  color: white;
  padding: 10px 14px;
}
.skip-link:focus { top: 12px; }

.app-shell { min-height: 100vh; min-height: 100dvh; }

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: var(--rail-width);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  color: white;
  background: var(--rail);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: white;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  font-size: 1.15rem;
  font-weight: 850;
  color: white;
  background: var(--blue);
}
.brand b { display: block; font-size: .85rem; letter-spacing: .1em; }
.brand small { display: block; margin-top: 4px; font-size: .55rem; letter-spacing: .1em; opacity: .58; }

.primary-nav { display: grid; gap: 6px; margin-top: 44px; }
.nav-link {
  text-decoration: none;
  min-height: 46px;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.primary-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 13px;
  position: relative;
  padding: 0 13px;
  text-align: left;
  color: rgba(255,255,255,.72);
  border-radius: 10px;
}
.primary-nav .nav-link span { font: 700 .68rem/1 ui-monospace, "SFMono-Regular", monospace; color: rgba(255,255,255,.34); }
.primary-nav .nav-link:hover, .primary-nav .nav-link.active {
  color: white;
  background: rgba(12,118,111,.27);
}
.primary-nav .nav-link.active::before { content: ""; position: absolute; inset: 12px auto 12px 0; width: 3px; border-radius: 3px; background: #71d1c8; }

.rail-progress { margin-top: auto; padding: 18px 12px 0; border-top: 1px solid rgba(255,255,255,.18); }
.rail-progress > div:first-child { display: flex; justify-content: space-between; font-size: .76rem; }
.rail-progress strong { color: #71d1c8; font-variant-numeric: tabular-nums; }
.progress-track { height: 5px; margin: 10px 0 9px; overflow: hidden; background: rgba(255,255,255,.15); }
.progress-track i { display: block; width: 0; height: 100%; background: #51b9af; transition: width .25s ease; }
.rail-progress small { color: rgba(255,255,255,.6); }

main { margin-left: var(--rail-width); min-height: 100vh; min-height: 100dvh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 80px;
  padding: 14px clamp(24px, 4vw, 52px);
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.eyebrow { margin: 0 0 4px; font: 750 .65rem/1.2 ui-monospace, "SFMono-Regular", monospace; letter-spacing: .13em; color: var(--blue-dark); }
.topbar h1 { margin: 0; font-size: clamp(1.2rem, 2vw, 1.55rem); line-height: 1.15; font-weight: 720; letter-spacing: -.02em; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.text-button { min-height: 44px; border: 0; border-radius: 8px; padding: 10px; color: var(--blue-dark); background: transparent; cursor: pointer; }
.text-button:hover { background: var(--soft); }
.day-jump, .primary-button {
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid var(--blue);
  border-radius: 10px;
  color: white;
  background: var(--blue);
  font-weight: 750;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}
.day-jump:hover, .primary-button:hover { border-color: var(--blue-dark); background: var(--blue-dark); }

.view { display: none; padding: clamp(28px, 4vw, 48px); }
.view.active { display: block; }
.view > div { max-width: 1180px; margin: 0 auto; }

.day-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 0 0 28px;
  border-bottom: 1px solid var(--line);
}
.day-kicker { display: inline-flex; margin: 0 0 12px; padding: 6px 10px; border-radius: 999px; color: var(--blue-dark); background: var(--soft); font-size: .72rem; font-weight: 760; letter-spacing: .07em; text-transform: uppercase; }
.day-hero h2 { max-width: 820px; margin: 0; font-size: clamp(2rem, 3.7vw, 3rem); line-height: 1.08; font-weight: 760; letter-spacing: -.035em; }
.day-hero h2, .work-card h3, .section-intro h2, .flashcard-stage h2, .interview-workbench h2 { overflow-wrap: anywhere; }
.concept-line { margin: 16px 0 0; color: var(--muted); font-size: 1.05rem; }
.day-nav { display: flex; gap: 8px; }
.icon-button {
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}
.icon-button:hover:not(:disabled) { color: white; border-color: var(--blue); background: var(--blue); }
.icon-button:disabled { opacity: .28; cursor: not-allowed; }

.session-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr); gap: 24px; margin-top: 28px; }
.work-stack { display: grid; gap: 18px; }
.work-card {
  padding: clamp(22px, 3vw, 30px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(19,34,43,.03);
}
.work-card:first-child { box-shadow: var(--shadow); }
.card-index { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.card-index b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--blue-dark); background: var(--soft); font: 800 .7rem/1 ui-monospace, "SFMono-Regular", monospace; }
.card-index span { font-size: .72rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.work-card h3 { margin: 0 0 12px; font-size: clamp(1.3rem, 2.2vw, 1.75rem); line-height: 1.22; font-weight: 720; letter-spacing: -.02em; }
.work-card > p { color: var(--muted); line-height: 1.7; }

.answer-box {
  width: 100%;
  min-height: 150px;
  margin-top: 14px;
  padding: 16px;
  resize: vertical;
  color: var(--ink);
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 11px;
  line-height: 1.65;
}
.answer-box.small { min-height: 108px; }
.answer-box:focus-visible { border-color: var(--blue); outline: 3px solid color-mix(in srgb, var(--blue) 14%, transparent); }
.field-foot { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: 10px; }
.save-state { color: var(--muted); font-size: .75rem; }
.reveal-button, .secondary-button, .record-button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-weight: 750;
  cursor: pointer;
}
.reveal-button:hover, .secondary-button:hover, .record-button:hover { border-color: #b9cbc7; background: var(--soft); }
.study-note {
  display: none;
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 11px;
  background: var(--soft);
}
.study-note.visible { display: block; }
.study-note dl { display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; margin: 0; }
.study-note dt { font-weight: 800; }
.study-note dd { margin: 0; line-height: 1.55; }

.task-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.task-strip > div { padding-top: 14px; border-top: 1px solid var(--line); }
.task-strip small { display: block; margin-bottom: 6px; color: var(--blue-dark); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.task-strip p { margin: 0; line-height: 1.5; }

.speak-controls { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.timer { min-width: 82px; padding: 9px 12px; border-radius: 9px; text-align: center; font: 800 1.05rem/1.2 ui-monospace, monospace; background: var(--rail); color: white; }
.record-button.recording { color: white; background: var(--red); border-color: var(--red); }
.recording-result { margin-top: 12px; font-size: .86rem; }
.recording-result audio { width: 100%; max-width: 100%; }

.session-side { display: grid; align-content: start; gap: 18px; }
.score-panel { padding: 22px; border-radius: 14px; color: white; background: var(--rail); box-shadow: var(--shadow); }
.score-panel h3 { margin: 0 0 7px; font-size: 1.25rem; line-height: 1.2; font-weight: 720; }
.score-panel > p { margin: 0 0 16px; color: rgba(255,255,255,.66); font-size: .83rem; line-height: 1.55; }
.score-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.score-button { aspect-ratio: 1; border: 1px solid rgba(255,255,255,.24); border-radius: 8px; color: white; background: transparent; cursor: pointer; }
.score-button:hover, .score-button.active { color: var(--ink); background: var(--yellow); border-color: var(--yellow); }
.complete-button {
  width: 100%;
  min-height: 48px;
  margin-top: 15px;
  border: 0;
  border-radius: 9px;
  background: #50c2a5;
  color: #102a25;
  font-weight: 850;
  cursor: pointer;
}
.complete-button.done { color: white; background: var(--green); }
.rubric { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.7); }
.rubric h3 { margin: 0 0 12px; font-size: .82rem; letter-spacing: .09em; text-transform: uppercase; }
.rubric ol { margin: 0; padding-left: 20px; color: var(--muted); font-size: .82rem; line-height: 1.65; }
.source-note { padding: 16px 0; color: var(--muted); font-size: .78rem; border-top: 1px solid var(--line); }

.section-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .45fr); gap: 34px; align-items: end; margin-bottom: 34px; }
.section-intro h2 { margin: 0; font-size: clamp(1.85rem, 3.3vw, 2.8rem); line-height: 1.08; font-weight: 750; letter-spacing: -.035em; text-wrap: balance; }
.section-intro p { margin: 0; color: var(--muted); line-height: 1.65; }

.module-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.module-cell { min-height: 145px; padding: 20px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); cursor: pointer; transition: border-color .18s ease, box-shadow .18s ease; }
.module-cell { width: 100%; appearance: none; color: var(--ink); text-align: left; }
.module-cell:hover { border-color: #b7ccc7; box-shadow: 0 8px 24px rgba(19,34,43,.07); }
.module-title { display: block; margin: 9px 0 6px; font-size: 1.15rem; line-height: 1.2; font-weight: 720; }
.module-deliverable { display: block; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.module-cell .module-number { color: var(--blue-dark); font: 800 .7rem/1 ui-monospace, "SFMono-Regular", monospace; }
.module-meter { display: block; height: 4px; margin-top: 16px; background: #dfe4e5; }
.module-meter i { display: block; height: 100%; background: var(--blue); }

.roadmap-toolbar { display: flex; gap: 12px; justify-content: space-between; margin: 32px 0 14px; }
.filter-select { min-height: 44px; min-width: 230px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface); }
.roadmap-table { overflow: hidden; scroll-margin-top: 96px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.day-row {
  width: 100%;
  display: grid;
  grid-template-columns: 74px minmax(150px, .7fr) minmax(220px, 1.3fr) 100px 34px;
  gap: 16px;
  align-items: center;
  min-height: 68px;
  padding: 10px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  appearance: none;
  cursor: pointer;
  color: var(--ink);
  background: transparent;
  text-align: left;
}
.day-row:hover { background: var(--soft); }
.day-row .day-num { font: 800 1rem/1 ui-monospace, "SFMono-Regular", monospace; font-variant-numeric: tabular-nums; }
.day-row .module-name { color: var(--blue-dark); font-size: .75rem; font-weight: 800; }
.day-row .day-topic small { display: block; margin-top: 3px; color: var(--muted); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #c1c8ca; }
.status-dot.done { background: var(--green); }
.status-dot.started { background: var(--yellow); }
.score-label { color: var(--muted); font-size: .78rem; text-align: right; }

.review-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(270px, .55fr); gap: 32px; }
.flashcard-stage { min-height: 430px; padding: clamp(25px, 5vw, 52px); border-radius: 16px; background: var(--rail); color: white; position: relative; box-shadow: var(--shadow); }
.flashcard-stage::before { content: "ACTIVE RECALL"; position: absolute; top: 18px; right: 20px; font: 800 .62rem/1 ui-monospace, "SFMono-Regular", monospace; letter-spacing: .16em; color: rgba(255,255,255,.38); }
.flashcard-stage .card-count { color: var(--yellow); font-weight: 800; }
.flashcard-stage h2 { margin: 54px 0 10px; font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1; font-weight: 760; letter-spacing: -.04em; text-wrap: balance; }
.flashcard-stage .card-zh { font-size: 1.25rem; color: rgba(255,255,255,.7); }
.flashcard-answer { display: none; margin-top: 34px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.25); }
.flashcard-answer.visible { display: block; }
.flashcard-answer p { line-height: 1.6; }
.rating-row { display: none; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 22px; }
.rating-row.visible { display: grid; }
.rating-button { min-height: 48px; border: 1px solid rgba(255,255,255,.3); border-radius: 9px; background: transparent; color: white; cursor: pointer; }
.rating-button:hover { color: var(--ink); background: var(--yellow); border-color: var(--yellow); }
.flashcard-stage .secondary-button { color: var(--ink); }
.review-side { display: grid; align-content: start; gap: 18px; }
.stat-block { padding: 22px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.stat-block strong { display: block; font-size: 2.1rem; line-height: 1; font-weight: 780; font-variant-numeric: tabular-nums; }
.stat-block span { color: var(--muted); font-size: .8rem; }
.notebook-panel { padding: 22px; border: 1px solid #cde2dd; border-radius: 13px; background: var(--soft); }
.notebook-panel h3 { margin: 0 0 8px; font-size: 1.15rem; line-height: 1.2; font-weight: 720; }
.notebook-panel p { color: #365d58; font-size: .83rem; line-height: 1.55; }
.notebook-panel select { width: 100%; min-height: 42px; margin-bottom: 9px; border: 1px solid #b7ccc7; border-radius: 8px; color: var(--ink); background: white; }
.notebook-actions { display: grid; gap: 8px; }

.lab-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.lab-tab { min-height: 44px; padding: 0 17px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; font-weight: 700; }
.lab-tab.active { color: white; border-color: var(--blue); background: var(--blue); }
.lab-panel { display: none; }
.lab-panel.active { display: block; }
.model-grid { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(280px, .85fr); gap: 28px; }
.input-sheet, .result-sheet { padding: 26px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.input-sheet { box-shadow: var(--shadow); }
.input-sheet h3, .result-sheet h3 { margin: 0 0 18px; font-size: 1.3rem; line-height: 1.2; font-weight: 720; }
.model-field { display: grid; grid-template-columns: 1fr 150px; gap: 14px; align-items: center; padding: 9px 0; border-bottom: 1px solid #e2e3df; }
.model-field label { color: var(--muted); font-size: .85rem; }
.model-field input { min-height: 40px; width: 100%; padding: 0 9px; text-align: right; border: 1px solid var(--line); border-radius: 8px; background: #f8faf9; }
.result-line { display: flex; justify-content: space-between; gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.result-line strong { font-variant-numeric: tabular-nums; }
.result-line.hero-result { margin: 0 -26px; padding: 18px 26px; color: white; background: var(--blue); border: 0; }
.result-note { margin-top: 20px; color: var(--muted); font-size: .78rem; line-height: 1.55; }

.tool-list { display: grid; gap: 10px; }
.tool-row { display: grid; grid-template-columns: minmax(150px,.55fr) minmax(220px,1fr) 120px; gap: 22px; align-items: center; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.tool-row h3 { margin: 0 0 5px; font-size: 1.05rem; line-height: 1.2; font-weight: 720; }
.tool-row p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.tool-row a { font-weight: 800; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.tool-tag { display: inline-block; margin-bottom: 6px; color: var(--blue-dark); font-size: .68rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }

.packet-list { counter-reset: packet; display: grid; gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.packet-item { counter-increment: packet; display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; align-items: center; padding: 18px; border-bottom: 1px solid var(--line); }
.packet-item::before { content: counter(packet, decimal-leading-zero); font: 800 .74rem/1 ui-monospace, "SFMono-Regular", monospace; color: var(--blue-dark); }
.packet-item label { line-height: 1.5; }
.packet-item input { width: 22px; height: 22px; accent-color: var(--green); }

.interview-grid { display: grid; grid-template-columns: minmax(260px, .6fr) minmax(0, 1.3fr); gap: 28px; }
.question-list { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.question-button { width: 100%; min-height: 60px; padding: 12px 14px; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; }
.question-button small { display: block; color: var(--blue-dark); font-size: .67rem; font-weight: 800; text-transform: uppercase; }
.question-button.active, .question-button:hover { background: var(--soft); }
.interview-workbench { padding: clamp(24px, 4vw, 40px); border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.interview-workbench h2 { margin: 0 0 22px; font-size: clamp(1.7rem, 3.4vw, 2.75rem); line-height: 1.1; font-weight: 750; letter-spacing: -.035em; text-wrap: balance; }
.criteria-box { display: none; margin-top: 18px; padding: 18px; border-radius: 11px; background: var(--soft); line-height: 1.6; }
.criteria-box.visible { display: block; }
.evidence-intro { margin-top: 58px; }
.evidence-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.evidence-card { min-height: 190px; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.evidence-card span { color: var(--blue-dark); font: 800 .65rem/1 ui-monospace, "SFMono-Regular", monospace; letter-spacing: .12em; }
.evidence-card h3 { margin: 12px 0 15px; font-size: 1.15rem; line-height: 1.2; font-weight: 720; }
.evidence-card p { margin: 7px 0; color: var(--muted); font-size: .8rem; line-height: 1.55; }

.empty-state { padding: 50px 30px; text-align: center; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.empty-state h3 { font-size: 1.55rem; line-height: 1.2; font-weight: 720; }

.mobile-nav { display: none; }
.mobile-tweaks-toggle { display: none; }

#tweaks-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.55);
  color: white;
  background: var(--rail);
  font-size: .8rem;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(19,34,43,.22);
}
#tweaks-panel {
  position: fixed;
  right: 18px;
  bottom: 78px;
  z-index: 99;
  display: none;
  width: min(310px, calc(100vw - 36px));
  padding: 20px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  color: #e8edf2;
  background: var(--rail);
  box-shadow: 0 14px 40px rgba(0,0,0,.28);
}
#tweaks-panel.visible { display: block; }
#tweaks-panel h2 { margin: 0 0 18px; font-size: 1.05rem; line-height: 1; font-weight: 720; }
#tweaks-panel label { display: block; margin: 12px 0 7px; font-size: .8rem; }
#tweaks-panel input[type="range"] { width: 100%; }
#tweaks-panel .check-row { display: flex; gap: 8px; align-items: center; }
#tweaks-panel hr { margin: 18px 0; border: 0; border-top: 1px solid rgba(255,255,255,.18); }
#tweaks-panel p { margin: 14px 0 0; color: #9eaaba; font-size: .7rem; line-height: 1.45; }
.file-button, .danger-link { width: 100%; min-height: 44px; padding: 10px; border: 1px solid rgba(255,255,255,.3); border-radius: 9px; text-align: center; background: transparent; color: white; cursor: pointer; }
.file-button { position: relative; display: grid !important; place-items: center; }
.file-button:focus-within { outline: 3px solid #71d1c8; outline-offset: 3px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.danger-link { margin-top: 8px; color: #ffaaa3; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 200; opacity: 0; pointer-events: none; transform: translate(-50%, 16px); padding: 11px 16px; border-radius: 10px; color: white; background: var(--rail); transition: opacity .2s ease, transform .2s ease; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }

@media (max-width: 1100px) {
  :root { --rail-width: 210px; }
  .rail { padding-inline: 15px; }
  .brand small { display: none; }
  .session-grid, .review-layout { grid-template-columns: 1fr; }
  .session-side { grid-template-columns: 1fr 1fr; }
  .module-summary { grid-template-columns: repeat(2, 1fr); }
  .interview-grid { grid-template-columns: 1fr; }
  .evidence-grid { grid-template-columns: repeat(2, 1fr); }
  .question-list { display: flex; overflow-x: auto; }
  .question-list { overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: thin; }
  .question-button { min-width: 240px; border-right: 1px solid var(--line); scroll-snap-align: start; }
}

@media (max-width: 960px) {
  :root { --rail-width: 0px; }
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .rail { display: none; }
  main { margin-left: 0; }
  .topbar {
    min-height: 76px;
    padding: max(14px, env(safe-area-inset-top)) max(28px, env(safe-area-inset-right)) 14px max(28px, env(safe-area-inset-left));
  }
  .view {
    padding: clamp(28px, 4vw, 38px) max(28px, env(safe-area-inset-right)) 48px max(28px, env(safe-area-inset-left));
  }
  .day-row { grid-template-columns: 64px minmax(120px, .7fr) minmax(180px, 1.3fr) 76px 24px; gap: 10px; padding-inline: 12px; }
  .mobile-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(5, 1fr) 52px;
    min-height: calc(64px + env(safe-area-inset-bottom));
    padding: 0 max(8px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px, env(safe-area-inset-left));
    background: var(--rail);
    border-top: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 -10px 30px rgba(19,34,43,.14);
  }
  .mobile-nav .nav-link { position: relative; display: grid; place-items: center; min-height: 60px; color: rgba(255,255,255,.62); font-size: .78rem; }
  .mobile-nav .nav-link.active { color: #83d8d0; background: rgba(255,255,255,.05); }
  .mobile-nav .nav-link.active::before { content: ""; position: absolute; inset: 0 16px auto; height: 2px; border-radius: 0 0 2px 2px; background: #71d1c8; }
  #tweaks-toggle { display: none; }
  .mobile-tweaks-toggle {
    display: block;
    min-height: 60px;
    border: 0;
    color: rgba(255,255,255,.62);
    background: transparent;
    font-size: .78rem;
    font-weight: 850;
    cursor: pointer;
  }
  .mobile-tweaks-toggle { border-left: 1px solid rgba(255,255,255,.12); }
  .mobile-tweaks-toggle[aria-expanded="true"] { color: #83d8d0; background: rgba(255,255,255,.06); }
  #tweaks-panel {
    right: max(14px, env(safe-area-inset-right));
    bottom: calc(138px + env(safe-area-inset-bottom));
    max-height: calc(100dvh - 170px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}

@media (max-width: 680px) {
  .session-side, .model-grid { grid-template-columns: 1fr; }
  .tool-row { grid-template-columns: 1fr; gap: 10px; }
}

@media (max-width: 600px) {
  .topbar { min-height: 70px; padding: max(10px, env(safe-area-inset-top)) max(17px, env(safe-area-inset-right)) 10px max(17px, env(safe-area-inset-left)); }
  .topbar h1 { font-size: 1.18rem; }
  .top-actions .text-button { display: none; }
  .day-jump { padding: 0 11px; font-size: .76rem; }
  .view { padding: 22px max(17px, env(safe-area-inset-right)) 34px max(17px, env(safe-area-inset-left)); }
  .day-hero { grid-template-columns: 1fr; gap: 20px; }
  .day-hero h2 { font-size: clamp(1.85rem, 8.5vw, 2.25rem); }
  .session-grid { margin-top: 22px; gap: 22px; }
  .work-stack { gap: 16px; }
  .work-card { padding: 21px 18px; }
  .task-strip, .session-side, .model-grid { grid-template-columns: 1fr; }
  .study-note dl { grid-template-columns: 1fr; gap: 2px; }
  .study-note dd { margin-bottom: 10px; }
  .section-intro { grid-template-columns: 1fr; gap: 14px; }
  .module-summary { grid-template-columns: 1fr; }
  .roadmap-toolbar { align-items: stretch; flex-direction: column; }
  .filter-select { width: 100%; min-width: 0; }
  .day-row { grid-template-columns: 52px minmax(0,1fr) 20px; gap: 8px; }
  .day-row .module-name, .day-row .score-label { display: none; }
  .flashcard-stage { min-height: 440px; padding: 28px 22px; }
  .flashcard-stage::before { display: none; }
  .score-row { grid-template-columns: repeat(3, 1fr); }
  .rating-row { grid-template-columns: 1fr 1fr; }
  .model-field { grid-template-columns: 1fr 112px; }
  .tool-row { grid-template-columns: 1fr; gap: 10px; }
  .evidence-grid { grid-template-columns: 1fr; }
  .packet-item { grid-template-columns: 32px 1fr auto; padding-inline: 12px; }
  .question-button { min-width: min(82vw, 280px); }
  .answer-box, .model-field input, .filter-select, .notebook-panel select { font-size: 16px; }
  .mobile-nav .nav-link { font-size: .72rem; }
  .mobile-tweaks-toggle { font-size: .68rem; }
}

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

@media (hover: none) and (pointer: coarse) {
  .reveal-button, .secondary-button, .record-button, .lab-tab, .filter-select, .model-field input { min-height: 44px; }
  .score-button { min-width: 44px; min-height: 44px; }
}

@media (max-width: 960px) and (orientation: landscape) and (max-height: 520px) {
  body { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  .topbar { position: relative; min-height: 72px; }
  .mobile-nav { min-height: calc(56px + env(safe-area-inset-bottom)); }
  .mobile-nav .nav-link { min-height: 52px; }
  .mobile-tweaks-toggle { min-height: 52px; }
  #tweaks-panel { bottom: calc(124px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(70px + env(safe-area-inset-bottom)); }
}

@media print {
  .rail, .topbar, .mobile-nav, #tweaks-toggle, #tweaks-panel { display: none !important; }
  main { margin: 0; }
  .view { display: none !important; padding: 0; }
  .view.active { display: block !important; }
  body { background: white; }
}
