/* The review screen, in Lemma's own type and style: its tokens (src/css/tokens.css of the app), its
   word card's header and senses (.kaik-head-*, .kaik-sense*), its report chips (.llm-chip) and its
   wordmark. Values are copied, not imported: the app and this tool ship apart. */
:root {
  --bg: #f7f5f1;
  --surface: #fdfcfa;
  --text: #11141a;
  --muted: #5a5d65;
  --faint: #888c94;
  --line: #d8d4cc;
  --line-soft: #e7e3da;
  --chip: #ecebe6;
  --accent: #1d3a8a;
  --accent-soft: #e6ecf8;
  --warn: #b4441f;
  --warn-soft: #f6e7df;
  /* Not in Lemma's palette, which has no « yes » to say: a green of the same depth as its navy. */
  --good: #2c6e47;
  --good-soft: #e1efe5;

  --font-ui: 'Inter Tight', -apple-system, system-ui, sans-serif;
  --font-cz: 'Newsreader', Georgia, serif;
  --fs-eyebrow: 12px;
  --fs-meta: 13px;
  --fs-small: 14px;
  --fs-sense-label: 14px;
  --fs-note: 14px;
  --fs-body: 17px;
  --fs-cz-example: 17px;
  --fs-entry-type: 15px;
  --fs-hero-lemma: 32px;
  --fs-state-title: 22px;
  --fs-btn: 15px;
  --ls-eyebrow: 1.5px;
  --ls-entry-type: 0.8px;
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 22px;
  --r-input: 10px;
  --r-btn-lg: 12px;
  --r-card: 14px;
  --r-pill: 999px;
  --btn-h: 52px;
  --chip-h: 40px;
  --num-w: 12px;
  --num-gap: 10px;
  --num-lh: 25px;
  --sense-gap: 14px;
  --gutter: 22px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1e21;
    --surface: #26282c;
    --text: #eeeff1;
    --muted: #aeb2b9;
    --faint: #868a91;
    --line: #3a3c42;
    --line-soft: #2d2f33;
    --chip: #313338;
    --accent: #8fb0ff;
    --accent-soft: #283655;
    --warn: #e8956b;
    --warn-soft: #46291e;
    --good: #84c79c;
    --good-soft: #1f3729;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-feature-settings: "ss01", "cv11";
  font-size: var(--fs-body);
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}

button, input, textarea { font-family: inherit; font-feature-settings: inherit; }

::selection { background: var(--accent-soft); color: var(--text); }
input, textarea { caret-color: var(--accent); }
/* One focus ring for every control, keyboard only: the accent, clear of the control's own edge. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.prev__open:focus-visible, .prev__undo:focus-visible { outline-offset: -3px; }

body.has-sheet { overflow: hidden; }

.view {
  min-height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) var(--gutter) max(12px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

/* --- Lemma's wordmark: the stone, then the name in spaced capitals ---------------------------- */

.wordmark {
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--s-5);
}
.wordmark::before {
  content: "";
  width: 14px;
  height: 14px;
  margin-right: 6px;
  flex-shrink: 0;
  background: currentcolor;
  -webkit-mask: var(--mark) center / contain no-repeat;
  mask: var(--mark) center / contain no-repeat;
}
.wordmark__tool { color: var(--muted); margin-left: 0.5em; }

/* Lemma's monochrome stone (design/logo/lemma-icon-mono-facettes.svg in the app), as a mask so it
   takes the wordmark's colour. */
:root {
  --mark: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='103.109' height='61.571' viewBox='38.447 59.215 103.109 61.571'><defs><clipPath id='stone'><path d='m 37.394743,158.36857 19.210515,-5.17206 a 9.8468467,9.8468467 4.579629 0 1 6.600717,0.52872 l 53.588055,24.11462 a 55.865101,55.865101 27.828656 0 1 6.20579,3.27591 l 12.00036,7.33356 a 17.422572,17.422572 42.837839 0 1 5.05402,4.68627 l 13.8916,19.2939 a 6.6148884,6.6148884 82.235486 0 1 0.83883,6.15191 l -4.56926,12.40228 a 5.0418608,5.0418608 145.11243 0 1 -4.731,3.29886 h -33.96874 l -62.000005,0 a 8.2812715,8.2812715 23.002543 0 1 -5.957559,-2.52915 l -23.116132,-23.9417 a 5.7174819,5.7174819 77.592047 0 1 -1.286979,-5.84965 l 13.69009,-39.359 a 6.6465203,6.6465203 137.05526 0 1 4.549698,-4.23447 z'></path></clipPath></defs><g transform='translate(90,90) scale(0.91) translate(-90,-90) translate(2.9999969,-106.61588) matrix(0.8309663,0,0,0.8309663,14.705932,32.671262) translate(-0.01527486,3.7236547)'><g clip-path='url(%23stone)'><path d='m 37.394743,158.36857 19.210515,-5.17206 a 9.8468467,9.8468467 4.579629 0 1 6.600717,0.52872 l 53.588055,24.11462 a 55.865101,55.865101 27.828656 0 1 6.20579,3.27591 l 12.00036,7.33356 a 17.422572,17.422572 42.837839 0 1 5.05402,4.68627 l 13.8916,19.2939 a 6.6148884,6.6148884 82.235486 0 1 0.83883,6.15191 l -4.56926,12.40228 a 5.0418608,5.0418608 145.11243 0 1 -4.731,3.29886 h -33.96874 l -62.000005,0 a 8.2812715,8.2812715 23.002543 0 1 -5.957559,-2.52915 l -23.116132,-23.9417 a 5.7174819,5.7174819 77.592047 0 1 -1.286979,-5.84965 l 13.69009,-39.359 a 6.6465203,6.6465203 137.05526 0 1 4.549698,-4.23447 z' fill='%23000000' fill-opacity='0.38'></path><polygon points='-187.18,-458.63 49,200.283 90,199.283 672.40,-189.01 665.5,-495.4 394.8,-651.7 87,-706 -100.1,-686.3' fill='%23000000' fill-opacity='0.11'></polygon><polygon points='49,200.283 -187.18,-458.63 -491.5,-495.4 -692.4,-256 -799.3,37.7 -799.3,350.3 -692.4,644 -448.14,692.45' fill='%23000000' fill-opacity='0.29'></polygon><polygon points='-13.65,897.48 49,200.283 90,199.283 112,225.283 -172.27,864.87 -145.9,1063.3' fill='%23000000' fill-opacity='0.45'></polygon><polygon points='49,200.283 -448.14,692.45 -429.2,931.3 -220.8,1039.7 -13.65,897.48' fill='%23000000' fill-opacity='0.61'></polygon><polygon points='672.40,-189.01 90,199.283 112,225.283 794.64,70.23 932.7,-113.8' fill='%23000000' fill-opacity='0.81'></polygon><polygon points='112,225.283 -172.27,864.87 8.5,1090.6 319.9,1063.3 603.2,931.3 824.3,710.2 956.3,426.9 987,194 983.6,115.5 794.64,70.23' fill='%23000000'></polygon></g></g></svg>");
}

.title { font-size: var(--fs-state-title); font-weight: 600; letter-spacing: -0.3px; line-height: 1.2; margin: 0 0 var(--s-3); }
.lead { font-size: var(--fs-small); color: var(--muted); margin: 0 0 var(--s-4); line-height: 1.5; }
.label { display: block; font-size: var(--fs-small); color: var(--text); margin: var(--s-4) 0 var(--s-2); }
.eyebrow {
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--muted);
  margin: var(--s-5) 0 var(--s-3);
}
.error { color: var(--warn); font-size: var(--fs-small); margin: var(--s-3) 0 0; }
.error:empty { display: none; }

.field {
  display: block;
  width: 100%;
  min-height: 48px;
  font-size: var(--fs-body);
  padding: var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--r-input);
  background: var(--surface);
  color: var(--text);
}
.field:focus { border-color: var(--accent); outline: none; }
.field--area { font-size: var(--fs-btn); line-height: 1.4; resize: none; min-height: 110px; field-sizing: content; max-height: 40vh; }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--btn-h);
  padding: 0 var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-btn-lg);
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-btn);
  font-weight: 600;
  cursor: pointer;
}
.btn:active { background: var(--accent-soft); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn--primary:active { opacity: 0.85; background: var(--accent); }
.code .btn { width: 100%; margin-top: var(--s-4); }

.link {
  background: none;
  border: 0;
  color: var(--accent);
  font-size: var(--fs-btn);
  font-weight: 600;
  padding: 10px 2px;
  min-height: 44px;
  cursor: pointer;
}
.link:disabled { color: var(--faint); cursor: default; }

.code { width: 100%; max-width: 420px; align-self: center; margin: auto 0; padding: var(--s-5) 0 12dvh; }

/* --- Sets ------------------------------------------------------------------------------------- */

.bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.bar--sets { margin-bottom: var(--s-4); align-items: baseline; }
.bar--sets .title { margin: 0; }
.code-chip { font-size: var(--fs-meta); color: var(--muted); background: var(--chip); border-radius: var(--r-pill); padding: 4px 10px; }

.set-list { list-style: none; margin: 0 0 var(--s-3); padding: 0; display: grid; gap: var(--s-2); }
.set {
  width: 100%;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: var(--s-4) var(--s-4) var(--s-4);
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: var(--s-3);
  row-gap: 2px;
  font-size: var(--fs-body);
  cursor: pointer;
}
.set > * { grid-column: 1; }
.set:active { background: var(--accent-soft); }
.set__title { font-weight: 600; line-height: 1.3; }
.set__dir, .set__meta { color: var(--muted); font-size: var(--fs-small); }
.set__meta { font-variant-numeric: tabular-nums; }
/* A chevron in the right column, the whole card's height: the row opens something. */
.set__go { grid-column: 2; grid-row: 1 / span 3; align-self: center; color: var(--accent); font-size: 22px; line-height: 1; }
.set .meter { grid-column: 1 / -1; margin-top: var(--s-3); }

/* How much of a set is judged: a hairline, the done part in the accent. */
.meter { height: 3px; border-radius: var(--r-pill); background: var(--line-soft); overflow: hidden; }
.meter__done { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width 0.3s ease-out; }

.link--quiet { color: var(--muted); font-weight: 500; align-self: flex-start; }

.pending {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  z-index: 5;
  transform: translateX(-50%);
  margin: 0;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: var(--chip);
  color: var(--muted);
  font-size: var(--fs-meta);
  white-space: nowrap;
  pointer-events: none;
}
.pending[hidden] { display: none; }

/* --- Review ----------------------------------------------------------------------------------- */

.review { flex: 1; display: flex; flex-direction: column; min-height: 0; }
/* The red radiation of a « Pas bon » reaches past the strip, and a flying card past the screen: neither
   may make the page scrollable. Clipped a gutter's width beyond the section, so the radiation shows. */
.review { overflow: clip; overflow-clip-margin: 20px; }
.bar--review { margin: -6px 0 var(--s-1); }
.review > .meter { margin: 0 0 var(--s-3); }
.progress { font-variant-numeric: tabular-nums; color: var(--muted); font-size: var(--fs-small); font-weight: 600; }

/* The card sits in a cross of four labels, each naming what pushing the card its way does. */
.stage {
  flex: 1;
  display: grid;
  grid-template: auto 1fr auto / 40px 1fr 40px;
  gap: var(--s-2);
  min-height: 420px;
  touch-action: none;
}
/* Room between the stage and the previous word's strip, so the strip reads as its own thing and not
   as a fifth band of the cross. */
.stage + .prev { margin-top: var(--s-3); }

.edge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  border: 0;
  border-radius: var(--r-btn-lg);
  font-size: var(--fs-btn);
  /* As heavy as the arrows: 700 is the heaviest weight the bundled Inter Tight carries. */
  font-weight: 700;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.12s, color 0.12s;
}
.edge--up, .edge--down { grid-column: 1 / -1; min-height: 48px; }
.edge--left, .edge--right { flex-direction: column; padding: 10px 0; }
.edge--left .edge__text, .edge--right .edge__text { writing-mode: vertical-rl; }
/* Read bottom to top on the left, top to bottom on the right: both face the card. */
.edge--left .edge__text { transform: rotate(180deg); }
.edge__arrow { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentcolor; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.edge--down .edge__arrow { transform: rotate(180deg); }
.edge--left .edge__arrow { transform: rotate(-90deg); }
.edge--right .edge__arrow { transform: rotate(90deg); }
.edge--up { background: var(--chip); color: var(--text); }
.edge--right { background: var(--good-soft); color: var(--good); }
.edge--left { background: var(--warn-soft); color: var(--warn); }
.edge--down { background: var(--chip); color: var(--muted); }
/* The band aimed at deepens with the drag and fills once letting go would act, in step with the card:
   its `.wash` layer, under the arrow and label, whose opacity alone follows the finger. */
.edge { position: relative; isolation: isolate; }
.edge--up { --tone: var(--text); }
.edge--down { --tone: var(--muted); }
.edge--right { --tone: var(--good); }
.edge--left { --tone: var(--warn); }
.edge > .wash { z-index: -1; }
.edge--armed { color: var(--bg); }

/* The card fills the middle of the cross: the whole zone between the bands is what the finger drags,
   and the word lands at the same height on every card, in the upper third, whatever follows it. */
.card {
  align-self: stretch;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-card);
  box-shadow: 0 1px 2px rgb(0 0 0 / 4%), 0 8px 24px rgb(0 0 0 / 6%);
  padding: clamp(var(--s-5), 8dvh, 72px) var(--s-4) var(--s-5);
  touch-action: none;
  user-select: none;
  cursor: grab;
  transition: transform 0.22s ease-out;
  overflow-wrap: break-word;
}
.card:focus { outline: none; }
.card--dragging { transition: none; cursor: grabbing; will-change: transform; }
/* The next word arrives with a short rise, so a new card never passes for the one just judged. It
   animates `translate` and opacity, not `transform`, which the drag writes inline. */
.card--in { animation: card-in 0.16s ease-out; }
/* Opacity alone: a slide, however short, read as a jump on the phone. */
@keyframes card-in { from { opacity: 0; } }
.card--out { transition: transform 0.3s ease-in; }

/* Lemma's entry header: the word in the Czech face, italic, in the accent; a faint dot; the type in
   the text ink, a lower-case grammatical mention. */
.head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 var(--s-2); margin: 0; }
.head__word { font-family: var(--font-cz); font-style: italic; font-weight: 500; font-size: var(--fs-hero-lemma); line-height: 1.15; color: var(--accent); min-width: 0; }
.head__sep { font-size: var(--fs-entry-type); color: var(--faint); }
.head__type { font-size: var(--fs-entry-type); font-weight: 500; letter-spacing: var(--ls-entry-type); color: var(--text); }
.head--small .head__word { font-size: 26px; }
.head-line { margin: var(--s-1) 0 0; font-size: var(--fs-small); color: var(--muted); }
.head-line .cz { font-family: var(--font-cz); font-size: 16px; color: var(--text); }

/* Lemma's senses: a number column in grey, the glosses on one left edge, the labels under them. */
.senses { list-style: none; margin: var(--s-4) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--sense-gap); }
.sense { display: flex; gap: var(--num-gap); }
.sense__num { flex-shrink: 0; width: var(--num-w); font-size: var(--fs-meta); line-height: var(--num-lh); color: var(--muted); }
.sense__body { flex: 1; min-width: 0; }
.gloss { margin: 0; font-size: var(--fs-body); line-height: 1.45; text-wrap: pretty; }
.sense__labels { margin: var(--s-1) 0 0; font-size: var(--fs-sense-label); color: var(--muted); }

.end { margin: auto 0; padding-bottom: 6dvh; text-align: center; display: grid; gap: var(--s-2); justify-items: center; }
.end .title { margin: 0; }
.end__counts { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2); margin: var(--s-2) 0 var(--s-4); }
.end__counts .badge { margin: 0; font-size: var(--fs-small); padding: 5px 12px; font-variant-numeric: tabular-nums; }
.end .btn { width: min(100%, 280px); }

/* The keyboard, said once, where there is one. */
.kbd-hint { display: none; margin: var(--s-3) 0 0; text-align: center; font-size: var(--fs-meta); color: var(--muted); }
@media (hover: hover) and (pointer: fine) {
  .kbd-hint { display: block; }
}
.kbd-hint kbd { font: inherit; font-weight: 600; color: var(--text); padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); }

/* --- Sheets ----------------------------------------------------------------------------------- */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  transition: transform 0.25s ease-out;
}
.sheet[hidden] { display: none; }
.sheet--top { transform: translateY(-100%); }
.sheet--bottom { transform: translateY(100%); }
.sheet--open { transform: none; }

.sheet__body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: max(var(--s-5), env(safe-area-inset-top)) var(--gutter) var(--s-4);
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}
.sheet__foot {
  display: flex;
  gap: var(--s-2);
  padding: var(--s-3) var(--gutter) max(var(--s-3), env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-soft);
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}
.sheet__foot .btn { flex: 1; }

/* One step of the chain: who, what they decided, what they wrote. Their text reads as Lemma's
   examples do, behind a rule. */
.delivered { margin: var(--s-4) 0 0; padding: var(--s-3) var(--s-4) var(--s-4); background: var(--accent-soft); border-radius: var(--r-card); }
.delivered .eyebrow { margin: 0; color: var(--accent); }
.delivered .senses { margin-top: var(--s-2); }
.steps-title { margin-top: var(--s-5); }
.steps { list-style: none; margin: var(--s-3) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-3); }
.step { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-card); padding: var(--s-3) var(--s-4) var(--s-4); }
.step__who { margin: 0; font-size: var(--fs-btn); }
.step__who b { font-weight: 600; }
.step__model { color: var(--muted); }
.step__meta { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-small); }
.step .senses { margin-top: var(--s-3); gap: var(--s-2); }
.step__text { margin: var(--s-3) 0 0; padding-left: 11px; border-left: 2px solid var(--line); font-size: var(--fs-btn); line-height: 1.5; white-space: pre-wrap; }
.step__none { margin: var(--s-2) 0 0; color: var(--faint); font-size: var(--fs-small); }
.verdict { font-weight: 600; }
.verdict--bon { color: var(--good); }
.verdict--passable { color: var(--text); }
.verdict--faux { color: var(--warn); }

/* Lemma's report chips (« Faux · Imprécis · Incomplet · Pas compréhensible »). */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip {
  display: inline-flex;
  align-items: center;
  min-height: var(--chip-h);
  padding: 0 var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-small);
  cursor: pointer;
}
.chip[aria-pressed='true'] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.chip[aria-pressed='true']::before { content: "✓"; margin-right: var(--s-2); }

/* The way to the history: a pill that reads as a button, its count inside. */
.history-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--accent);
  font-size: var(--fs-small);
  font-weight: 600;
  cursor: pointer;
}
.history-btn:active { background: var(--accent-soft); }
.history-btn svg { width: 16px; height: 16px; fill: none; stroke: currentcolor; stroke-width: 2.2; stroke-linecap: round; }
.history-btn__count { color: var(--muted); font-variant-numeric: tabular-nums; }

/* The previous word, under the stage until the next verdict: where a verdict is made precise or taken
   back, so it reads as a zone to act in — the accent's soft tint, not one more white card — with its
   action drawn as a button. One fixed height in every state (empty, any verdict, a long word): the
   strip is swapped at each verdict, and a change of height would move the card. */
.prev {
  position: relative;
  display: flex;
  align-items: stretch;
  height: 62px;
  margin-top: var(--s-2);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: var(--r-btn-lg);
  background: var(--accent-soft);
}
/* No clipping on the strip (a « Pas bon » radiates past it): its two halves round their own corners. */
.prev__open { border-radius: calc(var(--r-btn-lg) - 1px) 0 0 calc(var(--r-btn-lg) - 1px); }
.prev__undo { border-radius: 0 calc(var(--r-btn-lg) - 1px) calc(var(--r-btn-lg) - 1px) 0; }
.prev__open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 0 10px 0 14px;
  border: 0;
  background: none;
  color: var(--text);
  font-size: var(--fs-btn);
  text-align: left;
  cursor: pointer;
}
.prev__open:active, .prev__undo:active { background: color-mix(in srgb, var(--accent) 14%, var(--accent-soft)); }
.prev__who { min-width: 0; display: grid; gap: 1px; overflow: hidden; }
.prev__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: var(--fs-eyebrow); font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.prev__line { display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; }
.prev__word { font-family: var(--font-cz); font-style: italic; font-size: 21px; color: var(--accent); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prev .badge { margin-top: 0; flex-shrink: 0; padding: 1px 8px; font-size: var(--fs-eyebrow); }
.prev__word { line-height: 1.2; }
.prev__act {
  margin-left: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--accent);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}
/* After a « Pas bon », saying what is wrong is the step the review needs most: the strip takes the
   « Pas bon » colour and its action is filled with it. Only colours change: same height, same places.
   « Revenir » turns to the ink, so the red stays the call to make it precise. */
.prev__act--strong { background: var(--warn); border-color: var(--warn); color: var(--bg); }
.prev--bad { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.prev--bad .prev__undo { color: var(--text); border-left-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.prev--bad .badge--bad { background: var(--surface); }
.prev--bad .prev__open:active, .prev--bad .prev__undo:active { background: color-mix(in srgb, var(--warn) 12%, var(--warn-soft)); }
.prev__undo {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 68px;
  padding: 0 10px;
  border: 0;
  border-left: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  background: none;
  color: var(--accent);
  font-size: var(--fs-meta);
  font-weight: 600;
  cursor: pointer;
}
/* Narrow phones: the verdict's badge says enough, the word keeps the room. */
@media (max-width: 379px) {
  .prev__label { display: none; }
}
.prev__undo svg { width: 19px; height: 19px; fill: none; stroke: currentcolor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.link--inline { padding: 0; min-height: 36px; font-size: var(--fs-small); }

/* The verdict, changeable: three segments, the chosen one in its own colour. */
/* One control of three segments sharing one frame: one verdict at a time, as on the card. */
.choices { display: flex; margin: var(--s-4) 0 0; padding: 3px; gap: 3px; border: 1px solid var(--line); border-radius: var(--r-btn-lg); background: var(--surface); }
.choice {
  flex: 1;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font-size: var(--fs-btn);
  font-weight: 600;
  cursor: pointer;
}
.choice--good[aria-pressed='true'] { background: var(--good); border-color: var(--good); color: var(--bg); }
.choice--bad[aria-pressed='true'] { background: var(--warn); border-color: var(--warn); color: var(--bg); }
.choice--unsure[aria-pressed='true'] { background: var(--muted); border-color: var(--muted); color: var(--bg); }

/* --- Recap ----------------------------------------------------------------------------------- */

.recap { flex: 1; }
.recap-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.recap-row {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-card);
  padding: var(--s-3) var(--s-4);
  color: var(--text);
  cursor: pointer;
}
.recap-row:active { background: var(--accent-soft); }
.recap-row__main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.recap-row .head__word { font-size: 22px; }
.recap-row .badge { margin-top: 5px; }
.bar--recap { display: grid; grid-template-columns: 1fr auto 1fr; }
.bar--recap .progress { text-align: center; }
.bar--recap .link { justify-self: start; }
.recap-row__gloss { font-size: var(--fs-btn); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recap-row__note { font-size: var(--fs-small); color: var(--muted); }
.badge { flex-shrink: 0; margin-top: 4px; padding: 3px 10px; border-radius: var(--r-pill); font-size: var(--fs-meta); font-weight: 600; }
.badge--good { background: var(--good-soft); color: var(--good); }
.badge--bad { background: var(--warn-soft); color: var(--warn); }
.badge--unsure { background: var(--chip); color: var(--muted); }

@media (hover: hover) and (pointer: fine) {
  .set:hover, .recap-row:hover { border-color: var(--accent); }
  .btn:hover { border-color: var(--accent); }
  .btn--primary:hover { opacity: 0.92; }
  .history-btn:hover, .chip:hover { border-color: var(--accent); }
  .prev__open:hover, .prev__undo:hover { background: color-mix(in srgb, var(--accent) 10%, var(--accent-soft)); }
  .prev--bad .prev__open:hover, .prev--bad .prev__undo:hover { background: color-mix(in srgb, var(--warn) 8%, var(--warn-soft)); }
  .choice:hover:not([aria-pressed='true']) { background: var(--chip); }
  .edge--up:hover, .edge--down:hover { background: var(--line-soft); }
  .edge--left:hover { color: var(--bg); background: var(--warn); }
  .edge--right:hover { color: var(--bg); background: var(--good); }
  .link:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 3px; }
}

.head__rank { font-size: 0.5em; font-style: normal; margin-left: 1px; }

/* What the drag will do: the card covers the band it heads for, so it takes on that band's colour,
   growing with the drag and firmer once letting go would act (swipe.js writes each `.wash` layer's
   opacity). No text on top (PM's choice: the colour alone). The wash is a layer of its own whose
   opacity alone changes, so the phone blends it without repainting the card. */
/* Above the bands, whose arrows are turned (so layered) and would otherwise show through the card. */
.card { position: relative; z-index: 1; }
.card[data-aim='right'] { --tone: var(--good); }
.card[data-aim='left'] { --tone: var(--warn); }
.card[data-aim='down'] { --tone: var(--muted); }
.card[data-aim='up'] { --tone: var(--text); }
.wash {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--tone, transparent);
  opacity: 0;
  pointer-events: none;
}
.card--dragging .wash, .edge--aimed .wash { will-change: opacity; }
/* A band lit by the drag fades back once the next card is in. */
.edge > .wash { transition: opacity 0.25s ease-out; }
.edge--aimed > .wash { transition: none; }
/* Before the first verdict: the same frame, dashed, saying what the zone will be for. */
.prev--empty { align-items: center; justify-content: center; padding: 0 var(--s-4); border-style: dashed; background: none; }
.prev__empty { color: var(--muted); font-size: var(--fs-meta); line-height: 1.35; text-align: center; text-wrap: balance; }
/* The first verdict of a visit draws the eye to the strip once: a soft glow of the accent, gone in a
   second. Opacity alone, on a layer of its own; the first touch of the next card ends it (app.js), so
   it never runs under a drag. */
.prev--fresh::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 2px var(--accent);
  opacity: 0;
  pointer-events: none;
  animation: prev-glow 1.1s ease-out 0.15s;
}
.prev--bad.prev--fresh::before { box-shadow: inset 0 0 0 2px var(--warn); }
@keyframes prev-glow { 25% { opacity: 1; } 100% { opacity: 0; } }
/* A « Pas bon » just given: the strip flares red and glows evenly around its edges, then fades back to
   its soft red in about a second (PM, 2026-11-25: softer than the first version, and the glow stays
   around the strip instead of rising toward the card). Two layers of their own that only fade (opacity)
   and spread (transform): the flash inside the strip, under its words and buttons, and the radiation
   behind it, seen past its edges. The first touch of the next card ends both (app.js): left running
   under a drag, they restyle the page on every frame. */
.prev > button { position: relative; z-index: 1; }
.prev--flare { --flare: var(--warn); }
.prev--flare::before,
.prev--flare::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
}
.prev--flare::before { background: var(--flare); animation: prev-flash 1.2s ease-out; }
/* The radiation: a red field larger than the strip, its edges faded by a mask (a soft light, never a
   block), behind the strip so only what reaches past its edges shows. */
.prev--flare::after {
  inset: -12px;
  transform-origin: 50% 50%;
  z-index: -1;
  border-radius: 0;
  background: var(--flare);
  -webkit-mask: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 12px), transparent),
    linear-gradient(to bottom, transparent, #000 12px, #000 calc(100% - 12px), transparent);
  -webkit-mask-composite: source-in;
  mask: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 12px), transparent),
    linear-gradient(to bottom, transparent, #000 12px, #000 calc(100% - 12px), transparent);
  mask-composite: intersect;
  animation: prev-radiate 1.1s cubic-bezier(0.2, 0.7, 0.3, 1);
}
@keyframes prev-flash {
  0% { opacity: 0; }
  12% { opacity: 0.55; }
  100% { opacity: 0; }
}
@keyframes prev-radiate {
  0% { opacity: 0; transform: scale(0.97); }
  15% { opacity: 0.35; }
  100% { opacity: 0; transform: scale(1.03); }
}
@media (prefers-color-scheme: dark) {
  /* The dark theme's « Pas bon » is a pale orange: the flare takes a deep red, under white words. */
  .prev--flare { --flare: #c8452a; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .sheet, .edge, .meter__done { transition: none; }
  .card--in, .prev--fresh::before, .prev--flare::before, .prev--flare::after { animation: none; }
}
