/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #f6f7f9;
  --bg-elevated: #ffffff;
  --bg-subtle: #eef0f4;
  --text: #14161a;
  --text-muted: #5a6070;
  --text-faint: #8a8f9c;
  --border: #e1e4ea;
  --border-strong: #cdd2dc;
  --accent: #2f5fff;
  --accent-hover: #2148d1;
  --accent-ink: #ffffff;
  --accent-soft: #eaefff;
  --success: #16a34a;
  --success-soft: #e8f8ee;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --warning: #b45309;
  --warning-soft: #fef3e0;
  --shadow-sm: 0 1px 2px rgba(20, 22, 26, .06);
  --shadow-md: 0 6px 20px rgba(20, 22, 26, .08);
  --shadow-lg: 0 16px 40px rgba(20, 22, 26, .14);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --container: 1180px;
}

[data-theme="dark"], :root:not([data-theme="light"]) {
  @media (prefers-color-scheme: dark) {
    --bg: #0e0f13;
    --bg-elevated: #171921;
    --bg-subtle: #1d1f29;
    --text: #f1f2f5;
    --text-muted: #a6acbb;
    --text-faint: #6d7284;
    --border: #2a2d3a;
    --border-strong: #3a3e4e;
    --accent: #6d8aff;
    --accent-hover: #8aa1ff;
    --accent-ink: #0e0f13;
    --accent-soft: #1c2340;
    --success: #34d17c;
    --success-soft: #12281c;
    --danger: #f87171;
    --danger-soft: #2c1618;
    --warning: #f0b34f;
    --warning-soft: #2c2211;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, .45);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, .55);
  }
}
:root[data-theme="dark"] {
  --bg: #0e0f13;
  --bg-elevated: #171921;
  --bg-subtle: #1d1f29;
  --text: #f1f2f5;
  --text-muted: #a6acbb;
  --text-faint: #6d7284;
  --border: #2a2d3a;
  --border-strong: #3a3e4e;
  --accent: #6d8aff;
  --accent-hover: #8aa1ff;
  --accent-ink: #0e0f13;
  --accent-soft: #1c2340;
  --success: #34d17c;
  --success-soft: #12281c;
  --danger: #f87171;
  --danger-soft: #2c1618;
  --warning: #f0b34f;
  --warning-soft: #2c2211;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, .45);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, .55);
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.15; letter-spacing: -0.01em; font-weight: 700; }
ul, ol { padding-left: 1.2em; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--accent); color: var(--accent-ink);
  z-index: 9999; border-radius: 8px; font-weight: 600;
  transition: top .2s var(--ease-out);
}
.skip-link:focus { top: 1rem; }
.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;
}

/* =============================================================
   3. Utilities
   ============================================================= */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 1.25rem; }
.container--narrow { max-width: 820px; }
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section--tight { padding-block: clamp(1.5rem, 4vw, 2.5rem); }
.eyebrow {
  display: inline-flex; align-items: center; gap: .4em;
  font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent);
}
.center { text-align: center; }
.stack { display: flex; flex-direction: column; }
.icon { width: 1em; height: 1em; flex-shrink: 0; }

/* =============================================================
   4. Typography
   ============================================================= */
h1 { font-size: clamp(1.9rem, 4.4vw, 2.9rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); }
.lede { font-size: clamp(1.02rem, 1.6vw, 1.18rem); color: var(--text-muted); }
.prose { color: var(--text-muted); max-width: 74ch; }
.prose + .prose { margin-top: 1rem; }

/* =============================================================
   5. Components
   ============================================================= */

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .8rem 1.4rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .96rem;
  transition: transform .18s var(--ease-out), background .18s var(--ease-out), box-shadow .18s var(--ease-out), border-color .18s var(--ease-out);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-hover); box-shadow: var(--shadow-md); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-secondary { background: var(--bg-elevated); color: var(--text); border: 1px solid var(--border-strong); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { color: var(--text-muted); padding-inline: .6rem; }
.btn-ghost:hover { color: var(--text); }
.btn-lg { padding: 1rem 1.8rem; font-size: 1.05rem; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }
.btn-danger-outline { border: 1px solid var(--danger); color: var(--danger); background: var(--danger-soft); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header__row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 68px; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; }
.brand__mark {
  width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; flex-shrink: 0;
}
.brand__mark svg { width: 18px; height: 18px; }
.main-nav { display: none; align-items: center; gap: 1.6rem; }
.main-nav a { font-weight: 600; font-size: .95rem; color: var(--text-muted); transition: color .15s; }
.main-nav a:hover { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: .6rem; }
.nav-toggle {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
}
@media (min-width: 960px) {
  .main-nav { display: flex; }
  .nav-toggle { display: none; }
}
.mobile-nav {
  display: none; flex-direction: column; gap: .1rem; padding: .5rem 0 1rem;
  border-top: 1px solid var(--border);
}
.mobile-nav.is-open { display: flex; }
.mobile-nav a { padding: .7rem .2rem; font-weight: 600; border-bottom: 1px solid var(--border); }
@media (min-width: 960px) { .mobile-nav { display: none !important; } }

/* Hero */
.hero { padding-block: clamp(2.2rem, 5vw, 3.5rem) clamp(1.5rem, 4vw, 2rem); }
.hero__badges { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.1rem; }
.pill {
  display: inline-flex; align-items: center; gap: .4em;
  font-size: .82rem; font-weight: 600; color: var(--text-muted);
  background: var(--bg-subtle); border: 1px solid var(--border);
  padding: .38rem .75rem; border-radius: 999px;
}
.pill svg { width: 14px; height: 14px; color: var(--success); }

/* Tool grid (homepage) */
.tool-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem; margin-top: 1.75rem;
}
.tool-tile {
  display: flex; flex-direction: column; gap: .6rem;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 1.15rem; transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out), border-color .18s var(--ease-out);
}
.tool-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.tool-tile__icon {
  width: 42px; height: 42px; border-radius: 10px; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
}
.tool-tile__icon svg { width: 22px; height: 22px; }
.tool-tile h3 { font-size: 1.02rem; }
.tool-tile p { font-size: .88rem; color: var(--text-muted); flex-grow: 1; }
.tool-tile__cat { font-size: .72rem; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; }

.category-filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }
.category-filters button {
  padding: .5rem .95rem; border-radius: 999px; font-weight: 600; font-size: .86rem;
  border: 1px solid var(--border-strong); color: var(--text-muted); background: var(--bg-elevated);
  transition: all .15s;
}
.category-filters button.is-active, .category-filters button:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* Tool card (the working tool) */
.tool-card {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: clamp(1.1rem, 3vw, 1.75rem); box-shadow: var(--shadow-sm);
}
.tool-card__head { display: flex; align-items: flex-start; gap: .9rem; margin-bottom: 1.1rem; }
.tool-card__head .tool-tile__icon { width: 44px; height: 44px; }
.tool-card__head h1 { margin: 0; }

.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .6rem; text-align: center; padding: clamp(1.6rem, 5vw, 2.6rem) 1rem;
  border: 2px dashed var(--border-strong); border-radius: var(--radius-md);
  background: var(--bg-subtle); cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone svg { width: 34px; height: 34px; color: var(--accent); }
.dropzone strong { font-size: 1rem; }
.dropzone span { font-size: .85rem; color: var(--text-muted); }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.file-list { display: flex; flex-direction: column; gap: .55rem; margin-top: 1rem; }
.file-row {
  display: flex; align-items: center; gap: .7rem; padding: .65rem .8rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elevated);
}
.file-row.is-dragging { opacity: .4; }
.file-row__handle { color: var(--text-faint); cursor: grab; touch-action: none; }
.file-row__handle svg { width: 16px; height: 16px; }
.file-row__thumb {
  width: 36px; height: 36px; border-radius: 6px; background: var(--bg-subtle); flex-shrink: 0;
  display: grid; place-items: center; overflow: hidden; color: var(--text-faint);
}
.file-row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-row__thumb svg { width: 18px; height: 18px; }
.file-row__meta { flex-grow: 1; min-width: 0; }
.file-row__name { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row__size { font-size: .78rem; color: var(--text-faint); }
.file-row__remove { color: var(--text-faint); padding: .3rem; border-radius: 6px; }
.file-row__remove:hover { color: var(--danger); background: var(--danger-soft); }
.file-row__remove svg { width: 16px; height: 16px; }

.tool-options { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.1rem; }
.field { display: flex; flex-direction: column; gap: .4rem; }
.field label { font-size: .84rem; font-weight: 700; color: var(--text-muted); }
.field input[type="text"], .field input[type="number"], .field input[type="password"], .field select, .field textarea {
  padding: .65rem .8rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg-elevated); color: var(--text); width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .8rem; }
.field-hint { font-size: .78rem; color: var(--text-faint); }
.radio-group { display: flex; flex-wrap: wrap; gap: .6rem; }
.radio-chip {
  display: inline-flex; align-items: center; gap: .4em; padding: .5rem .85rem; border-radius: 999px;
  border: 1px solid var(--border-strong); font-size: .87rem; font-weight: 600; cursor: pointer;
}
.radio-chip input { accent-color: var(--accent); }
.radio-chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.range-row { display: flex; align-items: center; gap: .8rem; }
.range-row input[type="range"] { flex-grow: 1; accent-color: var(--accent); }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
.checkbox-row { display: flex; align-items: center; gap: .55rem; font-size: .9rem; font-weight: 600; }

.thumb-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .65rem; margin-top: 1rem;
}
.page-thumb {
  position: relative; border: 2px solid var(--border); border-radius: 10px; overflow: hidden;
  background: var(--bg-subtle); aspect-ratio: 3/4; cursor: pointer; transition: border-color .15s;
}
.page-thumb canvas, .page-thumb img { width: 100%; height: 100%; object-fit: contain; }
.page-thumb.is-selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.page-thumb.is-marked-delete { border-color: var(--danger); }
.page-thumb.is-marked-delete::after {
  content: "✕"; position: absolute; inset: 0; background: color-mix(in srgb, var(--danger) 22%, transparent);
  display: grid; place-items: center; color: #fff; font-size: 1.4rem; font-weight: 800;
}
.page-thumb__num {
  position: absolute; bottom: 4px; right: 4px; background: rgba(0,0,0,.65); color: #fff;
  font-size: .68rem; font-weight: 700; padding: 1px 6px; border-radius: 999px;
}
.page-thumb__rot { position: absolute; top: 4px; right: 4px; background: var(--bg-elevated); border-radius: 6px; padding: 2px; box-shadow: var(--shadow-sm); }
.page-thumb__rot svg { width: 14px; height: 14px; }
.page-thumb.is-dragging { opacity: .35; }

/* State machine */
.tool-card [data-el] { display: none; }
.tool-card[data-state="idle"] [data-show="idle"],
.tool-card[data-state="ready"] [data-show="ready"],
.tool-card[data-state="loading-engine"] [data-show="loading-engine"],
.tool-card[data-state="working"] [data-show="working"],
.tool-card[data-state="done"] [data-show="done"],
.tool-card[data-state="error"] [data-show="error"] { display: block; }
.tool-card[data-state="ready"] [data-show="ready-flex"],
.tool-card[data-state="idle"] [data-show="idle-flex"] { display: flex; }

.progress-panel { text-align: center; padding: 2rem 1rem; }
.spinner {
  width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--border);
  border-top-color: var(--accent); margin: 0 auto 1rem; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-bar { height: 8px; border-radius: 999px; background: var(--bg-subtle); overflow: hidden; margin-top: 1rem; }
.progress-bar__fill { height: 100%; background: var(--accent); border-radius: 999px; width: 0%; transition: width .3s var(--ease-out); }
.progress-note { font-size: .85rem; color: var(--text-muted); margin-top: .6rem; }

.result-panel { text-align: center; padding: 1.6rem 1rem; }
.result-panel__icon {
  width: 52px; height: 52px; border-radius: 50%; background: var(--success-soft); color: var(--success);
  display: grid; place-items: center; margin: 0 auto .9rem;
}
.result-panel__icon svg { width: 26px; height: 26px; }
.result-stats { display: flex; justify-content: center; gap: 1.6rem; margin: 1rem 0 1.3rem; flex-wrap: wrap; }
.result-stat { text-align: center; }
.result-stat__value { font-size: 1.3rem; font-weight: 800; }
.result-stat__value.is-good { color: var(--success); }
.result-stat__label { font-size: .76rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; }
.result-files { display: flex; flex-direction: column; gap: .5rem; margin-top: 1rem; text-align: left; }
.result-file {
  display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.result-file__name { flex-grow: 1; font-size: .88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-file a.btn { flex-shrink: 0; }

.error-panel { text-align: center; padding: 1.8rem 1rem; }
.error-panel__icon {
  width: 52px; height: 52px; border-radius: 50%; background: var(--danger-soft); color: var(--danger);
  display: grid; place-items: center; margin: 0 auto .9rem;
}
.error-panel__icon svg { width: 26px; height: 26px; }
.error-panel__msg { color: var(--text-muted); max-width: 42ch; margin: .4rem auto 1.2rem; }

.privacy-badge {
  display: flex; align-items: flex-start; gap: .6rem; margin-top: 1.1rem; padding: .85rem 1rem;
  background: var(--success-soft); border: 1px solid color-mix(in srgb, var(--success) 30%, var(--border));
  border-radius: var(--radius-sm); font-size: .86rem; color: var(--text);
}
.privacy-badge svg { width: 18px; height: 18px; color: var(--success); flex-shrink: 0; margin-top: 1px; }
.limit-note { font-size: .8rem; color: var(--text-faint); margin-top: .6rem; }

/* Ad slots */
.ad-slot {
  display: flex; align-items: center; justify-content: center; border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm); background: var(--bg-subtle); color: var(--text-faint);
  font-size: .78rem; font-weight: 700; letter-spacing: .08em;
}
.ad-slot--leaderboard { min-height: 90px; margin-block: 1.5rem; }
.ad-slot--incontent { min-height: 250px; margin-block: 2rem; max-width: 700px; margin-inline: auto; }
.ad-slot--sidebar { min-height: 600px; width: 100%; }
.ad-rail { display: none; }
@media (min-width: 1280px) {
  .layout-with-rail { display: grid; grid-template-columns: 1fr 300px; gap: 2rem; align-items: start; }
  .ad-rail { display: block; position: sticky; top: 90px; }
}
.ad-corner {
  position: fixed; bottom: 14px; right: 14px; z-index: 60; width: 250px; max-width: calc(100vw - 28px);
  min-height: 90px; box-shadow: var(--shadow-lg); background: var(--bg-elevated);
}
.ad-corner__close {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg-subtle); display: grid; place-items: center; color: var(--text-muted);
}
.ad-corner__close svg { width: 12px; height: 12px; }
.ad-corner.is-hidden { display: none; }

dialog.ad-modal { border: none; border-radius: var(--radius-lg); padding: 0; max-width: 92vw; width: 420px; box-shadow: var(--shadow-lg); background: transparent; }
dialog.ad-modal::backdrop { background: rgba(10,11,15,.55); backdrop-filter: blur(2px); }
.ad-modal__inner { background: var(--bg-elevated); border-radius: var(--radius-lg); padding: 1.2rem; position: relative; }
.ad-modal__close {
  position: absolute; top: .7rem; right: .7rem; width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg-subtle); display: grid; place-items: center;
}
.ad-modal__close svg { width: 15px; height: 15px; }
.ad-modal .ad-slot { min-height: 280px; margin-top: .6rem; }

/* How it works */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.2rem; margin-top: 1.5rem; }
.step { display: flex; flex-direction: column; gap: .6rem; }
.step__num {
  width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 800;
}
.step h3 { font-size: 1rem; }
.step p { font-size: .9rem; color: var(--text-muted); }

/* Why-use grid */
.benefits { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.benefit { display: flex; gap: .7rem; padding: 1rem; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); }
.benefit svg { width: 20px; height: 20px; color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.benefit h3 { font-size: .95rem; margin-bottom: .2rem; }
.benefit p { font-size: .84rem; color: var(--text-muted); }

/* FAQ */
.faq-list { margin-top: 1.4rem; display: flex; flex-direction: column; gap: .6rem; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elevated); overflow: hidden; }
.faq-item summary {
  padding: 1rem 1.1rem; font-weight: 700; cursor: pointer; list-style: none; display: flex;
  align-items: center; justify-content: space-between; gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; font-size: 1.3rem; color: var(--accent); flex-shrink: 0; transition: transform .2s;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding: 0 1.1rem 1.1rem; color: var(--text-muted); font-size: .92rem; }

/* Related tools */
.related-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .9rem; margin-top: 1.3rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-elevated); margin-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 2rem; padding-block: 2.5rem; }
.footer-col h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); margin-bottom: .8rem; }
.footer-col a { display: block; font-size: .9rem; color: var(--text-muted); padding-block: .32rem; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--border); padding-block: 1.2rem; font-size: .82rem; color: var(--text-faint);
  display: flex; flex-wrap: wrap; gap: .8rem; justify-content: space-between; align-items: center;
}
.footer-credits { font-size: .76rem; color: var(--text-faint); max-width: 60ch; }

/* Home hero visual */
.home-hero { text-align: center; padding-block: clamp(2.6rem, 7vw, 4.5rem) 1rem; }
.home-hero h1 { max-width: 18ch; margin-inline: auto; }
.home-hero .lede { max-width: 52ch; margin-inline: auto; margin-top: .8rem; }
.home-hero__badges { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 1.4rem; }

/* Legal pages */
.legal-content h2 { margin-top: 2rem; margin-bottom: .6rem; }
.legal-content p, .legal-content li { color: var(--text-muted); margin-bottom: .7rem; }
.legal-content { margin-top: 1.5rem; }

/* =============================================================
   8. Responsive
   ============================================================= */
@media (min-width: 720px) {
  .field-row { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
}
@media (min-width: 960px) {
  .tool-card { padding: 2rem; }
}

/* =============================================================
   9. Reduced-motion
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 1.4s; }
  .tool-tile { transition: none; }
}

/* No-JS notice */
.no-js-note { display: none; }
.no-js .no-js-note { display: block; padding: 1rem; background: var(--warning-soft); border: 1px solid var(--warning); border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .9rem; }
.no-js .js-only { display: none !important; }

/* =============================================================
   10. Cookie consent banner
   ============================================================= */
.cookie-banner {
  position: fixed; inset: auto 0 0 0; z-index: 300;
  background: var(--bg-elevated); border-top: 1px solid var(--border); box-shadow: var(--shadow-lg);
  padding: 1rem; transform: translateY(100%); transition: transform .3s ease;
  display: none;
}
.cookie-banner.is-visible { display: block; transform: translateY(0); }
.cookie-banner__inner {
  max-width: 1100px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between;
}
.cookie-banner p { margin: 0; font-size: .9rem; color: var(--text-muted); flex: 1 1 320px; }
.cookie-banner a { color: var(--accent); font-weight: 600; }
.cookie-banner__actions { display: flex; gap: .6rem; flex-shrink: 0; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) {
  .cookie-banner { transition: none; }
}
