/* TONEDLE ================================================================
   Daily color matching game. White editorial page, ink text, hairline
   structure. Gray lives only on the stage mat. Color is earned: the
   character art, the live guess, and the true color after the reveal.
   ======================================================================= */

:root {
  /* paper and ink */
  --paper: #FFFFFF;
  --ink: #1A1A1A;
  --text-dim: #787C7E;
  --hairline: #D3D6DA;
  --well: #F6F7F8;

  /* the mat, the only gray field */
  --mat: #7B7B7B;
  --mat-caption: #EDEDED;
  --mat-line: #8F8F8F;

  /* live guess, written by js */
  --r: 128;
  --g: 128;
  --b: 128;
  --guess: rgb(var(--r), var(--g), var(--b));

  /* earned accent, set to the true color after a reveal */
  --accent: #1A1A1A;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(26, 26, 26, 0.14);

  --shade-boost: 1;

  --col: 560px;
  --radius: 4px;
  --radius-well: 6px;

  --meter-hit: #6AAA64;
  --meter-near: #E8B93B;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-text-size-adjust: 100%;
}
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }

body {
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
  min-height: 100svh;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

.mono {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---------------------------------------------------------------- loading */
.loader {
  position: fixed; inset: 0; z-index: 40;
  background: var(--paper);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px;
}
.loader { transition: opacity .34s ease; }
.loader.gone { opacity: 0; pointer-events: none; }
.loader-mark {
  font-weight: 800; font-size: 26px; letter-spacing: 0.26em;
  text-indent: 0.26em;
}
.loader-note { color: var(--text-dim); font-size: 14px; }
.loader-line {
  width: 200px; height: 2px; background: var(--hairline); overflow: hidden;
}
.loader-line i { display: block; height: 100%; width: 0%; background: var(--ink); }

/* ----------------------------------------------------------------- shell */
.shell {
  min-height: 100svh;
  display: flex; flex-direction: column;
  opacity: 0;
}
.shell.ready { opacity: 1; }

.chrome {
  height: 56px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 14px;
  border-bottom: 1px solid var(--hairline);
}
.chrome-end { display: flex; justify-content: flex-end; gap: 4px; }

.wordmark {
  font: 800 20px/1 "Archivo", sans-serif;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  color: var(--ink);
  background: none; border: 0; cursor: pointer;
  padding: 12px 4px;
}

.icon-btn {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: none; border: 0; cursor: pointer;
  color: var(--ink); border-radius: 999px;
}
.icon-btn svg { width: 22px; height: 22px; }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { background: var(--well); }

.wrap {
  flex: 1;
  width: 100%;
  max-width: calc(var(--col) + 32px);
  margin: 0 auto;
  padding: 0 16px 40px;
}

.byline {
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  padding: 14px 0 18px;
  min-height: 22px;
}
.byline .mono { color: var(--text-dim); }
.byline b { font-weight: 400; color: var(--ink); }

.view { display: flex; flex-direction: column; gap: 14px; }
.view-center {
  align-items: center; justify-content: center; text-align: center;
  gap: 18px; min-height: 52vh;
}

.foot {
  border-top: 1px solid var(--hairline);
  padding: 12px;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
}

/* ------------------------------------------------------------ the banner */
.banner {
  display: flex; gap: 12px; align-items: center;
  background: var(--well);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.banner-icon { width: 22px; height: 22px; flex: none; }
.banner-line { font-weight: 600; font-size: 15px; }
.banner-line .mono { font-weight: 600; }
.banner-sub { color: var(--text-dim); font-size: 14px; }

/* ------------------------------------------------------------- the stage */
.stage {
  background: var(--mat);
  border-radius: var(--radius);
  padding: 14px 14px 10px;
}
.plate {
  position: relative;
  height: clamp(190px, 52vw, 290px);
  display: grid;
  place-items: center;
}
.plate-base, .plate-layer {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.plate-base { object-fit: contain; }
.plate-layer {
  -webkit-mask-image: var(--mask);
  mask-image: var(--mask);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  pointer-events: none;
}
.plate-paint { background-color: var(--guess); }
.plate-true {
  background-color: var(--accent);
  clip-path: circle(0% at 50% 50%);
}
/* keeps whatever shading the source art had: the base is normalised so a
   flat region multiplies to white (no change) and shadows stay relative */
.plate-shade {
  background-image: var(--base);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  filter: brightness(var(--shade-boost));
  mix-blend-mode: multiply;
}
.plate-swatch {
  position: absolute;
  inset: 8% 12%;
  border-radius: var(--radius);
  background: var(--swatch, #C4574E);
}

.stage-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--mat-line);
}
.chip-mat {
  font-size: 12px;
  color: var(--mat-caption);
  border: 1px solid var(--mat-line);
  border-radius: 3px;
  padding: 3px 9px;
}
.stage-no { font-size: 12px; color: var(--mat-caption); }

/* -------------------------------------------------------------- the rack */
.card {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 18px;
}
.rack { display: flex; flex-direction: column; gap: 12px; }
.rack-head {
  text-align: right;
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 2px;
}
.rack-head b { color: var(--ink); font-weight: 600; margin-right: 2px; }

.slider-row {
  display: grid;
  grid-template-columns: 18px 1fr 62px;
  align-items: center;
  gap: 10px;
}
.ch { font-size: 13px; font-weight: 600; text-align: center; }

.track {
  display: block;
  background: var(--well);
  border-radius: var(--radius-well);
  padding: 2px 12px;
}
body.no-scroll { overflow: hidden; }
.track input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 32px;
  background: none;
  cursor: pointer;
  margin: 0;
}
.track input[type="range"]::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 5px;
  background: var(--grad, var(--well));
}
.track input[type="range"]::-moz-range-track {
  height: 10px;
  border-radius: 5px;
  background: var(--grad, var(--well));
}
.track input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  margin-top: -6px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid var(--ink);
  cursor: grab;
  transition: transform .12s ease, box-shadow .12s ease;
}
.track input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid var(--ink);
  cursor: grab;
}
.track input[type="range"].dragging::-webkit-slider-thumb {
  transform: scale(1.2);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--guess) 34%, transparent);
}
.track input[type="range"].dragging::-moz-range-thumb {
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--guess) 34%, transparent);
}

.val {
  font-size: 14px;
  text-align: center;
  border: 1px solid var(--hairline);
  border-radius: 3px;
  padding: 7px 0;
}

.readout {
  display: flex; align-items: center; gap: 14px;
  margin-top: 2px;
}
.readout-swatch {
  width: 48px; height: 48px; flex: none;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: var(--guess);
}
.readout-text { display: flex; flex-direction: column; gap: 2px; }
.hex { font-size: 21px; font-weight: 600; letter-spacing: 0.01em; }
.rgb { font-size: 13px; color: var(--text-dim); }

/* ------------------------------------------------------------- buttons */
.pill {
  font: 600 16px/1 "Archivo", sans-serif;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 17px 24px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  transition: transform .12s ease;
}
.pill:active { transform: scale(.975); }
.pill-ink { background: var(--ink); color: #FFFFFF; width: 100%; }
.pill-accent { background: var(--accent); color: var(--accent-ink); flex: 1; }
.pill-ghost {
  background: var(--paper); color: var(--ink);
  border-color: var(--hairline);
  padding-left: 22px; padding-right: 22px;
}
.pill-tight { width: auto; padding: 14px 34px; }
.btn-icon { width: 18px; height: 18px; }

.linkish {
  background: none; border: 0; cursor: pointer;
  font: 400 15px/1.4 "Archivo", sans-serif;
  color: var(--text-dim);
  padding: 12px 6px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.linkish:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.quiet-nav { text-align: center; padding-top: 4px; }
.footnote { text-align: center; color: var(--text-dim); font-size: 13px; padding-top: 4px; }

/* -------------------------------------------------------- guess history */
.rows { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.row {
  position: relative;
  display: grid;
  grid-template-columns: 26px 24px 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 13px 14px;
  overflow: hidden;
}
.row::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--own);
}
.row.empty { border-style: dashed; }
.row.empty::before { background: none; }
.row.done { border-color: var(--own-soft); }
.row-i { font-size: 12px; color: var(--text-dim); }
.row-sw { width: 24px; height: 24px; border-radius: 3px; background: var(--own); }
.row-pc { font-size: 15px; font-weight: 600; }
.row-chips { display: flex; gap: 6px; }
.row-chips i {
  font-style: normal;
  font-size: 11px;
  border: 1px solid var(--hairline);
  border-radius: 3px;
  padding: 4px 7px;
  background: var(--well);
  display: inline-flex; gap: 5px;
  min-width: 38px;
  justify-content: center;
}
.row-chips i span { display: inline-block; }

/* ------------------------------------------------------------ result card */
.result { display: flex; flex-direction: column; gap: 0; }
.headline { font-weight: 800; font-size: clamp(28px, 6vw, 34px); letter-spacing: -0.015em; }
.headline-lg { font-size: clamp(32px, 8vw, 42px); }
.result-sub { color: var(--text-dim); font-size: 15px; margin-top: 4px; }
.result-sub b { color: var(--ink); font-weight: 600; }
.lede { color: var(--text-dim); font-size: 15px; margin-top: -6px; }

.reveal {
  display: flex; align-items: center; gap: 14px;
  margin-top: 16px;
}
.reveal-sw {
  width: 56px; height: 56px; flex: none;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: var(--accent);
}
.reveal-label { color: var(--text-dim); font-size: 14px; }
.reveal-hex { font-size: 22px; font-weight: 600; display: block; margin-top: 2px; }

.strip-head {
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--text-dim);
  border-top: 1px solid var(--hairline);
  margin-top: 18px; padding-top: 14px;
}
.strip { display: flex; gap: 8px; margin-top: 8px; }
.strip i { flex: 1; height: 34px; border-radius: 3px; background: var(--c); }
.strip i.target { box-shadow: inset 0 0 0 2px var(--ink); }

.result-actions { display: flex; gap: 10px; margin-top: 16px; }

.countdown-row {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--text-dim); font-size: 14px;
  margin-top: 16px;
}
.countdown-row .mono { color: var(--ink); font-size: 15px; }
.cd-icon { width: 15px; height: 15px; flex: none; color: var(--text-dim); }
.cd .d { display: inline-block; }
.cd .d.roll { animation: digit-roll .28s ease-out; }
@keyframes digit-roll {
  from { transform: translateY(-55%); opacity: .25; }
  to { transform: none; opacity: 1; }
}

/* ---------------------------------------------------------- the darkroom */
.feature { display: flex; gap: 16px; align-items: center; }
.feature-art {
  width: 168px; flex: none; height: 108px;
  background: var(--mat); border-radius: var(--radius);
  display: grid; place-items: center; overflow: hidden;
}
.feature-art img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.feature-body { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.tagchip {
  font-size: 12px; color: var(--text-dim);
  border: 1px solid var(--hairline); border-radius: 999px;
  padding: 4px 10px;
}
.feature-name { font-size: 19px; font-weight: 600; }
.feature-name .mono { font-weight: 400; color: var(--text-dim); }
.feature-note { color: var(--text-dim); font-size: 14px; }
.feature .pill { margin-top: 6px; padding: 13px 26px; width: auto; }

.rowhead {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 6px;
}
.rowhead-label { font-size: 13px; color: var(--text-dim); }
.rowhead-note { font-size: 13px; color: var(--text-dim); }

.archive {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.plate-card {
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 22px;
}
.plate-card:hover { border-color: var(--ink); }
.plate-card.on { border-color: var(--ink); background: var(--well); box-shadow: inset 0 0 0 1px var(--ink); }
.plate-card-top { display: flex; justify-content: space-between; align-items: center; }
.plate-card-no { font-size: 12px; color: var(--text-dim); }
.plate-card-dot { width: 13px; height: 13px; border-radius: 3px; border: 1px solid var(--hairline); }
.plate-card > span:last-child { display: flex; flex-direction: column; gap: 1px; }
.plate-card-name { font-size: 15px; font-weight: 600; }
.plate-card-state { font-size: 13px; color: var(--text-dim); }
.plate-card.unsolved .plate-card-name, .plate-card.unsolved .plate-card-state { color: var(--text-dim); }

/* ---------------------------------------------------------------- versus */
.setup { display: flex; flex-direction: column; gap: 0; }
.field-label { font-size: 13px; color: var(--text-dim); margin-bottom: 8px; }
.setup .field-label + .segment { margin-bottom: 16px; }
.segment { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.seg {
  font: 600 16px/1 "Archivo", sans-serif;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 18px 0;
  cursor: pointer;
  color: var(--ink);
}
.seg.on { background: var(--ink); color: #FFFFFF; border-color: var(--ink); }
.setup .pill { margin-top: 4px; }
.pass-round { font-size: 13px; color: var(--text-dim); letter-spacing: 0.1em; }

.vs-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.vs-line {
  position: relative;
  display: grid; grid-template-columns: 24px 1fr auto auto;
  align-items: center; gap: 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 13px 14px;
  overflow: hidden;
}
.vs-line::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--own);
}
.vs-line.win { box-shadow: inset 0 0 0 1px var(--ink); border-color: var(--ink); background: var(--well); }
.vs-sw { width: 24px; height: 24px; border-radius: 3px; background: var(--own); }
.vs-name { font-weight: 600; font-size: 15px; }
.vs-tag {
  font-size: 11px; background: var(--ink); color: #FFF;
  border-radius: 3px; padding: 4px 8px; font-weight: 600;
}
.vs-pc { font-size: 15px; font-weight: 600; }

.round-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-top: 8px; }
.round-cell {
  border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 12px;
}
.round-cell.win { border-color: var(--ink); background: var(--well); box-shadow: inset 0 0 0 1px var(--ink); }
.round-cell .mono.small { font-size: 12px; color: var(--text-dim); display: block; }
.round-cell .who { font-weight: 600; font-size: 15px; margin: 4px 0 2px; }

/* -------------------------------------------------------- meter (share) */
.meter-row { display: flex; align-items: center; gap: 14px; }
.meter { display: flex; gap: 5px; }
.meter i {
  width: 22px; height: 22px; border-radius: 3px;
  border: 1px solid var(--hairline);
  background: var(--paper);
}
.meter i.near { background: var(--meter-near); border-color: var(--meter-near); }
.meter i.hit { background: var(--meter-hit); border-color: var(--meter-hit); }
.meter-pc { font-size: 14px; color: var(--text-dim); }
.meter-who { width: 54px; font-size: 14px; font-weight: 600; }

.compare-rows { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--hairline); }
.compare-rows .meter-pc { margin-left: auto; color: var(--ink); font-weight: 600; }

/* ---------------------------------------------------------------- modals */
.scrim {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(26, 26, 26, 0.4);
}
.modal {
  position: fixed; z-index: 60;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100svh - 48px);
  overflow-y: auto;
  scrollbar-width: none;
  background: var(--paper);
  border-radius: 6px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18);
  padding: 22px;
  animation: modal-in .24s ease-out;
}
.modal::-webkit-scrollbar { display: none; }
@keyframes modal-in {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.94); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-head h2 { font-size: 21px; font-weight: 800; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.step-art { height: 96px; border-radius: var(--radius); overflow: hidden; }
.step-art-mat { background: var(--mat); display: grid; place-items: center; }
.step-art-mat img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.step-art-well {
  background: var(--well);
  display: flex; flex-direction: column; justify-content: center; gap: 9px;
  padding: 0 14px;
}
.mini-track { height: 7px; border-radius: 4px; background: var(--g1); display: block; }
.step-art-frame {
  border: 1px solid var(--hairline);
  display: flex; flex-direction: column; justify-content: center; gap: 10px;
  padding: 0 12px;
}
.mini-row { display: flex; align-items: center; gap: 8px; }
.mini-row b { font-size: 14px; font-weight: 600; }
.mini-swatch { width: 20px; height: 20px; border-radius: 3px; background: #00B1B0; }
.mini-chips { display: flex; gap: 5px; }
.mini-chips i {
  font-style: normal; font-size: 10px;
  border: 1px solid var(--hairline); border-radius: 3px;
  padding: 3px 5px; background: var(--well);
}
.step-name { font-size: 15px; font-weight: 600; margin-top: 12px; }
.step-name .mono { color: var(--text-dim); font-weight: 400; margin-right: 4px; font-size: 13px; }
.step-copy { font-size: 14px; color: var(--text-dim); margin-top: 3px; }

.rules {
  list-style: none;
  border-top: 1px solid var(--hairline);
  margin-top: 20px; padding-top: 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.rules li { position: relative; padding-left: 20px; font-size: 15px; }
.rules li::before {
  content: ""; position: absolute; left: 2px; top: 8px;
  width: 7px; height: 7px; background: var(--ink);
}
.modal .pill-ink { margin-top: 22px; }

.metrics {
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding-bottom: 18px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 20px;
}
.modal .countdown-row {
  border-top: 1px solid var(--hairline);
  padding-top: 16px;
  margin-top: 4px;
}
.metric { padding-left: 14px; border-left: 1px solid var(--hairline); }
.metric:first-child { padding-left: 0; border-left: 0; }
.metric-label { font-size: 13px; color: var(--text-dim); }
.metric-val { font-size: 27px; font-weight: 800; margin-top: 2px; }

.dist { display: flex; flex-direction: column; gap: 7px; margin-bottom: 20px; }
.dist-row { display: grid; grid-template-columns: 16px 1fr; align-items: center; gap: 10px; }
.dist-k { font-size: 13px; color: var(--text-dim); }
.dist-bar {
  background: var(--well);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  padding: 4px 8px;
  text-align: right;
  font-size: 13px; font-weight: 600;
  min-width: 34px;
}
.dist-bar.today { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.share-preview {
  background: var(--well);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.share-title { font-size: 16px; font-weight: 600; }
.share-url { font-size: 13px; color: var(--text-dim); margin-top: 4px; }

.toast {
  position: fixed; z-index: 70;
  left: 50%; bottom: 40px;
  transform: translateX(-50%);
  background: var(--ink); color: #FFFFFF;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  display: flex; align-items: center; gap: 8px;
}
.toast svg { width: 15px; height: 15px; stroke: var(--accent-live, #FFFFFF); stroke-width: 2.2; }

/* ------------------------------------------------------ entrance motion */
.stage.enter { animation: stage-in .55s cubic-bezier(.34, 1.36, .64, 1); }
@keyframes stage-in {
  from { opacity: 0; transform: scale(.93); }
  to { opacity: 1; transform: scale(1); }
}

.plate-paint.enter { animation: region-in .5s .26s ease-out backwards; }
@keyframes region-in {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0 0 0 0); }
}

.plate-paint.breathe { animation: breathe 2.6s .8s ease-in-out infinite; }
@keyframes breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: .74; }
}

.rack.enter > * { animation: rise .4s ease-out backwards; }
.rack.enter > *:nth-child(1) { animation-delay: .18s; }
.rack.enter > *:nth-child(2) { animation-delay: .23s; }
.rack.enter > *:nth-child(3) { animation-delay: .28s; }
.rack.enter > *:nth-child(4) { animation-delay: .33s; }
.rack.enter > *:nth-child(5) { animation-delay: .38s; }
.rack.enter > *:nth-child(6) { animation-delay: .43s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.rows.enter > li { animation: fade-in .3s backwards; }
.rows.enter > li:nth-child(1) { animation-delay: .42s; }
.rows.enter > li:nth-child(2) { animation-delay: .46s; }
.rows.enter > li:nth-child(3) { animation-delay: .50s; }
.rows.enter > li:nth-child(4) { animation-delay: .54s; }
.rows.enter > li:nth-child(5) { animation-delay: .58s; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.swap-in { animation: swap-in .3s ease-out; }
@keyframes swap-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.toast { animation: toast-in .22s ease-out; }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* pigment burst */
.burst { position: fixed; inset: 0; z-index: 30; pointer-events: none; overflow: hidden; }
.pigment { position: absolute; border-radius: 4px; will-change: transform; }

/* --------------------------------------------------------------- mobile */
@media (max-width: 560px) {
  .wrap { padding: 0 16px 32px; }
  .byline { font-size: 13px; padding: 12px 0 14px; }
  .steps { grid-template-columns: 1fr; }
  .step-art { height: 88px; }
  .metrics { grid-template-columns: repeat(2, 1fr); gap: 16px 0; }
  .metric:nth-child(3) { padding-left: 0; border-left: 0; }
  .modal {
    top: auto; bottom: 0;
    transform: translate(-50%, 0);
    width: 100%;
    border-radius: 10px 10px 0 0;
    max-height: 92svh;
    animation-name: modal-up;
  }
  @keyframes modal-up {
    from { opacity: 0; transform: translate(-50%, 14%); }
    to { opacity: 1; transform: translate(-50%, 0); }
  }
  .result-actions { flex-direction: column; }
  .pill-ghost { width: 100%; }
  .feature { flex-direction: column; align-items: stretch; }
  .feature-art { width: 100%; }
  .row { grid-template-columns: 22px 22px 1fr auto; gap: 9px; padding: 11px 12px; }
  .row-chips i { min-width: 34px; padding: 4px 5px; }
  .archive { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 380px) {
  .row-chips { gap: 4px; }
  .row-chips i { min-width: 30px; font-size: 10px; }
}

/* ------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .pill:active { transform: none; }
}
