:root {
  --ink: #172626;
  --deep: #102a2a;
  --deep-2: #173d3a;
  --paper: #f4f1e9;
  --paper-2: #ebe6da;
  --card: #fffdf8;
  --line: #d9d4c8;
  --muted: #697674;
  --accent: #e6603d;
  --accent-dark: #b83e25;
  --gold: #d5a642;
  --mint: #b7d3c8;
  --success: #25735d;
  --warning: #a26414;
  --danger: #b53d36;
  --shadow: 0 18px 44px rgba(20, 39, 37, .09);
  --radius: 20px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --font-sans: "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  --font-serif: "Yu Mincho", "Hiragino Mincho ProN", serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; min-height: 100dvh; margin: 0; color: var(--ink); background: var(--paper); font-family: var(--font-sans); line-height: 1.7; overscroll-behavior-y: none; }
button, input, select, textarea { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
svg { width: 1.3rem; fill: none; stroke: currentColor; stroke-width: 1.8; }
.skip-link { position: fixed; z-index: 100; top: -60px; left: 1rem; padding: .7rem 1rem; color: white; background: var(--deep); border-radius: 8px; }
.skip-link:focus { top: 1rem; }

.site-header { position: fixed; z-index: 20; inset: 0 auto 0 0; display: flex; width: 250px; padding: 28px 18px 20px; flex-direction: column; align-items: stretch; gap: 24px; background: rgba(255,253,248,.96); border-right: 1px solid rgba(23,38,38,.12); backdrop-filter: blur(18px); }
.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; line-height: 1.05; }
.brand strong { display: block; letter-spacing: .1em; }
.brand small { display: block; margin-top: .32rem; color: var(--muted); font-size: .68rem; letter-spacing: .04em; }
.brand-mark { display: grid; width: 41px; height: 45px; place-items: center; color: white; background: var(--deep); clip-path: polygon(50% 0, 96% 16%, 90% 70%, 50% 100%, 10% 70%, 4% 16%); font-size: .68rem; font-weight: 800; letter-spacing: .06em; }
.desktop-nav { display: flex; flex-direction: column; gap: 6px; }
.desktop-nav a { position: relative; display: flex; min-height: 52px; padding: 8px 12px; align-items: center; gap: 12px; color: var(--muted); border: 2px solid transparent; border-radius: 14px; text-decoration: none; font-size: .88rem; font-weight: 800; transition: background .15s, border-color .15s, transform .15s; }
.desktop-nav a:hover { background: var(--paper); transform: translateX(2px); }
.desktop-nav a.active { color: var(--deep); background: #f8e7e1; border-color: #f0b4a3; }
.desktop-nav a.quiz-nav { color: #9d3823; }.desktop-nav a.quiz-nav.active { color: white; background: var(--accent); border-color: var(--accent); box-shadow: 0 4px 0 #a43e27; }
.nav-icon { display: grid; width: 31px; height: 31px; flex: 0 0 auto; place-items: center; color: var(--deep-2); background: var(--paper-2); border-radius: 9px; font-size: .8rem; font-weight: 900; }.quiz-nav .nav-icon { color: white; background: var(--accent); }.quiz-nav.active .nav-icon { color: var(--accent); background: white; }
.desktop-nav a small { display: block; margin-top: -2px; font-size: .59rem; font-weight: 700; opacity: .72; }
.sidebar-quest { display: grid; margin-top: auto; padding: 17px; gap: 4px; color: white; background: linear-gradient(145deg, var(--deep-2), var(--deep)); border-radius: 17px; box-shadow: 0 10px 24px rgba(16,42,42,.15); }.sidebar-quest small { color: #f29270; font-size: .61rem; font-weight: 900; letter-spacing: .1em; }.sidebar-quest strong { font-family: var(--font-serif); font-size: 1.05rem; }.sidebar-quest span { color: #bcd0ca; font-size: .7rem; }.sidebar-quest a { margin-top: .6rem; padding: .55rem .7rem; color: white; background: var(--accent); border-radius: 10px; text-align: center; text-decoration: none; font-size: .75rem; font-weight: 900; box-shadow: 0 3px 0 #963820; }
.icon-button { display: inline-grid; width: 42px; height: 42px; flex: 0 0 auto; padding: 0; place-items: center; background: transparent; border: 1px solid var(--line); border-radius: 50%; cursor: pointer; }
.icon-button:hover { background: var(--card); }
.site-header > .icon-button { align-self: center; }
.pwa-install-button { display: flex; min-height: 44px; padding: .6rem .8rem; align-items: center; justify-content: center; gap: .55rem; color: white; background: var(--success); border: 0; border-radius: 12px; box-shadow: 0 3px 0 #14513f; cursor: pointer; font-size: .78rem; }
.pwa-install-button[hidden] { display: none; }
.pwa-install-button > span { display: grid; width: 25px; height: 25px; place-items: center; background: rgba(255,255,255,.16); border-radius: 50%; font-size: 1rem; }
.mobile-nav { display: none; }

main { min-height: 100vh; margin-left: 250px; }
.page { width: min(1080px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 90px; animation: reveal .32s ease both; }
@keyframes reveal { from { opacity: 0; transform: translateY(5px); } }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 28px; }
.page-heading h1 { margin: .25rem 0 0; font-family: var(--font-serif); font-size: clamp(2rem, 4.5vw, 3.7rem); font-weight: 600; line-height: 1.15; letter-spacing: -.035em; }
.page-heading p:last-child { max-width: 610px; }
.eyebrow { margin: 0; color: var(--accent-dark); font-size: .72rem; font-weight: 800; letter-spacing: .17em; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.nowrap { white-space: nowrap; }
.number { font-variant-numeric: tabular-nums; }

.hero { position: relative; display: grid; min-height: 420px; padding: clamp(32px, 6vw, 72px); overflow: hidden; grid-template-columns: 1.2fr .8fr; align-items: center; color: white; background: var(--deep); border-radius: 28px; box-shadow: var(--shadow); }
.hero::before { position: absolute; top: -190px; right: -120px; width: 520px; height: 520px; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; box-shadow: 0 0 0 56px rgba(255,255,255,.035), 0 0 0 112px rgba(255,255,255,.025); content: ""; }
.hero-copy { position: relative; z-index: 1; }
.hero h1 { max-width: 720px; margin: .35rem 0 1rem; font-family: var(--font-serif); font-size: clamp(2.2rem, 5vw, 4.8rem); font-weight: 500; line-height: 1.18; letter-spacing: -.04em; }
.hero h1 em { color: #f29270; font-style: normal; }
.hero-copy > p:not(.eyebrow) { max-width: 620px; color: #d0dbd7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }
.start-hint { margin: .8rem 0 0 !important; color: #f6b8a6 !important; font-size: .73rem; font-weight: 800; }
.hero-visual { position: relative; z-index: 1; display: grid; place-items: center; }
.dial { position: relative; display: grid; width: min(280px, 70vw); aspect-ratio: 1; place-items: center; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--value) * 1%), rgba(255,255,255,.08) 0); }
.dial::before { position: absolute; width: 80%; aspect-ratio: 1; background: var(--deep); border-radius: 50%; content: ""; }
.dial-content { position: relative; z-index: 1; text-align: center; }
.dial strong { display: block; font-family: var(--font-serif); font-size: 4.4rem; font-weight: 500; line-height: 1; }
.dial span { color: #b9cbc5; font-size: .8rem; letter-spacing: .12em; }

.button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: .5rem; padding: .7rem 1.2rem; border: 1px solid transparent; border-radius: 999px; cursor: pointer; text-decoration: none; font-weight: 800; }
.button.primary { color: white; background: var(--accent); }
.button.primary:hover { background: var(--accent-dark); }
.button.secondary { color: var(--deep); background: #fff; }
.button.ghost { color: var(--ink); background: transparent; border-color: var(--line); }
.button.dark { color: white; background: var(--deep); }
.button:disabled { opacity: .42; cursor: not-allowed; }
.text-button { padding: .25rem 0; color: var(--deep-2); background: none; border: 0; border-bottom: 1px solid currentColor; cursor: pointer; font-size: .86rem; font-weight: 700; }
.text-button.danger { color: var(--danger); }

.stats-strip { display: grid; margin: -26px 28px 38px; position: relative; z-index: 3; grid-template-columns: repeat(4, 1fr); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat { padding: 22px 26px; border-right: 1px solid var(--line); }
.stat:last-child { border: 0; }
.stat small { display: block; color: var(--muted); font-size: .74rem; font-weight: 700; }
.stat strong { font-family: var(--font-serif); font-size: 1.65rem; font-weight: 600; }
.stat .trend { margin-left: .25rem; color: var(--success); font-family: var(--font-sans); font-size: .72rem; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin: 42px 0 18px; }
.section-heading h2 { margin: .15rem 0 0; font-family: var(--font-serif); font-size: clamp(1.55rem, 3vw, 2.15rem); font-weight: 600; letter-spacing: -.025em; }
.section-heading a { color: var(--muted); font-size: .84rem; font-weight: 700; }
.card-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.card { padding: 24px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 26px rgba(20,39,37,.045); }
.card.span-4 { grid-column: span 4; }
.card.span-5 { grid-column: span 5; }
.card.span-6 { grid-column: span 6; }
.card.span-7 { grid-column: span 7; }
.card.span-8 { grid-column: span 8; }
.card.span-12 { grid-column: span 12; }
.card h2, .card h3 { margin: 0 0 .45rem; }
.card h3 { font-family: var(--font-serif); font-size: 1.25rem; }
.card p { margin: .35rem 0; }
.action-card { position: relative; display: flex; min-height: 240px; flex-direction: column; overflow: hidden; }
.action-card .step-no { color: var(--accent); font: 600 3.2rem/1 var(--font-serif); }
.action-card .button { align-self: flex-start; margin-top: auto; }
.action-card.featured { color: white; background: var(--deep-2); border-color: var(--deep-2); }
.action-card.featured .muted { color: #bfd0cb; }
.action-card::after { position: absolute; right: -35px; bottom: -35px; width: 130px; height: 130px; border: 1px solid rgba(128,128,128,.16); border-radius: 50%; content: ""; }

.notice { display: flex; gap: 1rem; padding: 16px 18px; background: #fff5dc; border-left: 4px solid var(--gold); border-radius: 5px 14px 14px 5px; }
.notice strong { flex: 0 0 auto; }
.notice p { margin: 0; }
.version-banner { display: flex; align-items: center; gap: 1rem; margin-bottom: 24px; padding: 15px 18px; background: var(--deep); color: white; border-radius: 14px; }
.version-banner .tag { color: var(--deep); background: #f1c866; }
.tag { display: inline-flex; min-height: 25px; align-items: center; padding: .2rem .6rem; color: var(--deep-2); background: #dcece5; border-radius: 999px; font-size: .7rem; font-weight: 800; letter-spacing: .04em; }
.tag.orange { color: #8a301d; background: #fde2d8; }
.tag.gold { color: #6d4a00; background: #f6e7b8; }
.tag.gray { color: #5e6867; background: #e9e9e5; }

.toolbar { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 18px; }
.search { position: relative; flex: 1 1 280px; }
.search input, .select, input[type="date"], input[type="number"], select { width: 100%; height: 46px; padding: 0 1rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; outline: none; }
.search input:focus, select:focus, input:focus, textarea:focus { border-color: var(--deep-2); box-shadow: 0 0 0 3px rgba(23,61,58,.11); }
.toolbar select { width: auto; min-width: 190px; }
.segmented { display: inline-flex; padding: 4px; background: var(--paper-2); border-radius: 12px; }
.segmented button { padding: .4rem .8rem; background: transparent; border: 0; border-radius: 9px; cursor: pointer; font-size: .78rem; font-weight: 700; }
.segmented button.active { background: var(--card); box-shadow: 0 2px 8px rgba(0,0,0,.07); }

.term-list { display: grid; gap: 10px; }
.term-row { display: grid; padding: 17px 20px; grid-template-columns: minmax(170px, .8fr) 1.7fr 90px; gap: 1.2rem; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.term-row:hover { border-color: var(--mint); transform: translateY(-1px); }
.term-title strong { display: block; font-size: 1rem; }
.term-title small { color: var(--muted); }
.term-row p { margin: 0; color: #3e4d4b; font-size: .86rem; }
.mastery { text-align: right; }
.mastery b { display: block; font-size: .8rem; }
.meter { display: block; height: 5px; margin-top: 7px; overflow: hidden; background: var(--paper-2); border-radius: 5px; }
.meter > span { display: block; width: var(--value); height: 100%; background: var(--success); border-radius: inherit; }

.key-hint { display: inline-grid; min-width: 25px; height: 25px; padding: 0 .4rem; place-items: center; color: var(--ink); background: white; border-radius: 5px; font-size: .7rem; }

.writing-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 20px; align-items: start; }
.scenario { padding: clamp(24px, 4vw, 44px); background: var(--card); border: 1px solid var(--line); border-radius: 20px; }
.scenario h2 { margin: .4rem 0 1.2rem; font: 600 clamp(1.6rem,3vw,2.25rem) var(--font-serif); }
.scenario-text { font-family: var(--font-serif); font-size: 1rem; line-height: 2.1; }
.evidence { padding: 1px 3px; background: linear-gradient(transparent 55%, #f8dda0 55%); }
.question-box { margin-top: 24px; padding: 22px; background: #f1eee5; border-radius: 15px; }
.question-box h3 { margin-top: 0; font-size: 1rem; }
.question-box textarea { width: 100%; min-height: 130px; padding: 1rem; resize: vertical; background: white; border: 1px solid var(--line); border-radius: 10px; }
.counter-row { display: flex; margin-top: .4rem; justify-content: space-between; color: var(--muted); font-size: .78rem; }
.writing-aside { position: sticky; top: 96px; display: grid; gap: 14px; }
.guide-card { padding: 20px; background: var(--deep); border-radius: 17px; color: white; }
.guide-card h3 { margin-top: 0; font: 600 1.2rem var(--font-serif); }
.guide-card ol { padding-left: 1.2rem; color: #cfdbd7; font-size: .83rem; }
.rubric { display: grid; gap: 8px; margin: 1rem 0; }
.rubric label { display: flex; gap: .65rem; align-items: start; padding: .75rem; background: #f8f6ef; border-radius: 10px; font-size: .84rem; }
.feedback { margin-top: 16px; padding: 18px; background: #e4f0eb; border-radius: 13px; }
.feedback.bad { background: #fae5df; }
.model-answer { padding: 15px 18px; color: white; background: var(--deep-2); border-radius: 12px; font-family: var(--font-serif); }

.past-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.past-card { padding: 24px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
.past-card h3 { margin: .4rem 0; font-family: var(--font-serif); font-size: 1.4rem; }
.past-links { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1rem; }
.past-links a { color: var(--deep-2); font-size: .82rem; font-weight: 800; }
.score-entry { display: grid; margin-top: 1rem; grid-template-columns: 1fr 100px auto; gap: .6rem; }
.score-entry input { width: 100%; height: 42px; padding: 0 .7rem; background: white; border: 1px solid var(--line); border-radius: 9px; }

.topic-bars { display: grid; gap: 14px; }
.topic-bar { display: grid; grid-template-columns: 155px 1fr 48px; gap: 1rem; align-items: center; font-size: .82rem; }
.heatmap { display: grid; width: fit-content; grid-template-columns: repeat(14, 14px); gap: 4px; }
.heatmap i { width: 14px; height: 14px; background: var(--paper-2); border-radius: 3px; }
.heatmap i[data-level="1"] { background: #c9ddd5; }.heatmap i[data-level="2"] { background: #7fb09d; }.heatmap i[data-level="3"] { background: #2e7c64; }
.empty { padding: 55px 20px; color: var(--muted); text-align: center; background: var(--card); border: 1px dashed var(--line); border-radius: 18px; }

.dialog { width: min(520px, calc(100% - 24px)); padding: 0; background: transparent; border: 0; }
.dialog::backdrop { background: rgba(5,18,17,.55); backdrop-filter: blur(5px); }
.dialog-card { padding: 28px; background: var(--card); border-radius: 22px; box-shadow: var(--shadow); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.dialog-heading h2 { margin: 0; font-family: var(--font-serif); font-size: 1.8rem; }
.dialog-card > label:not(.check-row) { position: relative; display: block; margin: .9rem 0; font-size: .78rem; font-weight: 800; }
.dialog-card input, .dialog-card select { display: block; margin-top: .35rem; }
.field-suffix { position: absolute; right: 1rem; bottom: .7rem; color: var(--muted); }
.check-row { display: flex; align-items: center; gap: .6rem; margin: 1rem 0; font-size: .86rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.5rem; }
.utility-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin: .6rem 0 1rem; }
.file-label input { display: none; }
.install-guide { padding: 18px; background: #e8f0ec; border: 1px solid #c7ddd4; border-radius: 15px; }
.install-guide ol { display: grid; margin: 0; padding-left: 1.4rem; gap: .8rem; }
.install-guide p { margin: 1rem 0 0; color: var(--muted); font-size: .84rem; }
.toast { position: fixed; z-index: 100; right: 22px; bottom: 24px; max-width: 360px; padding: 12px 18px; color: white; background: var(--deep); border-radius: 12px; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .25s; }
.toast.show { opacity: 1; transform: translateY(0); }
.global-drill-launch { position: fixed; z-index: 18; right: 24px; bottom: 24px; display: flex; min-width: 200px; padding: 12px 18px; align-items: center; gap: 12px; color: white; background: var(--accent); border: 2px solid rgba(255,255,255,.5); border-radius: 17px; box-shadow: 0 6px 0 #963820, 0 16px 32px rgba(90,34,20,.2); text-decoration: none; transition: transform .15s, box-shadow .15s; }.global-drill-launch:hover { transform: translateY(2px); box-shadow: 0 4px 0 #963820, 0 12px 26px rgba(90,34,20,.2); }.global-drill-launch > span:first-child { display: grid; width: 38px; height: 38px; place-items: center; color: var(--accent); background: white; border-radius: 50%; font-size: .75rem; }.global-drill-launch small, .global-drill-launch strong { display: block; line-height: 1.3; }.global-drill-launch small { font-size: .62rem; opacity: .82; }.global-drill-launch strong { font-size: .9rem; }body[data-route="home"] .global-drill-launch, body[data-route="quiz"] .global-drill-launch { display: none; }

/* Security Quest: an original, game-like learning loop. */
.quest-hero { background: radial-gradient(circle at 83% 30%, rgba(73,166,132,.32), transparent 28%), linear-gradient(135deg, #0c2827, #174a43); }
.quest-start { min-height: 54px; padding-inline: 1.5rem; box-shadow: 0 6px 0 #963820; transition: transform .15s, box-shadow .15s; }
.quest-start:hover { transform: translateY(2px); box-shadow: 0 4px 0 #963820; }
.quest-emblem { position: relative; display: grid; width: min(280px, 70vw); min-height: 280px; padding: 35px; place-items: center; align-content: center; color: white; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); border-radius: 50%; box-shadow: 0 0 0 18px rgba(255,255,255,.025), inset 0 0 40px rgba(0,0,0,.1); }
.quest-shield { display: grid; width: 92px; height: 104px; place-items: center; background: linear-gradient(155deg, #f0805f, var(--accent)); clip-path: polygon(50% 0, 96% 16%, 89% 70%, 50% 100%, 11% 70%, 4% 16%); font-size: 1.4rem; font-weight: 900; letter-spacing: .12em; filter: drop-shadow(0 10px 13px rgba(0,0,0,.22)); }
.quest-emblem strong { margin-top: .6rem; font-size: 2rem; line-height: 1.2; }.quest-emblem small { color: #bdd5cd; font-weight: 800; }
.level-progress { display: block; width: 150px; height: 9px; margin-top: .7rem; overflow: hidden; background: rgba(255,255,255,.12); border-radius: 10px; }.level-progress i { display: block; height: 100%; background: #f29270; border-radius: inherit; }
.streak-stat strong { color: #c84e2f; }

.course-path { position: relative; display: grid; max-width: 850px; margin: 0 auto; gap: 14px; }
.course-path::before { position: absolute; z-index: 0; top: 38px; bottom: 38px; left: 43px; width: 3px; background: linear-gradient(var(--accent), var(--mint)); content: ""; }
.unit-card { position: relative; z-index: 1; display: grid; min-height: 106px; padding: 15px 20px 15px 14px; grid-template-columns: 58px 1fr 110px; gap: 15px; align-items: center; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 6px 20px rgba(20,39,37,.045); text-decoration: none; transition: transform .18s, border-color .18s, box-shadow .18s; }
.unit-card:hover { transform: translateX(5px); border-color: var(--mint); box-shadow: var(--shadow); }
.unit-node { display: grid; width: 58px; height: 58px; place-items: center; color: white; background: var(--deep-2); border: 5px solid var(--paper); border-radius: 50%; box-shadow: 0 0 0 2px var(--mint); font-size: .95rem; font-weight: 900; }
.unit-card:nth-child(-n+2) .unit-node { background: var(--accent); box-shadow: 0 0 0 2px #f2a28d; }
.unit-copy { display: grid; min-width: 0; }.unit-copy > small { color: var(--accent-dark); font-size: .66rem; font-weight: 900; letter-spacing: .1em; }.unit-copy > strong { font-family: var(--font-serif); font-size: 1.18rem; }.unit-copy > span:not(.meter) { overflow: hidden; color: var(--muted); font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.unit-copy .meter { max-width: 360px; }.unit-copy .meter i { display: block; width: var(--value); height: 100%; background: var(--success); border-radius: inherit; }
.unit-score { text-align: right; }.unit-score b, .unit-score small, .unit-score em { display: block; }.unit-score b { font-size: 1.15rem; }.unit-score small { color: var(--accent-dark); font-size: .68rem; font-weight: 900; white-space: nowrap; }.unit-score em { margin-top: .18rem; color: var(--muted); font-size: .58rem; font-style: normal; }

.drill-page { min-height: 100vh; min-height: 100dvh; padding: 24px 20px 90px; background: radial-gradient(circle at 10% 10%, rgba(183,211,200,.24), transparent 28%), #f7f5ef; }
.drill-shell { width: min(900px, 100%); margin: 0 auto; }
.drill-hud { position: sticky; z-index: 10; top: 12px; display: grid; padding: 9px 12px; grid-template-columns: 38px minmax(60px, 1fr) auto auto auto auto; gap: 10px; align-items: center; background: rgba(247,245,239,.92); border: 1px solid var(--line); border-radius: 16px; backdrop-filter: blur(15px); }
.drill-close { display: grid; width: 34px; height: 34px; place-items: center; color: var(--muted); text-decoration: none; font-size: 1.45rem; font-weight: 800; }
.daily-track { height: 12px; overflow: hidden; background: var(--paper-2); border-radius: 20px; }.daily-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #ef997e); border-radius: inherit; transition: width .35s; }
.hud-chip { display: inline-flex; height: 34px; padding: 0 .65rem; align-items: center; gap: .3rem; background: white; border: 1px solid var(--line); border-radius: 10px; font-size: .78rem; font-weight: 900; font-variant-numeric: tabular-nums; }.heart-chip { color: #ca493f; }.combo-chip { color: #bb761a; }.xp-chip { color: var(--success); }
.question-card { padding: clamp(24px, 5vw, 48px); background: var(--card); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); }
.question-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: .7rem; font-weight: 900; letter-spacing: .08em; }
.question-stem { margin: 1.2rem 0 1.8rem; font-family: var(--font-serif); font-size: clamp(1.35rem, 3vw, 2rem); font-weight: 600; line-height: 1.65; letter-spacing: -.02em; }
.quiz-options { display: grid; gap: 12px; }
.quiz-choice { display: grid; min-height: 70px; padding: 12px 16px; grid-template-columns: 38px 1fr auto; gap: 13px; align-items: center; text-align: left; background: white; border: 2px solid var(--line); border-radius: 16px; box-shadow: 0 3px 0 #c9c4b8; cursor: pointer; font-size: .92rem; font-weight: 700; line-height: 1.55; transition: border-color .14s, transform .14s, background .14s; }
.quiz-choice:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--deep-2); }.quiz-choice:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.choice-letter { display: grid; width: 36px; height: 36px; place-items: center; color: var(--muted); background: #f4f1e9; border: 1px solid var(--line); border-radius: 10px; font-size: .78rem; font-weight: 900; }
.quiz-choice.is-correct { color: #155d48; background: #e3f2eb; border-color: #3f9878; box-shadow: 0 3px 0 #3f9878; }.quiz-choice.is-correct .choice-letter { color: white; background: #3f9878; border-color: #3f9878; }.quiz-choice.is-wrong { color: #993a33; background: #fbe9e5; border-color: #d3675f; box-shadow: 0 3px 0 #d3675f; }.quiz-choice.is-wrong .choice-letter { color: white; background: #d3675f; }.quiz-choice.is-dim { opacity: .5; }.choice-mark { font-size: 1.5rem; font-weight: 900; }

body[data-route="quiz"] .site-header, body[data-route="quiz"] .mobile-nav, body[data-route="quiz"] .global-drill-launch { display: none; }
body[data-route="quiz"] main { min-height: 100dvh; margin-left: 0; padding-top: 0; }
/* Read the complete stem first; panels scroll naturally without shrinking text. */
.drill-page.is-question { min-height: 100dvh; padding: max(14px, var(--safe-top)) max(16px, var(--safe-right)) max(14px, var(--safe-bottom)) max(16px, var(--safe-left)); }
.is-question .drill-shell { width: min(980px,100%); }
.is-question .question-card { margin-top: 16px; padding: clamp(20px,4vw,40px); }
.quiz-tabs { display: flex; gap: 8px; margin: 20px 0 0; padding: 5px; border-radius: 14px; background: var(--paper-2); }
.quiz-tabs [role="tab"] { flex: 1; min-height: 48px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font: 800 1rem var(--font-sans); cursor: pointer; }
.quiz-tabs [aria-selected="true"] { color: white; background: var(--deep-2); box-shadow: 0 3px 0 #0d2926; }
.quiz-tabs [role="tab"]:focus-visible, .quiz-panel:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.quiz-panel[hidden] { display: none !important; }
.quiz-panel { padding-top: 12px; }
.is-question .question-stem { margin: 18px 0 28px; font-family: var(--font-sans); font-size: clamp(1.3rem,2.4vw,1.85rem); font-weight: 600; line-height: 1.95; overflow-wrap: anywhere; }
.is-question .quiz-options { display: grid; gap: 14px; }
.is-question .quiz-choice { min-height: 88px; padding: 18px; font-size: 1rem; line-height: 1.8; overflow-wrap: anywhere; }
.choices-instruction { margin: 4px 0 20px; font-weight: 800; }.choices-instruction small { color: var(--muted); font-size: .8rem; font-weight: 500; }
.panel-next { width: 100%; min-height: 54px; }.panel-back { margin-top: 22px; min-height: 44px; }
.quiz-glossary { margin: 0 clamp(20px,5vw,42px) 24px; padding: 22px; border: 1px solid #b9d4ca; border-radius: 16px; background: #f0f7f3; }
.quiz-glossary h3 { margin: 0; font-size: 1.05rem; }.quiz-glossary > p { margin: 5px 0 18px; color: var(--muted); font-size: .8rem; }
.quiz-glossary dl { margin: 0; }.quiz-glossary dl > div { padding: 13px 0; border-top: 1px solid #cedfd6; }
.quiz-glossary dt { color: var(--deep); font-size: 1rem; font-weight: 900; overflow-wrap: anywhere; }.quiz-glossary dt small { display: block; color: #4d6a60; font-size: .78rem; font-weight: 500; }
.quiz-glossary dd { margin: 7px 0 0; font-size: .87rem; line-height: 1.8; overflow-wrap: anywhere; }
@media (max-width: 540px) { .is-question .question-card { padding: 18px; }.is-question .quiz-choice { padding: 13px 10px; font-size: .94rem; }.quiz-glossary { margin-inline: 15px; padding: 16px; } }

.quiz-insight-dock { position: relative; display: flex; min-height: 46px; align-items: center; justify-content: center; gap: 6px; }
.quiz-insight { position: relative; display: inline-flex; height: 40px; min-width: 72px; padding: 4px 9px; align-items: center; justify-content: center; gap: 6px; color: var(--muted); background: rgba(255,253,248,.94); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-size: .68rem; font-weight: 800; touch-action: manipulation; }
.quiz-insight:hover, .quiz-insight:focus-visible, .quiz-insight.is-open { color: var(--deep); background: white; border-color: var(--mint); outline: none; }
.insight-icon { display: grid; width: 24px; height: 24px; place-items: center; color: white; background: var(--deep-2); border-radius: 8px; font-size: .72rem; }
.insight-popover { position: absolute; z-index: 20; bottom: calc(100% + 9px); left: 50%; display: grid; width: min(310px, calc(100vw - 24px)); padding: 13px 15px; gap: 3px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); text-align: left; opacity: 0; transform: translate(-50%, 6px); visibility: hidden; pointer-events: none; transition: opacity .15s, transform .15s, visibility .15s; }
.quiz-insight:first-child .insight-popover { left: 0; transform: translate(0, 6px); }
.quiz-insight:nth-of-type(3) .insight-popover { right: 0; left: auto; transform: translate(0, 6px); }
.quiz-insight:hover .insight-popover, .quiz-insight:focus-visible .insight-popover, .quiz-insight.is-open .insight-popover { opacity: 1; transform: translate(-50%, 0); visibility: visible; }
.quiz-insight:first-child:hover .insight-popover, .quiz-insight:first-child:focus-visible .insight-popover, .quiz-insight:first-child.is-open .insight-popover, .quiz-insight:nth-of-type(3):hover .insight-popover, .quiz-insight:nth-of-type(3):focus-visible .insight-popover, .quiz-insight:nth-of-type(3).is-open .insight-popover { transform: translate(0, 0); }
.insight-popover small { color: var(--accent-dark); font-size: .6rem; letter-spacing: .12em; }
.insight-popover strong { font-family: var(--font-serif); font-size: .95rem; }
.insight-popover > span { color: var(--muted); font-size: .76rem; font-weight: 600; line-height: 1.55; }
.insight-level { display: inline-grid; height: 30px; padding: 0 8px; place-items: center; color: #6d4a00; background: #f6e7b8; border-radius: 9px; font-size: .64rem; font-weight: 900; }

.answer-sheet { margin-top: 16px; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); animation: answer-rise .3s ease both; }
@keyframes answer-rise { from { opacity: 0; transform: translateY(12px); } }
.verdict { display: flex; padding: 25px clamp(20px,5vw,42px); gap: 16px; align-items: center; background: #dff0e9; }.answer-sheet.bad .verdict { background: #f9e3de; }.verdict-icon { display: grid; width: 52px; height: 52px; flex: 0 0 auto; place-items: center; color: white; background: var(--success); border-radius: 50%; font-size: 1.7rem; font-weight: 900; }.bad .verdict-icon { background: var(--danger); }.verdict p { margin: 0; color: var(--success); font-size: .68rem; font-weight: 900; letter-spacing: .13em; }.bad .verdict p { color: var(--danger); }.verdict h2 { margin: .1rem 0; font: 600 clamp(1.3rem,3vw,1.9rem) var(--font-serif); }.verdict span:last-child { font-size: .84rem; }
.retry-notice { margin: 18px clamp(20px,5vw,42px) 0; padding: 12px 15px; color: #8c352f; background: #fff1ed; border: 1px solid #efc3ba; border-radius: 12px; font-size: .82rem; font-weight: 800; }
.explain-grid { display: grid; padding: 24px clamp(20px,5vw,42px); grid-template-columns: 1fr 1fr; gap: 12px; }.explain-block { padding: 18px; background: #f6f3eb; border: 1px solid var(--line); border-radius: 15px; }.explain-block.why, .explain-block.span-all { grid-column: 1/-1; }.explain-block.why { color: white; background: var(--deep-2); border-color: var(--deep-2); }.explain-block small { color: var(--accent-dark); font-size: .65rem; font-weight: 900; letter-spacing: .08em; }.explain-block.why small { color: #f29270; }.explain-block h3 { margin: .35rem 0; font: 600 1.3rem var(--font-serif); }.explain-block h3 span { color: #bcd0ca; font: 700 .72rem var(--font-sans); }.explain-block p { margin: .35rem 0 0; font-size: .85rem; }
.choice-reviews { padding: 5px clamp(20px,5vw,42px) 25px; }.choice-review { display: grid; padding: 13px 0; grid-template-columns: 30px 1fr; gap: 10px; border-bottom: 1px solid var(--line); }.choice-review > span { display: grid; width: 25px; height: 25px; place-items: center; background: var(--paper-2); border-radius: 7px; font-size: .68rem; font-weight: 900; }.choice-review.correct > span { color: white; background: var(--success); }.choice-review.selected:not(.correct) > span { color: white; background: var(--danger); }.choice-review p { margin: .2rem 0 0; color: var(--muted); font-size: .78rem; }
.question-source { margin: 0 clamp(20px,5vw,42px) 20px; color: var(--muted); font-size: .72rem; }
.next-bar { display: flex; min-height: 86px; padding: 16px clamp(20px,5vw,42px); align-items: center; justify-content: space-between; gap: 15px; background: #f1eee5; border-top: 1px solid var(--line); }.next-bar > span { color: var(--muted); font-size: .8rem; font-weight: 700; }.next-bar .button { min-width: 180px; }

@media (max-width: 850px) {
  .site-header { inset: 0 0 auto 0; width: auto; height: calc(62px + var(--safe-top)); padding: var(--safe-top) max(14px, var(--safe-right)) 0 max(14px, var(--safe-left)); flex-direction: row; align-items: center; gap: .65rem; border-right: 0; border-bottom: 1px solid rgba(23,38,38,.1); }
  .brand { margin-right: auto; }.sidebar-quest { display: none; }.site-header > .icon-button { align-self: auto; }
  .pwa-install-button { min-height: 38px; padding: .45rem .7rem; font-size: .72rem; box-shadow: none; }
  .pwa-install-button > span { width: 22px; height: 22px; }
  .brand small, .desktop-nav { display: none; }
  main { min-height: calc(100dvh - 126px - var(--safe-top) - var(--safe-bottom)); margin-left: 0; padding-top: calc(62px + var(--safe-top)); }
  .mobile-nav { position: fixed; z-index: 30; right: 0; bottom: 0; left: 0; display: grid; height: calc(64px + var(--safe-bottom)); padding: 0 var(--safe-right) var(--safe-bottom) var(--safe-left); grid-template-columns: repeat(5, 1fr); background: rgba(255,253,248,.96); border-top: 1px solid var(--line); backdrop-filter: blur(16px); }
  .mobile-nav a { display: flex; align-items: center; justify-content: center; flex-direction: column; color: var(--muted); text-decoration: none; font-size: .64rem; font-weight: 700; }
  .mobile-nav a span { font-size: 1.15rem; line-height: 1.2; }
  .mobile-nav a.active { color: var(--accent-dark); }
  .mobile-nav .mobile-quiz-nav span { display: grid; width: 34px; height: 34px; margin-top: -18px; place-items: center; color: white; background: var(--accent); border: 4px solid var(--card); border-radius: 50%; box-shadow: 0 3px 0 #963820; }.mobile-nav .mobile-quiz-nav.active { color: var(--accent-dark); }
  .page { width: min(100% - 24px, 1180px); padding: 24px 0 calc(86px + var(--safe-bottom)); }
  .page-heading { display: block; }
  .hero { min-height: auto; padding: 32px 24px; grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .dial { width: 180px; }.dial strong { font-size: 3rem; }
  .stats-strip { margin: -20px 10px 30px; grid-template-columns: 1fr 1fr; }
  .stat { padding: 16px; }.stat:nth-child(2) { border-right: 0; }.stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .card.span-4, .card.span-5, .card.span-6, .card.span-7, .card.span-8 { grid-column: 1/-1; }
  .term-row { grid-template-columns: 1fr 70px; }.term-row p { display: none; }
  .writing-layout { grid-template-columns: 1fr; }
  .writing-aside { position: static; }
  .past-grid { grid-template-columns: 1fr; }
  .score-entry { grid-template-columns: 1fr 90px; }.score-entry button { grid-column: 1/-1; }
  .topic-bar { grid-template-columns: 110px 1fr 38px; gap: .5rem; }
  .quest-emblem { width: 200px; min-height: 200px; padding: 22px; }.quest-shield { width: 65px; height: 75px; }.quest-emblem strong { font-size: 1.45rem; }
  .drill-page { min-height: 100dvh; padding: calc(8px + var(--safe-top)) max(10px, var(--safe-right)) calc(20px + var(--safe-bottom)) max(10px, var(--safe-left)); }.drill-hud { top: var(--safe-top); grid-template-columns: 32px minmax(30px,1fr) auto auto auto; gap: 5px; }.xp-chip { display: none; }.hud-chip { padding: 0 .45rem; }.question-card { padding: 22px 16px; border-radius: 20px; }.question-stem { margin-bottom: 1.25rem; }.quiz-choice { min-height: 66px; padding: 10px; grid-template-columns: 34px 1fr auto; gap: 9px; font-size: .88rem; touch-action: manipulation; }.choice-letter { width: 32px; height: 32px; }.explain-grid { grid-template-columns: 1fr; padding-inline: 15px; }.explain-block.why, .explain-block.span-all { grid-column: auto; }.verdict { padding: 20px 15px; align-items: flex-start; }.verdict-icon { width: 42px; height: 42px; }.retry-notice, .choice-reviews { margin-inline: 15px; padding-inline: 0; }.question-source { margin-inline:15px; }.next-bar { position: sticky; bottom: 0; z-index: 5; padding: 12px 15px calc(12px + var(--safe-bottom)); }.next-bar > span { display: none; }.next-bar .button { width: 100%; min-height: 50px; }.unit-card { grid-template-columns: 52px 1fr 70px; padding-inline: 10px; gap: 10px; }.unit-node { width: 52px; height: 52px; }.course-path::before { left: 36px; }.unit-copy > span:not(.meter) { display: none; }.unit-score b { font-size: .95rem; }.unit-score em { display: none; }
  .global-drill-launch { display: none; }
  .toast { right: max(12px, var(--safe-right)); bottom: calc(76px + var(--safe-bottom)); left: max(12px, var(--safe-left)); max-width: none; text-align: center; }
  .dialog { max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 20px); margin-block: calc(var(--safe-top) + 10px) calc(var(--safe-bottom) + 10px); }
  .dialog-card { max-height: inherit; padding: 22px; overflow-y: auto; }
  .drill-page.is-question { padding: max(7px, var(--safe-top)) max(7px, var(--safe-right)) max(5px, var(--safe-bottom)) max(7px, var(--safe-left)); }
  .is-question .drill-hud { top: auto; }
  .quiz-insight .insight-popover, .quiz-insight:first-child .insight-popover, .quiz-insight:nth-of-type(3) .insight-popover { position: fixed; right: max(7px, var(--safe-right)); bottom: calc(53px + var(--safe-bottom)); left: max(7px, var(--safe-left)); width: auto; transform: translateY(6px); }
  .quiz-insight:hover .insight-popover, .quiz-insight:focus-visible .insight-popover, .quiz-insight.is-open .insight-popover, .quiz-insight:first-child:hover .insight-popover, .quiz-insight:first-child:focus-visible .insight-popover, .quiz-insight:first-child.is-open .insight-popover, .quiz-insight:nth-of-type(3):hover .insight-popover, .quiz-insight:nth-of-type(3):focus-visible .insight-popover, .quiz-insight:nth-of-type(3).is-open .insight-popover { transform: translateY(0); }
  body[data-route="quiz"] .toast { bottom: calc(14px + var(--safe-bottom)); }
}

@media (max-width: 520px) {
  .brand-mark { width: 36px; height: 39px; }
  .hero { padding: 28px 20px; border-radius: 22px; }
  .hero h1 { font-size: clamp(2rem, 11vw, 3rem); }
  .hero-copy > p:not(.eyebrow) { font-size: .88rem; }
  .hero-actions { display: grid; margin-top: 1.3rem; }
  .hero-actions .button { width: 100%; }
  .stats-strip { margin-inline: 6px; }
  .stat { padding: 14px 12px; }
  .stat strong { font-size: 1.4rem; }
  .section-heading { display: block; }
  .section-heading > span, .section-heading > div:last-child { display: block; margin-top: .35rem; text-align: left; }
  .toolbar > * { flex-basis: 100%; width: 100%; }
  .toolbar select { width: 100%; }
  .question-meta { flex-wrap: wrap; gap: .3rem; }
  .question-stem { margin-top: .9rem; font-size: 1.22rem; line-height: 1.62; }
  .quiz-choice { padding-inline: 9px; }
  .quiz-insight { min-width: 64px; padding-inline: 7px; }
  .insight-level { padding-inline: 6px; }
  .verdict h2 { font-size: 1.22rem; }
  .counter-row { align-items: end; gap: .5rem; }
  .score-entry { grid-template-columns: 1fr; }
  .score-entry button { grid-column: auto; }
}

@media (max-height: 650px) and (min-width: 600px) {
  .is-question .quiz-options { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(2, minmax(0, 1fr)); }
  .quiz-insight-dock { min-height: 40px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }

/* Lesson completion shares the quiz route, with its own scrollable result phase. */
.lesson-count { color: var(--deep); font-size: .78rem; font-weight: 900; white-space: nowrap; }
.lesson-complete { position: relative; display: flex; min-height: 100dvh; flex-direction: column; overflow: hidden; color: #34413a; background: #fffef9; }
.completion-content { position: relative; z-index: 1; width: min(560px, 100%); margin: auto; padding: 28px 22px 24px; text-align: center; }
.completion-art { position: relative; width: 220px; height: 174px; margin: 0 auto 18px; }
.completion-art::before { position: absolute; inset: 2px 30px 0; border-radius: 50%; background: #f0f8df; content: ""; }
.completion-medal { position: absolute; z-index: 2; top: 12px; left: 50px; display: grid; width: 120px; height: 120px; place-content: center; border: 8px solid #ffe78d; border-radius: 50%; background: #ffc83d; box-shadow: 0 7px 0 #e6a725, inset 0 0 0 3px #efb52c; animation: medal-pop .85s cubic-bezier(.2,.8,.3,1.3) both; }
.completion-medal span { color: #fff9d8; font-size: 54px; line-height: 1; text-shadow: 0 3px #e5a722; }
.completion-medal strong { color: #815614; font-size: 15px; letter-spacing: .12em; }
.medal-ribbon { position: absolute; top: 109px; left: 75px; width: 70px; height: 58px; background: #58b832; clip-path: polygon(0 0,100% 0,100% 100%,50% 75%,0 100%); }
.completion-spark { position: absolute; z-index: 3; color: #ffc025; font-size: 34px; animation: medal-pop .8s .2s both; }
.spark-one { top: 4px; left: 18px; transform: rotate(-15deg); }.spark-two { top: 83px; right: 12px; font-size: 27px; }.spark-three { top: 5px; right: 18px; color: #58b832; }
.completion-eyebrow { margin: 0 0 8px; color: #52831e; font-size: .76rem; font-weight: 900; letter-spacing: .16em; }
.completion-content h1 { margin: 0; color: #4b9c21; font: 900 clamp(2rem,6vw,2.7rem)/1.3 var(--font-sans); outline: none; }
.completion-lead { margin: 12px 0 5px; font-size: 1.2rem; font-weight: 900; }
.completion-message { margin: 0; color: #69776b; font-size: .88rem; }
.completion-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin: 28px 0 20px; }
.completion-stat { overflow: hidden; border: 2px solid var(--stat-color); border-bottom-width: 4px; border-radius: 16px; background: white; animation: answer-rise .5s .2s both; }
.completion-stat > span { display: block; padding: 6px 2px; color: var(--stat-ink); background: var(--stat-color); font-size: .75rem; font-weight: 900; }
.completion-stat strong { display: block; padding: 12px 2px 0; color: var(--stat-ink); font-size: clamp(1.12rem,4vw,1.5rem); font-variant-numeric: tabular-nums; white-space: nowrap; }
.completion-stat small { display: block; padding: 3px 2px 12px; color: #6c766c; font-size: .7rem; }
.stat-xp { --stat-color: #ffda64; --stat-ink: #755000; }.stat-accuracy { --stat-color: #bce88e; --stat-ink: #3b7019; }.stat-time { --stat-color: #a8e4f4; --stat-ink: #176581; }
.completion-streak { display: flex; align-items: center; gap: 12px; padding: 17px; text-align: left; border: 2px solid #e8eadd; border-radius: 16px; background: #fff; }
.completion-streak > span:first-child { font-size: 32px; }.completion-streak strong { font-size: .95rem; }.completion-streak p { margin: 3px 0 0; color: #6c766c; font-size: .76rem; }.completion-check { margin-left: auto; color: #58a52c; font-weight: 900; }
.completion-review-note { margin: 16px 0 0; color: #6c766c; font-size: .8rem; }.completion-review { margin-top: 14px; font-size: .8rem; }
.completion-footer { position: relative; z-index: 1; padding: 22px max(20px,var(--safe-right)) max(26px,var(--safe-bottom)) max(20px,var(--safe-left)); border-top: 2px solid #e9ebdf; background: #fffef9; }
.completion-footer > div { display: flex; width: min(740px,100%); margin: auto; justify-content: space-between; gap: 16px; }
.completion-footer .button { min-height: 52px; padding: 12px 24px; border: 2px solid; border-radius: 15px; font-weight: 900; }
.completion-home { color: #65745f; background: white; border-color: #dfe4d7 !important; box-shadow: 0 4px #dfe4d7; }
.completion-continue { color: white; background: #55ad25; border-color: #55ad25 !important; box-shadow: 0 4px #398819; }
.completion-footer .button:hover { filter: brightness(1.04); transform: translateY(-1px); }.completion-footer .button:active { transform: translateY(4px); box-shadow: none; }
.completion-confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.completion-confetti i { position: absolute; top: -25px; left: var(--x); width: 9px; height: 16px; border-radius: 3px; background: var(--color); opacity: 0; animation: completion-confetti 2.8s var(--delay) ease-out both; }
@keyframes medal-pop { from { opacity: 0; scale: .4; translate: 0 20px; } 65% { scale: 1.12; translate: 0 -8px; } to { opacity: 1; scale: 1; translate: 0 0; } }
@keyframes completion-confetti { 0% { opacity: 0; transform: translateY(-20px) rotate(0); } 10% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(75vh) rotate(540deg); } }
@media (max-width: 540px) { .completion-content { padding-top: max(22px,var(--safe-top)); }.completion-stats { gap: 8px; }.completion-footer > div { flex-direction: column-reverse; }.completion-footer .button { width: 100%; }.completion-art { margin-bottom: 10px; }.lesson-count { font-size: .7rem; } }
@media (prefers-reduced-motion: reduce) { .completion-confetti { display: none; } }

.is-answered abbr, .answer-sheet abbr { text-decoration: underline dotted; text-underline-offset: .2em; cursor: help; }

.quiz-glossary { scroll-margin-top: 90px; }
