@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/assets/fonts/plus-jakarta-sans.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
/* File Perks: one stylesheet. Tokens first; every colour, radius, shadow and duration comes from
   them. Light by default, dark by preference or the header switch. */
:root {
  --bg: #ffffff;
  --bg-alt: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #f2f5fb;
  --ink: #0f1b3d;
  --ink-2: #33415f;
  --muted: #5a6683;
  --line: #e2e7f0;
  --line-strong: #c9d2e3;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-ink: #ffffff;
  --accent-soft: #eaf0ff;
  --accent-line: #b8cafb;
  --ok: #0f7a45;
  --ok-soft: #e7f6ee;
  --err: #b42318;
  --err-soft: #fdecea;
  --warn: #8a5a00;
  --warn-soft: #fff4dc;
  --focus: #1d4ed8;
  --shadow-sm: 0 1px 2px rgb(15 27 61 / 0.06);
  --shadow: 0 1px 2px rgb(15 27 61 / 0.05), 0 6px 20px rgb(15 27 61 / 0.06);
  --shadow-lg: 0 10px 40px rgb(15 27 61 / 0.12);
  --r-sm: 8px;
  --r: 10px;
  --r-lg: 14px;
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --t: 160ms;
  --wrap: 1160px;
  --checker: repeating-conic-gradient(#e8ebf2 0% 25%, #ffffff 0% 50%) 50% / 16px 16px;
  color-scheme: light;
}
:root[data-theme="dark"], :root.is-dark {
  --bg: #0b1220;
  --bg-alt: #0f182b;
  --surface: #111b30;
  --surface-2: #16223b;
  --ink: #e8edf8;
  --ink-2: #c3cce0;
  --muted: #9aa6c2;
  --line: #22304d;
  --line-strong: #33456a;
  --accent: #7ea3ff;
  --accent-hover: #a3bdff;
  --accent-ink: #0b1220;
  --accent-soft: #17264a;
  --accent-line: #2f4a8a;
  --ok: #5fd39b;
  --ok-soft: #0f2a20;
  --err: #ff8a80;
  --err-soft: #331617;
  --warn: #f3c56b;
  --warn-soft: #2e2410;
  --focus: #9db9ff;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3);
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
  --shadow-lg: 0 12px 40px rgb(0 0 0 / 0.45);
  --checker: repeating-conic-gradient(#1a2440 0% 25%, #111b30 0% 50%) 50% / 16px 16px;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220; --bg-alt: #0f182b; --surface: #111b30; --surface-2: #16223b;
    --ink: #e8edf8; --ink-2: #c3cce0; --muted: #9aa6c2; --line: #22304d; --line-strong: #33456a;
    --accent: #7ea3ff; --accent-hover: #a3bdff; --accent-ink: #0b1220; --accent-soft: #17264a; --accent-line: #2f4a8a;
    --ok: #5fd39b; --ok-soft: #0f2a20; --err: #ff8a80; --err-soft: #331617; --warn: #f3c56b; --warn-soft: #2e2410;
    --focus: #9db9ff;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3); --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25); --shadow-lg: 0 12px 40px rgb(0 0 0 / 0.45);
    --checker: repeating-conic-gradient(#1a2440 0% 25%, #111b30 0% 50%) 50% / 16px 16px;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.6 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 0.5em; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 1.4rem + 2.2vw, 2.9rem); font-weight: 750; }
h2 { font-size: clamp(1.35rem, 1.2rem + 0.7vw, 1.75rem); font-weight: 700; }
h3 { font-size: 1.08rem; font-weight: 650; }
p { margin: 0 0 1em; text-wrap: pretty; }
ul, ol { padding-left: 1.25em; }
code { font-family: var(--mono); font-size: 0.9em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 0.05em 0.35em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.wrap.narrow { max-width: 820px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: var(--r); font-weight: 600; }
.skip:focus { top: 12px; color: var(--accent-ink); }
main:focus { outline: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--ink);
  font: 600 0.95rem/1.2 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background var(--t), border-color var(--t), color var(--t), box-shadow var(--t), transform var(--t);
}
.btn:hover { border-color: var(--accent-line); background: var(--surface-2); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 1.1em; height: 1.1em; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn-quiet:hover { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.btn-small { min-height: 36px; padding: 6px 12px; font-size: 0.88rem; }
.btn-block { width: 100%; }
.prose .btn { white-space: normal; text-align: center; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary:disabled:hover { background: var(--accent); border-color: var(--accent); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 0.18em; }
.link-btn:hover { color: var(--ink); }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r); border: 1px solid transparent;
  background: transparent; color: var(--ink-2); cursor: pointer; transition: background var(--t), color var(--t);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn .icon { width: 22px; height: 22px; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; transition: border-color var(--t), box-shadow var(--t); }
.site-header.is-scrolled { border-color: var(--line); box-shadow: var(--shadow-sm); }
.header-row { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 750; font-size: 1.18rem; letter-spacing: -0.02em; }
.brand:hover { color: var(--ink); }
.brand .mark { width: 34px; height: 34px; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav > a, .nav-trigger {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 8px 12px; border-radius: var(--r-sm);
  color: var(--ink-2); text-decoration: none; font: 550 0.95rem/1 var(--font); background: none; border: 0; cursor: pointer;
}
.nav > a:hover, .nav-trigger:hover { background: var(--surface-2); color: var(--ink); }
.nav > a[aria-current="page"], .nav-trigger[data-current] { color: var(--accent); }
.nav-trigger .icon { width: 16px; height: 16px; transition: transform var(--t); }
.nav-trigger[aria-expanded="true"] .icon { transform: rotate(180deg); }
.nav-menu { position: relative; }
.menu-panel {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 60;
  display: grid; grid-template-columns: repeat(3, minmax(190px, 1fr)); gap: 8px 20px; width: max-content; max-width: min(720px, 92vw);
  padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
}
.menu-title { margin: 0 0 6px; padding: 0 8px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.menu-group ul { list-style: none; margin: 0; padding: 0; }
.menu-group a { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.menu-group a:hover { background: var(--accent-soft); color: var(--accent); }
.menu-group .icon { color: var(--accent); width: 18px; height: 18px; }
.nav-search { display: flex; align-items: center; margin-left: 8px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); transition: border-color var(--t), box-shadow var(--t); }
.nav-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.nav-search input { width: 150px; min-height: 40px; padding: 6px 4px 6px 12px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 0.92rem; }
.nav-search input:focus { outline: none; }
.nav-search button { display: grid; place-items: center; width: 40px; height: 40px; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: var(--r); }
.nav-search button:hover { color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 2px; }
.menu-btn { display: none; }
.when-dark, .when-open { display: none; }
.is-dark .when-dark { display: block; }
.is-dark .when-light { display: none; }
.menu-btn[aria-expanded="true"] .when-open { display: block; }
.menu-btn[aria-expanded="true"] .when-closed { display: none; }

@media (max-width: 1023px) {
  .menu-btn { display: inline-grid; }
  .header-actions { margin-left: auto; }
  .nav {
    position: fixed; inset: 68px 0 auto 0; z-index: 49; display: none; flex-direction: column; align-items: stretch; gap: 2px;
    max-height: calc(100dvh - 68px); overflow-y: auto; padding: 12px 20px 24px; margin: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg);
  }
  .nav.is-open { display: flex; }
  .nav > a, .nav-trigger { width: 100%; justify-content: space-between; padding: 12px; font-size: 1rem; }
  .menu-panel { position: static; transform: none; grid-template-columns: 1fr; width: auto; max-width: none; box-shadow: none; border: 0; padding: 4px 0 8px 8px; background: transparent; }
  .nav-search { order: -1; margin: 0 0 8px; }
  .nav-search input { width: 100%; flex: 1; min-height: 44px; }
}

/* ---------- breadcrumbs ---------- */
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; list-style: none; margin: 0 0 18px; padding: 0; font-size: 0.88rem; color: var(--muted); }
.crumbs li { display: inline-flex; align-items: center; gap: 4px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs .icon { width: 14px; height: 14px; opacity: 0.7; }
.crumbs [aria-current] { color: var(--ink-2); font-weight: 550; }

/* ---------- sections ---------- */
.section { padding: clamp(40px, 6vw, 72px) 0; }
.section.alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.lead { font-size: clamp(1.03rem, 1rem + 0.25vw, 1.15rem); color: var(--ink-2); max-width: 64ch; }
.eyebrow { margin: 0 0 10px; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.more-link { margin: 18px 0 0; }
.more-link a, a.more-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; text-decoration: none; }
.more-link a:hover, a.more-link:hover { text-decoration: underline; }
.more-link .icon { width: 16px; height: 16px; }
.h-icon { display: inline-block; vertical-align: -0.15em; margin-right: 8px; color: var(--accent); }

/* ---------- hero ---------- */
.hero { padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 72px); background: linear-gradient(180deg, var(--accent-soft), var(--bg) 85%); border-bottom: 1px solid var(--line); }
.hero-inner { text-align: center; display: flex; flex-direction: column; align-items: center; }
.hero .lead { margin-inline: auto; }
.hero-search, .dir-search {
  display: flex; align-items: center; gap: 8px; width: 100%; max-width: 620px; margin: 12px auto 0; padding: 6px 6px 6px 16px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: var(--shadow);
  transition: border-color var(--t), box-shadow var(--t);
}
.hero-search:focus-within, .dir-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.hero-search > .icon, .dir-search > .icon { color: var(--muted); }
.hero-search input, .dir-search input { flex: 1; min-width: 0; min-height: 44px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1.02rem; }
.hero-search input:focus, .dir-search input:focus { outline: none; }
.dir-search { margin: 18px 0 0; max-width: 560px; }
.quick-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; list-style: none; margin: 20px 0 0; padding: 0; }
.quick-links a { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); text-decoration: none; font-size: 0.9rem; font-weight: 550; transition: border-color var(--t), color var(--t); }
.quick-links a:hover { border-color: var(--accent-line); color: var(--accent); }
.page-hero { padding: clamp(28px, 4vw, 48px) 0 clamp(20px, 3vw, 32px); border-bottom: 1px solid var(--line); background: var(--bg-alt); }
.search-status { min-height: 1.5em; margin: 10px 0 0; color: var(--muted); font-size: 0.92rem; }

/* ---------- tool cards ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; margin-top: 18px; }
.tool-grid.related { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.tool-grid.compact { margin: 22px 0 26px; }
.tool-card {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; height: 100%; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm);
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
}
.tool-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow); transform: translateY(-2px); color: var(--ink); }
.tool-card-icon { display: grid; place-items: center; width: 40px; height: 32px; flex: none; border-radius: var(--r); background: var(--accent-soft); color: var(--accent); }
.tool-card-icon .icon { width: 20px; height: 20px; }
.fmt-pair { display: inline-flex; align-items: center; gap: 4px; flex: none; height: 32px; padding: 4px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent); }
.fmt-pair b { display: grid; place-items: center; min-width: 40px; height: 24px; padding: 0 6px; border-radius: 6px; background: var(--surface); font: 750 0.72rem/1 var(--font); letter-spacing: 0.04em; color: var(--ink); box-shadow: var(--shadow-sm); }
.fmt-pair b + .icon + b { background: var(--accent); color: var(--accent-ink); }
.fmt-pair .icon { width: 14px; height: 14px; stroke-width: 2.4; }
.tool-card-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.tool-card-title { margin: 0; font-size: 1.02rem; }
.tool-card-desc { color: var(--muted); font-size: 0.9rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tool-card-go { position: absolute; top: 20px; right: 16px; color: var(--line-strong); transition: color var(--t), transform var(--t); }
.tool-card:hover .tool-card-go { color: var(--accent); transform: translateX(2px); }
.tool-group + .tool-group { margin-top: 40px; }
.tool-group h2 { font-size: 1.2rem; }
.empty-state { text-align: center; padding: 48px 20px; border: 1px dashed var(--line-strong); border-radius: var(--r-lg); color: var(--muted); }
.empty-state > .icon { width: 36px; height: 36px; margin: 0 auto 10px; color: var(--muted); }
.empty-state h2 { font-size: 1.2rem; }

/* ---------- home ---------- */
.step-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 16px; list-style: none; padding: 0; margin: 20px 0 0; }
.step-cards li { padding: 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.step-cards p { margin: 0; color: var(--ink-2); }
.step-num { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 12px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 750; }
.benefits { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 24px 28px; list-style: none; padding: 0; margin: 22px 0 0; }
.benefits li { padding-top: 16px; border-top: 2px solid var(--ink); }
.benefits h3 { margin-bottom: 6px; }
.benefits p { margin: 0; color: var(--ink-2); font-size: 0.95rem; }

/* ---------- tool page ---------- */
.tool-hero { padding: clamp(22px, 3vw, 36px) 0 8px; }
.tool-head { display: flex; align-items: flex-start; gap: 16px; }
.tool-head h1 { margin-bottom: 6px; }
.tool-head .lead { margin: 0; }
.tool-icon { display: grid; place-items: center; width: 56px; height: 56px; flex: none; border-radius: var(--r-lg); background: var(--accent-soft); color: var(--accent); }
.tool-icon .icon { width: 28px; height: 28px; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; padding: 0; margin: 16px 0 0; color: var(--ink-2); font-size: 0.9rem; font-weight: 550; }
.trust li { display: inline-flex; align-items: center; gap: 6px; }
.trust .icon { width: 18px; height: 18px; color: var(--ok); }
@media (max-width: 599px) { .tool-icon { display: none; } }
.bench-section { padding: 16px 0 clamp(36px, 5vw, 56px); }
.workbench { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
@media (max-width: 899px) { .workbench { grid-template-columns: minmax(0, 1fr); } }
.bench-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.bench-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 84px; }
@media (max-width: 899px) { .bench-side { position: static; } }

.dropzone { position: relative; border: 2px dashed var(--accent-line); border-radius: var(--r-lg); background: var(--accent-soft); transition: border-color var(--t), background var(--t), box-shadow var(--t); }
.dropzone.is-over { border-color: var(--accent); border-style: solid; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.dropzone.is-compact .drop-label { flex-direction: row; flex-wrap: wrap; justify-content: center; padding: 16px; min-height: 0; gap: 8px 12px; }
.dropzone.is-compact .drop-icon, .dropzone.is-compact .drop-or { display: none; }
.dropzone.is-compact .drop-title { font-size: 1rem; }
.dropzone.is-compact .drop-hint { width: 100%; }
.file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 1; }
.file-input:focus-visible + .drop-label { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: var(--r-lg); }
.drop-label { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 240px; padding: 32px 20px; text-align: center; cursor: pointer; }
.drop-icon { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }
.drop-icon .icon { width: 28px; height: 28px; }
.drop-title { font-size: 1.2rem; font-weight: 700; color: var(--ink); }
.drop-or { color: var(--muted); font-size: 0.9rem; }
.drop-btn { pointer-events: none; }
.drop-hint { color: var(--muted); font-size: 0.88rem; }

.options, .queue, .favicon-out, .crop-stage { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.options { padding: 18px; display: flex; flex-direction: column; gap: 18px; }
.options-empty p { margin: 0; color: var(--ink-2); font-size: 0.93rem; }
.options-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1rem; }
.options-title .icon { color: var(--accent); width: 18px; height: 18px; }
.field { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.field legend, .field > label:first-child, .field-label { padding: 0; margin-bottom: 8px; font-weight: 650; font-size: 0.92rem; color: var(--ink); display: flex; justify-content: space-between; align-items: center; width: 100%; }
.field > label:first-child { margin-bottom: 0; flex-wrap: wrap; gap: 2px 8px; }
.legend-note { font-weight: 450; color: var(--muted); font-size: 0.85rem; }
.field output { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.field-note { margin: 0; color: var(--muted); font-size: 0.84rem; line-height: 1.45; }
.field-note:empty { display: none; }
.field-note.is-warn { color: var(--warn); }
.field[disabled] { opacity: 0.55; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); }
.seg-option { flex: 1 1 auto; position: relative; }
.seg-option input, .chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-option span { display: flex; align-items: center; justify-content: center; min-height: 36px; padding: 6px 10px; border-radius: 7px; font-weight: 600; font-size: 0.9rem; color: var(--ink-2); transition: background var(--t), color var(--t), box-shadow var(--t); text-align: center; }
.seg-option input:checked + span { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--accent-line); }
.seg-option input:focus-visible + span, .chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 1px; }
.seg-option input:disabled + span { opacity: 0.45; text-decoration: line-through; cursor: not-allowed; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; }
.chip span { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 0.88rem; font-weight: 600; color: var(--ink-2); background: var(--surface); transition: all var(--t); }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
input[type="range"] { width: 100%; accent-color: var(--accent); min-height: 28px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 0.92rem; color: var(--ink); cursor: pointer; min-height: 32px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.bg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.color-pick { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 0.85rem; color: var(--ink-2); cursor: pointer; }
.color-pick input { width: 40px; height: 34px; padding: 2px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; }
.color-pick.is-off { opacity: 0.45; }
.size-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.size-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 380px) { .size-grid.four { grid-template-columns: 1fr 1fr; } }
.size-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.unit-input { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); }
.unit-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.unit-input input { border: 0 !important; box-shadow: none !important; min-width: 0; }
.unit-input span { padding-right: 10px; color: var(--muted); font-size: 0.85rem; }
.options input[type="number"] { width: 100%; min-height: 40px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font: inherit; font-variant-numeric: tabular-nums; }
.options input[type="number"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.options input[aria-invalid="true"] { border-color: var(--err); }
.inline-input { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--muted); }
.inline-input input { max-width: 120px; }
.actions { display: flex; flex-direction: column; gap: 8px; }
.local-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; color: var(--muted); font-size: 0.85rem; }
.local-note .icon { width: 16px; height: 16px; color: var(--ok); }

/* queue */
.queue { overflow: hidden; }
.queue-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.queue-title { margin: 0; font-size: 1rem; }
.queue-count { color: var(--muted); font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.queue-list { list-style: none; margin: 0; padding: 0; }
.item { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.thumb { width: 56px; height: 56px; border-radius: var(--r-sm); overflow: hidden; background: var(--checker); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .icon { width: 26px; height: 26px; }
.item-main { min-width: 0; }
.item-name { margin: 0; font-weight: 650; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-meta, .item-result, .item-error, .item-stage { margin: 2px 0 0; font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.item-result { color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.item-result strong { color: var(--ink); }
.delta { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-weight: 700; font-size: 0.78rem; }
.delta.is-smaller { background: var(--ok-soft); color: var(--ok); }
.delta.is-larger { background: var(--warn-soft); color: var(--warn); }
.item-error { display: flex; gap: 6px; align-items: flex-start; color: var(--err); }
.item-error .icon, .item-warn .icon { width: 16px; height: 16px; margin-top: 2px; }
.item-warn { display: flex; gap: 6px; align-items: flex-start; margin: 4px 0 0; font-size: 0.84rem; color: var(--warn); }
.item-actions { display: flex; align-items: center; gap: 6px; }
.item-actions .icon-btn { width: 36px; height: 36px; }
.item-actions .icon-btn .icon { width: 18px; height: 18px; }
.bar { height: 4px; margin-top: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.bar span { display: block; height: 100%; width: 40%; border-radius: 4px; background: var(--accent); animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.item[data-state="error"] .thumb { border-color: var(--err); }
.item[data-state="done"] .thumb { border-color: var(--ok); }
@media (max-width: 520px) {
  .item { grid-template-columns: 44px minmax(0, 1fr); padding: 12px 14px; }
  .thumb { width: 44px; height: 44px; }
  .item-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

/* cropper */
.crop-stage { padding: 14px; }
.crop-area { position: relative; margin: 0 auto; touch-action: none; user-select: none; -webkit-user-select: none; background: var(--checker); }
.crop-area canvas { display: block; width: 100%; height: 100%; }
.crop-shade { position: absolute; inset: 0; pointer-events: none; }
.crop-clip { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.crop-window { position: absolute; box-shadow: 0 0 0 9999px rgb(10 15 30 / 0.55); }
.crop-frame { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.45); cursor: move; touch-action: none; }
.crop-frame:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.crop-frame::before, .crop-frame::after { content: ""; position: absolute; pointer-events: none; border-color: rgb(255 255 255 / 0.5); border-style: solid; }
.crop-frame::before { inset: 33.33% 0; border-width: 1px 0; }
.crop-frame::after { inset: 0 33.33%; border-width: 0 1px; }
.crop-handle { position: absolute; width: 24px; height: 24px; background: #fff; border: 2px solid var(--accent); border-radius: 50%; touch-action: none; }
.crop-handle[data-h="nw"] { left: -13px; top: -13px; cursor: nwse-resize; }
.crop-handle[data-h="ne"] { right: -13px; top: -13px; cursor: nesw-resize; }
.crop-handle[data-h="sw"] { left: -13px; bottom: -13px; cursor: nesw-resize; }
.crop-handle[data-h="se"] { right: -13px; bottom: -13px; cursor: nwse-resize; }
.crop-help { margin: 10px 0 0; color: var(--muted); font-size: 0.85rem; text-align: center; }

/* social presets */
.preset-list { display: grid; grid-template-columns: 1fr; gap: 6px; }
.preset { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; transition: border-color var(--t), background var(--t); }
.preset input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.preset:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.preset:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 1px; }
.preset-shape { flex: none; width: 34px; height: 34px; display: grid; place-items: center; }
.preset-shape::before { content: ""; display: block; border: 2px solid var(--accent); border-radius: 3px; width: var(--pw, 28px); height: var(--ph, 28px); }
.preset-text { display: flex; flex-direction: column; line-height: 1.3; font-size: 0.88rem; }
.preset-text b { font-weight: 650; color: var(--ink); }
.preset-text span { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.8rem; }

/* background colour preview */
.preview-stage { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pick-canvas, .compare-img { max-width: 100%; height: auto; border-radius: var(--r-sm); background: var(--checker); cursor: crosshair; }
.compare-img { cursor: default; }
.compare { width: auto; }

/* base64 */
.b64-decode, .b64-out { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.b64-decode label { font-weight: 650; font-size: 0.95rem; }
.b64-decode textarea, .b64-text { width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface-2); color: var(--ink); font: 0.8rem/1.5 var(--mono); resize: vertical; word-break: break-all; }
.b64-decode textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.b64-decode .btn { align-self: flex-start; }
.b64-out h2 { font-size: 1.05rem; margin: 0; }
.b64-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.b64-preview { max-width: 100%; max-height: 320px; width: auto; border-radius: var(--r-sm); background: var(--checker); border: 1px solid var(--line); }
[data-b64-image] { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }

/* password */
.pw-row { display: flex; align-items: center; gap: 6px; }
.pw-row input { flex: 1; min-width: 0; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font: inherit; }
.pw-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.icon-btn[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }

/* favicon results */
.favicon-out { padding: 18px; }
.favicon-out h2 { font-size: 1.05rem; }
.icon-previews { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; margin: 6px 0 16px; }
.icon-previews figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--muted); }
.icon-previews .tile { display: grid; place-items: center; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--checker); }
.icon-previews img { image-rendering: auto; }
.tab-preview { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 8px 14px; margin-bottom: 16px; border-radius: 10px 10px 0 0; background: var(--surface-2); border: 1px solid var(--line); border-bottom: 0; font-size: 0.85rem; color: var(--ink-2); }
.tab-preview img { width: 16px; height: 16px; }
.code-block { position: relative; margin: 10px 0 0; }
.code-block pre { margin: 0; padding: 14px 16px; overflow-x: auto; border-radius: var(--r); background: #0f1b3d; color: #e8edf8; font: 0.82rem/1.6 var(--mono); }
.code-block .btn { position: absolute; top: 8px; right: 8px; min-height: 32px; padding: 4px 10px; font-size: 0.8rem; background: #1d2b55; color: #e8edf8; border-color: #33456a; }
.code-block code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.favicon-out h3 { margin-top: 22px; }
.file-list { margin: 10px 0 0; padding-left: 1.2em; font-size: 0.9rem; color: var(--ink-2); }

/* notices and toasts */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); font-size: 0.92rem; margin: 0; border: 1px solid; }
.notice .icon { width: 18px; height: 18px; margin-top: 2px; }
.notice-error { background: var(--err-soft); border-color: color-mix(in srgb, var(--err) 35%, transparent); color: var(--err); }
.notice-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: var(--warn); }
.notice-info { background: var(--accent-soft); border-color: var(--accent-line); color: var(--ink-2); }
.toast-region { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: var(--r); background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); font-size: 0.92rem; pointer-events: auto; animation: toast-in 200ms ease-out; }
.toast .icon { width: 18px; height: 18px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- content ---------- */
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 18px; }
.steps li { counter-increment: s; position: relative; padding: 0 0 12px 44px; color: var(--ink-2); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 750; font-size: 0.9rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; margin: 0 0 22px; }
.facts div { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.facts dt { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; color: var(--muted); }
.facts dd { margin: 4px 0 0; font-weight: 600; color: var(--ink); font-size: 0.95rem; }
.ticks { list-style: none; padding: 0; margin: 0 0 18px; }
.ticks li { position: relative; padding: 0 0 8px 26px; color: var(--ink-2); }
.ticks li::before { content: ""; position: absolute; left: 4px; top: 0.55em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.privacy-line { display: flex; gap: 8px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); background: var(--ok-soft); color: var(--ink); font-size: 0.93rem; margin: 0; }
.privacy-line .icon { color: var(--ok); width: 20px; height: 20px; margin-top: 1px; }
.faq-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.faq-item { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; cursor: pointer; font-weight: 650; list-style: none; min-height: 48px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .icon { color: var(--accent); transition: transform var(--t); }
.faq-item[open] summary .icon { transform: rotate(45deg); }
.faq-answer { padding: 0 16px 14px; color: var(--ink-2); }
.faq-answer p { margin: 0; }
.prose section + section { margin-top: 32px; }
.prose h2 { font-size: 1.3rem; }
.prose ul { margin: 0 0 1em; }
.prose li { margin-bottom: 6px; }
.link-list { columns: 2 220px; list-style: none; padding: 0; margin: 12px 0 0; }
.link-list li { margin-bottom: 8px; }
.toc { margin-top: 18px; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.toc ol { margin: 0; columns: 2 240px; }
.toc li { margin: 3px 0; }
.howto-section + .howto-section { margin-top: 56px; }
.howto-section h2 { display: flex; align-items: center; gap: 12px; }
.howto-num { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 1rem; }
.howto-shot { margin: 18px 0 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.howto-shot img { width: 100%; }
.howto-shot figcaption { padding: 14px 18px; border-top: 1px solid var(--line); }
.callout-key { margin: 0; padding: 0; list-style: none; counter-reset: c; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 8px 18px; }
.callout-key li { counter-increment: c; display: flex; gap: 8px; align-items: flex-start; font-size: 0.9rem; color: var(--ink-2); }
.callout-key li::before { content: counter(c); display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 50%; background: #b3261e; color: #fff; font-weight: 750; font-size: 0.78rem; }
.shot-missing { padding: 40px; text-align: center; color: var(--muted); }
.trouble div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.trouble dt { font-weight: 650; }
.trouble dd { margin: 4px 0 0; color: var(--ink-2); }
.not-found .lead { margin-bottom: 0; }

/* consent bar (only rendered when analytics or ads are configured) */
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 95; max-width: 640px; margin: 0 auto; padding: 18px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
.consent p { margin: 0 0 12px; font-size: 0.92rem; color: var(--ink-2); }
.consent-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- footer ---------- */
.site-footer { margin-top: 0; padding: 48px 0 28px; background: var(--bg-alt); border-top: 1px solid var(--line); font-size: 0.93rem; }
.footer-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 28px; }
.footer-brand { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.footer-brand p { margin: 0; }
@media (max-width: 899px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 380px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand p { color: var(--muted); max-width: 60ch; }
.site-footer h2 { font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer li a { color: var(--ink-2); text-decoration: none; }
.site-footer li a:hover { color: var(--accent); text-decoration: underline; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.88rem; }
.footer-dev a { color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .bar span { width: 100%; animation: none; opacity: 0.6; }
}
@media print {
  .site-header, .site-footer, .workbench, .bench-section, .toast-region, .consent { display: none !important; }
}

/* PDF tools: option controls */
.options input[type="text"], .options .field > input[type="password"] { width: 100%; min-height: 40px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font: inherit; }
.options input[type="text"]:focus, .options .field > input[type="password"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-sub { display: flex; flex-direction: column; gap: 6px; }
.field-sub label, .field-sub-label { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; }
.icon.flip { transform: scaleX(-1); }
.level-list { display: grid; gap: 6px; }
.level { position: relative; display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; transition: border-color var(--t), background var(--t); }
.level input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.level > span { display: flex; flex-direction: column; gap: 2px; font-size: 0.85rem; color: var(--muted); line-height: 1.4; }
.level b { color: var(--ink); font-size: 0.92rem; font-weight: 650; }
.level:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.level:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 1px; }

/* PDF page grid */
.page-grid-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 16px; }
.page-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 14px; }
@media (max-width: 420px) { .page-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.page-tile { display: flex; flex-direction: column; gap: 6px; border-radius: var(--r); transition: opacity var(--t), transform var(--t); }
.page-face { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 3 / 4; padding: 8px; border: 2px solid var(--line); border-radius: var(--r); background: var(--surface-2); color: inherit; font: inherit; cursor: default; overflow: hidden; }
button.page-face { cursor: pointer; }
button.page-face:hover { border-color: var(--accent-line); }
.page-face:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.page-pic { display: grid; place-items: center; width: 100%; height: 100%; transform: rotate(var(--turn, 0deg)); transition: transform var(--t); }
.page-tile.is-turned .page-pic { transform: rotate(var(--turn, 0deg)) scale(0.75); }
.page-pic img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; background: #fff; box-shadow: var(--shadow-sm); }
.page-tile:not(.is-drawn) .page-pic img { width: 70%; aspect-ratio: 3 / 4; }
.page-tile.is-wide:not(.is-drawn) .page-pic img { aspect-ratio: 4 / 3; }
.page-num { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); min-width: 24px; padding: 1px 8px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 0.75rem; font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; }
.page-mark { position: absolute; top: 6px; right: 6px; display: none; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
.page-mark .icon { width: 16px; height: 16px; }
.page-tile.is-selected .page-face { border-color: var(--accent); background: var(--accent-soft); }
.page-tile.is-selected .page-mark { display: grid; }
.page-grid-wrap[data-pick-mode="remove"] .page-tile.is-selected .page-face { border-color: var(--err); background: var(--err-soft); }
.page-grid-wrap[data-pick-mode="remove"] .page-tile.is-selected .page-mark { background: var(--err); color: #fff; }
.page-grid-wrap[data-pick-mode="remove"] .page-tile.is-selected .page-pic { opacity: 0.45; }
.page-tile.is-removed .page-face { border-style: dashed; border-color: var(--err); background: var(--err-soft); }
.page-tile.is-removed .page-pic { opacity: 0.35; }
.page-tile.is-dragging { opacity: 0.4; }
.page-tile.is-drop .page-face { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mode-organize .page-tile { cursor: grab; }
.page-tools { display: flex; justify-content: center; gap: 2px; }
.page-tools .icon-btn { width: 34px; height: 34px; }
.page-tools .icon-btn .icon { width: 18px; height: 18px; }
.page-tools .icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* PDF results shown outside the list */
.combined-out { background: var(--surface); border: 1px solid var(--ok); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 18px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.combined-out h2 { margin: 0; font-size: 1.05rem; }
.text-out .b64-text { word-break: normal; overflow-wrap: anywhere; white-space: pre-wrap; font-size: 0.85rem; }
@media (prefers-reduced-motion: reduce) { .page-pic, .page-tile { transition: none; } }
