/* =========================================================
   Klank — Delft-tile design system (light + dark)
   ========================================================= */
:root {
  --porcelain: #F2F5FA; --tile: #FFFFFF; --glaze: #E2E9F5; --glaze-2: #C9D6EE;
  --delft: #1E3F96; --delft-2: #2F55B5; --delft-deep: #0E2257;
  --ink: #15203B; --muted: #56627F; --line: #D3DCEB;
  --oranje: #F2711C; --oranje-deep: #B94A06; --oranje-soft: #FDE7D6;
  --ok: #1C7C54; --ok-soft: #DDF1E7; --bad: #B4232F; --bad-soft: #F8DEE0;
  --orn: #1E3F96; --orn-new: #F2711C; --shadow: 0 1px 0 rgba(14, 34, 87, .08), 0 8px 24px -16px rgba(14, 34, 87, .35);
  --ar: "Markazi Text", "Noto Naskh Arabic", "Segoe UI", Tahoma, serif;
  --nl: "Noto Serif", Georgia, "Times New Roman", serif;
  --disp: "Noto Serif Display", "Noto Serif", Georgia, serif;
  --r-tile: 6px; --r-card: 14px; --r-sheet: 22px;
  --wrap: 1180px; --col: 760px; --gut: clamp(16px, 4vw, 32px);
  --top: env(safe-area-inset-top, 0px); --bot: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --porcelain: #0A1430; --tile: #101D45; --glaze: #172A5E; --glaze-2: #22397A;
    --delft: #A3BCFF; --delft-2: #C2D2FF; --delft-deep: #EAF0FF; --ink: #E5EBF8; --muted: #9DA9C8; --line: #22346A;
    --oranje: #FF8A3D; --oranje-deep: #FFAA70; --oranje-soft: #3A2414; --ok: #52C892; --ok-soft: #12352A; --bad: #FF7E89; --bad-soft: #3D1820;
    --orn: #6F8EE0; --orn-new: #FF8A3D; --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 28px -18px rgba(0, 0, 0, .9);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --porcelain: #0A1430; --tile: #101D45; --glaze: #172A5E; --glaze-2: #22397A;
  --delft: #A3BCFF; --delft-2: #C2D2FF; --delft-deep: #EAF0FF; --ink: #E5EBF8; --muted: #9DA9C8; --line: #22346A;
  --oranje: #FF8A3D; --oranje-deep: #FFAA70; --oranje-soft: #3A2414; --ok: #52C892; --ok-soft: #12352A; --bad: #FF7E89; --bad-soft: #3D1820;
  --orn: #6F8EE0; --orn-new: #FF8A3D; --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 28px -18px rgba(0, 0, 0, .9);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--porcelain); }
html.fs1 { font-size: 106.25%; } html.fs2 { font-size: 112.5%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--porcelain); color: var(--ink);
  font: 400 1.1875rem/1.75 var(--ar); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  padding-bottom: calc(76px + var(--bot));
}
body.has-mini { padding-bottom: calc(142px + var(--bot)); }
a { color: var(--delft); text-underline-offset: .2em; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; }
h1, h2, h3, h4 { font-family: var(--ar); color: var(--delft-deep); margin: 0; line-height: 1.35; font-weight: 700; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--oranje); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--glaze-2); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Dutch & IPA text */
.nl { font-family: var(--nl); direction: ltr; unicode-bidi: isolate; font-feature-settings: "kern"; }
.ipa { font-family: var(--nl); direction: ltr; unicode-bidi: isolate; color: var(--muted); font-size: .86em; letter-spacing: .01em; white-space: nowrap; }
.arh { color: var(--muted); font-size: .92em; }
.arh sup, .mk { font: 600 .62em/1 var(--nl); color: var(--oranje-deep); vertical-align: super; margin-inline-start: 2px; direction: ltr; unicode-bidi: isolate; }
html.no-ar .arh { display: none !important; }
html.no-ipa .ipa { display: none !important; }

/* tappable Dutch */
.say {
  font-family: var(--nl); direction: ltr; unicode-bidi: isolate; color: var(--delft); font-weight: 600;
  border-bottom: 1.5px dotted color-mix(in srgb, var(--delft) 45%, transparent); border-radius: 2px;
  transition: color .2s, background-color .2s; text-align: start;
}
.say:hover { color: var(--delft-2); background: var(--glaze); }
.say.speaking, [data-say].speaking { color: var(--oranje-deep); }

/* ---------- layout ---------- */
.wrap { width: min(var(--wrap), 100% - 2 * var(--gut)); margin-inline: auto; }
.top {
  position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--porcelain) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
  padding-top: var(--top);
}
.top .wrap { display: flex; align-items: center; gap: 12px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--delft-deep); }
.brand .logo { width: 36px; height: 36px; }
.brand b { font: 700 1.25rem/1 var(--disp); letter-spacing: -.01em; direction: ltr; }
.brand small { display: block; font: 400 .82rem/1.2 var(--ar); color: var(--muted); margin-top: 3px; }
.nav { display: none; gap: 2px; margin-inline-start: 18px; }
.nav a { display: flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 1.02rem; }
.nav a .ico { width: 19px; height: 19px; }
.nav a:hover { color: var(--delft); background: var(--glaze); }
.nav a.on { color: var(--delft-deep); background: var(--tile); box-shadow: inset 0 -3px 0 var(--oranje); }
.top-actions { margin-inline-start: auto; display: flex; gap: 6px; }
.iconbtn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--delft-deep); }
.iconbtn:hover { background: var(--glaze); }
.searchbtn { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--tile); color: var(--muted); min-width: 42px; }
.searchbtn span { display: none; font-size: .98rem; }

.layout { width: min(var(--wrap), 100% - 2 * var(--gut)); margin: 0 auto; }
main { outline: none; min-width: 0; padding: 20px 0 40px; }
.col { max-width: var(--col); }
@media (min-width: 1024px) {
  body, body.has-mini { padding-bottom: 0; }
  .nav { display: flex; }
  .searchbtn span { display: inline; }
  .layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 40px; align-items: start; }
  .tabbar, .mini { display: none !important; }
}

/* bottom tab bar (mobile) */
.tabbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 35; display: flex; background: var(--tile);
  border-top: 1px solid var(--line); padding: 4px 4px calc(4px + var(--bot));
}
.tabbar a { flex: 1; display: grid; justify-items: center; gap: 1px; padding: 6px 2px 4px; text-decoration: none; color: var(--muted); font: 600 .78rem/1.3 var(--ar); position: relative; }
.tabbar a .ico { width: 24px; height: 24px; }
.tabbar a.on { color: var(--delft); }
.tabbar a.on::before { content: ""; position: absolute; top: -5px; width: 28px; height: 3px; border-radius: 3px; background: var(--oranje); }

/* ---------- tiles (the identity) ---------- */
.tile {
  --o: var(--orn);
  position: relative; display: grid; place-items: center; align-content: center; gap: 2px; aspect-ratio: 1;
  background-color: var(--tile); border-radius: var(--r-tile); text-align: center; color: var(--delft);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow);
  background-image:
    radial-gradient(circle at 0 0, var(--o) 0 2.6px, transparent 3.1px 8.6px, var(--o) 8.6px 9.8px, transparent 10.4px),
    radial-gradient(circle at 100% 0, var(--o) 0 2.6px, transparent 3.1px 8.6px, var(--o) 8.6px 9.8px, transparent 10.4px),
    radial-gradient(circle at 0 100%, var(--o) 0 2.6px, transparent 3.1px 8.6px, var(--o) 8.6px 9.8px, transparent 10.4px),
    radial-gradient(circle at 100% 100%, var(--o) 0 2.6px, transparent 3.1px 8.6px, var(--o) 8.6px 9.8px, transparent 10.4px);
  transition: transform .18s var(--ease), background-color .25s, box-shadow .25s;
}
.tile.new { --o: var(--orn-new); }
button.tile:hover { background-color: var(--glaze); }
button.tile:active { transform: scale(.97); }
.tile .g { font: 600 clamp(1.5rem, 6vw, 2.1rem)/1.05 var(--disp); direction: ltr; letter-spacing: -.01em; font-stretch: 100%; }
.tile .g.long { font-size: clamp(1.1rem, 4.6vw, 1.5rem); font-stretch: 80%; }
.tile .i { font: 400 .8rem/1.2 var(--nl); color: var(--muted); direction: ltr; }
.tile .a { font: 500 .82rem/1.2 var(--ar); color: var(--muted); }
.tile.speaking { background-color: var(--oranje-soft); box-shadow: inset 0 0 0 2px var(--oranje), var(--shadow); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 4px; }
.tiles.letters { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }

/* familiarity marks */
.fam { display: inline-flex; align-items: center; gap: 6px; font: 600 .82rem/1.4 var(--ar); color: var(--muted); }
.fam::before { content: ""; width: 12px; height: 12px; border-radius: 3px; background: var(--tile); box-shadow: inset 0 0 0 2px var(--orn); }
.fam.new { color: var(--oranje-deep); }
.fam.new::before { box-shadow: inset 0 0 0 2px var(--orn-new); background: var(--oranje-soft); }
.fam.ar { color: var(--ok); }
.fam.ar::before { box-shadow: inset 0 0 0 2px var(--ok); background: var(--ok-soft); }

/* ---------- hero ---------- */
.hero { padding: 18px 0 8px; }
.hero h1 { font-size: clamp(2.05rem, 7vw, 3.4rem); line-height: 1.22; letter-spacing: -.005em; max-width: 15ch; }
.hero .lead { font-size: clamp(1.12rem, 2.6vw, 1.32rem); color: var(--muted); margin-top: 12px; max-width: 46ch; }
.strip { margin-top: 26px; }
.strip-row { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 3px; direction: ltr; max-width: 640px; }
.strip-row .tile .g { font-size: clamp(1.15rem, 5.2vw, 2.2rem); }
.strip-row .tile .i { font-size: clamp(.62rem, 2vw, .82rem); }
.strip-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.strip-word { font: 600 clamp(1.5rem, 5vw, 2rem)/1.2 var(--disp); color: var(--delft-deep); direction: ltr; }
.strip-cap { margin-top: 12px; color: var(--muted); max-width: 54ch; font-size: 1.05rem; }
.lay .tile { animation: lay .6s var(--ease) both; animation-delay: calc(var(--k) * 70ms + 150ms); }
@keyframes lay { from { opacity: 0; transform: translateY(-14px) rotate(-3deg); } to { opacity: 1; transform: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 8px 18px; border-radius: 12px;
  font: 700 1.05rem/1.2 var(--ar); text-decoration: none; border: 1px solid transparent; transition: background-color .2s, transform .15s, box-shadow .2s;
  white-space: nowrap;
}
.btn .ico { width: 20px; height: 20px; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--delft); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #0A1430; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #0A1430; } }
.btn.primary:hover { background: var(--delft-2); }
.btn.play { background: var(--oranje); color: #1A1206; }
.btn.play:hover { filter: brightness(1.05); }
.btn.ghost { background: var(--tile); color: var(--delft-deep); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--glaze-2); background: var(--glaze); }
.btn.sm { min-height: 38px; padding: 4px 12px; font-size: .95rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.pbtn { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--oranje); color: #1A1206; flex: none; }
.pbtn .ico { width: 22px; height: 22px; fill: currentColor; stroke: none; }
.pbtn.sm { width: 36px; height: 36px; }
.pbtn.sm .ico { width: 17px; height: 17px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--tile); color: var(--muted); font: 600 .95rem/1.2 var(--ar); }
.chip.on { background: var(--delft); color: #fff; border-color: transparent; }
:root[data-theme="dark"] .chip.on { color: #0A1430; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip.on { color: #0A1430; } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- sections & headings ---------- */
.sec { margin-top: 36px; }
.sec > h2 { font-size: 1.55rem; }
.sec > .sub { color: var(--muted); margin-top: 4px; max-width: 60ch; }
.sec-body { margin-top: 16px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: .98rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--delft); }
.page-h { padding: 6px 0 4px; }
.page-h h1 { font-size: clamp(1.9rem, 5.6vw, 2.6rem); }
.page-h .sub { color: var(--muted); margin-top: 6px; max-width: 58ch; font-size: 1.1rem; }
.subnav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 18px calc(-1 * var(--gut)) 0; padding: 2px var(--gut) 6px; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { flex: none; padding: 7px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 700; font-size: .98rem; border: 1px solid var(--line); background: var(--tile); }
.subnav a.on { background: var(--delft-deep); color: var(--porcelain); border-color: transparent; }

/* ---------- course map ---------- */
.next-card { margin-top: 28px; display: grid; gap: 12px; padding: 20px; border-radius: var(--r-card); background: var(--delft-deep); color: #EEF3FF; }
:root[data-theme="dark"] .next-card { background: var(--glaze); color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .next-card { background: var(--glaze); color: var(--ink); } }
.next-card .k { font-size: .98rem; opacity: .8; }
.next-card h2 { color: inherit; font-size: 1.6rem; }
.next-card .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.bar { height: 8px; border-radius: 8px; background: color-mix(in srgb, currentColor 18%, transparent); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--oranje); border-radius: inherit; transition: width .8s var(--ease); }
.units { display: grid; gap: 22px; margin-top: 16px; }
@media (min-width: 760px) { .units { grid-template-columns: 1fr 1fr; } }
.unit h3 { font-size: 1.22rem; display: flex; align-items: baseline; gap: 10px; }
.unit h3 .n { font: 600 .95rem/1 var(--nl); color: var(--oranje-deep); }
.unit .goal { color: var(--muted); font-size: 1rem; margin-top: 2px; }
.lessons { list-style: none; margin: 10px 0 0; padding: 0; border-top: 1px solid var(--line); }
.lessons li a { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.lessons li a:hover { background: color-mix(in srgb, var(--glaze) 60%, transparent); }
.lessons .no { font: 600 .95rem/1 var(--nl); color: var(--delft); direction: ltr; text-align: center; }
.lessons .t { font-weight: 600; line-height: 1.4; }
.lessons .m { color: var(--muted); font-size: .9rem; }
.lessons .st { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px var(--line); }
.lessons .done .st { background: var(--ok); box-shadow: none; color: #fff; }
.lessons .done .st .ico { width: 16px; height: 16px; stroke-width: 3; }
.lessons .cur .st { box-shadow: inset 0 0 0 2px var(--oranje); }
.lessons .cur .no { color: var(--oranje-deep); }

.tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
@media (min-width: 760px) { .tools { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tool { display: grid; gap: 4px; align-content: start; padding: 14px; border-radius: var(--r-card); background: var(--tile); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.tool:hover { border-color: var(--glaze-2); }
.tool .ico { width: 26px; height: 26px; color: var(--delft); }
.tool b { font-size: 1.08rem; color: var(--delft-deep); }
.tool span { color: var(--muted); font-size: .95rem; line-height: 1.45; }
.quick { display: flex; gap: 8px; margin-top: 14px; }
.quick input { flex: 1; min-width: 0; }
.field { height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--tile); color: var(--ink); }
.field:focus { outline: none; border-color: var(--delft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--delft) 20%, transparent); }
.field.nl { font-family: var(--nl); font-size: 1.1rem; }

/* ---------- lesson ---------- */
.lesson-h .no { font: 600 1rem/1 var(--nl); color: var(--oranje-deep); }
.lesson-h h1 { margin-top: 6px; }
.goalbox { margin-top: 14px; padding: 12px 16px; border-radius: 12px; background: var(--glaze); color: var(--delft-deep); font-weight: 600; }
.intro { margin-top: 16px; font-size: 1.16rem; max-width: 62ch; }
.block { margin-top: 26px; }
.block > h3 { font-size: 1.25rem; margin-bottom: 10px; }
.tip { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--tile); border-inline-start: 4px solid var(--oranje); box-shadow: inset 0 0 0 1px var(--line); }
.tip .ico { color: var(--oranje-deep); margin-top: 4px; }
.note { color: var(--muted); padding-inline-start: 14px; border-inline-start: 2px solid var(--line); margin-top: 10px; }
.lesson-nav { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line); }

/* sound rows */
.srow { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.srow:first-child { padding-top: 4px; }
.srow .tile { width: 92px; }
.srow h4 { font-size: 1.12rem; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.srow .tip-t { margin-top: 4px; }
.ws { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 10px; }
.w { display: inline-grid; gap: 0; padding: 6px 11px 5px; border-radius: 10px; background: var(--tile); box-shadow: inset 0 0 0 1px var(--line); text-align: start; min-height: 44px; align-content: center; }
.w:hover { box-shadow: inset 0 0 0 1px var(--glaze-2); background: var(--glaze); }
.w .n { font: 600 1.08rem/1.25 var(--nl); color: var(--delft); direction: ltr; text-align: start; }
.w .m { font-size: .88rem; color: var(--muted); line-height: 1.35; }
.w .h { font-size: .84rem; color: var(--muted); line-height: 1.3; }
.w.speaking { box-shadow: inset 0 0 0 2px var(--oranje); background: var(--oranje-soft); }
@media (max-width: 520px) { .srow { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; } .srow .tile { width: 72px; } }

/* rules */
.rule { padding: 16px 0; border-bottom: 1px solid var(--line); }
.rule .pat { display: flex; flex-wrap: wrap; gap: 6px; direction: ltr; justify-content: flex-end; }
.rule .pat span { font: 600 1.05rem/1 var(--nl); color: var(--delft-deep); padding: 7px 10px; border-radius: var(--r-tile); background: var(--glaze); }
.rule h4 { font-size: 1.15rem; margin-top: 10px; }
.rule p { margin-top: 4px; }

/* pairs */
.pairs { display: grid; gap: 10px; }
@media (min-width: 640px) { .pairs { grid-template-columns: 1fr 1fr; } }
.pair { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; align-items: stretch; }
.pair .w { width: 100%; }
.pair .test { width: 44px; border-radius: 10px; display: grid; place-items: center; color: var(--delft); box-shadow: inset 0 0 0 1px var(--line); background: var(--tile); }
.pair .test:hover { background: var(--glaze); }
.pair.ok .w.hit { box-shadow: inset 0 0 0 2px var(--ok); background: var(--ok-soft); }
.pair.no .w.hit { box-shadow: inset 0 0 0 2px var(--bad); background: var(--bad-soft); }
.pair.ask .w { box-shadow: inset 0 0 0 2px var(--oranje); }
.diff { font: 600 .92rem/1.4 var(--nl); color: var(--oranje-deep); direction: ltr; text-align: start; margin-top: 4px; }

/* stress & intonation */
.stress { display: grid; gap: 6px; }
.syl { font-family: var(--nl); direction: ltr; display: inline-flex; gap: 0; font-size: 1.18rem; }
.syl span { color: var(--muted); padding: 0 1px; }
.syl span.acc { color: var(--delft-deep); font-weight: 700; box-shadow: inset 0 -4px 0 var(--oranje); }
.syl .dot { color: var(--glaze-2); }
.srule { padding: 14px 0; border-bottom: 1px solid var(--line); }
.srule h4 { font-size: 1.1rem; }
.srule .ws .w { min-width: 120px; }
.tune { width: 64px; height: 26px; color: var(--oranje-deep); flex: none; }
.line { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line .say { font-size: 1.12rem; justify-self: start; }
.line .m { grid-column: 2; color: var(--muted); font-size: .98rem; }
.cmp { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; }
.cmp .arrow { color: var(--muted); }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 1.02rem; }
.tblwrap { overflow-x: auto; margin-top: 6px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); background: var(--tile); }
.tbl th { text-align: start; font-weight: 700; color: var(--delft-deep); background: var(--glaze); padding: 8px 12px; font-size: .95rem; white-space: nowrap; }
.tbl td { padding: 8px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.tbl td .say { font-weight: 600; border-bottom: 0; }

/* dialogs */
.dialog { border-radius: var(--r-card); background: var(--tile); box-shadow: inset 0 0 0 1px var(--line); padding: 14px 16px; }
.dialog + .dialog { margin-top: 12px; }
.dialog-h { display: flex; align-items: center; gap: 12px; }
.dialog-h h4 { font-size: 1.15rem; flex: 1; }
.dialog .dn { color: var(--muted); font-size: .98rem; }
.dl { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); align-items: start; }
.dl .who { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font: 700 .9rem/1 var(--nl); background: var(--glaze); color: var(--delft-deep); margin-top: 3px; }
.dl.B .who { background: var(--oranje-soft); color: var(--oranje-deep); }
.dl .say { font-size: 1.08rem; display: block; border-bottom: 0; }
.dl .m { color: var(--muted); font-size: .97rem; }
.dl.now { background: linear-gradient(to left, transparent, color-mix(in srgb, var(--oranje-soft) 70%, transparent)); }

/* ---------- player ---------- */
.player { position: sticky; top: 84px; margin-top: 20px; display: none; }
@media (min-width: 1024px) { .player { display: block; } }
.pl { border-radius: var(--r-card); background: var(--tile); box-shadow: inset 0 0 0 1px var(--line), var(--shadow); padding: 18px; display: grid; gap: 10px; }
.pl-k { font-size: .92rem; color: var(--muted); }
.pl-word { font: 600 clamp(1.8rem, 4vw, 2.4rem)/1.15 var(--disp); color: var(--delft-deep); direction: ltr; text-align: start; word-break: break-word; }
.pl-word.long { font-size: 1.4rem; line-height: 1.3; font-family: var(--nl); }
.pl-ipa { font: 400 1.05rem/1.4 var(--nl); color: var(--muted); direction: ltr; text-align: start; }
.pl-ar { font-size: 1.15rem; color: var(--ink); }
.pl-mean { color: var(--muted); }
.pl-note { font-size: .98rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 8px; }
.pl-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pl-acts .btn.sm { padding: 4px 10px; }
.pl-rec { display: grid; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--glaze); }
.meter { height: 8px; border-radius: 8px; background: color-mix(in srgb, var(--delft) 15%, transparent); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--oranje); transition: width .08s linear; }
.pl-sr { padding: 10px 12px; border-radius: 12px; font-weight: 600; }
.pl-sr.ok { background: var(--ok-soft); color: var(--ok); }
.pl-sr.mid { background: var(--oranje-soft); color: var(--oranje-deep); }
.pl-sr.no { background: var(--bad-soft); color: var(--bad); }
.pl-empty { color: var(--muted); font-size: 1rem; }
.speaking-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--oranje); animation: pulse 1s ease-in-out infinite; display: none; }
.is-speaking .speaking-dot { display: inline-block; }
@keyframes pulse { 50% { transform: scale(.55); opacity: .5; } }

/* mini player (mobile) */
.mini {
  position: fixed; inset-inline: 8px; bottom: calc(66px + var(--bot)); z-index: 34; display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 16px; background: var(--tile); box-shadow: inset 0 0 0 1px var(--line), 0 12px 30px -14px rgba(14, 34, 87, .55);
}
.mini .t { flex: 1; min-width: 0; display: grid; text-align: start; }
.mini .t b { font: 600 1.12rem/1.25 var(--nl); color: var(--delft-deep); direction: ltr; text-align: start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .t span { font-size: .9rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; display: grid; align-items: end; }
.sheet-bg { position: absolute; inset: 0; background: rgba(8, 14, 34, .5); opacity: 0; transition: opacity .3s; }
.sheet {
  position: relative; width: 100%; max-width: 620px; margin: 0 auto; max-height: 90vh; max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--porcelain); border-radius: var(--r-sheet) var(--r-sheet) 0 0; padding: 8px clamp(16px, 4vw, 26px) calc(22px + var(--bot));
  transform: translateY(100%); transition: transform .42s var(--ease);
}
.sheet-wrap.open .sheet { transform: none; }
.sheet-wrap.open .sheet-bg { opacity: 1; }
.grab { width: 42px; height: 5px; border-radius: 5px; background: var(--line); margin: 4px auto 10px; }
.sheet-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sheet-h h2 { font-size: 1.4rem; flex: 1; }
@media (min-width: 760px) {
  .sheet-wrap { align-items: center; padding: 24px; }
  .sheet { border-radius: var(--r-sheet); transform: translateY(20px); opacity: 0; transition: transform .35s var(--ease), opacity .25s; max-height: 86vh; }
  .sheet-wrap.open .sheet { opacity: 1; }
  .grab { display: none; }
}
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.set-row label, .set-row .l { flex: 1; }
.set-row em { display: block; font-style: normal; color: var(--muted); font-size: .92rem; line-height: 1.45; }
.set-row select { max-width: 60%; }
.sel { height: 44px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--tile); color: var(--ink); font-size: .98rem; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--glaze); flex-wrap: wrap; }
.seg button { padding: 6px 12px; border-radius: 9px; font-weight: 700; font-size: .95rem; color: var(--muted); }
.seg button.on { background: var(--tile); color: var(--delft-deep); box-shadow: 0 1px 2px rgba(14, 34, 87, .15); }
.switch { width: 50px; height: 30px; border-radius: 30px; background: var(--line); position: relative; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: inset-inline-start .25s var(--ease); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.switch[aria-checked="true"] { background: var(--delft); }
.switch[aria-checked="true"]::after { inset-inline-start: 23px; }
input[type=range] { accent-color: var(--oranje); width: 160px; }
.vlist { max-height: 260px; overflow-y: auto; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); background: var(--tile); }
.vlist button { width: 100%; display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: start; font-size: .95rem; }
.vlist button:hover { background: var(--glaze); }
.vlist button.nlv { font-weight: 700; }
.vlist button.on { box-shadow: inset 4px 0 0 var(--oranje); }
.vlist .lng { font-family: var(--nl); direction: ltr; color: var(--muted); }

/* banner */
.banner { background: var(--oranje-soft); color: var(--ink); border-bottom: 1px solid var(--line); }
.banner .wrap { display: flex; gap: 12px; align-items: center; padding: 10px 0; flex-wrap: wrap; }
.banner p { flex: 1; min-width: 220px; font-size: 1.02rem; }

/* ---------- quiz ---------- */
.quiz { margin-top: 12px; border-radius: var(--r-card); background: var(--tile); box-shadow: inset 0 0 0 1px var(--line), var(--shadow); padding: 18px; }
.qhead { display: flex; align-items: center; gap: 12px; }
.qhead .bar { flex: 1; color: var(--delft); }
.qhead .sc { font: 600 .95rem/1 var(--nl); color: var(--muted); direction: ltr; }
.qprompt { margin-top: 16px; font-size: 1.15rem; font-weight: 600; color: var(--delft-deep); }
.qshow { margin-top: 12px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.qshow .big { font: 600 clamp(1.8rem, 6vw, 2.6rem)/1.15 var(--disp); color: var(--delft-deep); direction: ltr; }
.qopts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.qopts.one { grid-template-columns: 1fr; }
.qopt { min-height: 56px; padding: 10px 12px; border-radius: 12px; background: var(--porcelain); box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 700; font-size: 1.08rem; display: grid; place-items: center; text-align: center; line-height: 1.35; }
.qopt .nl { font-size: 1.15rem; color: var(--delft); }
.qopt .m { display: block; font-weight: 400; font-size: .88rem; color: var(--muted); }
.qopt:hover { box-shadow: inset 0 0 0 1.5px var(--delft); }
.qopt.right { background: var(--ok-soft); box-shadow: inset 0 0 0 2px var(--ok); color: var(--ok); }
.qopt.wrong { background: var(--bad-soft); box-shadow: inset 0 0 0 2px var(--bad); color: var(--bad); }
.qfeed { margin-top: 14px; padding: 12px 14px; border-radius: 12px; display: grid; gap: 6px; }
.qfeed.ok { background: var(--ok-soft); }
.qfeed.no { background: var(--bad-soft); }
.qfeed b { color: var(--ink); }
.qfoot { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.qend { text-align: center; padding: 10px 0; display: grid; gap: 10px; justify-items: center; }
.qend .big { font: 600 3rem/1 var(--disp); color: var(--delft-deep); direction: ltr; }
.qinput { display: flex; gap: 8px; margin-top: 14px; }
.qinput input { flex: 1; min-width: 0; }
.sylpick { display: flex; gap: 6px; direction: ltr; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.sylpick button { min-width: 64px; min-height: 56px; padding: 6px 12px; border-radius: 10px; font: 600 1.3rem/1 var(--nl); color: var(--delft-deep); background: var(--porcelain); box-shadow: inset 0 0 0 1.5px var(--line); }
.sylpick button.right { background: var(--ok-soft); box-shadow: inset 0 0 0 2px var(--ok); }
.sylpick button.wrong { background: var(--bad-soft); box-shadow: inset 0 0 0 2px var(--bad); }

/* practice hub */
.modes { display: grid; gap: 10px; margin-top: 16px; }
@media (min-width: 640px) { .modes { grid-template-columns: 1fr 1fr; } }
.mode { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: start; padding: 14px; border-radius: var(--r-card); background: var(--tile); box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; color: var(--ink); }
.mode:hover { box-shadow: inset 0 0 0 1px var(--glaze-2); }
.mode .ico { width: 30px; height: 30px; color: var(--delft); margin: 4px auto 0; }
.mode b { display: block; color: var(--delft-deep); font-size: 1.1rem; }
.mode span { color: var(--muted); font-size: .97rem; line-height: 1.45; }
.mode.daily { background: var(--delft-deep); color: #EEF3FF; box-shadow: none; }
.mode.daily b, .mode.daily .ico { color: #fff; }
.mode.daily span { color: #C9D6F5; }
:root[data-theme="dark"] .mode.daily { background: var(--glaze); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mode.daily { background: var(--glaze); } }

/* flashcards */
.card { margin-top: 12px; min-height: 260px; border-radius: var(--r-card); background: var(--tile); box-shadow: inset 0 0 0 1px var(--line), var(--shadow); display: grid; place-items: center; text-align: center; padding: 24px 18px; gap: 10px; }
.card .front { font: 600 clamp(1.8rem, 6vw, 2.6rem)/1.2 var(--disp); color: var(--delft-deep); direction: ltr; }
.card .back { display: grid; gap: 6px; }
.card .back .m { font-size: 1.4rem; font-weight: 700; }
.cardbar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }

/* tools */
.toolbox { margin-top: 12px; border-radius: var(--r-card); background: var(--tile); box-shadow: inset 0 0 0 1px var(--line); padding: 16px; display: grid; gap: 14px; }
.toolrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolrow .field { flex: 1; min-width: 160px; }
.ex-tiles { display: flex; flex-wrap: wrap; gap: 4px; direction: ltr; }
.ex-tiles .tile { width: 78px; }
.ex-tiles .tile.st::after { content: ""; position: absolute; inset-inline: 14px; bottom: 6px; height: 3px; border-radius: 3px; background: var(--oranje); }
.ex-notes { display: grid; gap: 6px; }
.ex-notes div { display: grid; grid-template-columns: 70px 1fr; gap: 10px; font-size: 1rem; }
.ex-notes .nl { color: var(--delft-deep); font-weight: 700; }
.out-big { font: 600 clamp(1.3rem, 4.2vw, 1.9rem)/1.3 var(--disp); color: var(--delft-deep); direction: ltr; text-align: start; word-break: break-word; }
.clock { width: 180px; height: 180px; flex: none; }
.clock .face { fill: var(--tile); stroke: var(--delft); stroke-width: 3; }
.clock .tick { stroke: var(--delft); stroke-width: 2; stroke-linecap: round; }
.clock .tick.q { stroke-width: 4; }
.clock .hh { stroke: var(--delft-deep); stroke-width: 6; stroke-linecap: round; }
.clock .mh { stroke: var(--oranje); stroke-width: 4; stroke-linecap: round; }
.clock .half { fill: color-mix(in srgb, var(--oranje) 14%, transparent); }
.clockwrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.spell-out { display: grid; gap: 6px; }
.spell-out .sp { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.spell-out .L { font: 700 1.3rem/1 var(--disp); color: var(--delft-deep); text-align: center; direction: ltr; }

/* vowel chart */
.vchart { width: 100%; max-width: 560px; height: auto; direction: ltr; margin-top: 6px; }
.vchart .frame { fill: var(--tile); stroke: var(--glaze-2); stroke-width: 2; }
.vchart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 4 6; }
.vchart .lbl { fill: var(--muted); font: 600 15px var(--ar); }
.vchart .pt { cursor: pointer; }
.vchart .pt circle { fill: var(--delft); transition: r .2s; }
.vchart .pt.round circle.ring { fill: none; stroke: var(--oranje); stroke-width: 2.5; }
.vchart .pt text { font: 600 18px var(--nl); fill: var(--delft-deep); paint-order: stroke; stroke: var(--tile); stroke-width: 4px; stroke-linejoin: round; }
.vchart .pt text.ip { font: 400 13px var(--nl); fill: var(--muted); }
.vchart .pt:hover circle:not(.ring) { fill: var(--oranje); }
.vchart .di { fill: none; stroke: var(--oranje); stroke-width: 2.5; stroke-linecap: round; }
.vchart .dit { font: 700 15px var(--nl); fill: var(--oranje-deep); cursor: pointer; paint-order: stroke; stroke: var(--tile); stroke-width: 4px; stroke-linejoin: round; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 8px; color: var(--muted); font-size: .95rem; }

/* me */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { padding: 14px; border-radius: var(--r-card); background: var(--tile); box-shadow: inset 0 0 0 1px var(--line); }
.stat b { display: block; font: 600 1.9rem/1.1 var(--disp); color: var(--delft-deep); direction: ltr; text-align: start; }
.stat span { color: var(--muted); font-size: .95rem; }

/* search */
.search { position: fixed; inset: 0; z-index: 70; background: var(--porcelain); display: grid; grid-template-rows: auto 1fr; padding-top: var(--top); }
.search-h { display: flex; gap: 8px; align-items: center; padding: 10px var(--gut); border-bottom: 1px solid var(--line); max-width: 860px; width: 100%; margin: 0 auto; }
.search-h input { flex: 1; min-width: 0; height: 50px; font-size: 1.1rem; }
.results { overflow-y: auto; padding: 8px var(--gut) 40px; max-width: 860px; width: 100%; margin: 0 auto; }
.res { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 11px 4px; border-bottom: 1px solid var(--line); text-align: start; }
.res:hover { background: var(--glaze); }
.res .nl { font-weight: 600; color: var(--delft); font-size: 1.08rem; text-align: start; }
.res .m { color: var(--muted); font-size: .96rem; grid-column: 1; }
.res .tag { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: .82rem; color: var(--muted); padding: 2px 8px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; }
.res.explain { background: var(--oranje-soft); border-radius: 12px; border: 0; margin: 8px 0; padding: 12px; }

/* toast */
.toast { position: fixed; z-index: 90; left: 50%; bottom: calc(150px + var(--bot)); transform: translate(-50%, 16px); opacity: 0; pointer-events: none; background: var(--delft-deep); color: var(--porcelain); padding: 10px 18px; border-radius: 12px; font-weight: 600; max-width: calc(100% - 32px); transition: opacity .25s, transform .3s var(--ease); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 1024px) { .toast { bottom: 28px; } }

footer.foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 22px 0 10px; color: var(--muted); font-size: .95rem; display: grid; gap: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* =========================================================
   Additions: shared helpers, tools, quiz, cards, progress
   ========================================================= */
.skip { position: absolute; inset-inline-start: 8px; top: -64px; z-index: 100; background: var(--delft-deep); color: var(--porcelain); padding: 10px 14px; border-radius: 10px; text-decoration: none; font-weight: 700; }
.skip:focus { top: 8px; }
html.locked, html.locked body { overflow: hidden; }
.brand > span { display: grid; }
.ico.inl { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -.22em; }
.ico.ok { color: var(--ok); }
.bsub { color: var(--muted); margin: -4px 0 12px; max-width: 62ch; }
.block > h2.gh { font-size: 1.4rem; margin-bottom: 6px; }
.actions { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.flash { animation: flash 1.8s var(--ease); }
@keyframes flash { 0%, 45% { background-color: var(--oranje-soft); } 100% { background-color: transparent; } }
.srow, .rule, .topic, .block[id], .dialog { scroll-margin-top: 84px; }
.dig { font-family: var(--nl); direction: ltr; unicode-bidi: isolate; text-align: start; white-space: nowrap; }
[tabindex="-1"]:focus { outline: none; }
.strip-row .tile .g.long { font-size: clamp(.95rem, 4vw, 1.75rem); font-stretch: 85%; }
.pat.diff { display: flex; flex-wrap: wrap; gap: 6px; direction: ltr; justify-content: flex-end; margin: 0 0 12px; }
.pat.diff span { font: 600 .95rem/1 var(--nl); padding: 7px 10px; border-radius: var(--r-tile); color: var(--oranje-deep); background: var(--oranje-soft); }
.btn.danger { color: var(--bad); }
a.chip { text-decoration: none; }
.lesson-nav .btn { white-space: normal; text-align: center; max-width: 48%; line-height: 1.35; }

/* phrase rows */
.lines { display: grid; }
.line .pbtn { align-self: start; margin-top: 2px; }
.lt { min-width: 0; display: grid; gap: 2px; justify-items: start; }
.pr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-size: .95rem; line-height: 1.5; }
.pr .ipa { white-space: normal; }
.line .m .nt { display: block; font-size: .9rem; opacity: .9; }
.line .m .btn { margin-top: 6px; }
.line.into .tune { align-self: start; margin-top: 8px; }

/* mistakes & connected speech */
.mis-list, .conn-list { display: grid; }
.mis, .conn { padding: 12px 0; border-bottom: 1px solid var(--line); }
.mis-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mis .wr { color: var(--bad); font-weight: 600; }
.mis .wr s { text-decoration-thickness: 2px; }
.mis .arrow, .cmp .arrow { color: var(--muted); }
.mis .say { font-size: 1.15rem; }
.mis .m, .conn .m { color: var(--muted); margin-top: 4px; font-size: .98rem; }
.cmp .w { width: 100%; }
.w.spoken { box-shadow: inset 0 0 0 1.5px var(--oranje); }

/* grammar */
.topic + .topic { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.topic > h3 { font-size: 1.3rem; }
.topic .lines, .topic .tblwrap, .topic .tip, .topic .note { margin-top: 12px; }
.tbl .sep { color: var(--muted); margin: 0 6px; }
.tbl td .nl { color: var(--delft-deep); font-weight: 600; }
td.lg { font: 700 1.25rem/1.2 var(--ar); color: var(--delft-deep); text-align: center; width: 76px; white-space: nowrap; }
.topics { display: grid; gap: 8px; margin-top: 18px; }
@media (min-width: 640px) { .topics { grid-template-columns: 1fr 1fr; } }
.topic-link { display: grid; grid-template-columns: 32px 1fr; gap: 10px; padding: 12px 14px; border-radius: var(--r-card); background: var(--tile); box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; color: var(--ink); }
.topic-link:hover { box-shadow: inset 0 0 0 1px var(--glaze-2); background: color-mix(in srgb, var(--glaze) 50%, var(--tile)); }
.topic-link .no { font: 600 1rem/1.7 var(--nl); color: var(--oranje-deep); text-align: center; }
.topic-link b { display: block; color: var(--delft-deep); font-size: 1.08rem; }
.topic-link span span { color: var(--muted); font-size: .96rem; line-height: 1.45; }

/* numbers grid */
.numgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 6px; }
.num { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--tile); box-shadow: inset 0 0 0 1px var(--line); text-align: start; }
.num b { font: 600 1.35rem/1.1 var(--disp); color: var(--delft-deep); direction: ltr; text-align: start; }
.num .nl { color: var(--delft); font-size: .98rem; word-break: break-word; }
.num:hover { background: var(--glaze); }
.num.speaking { box-shadow: inset 0 0 0 2px var(--oranje); background: var(--oranje-soft); }

/* tools */
.ex-out, .num-out, .clock-out, .vc-out { display: grid; gap: 12px; }
.ex-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ex-tiles .tile .g { font-size: 1.5rem; }
.ex-tiles .tile .a { font-size: .85rem; }
.ex-tiles .tile.mute { opacity: .55; }
.ex-tiles { gap: 12px 16px; justify-content: flex-end; }
.ex-tiles .sy { display: flex; gap: 4px; position: relative; padding-bottom: 9px; }
.ex-tiles .sy.st::after { content: ""; position: absolute; inset-inline: 4px; bottom: 0; height: 4px; border-radius: 4px; background: var(--oranje); }
.ex-tiles .tile { width: 70px; }
@media (max-width: 420px) { .ex-tiles .tile { width: 60px; } .ex-tiles .tile .a { font-size: .8rem; } }
.sylrow { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.sylrow .m { color: var(--muted); font-size: .92rem; }
.ex-notes.wide div { grid-template-columns: 96px 1fr; }
.ex-notes.wide div > span:first-child { color: var(--muted); }
.num-in { max-width: 200px; font-family: var(--nl); font-size: 1.2rem; }
.clock-say { display: grid; gap: 8px; min-width: 0; flex: 1 1 220px; }
.digital { font: 600 2rem/1 var(--disp); color: var(--muted); direction: ltr; text-align: start; letter-spacing: .02em; }
.clock .pin { fill: var(--delft-deep); }
.time-in { max-width: 160px; font-family: var(--nl); direction: ltr; }
.spn { display: grid; min-width: 0; }
.spn .nl { font-weight: 600; color: var(--delft-deep); }
.sp.speaking { background: var(--oranje-soft); }
.vc { font-weight: 600; }
.vc .ico { display: inline-block; width: 20px; height: 20px; vertical-align: -4px; margin-inline-end: 6px; }
.vc:not(.ok):not(.bad) { font-weight: 400; }
.vc.ok { color: var(--ok); }
.vc.bad { color: var(--bad); }
.vc b.nl { color: var(--ink); }
.vhelp { padding: 10px 12px; border-radius: 10px; background: var(--glaze); }
.caps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; color: var(--muted); font-size: .98rem; }
.caps li { display: flex; gap: 8px; align-items: center; }
.caps li .ico { width: 18px; height: 18px; color: var(--bad); }
.caps li.ok .ico { color: var(--ok); }
.chartwrap { overflow-x: auto; }
.legend .lg-ring::before { content: ""; display: inline-block; width: 13px; height: 13px; border-radius: 50%; border: 2.5px solid var(--oranje); vertical-align: -2px; margin-inline-end: 6px; }
.legend .lg-arr::before { content: ""; display: inline-block; width: 22px; height: 3px; border-radius: 3px; background: var(--oranje); vertical-align: 4px; margin-inline-end: 6px; }
.vchart .dg { cursor: pointer; }
.vchart .dg:hover .di { stroke-width: 4; }
.vchart .pt.speaking circle:not(.ring), .vchart .pt:focus-visible circle:not(.ring) { fill: var(--oranje); }
.vchart .pt:focus-visible, .vchart .dg:focus-visible { outline: none; }

/* player extras */
.pl-k { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pl-err { color: var(--bad); font-weight: 600; }
.rec-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); animation: pulse 1s ease-in-out infinite; }
.pl-sheet { box-shadow: none; padding: 0; background: transparent; }
.mini .t { cursor: pointer; }
.set-h { font-size: 1.1rem; margin: 18px 0 8px; }

/* search extras */
.search-h > .ico { color: var(--muted); }
.search > *, .res, .res > * { min-width: 0; }
.res > * { overflow-wrap: anywhere; }
.vlist .pl-empty { padding: 12px 14px; }
.res.nav, .res.explain { text-decoration: none; color: var(--ink); }
.res .t { font-weight: 700; color: var(--delft-deep); }
.res .pr { grid-column: 1; font-size: .88rem; color: var(--muted); }

/* quiz extras */
.quiz-host { margin-top: 18px; }
.qstart { display: grid; gap: 12px; justify-items: start; }
.qstart p { color: var(--muted); }
.qshow .big.phrase { font: 600 clamp(1.3rem, 4.4vw, 1.75rem)/1.35 var(--nl); }
.qshow .big.ar { font: 700 clamp(1.4rem, 4.6vw, 1.9rem)/1.4 var(--ar); direction: rtl; }
.qshow > .m { color: var(--muted); }
mark { background: var(--oranje-soft); color: var(--oranje-deep); border-radius: 4px; padding: 0 2px; box-shadow: inset 0 -3px 0 var(--oranje); }
.gap { display: inline-block; width: 1.25em; height: .85em; border-bottom: 3px solid var(--oranje); margin: 0 3px; }
.qopt .big-l { font: 600 2rem/1 var(--disp); color: var(--delft-deep); }
.qopt .big-n { font: 600 1.6rem/1 var(--disp); direction: ltr; color: var(--delft-deep); }
.qopt.right .big-n, .qopt.right .big-l, .qopt.right .nl, .qopt.right .arn { color: var(--ok); }
.qopt.wrong .big-n, .qopt.wrong .big-l, .qopt.wrong .nl, .qopt.wrong .arn { color: var(--bad); }
.arn { font: 700 1.45rem/1.2 var(--ar); }
.qopt .m.ipa { display: block; white-space: normal; }
.qopt[disabled] { cursor: default; }
.pbtn.xl { width: 68px; height: 68px; }
.pbtn.xl .ico { width: 30px; height: 30px; }
.qclock { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.qclock .clock { width: 140px; height: 140px; }
.qsay { display: grid; gap: 4px; }
.qspeak { display: grid; gap: 10px; justify-items: start; margin-top: 16px; }
.qfeed .ipa { color: inherit; opacity: .8; }
.qend p { max-width: 46ch; }

/* flashcards */
.cards { margin-top: 18px; }
.card .front.ar { font: 700 clamp(1.5rem, 5vw, 2.1rem)/1.4 var(--ar); direction: rtl; }
.card .back { border-top: 1px dashed var(--line); padding-top: 12px; width: 100%; justify-items: center; }
.card .back .pr { justify-content: center; }
.card-play { min-height: 46px; }
.cardbar.one { grid-template-columns: 1fr; }
.deckbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.deckbar .m { color: var(--muted); font-size: .95rem; }
.deck-l { margin: 14px 0 6px; font-weight: 700; color: var(--delft-deep); font-size: .98rem; }
.mode-chips { margin-top: 16px; }
.seg a { padding: 6px 12px; border-radius: 9px; font-weight: 700; font-size: .95rem; color: var(--muted); text-decoration: none; }
.seg a.on { background: var(--tile); color: var(--delft-deep); box-shadow: 0 1px 2px rgba(14, 34, 87, .15); }

/* course & progress */
.lessons .tm { display: grid; min-width: 0; }
.next-card p { opacity: .9; max-width: 56ch; }
.finish { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px; border-radius: var(--r-card); background: var(--glaze); }
.finish p { flex: 1; font-weight: 600; color: var(--delft-deep); }
.mode > div { min-width: 0; }
.mode div > span { display: block; }
.days { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 4px; max-width: 520px; }
.day { aspect-ratio: 1; border-radius: 4px; background: var(--glaze); }
.day.l1 { background: color-mix(in srgb, var(--delft) 35%, var(--glaze)); }
.day.l2 { background: color-mix(in srgb, var(--delft) 65%, var(--glaze)); }
.day.l3 { background: var(--delft); }
.tbl td .say { white-space: nowrap; }
@media (max-width: 520px) {
  .tbl { font-size: .96rem; }
  .tbl th, .tbl td { padding: 7px 9px; }
}
