/* Update 11 (S1 + L1, spec §1): the first-run screens' shared parts. 1 · the sheet (ui/sheet.js: the Sprachsteuerung
   sheet and the Datenschutz / Impressum sheet) — paper from the bottom with a torn top edge (the B1 mockup), a grab mark,
   the serif title, »Schließen« sticky at its foot; it slides up only under prefers-reduced-motion: no-preference. */
.sh-veil{position:fixed;inset:0;z-index:40;display:flex;align-items:flex-end;justify-content:center;background:rgba(26,25,23,.42)}
.sh-card{--bg:var(--paper);--fg:var(--ink);--fg-2:var(--ink-2);position:relative;isolation:isolate;width:100%;max-width:430px;
  max-height:calc(100dvh - 12px);overflow-y:auto;overscroll-behavior:contain;padding:26px var(--gut) 0;color:var(--fg);
  background:var(--bg);text-align:left;
  clip-path:polygon(0 14px,6% 6px,14% 10px,24% 3px,36% 8px,48% 2px,60% 7px,72% 1px,84% 6px,93% 2px,100% 9px,100% 100%,0 100%)}
.sh-grab{display:block;width:44px;height:5px;margin:0 auto 14px;border-radius:3px;background:var(--paper-3)}
.sh-h{margin:0 0 12px;font:800 28px/1.05 var(--serif);letter-spacing:-.01em}
.sh-h:focus{outline:none}
.sh-h:focus-visible{outline:3px solid var(--fg);outline-offset:4px}
.sh-foot{position:sticky;bottom:0;margin-top:18px;padding:12px 0 max(16px,env(safe-area-inset-bottom));background:var(--bg)}
.sh-close{min-height:var(--tap)}
@media (prefers-reduced-motion:no-preference){.sh-veil:not(.still) .sh-card{animation:sh-up 300ms var(--e-ink) both}}
@keyframes sh-up{from{opacity:0;transform:translateY(48px)}to{opacity:1;transform:none}}

/* 2 · VOR DEM START (S1, his B1 »Tinten-START«; the b1 mockup). START is the download: the swash inks in vermilion from
   the left as the session's clips decode (--dl 0–100, set through CSSOM by ui/check-foot.js). The leading edge is the swash
   texture's own dry tail riding ahead of the solid ink, so it reads as being painted, not as a progress bar; the letters
   turn white where the ink lands (the white label sits inside the masked ink). Mask layers: swash ∩ (solid ∪ dry tail).
   --ex: the edge in % of the stroke (−20 at 0 → 126 at 100). Reduced motion: no transition, the fill still follows. */
@property --dl{syntax:'<number>';inherits:true;initial-value:0}
.btn-start.inking{--btn-bg:var(--paper-3);color:var(--ink-3);--ex:calc(var(--dl) * 1.46 - 20)}
.btn-start.inking:disabled{--btn-bg:var(--paper-3);color:var(--ink-3);cursor:default}
.btn-start.inking .ink{position:absolute;inset:-5px calc(-1 * var(--gut)) -5px -6px;z-index:1;pointer-events:none;background:var(--verm);
  -webkit-mask:url(../img/ink/swash.webp) 0 50%/150% 100% no-repeat,
    linear-gradient(90deg,#000 calc(var(--ex) * 1% - 26%),#0000 calc(var(--ex) * 1% - 20%)),
    url(../img/ink/swash.webp) calc((2 * var(--ex) - 60) * 1%) 50%/50% 100% no-repeat;
  -webkit-mask-composite:source-in,source-over;
  mask:url(../img/ink/swash.webp) 0 50%/150% 100% no-repeat,
    linear-gradient(90deg,#000 calc(var(--ex) * 1% - 26%),#0000 calc(var(--ex) * 1% - 20%)),
    url(../img/ink/swash.webp) calc((2 * var(--ex) - 60) * 1%) 50%/50% 100% no-repeat;
  mask-composite:intersect,add}
.btn-start.inking .ink::after{content:"START";position:absolute;inset:5px var(--gut) 5px 6px;display:grid;place-items:center;padding-left:.1em;color:var(--on-verm)}
.btn-start.inking.full{--btn-bg:var(--verm);color:var(--on-verm)}
.btn-start.inking.full .ink{-webkit-mask:url(../img/ink/swash.webp) 0 50%/150% 100% no-repeat;mask:url(../img/ink/swash.webp) 0 50%/150% 100% no-repeat}
@media (prefers-reduced-motion:no-preference){.btn-start.inking{transition:--dl 400ms var(--e-ink)}}
.s-check{overflow-x:clip} /* the ready pulse (scale 1.045) no longer pushes the swash past a 360-px screen */
.chk{--gap:12px}
.chk .sum{margin-top:2px}
.chk .sum-tag{grid-column:1 / -1;margin:2px 0 4px;font:800 13px/1 var(--sans);letter-spacing:.14em;text-transform:uppercase;color:var(--verm)}
.chk .sum-tag[hidden],.chk .sum .mix[hidden]{display:none}
/* first run: the one-time block */
.chk .once{margin-top:12px;flex:none}
.chk .once[hidden]{display:none}
.chk .once-h{margin:0 0 4px;display:flex;align-items:baseline;justify-content:space-between;font:800 13px/1 var(--sans);letter-spacing:.14em;text-transform:uppercase;color:var(--verm)}
.chk .once-h span{font:700 13px/1 var(--sans);letter-spacing:0;text-transform:none;color:var(--ink-3)}
.chk .once .list{border-top:1.5px solid var(--rule)}
.chk .once .row{min-height:76px;padding:6px 0;flex-wrap:nowrap}
.chk .once .row-t b{font-size:18.5px}
.chk .once .row-t small{font-size:14px}
.chk .once .nw{white-space:nowrap}
.chk .once .row>.btn{padding:0 16px;font-size:17px;flex:none}
.chk .once .row>.round svg{width:26px;height:26px}
.chk .once .round.busy{opacity:.55}
.chk .once .row>.side-t{min-height:var(--tap);padding:0 0 0 6px;font-size:15.5px;color:var(--ink);text-decoration:underline;
  text-decoration-thickness:2px;text-underline-offset:4px;text-decoration-color:var(--line);width:70px;line-height:1.15;text-align:right}
.chk .once .row.prob{grid-template-columns:28px 1fr auto}
.chk .once .row.prob .fix{grid-column:2 / 4}
.chk .alt{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:6px 0 0;font:600 14px/1.3 var(--sans);color:var(--ink-2)}
.chk .alt[hidden]{display:none}
.chk .alt .btn,.chk .kitl{min-height:var(--tap);padding:0 0 0 8px;font-size:15.5px;color:var(--ink);text-decoration:underline;text-decoration-thickness:2px;
  text-underline-offset:4px;text-decoration-color:var(--line)}
.chk .kitl{margin-top:var(--gap);padding:0;justify-content:flex-start;text-align:left;font-size:14px;font-weight:700;color:var(--ink-2)}
.chk .priv2{display:grid;grid-template-columns:20px 1fr auto;column-gap:10px;align-items:center;margin:var(--gap) 0 0;padding:0;
  font:500 13px/1.3 var(--sans);color:var(--ink-2)}
.chk .priv2>svg{width:18px;height:18px;color:var(--ink-2)}
.chk .priv2 .btn{min-height:var(--tap);padding:0 4px 0 10px;font-size:15px;font-weight:800;color:var(--ink);gap:4px}
/* repeat run: the calm painting — phone, 2–3 m, the fighter in guard */
.chk .scene{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:14px;padding:18px 0 6px}
.chk .dist2{width:100%;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:end;column-gap:10px;padding:0 4px}
.chk .dist2 .ph{grid-area:1/1;width:34px;height:38px;margin-bottom:4px;color:var(--ink)}
.chk .dist2 .rl{grid-area:1/2;position:relative;height:3px;margin-bottom:22px;background:repeating-linear-gradient(90deg,var(--ink-2) 0 8px,transparent 8px 15px)}
.chk .dist2 .rl b{position:absolute;left:50%;bottom:10px;translate:-50% 0;font:800 40px/1 var(--num);white-space:nowrap}
.chk .dist2 .cap{grid-area:1/2;justify-self:center;margin-bottom:3px;font:700 13px/1.15 var(--sans);color:var(--ink-2);white-space:nowrap}
.chk .dist2 .picto{grid-area:1/3;--ps:min(150px,36vw)}
.chk .ears2{margin:0;max-width:300px;text-align:center;font:700 16px/1.35 var(--sans);color:var(--ink-2);text-wrap:balance}
.chk.first .scene,.chk:has(.probs:not([hidden])) .scene{display:none} /* a first run: the line under START; a problem row takes its room */
.chk.first:has(.probs:not([hidden])) :is(.alt,.kitl,.sum-n){display:none} /* on a first run too: one problem row fits 360×800; the sheet and Einstellungen keep both. Update 12: the rounds line too (a »heute« of two rows ran 12 px over) */
.chk.first .probs{margin-top:6px}
.chk.first .probs .row.prob{padding-block:4px;row-gap:0}
.chk.first .probs .row.prob>.act{margin:0}
.chk .probs{margin-top:10px;border-top:0}
.chk .probs[hidden]{display:none}
/* the foot: legend (first run) or the Sprachsteuerung row (repeat), START, its one line, the bottle hint */
.chk .foot{grid-template-columns:minmax(0,1fr);gap:6px;padding-top:8px}
.chk .cmds .cg-w{white-space:normal}
.chk .foot .cmds[hidden],.chk .foot .mode[hidden],.chk .why2[hidden],.chk .bottle[hidden]{display:none}
.chk .mode{width:100%;min-height:var(--tap);display:flex;align-items:center;gap:12px;padding:0 4px 0 0;border-block:1.5px solid var(--rule);
  font:700 16px/1.2 var(--sans);color:var(--ink-2);text-align:left;background:none}
.chk .mode>svg:first-child{width:36px;height:24px;flex:none;color:var(--ink)}
.chk .mode .mt{display:grid;gap:2px;flex:1;min-width:0}
.chk .mode .mt small{font:700 13px/1.1 var(--sans);color:var(--ink-2)}
.chk .mode .mt b{font:800 17px/1.15 var(--sans);color:var(--ink)}
.chk .mode .mt .mfix{font:650 14px/1.25 var(--sans);color:var(--ink)}
.chk .mode .chev{width:22px;height:22px;rotate:-90deg;color:var(--ink-2);flex:none}
.chk .mode.prob{position:relative;isolation:isolate;border-color:transparent}
.chk .mode.prob::before{content:"";position:absolute;inset:2px -10px;z-index:-1;clip-path:var(--brush);background:var(--tint)}
.chk .mode.warn{--tint:rgba(242,193,78,.3)}
.chk .mode.fail{--tint:rgba(160,29,22,.13)}
.btn-start.inking{margin-top:6px}
.chk .why2{margin:0;display:flex;flex-wrap:wrap;justify-content:center;align-items:baseline;column-gap:8px;row-gap:4px;text-align:center;
  font:650 14.5px/1.35 var(--sans);color:var(--ink-2);text-wrap:balance}
.chk .why2 .pc{font:800 19px/1 var(--num);color:var(--ink);font-variant-numeric:tabular-nums}
.chk .why2 .pc[hidden]{display:none}
.chk .why2.load{font:700 15px/1.3 var(--sans)}
.chk .why2.deg{padding:8px 12px 8px 14px;font:800 16px/1.25 var(--sans);color:var(--ink);text-align:left;justify-content:flex-start;
  background:rgba(242,193,78,.55);border-left:6px solid var(--crit);border-radius:4px 12px 12px 4px}
/* the offline line's thin brush bar: sumi ink fills the swash shape left to right (--dl) */
.chk .brushbar{position:relative;display:block;width:100%;height:12px;isolation:isolate;--ex:calc(var(--dl) * 1.27 - 12)}
.chk .brushbar[hidden]{display:none}
.chk .brushbar>i{position:absolute;inset:0;-webkit-mask:url(../img/ink/swash.webp) 0 50%/118% 100% no-repeat;mask:url(../img/ink/swash.webp) 0 50%/118% 100% no-repeat}
.chk .brushbar>.trk{background:var(--paper-3)}
.chk .brushbar>.fill{background:var(--ink);
  -webkit-mask:url(../img/ink/swash.webp) 0 50%/118% 100% no-repeat,linear-gradient(90deg,#000 calc(var(--ex) * 1% - 15%),#0000 calc(var(--ex) * 1% - 11%));
  -webkit-mask-composite:source-in;
  mask:url(../img/ink/swash.webp) 0 50%/118% 100% no-repeat,linear-gradient(90deg,#000 calc(var(--ex) * 1% - 15%),#0000 calc(var(--ex) * 1% - 11%));
  mask-composite:intersect}

/* 3 · THE SPRACHSTEUERUNG SHEET (ui/voice-sheet.js) — the modes stacked, the hint, the legend, the test, two actions */
.vsheet .vseg{display:grid;grid-template-columns:1fr;gap:var(--gap)}
.vsheet .vseg>.btn{min-height:var(--tap);padding:0 14px;font-size:17px;justify-content:flex-start;--btn-bg:var(--paper-3)}
.vsheet .vseg>.btn[aria-checked=true]{--btn-bg:var(--ink)}
.vsheet .vhint{margin:10px 0 0;font:500 13.5px/1.4 var(--sans);color:var(--ink-2)}
.vsheet .cmds{margin:14px 0 0;display:flex;flex-direction:column;align-items:flex-start;row-gap:8px;font:700 15.5px/1.3 var(--sans)}
.vsheet .cmds .cg{display:inline-flex;align-items:center;gap:8px}
.vsheet .cmds .ci{width:22px;height:22px;flex:none;color:var(--ink-2)}
.vsheet .cmds .cg-t{display:grid;text-align:left}
.vsheet .cmds .picto{--ps:26px}
.vsheet .kom{margin:10px 0 0}
.vsheet .mtest{display:flex;flex-direction:column;align-items:center;gap:10px;margin-top:14px;text-align:center}
.vsheet .mtest[hidden],.vsheet .say[hidden],.vsheet .mtest .btn[hidden]{display:none}
.vsheet .say{margin:0;font:800 64px/.95 var(--num)}
.vsheet .say small{display:block;margin-bottom:6px;font:700 22px/1 var(--sans);letter-spacing:.04em;color:var(--ink-2)}
.vsheet .heard{display:flex;flex-wrap:wrap;justify-content:center;align-items:baseline;gap:10px;margin:0;font:800 26px/1.1 var(--num)}
.vsheet .heard span{font:700 15px/1.2 var(--sans);color:var(--ink-2)}
.vsheet .heard.vh-ok span{font:800 20px/1.2 var(--sans);color:var(--ok)}
.vsheet .heard .no{font:800 15px/1.25 var(--sans);color:var(--crit)}
.vsheet .heard s{text-decoration-thickness:3px;text-decoration-color:var(--crit)}
.vsheet .acts{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:16px}
.vsheet .acts .btn{padding:0 10px;gap:8px;font-size:17px}
.vsheet .acts .btn[hidden]{display:none}
.vsheet .acts:has(.btn[hidden]){grid-template-columns:minmax(0,1fr)}

/* 4 · EINSTELLUNGEN (S1 »Where everything goes«): »Coach über Musik testen« under Coach-Lautstärke; the Diagnose facts */
.s-settings .row.mus{margin-top:10px;border-top:1.5px solid var(--rule);border-bottom:0}
.s-settings .row.mus .ri{width:28px;height:28px;flex:none;color:var(--ink-2)}
.s-settings .vers{display:grid;gap:4px;margin-top:8px}
.s-settings .vers .ver{margin:0}
/* Geschafft: the install row (ui/finish-install.js) — calm, under the stats */
.fin .row.inst{width:100%;margin-top:12px;border-top:1.5px solid var(--rule);text-align:left}
.fin .row.inst .ri{width:28px;height:28px;flex:none;color:var(--fg-2)}
/* narrow phones and the large font scale: the rail's caption goes under the figure, »Datenschutz ›« under its line */
@media (max-width:340px){
  .chk .dist2 .cap{grid-area:2/1/auto/-1;margin:4px 0 0;white-space:normal;text-align:center}
  .chk .dist2 .rl{margin-bottom:14px}
  .chk .dist2 .rl b{font-size:min(40px,9vw)}
  .chk .dist2 .picto{--ps:30vw}
}
@media (max-width:340px){.vsheet .acts{grid-template-columns:minmax(0,1fr)}.chk .once .nw{white-space:normal}}
@media (max-width:300px){
  .sh-h{font-size:min(28px,9.6vw)}
  .chk .priv2{grid-template-columns:20px minmax(0,1fr)}
  .chk .priv2 .btn{grid-column:1 / -1;justify-self:end}
}
.chk .row.prob>.act{grid-column:2 / 4;justify-self:start;margin:2px 0 4px}
