/* ══════════════════════════════════════════════════════════════
   THE BESTIARY — Institute of Applied Zoology
   Field-guide / taxonomy-laboratory styling.
   No external fonts, images, or network requests. All self-contained.
   ══════════════════════════════════════════════════════════════ */

:root {
  /* Warm near-black paper stack */
  --ink-000: #0b0907;
  --ink-050: #0f0d0a;
  --ink-100: #16130f;
  --ink-200: #1d1915;
  --ink-300: #272219;
  --line:    rgba(255, 233, 200, 0.10);
  --line-2:  rgba(255, 233, 200, 0.18);

  /* Type */
  --paper:   #f3ead9;
  --paper-2: #cbbfa9;
  --paper-3: #8e836f;

  /* Warm accent + supporting */
  --accent:    #ffab4a;
  --accent-hi: #ffc887;
  --accent-lo: #b56f1e;
  --sage:      #8fc9a0;
  --rust:      #e2703f;

  --mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Mono", Menlo,
          Consolas, "Liberation Mono", "Courier New", monospace;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
             "Hoefler Text", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --r:   14px;
  --r-sm: 9px;
  --wrap: 900px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

/* The UA sheet's [hidden] { display: none } is a type selector and loses to any
   author class rule that sets `display` (.btn, .stage, .drop-veil …). Without
   this reset the `hidden` attribute is silently inert on those elements. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ink-000);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Faint graph-paper field, warm vignette. Pure CSS, no images. */
.bg-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(120% 80% at 50% -10%, rgba(255, 171, 74, .10), transparent 60%),
    radial-gradient(90% 60% at 90% 110%, rgba(143, 201, 160, .05), transparent 60%),
    linear-gradient(rgba(255, 233, 200, .028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 233, 200, .028) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 28px 28px, 28px 28px;
}

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }

.mono { font-family: var(--mono); }
.display { font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: #241503; font-weight: 700;
  padding: 10px 16px; border-radius: 0 0 var(--r-sm) var(--r-sm);
  text-decoration: none; transition: top .18s var(--ease);
}
.skip-link:focus { top: 0; }

/* ── Focus rings ─────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent-hi);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Header ──────────────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(var(--ink-050), transparent);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-block: 14px;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { font-size: 24px; line-height: 1; filter: saturate(1.1); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong {
  font-family: var(--display); font-size: 19px; letter-spacing: .01em;
}
.brand-text small { font-size: 10.5px; letter-spacing: .13em; color: var(--paper-3); text-transform: uppercase; }
.header-meta { font-size: 10.5px; letter-spacing: .16em; color: var(--paper-3); }

/* ── Stages ──────────────────────────────────────────────── */
main { padding-block: clamp(28px, 6vw, 60px) 40px; }
/* .stage[hidden] is covered by the global [hidden] reset above. */

/* ── Hero ────────────────────────────────────────────────── */
.hero { text-align: center; margin-bottom: clamp(24px, 5vw, 40px); }
.eyebrow {
  font-size: 10.5px; letter-spacing: .19em; color: var(--accent);
  margin: 0 0 14px; text-transform: uppercase;
}
h1.display {
  font-size: clamp(38px, 9vw, 68px);
  line-height: 1.02; margin: 0 0 16px; text-wrap: balance;
}
h1.display em {
  font-style: italic; color: var(--accent);
  text-shadow: 0 0 34px rgba(255, 171, 74, .32);
}
.lede {
  margin: 0 auto; max-width: 54ch; color: var(--paper-2);
  font-size: clamp(15px, 2.1vw, 17.5px); text-wrap: pretty;
}
.lede strong { color: var(--paper); font-weight: 600; }

/* ── Specimen panel framing ──────────────────────────────── */
.specimen {
  position: relative;
  background:
    linear-gradient(var(--ink-100), var(--ink-050));
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  padding: clamp(18px, 4vw, 30px);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .9),
              inset 0 1px 0 rgba(255, 233, 200, .05);
}
.specimen + .specimen { margin-top: 18px; }

/* corner registration ticks */
.ticks { position: absolute; inset: 8px; pointer-events: none; border-radius: 8px; }
.ticks::before, .ticks::after {
  content: ""; position: absolute; width: 16px; height: 16px;
  border-color: var(--accent); opacity: .5;
}
.ticks::before { top: 0; left: 0; border-top: 1.5px solid; border-left: 1.5px solid; border-radius: 4px 0 0 0; }
.ticks::after  { bottom: 0; right: 0; border-bottom: 1.5px solid; border-right: 1.5px solid; border-radius: 0 0 4px 0; }

.panel-title {
  font-size: 10.5px; letter-spacing: .18em; color: var(--accent);
  margin: 0 0 14px; text-transform: uppercase;
}

/* ── Dropzone ────────────────────────────────────────────── */
.dropzone {
  border: 2px dashed var(--line-2);
  border-radius: var(--r-sm);
  padding: clamp(30px, 8vw, 56px) 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease);
  background: rgba(255, 233, 200, .012);
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent); background: rgba(255, 171, 74, .05); }
.dropzone.is-over {
  border-color: var(--accent); background: rgba(255, 171, 74, .10);
  transform: scale(1.012);
}
.dz-icon { font-size: 44px; display: block; margin-bottom: 10px; }
.dropzone.is-over .dz-icon { animation: wiggle .5s var(--ease); }
@keyframes wiggle { 25% { transform: rotate(-11deg); } 75% { transform: rotate(11deg); } }
.dz-title { font-family: var(--display); font-size: clamp(19px, 3.4vw, 25px); margin: 0 0 5px; }
.dz-sub { margin: 0 0 14px; color: var(--paper-2); font-size: 15px; }
.linky { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.dz-fine { margin: 0; font-size: 10.5px; letter-spacing: .1em; color: var(--paper-3); text-transform: uppercase; }

.capture-actions {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; flex-wrap: wrap; margin-top: 18px;
}
.hint { font-size: 11.5px; color: var(--paper-3); margin: 0; letter-spacing: .04em; }
kbd {
  font-family: var(--mono); font-size: 10.5px;
  border: 1px solid var(--line-2); border-bottom-width: 2px;
  border-radius: 4px; padding: 1px 5px; color: var(--paper-2);
  background: var(--ink-200);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 15px;
  padding: 12px 22px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .16s var(--ease), background .16s var(--ease),
              border-color .16s var(--ease), box-shadow .16s var(--ease), color .16s var(--ease);
}
.btn:active { transform: translateY(1px) scale(.985); }

.btn-primary {
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  color: #2a1802;
  box-shadow: 0 8px 26px -10px rgba(255, 171, 74, .75);
}
.btn-primary:hover { filter: brightness(1.07); box-shadow: 0 12px 32px -10px rgba(255, 171, 74, .9); }

.btn-secondary {
  background: var(--ink-300); color: var(--paper); border-color: var(--line-2);
}
.btn-secondary:hover { background: #332b20; border-color: var(--accent-lo); }

.btn-ghost { background: transparent; color: var(--paper-2); border-color: var(--line-2); }
.btn-ghost:hover { color: var(--paper); border-color: var(--paper-3); }

.btn-lg { font-size: 17px; padding: 15px 30px; }
.btn-sm { font-size: 13px; padding: 8px 16px; }

/* ── Camera ──────────────────────────────────────────────── */
.camera-frame {
  position: relative; border-radius: var(--r-sm); overflow: hidden;
  background: #000; aspect-ratio: 4 / 3; border: 1px solid var(--line-2);
}
#video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.reticle {
  position: absolute; inset: 12%;
  border: 1.5px solid rgba(255, 171, 74, .45);
  border-radius: 50%;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .18);
}
.countdown {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--display); font-size: clamp(80px, 26vw, 170px); font-weight: 700;
  color: var(--accent); text-shadow: 0 6px 40px rgba(0, 0, 0, .85);
  background: rgba(0, 0, 0, .30);
  opacity: 0; pointer-events: none;
}
.countdown.tick { animation: pop .85s var(--ease); }
@keyframes pop {
  0%   { opacity: 0; transform: scale(1.55); }
  22%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(.82); }
}
.camera-frame.flash::after {
  content: ""; position: absolute; inset: 0; background: #fff;
  animation: flash .38s ease-out forwards;
}
@keyframes flash { from { opacity: .95; } to { opacity: 0; } }

.camera-actions {
  display: flex; align-items: center; justify-content: center;
  gap: 18px; margin-top: 18px;
}
.shutter {
  width: 68px; height: 68px; border-radius: 50%; cursor: pointer;
  background: var(--accent); border: 3px solid var(--ink-000);
  box-shadow: 0 0 0 3px var(--accent), 0 10px 28px -10px rgba(255, 171, 74, .9);
  display: grid; place-items: center;
  transition: transform .16s var(--ease), filter .16s var(--ease);
}
.shutter:hover { filter: brightness(1.08); }
.shutter:active { transform: scale(.9); }
.shutter[disabled] { opacity: .45; cursor: not-allowed; }
.shutter-ring { width: 46px; height: 46px; border-radius: 50%; border: 2px solid rgba(42, 24, 2, .35); }
.camera-panel .hint { text-align: center; margin-top: 12px; }

/* ── Preview ─────────────────────────────────────────────── */
.preview-grid {
  display: grid; gap: clamp(18px, 4vw, 28px);
  grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
  align-items: center;
}
.thumb { margin: 0; }
.thumb img {
  width: 100%; aspect-ratio: 1; object-fit: cover; display: block;
  border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--ink-200);
}
.thumb figcaption {
  font-size: 10px; letter-spacing: .16em; color: var(--paper-3);
  margin-top: 8px; text-align: center; text-transform: uppercase;
}
.preview-copy > p { color: var(--paper-2); margin: 0 0 18px; }
.preview-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ── Analysing ───────────────────────────────────────────── */
.analysing-card { text-align: center; }
.scan-frame {
  position: relative; width: min(340px, 100%); margin: 0 auto 22px;
  aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden;
  border: 1px solid var(--line-2); background: var(--ink-200);
}
#scan-img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.72) contrast(1.05); }
.scan-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 171, 74, .13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 171, 74, .13) 1px, transparent 1px);
  background-size: 34px 34px;
  mix-blend-mode: screen;
}
.scan-line {
  position: absolute; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-hi), transparent);
  box-shadow: 0 0 22px 6px rgba(255, 171, 74, .55);
  animation: scan 2.1s ease-in-out infinite;
}
@keyframes scan {
  0%, 100% { top: 4%; }
  50%      { top: 96%; }
}
.status-line {
  font-family: var(--mono); font-size: clamp(13px, 2.4vw, 15px);
  color: var(--accent-hi); margin: 0 0 14px; min-height: 2.6em;
  display: flex; align-items: center; justify-content: center;
  animation: fadeSlide .45s var(--ease);
}
@keyframes fadeSlide { from { opacity: 0; transform: translateY(6px); } }
.dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; }
.dots i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  animation: bounce 1.1s ease-in-out infinite;
}
.dots i:nth-child(2) { animation-delay: .16s; }
.dots i:nth-child(3) { animation-delay: .32s; }
@keyframes bounce {
  0%, 100% { opacity: .28; transform: translateY(0); }
  50%      { opacity: 1;   transform: translateY(-5px); }
}

/* ── Result ──────────────────────────────────────────────── */
.result-card { overflow: hidden; }

.verdict-head { border-bottom: 1px solid var(--line); padding-bottom: 22px; margin-bottom: 22px; }
.verdict-main {
  display: flex; align-items: center; justify-content: space-between;
  gap: 22px; flex-wrap: wrap; margin-top: 6px;
}
.verdict-id { display: flex; align-items: center; gap: 16px; min-width: 0; flex: 1 1 260px; }
.verdict-emoji {
  font-size: clamp(52px, 12vw, 82px); line-height: 1;
  filter: drop-shadow(0 8px 26px rgba(255, 171, 74, .38));
  animation: emojiIn .8s var(--ease) both;
}
@keyframes emojiIn {
  0%   { opacity: 0; transform: scale(.3) rotate(-22deg); }
  60%  { transform: scale(1.16) rotate(6deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
.verdict-names { min-width: 0; }
h2#r-headline {
  font-size: clamp(27px, 6.2vw, 46px); line-height: 1.03;
  margin: 0 0 6px; text-wrap: balance;
}
h2#r-headline .sp { display: block; font-size: .5em; color: var(--paper-3); font-style: italic; font-weight: 400; }
.sci { font-style: italic; color: var(--sage); font-size: clamp(12px, 2.3vw, 14px); margin: 0; letter-spacing: .02em; }

.ring-wrap { position: relative; width: 118px; flex: 0 0 auto; text-align: center; }
.ring { width: 118px; height: 118px; transform: rotate(-90deg); display: block; }
.ring-track { fill: none; stroke: rgba(255, 233, 200, .09); stroke-width: 9; }
.ring-bar {
  fill: none; stroke: var(--accent); stroke-width: 9; stroke-linecap: round;
  stroke-dasharray: 0 999;
  filter: drop-shadow(0 0 8px rgba(255, 171, 74, .55));
  transition: stroke-dasharray 1.4s var(--ease);
}
.ring-num {
  position: absolute; top: 44px; left: 0; right: 0; margin: 0;
  font-family: var(--display); font-size: 30px; font-weight: 700; line-height: 1;
}
.ring-num i { font-style: normal; font-size: .55em; color: var(--paper-3); }
.ring-cap { font-size: 9px; letter-spacing: .18em; color: var(--paper-3); margin: 4px 0 0; }

.tagline {
  font-family: var(--display); font-style: italic;
  font-size: clamp(17px, 3.2vw, 22px); color: var(--accent-hi);
  margin: 18px 0 0; text-wrap: balance;
}
.tagline::before { content: "“"; }
.tagline::after  { content: "”"; }

.verdict { color: var(--paper-2); font-size: clamp(15px, 2.2vw, 17px); margin: 0 0 26px; text-wrap: pretty; }

.block { margin-bottom: 26px; }
.block-title {
  font-size: 10px; letter-spacing: .2em; color: var(--accent);
  margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
  text-transform: uppercase;
}

/* Traits */
.traits { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.traits li {
  background: var(--ink-200); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 12px 14px;
}
.traits b {
  display: block; font-family: var(--mono); font-size: 10px;
  letter-spacing: .13em; color: var(--accent); margin-bottom: 4px; text-transform: uppercase;
}
.traits span { font-size: 14px; color: var(--paper-2); }

/* Breakdown bars */
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.bars li { display: grid; grid-template-columns: 26px minmax(0, 1fr) 46px; align-items: center; gap: 11px; }
.bar-emoji { font-size: 19px; line-height: 1; text-align: center; }
.bar-body { min-width: 0; }
.bar-name { font-size: 13.5px; margin-bottom: 5px; color: var(--paper); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 9px; border-radius: 999px; background: rgba(255, 233, 200, .07); overflow: hidden; }
.bar-fill {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-lo), var(--accent));
  transition: width 1.1s var(--ease);
}
.bars li:first-child .bar-fill { background: linear-gradient(90deg, var(--accent), var(--accent-hi)); }
.bar-pct { font-family: var(--mono); font-size: 13px; text-align: right; color: var(--paper-2); }

/* Stats */
.stats { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.stats li { display: grid; grid-template-columns: 84px minmax(0, 1fr) 34px; align-items: center; gap: 11px; }
.stat-label { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; color: var(--paper-3); text-transform: uppercase; }
.stat-track { height: 7px; border-radius: 999px; background: rgba(255, 233, 200, .07); overflow: hidden; }
.stat-fill {
  height: 100%; width: 0; border-radius: 999px; background: var(--sage);
  transition: width 1s var(--ease);
}
.stat-val { font-family: var(--mono); font-size: 12px; text-align: right; color: var(--paper-2); }

/* Notes */
.notes { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.note {
  border: 1px solid var(--line); border-left: 2.5px solid var(--accent);
  border-radius: var(--r-sm); padding: 13px 15px; background: rgba(255, 233, 200, .022);
}
.note h4 { font-size: 9.5px; letter-spacing: .17em; color: var(--accent); margin: 0 0 6px; text-transform: uppercase; }
.note p { margin: 0; font-size: 14px; color: var(--paper-2); text-wrap: pretty; }

.stamp {
  position: absolute; right: 12px; bottom: 34px;
  transform: rotate(-90deg); transform-origin: right bottom;
  font-size: 9px; letter-spacing: .34em; color: rgba(255, 171, 74, .28);
  margin: 0; pointer-events: none; user-select: none;
}

.result-actions {
  display: flex; gap: 12px; flex-wrap: wrap;
  justify-content: center; margin-top: 22px;
}

/* Staggered reveal */
.reveal { animation: revealIn .62s var(--ease) both; animation-delay: calc(var(--d) * 95ms); }
@keyframes revealIn { from { opacity: 0; transform: translateY(14px); } }

/* ── Error ───────────────────────────────────────────────── */
.error-card { text-align: center; }
.err-emoji { font-size: 46px; margin: 0 0 10px; }
.err-title { font-size: clamp(23px, 4.6vw, 32px); margin: 0 0 10px; }
.err-body { color: var(--paper-2); margin: 0 auto 22px; max-width: 46ch; text-wrap: pretty; }
.err-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Countdown to the daily allocation reset (or the burst-limit cooldown). */
.err-countdown {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 auto 22px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, .16);
}
.err-countdown-label {
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--paper-3);
}
.err-countdown-time {
  font-family: var(--mono);
  font-size: 17px;
  font-variant-numeric: tabular-nums; /* so the seconds digit does not jitter the width */
  color: var(--accent);
}

/* Header link through to the full bestiary index. */
.header-link { text-decoration: none; transition: color .2s var(--ease); }
.header-link:hover { color: var(--accent); }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); margin-top: 50px; padding-block: 26px 40px; }
.footer-inner { text-align: center; }
.foot-1 { font-size: 10px; letter-spacing: .19em; color: var(--accent); margin: 0 0 8px; }
.foot-2 { font-size: 13.5px; color: var(--paper-2); margin: 0 0 8px; }
.foot-3 { font-size: 10px; letter-spacing: .12em; color: var(--paper-3); margin: 0; }

/* ── Page-level drop target ──────────────────────────────── */
/* Shown only when the capture stage is off-screen, so a photo dropped on the
   result or error stage still lands somewhere meaningful. */
.drop-veil {
  position: fixed; inset: 0; z-index: 70;
  display: grid; place-items: center;
  background: rgba(11, 9, 7, .74);
  pointer-events: none;
  animation: veilIn .16s var(--ease);
}
@keyframes veilIn { from { opacity: 0; } }
.drop-veil-inner {
  border: 2px dashed var(--accent);
  border-radius: var(--r);
  background: rgba(22, 19, 15, .92);
  color: var(--accent-hi);
  padding: 28px 36px; margin: 0;
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .95);
}

/* ── Toast ───────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(16px);
  background: var(--ink-300); color: var(--paper);
  border: 1px solid var(--accent-lo); border-radius: 999px;
  padding: 11px 22px; font-size: 14px; font-weight: 600;
  box-shadow: 0 16px 44px -14px rgba(0, 0, 0, .95);
  opacity: 0; pointer-events: none; z-index: 60;
  transition: opacity .26s var(--ease), transform .26s var(--ease);
  max-width: calc(100vw - 40px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 620px) {
  .header-meta { display: none; }
  .preview-grid { grid-template-columns: 1fr; }
  .thumb { max-width: 180px; margin-inline: auto; }
  .verdict-main { flex-direction: column; align-items: flex-start; gap: 18px; }
  /* flex-basis would apply to height in a column — reset it or a dead gap appears */
  .verdict-id { flex: 0 0 auto; width: 100%; }
  .ring-wrap { align-self: center; }
  .stamp { display: none; }
  .bars li { grid-template-columns: 24px minmax(0, 1fr) 42px; }
  .stats li { grid-template-columns: 72px minmax(0, 1fr) 32px; }

  /* Thumb-reachable primary actions */
  .preview-actions, .result-actions, .err-actions { flex-direction: column-reverse; }
  .preview-actions .btn, .result-actions .btn, .err-actions .btn { width: 100%; }
  .btn-lg { padding: 17px 24px; }
}

/* ── Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .scan-line { top: 50%; }
  .dropzone.is-over { transform: none; }
}
