/* The Daily Health Tracker's palette (HealthDiary generate_dashboard.py :root), picked by Maarten
   2026-11-03 from design-options.html: cream page, white cards, one teal accent, neutrals tinted
   toward the teal. --muted is the light grey for small print (the tracker's --tertiary),
   --secondary the darker one (its --muted); --fill is the cream inside white things. */
/* no double-tap zoom on the iPhone (Maarten, 2026-11-04: two quick taps on ⏩ zoomed the page);
   pinch zoom still works. Also makes taps fire without Safari's wait for a second tap */
html { touch-action: manipulation; }

:root {
  --card-scale: 1;   /* the lesson's text size, for the word card (lesson.html setSize) */
  --bg: #FAF7F2;
  --text: #16211F;
  --card: #ffffff;
  --fill: #FAF7F2;
  --border: #e4ded3;
  --border-soft: #efeae0;
  --border-strong: #d4cbbc;
  --muted: #8a908e;
  --secondary: #57605e;
  --accent: #1d9486;
  --accent-hover: #157065;
  --accent-soft: rgba(29,148,134,0.10);
  --ok: #34a853;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 16px rgba(26,26,26,0.04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

.wrap { max-width: 900px; margin: 0 auto; padding: 32px 16px 140px; }

h1 { font-size: 26px; font-weight: 700; margin: 0 0 4px; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 32px; }
a { color: var(--accent); text-decoration: none; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
}

.form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--secondary); }
.field.grow { flex: 1 1 220px; }
input[type=text], input[type=url], select {
  font: inherit; font-size: 16px; color: var(--text);
  padding: 12px 16px; min-height: 48px;
  border: 1px solid var(--border-strong); border-radius: 8px; background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
input[type=file] { font-size: 14px; min-height: 44px; }
textarea {
  font: inherit; font-size: 16px; color: var(--text); padding: 14px 16px; resize: vertical;
  border: 1px solid var(--border-strong); border-radius: 8px; background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
/* focus: a teal border and a soft teal ring instead of the browser's blue outline */
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* the main button: teal gradient (the tracker's switch colours), 8 px corners, lifts on hover */
.btn {
  font: inherit; font-size: 15px; font-weight: 600; letter-spacing: .01em;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover)); color: #fff;
  border: 0; border-radius: 8px;
  padding: 0 22px; min-height: 44px; cursor: pointer;
  transition: background .15s, transform .12s ease, box-shadow .12s ease;
}
.btn:hover:not(:disabled) { background: linear-gradient(90deg, var(--accent-hover), #0f564e);
  transform: translateY(-1px); box-shadow: 0 4px 10px rgba(21,112,101,0.22); }
.btn:disabled { opacity: .5; cursor: default; }

.msg { font-size: 14px; color: var(--secondary); margin-top: 10px; min-height: 21px; }
.msg.err { color: #c62828; }

/* the list: one white card, two lines per lesson — flag · title · ⋯, the meta under the title
   (Maarten, 2026-11-03) */
.lessons { list-style: none; margin: 0; padding: 4px 16px; background: var(--card); border: 1px solid var(--border);
           border-radius: 12px; box-shadow: var(--shadow); }
.lessons:empty { display: none; }
.lessons li {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto; column-gap: 12px; row-gap: 1px; align-items: center;
  padding: 12px 0;
}
.lessons li + li { border-top: 1px solid var(--border-soft); }
/* the whole row opens the lesson, not just the title (Maarten, 2026-11-03); ⋯ opens its menu */
.lessons li { position: relative; }
.lessons li.ready { cursor: pointer; }
.lessons li.ready:hover .lesson-title { color: var(--accent); }
.lessons a.lesson-title::after { content: ""; position: absolute; inset: 0; }
.lessons .row-menu-btn { position: relative; z-index: 1; }
.lessons .meta { grid-column: 2; grid-row: 2; color: var(--muted); font-size: 13px; }
/* flag · title · ⋯ (Maarten, 2026-11-02); the language's name under the flag (2026-11-03) */
.lessons .flag-cell { grid-row: 1 / span 2; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.lessons .flag { font-size: 18px; line-height: 1; }
.lessons .lang-name { font-size: 11px; line-height: 1.1; color: var(--muted); white-space: nowrap; }
/* one line; a title longer than the row (up to 70 characters, Maarten 2026-11-04) ends in … */
.lessons .lesson-title { grid-column: 2; grid-row: 1; min-width: 0; font-weight: 500; color: var(--text);
                         white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lessons .kind-icon { font-size: 14px; margin-right: 2px; }
@media (max-width: 640px) {   /* a phone: the title on up to two lines rather than cut */
  .lessons li { grid-template-columns: 56px minmax(0, 1fr) auto auto; column-gap: 10px; }
  .lessons .lesson-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
.lessons a.lesson-title:hover { color: var(--accent); }
.lessons .row-menu-btn { grid-column: 4; grid-row: 1 / span 2; }
.row-menu-btn {
  flex: none; width: 36px; height: 36px; border-radius: 999px; border: 1px solid transparent; background: none;
  font-size: 20px; line-height: 1; letter-spacing: 1px; color: var(--muted); cursor: pointer;
}
.row-menu-btn:hover { background: var(--fill); border-color: var(--border); color: var(--text); }
/* as wide as Edit / Delete need, not the page menu's 180 px (Maarten, 2026-11-03) */
.topbar-menu.row-menu { position: absolute; right: auto; min-width: 0; width: max-content; }
.row-menu .topbar-menu-item { padding: 9px 14px 9px 10px; }
.topbar-menu-item.danger { color: #c62828; }
/* Audio / YouTube or Text only */
.kind-switch { margin-bottom: 14px; }
textarea { width: 100%; box-sizing: border-box; }
.only-audio[hidden], .only-text[hidden] { display: none; }
.status-ready { color: var(--ok); }
.status-error { color: #c62828; }

/* ── Lesson page ─────────────────────────────────────────── */
.transcript { font-size: 21px; line-height: 1.9; }
/* the text sits in a white card on the cream page (Maarten, 2026-11-03) */
.transcript { background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
              padding: 28px 32px; }
@media (max-width: 640px) { .transcript { padding: 18px 16px; } }
.transcript p { margin: 0 0 30px; }   /* a clear gap between paragraphs (Maarten, 2026-11-01: was 18px) */
.transcript p:last-child { margin-bottom: 0; }
/* note lessons (a text lesson with blank lines): more space between the word / example blocks,
   Maarten 2026-11-07; with Translation on every sentence is its own row already */
.transcript.blocks p { margin-bottom: 52px; }
.transcript.show-tr .line-break { display: none; }
.w {
  /* fixed padding on every word so highlighting never changes layout */
  padding: 1px 2px; border-radius: 4px; cursor: pointer;
}
.w:hover { background: var(--accent-soft); }
.nospace .w { padding: 1px 0; }  /* Chinese/Japanese: no extra gap between characters */
/* the word being spoken: solid teal, white text (Maarten, 2026-11-03) */
.w.active, .w.active:hover, .w.active.info { background: var(--accent); color: #fff; }   /* .info (looked up)
   comes later in this file: without .w.active.info the word went pale with white text while the mouse
   was on its card (Maarten, 2026-11-03) */
.w.active .py, .w.active rt { color: rgba(255,255,255,.85); }

/* the white space around the video inside the card: left, right and above it (Maarten,
   2026-11-03: "quite a bit more", then doubled; then the top halved again); less on a phone */
body { --pad: 64px; }
@media (max-width: 640px) { body { --pad: 32px; } }
/* the video's width: small = 28 % of the window height, big = 50 %, 16:9, never wider than the
   window minus the card's margin, border and --pad (Maarten); the player card is sized from it */
body { --video-w: min(calc(28vh * 16 / 9), calc(100vw - 22px - 2 * var(--pad))); }
body.video-big { --video-w: min(calc(50vh * 16 / 9), calc(100vw - 22px - 2 * var(--pad))); }
@media (max-width: 640px) {  /* phone: small = 60 % of the width, big = the full width */
  body { --video-w: min(calc(28vh * 16 / 9), 60vw); }
  body.video-big { --video-w: calc(100vw - 22px - 2 * var(--pad)); }
}
/* a floating card above the bottom edge (Maarten, 2026-11-03); fitPlayer keeps the text clear of it.
   Only a little wider than the video (2026-11-03), never so narrow that the buttons don't fit one
   row; without a video (audio, or the video hidden) a compact card.
   Glass: the text behind shows through blurred and light grey (64 % white; 72 % was a little
   too faint); under the mouse almost solid (94 %) — Maarten, 2026-11-03 */
body { --player-w: min(calc(100vw - 20px), 480px); }
body.has-video:not(.video-hidden) { --player-w: min(calc(100vw - 20px), max(440px, calc(var(--video-w) + 2 * var(--pad) + 2px))); }
/* Back-translate: the same card; the size icons sit in the white space right of the video
   (Maarten, 2026-11-03: the buttons must not make the edges wider) */
/* Liquid glass (Maarten, 2026-11-03, from an example): a cool grey tint instead of white, a stronger
   blur that also lifts the colours behind, a bright white rim on the top-left edge fading out
   towards the bottom right (::before), a soft inner highlight and a deeper, softer shadow. Under
   the mouse still almost solid, so the buttons read clearly (was rgba(255,255,255,.94)). */
.player {
  position: fixed; left: 0; right: 0; bottom: 10px; width: var(--player-w); margin: 0 auto;
  background: linear-gradient(140deg, rgba(240,242,243,.58), rgba(198,204,207,.52));
  border: 1px solid rgba(40,50,50,.10); border-radius: 18px;   /* a faint dark line: the white rim shows on a white page */
  -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75), inset 0 -1px 0 rgba(0,0,0,.04),
              0 12px 32px rgba(20,30,30,.16), 0 2px 6px rgba(20,30,30,.08);
  transition: background .2s ease;
}
.player::before {   /* the white edge: strong top left, gone bottom right */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 2px; pointer-events: none;
  background: linear-gradient(140deg, rgba(255,255,255,.95), rgba(255,255,255,.35) 35%, rgba(255,255,255,0) 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.player:hover { background: linear-gradient(140deg, rgba(250,250,251,.94), rgba(236,238,240,.92)); }
/* YouTube lessons: the video above the timeline and the buttons */
.yt-wrap { width: var(--video-w); aspect-ratio: 16 / 9; margin: calc(var(--pad) / 2) auto 0; }   /* half the space on top */
.yt-wrap[hidden] { display: none; }
.yt-wrap { position: relative; }
.yt-wrap iframe, .yt-wrap #yt { width: 100%; height: 100%; border: 0; border-radius: 8px; display: block; }
.yt-shield { position: absolute; inset: 0; cursor: pointer; border-radius: 8px; }
.yt-shield.poster { background: #000 var(--poster) center / cover no-repeat; }
/* video size + show/hide (lesson.html); .wrap's bottom padding follows the player (fitPlayer) */
/* hidden keeps the player running (it plays the sound) but out of sight */
.video-hidden .yt-wrap { position: absolute; left: -10000px; width: 480px; }

/* icon buttons: just the icon; a soft teal circle on hover (Maarten, 2026-11-03) */
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid transparent;
  background: transparent; color: var(--secondary); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; padding: 0; flex-shrink: 0;
  transition: background .15s, color .15s;
}
.icon-btn:hover { color: var(--accent-hover); background: var(--accent-soft); }
.icon-btn[hidden] { display: none; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2;
                stroke-linecap: round; stroke-linejoin: round; }
.icon-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
/* size icons sit just outside the video's top-right corner */
.video-size { position: absolute; top: 0; left: calc(100% + 10px); display: flex; flex-direction: column; gap: 8px; }
/* show/hide: camera icon, crossed out when the video is hidden; not "pressed"-filled */
.video-toggle { width: 44px; height: 44px; }
.video-toggle[aria-pressed="true"], .video-toggle[aria-pressed="false"] { background: transparent; color: var(--secondary); border-color: transparent; }
.video-toggle:hover { color: var(--accent-hover); background: var(--accent-soft); }
/* the icon shows what a click will do (Maarten, 2026-11-01): video shown → crossed-out camera */
.video-toggle .ico-on { display: none; }
.video-hidden .video-toggle .ico-off { display: none; }
.video-hidden .video-toggle .ico-on { display: block; }
@media (max-width: 760px) {  /* no room beside the video: the size icons sit above it, right,
                                smaller than on a desktop (Maarten, 2026-11-01) */
  .yt-wrap { margin-top: 44px; }
  .video-size { left: auto; right: 0; top: -38px; flex-direction: row; gap: 6px; }
  .video-size .icon-btn { width: 32px; height: 32px; }
  .video-size .icon-btn svg { width: 16px; height: 16px; }
}
/* playback speed: a pill with the current speed, accent-coloured when not 1× */
.speed-btn {   /* smaller since it sits with the size buttons (Maarten, 2026-11-03) */
  min-width: 44px; height: 34px; padding: 0 8px; border-radius: 999px;
  color: var(--secondary); font: 600 13px system-ui, sans-serif; cursor: pointer; flex-shrink: 0;
  position: relative;
}
.speed-btn::after { content: ""; position: absolute; inset: -5px 0; }   /* 44 px to tap */
.speed-btn:hover { color: var(--accent); }
.speed-btn.changed { color: var(--accent); border-color: var(--accent); }
/* the buttons on top, the timeline and the time below (Maarten, 2026-11-03: the other way round
   before); play always in the middle of the card: three columns, the outer two the same width.
   Speed, video size + show/hide on the right (Maarten, 2026-11-03: not speed alone on the left);
   the play cluster close together */
.player-inner {
  margin: 0 auto; padding: 12px var(--pad) 14px;   /* the timeline lines up with the video */
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 2px;
  container-type: inline-size;
}
.pl-grid { flex: 1 1 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; row-gap: 8px;
           grid-template-areas: "left mid right" "seek seek seek"; }
.pl-mid { grid-area: mid; display: flex; align-items: center; gap: 2px; justify-self: center; }
.pl-right { grid-area: right; display: flex; align-items: center; gap: 2px; }
.pl-seek { grid-area: seek; display: flex; align-items: center; gap: 10px; }
/* in the bar: show/hide a little smaller, so speed + size + show/hide fit beside the play
   cluster of a small video on a desktop */
.pl-right .video-toggle { width: 36px; height: 36px; position: relative; }
.pl-right .video-toggle::after { content: ""; position: absolute; inset: -4px 0; }
/* when the three don't fit beside the play cluster, they reach into the card's white padding
   (at most to 16 px from the edge): the auto margin right-aligns them while there is room and
   lets them run past the timeline's end when there isn't. Widths: play cluster 212, speed 40,
   size 34, show/hide 36, gaps 2, 6 px from the cluster */
.pl-right { justify-content: flex-start; padding-left: 6px; min-width: 0; }   /* overflow: visible */
.pl-right > :first-child { margin-left: auto; }
/* a phone (32 px padding) has less room to reach into: speed goes to the left edge first */
.pl-right { pointer-events: none; }
.pl-right > * { pointer-events: auto; }
@media (max-width: 640px) {
  @container (min-width: 356px) and (max-width: 419.98px) {   /* a video: speed + size + show/hide */
    body.has-video:not(.video-hidden) .pl-right { grid-area: 1 / 1 / 2 / -1; padding-left: 0; }
    body.has-video:not(.video-hidden) .pl-right .speed-btn { margin: 0 auto 0 0; }
  }
  @container (min-width: 292px) and (max-width: 347.98px) {   /* video hidden: speed + show/hide */
    body.has-video.video-hidden .pl-right { grid-area: 1 / 1 / 2 / -1; padding-left: 0; }
    body.has-video.video-hidden .pl-right .speed-btn { margin: 0 auto 0 0; }
  }
}
/* too narrow even for that (a phone): play alone on top, the timeline, then speed left and
   size + show/hide right on a row of their own */
@container (max-width: 355.98px) {
  body.has-video:not(.video-hidden) .pl-grid { grid-template-areas: "mid mid mid" "seek seek seek" "right right right"; }
  body.has-video:not(.video-hidden) .pl-right { padding-left: 0; }
  body.has-video:not(.video-hidden) .pl-right .speed-btn { margin: 0 auto 0 0; }
}
@container (max-width: 291.98px) {
  .pl-grid { grid-template-areas: "mid mid mid" "seek seek seek" "right right right"; }
  .pl-right { padding-left: 0; }
  .pl-right .speed-btn { margin: 0 auto 0 0; }
}
/* play and speed: small glass pills on the glass card, like the chosen button in Maarten's example
   (2026-11-03; play was a solid teal circle): lighter frosted glass, a white rim strongest at the
   top left, a soft inner highlight; the icon in teal */
.play, .speed-btn {
  background: linear-gradient(150deg, rgba(255,255,255,.82), rgba(255,255,255,.38));
  border: 1px solid rgba(255,255,255,.75);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95), inset 0 -1px 1px rgba(20,30,30,.05),
              0 0 0 1px rgba(40,50,50,.07), 0 3px 10px rgba(20,30,30,.12);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background .15s, box-shadow .15s, transform .12s ease;
}
.play {
  flex: 0 0 64px; width: 64px; height: 46px; border-radius: 999px;
  color: var(--accent); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.play:hover, .speed-btn:hover { background: linear-gradient(150deg, rgba(255,255,255,.98), rgba(255,255,255,.6));
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(29,148,134,.25), 0 4px 14px rgba(20,30,30,.16); }
.play:hover { color: var(--accent-hover); }
.play:active { transform: scale(.97); }
.play svg { width: 22px; height: 22px; fill: currentColor; }
.seek { flex: 1 1 auto; accent-color: var(--accent); min-width: 0; }
/* 10 s back / forward: circular arrow with "10" inside */
.skip { width: 44px; height: 44px; }
/* the 10 s jumps right beside the word steps (Maarten, 2026-11-03) */
.skip[data-skip="-10"] { margin-right: -8px; }
.skip[data-skip="10"] { margin-left: -8px; }
.skip svg { width: 26px; height: 26px; }
.skip text { font: 700 7.5px system-ui, sans-serif; fill: currentColor; stroke: none; text-anchor: middle; }
/* one word back / forward: smaller than the jumps, right beside play (2026-11-02) */
.word-step { width: 40px; height: 40px; }   /* bigger (Maarten, 2026-11-03: was 34 / 18) */
.word-step svg { width: 22px; height: 22px; }
.word-step rect { fill: currentColor; fill-opacity: .18; }
.time {
  width: 96px; flex-shrink: 0; text-align: right;
  font-variant-numeric: tabular-nums; font-size: 13px; color: var(--secondary);
}
.state { color: var(--muted); font-size: 16px; }

.lesson-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 24px; }
.lesson-bar .sub { margin: 0; }
.bar-controls { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
/* a choice of two or three: the tracker's view pills — a white capsule, the chosen one soft teal */
.segmented { display: inline-flex; gap: 2px; padding: 4px; background: var(--card); border: 1px solid var(--border);
             border-radius: 999px; }
.segmented[hidden] { display: none; }
.segmented button {
  font: inherit; font-size: 14px; font-weight: 500; min-height: 36px; padding: 0 16px; border-radius: 999px;
  border: 0; background: transparent; color: var(--secondary); cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s;
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-hover); font-weight: 600; }

/* ── Chinese: characters with pinyin underneath ───────────── */
.zh .w { display: inline-flex; flex-direction: column; align-items: center; vertical-align: top; padding: 1px 0; margin-bottom: 8px; }
/* punctuation outside the word (quotes): same two-line layout, never highlighted */
.zh .wp { display: inline-flex; flex-direction: column; align-items: center; vertical-align: top; padding: 1px 0; margin-bottom: 8px; }
.zh .hz { line-height: 1.35; }
/* pinyin a bit bigger (Maarten, 2026-11-01): 17 px at the normal 21 px text, and it follows the
   text-size menu (em); the English translation keeps its own size */
.zh .py { font-size: .81em; line-height: 1.25; color: var(--secondary); }
/* pinyin is written with spaces between units; characters are not */
.zh.mode-both .w, .zh.mode-both .wp.after { margin-right: .4em; }
.zh.mode-both .w.tight, .zh.mode-pinyin .w.tight { margin-right: 0; }   /* 繁华" — the quote sits against the word */
.zh.mode-chars .py { display: none; }
.zh.mode-chars .w { margin-bottom: 0; }
.zh.mode-pinyin .hz { display: none; }
.zh.mode-pinyin .py { font-size: 1em; color: var(--text); line-height: 1.5; }
.zh.mode-pinyin .w { margin-right: .3em; margin-bottom: 0; }
.zh.mode-pinyin .wp.after { margin-right: .3em; }
.zh.mode-pinyin .wp, .zh.mode-chars .wp { margin-bottom: 0; }
/* Greek: the words already have spaces between them, so no margin on top of it; Greek only / the
   romanization only read as normal text */
.zh.el.mode-both .w, .zh.el.mode-both .wp.after, .zh.el.mode-pinyin .w, .zh.el.mode-pinyin .wp.after { margin-right: 0; }
.wc-py { font-size: calc(15px * var(--card-scale)); color: var(--secondary); }
/* on/off: a 44 x 24 teal switch in front of the label (Maarten, 2026-11-03), drawn by the button
   itself — ::before is the track, ::after the knob; the label goes bold when on */
.toggle {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: 14px; font-weight: 500;
  min-height: 44px; padding: 0 6px 0 2px; border-radius: 8px; cursor: pointer;
  background: none; color: var(--secondary); border: 0;
  white-space: nowrap;
}
.toggle::before {
  content: ""; flex: none; width: 44px; height: 24px; border-radius: 999px; background: var(--border);
  transition: background .2s;
}
.toggle::after {
  content: ""; position: absolute; left: 5px; top: 50%; width: 18px; height: 18px; margin-top: -9px;
  border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.25); transition: transform .2s;
}
.toggle:hover::before { background: var(--border-strong); }
.toggle[aria-pressed="true"] { color: var(--text); font-weight: 600; }
.toggle[aria-pressed="true"]::before { background: var(--accent); }
.toggle[aria-pressed="true"]::after { transform: translateX(20px); }

/* sentences flow inline; with translation on, each sentence becomes a block
   with its English line underneath */
.tr { display: none; }
.show-tr .sent { display: block; margin-bottom: 14px; }
/* the English is 15/21 of the text (15 px at 100 %) and grows / shrinks with + / −
   (Maarten, 2026-11-02: it stayed 15 px) */
.show-tr .tr {
  display: block; font-size: calc(15em / 21); line-height: 1.5; color: var(--muted); margin-top: -2px;
}
.w.info { background: rgba(29,148,134,.07); }
/* spelling changed by the name-consistency check (names.py) */
.w.doubt { color: var(--muted-word, #b0b0b0); }
.w.doubt::before { content: '['; }
.w.doubt::after { content: ']'; }
/* Chinese / Japanese / Greek: the word is a column (characters over pinyin), where ::before and ::after
   became rows of their own — [ / 哼 / Hēng / ] on four lines (Maarten, 2026-11-08). There each line
   gets its own brackets: [哼,] over [Hēng,] */
.zh .w.doubt::before, .zh .w.doubt::after { content: none; }
.zh .w.doubt .hz::before, .zh .w.doubt .py::before { content: '['; }
.zh .w.doubt .hz::after, .zh .w.doubt .py::after { content: ']'; }
.w.unified { text-decoration: underline dotted #f5a623; text-decoration-thickness: 2px; text-underline-offset: 4px; }
/* difficult words (marks.py, Maarten 2026-11-05): a word the learner marked waits for its card
   under a yellow marker; in a lesson with cards only for chosen words, the words that have a card
   get the same yellow marker (Maarten, 2026-11-06 — was a teal dotted underline), so the learner
   sees what to hover. A full-card lesson marks nothing: every word has a card there. */
.w.has-card { background: #fff0a3; border-radius: 3px; box-shadow: 0 0 0 2px #fff0a3; }
/* a word still WAITING for its card (marked, or another place of a marked word): white with a gray
   dotted border, so it shows which words have no card yet (Maarten, 2026-11-12 — was the same yellow) */
.w.marked:not(.has-card) { background: #fff; border-radius: 3px; outline: 1.5px dotted #8a908e; outline-offset: 1px; }
/* …but while it is spoken it looks like every other active word, teal with white text (Maarten,
   2026-11-06: the yellow stayed and the text went white on it) */
.w.active.marked, .w.active.has-card { background: var(--accent); border-radius: 4px; box-shadow: none; outline: none; }
.wc-mark { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text);
  font: inherit; font-size: calc(14px * var(--card-scale)); cursor: pointer; }
.wc-mark:hover { background: #fffbe0; border-color: #e6c84a; }
.wc-mark.on { background: #fff0a3; border-color: #e6c84a; }
.wc-waiting { font-size: calc(13px * var(--card-scale)); color: var(--muted); margin: 0 0 8px; }
.word-card.mark-only { width: auto; padding: 8px; }
/* the front page: "N words waiting" under the reader's yellow marker (Maarten, 2026-11-06) */
.lessons .waiting { white-space: nowrap; color: var(--text); font-weight: 500; background: #fff0a3;
  border-radius: 3px; box-shadow: 0 0 0 2px #fff0a3; }
.lessons .learning { white-space: nowrap; }
/* the language level A1–C2 (Maarten, 2026-11-06) */
.level-badge { display: inline-block; padding: 0 6px; border: 1px solid var(--border-strong); border-radius: 5px;
  font-size: 11px; font-weight: 700; line-height: 17px; color: var(--secondary); vertical-align: 1px; }
.edit-row { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-start; margin: 4px 0 14px; }
.edit-row .bt-grades { margin-left: 0; }
.edit-row .bt-grade, .edit-row .bt-grade:hover { cursor: pointer; }
.field-opt { color: var(--muted); }
.wc-unified { font-size: calc(13px * var(--card-scale)); color: #8a5a00; background: #fff6e5; border-radius: 8px; padding: 6px 10px; margin: 4px 0 8px; }

/* ── Word info card ───────────────────────────────────────── */
.word-card {
  position: absolute; z-index: 20; overflow-y: auto;
  width: calc(320px * var(--card-scale)); max-width: calc(100vw - 16px);   /* grows with the text size */
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,.12);
  padding: 14px 16px; font-size: calc(14px * var(--card-scale)); line-height: 1.45;
}
.word-card[hidden] { display: none; }
/* leaving the card: at once 50 %, held for 0.4 s, then out over 0.6 s — 1 s in all (CARD_FADE_MS in
   lesson.html; Maarten 2026-11-07, was 1 s from full); back on it, it is solid at once */
.word-card.fading { animation: card-fade 1s linear forwards; }
@keyframes card-fade { 0%, 40% { opacity: .5; } 100% { opacity: 0; } }
.wc-content.wc-clipped { overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, #000 80%, transparent);
  mask-image: linear-gradient(to bottom, #000 80%, transparent); cursor: pointer; }
.wc-more { display: block; width: 100%; min-height: 44px; margin-top: 2px; border: 0; background: none;
  font: inherit; font-size: calc(14px * var(--card-scale)); font-weight: 600; color: var(--accent); cursor: pointer; text-align: left; padding: 0; }
.wc-more:hover { color: var(--accent-hover); }
.wc-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.wc-word { font-size: calc(18px * var(--card-scale)); font-weight: 700; }
.wc-arrow { color: var(--muted); }
/* 🔊 the base form (lesson word card, 2026-11-04): a small round button in the top line, the
   vocab trainer's sentence 🔊 look; centred on the text line, with a 44 px touch area */
.wc-say { position: relative; align-self: center; width: 30px; height: 30px; padding: 0; flex-shrink: 0;
  border-radius: 999px; border: 1px solid var(--border); background: var(--fill); color: var(--secondary);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background .15s, color .15s; }
.wc-say::after { content: ""; position: absolute; inset: -7px; }
.wc-say:hover, .wc-say.on { background: var(--accent-soft); color: var(--accent-hover); border-color: rgba(29,148,134,.35); }
.wc-say svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.wc-lemma { font-size: calc(16px * var(--card-scale)); font-weight: 600; color: var(--accent); }
.wc-pos {
  margin-left: auto; font-size: calc(11px * var(--card-scale)); text-transform: uppercase; letter-spacing: .04em;
  color: var(--secondary); background: var(--fill); border: 1px solid var(--border); border-radius: 8px; padding: 1px 8px;
}
/* how common the word is (freqMeter): right-aligned, before the word type */
.wc-freq { margin-left: auto; display: inline-flex; align-items: flex-end; gap: 5px; font-size: calc(11px * var(--card-scale)); color: var(--muted); }
.wc-freq + .wc-pos { margin-left: 0; }
/* the HSK 3.0 level (Chinese, hsk.py): a small outlined tag after the frequency, before the word type */
.wc-hsk { margin-left: auto; font-size: calc(11px * var(--card-scale)); color: var(--accent); border: 1px solid rgba(29,148,134,.35);
  border-radius: 8px; padding: 0 6px; white-space: nowrap; }
.wc-freq + .wc-hsk { margin-left: 0; }
.wc-hsk + .wc-pos { margin-left: 0; }
/* add to the vocab trainer: the card's top right corner (Maarten, 2026-11-03); the head line
   keeps clear of it */
.wc-vocab { position: absolute; top: 9px; right: 8px; width: 34px; height: 34px; padding: 0; border-radius: 8px;
  border: 1px solid transparent; background: none; color: var(--secondary); cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; transition: background .15s, color .15s; }
.wc-vocab::after { content: ""; position: absolute; inset: -5px; }   /* a 44 px touch area */
.wc-vocab:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent-hover); }
.wc-vocab svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wc-vocab.in { color: var(--accent); }
.wc-vocab.in .fill { fill: var(--accent); }
.wc-vocab.in .tick { stroke: #fff; stroke-width: 2.2; }
.wc-vocab:disabled { cursor: default; }
.wc-vocab.just svg { animation: vocab-pop .3s ease-out; }
@keyframes vocab-pop { 50% { transform: scale(1.25); } }
.word-card.has-vocab .wc-head:first-of-type { padding-right: 34px; }
/* a part's own bookmark: the top right of its section */
.wc-part.has-vocab, .wc-compound-part.has-vocab { position: relative; }
.wc-part.has-vocab > .wc-head, .wc-compound-part.has-vocab > .wc-head { padding-right: 34px; }
.wc-part > .wc-vocab, .wc-compound-part > .wc-vocab { top: 4px; right: -6px; }
.wc-freq-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.wc-freq-bars span { width: 3px; border-radius: 1px; background: var(--border); }
.wc-freq-bars span:nth-child(1) { height: 3px; }
.wc-freq-bars span:nth-child(2) { height: 5px; }
.wc-freq-bars span:nth-child(3) { height: 7px; }
.wc-freq-bars span:nth-child(4) { height: 9px; }
.wc-freq-bars span:nth-child(5) { height: 11px; }
.wc-freq-bars span.on { background: var(--accent); }
.wc-freq-label { line-height: 1; }
.wc-meaning { font-size: calc(15px * var(--card-scale)); margin-bottom: 4px; }
.wc-form { color: var(--secondary); font-size: calc(13px * var(--card-scale)); }
.wc-here { font-size: calc(13px * var(--card-scale)); color: var(--accent); margin-bottom: 4px; }
/* verb form over several words: its words as the top line (hat … gesehen) */
.wc-group-words { font-size: calc(14px * var(--card-scale)); font-weight: 600; color: var(--muted); }
/* contraction (zum = zu + dem): one section per part, a thick line between them */
.wc-part { margin-top: 10px; }
.wc-part + .wc-part { border-top: 4px solid var(--border-strong); padding-top: 12px; margin-top: 14px; }
.wc-part .wc-head { margin-bottom: 4px; }
.wc-variant { font-size: calc(13px * var(--card-scale)); color: var(--secondary); margin: 2px 0 2px 12px; }
.wc-variant::before { content: "↳ "; color: var(--muted); }
.wc-variant-de { font-weight: 600; color: var(--text, #1a1a1a); }
/* the variant / meaning used in this sentence: yellow text-marker look, also when it wraps */
.wc-variant-here .wc-variant-text, .wc-meaning-here {
  background: #fff176; color: var(--text); border-radius: 3px; padding: 1px 4px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.wc-example { margin-top: 8px; font-size: calc(13px * var(--card-scale)); border-left: 3px solid var(--border); padding-left: 8px; }
.wc-example-de { font-style: italic; }
/* Chinese: never in italics — slanted characters are hard to read (Maarten, 2026-11-01) */
.word-card.zh .wc-example-de { font-style: normal; }
.wc-example-en { color: var(--muted); }
.wc-example-py { color: var(--secondary); font-size: calc(13px * var(--card-scale)); }
.wc-chars { margin-top: 6px; color: var(--secondary); font-size: calc(13px * var(--card-scale)); }
.wc-chars-hz { color: var(--text, #1a1a1a); font-size: calc(15px * var(--card-scale)); }
.wc-chars-py { color: var(--secondary); }
.wc-rel { margin-top: 6px; color: var(--secondary); font-size: calc(13px * var(--card-scale)); }
.wc-rel-sign { font-weight: 600; color: var(--text, #1a1a1a); }
.wc-forms {
  display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-soft);
}
.wc-label { color: var(--muted); font-size: calc(13px * var(--card-scale)); white-space: nowrap; }
.wc-value { font-weight: 600; }
.wc-note { margin-top: 10px; font-size: calc(13px * var(--card-scale)); color: var(--secondary); background: var(--fill); border-radius: 8px; padding: 8px 10px; }
.wc-play {
  margin-top: 12px; width: 100%; min-height: 44px; border: 0; border-radius: 8px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover)); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
.wc-play:hover { background: linear-gradient(90deg, var(--accent-hover), #0f564e); }

/* where another person starts talking (no speaker numbers: Soniox gets WHO wrong too often) */
.turn {
  display: inline-block; width: 3px; height: 0.95em; margin: 0 7px 0 1px; vertical-align: -0.12em;
  border-radius: 2px; background: var(--accent); opacity: .45;
}
/* Speakers off: the plain running text, no line breaks, no bars */
.no-speakers .turn-break, .no-speakers .turn { display: none; }
/* with translations every sentence is on its own line already: one new line is enough */
.show-tr .turn-break { display: none; }
/* … so there Speakers puts a paragraph-sized gap before a sentence where another person starts
   (Maarten, 2026-11-03: before, Speakers did nothing with Translation on) */
.show-tr:not(.no-speakers):not(.bt) .sent:has(> .de > .turn-break) { margin-top: 30px; }
/* what is true only in this sentence (form, Here, the sentence's note): a tinted box after
   the dictionary part, just above the examples */
.wc-sentence { background: var(--accent-soft); border-radius: 8px; padding: 8px 10px; margin: 10px 0 0; }
.wc-sentence-label {
  font-size: calc(11px * var(--card-scale)); text-transform: uppercase; letter-spacing: .04em; color: var(--accent); margin-bottom: 2px;
}
.wc-sentence .wc-form { color: var(--text, #1a1a1a); font-size: calc(14px * var(--card-scale)); }
.wc-sentence .wc-here { margin: 2px 0 0; }
.wc-sentence-note { font-size: calc(13px * var(--card-scale)); color: var(--secondary); margin-top: 4px; }
/* Turkish: the suffix chain, kitab (kitap) = book + ı = the … (object) */
.wc-morph { margin-top: 4px; font-size: calc(13px * var(--card-scale)); color: var(--secondary); line-height: 1.6; }
.wc-morph-piece { color: var(--text, #1a1a1a); font-size: calc(15px * var(--card-scale)); font-weight: 600; }
.wc-morph-base { color: var(--muted); }

/* text size: an icon, the menu drops down under it (lesson.html "Text size") */
.font-menu { position: relative; }
.font-menu > .icon-btn { width: 40px; height: 40px; }
.font-drop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, .08);
}
.font-drop[hidden] { display: none; }
.font-drop .icon-btn { width: 44px; height: 44px; font: 500 22px/1 system-ui, sans-serif; }   /* just − / + (Maarten, 2026-11-02) */
.font-val { min-width: 44px; text-align: center; font-size: 13px; color: var(--secondary); }

/* a German compound's parts, below the word (Straße + n + Interview) */
.wc-compound { border-top: 4px solid var(--border-strong); margin-top: 14px; padding-top: 10px; }
.wc-compound-label { font-size: calc(12px * var(--card-scale)); color: var(--muted); margin-bottom: 6px; }
.wc-compound-part + .wc-compound-part { border-top: 4px solid var(--border-strong); margin-top: 14px; padding-top: 12px; }

/* a word nobody could make out (review: unclear="…") */
.wc-unclear { background: #fff4e5; border-radius: 8px; padding: 8px 10px; margin: 6px 0 10px; }
.wc-unclear-title { font-size: calc(13px * var(--card-scale)); font-weight: 600; color: #a35a00; }
.wc-unclear-text { font-size: calc(13px * var(--card-scale)); color: var(--secondary); margin-top: 2px; }

/* ── Back-translation (lesson.html) ──────────────────────────
   Same layout as Translation on: each sentence a block, its English underneath. The foreign
   line keeps its space but is blank until shown (visibility), so nothing moves when it
   appears; hint words light up where they stand. */
.bt-tools { display: none; }
.bt .sent { display: block; margin-bottom: 14px; }
.bt .sent:not(.has-tr) { display: none; }   /* untranslated sentences are left out */
.bt .turn-break { display: none; }
.bt .sent:not(.revealed) .de { visibility: hidden; }
.bt .sent:not(.revealed) .w.hinted { visibility: visible; color: var(--accent); background: none; cursor: default; }
.bt .tr { display: block; font-size: calc(15em / 21); line-height: 1.5; margin-top: -2px; color: var(--text); }
.bt .sent.revealed .tr { color: var(--muted); }
/* the line worked on (keyboard): a tint that doesn't move anything */
.bt .sent.current { background: var(--fill); box-shadow: 0 0 0 8px var(--fill); border-radius: 2px; }   /* cream on the white text card */
/* the line's buttons: one row of fixed height under the English; before Show: Hint / Show,
   after: Again + the grade. Pills like the rest of the app (Maarten, 2026-11-01) */
.bt-tools, .bt-legend { display: none; }
.bt .bt-tools { display: flex; align-items: center; height: 44px; margin-top: 6px; }
.bt-before, .bt-after { display: flex; align-items: center; gap: 8px; }
.bt .sent:not(.revealed) .bt-after, .bt .sent.revealed .bt-before { display: none; }
.bt-btn {
  font: inherit; font-size: 14px; font-weight: 500; height: 36px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--fill); color: var(--text); cursor: pointer; white-space: nowrap;
  position: relative; transition: background .15s, border-color .15s;
}
.bt-btn::after { content: ""; position: absolute; inset: -4px -2px; }   /* a 44 px touch area */
.bt-btn:hover { background: var(--border-soft); border-color: var(--text); }
.bt-show { background: linear-gradient(90deg, var(--accent), var(--accent-hover)); border-color: transparent; color: #fff; font-weight: 600; }
.bt-show:hover { background: linear-gradient(90deg, var(--accent-hover), #0f564e); border-color: transparent; color: #fff; }
/* how well the sentence is known, by the LAST grade: 5 bars like the word card's frequency,
   green (Maarten, 2026-11-01) */
.bt-meter { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; margin-right: 6px; vertical-align: -1px; }
.bt-meter span { width: 3px; border-radius: 1px; background: var(--border); }
.bt-meter span:nth-child(1) { height: 3px; } .bt-meter span:nth-child(2) { height: 5px; }
.bt-meter span:nth-child(3) { height: 7px; } .bt-meter span:nth-child(4) { height: 9px; }
.bt-meter span:nth-child(5) { height: 11px; }
.bt-meter span.on { background: var(--ok); }
.bt-last { font-size: 13px; line-height: 1.25; color: var(--muted); margin-left: 4px; max-height: 44px; overflow: hidden; }
.bt-grades { display: flex; gap: 6px; margin-left: 6px; }
/* 1 = red … 5 = green, the tracker's rating colours: faded squares, full colour on hover and
   when chosen; the chosen one also gets a ring (Maarten, 2026-11-03) */
.bt-grade.g1 { --g: #d9534f; } .bt-grade.g2 { --g: #f0ad4e; } .bt-grade.g3 { --g: #f5d33c; }
.bt-grade.g4 { --g: #92d05a; } .bt-grade.g5 { --g: #34a853; }
.bt-grade, .bt-grade:hover { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 7px;
  background: var(--g); color: #fff; font-weight: 700; opacity: .35; transition: opacity .12s, box-shadow .12s; }
.bt-grade:hover, .bt-grade[aria-pressed="true"] { opacity: 1; background: var(--g); }
.bt-grade[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--g); }
.bt-on .bt-legend { display: block; font-size: 14px; line-height: 1.5; color: var(--secondary); border: 1px solid var(--border-soft);
                    background: var(--card); border-radius: 10px; padding: 10px 14px; margin: -8px 0 22px; }
@media (max-width: 400px) {   /* a phone: Again + five grades still fit on one row */
  .bt-btn { padding: 0 11px; }
  .bt-grades { gap: 5px; margin-left: 2px; }
}
/* 🎙 Record / ▶ Compare (back-translate after Show, and speak) and speak mode (Maarten,
   2026-11-03): the sentence AND its English show, also sentences without a translation (they
   have the speaker); one row: Listen, Record, Compare, the pronunciation grade, the last one */
.sp-row { display: none; }
.speak .sent:not(.has-tr) { display: block; }
.speak .bt-before, .speak .bt-after { display: none; }
.speak .sp-row { display: flex; align-items: center; gap: 8px; }
.speak .sp-row .bt-grades { margin-left: 2px; }
.sp-listen { background: linear-gradient(90deg, var(--accent), var(--accent-hover)); border-color: transparent; color: #fff; font-weight: 600; }
.sp-listen:hover { background: linear-gradient(90deg, var(--accent-hover), #0f564e); border-color: transparent; color: #fff; }
.rec-btn.recording, .rec-btn.recording:hover { background: #d9534f; border-color: transparent; color: #fff; animation: rec-pulse 1.2s ease-in-out infinite; }
@keyframes rec-pulse { 50% { box-shadow: 0 0 0 4px rgba(217, 83, 79, .25); } }
.sp-last { font-size: 13px; line-height: 1.25; color: var(--muted); margin-left: 4px; max-height: 44px; overflow: hidden; }
.text-only .rec-btn, .text-only .cmp-btn { display: none; }
@media (max-width: 760px) {   /* a phone: the new buttons show only their emoji */
  .ibtn .lbl, .sp-last .last-text { display: none; }
  .ibtn { padding: 0; width: 38px; }
}
@media (max-width: 400px) {   /* Again / Listen, Record, Compare + five grades on one row at 375 px */
  .ibtn { width: 36px; }
  .bt-after, .speak .sp-row { gap: 5px; }
  .bt-after .bt-grades, .speak .sp-row .bt-grades { margin-left: 0; }
  .sp-last { display: none; }   /* no room for the last grade: the meter shows from 401 px */
}
/* the size button is a toggle: only the size that is not active shows (Maarten, 2026-11-01) */
.video-big .video-size [data-size="big"], body:not(.video-big) .video-size [data-size="small"] { display: none; }
.video-size .icon-btn { width: 34px; height: 34px; position: relative; }
.video-size .icon-btn svg { width: 17px; height: 17px; }
.video-size .icon-btn::after { content: ""; position: absolute; inset: -5px; }   /* 44 px to tap */
/* normal reading: in the bar, next to show/hide */
.player-inner .video-size { position: static; flex-direction: row; align-items: center; }
@media (max-width: 760px) { body:not(.bt-on) .yt-wrap { margin-top: calc(var(--pad) / 2); } }   /* no icons above it any more */

/* back-translate: the bar is gone; show/hide + size in one column outside the video's top-right
   corner (on a phone: a row above the video, right). A hidden video: show/hide alone, in the bar.
   A plain audio lesson has no bar at all. */
.bt-on .player-inner > :not(.video-size) { display: none; }
.bt-on .player-inner:not(:has(.video-size)) { display: none; }
.bt-on .player-inner { justify-content: flex-end; padding: 8px var(--pad); }
/* centred in the white space right of the video (the card's half-width minus the video's) */
.bt-on .yt-wrap { --side: calc((var(--player-w) - var(--video-w)) / 2 - 1px); }
.bt-on .yt-wrap .video-size { position: absolute; top: 0; left: calc(100% + (var(--side) - 34px) / 2); right: auto; flex-direction: column; gap: 8px; }
/* back-translate shows only the English: Speakers and Translation do nothing there (Maarten, 2026-11-03) */
.bt-on .icon-toggle { display: none; }
.bt-on .video-size .video-toggle { width: 34px; height: 34px; }
.video-hidden .video-size [data-size] { display: none; }
/* back-translate, video hidden: show/hide alone, centred, with words — the bar has the room */
.video-toggle-label { display: none; }
.bt-on.video-hidden .player-inner { justify-content: center; }
.bt-on.video-hidden .video-size .video-toggle {
  width: auto; height: 40px; padding: 0 16px 0 12px; gap: 8px; border-radius: 999px;
  font: 600 14px system-ui, sans-serif;
}
.bt-on.video-hidden .video-toggle-label { display: inline; }   /* no size without a video (both modes) */
.bt-on:not(.has-video) .player { display: none; }
.bt-on .yt-wrap { margin-top: calc(var(--pad) / 2); margin-bottom: var(--pad); }   /* top: as in normal reading */
@media (max-width: 640px) {   /* phone: small = as in normal reading, the buttons beside it as on a
                                 desktop; big = the whole window width, the buttons in a slim row
                                 above its right end (Maarten, 2026-11-03) */
  .bt-on .yt-wrap { --btn: clamp(28px, calc(var(--side) - 8px), 34px); }   /* as big as the space allows */
  .bt-on .yt-wrap .video-size { left: calc(100% + (var(--side) - var(--btn)) / 2); gap: 6px; }
  .bt-on .video-size .icon-btn, .bt-on .video-size .video-toggle { width: var(--btn); height: var(--btn); }
  .bt-on .video-size .icon-btn svg { width: 15px; height: 15px; }
  .bt-on.video-big .yt-wrap { margin-top: 40px; margin-bottom: 0; }
  /* big = the whole window width (Maarten, 2026-11-01): the card goes edge to edge for it */
  body.bt-on.video-big.has-video:not(.video-hidden) { --player-w: 100vw; }
  .bt-on.video-big .player { bottom: 0; border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; }
  .bt-on.video-big .yt-wrap { width: 100%; margin-left: 0; margin-right: 0; }
  .bt-on.video-big .yt-wrap iframe, .bt-on.video-big .yt-wrap #yt, .bt-on.video-big .yt-shield { border-radius: 0; }
  .bt-on.video-big .yt-wrap .video-size { top: -37px; left: auto; right: 12px; flex-direction: row; }
  .bt-on.video-big .video-size .icon-btn { width: 32px; height: 32px; }
  .bt-on.video-hidden .yt-wrap { width: 480px; }   /* off screen: YouTube stops below 200 px */
}

/* ⋯ menu top-right and the Settings dialog — the Daily Health Tracker's look (2026-11-02) */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar h1 { margin: 0; }
/* InKontext lockup (Maarten, 2026-11-03): a K on the health app's tile, the name as text, both
   Urbanist ExtraBold (served from static/fonts, latin subset) in the health app's ink */
@font-face { font-family: 'Urbanist'; font-weight: 800; font-display: block;
             src: url(/static/fonts/urbanist-latin.woff2) format('woff2'); }
.brand { display: inline-flex; align-items: center; gap: .42em; font-family: 'Urbanist', sans-serif;
         font-weight: 800; font-size: 28px; color: #12262b; letter-spacing: -0.005em; line-height: 1.09; }
.brand-mark { width: 1.55em; height: 1.55em; flex-shrink: 0; border-radius: calc(1.55em * 27 / 120);
              background: linear-gradient(180deg, #1d9486, #052f31); color: #fff;
              display: flex; align-items: center; justify-content: center; font-size: 1em; line-height: 1; }
.topbar .brand { margin-bottom: 6px; }
a.brand, a.brand:hover { text-decoration: none; color: #12262b; }
/* in the sticky headers: the same lockup, smaller (Maarten, 2026-11-03) */
.brand-sm { font-size: 17px; flex: none; }
.topbar-menu-wrap { position: relative; }
.topbar-menu-btn {
  width: 40px; height: 40px; background: var(--card); border: 1px solid var(--border);
  border-radius: 999px; font-size: 22px; line-height: 1; letter-spacing: 2px; cursor: pointer; color: var(--text);
  transition: background .15s, border-color .15s;
}
.topbar-menu-btn:hover { background: var(--fill); border-color: var(--border-strong); }
.topbar-menu {
  position: absolute; top: 48px; right: 0; min-width: 180px; background: var(--card);
  border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,0.10); padding: 6px; z-index: 100;
}
.topbar-menu-item {
  display: block; width: 100%; text-align: left; padding: 10px 12px; background: transparent; border: none;
  font: inherit; font-size: 14px; color: var(--text); cursor: pointer; border-radius: 6px;
}
.topbar-menu-item:hover { background: var(--fill); }
a.topbar-menu-item { text-decoration: none; box-sizing: border-box; }
.topbar-menu-item[hidden] { display: none; }
.topbar-menu-emoji { display: inline-block; font-size: 0.85em; width: 1.15em; text-align: center; margin-right: 2px; }
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,0.35); display: flex; align-items: flex-start;
              justify-content: center; padding: 80px 16px 16px; z-index: 200; animation: modal-fade-in .15s ease-out; }
.modal-back[hidden] { display: none; }
.modal { background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 12px 48px rgba(0,0,0,0.25);
         padding: 28px 32px 24px; width: 100%; max-width: 480px; animation: modal-pop-in .18s ease-out; }
@keyframes modal-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-pop-in { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) { .modal { padding: 20px 16px 18px; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head h2 { margin: 0; font-size: 20px; }
.modal h3 { font-size: 15px; margin: 18px 0 2px; }
.modal-sub { color: var(--muted); font-size: 13px; margin: 4px 0 10px; }
.modal-x { border: none; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); }
.modal-x:hover { color: var(--text); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0;
               border-top: 1px solid var(--border-soft); }
.setting-label { font-size: 14px; font-weight: 600; }
.setting-row select { min-height: 40px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border-strong); font: inherit; background: var(--fill); }

/* a word another variety doesn't use, or uses very differently (coger, vosotros) — 2026-11-02 */
.wc-region { display: flex; gap: 8px; align-items: flex-start; font-size: calc(13px * var(--card-scale)); color: #7a5200;
             background: #fff6e5; border-radius: 8px; padding: 7px 10px; margin: 8px 0 6px; line-height: 1.4; }
.wc-region-icon { flex: none; }

/* ── Sticky header (lesson page only) — the Daily Health Tracker's .sticky-summary (Maarten,
   2026-11-03): white, a hairline and a shadow; it slides in once the title and its controls
   have scrolled away. Its controls are a copy of the real ones (lesson.html). ── */
.sticky-head {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  background: var(--card); border-bottom: 1px solid var(--border-soft); box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  transform: translateY(-100%); opacity: 0; pointer-events: none; transition: transform .22s ease, opacity .22s ease;
}
.sticky-head.visible { transform: none; opacity: 1; pointer-events: auto; }
.sticky-inner { max-width: 900px; margin: 0 auto; padding: 6px 16px; display: flex; align-items: center; gap: 10px; }
.sticky-back {
  flex: none; width: 36px; height: 36px; border-radius: 999px; display: inline-flex; align-items: center;
  justify-content: center; font-size: 18px; color: var(--accent);
}
.sticky-back:hover { background: var(--accent-soft); }
.sticky-title { flex: 1 1 0; min-width: 0; font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* one row; on a phone it scrolls sideways (the tracker's header does the same) */
.sticky-ctrl { margin-left: auto; flex: 0 1 auto; display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; min-width: 0;
               overflow-x: auto; scrollbar-width: none; }
.sticky-ctrl::-webkit-scrollbar { display: none; }
.sticky-ctrl > * { flex: none; }
.sticky-ctrl .segmented { padding: 3px; }
.sticky-ctrl .segmented button { min-height: 30px; padding: 0 12px; font-size: 13px; }
.sticky-ctrl .toggle { font-size: 13px; }
.sticky-drop { position: fixed; z-index: 31; }
@media (max-width: 640px) { .sticky-title { display: none; } .sticky-ctrl { margin-left: 0; } }
/* the global ⋯ at the right end of a sticky header, a little smaller than the page's */
.sticky-inner > .topbar-menu-wrap { margin-left: auto; flex: none; }
.sticky-inner .topbar-menu-btn { width: 36px; height: 36px; font-size: 20px; }
.sticky-inner .topbar-menu { top: 44px; }
.sticky-inner { min-height: 48px; }
/* a phone, lesson page: the K alone, so the controls keep their room */
@media (max-width: 640px) { .sticky-inner .brand-word { display: none; } }

/* ── Jump-to-top capsule — the tracker's .fab-capsule: slim teal, ↑ top / ◎ the word being
   spoken, 60 % see-through until the mouse is on it; just outside the text column, above the
   player (fitPlayer sets --player-h) ── */
.fab-capsule {
  position: fixed; right: max(12px, calc(50vw - 450px - 50px)); bottom: calc(var(--player-h, 0px) + 22px); z-index: 25;
  width: 34px; border-radius: 17px; background: var(--accent); padding: 4px 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: 0 6px 16px rgba(0,0,0,0.18);
  opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .2s ease, transform .2s ease;
}
.fab-capsule.visible { opacity: .6; pointer-events: auto; transform: none; }
.fab-capsule.visible:hover { opacity: 1; }
.fab-half {
  position: relative; width: 26px; height: 26px; border-radius: 50%; background: none; color: #fff; border: none;
  font: 700 14px/1 system-ui, sans-serif; display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer;
}
.fab-half::after { content: ""; position: absolute; inset: -6px -4px; }   /* a bigger touch area */
.fab-half:hover { background: rgba(255,255,255,.18); }
.fab-divider { width: 16px; height: 1px; background: rgba(255,255,255,.25); }
/* nothing has been spoken yet: only ↑ */
.fab-capsule.no-word .fab-divider, .fab-capsule.no-word [data-act="now"] { display: none; }

/* Speakers / Translation: an icon + label; on = soft teal with a teal edge. The weight never
   changes, so nothing beside it moves (Maarten, 2026-11-03). The sticky header: the icon only */
.icon-toggle {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 13px 0 10px;
  border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--secondary);
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-toggle svg { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2;
                   stroke-linecap: round; stroke-linejoin: round; }
.icon-toggle:hover { background: var(--accent-soft); color: var(--accent-hover); }
.icon-toggle[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-hover); border-color: rgba(29,148,134,.35); }
.icon-toggle[aria-pressed="true"]:hover { background: rgba(29,148,134,.16); }
.sticky-ctrl .icon-toggle { width: 36px; min-height: 36px; padding: 0; justify-content: center; }
/* too narrow for the labels (fitBarLabels): the icon alone, as in the sticky header */
.bar-controls.compact .icon-toggle { width: 40px; padding: 0; justify-content: center; }
.bar-controls.compact .icon-toggle .lbl { display: none; }
.sticky-ctrl .icon-toggle .lbl { display: none; }
/* Exit Back-translate / Speak: the second button's look (cream, the border turns ink on hover) */
.mode-exit { display: none; }
.bt-on .mode-exit {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px 0 10px;
  border-radius: 8px; border: 1px solid var(--border-strong); background: var(--fill); color: var(--text);
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: border-color .15s;
}
.bt-on .mode-exit:hover { border-color: var(--text); }
.mode-exit svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.bt-on .sticky-ctrl .mode-exit { min-height: 34px; font-size: 13px; }

/* the lesson's ⋯ menu, at the right end of the controls; Back-translate gets a ✓ when on */
.lesson-menu-wrap { position: relative; }
/* Modes: a pill like Speakers / Translation, with a hairline so it reads as a button at rest
   (Maarten, 2026-11-03: a pill called Modes, not a second ⋯); teal while a mode is on */
.lesson-menu-btn {
  display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 10px 0 14px;
  border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--secondary);
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.lesson-menu-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2;
                       stroke-linecap: round; stroke-linejoin: round; }
.lesson-menu-btn:hover, .lesson-menu-btn[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent-hover); }
.bt-on .lesson-menu-btn { background: var(--accent-soft); color: var(--accent-hover); border-color: rgba(29,148,134,.35); }
.sticky-ctrl .lesson-menu-btn { min-height: 36px; font-size: 13px; padding: 0 8px 0 12px; }
.lesson-menu { right: 0; top: 46px; min-width: 200px; }
.lesson-menu .topbar-menu-item { display: flex; align-items: center; gap: 4px; }
.lesson-menu .topbar-menu-item[aria-pressed="true"]::after { content: "✓"; margin-left: auto; padding-left: 12px; color: var(--accent); font-weight: 700; }
.sticky-drop.lesson-menu { right: auto; }

/* where there is room beside the player card, the capsule sits at its right, bottom-aligned, 24 px
   away (Maarten, 2026-11-03: not above the video); narrower, it stays above the card. The card's
   width depends on the video, so fitPlayer measures it and sets .fab-beside / --fab-right */
.fab-beside .fab-capsule { right: var(--fab-right); bottom: 10px; }

/* ── Front page (Maarten, 2026-11-03): + Add lesson, the vocab trainer, filter / sort, Load more ── */
.home-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.home-actions + .msg { margin: 8px 0 18px; }
/* the second button: cream with a border, as the tracker's Cancel */
.btn-secondary {
  font: inherit; font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--fill); color: var(--text); cursor: pointer; transition: background .15s, border-color .15s;
}
.btn-secondary:hover { background: var(--border-soft); border-color: var(--text); }
.btn-secondary[hidden], .btn[hidden] { display: none; }   /* "Load -6 more" showed: display beat [hidden] */
a.btn-secondary, a.btn-secondary:hover { text-decoration: none; color: var(--text); }
.btn-danger { background: linear-gradient(90deg, #d9534f, #c62828); }
.btn-danger:hover:not(:disabled) { background: linear-gradient(90deg, #c62828, #a31f1f); box-shadow: 0 4px 10px rgba(198,40,40,0.22); }
.vocab-due { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--accent); color: #fff;
             font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.vocab-due:empty, .vocab-due[hidden] { display: none; }
/* filter + sort (Maarten, 2026-11-04): first only "Filter" — the icon and the word, no pill (as on
   Airbnb); a click swaps it for the three menus. The row is one button high either way, so the
   list never moves. The menus look like the Vocab trainer button: 8 px corners, an emoji first */
.list-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 12px; min-height: 44px; }
.list-tools .filter-open { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px;
  font: inherit; font-size: 15px; font-weight: 600; color: var(--text); background: none; border: 0; cursor: pointer; }
.list-tools .filter-open svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.list-tools .filter-open:hover { color: var(--accent); }
.list-tools:not(.open) .tool-sel { display: none; }
.list-tools.open .filter-open { display: none; }
.tool-sel { position: relative; display: inline-flex; }
.tool-sel .tool-emoji { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; font-size: 15px; }
.list-tools select {
  -webkit-appearance: none; appearance: none; min-height: 44px; padding: 0 38px 0 20px;
  font: inherit; font-size: 15px; font-weight: 600; color: var(--text); cursor: pointer;
  border-radius: 8px; border: 1px solid var(--border-strong); background-color: var(--fill);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23555' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 11px 8px;
  transition: background-color .15s, border-color .15s;
}
.list-tools select:hover { background-color: var(--border-soft); border-color: var(--text); }
.tool-sel.has-emoji select { padding-left: 40px; }
.list-count { margin-left: auto; font-size: 13px; color: var(--muted); }
.list-empty { color: var(--muted); font-size: 14px; text-align: center; padding: 24px 0; }
.load-more-row { display: flex; justify-content: center; margin-top: 16px; }
@media (max-width: 640px) {
  .list-tools .tool-sel { flex: 1 1 150px; }
  .list-tools .tool-sel:first-of-type { flex-basis: 100%; }   /* "All languages (n)" needs the row */
  .list-tools select { width: 100%; }
  .list-count { width: 100%; margin-left: 0; }
}

/* ── Dialog buttons and the step-by-step Add lesson (the tracker's "Add to meal" choices) ── */
.modal-foot[hidden] { display: none; }
.modal-foot { display: flex; justify-content: flex-end; gap: 12px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border-soft); }
.modal-foot .btn, .modal-foot .btn-secondary { min-height: 48px; padding: 0 26px; font-size: 16px; }
.wizard .modal-foot { justify-content: space-between; }
.modal.wizard { max-width: 600px; }
.modal.wide { max-width: 760px; }
.modal-small { max-width: 420px; }
.del-text { font-size: 15px; margin: 14px 0 4px; overflow-wrap: anywhere; }
.wiz-step { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.wiz-q { font-size: 16px; font-weight: 600; margin: 16px 0 14px; }
.choice-grid { display: grid; gap: 12px; }
.choice-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice {
  font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 10px 14px; min-height: 96px; cursor: pointer; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px; text-align: center; transition: border-color .15s, background .15s, transform .12s ease, box-shadow .12s ease;
}
.choice:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); box-shadow: var(--shadow); }
.choice[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.choice-emoji { font-size: 36px; line-height: 1.1; }
.choice-name { font-size: 15px; font-weight: 700; }
/* the languages: a little bigger and lighter (Maarten, 2026-11-03) */
#lang-choices .choice-name { font-size: 17px; font-weight: 600; }
.choice-desc { font-size: 13px; color: var(--secondary); line-height: 1.35; }
.kinds .choice { min-height: 150px; padding: 20px 12px; }
.kinds .choice-emoji { font-size: 40px; margin-bottom: 4px; }
.wizard section .field { margin-top: 16px; }
.wizard input[type=url], .wizard input[type=text] { width: 100%; }
.drop-zone {
  margin-top: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 170px; border: 2px dashed var(--border-strong); border-radius: 14px; background: var(--fill); cursor: pointer;
  text-align: center; padding: 16px; transition: border-color .15s, background .15s;
}
.drop-zone:hover, .drop-zone.over { border-color: var(--accent); background: var(--accent-soft); }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.drop-name { font-weight: 700; overflow-wrap: anywhere; }
.title-count { font-size: 12px; color: var(--muted); text-align: right; margin: 4px 0 0; }
@media (max-width: 480px) {
  .choice-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choice-grid.kinds { grid-template-columns: 1fr; }
  .kinds .choice { min-height: 0; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 14px 16px; text-align: left; flex-wrap: wrap; }
  .kinds .choice-emoji { font-size: 30px; margin: 0; }
  .kinds .choice-desc { width: 100%; padding-left: 42px; margin-top: -8px; }
  .modal-foot .btn, .modal-foot .btn-secondary { padding: 0 18px; }
}
.modal-back { overflow-y: auto; }

/* ── Vocab trainer (vocab.html, Maarten 2026-11-03) ── */
.vocab-langs { list-style: none; margin: 0; padding: 4px 16px; background: var(--card); border: 1px solid var(--border);
               border-radius: 12px; box-shadow: var(--shadow); }
.vocab-langs:empty { display: none; }
.vocab-langs li + li { border-top: 1px solid var(--border-soft); }
/* flag · Study / count · new–learning–review towards the middle · ⋯ at the right end (Maarten,
   2026-11-03); the whole row is the link (its ::after), ⋯ sits above it */
.vocab-langs li { position: relative; display: grid; grid-template-columns: 84px minmax(0, 1fr) minmax(0, 1fr) 40px;
                  column-gap: 14px; align-items: center; padding: 14px 0; }
.vocab-langs a.vl-main { color: var(--text); text-decoration: none; }
.vocab-langs a.vl-main::after { content: ""; position: absolute; inset: 0; }
.vocab-langs .vc-n { justify-self: start; }
.vocab-langs .row-menu-btn { position: relative; z-index: 1; }
.vocab-langs .flag-cell { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.vocab-langs .flag { font-size: 26px; line-height: 1; }
.vocab-langs .lang-name { font-size: 14px; font-weight: 600; color: var(--secondary); }   /* bigger (Maarten, 2026-11-03) */
/* words due: a "Study N words" button where the count was (Maarten, 2026-11-03) */
.vl-main { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.vl-study { display: inline-flex; align-items: center; min-height: 40px; font-size: 15px; }
.vocab-langs li:hover .vl-study { background: linear-gradient(90deg, var(--accent-hover), #0f564e); }
.vl-due { font-weight: 600; }
.vl-total { font-size: 13px; color: var(--muted); }
.vocab-langs li:hover .vl-due { color: var(--accent); }
.vocab-empty p { margin: 0; color: var(--secondary); }
/* Anki's colours: new blue, learning red, to review green; the kind of the card on screen underlined */
.vc-n { display: inline-flex; gap: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.vc-n > span { padding-bottom: 1px; border-bottom: 2px solid transparent; }
.vc-n .now { border-bottom-color: currentColor; }
.vc-n small { font-size: 11px; font-weight: 500; margin-left: 3px; }
.n-new { color: #2f6fd6; } .n-learn { color: #c62828; } .n-review { color: #2e8b3e; }
.study-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 18px; }
.study-bar h1 { margin: 0; }
.vc-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
           padding: 30px 32px 22px; text-align: center; }
/* ⋯ in the card's top-right corner: small, out of the way (Maarten, 2026-11-04) */
.vc-card { position: relative; }
.vc-card-menu-btn { position: absolute; top: 10px; right: 10px; }
.vc-word { font-size: 34px; font-weight: 700; line-height: 1.25; min-height: 1.25em; }
.vc-lemma { display: none; color: var(--accent-hover); }
.vc-card.revealed .vc-q { display: none; }
.vc-card.revealed .vc-lemma { display: inline; }
/* the pinyin under a Chinese word, only with the answer (Maarten, 2026-11-12) */
.vc-lemma-py { display: none; font-size: 17px; color: var(--muted); margin-top: 2px; }
.vc-card.revealed .vc-lemma-py:not(:empty) { display: block; }
/* 🔊 for the word: after Show answer, beside it, the sentence 🔊's look (Maarten, 2026-11-04) */
.vc-word-play { margin-left: 12px; vertical-align: middle; position: relative; top: -3px; }
.vc-word-play[hidden], .vc-card:not(.revealed) .vc-word-play { display: none; }
.vc-q { color: #c9ccca; letter-spacing: .08em; }   /* lighter (Maarten, 2026-11-03) */
.vc-meaning { font-size: 17px; color: var(--secondary); margin: 6px 0 4px; }
.vc-context { border-top: 1px solid var(--border-soft); margin-top: 20px; padding-top: 18px; }
.vc-en { font-size: 16px; color: var(--secondary); line-height: 1.5; }
.vc-fl { font-size: 20px; line-height: 1.6; margin-top: 8px; }
.vc-py { font-size: 14px; color: var(--muted); margin-top: 2px; }
.vc-src { display: inline-block; margin-top: 10px; font-size: 12px; color: var(--muted); }
.vc-src:hover { color: var(--accent); }
/* the gap: the word itself, invisible, under ??? — exactly its width, so showing it moves nothing */
.gap { position: relative; display: inline-block; min-width: 2.4em; text-align: center; line-height: 1.2;
       border-bottom: 2px solid var(--accent); }
.gap-word { visibility: hidden; }
.gap-q { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; color: var(--accent); letter-spacing: .05em; }
.vc-card.revealed .gap-word { visibility: visible; color: var(--accent-hover); }
.vc-card.revealed .gap-q { visibility: hidden; }
.vc-actions { margin-top: 26px; min-height: 84px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.vc-show { min-height: 52px; padding: 0 40px; font-size: 16px; }
.vc-show[hidden], .vc-grades[hidden] { display: none; }
/* the five grades: back-translate's colour squares, the meaning and the next interval under each */
/* close together, not touching (Maarten, 2026-11-03) */
.vc-grades { display: flex; justify-content: center; gap: 4px; }
.vc-grade { width: 66px; }
.vc-grade.g1 { --g: #d9534f; } .vc-grade.g2 { --g: #f0ad4e; } .vc-grade.g3 { --g: #f5d33c; }
.vc-grade.g4 { --g: #92d05a; } .vc-grade.g5 { --g: #34a853; }
.vc-grade { font: inherit; border: 0; background: none; padding: 0; cursor: pointer; display: flex; flex-direction: column;
            align-items: center; gap: 3px; color: var(--text); }
.vc-grade-n { width: 48px; height: 48px; border-radius: 9px; background: var(--g); color: #fff; font-weight: 700; font-size: 17px;
              display: flex; align-items: center; justify-content: center; opacity: .85; transition: opacity .12s, transform .12s; }
.vc-grade:hover .vc-grade-n { opacity: 1; transform: translateY(-1px); }
.vc-grade-label { font-size: 13px; font-weight: 600; line-height: 1.2; }
.vc-grade-ivl { font-size: 12px; color: var(--muted); line-height: 1.2; white-space: nowrap; }
.vc-grade:disabled { cursor: default; opacity: .6; }
.vc-keys { font-size: 12px; color: var(--muted); margin: 0; }
@media (hover: none), (max-width: 640px) { .vc-keys { display: none; } }   /* no keyboard on a phone */
/* the sentence with 🔊 and Show in context on its right, once the answer shows */
.vc-fl-row { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.vc-fl-row .vc-fl { margin-top: 0; }
/* laid out from the start, shown on Show answer: the sentence never moves */
.vc-tools { display: inline-flex; visibility: hidden; align-items: center; gap: 4px; min-width: 36px; }
.vc-card.revealed .vc-tools { visibility: visible; }
.vc-tool { font: inherit; font-size: 13px; font-weight: 600; height: 36px; min-width: 36px; padding: 0 9px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--fill); color: var(--secondary); cursor: pointer; display: inline-flex;
  align-items: center; gap: 6px; position: relative; transition: background .15s, color .15s, border-color .15s; }
.vc-tool::after { content: ""; position: absolute; inset: -4px; }
.vc-tool:hover, .vc-tool.on { background: var(--accent-soft); color: var(--accent-hover); border-color: rgba(29,148,134,.35); }
.vc-tool svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.vc-play { padding: 0; width: 36px; justify-content: center; }
@media (max-width: 640px) { .vc-open span { display: none; } .vc-open { padding: 0; width: 36px; justify-content: center; } }
/* the word's card under the grades: as in the lesson, its first lines fading out until clicked */
.vc-info { margin-top: 40px; text-align: left; border-top: 1px solid var(--border-soft); padding-top: 18px; }
.vc-info[hidden] { display: none; }
.vc-wordcard { font-size: 14px; line-height: 1.45; max-width: 520px; margin: 0 auto; }
.vc-wordcard.clipped { max-height: 92px; overflow: hidden; cursor: pointer;
  -webkit-mask-image: linear-gradient(to bottom, #000 35%, transparent); mask-image: linear-gradient(to bottom, #000 35%, transparent); }
.vc-info .wc-more { max-width: 520px; margin: 0 auto; display: block; }
.ctx-modal { max-width: 920px; padding: 18px 20px 12px; }
.ctx-modal iframe { display: block; width: 100%; height: min(76vh, 720px); border: 0; margin-top: 10px; border-radius: 10px; background: var(--bg); }
.modal-back:has(.ctx-modal) { padding-top: 32px; }
.vc-done { text-align: center; }
.vc-done-big { font-size: 22px; font-weight: 700; }
@media (max-width: 640px) {
  .vc-card { padding: 22px 16px 18px; }
  .vc-word { font-size: 28px; }
  .vc-fl { font-size: 18px; }
  .vc-grades { gap: 3px; }
  .vc-grade { width: 58px; }
  .vc-grade-n { width: 44px; height: 44px; }
  .vc-keys { display: none; }
  .vocab-langs li { grid-template-columns: 72px minmax(0, 1fr) 40px; row-gap: 8px; }
  .vocab-langs .flag-cell { grid-row: 1 / span 2; }
  .vocab-langs .row-menu-btn { grid-column: 3; grid-row: 1 / span 2; }
  .vocab-langs .vc-n { grid-column: 2; grid-row: 2; }
}

/* ── The lesson's sticky header: the player's liquid glass (Maarten, 2026-11-03; dark grey before
   that the same day) — the same grey tint, blur and white edge, dark text. The title stays
   further from the logo and lighter. ── */
.sticky-glass {
  background: linear-gradient(170deg, rgba(240,242,243,.58), rgba(198,204,207,.52));
  -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%);
  border-bottom: 1px solid rgba(40,50,50,.10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75), inset 0 -1px 0 rgba(255,255,255,.45),
              0 8px 24px rgba(20,30,30,.12), 0 1px 4px rgba(20,30,30,.06);
}
.sticky-glass::before {   /* the white edge along the top, strongest on the left */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, rgba(255,255,255,.95), rgba(255,255,255,.4) 45%, rgba(255,255,255,.15));
}
.sticky-glass .sticky-title { margin-left: 18px; font-weight: 500; }
.sticky-glass .topbar-menu-btn, .sticky-glass .lesson-menu-btn { background: rgba(255,255,255,.45); border-color: rgba(255,255,255,.7); }
.sticky-glass .topbar-menu-btn:hover, .sticky-glass .lesson-menu-btn:hover { background: rgba(255,255,255,.8); }
.sticky-glass .segmented { background: rgba(255,255,255,.45); border-color: rgba(255,255,255,.7); }
.wc-part + .wc-part > .wc-vocab, .wc-compound-part + .wc-compound-part > .wc-vocab { top: 14px; }

/* the vocab trainer's Show in context (lesson.html ?embed): just the paragraph, its player and
   the word cards — no header, title, modes or jump capsule (Maarten, 2026-11-03) */
body.embed .wrap { padding-top: 16px; }
body.embed .topbar, body.embed .wrap > .sub, body.embed #title, body.embed #info, body.embed #difficulty, body.embed .lesson-menu-wrap,
body.embed .sticky-head, body.embed .fab-capsule { display: none !important; }
body.embed .lesson-bar { margin-bottom: 12px; }
.open-lesson { display: none; }
body.embed .open-lesson { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--fill); color: var(--text); font-size: 14px; font-weight: 600; }
body.embed .open-lesson:hover { border-color: var(--text); }
.open-lesson svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.focus-sent .de { background: rgba(245,211,60,.28); box-shadow: 0 0 0 3px rgba(245,211,60,.28); border-radius: 3px; }
/* the trainer: the scrollbar's room is kept, so a card that grows on Show answer doesn't shift sideways */
html:has(.vocab-wrap) { scrollbar-gutter: stable; }
@media (max-width: 640px) {
  .vc-grade-label { font-size: 12px; white-space: nowrap; }
  .ctx-modal { padding: 12px 10px 8px; }
  .ctx-modal iframe { height: 80vh; }
  .modal-back:has(.ctx-modal) { padding: 12px 8px; }
}

/* More sentences: only once the answer shows (Maarten, 2026-11-03); laid out from the start so
   showing it moves nothing */
.vc-more { text-align: center; }
.vc-more-btn { margin-top: 10px; visibility: hidden; font: inherit; font-size: 14px; font-weight: 600; color: var(--accent);
  background: none; border: 0; cursor: pointer; min-height: 44px; padding: 0 8px; }
.vc-more-btn:hover { color: var(--accent-hover); }
.vc-card.revealed .vc-more-btn { visibility: visible; }
.vc-card:not(.revealed) .vc-more-list { display: none; }
.vc-more-list[hidden] { display: none; }
.vc-more-list .vc-context { margin-top: 14px; padding-top: 14px; }
.vc-more-list .vc-fl { font-size: 18px; }

/* the trainer's database: one language's words A–Z (Maarten, 2026-11-03) */
.db-modal { max-width: 760px; }
.db-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0 8px; }
.db-tools select, .db-per select { min-height: 40px; padding: 6px 30px 6px 12px; font-size: 14px; border-radius: 999px; }
.db-count { margin-left: auto; font-size: 13px; color: var(--muted); }
.db-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.db-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
               padding: 8px 8px; border-bottom: 1px solid var(--border); }
.db-table td { padding: 8px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.db-word { font-weight: 600; white-space: nowrap; }
.db-en { color: var(--secondary); }
.db-del-cell { width: 1%; text-align: right; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.db-phase { display: inline-block; white-space: nowrap; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px;
            background: color-mix(in srgb, var(--p) 22%, #fff); color: color-mix(in srgb, var(--p) 70%, #000); }
.db-phase.p1 { --p: #9aa3a1; } .db-phase.p2 { --p: #d9534f; } .db-phase.p3 { --p: #f0ad4e; }
.db-phase.p4 { --p: #d4b41c; } .db-phase.p5 { --p: #79b843; } .db-phase.p6 { --p: #34a853; }
.db-del { height: 34px; min-width: 34px; padding: 0 6px; border-radius: 8px; border: 1px solid transparent; background: none;
          color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font: inherit;
          font-size: 13px; font-weight: 600; position: relative; }
.db-del::after { content: ""; position: absolute; inset: -5px; }
.db-del:hover { color: #c62828; background: #fdecea; }
.db-del svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.db-del.sure { background: #c62828; color: #fff; padding: 0 12px; }
.db-empty { color: var(--muted); text-align: center; padding: 18px 0; }
.db-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.db-per { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--secondary); }
.db-pages { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--secondary); }
.db-pages .icon-btn { font-size: 22px; }
.db-pages .icon-btn:disabled { opacity: .35; cursor: default; background: none; }
@media (max-width: 640px) {
  .db-table { font-size: 14px; }
  .db-table th:nth-child(3), .db-table td:nth-child(3) { padding-left: 4px; padding-right: 4px; }
  .db-word { white-space: normal; }
}

/* Back-translate: the sentence into the vocab trainer, after the grades (Maarten, 2026-11-03) */
.bt-vocab { width: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; margin-left: 6px;
            background: none; border-color: transparent; color: var(--secondary); }
.bt-vocab:hover:not(:disabled) { background: var(--accent-soft); border-color: transparent; color: var(--accent-hover); }
.bt-vocab svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bt-vocab.in { color: var(--accent); cursor: default; }
.bt-vocab.in .fill { fill: var(--accent); }
.bt-vocab.in .tick { stroke: #fff; stroke-width: 2.2; }
.bt-vocab.just svg { animation: vocab-pop .3s ease-out; }
/* a phone (Maarten, 2026-11-03): Again, Record, Compare, five grades and the bookmark on one row —
   the buttons of that row a little narrower and closer (36 → 33 px, gaps 5 → 3), so the row
   stays inside the screen. Speak mode keeps its sizes (no bookmark there). */
@media (max-width: 400px) {
  .bt-after { gap: 3px; }
  .bt-after .ibtn, .bt-after .bt-grade, .bt-after .bt-grade:hover { width: 33px; }
  .bt-after .bt-grades { gap: 3px; }
  .bt-vocab { margin-left: 0; width: 30px; }
}

/* sentence cards (Maarten, 2026-11-03): the English is the question, the whole sentence one gap */
.vc-kind-label { display: none; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.vc-card.is-sentence .vc-word { display: none; }
.vc-card.is-sentence .vc-kind-label { display: block; }
.vc-card.is-sentence .vc-meaning { font-size: 21px; color: var(--text); margin-top: 10px; }
.gap-all { min-width: 6em; }
.vc-kind { margin-left: auto; margin-right: 12px; min-height: 36px; padding: 4px 28px 4px 12px; font-size: 13px; border-radius: 999px; background-color: var(--card); }
@media (max-width: 640px) {
  .study-bar { flex-wrap: wrap; }
  .vc-kind { order: 3; margin: 0; }
}
.db-sentence { font-weight: 500; white-space: normal; }

/* plain English in a non-English video (intro / outro): ordinary text, no card, no hover */
.wf { cursor: auto; }
.zh .wf { display: inline-block; vertical-align: top; line-height: 1.35; padding: 1px 0; margin-bottom: 8px; }
.sent.plain .bt-tools { display: none; }

/* the lesson's difficulty, under the title (Maarten, 2026-11-05): back-translate's colour squares */
.difficulty { display: flex; align-items: center; gap: 4px; margin: 2px 0 8px; }
.difficulty[hidden] { display: none; }
.difficulty-label { font-size: 13px; color: var(--muted); }
.difficulty .bt-grade, .difficulty .bt-grade:hover { width: 28px; height: 28px; border-radius: 6px; font-size: 13px; cursor: pointer; }
/* the front page: the latest rating as a small square */
.lessons .diff-badge { grid-column: 3; grid-row: 1 / span 2; width: 24px; height: 24px; border-radius: 6px; color: #fff;
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.diff-badge.g1 { background: #d9534f; } .diff-badge.g2 { background: #f0ad4e; } .diff-badge.g3 { background: #f5d33c; }
.diff-badge.g4 { background: #92d05a; } .diff-badge.g5 { background: #34a853; }


/* tone colours on pinyin (Maarten, 2026-11-06; Pleco's: 1 red, 2 green, 3 blue, 4 purple,
   neutral grey) — the text's pinyin line and the word card's. On the lit word: white, as before */
.t1 { color: #d93025; }
.t2 { color: #1e8e3e; }
.t3 { color: #1a73e8; }
.t4 { color: #8e24aa; }
.t5 { color: #9a9a9a; }
/* switched off in Settings → Chinese: the pinyin's usual grey */
.no-tones .t1, .no-tones .t2, .no-tones .t3, .no-tones .t4, .no-tones .t5 { color: inherit; }
.w.active .py .t1, .w.active .py .t2, .w.active .py .t3, .w.active .py .t4, .w.active .py .t5 { color: inherit; }
.wc-seen { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border-soft, #f3f3f3);
           color: var(--muted, #9a9a9a); font-size: calc(12.5px * var(--card-scale, 1)); }

/* ☆ favourite after each sentence (Maarten, 2026-11-06): small and pale; ★ in the star colour.
   Its margins are the bigger gap between two sentences; the hit area is larger than the glyph */
.fav { display: inline-block; position: relative; border: 0; background: none; padding: 0; margin: 0 .7em 0 .2em;
       font: inherit; font-size: .62em; line-height: 1; vertical-align: .18em; color: #c9c9c9; cursor: pointer; opacity: .8; }
/* a bookmark, not a star (Maarten, 2026-11-08): outline, filled once saved */
.fav svg { display: block; width: .8em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; }
.fav[aria-pressed="true"] svg { fill: currentColor; }
.fav::after { content: ""; position: absolute; inset: -12px -8px; }
.fav:hover { color: #f5a623; opacity: 1; }
.fav[aria-pressed="true"] { color: #f5a623; opacity: 1; }
.zh .fav { vertical-align: top; margin-top: .25em; }
.show-tr .sent .fav, .bt .sent .fav { margin-left: .35em; }
.bt .sent:not(.revealed) .fav { visibility: visible; }
body.embed .fav { display: none; }
/* Back-translate: all sentences or only the favourites */
.bt-filter { display: none; gap: 6px; margin: 0 0 14px; }
.bt-on:not(.speak-on) .bt-filter { display: flex; }
.bt-filter button { border: 1px solid var(--border, #ececec); background: var(--card, #fff); color: var(--text, #1a1a1a);
                    border-radius: 999px; padding: 0 14px; min-height: 36px; font: inherit; font-size: 14px; cursor: pointer; }
.bt-filter button[aria-pressed="true"] { background: var(--accent-soft, #eef); border-color: var(--accent, #5b5ef4); color: var(--accent-hover, #4547d4); font-weight: 600; }
.bt-filter .fav-count { color: var(--muted, #9a9a9a); font-weight: 400; }
.bt.fav-only .sent.fav-hidden { display: none; }
.fav-none { color: var(--muted, #9a9a9a); font-size: 14px; margin: 0 0 14px; }
/* shadowing: the chip that says it is on, the sentence to repeat, the play button filling up */
.shadow-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px 0 12px;
               border-radius: 999px; border: 1px solid rgba(29,148,134,.35); background: var(--accent-soft, #eef);
               color: var(--accent-hover, #4547d4); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.shadow-chip[hidden] { display: none; }
.shadow-chip svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.sent.shadow-repeat .de { background: var(--accent-soft); box-shadow: 0 0 0 4px var(--accent-soft); border-radius: 3px; }
.play.gap { position: relative; }
.play.gap::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; pointer-events: none;
                   background: conic-gradient(var(--accent, #5b5ef4) var(--gap-p, 0%), transparent 0);
                   -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
                           mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
                   animation: gapfill var(--gap-ms, 2s) linear forwards; }
@property --gap-p { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
@keyframes gapfill { to { --gap-p: 100%; } }

/* ── the front page's Standard view (Maarten, 2026-11-06): big cards, 3 in a row on a wide
   window, 2 on a narrower one, 1 on a phone. The thumbnail (16:9), the title under it (up to two
   lines), then the language, the level and "N words waiting". The whole card opens the lesson ── */
.lessons.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 18px;
                 padding: 0; background: none; border: 0; box-shadow: none; }
.lessons.cards li.lesson-card { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 0 0 10px; background: var(--card);
                                border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.lessons.cards li + li { border-top: 1px solid var(--border); }
.lessons.cards .thumb { display: block; aspect-ratio: 16 / 9; background: var(--fill); overflow: hidden; }
.lessons.cards .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lessons.cards .thumb-icon { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.lessons.cards .thumb-icon svg { width: 30%; max-width: 72px; height: auto; fill: none; stroke: currentColor; stroke-width: 2;
                                 stroke-linecap: round; stroke-linejoin: round; }
.lessons.cards .lesson-title { padding: 2px 14px 0; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2;
                               -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; min-height: 2.7em; }
.lessons.cards .card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 0 6px 0 14px;
                            font-size: 13px; color: var(--muted); margin-top: auto; }
.lessons.cards .card-lang { white-space: nowrap; }
.lessons.cards .row-menu-btn { margin-left: auto; }
.lessons.cards .card-status { white-space: nowrap; }
.home-actions .view-toggle { margin-left: auto; }
.view-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 2px; background: var(--card); }
.view-toggle button { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 0;
                      border-radius: 999px; background: none; color: var(--secondary); font: inherit; font-size: 13px; cursor: pointer; }
.view-toggle button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-hover); font-weight: 600; }
.view-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@media (max-width: 480px) { .view-toggle .lbl { display: none; } .view-toggle button { min-width: 44px; justify-content: center; } }
/* input time, one chip per language */
.input-time { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 16px; }
.input-time[hidden] { display: none; }
.input-head { font-size: 13px; color: var(--muted); }
.input-lang { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px; border: 1px solid var(--border);
              border-radius: 999px; background: var(--card); font-size: 14px; }
.input-flag { font-size: 15px; }
.input-sub { font-size: 12px; color: var(--muted); }

/* lessons not built yet (not in reviewed/ready.json): half opacity, still clickable (Maarten, 2026-11-07) */
.lessons li.unbuilt { opacity: .2; }   /* was .45 — lower still (Maarten, 2026-11-07) */
.lessons li.unbuilt:hover, .lessons li.unbuilt:focus-within { opacity: .6; }

/* who sees what (2026-11-12, auth.py): the server marks <html> before sending the page —
   is-admin (Maarten: add, edit and delete lessons, mark difficult words), signed-in (Sign out).
   Set from the start, so nothing appears or disappears after the first paint */
html:not(.is-admin) .admin-only, html:not(.is-admin) .row-menu-btn, html:not(.is-admin) .wc-mark,
html:not(.signed-in) .signout { display: none !important; }
/* the online copy (INKONTEXT_SERVER): lessons are added and a text lesson's text edited on the Mac */
html.server .mac-only { display: none !important; }

/* a learner's catalog and welcome (2026-11-12) */
html.is-admin .learner-only { display: none !important; }
.welcome-points { list-style: none; padding: 0; margin: 0 0 4px; display: grid; gap: 12px; }
.welcome-points li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.45; }
.welcome-points .wp-icon { font-size: 22px; line-height: 1.1; flex: none; width: 28px; text-align: center; }
.cat-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; max-height: min(60vh, 560px); overflow-y: auto; }
.cat-item { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.cat-item.unbuilt { opacity: .75; }
.cat-thumb { width: 96px; aspect-ratio: 16 / 9; flex: none; border-radius: 8px; overflow: hidden; background: var(--fill);
  display: flex; align-items: center; justify-content: center; }
.cat-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat-thumb .thumb-icon svg { width: 30px; height: 30px; fill: none; stroke: var(--muted); stroke-width: 2; }
.cat-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cat-title { font-weight: 600; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.cat-meta { color: var(--muted); font-size: 13px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cat-add { min-height: 44px; padding: 0 18px; flex: none; }
.cat-added { color: var(--ok); font-weight: 600; font-size: 14px; flex: none; padding: 0 6px; }
@media (max-width: 480px) { .cat-thumb { width: 72px; } .cat-add { padding: 0 14px; } }

/* Settings → Delete my account (2026-11-12) */
.danger-text { color: #c62828; }
.danger-box { margin-top: 12px; padding: 14px 16px; border: 1px solid #f1c4c4; background: #fdf3f3; border-radius: 10px; }
.danger-box p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; }
.danger-box .field { display: block; margin-bottom: 12px; }
.danger-box input { width: 100%; max-width: 220px; font-size: 16px; letter-spacing: .08em; }
.danger-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.danger-row .btn, .danger-row .btn-secondary { min-height: 44px; }
.danger-row .btn:disabled { opacity: .45; }

/* the welcome's "I agree to the Terms of Service" (2026-11-12) */
.terms-agree { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0 0; font-size: 14px; line-height: 1.45; cursor: pointer; }
.terms-agree input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
.terms-agree a { color: var(--accent); }
#cat-start:disabled { opacity: .45; cursor: default; }
