/* PixelSize Tools — "Photographer's desk": warm paper and cream, a classic serif for headlines,
   one confident blue, and real images framed like prints. Mobile-first. */
:root {
  --bg: #fbf8f3;
  --bg-2: #f4eee4;
  --surface: #ffffff;
  --surface-2: #f8f4ee;
  --ink: #191a1f;
  --muted: #5d5850;
  --line: #e8e0d3;
  --line-strong: #d8cdbb;
  --accent: #1f5fe0;
  --accent-ink: #ffffff;
  --accent-soft: #e9effd;
  --ok: #0f7a3d;   --ok-soft: #e3f3e8;
  --warn: #8a5300; --warn-soft: #fbf0d9;
  --fail: #b42318; --fail-soft: #fde8e5;
  --check-a: #ece6db; --check-b: #ffffff;
  --focus: #1f5fe0;
  --laptop: #2a2c31; --laptop-edge: #4a4d55; --laptop-base: #c9ccd2; --laptop-base-2: #a9adb5;
  --shadow-sm: 0 1px 2px rgba(64, 44, 14, .06), 0 2px 10px rgba(64, 44, 14, .05);
  --shadow-md: 0 2px 4px rgba(64, 44, 14, .05), 0 12px 32px -8px rgba(64, 44, 14, .14);
  --shadow-lg: 0 30px 60px -24px rgba(48, 32, 8, .35), 0 12px 24px -12px rgba(48, 32, 8, .18);
  --t-green: #15803d; --t-orange: #e0611a; --t-blue: #1f5fe0; --t-teal: #0f766e;
  --t-rose: #e11d48; --t-purple: #7c3aed; --t-pink: #db2777; --t-amber: #c58a00;
  /* Text-safe versions of the tool colours (≥ 4.5:1 on the surfaces they sit on). */
  --tx-blue: #1d54c7; --tx-pink: #be185d; --tx-green: #15803d; --tx-amber: #8a5a00;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "Noto Serif", Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --radius: 14px; --radius-sm: 10px;
  --step--1: 0.875rem; --step-0: 1rem; --step-1: 1.125rem; --step-2: 1.35rem; --step-3: clamp(1.6rem, 1.3rem + 1.2vw, 2.1rem);
  --step-4: clamp(2.1rem, 1.5rem + 2.6vw, 3.5rem);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15130f; --bg-2: #1b1814; --surface: #201d18; --surface-2: #28241e; --ink: #f2ede4; --muted: #b8ae9f;
    --line: #37322a; --line-strong: #4a4337; --accent: #7ea6ff; --accent-ink: #0b1020; --accent-soft: #1e2840;
    --ok: #63d394; --ok-soft: #13291c; --warn: #f0b85a; --warn-soft: #2e2512; --fail: #ff8f85; --fail-soft: #35171a;
    --check-a: #2c2821; --check-b: #211e19; --focus: #a9c1ff;
    --laptop: #0c0d10; --laptop-edge: #3a3d45; --laptop-base: #4a4d55; --laptop-base-2: #33363d;
    --tx-blue: #9dbcff; --tx-pink: #ff9cc9; --tx-green: #7be0a4; --tx-amber: #f3c766;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow-md: 0 12px 32px -8px rgba(0, 0, 0, .55); --shadow-lg: 0 30px 60px -24px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15130f; --bg-2: #1b1814; --surface: #201d18; --surface-2: #28241e; --ink: #f2ede4; --muted: #b8ae9f;
  --line: #37322a; --line-strong: #4a4337; --accent: #7ea6ff; --accent-ink: #0b1020; --accent-soft: #1e2840;
  --ok: #63d394; --ok-soft: #13291c; --warn: #f0b85a; --warn-soft: #2e2512; --fail: #ff8f85; --fail-soft: #35171a;
  --check-a: #2c2821; --check-b: #211e19; --focus: #a9c1ff;
  --laptop: #0c0d10; --laptop-edge: #3a3d45; --laptop-base: #4a4d55; --laptop-base-2: #33363d;
  --tx-blue: #9dbcff; --tx-pink: #ff9cc9; --tx-green: #7be0a4; --tx-amber: #f3c766;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow-md: 0 12px 32px -8px rgba(0, 0, 0, .55); --shadow-lg: 0 30px 60px -24px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--step-0)/1.6 var(--font-sans); overflow-x: hidden; }
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
svg { flex: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--surface); padding: 8px 12px; z-index: 50; border-radius: 6px; }
.skip:focus { top: 8px; }
.num, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 0.92em; }
.wrap {
  width: 100%; max-width: 1200px; margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 900px) { .wrap { padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); } }
.prose { max-width: 70ch; }
h1, h2, h3 { text-wrap: balance; color: var(--ink); }
h1, h2 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.012em; line-height: 1.1; }
h1 { font-size: var(--step-4); margin: 0 0 14px; }
h2 { font-size: var(--step-3); margin: 2em 0 0.5em; }
h3 { font-size: var(--step-1); font-weight: 650; line-height: 1.3; margin: 1.5em 0 0.4em; }
.eyebrow { font: 600 0.72rem/1.2 var(--font-sans); text-transform: uppercase; letter-spacing: 0.16em; color: var(--muted); margin: 0 0 12px; }
.lede { font-size: var(--step-0); color: var(--muted); margin: 0; max-width: 58ch; }
@media (min-width: 600px) { .lede { font-size: var(--step-1); } }

/* ---------- tool colour tiles ---------- */
.tile { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: #fff; flex: none; }
.tile svg { width: 18px; height: 18px; }
.tile-sm { width: 28px; height: 28px; border-radius: 8px; }
.tile-sm svg { width: 15px; height: 15px; }
.tile-lg { width: 52px; height: 52px; border-radius: 14px; }
.tile-lg svg { width: 26px; height: 26px; }
.tile-green { background: var(--t-green); } .tile-orange { background: var(--t-orange); } .tile-blue { background: var(--t-blue); }
.tile-teal { background: var(--t-teal); } .tile-rose { background: var(--t-rose); } .tile-purple { background: var(--t-purple); }
.tile-pink { background: var(--t-pink); } .tile-amber { background: var(--t-amber); }

/* ---------- header ---------- */
.site-header { position: relative; z-index: 30; background: color-mix(in srgb, var(--bg) 92%, transparent); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 12px; min-height: 68px; padding-block: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 1.14rem; letter-spacing: -0.01em; white-space: nowrap; }
.brand b { font-weight: 750; }
.brand-accent { color: var(--accent); }
.brand-mark { width: 30px; height: 30px; }
.site-nav { display: none; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.theme-toggle, .nav-toggle {
  width: 44px; height: 44px; border: 1px solid transparent; background: transparent; color: var(--ink);
  border-radius: 10px; cursor: pointer; display: inline-grid; place-items: center;
}
.theme-toggle:hover, .nav-toggle:hover { background: var(--surface-2); border-color: var(--line); }
.theme-toggle svg, .nav-toggle svg { width: 20px; height: 20px; }
.theme-toggle .sun { display: none; }
.theme-toggle[data-mode="dark"] .sun { display: block; }
.theme-toggle[data-mode="dark"] .moon { display: none; }
.btn.header-cta { display: none; }
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-list > li > a, .nav-sub-toggle {
  display: flex; align-items: center; gap: 6px; padding: 10px 12px; min-height: 44px; border-radius: 8px;
  color: var(--ink); text-decoration: none; font: 500 var(--step--1)/1.2 var(--font-sans); background: none; border: 0; cursor: pointer; width: 100%;
}
.nav-list > li > a:hover, .nav-sub-toggle:hover { background: var(--surface-2); }
.nav-list > li > a[aria-current="page"], .nav-sub-toggle[data-current] { color: var(--accent); }
.nav-sub-toggle .chev { width: 16px; height: 16px; transition: transform .2s; }
.nav-sub-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.nav-sub { list-style: none; margin: 0; padding: 4px 0 8px; display: grid; gap: 2px; }
.nav-sub a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; min-height: 44px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: var(--step--1); }
.nav-sub a:hover, .nav-sub a[aria-current="page"] { background: var(--accent-soft); }
/* Mobile menu */
@media (max-width: 959px) {
  .site-header.nav-open .site-nav {
    display: block; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md); padding: 8px max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px));
    max-height: calc(100vh - 80px); overflow-y: auto;
  }
  .nav-sub-toggle { display: none; }
  .nav-sub { display: grid; grid-template-columns: 1fr; border-block: 1px solid var(--line); margin-block: 4px; padding-block: 6px; }
}
@media (min-width: 960px) {
  .site-nav { display: block; margin-left: 36px; }
  .nav-list { display: flex; align-items: center; gap: 2px; }
  .nav-list > li > a, .nav-sub-toggle { padding: 8px 12px; min-height: 40px; width: auto; }
  .nav-toggle { display: none; }
  .btn.header-cta { display: inline-flex; }
  .has-sub { position: relative; }
  .nav-sub {
    display: none; position: absolute; top: calc(100% + 8px); left: -12px; width: 520px; grid-template-columns: 1fr 1fr; gap: 2px;
    padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  }
  .has-sub.open .nav-sub { display: grid; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 20px;
  border-radius: 10px; border: 1px solid transparent; font: 650 var(--step-0)/1.2 var(--font-sans); cursor: pointer; text-decoration: none;
  transition: background-color .15s, box-shadow .15s, transform .15s, border-color .15s;
}
.btn svg { width: 18px; height: 18px; }
.btn-sm { min-height: 40px; padding: 8px 14px; font-size: var(--step--1); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 6px 16px -6px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); text-decoration: none; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--ink); background: var(--surface-2); }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-run { flex: 1 1 220px; }

/* ---------- drop zone ---------- */
.drop {
  position: relative; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface);
  display: grid; justify-items: center; text-align: center; gap: 6px; padding: 26px 16px 22px; cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.drop:hover, .drop.dragging { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface)); }
.drop-icon { width: 40px; height: 40px; color: var(--accent); }
.drop-title { margin: 0; font-weight: 650; font-size: var(--step-1); }
.drop-or { margin: 0; font-size: var(--step--1); color: var(--muted); }
.drop-sub { margin: 4px 0 0; font-size: 0.8rem; color: var(--muted); }
.btn-choose { min-width: 190px; }
.drop.has-files { padding: 14px; grid-template-columns: auto 1fr; justify-items: start; text-align: left; align-items: center; }
.drop.has-files .drop-icon, .drop.has-files .drop-title, .drop.has-files .drop-or { display: none; }
.drop.has-files .btn-choose { background: var(--surface); color: var(--ink); border-color: var(--line-strong); box-shadow: none; min-width: 0; }
.drop.has-files .drop-sub { margin: 0; }
.file-hint { font-size: var(--step--1); color: var(--muted); margin: 8px 0 0; min-height: 1.4em; font-variant-numeric: tabular-nums; }
.file-hint:empty { min-height: 0; margin: 0; }
.file-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; max-height: 220px; overflow: auto; }
.file-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 4px 4px 4px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; font-size: var(--step--1); }
.fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsize { color: var(--muted); }
.icon-btn { min-width: 40px; min-height: 40px; border: 0; background: transparent; color: var(--muted); font-size: 1.3rem; border-radius: 6px; cursor: pointer; }
.icon-btn:hover { background: var(--fail-soft); color: var(--fail); }

/* ---------- form controls ---------- */
.options { display: grid; gap: 16px; margin-top: 16px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field > .label, legend, .range-head label { font-weight: 650; font-size: var(--step--1); }
.hint { font-size: var(--step--1); color: var(--muted); margin: 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 6px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
input[type="number"], input[type="text"], select {
  width: 100%; min-height: 46px; padding: 8px 12px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px;
}
input[type="number"] { font-family: var(--font-mono); }
input[type="number"]:focus, select:focus { border-color: var(--accent); }
input[type="color"] { width: 58px; height: 46px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); cursor: pointer; }
input[type="range"] { width: 100%; accent-color: var(--accent); min-height: 34px; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; flex: none; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.choice-group { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-group .check { padding: 4px 14px 4px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); }
.choice-group .check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.segmented { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; width: 100%; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.segmented span { display: grid; place-items: center; min-height: 40px; border-radius: 9px; font-weight: 600; font-size: var(--step--1); color: var(--muted); }
.segmented input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.segmented input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 38px; padding: 4px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink); font: 500 var(--step--1) var(--font-mono); cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.input-unit { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.range-head { display: flex; justify-content: space-between; align-items: baseline; }
output { font-family: var(--font-mono); font-weight: 650; color: var(--accent); }
.preset-grid { display: grid; gap: 6px; }
@media (min-width: 600px) { .preset-grid { grid-template-columns: 1fr 1fr; } }
.preset { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; background: var(--surface); }
.preset:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.preset .dims { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- tool pages ---------- */
.page-head { background: linear-gradient(180deg, var(--bg-2), var(--bg)); border-bottom: 1px solid var(--line); }
.page-head-inner { padding-block: 22px 28px; }
.crumbs { display: flex; gap: 8px; font-size: var(--step--1); color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--muted); }
.page-title { display: flex; gap: 16px; align-items: center; }
.page-title .eyebrow { margin-bottom: 6px; }
.page-title h1 { margin: 0; }
.page-head .lede { margin-top: 14px; }
.trust { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 14px 0 0; padding: 0; list-style: none; font-size: var(--step--1); color: var(--muted); }
.trust li { display: inline-flex; align-items: center; gap: 7px; }
.trust li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.tool { margin-block: 24px 8px; }
.tool-grid { display: grid; gap: 16px; }
@media (min-width: 980px) { .tool-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; gap: 24px; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); padding: 16px; min-width: 0; box-shadow: var(--shadow-sm); }
@media (min-width: 600px) { .panel { padding: 22px; } }
.panel-input .drop { background: var(--surface-2); }
.output-head h2 { margin: 0; font-family: var(--font-sans); font-size: var(--step-1); font-weight: 700; letter-spacing: 0; }
.status { min-height: 1.5em; margin: 8px 0 0; font-size: var(--step--1); color: var(--muted); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.status:empty { min-height: 0; }
.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress .bar { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.empty { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 28px 18px; margin-top: 12px; color: var(--muted); font-size: var(--step--1); text-align: center; background: var(--surface-2); }
#results:not(:empty) + .empty { display: none; }
.compare-slot:not([hidden]) ~ .empty { display: none; }
.msg { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; font-size: var(--step--1); }
.msg-error { background: var(--fail-soft); color: var(--fail); }
#results { display: grid; gap: 12px; margin-top: 12px; }
#results:empty { margin: 0; }
.zip-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }

/* Result cards */
.result { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); align-items: start; background: var(--surface); }
.result-failed { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 599px) {
  .result:not(.result-failed) .result-body { display: contents; }
  .result .thumb { grid-row: 1 / span 2; }
  .result .result-name, .result .badge { grid-column: 2; }
  .result .facts, .result .hint, .result .btn-download { grid-column: 1 / -1; }
  .btn-download { justify-self: stretch; }
}
@media (min-width: 600px) { .result { grid-template-columns: 116px minmax(0, 1fr); gap: 16px; } }
.thumb { aspect-ratio: 1; max-width: 100%; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); }
.thumb img { max-height: 100%; object-fit: contain; display: block; }
.checker { background: conic-gradient(var(--check-a) 25%, var(--check-b) 0 50%, var(--check-a) 0 75%, var(--check-b) 0) 0 0/16px 16px; }
.result-body { min-width: 0; display: grid; gap: 6px; align-content: start; }
.result-name { margin: 0; font-size: var(--step-0); font-weight: 650; overflow-wrap: anywhere; }
.facts { margin: 0; display: grid; gap: 2px; font-size: var(--step--1); }
.facts div { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 6px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.facts .num { font-family: var(--font-sans); font-size: 1em; }
.delta { color: var(--muted); }
.badge { justify-self: start; margin: 0; padding: 3px 10px; border-radius: 99px; font-size: 0.8rem; font-weight: 650; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-fail { background: var(--fail-soft); color: var(--fail); }
.btn-download { justify-self: start; margin-top: 4px; }

/* ---------- before/after slider ---------- */
.compare-slot { margin-top: 12px; }
.compare { margin: 0; }
.compare-stage {
  position: relative; overflow: hidden; border-radius: 12px; margin-inline: auto; background: var(--surface-2);
  width: min(100%, calc(62vh * var(--ar))); aspect-ratio: var(--ar); max-width: 100%;
  user-select: none; -webkit-user-select: none; touch-action: pan-y;
}
.compare.checker .compare-stage { background: conic-gradient(var(--check-a) 25%, var(--check-b) 0 50%, var(--check-a) 0 75%, var(--check-b) 0) 0 0/16px 16px; }
.compare-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; max-width: none; pointer-events: none; }
.compare-after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos)); }
.compare-notice { position: absolute; inset: 0; z-index: 4; display: grid; place-content: center; padding: 24px; text-align: center; background: var(--surface); color: var(--ink); font-size: 0.9rem; pointer-events: none; }
.compare-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15), 0 0 12px rgba(0, 0, 0, .25); pointer-events: none; }
.compare-knob { position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; transform: translate(-50%, -50%); border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
.compare-knob::before, .compare-knob::after { content: ""; position: absolute; top: 50%; width: 7px; height: 7px; border: solid #1d1f24; border-width: 0 0 2px 2px; }
.compare-knob::before { left: 11px; transform: translateY(-50%) rotate(45deg); }
.compare-knob::after { right: 11px; transform: translateY(-50%) rotate(-135deg); }
.compare-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; z-index: 3; touch-action: pan-y; }
.compare-range:focus-visible ~ .compare-handle .compare-knob, .compare-stage:focus-within .compare-knob { outline: 3px solid var(--focus); outline-offset: 2px; }
.compare-label { position: absolute; top: 10px; z-index: 2; padding: 5px 10px; border-radius: 8px; background: rgba(17, 18, 22, .72); color: #fff; font-size: 0.75rem; font-weight: 600; line-height: 1.2; pointer-events: none; font-variant-numeric: tabular-nums; backdrop-filter: blur(4px); }
.compare-label-before { left: 10px; }
.compare-label-after { right: 10px; background: color-mix(in srgb, #1f5fe0 88%, black); }
/* Narrow screens: put the result label at the bottom so the two never collide */
@media (max-width: 599px) {
  .compare-label { font-size: 0.68rem; padding: 4px 7px; top: 8px; }
  .compare-label-before { left: 8px; }
  .compare-label-after { top: auto; bottom: 8px; right: 8px; }
  .compare-knob { width: 34px; height: 34px; }
}
.compare-caption { margin-top: 8px; font-size: var(--step--1); color: var(--muted); text-align: center; }

/* ---------- homepage hero ---------- */
.hero { position: relative; background: radial-gradient(120% 90% at 85% 10%, var(--bg-2) 0%, var(--bg) 60%); border-bottom: 1px solid var(--line); overflow: hidden; }
.hero-grid { display: grid; gap: 28px; padding-block: 28px 36px; }
@media (min-width: 1000px) { .hero-grid { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 48px; align-items: center; padding-block: 48px 56px; } }
.hero h1 { font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.4rem); max-width: 19ch; }
.hero-card { margin-top: 22px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-md); }
@media (min-width: 600px) { .hero-card { padding: 18px; } }
.hero-card .drop { border-color: color-mix(in srgb, var(--accent) 35%, var(--line-strong)); }
.quick-panel { display: grid; gap: 14px; }
.quick-options { margin-top: 12px; }
.quick-options:has(.quick-panel[hidden]) { margin: 0; }
.benefits { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 640px) { .benefits { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.benefits li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.8rem; color: var(--muted); line-height: 1.35; }
.benefits b { display: block; color: var(--ink); font-size: 0.82rem; }
.benefits svg { width: 22px; height: 22px; color: var(--accent); margin-top: 1px; }
.benefits li:nth-child(2) svg { color: var(--t-amber); } .benefits li:nth-child(3) svg { color: var(--t-purple); } .benefits li:nth-child(4) svg { color: var(--t-rose); }
.hero-visual { position: relative; min-width: 0; padding: 34px 0 0; }
.laptop { position: relative; width: min(88%, 600px); margin-inline: auto; filter: drop-shadow(0 30px 40px rgba(48, 32, 8, .22)); }
.laptop-lid { background: var(--laptop); border: 1px solid var(--laptop-edge); border-radius: 16px 16px 6px 6px; padding: 3.2% 3.2% 4%; }
.laptop-screen { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 4px; background: #0f1115; display: grid; place-items: center; }
.laptop-screen > img.scene-static { width: 100%; height: 100%; object-fit: cover; display: block; }
.laptop-screen > .compare { position: absolute; inset: 0; width: auto; height: auto; }
.laptop-screen .compare-stage { position: absolute; inset: 0; width: auto; height: auto; border-radius: 0; aspect-ratio: auto; max-width: none; }
.laptop-screen .compare:not(.checker) .compare-stage { background: #0f1115; }
.laptop-screen .compare-caption { display: none; }
.laptop-base { position: relative; height: 16px; margin: 0 -6%; background: linear-gradient(180deg, var(--laptop-base), var(--laptop-base-2)); border-radius: 0 0 18px 18px; }
.laptop-base::before { content: ""; position: absolute; left: 50%; top: 0; width: 16%; height: 6px; transform: translateX(-50%); background: var(--laptop-base-2); border-radius: 0 0 8px 8px; }
.hero-caption { margin: 18px auto 0; max-width: 52ch; text-align: center; font-size: var(--step--1); color: var(--muted); }
.hero-results { margin-top: 16px; }
.float-chips { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.fchip {
  position: absolute; padding: 9px 14px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-md);
  font: 700 0.85rem/1 var(--font-sans); border: 1px solid var(--line); animation: float 6s ease-in-out infinite;
}
.fchip-jpg { top: 8px; left: 3%; color: var(--tx-blue); }
.fchip-png { top: 42%; left: 0; color: var(--tx-pink); animation-delay: -2s; }
.fchip-webp { top: 26%; right: 0; color: var(--tx-green); animation-delay: -4s; }
.fchip-gif { top: 58%; right: 1%; color: var(--tx-amber); animation-delay: -1s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.hero-note { position: absolute; top: -18px; right: 16%; margin: 0; font: italic 400 1.05rem/1.25 var(--font-display); color: var(--muted); transform: rotate(-4deg); z-index: 2; }
@media (max-width: 699px) {
  .fchip { padding: 6px 10px; font-size: 0.72rem; }
  .fchip-png, .fchip-gif { display: none; }
  .hero-note { display: none; }
}
.hero-results .result { box-shadow: var(--shadow-sm); }

/* ---------- sections ---------- */
.section { padding-block: 48px; }
.section.wrap + .section.wrap { padding-top: 8px; }
@media (min-width: 900px) { .section { padding-block: 72px; } }
.section-head { display: grid; gap: 6px; margin-bottom: 24px; max-width: 64ch; }
.section-head h2 { margin: 0; }
.section-head p { margin: 0; color: var(--muted); }
.band { background: var(--bg-2); border-block: 1px solid var(--line); }

/* Tool cards (homepage) */
.tool-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.tool-card { display: grid; grid-template-rows: auto 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s, border-color .2s; }
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.card-art { position: relative; display: block; aspect-ratio: 7 / 4; overflow: hidden; background: var(--surface-2); margin: 10px 10px 0; border-radius: 10px; }
.card-art img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.tool-card:hover .card-art img { transform: scale(1.04); }
.art-chip { position: absolute; right: 8px; bottom: 8px; padding: 4px 9px; border-radius: 8px; background: rgba(255, 255, 255, .94); color: #1a1b1f; font: 650 0.74rem/1.2 var(--font-sans); font-variant-numeric: tabular-nums; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.art-frame { position: absolute; inset: 16% 22%; border: 2px dashed rgba(255, 255, 255, .95); border-radius: 4px; box-shadow: 0 0 0 999px rgba(10, 14, 24, .28); }
.card-art-stack img { transform: rotate(-2.5deg) scale(.86); border-radius: 8px; box-shadow: 8px 8px 0 -2px #fff, 8px 8px 0 0 var(--line-strong), 16px 16px 0 -2px #fff, 16px 16px 0 0 var(--line-strong); }
.tool-card:hover .card-art-stack img { transform: rotate(-2.5deg) scale(.88); }
.card-body { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; padding: 14px 16px 16px; align-content: start; }
.card-body .tile { grid-row: span 2; }
.card-title { margin: 0; font-size: var(--step-0); font-weight: 650; font-family: var(--font-sans); letter-spacing: 0; }
.card-text { font-size: var(--step--1); color: var(--muted); line-height: 1.45; }
/* Phones: two compact cards per row so eight tools don't become a very long list */
@media (max-width: 559px) {
  .tool-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-art { margin: 6px 6px 0; border-radius: 8px; }
  .art-chip { font-size: 0.66rem; padding: 3px 6px; right: 5px; bottom: 5px; }
  .card-body { grid-template-columns: 1fr; padding: 10px 10px 12px; gap: 6px; }
  .card-body .tile { grid-row: auto; width: 28px; height: 28px; border-radius: 8px; }
  .card-body .tile svg { width: 15px; height: 15px; }
  .card-title { font-size: 0.92rem; line-height: 1.25; }
  .card-text { font-size: 0.78rem; }
}

/* Feature split */
.split { display: grid; gap: 28px; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; } }
.split-intro h2 { margin-top: 0; }
.split-intro p { color: var(--muted); }
.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.features li { display: flex; gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.features svg { width: 26px; height: 26px; color: var(--accent); margin-top: 2px; }
.features h3 { margin: 0 0 4px; }
.features p { margin: 0; color: var(--muted); font-size: var(--step--1); }
.steps3 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); counter-reset: s; padding: 0; margin: 0; list-style: none; }
.steps3 li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; counter-increment: s; box-shadow: var(--shadow-sm); }
.steps3 li::before { content: counter(s); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font: 700 0.9rem var(--font-display); margin-bottom: 10px; }
.steps3 h3 { margin: 0 0 4px; }
.steps3 p { margin: 0; color: var(--muted); font-size: var(--step--1); }
.good-to-know { margin-top: 28px; max-width: 70ch; }
.good-to-know ul { padding-left: 1.2em; color: var(--muted); }

/* ---------- content ---------- */
.content { padding-block: 16px 40px; }
.content ol, .content ul { padding-left: 1.3em; }
.content li + li { margin-top: 4px; }
.table-wrap:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.owner-missing { background: var(--warn-soft); color: var(--warn); padding: 1px 6px; border-radius: 4px; font-weight: 600; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); margin: 12px 0; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: var(--step--1); }
.table-wrap table { min-width: 520px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-weight: 650; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { white-space: nowrap; }
.callout { border-left: 3px solid var(--accent); background: var(--surface); padding: 12px 16px; border-radius: 0 10px 10px 0; margin: 16px 0; }
.related { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); margin-top: 12px; }
.mini-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
.mini-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.mini-card b { display: block; font-weight: 650; }
.mini-card span span { font-size: var(--step--1); color: var(--muted); line-height: 1.4; }
.page-head.simple .page-head-inner { padding-block: 32px; }

/* Reserved ad slots (disabled until owner enables). Never beside upload, processing or download controls. */
.ad-slot { margin-block: 32px; min-height: 120px; border: 1px dashed var(--line); border-radius: var(--radius); display: grid; place-items: center; color: var(--muted); font-size: 0.75rem; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); margin-top: 48px; font-size: var(--step--1); color: var(--muted); }
.footer-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); padding-block: 40px 28px; }
.footer-brand p { margin: 10px 0 0; max-width: 32ch; }
.footer-grid h2 { font: 650 0.75rem/1.2 var(--font-sans); margin: 0 0 12px; color: var(--ink); text-transform: uppercase; letter-spacing: 0.12em; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.footer-grid nav a { color: var(--muted); text-decoration: none; display: inline-block; padding-block: 4px; }
.footer-grid nav a:hover { color: var(--accent); text-decoration: underline; }
.footer-base { border-top: 1px solid var(--line); padding-block: 16px 28px; display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: space-between; }
.preview-banner { background: var(--warn-soft); color: var(--warn); font-size: var(--step--1); padding-block: 8px; }
.is-home + .site-footer { margin-top: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
