:root {
  color-scheme: light;
  --paper: #f6f1e7;
  --paper-deep: #ece4d5;
  --card: #fffdf8;
  --ink: #172420;
  --muted: #65716b;
  --line: #d9d2c5;
  --line-strong: #bbb4a7;
  --green: #1f765f;
  --green-deep: #125141;
  --green-soft: #dcece4;
  --acid: #d7ef4a;
  --acid-soft: #eff8b7;
  --orange: #e86f43;
  --orange-soft: #fae2d8;
  --blue: #397c99;
  --blue-soft: #deedf3;
  --red: #bd493f;
  --shadow: 0 18px 60px rgba(33, 42, 36, .09);
  --shadow-soft: 0 8px 26px rgba(33, 42, 36, .07);
  --radius: 18px;
  --sans: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  --serif: "Songti SC", "STSong", "SimSun", serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, "Microsoft YaHei", monospace;
}

* { box-sizing: border-box; }
html { background: var(--paper); scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(circle at 86% 0%, rgba(215, 239, 74, .16), transparent 24rem),
    linear-gradient(rgba(31, 118, 95, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 118, 95, .025) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 32px 32px, 32px 32px, auto;
}

button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.hidden { display: none !important; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app-shell {
  width: min(1120px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 22px 108px;
}

.topbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 2px 10px;
}

.brand-button {
  border: 0;
  background: transparent;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--acid);
  background: var(--green-deep);
  border: 1px solid #0d4436;
  border-radius: 13px 13px 13px 5px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 7px 16px rgba(18,81,65,.18);
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-copy { display: grid; text-align: left; line-height: 1; }
.brand-copy strong { font-family: var(--serif); font-size: 24px; letter-spacing: .08em; }
.brand-copy small { margin-top: 6px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }

.top-stats { display: flex; align-items: center; gap: 10px; }
.streak-pill, .compact-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, .72);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(33,42,36,.04);
}
.streak-pill svg { color: var(--orange); fill: var(--orange-soft); }
.streak-pill strong { color: var(--ink); }

.page { animation: page-in .26s ease-out both; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: 18px;
}

.today-card {
  position: relative;
  min-height: 322px;
  overflow: hidden;
  padding: clamp(24px, 4vw, 42px);
  color: #f8fff9;
  border-radius: 28px 28px 28px 8px;
  background:
    radial-gradient(circle at 92% 10%, rgba(215,239,74,.28), transparent 14rem),
    linear-gradient(145deg, #17634f, #0d4235 74%);
  box-shadow: 0 24px 65px rgba(18,81,65,.2);
}
.today-card::before {
  content: "";
  position: absolute;
  right: -52px;
  bottom: -76px;
  width: 280px;
  height: 280px;
  border: 44px solid rgba(255,255,255,.055);
  border-radius: 50%;
}
.today-card::after {
  content: "H₂O";
  position: absolute;
  right: 25px;
  bottom: 10px;
  color: rgba(255,255,255,.06);
  font-family: var(--mono);
  font-weight: 900;
  font-size: 88px;
  transform: rotate(-9deg);
}
.eyebrow { margin: 0 0 12px; color: var(--green); font-size: 12px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.today-card .eyebrow { color: var(--acid); }
.today-card h1 { position: relative; z-index: 1; max-width: 560px; margin: 0; font-family: var(--serif); font-size: clamp(32px, 5vw, 54px); line-height: 1.13; letter-spacing: .02em; }
.today-card h1 span { color: var(--acid); }
.today-subtitle { position: relative; z-index: 1; max-width: 550px; margin: 15px 0 0; color: rgba(255,255,255,.7); font-size: 14px; line-height: 1.75; }

.progress-row { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; margin-top: 28px; }
.progress-track { flex: 1; height: 9px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.13); }
.progress-track > span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--acid); transition: width .4s ease; }
.progress-label { min-width: 72px; color: rgba(255,255,255,.76); font-size: 12px; font-weight: 800; text-align: right; }

.primary-action {
  position: relative;
  z-index: 1;
  margin-top: 22px;
  min-height: 52px;
  padding: 0 20px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 14px;
  color: var(--green-deep);
  background: var(--acid);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 11px 22px rgba(7,38,30,.22);
  transition: transform .15s ease, filter .15s ease;
}
.primary-action:hover { transform: translateY(-2px); filter: brightness(1.025); }
.primary-action svg { width: 19px; }

.side-stack { display: grid; gap: 14px; }
.metric-card {
  min-height: 154px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px 22px 7px 22px;
  background: rgba(255,253,248,.82);
  box-shadow: var(--shadow-soft);
}
.metric-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.metric-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: var(--green-deep); background: var(--green-soft); }
.metric-icon.orange { color: #9b3f23; background: var(--orange-soft); }
.metric-card small { color: var(--muted); font-weight: 800; }
.metric-card strong { display: block; margin-top: 14px; font-family: var(--serif); font-size: 32px; }
.metric-card p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }

.section { margin-top: 34px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.section-heading h2 { margin: 0; font-family: var(--serif); font-size: 24px; letter-spacing: .02em; }
.section-heading p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.text-button { border: 0; padding: 8px 0; color: var(--green); background: transparent; font-size: 13px; font-weight: 900; cursor: pointer; }

.task-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.task-card {
  position: relative;
  min-height: 164px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 19px 19px 6px 19px;
  background: var(--card);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.task-card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: 0 16px 34px rgba(33,42,36,.1); }
.task-card::after { content: ""; position: absolute; right: -26px; bottom: -28px; width: 100px; height: 100px; border-radius: 50%; background: var(--green-soft); opacity: .55; }
.task-card.review::after { background: var(--orange-soft); }
.task-card.challenge::after { background: var(--blue-soft); }
.task-head { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; }
.task-icon { width: 42px; height: 42px; display: grid; place-items: center; color: var(--green-deep); border-radius: 12px; background: var(--green-soft); }
.review .task-icon { color: #9b3f23; background: var(--orange-soft); }
.challenge .task-icon { color: #255d76; background: var(--blue-soft); }
.task-count { color: var(--muted); font-size: 12px; font-weight: 900; }
.task-card h3 { position: relative; z-index: 1; margin: 20px 0 0; font-size: 18px; }
.task-card p { position: relative; z-index: 1; margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }

.chapter-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; padding: 2px 2px 12px; scrollbar-width: thin; }
.chapter-card { min-height: 120px; padding: 18px; border: 1px solid var(--line); border-radius: 17px 17px 5px 17px; background: rgba(255,253,248,.76); cursor: pointer; text-align: left; }
.chapter-card b { display: block; font-family: var(--serif); font-size: 18px; }
.chapter-card span { display: block; margin-top: 9px; color: var(--muted); font-size: 12px; }
.chapter-bar { height: 5px; margin-top: 18px; overflow: hidden; border-radius: 999px; background: var(--paper-deep); }
.chapter-bar i { display: block; height: 100%; background: var(--green); border-radius: inherit; }

.bottom-nav {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  width: min(620px, calc(100% - 28px));
  min-height: 68px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  transform: translateX(-50%);
  border: 1px solid rgba(187,180,167,.76);
  border-radius: 22px;
  background: rgba(255,253,248,.92);
  box-shadow: 0 18px 54px rgba(33,42,36,.17);
  backdrop-filter: blur(18px);
}
.nav-button { min-height: 52px; border: 0; border-radius: 14px; display: grid; place-items: center; align-content: center; gap: 4px; color: #77817c; background: transparent; cursor: pointer; }
.nav-button svg { width: 20px; height: 20px; }
.nav-button span { font-size: 10px; font-weight: 900; }
.nav-button.active { color: var(--green-deep); background: var(--green-soft); }

.page-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; padding: 18px 0 8px; }
.page-head h1 { margin: 0; font-family: var(--serif); font-size: clamp(31px, 5vw, 48px); }
.page-head p { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.search-box { width: min(330px, 100%); height: 46px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.search-box svg { color: var(--muted); }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); background: transparent; }

.filter-row { display: flex; gap: 8px; padding: 20px 0 8px; overflow-x: auto; }
.filter-chip { flex: 0 0 auto; min-height: 36px; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(255,253,248,.74); font-size: 12px; font-weight: 900; cursor: pointer; }
.filter-chip.active { color: #f7fff9; border-color: var(--green-deep); background: var(--green-deep); }

.library-list { display: grid; gap: 10px; margin-top: 14px; }
.equation-row { display: grid; grid-template-columns: minmax(170px,.8fr) minmax(280px,1.2fr) auto; align-items: center; gap: 18px; padding: 17px 18px; border: 1px solid var(--line); border-radius: 16px 16px 5px 16px; background: rgba(255,253,248,.82); box-shadow: 0 4px 16px rgba(33,42,36,.035); }
.equation-context b { display: block; font-size: 14px; }
.equation-context span { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }
.equation-text { overflow-wrap: anywhere; color: var(--green-deep); font-family: var(--mono); font-size: clamp(15px, 2.2vw, 20px); font-weight: 800; line-height: 1.55; }
.star-button { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: transparent; cursor: pointer; }
.star-button.active { color: #9d7516; border-color: #e4cf7b; background: #fbf2c8; }
.star-button.active svg { fill: #efc94c; }

.empty-state { padding: 52px 20px; border: 1px dashed var(--line-strong); border-radius: 18px; color: var(--muted); text-align: center; }
.empty-state svg { width: 34px; height: 34px; color: var(--green); }

.progress-layout { display: grid; grid-template-columns: minmax(280px,.72fr) minmax(360px,1.28fr); gap: 18px; margin-top: 24px; }
.panel { padding: 22px; border: 1px solid var(--line); border-radius: 21px 21px 7px 21px; background: rgba(255,253,248,.82); box-shadow: var(--shadow-soft); }
.panel h2 { margin: 0; font-family: var(--serif); font-size: 21px; }
.panel-note { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.mastery-ring { --ring: 0%; width: 170px; height: 170px; margin: 22px auto; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--green) var(--ring), var(--paper-deep) 0); position: relative; }
.mastery-ring::before { content: ""; position: absolute; inset: 14px; border: 1px solid var(--line); border-radius: inherit; background: var(--card); }
.ring-copy { position: relative; z-index: 1; text-align: center; }
.ring-copy strong { display: block; font-family: var(--serif); font-size: 38px; }
.ring-copy span { color: var(--muted); font-size: 11px; font-weight: 900; }
.stat-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-box { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.stat-box strong { display: block; font-size: 22px; }
.stat-box span { color: var(--muted); font-size: 11px; }
.chapter-progress-list { display: grid; gap: 19px; margin-top: 24px; }
.chapter-progress-item header { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 800; }
.chapter-progress-item header span { color: var(--muted); font-size: 11px; }
.wide-bar { height: 9px; margin-top: 9px; overflow: hidden; border-radius: 99px; background: var(--paper-deep); }
.wide-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green-deep), var(--green)); }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.setting-card { padding: 22px; border: 1px solid var(--line); border-radius: 20px 20px 6px 20px; background: var(--card); }
.setting-card h2 { margin: 0; font-size: 17px; }
.setting-card p { margin: 8px 0 18px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.goal-options { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.goal-option { min-height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); font-weight: 900; cursor: pointer; }
.goal-option.active { color: #fff; border-color: var(--green); background: var(--green); }
.danger-button { min-height: 44px; padding: 0 15px; border: 1px solid #dfaaa4; border-radius: 12px; color: var(--red); background: #fff8f6; font-weight: 900; cursor: pointer; }

.session-shell { width: min(780px, 100%); min-height: 100vh; margin: 0 auto; padding: 18px 20px 40px; display: flex; flex-direction: column; }
.session-head { min-height: 54px; display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; gap: 12px; }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,253,248,.82); cursor: pointer; }
.session-title { text-align: center; }
.session-title b { display: block; font-size: 14px; }
.session-title span { color: var(--muted); font-size: 11px; }
.session-progress { height: 7px; margin: 15px 0 28px; overflow: hidden; border-radius: 99px; background: var(--paper-deep); }
.session-progress i { display: block; height: 100%; border-radius: inherit; background: var(--green); transition: width .3s ease; }

.study-stage { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-bottom: 22px; }
.question-kicker { margin: 0; color: var(--green); font-size: 11px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; text-align: center; }
.question-prompt { max-width: 650px; margin: 13px auto 0; font-family: var(--serif); font-size: clamp(27px, 5vw, 42px); line-height: 1.35; text-align: center; }
.question-meta { margin-top: 11px; color: var(--muted); font-size: 12px; text-align: center; }

.recall-card { position: relative; min-height: 230px; margin-top: 30px; padding: 30px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 24px 24px 7px 24px; background: var(--card); box-shadow: var(--shadow); }
.recall-card::before { content: ""; position: absolute; inset: 0; opacity: .34; background: repeating-linear-gradient(0deg, transparent 0 31px, rgba(57,124,153,.12) 31px 32px); }
.recall-placeholder { position: relative; z-index: 1; text-align: center; color: var(--muted); }
.recall-placeholder svg { width: 34px; height: 34px; color: var(--green); }
.recall-placeholder b { display: block; margin-top: 13px; color: var(--ink); font-size: 16px; }
.recall-placeholder span { display: block; margin-top: 5px; font-size: 12px; }
.answer-block { position: relative; z-index: 1; width: 100%; text-align: center; }
.answer-equation { color: var(--green-deep); font-family: var(--mono); font-size: clamp(22px, 4.4vw, 34px); font-weight: 900; line-height: 1.65; overflow-wrap: anywhere; }
.answer-note { max-width: 560px; margin: 18px auto 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.7; }
.condition-note { display: inline-flex; margin-top: 14px; padding: 7px 10px; border: 1px solid #bad0d9; border-radius: 8px; color: #255d76; background: var(--blue-soft); font-size: 11px; font-weight: 900; }
.mistake-note { display: inline-flex; gap: 7px; margin-top: 10px; padding: 7px 10px; border-radius: 8px; color: #8c3f2d; background: var(--orange-soft); font-size: 11px; font-weight: 800; }

.session-actions { display: grid; gap: 10px; margin-top: 22px; }
.reveal-button, .next-button { min-height: 54px; border: 1px solid var(--green-deep); border-radius: 15px; color: #fff; background: var(--green-deep); font-weight: 900; cursor: pointer; box-shadow: 0 10px 24px rgba(18,81,65,.17); }
.grade-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; }
.grade-button { min-height: 58px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); cursor: pointer; font-weight: 900; }
.grade-button small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 700; }
.grade-button[data-grade="0"] { color: var(--red); border-color: #e2b0aa; background: #fff8f6; }
.grade-button[data-grade="2"] { color: var(--green-deep); border-color: #94bdae; background: #f2f9f5; }

.choice-list { display: grid; gap: 10px; margin-top: 28px; }
.choice-button { width: 100%; min-height: 64px; padding: 15px 17px; display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); background: var(--card); text-align: left; cursor: pointer; }
.choice-letter { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: var(--muted); background: var(--paper); font-size: 11px; font-weight: 900; }
.choice-equation { font-family: var(--mono); font-size: 14px; font-weight: 800; line-height: 1.55; }
.choice-button:hover { border-color: var(--green); }
.choice-button.wrong { color: var(--red); border-color: #d99a94; background: #fff4f2; animation: shake .25s ease; }
.choice-button.correct { color: var(--green-deep); border-color: #75aa97; background: #edf7f2; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.feedback-line { min-height: 28px; margin-top: 14px; font-size: 13px; font-weight: 900; text-align: center; }
.feedback-line.bad { color: var(--red); }
.feedback-line.good { color: var(--green); }

.answer-form { margin-top: 28px; }
.answer-input { width: 100%; min-height: 114px; resize: vertical; padding: 18px; border: 1px solid var(--line-strong); border-radius: 17px; outline: 0; color: var(--green-deep); background: var(--card); font-family: var(--mono); font-size: clamp(17px, 3vw, 23px); line-height: 1.65; box-shadow: inset 0 1px 8px rgba(33,42,36,.04); }
.answer-input:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(31,118,95,.1); }
.input-help { margin: 8px 2px 0; color: var(--muted); font-size: 10px; }
.result-card { margin-top: 14px; padding: 15px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); }
.result-card.correct { border-color: #82b5a2; background: #edf7f2; }
.result-card.wrong { border-color: #dda59f; background: #fff4f2; }
.result-card b { display: block; font-size: 12px; }
.result-card code { display: block; margin-top: 8px; color: var(--green-deep); font-family: var(--mono); font-size: 14px; font-weight: 800; white-space: normal; }

.session-summary { flex: 1; display: grid; place-items: center; text-align: center; }
.summary-card { width: min(520px, 100%); padding: 38px 28px; border: 1px solid var(--line); border-radius: 26px 26px 8px 26px; background: var(--card); box-shadow: var(--shadow); }
.summary-mark { width: 72px; height: 72px; margin: 0 auto; display: grid; place-items: center; border-radius: 24px 24px 7px 24px; color: var(--green-deep); background: var(--acid); }
.summary-mark svg { width: 35px; height: 35px; }
.summary-card h1 { margin: 22px 0 0; font-family: var(--serif); font-size: 32px; }
.summary-card p { margin: 10px auto 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.summary-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 24px; }
.summary-stat { padding: 13px 8px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }
.summary-stat strong { display: block; font-size: 21px; }
.summary-stat span { color: var(--muted); font-size: 9px; }
.summary-card .next-button { width: 100%; margin-top: 22px; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 102px; max-width: calc(100% - 36px); padding: 11px 16px; border-radius: 12px; color: #fff; background: rgba(23,36,32,.94); font-size: 12px; font-weight: 800; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; box-shadow: 0 10px 28px rgba(0,0,0,.18); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.loading-screen { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 13px; color: var(--muted); }
.loading-mark { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 20px 20px 6px 20px; color: var(--acid); background: var(--green-deep); animation: pulse 1.4s ease-in-out infinite; }
.loading-mark svg { width: 32px; height: 32px; }
@keyframes pulse { 50% { transform: translateY(-4px); box-shadow: 0 16px 35px rgba(18,81,65,.2); } }

@media (max-width: 760px) {
  .app-shell { padding-inline: 14px; }
  .topbar { min-height: 70px; }
  .brand-copy small { display: none; }
  .streak-pill { padding-inline: 10px; }
  .compact-pill { display: none; }
  .hero-grid { grid-template-columns: 1fr; }
  .today-card { min-height: 302px; padding: 26px 22px; }
  .today-card::after { font-size: 65px; }
  .side-stack { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 132px; padding: 16px; }
  .metric-card strong { margin-top: 9px; font-size: 27px; }
  .task-grid { grid-template-columns: 1fr; }
  .task-card { min-height: 126px; }
  .task-card h3 { margin-top: 14px; }
  .page-head { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .equation-row { grid-template-columns: 1fr auto; gap: 9px 12px; }
  .equation-context { grid-column: 1 / -1; }
  .equation-text { grid-column: 1; }
  .star-button { grid-column: 2; grid-row: 2; }
  .progress-layout, .settings-grid { grid-template-columns: 1fr; }
  .session-shell { padding: 12px 14px 28px; }
  .recall-card { min-height: 210px; padding: 22px 16px; }
  .grade-row { gap: 6px; }
  .grade-button { min-height: 61px; font-size: 12px; }
  .summary-card { padding: 30px 18px; }
}

@media (max-width: 420px) {
  .side-stack { grid-template-columns: 1fr; }
  .metric-card { min-height: 112px; }
  .today-card h1 { font-size: 34px; }
  .bottom-nav { min-height: 64px; }
  .question-prompt { font-size: 28px; }
  .choice-button { padding-inline: 12px; }
}

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

:focus-visible { outline: 3px solid rgba(57,124,153,.45); outline-offset: 3px; }
