/* Quiet blend (owner direction 2026-10-28, brief docs/harness/tasks/2026-10-28-e-quiet-frontend.md).
   e-quiet's structure laid over Wortweg's own content and colour code: hairlines instead of boxes and
   glow, one primary button per screen, Source Serif for the German word, the learn card as a bottom
   sheet over the lower board on a phone. Loaded LAST so it only restyles; every mechanic, id and
   event stays where ui-layout.css / components.css put it. Gender pills (der/die/das), the gold
   found path, umlaut tiles and flags are unchanged in meaning. Dark is the default, "hell" is the
   paper option in the menu; both themes are covered by the same token roles below. */

/* Self-hosted, never from fonts.googleapis.com (same GDPR reason as tokens.css). Variable woff2
   from @fontsource-variable (Inter 5.3.0, Source Serif 4 5.3.1), SIL OFL 1.1, see fonts/OFL.txt.
   unicode-range is the download gate: the latin file covers German incl. a o u umlauts and eszett;
   Inter's latin-ext file is fetched only when a glyph like Turkish g-breve or s-cedilla is painted. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("./fonts/inter-latin-wght.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("./fonts/inter-latin-ext-wght.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("./fonts/source-serif-4-latin-wght.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Inter for every UI string; Archivo stays behind it as the fallback, then the same Georgian,
     system and emoji tail as tokens.css so Mkhedruli and emoji still resolve. */
  --font: "Inter", "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Noto Sans Georgian", "BPG Glaho", Sylfaen,
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
  /* One UI face. Plex Mono read as "terminal" next to a serif word; numbers keep their columns via
     tabular-nums where they line up (stats, counts, progress). */
  --mono: var(--font);
  --hair: color-mix(in srgb, var(--text) 14%, transparent);
  --hair-soft: color-mix(in srgb, var(--text) 8%, transparent);
  --accent-wash: color-mix(in srgb, var(--accent) 16%, transparent);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --elev-tile: none;
  --elev-card: none;
  --shadow-raised: none;
  --radius-card: 18px;
  /* The gendered word inside an example sentence is TEXT on a navy card, not a pill with white ink,
     so it takes a lightened tint of the same hue. */
  --gender-der-text: color-mix(in oklch, var(--gender-der) 52%, white);
  --gender-die-text: color-mix(in oklch, var(--gender-die) 58%, white);
  --gender-das-text: color-mix(in oklch, var(--gender-das) 52%, white);
}
[data-theme="hell"] {
  --elev-tile: none;
  --elev-card: none;
  --shadow-raised: none;
  --gender-der-text: var(--gender-der);
  --gender-die-text: oklch(47% 0.19 350);
  --gender-das-text: oklch(45% 0.14 145);
}

/* The page colour lives on <html> so the ASCII background canvas (z-index -1) paints above it;
   a body background would be drawn over the canvas and hide it. */
html { background: var(--bg); }
body { background: transparent; }

/* ───────── Buttons: one primary per screen, everything else hairline ───────── */
.btn-primary {
  background: var(--accent);
  color: var(--selected-ink);
  border: 1px solid transparent;
  border-radius: 12px;
  box-shadow: none;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-shadow: none;
}
.btn-primary:hover { filter: none; background: color-mix(in oklch, var(--accent) 88%, var(--text)); }
.btn-secondary,
.btn-ghost {
  background: transparent;
  border: 1px solid var(--hair);
  border-radius: 12px;
  box-shadow: none;
  color: var(--text);
}
.btn-ghost:hover,
.btn-secondary:hover { border-color: var(--accent); background: transparent; }
.link-btn { color: var(--accent); }

/* ───────── Header + tab bar: frameless, hairline only ───────── */
.play-header {
  background: var(--bg);
  border-bottom: 1px solid var(--hair-soft);
  box-shadow: none;
}
.gear-btn,
.help-btn,
.play-exit-btn,
.account-chip {
  background: transparent;
  border: 1px solid var(--hair);
  box-shadow: none;
  color: var(--text);
}
.account-chip { color: var(--text); }
.gear-btn:hover,
.help-btn:hover,
.account-chip:hover { border-color: var(--accent); background: transparent; }
.play-exit-btn { border-color: transparent; }

@media (max-width: 720px) {
  .app-nav {
    background: var(--bg);
    border-top: 1px solid var(--hair);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
.app-nav-link { color: var(--text-muted); }
.app-nav-link[aria-current="page"] { color: var(--accent); background: transparent; box-shadow: none; }
.app-nav-link[aria-current="page"]::before,
.app-nav-link[aria-current="page"]::after { display: none; }

/* ───────── Setup: the hub (language, level, topics) as quiet rows ───────── */
.brand-hero { display: none; }
/* The hub reads top to bottom as one question at a time: language, level (under its own heading,
   with Quick start as the one primary button), then topic packs under their label. */
.setup-panel:not([hidden]) {
  display: flex;
  flex-direction: column;
  padding-top: var(--space-6);
  max-width: 560px;
  margin-inline: auto;
}
.setup-panel > .setup-lang { order: 1; }
.setup-panel > .setup-title { order: 2; }
.setup-panel > .setup-sub { order: 3; }
.setup-panel > .setup-quick-start { order: 4; }
.setup-panel > .level-grid { order: 5; margin-top: var(--space-4); }
.setup-panel > .setup-persona-topic { order: 6; }
.setup-panel > .topic-block { order: 7; margin-top: var(--space-6); }
.setup-lang { align-items: flex-start; text-align: left; }
.setup-lang-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
}
.setup-lang-options { justify-content: flex-start; gap: var(--space-2); }
.setup-lang-option {
  background: transparent;
  border: 1px solid var(--hair);
  border-radius: 999px;
  box-shadow: none;
  color: var(--text);
  font-weight: 500;
  min-height: 44px;
  padding: 0 var(--space-4);
}
.setup-lang-option[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-wash);
  color: var(--text);
}
.setup-title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.024em;
  text-align: left;
  margin-top: var(--space-8);
}
.setup-quick-start {
  min-height: 54px;
  font-size: 15px;
  border-radius: 12px;
}
.topic-title {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0;
  text-transform: none;
}

/* Topic and level pickers: one raised card, hairline rows, no per-item boxes. */
.topic-grid,
.level-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--surface-raised);
  border: 1px solid var(--hair);
  border-radius: 16px;
  overflow: hidden;
}
.topic-grid > *,
.level-grid > .level-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 13px;
  row-gap: 1px;
  text-align: left;
  width: 100%;
  min-height: 56px;
  margin: 0;
  padding: 12px 16px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--hair-soft);
  border-radius: 0;
  box-shadow: none;
  transform: none;
}
.topic-grid > *:last-child,
.level-grid > .level-card:last-child { border-bottom: 0; }
.topic-grid > *:hover,
.level-grid > .level-card:hover { background: var(--accent-wash); transform: none; box-shadow: none; }
.level-card .level-badge {
  grid-row: 1 / span 2;
  background: transparent;
  border: 0;
  padding: 0;
  min-width: 32px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  box-shadow: none;
}
.level-card .level-name { font-size: 14.5px; font-weight: 600; color: var(--text); }
.level-card .level-desc { grid-column: 2; font-size: 12.5px; color: var(--text-muted); line-height: 1.35; }
.level-card .level-count {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 12.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.level-card.is-selected,
.level-card[aria-pressed="true"] { background: var(--accent-wash); }

/* ───────── Play: calm board, gold found path, teal live trace ───────── */
.stat-strip { display: none; }
.board-caption {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0;
}
.cell {
  /* Opaque equivalent of a 4% tint: identical on a plain page, but the ASCII field never shows
     through a tile and competes with its letter. */
  background: color-mix(in srgb, var(--text) 4%, var(--bg));
  border: 1px solid var(--hair-soft);
  box-shadow: none;
  font-family: var(--font);
  font-weight: 500;
  color: var(--text);
}
@media (hover: hover) {
  .cell:hover { background: color-mix(in srgb, var(--text) 8%, var(--bg)); transform: none; }
}
/* No aura, no halo, no sheen: the ribbon is a flat band. The dark seal under a solved word stays,
   it is the non-colour cue that a word is locked in (lib/snake.js, WCAG 1.4.1). */
.board-aura { display: none; }
#lineSvg path[opacity],
#lineSvg path[stroke="rgba(255,255,255,0.16)"] { display: none; }
.cell.selected {
  color: var(--selected-ink);
  font-weight: 700;
  text-shadow: none;
}
.cell.locked {
  color: var(--found-ink);
  font-weight: 650;
  text-shadow: none;
}
.coach {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--text-muted);
  font-size: 13.5px;
  padding: var(--space-1) var(--space-1);
}
.status {
  color: var(--text-muted);
  font-size: 13.5px;
}
.progress-bar { background: var(--hair-soft); box-shadow: none; height: 3px; }
.progress-fill { background: var(--accent); box-shadow: none; }
.progress-label { color: var(--text-muted); font-size: 12.5px; }

.word-slot .sq {
  background: transparent;
  border: 1px solid var(--hair);
  box-shadow: none;
}
.word-slot .sq.done {
  background: var(--found);
  border-color: transparent;
  color: var(--found-ink);
}

/* Hint: the rescue control, not the main act (tracing is). Outline, still a 48px target. */
.play-action-bar #hintBtn {
  background: transparent;
  border: 1px solid var(--hair);
  color: var(--text);
  box-shadow: none;
  border-radius: 12px;
}
.play-action-bar #hintBtn:hover { border-color: var(--accent); }
@media (max-width: 1023px) {
  .app[data-ui-state="playing"] .play-layout > .play-action-bar {
    background: var(--bg);
    border-top: 1px solid var(--hair-soft);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* Article probe (der/die/das chips above the board): hairline chips, gender colour only on answer. */
.article-probe {
  background: transparent;
  border: 0;
  box-shadow: none;
}

/* ───────── The learn card ───────── */
.wortkarte-card {
  background: var(--surface-raised);
  border: 1px solid var(--hair);
  border-radius: var(--radius-card);
  box-shadow: none;
  padding: 20px 22px;
}
.wortkarte-card .rail-h {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0;
  text-transform: none;
  margin: 0 0 var(--space-2);
}
.wcard .wcard-word {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.wcard .lesson-word {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.1;
}
.wcard .lesson-gender { box-shadow: none; }
.wcard .lesson-speak {
  margin-left: auto;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--hair);
  background: transparent;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}
.wcard .lesson-speak:hover { border-color: var(--accent); }
.wcard .wcard-plural { font-size: 14px; color: var(--text-muted); margin-top: 6px; }
.wcard .wcard-gloss-details summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  margin-top: 12px;
  border: 1px solid var(--hair);
  border-radius: 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.wcard .wcard-gloss-details summary::-webkit-details-marker { display: none; }
.wcard .wcard-gloss-details[open] summary { display: none; }
.wcard .wcard-gloss { font-size: 16px; color: var(--text); margin-top: 10px; }
.wcard .wcard-tags { margin-top: 12px; }
.wcard .wcard-ex {
  border-top: 1px solid var(--hair-soft);
  margin-top: 14px;
  padding-top: 14px;
}
.wcard .lesson-example {
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--text);
}
/* Highlighted word: its gender colour for nouns, plain ink otherwise (teal is for controls only). */
.wcard .lesson-example strong { font-weight: 600; color: var(--text); }
.wcard:has(.lesson-gender--der) .lesson-example strong { color: var(--gender-der-text); }
.wcard:has(.lesson-gender--die) .lesson-example strong { color: var(--gender-die-text); }
.wcard:has(.lesson-gender--das) .lesson-example strong { color: var(--gender-das-text); }
.wcard .lesson-example-en { font-size: 14px; color: var(--text-muted); margin-top: 6px; }

/* Phone: the card is a bottom sheet over the lower board, opened by lib/learn-sheet.js after a
   solve or a tap on a found word, closed by Continue or by touching the board again. Without the
   open class it stays hidden, so the board owns the first screen. */
.learn-sheet-continue { display: none; }
@media (max-width: 1023px) {
  .app[data-ui-state="playing"] .wortkarte-card:not(.wortkarte-card--idle) {
    position: fixed;
    left: 0;
    right: 0;
    /* Docks ON TOP of the fixed Hint bar (64px + safe area), never over it: the rescue control
       stays visible and tappable while the learner reads the card. */
    bottom: calc(64px + env(safe-area-inset-bottom));
    z-index: 60;
    margin: 0;
    max-height: min(46dvh, 400px);
    overflow-y: auto;
    border-radius: 22px 22px 0 0;
    border-bottom: 1px solid var(--hair-soft);
    padding: 22px 20px 82px;
    transform: translateY(calc(100% + 72px));
    visibility: hidden;
    /* Stops taking touches the instant it starts to close: during the 0.32s slide-out a fast next
       drag would otherwise land on the departing sheet instead of the board. */
    pointer-events: none;
    transition: transform 0.32s var(--ease-out), visibility 0s linear 0.32s;
  }
  .app.learn-sheet-open[data-ui-state="playing"][data-section="spielen"] .wortkarte-card:not(.wortkarte-card--idle) {
    transform: none;
    visibility: visible;
    pointer-events: auto;
    transition: transform 0.32s var(--ease-out), visibility 0s;
  }
  .app[data-ui-state="playing"] .wortkarte-card:not(.wortkarte-card--idle)::before {
    content: "";
    position: absolute;
    top: 9px;
    left: 50%;
    width: 36px;
    height: 4px;
    margin-left: -18px;
    border-radius: 2px;
    background: var(--hair);
  }
  .app.learn-sheet-open[data-ui-state="playing"][data-section="spielen"] .learn-sheet-continue {
    display: flex;
    position: fixed;
    left: 22px;
    right: 22px;
    bottom: calc(64px + 14px + env(safe-area-inset-bottom));
    z-index: 61;
    width: auto;
    min-height: 54px;
    align-items: center;
    justify-content: center;
    font-size: 15px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .app[data-ui-state="playing"] .wortkarte-card { transition: none !important; }
}

/* ───────── Solve: one headline, a hairline stat row, one primary button ───────── */
.app[data-ui-state="solved"] { background: transparent; }
.solve-panel,
.solve-panel:not([hidden]) {
  background: transparent;
  border: 0;
  box-shadow: none;
  text-align: left;
}
.solve-panel:not([hidden]) .solve-title {
  align-self: flex-start;
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.028em;
  line-height: 1.05;
  margin: var(--space-6) 0 0;
  padding-bottom: 10px;
  /* The one gold moment: a hairline sweeps under the headline once, then holds still. */
  background: linear-gradient(var(--brand-pop), var(--brand-pop)) left bottom / 0 2.4px no-repeat;
  animation: quiet-sweep 0.7s 0.3s var(--ease-out) forwards;
}
@keyframes quiet-sweep { to { background-size: 100% 2.4px; } }
@media (prefers-reduced-motion: reduce) {
  .solve-panel:not([hidden]) .solve-title { animation: none; background-size: 100% 2.4px; }
}
.solve-sub { color: var(--text-muted); }
.solve-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--hair-soft);
  border-radius: 0;
  box-shadow: none;
  margin-top: var(--space-6);
}
.solve-stat {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--hair-soft);
  border-radius: 0;
  box-shadow: none;
  padding: 16px 18px 16px 2px;
  align-items: flex-start;
  text-align: left;
}
@media (max-width: 1023px) {
  .solve-stat:nth-child(odd) { border-right: 1px solid var(--hair-soft); }
}
@media (min-width: 1024px) {
  .solve-panel .solve-stats { grid-template-columns: repeat(4, 1fr); }
  .solve-stat { border-right: 1px solid var(--hair-soft); border-bottom: 0; }
  .solve-stat:last-child { border-right: 0; }
}
.solve-stat-n { font: 600 19px/1.15 var(--font); letter-spacing: -0.01em; color: var(--text); font-variant-numeric: tabular-nums; }
.solve-sub { font: 500 13px/1.4 var(--font); }
.solve-stat-l { font-size: 12px; color: var(--text-muted); text-transform: none; letter-spacing: 0; }
.solve-haul,
.lb-week-card,
.solve-feedback,
.solve-a2hs,
.solve-share-nudge,
.solve-pulse {
  background: var(--surface-raised);
  border: 1px solid var(--hair);
  border-radius: var(--radius-card);
  box-shadow: none;
}
.solve-haul-title { font-size: 12.5px; font-weight: 500; color: var(--text-muted); text-transform: none; letter-spacing: 0; }
.solve-haul-chips > * {
  background: var(--surface-raised);
  border: 1px solid var(--hair);
  border-radius: 999px;
  box-shadow: none;
}
.solve-next { width: 100%; min-height: 54px; font-size: 15px; }

/* ───────── Hubs (Words / Review / Progress / Board) + overlays ───────── */
.section-title { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.section-view .rail-card,
.rail-card {
  background: var(--surface-raised);
  border: 1px solid var(--hair);
  border-radius: var(--radius-card);
  box-shadow: none;
}
.modal,
.modal-card,
.gear-menu,
dialog {
  box-shadow: none;
}
.gear-menu {
  background: var(--surface-raised);
  border: 1px solid var(--hair);
}

/* Toasts: a quiet raised note, not an accent-striped alert. */
.toast {
  background: var(--surface-raised);
  border: 1px solid var(--hair);
  border-left: 1px solid var(--hair);
  border-radius: 14px;
}
.toast-badge { color: var(--text-muted); letter-spacing: 0; text-transform: none; font-weight: 600; }

/* Review flashcard: the German word in the serif, like every other place a word is taught. */
.review-word { font-family: var(--serif); font-weight: 600; letter-spacing: -0.015em; }
.review-card {
  background: var(--surface-raised);
  border: 1px solid var(--hair);
  border-radius: var(--radius-card);
  box-shadow: none;
}

/* Progress: the four numbers as ONE card split by hairlines (e-quiet ptiles), not four boxes. */
.stat-tiles {
  gap: 0;
  background: var(--surface-raised);
  border: 1px solid var(--hair);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.stat-tile {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 18px;
}
.stat-tile:nth-child(odd) { border-right: 1px solid var(--hair-soft); }
.stat-tile:nth-child(-n+2) { border-bottom: 1px solid var(--hair-soft); }
.fortschritt-review {
  background: var(--surface-raised);
  border: 1px solid var(--hair);
  border-radius: var(--radius-card);
  box-shadow: none;
}
.fortschritt-panel-title,
.chart-head h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }

/* Board: ranked rows on hairlines; the segmented tabs as a quiet underline pair. */
.leaderboard-row {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--hair-soft);
  border-radius: 0;
  box-shadow: none;
  font-variant-numeric: tabular-nums;
}
.lb-tabs {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--hair);
  border-radius: 0;
  padding: 0;
  gap: var(--space-4);
}
.lb-tab {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  box-shadow: none;
  color: var(--text-muted);
  min-height: 44px;
}
.lb-tab[aria-selected="true"] {
  background: transparent;
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* Compact lesson inside the phone sheet: same content, tighter rhythm, so the word, plural,
   reveal and example fit the shorter sheet before it needs to scroll. */
@media (max-width: 1023px) {
  .app[data-ui-state="playing"] .wortkarte-card .rail-h { display: none; }
  .app[data-ui-state="playing"] .wortkarte-card .lesson-word { font-size: 28px; }
  .app[data-ui-state="playing"] .wortkarte-card .wcard-gloss-details summary { margin-top: 8px; }
  .app[data-ui-state="playing"] .wortkarte-card .wcard-tags { margin-top: 8px; }
  .app[data-ui-state="playing"] .wortkarte-card .wcard-ex { margin-top: 10px; padding-top: 10px; }
  .app[data-ui-state="playing"] .wortkarte-card .lesson-example { font-size: 15.5px; line-height: 1.45; }
}

/* ASCII background canvas (lib/ascii-bg.js): z-index -1 paints it just above the body background
   and under every page, so cards, tiles, header and bars keep their own surfaces on top. */
.ascii-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  display: block;
}
.ascii-bg[hidden] { display: none; }

/* Close (x) on toasts and info cards: top-right, 44px target, quiet until hovered. */
.toast { position: relative; padding-right: 52px; }
.lb-week-card { position: relative; padding-right: 52px; }
.toast-close,
.card-close {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 12px;
  color: var(--text-muted);
  cursor: pointer;
}
.toast-close:hover,
.card-close:hover { color: var(--text); background: var(--hair-soft); }

/* Phone, mid-play: toasts still drop in from the top (at the bottom they hid Hint), but BELOW the
   header, not over it: the logo, Help, account and menu stay readable and tappable while a note is
   up (owner bug 2026-11-01). 72px = measured header bottom at 375x812, plus an 8px breath. */
@media (max-width: 720px) {
  body:has(.app[data-ui-state="playing"][data-section="spielen"]) .toast-host {
    top: calc(env(safe-area-inset-top, 0px) + 80px);
  }
}
