:root {
  --paper: #eef1f3;
  --sheet: #ffffff;
  --ink: #1b2330;
  --ink-2: #4f5b6b;
  --line: #d5dbe1;
  --orange: #e8711c;
  --orange-ink: #b4520d;
  --l8: #6da83a; --l9: #1f8fc6; --l10: #d8323f; --l11: #f08a1c;
  --l12: #1a9e95; --l13: #8a62b5; --l14: #cc4b8f;
  --radius: 10px;
  --player-h: 0px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #151a21; --sheet: #1e252e; --ink: #e8edf2; --ink-2: #a3aebb; --line: #2f3843;
    --orange-ink: #f39a55; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #151a21; --sheet: #1e252e; --ink: #e8edf2; --ink-2: #a3aebb; --line: #2f3843;
  --orange-ink: #f39a55; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.5 "Atkinson Hyperlegible", system-ui, sans-serif;
}
h1, h2, h3 { font-family: "Bricolage Grotesque", system-ui, sans-serif; line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.top {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  border-bottom: 1px solid var(--line); background: var(--sheet); position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 8px; background: var(--orange); color: #fff;
  display: grid; place-items: center; font: 800 20px "Bricolage Grotesque", sans-serif;
}
.brand b { font: 700 17px "Bricolage Grotesque", sans-serif; display: block; }
.brand small { color: var(--ink-2); font-size: 13px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--paper); }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 999px; font-size: 14px; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--sheet); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .12); font-weight: 700; }
.icon-btn { border: 1px solid var(--line); background: var(--sheet); border-radius: 8px; padding: 6px 10px; font-size: 14px; }

main { padding: 20px 16px calc(var(--player-h) + 32px); max-width: 1400px; margin: 0 auto; }

/* ---------- home ---------- */
.home-head { display: grid; gap: 18px; grid-template-columns: 1fr; margin-bottom: 26px; }
@media (min-width: 900px) { .home-head { grid-template-columns: 1.3fr 1fr; align-items: end; } }
.home-head h1 { font-size: clamp(30px, 5vw, 52px); font-weight: 800; }
.home-head p { color: var(--ink-2); margin: 8px 0 0; max-width: 60ch; }
.resume {
  background: var(--sheet); border: 1px solid var(--line); border-left: 6px solid var(--c, var(--orange));
  border-radius: var(--radius); padding: 14px 16px; text-decoration: none; display: block;
}
.resume small { color: var(--ink-2); display: block; }
.resume strong { font: 700 20px "Bricolage Grotesque", sans-serif; }

.stats { display: flex; gap: 22px; flex-wrap: wrap; margin: 4px 0 22px; color: var(--ink-2); font-size: 15px; }
.stats b { color: var(--ink); font: 700 22px "Bricolage Grotesque", sans-serif; margin-right: 4px; }

/* the lessons as a stack of coloured page edges */
.edges { display: grid; gap: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--sheet); }
.edge {
  display: grid; grid-template-columns: 74px 1fr; text-decoration: none; min-height: 84px;
  border-top: 1px solid var(--line);
}
.edge:first-child { border-top: 0; }
.edge-num {
  background: var(--c); color: #fff; display: grid; place-items: center;
  font: 800 34px "Bricolage Grotesque", sans-serif;
}
.edge-body { padding: 12px 16px; display: grid; gap: 8px; align-content: center; }
@media (min-width: 760px) { .edge-body { grid-template-columns: 1.1fr 1fr 1fr; align-items: center; gap: 22px; } }
.edge-body h2 { font-size: 22px; font-weight: 700; }
.edge-body h2 small { display: block; font: 400 14px "Atkinson Hyperlegible", sans-serif; color: var(--ink-2); margin-top: 2px; }
.edge:hover .edge-body h2 { text-decoration: underline; text-decoration-color: var(--c); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.meter { font-size: 13px; color: var(--ink-2); }
.meter-bar { height: 8px; border-radius: 99px; background: var(--paper); overflow: hidden; margin-top: 4px; }
.meter-bar i { display: block; height: 100%; background: var(--c); border-radius: 99px; }

.more { margin-top: 30px; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.more a, .more button {
  text-align: left; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; text-decoration: none; display: block;
}
.more strong { display: block; font: 700 17px "Bricolage Grotesque", sans-serif; }
.more span { color: var(--ink-2); font-size: 14px; }

/* ---------- lesson ---------- */
.lesson-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.lesson-num {
  background: var(--c); color: #fff; width: 56px; height: 56px; border-radius: 12px;
  display: grid; place-items: center; font: 800 30px "Bricolage Grotesque", sans-serif; flex: none;
}
.lesson-head h1 { font-size: clamp(24px, 4vw, 36px); font-weight: 800; }
.lesson-head p { margin: 0; color: var(--ink-2); font-size: 14px; }
.lesson-head .seg { margin-left: auto; }
.lesson-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: thin; }
.lesson-tabs a {
  flex: none; text-decoration: none; padding: 4px 12px; border-radius: 8px; font-weight: 700;
  border: 2px solid var(--c); color: var(--ink);
}
.lesson-tabs a[aria-current="page"] { background: var(--c); color: #fff; }

.study { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 1100px) { .study { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } }

.reader { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.reader-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.reader-bar .pg { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 14px; margin-right: auto; }
.sheet-wrap { overflow: auto; background: #d9dee3; max-height: calc(100vh - 220px); min-height: 300px; }
:root[data-theme="dark"] .sheet-wrap { background: #0f1318; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sheet-wrap { background: #0f1318; } }
.spread { display: flex; justify-content: center; gap: 4px; padding: 10px; }
.spread img { display: block; width: 100%; max-width: 760px; height: auto; background: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / .2); cursor: zoom-in; }
.spread.two img { width: 50%; }
.spread.zoom { justify-content: flex-start; }
.spread.zoom img { width: 1400px; max-width: none; cursor: zoom-out; }
.strip { display: flex; gap: 6px; overflow-x: auto; padding: 8px 10px; border-top: 1px solid var(--line); }
.strip button { flex: none; border: 2px solid transparent; background: none; padding: 0; border-radius: 4px; position: relative; }
.strip button[aria-current="true"] { border-color: var(--c); }
.strip img { display: block; width: 54px; height: 75px; object-fit: cover; border-radius: 2px; }
.strip span { position: absolute; bottom: 2px; right: 3px; font-size: 11px; background: rgb(0 0 0 / .6); color: #fff; padding: 0 4px; border-radius: 3px; }

.tracks { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); }
.tracks h2 { font-size: 18px; padding: 12px 14px 4px; }
.tracks .note { margin: 0 14px 8px; font-size: 13px; color: var(--ink-2); }
.tgroup { padding: 4px 0 8px; border-top: 1px solid var(--line); }
.tgroup h3 { font: 700 14px "Atkinson Hyperlegible", sans-serif; color: var(--ink-2); padding: 8px 14px 2px; display: flex; justify-content: space-between; }
.tgroup h3 a { font-weight: 400; font-size: 13px; }
.track {
  width: 100%; display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: center;
  border: 0; background: none; text-align: left; padding: 7px 14px; font-size: 15px;
}
.track:hover { background: var(--paper); }
.track .dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 11px; }
.track.done .dot { background: var(--c); border-color: var(--c); color: #fff; }
.track.playing { background: color-mix(in srgb, var(--c) 14%, transparent); }
.track.playing .dot { border-color: var(--c); }
.track small { color: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; }

/* ---------- list pages (A2.1 audio, plans) ---------- */
.plain { max-width: 900px; }
.plain h1 { font-size: 32px; margin-bottom: 6px; }
.plain > p { color: var(--ink-2); margin-top: 0; }
.plain .tracks { margin-top: 16px; }
.plan-list { display: grid; gap: 8px; margin-top: 16px; }
.plan-list a { background: var(--sheet); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; text-decoration: none; font-weight: 700; }

/* ---------- player: small floating card, draggable by its handle ---------- */
.player {
  position: fixed; z-index: 30; right: 16px; bottom: 16px; width: min(380px, calc(100vw - 24px));
  background: var(--sheet); border: 1px solid var(--line); border-top: 4px solid var(--c, var(--orange));
  border-radius: 14px; padding: 6px 10px 8px; box-shadow: 0 10px 34px rgb(15 25 40 / .28);
  touch-action: manipulation;
}
.player.dragging { box-shadow: 0 16px 44px rgb(15 25 40 / .38); opacity: .96; user-select: none; }
.p-top { display: flex; align-items: center; gap: 6px; }
.p-grip {
  flex: none; width: 26px; height: 32px; border: 0; background: none; padding: 0; color: var(--ink-2);
  display: grid; place-items: center; cursor: grab; touch-action: none; border-radius: 6px;
}
.player.dragging .p-grip { cursor: grabbing; }
.p-grip svg { width: 18px; height: 18px; fill: currentColor; }
.player .meta { flex: 1; min-width: 0; cursor: grab; touch-action: none; }
.player .meta b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; line-height: 1.25; }
.player .meta small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); font-size: 11.5px; }
.p-opt {
  flex: none; border: 1px solid var(--line); background: var(--paper); border-radius: 7px;
  height: 28px; min-width: 30px; padding: 0 6px; font-size: 12.5px; font-variant-numeric: tabular-nums;
}
.p-opt[aria-pressed="true"] { background: var(--c, var(--orange)); color: #fff; border-color: transparent; }
.p-bottom { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.player .ctrl { display: flex; gap: 3px; align-items: center; flex: none; }
.player .ctrl button { border: 0; background: none; border-radius: 50%; width: 30px; height: 30px; display: grid; place-items: center; padding: 0; color: var(--ink); }
.player .ctrl button:hover { background: var(--paper); }
.player .ctrl .play { width: 38px; height: 38px; background: var(--c, var(--orange)); color: #fff; }
.player .ctrl .play:hover { background: var(--c, var(--orange)); filter: brightness(1.08); }
.player svg { width: 18px; height: 18px; fill: currentColor; }
.p-seek { flex: 1; min-width: 0; }
.player input[type="range"] { width: 100%; height: 18px; accent-color: var(--c, var(--orange)); margin: 0; display: block; }
.player .times { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; margin-top: -2px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login form { background: var(--sheet); border: 1px solid var(--line); border-top: 8px solid var(--orange); border-radius: var(--radius); padding: 28px 24px; width: min(400px, 100%); }
.login h1 { font-size: 30px; font-weight: 800; }
.login p { color: var(--ink-2); margin: 6px 0 18px; }
.login input { width: 100%; font: inherit; font-size: 18px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); }
.login button { margin-top: 12px; width: 100%; padding: 11px; border: 0; border-radius: 8px; background: var(--orange); color: #fff; font-weight: 700; font-size: 17px; }
.login .err { color: #c62828; font-weight: 700; }

@media (prefers-reduced-motion: no-preference) {
  .meter-bar i { transition: width .4s ease; }
}

/* ---------- refinements after the first device pass ---------- */
@media (min-width: 1100px) {
  .tracks { position: sticky; top: 74px; max-height: calc(100vh - 74px - var(--player-h) - 24px); overflow: auto; }
}
@media (max-width: 640px) {
  .top { gap: 8px; padding: 8px 12px; }
  .brand small { display: none; }
  .seg button { padding: 5px 9px; }
  .reader-bar { flex-wrap: nowrap; gap: 6px; }
  .reader-bar .icon-btn { padding: 6px 8px; }
  .reader-bar .pg { font-size: 13px; }
  .spread { padding: 6px; }
  .sheet-wrap { max-height: none; }
  .lesson-head .seg { margin-left: 0; }
}

/* ---------- install pop-up ---------- */
.install {
  position: fixed; z-index: 40; right: 16px; left: 16px; bottom: 16px;
  margin: 0 auto; max-width: 440px;
  display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: start;
  background: var(--sheet); border: 1px solid var(--line); border-top: 6px solid var(--orange);
  border-radius: 14px; padding: 16px; box-shadow: 0 12px 40px rgb(15 25 40 / .28);
}
body:has(.player:not([hidden])) .install { bottom: 130px; }
@media (min-width: 900px) { .install { left: auto; right: 24px; } }
.install img { border-radius: 12px; }
.install h2 { font-size: 19px; font-weight: 800; }
.install p { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; }
.install ol { margin: 8px 0 0; padding-left: 20px; font-size: 15px; display: grid; gap: 4px; }
.install-actions { display: flex; gap: 8px; margin-top: 12px; }
.install-yes { border: 0; background: var(--orange); color: #fff; font-weight: 700; padding: 9px 18px; border-radius: 8px; }
.install-no { border: 1px solid var(--line); background: none; padding: 9px 14px; border-radius: 8px; color: var(--ink-2); }
.install-btn { background: var(--orange); color: #fff; border-color: transparent; font-weight: 700; }
@media (max-width: 640px) { .install-btn { font-size: 13px; padding: 6px 8px; } }
@media (prefers-reduced-motion: no-preference) {
  .install:not([hidden]) { animation: rise .35s ease-out; }
  @keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
}
/* inside the installed app: respect the notch */
.is-app .top { padding-top: max(10px, env(safe-area-inset-top)); }
@media (max-width: 640px) { .wide-only { display: none; } }

/* ---------- audio hotspots on the book page ---------- */
.pg-img { position: relative; flex: 1 1 0; max-width: 760px; }
.spread.two .pg-img { width: 50%; }
.spread .pg-img img, .spread.two .pg-img img { width: 100%; max-width: none; }
.spread.zoom .pg-img { flex: none; max-width: none; width: 1400px; }
.spread.zoom .pg-img img { width: 1400px; }
.spot {
  position: absolute; transform: translate(-50%, -50%);
  width: clamp(32px, 4.2%, 44px); aspect-ratio: 1; border-radius: 50%; padding: 0;
  display: grid; place-items: center;
  background: #fff; color: var(--c); border: 2.5px solid var(--c);
  box-shadow: 0 2px 8px rgb(0 0 0 / .28); cursor: pointer;
}
.spot svg { width: 60%; height: 60%; fill: currentColor; }
.spot:hover { background: var(--c); color: #fff; }
.spot.heard { border-style: dashed; }
.spot.on { background: var(--c); color: #fff; }
.spread.zoom .spot { width: 52px; }
@media (prefers-reduced-motion: no-preference) {
  .spot.on::after {
    content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 3px solid var(--c);
    animation: ping 1.4s ease-out infinite;
  }
  @keyframes ping { from { transform: scale(.85); opacity: .9; } to { transform: scale(1.5); opacity: 0; } }
}
.strip .has-audio { position: absolute; top: 3px; left: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--c); border: 2px solid #fff; }

/* ---------- audio panel: rows per printed marker ---------- */
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px 4px; }
.panel-head h2 { padding: 0; }
.spot-row { padding: 2px 8px 4px; }
.spot-row.on { background: color-mix(in srgb, var(--c) 12%, transparent); }
.sp-main {
  width: 100%; display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center;
  border: 0; background: none; text-align: left; padding: 7px 6px; border-radius: 8px;
}
.sp-main:hover { background: var(--paper); }
.sp-icon { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--c); color: var(--c); display: grid; place-items: center; }
.sp-icon svg { width: 18px; height: 18px; fill: currentColor; }
.spot-row.on .sp-icon { background: var(--c); color: #fff; }
.sp-text b { display: block; font-size: 15px; }
.sp-text small { color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.sp-done { visibility: hidden; color: var(--c); font-weight: 700; }
.spot-row.heard .sp-done { visibility: visible; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 6px 6px 50px; }
.chip { min-width: 32px; height: 28px; border-radius: 7px; border: 1px solid var(--line); background: var(--sheet); font-size: 13px; font-variant-numeric: tabular-nums; }
.chip.heard { border-color: var(--c); }
.chip.on { background: var(--c); color: #fff; border-color: transparent; }
.panel-btn[aria-expanded="true"] { background: var(--c); color: #fff; border-color: transparent; }

/* wide screens: the panel collapses and the book takes the full width */
@media (min-width: 1100px) {
  .study.closed { grid-template-columns: minmax(0, 1fr); }
  .study.closed .tracks { display: none; }
  .panel-head [data-panel] { display: none; }
}
/* narrow screens: the panel is a drawer from the right */
@media (max-width: 1099px) {
  .tracks {
    position: fixed; z-index: 36; top: 0; right: 0; bottom: 0; width: min(400px, 90vw);
    border-radius: 0; border-width: 0 0 0 1px; overflow: auto; overscroll-behavior: contain;
    padding-bottom: calc(var(--player-h) + 16px); box-shadow: -10px 0 30px rgb(0 0 0 / .2);
  }
  .study.closed .tracks { visibility: hidden; transform: translateX(105%); }
  .scrim { position: fixed; inset: 0; z-index: 35; background: rgb(10 15 25 / .4); }
  @media (prefers-reduced-motion: no-preference) {
    .tracks { transition: transform .25s ease, visibility 0s linear 0s; }
    .study.closed .tracks { transition: transform .25s ease, visibility 0s linear .25s; }
  }
  .reader-bar .panel-btn { margin-left: auto; }
}
@media (max-width: 640px) {
  .reader-bar { flex-wrap: wrap; }
  .reader-bar .pg { flex: 1 0 auto; }
}

/* ---------- transcript (CC) with karaoke highlight ---------- */
.player.cc { width: min(560px, calc(100vw - 24px)); }
.p-cc { font-weight: 800; letter-spacing: .02em; }
.p-text {
  margin: 6px -4px 2px; padding: 8px 10px; max-height: min(36vh, 280px); overflow: auto; overscroll-behavior: contain;
  background: var(--paper); border-radius: 10px; font-size: 17px; line-height: 1.75; scroll-behavior: smooth;
}
.p-text p { margin: 0 0 6px; color: var(--ink-2); }
.p-text p.cur { color: var(--ink); }
.p-text .w { cursor: pointer; border-radius: 4px; padding: 1px 1px; }
.p-text .w:hover { text-decoration: underline; text-decoration-color: var(--c, var(--orange)); }
.p-text .w.past { color: var(--ink); }
.p-text p:not(.cur) .w.past { color: color-mix(in srgb, var(--ink) 75%, var(--c, var(--orange))); }
.p-text .w.now {
  color: var(--ink);
  background: linear-gradient(90deg, color-mix(in srgb, var(--c, var(--orange)) 42%, transparent) var(--p, 0%), transparent var(--p, 0%));
  box-shadow: inset 0 -2px 0 var(--c, var(--orange));
}
.p-text .empty { color: var(--ink-2); font-size: 14px; margin: 0; }

/* ---------- full-screen book: only the pages and the player ---------- */
.reader .full-x, .reader .full-nav { display: none; }
html.focus { overflow: hidden; }
html.focus .reader {
  position: fixed; inset: 0; z-index: 25; border: 0; border-radius: 0; background: #20252c;
}
html.focus .reader-bar, html.focus .reader .strip { display: none; }
html.focus .sheet-wrap { max-height: none; height: calc(100dvh - var(--dock-h)); background: #20252c; }
html.focus .spread { padding: 8px; gap: 4px; align-items: flex-start; }
/* fit the spread to the window: the image keeps its own proportions under both limits */
html.focus .spread:not(.zoom) { justify-content: center; }
html.focus .spread:not(.zoom) .pg-img { flex: none; max-width: none; width: auto; }
html.focus .spread:not(.zoom) .pg-img img {
  width: auto; height: auto; max-width: calc(100vw - var(--dock-w) - 16px); max-height: calc(100dvh - var(--dock-h) - 16px);
}
html.focus .spread.two:not(.zoom) .pg-img img { max-width: calc((100vw - var(--dock-w) - 20px) / 2); }
html.focus .reader .full-x, html.focus .reader .full-nav {
  display: grid; place-items: center; position: fixed; z-index: 26; border: 0; color: #fff;
  background: rgb(20 25 32 / .55); backdrop-filter: blur(4px);
}
html.focus .reader .full-x { top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; font-size: 18px; }
html.focus .reader .full-nav { top: 50%; transform: translateY(-50%); width: 44px; height: 72px; border-radius: 10px; font-size: 30px; }
html.focus .reader .full-nav.prev { left: 8px; } html.focus .reader .full-nav.next { right: 8px; }
html.focus .reader .full-x:hover, html.focus .reader .full-nav:hover { background: rgb(20 25 32 / .85); }
@media (hover: none) { html.focus .reader .full-nav { opacity: .55; } }
html.focus .install { display: none; }

/* ---------- docked side: CC transcript and/or answer next to the book (wide) or under it (narrow) ----------
   html.dock    = the side region is open (CC on, or an answer open)
   html.p-dock  = the player sits in that region (it floats otherwise)
   html.ans-dock = an answer is open; it takes the top of the region, the player sits under it */
:root { --dock-w: 0px; --dock-h: 0px; }
@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  html.dock { --dock-w: clamp(320px, 30vw, 460px); }
}
@media (max-width: 899px), (max-aspect-ratio: 999/1000) {
  html.dock { --dock-h: max(260px, 42dvh); }
  html.ans-dock.cc-dock { --dock-h: max(340px, 56dvh); }
}
html.dock body { padding-right: var(--dock-w); padding-bottom: var(--dock-h); }
html.p-dock .player {
  left: auto !important; top: auto !important; right: 0 !important; bottom: 0 !important;
  display: flex; flex-direction: column; border-radius: 0; box-shadow: 0 0 24px rgb(15 25 40 / .18);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
}
html.p-dock .p-grip { display: none; }
html.p-dock .player .meta { cursor: default; }
html.cc-dock .p-text { flex: 1; max-height: none; min-height: 0; margin: 8px 0 6px; }
@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  html.p-dock .player { width: var(--dock-w); height: 100dvh; border-top: 0; border-left: 4px solid var(--c, var(--orange)); }
  html.ans-dock.p-dock .player { height: auto; border-top: 1px solid var(--line); }
  html.ans-dock.cc-dock .player { height: 55dvh; }
  html.cc-dock .p-text { font-size: 18px; }
}
@media (max-width: 899px), (max-aspect-ratio: 999/1000) {
  html.p-dock .player { width: 100%; height: var(--dock-h); border-top: 4px solid var(--c, var(--orange)); border-left: 0; border-right: 0; border-bottom: 0; }
  html.ans-dock.p-dock .player { height: auto; border-top: 1px solid var(--line); }
  html.ans-dock.cc-dock .player { height: calc(var(--dock-h) * .5); }
}
html.dock .install { display: none; }
/* full screen leaves room for the docked side */
html.focus.dock .reader { right: var(--dock-w); bottom: var(--dock-h); }
html.focus.dock .reader .full-x { right: calc(var(--dock-w) + 12px); }
html.focus.dock .reader .full-nav.next { right: calc(var(--dock-w) + 8px); }
html.focus.dock .reader .full-nav { top: calc((100dvh - var(--dock-h)) / 2); }
/* the narrow audio drawer stops above the docked side */
@media (max-width: 1099px) { html.dock .tracks, html.dock .scrim { bottom: var(--dock-h); right: var(--dock-w); } }

/* ---------- parts of a multi-track exercise, inside the player ---------- */
.p-parts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 6px; }
.p-parts small { color: var(--ink-2); font-size: 12px; margin-right: 2px; }
.p-parts .chip { min-width: 30px; height: 28px; font-size: 13px; }
html.cc-dock .p-parts { flex: none; }
html.focus .spread:not(.zoom) { min-height: 100%; align-items: center; }

/* ---------- answer keys: square key button next to each exercise, card with the official answer ---------- */
.key {
  position: absolute; transform: translate(-50%, -50%);
  width: clamp(30px, 3.8%, 40px); aspect-ratio: 1; border-radius: 9px; padding: 0;
  display: grid; place-items: center; cursor: pointer;
  background: #fff; color: var(--c); border: 2px solid var(--c);
  box-shadow: 0 2px 6px rgb(0 0 0 / .22);
}
.key svg { width: 62%; height: 62%; fill: currentColor; transform: rotate(-45deg); }
.key:hover { background: var(--c); color: #fff; }
/* opened before: quieter, so the ones still to check stand out */
.key.seen { background: color-mix(in srgb, var(--c) 16%, #fff); border-style: dashed; box-shadow: none; }
.spread.zoom .key { width: 48px; }
.spot-row { display: grid; grid-template-columns: 1fr auto; align-items: center; }
.spot-row .chips { grid-column: 1 / -1; }
.sp-key {
  width: 34px; height: 34px; border-radius: 9px; border: 1.5px solid var(--line); background: var(--sheet);
  color: var(--c); display: grid; place-items: center; padding: 0; margin-right: 4px;
}
.sp-key svg { width: 18px; height: 18px; fill: currentColor; transform: rotate(-45deg); }
.sp-key:hover { border-color: var(--c); }
.p-key svg { width: 15px; height: 15px; fill: currentColor; transform: rotate(-45deg); display: block; margin: auto; }
.p-key { color: var(--c, var(--orange)); }

.ans {
  position: fixed; inset: auto 0 auto auto; top: 0; margin: 0; z-index: 30; padding: 0;
  width: var(--dock-w); height: calc(100dvh - var(--ph, 0px)); max-width: none; max-height: none;
  border: 0; border-left: 4px solid var(--c, var(--orange)); border-radius: 0;
  background: var(--sheet); color: var(--ink); box-shadow: 0 0 24px rgb(15 25 40 / .18);
  display: none; flex-direction: column; overflow: hidden;
}
.ans[open] { display: flex; }
@media (max-width: 899px), (max-aspect-ratio: 999/1000) {
  .ans { top: auto; left: 0; right: 0; bottom: var(--ph, 0px); width: 100%; height: calc(var(--dock-h) - var(--ph, 0px));
         border-left: 0; border-top: 4px solid var(--c, var(--orange)); }
  html:not(.p-dock) .ans { padding-bottom: env(safe-area-inset-bottom); }
}
.ans-head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 14px 14px 10px 16px; border-bottom: 1px solid var(--line); }
.ans-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--c, var(--orange)); color: #fff; display: grid; place-items: center; }
.ans-icon svg { width: 22px; height: 22px; fill: currentColor; transform: rotate(-45deg); }
.ans-head h2 { margin: 0; font: 800 19px/1.2 "Bricolage Grotesque", sans-serif; }
.ans-head small { color: var(--ink-2); font-size: 13px; }
.ans-x { border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 8px; width: 34px; height: 34px; font-size: 15px; }
.ans-body { flex: 1; min-height: 0; overflow: auto; padding: 6px 18px 12px; font-size: 16.5px; line-height: 1.6; overscroll-behavior: contain; }
.ans-part { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.ans-part:last-child { border-bottom: 0; }
.ans-part:not(:has(.ans-letter)) { grid-template-columns: 1fr; }
.ans-letter {
  width: 26px; height: 26px; border-radius: 50%; background: color-mix(in srgb, var(--c, var(--orange)) 16%, transparent);
  color: var(--c, var(--orange)); font-weight: 700; display: grid; place-items: center; margin-top: 2px;
}
.ans-part p { margin: 0 0 6px; overflow-wrap: anywhere; }
.ans-part p:last-child { margin-bottom: 0; }
.ans-sample { display: inline-block; font-style: normal; font-size: 12.5px; font-weight: 700; color: var(--ink-2); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; margin-right: 6px; vertical-align: 1px; }
.ans-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px 12px; border-top: 1px solid var(--line); background: var(--paper); }
.ans-foot small { color: var(--ink-2); font-size: 12.5px; }
.ans-play { flex: none; border: 0; border-radius: 8px; padding: 8px 14px; background: var(--c, var(--orange)); color: #fff; font-weight: 700; }
@media (prefers-reduced-motion: no-preference) {
  .ans[open] { animation: ans-in .16s ease-out; }
  @keyframes ans-in { from { opacity: 0; } }
}
.key.open { background: var(--c); color: #fff; border-style: solid; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 30%, transparent); }

/* ---------- answer explanation behind "Warum?" ---------- */
.why {
  margin-top: 6px; border: 1px solid var(--line); background: var(--paper); color: var(--ink-2);
  border-radius: 7px; padding: 3px 10px; font-size: 13.5px; font-weight: 700;
}
.why[aria-expanded="true"] { color: var(--c, var(--orange)); border-color: var(--c, var(--orange)); }
.why + .expl + p { margin-top: 12px; }
.expl p { margin: 0 0 6px !important; }
.expl p:last-child { margin-bottom: 0 !important; }
.expl {
  margin: 8px 0 0 !important; padding: 8px 12px; border-left: 3px solid var(--c, var(--orange));
  background: color-mix(in srgb, var(--c, var(--orange)) 8%, transparent); border-radius: 0 8px 8px 0;
  font-size: 15px; line-height: 1.55;
}

/* ---------- word list pane (shares the docked side with the answer) ---------- */
.voc-icon { font: 800 15px "Bricolage Grotesque", sans-serif; letter-spacing: -.02em; }
.voc-tools { display: flex; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.voc-tools input {
  flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 15px;
}
.voc-hide { flex: none; border: 1px solid var(--line); background: var(--sheet); color: var(--ink); border-radius: 8px; padding: 0 10px; font-size: 13px; font-weight: 700; }
.voc-hide[aria-pressed="true"] { background: var(--c, var(--orange)); color: #fff; border-color: transparent; }
.voc-body { padding: 0 14px 12px; }
.vsec h3 {
  position: sticky; top: 0; z-index: 1; background: var(--sheet); margin: 0;
  padding: 12px 0 6px; font: 800 15px "Bricolage Grotesque", sans-serif; color: var(--c, var(--orange));
  border-bottom: 2px solid color-mix(in srgb, var(--c, var(--orange)) 35%, transparent);
}
.vrow { display: grid; grid-template-columns: 1fr minmax(0, .8fr); gap: 2px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.v-de { font-weight: 700; }
.v-ref { margin-left: 6px; font-size: 11.5px; font-weight: 700; color: var(--ink-2); border: 1px solid var(--line); border-radius: 5px; padding: 0 4px; vertical-align: 1px; }
.v-en { color: var(--ink); }
.v-ex { grid-column: 1 / -1; font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.v-exen { display: block; font-style: italic; }
/* self-test mode: English is covered until the row is tapped */
.voc.quiz .vrow { cursor: pointer; }
.voc.quiz .vrow:not(.show) .v-en, .voc.quiz .vrow:not(.show) .v-exen {
  color: transparent; background: color-mix(in srgb, var(--ink-2) 18%, transparent); border-radius: 5px; user-select: none;
}
@media (max-width: 420px) { .vrow { grid-template-columns: 1fr; } }
.empty { color: var(--ink-2); padding: 14px 0; }
/* full screen: word list button under the ✕ */
.reader .full-voc { display: none; }
html.focus .reader .full-voc {
  display: block; position: fixed; z-index: 6; top: 64px; right: calc(var(--dock-w) + 12px);
  border: 0; border-radius: 10px; padding: 8px 12px; background: rgb(20 25 32 / .6); color: #fff; font-weight: 700; font-size: 14px;
}

/* ---------- pronunciation buttons in the word list ---------- */
.v-de { display: flex; align-items: flex-start; gap: 8px; }
.v-say {
  flex: none; width: 30px; height: 30px; border-radius: 50%; padding: 0; margin-top: -3px;
  border: 1.5px solid var(--c, var(--orange)); background: var(--sheet); color: var(--c, var(--orange));
  display: grid; place-items: center;
}
.v-say svg { width: 16px; height: 16px; fill: currentColor; }
.v-say:hover, .v-say.speaking { background: var(--c, var(--orange)); color: #fff; }
.v-say.small { width: 24px; height: 24px; margin-top: -1px; border-width: 1px; }
.v-say.small svg { width: 13px; height: 13px; }
.v-ex { display: flex; gap: 8px; align-items: flex-start; }
.v-uz { display: block; color: var(--ink-2); font-size: 14px; margin-top: 1px; }
.voc.quiz .vrow:not(.show) .v-uz { color: transparent; background: color-mix(in srgb, var(--ink-2) 18%, transparent); border-radius: 5px; }
.v-cards { padding: 18px 0 8px; }
.c-open {
  width: 100%; border: 0; border-radius: 12px; padding: 14px 16px; text-align: left;
  background: var(--c, var(--orange)); color: #fff; font: 800 18px "Bricolage Grotesque", sans-serif;
}
.c-open small { display: block; font: 400 13.5px "Atkinson Hyperlegible", sans-serif; opacity: .9; margin-top: 2px; }

/* ---------- flashcards ---------- */
.cards {
  width: min(620px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0;
  border-top: 5px solid var(--c, var(--orange)); border-radius: 16px; background: var(--paper); color: var(--ink);
  box-shadow: 0 20px 60px rgb(10 20 35 / .4); overflow: hidden;
}
.cards[open] { display: flex; flex-direction: column; }
.cards::backdrop { background: rgb(12 18 28 / .55); }
.cards-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 8px; background: var(--sheet); }
.cards-head h2 { font: 800 19px "Bricolage Grotesque", sans-serif; }
.cards-head small { color: var(--ink-2); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.cards-bar { height: 5px; background: var(--line); }
.cards-bar i { display: block; height: 100%; width: 0; background: var(--c, var(--orange)); transition: width .25s; }
.cards-opts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--sheet); border-bottom: 1px solid var(--line); }
.cards-opts .voc-hide { height: 32px; }
.cards-stage { position: relative; padding: 18px 16px 8px; perspective: 1200px; flex: 1; min-height: 0; }
.card {
  position: relative; height: min(340px, 48dvh); cursor: pointer; transform-style: preserve-3d;
  transition: transform .45s cubic-bezier(.3, .7, .3, 1); outline-offset: 4px;
}
.card.flipped { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
  padding: 20px 22px; border-radius: 16px; background: var(--sheet); border: 1px solid var(--line);
  box-shadow: 0 6px 22px rgb(15 25 40 / .12);
}
.face.back { transform: rotateY(180deg); border-top: 5px solid var(--c, var(--orange)); }
.c-hint { position: absolute; top: 12px; left: 16px; font-size: 12.5px; color: var(--ink-2); }
.c-de { font: 800 clamp(26px, 6vw, 40px)/1.15 "Bricolage Grotesque", sans-serif; overflow-wrap: anywhere; }
.c-de .g-m { color: #2563c9; } .c-de .g-f { color: #d13b4f; } .c-de .g-n { color: #2f9a4a; }
.c-note { color: var(--ink-2); font-size: 15px; }
.c-tap { position: absolute; bottom: 12px; font-size: 12.5px; color: var(--ink-2); }
.c-uz { font: 800 clamp(22px, 5vw, 32px)/1.2 "Bricolage Grotesque", sans-serif; }
.c-en { font-size: 18px; color: var(--ink-2); }
.c-ex { font-size: 14.5px; color: var(--ink-2); line-height: 1.45; max-width: 46ch; }
.c-ex i { display: block; }
.c-say {
  position: absolute; top: 28px; right: 28px; z-index: 2; width: 46px; height: 46px; border-radius: 50%;
  border: 2px solid var(--c, var(--orange)); background: var(--sheet); color: var(--c, var(--orange)); display: grid; place-items: center; padding: 0;
}
.c-say svg { width: 22px; height: 22px; fill: currentColor; }
.c-say.speaking, .c-say:hover { background: var(--c, var(--orange)); color: #fff; }
.cards-actions { display: flex; gap: 10px; padding: 10px 16px calc(16px + env(safe-area-inset-bottom)); }
.cards-actions button, .cards-done-actions button { flex: 1; height: 50px; border-radius: 12px; font-weight: 800; font-size: 16px; }
.c-flip { border: 0; background: var(--ink); color: var(--sheet); }
.c-again { border: 2px solid var(--line); background: var(--sheet); color: var(--ink); }
.c-know { border: 0; background: var(--c, var(--orange)); color: #fff; }
.cards-actions kbd { font: inherit; font-size: 12px; opacity: .7; margin-left: 4px; }
@media (hover: none) { .cards-actions kbd { display: none; } }
.cards-done { padding: 34px 20px 24px; text-align: center; }
.cards-done h3 { font: 800 28px "Bricolage Grotesque", sans-serif; color: var(--c, var(--orange)); margin-bottom: 8px; }
.cards-done p { color: var(--ink-2); margin: 0 0 18px; }
.cards-done-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 600px) {
  .cards { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .card { height: auto; flex: 1; min-height: 300px; }
  .cards-stage { display: flex; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { .card { transition: none; } }

/* ---------- English under the German transcript, with its own runner ---------- */
.p-tr { font-weight: 800; letter-spacing: .02em; }
.p-text.with-tr p.de { margin-bottom: 1px; }
.p-text p.tr { margin: 0 0 12px; font-size: .86em; font-style: italic; color: color-mix(in srgb, var(--ink-2) 80%, transparent); }
.p-text p.tr.cur { color: var(--ink-2); }
.p-text p.tr .w.now { font-style: italic; }

/* ---------- the task in English, collapsed at the top of the answer ---------- */
.ans-task { margin: 10px 0 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.ans-task summary { cursor: pointer; padding: 8px 12px; font-weight: 700; font-size: 14.5px; color: var(--ink-2); list-style-position: inside; }
.ans-task[open] summary { color: var(--c, var(--orange)); border-bottom: 1px solid var(--line); }
.ans-task p { margin: 0; padding: 10px 12px 12px; font-size: 15px; line-height: 1.55; }

/* ---------- text size (A− / A+): answer, word list, transcript ---------- */
.ans-head { grid-template-columns: auto 1fr auto auto; }
.fs { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--paper); }
.fs button { border: 0; background: none; color: var(--ink); height: 32px; min-width: 36px; padding: 0 6px; font-weight: 800; font-size: 14px; }
.fs button + button { border-left: 1px solid var(--line); font-size: 17px; }
.fs button:disabled { opacity: .35; }
.fs button:not(:disabled):hover { color: var(--c, var(--orange)); }
.ans-body { font-size: calc(16.5px * var(--fs, 1)); }
.ans-sample { font-size: calc(12.5px * var(--fs, 1)); }
.why { font-size: calc(14px * var(--fs, 1)); }
.expl { font-size: calc(16px * var(--fs, 1)); }
.ans-task summary { font-size: calc(15.5px * var(--fs, 1)); }
.ans-task p { font-size: calc(16.5px * var(--fs, 1)); }
.vrow { font-size: calc(15px * var(--fs, 1)); }
.v-uz { font-size: calc(14px * var(--fs, 1)); }
.v-ex { font-size: calc(14px * var(--fs, 1)); }
.p-text { font-size: calc(17px * var(--fs, 1)); }
.p-text p.tr { font-size: .94em; }
@media (min-width: 900px) and (min-aspect-ratio: 1/1) { html.cc-dock .p-text { font-size: calc(18px * var(--fs, 1)); } }

/* ---------- draggable split lines (narrow screens) ---------- */
.grip { display: none; }
@media (max-width: 899px), (max-aspect-ratio: 999/1000) {
  html.dock { --dock-h: var(--dock-hu, max(260px, 42dvh)); }
  html.ans-dock.cc-dock { --dock-h: var(--dock-hu, max(360px, 66dvh)); }
  html.ans-dock.cc-dock .player { height: calc(var(--dock-h) * var(--pl-f, .5)); }
  .grip {
    position: fixed; left: 50%; width: 140px; transform: translateX(-50%); z-index: 34; height: 24px; margin: 0; padding: 0;
    touch-action: none; cursor: row-resize; background: transparent; -webkit-tap-highlight-color: transparent;
  }
  .grip::before {
    content: ""; position: absolute; left: 50%; top: 50%; width: 52px; height: 6px; transform: translate(-50%, -50%);
    border-radius: 3px; background: var(--c, var(--orange)); box-shadow: 0 0 0 3px var(--sheet), 0 1px 4px rgb(0 0 0 / .25);
  }
  .grip.drag::before, .grip:focus-visible::before { width: 72px; }
  .grip:focus-visible { outline: none; }
  html.dock .grip-dock { display: block; bottom: calc(var(--dock-h) - 14px); }
  html.ans-dock.cc-dock .grip-pl { display: block; bottom: calc(var(--ph, 0px) - 14px); }
  html.dragging, html.dragging * { user-select: none; -webkit-user-select: none; cursor: row-resize; }
  html.dragging .player, html.dragging .ans, html.dragging body { transition: none !important; }
}
/* wide screens: a vertical line between the book and the region beside it (drag sideways),
   and, with answer and transcript open together, a line between them (drag up and down) */
@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  html.dock { --dock-w: var(--dock-wu, clamp(320px, 30vw, 460px)); }
  html.ans-dock.cc-dock .player { height: calc(100dvh * var(--pl-w, .55)); }
  .grip { position: fixed; z-index: 34; margin: 0; padding: 0; background: transparent; touch-action: none; }
  .grip::before {
    content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    border-radius: 3px; background: var(--c, var(--orange)); box-shadow: 0 0 0 3px var(--sheet), 0 1px 4px rgb(0 0 0 / .25);
    opacity: .55; transition: opacity .15s;
  }
  .grip:hover::before, .grip.drag::before, .grip:focus-visible::before { opacity: 1; }
  .grip:focus-visible { outline: none; }
  html.dock .grip-dock { display: block; top: 0; bottom: 0; right: calc(var(--dock-w) - 6px); width: 14px; cursor: col-resize; }
  .grip-dock::before { width: 6px; height: 64px; }
  html.ans-dock.cc-dock .grip-pl { display: block; right: 0; width: var(--dock-w); height: 14px; bottom: calc(var(--ph, 0px) - 7px); cursor: row-resize; }
  .grip-pl::before { width: 64px; height: 6px; }
  html.dragging, html.dragging * { user-select: none; -webkit-user-select: none; }
  html.dragging:has(.grip-dock.drag), html.dragging:has(.grip-dock.drag) * { cursor: col-resize; }
  html.dragging:has(.grip-pl.drag), html.dragging:has(.grip-pl.drag) * { cursor: row-resize; }
  html.dragging .player, html.dragging .ans, html.dragging body { transition: none !important; }
  /* the reader's page images must not swallow the pointer while the line is dragged */
  html.dragging iframe, html.dragging img { pointer-events: none; }
}
@media (min-width: 900px) and (min-aspect-ratio: 1/1) and (hover: none) {
  .grip::before { opacity: .8; }
}

/* ---------- answer switches: task in English, explanations, transcript ---------- */
.ans-tg { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--paper); }
.tg { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; color: var(--ink); padding: 4px 0; font-weight: 700; font-size: 14px; }

.tg i { position: relative; flex: none; width: 34px; height: 20px; border-radius: 10px; background: color-mix(in srgb, var(--ink-2) 35%, transparent); transition: background .15s; }
.tg i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .3); transition: transform .15s; }
.tg[aria-checked="true"] i { background: var(--c, var(--orange)); }
.tg[aria-checked="true"] i::after { transform: translateX(14px); }
.tg:focus-visible { outline: 2px solid var(--c, var(--orange)); outline-offset: 2px; border-radius: 4px; }
.ans:not(.show-task) .ans-task { display: none; }
.ans-task b { display: block; padding: 8px 12px 0; font-size: calc(13px * var(--fs, 1)); color: var(--c, var(--orange)); }
.ans-task p { padding-top: 4px; }
.ans.show-expl .why { display: none; }
.ans.show-expl .expl[hidden] { display: block !important; }
@media (prefers-reduced-motion: reduce) { .tg i, .tg i::after { transition: none; } }
/* narrow: a compact head and one row of switches, so the answer itself keeps the room */
@media (max-width: 899px), (max-aspect-ratio: 999/1000) {
  .ans-head { grid-template-columns: 1fr auto auto; gap: 8px; padding: 8px 10px 8px 14px; }
  .ans-head .ans-icon { display: none; }
  .ans-head h2 { font-size: 16px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .ans-head small { font-size: 12px; }
  .ans-tg { flex-wrap: nowrap; overflow-x: auto; gap: 14px; padding: 6px 14px; scrollbar-width: none; }
  .tg { flex: none; font-size: 13.5px; gap: 6px; }
  .fs button { height: 30px; min-width: 32px; }
  .ans-x { width: 30px; height: 30px; }
}
@media (max-width: 899px), (max-aspect-ratio: 999/1000) {
  .ans-tg { gap: 12px; padding: 6px 12px; }
  /* with the transcript under it, the answer drops its credit line (it is shown when the transcript is off) */
  html.cc-dock #ans .ans-foot small { display: none; }
  html.cc-dock #ans .ans-foot:has(.ans-play[hidden]) { display: none; }
}
/* key under a speaker: half the speaker (≈1.1 key) + half the key + a gap, whatever the page size */
.key.under { transform: translate(-50%, calc(55% + 5px)); }
.key.above { transform: translate(-50%, calc(-155% - 5px)); }

/* ---------- study tools row under the lesson head ---------- */
.study-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; }
.study-tools > * {
  display: block; text-align: left; text-decoration: none; color: var(--ink); background: var(--sheet);
  border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: 10px; padding: 8px 12px; font: inherit; cursor: pointer;
}
.study-tools b { display: block; font-size: 15px; }
.study-tools small { display: block; color: var(--ink-2); font-size: 12.5px; line-height: 1.3; }
.study-tools > *:hover { border-color: var(--c); }
@media (max-width: 520px) { .study-tools small { display: none; } .study-tools > * { text-align: center; padding: 8px 4px; } .study-tools b { font-size: 14px; } }

/* ---------- daily review on the home page ---------- */
.review {
  display: flex; align-items: center; gap: 14px; margin: 0 0 22px; padding: 12px 16px; text-decoration: none; color: var(--ink);
  background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius);
}
.review-n { flex: none; min-width: 48px; height: 48px; padding: 0 8px; border-radius: 12px; background: var(--orange); color: #fff; display: grid; place-items: center; font: 800 22px "Bricolage Grotesque", sans-serif; }
.review strong { display: block; font: 700 18px "Bricolage Grotesque", sans-serif; }
.review small { color: var(--ink-2); }
.cards.review .cards-opts .seg { display: none; }

/* ---------- transcript practice modes ---------- */
.p-modes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; align-items: center; }
.p-modes button { border: 1px solid var(--line); background: var(--sheet); color: var(--ink-2); border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 700; }
.p-modes button[aria-pressed="true"] { background: var(--c, var(--orange)); border-color: transparent; color: #fff; }
.p-modes .p-loop1 { margin-left: auto; }
html.cc-dock .p-modes { flex: none; }
.p-text p.de.looping { outline: 2px dashed var(--c, var(--orange)); outline-offset: 3px; border-radius: 4px; }
.gap-in {
  font: inherit; color: var(--ink); background: var(--sheet); border: 0; border-bottom: 2px solid var(--c, var(--orange));
  border-radius: 3px 3px 0 0; padding: 0 3px; margin: 0 1px; max-width: 14ch;
}
.gap-in:focus { outline: 2px solid var(--c, var(--orange)); outline-offset: 1px; }
.gap-in.ok { border-color: #2e8b57; background: color-mix(in srgb, #2e8b57 14%, var(--sheet)); }
.gap-in.case { border-color: #c98a00; background: color-mix(in srgb, #c98a00 14%, var(--sheet)); }
.gap-in.bad { border-color: #c0392b; background: color-mix(in srgb, #c0392b 12%, var(--sheet)); }
.p-tool { font-size: 15px; }
.tool-btn { border: 0; border-radius: 8px; padding: 6px 12px; background: var(--c, var(--orange)); color: #fff; font-weight: 700; font-size: 14px; }
.tool-btn.ghost { background: var(--sheet); color: var(--ink); border: 1px solid var(--line); }
.tool-btn.big { padding: 12px 26px; font-size: 17px; }
.gaps-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0 4px; }
.gap-score { font-weight: 700; }
.dict { display: grid; gap: 8px; }
.dict-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dict-top > span:not(.dict-nav) { color: var(--ink-2); font-size: 14px; }
.dict-nav { margin-left: auto; display: flex; gap: 4px; }
.dict-in { width: 100%; font: inherit; font-size: 1em; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--sheet); color: var(--ink); resize: vertical; }
.dict-acts { display: flex; gap: 8px; }
.dict-res, .dict-sol { margin: 0; line-height: 1.8; color: var(--ink); }
.d-ok { color: #2e8b57; font-weight: 700; }
.d-miss { color: var(--ink-2); text-decoration: underline wavy #c0392b; text-underline-offset: 4px; }
.d-extra { color: #c0392b; text-decoration: line-through; }
.dict-score { margin: 0; font-weight: 700; color: var(--ink-2) !important; }
.say-tools { display: inline-flex; gap: 4px; margin-right: 6px; vertical-align: 2px; }
.say-btn { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--sheet); color: var(--c, var(--orange)); font-size: 13px; padding: 0; }
.say-btn.mic.on { background: #c0392b; color: #fff; border-color: transparent; animation: mic 1s ease-in-out infinite alternate; }
@keyframes mic { to { box-shadow: 0 0 0 6px color-mix(in srgb, #c0392b 25%, transparent); } }
.say-res { display: block; margin: 4px 0 2px; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.say-pct { font-weight: 800; padding: 0 6px; border-radius: 6px; color: #fff; }
.say-pct.good { background: #2e8b57; }
.say-pct.mid { background: #c98a00; }
.say-pct.low { background: #c0392b; }
.p-text.m-speak p.tr { display: none; }

/* ---------- grammar sheet ---------- */
.gram-icon { font: 800 20px "Bricolage Grotesque", sans-serif; }
.g-toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.g-toc a { font-size: calc(13px * var(--fs, 1)); padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); background: var(--paper); }
.g-topic { padding: 12px 0 14px; border-bottom: 1px solid var(--line); }
.g-topic h3, .g-quiz h3 { margin: 4px 0 0; font: 800 calc(18px * var(--fs, 1)) "Bricolage Grotesque", sans-serif; color: var(--c, var(--orange)); }
.g-uz { margin: 0 0 8px !important; color: var(--ink-2); font-weight: 700; }
.g-topic p { margin: 0 0 8px; }
.g-table-wrap { overflow-x: auto; margin: 8px 0; }
.g-table { border-collapse: collapse; font-size: .92em; min-width: 100%; }
.g-table th, .g-table td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; vertical-align: top; }
.g-table th { background: color-mix(in srgb, var(--c, var(--orange)) 12%, var(--paper)); }
.g-ex { margin: 8px 0; padding-left: 1.1em; }
.g-ex li { margin-bottom: 6px; }
.g-ex small { display: block; color: var(--ink-2); font-size: .88em; }
.g-tip { padding: 8px 12px; border-left: 3px solid #c98a00; background: color-mix(in srgb, #c98a00 10%, transparent); border-radius: 0 8px 8px 0; }

/* ---------- quiz items (grammar + lesson test) ---------- */
.q { padding: 10px 0 12px; border-bottom: 1px dashed var(--line); }
.q-q { margin: 0 0 8px; font-weight: 700; }
.q-n { display: inline-grid; place-items: center; min-width: 24px; height: 24px; margin-right: 8px; border-radius: 50%; background: color-mix(in srgb, var(--c, var(--orange)) 16%, transparent); color: var(--c, var(--orange)); font-size: 13px; }
.q-gap { letter-spacing: .1em; color: var(--c, var(--orange)); }
.q-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.q-opt { border: 1.5px solid var(--line); background: var(--sheet); color: var(--ink); border-radius: 8px; padding: 6px 12px; font: inherit; font-size: .95em; text-align: left; }
.q-opt:not(:disabled):hover { border-color: var(--c, var(--orange)); }
.q-opt.picked { border-color: var(--c, var(--orange)); background: color-mix(in srgb, var(--c, var(--orange)) 14%, var(--sheet)); font-weight: 700; }
.q-opt.is-right { border-color: #2e8b57; background: color-mix(in srgb, #2e8b57 16%, var(--sheet)); font-weight: 700; }
.q-opt.is-wrong { border-color: #c0392b; background: color-mix(in srgb, #c0392b 14%, var(--sheet)); text-decoration: line-through; }
.q-opt:disabled { cursor: default; opacity: 1; color: var(--ink); }
.q.right .q-n { background: #2e8b57; color: #fff; }
.q.wrong .q-n { background: #c0392b; color: #fff; }
.q-why { margin: 8px 0 0; padding: 6px 10px; border-radius: 8px; background: var(--paper); color: var(--ink-2); font-size: .92em; }
.q-total, .t-score { font-weight: 700; margin: 12px 0; }

/* ---------- lesson test page ---------- */
.test { max-width: 760px; font-size: 17px; line-height: 1.55; }
.t-intro, .t-hint { color: var(--ink-2); }
.t-sec { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin: 0 0 16px; }
.t-sec h2 { margin: 0 0 6px; font: 800 22px "Bricolage Grotesque", sans-serif; color: var(--c); }
.t-listen { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.t-audio { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--ink-2); font-size: 14px; }
.t-text { background: var(--paper); border-radius: 10px; padding: 12px 16px; margin: 6px 0 10px; }
.t-text h4 { margin: 0 0 6px; font-size: 18px; }
.t-text p { margin: 0 0 8px; }
.t-tr summary { cursor: pointer; color: var(--c); font-weight: 700; font-size: 14px; }
.t-end { text-align: center; padding: 8px 0 24px; }
.lang-seg { margin-left: auto; }
.lang-seg button { padding: 3px 10px; font-size: 13px; }

/* ---------- side panel tabs: Audios | Grammatik | Wörter | Lesen ---------- */
.p-head-sticky { position: sticky; top: 0; z-index: 3; background: var(--sheet); border-bottom: 1px solid var(--line); }
.p-head-sticky .panel-head { padding: 10px 14px 6px; }
.p-head-sticky .panel-head h2 { padding: 0; font-size: 17px; }
.ptabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; padding: 0 8px; }
.ptabs button {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 48px;
  border: 0; background: none; color: var(--ink-2); font: 700 14px "Atkinson Hyperlegible", sans-serif; padding: 6px 2px 8px; border-radius: 8px 8px 0 0;
}
.ptabs button:hover { color: var(--ink); background: var(--paper); }
.ptabs button[aria-selected="true"] { color: var(--ink); }
.ptabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--c); }
.ptabs button:focus-visible { outline: 2px solid var(--c); outline-offset: -2px; }
.ptabs small { font-size: 11.5px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; min-height: 1.2em; }
.ptabs small.good { color: #2e8b57; } .ptabs small.mid { color: #b07a00; } .ptabs small.low { color: #c0392b; }
.ppane { padding-bottom: 12px; }
.ppane[data-pane="audio"] > .note { margin-top: 10px; }
.qp-pad { padding: 14px; }

/* wide screens: a practice tab makes the panel a little wider, for 4 options and the reading texts */
@media (min-width: 1100px) {
  .study.quiz-on:not(.closed) { grid-template-columns: minmax(0, 1fr) 420px; }
}
@media (max-width: 1099px) {
  .study.quiz-on .tracks { width: min(460px, 94vw); }
}
@media (max-width: 520px) {
  .study .tracks { width: 94vw; }
  .ptabs button { font-size: 13px; }
}

/* score bar with one dot per question */
.qp-bar { padding: 12px 14px 10px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--c) 6%, var(--sheet)); }
.qp-score { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 15px; }
.qp-score small { color: var(--ink-2); font-size: 13px; }
.qp-dots { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 0; }
.qp-dots button { width: 18px; height: 18px; padding: 0; border-radius: 50%; border: 2px solid var(--line); background: var(--sheet); }
.qp-dots button.ok { background: #2e8b57; border-color: #2e8b57; }
.qp-dots button.bad { background: #c0392b; border-color: #c0392b; }
.qp-dots button:hover, .qp-dots button:focus-visible { border-color: var(--c); outline: none; }
@media (pointer: coarse) { .qp-dots { gap: 6px; } .qp-dots button { width: 22px; height: 22px; } }
.qp-done { margin: 10px 0 0; font-size: 15px; }
.qp-done b { font: 800 26px "Bricolage Grotesque", sans-serif; color: var(--c); margin-right: 4px; }
.qp-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* one question */
.qp-list { padding: 0 14px; font-size: calc(16px * var(--fs, 1)); line-height: 1.45; }
.qp-topic { margin: 16px 0 0; font: 800 16px "Bricolage Grotesque", sans-serif; color: var(--c); }
.qp-topic small { display: block; font: 400 13px "Atkinson Hyperlegible", sans-serif; color: var(--ink-2); }
.qp { padding: 14px 0; border-bottom: 1px solid var(--line); }
.qp-q { display: flex; gap: 8px; margin: 0 0 10px; font-weight: 700; }
.qp-q .q-n { flex: none; margin: 0; }
.qp.right .q-n { background: #2e8b57; color: #fff; }
.qp.wrong .q-n { background: #c0392b; color: #fff; }
.qp-opts { display: grid; gap: 6px; }
.qp-opt {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; text-align: left;
  border: 1.5px solid var(--line); background: var(--sheet); color: var(--ink); border-radius: 10px; padding: 7px 10px; font: inherit;
}
.qp-l { flex: none; width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; background: var(--paper); color: var(--ink-2); font-size: 13px; font-weight: 700; }
.qp-opt:not(:disabled):hover { border-color: var(--c); }
.qp-opt:not(:disabled):hover .qp-l { background: var(--c); color: #fff; }
.qp-opt:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.qp-opt:disabled { cursor: default; color: var(--ink); }
.qp-opt.is-right { border-color: #2e8b57; background: color-mix(in srgb, #2e8b57 14%, var(--sheet)); font-weight: 700; }
.qp-opt.is-right .qp-l { background: #2e8b57; color: #fff; }
.qp-opt.is-wrong { border-color: #c0392b; background: color-mix(in srgb, #c0392b 12%, var(--sheet)); }
.qp-opt.is-wrong .qp-l { background: #c0392b; color: #fff; }
.qp.done .qp-opt:not(.is-right):not(.is-wrong) { opacity: .6; }
.qp .q-why { margin-top: 10px; }
@media (prefers-reduced-motion: no-preference) {
  .qp-opt { transition: border-color .12s, background-color .12s; }
  .qp.done .q-why { animation: qpwhy .2s ease-out; }
  @keyframes qpwhy { from { opacity: 0; transform: translateY(-4px); } }
}
.qp-more { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 4px; }

/* reading: three short texts */
.qp-texts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 12px 0 0; width: 100%; }
.qp-texts button { display: flex; flex-direction: column; align-items: center; padding: 5px 4px; line-height: 1.2; }
.qp-texts small { font-size: 11.5px; opacity: .8; font-variant-numeric: tabular-nums; }
.qp-text { margin: 12px 0 4px; padding: 12px 14px; border-radius: 10px; background: var(--paper); border-left: 3px solid var(--c); }
.qp-kind { margin: 0; font-size: 12.5px; color: var(--ink-2); }
.qp-text h4 { margin: 2px 0 8px; font: 800 18px "Bricolage Grotesque", sans-serif; }
.qp-text p { margin: 0 0 8px; }
.qp-text .t-tr p { color: var(--ink-2); }

/* ---------- statistics page ---------- */
.stats a { color: var(--ink-2); text-decoration: none; }
.stats a small { display: block; color: var(--c, var(--orange)); font-size: 13px; text-decoration: underline; }
.stats-page { max-width: 1000px; }
.st-top span { min-width: 150px; }
.st-sec { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin: 0 0 16px; }
.st-sec h2 { margin: 0 0 10px; font: 800 20px "Bricolage Grotesque", sans-serif; }
.st-heat { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 5px; max-width: 520px; }
.st-heat i { aspect-ratio: 1; border-radius: 4px; background: color-mix(in srgb, var(--orange) calc(20% + 80% * var(--v)), var(--paper)); }
.st-heat i.zero { background: var(--paper); border: 1px solid var(--line); }
.st-legend { display: flex; justify-content: space-between; max-width: 520px; margin: 6px 0 0; font-size: 12.5px; color: var(--ink-2); }
.st-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
.st-table { border-collapse: collapse; width: 100%; min-width: 680px; font-size: 14px; }
.st-table th, .st-table td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.st-table thead th { color: var(--ink-2); font-weight: 700; font-size: 13px; }
.st-table tbody th a { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 700; }
.st-table td small { display: block; color: var(--ink-2); font-size: 12px; white-space: nowrap; }
.st-num { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--c); color: #fff; font: 800 15px "Bricolage Grotesque", sans-serif; }
.st-pct { font: 800 17px "Bricolage Grotesque", sans-serif; }
.st-pct.good { color: #2e8b57; } .st-pct.mid { color: #b07a00; } .st-pct.low { color: #c0392b; }
.st-hard { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.st-hard a { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.st-hard a:hover { border-color: var(--orange); }
.st-hard small { color: var(--ink-2); white-space: nowrap; }
@media (max-width: 520px) {
  .st-sec { padding: 12px 14px; }
  .st-wrap { margin: 0 -14px; padding: 0 14px; }
  .st-hard a { grid-template-columns: auto 1fr; }
  .st-hard small { grid-column: 2; }
}

/* phones: one card per lesson instead of a wide table */
@media (max-width: 640px) {
  .st-wrap { margin: 0; padding: 0; overflow: visible; }
  .st-table, .st-table tbody { display: block; min-width: 0; }
  .st-table thead { display: none; }
  .st-table tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .st-table tbody th { grid-column: 1 / -1; border: 0; padding: 0; }
  .st-table td { border: 0; padding: 0; }
  .st-table td::before { content: attr(data-l); display: block; font-size: 12px; color: var(--ink-2); }
}

/* ---------- volume picker in the header ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.level-pick select {
  font: 700 15px "Atkinson Hyperlegible", sans-serif; color: var(--ink); background: var(--sheet);
  border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 30px 6px 14px; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px; background-repeat: no-repeat;
}
.level-pick select:hover, .level-pick select:focus-visible { border-color: var(--orange); outline: none; }
@media (max-width: 640px) { .level-pick select { font-size: 14px; padding: 5px 26px 5px 10px; } }

/* ---------- films (B1) ---------- */
.track.film .dot { font-size: 10px; border-color: var(--c); color: var(--c); }
dialog.video { width: min(960px, calc(100vw - 24px)); padding: 0; border: 0; border-radius: var(--radius); background: var(--sheet); color: var(--ink); overflow: hidden; }
dialog.video::backdrop { background: rgb(10 15 25 / .7); }
dialog.video video { display: block; width: 100%; max-height: calc(100dvh - 120px); background: #000; }
/* phones: the volume picker names the level, so the brand keeps only its number */
@media (max-width: 560px) {
  .top .brand > span:last-child { display: none; }
  .top { gap: 8px; }
}
/* translations of the transcripts exist only for A2.2 */
html.no-tr #pTr { display: none; }

/* ---------- home: the six volumes, closed until opened ---------- */
.levels { display: grid; gap: 12px; }
.lv { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lv.current { border-color: color-mix(in srgb, var(--c) 55%, var(--line)); }
.lv-h { margin: 0; font: inherit; }
.lv-head {
  width: 100%; display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 16px;
  padding: 0 18px 0 0; border: 0; background: none; color: var(--ink); text-align: left; cursor: pointer; font: inherit;
}
.lv-num {
  align-self: stretch; min-height: 76px; width: 76px; display: grid; place-items: center; background: var(--c); color: #fff;
  font: 800 34px "Bricolage Grotesque", sans-serif;
}
.lv-text b { display: block; font: 800 26px/1.1 "Bricolage Grotesque", sans-serif; }
.lv-text small { display: block; color: var(--ink-2); font-size: 14px; margin-top: 3px; }
.lv-prog { display: grid; gap: 5px; min-width: 150px; font-size: 13px; color: var(--ink-2); }
.lv-prog i { display: block; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--c) var(--p, 0%), var(--paper) var(--p, 0%)); }
.lv-chev { width: 12px; height: 12px; border-right: 2.5px solid var(--ink-2); border-bottom: 2.5px solid var(--ink-2); transform: rotate(45deg) translate(-3px, -3px); }
.lv-head[aria-expanded="true"] .lv-chev { transform: rotate(-135deg) translate(-2px, -2px); }
.lv-head:hover .lv-text b { text-decoration: underline; text-decoration-color: var(--c); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.lv-head:focus-visible { outline: 3px solid var(--c); outline-offset: -3px; }
.lv-body { padding: 16px 18px 20px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--c) 4%, var(--paper)); }
.lv-intro { margin: 0 0 12px; color: var(--ink-2); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.lv-body .stats { margin: 0 0 14px; }
.lv-body .more { margin-top: 18px; }
@media (prefers-reduced-motion: no-preference) {
  .lv-chev { transition: transform .2s; }
  .lv-body:not([hidden]) { animation: lvopen .2s ease-out; }
  @keyframes lvopen { from { opacity: 0; transform: translateY(-6px); } }
}
@media (max-width: 640px) {
  .lv-head { grid-template-columns: auto 1fr auto; gap: 12px; padding-right: 14px; }
  .lv-num { width: 58px; min-height: 64px; font-size: 26px; }
  .lv-text b { font-size: 22px; }
  .lv-prog { grid-column: 2 / 3; grid-row: 2; min-width: 0; padding-bottom: 12px; }
  .lv-chev { grid-row: 1; grid-column: 3; }
  .lv-num { grid-row: 1 / 3; }
  .lv-body { padding: 14px 12px 16px; }
}
@media (max-width: 640px) {
  .lv-text { padding-top: 10px; }
  .lv-num { min-height: 0; }
  .lv-prog { padding-bottom: 10px; }
}

/* ---------- sozlar.com: Solutions ---------- */
/* the site menu button (☰, html.sz-over) floats in the top-left corner over the header */
.top { padding-left: 60px; }
html.focus .sz-burger { display: none !important; }
.lv-num { font-size: 26px; }
.edge-num { font-size: 22px; }
.p-text .spk { color: var(--c, var(--orange)); font-weight: 700; margin-right: .25em; }
.p-modes .fs { margin-left: 6px; }
.lesson-head .seg button[disabled] { opacity: .4; cursor: default; }

/* ---------- speaker buttons: a frame over the printed 🎧 marker, nothing on top of the text ---------- */
/* the book already prints the speaker icon: the button only outlines that marker; the tap area stays finger-sized */
.spot {
  width: 6.2%; height: auto; aspect-ratio: 4 / 1.25; border-radius: 6px;
  background: transparent; border: 2px solid var(--c); color: transparent;
  box-shadow: 0 0 0 2px rgb(255 255 255 / .85), 0 0 10px color-mix(in srgb, var(--c) 55%, transparent);
}
.spot svg { display: none; }
.spot::before { content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, 40px); height: max(100%, 40px); transform: translate(-50%, -50%); }
.spot:hover { background: color-mix(in srgb, var(--c) 18%, transparent); }
.spot.heard { border-style: dashed; }
.spot.on { background: color-mix(in srgb, var(--c) 28%, transparent); color: transparent; }
.spread.zoom .spot { width: 6.2%; }
@media (prefers-reduced-motion: no-preference) {
  .spot.on::after { inset: -5px; border-radius: 9px; }
  @keyframes ping { from { transform: scale(.95); opacity: .9; } to { transform: scale(1.25); opacity: 0; } }
}
/* full screen: the page-turn arrows stay thin and see-through, so they do not hide the page */
html.focus .reader .full-nav { width: 30px; height: 56px; font-size: 22px; background: rgb(20 25 32 / .35); }

/* ---------- Solutions answer keys (2026-10-22): the key sits just left of the printed exercise number ---------- */
.key { width: clamp(22px, 2.5%, 34px); border-radius: 7px; transform: translate(calc(-100% - 9px), -50%); }
.key::before { content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, 36px); height: max(100%, 36px); transform: translate(-50%, -50%); }
.spread.zoom .key { width: 34px; }
.ans-body p { margin: 0; padding: 7px 0; border-bottom: 1px dashed var(--line); overflow-wrap: anywhere; }
.ans-body p:last-child { border-bottom: 0; }
.ans-gap { display: inline-block; width: 1.4em; }
.p-key[hidden] { display: none; }
/* Uzbek line under each transcript line */
.p-uz[hidden] { display: none; }
.p-text p.uz { display: none; margin: 0 0 10px; font-size: .88em; color: color-mix(in srgb, var(--ink-2) 85%, transparent); }
.p-text.show-uz p.uz { display: block; }
.p-text.show-uz p.de { margin-bottom: 1px; }
.p-text.m-dict p.uz { display: none !important; }

/* pinch zoom (2026-10-22): two fingers zoom the book pages (app.js pinchZoom), not the whole screen */
.sheet-wrap { touch-action: pan-x pan-y; }
/* several exercises share the playing track: one heading per exercise in the answer card */
.ans-ex { margin: 14px 0 2px; font-size: .95em; font-weight: 700; color: var(--c, var(--orange)); }
.ans-ex:first-child { margin-top: 4px; }

/* ---------- unit word table (2026-10-22): shares the side dialog with the answer key ---------- */
.ans .w-ic { display: none; font: 800 15px "Bricolage Grotesque", sans-serif; letter-spacing: -.02em; }
.ans.words .w-ic { display: block; }
.ans.words .ans-icon svg { display: none; }
.ans.words .ans-body { padding-top: 0; font-size: calc(15.5px * var(--fs, 1)); line-height: 1.45; }
.w-tools { position: sticky; top: 0; z-index: 2; display: flex; gap: 8px; padding: 10px 0; background: var(--sheet); }
.w-tools input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 15px; }
.w-hide { flex: none; border: 1px solid var(--line); background: var(--sheet); color: var(--ink); border-radius: 8px; padding: 0 10px; font-size: 13px; font-weight: 700; }
.w-hide[aria-pressed="true"] { background: var(--c, var(--orange)); color: #fff; border-color: transparent; }
.wsec h3 { margin: 0; position: sticky; top: var(--wt, 58px); z-index: 1; background: var(--sheet); border-bottom: 2px solid color-mix(in srgb, var(--c, var(--orange)) 35%, transparent); }
.wsec h3 button { all: unset; box-sizing: border-box; width: 100%; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 12px 0 6px; cursor: pointer;
  font: 800 15px "Bricolage Grotesque", sans-serif; color: var(--c, var(--orange)); }
.wsec h3 button span { flex: none; font: 600 12px system-ui, sans-serif; color: var(--ink-2); }
.wsec h3 button:hover span, .wsec h3 button:focus-visible span { text-decoration: underline; }
.wsec h3 button:focus-visible { outline: 2px solid var(--c, var(--orange)); outline-offset: 2px; }
.wrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2px 14px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.w-en { font-weight: 700; overflow-wrap: anywhere; }
.w-uz { color: var(--ink-2); overflow-wrap: anywhere; }
.ans.quiz .wrow { cursor: pointer; }
.ans.quiz .wrow:not(.show) .w-uz { color: transparent; background: color-mix(in srgb, var(--ink-2) 18%, transparent); border-radius: 5px; user-select: none; }
@media (max-width: 420px) { .wrow { grid-template-columns: 1fr; } }
.ans.words .empty { color: var(--ink-2); padding: 14px 0; }
/* full screen: the Words button under the ✕ */
.reader .full-voc { display: none; }
html.focus .reader .full-voc {
  display: block; position: fixed; z-index: 6; top: 64px; right: 12px;
  border: 0; border-radius: 10px; padding: 8px 12px; background: rgb(20 25 32 / .6); color: #fff; font-weight: 700; font-size: 14px;
}
html.focus.dock .reader .full-voc { right: calc(var(--dock-w) + 12px); }
/* one page / two pages (2026-10-22): bar button + the same button in full screen, above Words */
.reader [data-pages][hidden] { display: none; }
.reader .full-pages { display: none; }
html.focus .reader .full-pages:not([hidden]) {
  display: block; position: fixed; z-index: 6; top: 64px; right: 12px;
  border: 0; border-radius: 10px; padding: 8px 12px; background: rgb(20 25 32 / .6); color: #fff; font-weight: 700; font-size: 14px;
}
html.focus .reader .full-pages:not([hidden]) ~ .full-voc { top: 112px; }
html.focus.dock .reader .full-pages { right: calc(var(--dock-w) + 12px); }
/* one page chosen on a wide screen: the page fills the width like the two-page spread; scroll down to read on */
.spread.one:not(.zoom) .pg-img { flex: 1 1 auto; max-width: none; }
.spread.one:not(.zoom) .pg-img img { width: 100%; max-width: none; }
/* answer key laid out (2026-10-23): numbered answers in a grid / rows, label chip, one sentence per row */
.ans-label { display: inline-block; margin: 10px 0 2px !important; padding: 2px 10px !important; border: 0 !important; border-radius: 999px;
  background: color-mix(in srgb, var(--c, var(--orange)) 15%, transparent); color: var(--c, var(--orange)); font-size: .8em; font-weight: 700; }
.ans-items { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 0; }
.ans-items.grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 14px; }
.ans-items li { display: grid; grid-template-columns: 30px 1fr; gap: 8px; align-items: baseline; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.ans-items.grid li { border-bottom: 0; padding: 4px 0; }
.ans-n { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 50%; font-size: .78em;
  background: color-mix(in srgb, var(--c, var(--orange)) 16%, transparent); color: var(--c, var(--orange)); }
.ans-items li span { overflow-wrap: anywhere; }
.ans-sents { margin: 8px 0; padding: 0; list-style: none; }
.ans-sents li { padding: 6px 0 6px 16px; border-bottom: 1px dashed var(--line); position: relative; }
.ans-sents li::before { content: ""; position: absolute; left: 2px; top: 1.05em; width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--orange)); }
.ans-sents li:last-child, .ans-items:not(.grid) li:last-child { border-bottom: 0; }
/* a pinch-zoomed page narrower than the screen sits in the middle, not against the left edge */
.spread.zoom { justify-content: safe center; }

/* ---------- interactive gaps (2026-10-27): input boxes on the book's answer lines; sizes follow the page width ---------- */
/* --cq = 1% of the page width, set by app.js (ResizeObserver); container queries would collapse auto-width pages */
.gap {
  position: absolute; z-index: 3; transform: translateY(-82%); box-sizing: border-box;
  height: calc(1.85 * var(--cq, 7px)); padding: 0 calc(.35 * var(--cq, 7px)); margin: 0; border: 0; border-radius: calc(.35 * var(--cq, 7px));
  font: 600 calc(1.3 * var(--cq, 7px))/1 system-ui, sans-serif; color: #12408a; background: rgb(255 255 255 / .55);
  outline: 0; box-shadow: inset 0 -2px 0 rgb(18 64 138 / .25);
}
.gap:focus { background: rgb(255 240 180 / .75); box-shadow: inset 0 -2px 0 #12408a; }
/* no min-height on the empty box: on a phone page (--cq ~ 4px) a 13px box grew over the printed line above and its white veil washed the text out; only the box being typed in is made usable-sized */
.gap:not(.mc):focus { min-height: 14px; font-size: max(12px, calc(1.3 * var(--cq, 7px))); z-index: 5; }
.gap.ok { color: #137a2e; background: rgb(205 242 205 / .8); box-shadow: inset 0 -2px 0 #2e9b4b; }
.gap.bad { color: #c0261c; background: rgb(255 214 208 / .85); box-shadow: inset 0 -2px 0 #d33; }
.gap.shown { color: #6a3fa0; font-style: italic; background: rgb(236 224 255 / .85); }
.gapbar {
  position: absolute; z-index: 4; transform: translateY(calc(-100% - calc(2.6 * var(--cq, 7px)))); display: flex; gap: calc(.5 * var(--cq, 7px)); align-items: center;
  padding: calc(.4 * var(--cq, 7px)); border-radius: calc(.8 * var(--cq, 7px)); background: #12408a; box-shadow: 0 calc(.4 * var(--cq, 7px)) calc(1.6 * var(--cq, 7px)) rgb(0 0 0 / .25); white-space: nowrap;
}
.gapbar button { border: 0; border-radius: calc(.55 * var(--cq, 7px)); padding: calc(.5 * var(--cq, 7px)) calc(1 * var(--cq, 7px)); font: 700 calc(1.3 * var(--cq, 7px))/1 system-ui, sans-serif; cursor: pointer; background: #fff; color: #12408a; min-height: 22px; }
.gapbar button[data-gap="check"] { background: #ffd23f; }
.gapscore { color: #fff; font: 700 calc(1.3 * var(--cq, 7px))/1 system-ui, sans-serif; padding: 0 calc(.6 * var(--cq, 7px)); }
/* circle-the-answer options (2026-10-28): a round button over the printed option letter; chosen = circled */
.gap.mc { aspect-ratio: 1; height: auto; padding: 0; border: 0; border-radius: 50%; transform: translate(-50%, -50%); background: transparent; box-shadow: 0 0 0 1px rgb(18 64 138 / .22); cursor: pointer; }
.gap.mc:hover { background: rgb(255 240 180 / .45); }
.gap.mc:focus { background: transparent; outline: none; }
.gap.mc:focus-visible { outline: 2px dashed #12408a; outline-offset: 1px; }
.gap.mc[aria-pressed="true"] { box-shadow: 0 0 0 calc(.22 * var(--cq, 7px)) #12408a; background: rgb(255 240 180 / .35); }
.gap.mc.ok[aria-pressed="true"] { box-shadow: 0 0 0 calc(.26 * var(--cq, 7px)) #2e9b4b; background: rgb(205 242 205 / .45); }
.gap.mc.bad[aria-pressed="true"] { box-shadow: 0 0 0 calc(.26 * var(--cq, 7px)) #d33; background: rgb(255 214 208 / .5); }
.gap.mc.shown[aria-pressed="true"] { box-shadow: 0 0 0 calc(.26 * var(--cq, 7px)) #6a3fa0; background: rgb(236 224 255 / .5); }
.gapbar.mcbar { transform: translate(-calc(1 * var(--cq, 7px)), calc(-100% - calc(2.6 * var(--cq, 7px)))); }
/* underline-the-word options: a box over the word; chosen = underlined */
.gap.mc.ul { aspect-ratio: auto; border-radius: calc(.3 * var(--cq, 7px)); transform: translateY(-50%); min-height: 0; box-shadow: none; }
.gap.mc.ul:hover { background: rgb(255 240 180 / .45); }
.gap.mc.ul[aria-pressed="true"] { box-shadow: inset 0 -calc(.28 * var(--cq, 7px)) 0 #12408a; background: rgb(255 240 180 / .3); }
.gap.mc.ul.ok[aria-pressed="true"] { box-shadow: inset 0 -calc(.32 * var(--cq, 7px)) 0 #2e9b4b; background: rgb(205 242 205 / .45); }
.gap.mc.ul.bad[aria-pressed="true"] { box-shadow: inset 0 -calc(.32 * var(--cq, 7px)) 0 #d33; background: rgb(255 214 208 / .5); }
.gap.mc.ul.shown[aria-pressed="true"] { box-shadow: inset 0 -calc(.32 * var(--cq, 7px)) 0 #6a3fa0; background: rgb(236 224 255 / .5); }

/* ---------- phones (2026-10-29): one compact unit row + a bottom dock for the reader's tools ---------- */
.reader-bar .pg { border: 0; background: none; padding: 4px 2px; font: inherit; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.unit-pick, .narrow-only, .reader-bar .home-btn, .reader-bar .race-btn { display: none; }
/* Destination: the unit game (🎮) is on every screen */
.reader-bar .race-btn.play-btn { display: flex; align-items: center; justify-content: center; font-size: 18px; text-decoration: none; }
@media (max-width: 640px) {
  .narrow-only { display: inline; }
  /* unit: no tab row, no big title — one row "1 · Generations ▾"  [SB | WB] */
  .lesson-tabs, .lesson-head .lesson-num, .lesson-head .lh-title { display: none; }
  .lesson-head { flex-wrap: nowrap; gap: 8px; margin: 2px 0 8px; }
  .unit-pick { display: block; flex: 1 1 auto; min-width: 0; }
  .unit-pick select {
    width: 100%; min-height: 40px; padding: 6px 30px 6px 12px; border-radius: 999px; border: 2px solid var(--c);
    background: var(--sheet); color: var(--ink); font: 700 15px/1.2 inherit; text-overflow: ellipsis;
  }
  .lesson-head .seg { flex: none; }
  .lesson-head .seg button { padding: 7px 12px; font-weight: 700; }
  /* reader: tools in a dock stuck to the bottom of the screen (above a docked player) */
  .reader { display: flex; flex-direction: column; overflow: clip; border-radius: 12px; min-width: 0; }
  .reader > * { min-width: 0; max-width: 100%; }
  .reader .sheet-wrap { order: 1; }
  .reader .strip { order: 2; display: none; position: sticky; z-index: 24; bottom: calc(var(--dock-h, 0px) + 56px); background: var(--sheet); }
  .reader.strip-open .strip { display: flex; }
  .reader-bar {
    order: 3; position: sticky; z-index: 25; bottom: var(--dock-h, 0px); flex-wrap: nowrap; justify-content: space-between;
    gap: 2px; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); border-bottom: 0;
    background: var(--sheet); box-shadow: 0 -4px 14px rgb(15 25 40 / .10);
  }
  .reader-bar .icon-btn, .reader-bar .pg { flex: 1 1 0; min-width: 0; height: 42px; padding: 0; display: flex; align-items: center; justify-content: center; gap: 2px; margin: 0; border: 0; background: none; border-radius: 10px; }
  .reader-bar .home-btn { display: flex; order: 0; font-size: 19px; text-decoration: none; color: var(--ink); }
  .reader-bar [data-go="-1"] { order: 1; } .reader-bar .pg { order: 2; } .reader-bar [data-go="1"] { order: 3; }
  .reader-bar [data-zoom] { order: 4; } .reader-bar [data-words] { order: 5; } .reader-bar .panel-btn { order: 6; } .reader-bar [data-full] { order: 7; }
  .reader-bar .icon-btn:active { background: var(--paper); }
  .reader-bar .pg { font: 800 16px/1 system-ui, sans-serif; color: var(--ink); border-radius: 10px; }
  .reader-bar .pg::after { content: " ▴"; font-size: 11px; color: var(--ink-2); }
  .reader.strip-open .reader-bar .pg { background: var(--paper); }
  .reader-bar [data-go] { font-size: 22px; }
  /* icons instead of words */
  .reader-bar [data-zoom], .reader-bar [data-words], .reader-bar .panel-btn { font-size: 0; }
  .reader-bar [data-zoom]::before { content: "🔍"; font-size: 19px; }
  .reader-bar [data-zoom][aria-pressed="true"] { background: var(--c); }
  .reader-bar [data-words]::before { content: "Aa"; font: 800 17px/1 system-ui, sans-serif; }
  .reader-bar .panel-btn::before { content: "🎧"; font-size: 19px; }
  .reader-bar .panel-btn[aria-expanded="true"] { background: var(--paper); }
  .reader-bar .panel-btn { margin-left: 0; }
  .reader-bar [data-full] { font-size: 19px; }
  /* the floating player card starts above the dock */
  html:not(.p-dock) .player { bottom: 70px; }
}

/* ---------- audio list: header with ✕ on narrow screens; a compact bottom sheet on phones (2026-10-29) ---------- */
.tr-head { display: none; }
@media (max-width: 1099px) {
  .tr-head {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 2;
    padding: 10px 10px 10px 16px; background: var(--sheet); border-bottom: 1px solid var(--line);
  }
  .tr-head b { flex: 1; min-width: 0; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tr-x { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-size: 18px; }
  .tr-grip { display: none; }
}
@media (max-width: 640px) {
  .tracks {
    top: auto; left: 0; right: 0; bottom: var(--dock-h, 0px); width: 100%; max-height: 62dvh;
    border-radius: 18px 18px 0 0; border-width: 1px 0 0; box-shadow: 0 -12px 34px rgb(0 0 0 / .22);
  }
  .study.closed .tracks { transform: translateY(105%); }
  .tr-head { padding: 16px 10px 8px 16px; border-radius: 18px 18px 0 0; }
  .tr-grip { display: block; position: absolute; top: 6px; left: 50%; width: 44px; height: 4px; margin-left: -22px; border-radius: 4px; background: var(--line); }
  .tracks .note { display: none; }
  .tgroup { padding: 2px 0 4px; }
  .tgroup h3 { font-size: 13px; padding: 8px 16px 2px; }
  .spot-row { padding: 0 6px; }
  .sp-main { grid-template-columns: 30px 1fr auto; gap: 10px; padding: 6px 8px; min-height: 44px; }
  .sp-icon { width: 30px; height: 30px; }
  .sp-icon svg { width: 15px; height: 15px; }
  .sp-text { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
  .sp-text b { display: inline; font-size: 15px; }
  .sp-text small::before { content: "· "; }
}

/* ---------- phones (2026-10-29): swipe turns the page (no ‹ › in the dock); the dock stays in full screen ---------- */
@media (max-width: 640px) {
  .reader-bar [data-go] { display: none; }
  html.focus .reader-bar {
    display: flex; position: fixed; left: 0; right: 0; bottom: var(--dock-h, 0px); z-index: 27;
    background: #1d232b; border-top-color: #333b45; box-shadow: 0 -4px 16px rgb(0 0 0 / .35);
  }
  html.focus .reader-bar .icon-btn, html.focus .reader-bar .pg { color: #fff; }
  html.focus .reader-bar .pg::after { color: #9aa4b0; }
  html.focus .reader-bar [data-full] { font-size: 0; }
  html.focus .reader-bar [data-full]::before { content: "✕"; font-size: 20px; }
  html.focus .reader .full-x, html.focus .reader .full-nav, html.focus .reader .full-voc, html.focus .reader .full-pages { display: none !important; }
  html.focus .sheet-wrap { height: calc(100dvh - var(--dock-h) - 58px); }
  html.focus .spread:not(.zoom) .pg-img img { max-height: calc(100dvh - var(--dock-h) - 58px - 16px); }
  html.focus .reader.strip-open .strip { display: flex; position: fixed; left: 0; right: 0; bottom: calc(var(--dock-h, 0px) + 58px); z-index: 27; background: #1d232b; }
}

/* ---------- page curl (2026-10-29, app.js pageCurl): layers over the spread while a page turns ---------- */
.curl { position: absolute; z-index: 6; pointer-events: none; overflow: hidden; }
.curl > div { position: absolute; inset: 0; }
.curl-base { background: #d9dee3; }
.curl .spread { position: absolute; inset: 0; margin: 0; }
.curl-shade, .curl-flap { position: absolute; transform-origin: 0 50%; }
.curl > .curl-shade { inset: auto; background: linear-gradient(90deg, rgb(0 0 0 / .32), rgb(0 0 0 / 0)); }
.curl-flap-wrap { filter: drop-shadow(-6px 4px 8px rgb(0 0 0 / .28)); }
.curl-flap-clip { position: absolute; inset: 0; }
.curl-flap { background: linear-gradient(90deg, #cfc8bb 0, #ece6dc 14px, #faf7f1 38%, #f1ece3 75%, #e2dbcf 100%); }
@media (max-width: 640px) {
  /* phones: no full-screen button (the screen is already the book); 🏁 opens the unit's word race */
  .reader-bar [data-full] { display: none; }
  html.focus .reader-bar [data-full] { display: flex; }
  .reader-bar .race-btn { display: flex; order: 5; font-size: 19px; text-decoration: none; color: var(--ink); }
}
@media (max-width: 640px) {
  /* phones: the book page edge to edge (the screen is narrow; every pixel of width makes the page taller too) */
  main:has(.reader) { padding-left: 0; padding-right: 0; }
  main:has(.reader) .lesson-head { padding: 0 12px; }
  .reader { border-radius: 0; border-left: 0; border-right: 0; }
  .spread:not(.zoom) { padding: 0; }
  .sheet-wrap { scrollbar-width: none; }
  .sheet-wrap::-webkit-scrollbar { display: none; }
}
.gapgrip {
  display: flex; align-items: center; justify-content: center; align-self: stretch; min-width: 22px; padding: 0 calc(.3 * var(--cq, 7px));
  color: #fff; font: 700 max(16px, calc(1.6 * var(--cq, 7px)))/1 system-ui, sans-serif; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
}
.gapbar.dragging { opacity: .85; } .gapbar.dragging .gapgrip { cursor: grabbing; }

/* ---------- computers and tablets (2026-10-30): the book fits the window, one scroll bar ---------- */
@media (min-width: 641px) {
  /* unit: number, title, unit tabs and SB | WB in one row */
  .lesson-head { flex-wrap: nowrap; gap: 12px; margin-bottom: 10px; }
  .lesson-head .lesson-num { width: 44px; height: 44px; border-radius: 10px; font-size: 24px; }
  .lesson-head .lh-title { flex: 0 1 auto; min-width: 0; }
  .lesson-head .lh-title h1 { font-size: 24px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lesson-head .lh-title p { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lesson-head .lesson-tabs { flex: 0 1 auto; min-width: 0; margin: 0 0 0 auto; padding: 2px 0; }
  .lesson-head .lesson-tabs a { padding: 2px 9px; font-size: 14px; }
  .lesson-head .seg { margin-left: 0; flex: none; }
  /* reader bar: ‹ Page 8–9 › together on the left, the tools on the right */
  .reader-bar > * { order: 5; }
  .reader-bar [data-go="-1"] { order: 1; } .reader-bar .pg { order: 2; margin-right: 0; } .reader-bar [data-go="1"] { order: 3; }
  .reader-bar [data-zoom] { order: 4; margin-left: auto; }
  .reader-bar .panel-btn { margin-left: 0; }
  .reader-bar .pg { border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; min-width: 96px; color: var(--ink); font-weight: 700; }
  .reader-bar .pg::after { content: " ▾"; font-size: 11px; color: var(--ink-2); }
  .reader-bar .pg[aria-expanded="true"]::after { content: " ▴"; }
  .reader-bar .pg:hover { border-color: var(--c); }
  .reader:not(.strip-open) .strip { display: none; }
  /* the sheet takes the rest of the window (app.js fit: --sheet-h, --pw = one page's width) */
  .reader.fit .sheet-wrap { height: var(--sheet-h); max-height: none; min-height: 0; overscroll-behavior: contain; scrollbar-gutter: stable; }
  .reader.fit .spread:not(.zoom):not(.one) { align-items: flex-start; }
  .reader.fit .spread:not(.zoom):not(.one) .pg-img { flex: none; width: var(--pw); max-width: none; }
  main:has(.reader.fit) { padding-bottom: 10px; }
}
@media (min-width: 1100px) {
  .study:has(.reader.fit) .tracks { max-height: var(--reader-h); }
}
/* full screen on a computer: no Words / 2 pages buttons over the page; ✕ and ‹ › fade out while the mouse rests */
html.focus .reader .full-pages, html.focus .reader .full-voc { display: none !important; }
@media (hover: hover) {
  html.focus .reader .full-x, html.focus .reader .full-nav { transition: opacity .3s; }
  html.focus.idle .reader .full-x, html.focus.idle .reader .full-nav { opacity: 0; }
  html.focus.idle .sheet-wrap { cursor: none; }
  html.focus.idle .sheet-wrap img { cursor: none; }
}
/* full screen on a computer (2026-10-31): the toolbar stays on top of the pages (dark); ▴ folds it, ▾ Tools brings it back */
.reader .bar-hide, .reader .full-bar { display: none; }
@media (min-width: 641px) {
  html.focus .reader { display: flex; flex-direction: column; }
  html.focus:not(.bar-off) .reader-bar {
    display: flex; flex: none; height: 52px; padding: 6px 12px; position: relative; z-index: 27;
    background: #1d232b; border-bottom: 1px solid #333b45;
  }
  html.focus .reader-bar .icon-btn, html.focus .reader-bar .pg { color: #e8edf2; background: transparent; border-color: #3a434e; }
  html.focus .reader-bar .icon-btn:hover, html.focus .reader-bar .pg:hover { background: #2a313a; }
  html.focus .reader-bar .icon-btn[aria-pressed="true"] { background: #3a434e; }
  html.focus .reader-bar .pg::after { color: #9aa4b0; }
  html.focus .reader-bar .home-btn, html.focus .reader-bar .panel-btn { display: none; }
  html.focus .reader-bar .bar-hide { display: flex; }
  html.focus .reader-bar [data-full] { font-size: 0; }
  html.focus .reader-bar [data-full]::before { content: "✕"; font-size: 16px; }
  html.focus:not(.bar-off) .sheet-wrap { flex: 1; height: auto; min-height: 0; }
  html.focus:not(.bar-off) .spread:not(.zoom) .pg-img img { max-height: calc(100dvh - var(--dock-h) - 52px - 16px); }
  html.focus:not(.bar-off) .reader .full-x { display: none; }
  html.focus:not(.bar-off) .reader.strip-open .strip {
    display: flex; position: absolute; top: 52px; left: 0; right: 0; z-index: 27; background: #1d232b; box-shadow: 0 8px 20px rgb(0 0 0 / .35);
  }
  html.focus.bar-off .reader .full-bar {
    display: block; position: fixed; top: 0; left: calc((100vw - var(--dock-w)) / 2); transform: translateX(-50%); z-index: 26;
    border: 0; border-radius: 0 0 10px 10px; padding: 5px 14px 6px; font: inherit; font-size: 13px; font-weight: 700;
    color: #fff; background: rgb(20 25 32 / .7); backdrop-filter: blur(4px); cursor: pointer; transition: opacity .3s;
  }
  html.focus.bar-off .reader .full-bar:hover { background: rgb(20 25 32 / .9); }
}
@media (hover: hover) { html.focus.idle .reader .full-bar { opacity: 0; } }
/* full screen, "1 page" on a computer: the page fills the width (scroll down inside to read on) */
@media (min-width: 641px) {
  html.focus .spread.one:not(.zoom), html.focus:not(.bar-off) .spread.one:not(.zoom) { align-items: flex-start; }
  html.focus .spread.one:not(.zoom) .pg-img, html.focus:not(.bar-off) .spread.one:not(.zoom) .pg-img { flex: 1 1 auto; width: 100%; }
  html.focus .spread.one:not(.zoom) .pg-img img, html.focus:not(.bar-off) .spread.one:not(.zoom) .pg-img img { width: 100%; max-width: none; max-height: none; }
}
/* computer (2026-10-31, app.js deskHead): unit tabs in the top bar, Student's Book / Workbook in the reader's tool row */
@media (min-width: 641px) {
  .top:has(.top-unit) .brand { margin-right: 0; flex: none; max-width: 300px; min-width: 0; }
  .top:has(.top-unit) .brand > span:last-child { min-width: 0; }
  .top:has(.top-unit) .brand small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .top-unit { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; margin-right: auto; padding-left: 8px; }
  .top-unit .lesson-tabs { margin: 0; padding: 2px 0; overflow: hidden; min-width: 0; }
  .top-unit .lesson-tabs a { padding: 2px 9px; font-size: 14px; }
  .top-unit.pick .lesson-tabs { display: none; }
  .top-unit.pick .unit-pick { display: block; max-width: 340px; }
  .top-unit .unit-pick select {
    width: 100%; padding: 6px 30px 6px 12px; border-radius: 999px; border: 2px solid var(--c);
    background: var(--sheet); color: var(--ink); font: 700 14px/1.2 inherit; text-overflow: ellipsis;
  }
  .reader-bar .seg { order: 3; flex: none; margin-left: 6px; }
  .reader-bar .seg button { padding: 4px 12px; font-size: 14px; }
  .reader-bar .seg button[disabled] { opacity: .4; cursor: default; }
  html.focus .reader-bar .seg { background: transparent; border-color: #3a434e; }
  html.focus .reader-bar .seg button { color: #9aa4b0; }
  html.focus .reader-bar .seg button[aria-pressed="true"] { background: #3a434e; color: #fff; box-shadow: none; }
}
/* full screen, "2 pages" on a computer: the two pages fill the width too (scroll down inside to read on) */
@media (min-width: 641px) {
  html.focus .spread.two:not(.zoom), html.focus:not(.bar-off) .spread.two:not(.zoom) { align-items: flex-start; }
  html.focus .spread.two:not(.zoom) .pg-img, html.focus:not(.bar-off) .spread.two:not(.zoom) .pg-img { flex: 1 1 0; min-width: 0; width: auto; }
  html.focus .spread.two:not(.zoom) .pg-img img, html.focus:not(.bar-off) .spread.two:not(.zoom) .pg-img img { width: 100%; max-width: none; max-height: none; }
}
