/* ==========================================================================
   TamperCheck — "forensic inspection bench" theme
   ========================================================================== */

@font-face { font-family: "Plex Sans"; src: url(fonts/plex-sans-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url(fonts/plex-sans-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url(fonts/plex-sans-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url(fonts/plex-sans-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url(fonts/plex-mono-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url(fonts/plex-mono-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url(fonts/plex-mono-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }

/* ---- tokens ------------------------------------------------------------- */
:root {
  color-scheme: light;
  --sans: "Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --bg: #f3f2ee;
  --grid: rgba(17, 19, 23, .055);
  --surface: #ffffff;
  --surface-2: #f8f7f4;
  --ink: #111317;
  --ink-2: #2d3138;
  --muted: #5f6672;
  --faint: #9a9fa8;
  --line: #e4e2dc;
  --line-strong: #cfccc4;
  --link: #1d4ed0;

  --accent: #ffcc00;
  --accent-ink: #111317;

  --ok: #16794a;   --ok-bg: #e4f4ea;   --ok-line: #a9dcbf;
  --bad: #c42f28;  --bad-bg: #fdeae8;  --bad-line: #f1b6b0;
  --mid: #985a00;  --mid-bg: #fff2d6;  --mid-line: #ecc98a;
  --neu: #5d6470;  --neu-bg: #ecebe6;  --neu-line: #d6d4cd;
  --info-bg: #eef2fb; --info-line: #c9d5f1;

  --hdr-bg: #111317; --hdr-ink: #f1f2f4; --hdr-muted: #a3a9b3; --hdr-line: #23272e;

  --lcd: #0e1a13; --lcd-ink: #7dffaa;

  --shadow: 0 1px 2px rgba(17,19,23,.05), 0 6px 18px -6px rgba(17,19,23,.10);
  --shadow-lg: 0 2px 4px rgba(17,19,23,.05), 0 22px 48px -12px rgba(17,19,23,.22);
  --r: 14px; --r-sm: 9px;
}

/* dark tokens: system preference unless user forced light, or user forced dark */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0d10; --grid: rgba(255,255,255,.035);
    --surface: #13161b; --surface-2: #181c22;
    --ink: #eef0f3; --ink-2: #cfd4db; --muted: #949ca8; --faint: #636b77;
    --line: #242930; --line-strong: #333a44; --link: #8fb0ff;
    --accent: #ffd21f;
    --ok: #4fd18b;  --ok-bg: #0e2619;  --ok-line: #1f5a3a;
    --bad: #ff6f66; --bad-bg: #2c1210; --bad-line: #6b2621;
    --mid: #f3b950; --mid-bg: #2a200e; --mid-line: #6a4b17;
    --neu: #9aa2ad; --neu-bg: #1d2128; --neu-line: #2e343d;
    --info-bg: #121a2c; --info-line: #263453;
    --hdr-bg: #08090b; --hdr-line: #1d2127;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -8px rgba(0,0,0,.5);
    --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 24px 56px -12px rgba(0,0,0,.7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d10; --grid: rgba(255,255,255,.035);
  --surface: #13161b; --surface-2: #181c22;
  --ink: #eef0f3; --ink-2: #cfd4db; --muted: #949ca8; --faint: #636b77;
  --line: #242930; --line-strong: #333a44; --link: #8fb0ff;
  --accent: #ffd21f;
  --ok: #4fd18b;  --ok-bg: #0e2619;  --ok-line: #1f5a3a;
  --bad: #ff6f66; --bad-bg: #2c1210; --bad-line: #6b2621;
  --mid: #f3b950; --mid-bg: #2a200e; --mid-line: #6a4b17;
  --neu: #9aa2ad; --neu-bg: #1d2128; --neu-line: #2e343d;
  --info-bg: #121a2c; --info-line: #263453;
  --hdr-bg: #08090b; --hdr-line: #1d2127;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -8px rgba(0,0,0,.5);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 24px 56px -12px rgba(0,0,0,.7);
}

/* ---- base --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -.015em; margin: 0; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--mono); font-size: .92em; }
code { background: var(--neu-bg); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; }
strong { font-weight: 600; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.i { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.page { padding-top: 32px; padding-bottom: 72px; }
.page.narrow { max-width: 920px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13.5px; line-height: 1.5; }
.t-bad { color: var(--bad); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; font-weight: 600; }
.skip:focus { top: 12px; }

.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 500 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.lede { font-size: 18px; line-height: 1.6; color: var(--muted); max-width: 62ch; }

/* ---- buttons ------------------------------------------------------------ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 500 15px/1 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s, box-shadow .15s; }
.btn:hover { border-color: var(--ink); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 14px; }
.btn-lg { height: 50px; padding: 0 22px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; box-shadow: inset 0 -2px 0 rgba(0,0,0,.14); }
.btn-accent:hover { border-color: var(--accent); filter: brightness(1.04); box-shadow: inset 0 -2px 0 rgba(0,0,0,.14), 0 6px 18px -6px rgba(255,190,0,.6); }
.btn-ink { background: var(--ink); border-color: var(--ink); color: var(--bg); font-weight: 600; }
.btn-ink:hover { opacity: .9; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { border-color: var(--line-strong); background: var(--surface); }
.btn-danger { color: var(--bad); border-color: var(--bad-line); background: var(--surface); }
.btn-danger:hover { border-color: var(--bad); background: var(--bad-bg); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.link { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }
.link:hover { color: var(--ink); }
form.inline { display: inline; }

/* ---- header ------------------------------------------------------------- */
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--hdr-bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--hdr-line); color: var(--hdr-ink); }
.top-in { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -.02em; color: var(--hdr-ink); text-decoration: none; }
.brand:hover { text-decoration: none; }
.logo { width: 30px; height: 30px; flex: none; }
.logo-bg { fill: #1c2026; stroke: #2c323b; }
.logo-ln, .logo-ck { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav { display: flex; gap: 2px; }
.nav a { position: relative; color: var(--hdr-muted); text-decoration: none; font-size: 14.5px; font-weight: 500; padding: 8px 12px; border-radius: 7px; transition: color .15s, background .15s; }
.nav a:hover { color: var(--hdr-ink); background: rgba(255,255,255,.06); }
.nav a[aria-current] { color: var(--hdr-ink); }
.nav a[aria-current]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -13px; height: 2px; background: var(--accent); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 1px solid rgba(255,255,255,.12); background: transparent; color: var(--hdr-muted); cursor: pointer; }
.icon-btn:hover { color: var(--hdr-ink); border-color: rgba(255,255,255,.25); }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}

/* ---- hero --------------------------------------------------------------- */
.hero { position: relative; border-bottom: 1px solid var(--line); overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px; background-position: -1px -1px;
  mask-image: radial-gradient(ellipse 80% 90% at 70% 40%, #000 30%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse 80% 90% at 70% 40%, #000 30%, transparent 85%); }
.hero-in { display: grid; grid-template-columns: 1.08fr .92fr; gap: 56px; align-items: center; padding-top: 72px; padding-bottom: 48px; }
.hero h1 { font-size: clamp(36px, 5vw, 60px); line-height: 1.02; letter-spacing: -.035em; font-weight: 700; margin-bottom: 22px; }
.hero h1 em { font-style: normal; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: .16em; text-underline-offset: .1em; text-decoration-skip-ink: none; }
.hero .lede { margin-bottom: 30px; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); } 70%, 100% { box-shadow: 0 0 0 9px transparent; } }

.hero-fig { position: relative; }
.hero-art { width: 100%; height: auto; overflow: visible; }
.hero-art text { font-family: var(--mono); }
.d-dim { fill: none; stroke: var(--muted); stroke-width: 1.3; }
.dash { stroke-dasharray: 3 4; }
.d-pill { fill: var(--bg); stroke: var(--line-strong); }
.d-txt { font-size: 12.5px; font-weight: 500; fill: var(--ink-2); }
.d-dev rect { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.d-dev .d-body { fill: var(--surface); filter: drop-shadow(0 10px 18px rgba(0,0,0,.12)); }
.d-dev .d-screen { fill: var(--lcd); stroke: var(--ink); }
.d-screen-txt { font-size: 14px; font-weight: 600; letter-spacing: .12em; fill: var(--lcd-ink); }
.d-flag { fill: color-mix(in srgb, var(--bad) 10%, transparent); stroke: var(--bad); stroke-width: 2; stroke-dasharray: 5 4; animation: spin 24s linear infinite; transform-origin: 118px 160px; }
@keyframes spin { to { transform: rotate(360deg); } }
.d-flag-ln { fill: none; stroke: var(--bad); stroke-width: 1.5; }
.d-flag-txt { font-size: 12px; font-weight: 600; letter-spacing: .08em; fill: var(--bad); }
.d-plate { fill: var(--line-strong); }
.d-scale { fill: var(--surface-2); stroke: var(--line-strong); stroke-width: 1.5; }
.d-lcd { fill: var(--lcd); }
.d-lcd-txt { font-size: 27px; font-weight: 500; fill: var(--lcd-ink); letter-spacing: -.02em; }
.d-delta { fill: var(--bad-bg); stroke: var(--bad-line); }
.d-delta-txt { font-size: 13.5px; font-weight: 600; fill: var(--bad); }
.d-cap { font-size: 10.5px; letter-spacing: .14em; fill: var(--faint); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 0 40px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.stat { padding: 18px 22px; border-left: 1px solid var(--line); display: flex; flex-direction: column-reverse; gap: 2px; }
.stat:first-child { border-left: 0; }
.stat dt { font-size: 13px; color: var(--muted); }
.stat dd { margin: 0; font: 600 30px/1.1 var(--mono); letter-spacing: -.03em; }
.stat-bad dd { color: var(--bad); }

/* ---- browse ------------------------------------------------------------- */
.section { padding-top: 56px; padding-bottom: 64px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 18px; }
.section-head h2 { font-size: 30px; letter-spacing: -.025em; }
.section-head .eyebrow { margin-bottom: 10px; }
.search { display: flex; gap: 8px; flex-wrap: wrap; }
.search-in { position: relative; display: block; }
.search-in .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search-in input { padding-left: 38px; width: 280px; }
.search select { width: auto; min-width: 150px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font-size: 14px; font-weight: 500; text-decoration: none; transition: all .15s; }
.chip .i { width: 15px; height: 15px; }
.chip:hover { border-color: var(--ink); text-decoration: none; }
.chip[aria-current] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip-genuine .i { color: var(--ok); } .chip-suspicious .i { color: var(--bad); } .chip-disputed .i { color: var(--mid); } .chip-review .i { color: var(--neu); }
.chip[aria-current] .i { color: inherit; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: transform .2s cubic-bezier(.2,.7,.3,1), box-shadow .2s, border-color .2s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); text-decoration: none; }
.card-media { position: relative; aspect-ratio: 4 / 3; background: var(--neu-bg); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s cubic-bezier(.2,.7,.3,1); }
.card:hover .card-media img { transform: scale(1.04); }
.no-photo { height: 100%; display: grid; place-items: center; color: var(--faint);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 16px 16px; }
.no-photo .i { width: 44px; height: 44px; stroke-width: 1.3; }
.card-media .stamp { position: absolute; top: 12px; left: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.case-no { position: absolute; top: 12px; right: 12px; font: 500 11.5px/1 var(--mono); color: #fff; background: rgba(12,14,17,.72); backdrop-filter: blur(4px); padding: 5px 7px; border-radius: 6px; letter-spacing: .04em; }
.card-body { padding: 16px 18px 14px; display: flex; flex-direction: column; flex: 1; }
.card-brand { font: 500 11.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 6px; }
.card h3 { font-size: 19px; font-weight: 600; letter-spacing: -.02em; margin-bottom: 12px; }
.readouts { display: flex; flex-wrap: wrap; gap: 6px 14px; font: 500 13px/1.3 var(--mono); color: var(--ink-2); margin-bottom: 14px; }
.readouts span { display: inline-flex; align-items: center; gap: 6px; }
.readouts .i { color: var(--faint); width: 15px; height: 15px; }
.card-foot { display: flex; align-items: center; gap: 14px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.card-foot span { display: inline-flex; align-items: center; gap: 5px; }
.card-foot .i { width: 15px; height: 15px; }
.card-foot .src { margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; font-size: 12px; }
.card .tally { margin-bottom: 14px; }

/* status stamps ---------------------------------------------------------- */
.st-genuine { --st: var(--ok); --st-bg: var(--ok-bg); --st-line: var(--ok-line); }
.st-suspicious { --st: var(--bad); --st-bg: var(--bad-bg); --st-line: var(--bad-line); }
.st-disputed { --st: var(--mid); --st-bg: var(--mid-bg); --st-line: var(--mid-line); }
.st-review { --st: var(--neu); --st-bg: var(--neu-bg); --st-line: var(--neu-line); }
.stamp { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px 5px 7px; border-radius: 7px; font: 600 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--st); background: var(--st-bg); border: 1px solid var(--st-line); }
.stamp .i { width: 14px; height: 14px; stroke-width: 2.4; }

/* tally ------------------------------------------------------------------ */
.bar { display: flex; height: 6px; border-radius: 99px; overflow: hidden; background: var(--neu-bg); gap: 2px; }
.bar i { display: block; border-radius: 99px; }
.bar .g { background: var(--ok); } .bar .s { background: var(--bad); } .bar .u { background: var(--faint); }
.tally-n { display: flex; gap: 12px; margin-top: 7px; font: 500 12px/1 var(--mono); color: var(--muted); }
.tally-n span { display: inline-flex; align-items: center; gap: 5px; }
.tally-n span[class]::before { content: ""; width: 7px; height: 7px; border-radius: 2px; }
.k-g::before { background: var(--ok); } .k-u::before { background: var(--faint); } .k-s::before { background: var(--bad); }
.tally-big .bar { height: 10px; }
.tally-big { margin-bottom: 14px; }

.empty { text-align: center; padding: 56px 20px; color: var(--muted); border: 1.5px dashed var(--line-strong); border-radius: var(--r); background: var(--surface); }
.empty > .i { width: 34px; height: 34px; color: var(--faint); margin-bottom: 10px; }
.empty h3 { color: var(--ink); font-size: 18px; margin-bottom: 6px; }
.empty .btn { margin-top: 6px; }

/* how it works ----------------------------------------------------------- */
.how { background: var(--surface); border-top: 1px solid var(--line); padding: 56px 0 64px; }
.how-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.how-grid li { position: relative; padding: 24px 24px 8px; border-left: 1px solid var(--line); }
.how-grid li:first-child { border-left: 0; padding-left: 0; }
.how-n { display: block; font: 500 12px/1 var(--mono); color: var(--faint); letter-spacing: .1em; margin-bottom: 18px; }
.how-grid .i { width: 26px; height: 26px; padding: 9px; box-sizing: content-box; border-radius: 11px; background: var(--accent); color: var(--accent-ink); margin-bottom: 16px; }
.how-grid h3 { font-size: 18px; margin-bottom: 6px; }
.how-grid p { color: var(--muted); font-size: 15px; margin: 0; }

/* ---- callouts ----------------------------------------------------------- */
.callout { position: relative; display: flex; gap: 14px; padding: 16px 18px 16px 26px; border-radius: var(--r-sm); border: 1px solid; margin: 0 0 24px; font-size: 15px; overflow: hidden; }
.callout::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; }
.callout > .i { width: 22px; height: 22px; margin-top: 1px; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout-warn { background: var(--mid-bg); border-color: var(--mid-line); }
.callout-warn::before { background: var(--accent); width: 5px; }
.callout-warn > .i { color: var(--mid); }
.callout-bad { background: var(--bad-bg); border-color: var(--bad-line); }
.callout-bad::before { background: repeating-linear-gradient(-45deg, var(--bad) 0 6px, transparent 6px 12px); }
.callout-bad > .i { color: var(--bad); }
.callout-info { background: var(--info-bg); border-color: var(--info-line); }
.callout-info::before { background: var(--link); opacity: .6; width: 4px; }
.callout-info > .i { color: var(--link); }

/* ---- forms -------------------------------------------------------------- */
input, select, textarea { font: 400 15px/1.4 var(--sans); color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 0 12px; height: 42px; width: 100%; transition: border-color .15s, box-shadow .15s; }
textarea { height: auto; padding: 11px 12px; resize: vertical; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 45%, transparent); }
select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a919c' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 16px; }
input[type=number] { -moz-appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--ink); flex: none; margin: 2px 0 0; }

.page-head { margin-bottom: 28px; }
.page-head h1 { font-size: clamp(30px, 4vw, 44px); letter-spacing: -.03em; font-weight: 700; margin-bottom: 12px; }

.steps { counter-reset: step; }
.step { display: grid; grid-template-columns: 52px 1fr; gap: 20px; padding: 28px 0; border-top: 1px solid var(--line); }
.step-no { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font: 600 14px/1 var(--mono); background: var(--ink); color: var(--bg); }
.step h2 { font-size: 21px; margin: 8px 0 6px; }
.step .sub { color: var(--muted); font-size: 15px; margin-bottom: 18px; }
.fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 18px; }
.fields.four { grid-template-columns: repeat(4, 1fr); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lbl { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.lbl i { font-style: normal; color: var(--bad); }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.unit { position: relative; display: block; }
.unit input { font-family: var(--mono); font-size: 16px; font-weight: 500; padding-right: 48px; }
.unit span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font: 500 13px/1 var(--mono); color: var(--faint); pointer-events: none; }
.ref-hint { margin-top: 16px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--info-bg); border: 1px solid var(--info-line); font-size: 14px; }
.ref-hint.flag { background: var(--bad-bg); border-color: var(--bad-line); }
.ref-hint b { font-family: var(--mono); font-weight: 600; }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.slot { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 16px; min-height: 160px; border: 1.5px dashed var(--line-strong); border-radius: var(--r); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.slot:hover, .slot.drag { border-color: var(--ink); background: var(--surface-2); }
.slot.drag { transform: scale(1.02); }
.slot:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.slot input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.slot-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--neu-bg); color: var(--ink-2); margin-bottom: 8px; }
.slot strong { font-size: 14.5px; line-height: 1.3; }
.slot small { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.slot-cta { display: inline-flex; align-items: center; gap: 4px; margin-top: auto; padding-top: 10px; font-size: 13px; font-weight: 600; color: var(--link); }
.slot-cta .i { width: 14px; height: 14px; stroke-width: 2.4; }
.previews { display: flex; flex-wrap: wrap; gap: 5px; }
.previews:empty { display: none; }
.previews img { width: 42px; height: 42px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.slot.has-files { border-style: solid; border-color: var(--ok); }
.slot.has-files .slot-ic { background: var(--ok-bg); color: var(--ok); }
.slot.has-files .slot-cta { display: none; }
.slot .badge-n { position: absolute; top: 12px; right: 12px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 99px; background: var(--ok); color: #fff; font: 600 12px/24px var(--mono); text-align: center; }
.photo-count { margin-top: 12px; }
.photo-count.over { color: var(--bad); font-weight: 600; }

.submit-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-top: 8px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; max-width: 520px; cursor: pointer; }

/* ---- device page -------------------------------------------------------- */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; text-decoration: none; margin-bottom: 18px; }
.back:hover { color: var(--ink); text-decoration: none; }
.case-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-bottom: 24px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.case-meta { display: flex; flex-wrap: wrap; gap: 0; font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.case-meta span + span::before { content: "/"; margin: 0 10px; color: var(--faint); }
.case-meta time { text-transform: none; }
.case-head h1 { font-size: clamp(30px, 4vw, 46px); letter-spacing: -.035em; font-weight: 700; }
.brand-name { color: var(--muted); font-weight: 500; }
.verdict { display: flex; align-items: center; gap: 14px; padding: 14px 18px 14px 14px; border-radius: var(--r); background: var(--st-bg); border: 1px solid var(--st-line); color: var(--st); }
.verdict > .i { width: 40px; height: 40px; padding: 8px; box-sizing: border-box; border-radius: 10px; background: var(--st); color: var(--surface); stroke-width: 2.4; }
.verdict strong { display: block; font-size: 18px; letter-spacing: -.01em; }
.verdict small { display: block; color: var(--muted); font-size: 12.5px; }

.dev-grid { display: grid; grid-template-columns: minmax(0, 1fr) 370px; grid-template-rows: auto 1fr; grid-template-areas: "media side" "disc side"; gap: 0 36px; align-items: start; }
.dev-main { grid-area: media; } .dev-side { grid-area: side; } .dev-grid > .discussion { grid-area: disc; }
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tile { position: relative; display: block; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; background: var(--neu-bg); border: 1px solid var(--line); }
.tile:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 10; border-radius: var(--r); }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s cubic-bezier(.2,.7,.3,1); }
.tile:hover img { transform: scale(1.04); }
.tile-tag { position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: #fff; background: rgba(12,14,17,.74); backdrop-filter: blur(4px); padding: 5px 7px; border-radius: 5px; }
.tile:first-child .tile-tag { left: 14px; bottom: 14px; font-size: 11.5px; padding: 6px 9px; }

.notes { margin-top: 24px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.notes p { margin: 0; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.panel-title { display: flex; align-items: center; gap: 8px; font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 16px; }
.panel-title .i { width: 16px; height: 16px; }
.panel > p:last-child { margin-bottom: 0; }
.panel-quiet { background: transparent; box-shadow: none; border-style: dashed; display: grid; gap: 12px; }

.vote-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.vote { --vc: var(--neu); --vc-bg: var(--neu-bg); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 4px 10px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); font: 500 13px/1.2 var(--sans); cursor: pointer; transition: all .15s; }
.vote .i { width: 22px; height: 22px; color: var(--vc); stroke-width: 2.2; }
.vote b { font: 600 17px/1.2 var(--mono); }
.vote:hover:not(:disabled) { border-color: var(--vc); background: var(--vc-bg); transform: translateY(-1px); }
.vote-genuine { --vc: var(--ok); --vc-bg: var(--ok-bg); }
.vote-suspicious { --vc: var(--bad); --vc-bg: var(--bad-bg); }
.vote.chosen { background: var(--vc); border-color: var(--vc); color: var(--surface); }
.vote.chosen .i { color: var(--surface); }
.vote:disabled { opacity: .5; cursor: not-allowed; }

.gauge { padding: 34px 0 0; margin-bottom: 18px; }
.g-track { position: relative; height: 10px; border-radius: 99px; background: var(--neu-bg);
  background-image: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), var(--line-strong) calc(10% - 1px) 10%); }
.g-range { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--ok) 40%, transparent); border: 1px solid var(--ok); border-radius: 99px; min-width: 6px; }
.g-median { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: var(--ok); }
.g-median span { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); font: 500 10px/1 var(--mono); color: var(--ok); text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
.g-marker { position: absolute; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--ink); border: 3px solid var(--surface); box-shadow: 0 0 0 1.5px var(--ink); z-index: 1; }
.g-marker span { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); font: 600 12px/1 var(--mono); background: var(--ink); color: var(--surface); padding: 5px 7px; border-radius: 5px; white-space: nowrap; }
.g-marker span::after { content: ""; position: absolute; left: 50%; bottom: -4px; margin-left: -4px; border: 4px solid transparent; border-bottom: 0; border-top-color: var(--ink); }
.gauge.flag .g-marker { background: var(--bad); box-shadow: 0 0 0 1.5px var(--bad); }
.gauge.flag .g-marker span { background: var(--bad); }
.gauge.flag .g-marker span::after { border-top-color: var(--bad); }
.g-axis { display: flex; justify-content: space-between; margin-top: 26px; font: 500 10.5px/1 var(--mono); color: var(--faint); }

.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.ro { padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); }
.ro small { display: block; font: 500 10.5px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 5px; }
.ro b { font: 600 17px/1.2 var(--mono); letter-spacing: -.02em; }
.ro.bad { background: var(--bad-bg); border-color: var(--bad-line); }
.ro.bad b { color: var(--bad); }

.spec { display: grid; grid-template-columns: auto 1fr; margin: 0; font-size: 14px; }
.spec dt, .spec dd { padding: 9px 0; border-bottom: 1px dashed var(--line); margin: 0; }
.spec dt { color: var(--muted); padding-right: 16px; }
.spec dd { text-align: right; font-weight: 500; }
.spec dd.mono { font-size: 13.5px; }
.spec dt:last-of-type, .spec dd:last-of-type { border-bottom: 0; }

.discussion { margin-top: 40px; }
.discussion h2 { display: flex; align-items: center; gap: 10px; font-size: 22px; margin-bottom: 6px; }
.count { font: 600 13px/1 var(--mono); padding: 5px 8px; border-radius: 99px; background: var(--neu-bg); color: var(--muted); }
.comments { list-style: none; padding: 0; margin: 16px 0 20px; }
.comment { display: grid; grid-template-columns: 38px 1fr; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.comment:first-child { border-top: 1px solid var(--line); }
.comment p { margin: 4px 0 0; overflow-wrap: anywhere; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font: 600 13px/1 var(--mono); background: hsl(var(--h) 55% 88%); color: hsl(var(--h) 55% 28%); }
:root[data-theme="dark"] .avatar { background: hsl(var(--h) 35% 20%); color: hsl(var(--h) 70% 76%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar { background: hsl(var(--h) 35% 20%); color: hsl(var(--h) 70% 76%); } }
.c-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 14.5px; }
.c-head time { color: var(--faint); font: 400 12.5px/1 var(--mono); }
.c-actions { margin-left: auto; display: inline-flex; gap: 12px; }
.tag { font: 600 10px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; padding: 4px 6px; border-radius: 4px; background: var(--accent); color: var(--accent-ink); align-self: center; }
.comment-form { margin-top: 16px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.comment-form textarea { border: 0; padding: 4px 2px; box-shadow: none !important; background: transparent; min-height: 72px; }
.cf-row { display: flex; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.cf-row input { max-width: 260px; }
.cf-row .btn { margin-left: auto; }

/* ---- reference ---------------------------------------------------------- */
.table-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; box-shadow: var(--shadow); margin-bottom: 16px; }
table.ref { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.ref th, .ref td { padding: 14px 18px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
.ref th { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); background: var(--surface-2); }
.ref tbody tr:last-child td { border-bottom: 0; }
.ref tbody tr:hover td { background: var(--surface-2); }
.ref .num { text-align: right; font-family: var(--mono); font-size: 13.5px; }
.ref .strong { font-weight: 600; font-size: 14.5px; }
.ref .preview { white-space: normal; max-width: 420px; color: var(--muted); }
.ref .empty { border: 0; }
.model-cell { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); font-weight: 600; }
.model-cell small { font: 500 10.5px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.model-cell:hover { color: var(--link); }
.pill { display: inline-block; min-width: 26px; padding: 3px 8px; border-radius: 99px; font: 600 12px/1.2 var(--mono); text-align: center; background: var(--neu-bg); color: var(--muted); }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-bad { background: var(--bad-bg); color: var(--bad); }

/* ---- guide -------------------------------------------------------------- */
.guide-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; align-items: start; }
.toc { position: sticky; top: 96px; }
.toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; border-left: 1px solid var(--line); }
.toc li { counter-increment: toc; }
.toc a { display: flex; gap: 10px; padding: 7px 0 7px 16px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; font-size: 14px; }
.toc a::before { content: counter(toc, decimal-leading-zero); font: 500 11.5px/1.7 var(--mono); color: var(--faint); }
.toc a:hover, .toc a.active { color: var(--ink); border-left-color: var(--accent); }
.guide { max-width: 720px; }
.g-sec { padding: 8px 0 28px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.g-sec:last-child { border-bottom: 0; }
.g-sec h2 { display: flex; align-items: center; gap: 12px; font-size: 24px; margin: 0 0 16px; }
.g-sec h2 .i { width: 22px; height: 22px; color: var(--muted); }
.g-n { font: 600 13px/1 var(--mono); padding: 6px 8px; border-radius: 7px; background: var(--ink); color: var(--bg); }
.g-sec p { color: var(--ink-2); }
ul.checks, ul.flags { list-style: none; padding: 0; margin: 0 0 1em; }
ul.checks li, ul.flags li { position: relative; padding-left: 32px; margin-bottom: 10px; }
ul.checks li::before { content: ""; position: absolute; left: 0; top: .2em; width: 18px; height: 18px; border: 1.5px solid var(--line-strong); border-radius: 5px; background: var(--surface); }
ul.flags li::before { content: "!"; position: absolute; left: 0; top: .15em; width: 20px; height: 20px; border-radius: 50%; background: var(--bad); color: #fff; font: 700 12px/20px var(--mono); text-align: center; }
.os-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.os-grid div { padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); }
.os-grid small { display: block; font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 8px; }
.os-grid code { background: none; border: 0; padding: 0; font-size: 13px; }

/* ---- misc pages --------------------------------------------------------- */
.msg-card { max-width: 520px; margin: 40px auto; text-align: center; padding: 44px 36px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.msg-ic { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--accent); color: var(--accent-ink); margin-bottom: 18px; }
.msg-ic .i { width: 26px; height: 26px; }
.msg-card h1 { font-size: 26px; margin-bottom: 10px; }
.msg-card p { color: var(--muted); }
.admin-login { display: flex; gap: 8px; margin-top: 18px; }

/* ---- lightbox ----------------------------------------------------------- */
.lb { position: fixed; inset: 0; z-index: 100; display: grid; grid-template-rows: 1fr auto; place-items: center; padding: 56px 72px 20px; background: rgba(6,7,9,.94); backdrop-filter: blur(6px); animation: fade .18s ease-out; }
.lb[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.lb img { max-width: 100%; max-height: calc(100vh - 130px); object-fit: contain; border-radius: 8px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.lb-cap { color: #c9ced6; font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; padding-top: 16px; display: flex; gap: 16px; }
.lb-cap a { color: #fff; }
.lb button { position: absolute; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.06); color: #fff; cursor: pointer; }
.lb button:hover { background: rgba(255,255,255,.14); }
.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 14px; top: 50%; margin-top: -23px; }
.lb-next { right: 14px; top: 50%; margin-top: -23px; }
body.lb-open { overflow: hidden; }

/* ---- footer ------------------------------------------------------------- */
.foot { background: var(--hdr-bg); color: var(--hdr-muted); font-size: 14px; }
.foot-grid { display: grid; grid-template-columns: 1.1fr .7fr 1.5fr; gap: 48px; padding-top: 52px; padding-bottom: 40px; }
.foot .brand { margin-bottom: 14px; }
.foot h4 { font: 500 11.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: #737b87; margin: 6px 0 14px; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin-bottom: 8px; }
.foot a:not(.brand) { color: #d8dce1; text-decoration: none; }
.foot a:not(.brand):hover { color: #fff; text-decoration: underline; }
.foot-warn { display: flex; gap: 14px; padding: 18px 20px; border-radius: var(--r); border: 1px solid #2a2f37; background: rgba(255,255,255,.03); align-self: start; }
.foot-warn .i { width: 22px; height: 22px; color: var(--accent); margin-top: 2px; }
.foot-warn p { margin: 0; line-height: 1.55; }
.foot-warn strong { color: #fff; }
.foot-bottom { display: flex; flex-wrap: wrap; gap: 8px 28px; padding-top: 18px; padding-bottom: 28px; border-top: 1px solid #1f232a; font: 500 11px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: #69717d; }
.foot-bottom span::before { content: "◆"; color: var(--accent); margin-right: 8px; font-size: 8px; vertical-align: 2px; }

/* ---- responsive --------------------------------------------------------- */
@media (max-width: 1020px) {
  .dev-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "media" "side" "disc"; }
  .dev-side { margin-top: 24px; }
  .hero-in { grid-template-columns: 1fr; gap: 24px; padding-top: 48px; }
  .hero-fig { max-width: 520px; }
  .how-grid { grid-template-columns: 1fr 1fr; row-gap: 12px; }
  .how-grid li:nth-child(3) { border-left: 0; padding-left: 0; }
  .guide-grid { grid-template-columns: 1fr; gap: 24px; }
  .toc { position: static; }
  .toc ol { display: flex; flex-wrap: wrap; gap: 4px 0; border-left: 0; }
  .toc a { padding: 4px 14px 4px 0; border-left: 0; margin-left: 0; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-warn { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .top-in { flex-wrap: wrap; height: auto; padding-top: 10px; gap: 6px 12px; }
  .nav { order: 3; width: calc(100% + 32px); margin: 0 -16px; padding: 0 10px; overflow-x: auto; border-top: 1px solid var(--hdr-line); scrollbar-width: none; }
  .nav a { padding: 11px 10px; white-space: nowrap; }
  .nav a[aria-current]::after { bottom: 0; left: 10px; right: 10px; }
  .hide-sm { display: none; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .stat dd { font-size: 24px; }
  .section { padding-top: 40px; }
  .search, .search-in, .search-in input { width: 100%; }
  .search select { flex: 1; }
  .fields, .fields.four { grid-template-columns: 1fr 1fr; }
  .step { grid-template-columns: 1fr; gap: 6px; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .case-head { align-items: flex-start; }
  .verdict { width: 100%; }
  .os-grid { grid-template-columns: 1fr; }
  .lb { padding: 56px 8px 16px; }
  .lb-prev, .lb-next { top: auto; bottom: 10px; margin: 0; }
}
@media (max-width: 520px) {
  .fields { grid-template-columns: 1fr; }
  .how-grid { grid-template-columns: 1fr; }
  .how-grid li { border-left: 0; padding-left: 0; }
  .foot-grid { grid-template-columns: 1fr; gap: 28px; }
  .submit-bar .btn { width: 100%; }
  .cf-row { flex-wrap: wrap; }
  .cf-row input { max-width: none; }
  .cf-row .btn { width: 100%; }
  .grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.lb button[hidden] { display: none; }

/* ---- moderation, reports, trust cues ------------------------------------ */
.report { position: relative; }
.report summary { list-style: none; display: inline-flex; }
.report summary::-webkit-details-marker { display: none; }
.report summary .i { width: 14px; height: 14px; }
.report[open] summary { color: var(--ink); }
.report form { display: grid; gap: 8px; margin-top: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm); box-shadow: var(--shadow); }
.report-sm form { position: absolute; right: 0; top: 100%; z-index: 5; width: 280px; text-align: left; }
.radio { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.radio input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--ink); flex: none; }
.report .btn { justify-self: start; margin-top: 4px; }
.pid { font: 500 11.5px/1 var(--mono); color: var(--faint); }
.tag-mod { display: inline-flex; align-items: center; gap: 4px; background: var(--ink); color: var(--bg); }
.tag-mod .i { width: 11px; height: 11px; stroke-width: 2.6; }
.avatar-mod { background: var(--ink) !important; color: var(--accent) !important; }
.comment.is-hidden { opacity: .55; }
.trust-note { display: flex; gap: 12px; padding: 12px 14px; margin: 10px 0 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.trust-note > .i { width: 18px; height: 18px; color: var(--ok); margin-top: 1px; }
.trust-note p { margin: 0; }
.trust-note .tag-mod { font-size: 9.5px; padding: 2px 5px; vertical-align: 1px; }
.panel-mod { border-color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ref td.btn-row { display: table-cell; }
.ref td.btn-row form { margin: 2px; }
.ref .reasons { white-space: normal; }
.admin-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.msg-card .callout { text-align: left; margin-top: 12px; }
.admin-sub { margin: 40px 0 8px; }
.admin-sub h2 { font-size: 24px; }

/* ---- long user text, paging, unlisted models ---------------------------- */
/* User-supplied text (long URLs, unbroken strings) must wrap rather than overflow the grid. */
.case-head h1, .dev-main, .dev-side, .discussion, .card-body, .ref .model-cell { overflow-wrap: anywhere; min-width: 0; }
.pager { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 20px 0 0; }
.pager .muted { margin-right: auto; }
.discussion .pager { margin: 14px 0 0; }
.unlisted { margin-left: 8px; padding: 1px 6px; border-radius: 4px; border: 1px dashed var(--line-strong); font-size: 10px; letter-spacing: .06em; color: var(--muted); vertical-align: 1px; }
#notice { scroll-margin-top: 96px; }
#notice:focus { outline: none; }

/* ---- stats page (moderators) ---------------------------------------------- */
/* Two validated series colors (dataviz palette slots 1–2), stepped separately for dark. */
.stats-page, .viz-tip { --s1: #2a78d6; --s2: #eb6834; --grid-ln: var(--line); --axis-ln: var(--line-strong); }
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .stats-page, :root:where(:not([data-theme="light"])) .viz-tip { --s1: #3987e5; --s2: #d95926; }
}
:root[data-theme="dark"] .stats-page, :root[data-theme="dark"] .viz-tip { --s1: #3987e5; --s2: #d95926; }

.stats-filters { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; margin: 0 0 20px; }
.stats-filters .chips { margin: 0; }
.stats-h { font-size: 20px; margin: 32px 0 12px; }

.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 16px 16px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.kpi-label { font-size: 13px; color: var(--muted); }
.kpi-value { font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.kpi-delta { font-size: 12.5px; font-weight: 600; }
.kpi-delta .muted { font-weight: 400; }
.kpi-delta.good { color: var(--ok); } .kpi-delta.bad { color: var(--bad); } .kpi-delta.flat { color: var(--muted); }
.spark { width: 100%; height: 30px; margin-top: 6px; overflow: visible; }
.spark polyline { fill: none; stroke: var(--faint); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark circle { fill: var(--s1); stroke: var(--surface); stroke-width: 2; }

.attn { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.attn-item { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface-2); font-size: 13.5px; color: var(--ink-2); text-decoration: none; }
a.attn-item:hover { border-color: var(--ink); }
.attn-item .i { width: 16px; height: 16px; color: var(--muted); }
.attn-item.bad { border-color: var(--bad-line); background: var(--bad-bg); }
.attn-item.bad .i { color: var(--bad); }

.viz { margin: 0; position: relative; }
.viz svg { display: block; width: 100%; height: auto; overflow: visible; }
.viz-line { border-radius: var(--r-sm); }
.viz-line:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.viz-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin: 0 0 6px; }
.viz-legend span { display: inline-flex; align-items: center; gap: 6px; }
.key-line { display: inline-block; width: 14px; height: 2px; border-radius: 1px; }
.ser-bg-1 { background: var(--s1); } .ser-bg-2 { background: var(--s2); }
.viz .gridline { stroke: var(--grid-ln); stroke-width: 1; }
.viz .axis { stroke: var(--axis-ln); stroke-width: 1; }
.viz .tick { font: 500 11px var(--mono); fill: var(--muted); font-variant-numeric: tabular-nums; }
.viz .ser { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz .ser-1 { stroke: var(--s1); } .viz .ser-2 { stroke: var(--s2); }
.viz .dot { stroke: var(--surface); stroke-width: 2; }
.viz .dot-1 { fill: var(--s1); } .viz .dot-2 { fill: var(--s2); }
.viz .end { font-size: 12px; fill: var(--muted); }
.viz .end-v { font-weight: 600; fill: var(--ink); }
.viz .cross { stroke: var(--axis-ln); stroke-width: 1; }
.viz .ser.partial { opacity: .4; }
/* Narrow screens: scroll the trend chart sideways instead of shrinking its text. */
@media (max-width: 760px) { .viz-line { overflow-x: auto; } .viz-line svg { min-width: 680px; } }
.viz .hit { fill: transparent; }
.viz-line .hit { cursor: crosshair; }

.cols-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.viz-cols { padding: 14px 14px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.viz-cols figcaption { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.viz-cols figcaption b { font-size: 18px; color: var(--ink); font-weight: 600; }
.viz .col { fill: var(--s1); transition: opacity .12s; }
.viz-col:hover .col, .viz-col:focus .col { opacity: .75; }
.viz .col-v { font-size: 11px; font-weight: 600; fill: var(--ink-2); }

.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.stats-grid .panel { margin: 0; }
.stats-page .panel { margin-bottom: 16px; }
.vbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.vbars li { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 13.5px; }
.vb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vb-track { height: 10px; }
.vb-fill { display: block; height: 100%; min-width: 2px; background: var(--s1); border-radius: 0 4px 4px 0; }
.vb-val { font: 600 13px var(--mono); font-variant-numeric: tabular-nums; min-width: 3ch; text-align: right; }

.sbar { display: flex; gap: 2px; height: 14px; margin: 4px 0 14px; }
.sbar span { background: var(--st); min-width: 4px; }
.sbar span:first-child { border-radius: 4px 0 0 4px; }
.sbar span:last-child { border-radius: 0 4px 4px 0; }
.sbar span:only-child { border-radius: 4px; }
.slegend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13.5px; }
.slegend li { display: inline-flex; align-items: center; gap: 6px; }
.slegend .i { width: 16px; height: 16px; color: var(--st); }
.readout-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.viz-table { margin-top: 12px; }
.viz-table .table-card { margin-top: 10px; max-height: 420px; overflow: auto; }

.viz-tip { position: fixed; z-index: 60; pointer-events: none; min-width: 120px; max-width: 260px; padding: 8px 10px; border-radius: 8px; background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg); font-size: 12.5px; line-height: 1.45; }
.viz-tip[hidden] { display: none; }
.viz-tip .tt-h { color: var(--muted); font-size: 11.5px; margin-bottom: 2px; }
.viz-tip .tt-row { display: flex; align-items: center; gap: 6px; }
.viz-tip .tt-row b { font-variant-numeric: tabular-nums; }

@media (max-width: 1020px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cols-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid, .cols-grid { grid-template-columns: minmax(0, 1fr); }
  .readout-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
