/* English Program course site: shared styles for the student and instructor app.
   Look: bold color blocks, thick outlines and sticker shapes.
   Accessibility (WCAG 2.2 AAA): every text color is at least 7:1 against the background it sits on,
   targets are at least 44px, focus is a three-band ring that shows on any color, lines stay under 80 characters,
   and all motion is opt-in: it runs only when the device has not asked for reduced motion. */
:root {
  --bg: #fff6e5; --surface: #ffffff; --ink: #16112a; --muted: #46405c;
  --line: #16112a; --line-soft: #d9cfbd;
  --hero: #21114a; --hero-ink: #ffffff; --hero-muted: #e6ddff;
  --sun: #ffd23f; --mango: #ffab5c; --pink: #ff9fcf; --mint: #62e6c3; --sky: #8fd0ff; --lilac: #c9b6ff;
  --on-bright: #16112a;
  --t1-solid: #62e6c3; --t1: #00524a; --t1-soft: #d6f9ee;
  --t2-solid: #c9b6ff; --t2: #5a2bb0; --t2-soft: #eee6ff;
  --core: #6a4400; --core-dot: #ffd23f; --core-soft: #fff0c2;
  --final: #842a0b; --final-soft: #ffe4d6; --on-final: #ffffff;
  --ok: #0a5230; --ok-soft: #dbf6e5; --bad: #8a1414; --bad-soft: #ffe2e2; --on-bad: #ffffff;
  --on-solid: #16112a;
  --shadow-c: #16112a;
  --shadow: 5px 5px 0 var(--shadow-c);
  --shadow-sm: 3px 3px 0 var(--shadow-c);
  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Atkinson Hyperlegible", Verdana, system-ui, -apple-system, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --stripe: linear-gradient(90deg, var(--sun) 0 20%, var(--mango) 20% 40%, var(--pink) 40% 60%, var(--lilac) 60% 80%, var(--mint) 80% 100%);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #120d22; --surface: #1d1634; --ink: #fff7e8; --muted: #d9d0ee; --line: #fff7e8; --line-soft: #3d3360;
    --hero: #0b0719; --hero-muted: #e6ddff;
    --t1: #6ff0cc; --t1-soft: #0f3a33; --t2: #d2c0ff; --t2-soft: #2d2152;
    --core: #ffd56b; --core-soft: #3a2e0a; --final: #ffb48f; --final-soft: #45230f; --on-final: #16112a;
    --ok: #86e8b0; --ok-soft: #0f3322; --bad: #ffb3b3; --bad-soft: #46161b; --on-bad: #16112a;
    --shadow-c: #7a5cf0;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #120d22; --surface: #1d1634; --ink: #fff7e8; --muted: #d9d0ee; --line: #fff7e8; --line-soft: #3d3360;
  --hero: #0b0719; --hero-muted: #e6ddff;
  --t1: #6ff0cc; --t1-soft: #0f3a33; --t2: #d2c0ff; --t2-soft: #2d2152;
  --core: #ffd56b; --core-soft: #3a2e0a; --final: #ffb48f; --final-soft: #45230f; --on-final: #16112a;
  --ok: #86e8b0; --ok-soft: #0f3322; --bad: #ffb3b3; --bad-soft: #46161b; --on-bad: #16112a;
  --shadow-c: #7a5cf0;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 18px; line-height: 1.6; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.wrap { max-width: 1140px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.narrow { max-width: 840px; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; font-family: var(--f-display); line-height: 1.12; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 5.5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.45rem, 3.2vw, 2rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 800; }
h4 { font-size: 1.08rem; font-weight: 800; }
p, ul, ol { margin: 0; }
/* Readable line length: no paragraph runs past about 75 characters */
main p, main li, main dd, main .q-text { max-width: 75ch; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 3px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 9px var(--sun); border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -100px; z-index: 40; background: var(--sun); color: var(--on-bright); padding: .7rem 1.1rem; border: 3px solid #16112a; border-radius: 10px; font-weight: 700; }
.skip:focus { top: 8px; }
.code { font-family: var(--f-mono); font-weight: 500; letter-spacing: .02em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .94rem; }
.stack { display: grid; gap: 1rem; }
.stack-lg { display: grid; gap: 2.25rem; }
.row { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; }
.between { justify-content: space-between; }
.eyebrow { font-size: .82rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
::selection { background: var(--sun); color: #16112a; }

/* ---------- header ---------- */
.app-head { background: var(--surface); border-bottom: 3px solid var(--line); position: relative; }
.app-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: -9px; height: 6px; background: var(--stripe); }
.app-head .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding-block: .75rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; min-height: 44px; font-family: var(--f-display); font-weight: 800; font-size: 1.25rem; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--sun); color: var(--on-bright); border: 3px solid #16112a; box-shadow: 3px 3px 0 var(--pink); font-size: 1.15rem; transform: rotate(-8deg); }
.who { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .95rem; }

main { padding-block: 2.5rem 5rem; }
main:focus { outline: none; box-shadow: none; }
.back a { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: .3rem .9rem; border: 2.5px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 700; text-decoration: none; box-shadow: var(--shadow-sm); }
.back a:hover { background: var(--sun); color: var(--on-bright); }

/* ---------- buttons and forms ---------- */
.btn { font: inherit; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 48px; padding: .6rem 1.3rem; border-radius: 999px; border: 3px solid #16112a; cursor: pointer; text-decoration: none; background: var(--sun); color: var(--on-bright); box-shadow: var(--shadow-sm); text-align: center; }
.btn:hover { background: var(--mango); }
.btn:active { box-shadow: none; }
.btn.violet { background: var(--lilac); }
.btn.violet:hover { background: var(--pink); }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--t2-soft); }
.btn.danger { background: var(--bad); color: var(--on-bad); border-color: var(--line); }
.btn.danger:hover { background: var(--bad); text-decoration: underline; }
.btn.sm { min-height: 44px; padding: .3rem .95rem; font-size: .92rem; }
.btn[disabled] { cursor: not-allowed; background: var(--surface); color: var(--ink); border-style: dashed; box-shadow: none; }
label { font-weight: 700; display: block; margin-bottom: .3rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], select, textarea {
  font: inherit; width: 100%; padding: .65rem .8rem; border-radius: 12px; border: 2.5px solid var(--line); background: var(--surface); color: var(--ink); min-height: 48px; }
textarea { min-height: 10rem; resize: vertical; line-height: 1.6; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 8px var(--sun); }
.field { display: grid; gap: .2rem; }
.hint { font-size: .92rem; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 1rem; align-items: end; }
summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: .5rem; font-weight: 700; }
summary::marker { color: var(--t2); }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "+"; flex: none; display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2px solid var(--line); font-weight: 800; line-height: 1; background: var(--sun); color: var(--on-bright); }
details[open] > summary::before { content: "−"; background: var(--mint); }

/* ---------- messages ---------- */
.msg { padding: .9rem 1.1rem; border-radius: 14px; border: 3px solid; }
.msg.error { background: var(--bad-soft); border-color: var(--bad); }
.msg.ok { background: var(--ok-soft); border-color: var(--ok); }
.msg.info { background: var(--core-soft); border-color: var(--line); }
.toast { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 30; background: var(--ink); color: var(--bg); padding: .8rem 1.2rem; border-radius: 14px; border: 3px solid var(--sun); font-weight: 700; max-width: calc(100% - 32px); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 3px solid var(--line); border-radius: 20px; padding: 1.4rem; box-shadow: var(--shadow); min-width: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 1.1rem; }

/* Welcome banner: deep color block with sun, petal and stripe shapes */
.hero-band { background: var(--hero); color: var(--hero-ink); border: 3px solid var(--line); border-radius: 28px; padding: clamp(1.4rem, 4vw, 2.5rem); position: relative; overflow: hidden; box-shadow: 8px 8px 0 var(--pink); }
.hero-band::before { content: ""; position: absolute; width: 240px; height: 240px; right: -60px; top: -80px; border-radius: 50%; background: var(--sun); border: 3px solid #16112a; pointer-events: none; }
.hero-band::after { content: ""; position: absolute; width: 180px; height: 120px; right: 120px; bottom: -60px; border-radius: 60% 40% 0 0; background: repeating-linear-gradient(-45deg, var(--mint) 0 12px, transparent 12px 24px); opacity: .9; pointer-events: none; }
.hero-band > * { position: relative; z-index: 1; max-width: 60ch; }
.hero-band h1 { font-size: clamp(2.3rem, 7vw, 4rem); }
.hero-band .eyebrow { color: var(--sun); }
.hero-band p { color: var(--hero-muted); font-size: 1.08rem; }
.hero-band :focus-visible { outline-color: #fff; }
.meter { height: 22px; background: rgba(255,255,255,.12); border: 2.5px solid #fff; border-radius: 999px; overflow: hidden; margin-top: .9rem; max-width: 560px; }
.meter > span { display: block; height: 100%; background: repeating-linear-gradient(-45deg, var(--sun) 0 10px, var(--mango) 10px 20px); border-right: 2.5px solid #fff; border-radius: 999px; transform-origin: left center; }
.rule-banner { display: flex; gap: 1rem; align-items: flex-start; padding: 1.1rem 1.3rem; border-radius: 18px; background: var(--final-soft); border: 3px solid var(--line); box-shadow: var(--shadow-sm); }
.rb-icon { flex: none; width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center; background: var(--mango); color: var(--on-bright); border: 2.5px solid #16112a; font-family: var(--f-display); font-weight: 800; font-size: 1.2rem; }

/* Status chips: always text plus color, never color alone */
.chip { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 700; letter-spacing: .03em; padding: .2rem .7rem; border-radius: 999px; white-space: nowrap; border: 2px solid currentColor; }
.chip::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: currentColor; }
.s-passed { color: var(--ok); background: var(--ok-soft); }
.s-passed::before { content: "✓"; width: auto; height: auto; background: none; }
.s-available, .s-in_progress { color: var(--t1); background: var(--t1-soft); }
.s-pending, .s-component { color: var(--core); background: var(--core-soft); }
.s-locked { color: var(--muted); background: var(--surface); border-style: dashed; }
.s-failed { color: var(--bad); background: var(--bad-soft); }

/* ---------- plan ---------- */
.road { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); gap: 1.25rem; }
.road > li:nth-child(4n+1) { --yc: var(--sun); }
.road > li:nth-child(4n+2) { --yc: var(--mint); }
.road > li:nth-child(4n+3) { --yc: var(--pink); }
.road > li:nth-child(4n+4) { --yc: var(--lilac); }
.year-head { display: flex; align-items: center; gap: .7rem; padding-bottom: .55rem; border-bottom: 4px solid var(--line); margin-bottom: .8rem; }
.year-num { width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--yc, var(--sun)); color: var(--on-bright); border: 2.5px solid #16112a; display: grid; place-items: center; font-family: var(--f-display); font-weight: 800; font-size: 1.15rem; }
.sem { background: var(--surface); border: 2.5px solid var(--line); border-radius: 16px; padding: .8rem; margin-bottom: .8rem; }
.sem-head { font-size: .85rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: .5rem; }
.sem ul { list-style: none; padding: 0; display: grid; gap: .45rem; }
.pc { display: grid; gap: .3rem; min-height: 44px; padding: .6rem .75rem; border-radius: 12px; text-decoration: none; background: var(--bg); border: 2px solid var(--line); border-left-width: 8px; }
a.pc:hover { background: var(--t1-soft); box-shadow: var(--shadow-sm); }
.grid .pc { padding: .9rem 1rem; font-size: 1.05rem; background: var(--surface); box-shadow: var(--shadow-sm); }
.grid a.pc:hover { background: var(--t1-soft); box-shadow: var(--shadow); }
.pc.passed { border-left-color: var(--ok); }
.pc.available, .pc.in_progress { border-left-color: var(--t1); }
.pc.pending, .pc.component { border-left-color: var(--core); }
.pc.failed { border-left-color: var(--bad); }
.pc.locked { border-left-style: dashed; }
.pc-top { display: flex; justify-content: space-between; gap: .5rem; align-items: center; flex-wrap: wrap; }
.pc .code { color: var(--t1); font-size: .88rem; font-weight: 500; }
.track-t2 .pc .code { color: var(--t2); }
.track-t2 a.pc:hover, .track-t2 .grid a.pc:hover { background: var(--t2-soft); }

/* ---------- course page ---------- */
.course-head { display: grid; gap: .75rem; }
.course-head > .row .code { background: var(--sun); color: var(--on-bright); border: 2.5px solid #16112a; border-radius: 10px; padding: .15rem .65rem; font-size: 1rem; transform: rotate(-2deg); box-shadow: 3px 3px 0 var(--pink); }
.tabs { display: flex; flex-wrap: wrap; gap: .6rem; padding-bottom: .4rem; }
.tab { font: inherit; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; padding: .55rem 1.1rem; min-height: 48px; border-radius: 999px; border: 2.5px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; }
.tab:hover { background: var(--t2-soft); }
.tab[aria-selected="true"] { background: var(--sun); color: var(--on-bright); border-color: #16112a; box-shadow: var(--shadow-sm); }
.reading { border-left: 10px solid var(--sun); }
.excerpt-body p + p { margin-top: 1.2rem; }
.excerpt-body { font-size: 1.08rem; line-height: 1.8; max-width: 68ch; }
.cite { font-size: .92rem; color: var(--muted); font-style: italic; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 1rem; }
.video-frame { position: relative; aspect-ratio: 16 / 9; max-width: 100%; border-radius: 16px; overflow: hidden; background: #000; border: 3px solid var(--line); box-shadow: var(--shadow-sm); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.guide h3 { margin: 1.5rem 0 .5rem; }
.guide p { margin: .6rem 0; max-width: 72ch; }
.guide ul { margin: .5rem 0; padding-left: 1.3rem; }
.table-wrap { overflow-x: auto; margin: 1rem 0; border: 3px solid var(--line); border-radius: 16px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: .65rem .8rem; border-bottom: 1.5px solid var(--line-soft); vertical-align: top; }
th { background: var(--sun); color: var(--on-bright); font-weight: 700; border-bottom: 3px solid #16112a; }
tbody tr:hover { background: var(--bg); }

/* ---------- exam ---------- */
.exam-bar { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 3px solid var(--line); padding-block: .65rem; }
.exam-bar .wrap { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; }
.progress { flex: 1 1 200px; height: 18px; background: var(--bg); border: 2.5px solid var(--line); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: repeating-linear-gradient(-45deg, var(--mint) 0 10px, var(--sky) 10px 20px); }
.passage { background: var(--core-soft); border: 2.5px solid var(--line); border-radius: 16px; padding: 1.1rem 1.3rem; white-space: pre-wrap; font-size: 1.05rem; line-height: 1.75; max-height: 32rem; overflow: auto; }
.q { border-top: 2.5px dashed var(--line-soft); padding-top: 1.4rem; }
.q-head { display: flex; gap: .7rem; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: .4rem; }
.q-n { font-family: var(--f-display); font-weight: 800; background: var(--lilac); color: var(--on-bright); border: 2px solid #16112a; border-radius: 999px; padding: .1rem .75rem; }
.q-text { white-space: pre-wrap; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; width: 100%; }
.opt { display: flex; gap: .8rem; align-items: flex-start; min-height: 48px; padding: .7rem .9rem; border: 2.5px solid var(--line); border-radius: 14px; cursor: pointer; font-weight: 400; margin: 0; background: var(--surface); }
.opt:hover { background: var(--t2-soft); }
.opt input { margin-top: .3rem; width: 1.3rem; height: 1.3rem; accent-color: var(--t2); flex: none; }
.opt:has(input:checked) { background: var(--t2-soft); border-width: 3px; box-shadow: var(--shadow-sm); font-weight: 700; }
.opts { display: grid; gap: .6rem; margin-top: .7rem; }
.match-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .6rem; align-items: center; }
@media (max-width: 560px) { .match-row { grid-template-columns: 1fr; } }
.result { border-radius: 16px; padding: 1rem 1.1rem; border: 3px solid var(--line); border-left-width: 10px; background: var(--surface); }
.result.right { border-left-color: var(--ok); background: var(--ok-soft); }
.result.wrong { border-left-color: var(--bad); background: var(--bad-soft); }
.result.partial, .result.waiting { border-left-color: var(--core); background: var(--core-soft); }
.score-big { font-family: var(--f-display); font-size: clamp(3rem, 10vw, 5rem); font-weight: 800; line-height: 1; }
.key { background: var(--t2-soft); border: 2px solid var(--line); border-radius: 14px; padding: .8rem 1rem; }
.answer-box { background: var(--bg); border: 2px solid var(--line); border-radius: 14px; padding: .9rem 1rem; white-space: pre-wrap; }

/* ---------- sign in ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem 16px; background-color: var(--hero);
  background-image: radial-gradient(circle at 12% 18%, var(--sun) 0 70px, transparent 71px), radial-gradient(circle at 88% 82%, var(--pink) 0 90px, transparent 91px), radial-gradient(circle at 85% 12%, var(--mint) 0 26px, transparent 27px), radial-gradient(circle at 10% 88%, var(--lilac) 0 34px, transparent 35px); }
.login-card { width: min(460px, 100%); box-shadow: 8px 8px 0 var(--sun); border-color: #16112a; }
.login-card h1 { font-size: clamp(2.2rem, 7vw, 3rem); }

/* ---------- course lessons with a sticky course path ---------- */
.course-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
@media (min-width: 960px) { .course-layout { grid-template-columns: 300px minmax(0, 1fr); align-items: start; } .course-nav { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; } }
.course-nav { background: var(--surface); }
.course-nav ol { margin-top: .6rem; padding-left: 0; list-style: none; display: grid; gap: .35rem; font-size: .95rem; counter-reset: step; }
.course-nav li { counter-increment: step; }
.course-nav a { display: flex; gap: .6rem; align-items: flex-start; min-height: 44px; padding: .45rem .6rem; border-radius: 12px; text-decoration: none; line-height: 1.35; border: 2px solid transparent; }
.course-nav a::before { content: counter(step); flex: none; display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; border: 2px solid var(--line); font-weight: 800; font-size: .8rem; background: var(--bg); }
.course-nav a:hover { background: var(--t2-soft); border-color: var(--line); }
.course-nav li:last-child a { background: var(--mango); color: var(--on-bright); border-color: #16112a; font-weight: 700; }
.course-nav li:last-child a::before { content: "★"; background: var(--sun); border-color: #16112a; color: var(--on-bright); }
#done-count { font-weight: 700; }
.lesson { scroll-margin-top: 1rem; border-top-width: 12px; }
.lesson:nth-of-type(5n+1) { border-top-color: var(--sun); }
.lesson:nth-of-type(5n+2) { border-top-color: var(--mint); }
.lesson:nth-of-type(5n+3) { border-top-color: var(--pink); }
.lesson:nth-of-type(5n+4) { border-top-color: var(--lilac); }
.lesson:nth-of-type(5n+5) { border-top-color: var(--sky); }
.lesson h2 { font-size: clamp(1.3rem, 2.8vw, 1.65rem); }
.lesson h3, .lesson h4 { font-size: 1.15rem; }
.lesson .eyebrow { color: var(--t2); margin-bottom: -.5rem; }
.final-step { border-top-color: var(--mango) !important; }
.reading-list { list-style: none; padding: 0; display: grid; gap: .6rem; }
.reading-item { background: var(--core-soft); border: 2px solid var(--line); border-radius: 14px; padding: .8rem 1rem; }
.reading-item a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.done-toggle { max-width: 24rem; background: var(--t1-soft); }
.done-toggle:has(input:checked) { background: var(--mint); color: var(--on-bright); }
.done-toggle input { accent-color: var(--t1); }

.review-list { display: grid; gap: .5rem; margin: 0; }
.review-list > div { display: grid; grid-template-columns: minmax(9rem, 14rem) 1fr; gap: .25rem 1rem; padding-block: .55rem; border-bottom: 2px dashed var(--line-soft); }
.review-list dt { font-weight: 700; }
.review-list dd { margin: 0; }
@media (max-width: 640px) { .review-list > div { grid-template-columns: 1fr; } }

/* ---------- phones ---------- */
@media (max-width: 560px) {
  body { font-size: 17px; }
  .who .muted { display: none; }
  main { padding-block: 1.6rem 3.5rem; }
  .card { padding: 1.1rem; border-radius: 16px; box-shadow: 4px 4px 0 var(--shadow-c); }
  .hero-band { box-shadow: 5px 5px 0 var(--pink); }
  .hero-band::before { width: 110px; height: 110px; right: -45px; top: -50px; }
  .hero-band .eyebrow { padding-right: 3rem; }
  .hero-band::after { right: 20px; width: 120px; }
  .rule-banner { padding: 1rem; gap: .75rem; }
}

/* ---------- motion: only when the device allows it ---------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .btn, .pc, .tab, .opt, .back a, .course-nav a, .card { transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease; }
  .btn:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--shadow-c); }
  .btn:active { transform: translate(2px, 2px); box-shadow: none; }
  .btn[disabled]:hover { transform: none; box-shadow: none; }
  a.pc:hover, .back a:hover { transform: translate(-2px, -2px) rotate(-.4deg); }
  .opt:hover { transform: translateX(3px); }
  .brand:hover .brand-mark { transform: rotate(8deg) scale(1.06); }
  .brand-mark { transition: transform .25s ease; }
  main .stack-lg > * { animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
  main .stack-lg > *:nth-child(2) { animation-delay: .06s; }
  main .stack-lg > *:nth-child(3) { animation-delay: .12s; }
  main .stack-lg > *:nth-child(4) { animation-delay: .18s; }
  main .stack-lg > *:nth-child(n+5) { animation-delay: .24s; }
  .hero-band::before { animation: pop .7s cubic-bezier(.3,1.5,.5,1) both .1s; }
  .meter > span { animation: grow 1s cubic-bezier(.2,.8,.2,1) both .3s; }
  .login-card { animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
  @keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
  @keyframes pop { from { transform: scale(.4); } to { transform: none; } }
  @keyframes grow { from { transform: scaleX(0); } to { transform: none; } }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media (forced-colors: active) { .chip, .pc, .card, .btn { border-color: CanvasText; } .meter > span, .progress > span { background: Highlight; } }
@media print { .app-head, .exam-bar, .btn { display: none !important; } .card { box-shadow: none; } }

/* ---------- discussion board, projects, listening text version ---------- */
.post { background: var(--surface); border: 2.5px solid var(--line); border-radius: 18px; padding: 1rem 1.2rem; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: .5rem; }
.post-meta { margin: 0; }
.post-body p { margin: .3rem 0; overflow-wrap: anywhere; }
.post-actions { gap: .5rem; }
.replies { gap: .7rem; margin-left: clamp(.6rem, 4vw, 2rem); padding-left: clamp(.6rem, 2vw, 1rem); border-left: 4px solid var(--t2); }
.replies:empty { display: none; }
.post.reply { box-shadow: none; border-width: 2px; }
.reply-form { padding-top: .4rem; }
.clips { list-style: none; padding: 0; margin: 0; }
.clip { background: var(--core-soft); border: 2px solid var(--line); border-radius: 14px; padding: .7rem .9rem; display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; }
.clip .row { width: 100%; }
input[type=file] { min-height: 48px; padding: .5rem; border: 2.5px dashed var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); max-width: 100%; font: inherit; }
input[type=file]::file-selector-button { min-height: 40px; padding: .3rem .9rem; margin-right: .8rem; border: 2.5px solid var(--line); border-radius: 999px; background: var(--sun); color: #16112a; font: inherit; font-weight: 700; cursor: pointer; }
input[type=file]:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 8px var(--sun); }
.btn.rec-on { background: var(--bad); color: var(--on-bad); }
.btn.rec-on::before { content: ""; display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; background: currentColor; margin-right: .5rem; }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 700; }
.mode-pick { gap: .6rem; }
.mode-pick .opt { flex: 1 1 15rem; }
.script p { margin: 0 0 .5rem; white-space: normal; }
.script-box h3 { margin: 0; }
.ways summary { cursor: pointer; }
@media (forced-colors: active) { .post, .clip, input[type=file] { border-color: CanvasText; } }
