/* G1 Drive — self-contained, mobile-first study interface. */
:root {
  --canvas: #f6f6f1;
  --paper: #fff;
  --ink: #202522;
  --muted: #6c726c;
  --line: #e3e6de;
  --coral: #c74336;
  --coral-dark: #bd382d;
  --coral-soft: #fff0eb;
  --green: #26735b;
  --green-soft: #edf5ed;
  --mustard: #d6a64b;
  --radius: 22px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, a, summary { touch-action: manipulation; }
button:focus-visible, a:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #bd8530;
  outline-offset: 4px;
}
img, svg { max-width: 100%; }
img { display: block; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.035em; }
p { line-height: 1.6; }
button { color: inherit; }
.icon { width: 22px; height: 22px; flex-shrink: 0; stroke-width: 1.8; vertical-align: middle; }
.hidden, [hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 100; transform: translateY(-180%); padding: 13px 18px; border-radius: 10px; background: var(--ink); color: white; font-size: 13px; }
.skip-link:focus { transform: none; }
.app-shell { min-height: 100vh; min-height: 100dvh; }
.sidebar { display: none; }
.main-shell { min-width: 0; }
.topbar {
  min-height: 76px; padding: 18px 20px; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line);
  background: var(--canvas);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-icon {
  width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px;
  background: var(--coral); color: white; font-size: 19px; font-weight: 800; letter-spacing: -.07em;
}
.brand-name { font-size: 22px; font-weight: 750; letter-spacing: -.05em; }
.brand-name > span { display: block; margin-top: 5px; font-size: 6px; font-weight: 700; letter-spacing: .13em; color: #7e8876; }
.brand-icon > span { display: none; }
.mobile-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.mobile-brand > strong { font-size: 22px; font-weight: 750; letter-spacing: -.05em; }
.page-label { display: none; color: var(--muted); font-size: 13px; }
.free-badge {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 7px 10px; border: 1px solid #dce5d8; border-radius: 100px;
  color: #456143; background: #edf2e7; font-size: 11px; font-weight: 650; white-space: nowrap;
}
.free-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
#app { width: 100%; max-width: 1232px; margin: 0 auto; padding: 25px 20px 36px; }
.view { animation: arrive .22s ease-out; }
.view-heading { margin: 0 0 24px; }
.eyebrow { margin: 0 0 10px; color: var(--green); font-weight: 700; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.page-title { font-size: clamp(28px, 5vw, 38px); line-height: 1.16; font-weight: 750; margin: 0 0 10px; }
.muted { color: var(--muted); }
.view-heading > p:last-child { margin-bottom: 0; font-size: 14px; }
.section-title { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.3; }
.home-grid { display: grid; gap: 16px; margin-bottom: 32px; }
.hero-card {
  position: relative; isolation: isolate; min-width: 0; overflow: hidden;
  border-radius: var(--radius); background: #e8eee2; padding: 28px 24px;
}
.hero-copy { position: relative; z-index: 2; }
.hero-copy > .tag { margin-bottom: 17px; background: #d9e5cf; color: #536b45; letter-spacing: .07em; font-size: 9px; padding: 6px 9px; }
.hero-copy > h2 { max-width: 360px; margin-bottom: 12px; font-size: 31px; line-height: 1.15; font-weight: 750; }
.hero-copy > p { max-width: 340px; color: #576153; font-size: 14px; margin-bottom: 21px; }
.hero-art { margin: 21px auto 0; max-width: 260px; }
.hero-art svg { display: block; width: 100%; height: auto; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 24px; margin: 23px 0; }
.stat-pair { display: flex; flex-direction: column; gap: 5px; font-size: 10px; color: #5f685a; }
.stat-pair strong { font-size: 12px; color: var(--ink); letter-spacing: -.015em; font-weight: 700; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.btn {
  min-height: 46px; border-radius: 12px; border: 1px solid transparent; padding: 12px 18px;
  display: inline-flex; justify-content: center; align-items: center; gap: 9px;
  text-decoration: none; font-size: 13px; font-weight: 650; line-height: 1.35;
  transition: background .16s, border-color .16s, transform .16s;
}
.btn-primary { background: var(--coral); color: white; }
.btn-primary:hover { background: var(--coral-dark); }
.btn-secondary { background: white; border-color: var(--line); }
.btn-secondary:hover { background: #f3f5ef; border-color: #c7cec1; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: #eaece4; color: var(--ink); }
.btn-small { font-size: 12px; padding: 10px 13px; min-height: 44px; }
.btn:disabled { background: #e5e7df; border-color: #e5e7df; color: #8e958b; transform: none; }
.progress-card { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.progress-card h2, .progress-card h3 { font-size: 16px; margin-bottom: 20px; }
.progress-card .section-header { align-items: center; margin-bottom: 22px; }
.progress-card .section-header h2 { margin: 0; }
.progress-card .section-header > .icon { width: 19px; height: 19px; color: #78866c; }
.progress-number { display: flex; align-items: baseline; gap: 7px; margin: 17px 0 6px; }
.progress-number strong { font-size: 51px; line-height: 1.1; font-weight: 750; letter-spacing: -.065em; }
.progress-number > span { font-size: 13px; color: #899080; }
.progress-card > .muted { font-size: 12px; margin: 0 0 22px; }
.progress-legend { display: flex; flex-wrap: wrap; gap: 15px; margin: 14px 0 20px; font-size: 10px; color: var(--muted); }
.progress-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 6px; height: 6px; border-radius: 2px; display: inline-block; }
.correct-dot { background: var(--green); }
.wrong-dot { background: #e59880; }
.text-link { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 12px; font-weight: 650; color: #52684c; text-decoration: none; }
.text-link:hover { color: var(--coral); }
.text-link .icon { width: 16px; height: 16px; }
.ring {
  --progress: 0; position: relative; display: grid; place-items: center; flex-shrink: 0;
  width: 132px; height: 132px; margin: 2px auto 18px; border-radius: 50%;
  background: conic-gradient(var(--green) calc(var(--progress) * 1%), #e9ede5 0);
}
.ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: white; }
.ring-value { position: relative; z-index: 1; text-align: center; line-height: 1.15; }
.ring-value strong { display: block; font-size: 32px; font-weight: 750; letter-spacing: -.06em; }
.ring-value span, .ring-value small { display: block; font-size: 11px; color: var(--muted); margin-top: 6px; }
.progress-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 12px; color: var(--muted); margin-bottom: 13px; }
.progress-meta strong { color: var(--ink); font-weight: 650; }
.mini-grid { display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); gap: 5px; }
.mini-square { width: 100%; aspect-ratio: 1; min-height: 6px; border-radius: 3px; background: #eef0e9; }
.mini-square.is-seen { background: #c8d6c3; }
.mini-square.is-mastered { background: var(--green); }
.mini-square.is-wrong { background: #e59880; }
.progress-card > p:last-child { margin: 13px 0 0; font-size: 11px; }
.section-header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 16px; }
.section-header > p, .section-header > span { margin: 0; color: var(--muted); font-size: 12px; }
.topics-grid { display: grid; gap: 10px; margin-bottom: 24px; }
.topic-card {
  text-align: left; display: flex; align-items: center; gap: 13px; width: 100%; min-width: 0;
  padding: 18px 16px; border: 1px solid var(--line); border-radius: 16px; background: white;
  transition: border-color .16s, background .16s, transform .16s;
}
.topic-card:hover { border-color: #b6c5ae; background: #fdfefb; transform: translateY(-1px); }
.topic-icon { display: grid; place-items: center; width: 42px; height: 42px; flex-shrink: 0; border-radius: 12px; background: #f1f3eb; color: #647259; }
.topic-card:nth-child(2) .topic-icon { background: #fbefe5; color: #bd7c40; }
.topic-card:nth-child(3) .topic-icon { background: #edf0f3; color: #657d8b; }
.topic-card:nth-child(4) .topic-icon { background: #eeedf6; color: #857499; }
.topic-card:nth-child(5) .topic-icon { background: #f8f0db; color: #ad863c; }
.topic-card:nth-child(6) .topic-icon { background: #f6eae6; color: #a96c60; }
.topic-copy { min-width: 0; flex: 1; }
.topic-copy h3, .topic-copy strong { display: block; font-size: 13px; font-weight: 650; letter-spacing: -.01em; margin: 0 0 6px; line-height: 1.35; }
.topic-copy p { font-size: 11px; color: var(--muted); margin: 0; line-height: 1.4; }
.topic-copy > span { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.45; }
.topic-copy > .topic-meta { margin-top: 9px; font-size: 10px; color: #899080; }
.topic-meta { color: var(--muted); font-size: 11px; line-height: 1.5; }
.topic-arrow { color: #89917f; flex-shrink: 0; }
.notice { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); background: #eeefe8; padding: 14px 16px; border-radius: 12px; font-size: 11px; line-height: 1.65; margin-top: 20px; }
.notice p { margin: 0; }
.notice .icon { width: 17px; height: 17px; margin-top: 1px; }
.practice-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.back-button { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; border: 0; padding: 6px 0; background: transparent; color: var(--muted); font-size: 12px; }
.back-button:hover { color: var(--ink); }
.session-label { font-size: 12px; font-weight: 650; color: var(--muted); }
.question-count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.question-count strong { color: var(--ink); }
.quiz-layout { display: grid; gap: 20px; align-items: start; }
.quiz-main { min-width: 0; }
.question-card { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 23px 20px; }
.question-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 18px; font-size: 10px; color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; background: #f0f3ea; color: #637159; font-weight: 650; border-radius: 6px; font-size: 10px; line-height: 1.4; }
.question-title { font-size: 22px; line-height: 1.35; margin: 0 0 22px; font-weight: 700; letter-spacing: -.025em; overflow-wrap: break-word; }
.question-visual { margin: 0 0 22px; padding: 16px; border: 1px solid #f0f0e8; border-radius: 14px; background: #fafbf7; display: grid; place-items: center; min-height: 132px; }
.question-visual img { width: auto; max-width: 100%; max-height: 170px; object-fit: contain; }
.question-visual figcaption { margin-top: 9px; color: var(--muted); font-size: 10px; text-align: center; }
.answers { display: grid; gap: 10px; }
.answer-option {
  min-height: 62px; width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 13px 14px; background: white; border: 1px solid #dfe3da; border-radius: 12px;
  line-height: 1.45; transition: border-color .15s, background .15s;
}
.answer-option:not(:disabled):hover { border-color: #b9c4b2; background: #fafbf7; }
.answer-letter { display: grid; place-items: center; width: 28px; height: 28px; flex-shrink: 0; border: 1px solid #e2e5dd; background: #f7f8f3; border-radius: 8px; font-size: 11px; font-weight: 650; color: #6a7362; }
.answer-copy { flex: 1; min-width: 0; font-size: 15px; }
.answer-status { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.answer-status:empty { display: none; }
.answer-option.is-selected { background: #fff5ee; border-color: var(--coral); box-shadow: inset 0 0 0 1px var(--coral); }
.answer-option.is-selected .answer-letter { background: var(--coral); border-color: var(--coral); color: white; }
.answer-option.is-correct, .answer-option.is-correct:disabled { background: #eef6ee; border-color: #78a78b; box-shadow: none; color: var(--ink); }
.answer-option.is-correct .answer-letter { background: var(--green); border-color: var(--green); color: white; }
.answer-option.is-correct .answer-status { color: var(--green); }
.answer-option.is-incorrect, .answer-option.is-incorrect:disabled { background: #fff1ed; border-color: #df8e79; box-shadow: none; color: var(--ink); }
.answer-option.is-incorrect .answer-letter { background: var(--coral); border-color: var(--coral); color: white; }
.answer-option.is-incorrect .answer-status { color: var(--coral); }
.answer-option:disabled { opacity: 1; color: #757c70; }
.feedback { margin-top: 18px; padding: 19px 18px; border-radius: 14px; background: #eff5eb; border: 1px solid #dce9d7; }
.feedback.is-success { background: #eff6ed; border-color: #dce9d7; }
.feedback.is-error { background: #fff4ec; border-color: #f0dfd1; }
.feedback-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; color: var(--green); }
.feedback.is-error .feedback-heading { color: #a95836; }
.feedback-title { font-size: 14px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.explanation { margin: 0; font-size: 14px; line-height: 1.65; color: #4f5b4b; }
.review-hint { margin: 12px 0 0; font-size: 12px; color: #8a654a; line-height: 1.6; }
.feedback.is-error .explanation { color: #6c5848; }
.source-details { margin-top: 13px; border-top: 1px solid rgba(67, 92, 58, .13); padding-top: 8px; font-size: 11px; }
.source-details summary { cursor: pointer; padding: 13px 0; min-height: 44px; color: #53664b; font-weight: 600; }
.source-details .icon { width: 13px; height: 13px; margin-left: 3px; }
.source-link { display: inline-block; margin-top: 5px; color: var(--green); overflow-wrap: anywhere; line-height: 1.65; }
.source-section { color: var(--muted); font-size: 11px; margin: 5px 0 0; line-height: 1.6; overflow-wrap: anywhere; }
.quiz-actions { margin-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.quiz-actions p { font-size: 11px; color: var(--muted); margin: 0; }
.check-button, .next-button { flex: 1; min-width: 140px; }
.quiz-aside { display: none; gap: 16px; }
.session-progress { padding: 22px; background: white; border: 1px solid var(--line); border-radius: 18px; }
.session-progress h2, .session-progress h3 { font-size: 14px; margin: 0 0 17px; }
.session-progress > p { font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.progress-track { width: 100%; height: 6px; overflow: hidden; border-radius: 20px; background: #e9ede4; margin: 13px 0; }
.progress-fill { display: block; height: 100%; min-width: 0; background: var(--green); border-radius: inherit; transition: width .25s ease; }
.mobile-progress { padding: 0; border: 0; border-radius: 0; background: transparent; margin: -5px 0 22px; }
.mobile-progress .progress-track { margin: 0; height: 4px; }
.session-pips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.pip { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: #edf0e7; color: #8a927f; font-size: 9px; font-weight: 600; }
.pip.is-complete { background: #d4e4ce; color: #426638; }
.pip.is-current { background: var(--coral); color: white; box-shadow: 0 0 0 3px #fbece5; }
.aside-tip { padding: 20px 22px; border-radius: 18px; background: #ecefe5; color: #5f6d54; }
.aside-tip h3 { font-size: 13px; font-weight: 650; margin: 0 0 9px; }
.aside-tip > .icon { margin-bottom: 12px; color: #8b9b73; }
.aside-tip p { font-size: 12px; line-height: 1.65; margin: 0; }
.empty-state { text-align: center; background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 50px 22px; }
.empty-icon { display: grid; place-items: center; width: 66px; height: 66px; background: #edf3e8; color: var(--green); border-radius: 21px; margin: 0 auto 22px; }
.empty-icon .icon { width: 29px; height: 29px; }
.empty-state h2 { font-size: 24px; margin-bottom: 10px; }
.empty-state p { max-width: 360px; margin: 0 auto 24px; font-size: 14px; color: var(--muted); }
.mistake-list { display: grid; gap: 12px; }
.review-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; background: #e9eee1; border-radius: 16px; padding: 18px 20px; margin-bottom: 22px; }
.review-banner > span { display: inline-flex; align-items: center; gap: 11px; }
.review-banner > span .icon { color: #5e7850; }
.review-banner strong { font-size: 13px; font-weight: 650; }
.mistake-item { display: flex; align-items: flex-start; gap: 14px; padding: 20px 18px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.mistake-number { width: 33px; height: 33px; flex-shrink: 0; display: grid; place-items: center; background: var(--coral-soft); color: var(--coral); border-radius: 10px; font-weight: 700; font-size: 12px; }
.mistake-copy { flex: 1; min-width: 0; }
.mistake-copy h2, .mistake-copy h3 { margin: 0 0 7px; font-size: 14px; line-height: 1.45; font-weight: 600; letter-spacing: -.01em; }
.mistake-copy .eyebrow { display: block; margin-bottom: 8px; font-size: 8px; }
.mistake-copy p { color: var(--muted); font-size: 11px; margin: 0; }
.mistake-action { flex-shrink: 0; align-self: center; }
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.metric-card { padding: 23px 18px; border-radius: 18px; border: 1px solid var(--line); background: white; }
.metric-number { display: block; font-size: 32px; font-weight: 750; line-height: 1.15; letter-spacing: -.06em; margin: 8px 0; }
.metric-label { font-size: 11px; color: var(--muted); line-height: 1.5; }
.metric-card > p { font-size: 10px; margin: 8px 0 0; line-height: 1.5; }
.metric-card > .icon { color: var(--green); width: 19px; height: 19px; }
.breakdown-list { background: white; border: 1px solid var(--line); padding: 22px 20px; border-radius: var(--radius); }
.breakdown-row { display: flex; align-items: center; gap: 12px; }
.breakdown-row + .breakdown-row { margin-top: 22px; }
.breakdown-label { flex: 1; min-width: 0; font-size: 12px; }
.breakdown-label > strong { display: block; margin-bottom: 9px; font-size: 12px; font-weight: 600; }
.breakdown-count { min-width: 40px; white-space: nowrap; color: var(--muted); font-size: 11px; text-align: right; }
.breakdown-row > .btn { padding-inline: 8px; min-width: 44px; }
.breakdown-row > .topic-icon { width: 34px; height: 34px; border-radius: 10px; }
.breakdown-row > .topic-icon .icon { width: 19px; height: 19px; }
.breakdown-track { height: 7px; border-radius: 10px; overflow: hidden; background: #edf0e8; }
.breakdown-fill { display: block; height: 100%; background: #6e9568; border-radius: inherit; }
.progress-callout { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; padding: 24px; margin-top: 24px; border-radius: 18px; background: #e8eee1; }
.progress-callout > div { flex: 1; min-width: 200px; }
.progress-callout .section-title { font-size: 17px; }
.progress-callout p { font-size: 12px; margin: 9px 0 0; max-width: 390px; }
.progress-footnote { font-size: 10px; color: #899080; margin: 7px 0 0; line-height: 1.6; }
.results-card { max-width: 640px; margin: 16px auto; padding: 36px 24px; text-align: center; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.results-card h1, .results-card h2 { font-size: 29px; margin-bottom: 13px; }
.results-card > p { font-size: 14px; color: var(--muted); }
.result-score { font-size: 60px; font-weight: 750; color: var(--green); letter-spacing: -.07em; line-height: 1; margin: 24px 0 13px; }
.result-score span, .result-score small { font-size: 27px; color: #94a18b; font-weight: 500; }
.result-score strong { font: inherit; }
.result-score > span { margin-left: 7px; }
.result-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 18px; padding-top: 8px; margin-bottom: 22px; color: var(--muted); font-size: 12px; }
.result-summary > span { display: inline-flex; align-items: center; gap: 6px; }
.result-summary .icon { width: 15px; height: 15px; }
.result-summary > span:first-child { color: var(--green); }
.results-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 28px; }
.results-actions .btn { flex: 1; min-width: 160px; }
.bottom-nav {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px;
  padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: rgba(255, 255, 252, .97);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.nav-link { text-decoration: none; border: 0; background: transparent; font-weight: 600; color: #777e73; }
.bottom-nav .nav-link { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; position: relative; min-height: 52px; border-radius: 11px; font-size: 10px; line-height: 1.3; }
.bottom-nav .nav-link.is-active { color: var(--coral); background: #fff3ec; }
.nav-count { display: inline-flex; align-items: center; justify-content: center; min-width: 19px; height: 19px; border-radius: 6px; background: #ede8df; color: #827966; font-size: 10px; padding: 0 5px; font-weight: 650; }
.bottom-nav .nav-count { position: absolute; top: 2px; left: calc(50% + 10px); min-width: 16px; height: 16px; font-size: 9px; background: #fae3da; color: #ba5642; border: 2px solid white; }
.toast { position: fixed; z-index: 100; bottom: calc(90px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); max-width: calc(100vw - 36px); width: max-content; padding: 13px 18px; border-radius: 12px; background: var(--ink); color: white; font-size: 12px; line-height: 1.5; box-shadow: 0 6px 24px #20252218; }
.storage-note { margin-top: 20px; font-size: 11px; color: var(--muted); line-height: 1.7; }
.storage-note .btn { margin-top: 8px; }
.app-footer { padding: 0 20px calc(104px + env(safe-area-inset-bottom)); text-align: center; color: #8a9183; font-size: 9px; line-height: 1.8; }
.ontario-mark { display: block; font-size: 23px; line-height: 1; color: #78886a; margin-bottom: 13px; }
.sidebar-edition { display: block; margin-top: 17px; font-size: 8px; letter-spacing: .06em; color: #a2a996; }
@keyframes arrive { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (min-width: 560px) {
  #app { padding: 32px 30px 36px; }
  .topbar { padding-inline: 30px; }
  .topics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .hero-card { display: flex; align-items: center; padding: 30px; }
  .hero-copy { flex: 1; }
  .hero-art { width: 35%; margin: 0 -12px 0 8px; }
  .hero-copy > h2 { font-size: 34px; }
  .progress-card { padding: 26px; }
  .question-card { padding: 30px; }
  .question-title { font-size: 25px; }
  .answer-option { padding: 15px 17px; gap: 14px; }
  .answer-copy { font-size: 15px; }
  .check-button, .next-button { flex: 0 1 auto; min-width: 166px; }
  .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .breakdown-list { padding: 28px; }
}
@media (min-width: 900px) {
  .sidebar { display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0; width: 220px; padding: 33px 22px 24px; background: #fdfdf9; border-right: 1px solid var(--line); z-index: 40; }
  .sidebar > .brand { margin: 0 8px 51px; }
  .side-nav { display: grid; gap: 9px; }
  .side-nav .nav-link { display: flex; align-items: center; gap: 12px; min-height: 47px; padding: 12px 14px; border-radius: 11px; text-align: left; font-size: 13px; width: 100%; }
  .side-nav .nav-link:hover { background: #f0f2eb; }
  .side-nav .nav-link.is-active { color: var(--coral); background: #faeee6; }
  .side-nav .nav-link .nav-count { margin-left: auto; }
  .side-nav .nav-link .icon { width: 19px; height: 19px; }
  .sidebar-footer { margin-top: auto; padding: 19px 10px 0; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); line-height: 1.7; }
  .sidebar-footer strong { font-weight: 600; color: #59644f; }
  .sidebar-footer p { margin: 0 0 7px; }
  .sidebar-footer .icon { width: 15px; height: 15px; margin-right: 5px; }
  .sidebar-footer strong { display: block; margin-bottom: 7px; font-size: 11px; }
  .main-shell { margin-left: 220px; }
  .topbar { min-height: 80px; padding-inline: 40px; }
  .mobile-brand { display: none; }
  .page-label { display: block; }
  .free-badge { padding: 8px 13px; }
  #app { max-width: 1200px; padding: 38px 40px 60px; }
  .view-heading { margin-bottom: 28px; }
  .view-heading > p:last-child { font-size: 14px; }
  .home-grid { grid-template-columns: minmax(0, 1.55fr) minmax(240px, 1fr); gap: 20px; margin-bottom: 34px; }
  .hero-card { min-height: 306px; padding: 30px; }
  .hero-copy > h2 { font-size: 33px; }
  .hero-art { position: absolute; width: 170px; right: -33px; bottom: 20px; z-index: 0; opacity: .8; }
  .hero-copy > p { max-width: 280px; }
  .hero-copy { max-width: 320px; }
  .hero-stats { gap: 19px; }
  .progress-card { padding: 25px; }
  .ring { width: 124px; height: 124px; margin-bottom: 19px; }
  .topics-grid { gap: 14px; }
  .topic-card { padding: 20px; }
  .section-title { font-size: 20px; }
  .bottom-nav { display: none; }
  .question-visual img { max-height: 230px; }
  .question-visual { padding: 20px; }
  .quiz-aside { display: grid; grid-template-columns: 1fr 1fr; }
  .mobile-progress { display: none; }
  .app-footer { padding: 0 40px 26px; font-size: 10px; }
  .toast { bottom: 28px; left: calc(50% + 110px); max-width: calc(100vw - 280px); }
}
@media (min-width: 1150px) {
  .home-grid { grid-template-columns: minmax(0, 1.8fr) minmax(270px, 1fr); }
  .hero-card { padding: 34px; }
  .hero-copy > h2 { font-size: 37px; max-width: 290px; }
  .hero-art { width: 220px; right: -13px; bottom: 22px; opacity: 1; }
  .hero-copy > p { max-width: 290px; }
  .topics-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .topic-card { padding: 19px 16px; gap: 11px; }
  .topic-icon { width: 38px; height: 38px; border-radius: 11px; }
  .topic-arrow .icon { width: 17px; height: 17px; }
  .quiz-layout { grid-template-columns: minmax(0, 1fr) 250px; gap: 24px; }
  .quiz-aside { grid-template-columns: 1fr; position: sticky; top: 24px; }
  .question-card { padding: 32px; }
}
@media (max-width: 359px) {
  #app { padding-inline: 14px; }
  .topbar { padding-inline: 14px; }
  .hero-card, .question-card { padding: 22px 17px; }
  .hero-copy > h2 { font-size: 28px; }
  .answer-option { padding: 12px 11px; gap: 9px; }
  .answer-copy { font-size: 15px; }
  .breakdown-list { padding-inline: 14px; }
  .breakdown-row { gap: 8px; }
  .breakdown-row > .topic-icon { width: 29px; height: 29px; }
  .breakdown-label > strong { font-size: 11px; }
  .question-title { font-size: 20px; }
  .mistake-item { flex-wrap: wrap; }
  .mistake-action { margin-left: 47px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
@media print {
  .sidebar, .topbar, .bottom-nav, .quiz-aside, .quiz-actions, .toast { display: none !important; }
  .main-shell { margin: 0; }
  #app { padding: 0; }
  body, :root { background: white; }
  .question-card { break-inside: avoid; }
}

/* Test-mode disclosures are separate from live purchase presentation. */
#commerce-notice.is-test-mode{padding:12px 16px;border:1px solid #e0be69;border-radius:10px;background:#fff4cd;color:#4a3600;font-size:14px;font-weight:650;line-height:1.45}
.commerce-test-notice{margin:0 0 20px;padding:16px;border:1px solid #e0be69;border-left:4px solid #b77a00;border-radius:12px;background:#fff4cd;color:#4a3600;font-size:15px;line-height:1.5}
.commerce-test-notice strong{display:block;font-size:16px}.commerce-test-notice p{margin:6px 0 0;color:inherit;font-size:inherit;line-height:inherit}
.test-pass-badge{display:inline-block;margin:0 0 12px;padding:6px 10px;border:1px solid #e0be69;border-radius:6px;background:#fff4cd;color:#4a3600;font-size:12px;font-weight:750;letter-spacing:.04em;line-height:1.4}
.commerce-test-note{padding:12px;border-radius:10px;background:#fff4cd;color:#4a3600;font-size:14px;line-height:1.5}
