:root {
  --ink: #1c2430;
  --muted: #5c6978;
  --navy: #10243f;
  --navy-2: #1a3c66;
  --sea: #1d6a62;
  --gold: #9a6b24;
  --paper: #f4f0e6;
  --card: #fffdf8;
  --line: #e3d9c8;
  --bad: #8e2d2d;
  --bad-bg: #f8ece8;
  --good: #1c6b45;
  --good-bg: #e7f4ec;
  --mid: #8a5a12;
  --mid-bg: #f8f1e2;
  --shadow: 0 10px 28px rgba(16, 36, 63, 0.08);
  --topbar-h: 56px;
  --tabbar-h: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
}
html {
  overflow-x: clip;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body {
  overflow-x: clip;
  overflow-y: visible;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
}
button, input, select, textarea {
  font: inherit;
  color: inherit;
}
button { cursor: pointer; }
h1, h2, h3, h4 {
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(1.7rem, 7vw, 2.4rem); line-height: 1.12; margin: 0 0 0.45rem; }
h2 { font-size: 1.28rem; margin: 0 0 0.55rem; line-height: 1.2; }
h3 { margin: 1.2rem 0 0.35rem; font-size: 1.08rem; }

/* ---------- shell mobile-first ---------- */
#shell {
  min-height: 100dvh;
  display: block;
  padding-top: calc(var(--topbar-h) + var(--safe-top));
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 8px);
}

#sidebar {
  background: var(--navy);
  color: #f4efe4;
}

#topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  height: calc(var(--topbar-h) + var(--safe-top));
  padding: var(--safe-top) 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--navy);
  color: #f4efe4;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}
.aside-note { display: none; }

#brand {
  display: flex;
  gap: 10px;
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  text-align: left;
  padding: 8px 6px;
  min-height: 44px;
  min-width: 0;
}
.brand-text { min-width: 0; }
#brand strong {
  display: block;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.1;
}
#brand small {
  display: block;
  color: #d7c39a;
  letter-spacing: 0.02em;
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 58vw;
}
.mark {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: block;
  object-fit: cover;
  background: var(--navy);
}
.hero-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  display: block;
  margin-bottom: 14px;
  box-shadow: 0 8px 20px rgba(16, 36, 63, 0.18);
}

#more-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #f4efe4;
  font-size: 1.4rem;
  line-height: 1;
}

#tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding: 6px 4px var(--safe-bottom);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  background: #0d1e35;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
#tabbar .desk-tab { display: none; }
#tabbar button {
  min-height: 52px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #c9bfae;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 2px;
  font-size: 0.68rem;
  line-height: 1.15;
}
#tabbar button .tab-ico {
  font-size: 1.15rem;
  line-height: 1;
  font-family: Georgia, serif;
}
#tabbar button.on {
  color: #fffdf8;
  background: rgba(255, 255, 255, 0.1);
}

main {
  flex: 1;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 14px 14px 28px;
}

/* ---------- sheet / more menu ---------- */
.sheet[hidden] { display: none !important; }
.sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 36, 63, 0.45);
}
.sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(78dvh, 640px);
  overflow: auto;
  background: var(--card);
  border-radius: 18px 18px 0 0;
  padding: 8px 14px calc(18px + var(--safe-bottom));
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.2);
}
.sheet-handle {
  width: 42px;
  height: 4px;
  border-radius: 99px;
  background: #d5cbbd;
  margin: 4px auto 12px;
}
.sheet-title {
  margin: 0 0 10px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.sheet-link {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 14px 14px;
  margin-bottom: 8px;
  min-height: 48px;
  font-size: 1.02rem;
}
.sheet-link.on {
  border-color: var(--navy);
  background: #efe6d6;
}

/* ---------- content ---------- */
.hero { margin-bottom: 18px; }
.hero.compact h1 { font-size: 1.85rem; }
.lead, .prose p, .panel p { line-height: 1.5; font-size: 1rem; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  color: var(--gold);
  margin: 0 0 0.35rem;
}
.hero-actions, .row-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.primary, .ghost {
  border-radius: 14px;
  padding: 14px 16px;
  border: 1px solid transparent;
  min-height: 48px;
  width: 100%;
  font-size: 1.02rem;
  text-align: center;
}
.primary { background: var(--navy); color: #fffdf8; }
.primary:active { background: var(--navy-2); }
.ghost { background: #fff; border-color: var(--line); }
.ghost:active { border-color: var(--navy); }
.primary:disabled { opacity: 0.5; cursor: default; }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.stat, .panel, .question, .review, .card-drill {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  padding: 14px 12px 16px;
  min-width: 0;
}
.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.25;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.stat strong {
  display: block;
  font-family: Georgia, serif;
  font-size: clamp(1.05rem, 3.8vw, 1.55rem);
  line-height: 1.15;
  font-weight: 600;
  word-break: break-word;
}
.stat strong small {
  font-size: 0.62em;
  font-weight: 500;
  color: var(--muted);
}
.panel { padding: 14px 14px 16px; margin-bottom: 12px; }
.bars { list-style: none; padding: 0; margin: 0; }
.bars li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  padding: 8px 0;
  font-size: 0.92rem;
}
.bars li .bar { grid-column: 1 / -1; }
.bar { height: 8px; background: #efe6d6; border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--sea), #2f8f86); }
.num { color: var(--muted); }

.split { display: grid; grid-template-columns: 1fr; gap: 12px; }
.course-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  padding: 4px 2px 8px;
  margin: 0 -2px 4px;
}
.course-link {
  flex: 0 0 auto;
  scroll-snap-align: start;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--ink);
  min-width: 160px;
  max-width: 220px;
  min-height: 56px;
}
.course-link:active { background: #f7f1e6; }
.course-link.on { background: #efe6d6; border-color: var(--navy); }
.course-link strong { display: block; font-size: 0.9rem; line-height: 1.25; }
.course-link span { color: var(--muted); font-size: 0.78rem; }
.prose {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 14px 20px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.prose ul, .prose ol { line-height: 1.5; padding-left: 1.15rem; }
.course-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.course-nav .ghost { max-width: none; }
.callout {
  background: var(--mid-bg);
  border-left: 3px solid var(--gold);
  padding: 10px 12px;
  border-radius: 0 10px 10px 0;
}

.toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.toolbar label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: var(--muted); }
select,
input[type="text"],
input[type="number"],
input[type="tel"],
input:not([type]),
.text-field input,
.answer-input {
  background: #fff;
  border: 1.5px solid #d5cbbd;
  border-radius: 14px;
  padding: 16px 14px;
  width: 100%;
  font-size: 1.35rem; /* grand + pas de zoom iOS (<16px) */
  min-height: 56px;
  letter-spacing: 0.02em;
}
.answer-input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(16, 36, 63, 0.12);
}
.question, .review, .card-drill { padding: 14px 14px 18px; margin-bottom: 12px; }
.expr { font-family: Georgia, serif; font-size: 1.2rem; line-height: 1.45; overflow-x: auto; }
.expr.big { font-size: 1.9rem; }
.frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: 0.92em; margin: 0 4px; }
.frac span:first-child { border-bottom: 1px solid currentColor; padding: 0 4px; }
.fig { width: min(100%, 280px); height: auto; max-width: 100%; }
.fig.wide { width: 100%; max-width: 100%; }
.field { border: 0; margin: 12px 0; padding: 0; }
.field legend, .text-field span { display: block; margin-bottom: 6px; color: var(--muted); }
.choice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 10px;
  line-height: 1.35;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 8px;
  background: #fff;
  min-height: 48px;
}
.choice input { width: 20px; height: 20px; margin-top: 2px; flex: 0 0 auto; }
.progress-label { color: var(--muted); font-size: 0.92rem; }

.correction { margin-top: 12px; border-radius: 12px; padding: 12px 12px; }
.correction.good { background: var(--good-bg); }
.correction.bad { background: var(--bad-bg); }
.correction.mid { background: var(--mid-bg); }
.correction h3 { margin-top: 0; }
.correction.good h3 { color: var(--good); }
.correction.bad h3 { color: var(--bad); }
.correction.mid h3 { color: var(--mid); }
.steps { padding-left: 1.15rem; }
.steps li { margin: 0.35rem 0; }
.trap { border-left: 3px solid var(--bad); padding-left: 10px; }
.result-line { font-size: 1.05rem; }
.fine { color: var(--muted); font-size: 0.88rem; }
.muted { color: var(--muted); }

.exam-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 10px;
  position: sticky;
  top: calc(var(--topbar-h) + var(--safe-top));
  z-index: 5;
  background: var(--paper);
  padding: 8px 0;
}
.exam-bar strong { font-variant-numeric: tabular-nums; font-size: 1.15rem; }
.exam-bar .primary, .exam-bar .ghost {
  width: auto;
  min-height: 40px;
  padding: 8px 12px;
  font-size: 0.92rem;
}
.dots {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.dot {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}
.dot.on { background: var(--navy); color: white; border-color: var(--navy); }
.dot.filled { box-shadow: inset 0 -3px 0 var(--sea); }
.card-back { font-size: 1.15rem; line-height: 1.45; }
.flash { min-height: 1.2em; color: var(--bad); }
.memo { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.memo th, .memo td { text-align: left; vertical-align: top; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.memo th { width: 38%; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(16, 36, 63, 0.5);
  display: grid;
  place-items: end center;
  padding: 0;
  z-index: 50;
}
.modal.hidden { display: none; }
.modal-card {
  background: var(--card);
  width: 100%;
  max-height: 88dvh;
  border-radius: 18px 18px 0 0;
  padding: 14px 14px calc(14px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
}
.modal-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.modal-card header button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 8px 12px;
}
.table-scroll { overflow: auto; -webkit-overflow-scrolling: touch; }
.modal table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.9rem; }
.modal th, .modal td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.modal td:first-child, .modal th:first-child { text-align: left; }

.method-steps { padding-left: 1.15rem; line-height: 1.5; }
.method-steps li { margin: 0.5rem 0; }
.stage-list { list-style: none; padding: 0; margin: 0 0 12px; }
.stage-list li { padding: 8px 0; }
.stage-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 6px;
}
.stage-block h2 { margin: 0; font-size: 1.1rem; }
.skill-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 10px;
}
.skill-chip {
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 14px;
  min-height: 56px;
}
.skill-chip strong { display: block; margin-bottom: 4px; }
.skill-chip span { color: var(--muted); font-size: 0.86rem; }
.skill-chip.current { border-color: var(--sea); box-shadow: inset 0 0 0 1px var(--sea); }
.skill-chip.done { background: var(--good-bg); border-color: #b7d8c4; }
.skill-bar { align-items: stretch; }
.streak-meter { width: 100%; }
.streak-meter .bar { margin-top: 4px; }
.rule-box, .rule-reminder {
  background: var(--mid-bg);
  border-left: 3px solid var(--gold);
  padding: 10px 12px;
  border-radius: 0 10px 10px 0;
}
.flash-banner {
  border-radius: 12px;
  padding: 12px 12px;
  margin-bottom: 12px;
}
.flash-banner.level { background: var(--mid-bg); }
.flash-banner.master { background: var(--good-bg); }
.flash-banner p { margin: 4px 0 0; }
.session-tip { margin-top: -4px; margin-bottom: 12px; }

.sticky-actions {
  position: sticky;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 6px);
  z-index: 4;
  background: linear-gradient(180deg, transparent, var(--paper) 28%);
  padding-top: 10px;
  padding-bottom: 4px;
}

.math-kb {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 8px 0 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdf8;
}
.math-kb[hidden] { display: none !important; }
.math-kb button {
  min-height: 48px;
  border: 1px solid #d5cbbd;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0 4px;
  line-height: 1;
}
.math-kb button:active {
  background: #efe6d6;
  border-color: var(--navy);
}
.math-kb .kb-frac {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}
.math-kb .kb-go {
  grid-column: span 4;
  background: var(--navy);
  color: #fffdf8;
  border-color: var(--navy);
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}
.math-kb .kb-go:active { background: var(--navy-2); }
.install-tip {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: #efe6d6;
  border: 1px solid var(--line);
}
.install-tip p { margin: 0 0 10px; }
.sheet-link.install-link {
  background: var(--navy);
  color: #fffdf8;
  border-color: var(--navy);
}
.install-hint {
  margin: 12px 4px 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}
/* ---------- feedback motion ---------- */
@keyframes pop-ok {
  0% { transform: scale(0.96); opacity: 0.4; }
  55% { transform: scale(1.02); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes shake-wrong {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
@keyframes celebrate-in {
  0% { transform: translate(-50%, -50%) scale(0.4); opacity: 0; }
  40% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}
@keyframes spark-fly {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; }
}
.correction.pop-ok { animation: pop-ok 0.45s ease-out; }
.correction.pop-bad { animation: pop-ok 0.35s ease-out; }
.shake-wrong { animation: shake-wrong 0.4s ease-in-out; }
.celebrate {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}
.celebrate-check {
  position: absolute;
  top: 42%;
  left: 50%;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--good);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 700;
  box-shadow: 0 12px 32px rgba(28, 107, 69, 0.35);
  animation: celebrate-in 0.9s ease-out forwards;
}
.celebrate .spark {
  position: absolute;
  top: 42%;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  animation: spark-fly 0.85s ease-out forwards;
}
.celebrate .s0 { --dx: -70px; --dy: -90px; background: #1d6a62; }
.celebrate .s1 { --dx: 80px; --dy: -70px; background: #9a6b24; }
.celebrate .s2 { --dx: -90px; --dy: 20px; background: #1c6b45; }
.celebrate .s3 { --dx: 95px; --dy: 30px; background: #d7c39a; }
.celebrate .s4 { --dx: -40px; --dy: -110px; background: #2f8f86; }
.celebrate .s5 { --dx: 50px; --dy: -100px; background: #8a5a12; }
.celebrate .s6 { --dx: -100px; --dy: -40px; background: #1a3c66; }
.celebrate .s7 { --dx: 110px; --dy: -20px; background: #1c6b45; }
.celebrate .s8 { --dx: -60px; --dy: 80px; background: #9a6b24; }
.celebrate .s9 { --dx: 70px; --dy: 85px; background: #1d6a62; }
.celebrate .s10 { --dx: 0px; --dy: -120px; background: #d7c39a; }
.celebrate .s11 { --dx: -20px; --dy: 100px; background: #10243f; }
.flash-ok { color: var(--good) !important; }
.flash-bad { color: var(--bad) !important; }

@media (prefers-reduced-motion: reduce) {
  .correction.pop-ok,
  .correction.pop-bad,
  .shake-wrong,
  .celebrate-check,
  .celebrate .spark { animation: none; }
  .celebrate { display: none; }
}

/* ---------- login ---------- */
.login-hero { max-width: 420px; }
.login-form { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.login-error {
  background: var(--bad-bg);
  color: var(--bad);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 0 0 8px;
}
.login-hint { margin-top: 14px; }

/* ---------- games ---------- */
.game-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.game-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 12px;
  row-gap: 2px;
  text-align: left;
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  min-height: 88px;
}
.game-card:active { border-color: var(--navy); background: #f7f1e6; }
.game-ico {
  grid-row: 1 / span 3;
  align-self: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #efe6d6;
  color: var(--navy);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  font-weight: 700;
}
.game-card strong { font-size: 1.05rem; }
.game-card span { color: var(--muted); font-size: 0.9rem; line-height: 1.35; }
.game-score {
  grid-column: 2;
  color: var(--sea);
  font-style: normal;
  font-size: 0.82rem;
  margin-top: 4px;
}
.table-pick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.table-pick {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  padding: 12px 8px;
  min-height: 64px;
}
.table-pick strong { display: block; font-size: 0.95rem; }
.table-pick span { color: var(--muted); font-size: 0.75rem; }
.miss-list { margin: 0; padding-left: 1.2rem; }
.miss-list li { margin: 6px 0; }
.flash { min-height: 1.2em; color: var(--muted); font-weight: 600; }
.game-q .flash { color: var(--sea); }

@media (min-width: 860px) {
  .game-grid { grid-template-columns: repeat(2, 1fr); }
  .table-pick-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ---------- desktop ---------- */
@media (min-width: 860px) {
  :root {
    --topbar-h: 0px;
    --tabbar-h: 0px;
  }
  #shell {
    display: grid;
    grid-template-columns: 250px 1fr;
    padding: 0;
    min-height: 100vh;
  }
  #sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    overflow: auto;
  }
  #topbar {
    position: static;
    height: auto;
    padding: 0;
    box-shadow: none;
  }
  #more-btn { display: none; }
  #brand { padding: 0; }
  #brand small { max-width: none; white-space: normal; }
  .mark { width: 36px; height: 36px; border-radius: 10px; }
  .aside-note {
    display: block;
    margin-top: auto;
    color: #c9bfae;
    font-size: 0.86rem;
    line-height: 1.4;
  }

  #tabbar {
    position: static;
    height: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: transparent;
    border: 0;
    overflow: visible;
  }
  #tabbar .mob-tab { display: none; }
  #tabbar .desk-tab { display: flex; }
  #tabbar button {
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    min-height: 42px;
    padding: 9px 10px;
    font-size: 0.95rem;
    color: #efe6d6;
  }
  #tabbar button .tab-ico { font-size: 1rem; width: 1.2em; text-align: center; }
  #tabbar button.on { background: rgba(255, 255, 255, 0.08); }

  #more-sheet { display: none !important; }

  main {
    max-width: 1100px;
    padding: 32px 4vw 80px;
    margin: 0;
  }

  .hero-actions, .row-actions, .course-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .primary, .ghost { width: auto; min-width: 140px; }
  .grid-3 { gap: 12px; }
  .stat { padding: 18px 16px 20px; gap: 10px; }
  .stat span { font-size: 0.8rem; }
  .stat strong { font-size: 1.7rem; }
  .split { grid-template-columns: 260px 1fr; align-items: start; }
  .course-list {
    display: flex;
    flex-direction: column;
    overflow: auto;
    max-height: calc(100vh - 36px);
    position: sticky;
    top: 18px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--card);
  }
  .course-link { max-width: none; min-width: 0; width: 100%; }
  .skill-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
  .exam-bar { position: static; background: transparent; padding: 0; }
  .dots { flex-wrap: wrap; overflow: visible; }
  .modal { place-items: center; padding: 24px; }
  .modal-card {
    width: min(720px, 100%);
    max-height: 86vh;
    border-radius: 16px;
    padding: 16px 18px 18px;
  }
  .sticky-actions {
    position: static;
    background: transparent;
    padding-top: 0;
  }
  .prose { padding: 28px 32px 36px; }
  .question, .review, .card-drill { padding: 22px 24px 26px; }
  h1 { font-size: clamp(2rem, 4vw, 3.4rem); }
}
