/* The public check page (check/index.html). Dark by default, light by prefers-color-scheme, like site.css (same base tokens).
   The four verdict colours are this page's: green Original, amber Original re-saved, red Changed, grey Not registered.
   No fonts, images or scripts are loaded from outside; every rule here is allowed by the page's CSP (style-src 'self'). */
:root {
  --bg: #0B0B0D; --surface: #17171A; --surface2: #202024; --ink: #F5F5F7; --ink2: rgba(255,255,255,.68); --ink3: rgba(255,255,255,.52);
  --accent: #FFB020; --on-accent: #1A1200; --accent-ink: #FFC75A; --line: rgba(255,255,255,.12); --scrim: rgba(0,0,0,.5);
  --ok: #4ADE80; --warn: #FBBF24; --bad: #F87171; --muted: #9CA3AF;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #F4F4F6; --surface: #FFFFFF; --surface2: #F0F0F3; --ink: #0B0B0D; --ink2: rgba(0,0,0,.64); --ink3: rgba(0,0,0,.6);
    --accent-ink: #8C5A00; --line: rgba(0,0,0,.12); --scrim: rgba(255,255,255,.55);
    --ok: #1B8A4C; --warn: #B45309; --bad: #B3261E; --muted: #6B7280;
    color-scheme: light;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
main { max-width: 640px; margin: 0 auto; padding: max(24px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom)); }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -.01em; }
.lead { font-size: 16px; color: var(--ink2); margin: 0; }
a { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* Icons: one hidden sprite, drawn with <use>. Lucide shapes, 24 px, 1.75 stroke, round caps, the text colour. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { flex: none; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* The three steps: stacked on a phone, one row with a thin connector from 560 px. */
.steps { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 20px; }
.steps li { position: relative; display: grid; grid-template-columns: 40px 1fr; column-gap: 14px; align-items: start; }
.step__n { grid-row: 1 / span 2; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface2); border: 1px solid var(--line); font-size: 17px; font-weight: 600; line-height: 1; }
.step__head { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.step__head .icon { color: var(--accent-ink); }
.step__title { margin: 0; font-size: 17px; line-height: 1.3; font-weight: 600; }
.steps p { margin: 0; font-size: 15px; line-height: 1.45; font-weight: 400; color: var(--ink2); }
@media (min-width: 560px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .steps li { display: block; }
  .step__head { display: block; margin: 14px 0 6px; min-height: 0; }
  .step__head .icon { margin-bottom: 8px; }
  .steps li:not(:last-child)::after { content: ""; position: absolute; top: 20px; left: 52px; right: -12px; height: 1px; background: var(--line); }
}

/* The picker card; the result card sits where the hints were once a file is chosen. */
.picker { position: relative; margin: 24px 0 0; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); display: flex; flex-direction: column; align-items: center; text-align: center; }
.picker.over { border-color: var(--accent); background: var(--surface2); }
.picker__hint { display: none; margin: 12px 0 0; font-size: 15px; color: var(--ink2); }
@media (hover: hover) and (pointer: fine) { .picker__hint { display: block; } }
.picker__privacy { margin: 8px 0 0; font-size: 13px; color: var(--ink3); }
.picker.has-file .picker__hint, .picker.has-file .picker__privacy { display: none; }
.picker noscript p { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: var(--surface2); font-size: 15px; text-align: left; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.sr-only:focus-visible + .button { outline: 2px solid var(--accent); outline-offset: 3px; }
.button { appearance: none; border: 1px solid transparent; border-radius: 14px; min-height: 52px; padding: 0 22px; font-family: inherit; font-size: 17px; font-weight: 600; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.primary { background: var(--accent); color: var(--on-accent); }
.secondary { background: var(--surface2); border-color: var(--line); color: var(--ink); }
.button:disabled { opacity: .4; cursor: default; }
.button:active:not(:disabled) { transform: scale(.97); }

.preview { display: none; width: 100%; margin: 16px 0 0; }
.preview.shown { display: block; }
.frame { position: relative; display: inline-block; max-width: 100%; border-radius: 10px; overflow: hidden; background: #000; vertical-align: top; }
.frame img { display: block; max-width: 100%; max-height: 320px; height: auto; }
.regions { position: absolute; inset: 0; display: none; grid-template: repeat(4, 1fr) / repeat(4, 1fr); }
.regions.shown { display: grid; }
.regions span { background: var(--scrim); }
.regions span.changed { background: none; outline: 3px solid var(--warn); outline-offset: -3px; }
.file-name { font-size: 13px; color: var(--ink3); margin: 6px 0 0; overflow-wrap: anywhere; }

/* The result card: always in the page (an empty live region has no box), dressed by its verdict--<kind> class and its tone. */
.verdict { --vc: var(--muted); width: 100%; text-align: left; }
.verdict.tone-good { --vc: var(--ok); }
.verdict.tone-warn { --vc: var(--warn); }
.verdict.tone-danger { --vc: var(--bad); }
.verdict.tone-neutral { --vc: var(--muted); }
.verdict[class*="verdict--"] { margin: 16px 0 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .verdict[class*="verdict--"] { border-color: color-mix(in srgb, var(--vc) 55%, var(--line)); background: color-mix(in srgb, var(--vc) 9%, var(--surface)); }
}
.verdict__head { display: flex; align-items: center; gap: 12px; }
.verdict__head .icon { width: 28px; height: 28px; color: var(--vc); }
.verdict h2 { margin: 0; font-size: 22px; line-height: 1.25; font-weight: 700; color: var(--vc); }
.verdict p { margin: 12px 0 0; font-size: 15px; line-height: 1.45; color: var(--ink2); }
.verdict p.note { margin-top: 8px; font-size: 13px; line-height: 1.4; color: var(--ink3); }
.verdict dl { margin: 12px 0 0; font-size: 14px; }
.verdict dt { color: var(--ink3); font-size: 13px; }
.verdict dd { margin: 0 0 8px; overflow-wrap: anywhere; }
.verdict dd:last-child { margin-bottom: 0; }
@media (min-width: 480px) {
  .verdict dl { display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr); gap: 6px 14px; }
  .verdict dt { font-size: 14px; }
  .verdict dd { margin: 0; }
}
.verdict .actions { margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.verdict .actions .button { flex: 1 1 auto; padding: 12px 18px; font-size: 15px; line-height: 1.25; text-align: center; overflow-wrap: anywhere; }
.spinner { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } .button:active:not(:disabled) { transform: none; } }

/* What this shows / cannot show. */
.proves { margin: 24px 0 0; display: grid; gap: 12px; }
.prove { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.prove h3 { margin: 0 0 8px; display: flex; align-items: center; gap: 8px; font-size: 17px; line-height: 1.3; font-weight: 600; }
.prove--yes .icon { color: var(--ok); }
.prove--no .icon { color: var(--muted); }
.prove ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 15px; line-height: 1.45; color: var(--ink2); }
@media (min-width: 560px) { .proves { grid-template-columns: 1fr 1fr; gap: 16px; } }

/* The code lookup: collapsed until it is wanted. */
.lookup { margin: 24px 0 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.lookup summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 14px; font-size: 15px; font-weight: 600; color: var(--accent-ink); cursor: pointer; list-style: none; }
.lookup summary::-webkit-details-marker { display: none; }
.lookup summary::after { content: ""; flex: none; width: 8px; height: 8px; margin-right: 4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.lookup[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.lookup__body { padding: 0 16px 16px; }
.lookup__body > p { margin: 0 0 12px; font-size: 15px; line-height: 1.45; color: var(--ink2); }
.field label { display: block; font-size: 13px; color: var(--ink3); margin: 0 0 6px; }
.row { display: flex; gap: 10px; }
.row input { flex: 1; min-width: 0; min-height: 52px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface2); color: var(--ink); padding: 0 14px; font: 16px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-transform: uppercase; }
.row input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.hint { font-size: 13px; color: var(--ink3); margin: 6px 0 0; }

.foot { margin: 32px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink3); }
.foot a { color: var(--ink2); text-underline-offset: 2px; }
