:root {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  color: #253044;
  background: #f7f8fa;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  line-height: 1.5;
}
button,
input,
select {
  font: inherit;
}
button,
a {
  cursor: pointer;
}
button {
  border: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #d6954b;
  outline-offset: 3px;
}
.shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background: #fff;
  border-right: 1px solid #e7eaf0;
  padding: 25px 15px;
}
.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 0 10px;
  margin-bottom: 30px;
  font-weight: 850;
  letter-spacing: 0.16em;
  font-size: 0.875rem;
  line-height: 1.1;
}
.brand small {
  display: block;
  font-size: 0.625rem;
  color: #8a899b;
  letter-spacing: 0.2em;
  margin-top: 4px;
}
.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #193e44;
  color: white;
  width: 39px;
  height: 39px;
  font-size: 1.2rem;
  letter-spacing: 0;
}
.brand-mark span {
  position: absolute;
  right: 4px;
  top: 1px;
  color: #f4b87a;
  font-size: 0.7rem;
}
.nav-label,
.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  font-weight: 800;
  color: #747e8c;
}
.nav-label {
  display: block;
  margin: 20px 12px 6px;
}
.nav-link {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 0.875rem;
  color: #5d6879;
  font-weight: 650;
}
.nav-link.active {
  background: #ece9f9;
  color: #6251a7;
}
.nav-link span {
  width: 18px;
  text-align: center;
}
.topbar {
  height: 65px;
  border-bottom: 1px solid #e8ebef;
  padding: 0 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 750;
  color: #667080;
}
#app {
  max-width: 1350px;
  margin: auto;
  padding: 32px 5% 70px;
}
#mobile-nav {
  display: none;
}
.warning,
.notice {
  border-radius: 10px;
  padding: 13px 15px;
  background: #fff3df;
  color: #6f5332;
  font-size: 0.875rem;
}
.warning {
  margin: 18px 5% 0;
}
.muted {
  color: #667080;
  line-height: 1.55;
}
.page-head {
  margin-bottom: 22px;
}
.page-head h1 {
  font-size: 2rem;
  letter-spacing: -0.045em;
  margin: 4px 0;
}
.page-head p {
  margin: 0;
}
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 28px 0 14px;
}
.section-title h2 {
  font-size: 1.15rem;
  margin: 0;
}
.card {
  background: white;
  border: 1px solid #e8ebf0;
  border-radius: 15px;
  overflow: hidden;
}
.panel {
  padding: 20px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}
.two-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}
.strip {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 20px;
}
.strip > div {
  padding: 14px 20px;
  border-right: 1px solid #edf0f2;
}
.strip > div:last-child {
  border: 0;
}
.strip b {
  display: block;
  font-size: 1.15rem;
}
.strip span {
  font-size: 0.8rem;
  color: #667080;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  padding: 10px 15px;
  background: #7562c8;
  color: white;
  border-radius: 9px;
  font-size: 0.875rem;
  font-weight: 750;
}
.button:hover {
  background: #6351b4;
}
.button.secondary {
  background: #edebf8;
  color: #5d4f9c;
}
.button.ghost {
  background: white;
  border: 1px solid #dedfe8;
  color: #4d5969;
}
.button.small {
  min-height: 38px;
  padding: 8px 12px;
}
.button:disabled {
  opacity: 0.55;
  cursor: default;
}
.actions,
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tabs {
  margin: 0 0 18px;
}
.tab {
  display: inline-block;
  background: #fff;
  border: 1px solid #e3e5ec;
  color: #5f6877;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 700;
}
.tab.active {
  background: #eae7f7;
  color: #5e50a2;
  border-color: #d7d1ed;
}
.hero {
  position: relative;
  background: #183d43;
  color: white;
  min-height: 210px;
  display: flex;
  align-items: center;
}
.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #163c43 0%, #163c43d9 50%, #163c4320 100%);
}
.hero-copy {
  position: relative;
  z-index: 1;
  padding: 28px;
  max-width: 580px;
}
.hero-copy h2 {
  font-size: 1.7rem;
  letter-spacing: -0.035em;
  margin: 6px 0;
}
.hero-copy p {
  color: #e4ece8;
}
.hero-copy .eyebrow {
  color: #c8e0d7;
}
.tile img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}
.tile-body {
  padding: 17px;
}
.tile h3 {
  margin: 5px 0;
  font-size: 1.05rem;
}
.tile p {
  margin: 4px 0 12px;
  color: #667080;
  font-size: 0.875rem;
  line-height: 1.5;
}
.tile .text-link {
  font-size: 0.875rem;
}
.text-link {
  color: #6856b3;
  font-weight: 750;
}
.progress-track {
  height: 7px;
  border-radius: 8px;
  background: #eeedf4;
  overflow: hidden;
  margin: 10px 0;
}
.progress-track span {
  display: block;
  height: 100%;
  background: #8e7ad1;
}
.station-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 15px;
}
.stamp {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f4eee6;
  color: #ad7849;
  font-weight: 800;
}
.stamp.done {
  background: #dfeee6;
  color: #397458;
}
.station-row h3 {
  font-size: 1rem;
  margin: 0;
}
.station-row p {
  font-size: 0.85rem;
  color: #667080;
  margin: 3px 0;
}
.stack {
  display: grid;
  gap: 10px;
}
.field {
  display: grid;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 700;
  color: #4b5667;
  margin: 14px 0;
}
.field input,
.field select {
  width: 100%;
  padding: 10px;
  border: 1px solid #d7dce4;
  border-radius: 9px;
  background: white;
  min-height: 44px;
}
.filters {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.filters .field {
  margin: 0;
  min-width: 170px;
}
.filters input {
  max-width: 280px;
}
.detail {
  max-width: 850px;
}
.detail-image {
  display: block;
  width: 100%;
  height: 210px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 20px;
}
.detail p {
  line-height: 1.65;
}
.word-list {
  display: grid;
  gap: 10px;
}
.word {
  padding: 17px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}
.word h3 {
  margin: 0;
}
.word p {
  margin: 5px 0;
  color: #667080;
}
.choices {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}
.choice {
  background: #f9f9fc;
  border: 1px solid #dfe3ea;
  border-radius: 10px;
  padding: 13px;
  text-align: left;
  color: #29364a;
}
.choice.selected {
  border-color: #8d7acb;
  background: #efecfa;
}
.choice:disabled {
  opacity: 0.7;
}
.feedback {
  min-height: 1.5em;
  color: #5d4f9c;
  font-weight: 700;
}
.reader {
  white-space: pre-wrap;
  line-height: 1.8;
}
.dialogue-line {
  padding: 12px 0;
  border-bottom: 1px solid #edf0f2;
}
.dialogue-line strong {
  display: inline-block;
  min-width: 90px;
}
.empty {
  padding: 24px;
  border: 1px dashed #d7dce4;
  border-radius: 12px;
  color: #667080;
}
.danger {
  background: none;
  color: #954e54;
  text-decoration: underline;
  padding: 10px 0;
}
dialog {
  border: 0;
  border-radius: 18px;
  box-shadow: 0 20px 80px #101b2c66;
  padding: 0;
  width: min(680px, calc(100% - 30px));
  max-height: 90vh;
  color: #253044;
}
dialog::backdrop {
  background: #101a29a8;
}
.modal {
  padding: 26px;
}
.modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f1f1f6;
  font-size: 1.4rem;
  color: #596576;
}
#toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10;
  background: #273747;
  color: white;
  border-radius: 10px;
  padding: 12px 16px;
  opacity: 0;
  pointer-events: none;
}
#toast.show {
  opacity: 1;
}
@media (max-width: 950px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 700px), (max-width: 950px) and (max-height: 500px) {
  .shell {
    display: block;
    padding-bottom: 80px;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 15px 20px;
    border: 0;
  }
  .brand {
    margin: 0;
  }
  .sidebar nav {
    display: none;
  }
  .topbar {
    height: 48px;
    padding: 0 20px;
  }
  #app {
    padding: 25px 18px 45px;
  }
  #mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 6;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: #fff;
    border-top: 1px solid #e6e9ee;
    padding: 5px 3px max(5px, env(safe-area-inset-bottom));
  }
  .mobile-link {
    display: grid;
    justify-items: center;
    align-content: center;
    min-height: 52px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #626d7c;
  }
  .mobile-link span {
    font-size: 1.15rem;
  }
  .mobile-link.active {
    color: #6857b6;
  }
  .grid,
  .two-grid {
    grid-template-columns: 1fr;
  }
  .hero {
    min-height: 220px;
  }
  .hero-copy {
    padding: 22px;
  }
  .hero-copy h2 {
    font-size: 1.45rem;
  }
  .strip > div {
    padding: 12px;
  }
  .station-row {
    grid-template-columns: 38px 1fr;
  }
  .station-row .button {
    grid-column: 2;
    justify-self: start;
  }
  .detail-image {
    height: 150px;
  }
  .filters .field {
    flex: 1;
    min-width: 140px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

.field textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  padding: 12px;
  border: 1px solid #cbd1dc;
  border-radius: 10px;
  font: inherit;
  background: white;
  color: #202d35;
}
/* Focused study flows */
.daily-lead {
  background: #183f45;
  color: #fff;
  border-color: #183f45;
}
.daily-lead .eyebrow,
.daily-lead .muted {
  color: #d1e5de;
}
.daily-lead h2 {
  font-size: 1.7rem;
  margin: 0.5rem 0;
}
.routine {
  display: block;
  min-height: 150px;
}
.routine h3 {
  margin: 0.5rem 0;
}
.review-card {
  min-height: 300px;
}
.review-card h2 {
  font-size: 1.45rem;
}
.review-answer {
  margin: 1.4rem 0;
  padding: 1rem;
  border-radius: 12px;
  background: #f1eefb;
}
.review-answer h3 {
  font-size: 1.6rem;
  margin: 0;
}
.check {
  display: block;
  margin: 0.6rem 0;
  font-size: 0.875rem;
}
.check input {
  width: 1.1rem;
  height: 1.1rem;
  vertical-align: middle;
}
fieldset {
  border: 1px solid #e4e6ed;
  border-radius: 10px;
  margin: 0;
  padding: 12px;
}
legend {
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0 5px;
}
.forecast {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  margin-top: 12px;
}
.forecast span {
  text-align: center;
  background: #f5f5fa;
  border-radius: 7px;
  padding: 6px 2px;
}
.forecast b,
.forecast small {
  display: block;
  font-size: 0.72rem;
}
.forecast small {
  color: #657080;
}
.heatmap {
  display: grid;
  grid-template-columns: repeat(14, minmax(12px, 1fr));
  gap: 5px;
  max-width: 530px;
}
.heatmap span {
  display: block;
  aspect-ratio: 1;
  border-radius: 4px;
  background: #ebeef1;
}
.heatmap .active {
  background: #b8d6c6;
}
.heatmap .goal-met {
  background: #43866b;
}
.reading-segment {
  border-bottom: 1px solid #edf0f2;
  padding: 10px 0 16px;
}
.reading-segment .reader {
  margin: 5px 0 12px;
}
.answer-review {
  border-top: 1px solid #e8ebf0;
  padding: 12px 0;
}
.answer-review h3 {
  font-size: 1rem;
}
.field textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #d7dce4;
  border-radius: 9px;
}
@media (max-width: 700px), (max-width: 950px) and (max-height: 500px) {
  .strip {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
  .strip > div {
    border-bottom: 1px solid #edf0f2;
  }
  .heatmap {
    grid-template-columns: repeat(7, minmax(12px, 1fr));
  }
  .routine {
    min-height: 0;
  }
  .forecast {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}
.sentence-text {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: inherit;
  font-size: 1rem;
  padding: 8px 4px;
}
.sentence-text:hover {
  background: #f2f0fa;
}
.reading-segment.is-speaking {
  background: #f0edfb;
  border-radius: 10px;
  box-shadow: inset 3px 0 #806dc6;
  padding-left: 12px;
}

/* Compact course directory and continuous reader */
.learn-directory { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.learn-directory section { background: #fff; border: 1px solid #e6e9ee; border-radius: 12px; padding: 12px; }
.learn-directory h2 { font-size: .85rem; margin: 0 0 6px; }
.learn-directory a { display: flex; align-items: center; min-height: 36px; color: #51428e; font-weight: 600; font-size: .85rem; }
.reading-paragraph { line-height: 1.9; }
.inline-segment { display: inline; border: 0; padding: 0; }
.inline-segment .sentence-text { display: inline; width: auto; padding: 2px 0; line-height: inherit; }
.inline-segment.is-speaking { padding: 0; box-shadow: none; background: #e5defa; }
.heatmap { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.heatmap span { display: grid; place-items: center; font-size: .75rem; color: #253044; }
.heatmap .goal-met { color: white; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 700px), (max-width: 950px) and (max-height: 500px) {
  .shell { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .mobile-link { font-size: .75rem; }
  .learn-directory { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .learn-directory a, .button, .tab, .close, select, input, summary { min-height: 44px; }
  .reading-toolbar { gap: 6px; }
  .reading-toolbar .button { padding: 8px 10px; }
  dialog { max-height: calc(100dvh - 16px); width: min(680px, calc(100% - 16px)); }
  .modal { padding: 16px; }
  #toast { bottom: calc(75px + env(safe-area-inset-bottom)); }
}
@media (max-width: 350px) {
  #app { padding-left: 12px; padding-right: 12px; }
  .learn-directory { gap: 8px; }
  .learn-directory section { padding: 9px; }
}
.review-mistakes { margin-top: 16px; }
.nav-badge { display: inline-grid; place-items: center; min-width: 1.2em; border-radius: 1em; background: #6857b6; color: #fff; font-size: .7rem !important; }
.inline-glossary { display: inline; padding: 2px 0; border: 0; background: transparent; color: #51428e; text-decoration: underline dotted; font: inherit; }
.speech-transport { margin: 8px 0; }
.back-link { display: inline-flex; align-items: center; min-height: 44px; }
.dialogue-line.current-turn { background: #f0edfb; border-radius: 8px; box-shadow: inset 3px 0 #806dc6; }
.inline-sentence { display: inline; margin: 0; padding: 0; font: inherit; line-height: inherit; cursor: pointer; }
.inline-sentence:hover { background: #f2f0fa; }
.inline-sentence:focus-visible { outline: 2px solid #6857b6; outline-offset: 2px; }

/* A calm, consistent learning space */
:root { --ink:#202f3c; --sub:#647582; --canvas:#f3f6f5; --surface:#fff; --line:#e0e8e5; --accent:#2b7169; --accent-soft:#e3f1ec; --lavender:#7464ba; --shadow:0 8px 30px rgba(30,61,57,.055); color:var(--ink); background:var(--canvas); }
body { background:var(--canvas); color:var(--ink); }
.sidebar,.topbar,#mobile-nav { background:var(--surface); border-color:var(--line); }
.sidebar { padding-top:28px; }
.brand-mark { background:linear-gradient(145deg,#1d5551,#143b40); box-shadow:0 5px 12px #183e3326; }
.nav-link { color:var(--sub); align-items:center; min-height:42px; }
.nav-link:hover { background:var(--accent-soft); }
.nav-link.active { background:var(--accent-soft); color:#24685f; }
.nav-icon,.nav-glyph { width:20px; height:20px; flex:0 0 20px; }
.nav-glyph { display:grid; place-items:center; font-size:1rem; }
.topbar { color:var(--sub); }
.topbar-title { display:flex; align-items:center; gap:10px; color:var(--ink); }
.top-back { display:none; }
#top-streak { font-size:.78rem; color:var(--accent); }
#app { max-width:1280px; }
.card,.band-panel { background:var(--surface); border:1px solid var(--line); box-shadow:var(--shadow); border-radius:16px; }
.panel { padding:22px; }
.muted,.tile p,.station-row p,.word p { color:var(--sub); }
.eyebrow,.nav-label { color:#71847f; letter-spacing:.12em; }
.page-head h1 { color:var(--ink); font-size:clamp(1.85rem,3vw,2.45rem); letter-spacing:-.045em; }
.section-title h2 { font-size:1.25rem; letter-spacing:-.025em; }
.section-title a,.text-link { color:var(--accent); }
.button { background:var(--accent); border-radius:10px; gap:8px; }
.button:hover { background:#215e58; }
.button.secondary { background:var(--accent-soft); color:#286c62; }
.button.ghost,.tab { background:var(--surface); border-color:var(--line); color:var(--sub); }
.tab.active { color:#286c62; background:var(--accent-soft); border-color:#cce6da; }
.field { color:var(--sub); }
.field input,.field select,.field textarea { color:var(--ink); background:var(--surface); border-color:var(--line); }
.tile { transition:transform .2s ease,box-shadow .2s ease; }
.tile:hover { transform:translateY(-2px); box-shadow:0 12px 35px #173e2d12; }
.tile img { height:156px; }
.tile-body { padding:18px 20px 20px; }
.tile h3 { color:var(--ink); }
.tile .eyebrow { font-size:.65rem; }
.home-hero { position:relative; min-height:360px; display:flex; align-items:end; overflow:hidden; border-radius:20px; background:#163e41; isolation:isolate; }
.home-hero img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:-2; }
.home-hero:after { content:""; position:absolute; inset:0; z-index:-1; background:linear-gradient(90deg,rgba(10,29,36,.76),rgba(10,29,36,.36) 48%,transparent 80%),linear-gradient(0deg,rgba(10,29,36,.45),transparent 75%); }
.home-hero-copy { padding:38px 42px; color:#fff; max-width:650px; }
.hero-kicker { display:block; font-size:.68rem; font-weight:800; letter-spacing:.14em; text-transform:uppercase; color:#d6e9de; }
.home-hero h1 { font-size:clamp(2.2rem,4.1vw,3.65rem); line-height:1.03; letter-spacing:-.055em; margin:12px 0; }
.home-hero p { color:#e1ece7; margin:0 0 22px; }
.hero-button { background:#fff; color:#174a44; }
.hero-button:hover { background:#e2f4eb; color:#174a44; }
.today-strip { display:grid; grid-template-columns:repeat(3,1fr); background:var(--surface); border:1px solid var(--line); border-radius:15px; box-shadow:var(--shadow); margin-top:14px; padding:13px 6px; }
.today-strip>div { display:grid; grid-template-columns:auto auto; align-content:center; justify-content:center; column-gap:9px; border-right:1px solid var(--line); }
.today-strip>div:last-child { border:0; }
.today-strip b { font-size:1.08rem; line-height:1.1; }
.today-strip div>span:last-child { grid-column:2; color:var(--sub); font-size:.73rem; }
.today-icon { grid-row:span 2; align-self:center; color:#ba8656; font-size:1.2rem; }
.home-section-title { margin-top:31px; }
.home-section-title .eyebrow { font-size:.66rem; }
.home-section-title h2 { margin:3px 0 0; }
.home-explore { grid-template-columns:repeat(4,minmax(0,1fr)); }
.today-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.today-grid .panel { display:flex; flex-direction:column; align-items:start; min-height:188px; }
.today-grid h2 { font-size:1.3rem; letter-spacing:-.03em; margin:9px 0 2px; }
.today-grid p { margin:0 0 18px; }
.today-grid .button { margin-top:auto; }
.daily-lead { background:#183f40; border-color:#183f40; color:white; }
.daily-lead .button { background:#bde5d4; color:#163f3a; }
.daily-lead .button:hover { background:#d9f3e6; }
.daily-lead .muted,.daily-lead .eyebrow { color:#d1e8dc; }
.band-panel { margin-top:14px; padding:18px 22px; display:flex; align-items:center; justify-content:space-between; gap:20px; }
.band-panel h2 { font-size:1.15rem; margin:4px 0; }.band-panel h2 span { font-size:.8rem; font-weight:600; color:var(--sub); }
.band-panel p { font-size:.83rem; margin:0; }.band-panel .field { min-width:145px; margin:0; }
.learn-directory section { background:var(--surface); border-color:var(--line); box-shadow:var(--shadow); }
.learn-directory a { color:var(--accent); }
.station-row { border-radius:15px; padding:18px; }
.stamp { background:#e5f3ec; color:#2d7561; }
.progress-track { background:#e9eeeb; }.progress-track span { background:#65ab91; }
.choice { background:var(--canvas); border-color:var(--line); color:var(--ink); }.choice.selected { background:var(--accent-soft); border-color:var(--accent); }
.review-answer { background:var(--accent-soft); }.feedback { color:var(--accent); }
.dialogue-line,.reading-segment,.answer-review { border-color:var(--line); }
.forecast span { background:var(--canvas); }.forecast small { color:var(--sub); }
.heatmap span { background:#e5ece8; }.heatmap .active { background:#b1d6c4; }.heatmap .goal-met { background:#388069; }
.empty { border-color:var(--line); color:var(--sub); }
dialog { background:var(--surface); color:var(--ink); }
.close { background:var(--canvas); color:var(--sub); }
.backup-status:not(:empty) { padding:12px 14px; background:var(--accent-soft); color:var(--ink); border-radius:10px; }
.inline-glossary { color:var(--accent); }
html[data-theme="dark"] { --ink:#edf4f2; --sub:#adbdba; --canvas:#0d171a; --surface:#162428; --line:#293b3c; --accent:#9ad6c0; --accent-soft:#243d39; --shadow:0 8px 30px #0002; color-scheme:dark; }
html[data-theme="dark"] .nav-link.active,html[data-theme="dark"] .button.secondary,html[data-theme="dark"] .tab.active { color:#b3e4cf; }
html[data-theme="dark"] .button:not(.secondary):not(.ghost) { color:#12352d; }
html[data-theme="dark"] .daily-lead { background:#1c4b46; border-color:#2b5a53; color:#f1fbf5; }
html[data-theme="dark"] .home-hero h1,html[data-theme="dark"] .home-hero p { color:#fff; }
html[data-theme="dark"] .hero-button { background:#e8f6ee!important; color:#174a44!important; }
html[data-theme="dark"] .heatmap span { background:#334444; color:#d1dcd8; }
html[data-theme="dark"] .heatmap .goal-met { background:#478f77; color:#fff; }
html[data-theme="dark"] .notice,html[data-theme="dark"] .warning { background:#4a3d27; color:#f8e1b7; }
html[data-theme="dark"] .choice.selected,html[data-theme="dark"] .current-turn { background:#243e3b; }
html[data-theme="dark"] .reading-segment.is-speaking,html[data-theme="dark"] .inline-segment.is-speaking { background:#31554c; }
@media (max-width:700px), (max-width:950px) and (max-height:500px) {
  .sidebar { padding:10px 16px; }.brand { font-size:.73rem; }.brand-mark { width:34px; height:34px; border-radius:10px; }
  .topbar { position:sticky; top:0; z-index:5; height:45px; padding:0 17px; box-shadow:0 2px 12px #233b3009; }
  .top-back:not([hidden]) { display:grid; place-items:center; color:var(--accent); font-size:1.75rem; line-height:1; width:28px; height:40px; }
  #app { padding:18px 15px 45px; }
  .home-hero { min-height:190px; border-radius:16px; }
  .home-hero img { object-position:67% center; }
  .home-hero:after { background:linear-gradient(0deg,rgba(9,27,34,.92),rgba(9,27,34,.5) 60%,rgba(9,27,34,.04)); }
  .home-hero-copy { padding:25px 22px; }.home-hero h1 { font-size:2.13rem; }.home-hero p { font-size:.88rem; margin-bottom:16px; }
  .home-hero p { display:none; }
  .today-strip { margin-top:10px; padding:12px 0; }.today-strip>div { gap:5px; }.today-strip b { font-size:1rem; }.today-strip div>span:last-child { font-size:.68rem; }.today-icon { font-size:.98rem; }
  .home-section-title { margin-top:24px; }.home-section-title .muted { font-size:.75rem; }
  .today-grid { grid-template-columns:1fr 1fr; gap:9px; }.today-grid .panel { padding:16px 14px; min-height:185px; }.today-grid h2 { font-size:1.12rem; }.today-grid p { font-size:.8rem; }.today-grid .button { font-size:.78rem; padding:9px 11px; }
  .band-panel { padding:16px; }.band-panel .field { min-width:105px; }.band-panel p { font-size:.75rem; }
  .home-explore { grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }.home-explore .tile img { height:90px; }.home-explore .tile-body { padding:12px; }.home-explore .tile h3 { font-size:.94rem; }.home-explore .tile p { font-size:.76rem; }
  #mobile-nav { background:var(--surface); border-color:var(--line); box-shadow:0 -5px 20px #112e260d; }
  .mobile-link { position:relative; color:var(--sub); min-height:52px; font-size:.72rem; gap:2px; }.mobile-link.active { color:var(--accent); }.mobile-link .nav-icon { width:20px; height:20px; }
  .mobile-link .mobile-label { font-size:.7rem; }.nav-badge { position:absolute; top:2px; left:calc(50% + 7px); min-width:16px; font-size:.62rem!important; background:#ba8054; }
  .field input,.field select,.field textarea { font-size:16px; }
  .panel { padding:18px; }.tile img { height:140px; }
}
@media (max-width:350px) { .home-hero h1 { font-size:1.85rem; }.today-grid .panel { padding:14px 11px; }.today-grid .button { font-size:.72rem; }.band-panel { gap:8px; } }
@media (prefers-reduced-motion:reduce) { .tile { transition:none; } }
@media (min-width:701px) and (max-width:950px) and (min-height:501px) { .home-explore { grid-template-columns:repeat(2,minmax(0,1fr)); } }
.progress-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:16px 0 12px; }
.progress-metrics div { padding:12px; border:1px solid var(--line); border-radius:11px; background:var(--canvas); }
.progress-metrics b,.progress-metrics span { display:block; }
.progress-metrics b { font-size:1.2rem; line-height:1.2; color:var(--ink); }
.progress-metrics span { margin-top:3px; font-size:.72rem; color:var(--sub); }
.progress-caption,.progress-note { font-size:.8rem; }
.progress-note { margin-top:26px; }
@media (max-width:350px) { .progress-metrics { gap:5px; }.progress-metrics div { padding:10px 8px; }.progress-metrics b { font-size:1.08rem; } }

/* Layout and native progress bars remain compatible with a strict style-src policy. */
.actions-bottom { margin-bottom:20px; }
.actions-vertical { margin:15px 0; }
.actions-top { margin-top:18px; }
.actions-small-top { margin-top:12px; }
.section-gap { margin-top:16px; }
progress.progress-track { display:block; width:100%; height:8px; border:0; overflow:hidden; border-radius:99px; background:#e9eeeb; }
progress.progress-track::-webkit-progress-bar { background:#e9eeeb; border-radius:99px; }
progress.progress-track::-webkit-progress-value { background:#65ab91; border-radius:99px; }
progress.progress-track::-moz-progress-bar { background:#65ab91; border-radius:99px; }
.wip-badge { display:inline-block; margin:0 0 10px; padding:5px 10px; border:1px solid #ffffff66; border-radius:999px; color:#fff; background:#102d33aa; font-size:.68rem; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.device-panel { margin-top:16px; }
.device-panel h3 { font-size:1rem; margin:20px 0 10px; }
.device-days { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:6px; }
.device-day { text-align:center; padding:8px 2px; border-radius:9px; background:var(--canvas); color:var(--sub); }
.device-day b,.device-day small { display:block; }
.device-day small { font-size:.62rem; }
.device-day.active { background:#b1d6c4; color:#163c32; }
.device-day.goal-met { background:#388069; color:#fff; }
.usage-preview { max-height:16rem; overflow:auto; padding:12px; border-radius:10px; background:var(--canvas); font-size:.75rem; white-space:pre-wrap; overflow-wrap:anywhere; }
.station-rail { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:8px; margin:0 0 18px; }
.station-chip { display:flex; flex-direction:column; gap:3px; padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--surface); color:var(--ink); text-decoration:none; }
.station-chip span { display:grid; place-items:center; height:25px; width:25px; border-radius:50%; background:var(--canvas); font-size:.75rem; }
.station-chip.earned span { color:#fff; background:#388069; }
.station-chip b { font-size:.8rem; }
.station-chip small { font-size:.7rem; color:var(--sub); }
.recovery-card { margin-top:20px; padding:16px; border:1px solid var(--line); border-radius:12px; background:var(--canvas); }
.recovery-card h3 { font-size:1rem; margin:0; }
.band-profile { font-size:.88rem; color:var(--sub); margin:12px 0 18px; }
.band-profile-title { font-weight:700; color:var(--ink); margin-bottom:8px; }
.band-profile ul { margin:8px 0; padding-left:20px; }
.band-profile li + li { margin-top:4px; }
.band-profile details { margin-top:10px; }
.practice-transcript,.practice-downloads { margin:12px 0; padding:12px 14px; border:1px solid var(--line); border-radius:12px; background:var(--canvas); }
.practice-transcript .reader { margin-bottom:0; }
.practice-assistance { color:var(--accent); font-size:.85rem; font-weight:700; }
@media (max-width:350px) { .station-rail { grid-template-columns:repeat(2,minmax(0,1fr)); }.device-days { gap:4px; }.device-day small { font-size:.57rem; } }

[data-speaking-result]:empty, [data-speaking-heard]:empty, [data-speaking-panel] > [role="status"]:empty { display: none; }
[data-speaking-panel] [hidden] { display: none; }
.speaking-live-toggle { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; cursor: pointer; }
.speaking-live-toggle input { accent-color: var(--accent); }
.speaking-live-panel { margin: 0.25rem 0 0.8rem; }
.speaking-live-panel p { margin: 0.35rem 0; white-space: pre-line; overflow-wrap: anywhere; }
[data-live-partner]:empty, [data-live-line]:empty { display: none; }
[data-live-line] { font-weight: 700; }
.pronunciation-dialog .speaking-live-panel .actions { justify-content: center; }
.pronunciation-random { width: 100%; }
.pronunciation-item {
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}
.pronunciation-item h3 { margin: 0 0 0.35rem; overflow-wrap: anywhere; }
.pronunciation-item p { margin: 0; }
.pronunciation-item .actions { flex: none; gap: 0.35rem; margin: 0; }
.pronunciation-term {
  color: inherit;
  background: transparent;
  font: inherit;
  padding: 0;
  text-align: left;
}
.button.speech-control {
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  font-size: 0.94rem;
  border-radius: 10px;
  white-space: nowrap;
}
.button.speech-control:not([hidden]) { display: inline-flex; }
.speech-control svg { width: 1.1rem; height: 1.1rem; flex: none; }
.button.speech-control.icon-only { min-width: 44px; padding: 0; }
.speech-control span:empty { display: none; }
.pronunciation-dialog { text-align: center; }
#speaking-dialog {
  width: min(420px, calc(100% - 32px));
  border: 1px solid var(--line, #d7dce4);
  border-radius: 14px;
}
#speaking-dialog::backdrop { background: #101010b8; }
[data-theme="dark"] #speaking-dialog {
  background: #15181f;
  color: #e9edf3;
  border-color: #272c37;
}
.pronunciation-dialog.modal { padding: 18px; }
.pronunciation-dialog h2 { overflow-wrap: anywhere; margin: 0 0 0.55rem; font-size: 1.75rem; }
.pronunciation-dialog [data-speaking-panel] {
  margin: 0;
  padding: 0.15rem 0 0.8rem;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.pronunciation-dialog details { text-align: left; margin: 0.75rem 0 0; font-size: 0.84rem; }
.pronunciation-dialog [data-speaking-panel] > .actions { justify-content: center; gap: 0.45rem; margin: 0.8rem 0; }
.pronunciation-dialog [role="status"] { font-size: 0.84rem; }
.pronunciation-instructions { text-align: center; margin: 0; font-size: 0.88rem; }
[data-theme="dark"] .pronunciation-dialog .secondary { background: #0e1114; border-color: #272c37; color: #e9edf3; }
.button.pronunciation-record {
  color: #2e1713;
  background: #ff7d70;
  border-color: #ff7d70;
}
.pronunciation-words {
  margin-top: 0.75rem;
  text-align: center;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font-size: clamp(1.2rem, 5vw, 1.7rem);
  line-height: 1.65;
  font-weight: 680;
}
.pronunciation-words:empty { display: none; }
.pronunciation-words.is-stale { opacity: 0.55; }
.pronunciation-words button {
  background: none;
  padding: 0 0.06em;
  font: inherit;
  border-bottom: 3px solid currentColor;
  border-radius: 0;
}
.pronunciation-score { margin: 0.4rem 0; text-align: center; }
.pronunciation-score strong { font-size: 2rem; margin-right: 0.55rem; }
.pronunciation-feedback { text-align: center; margin: 0.4rem 0; }
.word-heard { color: #176041; }
.word-pending { text-decoration: underline dashed; }
.word-unclear { color: #805511; }
.word-missed, .word-changed { color: #a4372d; }
.pronunciation-words button.word-unclear { border-bottom-style: dashed; }
.pronunciation-words button:is(.word-missed, .word-changed) { border-bottom-style: dotted; }
.pronunciation-heard { overflow-wrap: anywhere; margin: 0.35rem 0; }
[data-theme="dark"] .word-heard { color: #89e3b2; }
[data-theme="dark"] .word-unclear { color: #f4cd83; }
[data-theme="dark"] :is(.word-missed, .word-changed) { color: #ff9388; }

/* Home and Review share the Learn Japanese layout and colour tokens. */
html {
  --canvas: #f5f6f8;
  --surface: #fff;
  --line: #e1e4e9;
  --ink: #11141a;
  --sub: #5d6471;
  --accent: #3a4ad6;
  --accent-soft: #eceefc;
  --on-accent: #fff;
  --secondary-surface: #eff1f4;
  --muted-line: #cbd0d8;
  --review-red: #c7362b;
  --review-amber: #9e5c00;
  --review-green: #17784d;
}
html[data-theme="dark"] {
  --canvas: #0f1115;
  --surface: #171a20;
  --line: #272a33;
  --ink: #eceef2;
  --sub: #a3a9b5;
  --accent: #949eff;
  --accent-soft: #1d2140;
  --on-accent: #0b0e1c;
  --secondary-surface: #20242c;
  --muted-line: #363c47;
  --review-red: #ff7b6f;
  --review-amber: #f0b04a;
  --review-green: #4cc38a;
}
.button:not(.secondary):not(.ghost):not(.pronunciation-record),
html[data-theme="dark"] .button:not(.secondary):not(.ghost):not(.pronunciation-record) {
  background: var(--accent);
  color: var(--on-accent);
}
html[data-theme="dark"] .button.secondary,
html[data-theme="dark"] .tab.active { color: var(--ink); }
html[data-theme="dark"] .nav-link.active { color: var(--accent); }
.topbar-tools { display: flex; align-items: center; gap: 10px; }
.top-band, .theme-control {
  display: grid;
  place-items: center;
  min-width: 36px;
  height: 36px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font-size: .8rem;
  font-weight: 660;
}
.theme-control svg { width: 20px; height: 20px; }
.reference-home { max-width: 820px; margin: 0 auto; }
.reference-home .home-hero { min-height: clamp(185px, 39vw, 300px); border-radius: 23px; }
.reference-home .home-hero-copy { padding: 20px; }
.reference-home .home-hero h1 { font-size: clamp(1.85rem, 6vw, 3.2rem); margin: 5px 0; }
.home-tools { position: absolute; top: 12px; right: 14px; display: flex; gap: 6px; }
.home-tools :is(.top-band,.theme-control) { background: #112235dd; color: white; border-color: #ffffff4d; border-radius: 50%; width: 42px; height: 42px; }
.home-streak, .home-progress, .home-resume, .home-due {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 22px;
}
.home-streak { display: grid; grid-template-columns: repeat(3,1fr); padding: 14px 4px; margin-top: 16px; }
.home-streak > * { display: grid; align-content: center; justify-items: center; text-align: center; min-height: 54px; border-right: 1px solid var(--line); }
.home-streak > :last-child { border-right: 0; }
.home-streak strong, .home-progress strong { font-size: 1.55rem; line-height: 1.1; }
.home-streak span, .home-progress div span { color: var(--sub); font-size: .8rem; font-weight: 570; }
.home-today { display: grid; gap: 12px; margin: 12px 0; }
.home-due { position: relative; isolation: isolate; display: grid; grid-template-columns: 1fr; padding: 18px 20px; overflow: hidden; }
.home-due.has-due { border-color: transparent; background: var(--accent); color: var(--on-accent); }
.home-due.has-due::after { content: "↻"; position: absolute; z-index: -1; right: -9px; bottom: -40px; font-size: 11rem; line-height: 1; font-weight: 800; opacity: .12; }
.home-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 750; color: var(--sub); }
.home-due.has-due .home-label { color: inherit; }
.home-due > strong { font-size: 3.3rem; line-height: 1.13; letter-spacing: -.04em; margin-top: 5px; }
.home-due > span:nth-child(3), .home-due-action { font-weight: 680; }
.home-due-action { margin-top: 20px; }
.home-due-action span { padding-left: 8px; font-size: 1.15rem; }
.home-resume { padding: 18px 20px; }
.home-resume h2 { font-size: 1.42rem; line-height: 1.25; margin: 7px 0; }
.home-resume p { color: var(--sub); margin: 0 0 12px; }
.home-resume .progress-track { margin: 0 0 12px; }
.home-resume .actions { margin: 0; }
progress.progress-track { background: var(--secondary-surface); }
progress.progress-track::-webkit-progress-bar { background: var(--secondary-surface); }
progress.progress-track::-webkit-progress-value { background: var(--accent); }
progress.progress-track::-moz-progress-bar { background: var(--accent); }
.review-tally { display: flex; gap: 8px; flex-wrap: wrap; }
.review-tally span { border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
.home-progress { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; }
.home-progress div { display: grid; gap: 4px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.home-progress div:nth-child(odd) { border-right: 1px solid var(--line); }
.home-progress a { grid-column: 1/-1; display: flex; justify-content: space-between; padding: 15px 16px; color: var(--accent); font-weight: 700; font-size: .9rem; }
.course-title { margin: 29px 0 12px; }
.course-title :is(h1,h2) { margin: 0; font-size: 1.25rem; }
.course-tiles { display: grid; gap: 8px; grid-template-columns: minmax(0,1fr); }
.course-tile { display: flex; align-items: center; gap: 16px; padding: 13px 14px; min-height: 91px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--ink); }
.course-tile:hover { border-color: var(--muted-line); }
.course-tile:focus-visible, .home-due:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.course-tile-art { position: relative; flex: 0 0 70px; display: flex; align-items: end; aspect-ratio: 1.65; }
.course-tile-art:not(.has-image) { flex-basis: 48px; aspect-ratio: 1; }
.course-tile-art img { width: 100%; height: 100%; object-fit: cover; border-radius: 11px; }
.course-tile-art span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; background: var(--secondary-surface); color: var(--ink); font-weight: 700; }
.course-tile-art.has-image span { position: absolute; width: 28px; height: 28px; bottom: -4px; right: -7px; border: 2px solid var(--surface); border-radius: 9px; font-size: .68rem; }
.course-tile-copy { min-width: 0; display: grid; gap: 2px; }
.course-tile-copy strong { font-size: 1rem; }
.course-tile-copy > span { color: var(--sub); font-size: .9rem; line-height: 1.43; }
.course-band { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 20px; background: color-mix(in srgb, var(--review-green) 12%, var(--surface)); color: var(--review-green); font-size: .72rem; }
.course-band::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.course-footer, .review-foot { margin: 42px 0 12px; padding: 16px 0 0; border-top: 1px solid var(--line); color: var(--sub); font-size: .87rem; }
.course-footer { text-align: center; }
.course-footer a { text-decoration: underline; }
.reference-review { max-width: 720px; margin: 0 auto; }
.review-banner { display: block; width: 100%; aspect-ratio: 2.5; object-fit: cover; border-radius: 13px; }
.review-lead { margin: 16px 0 20px; color: var(--sub); font-size: .98rem; line-height: 1.6; }
.review-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-bottom: 14px; }
.review-stats > div { display: grid; place-items: center; align-content: center; gap: 7px; text-align: center; min-height: 80px; padding: 9px 3px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.review-stats strong { font-size: 1.45rem; line-height: 1.15; }
.review-stats span { font-size: .76rem; color: var(--sub); }
.review-box { margin-bottom: 14px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.review-box > h2:not(.review-front) { margin: 0 0 10px; font-size: .78rem; letter-spacing: .075em; text-transform: uppercase; color: var(--sub); }
.review-box p { color: var(--sub); font-size: .88rem; margin: 8px 0 0; }
.review-nudge { background: var(--accent-soft); border-color: var(--accent); border-radius: 13px; }
.review-nudge > strong { display: block; }
.review-nudge p { margin: 4px 0 12px; }
.review-nudge .button { background: var(--surface); color: var(--ink); }
.review-start { margin-bottom: 14px; }
.review-full { width: 100%; min-height: 48px; }
.review-full + .review-full { margin-top: 8px; }
.review-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.review-chips button { min-height: 44px; padding: 7px 13px; border: 1px solid var(--muted-line); border-radius: 28px; background: transparent; color: var(--sub); font-weight: 650; font-size: .86rem; }
.review-chips button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--canvas); }
#review-retention { width: 100%; min-height: 34px; margin: 0; accent-color: var(--accent); }
.review-add { color: var(--accent); background: var(--accent-soft); border: 1px solid transparent; }
html[data-theme="dark"] .button.review-add { color: var(--accent); }
.review-enrollment { min-height: 1.2em; }
.review-chart { width: 100%; height: auto; display: block; }
.review-chart rect { fill: var(--accent); opacity: .85; }
.review-chart text { fill: var(--sub); font-size: 10px; }
.review-tricky { list-style: none; margin: 0; padding: 0; }
.review-tricky li { display: flex; align-items: baseline; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.review-tricky li:last-child { border: 0; }
.review-tricky strong { overflow-wrap: anywhere; max-width: 55%; }
.review-tricky span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--sub); font-size: .84rem; }
.review-tricky small { color: var(--review-red); }
.review-session { padding: 15px; text-align: center; }
.review-session-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--sub); font-size: .78rem; }
.review-tag { display: block; color: var(--sub); font-size: .75rem; margin-top: 8px; }
.review-front { font-size: clamp(1.5rem, 6vw, 2rem); overflow-wrap: anywhere; margin: 13px 0; }
.review-back { margin-bottom: 12px; }
.review-back p:first-child { color: var(--ink); font-size: 1.1rem; }
.review-audio, .review-utilities { justify-content: center; }
.review-grades { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; }
.review-grades button { display: grid; place-content: center; gap: 3px; min-height: 54px; padding: 2px; border: 1px solid currentColor; border-radius: 9px; background: var(--secondary-surface); color: var(--accent); font-size: .82rem; }
.review-grades small { color: var(--sub); }
.review-grades button[data-review-action="again"] { color: var(--review-red); }
.review-grades button[data-review-action="hard"] { color: var(--review-amber); }
.review-grades button[data-review-action="good"] { color: var(--review-green); }
.review-finished { text-align: center; }
.review-finished .actions { justify-content: center; }
.reference-progress { max-width: 930px; margin: 0 auto; }
.progress-start { margin-bottom: 14px; }
.estimate-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; padding: 0; border: 0; margin: 14px 0; }
.estimate-options legend { font-weight: 700; margin-bottom: 8px; }
.estimate-options label { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 9px; font-size: .88rem; }
.estimate-options label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.estimate-options input { accent-color: var(--accent); }
.reference-tabs { display: flex; gap: 4px; margin: 0 0 15px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--secondary-surface); }
.reference-tabs a { flex: 1; text-align: center; padding: 9px 4px; border-radius: 8px; color: var(--sub); font-weight: 650; }
.reference-tabs a[aria-current] { background: var(--surface); color: var(--ink); }
.reference-tabs a small { display: block; font-size: .7em; }
.conversation-layout { max-width: 860px; padding: 24px 16px 60px; margin: 0 auto; }
.conversation-page .top-back { display: inline-grid; }
.conversation-layout > .card { margin-top: 16px; }
.conversation-layout h1 { line-height: 1.15; }
.conversation-layout h1 small { display: inline-block; font-size: .44em; vertical-align: middle; color: var(--sub); }
.conversation-layout .field { margin-bottom: 10px; }
.conversation-layout textarea { resize: vertical; }
.conversation-layout [role="status"] { overflow-wrap: anywhere; }
.conversation-hands-free { display: flex; align-items: center; gap: 0.5rem; min-height: 44px; }
.conversation-layout [hidden] { display: none !important; }
.conversation-transcript { display: grid; gap: 8px; max-height: min(420px, 53vh); overflow-y: auto; margin: 12px 0; }
.conversation-transcript > div { padding: 10px 14px; background: var(--secondary-surface); border-radius: 10px; overflow-wrap: anywhere; }
.conversation-transcript strong { font-size: .83rem; color: var(--sub); }
.conversation-transcript p { margin: 3px 0 0; white-space: pre-wrap; }
.conversation-layout summary { cursor: pointer; font-weight: 700; }
@media (min-width: 701px) {
  .course-tiles { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .review-chart { max-height: 150px; }
}
@media (max-width:700px), (max-width:950px) and (max-height:500px) {
  .sidebar { display: none; }
  html[data-page="home"] .topbar { display: none; }
  #app { padding: 18px 14px 80px; }
  html[data-page="home"] #app { padding-top: 13px; }
  .topbar { min-height: 56px; height: auto; padding: 0 13px; background: var(--surface); border-bottom: 1px solid var(--line); }
  #top-title { font-size: 1rem; }
  #top-streak, .review-keys { display: none; }
  #mobile-nav { background: var(--surface); }
  #mobile-nav .mobile-link { min-height: 61px; padding-top: 9px; gap: 1px; }
  #mobile-nav .mobile-link.active::before { content: ""; position: absolute; width: 29px; height: 3px; top: 0; left: calc(50% - 14.5px); border-radius: 0 0 3px 3px; background: var(--accent); }
  #mobile-nav .mobile-link .nav-badge { background: var(--review-red); color: var(--canvas); top: 6px; }
}
