/* Poco a Poco — base styles. Warm cream paper in light, warm brown-charcoal in dark.
   Layout: single column app shell, sticky header, fixed tab bar, full-screen overlays.
   The palette below is the same one css/lively.css sets (lively.css is loaded after this file and wins);
   it is repeated here so the app keeps its own colours even if that file fails to load.
   What each colour is for is explained at the top of lively.css; _spec/tools/contrast.mjs checks both files. */
:root {
  --bg: #FFF6EA;          /* cream paper */
  --surface: #FFFFFF;
  --surface-2: #FCEEDC;
  --ink: #2B1B14;         /* text */
  --muted: #6B5546;
  --line: #EFDDC8;
  --line-strong: #A08872; /* borders that must be seen: text fields */
  --accent: #BE431A;      /* terracotta */
  --accent-dark: #8F2F0E;
  --accent-2: #D9592B;
  --accent-soft: #FFEBE1;
  --accent-ink: #FFFFFF;
  --on-deep: #FFFFFF;     /* text on a deep fill */
  --on-bright: #33180A;   /* text on a bright fill (orange, gold, lime, aqua, coral) */
  --on-fill: var(--on-deep);
  --hero-a: #BE431A; --hero-b: #C94A2D; --hero-dark: #8F2F0E; --hero-ink: #FFFFFF;
  --gold: #FFC233;        /* sunny yellow */
  --gold-dark: #BD7700;
  --gold-soft: #FFF1C9;
  --gold-ink: #8A5300;
  --marker: #FFD35C;      /* highlighter */
  --marker-a: 70%; --marker-b: 30%;
  --margin: #0A7772;      /* margin rule: the second colour, teal */
  --good: #0A7B41;
  --good-dark: #075A2E;
  --good-soft: #DFF5E6;
  --good-ink: #075A2E;
  --bad: #C8202C;
  --bad-dark: #96141F;
  --bad-soft: #FFE9EA;
  --bad-ink: #96141F;
  --mid: #8A5300;
  --mid-soft: #FFF1C9;
  --teal: #0A7772; --teal-dark: #06544F; --teal-soft: #DDF3F0;
  --sky: #1C68BF; --sky-dark: #134C8F; --pink: #C91D7A; --pink-dark: #99135B;
  --orange: #F58220; --orange-dark: #C25E0A; --orange-ink: #A84A00;
  --navy: #27446E; --navy-dark: #172B4A; --chili: #C8202C; --chili-dark: #96141F;
  --lime: #A5CF3A; --lime-dark: #7A9E1C; --aqua: #3CCFC4; --aqua-dark: #1F9E94; --coral: #FF8F6B; --coral-dark: #D4623F;
  --el: #1C68BF;          /* masculine: el */
  --la: #C91D7A;          /* feminine: la */
  --der: #1C68BF;         /* old names, still read by scripts: der = el, die = la, das = spare third colour */
  --die: #C91D7A;
  --das: #0A7772;
  --shadow: 0 1px 2px rgba(60, 30, 10, .06), 0 4px 14px rgba(60, 30, 10, .06);
  --font-display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  --font-body: "Barlow", -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-ipa: "Gentium Book Plus", "Charis SIL", "Doulos SIL", "Noto Sans", -apple-system, sans-serif;
  --r: 10px;
  --r-sm: 7px;
  --head-h: 52px;
  --tab-h: 58px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1D1613; --surface: #2A201B; --surface-2: #382B24; --ink: #FFF3E6; --muted: #CDB8A7; --line: #4A3A30; --line-strong: #8F7A6A;
    --accent: #FF8A66; --accent-dark: #C9532F; --accent-2: #FFAA8C; --accent-soft: #4A281B; --accent-ink: #2A1108;
    --on-deep: #2A1108; --on-bright: #2A1108; --on-fill: var(--on-deep);
    --hero-a: #BE431A; --hero-b: #C94A2D; --hero-dark: #7A2A0C; --hero-ink: #FFFFFF;
    --gold: #FFCB47; --gold-dark: #B8860F; --gold-soft: #453410; --gold-ink: #FFCB47;
    --marker: #FFD35C; --marker-a: 28%; --marker-b: 18%; --margin: #3DD6C6;
    --good: #3DD68C; --good-dark: #1E9E60; --good-soft: #173A2A; --good-ink: #6BE3A8;
    --bad: #FF6B7D; --bad-dark: #C9404F; --bad-soft: #45201F; --bad-ink: #FF9FA8;
    --mid: #FFC857; --mid-soft: #453410;
    --teal: #3DD6C6; --teal-dark: #1F9E90; --teal-soft: #163B38;
    --sky: #62B5FF; --sky-dark: #2E82CC; --pink: #FF7DC0; --pink-dark: #CC4C8E;
    --orange: #FFA24D; --orange-dark: #CC7222; --orange-ink: #FFA24D;
    --navy: #8FB3F0; --navy-dark: #5C82C4; --chili: #FF6B6B; --chili-dark: #C94444;
    --lime: #B9DE55; --lime-dark: #86A82E; --aqua: #6FDDEE; --aqua-dark: #3AA6B8; --coral: #FFB199; --coral-dark: #D48062;
    --el: #62B5FF; --la: #FF7DC0; --der: #62B5FF; --die: #FF7DC0; --das: #3DD6C6;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1D1613; --surface: #2A201B; --surface-2: #382B24; --ink: #FFF3E6; --muted: #CDB8A7; --line: #4A3A30; --line-strong: #8F7A6A;
  --accent: #FF8A66; --accent-dark: #C9532F; --accent-2: #FFAA8C; --accent-soft: #4A281B; --accent-ink: #2A1108;
  --on-deep: #2A1108; --on-bright: #2A1108; --on-fill: var(--on-deep);
  --hero-a: #BE431A; --hero-b: #C94A2D; --hero-dark: #7A2A0C; --hero-ink: #FFFFFF;
  --gold: #FFCB47; --gold-dark: #B8860F; --gold-soft: #453410; --gold-ink: #FFCB47;
  --marker: #FFD35C; --marker-a: 28%; --marker-b: 18%; --margin: #3DD6C6;
  --good: #3DD68C; --good-dark: #1E9E60; --good-soft: #173A2A; --good-ink: #6BE3A8;
  --bad: #FF6B7D; --bad-dark: #C9404F; --bad-soft: #45201F; --bad-ink: #FF9FA8;
  --mid: #FFC857; --mid-soft: #453410;
  --teal: #3DD6C6; --teal-dark: #1F9E90; --teal-soft: #163B38;
  --sky: #62B5FF; --sky-dark: #2E82CC; --pink: #FF7DC0; --pink-dark: #CC4C8E;
  --orange: #FFA24D; --orange-dark: #CC7222; --orange-ink: #FFA24D;
  --navy: #8FB3F0; --navy-dark: #5C82C4; --chili: #FF6B6B; --chili-dark: #C94444;
  --lime: #B9DE55; --lime-dark: #86A82E; --aqua: #6FDDEE; --aqua-dark: #3AA6B8; --coral: #FFB199; --coral-dark: #D48062;
  --el: #62B5FF; --la: #FF7DC0; --der: #62B5FF; --die: #FF7DC0; --das: #3DD6C6;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
body.has-overlay { overflow: hidden; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.15; text-wrap: balance; }
h2 { font-size: 1.15rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; margin-top: 1rem; }
p { margin: .4rem 0; }
.display { font-family: var(--font-display); font-weight: 700; letter-spacing: .005em; }
h1.display { font-size: 2.1rem; }
.eyebrow { font-size: .72rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.lead { font-size: 1.08rem; }
.warn { color: var(--bad); background: var(--bad-soft); padding: .6rem .8rem; border-radius: var(--r-sm); }
.row { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.row.center { justify-content: center; }
.col { display: flex; flex-direction: column; gap: .6rem; }
.center-col { display: flex; flex-direction: column; align-items: center; gap: .9rem; text-align: center; }
.ic { display: inline-flex; line-height: 0; flex: none; }
.empty { padding: 1.5rem 0; text-align: center; }

/* ---------- shell ---------- */
#app { max-width: 680px; margin: 0 auto; min-height: 100vh; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--bg); z-index: 30; }
.app-head {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  height: var(--head-h); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-top: env(safe-area-inset-top, 0px); box-sizing: content-box;
  background: var(--bg); /* fallback for iOS < 16.2 (no color-mix) */
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  margin-top: calc(-1 * env(safe-area-inset-top, 0px));
}
.brand { display: flex; align-items: center; gap: .5rem; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font: 700 1.25rem/1 var(--font-display); }
.brand-name { font: 700 1.35rem/1 var(--font-display); letter-spacing: .01em; }
.head-stats { display: flex; align-items: center; gap: .7rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.hs-streak, .hs-xp { display: inline-flex; align-items: center; gap: .2rem; color: var(--muted); }
.hs-streak.on { color: var(--orange-ink); }
.hs-xp { color: var(--accent); }
.main { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 16px); }
.view { display: flex; flex-direction: column; gap: 1rem; padding-block: 1rem 1.5rem; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.view > h1.display { margin-top: .2rem; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  padding: 0 max(4px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(4px, env(safe-area-inset-left, 0px));
  background: var(--surface); /* fallback for iOS < 16.2 */
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
@media (min-width: 700px) { .tabbar { max-width: 680px; margin: 0 auto; border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600; }
.tab.on { color: var(--accent); }
.loading { align-items: center; padding-top: 4rem; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- primitives ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem; box-shadow: var(--shadow); display: block; text-align: left; width: 100%; min-width: 0; }
button.card { cursor: pointer; }
button.card:active { transform: scale(.99); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.section-title { font-family: var(--font-display); font-size: 1.35rem; margin-top: .4rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 44px; padding: .55rem 1.1rem; border-radius: var(--r-sm); border: 1.5px solid var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.wide { width: 100%; }
.btn.primary { box-shadow: 0 2px 0 color-mix(in srgb, var(--accent) 60%, #000); }
.btn.primary.good { background: var(--good); border-color: var(--good); color: var(--on-fill); box-shadow: 0 2px 0 color-mix(in srgb, var(--good) 60%, #000); }
.btn.primary.bad { background: var(--bad); border-color: var(--bad); color: var(--on-fill); box-shadow: 0 2px 0 color-mix(in srgb, var(--bad) 60%, #000); }
.btn:disabled { opacity: .45; box-shadow: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; background: transparent; border-radius: 50%; color: var(--ink); flex: none; }
.icon-btn.small { width: 34px; height: 34px; }
.icon-btn:active { background: var(--surface-2); }
.icon-btn.avatar { background: var(--surface-2); }
.chip-btn { display: inline-flex; align-items: center; gap: .3rem; min-height: 36px; padding: .3rem .75rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .9rem; font-weight: 500; }
.chip-btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip-btn.link { border-style: dashed; }
.chip-btn:disabled { opacity: .5; }
.link-btn { border: 0; background: none; color: var(--accent); font-weight: 600; padding: .4rem 0; display: inline-flex; align-items: center; gap: .2rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chip { display: inline-flex; align-items: center; padding: .25rem .65rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-size: .82rem; white-space: nowrap; }
button.chip { cursor: pointer; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip.unlock { background: var(--marker); color: #2B2300; border-color: transparent; }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.mid { background: var(--mid-soft); color: var(--mid); }
.chip.low { background: var(--bad-soft); color: var(--bad); }
.pill { display: inline-block; padding: .15rem .55rem; border-radius: 999px; background: var(--marker); color: #2B2300; font-size: .72rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.callout { background: var(--accent-soft); border-radius: var(--r-sm); padding: .7rem .85rem; display: flex; gap: .4rem; align-items: flex-start; flex-wrap: wrap; }
.callout.good { background: var(--good-soft); color: var(--good); font-weight: 600; }
.badge-ok { color: var(--good); font-weight: 600; }
.play { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--accent); flex: none; vertical-align: middle; }
.play.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.audio-pair { display: inline-flex; gap: .3rem; vertical-align: middle; }
.de-inline { border: 0; background: linear-gradient(transparent 58%, color-mix(in srgb, var(--marker) var(--marker-a), transparent) 58%); padding: 0 .1rem; font-weight: 600; color: inherit; }
.ipa { font-family: var(--font-ipa); color: var(--muted); font-size: .95rem; }
.art { font-weight: 700; }
/* article colours: el (masculine) blue, la (feminine) pink */
.g-m { color: var(--el); } .g-f { color: var(--la); }
.noun { white-space: nowrap; }
.pl { color: var(--muted); font-weight: 400; font-size: .85em; }
.input { width: 100%; min-width: 0; font: inherit; font-size: 17px; padding: .65rem .8rem; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); }
.input:focus { border-color: var(--accent); outline: none; }
.input.right { border-color: var(--good); background: var(--good-soft); }
.input.wrong { border-color: var(--bad); background: var(--bad-soft); }
.input.small { width: auto; max-width: 8rem; }
.big-input { font-size: 1.6rem; text-align: center; max-width: 12rem; font-variant-numeric: tabular-nums; }
textarea.input { resize: vertical; }
/* extra-letter keys above the keyboard: up to nine (á é í ó ú ñ ü ¿ ¡) share one row, down to a 320 px screen */
.umlauts { display: flex; flex-wrap: nowrap; gap: clamp(3px, 1.1vw, .35rem); width: 100%; }
.umlauts button { flex: 1 1 40px; min-width: 0; max-width: 46px; height: 38px; padding: 0; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface-2); font-weight: 600; font-size: 1.05rem; }
.seg-group { display: inline-flex; background: var(--surface-2); border-radius: var(--r-sm); padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg-group.wide { display: flex; }
.seg-group.wide .seg { flex: 1; }
.seg { border: 0; background: transparent; padding: .45rem .7rem; border-radius: 6px; font-weight: 600; font-size: .88rem; color: var(--muted); }
.seg.on { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.toggle { display: flex; align-items: center; gap: .5rem; padding: .35rem 0; }
.toggle input { width: 20px; height: 20px; accent-color: var(--accent); }
details summary { cursor: pointer; font-weight: 600; padding: .4rem 0; }
.stat-pill { display: flex; flex-direction: column; align-items: center; padding: .45rem .3rem; border-radius: var(--r-sm); background: var(--surface-2); min-width: 0; }
.stat-pill b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.stat-pill span { font-size: .72rem; color: var(--muted); text-align: center; }
.word-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; }
.ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.ring svg { position: absolute; inset: 0; }
.ring circle { transition: stroke-dashoffset .6s ease; }
.ring-label { position: relative; font-weight: 700; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; }
.ring-label small { color: var(--muted); font-weight: 500; font-size: .7rem; }
.quest-bar { height: 7px; border-radius: 99px; background: var(--surface-2); overflow: hidden; flex: 1; min-width: 40px; }
.quest-fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width .5s ease; }

/* ---------- today ---------- */
.today-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.streak-line { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; font-size: .95rem; }
.streak { display: inline-flex; align-items: center; gap: .25rem; color: var(--muted); }
.streak.on { color: var(--orange-ink); }
.streak b { font-size: 1.2rem; }
.joker { display: inline-flex; align-items: center; gap: .2rem; color: var(--accent); font-weight: 600; }
.risk { color: var(--mid); font-weight: 600; font-size: .88rem; }
.ok { color: var(--good); font-weight: 600; font-size: .88rem; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: .3rem; }
.wday { display: flex; flex-direction: column; align-items: center; gap: .2rem; font-size: .72rem; color: var(--muted); }
.wd-dot { width: 28px; height: 28px; border-radius: 50%; border: 1.5px dashed var(--line); display: grid; place-items: center; }
.wday.met .wd-dot { background: var(--gold); border: 0; color: #3A2600; }
.wday.joker .wd-dot { background: var(--teal-soft); border: 0; color: var(--teal); }
.wday.today .wd-name { color: var(--ink); font-weight: 700; }
.wday.today .wd-dot { border-color: var(--accent); border-style: solid; }
.tasks { display: flex; flex-direction: column; }
.task { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .75rem; padding: .7rem .1rem; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; width: 100%; }
.task:first-child { border-top: 0; }
.task-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.task.done .task-icon { background: var(--good-soft); color: var(--good); }
.task-text { display: flex; flex-direction: column; min-width: 0; }
.task-text .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task.done .task-text strong { text-decoration: line-through; text-decoration-color: var(--good); text-decoration-thickness: 2px; color: var(--muted); }
.task-xp { font-weight: 700; color: var(--accent); font-size: .9rem; font-variant-numeric: tabular-nums; }
.task.done .task-xp { color: var(--good); }
.quest { display: grid; grid-template-columns: 1fr 70px auto; align-items: center; gap: .6rem; padding: .45rem 0; }
.quest-text { min-width: 0; font-size: .95rem; }
.quest-xp { font-weight: 700; font-size: .85rem; color: var(--accent); min-width: 2.2rem; text-align: right; }
.quest.done .quest-fill { background: var(--good); }
.quest.done .quest-xp { color: var(--good); }
.article-card { border-left: 4px solid var(--margin); }
.article-card h3 { font-size: 1.6rem; margin: .3rem 0 .1rem; }
.article-card.read { box-shadow: none; } /* read: flat instead of faded, so its text keeps full contrast */
.fun-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.fun-card { display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; padding: .8rem; color: var(--ink); }
.fun-card .ic { color: var(--accent); }
.fun-card strong { font-size: .95rem; line-height: 1.2; }
@media (max-width: 380px) { .fun-row { grid-template-columns: 1fr 1fr; } }
.wod { background: linear-gradient(var(--surface), var(--surface)) padding-box; position: relative; }
.wod-word { font: 700 1.9rem/1.15 var(--font-display); display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin: .2rem 0; }
.wod-sub { display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: baseline; }
.wod-story { color: var(--ink); }
.journey { cursor: pointer; }
.journey-line { display: flex; align-items: center; gap: .35rem; margin-bottom: .45rem; flex-wrap: wrap; }

/* ---------- course ---------- */
.level { display: flex; flex-direction: column; gap: .5rem; margin-top: .6rem; }
.level-head { display: grid; grid-template-columns: auto 1fr auto; gap: .7rem; align-items: center; }
.level-badge { font: 700 1.1rem/1 var(--font-display); background: var(--ink); color: var(--bg); padding: .4rem .5rem; border-radius: 6px; }
.level-badge.small { font-size: .8rem; padding: .2rem .35rem; }
.lesson-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.lesson-row { display: grid; grid-template-columns: auto 1fr auto; gap: .75rem; align-items: center; padding: .7rem .9rem; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; }
.lesson-row:first-child { border-top: 0; }
.lesson-num { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.lesson-row.done .lesson-num { background: var(--good); border-color: var(--good); color: var(--surface); }
.lesson-row.next { background: var(--accent-soft); }
.lesson-row.next .lesson-num { border-color: var(--accent); color: var(--accent); }
.lesson-text { display: flex; flex-direction: column; min-width: 0; }
.mini-words { display: flex; flex-direction: column; gap: .3rem; padding: .3rem 0; }
.mini-word { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.word-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.word-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto; gap: .6rem; align-items: center; padding: .6rem .8rem; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; }
.word-row:first-child { border-top: 0; }
.word-de { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.word-en { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strength { display: inline-flex; gap: 2px; }
.strength i { width: 6px; height: 14px; border-radius: 2px; background: var(--line); }
.strength.s1 i:nth-child(1), .strength.s2 i:nth-child(-n+2), .strength.s3 i { background: var(--good); }
.strength.s1 i:nth-child(1) { background: var(--mid); }
.word-en, .word-sheet .word-en { margin: .2rem 0; }
.word-sheet .word-en, .word-pop .word-en { font-size: 1.15rem; font-weight: 500; }
.gram { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .4rem .9rem; }
.gram.locked { opacity: .65; }
.note { padding: .4rem 0 .6rem; }
.note + .note { border-top: 1px dashed var(--line); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: .5rem 0; }
.gtable { border-collapse: collapse; min-width: 60%; font-size: .95rem; }
.gtable th, .gtable td { border-bottom: 1px solid var(--line); padding: 0; text-align: left; }
.gtable thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .3rem .6rem; }
.gtable tbody th { color: var(--muted); font-weight: 500; }
.cell-say { border: 0; background: none; padding: .35rem .6rem; text-align: left; width: 100%; }
.gtable td .cell-say { font-weight: 600; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; opacity: 0; transition: opacity .2s ease; }
.overlay.in { opacity: 1; }
.overlay.closing { pointer-events: none; }
/* full-screen layers are opaque at once: a fade that stalls (throttled or background view) left the
   page below showing through a lesson or drill, both readable at the same time */
.session-layer, .reader-layer, .game-layer { background: var(--bg); opacity: 1; transition: none; }
.sheet-layer { background: rgba(40, 20, 10, .45); }
.sheet-wrap { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 640px; max-height: 88vh; max-height: 88dvh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 16px 16px 0 0; box-shadow: var(--shadow);
  transform: translateY(30px); transition: transform .22s ease;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.overlay.in .sheet { transform: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .8rem max(16px, env(safe-area-inset-right, 0px)) .4rem max(16px, env(safe-area-inset-left, 0px)); }
.sheet-head h2 { font-family: var(--font-display); font-size: 1.5rem; }
.sheet-body { overflow-y: auto; padding: .2rem max(16px, env(safe-area-inset-right, 0px)) 1rem max(16px, env(safe-area-inset-left, 0px)); -webkit-overflow-scrolling: touch; }
.sheet-actions { display: flex; gap: .5rem; padding: .6rem max(16px, env(safe-area-inset-right, 0px)) .9rem max(16px, env(safe-area-inset-left, 0px)); border-top: 1px solid var(--line); }
.sheet-actions .btn { flex: 1; }
.toasts { position: fixed; z-index: 90; left: 0; right: 0; top: calc(env(safe-area-inset-top, 0px) + 10px); display: flex; flex-direction: column; align-items: center; gap: .4rem; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: auto; max-width: 420px; width: 100%; background: var(--ink); color: var(--bg); border-radius: var(--r); padding: .65rem .9rem; box-shadow: var(--shadow); display: flex; flex-direction: column; transform: translateY(-12px); opacity: 0; transition: all .25s ease; }
.toast span { font-size: .85rem; opacity: .85; }
.toast.bad { background: var(--bad); color: var(--on-fill); }
.toast.in { transform: none; opacity: 1; }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 95; }

/* ---------- session ---------- */
.session { position: absolute; inset: 0; display: flex; flex-direction: column; max-width: 680px; margin: 0 auto; padding-top: env(safe-area-inset-top, 0px); }
.session-head { display: flex; align-items: center; gap: .6rem; padding: .4rem max(12px, env(safe-area-inset-right, 0px)) .4rem max(8px, env(safe-area-inset-left, 0px)); border-bottom: 1px solid var(--line); min-height: 54px; }
.pbar { flex: 1; height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.pbar-fill { height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .35s ease; }
.counter, .game-score { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.game-title { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.session-body, .game-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 1.1rem max(16px, env(safe-area-inset-right, 0px)) 1.5rem max(16px, env(safe-area-inset-left, 0px)); }
.session-body > .profile { display: flex; flex-direction: column; gap: 1rem; }
.session-foot { border-top: 1px solid var(--line); background: var(--surface); padding: .7rem max(16px, env(safe-area-inset-right, 0px)) calc(.7rem + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: .5rem; }
.foot-secondary:empty { display: none; }
.foot-secondary .row { justify-content: space-between; }
.feedback:empty { display: none; }
.feedback { border-radius: var(--r-sm); padding: .6rem .8rem; display: flex; flex-direction: column; gap: .25rem; }
.feedback.good { background: var(--good-soft); color: var(--good); }
.feedback.bad { background: var(--bad-soft); color: var(--bad); }
.fb-title { display: flex; align-items: center; gap: .35rem; font-weight: 700; font-size: 1.1rem; }
.fb-sub { font-size: .85rem; }
.fb-correct { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; color: var(--ink); font-weight: 600; }
.fb-note, .fb-why { color: var(--ink); font-size: .92rem; }
.fb-why { border-left: 3px solid currentColor; padding-left: .5rem; opacity: .9; }
.step { display: flex; flex-direction: column; gap: .9rem; }
.step.intro { padding-top: 1rem; }
.step.intro h1.display { font-size: 2.6rem; }
.goal { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--margin); border-radius: var(--r-sm); padding: .7rem .9rem; }
.step.notes { gap: .4rem; }
.step.notes .note { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .8rem .95rem; }
.step.notes .note + .note { border-top: 1px solid var(--line); }
.prompt { font-weight: 600; font-size: 1.05rem; }
.de-line { font-size: 1.35rem; font-weight: 500; line-height: 1.6; display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem; }
.de-line .input.inline { width: auto; min-width: 7rem; max-width: 100%; flex: 1 1 7rem; padding: .3rem .55rem; font-size: 1.2rem; border-width: 0 0 2px; border-radius: 4px 4px 0 0; background: var(--accent-soft); }
.gap { color: var(--accent); font-weight: 700; letter-spacing: .1em; }
.proverb { font-size: 1.4rem; }
.hint { color: var(--muted); font-size: .95rem; }
.en-src { font-size: 1.2rem; padding: .7rem .9rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); }
.options { display: flex; flex-direction: column; gap: .5rem; }
.option { text-align: left; padding: .8rem 1rem; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--surface); font-size: 1.05rem; min-height: 50px; }
.option:active:not(:disabled) { border-color: var(--accent); }
.option.right { border-color: var(--good); background: var(--good-soft); color: var(--good); font-weight: 600; }
.option.wrong { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.big-audio { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: .6rem 0; }
.big-audio .play { width: 64px; height: 64px; }
.big-audio .play + .play { width: 52px; height: 52px; }
.vocab-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.vocab-row { display: flex; align-items: center; gap: .5rem; padding: .7rem .8rem; border-top: 1px solid var(--line); }
.vocab-list > .vocab-row:first-child { border-top: 0; }
.vocab-main { flex: 1; min-width: 0; cursor: pointer; }
.vocab-de { font-size: 1.2rem; font-weight: 600; }
.vocab-sub { display: flex; flex-wrap: wrap; gap: .1rem .6rem; align-items: baseline; }
.vocab-en { color: var(--muted); }
.vocab-actions { display: flex; align-items: center; gap: .2rem; }
.vocab-detail { padding: .3rem .8rem .9rem; background: var(--surface-2); display: flex; flex-direction: column; gap: .5rem; }
.example { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem .6rem; }
.example .de, .example .es, .example span[lang="de"], .example span[lang="es"] { font-weight: 500; }
.dialogue { display: flex; flex-direction: column; gap: .6rem; }
.dl-line { display: grid; grid-template-columns: 1fr auto; gap: .2rem .5rem; align-items: end; max-width: 92%; }
.dl-line .dl-who { grid-column: 1 / -1; font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.dl-line.right { margin-left: auto; }
.dl-bubble { background: var(--surface); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: .55rem .8rem; min-width: 0; }
.dl-line.right .dl-bubble { border-radius: 14px 14px 4px 14px; background: var(--accent-soft); border-color: transparent; }
.dl-line.active .dl-bubble { outline: 2px solid var(--accent); }
.dl-line.me { max-width: 100%; display: block; }
.dl-de { font-size: 1.08rem; }
.dl-en { color: var(--muted); font-size: .88rem; margin-top: .15rem; }
.order-line { min-height: 56px; border-bottom: 2px solid var(--line); display: flex; flex-wrap: wrap; gap: .4rem; padding: .4rem 0; align-items: center; }
.order-line.right { border-color: var(--good); }
.order-line.wrong { border-color: var(--bad); animation: shake .35s; }
.order-bank { display: flex; flex-wrap: wrap; gap: .45rem; justify-content: center; padding-top: .4rem; }
.tile { padding: .5rem .8rem; border-radius: var(--r-sm); border: 1.5px solid var(--line); border-bottom-width: 3px; background: var(--surface); font-size: 1.08rem; font-weight: 500; min-height: 44px; }
.tile.used { visibility: hidden; }
.diff { font-size: 1.05rem; color: var(--ink); }
.diff .miss { background: var(--marker); color: #2B2300; border-radius: 3px; padding: 0 .15rem; }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.match-col { display: flex; flex-direction: column; gap: .5rem; }
.match-btn { padding: .7rem .6rem; min-height: 50px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--surface); font-size: .98rem; }
.match-btn.sel { border-color: var(--accent); background: var(--accent-soft); }
.match-btn.done { border-color: var(--good); background: var(--good-soft); color: var(--good); opacity: .85; }
.shake { animation: shake .35s; border-color: var(--bad) !important; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.read-text { font-size: 1.12rem; line-height: 1.7; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--margin); border-radius: var(--r-sm); padding: .8rem 1rem; }
.read-sent { display: inline; border: 0; background: none; padding: 0; text-align: left; font: inherit; color: inherit; }
.read-sent:active { background: var(--accent-soft); }
.read-en { color: var(--muted); font-size: .95rem; }
.read-qs { display: flex; flex-direction: column; gap: .6rem; }
.checklist { list-style: none; padding: 0; margin: .3rem 0; display: flex; flex-direction: column; gap: .25rem; }
.checklist li { display: flex; align-items: center; gap: .4rem; }
.checklist li.ok { color: var(--good); }
.checklist li.no { color: var(--bad); }
.model { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r-sm); padding: .6rem .8rem; }
.write-out { display: flex; flex-direction: column; gap: .6rem; }
.roleplay { display: flex; flex-direction: column; gap: .7rem; }
.answer-transcript { min-height: 1.6rem; font-size: 1.15rem; text-align: center; color: var(--accent); font-weight: 500; }
.summary { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .6rem; padding-top: 1.5rem; }
.summary h2 { font-family: var(--font-display); font-size: 2rem; }
.summary-badge { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: var(--good-soft); color: var(--good); }
.summary-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: .5rem; width: 100%; max-width: 420px; margin: .6rem 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .6rem .3rem; }
.stat-v { font: 700 1.6rem/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.stat-l { font-size: .75rem; color: var(--muted); }
.summary-note { color: var(--muted); max-width: 30rem; }

/* ---------- speak panel ---------- */
.speak-panel { display: flex; flex-direction: column; gap: .8rem; }
.speak-panel.compact { gap: .55rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .75rem; }
.sp-target { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .8rem .9rem; }
.compact .sp-target { border: 0; padding: 0; }
.sp-words { font-size: 1.45rem; font-weight: 500; line-height: 1.6; }
.compact .sp-words { font-size: 1.15rem; }
.sp-words.blurred { filter: blur(6px); }
.sp-word { border: 0; background: none; padding: 0 .05rem; font: inherit; color: inherit; border-radius: 4px; }
.sp-word .snd { text-decoration: underline 2px var(--marker); text-underline-offset: 4px; }
.sp-word.w-ok { color: var(--good); }
.sp-word.w-close { color: var(--mid); background: var(--mid-soft); }
.sp-word.w-miss { color: var(--bad); background: var(--bad-soft); text-decoration: underline wavy var(--bad); }
.sp-meta { display: flex; flex-direction: column; gap: .1rem; margin-top: .2rem; }
.sp-en { color: var(--muted); font-size: .95rem; }
.sp-controls { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.rec-wrap { display: flex; flex-direction: column; align-items: center; gap: .3rem; margin-left: auto; }
.step > .rec-wrap, .answer-transcript + .rec-wrap { margin: 0 auto; }
.rec-btn { width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--bad); color: var(--on-fill); display: grid; place-items: center; box-shadow: 0 3px 0 color-mix(in srgb, var(--bad) 55%, #000); }
.compact .rec-btn { width: 56px; height: 56px; }
.rec-btn.live { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bad) 50%, transparent); } 50% { box-shadow: 0 0 0 14px transparent; } }
.rec-label { font-size: .78rem; color: var(--muted); text-align: center; max-width: 9rem; }
.sp-live { min-height: 1.2rem; color: var(--accent); font-style: italic; }
.sp-live:empty { display: none; }
.sp-result { display: flex; flex-direction: column; gap: .7rem; }
.sp-result:empty { display: none; }
.sp-score { display: flex; align-items: center; gap: .9rem; }
.dial { --p: 0; width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--c, var(--accent)) calc(var(--p) * 1%), var(--surface-2) 0); }
.dial span { width: 52px; height: 52px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font: 700 1.3rem/1 var(--font-display); }
.dial.good { --c: var(--good); } .dial.mid { --c: var(--mid); } .dial.low { --c: var(--bad); }
.verdict { font: 700 1.4rem/1.1 var(--font-display); }
.heard { font-size: .92rem; margin-top: .15rem; }
.heard q { font-style: italic; }
.tips { display: flex; flex-direction: column; gap: .5rem; }
.tip { border: 1px solid var(--line); border-left: 4px solid var(--marker); border-radius: var(--r-sm); padding: .6rem .75rem; background: var(--surface); }
.tip-head { display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; }
.tip-ipa { font-family: var(--font-ipa); font-size: 1.15rem; color: var(--teal); }
.tip p { margin: .3rem 0 .45rem; font-size: .93rem; }
.self-rate { display: flex; flex-direction: column; gap: .4rem; }

/* ---------- sound guide ---------- */
.sound-grid-wrap { display: flex; flex-direction: column; gap: .8rem; }
.sound-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .45rem; margin-top: .3rem; }
.sound-tile { display: flex; flex-direction: column; align-items: flex-start; gap: .05rem; padding: .55rem .6rem; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface-2); text-align: left; }
.st-ipa { font-family: var(--font-ipa); font-size: 1.2rem; color: var(--teal); }
.st-name { font-size: .82rem; font-weight: 600; }
.st-score { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.sound-tile.good { border-color: var(--good); } .sound-tile.mid { border-color: var(--mid); } .sound-tile.low { border-color: var(--bad); background: var(--bad-soft); }
.sound-hero { display: flex; align-items: center; gap: 1rem; }
.big-ipa { font-family: var(--font-ipa); font-size: 2.6rem; color: var(--teal); min-width: 4rem; text-align: center; }
.sound-detail { display: flex; flex-direction: column; gap: .4rem; }
.example-list { display: flex; flex-direction: column; gap: .35rem; }
.pair { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; padding: .2rem 0; }
.recent { display: flex; flex-direction: column; }
.recent-row { display: flex; justify-content: space-between; gap: .6rem; padding: .45rem 0; border-top: 1px solid var(--line); }
.recent-row:first-child { border-top: 0; }
.score-pill { font-weight: 700; font-size: .85rem; padding: .1rem .5rem; border-radius: 99px; height: fit-content; }
.score-pill.good { background: var(--good-soft); color: var(--good); } .score-pill.mid { background: var(--mid-soft); color: var(--mid); } .score-pill.low { background: var(--bad-soft); color: var(--bad); }

/* ---------- reader ---------- */
.reader { position: absolute; inset: 0; display: flex; flex-direction: column; max-width: 680px; margin: 0 auto; padding-top: env(safe-area-inset-top, 0px); }
.reader-head { display: flex; align-items: center; gap: .6rem; padding: .4rem max(12px, env(safe-area-inset-right, 0px)) .4rem max(8px, env(safe-area-inset-left, 0px)); border-bottom: 1px solid var(--line); }
.reader-meta { display: flex; gap: .5rem; align-items: center; }
.kind { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--margin); }
.level { font-size: .75rem; font-weight: 700; }
.reader-meta .level { background: var(--ink); color: var(--bg); padding: .1rem .4rem; border-radius: 4px; }
.reader-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 1rem max(16px, env(safe-area-inset-right, 0px)) 2rem max(16px, env(safe-area-inset-left, 0px)); }
.art-title { font-size: 2.3rem; }
.art-sub { color: var(--muted); font-size: 1.05rem; }
.art-text { margin-top: 1rem; border-left: 2px solid var(--margin); padding-left: .9rem; display: flex; flex-direction: column; gap: .2rem; }
.art-block { padding: .45rem .5rem; border-radius: var(--r-sm); transition: background .2s; }
.art-block.active { background: color-mix(in srgb, var(--marker) var(--marker-b), transparent); }
.art-text.ear-only .art-block:not(.revealed) .art-de, .art-text.ear-only .art-block:not(.revealed) .art-en { filter: blur(7px); user-select: none; }
.art-text.ear-only .art-block:not(.revealed) { cursor: pointer; }
.art-row { display: flex; gap: .3rem; align-items: flex-start; }
.art-de { flex: 1; margin: 0; font-size: 1.2rem; line-height: 1.6; }
.art-en { margin: .1rem 0 0; color: var(--muted); font-size: .95rem; font-style: italic; }
.w { border: 0; background: none; padding: 0; font: inherit; color: inherit; border-radius: 3px; }
.w.has-gloss { text-decoration: underline dotted color-mix(in srgb, var(--teal) 80%, transparent); text-underline-offset: 4px; }
.w:active { background: var(--accent-soft); }
.moral { margin: 1.2rem 0; padding: .8rem 1rem; border-radius: var(--r-sm); background: var(--accent-soft); }
.art-quiz { margin-top: 1.2rem; display: flex; flex-direction: column; gap: .6rem; }
.art-done { display: flex; gap: .7rem; align-items: center; background: var(--good-soft); color: var(--good); padding: .8rem; border-radius: var(--r-sm); }
.art-done .muted { color: var(--ink); opacity: .75; }
.player { border-top: 1px solid var(--line); background: var(--surface); padding: .55rem max(12px, env(safe-area-inset-right, 0px)) calc(.55rem + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: .45rem; }
.player-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.player-row.small { gap: .4rem; }
.player-play { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.player .seg-group { margin-left: auto; }
.shadow-box { position: sticky; bottom: 0; margin-top: 1rem; background: var(--bg); padding: .5rem 0; display: flex; flex-direction: column; gap: .5rem; }
.word-pop { display: flex; flex-direction: column; gap: .6rem; }
.article-hero { display: flex; flex-direction: column; gap: .3rem; border-left: 4px solid var(--margin); }
.article-hero h2 { font-size: 2rem; }
.article-hero .btn { align-self: flex-start; margin-top: .4rem; }
.list-row { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--line); background: none; padding: .6rem 0; }
.archive .list-row:first-child { border-top: 0; }

/* ---------- games ---------- */
.game { position: absolute; inset: 0; display: flex; flex-direction: column; max-width: 680px; margin: 0 auto; padding-top: env(safe-area-inset-top, 0px); }
.game-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.game-tile { display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; padding: .9rem; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); text-align: left; box-shadow: var(--shadow); min-width: 0; }
.game-tile .ic { color: var(--accent); }
.game-tile.featured { border: 2px solid var(--accent); }
.game-best { font-size: .78rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.fuenf-hero { display: flex; gap: 1rem; align-items: center; }
.fuenf-mini { display: grid; grid-template-columns: repeat(5, 26px); gap: 3px; flex: none; }
.fuenf-mini .f-cell { width: 26px; height: 26px; font-size: .85rem; }
.fuenf { display: flex; flex-direction: column; align-items: center; gap: .8rem; }
.fuenf-grid { display: grid; gap: 5px; }
.f-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.f-cell { width: min(13vw, 54px); height: min(13vw, 54px); display: grid; place-items: center; border: 2px solid var(--line); border-radius: 6px; font: 700 1.6rem/1 var(--font-display); text-transform: uppercase; background: var(--surface); }
.f-cell.filled { border-color: var(--muted); }
.f-cell.correct { background: var(--good); border-color: var(--good); color: var(--on-fill); }
.f-cell.present { background: var(--gold); border-color: var(--gold); color: #3A2600; }
.f-cell.absent { background: var(--muted); border-color: var(--muted); color: var(--surface); }
.fuenf-info { min-height: 1rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.fuenf-reveal { display: flex; flex-direction: column; align-items: center; gap: .2rem; }
.f-word { font: 700 1.8rem/1.1 var(--font-display); }
.kb { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 520px; }
.kb-row { display: flex; gap: 4px; justify-content: center; }
.key { flex: 1; min-width: 0; height: 50px; border-radius: 6px; border: 0; background: var(--surface-2); font-weight: 700; font-size: 1rem; padding: 0; }
.key.wide { flex: 1.6; font-size: .8rem; }
.key.correct { background: var(--good); color: var(--on-fill); } .key.present { background: var(--gold); color: #3A2600; } .key.absent { background: var(--muted); color: var(--surface); }
.blitz { display: flex; flex-direction: column; align-items: center; gap: 1rem; text-align: center; }
.blitz .pbar { width: 100%; }
.blitz-word { font: 700 3rem/1.1 var(--font-display); margin-top: 1.5rem; word-break: break-word; }
.blitz-word.flash-bad { color: var(--bad); }
.blitz-combo { min-height: 1.4rem; font-weight: 700; color: var(--accent); }
.blitz-btns { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; width: 100%; max-width: 420px; }
.blitz-btn { height: 84px; border-radius: var(--r); border: 0; font: 700 1.7rem/1 var(--font-display); color: var(--on-fill); }
.art-el { background: var(--el); } .art-la { background: var(--la); }
.sp-syl { letter-spacing: .02em; }
.path-end { margin: 1rem 0; text-align: center; display: flex; flex-direction: column; gap: .3rem; }
.mem-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.mem-card { position: relative; height: 92px; border: 0; padding: 0; background: none; perspective: 600px; }
.mem-front, .mem-back { position: absolute; inset: 0; display: grid; place-items: center; padding: .4rem; border-radius: var(--r-sm); backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .35s ease; text-align: center; font-size: .95rem; line-height: 1.2; }
.mem-front { background: var(--accent); color: var(--accent-ink); font: 700 1.8rem/1 var(--font-display); }
.mem-back { background: var(--surface); border: 1.5px solid var(--line); transform: rotateY(180deg); }
.mem-back.de, .mem-back.es { font-weight: 600; }
.mem-card.flip .mem-front { transform: rotateY(180deg); }
.mem-card.flip .mem-back { transform: none; }
.mem-card.match .mem-back { border-color: var(--good); background: var(--good-soft); }
.reveal { display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; }
.order-line.compound .tile { margin-right: -.3rem; }

/* ---------- profile ---------- */
.rank-card .row { align-items: center; gap: 1rem; }
.rank-mark { font: 700 1.6rem/1 var(--font-display); }
.rank-ladder { display: flex; gap: .25rem; flex-wrap: wrap; margin: .8rem 0; }
.rung { font-size: .72rem; padding: .15rem .45rem; border-radius: 4px; background: var(--surface-2); color: var(--muted); }
.rung.on { background: var(--accent); color: var(--accent-ink); }
.bars { display: flex; align-items: flex-end; gap: .4rem; height: 120px; padding-top: .5rem; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .2rem; height: 100%; justify-content: flex-end; min-width: 0; }
.bar { width: 100%; max-width: 34px; background: var(--accent-soft); border-radius: 4px 4px 0 0; }
.bar.now { background: var(--accent); }
.bar-l { font-size: .65rem; color: var(--muted); white-space: nowrap; }
.route { display: flex; flex-direction: column; margin-top: .4rem; position: relative; }
.stop { display: grid; grid-template-columns: 22px 1fr auto; gap: .6rem; align-items: center; border: 0; background: none; text-align: left; padding: .35rem 0; position: relative; }
.stop::before { content: ""; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.stop:first-child::before { top: 50%; } .stop:last-child::before { bottom: 50%; }
.stop-dot { position: relative; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; z-index: 1; }
.stop.got .stop-dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.stop.next .stop-dot { border-color: var(--accent); }
.stop:disabled .stop-city { color: var(--muted); }
.stop.got .stop-city { font-weight: 600; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; margin-top: .4rem; }
.badge { display: flex; flex-direction: column; gap: .15rem; padding: .6rem; border-radius: var(--r-sm); border: 1px dashed var(--line); opacity: .55; }
.badge.got { opacity: 1; border-style: solid; border-color: var(--marker); background: color-mix(in srgb, var(--marker) 14%, var(--surface)); }
.badge .ic { color: var(--accent); }
.skill { display: grid; grid-template-columns: 6.5rem 1fr 4.5rem; gap: .6rem; align-items: center; padding: .25rem 0; font-size: .92rem; }
.settings .seg-group { margin-top: .3rem; }
.settings input[type="range"] { flex: 1; accent-color: var(--accent); }
.postcard { display: flex; flex-direction: column; gap: .4rem; position: relative; padding: 1rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); }
.postcard h2 { font-size: 2.2rem; padding-right: 70px; overflow-wrap: anywhere; } /* clear of the stamp: long city names */
.pc-stamp { position: absolute; top: .8rem; right: .8rem; width: 62px; height: 74px; border: 2px dashed var(--margin); border-radius: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--margin); transform: rotate(4deg); }
.pc-stamp span { font: 700 1.6rem/1 var(--font-display); }
.pc-stamp small { font-size: .6rem; text-transform: uppercase; letter-spacing: .05em; }
.wrong-form { color: var(--bad); text-decoration-color: var(--bad); }
.option.sel { border-color: var(--accent); background: var(--accent-soft); }
.hs-now { min-height: 1.4rem; font-weight: 600; color: var(--accent); }
.write-points { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: .2rem; }
.write-area { font-size: 17px; line-height: 1.5; }
.useful summary { font-size: .92rem; }
.useful .chips { padding: .4rem 0; }
.muted.ok { color: var(--good); }
.ai-feedback { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--r-sm); padding: .7rem .8rem; display: flex; flex-direction: column; gap: .5rem; background: var(--surface); }
.ai-comments { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .45rem; }
.ai-was { text-decoration: line-through; text-decoration-color: var(--bad); color: var(--muted); }
.grammar-card { display: flex; flex-direction: column; gap: .5rem; }
.g-rules { margin: .2rem 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .35rem; }
.g-rules.pitfalls li::marker { color: var(--bad); }
.level-line { display: grid; grid-template-columns: auto 1fr auto; gap: .6rem; align-items: center; }
.forecast { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .6rem .8rem; }
.small-bars { height: 80px; }
.bar-n { font-size: .7rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.own-row { display: flex; align-items: center; justify-content: space-between; }
.own-open { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 0; }
.own-tr a { color: var(--accent); font-style: normal; font-size: .85rem; }
.melody-row { display: flex; flex-direction: column; gap: .3rem; border-top: 1px dashed var(--line); padding-top: .6rem; }
.syl-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: 1rem 0 .4rem; }
.syl { min-width: 54px; padding: .7rem .6rem; border-radius: var(--r-sm); border: 1.5px solid var(--line); border-bottom-width: 3px; background: var(--surface); font: 600 1.5rem/1 var(--font-display); }
.syl.right { border-color: var(--good); background: var(--good-soft); color: var(--good); text-transform: uppercase; }
.syl.wrong { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.chat-log { display: flex; flex-direction: column; gap: .7rem; }
.chat-status { min-height: 1.2rem; padding-top: .4rem; }
.chat-foot .row { align-items: flex-end; }
.chat-foot textarea { flex: 1; min-height: 44px; }
.small-rec { width: 48px !important; height: 48px !important; flex: none; }
.chat-actions { gap: .2rem; }
.chat-fix { margin-top: .45rem; padding-top: .4rem; border-top: 1px dashed var(--line); color: var(--good); display: flex; flex-direction: column; gap: .2rem; }
.chat-fix .small { color: var(--ink); opacity: .8; }
.chat-ok { margin-top: .3rem; color: var(--good); font-size: .8rem; font-weight: 600; }
.chat-words { margin-top: .4rem; }
.me-chat { max-width: 92%; }
.scenario-list { display: flex; flex-direction: column; }
.scenario { gap: .4rem; align-items: center; }
.spark { display: inline-flex; line-height: 0; }
.recap { display: flex; flex-direction: column; gap: .5rem; }
.recap .summary-stats { max-width: none; }
.art-actions { display: flex; flex-direction: column; flex: none; }
.art-row .mine { opacity: .55; }
.art-row .mine.on { opacity: 1; color: var(--good); }
.packs summary { padding: 0; }
.packs .seg-group { margin-top: .5rem; }
.pack-list { display: flex; flex-direction: column; margin-top: .5rem; }
.pack-row { display: grid; grid-template-columns: auto 1fr auto; gap: .6rem; align-items: center; padding: .55rem 0; border-top: 1px solid var(--line); }
.pack-row.on .pack-text strong { color: var(--accent); }
.pack-text { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.known { display: flex; align-items: center; gap: .6rem; margin: .4rem 0 .2rem; }
.known .quest-bar { max-width: 140px; }
.pendel { display: flex; flex-direction: column; align-items: center; gap: 1rem; text-align: center; }
.pendel-phase { display: flex; flex-direction: column; gap: .1rem; }
.pendel-phase strong { font: 700 1.6rem/1.1 var(--font-display); color: var(--accent); }
.pendel-card { width: 100%; min-height: 240px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--margin); border-radius: var(--r); padding: 1.4rem 1rem; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .8rem; }
.pendel-en { font-size: 1.35rem; color: var(--muted); }
.pendel-count { font: 700 3rem/1 var(--font-display); color: var(--accent); min-height: 3rem; }
.pendel-de { font-size: 1.7rem; font-weight: 600; min-height: 2.2rem; }
.pendel-de.shown { color: var(--ink); }
.player-row.center { justify-content: center; }
.player-play.big { width: 64px; height: 64px; }
.center { text-align: center; }
.cert-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.cert-mini { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .7rem 1rem; border: 2px solid var(--marker); border-radius: var(--r-sm); background: var(--surface-2); }
.certificate { text-align: center; padding: 1.4rem 1rem; border: 3px double var(--accent); border-radius: var(--r); background: var(--surface-2); display: flex; flex-direction: column; gap: .5rem; align-items: center; }
.cert-level { font: 700 4.5rem/1 var(--font-display); color: var(--accent); }
.welcome-list { padding-left: 1.1rem; display: flex; flex-direction: column; gap: .4rem; }
.lesson-sheet, .word-sheet { display: flex; flex-direction: column; gap: .5rem; }

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

/* ---------- Modelltest ---------- */
.exam-parts { display: flex; flex-direction: column; gap: .5rem; }
.exam-part { display: grid; grid-template-columns: 24px 1fr; column-gap: .6rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .6rem .8rem; }
.exam-part > .muted { grid-column: 2; }
.exam-text { display: flex; flex-direction: column; gap: .75rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .9rem 1rem; }
.exam-text h2 { margin: 0; font-size: 1.15rem; }
.exam-text .chip-btn { align-self: flex-start; }
.exam-reading { font-family: "Gentium Book Plus", Georgia, serif; font-size: 1.08rem; line-height: 1.6; margin: 0; }
.exam-say { display: flex; flex-direction: column; gap: .45rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.exam-say .row { display: flex; gap: .6rem; align-items: center; }
.exam-say textarea { flex: 1; min-width: 0; font-size: 16px; }
.rec-btn.small-rec { width: 52px; height: 52px; flex: none; }
.counter.over { color: var(--bad); }
.exam-scores { display: flex; flex-direction: column; gap: .55rem; }
.exam-score { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--bad); border-radius: var(--r-sm); padding: .55rem .8rem; display: flex; flex-direction: column; gap: .35rem; }
.exam-score.pass { border-left-color: var(--good); }
.exam-score .row { display: flex; gap: .5rem; align-items: center; }
.exam-pct { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.exam-score .quest-bar { flex: none; }
.exam-score.fail .quest-fill { background: var(--bad); }
.exam-review { list-style: none; padding: 0; margin: .4rem 0; display: flex; flex-direction: column; gap: .4rem; }
.exam-review li { display: flex; flex-wrap: wrap; gap: .35rem; align-items: baseline; }
.exam-review li.ok > svg { color: var(--good); }
.exam-review li.no > svg { color: var(--bad); }
.exam-review li > div { flex-basis: 100%; }
details > summary { cursor: pointer; font-weight: 600; padding: .45rem 0; }
.exam-card .row.wrap { margin-top: .3rem; }
.exam-hist { list-style: none; padding: 0; margin: .2rem 0 0; display: flex; flex-direction: column; gap: .35rem; }
.exam-hist li { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.exam-nudge { display: flex; flex-direction: column; gap: .7rem; border-left: 4px solid var(--accent); }
.exam-nudge .row { display: flex; gap: .6rem; align-items: center; }
.exam-nudge .row > svg { color: var(--accent); flex: none; }
.backup-nudge { display: flex; flex-direction: column; gap: .7rem; border-left: 4px solid var(--good); }
.backup-nudge .row { display: flex; gap: .6rem; align-items: center; }
.backup-nudge .row > svg { color: var(--good); flex: none; }

/* ---------- Activity heatmap ---------- */
.hm-wrap { display: flex; flex-direction: column; gap: 3px; overflow-x: auto; padding-bottom: 2px; }
.hm-months, .hm-grid { display: grid; grid-template-columns: repeat(var(--weeks, 20), minmax(10px, 1fr)); gap: 3px; min-width: calc(var(--weeks, 20) * 13px); }
.hm-grid { grid-template-rows: repeat(7, auto); grid-auto-flow: column; }
.hm-m { font-size: .65rem; color: var(--muted); white-space: nowrap; overflow: visible; height: 1em; line-height: 1; }
.hm { display: block; aspect-ratio: 1; border-radius: 3px; background: var(--surface-2); min-width: 10px; }
.hm.future { background: transparent; }
.hm-1 { background: var(--accent-soft); }
.hm-2 { background: var(--accent); opacity: .45; }
.hm-3 { background: var(--accent); opacity: .75; }
.hm-4 { background: var(--accent); }
.hm.today { outline: 2px solid var(--ink); outline-offset: 1px; }
.hm-legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; margin-top: .4rem; }
.hm-legend .hm { width: 11px; min-width: 11px; }

/* ---------- English hints next to the Spanish UI (hints.js) ---------- */
.en-hint { display: none; }
/* Hints are set apart by size and weight, not by fading: faded text fell under 4.5:1 on tinted and coloured surfaces.
   inline-block keeps a hint in one piece: if it does not fit behind its label it moves to the next line whole. */
.en-hints .en-hint { display: inline-block; margin-left: .3em; font-size: .78em; font-weight: 400; font-style: normal; letter-spacing: 0; text-transform: none; white-space: normal; }
.en-hints .en-hint::before { content: "("; }
.en-hints .en-hint::after { content: ")"; }
.en-hints .tabbar .en-hint, .en-hints .week .en-hint, .en-hints .seg .en-hint, .en-hints .stat-pill .en-hint { display: block; margin: 0; font-size: .62rem; line-height: 1.1; }
.en-hints .tabbar .en-hint::before, .en-hints .tabbar .en-hint::after, .en-hints .week .en-hint::before, .en-hints .week .en-hint::after,
.en-hints .seg .en-hint::before, .en-hints .seg .en-hint::after, .en-hints .stat-pill .en-hint::before, .en-hints .stat-pill .en-hint::after { content: none; }
/* A button that holds a label and its hint: the hint gets its own line under the label, centred, smaller and in a
   lighter weight. It is a grid (label row, hint row; one more column when there is an icon) so the hint can never
   become a narrow column beside the label, and the button is as wide as the longer of the two lines. */
.en-hints .btn:has(> .en-hint), .en-hints .link-btn:has(> .en-hint), .en-hints .chip-btn:has(> .en-hint) { display: inline-grid; grid-template-columns: auto; justify-content: center; justify-items: center; align-content: center; align-items: center; column-gap: .35rem; row-gap: 0; text-align: center; }
.en-hints .btn:has(> .ic):has(> .en-hint), .en-hints .link-btn:has(> .ic):has(> .en-hint), .en-hints .chip-btn:has(> .ic):has(> .en-hint) { grid-template-columns: auto auto; }
.en-hints .btn > .en-hint, .en-hints .link-btn > .en-hint, .en-hints .chip-btn > .en-hint { grid-column: 1 / -1; display: block; margin: 0; font-size: .72em; font-weight: 600; line-height: 1.2; }
.en-hints .btn > .en-hint::before, .en-hints .btn > .en-hint::after, .en-hints .link-btn > .en-hint::before, .en-hints .link-btn > .en-hint::after,
.en-hints .chip-btn > .en-hint::before, .en-hints .chip-btn > .en-hint::after { content: none; }
/* two buttons at the foot of a sheet share the row only while both fit on one line each; longer ones stack */
.en-hints .sheet-actions { flex-wrap: wrap; }
.en-hints .sheet-actions .btn { flex: 1 1 auto; }
/* a card heading and the status beside it: the status drops under the heading instead of squeezing it */
.en-hints .card-head { flex-wrap: wrap; }
/* filter chips keep label and hint on one line; in a swipeable row they keep their width (the row scrolls) */
.en-hints .chip > .en-hint { white-space: nowrap; }
.chips.scroll > * { flex: none; }
/* the daily-puzzle card: on a 320 px screen the sample row goes above the text instead of squeezing it */
@media (max-width: 359px) { .fuenf-hero { flex-direction: column; align-items: flex-start; } }

.fb-leech, .fb-mem { border-radius: var(--r-sm); padding: .5rem .7rem; font-size: .92rem; margin-top: .4rem; }
.fb-leech { background: var(--bad-soft); }
.fb-mem { background: var(--accent-soft); }
.useful-chip { display: inline-flex; flex-direction: column; align-items: flex-start; text-align: left; line-height: 1.25; }
.useful-chip .chip-en { font-size: .75em; color: var(--muted); }

/* ---------- Kurz-Lektion before games ---------- */
.pre-lesson h2 { margin: 0; }
.pl-list { display: flex; flex-direction: column; gap: .35rem; }
.pl-row { display: flex; align-items: center; gap: .7rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .5rem .7rem; transition: border-color .2s; }
.pl-row.on { border-color: var(--accent); }
.pl-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .6rem; min-width: 0; }
.pl-text strong { font-size: 1.1rem; }
.num-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .4rem; }
.num-chip { display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .45rem .3rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.num-chip b { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.num-chip span { font-size: .85rem; color: var(--muted); }
.num-chip.on { border-color: var(--accent); }

/* ---------- Falsche Freunde + Alphabet ---------- */
.ff-note { background: var(--mid-soft); border-left: 3px solid var(--mid); border-radius: var(--r-sm); padding: .5rem .7rem; font-size: .92rem; line-height: 1.4; margin: .35rem 0; }
.ff-note.compact { font-size: .82rem; padding: .3rem .55rem; margin: .3rem 0 0; flex-basis: 100%; }
.ff-word { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: 1.6rem; margin: .3rem 0 .6rem; }
.abc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: .35rem; }
.abc-tile { display: flex; flex-direction: column; align-items: center; gap: .05rem; padding: .4rem .2rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); min-width: 0; }
.abc-tile b { font-size: 1.3rem; }
.abc-tile span { font-size: .82rem; color: var(--muted); }
.abc-tile small { font-size: .68rem; color: var(--accent); line-height: 1.1; text-align: center; }
.abc-tile.tricky { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.abc-tile.on { border-color: var(--accent); background: var(--accent-soft); }
.abc-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; width: 100%; max-width: 360px; }
.abc-opt { font-size: 1.6rem; font-weight: 700; justify-content: center; text-align: center; }
.spell-chips { display: flex; flex-wrap: wrap; gap: .3rem; margin: .4rem 0; }
.spell-chip { display: flex; flex-direction: column; align-items: center; padding: .3rem .5rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); min-width: 2.6rem; }
.spell-chip b { font-size: 1.1rem; }
.spell-chip span { font-size: .75rem; color: var(--muted); }
.name-spell { margin-top: .4rem; }
.alphabet h3 { margin: .9rem 0 .2rem; }
/* ---------- Pictures (emoji drawn by the phone) ---------- */
.pic { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; line-height: 1; display: inline-block; }
.pic.big { display: block; font-size: 3.6rem; text-align: center; margin: .2rem auto .4rem; filter: drop-shadow(0 4px 6px rgba(0,0,0,.12)); }
.pl-pic { font-size: 1.9rem; flex: none; }
.blitz-pic { display: block; font-size: 3.4rem; min-height: 3.6rem; text-align: center; margin-top: .4rem; }
.mem-pic { display: block; font-size: 1.7rem; margin-bottom: .15rem; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.vocab-pic { font-size: 1.5rem; margin-right: .35rem; vertical-align: -0.15em; }
.quiz-pic { font-size: 5.5rem; margin: .4rem 0 .8rem; animation: pic-pop .35s cubic-bezier(.34,1.56,.64,1); }
.pic-options { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; width: 100%; max-width: 360px; }
.pic-opt { font-size: 3rem; justify-content: center; padding: .8rem 0; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.pic-answer { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.pic-answer .pic { font-size: 2rem; }
@keyframes pic-pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .quiz-pic { animation: none; } }
.news-card { border-color: var(--accent); }
.news-card h2 { margin: .1rem 0 .3rem; }

/* ---------- Gesprächspartner: Englisch-Hilfe ---------- */
.chat-mode { margin-bottom: .1rem; }
.chat-mode .seg { font-size: .85rem; }
.help-ask .dl-bubble { background: var(--surface-2); }
.help-ask .dl-en { font-style: italic; }
.chat-help { display: flex; flex-direction: column; gap: .55rem; background: var(--surface); border: 1.5px solid var(--accent); border-radius: var(--r); padding: .8rem .9rem; margin: .4rem 0 .8rem; }
.chat-help .speak-panel { border: 0; padding: 0; background: transparent; box-shadow: none; }
.chat-help .row { display: flex; gap: .5rem; align-items: center; }
.chat-help .spacer { flex: 1; }
.chat-help .chip { cursor: default; }

/* ---------- Stimmtagebuch ---------- */
.diary-entry.due { border-color: var(--accent); }
.diary-entry .pill, .pack-text .pill { margin-left: .4rem; }
.diary-row { display: flex; flex-direction: column; gap: .4rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.diary-row .row { display: flex; gap: .45rem; align-items: center; }
.diary-delta { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); }
.diary-delta.up { color: var(--good); }
.diary-delta.down { color: var(--bad); }
.diary-list { list-style: none; padding: 0; margin: .3rem 0; display: flex; flex-direction: column; gap: .3rem; }
.diary-list li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
