:root {
  color-scheme: light;
  --canvas: #f5f3ee;
  --canvas-raised: #fbfaf7;
  --surface: rgba(255, 255, 255, 0.76);
  --surface-solid: #ffffff;
  --surface-soft: #eeece6;
  --text: #1d2420;
  --text-soft: #65706a;
  --line: rgba(29, 36, 32, 0.12);
  --accent: #146c4a;
  --accent-hover: #0d593c;
  --accent-soft: #dcece4;
  --accent-ink: #f7fffa;
  --warm: #e8793d;
  --warm-soft: #f9e6da;
  --danger: #b83a3a;
  --danger-soft: #f9e2e0;
  --shadow: 0 20px 60px rgba(36, 43, 38, 0.09);
  --shadow-small: 0 8px 24px rgba(36, 43, 38, 0.07);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --focus: 0 0 0 4px rgba(20, 108, 74, 0.2);
  --max-width: 1180px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #111613;
  --canvas-raised: #171d19;
  --surface: rgba(31, 39, 34, 0.82);
  --surface-solid: #1d2520;
  --surface-soft: #252e29;
  --text: #f2f5f1;
  --text-soft: #a6b0aa;
  --line: rgba(242, 245, 241, 0.12);
  --accent: #62c997;
  --accent-hover: #7ad7a9;
  --accent-soft: #203e30;
  --accent-ink: #0b2015;
  --warm: #f49a68;
  --warm-soft: #4a2e21;
  --danger: #ff8585;
  --danger-soft: #4b2628;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  --shadow-small: 0 8px 28px rgba(0, 0, 0, 0.22);
  --focus: 0 0 0 4px rgba(98, 201, 151, 0.22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 0%, rgba(232, 121, 61, 0.09), transparent 34rem),
    radial-gradient(circle at 94% 20%, rgba(20, 108, 74, 0.09), transparent 32rem),
    var(--canvas);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.28;
  background-image: linear-gradient(rgba(120,120,120,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(120,120,120,.05) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -0.035em; line-height: 1.08; }
h1 { font-size: clamp(2.5rem, 7vw, 5.8rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.7rem); }
h3 { font-size: 1.2rem; }

.shell { width: min(calc(100% - 40px), var(--max-width)); margin-inline: auto; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 10px; background: var(--text); color: var(--canvas); }
.skip-link:focus { top: 16px; }
.topbar, .practice-topbar {
  width: min(calc(100% - 40px), var(--max-width));
  min-height: 76px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.topbar-sticky {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  padding-inline: max(20px, calc((100vw - var(--max-width)) / 2));
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--canvas) 86%, transparent);
  backdrop-filter: blur(22px) saturate(130%);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 760; letter-spacing: -0.025em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--accent); color: var(--accent-ink); font-family: Georgia, serif; font-weight: 700; }
.nav-actions, .hero-actions, .today-actions, .summary-actions, .admin-actions, .dialog-actions { display: flex; align-items: center; gap: 10px; }

.button, .icon-button, .mode-card, .segment, .text-button, .choice {
  border: 0;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-solid);
  color: var(--text);
  text-decoration: none;
  font-weight: 670;
  box-shadow: 0 1px 0 rgba(255,255,255,.4) inset;
}
.button:hover, .mode-card:hover, .choice:hover { transform: translateY(-1px); box-shadow: var(--shadow-small); }
.button:active, .mode-card:active, .choice:active { transform: scale(.985); }
.button-primary { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.button-primary:hover { background: var(--accent-hover); }
.button-quiet { background: var(--surface); }
.button-danger { border-color: var(--danger); background: var(--danger); color: #fff; }
.button-small { min-height: 40px; padding: 8px 14px; font-size: .9rem; }
.button-full { width: 100%; }
.button[disabled], button[disabled] { cursor: not-allowed; opacity: .5; transform: none; box-shadow: none; }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); font-size: 1.2rem; }
.text-button { padding: 8px 0; background: transparent; font-weight: 650; }
.danger-text { color: var(--danger); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: none; box-shadow: var(--focus); }

.eyebrow { margin-bottom: 10px; color: var(--accent); font-size: .76rem; font-weight: 780; letter-spacing: .14em; text-transform: uppercase; }
.pill, .memory-badge { display: inline-flex; align-items: center; width: fit-content; padding: 5px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .75rem; font-weight: 750; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.card, .primary-surface, .section-block, .auth-card, .preview-card, .question-card, .summary-card {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(120%);
  box-shadow: var(--shadow-small);
}

/* Landing */
.landing { padding: 78px 0 40px; }
.hero { min-height: 590px; display: grid; grid-template-columns: 1.2fr .8fr; align-items: center; gap: clamp(44px, 8vw, 110px); }
.hero h1 { max-width: 820px; margin-bottom: 24px; }
.hero h1 span { color: var(--accent); font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 500; }
.hero-lede { max-width: 650px; margin-bottom: 32px; color: var(--text-soft); font-size: clamp(1.05rem, 2vw, 1.25rem); }
.preview-card { position: relative; overflow: hidden; padding: 28px; border-radius: var(--radius-xl); transform: rotate(2deg); }
.preview-card::after { content: ""; position: absolute; width: 150px; height: 150px; right: -55px; bottom: -70px; border-radius: 50%; background: var(--warm-soft); }
.preview-card > * { position: relative; z-index: 1; }
.preview-top { display: flex; align-items: center; gap: 12px; color: var(--text-soft); font-size: .82rem; font-weight: 680; }
.preview-top .pill { margin-left: auto; }
.preview-prompt { margin: 70px 0 12px; color: var(--text-soft); }
.preview-answer { margin-bottom: 70px; font-family: Georgia, serif; font-size: clamp(2rem, 4vw, 3.3rem); }
.preview-answer span { color: var(--warm); font-size: .6em; }
.memory-line { display: flex; justify-content: space-between; margin-bottom: 10px; color: var(--text-soft); font-size: .82rem; }
.memory-line strong { color: var(--text); }
.progress-track { height: 8px; overflow: hidden; border-radius: 99px; background: var(--surface-soft); }
.progress-track span { display: block; height: 100%; width: 62%; border-radius: inherit; background: var(--accent); transition: width 300ms ease; }
.method-section { padding: 100px 0 80px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 40px; margin-bottom: 34px; }
.section-heading h2 { max-width: 700px; margin: 0; }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.feature-card { min-height: 250px; padding: 26px; border-top: 1px solid var(--line); }
.feature-card:nth-child(even) { margin-top: 38px; }
.feature-card h3 { margin: 48px 0 12px; }
.feature-card p { color: var(--text-soft); }
.step-number { color: var(--warm); font: italic 1.1rem Georgia, serif; }
.footer { display: flex; justify-content: space-between; padding: 30px 0 45px; border-top: 1px solid var(--line); color: var(--text-soft); font-size: .9rem; }
.footer p { margin: 0; }

/* Authentication */
.auth-shell { min-height: calc(100vh - 76px); display: grid; grid-template-columns: 1fr 460px; align-items: center; gap: clamp(50px, 10vw, 150px); padding-block: 60px; }
.auth-intro h1 { max-width: 650px; margin-bottom: 24px; font-size: clamp(3rem, 6vw, 5.4rem); }
.auth-intro > p:not(.eyebrow) { max-width: 580px; color: var(--text-soft); font-size: 1.12rem; }
.auth-proof { display: flex; flex-direction: column; width: fit-content; margin-top: 50px; padding-left: 18px; border-left: 3px solid var(--warm); }
.auth-proof strong { font-size: 1.4rem; }
.auth-proof span { color: var(--text-soft); }
.auth-card { padding: 32px; border-radius: var(--radius-xl); }
.auth-card h2 { margin: 34px 0 26px; font-size: 1.8rem; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 12px; background: var(--surface-soft); }
.segment { min-height: 38px; border-radius: 9px; background: transparent; color: var(--text-soft); font-weight: 680; }
.segment.is-active { background: var(--surface-solid); color: var(--text); box-shadow: 0 2px 10px rgba(0,0,0,.08); }
label { display: block; margin-bottom: 7px; font-size: .86rem; font-weight: 680; }
input, select, textarea {
  width: 100%;
  min-height: 48px;
  margin: 0 0 18px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: color-mix(in srgb, var(--surface-solid) 86%, transparent);
  color: var(--text);
}
textarea { min-height: 130px; resize: vertical; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--text-soft) 75%, transparent); }
.field-note { margin: -12px 0 18px; color: var(--text-soft); font-size: .78rem; }
.form-message { min-height: 24px; margin: 15px 0 0; color: var(--danger); font-size: .86rem; }
.form-message.success { color: var(--accent); }

/* Dashboard */
.dashboard { padding: 54px 0 90px; }
.dashboard-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 32px; }
.dashboard-heading h1 { margin: 0; font-size: clamp(2.4rem, 5vw, 4.2rem); }
.goal-control { width: 180px; }
.goal-control select { margin: 0; }
.today-grid { display: grid; grid-template-columns: 1.45fr .75fr; gap: 16px; }
.today-card, .rhythm-card { min-height: 280px; padding: 32px; border-radius: var(--radius-xl); }
.primary-surface { background: linear-gradient(140deg, color-mix(in srgb, var(--accent-soft) 74%, var(--surface-solid)), var(--surface)); }
.card-kicker { display: flex; align-items: center; gap: 12px; color: var(--accent); font-size: .8rem; font-weight: 750; text-transform: uppercase; letter-spacing: .1em; }
.today-number { display: flex; align-items: baseline; gap: 12px; margin: 30px 0 4px; }
.today-number strong { font-size: clamp(3.5rem, 7vw, 5.6rem); letter-spacing: -.07em; line-height: 1; }
.today-number span { color: var(--text-soft); font-weight: 650; }
.today-card > p { margin-bottom: 26px; color: var(--text-soft); }
.rhythm-card { display: flex; align-items: center; gap: 28px; }
.ring { --goal: 0deg; flex: 0 0 auto; width: 112px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--warm) var(--goal), var(--surface-soft) 0); position: relative; }
.ring::before { content: ""; position: absolute; width: 84px; aspect-ratio: 1; border-radius: 50%; background: var(--canvas-raised); }
.ring span { position: relative; z-index: 1; font-weight: 760; }
.card-label { margin-bottom: 8px; color: var(--text-soft); font-size: .75rem; font-weight: 760; letter-spacing: .12em; text-transform: uppercase; }
.rhythm-card h2 { margin-bottom: 8px; }
.rhythm-card p:last-child { margin: 0; color: var(--text-soft); font-size: .86rem; }
.stats-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin: 18px 0 70px; padding: 22px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats-strip > div { padding: 4px 26px; border-right: 1px solid var(--line); }
.stats-strip > div:first-child { padding-left: 0; }
.stats-strip > div:last-child { border: 0; }
.stats-strip span, .stats-strip small { display: block; color: var(--text-soft); }
.stats-strip strong { display: block; margin: 4px 0; font-size: 1.8rem; letter-spacing: -.04em; }
.stats-strip small { font-size: .76rem; }
.section-block { margin-top: 22px; padding: 34px; border-radius: var(--radius-xl); }
.section-heading.compact { align-items: center; margin-bottom: 28px; }
.section-heading.compact .eyebrow { margin-bottom: 7px; }
.section-heading.compact h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
.section-heading.compact > p { max-width: 440px; margin: 0; color: var(--text-soft); font-size: .88rem; }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode-card { min-height: 100px; display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-solid); text-align: left; }
.mode-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: var(--accent-soft); color: var(--accent); font-size: 1.5rem; }
.mode-card strong, .mode-card small { display: block; }
.mode-card strong { margin-bottom: 3px; font-size: 1.04rem; }
.mode-card small { color: var(--text-soft); }
.mode-meta { color: var(--accent); font-size: .74rem; font-weight: 720; }
.session-size { display: grid; grid-template-columns: 240px 1fr 70px; align-items: center; gap: 16px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.session-size label, .session-size input { margin: 0; }
input[type="range"] { min-height: auto; padding: 0; accent-color: var(--accent); }
.session-size output { font-size: .86rem; font-weight: 680; text-align: right; }
.split-section { display: grid; grid-template-columns: 1.4fr .8fr; gap: 30px; }
.roadmap { margin: 0; padding: 0; list-style: none; }
.roadmap li { display: grid; grid-template-columns: 34px 1fr auto; gap: 14px; align-items: start; padding: 17px 0; border-top: 1px solid var(--line); }
.roadmap li > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-soft); color: var(--text-soft); font-size: .78rem; font-weight: 750; }
.roadmap li.is-current > span { background: var(--accent); color: var(--accent-ink); }
.roadmap strong { font-size: .98rem; }
.roadmap p { margin: 3px 0 0; color: var(--text-soft); font-size: .83rem; }
.roadmap small { padding-top: 5px; color: var(--text-soft); font-size: .72rem; }
.skill-balance { align-self: start; padding: 24px; border-radius: var(--radius-lg); }
.skill-balance h3 { margin-bottom: 25px; }
.skill-row { display: grid; grid-template-columns: 1fr 90px 24px; align-items: center; gap: 10px; margin-bottom: 17px; font-size: .78rem; }
.skill-row > div { height: 6px; overflow: hidden; border-radius: 10px; background: var(--surface-soft); }
.skill-row i { display: block; width: 0%; height: 100%; background: var(--warm); border-radius: inherit; transition: width 300ms ease; }
.skill-row strong { text-align: right; }
.history-list { display: grid; gap: 10px; }
.history-item { display: grid; grid-template-columns: 1fr auto auto; gap: 20px; align-items: center; padding: 15px 18px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-solid); }
.history-item strong { font-size: .9rem; }
.history-item span, .history-item time { color: var(--text-soft); font-size: .8rem; }
.empty-state { margin: 10px 0; color: var(--text-soft); text-align: center; }
.admin-panel { border-color: color-mix(in srgb, var(--warm) 40%, var(--line)); }
.invite-chip { padding: 8px 13px; border-radius: 999px; background: var(--warm-soft); color: var(--warm); font-size: .82rem; }
.admin-panel > p { color: var(--text-soft); }

/* Dialog */
.dialog { width: min(calc(100% - 30px), 560px); max-height: 90vh; overflow: auto; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--canvas-raised); color: var(--text); box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(7, 12, 9, .55); backdrop-filter: blur(8px); }
.dialog-small { max-width: 440px; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.dialog-heading h2 { margin: 0; }
.dialog-actions { justify-content: flex-end; margin-top: 24px; }
.search-results { display: grid; gap: 5px; max-height: 180px; overflow: auto; margin: -10px 0 18px; }
.search-result { min-height: 42px; padding: 8px 11px; border: 0; border-radius: 9px; background: var(--surface-soft); color: var(--text); text-align: left; cursor: pointer; }

/* Practice */
.practice-topbar { position: relative; width: min(calc(100% - 40px), 1040px); padding-top: 10px; }
.practice-progress-wrap { width: min(50vw, 520px); }
.practice-meta { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--text-soft); font-size: .76rem; font-weight: 650; }
.practice-shell { width: min(calc(100% - 40px), 820px); padding: 28px 0 70px; }
.question-card { min-height: 520px; display: flex; flex-direction: column; padding: clamp(26px, 5vw, 52px); border-radius: var(--radius-xl); }
.question-heading { display: flex; justify-content: space-between; gap: 15px; min-height: 28px; }
.memory-badge { background: var(--warm-soft); color: var(--warm); }
.question-instruction { margin: 30px 0 10px; color: var(--text-soft); text-align: center; }
#question-title { margin: 0 0 28px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.1rem, 6vw, 4.5rem); font-weight: 500; text-align: center; }
.question-subtitle { max-width: 600px; margin: -16px auto 26px; color: var(--text-soft); text-align: center; }
.answer-area { width: min(100%, 580px); margin: 0 auto; }
.answer-row { display: grid; grid-template-columns: 140px 1fr; align-items: center; gap: 12px; margin-bottom: 12px; }
.answer-row label, .answer-row input { margin: 0; }
.choice-list { display: grid; gap: 9px; }
.choice { min-height: 52px; display: flex; align-items: center; gap: 12px; padding: 11px 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-solid); color: var(--text); text-align: left; }
.choice::before { content: attr(data-key); width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 8px; color: var(--text-soft); font-size: .75rem; }
.choice.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.choice.is-correct { border-color: var(--accent); background: var(--accent-soft); }
.choice.is-wrong { border-color: var(--danger); background: var(--danger-soft); }
.choice:disabled { color: var(--text); cursor: default; opacity: 1; transform: none; box-shadow: none; }
.word-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; }
.word-fact { padding: 14px; border-radius: 13px; background: var(--surface-soft); }
.word-fact span, .word-fact strong { display: block; }
.word-fact span { margin-bottom: 4px; color: var(--text-soft); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.listen-button, .speak-button { margin: 0 auto 28px; }
.feedback { width: min(100%, 580px); margin: 24px auto 0; padding: 16px 18px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); }
.feedback.is-wrong { background: var(--danger-soft); color: var(--danger); }
.feedback strong, .feedback span { display: block; }
.feedback span { margin-top: 4px; color: var(--text); font-size: .9rem; }
.question-actions { display: flex; justify-content: center; gap: 10px; margin-top: auto; padding-top: 30px; }
.keyboard-hint { margin: 16px 0 -18px; color: var(--text-soft); font-size: .72rem; text-align: center; }
kbd { padding: 2px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--surface-soft); font-family: inherit; }
.session-note { max-width: 650px; margin: 18px auto 0; color: var(--text-soft); font-size: .8rem; text-align: center; }
.self-rating { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.exam-passage { padding: 20px; border-left: 3px solid var(--warm); border-radius: 0 14px 14px 0; background: var(--surface-soft); white-space: pre-line; }

/* Summary */
.summary-shell { min-height: calc(100vh - 76px); display: grid; place-items: center; padding: 50px 0 90px; }
.summary-card { width: min(100%, 700px); padding: clamp(32px, 6vw, 60px); border-radius: var(--radius-xl); text-align: center; }
.completion-mark { width: 64px; height: 64px; display: grid; place-items: center; margin: 0 auto 25px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 2rem; }
.summary-card h1 { margin-bottom: 15px; font-size: clamp(3rem, 7vw, 5rem); }
.summary-message { color: var(--text-soft); }
.xp-result { display: grid; gap: 2px; margin: 36px 0; padding: 24px; border-radius: var(--radius-lg); background: var(--accent-soft); }
.xp-result > span:first-child { color: var(--accent); font-size: .78rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.xp-result strong { color: var(--accent); font-size: 2.8rem; }
.xp-result > span:last-child { font-size: .82rem; }
.result-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.result-grid div { padding: 18px 10px; border-radius: 14px; background: var(--surface-soft); }
.result-grid span, .result-grid strong { display: block; }
.result-grid span { margin-bottom: 5px; color: var(--text-soft); font-size: .74rem; }
.result-grid strong { font-size: 1.25rem; }
.summary-actions { justify-content: center; margin-top: 30px; }

[hidden] { display: none !important; }

@media (max-width: 860px) {
  .hero, .auth-shell, .today-grid, .split-section { grid-template-columns: 1fr; }
  .hero { padding-top: 30px; }
  .preview-card { max-width: 520px; transform: none; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .feature-card:nth-child(even) { margin-top: 0; }
  .auth-shell { align-content: center; }
  .auth-intro { text-align: center; }
  .auth-intro > p, .auth-proof { margin-inline: auto; }
  .stats-strip { grid-template-columns: 1fr 1fr; }
  .stats-strip > div { border-bottom: 1px solid var(--line); }
  .stats-strip > div:nth-child(2) { border-right: 0; }
  .stats-strip > div:nth-child(3), .stats-strip > div:nth-child(4) { border-bottom: 0; }
  .stats-strip > div:nth-child(3) { padding-left: 0; }
}

@media (max-width: 620px) {
  .shell, .topbar, .practice-topbar { width: min(calc(100% - 24px), var(--max-width)); }
  .topbar { min-height: 64px; }
  .topbar-sticky { width: 100%; padding-inline: 12px; }
  .nav-actions .pill { display: none; }
  .landing { padding-top: 45px; }
  .hero { min-height: auto; }
  .hero-actions, .today-actions, .summary-actions { align-items: stretch; flex-direction: column; }
  .feature-grid, .mode-grid { grid-template-columns: 1fr; }
  .method-section { padding-block: 70px; }
  .footer { flex-direction: column; gap: 6px; }
  .dashboard { padding-top: 35px; }
  .dashboard-heading, .section-heading { align-items: stretch; flex-direction: column; }
  .goal-control { width: 100%; }
  .today-card, .rhythm-card, .section-block { padding: 23px; }
  .rhythm-card { align-items: flex-start; flex-direction: column; }
  .stats-strip > div { padding: 14px 16px; }
  .stats-strip > div:nth-child(odd) { padding-left: 0; }
  .mode-card { grid-template-columns: 44px 1fr; }
  .mode-meta { grid-column: 2; }
  .session-size { grid-template-columns: 1fr 60px; }
  .session-size label { grid-column: 1 / -1; }
  .roadmap li { grid-template-columns: 32px 1fr; }
  .roadmap small { grid-column: 2; }
  .history-item { grid-template-columns: 1fr auto; }
  .history-item time { grid-column: 1 / -1; }
  .practice-topbar { min-height: 82px; }
  .practice-topbar .brand { font-size: 0; gap: 0; }
  .practice-progress-wrap { width: 100%; }
  .practice-shell { padding-top: 25px; }
  .question-card { min-height: calc(100vh - 140px); }
  .answer-row { grid-template-columns: 1fr; gap: 5px; }
  .word-facts, .result-grid { grid-template-columns: 1fr 1fr; }
  .keyboard-hint { display: none; }
}

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

@media (prefers-contrast: more) {
  :root { --line: rgba(0,0,0,.34); }
  html[data-theme="dark"] { --line: rgba(255,255,255,.38); }
  .button, .mode-card, input, select, textarea { border-width: 2px; }
}
