:root {
  color-scheme: light dark;
  --canvas: #f7f2e9;
  --panel: #fffdf8;
  --subtle: #f3ebe8;
  --accent: #713957;
  --accent-ink: #fff9fa;
  --ink: #302331;
  --muted: #675a65;
  --line: #e6d8dd;
  --focus: #ad4d7e;
  --hero: #54304c;
  --hero-text: #fff7f5;
  --hero-control: #68415e;
  font-family: "DM Sans", system-ui, sans-serif;
  background: var(--canvas);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; }
header {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .85rem max(1rem, calc((100vw - 820px) / 2));
  border-bottom: 1px solid var(--line);
  font-weight: 750;
}
header button { margin-left: auto; }
.mark {
  display: grid;
  place-items: center;
  flex: 0 0 2.25rem;
  height: 2.25rem;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: .8rem;
}
main {
  max-width: 854px;
  margin: auto;
  padding: 1.15rem 1rem max(3rem, env(safe-area-inset-bottom));
}
h1, .stats-grid dd {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 500;
}
h1 {
  font-size: clamp(2.35rem, 7vw, 4.2rem);
  line-height: 1;
  letter-spacing: -.045em;
  margin: .62em 0 .45em;
  overflow-wrap: anywhere;
}
h2, h3 { line-height: 1.25; margin: 0 0 .7rem; }
h2 { font-size: 1.16rem; }
h3 { font-size: 1rem; }
p, li { line-height: 1.55; overflow-wrap: anywhere; }
p { margin: .7rem 0; }
.card, .hero {
  border-radius: 1.45rem;
  padding: clamp(1rem, 4vw, 2rem);
  margin: 1rem 0;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 12px 26px rgb(48 35 49 / 4%);
}
.hero {
  color: var(--hero-text);
  background: radial-gradient(ellipse at 95% 5%, #75445f, transparent 62%), var(--hero);
}
.eyebrow { font-size: .82rem; font-weight: 750; margin: 0; }
.hero-description { font-size: clamp(1.08rem, 3.4vw, 1.55rem); max-width: 32ch; margin: .65rem 0 1.3rem; }
.hero select { color-scheme: dark; background: var(--hero-control); color: var(--hero-text); border-color: #b88fa9; }
.hero .start-lesson { background: #fce5ec; color: #3d1734; border-color: #fce5ec; margin-top: 1rem; }
.lesson-choices { display: grid; gap: .75rem; }
.account-bar, .row { display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; }
.account-bar { justify-content: space-between; margin-bottom: .85rem; color: var(--muted); }
.dashboard-nav {
  display: flex;
  overflow-x: auto;
  gap: .35rem;
  padding: .3rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--panel);
  scrollbar-width: thin;
}
.dashboard-nav button {
  flex: 1 0 auto;
  color: var(--muted);
  background: transparent;
  border: 0;
  padding-inline: .72rem;
}
.dashboard-nav [aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
form, label { display: grid; gap: .5rem; min-width: 0; }
form { gap: .85rem; }
label { font-size: .9rem; font-weight: 650; }
input, select, button {
  font: inherit;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: .7rem;
  padding: .65rem .85rem;
  color: var(--ink);
  background: var(--panel);
}
select { width: 100%; }
input[type="checkbox"] { width: 1.25rem; accent-color: var(--accent); }
button, summary { cursor: pointer; font-weight: 700; }
summary { padding-block: .45rem; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button:disabled { opacity: .65; cursor: default; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.status { color: var(--accent); font-weight: 700; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .6rem; }
.stats-grid div { background: var(--subtle); border-radius: .9rem; padding: .75rem; }
.stats-grid dt { color: var(--muted); font-size: .8rem; }
.stats-grid dd { font-size: 2rem; line-height: 1.15; margin: .25rem 0 0; }
.live-card progress { width: 100%; height: .65rem; display: block; accent-color: var(--accent); }
.live-card > button { margin: .5rem .4rem 0 0; }
.illustration:empty { display: none; }
.illustration img { display: block; width: 100%; height: auto; max-height: 18rem; object-fit: cover; border-radius: 1rem; margin: 0 0 1rem; }
.illustration button { margin: 0 0 .9rem; }
.export-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); font-weight: 650; }
.phase-time { font-variant-numeric: tabular-nums; font-size: .9rem; color: var(--muted); }
.trail, .bingo ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.trail li, .bingo li { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.trail li { border-left: 3px solid var(--line); padding: .2rem 0 .2rem .8rem; }
.trail li:has(button) { border-color: var(--accent); }
.trail small, .bingo small { color: var(--accent); }
.bingo li { justify-content: space-between; border: 1px solid var(--line); border-radius: .8rem; padding: .6rem; }
.blitz-review { border-top: 1px solid var(--line); padding-top: .8rem; margin: .8rem 0; }
@media (min-width: 600px) {
  main { padding-top: 1.6rem; }
  .lesson-choices { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
}
@media (max-width: 460px) {
  .hero .start-lesson { width: 100%; }
  .dashboard-nav button { padding-inline: .62rem; font-size: .86rem; }
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #221a24;
    --panel: #2e2330;
    --subtle: #392b3a;
    --accent: #efb5d0;
    --accent-ink: #321729;
    --ink: #fff0f6;
    --muted: #e0c6d6;
    --line: #61445b;
    --focus: #e3a3c4;
  }
}

.puzzle { margin: 1rem 0; padding: 1rem; background: var(--subtle); border-radius: 1rem; }

.milestone-list { display:flex; flex-wrap:wrap; gap:.5rem; list-style:none; padding:0; }
.milestone-list li { background:var(--subtle); border-radius:1rem; padding:.25rem .7rem; font-weight:700; }

button.danger { border-color: #a94762; color: var(--accent); }

textarea { font:inherit; color:var(--ink); background:var(--panel); border:1px solid var(--line); border-radius:.7rem; padding:.65rem .85rem; resize:vertical; }
.pattern-note { border-bottom:1px solid var(--line); margin-bottom:1rem; padding-bottom:.65rem; }
