/* Edapt exercise-book stylesheet, built from the 9 October prototypes. */

/* Layout: the tutor app as a ruled 1B5 page. A sidebar sits left of the
   margin line; the page content sits right of it. Everything is sized in
   multiples of --line so text lands on the rules. Settings switch the
   root's data attributes. Night mode is the same book as a whiteboard. */
/* Caveat (SIL Open Font License) is served from /fonts so no page fetches from Google. */
@font-face { font-family: "Caveat"; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/caveat-500-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Caveat"; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/caveat-500-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Caveat"; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/caveat-700-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Caveat"; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/caveat-700-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --paper:     #f5f3ec;
  --field:     #fffefb;
  --card:      #fbfaf6;
  --rule:      #c3d0dc;
  --margin:    #d98c86;
  --ink:       #1b2733;
  --ink-2:     #3d4a57;
  --ink-3:     #5b6670;
  --on-ink:    #ffffff;
  --sky:       #8bbfdc;
  --sky-deep:  #2b5f84;
  --link:      #2b5f84;
  --yellow:    #f5c84b;
  --yellow-ink:#7a5c0a;
  --mint:      #3aa981;
  --mint-ink:  #17513f;
  --red:       #c75a52;
  --red-ink:   #8f3a33;
  /* The one red that carries white text: chips, badges, and reminders that mean "down" or "overdue". */
  --red-fill:  #b04a43;
  --hl-q:      color-mix(in srgb, #f5c84b 85%, transparent);
  --hl-a:      color-mix(in srgb, #3aa981 55%, transparent);
  --font-body: Arial, Helvetica, sans-serif;
  --font-note: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --ease:      cubic-bezier(0.16, 1, 0.3, 1);
  --line:      32px;
  --fs:        17px;
  --side:      240px;
  color-scheme: light;
}
:root[data-theme="night"] {
  --paper:     #1b2733;
  --field:     #243442;
  --card:      #20303d;
  --rule:      rgba(243, 247, 251, 0.14);
  --margin:    #a35a55;
  --ink:       #f2efe6;
  --ink-2:     #d9d6cc;
  --ink-3:     #aab1b8;
  --on-ink:    #1b2733;
  --sky-deep:  #8bbfdc;
  --link:      #8bbfdc;
  --yellow-ink:#f5c84b;
  --mint-ink:  #3aa981;
  --red-ink:   #e39a93;
  --hl-q:      color-mix(in srgb, #f5c84b 90%, transparent);
  /* Full mint: ink on the hint highlighter stays above 4.5:1 on the dark card. */
  --hl-a:      #3aa981;
  color-scheme: dark;
}
:root[data-easy="1"] { --line: 48px; --fs: 18px; --font-body: Verdana, "Segoe UI", sans-serif; --font-note: Verdana, "Segoe UI", sans-serif; }
:root[data-easy="1"] body { letter-spacing: 0.04em; word-spacing: 0.14em; }
:root[data-easy="1"] .brand { letter-spacing: 0; word-spacing: 0; }
:root[data-easy="1"] .note, :root[data-easy="1"] .who, :root[data-easy="1"] .tag, :root[data-easy="1"] .k, :root[data-easy="1"] .code, :root[data-easy="1"] .date, :root[data-easy="1"] .combo label, :root[data-easy="1"] .saved { font-size: 15px; font-weight: 700; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image: repeating-linear-gradient(to bottom, transparent 0 calc(var(--line) - 6px), var(--rule) calc(var(--line) - 6px) calc(var(--line) - 4px), transparent calc(var(--line) - 4px) var(--line));
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs);
  line-height: var(--line);
}
h1, h2, h3, p, ul { margin: 0; }
h1 { font-size: 38px; line-height: calc(var(--line) * 2); font-weight: 700; letter-spacing: -0.015em; text-wrap: balance; }
h2 { font-size: 24px; line-height: var(--line); font-weight: 700; }
h3 { font-size: 18px; line-height: var(--line); font-weight: 700; }
.note { font-family: var(--font-note); font-size: 24px; line-height: var(--line); color: var(--sky-deep); font-weight: 700; }
.note-ink { color: var(--ink-3); }
.muted { color: var(--ink-3); font-size: 15px; }
a { color: var(--link); }
a:hover { text-decoration-thickness: 3px; }
.row { min-height: calc(var(--line) * 2); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-1 { height: var(--line); display: flex; align-items: center; gap: 12px; }
.stack > * + * { margin-top: var(--line); }
.skip { position: absolute; left: 16px; top: -64px; z-index: 300; background: var(--ink); color: var(--on-ink); padding: 8px 14px; border-radius: var(--radius); font-weight: 700; text-decoration: none; }
.skip:focus-visible { top: 8px; outline: 3px solid var(--sky-deep); outline-offset: 3px; }
button, a, input, select, textarea, [role="option"] { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

/* Shell */
.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100%; }
.side { padding: 0 16px 0 20px; border-right: 2px solid var(--margin); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.main { padding: 0 24px 0 32px; min-width: 0; display: flex; flex-direction: column; }
.brand { height: calc(var(--line) * 2); display: flex; align-items: center; font-weight: 700; font-size: 24px; line-height: 32px; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand b { font: inherit; color: var(--sky-deep); vertical-align: baseline; }
.menu { list-style: none; padding: 0; }
.menu a { display: flex; align-items: center; gap: 10px; height: var(--line); padding: 0 10px; margin: 0 -10px; border-radius: var(--radius); text-decoration: none; color: var(--ink-2); font-weight: 700; }
.menu a svg { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; color: var(--ink-3); }
.menu a:hover { background: color-mix(in srgb, var(--sky) 35%, transparent); }
.menu a[aria-current="page"], .menu a[aria-current="page"]:hover { background: var(--ink); color: var(--on-ink); }
.menu a[aria-current="page"] svg { color: var(--yellow); }
.menu a:focus-visible { outline: 3px solid var(--sky-deep); outline-offset: 2px; }
.side .who { margin-top: auto; height: calc(var(--line) * 2); display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--sky); border: 2px solid var(--ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: #1b2733; }
.topbar { min-height: calc(var(--line) * 2); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.view[hidden] { display: none; }
.view { padding-bottom: calc(var(--line) * 2); }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 2px solid var(--margin); padding-inline: 16px; }
  .menu { display: flex; flex-wrap: wrap; gap: 4px 12px; }
  .menu a { margin: 0; }
  .side .who { display: none; }
  .main { padding-inline: 16px; }
}

/* Buttons, chips */
.btn { height: 48px; padding: 0 20px; border-radius: 999px; display: inline-flex; align-items: center; font: inherit; font-weight: 700; font-size: 16px; text-decoration: none; border: 2px solid var(--ink); color: var(--ink); background: transparent; cursor: pointer; transition: transform 150ms var(--ease), box-shadow 150ms var(--ease); }
.btn:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.btn:focus-visible { outline: 3px solid var(--sky-deep); outline-offset: 3px; }
.btn-ink { background: var(--ink); color: var(--on-ink); }
.btn-red { border-color: var(--red-ink); color: var(--red-ink); }
.btn-sm { height: 40px; padding: 0 16px; font-size: 15px; }
.chip { height: 32px; padding: 0 12px; border-radius: var(--radius); display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; border: 2px solid; white-space: nowrap; color: #1b2733; }
.chip-up { background: var(--mint); border-color: #17513f; }
.chip-flat { background: var(--yellow); border-color: #7a5c0a; }
.chip-down { background: var(--red-fill); border-color: #8f3a33; color: #ffffff; }
.chip-ink { background: var(--paper); border-color: var(--ink); color: var(--ink); }

/* Cards and boxes: outline and shadow never move the rhythm */
.card { padding: 16px 24px; outline: 2px solid var(--ink); outline-offset: -2px; box-shadow: 8px 8px 0 var(--sky); background: var(--card); }
.card-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; min-height: calc(var(--line) * 2); align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--line); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--line); }
@media (max-width: 1100px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* Highlighters: yellow for the question, green for the hint, ink text always */
.hl { padding: 0 0.2em; margin: 0 -0.2em; border-radius: 4px; -webkit-box-decoration-break: clone; box-decoration-break: clone; background-repeat: no-repeat; background-size: 100% 100%; background-position: 0 0; color: #1b2733; }
.hl-q { background-image: linear-gradient(var(--hl-q), var(--hl-q)); }
.hl-a { background-image: linear-gradient(var(--hl-a), var(--hl-a)); }
:root[data-hl="0"] .hl { background-image: none; color: inherit; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    :root:not([data-anim="0"]):not([data-sweep="0"]) .hl { animation: sweep linear both; animation-timeline: view(); animation-range: entry 20% entry 90%; }
  }
}
@keyframes sweep { from { background-size: 0% 100%; } }

/* Dialogue */
.dialogue { display: flex; flex-direction: column; gap: var(--line); padding-top: var(--line); }
.box { position: relative; padding: 8px 20px; margin-block: -8px; outline: 2px solid var(--ink); outline-offset: -2px; box-shadow: 8px 8px 0 var(--sky); max-width: 82%; }
.box.student { align-self: flex-end; box-shadow: 8px 8px 0 var(--yellow); }
.box.refusal { box-shadow: 8px 8px 0 var(--red); }
.box .who { position: absolute; top: calc(var(--line) * -1 + 8px); left: 0; font-family: var(--font-note); font-size: 22px; line-height: var(--line); color: var(--ink-3); }
.box.student .who { left: auto; right: 0; }
.box .tag { position: absolute; right: -8px; bottom: calc(var(--line) * -1 + 8px); font-family: var(--font-note); font-size: 22px; line-height: var(--line); font-weight: 700; }
.tag-q { color: var(--yellow-ink); } .tag-a { color: var(--mint-ink); } .tag-r { color: var(--red-ink); }
.box.thinking p { color: var(--ink-3); }
.box.thinking i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); margin-right: 4px; }
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-anim="0"]):not([data-settle="0"]) .box { animation: settle 500ms var(--ease) both; }
  .box:nth-child(2) { animation-delay: 120ms; } .box:nth-child(3) { animation-delay: 240ms; } .box:nth-child(4) { animation-delay: 360ms; }
  :root:not([data-anim="0"]) .box.thinking i { animation: pulse 1s ease-in-out infinite; }
  .box.thinking i:nth-child(2) { animation-delay: 150ms; } .box.thinking i:nth-child(3) { animation-delay: 300ms; }
}
@keyframes settle { from { opacity: 0; transform: translateY(8px); } }
@keyframes pulse { 50% { opacity: 0.3; } }
.summary { padding: 8px 20px; margin-block: calc(var(--line) - 8px) -8px; outline: 2px solid var(--ink); outline-offset: -2px; box-shadow: 8px 8px 0 var(--mint); }

/* The ask bar stays at the bottom of the window on Study */
.ask-dock { position: sticky; bottom: 0; margin-top: var(--line); padding-block: 8px; background: var(--paper); box-shadow: 0 -2px 0 var(--rule); }
.ask { min-height: calc(var(--line) * 2); display: flex; align-items: flex-end; gap: 12px; }
.ask textarea { flex: 1; height: 48px; max-height: 192px; min-width: 0; resize: none; overflow-y: auto; padding: 10px 16px; font: inherit; font-size: 16px; line-height: 24px; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--field); color: var(--ink); }
:root:not([data-anim="0"]) .ask textarea { transition: height 120ms var(--ease); }
.ask textarea:focus-visible { outline: 3px solid var(--sky-deep); outline-offset: 2px; }
.ask-hint { min-height: var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
kbd { font: 700 12px/1 var(--font-body); border: 1px solid var(--ink-3); border-radius: 4px; padding: 2px 5px; color: var(--ink-2); }

/* Focus bar + searchable dropdowns */
.focus { min-height: calc(var(--line) * 2); display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; padding-top: 22px; }
.focus > * { height: 40px; display: inline-flex; align-items: center; }
.focus .k { font-family: var(--font-note); font-size: 22px; color: var(--ink-3); }
.combo { position: relative; }
.combo label { position: absolute; left: 12px; top: -22px; font-family: var(--font-note); font-size: 20px; line-height: 20px; color: var(--ink-3); pointer-events: none; }
.combo input { height: 40px; width: 220px; max-width: 100%; padding: 0 36px 0 14px; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--paper); color: var(--ink); font: inherit; font-weight: 700; font-size: 15px; }
.combo.narrow input { width: 130px; }
.combo input:focus-visible { outline: 3px solid var(--sky-deep); outline-offset: 3px; }
.combo .caret { position: absolute; right: 12px; top: 10px; pointer-events: none; color: var(--ink-3); font-size: 14px; }
.combo ul { position: absolute; left: 0; top: 46px; z-index: 50; width: max(100%, 260px); max-height: 288px; overflow-y: auto; list-style: none; padding: 6px; margin: 0; background: var(--field); border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); line-height: 24px; }
.combo ul[hidden] { display: none; }
.combo li { padding: 6px 10px; border-radius: var(--radius); cursor: pointer; font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 10px; }
.combo li .sw { width: 12px; height: 12px; border-radius: 3px; border: 2px solid var(--ink); flex: none; }
.combo li[aria-selected="true"], .combo li:hover { background: var(--ink); color: var(--on-ink); }
.combo li.empty { color: var(--ink-3); cursor: default; }

/* Progress: rings */
.ring-tile { padding: var(--line) 24px 16px; outline: 2px solid var(--ink); outline-offset: -2px; display: grid; grid-template-columns: 128px 1fr; gap: 16px; align-items: start; min-height: calc(var(--line) * 6); background: var(--card); }
.ring-tile.up { box-shadow: 8px 8px 0 var(--mint); } .ring-tile.flat { box-shadow: 8px 8px 0 var(--yellow); } .ring-tile.down { box-shadow: 8px 8px 0 var(--red); }
.ring { width: 128px; height: 128px; }
.ring circle { fill: none; stroke-width: 12; }
.ring .track { stroke: var(--rule); }
.ring .arc { stroke: var(--arc); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; stroke-dasharray: 327; stroke-dashoffset: calc(327 - 327 * var(--p)); }
.ring text { font-family: var(--font-body); font-weight: 700; font-size: 30px; fill: var(--ink); text-anchor: middle; }
@media (prefers-reduced-motion: no-preference) { :root:not([data-anim="0"]):not([data-grow="0"]) .ring .arc { animation: draw 1200ms var(--ease) both; } }
@keyframes draw { from { stroke-dashoffset: 327; } }
.ring-tile .k { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; color: var(--ink-3); height: var(--line); }
.ring-tile .d { font-weight: 700; display: flex; align-items: center; gap: 6px; height: var(--line); }
.d.up { color: var(--mint-ink); } .d.flat { color: var(--yellow-ink); } .d.down { color: var(--red-ink); }

/* Progress: line chart */
.line-chart { width: 100%; height: calc(var(--line) * 8); display: block; }
.line-chart .grid { stroke: var(--rule); stroke-dasharray: 4 4; }
.line-chart .axis { font-family: var(--font-body); font-size: 12px; fill: var(--ink-3); }
.line-chart .area { fill: color-mix(in srgb, var(--sky) 35%, transparent); }
.line-chart .path { fill: none; stroke: var(--sky-deep); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1000; stroke-dashoffset: 0; }
.line-chart .dot { fill: var(--field); stroke: var(--sky-deep); stroke-width: 2.5; }
.line-chart .dot.end { fill: var(--sky-deep); }
.line-chart .dot:hover, .line-chart .dot:focus { stroke-width: 4; outline: none; }
.line-chart .dot-tip { font-family: var(--font-body); font-size: 13px; font-weight: 700; fill: var(--ink); opacity: 0; pointer-events: none; text-anchor: middle; }
.line-chart .dot:hover + .dot-tip, .line-chart .dot:focus + .dot-tip { opacity: 1; }
.line-chart .end-label { font-family: var(--font-body); font-size: 14px; font-weight: 700; fill: var(--ink); }
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-anim="0"]):not([data-grow="0"]) .line-chart .path { animation: trace 1400ms var(--ease) both; }
  :root:not([data-anim="0"]):not([data-grow="0"]) .line-chart .area { animation: fade 600ms 900ms var(--ease) both; }
}
@keyframes trace { from { stroke-dashoffset: 1000; } }
@keyframes fade { from { opacity: 0; } }

/* Progress: horizontal mastery bars */
.hbars { list-style: none; padding: 0; }
.hbars li { display: grid; grid-template-columns: 140px 1fr 110px; gap: 12px; align-items: center; min-height: calc(var(--line) * 2); padding-block: 8px; }
.hbars .track { height: 20px; background: color-mix(in srgb, var(--rule) 60%, transparent); border-radius: 4px; position: relative; }
.hbars .fill { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); border: 2px solid; border-radius: 4px; transform-origin: left; background-clip: padding-box; }
.hbars .fill.up { background: var(--mint); border-color: #17513f; } .hbars .fill.flat { background: var(--yellow); border-color: #7a5c0a; } .hbars .fill.down { background: var(--red); border-color: #8f3a33; }
.hbars .fill span { position: absolute; left: calc(100% + 8px); top: -6px; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
@media (prefers-reduced-motion: no-preference) { :root:not([data-anim="0"]):not([data-grow="0"]) .hbars .fill { animation: growx 800ms var(--ease) both; animation-delay: calc(var(--i) * 90ms); } }
@keyframes growx { from { transform: scaleX(0); } }
.hbars strong { font-size: 15px; }
@media (max-width: 600px) { .hbars li { grid-template-columns: 1fr; } }

/* Streak: green studied, red missed, today outlined */
.streak { display: flex; gap: 6px; flex-wrap: wrap; height: var(--line); align-items: center; }
.streak i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ink); display: inline-block; }
.streak i.f { background: var(--mint); border-color: #17513f; }
.streak i.m { background: var(--red); border-color: #8f3a33; }
.streak i.t { background: transparent; border-style: dashed; }

/* Tables */
details summary { height: var(--line); cursor: pointer; font-weight: 700; color: var(--link); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { height: var(--line); text-align: left; padding: 0 8px; border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums; white-space: nowrap; }
th { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.tbl { overflow-x: auto; }

/* Curriculum */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; min-height: calc(var(--line) * 2); align-items: center; }
.tab { height: 36px; padding: 0 14px; border-radius: 999px; border: 2px solid var(--ink); background: transparent; font: inherit; font-weight: 700; font-size: 14px; color: var(--ink); cursor: pointer; }
.tab[aria-selected="true"] { background: var(--ink); color: var(--on-ink); }
.tab:focus-visible { outline: 3px solid var(--sky-deep); outline-offset: 3px; }
.stmt { list-style: none; padding: 0; }
.stmt li { display: grid; grid-template-columns: 96px 1fr auto; gap: 16px; align-items: start; padding-block: var(--line) 0; }
.stmt .code { font-family: var(--font-note); font-size: 22px; line-height: var(--line); color: var(--sky-deep); font-weight: 700; }
.stmt .strand { font-size: 14px; font-weight: 700; color: var(--ink-3); height: var(--line); }
@media (max-width: 600px) { .stmt li { grid-template-columns: 1fr; } }

/* Review */
.due { list-style: none; padding: 0; }
.due li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; min-height: calc(var(--line) * 2); }
.due .sub { color: var(--ink-3); font-size: 14px; }
.rv-card { display: block; padding: 8px 20px; margin-block: calc(var(--line) - 8px) -8px; outline: 2px solid var(--ink); outline-offset: -2px; box-shadow: 8px 8px 0 var(--yellow); }
.rv-card input { flex: 1; height: 40px; min-width: 0; border: 2px solid var(--ink); border-radius: var(--radius); padding: 0 12px; font: inherit; font-size: 15px; background: var(--field); color: var(--ink); }
.rv-card input:focus-visible { outline: 3px solid var(--sky-deep); outline-offset: 2px; }
.rv-card form { display: flex; gap: 12px; align-items: center; height: calc(var(--line) * 2); }

/* Notebook */
.entries { list-style: none; padding: 0; }
.entry { padding: 8px 20px; margin-block: calc(var(--line) - 8px) -8px; outline: 2px solid var(--ink); outline-offset: -2px; box-shadow: 8px 8px 0 var(--yellow); }
.entry .date { font-family: var(--font-note); font-size: 22px; color: var(--ink-3); height: var(--line); }

/* Settings */
.set { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; min-height: calc(var(--line) * 2); }
.set .sub { color: var(--ink-3); font-size: 14px; display: block; }
.set select, .set input[type="text"] { height: 40px; font: inherit; font-size: 15px; font-weight: 700; padding: 0 12px; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--field); color: var(--ink); min-width: 180px; max-width: 100%; }
.set select:focus-visible, .set input:focus-visible { outline: 3px solid var(--sky-deep); outline-offset: 2px; }
.switch { position: relative; width: 56px; height: 32px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch input { z-index: 1; }
button.cal-chip { display: block; width: 100%; text-align: left; font: inherit; cursor: pointer; }
.switch span { pointer-events: none; position: absolute; inset: 0; border-radius: 999px; border: 2px solid var(--ink); background: var(--paper); transition: background 150ms var(--ease); }
.switch span::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); transition: transform 150ms var(--ease); }
.switch input:checked + span { background: var(--mint); }
.switch input:checked + span::after { transform: translateX(24px); background: #1b2733; }
.switch input:focus-visible + span { outline: 3px solid var(--sky-deep); outline-offset: 3px; }
.sub-list { padding-left: 24px; border-left: 2px solid var(--rule); }
.sub-list .set { min-height: var(--line); }
.saved { font-family: var(--font-note); font-size: 22px; color: var(--mint-ink); height: var(--line); opacity: 0; transition: opacity 300ms var(--ease); }
.saved.on { opacity: 1; }
.data-box textarea { width: 100%; height: calc(var(--line) * 4); font: 13px/20px ui-monospace, Consolas, monospace; border: 2px solid var(--ink); border-radius: var(--radius); padding: 6px 10px; resize: none; background: var(--field); color: var(--ink); }

/* Confirm dialogue */
dialog { border: 2px solid var(--ink); border-radius: var(--radius); padding: 24px; max-width: 440px; width: calc(100% - 32px); background: var(--card); color: var(--ink); box-shadow: 10px 10px 0 var(--red); font: inherit; line-height: var(--line); }
dialog::backdrop { background: rgba(12, 24, 36, 0.55); }
dialog h2 { margin-bottom: 8px; }
dialog .acts { display: flex; gap: 12px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }

/* ---- polish pass: depth, radii, marks, browser surfaces ---- */
:root { --shadow: 0 1px 0 rgba(27,39,51,.06), 0 10px 24px -14px rgba(27,39,51,.35); --radius: 6px; }
::selection { background: color-mix(in srgb, var(--yellow) 70%, transparent); color: #1b2733; }
html { caret-color: var(--ink); scrollbar-color: var(--rule) transparent; }
.btn { border-radius: var(--radius); transition: background 150ms var(--ease), color 150ms var(--ease), border-color 150ms var(--ease); }
.btn:hover { transform: none; box-shadow: none; background: color-mix(in srgb, var(--sky) 30%, transparent); }
.btn-ink:hover { background: var(--sky-deep); }
.btn-red:hover { background: color-mix(in srgb, var(--red) 16%, transparent); }
.chip { border-radius: var(--radius); height: 28px; padding: 0 10px; font-size: 13px; letter-spacing: .01em; }
.chip-up::before, .chip-flat::before, .chip-down::before, .val.up::before, .val.flat::before, .val.down::before, .d.up::before, .d.flat::before, .d.down::before { content: ""; display: inline-block; flex: none; }
.chip-up::before, .val.up::before, .d.up::before { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 9px solid currentColor; }
.chip-flat::before, .val.flat::before, .d.flat::before { width: 9px; height: 9px; background: currentColor; }
.chip-down::before, .val.down::before, .d.down::before { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 9px solid currentColor; }
.box { outline: 0; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); padding: 6px 18px; margin-block: -8px; }
.box.student { background: color-mix(in srgb, var(--yellow) 16%, var(--card)); box-shadow: var(--shadow); }
.box.refusal { background: color-mix(in srgb, var(--red) 12%, var(--card)); box-shadow: var(--shadow); }
.box.thinking { background: transparent; border-style: dashed; box-shadow: none; }
.card, .chart-card, .ring-tile, .tile, .stat, .entry, .rv-card, .summary, .notice { outline: 0; border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); }
.ring-tile.up, .ring-tile.flat, .ring-tile.down, .stat.up, .stat.flat, .stat.down, .stat.plain, .tile-sky, .tile-yellow, .tile-mint { box-shadow: var(--shadow); }
.entry { box-shadow: var(--shadow); background: var(--card); }
.summary { background: color-mix(in srgb, var(--mint) 14%, var(--card)); }
.rv-card { background: color-mix(in srgb, var(--yellow) 14%, var(--card)); }
.combo input, .ask textarea, .set select, .set input[type="text"], .data-box textarea, .rv-card input, textarea, select { border-radius: var(--radius); }
.combo ul { border-radius: var(--radius); box-shadow: var(--shadow); }
.menu a[aria-current="page"], .menu a[aria-current="page"]:hover { border-radius: var(--radius); }
.chip-btn, .tab { border-radius: var(--radius); }
.box .who, .box .tag, .entry .date { font-family: var(--font-note); }
dialog { border-radius: var(--radius); box-shadow: 0 24px 48px -24px rgba(27,39,51,.5); }
.focus-visible, :focus-visible { outline-color: var(--sky-deep); }

/* ---- home page ---- */
body > * { grid-column: 2; min-width: 0; }
.board, .cta { grid-column: 1 / -1; }
.lede { font-size: 19px; color: var(--ink-2); max-width: 60ch; }
.nav { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; position: relative; z-index: 2; }
.brand { font-weight: 700; font-size: 24px; line-height: 32px; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand b { font: inherit; color: var(--sky-deep); vertical-align: baseline; }
.nav ul { list-style: none; padding: 0; display: flex; gap: 24px; font-weight: 700; }
.nav a:not(.btn) { text-decoration: none; color: var(--ink-2); }
section { padding-block: 64px; }
.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; align-items: start; }
@keyframes sweep { from { background-size: 0% 100%; } }
.strip { min-height: 64px; display: flex; align-items: center; gap: 8px 28px; flex-wrap: wrap; font-family: var(--font-note); font-size: 22px; color: var(--ink-3); }
.strip b { color: var(--ink); font-weight: 700; }
.board { position: relative; padding: 64px 16px; background-color: var(--ink); }
.board .note { color: var(--sky); }
.board a, .board a:hover { color: var(--chalk); }
.board .box { outline-color: var(--chalk); box-shadow: 8px 8px 0 var(--sky-deep); }
.board .who { color: #aab1b8; }
.lede-chalk { font-size: 19px; color: #d9d6cc; max-width: 60ch; }
.refused { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0; }
.refused li { height: 64px; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.refused s { text-decoration-color: var(--red); text-decoration-thickness: 3px; font-weight: 700; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.step { padding: 32px 24px 24px; outline: 2px solid var(--ink); outline-offset: -2px; box-shadow: 8px 8px 0 var(--sky); position: relative; }
.step .n { position: absolute; top: -32px; left: 16px; font-family: var(--font-note); font-size: 28px; line-height: 32px; color: var(--sky-deep); font-weight: 700; }
.step p { color: var(--ink-2); }
.subjects { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.subj { height: 128px; padding: 16px 20px; display: flex; align-items: flex-end; font-weight: 700; font-size: 22px; line-height: 32px; outline: 2px solid var(--ink); outline-offset: -2px; text-decoration: none; color: var(--ink); transition: transform 150ms var(--ease), box-shadow 150ms var(--ease); }
.subj:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.subj:focus-visible { outline: 3px solid var(--sky-deep); outline-offset: 3px; }
.s-sky { background: var(--sky); } .s-mint { background: var(--mint); } .s-yellow { background: var(--yellow); }
.s-ink { background: var(--ink); color: #fff; } .s-deep { background: var(--sky-deep); color: #fff; } .s-paper { background: #fff; }
.chart-card { padding: 16px 24px; outline: 2px solid var(--ink); outline-offset: -2px; box-shadow: 10px 10px 0 var(--sky); background: color-mix(in srgb, var(--paper) 70%, #fff); }
.chart-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; min-height: 64px; align-items: center; }
.legend { display: flex; gap: 20px; list-style: none; padding: 0; margin: 0; font-size: 15px; font-weight: 700; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 14px; border-radius: 3px; border: 2px solid; display: inline-block; }
.sw-up { background: var(--mint); border-color: var(--mint-ink); } .sw-flat { background: var(--yellow); border-color: var(--yellow-ink); } .sw-down { background: var(--red); border-color: var(--red-ink); }
.chart { height: 320px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; align-items: end; padding: 32px 0 0 36px; position: relative; }
.chart .grid { position: absolute; inset: 32px 0 64px 36px; pointer-events: none; }
.chart .grid i { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--rule); }
.chart .grid i::after { content: attr(data-v); position: absolute; left: -36px; width: 28px; text-align: right; top: -12px; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.col { display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.bar { width: min(56px, 100%); border: 2px solid; border-radius: 4px 4px 0 0; transform-origin: bottom; position: relative; background-clip: padding-box; }
.bar:focus-visible { outline: 3px solid var(--sky-deep); outline-offset: 2px; }
.bar.up { background: var(--mint); border-color: var(--mint-ink); } .bar.flat { background: var(--yellow); border-color: var(--yellow-ink); } .bar.down { background: var(--red); border-color: var(--red-ink); }
.val { height: 32px; display: flex; align-items: center; gap: 4px; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.val.up { color: var(--mint-ink); } .val.flat { color: var(--yellow-ink); } .val.down { color: var(--red-ink); }
.lbl { height: 32px; font-size: 14px; color: var(--ink-3); display: flex; align-items: center; }
.bar .tip { position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 13px; line-height: 20px; padding: 4px 10px; border-radius: var(--radius); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 150ms var(--ease); }
.bar:hover .tip, .bar:focus-visible .tip { opacity: 1; }
@keyframes grow { from { transform: scaleY(0); } }
.topics { list-style: none; padding: 0; }
.topics li { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; height: 64px; }
.cta { padding: 64px 16px; background: var(--yellow); background-image: repeating-linear-gradient(to bottom, transparent 0 26px, rgba(12,24,36,0.12) 26px 28px, transparent 28px var(--line)); }
.cta .lede { color: var(--ink); }
footer { padding-block: 64px; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; font-size: 15px; color: var(--ink-3); }
footer h3 { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
footer ul { list-style: none; padding: 0; }
footer a { text-decoration: none; color: var(--ink-2); font-weight: 700; }
.nav a:not(.btn):hover, footer a:hover { color: var(--sky-deep); text-decoration: underline; text-underline-offset: 4px; }
main { display: contents; }
/* ---- dashboard ---- */
.seg { display: inline-flex; border: 2px solid var(--ink); border-radius: 999px; height: 40px; padding: 3px; gap: 2px; }
.seg button { font: inherit; font-weight: 700; font-size: 15px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.seg button:focus-visible { outline: 3px solid var(--sky-deep); outline-offset: -3px; }
.swap { transition: opacity 150ms var(--ease); }
.swap.out { opacity: 0; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 32px; }
.grid-2 { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; margin-top: 32px; }
@media (max-width: 860px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }
.stat { padding: 32px 24px 16px; outline: 2px solid var(--ink); outline-offset: -2px; min-height: 160px; position: relative; background: color-mix(in srgb, var(--paper) 60%, #fff); }
.stat .k { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; color: var(--ink-3); height: 32px; }
.stat .v { font-size: 56px; line-height: 64px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 12px; }
.stat .d { height: 32px; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.stat.up { box-shadow: 8px 8px 0 var(--mint); } .stat.flat { box-shadow: 8px 8px 0 var(--yellow); } .stat.down { box-shadow: 8px 8px 0 var(--red); }
.legend { display: flex; gap: 20px; list-style: none; padding: 0; margin: 0; font-size: 15px; font-weight: 700; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 14px; border-radius: 3px; border: 2px solid; display: inline-block; }
.sw-up { background: var(--mint); border-color: var(--mint-ink); } .sw-flat { background: var(--yellow); border-color: var(--yellow-ink); } .sw-down { background: var(--red); border-color: var(--red-ink); }
.chart { height: 320px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; align-items: end; padding: 32px 0 0 36px; position: relative; }
.chart .grid { position: absolute; inset: 32px 0 64px 36px; pointer-events: none; }
.chart .grid i { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--rule); }
.chart .grid i::after { content: attr(data-v); position: absolute; left: -36px; width: 28px; text-align: right; top: -12px; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.col { display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.bar { width: min(56px, 100%); border: 2px solid; border-radius: 4px 4px 0 0; transform-origin: bottom; position: relative; background-clip: padding-box; }
.bar:focus-visible { outline: 3px solid var(--sky-deep); outline-offset: 2px; }
.bar.up { background: var(--mint); border-color: var(--mint-ink); } .bar.flat { background: var(--yellow); border-color: var(--yellow-ink); } .bar.down { background: var(--red); border-color: var(--red-ink); }
.val { height: 32px; display: flex; align-items: center; gap: 4px; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.val.up { color: var(--mint-ink); } .val.flat { color: var(--yellow-ink); } .val.down { color: var(--red-ink); }
.lbl { height: 32px; font-size: 14px; color: var(--ink-3); display: flex; align-items: center; }
.bar .tip { position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 13px; line-height: 20px; padding: 4px 10px; border-radius: var(--radius); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 150ms var(--ease); }
.bar:hover .tip, .bar:focus-visible .tip { opacity: 1; }
.tbl { overflow-x: auto; }
.rows { list-style: none; padding: 0; }
.rows li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; height: 64px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); background: transparent; }
.dots i.f { background: var(--ink); }
.rows .sub { color: var(--ink-3); font-size: 14px; }
.log li { grid-template-columns: 72px 1fr auto; }
.log time { font-weight: 700; font-variant-numeric: tabular-nums; }
.notice { padding: 16px 24px; outline: 2px solid var(--ink); outline-offset: -2px; margin-top: 32px; display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; background: color-mix(in srgb, var(--mint) 18%, var(--paper)); }
.notice .g { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--mint-ink); font-size: 20px; }
.sw-ui { position: absolute; inset: 0; border-radius: 999px; border: 2px solid var(--ink); background: var(--paper); }
.sw-ui::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); transition: transform 150ms var(--ease); }
input:checked + .sw-ui { background: var(--mint); } input:checked + .sw-ui::after { transform: translateX(24px); }
input:focus-visible + .sw-ui { outline: 3px solid var(--sky-deep); outline-offset: 3px; }

/* ---- accessibility: skip link, hidden labels ---- */
.skip-link { position: absolute; left: 16px; top: -64px; z-index: 300; background: var(--ink); color: var(--on-ink); padding: 8px 14px; border-radius: var(--radius); font-weight: 700; text-decoration: none; }
.skip-link:focus-visible { top: 8px; outline: 3px solid var(--sky-deep); outline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.nav-item[hidden] { display: none; }

/* ---- dialogue boxes: speaker label with a small avatar, read-aloud button ---- */
.box .who { display: inline-flex; align-items: center; gap: 8px; max-width: min(360px, 60vw); white-space: nowrap; }
.box .who .who-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.box-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--sky); border: 2px solid var(--ink); display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-body); font-weight: 700; font-size: 12px; line-height: 1; color: #1b2733; flex: none; }
.box.student .box-avatar { background: var(--yellow); }
.box.system { border-style: dashed; border-color: var(--red-ink); background: color-mix(in srgb, var(--red) 8%, var(--card)); box-shadow: none; max-width: 100%; }
.box.system p { color: var(--ink-2); font-size: 15px; }
.plan-notice-action { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: calc(var(--line) * 1.5); }
.box .speak-btn { position: absolute; right: 8px; top: 8px; width: 28px; height: 28px; border: 2px solid var(--ink); border-radius: 50%; background: var(--card); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.box .speak-btn:hover { background: color-mix(in srgb, var(--sky) 35%, transparent); color: var(--ink); }
.box .speak-btn:focus-visible { outline: 3px solid var(--sky-deep); outline-offset: 2px; }
.box.tutor .bubble { padding-right: 32px; }
.context-block { margin-block: 0 8px; }
.context-block-header { height: var(--line); padding: 0; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 700; color: var(--link); cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.context-block-header:focus-visible { outline: 3px solid var(--sky-deep); outline-offset: 2px; }
.context-block-body { font-size: 15px; color: var(--ink-2); padding-left: 12px; border-left: 2px solid var(--rule); }

/* ---- the hint ladder: three rungs, three colours, decided in src/edapt/scaffold.py ---- */
.hint-badge { display: flex; width: fit-content; align-items: center; height: 24px; margin-block: 4px; padding: 0 12px; border-radius: var(--radius); border: 2px solid; font-family: var(--font-body); font-size: 12px; line-height: 1; font-weight: 700; letter-spacing: 0.02em; color: #1b2733; }
.hint-badge--green  { background: var(--mint);   border-color: var(--mint-ink); }
.hint-badge--orange { background: var(--yellow); border-color: var(--yellow-ink); }
.hint-badge--red    { background: var(--red-fill); border-color: var(--red-ink); color: #ffffff; }
.box.hint { border-color: var(--mint-ink); }
.ask-side { display: inline-flex; align-items: center; gap: 12px; }
.hint-counter { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink-2); }
.hint-counter--spent { color: var(--red-ink); }

/* The ask box flashes once when an answer lands. Durations come from
   src/edapt/scoring.py: 1000ms green for a correct answer, 500ms red when the
   third wrong answer ends the question. The green is a reward, the red a full stop. */
@keyframes edapt-flash-correct {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  25%      { box-shadow: 0 0 0 4px var(--mint); }
}
@keyframes edapt-flash-wrong {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  30%      { box-shadow: 0 0 0 4px var(--red); }
}
:root:not([data-anim="0"]) .ask.is-correct { animation: edapt-flash-correct 1000ms ease-out 1; border-radius: var(--radius); }
:root:not([data-anim="0"]) .ask.is-wrong   { animation: edapt-flash-wrong 500ms ease-out 1; border-radius: var(--radius); }
/* A flash is feedback, and a student who asked for less motion still needs it.
   The colour is held as a static ring instead of a pulse, whether the OS or
   the Animations setting asked for less. */
:root[data-anim="0"] .ask.is-correct { box-shadow: 0 0 0 4px var(--mint); border-radius: var(--radius); }
:root[data-anim="0"] .ask.is-wrong   { box-shadow: 0 0 0 4px var(--red); border-radius: var(--radius); }
@media (prefers-reduced-motion: reduce) {
  .ask.is-correct, .ask.is-wrong { animation: none; }
  .ask.is-correct { box-shadow: 0 0 0 4px var(--mint); }
  .ask.is-wrong   { box-shadow: 0 0 0 4px var(--red); }
  .box, .ring .arc, .line-chart .path, .line-chart .area, .hbars .fill, .hl { animation: none; }
}

/* ---- comboboxes: keyboard highlight and the mode descriptions ---- */
.combo li { flex-wrap: wrap; }
.combo li.kb-active { background: var(--ink); color: var(--on-ink); }
.combo li .desc { flex-basis: 100%; font-weight: 400; font-size: 13px; line-height: 20px; color: var(--ink-3); }
.combo li.kb-active .desc, .combo li:hover .desc, .combo li[aria-selected="true"] .desc { color: var(--on-ink); opacity: 0.85; }

/* ---- easy read: the same levers as data-easy, as a pressed button ---- */
html.reading-mode body { letter-spacing: 0.04em; word-spacing: 0.14em; }
.reading-mode-btn { height: 40px; padding: 0 16px; border: 2px solid var(--ink); border-radius: var(--radius); background: transparent; color: var(--ink); font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.reading-mode-btn:hover { background: color-mix(in srgb, var(--sky) 30%, transparent); }
.reading-mode-btn:focus-visible { outline: 3px solid var(--sky-deep); outline-offset: 3px; }
.reading-mode-btn[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }

/* ---- plan and billing (ADR-0013) on the rule grid ---- */
.billing-panel { max-width: 720px; display: flex; flex-direction: column; gap: var(--line); margin-top: var(--line); }
.billing-panel [hidden] { display: none !important; }
.billing-fieldset { border: 0; padding: 0; margin: 0; min-height: var(--line); }
.billing-fieldset legend { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; color: var(--ink-3); height: var(--line); padding: 0; }
.billing-choice { display: flex; align-items: center; gap: 10px; min-height: var(--line); cursor: pointer; flex-wrap: wrap; }
.billing-choice input { width: 18px; height: 18px; margin: 0; accent-color: var(--sky-deep); }
.billing-tier { min-height: calc(var(--line) * 2); align-content: center; }
.billing-tier-price { color: var(--ink-2); }
.billing-tier-promise { flex-basis: 100%; padding-left: 28px; font-size: 14px; color: var(--ink-3); line-height: 24px; }
.billing-field { min-height: calc(var(--line) * 2.5); }
.billing-field label { display: block; font-weight: 700; height: var(--line); }
.billing-field input { width: 160px; height: 40px; font: inherit; font-size: 15px; font-weight: 700; padding: 0 12px; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--field); color: var(--ink); }
.billing-field input:focus-visible { outline: 3px solid var(--sky-deep); outline-offset: 2px; }
.billing-total { min-height: var(--line); font-weight: 700; }
