/* =========================================================================
 * DjVu to WebP Converter — styles.
 * Redesigned 15 Nov 2026: professional, clean, single steel-blue identity
 * (#1d4e89). No gradients on buttons, headline, brand mark or dropzone;
 * pink #ec4899 is kept only as the --brand-2 token (no rule uses it).
 * All motion disabled under prefers-reduced-motion.
 * NOTE: rules use LITERAL colour values, not var() — a review browser
 * dropped every var(--*) declaration, so no critical visual may depend
 * on a custom property. The :root tokens below document the palette and
 * satisfy the accent-uniqueness test; no rule reads them.
 * Accent: --brand #1d4e89 (deep steel blue), --brand-2 #ec4899 (vivid pink)
 * — verified unused as --brand / --brand-2 by every other tool (accent
 * scan in tests/page.test.mjs covers all src/static/tools/*/styles.css
 * plus staging, own slug excluded).
 * ========================================================================= */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --ink: #141a2e;
  --ink-soft: #4b5573;
  --ink-faint: #8a93ad;
  --line: #e2e7f2;
  --brand: #1d4e89;
  --brand-2: #ec4899;
  --brand-soft: #e8eef7;
  --ok: #0f9d58;
  --ok-soft: #e5f6ec;
  --warn: #b45309;
  --warn-soft: #fef3e2;
  --err: #dc2626;
  --err-soft: #fdecea;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(20, 26, 46, 0.08);
  --shadow-lg: 0 18px 50px rgba(29, 78, 137, 0.16);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  background: #f6f7fb;
  color: #141a2e;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: #141a2e; color: #fff; padding: 10px 16px; border-radius: 10px;
  text-decoration: none; font-weight: 700; transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

/* ---------------- header ----------------
   Solid white: the old translucent header let scrolling text ghost
   through it. */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: #ffffff;
  border-bottom: 1px solid #e2e7f2;
  box-shadow: 0 1px 10px rgba(20, 26, 46, 0.06);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #141a2e; font-weight: 800; font-size: 1.05rem; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: #1d4e89;
  box-shadow: 0 10px 30px rgba(20, 26, 46, 0.08);
}
.brand-mark svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2; }
.nav { display: flex; gap: 4px; }
.nav a {
  color: #4b5573; text-decoration: none; font-weight: 600; font-size: 0.92rem;
  padding: 8px 12px; border-radius: 10px; transition: background 0.18s, color 0.18s;
}
.nav a:hover, .nav a:focus-visible { background: #eef1f8; color: #141a2e; outline: none; }

/* ---------------- hero ----------------
   Compact by design: one line of headline + one line of promise, so the
   converter itself — dropzone + settings — is on the first screen.
   Headline accent is solid steel blue (the old gradient text faded to
   near-invisible pink). Four short pills, one row at desktop. */
.hero {
  padding: 26px 0 10px;
  background:
    radial-gradient(600px 300px at 15% 0%, rgba(29, 78, 137, 0.08), transparent 60%);
}
.hero h1 {
  font-size: clamp(1.65rem, 3.4vw, 2.25rem);
  line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 6px; max-width: none;
}
.hero h1 .grad { color: #1d4e89; }
.lede { font-size: 1rem; color: #4b5573; max-width: none; margin: 0 0 12px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.trust-row li {
  display: inline-flex; align-items: center; gap: 7px;
  background: #ffffff; border: 1px solid #cdd5e4; border-radius: 999px;
  padding: 5px 11px; font-size: 0.82rem; font-weight: 600; color: #3d4763;
  box-shadow: 0 2px 8px rgba(20, 26, 46, 0.05);
}
.trust-row .dot { width: 7px; height: 7px; border-radius: 50%; background: #0f9d58; box-shadow: 0 0 0 3px #e5f6ec; }

/* ---------------- tool card ----------------
   Two columns on desktop: the action (dropzone + results) on the left,
   settings on the right — so the dropzone is visible without scrolling.
   Single column on mobile, action first, settings after. */
.tool-section { padding: 8px 0 32px; }
.tool-card {
  background: #ffffff; border: 1px solid #e2e7f2;
  border-radius: 22px; box-shadow: 0 18px 50px rgba(29, 78, 137, 0.16);
  padding: clamp(18px, 3vw, 28px);
}
.tool-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 24px; align-items: start; }
.tool-main { min-width: 0; }
.tool-side { min-width: 0; }
.tool-side .settings {
  background: #e8eef7; border: 1px solid #e2e7f2; border-radius: 16px;
  padding: 16px 18px;
}
.step-title { font-weight: 800; margin: 0 0 10px; font-size: 1rem; }

/* ---------------- settings — WebP output controls only ----------------
   Controls only (range, DPI, quality, lossless). The old ~7 explanatory
   paragraphs moved into the Guide's "Honest limitations" area, where the
   same points were already made — the panel is now compact and ends
   roughly where the file area ends. */
.settings { border: 0; margin: 0 0 4px; padding: 0; }
.settings-title { font-weight: 800; font-size: 1rem; margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid #dbe2ef; }
.webp-controls { display: grid; gap: 14px; }
.webp-controls .ctl-row + .ctl-row { border-top: 1px solid #dbe2ef; padding-top: 14px; }
.ctl-row { display: grid; gap: 6px; }
.ctl-row label { font-weight: 700; font-size: 0.92rem; }
.ctl-row .ctl-label { font-weight: 700; font-size: 0.92rem; }
.ctl-row .ctl-hint { font-size: 0.84rem; color: #8a93ad; font-weight: 400; }

/* Pages to convert: ONE compact row per option — radio + name + description
   together, radio aligned with the first line. */
.range-seg { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.range-seg label {
  display: flex; align-items: flex-start; gap: 9px;
  background: #ffffff; border: 1.5px solid #e2e7f2; border-radius: 12px;
  padding: 10px 12px; cursor: pointer; font-size: 0.92rem; min-width: 0;
}
.range-seg label:has(input:checked) { border-color: #1d4e89; background: #e8eef7; }
.range-seg input { flex: none; margin: 3px 0 0; accent-color: #1d4e89; }
.range-text { min-width: 0; }
.range-name { font-weight: 800; }
.range-desc { color: #4b5573; font-size: 0.85rem; }
.range-inputs { display: grid; gap: 8px; margin-top: 8px; }
.range-inputs input[type="text"], .range-inputs input[type="number"] {
  font: inherit; padding: 9px 11px; border: 1.5px solid #e2e7f2;
  border-radius: 10px; background: #ffffff; color: #141a2e; width: 100%; min-width: 0;
}
.range-inputs input:focus { outline: 3px solid rgba(29, 78, 137, 0.35); outline-offset: 2px; border-color: #1d4e89; }

/* DPI: keep the 3-column segmented look — it works. */
.dpi-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dpi-seg label {
  display: block; background: #ffffff; border: 1.5px solid #e2e7f2; border-radius: 12px;
  padding: 10px 8px; cursor: pointer; font-size: 0.92rem; text-align: center; min-width: 0;
}
.dpi-seg label:has(input:checked) { border-color: #1d4e89; background: #e8eef7; }
.dpi-seg input { accent-color: #1d4e89; margin-right: 4px; }
.dpi-seg .dpi-name { font-weight: 800; display: block; }
.dpi-seg .dpi-desc { color: #4b5573; font-size: 0.8rem; display: block; margin-top: 2px; }

/* Quality slider + Lossless checkbox. The checkbox aligns with the first
   line of its label; the short hint stays inline. */
.slider-row { display: flex; align-items: center; gap: 12px; }
.slider-row input[type="range"] { flex: 1; min-width: 0; accent-color: #1d4e89; }
.slider-val { font-weight: 800; color: #1d4e89; min-width: 3ch; text-align: right; }
.bg-row { display: flex; align-items: flex-start; gap: 10px; }
.bg-row input[type="checkbox"] {
  flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: #1d4e89;
}
.bg-row label { flex: 1; min-width: 0; }
.lossless-note { font-size: 0.84rem; color: #8a93ad; margin: 6px 0 0; }

/* ---------------- dropzone ---------------- */
.dropzone {
  border: 2px dashed #8fa3c4; border-radius: 16px;
  padding: 34px 20px; text-align: center; cursor: pointer;
  background: #f2f6fb;
  transition: border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.dropzone:hover, .dropzone:focus-visible { border-color: #1d4e89; outline: none; box-shadow: 0 10px 30px rgba(20, 26, 46, 0.08); }

/* What happens next: fills the left column in the empty state so the
   two columns stay balanced; a useful reference once files are added. */
.next-steps {
  margin-top: 18px; background: #ffffff; border: 1.5px solid #dbe2ec;
  border-radius: 16px; padding: 16px 18px;
}
.next-steps h3 { font-size: 1rem; margin: 0 0 10px; color: #141a2e; }
.next-steps ol {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 10px; counter-reset: step;
}
.next-steps ol > li {
  counter-increment: step; position: relative; padding-left: 38px;
  margin: 0; font-size: 0.95rem; color: #4b5573; line-height: 1.45;
}
.next-steps ol > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0; width: 26px; height: 26px;
  border-radius: 50%; background: #1d4e89; color: #fff;
  font-weight: 800; font-size: 0.85rem; display: grid; place-items: center;
}
.next-steps ol > li strong { color: #141a2e; }
.dropzone.drag {
  border-color: #1d4e89; background: #e8eef7;
  transform: scale(1.01); box-shadow: 0 18px 50px rgba(29, 78, 137, 0.16);
  animation: dz-pulse 1.1s ease-in-out infinite;
}
@keyframes dz-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(29, 78, 137, 0.22); }
  50% { box-shadow: 0 0 0 12px rgba(29, 78, 137, 0.0); }
}
.dz-icon { width: 52px; height: 52px; margin: 0 auto 8px; border-radius: 14px; display: grid; place-items: center; background: #1d4e89; }
.dz-icon svg { width: 28px; height: 28px; stroke: #fff; stroke-width: 2; fill: none; }
.dz-title { font-weight: 800; font-size: 1.08rem; margin: 0 0 4px; color: #141a2e; }
.dz-sub { color: #4b5573; margin: 0 0 16px; font-size: 0.92rem; }
.decoder-state { font-size: 0.85rem; color: #8a93ad; margin: 10px 2px 0; }

/* Encoder status: a proper status pill with a small spinner while the
   encoder loads. app.js replaces the element's textContent when the
   encoder is ready (or falls back), which also removes the spinner span
   — so the spinner only ever shows in the loading state. The .error
   class is added by app.js in the canvas-fallback case. */
.encoder-state {
  display: inline-flex; align-items: center; gap: 8px;
  background: #eef1f8; border: 1px solid #e2e7f2; border-radius: 999px;
  padding: 6px 12px; color: #4b5573; font-weight: 600; margin: 10px 2px 0;
}
.encoder-state.error { background: #fef3e2; border-color: #efd9ae; color: #b45309; }
.enc-spinner {
  width: 14px; height: 14px; flex: none; border-radius: 50%;
  border: 2px solid #c8d6e8; border-top-color: #1d4e89;
  animation: spin 0.8s linear infinite;
}

/* ---------------- buttons ----------------
   Solid steel blue. Disabled primary is a solid muted grey with white
   text — clearly visible, not a washed-out opacity. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 12px; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 0.92rem; text-decoration: none;
  padding: 10px 18px; transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn-primary { background: #1d4e89; color: #fff; box-shadow: 0 6px 18px rgba(29, 78, 137, 0.35); }
.btn-primary:hover:not(:disabled) { background: #163d6b; transform: translateY(-1px); }
.btn-primary:disabled { background: #94a3b8; color: #ffffff; box-shadow: none; opacity: 1; cursor: not-allowed; }
.btn-ghost { background: #ffffff; border-color: #e2e7f2; color: #141a2e; }
.btn-ghost:hover:not(:disabled) { background: #eef1f8; }
.btn-ghost:disabled { background: #f1f5f9; color: #94a3b8; border-color: #e2e7f2; opacity: 1; cursor: not-allowed; }
.btn-small { padding: 7px 13px; font-size: 0.85rem; border-radius: 10px; }
.btn:focus-visible { outline: 3px solid rgba(29, 78, 137, 0.4); outline-offset: 2px; }

/* ---------------- file cards ---------------- */
.file-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.file-card {
  border: 1px solid #e2e7f2; border-radius: 16px;
  padding: 14px 16px; background: #ffffff;
  animation: card-in 0.35s ease both;
}
.file-card:nth-child(2) { animation-delay: 0.05s; }
.file-card:nth-child(3) { animation-delay: 0.1s; }
.file-card:nth-child(4) { animation-delay: 0.15s; }
@keyframes card-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.file-card[data-status="done"] { border-color: #a3d9b1; background: #f0f9f3; }
.file-card[data-status="error"] { border-color: #efc1c1; background: #fdf5f5; }
.fc-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.fc-name { font-weight: 700; overflow-wrap: anywhere; }
.fc-size { color: #8a93ad; font-size: 0.85rem; white-space: nowrap; }
.fc-wait { color: #8a93ad; font-size: 0.9rem; margin: 8px 0 0; }
.fc-error { color: #dc2626; font-size: 0.92rem; margin: 8px 0 0; }
.fc-warn {
  background: #fef3e2; color: #b45309; border-radius: 10px;
  font-size: 0.86rem; padding: 8px 11px; margin: 10px 0 0;
}
.fc-info {
  background: #e8eef7; color: #1d4e89; border-radius: 10px;
  font-size: 0.86rem; padding: 8px 11px; margin: 10px 0 0; font-weight: 600;
}
.fc-progress { display: flex; align-items: center; gap: 10px; margin-top: 10px; color: #4b5573; font-weight: 600; font-size: 0.92rem; }
.fc-spinner {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 3px solid #e8eef7; border-top-color: #1d4e89;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.fc-result { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.check {
  width: 26px; height: 26px; border-radius: 50%; background: #0f9d58; color: #fff;
  display: inline-grid; place-items: center; font-weight: 800; font-size: 0.9rem; flex: none;
  animation: check-pop 0.35s ease both;
}
@keyframes check-pop {
  from { transform: scale(0.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.fc-dims { color: #4b5573; font-size: 0.9rem; }
.fc-after { font-weight: 800; }
.fc-pct { font-weight: 800; font-size: 0.9rem; color: #1d4e89; }
.fc-bar { height: 8px; border-radius: 99px; background: #eef1f8; margin-top: 10px; overflow: hidden; position: relative; }
.fc-bar-before { position: absolute; inset: 0; background: #dfe3ef; border-radius: 99px; }
.fc-bar-after {
  position: absolute; inset: 0 auto 0 0; width: var(--w, 100%); border-radius: 99px;
  background: #1d4e89;
  animation: bar-grow 0.6s ease both;
}
@keyframes bar-grow { from { width: 0; } }
.fc-note { font-size: 0.86rem; color: #4b5573; margin: 8px 0 0; }
.fc-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* per-page thumbnails: flexible grid, never wider than the card */
.page-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px; margin-top: 12px;
}
.pg-thumb {
  margin: 0; min-width: 0; border: 1px solid #e2e7f2; border-radius: 12px;
  overflow: hidden; background: #fff; display: flex; flex-direction: column;
}
.pg-thumb img { width: 100%; height: 140px; object-fit: contain; display: block; background: #fff; cursor: zoom-in; }
.pg-thumb img:focus-visible { outline: 3px solid rgba(29, 78, 137, 0.45); outline-offset: -3px; }
.pg-cap {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 6px 8px; border-top: 1px solid #e2e7f2; background: rgba(255, 255, 255, 0.92);
  font-size: 0.78rem; font-weight: 700; color: #4b5573; min-width: 0;
}
.pg-cap .pg-name { overflow-wrap: anywhere; min-width: 0; }
.pg-cap .pg-dl { color: #1d4e89; text-decoration: none; white-space: nowrap; }
.pg-cap .pg-dl:hover { color: #163d6b; }
.pg-more {
  display: grid; place-items: center; min-height: 140px; color: #8a93ad;
  font-size: 0.85rem; font-weight: 700; text-align: center; padding: 10px;
  border: 1px dashed #e2e7f2; border-radius: 12px;
}

/* ---------------- lightbox (click a preview to view full size) ---------------- */
.lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.lightbox[hidden] { display: none; }
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(10, 12, 24, 0.82); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.lightbox-panel {
  position: relative; margin: 0; max-width: min(92vw, 1100px); max-height: 88vh;
  display: flex; flex-direction: column; align-items: center;
  animation: card-in 0.25s ease both;
}
.lightbox-panel img {
  max-width: 100%; max-height: calc(88vh - 64px); width: auto; height: auto;
  object-fit: contain; border-radius: 12px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  background-color: #fff;
}
.lightbox-cap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 16px;
  margin-top: 14px; color: #e8eef7; font-size: 0.9rem; text-align: center;
}
.lightbox-name { font-weight: 800; color: #fff; overflow-wrap: anywhere; }
.lightbox-meta { color: #b9c8e8; }
.lightbox-close {
  position: absolute; top: -14px; right: -14px; width: 44px; height: 44px;
  border-radius: 50%; border: 0; cursor: pointer; z-index: 2;
  background: #fff; color: #141a2e; font-size: 1.5rem; line-height: 1;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.lightbox-close:hover { background: #eef1f8; }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; z-index: 2;
  background: rgba(255, 255, 255, 0.92); color: #141a2e;
  font-size: 1.7rem; line-height: 1; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.lightbox-nav:hover { background: #fff; }
.lightbox-nav[hidden] { display: none; }
.lightbox-prev { left: -8px; }
.lightbox-next { right: -8px; }
.lightbox-close:focus-visible, .lightbox-nav:focus-visible { outline: 3px solid rgba(29, 78, 137, 0.6); outline-offset: 2px; }

/* batch bar */
.batch-bar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  border-top: 1px solid #e2e7f2; margin-top: 18px; padding-top: 16px;
}
.bb-text { font-weight: 700; }
.bb-text small { display: block; font-weight: 400; color: #8a93ad; font-size: 0.84rem; }
.bb-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- privacy ---------------- */
.privacy { padding: 8px 0 44px; }
.privacy-card {
  background: linear-gradient(135deg, #0e2a4a, #1d4e89);
  color: #e8eef7; border-radius: 22px; padding: clamp(22px, 3vw, 36px);
  box-shadow: 0 18px 50px rgba(29, 78, 137, 0.16);
}
.privacy-card h2 { color: #fff; margin: 0 0 10px; font-size: 1.4rem; }
.privacy-card p { margin: 0 0 16px; max-width: 68ch; }
.net-meter {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px; padding: 9px 16px; font-weight: 700; color: #fff;
}
.net-meter b { font-size: 1.15rem; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: #34d399; animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
  50% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
}
.verify-steps { margin: 16px 0 0; padding-left: 20px; }
.verify-steps li { margin: 6px 0; }
kbd {
  background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px; padding: 1px 7px; font: inherit; font-size: 0.85em;
}
.tool-card kbd, .content kbd {
  background: #eef1f8; border-color: #e2e7f2; color: #141a2e;
}

/* ---------------- content / guide ----------------
   Readable line length (~68ch) and numbered steps with a visual
   treatment instead of a plain list. */
.content { padding: 16px 0 40px; }
.content h2 { font-size: 1.5rem; letter-spacing: -0.01em; margin: 0 0 12px; }
.content h3 { font-size: 1.08rem; margin: 22px 0 8px; }
.content p, .content li { color: #4b5573; }
.content > .wrap > p { max-width: 68ch; }
.content ul { padding-left: 22px; }
.content li { margin: 6px 0; }
.content > .wrap > ol {
  list-style: none; padding: 0; margin: 0 0 4px;
  display: grid; gap: 14px; counter-reset: step;
}
.content > .wrap > ol > li {
  counter-increment: step; position: relative; padding-left: 46px;
  margin: 0; max-width: 68ch;
}
.content > .wrap > ol > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 1px; width: 30px; height: 30px;
  border-radius: 50%; background: #1d4e89; color: #fff;
  font-weight: 800; font-size: 0.9rem; display: grid; place-items: center;
}
/* Honest limitations: balanced 3-column grid (the old 4-column grid left
   the second row half-empty). */
.prose-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.prose-card { background: #ffffff; border: 1px solid #e2e7f2; border-radius: 16px; padding: 16px 18px; }
.prose-card h3 { margin: 0 0 6px; }
.prose-card p { margin: 0; font-size: 0.93rem; }

/* ---------------- FAQ ----------------
   Real cards with borders and modest gaps. */
.faq details {
  background: #ffffff; border: 1px solid #e2e7f2; border-radius: 14px;
  padding: 14px 18px; margin: 10px 0;
}
.faq summary { font-weight: 700; cursor: pointer; }
.faq summary:focus-visible { outline: 3px solid rgba(29, 78, 137, 0.35); outline-offset: 2px; border-radius: 6px; }
.faq details p { margin: 10px 0 2px; }

/* ---------------- footer ----------------
   Light background, grouped related links (by family) instead of one
   wall of ~21 links. */
.site-footer { background: #eef1f8; border-top: 1px solid #e2e7f2; padding: 22px 0 28px; color: #8a93ad; font-size: 0.85rem; }
.site-footer .wrap { display: grid; gap: 10px; }
.site-footer p { margin: 0; }
.site-footer .footer-note { color: #8a93ad; }
.site-footer .footer-group { font-weight: 800; color: #141a2e; }
.site-footer .footer-links { line-height: 1.9; }
.site-footer a { color: #4b5573; font-weight: 600; }
.site-footer a:hover { color: #1d4e89; }

/* ---------------- responsive ---------------- */
@media (max-width: 860px) {
  .tool-layout { grid-template-columns: 1fr; }
  .tool-side .settings { padding: 14px 16px; }
  .prose-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .nav { display: none; }
  .hero { padding: 20px 0 8px; }
  .batch-bar { flex-direction: column; align-items: stretch; }
  .bb-actions { display: grid; grid-template-columns: 1fr; }
  .bb-actions .btn { width: 100%; }
  .fc-head { flex-direction: column; gap: 2px; }
  .page-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .prose-grid { grid-template-columns: minmax(0, 1fr); }
  .lightbox { padding: 12px; }
  .lightbox-prev { left: 2px; }
  .lightbox-next { right: 2px; }
  .lightbox-close { top: -10px; right: 0; }
}

/* reduced motion: kill every animation */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
