/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #fafbfe;
  --border: #e6e8f0;
  --border-soft: #eef0f6;
  --text: #14161f;
  --text-soft: #4a4f5e;
  --text-mute: #8890a0;
  --accent: #5b5bf0;
  --accent-2: #7c7cf5;
  --accent-ink: #ffffff;
  --accent-soft: #eeeeff;
  --success: #16a34a;
  --success-soft: #ecfdf3;
  --danger: #e0405a;
  --danger-soft: #fdecef;
  --warn: #b8860b;
  --warn-soft: #fff7e6;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(20, 22, 31, 0.04), 0 1px 1px rgba(20, 22, 31, 0.03);
  --shadow: 0 6px 20px rgba(20, 22, 31, 0.06), 0 2px 6px rgba(20, 22, 31, 0.04);
  --shadow-lg: 0 20px 48px rgba(20, 22, 31, 0.10), 0 6px 16px rgba(20, 22, 31, 0.06);
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --container: 1160px;
  --header-h: 64px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101119;
    --surface: #171926;
    --surface-2: #1c1e2c;
    --border: #2a2d3d;
    --border-soft: #23253449 ;
    --border-soft: #262838;
    --text: #f1f2f8;
    --text-soft: #b7bacb;
    --text-mute: #7d8296;
    --accent: #8a8bff;
    --accent-2: #a3a3ff;
    --accent-ink: #14152a;
    --accent-soft: #232447;
    --success: #34d399;
    --success-soft: #113328;
    --danger: #f87189;
    --danger-soft: #3a1b24;
    --warn: #f2c14e;
    --warn-soft: #3a2f14;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 6px 20px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.45), 0 6px 16px rgba(0, 0, 0, 0.3);
  }
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; overflow-x: clip; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
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, canvas { 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; }
input, select, textarea { font: inherit; color: inherit; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.15; letter-spacing: -0.01em; font-weight: 700; }
ul, ol { list-style: none; padding: 0; }
::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* =============================================================
   3. Utilities
   ============================================================= */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 1.25rem; }
.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: fixed; top: -100px; left: 1rem; z-index: 9999;
  padding: .6rem 1rem; background: var(--text); color: var(--bg);
  border-radius: 8px; font-weight: 600; transition: top .2s var(--ease-out);
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   4. Typography
   ============================================================= */
h1 { font-size: clamp(1.9rem, 4.2vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.1rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent);
}
.lede { color: var(--text-soft); font-size: 1.05rem; }

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

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .85rem 1.5rem; border-radius: 999px; font-weight: 600; font-size: .98rem;
  transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out), background .18s var(--ease-out), opacity .18s var(--ease-out);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--accent-2); box-shadow: var(--shadow-lg); }
.btn-lg { padding: 1.05rem 2rem; font-size: 1.05rem; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text-soft); padding: .6rem 1rem; }
.btn-ghost:hover { color: var(--accent); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border-radius: 999px; }
.btn-icon:hover { background: var(--surface-2); }

/* --- Cards --- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* --- Header / Nav --- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
  height: var(--header-h);
}
.site-header .container { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.12rem; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff; flex-shrink: 0;
}
.brand-mark svg { width: 18px; height: 18px; }
.nav-desktop { display: none; }
.nav-desktop ul { display: flex; align-items: center; gap: 1.6rem; }
.nav-desktop a { font-size: .93rem; font-weight: 600; color: var(--text-soft); transition: color .15s var(--ease-out); }
.nav-desktop a:hover, .nav-desktop a[aria-current="page"] { color: var(--accent); }
.nav-cta { display: none; }
.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border);
}
.nav-toggle svg { width: 20px; height: 20px; }
.nav-mobile {
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 90;
  background: var(--bg); padding: 1.25rem; overflow-y: auto;
  transform: translateY(-8px); opacity: 0; pointer-events: none;
  transition: opacity .2s var(--ease-out), transform .2s var(--ease-out);
}
.nav-mobile.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
.nav-mobile ul { display: flex; flex-direction: column; gap: .25rem; }
.nav-mobile a {
  display: block; padding: .9rem .25rem; font-size: 1.05rem; font-weight: 600;
  border-bottom: 1px solid var(--border-soft);
}
.nav-mobile .btn { margin-top: 1.25rem; }

/* --- Hero --- */
.hero { padding-block: 3.2rem 2.2rem; text-align: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .85rem;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  font-size: .82rem; font-weight: 700; margin-bottom: 1.1rem;
}
.hero h1 { max-width: 20ch; margin-inline: auto; }
.hero .lede { max-width: 46ch; margin: .9rem auto 1.6rem; }
.hero-actions { display: flex; justify-content: center; gap: .75rem; flex-wrap: wrap; }

/* --- Tool grid (homepage / tools page) --- */
.tool-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.tool-tile {
  padding: 1.5rem; display: flex; flex-direction: column; gap: .65rem;
  transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out), border-color .2s var(--ease-out);
}
.tool-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--accent); }
.tool-tile-icon {
  width: 48px; height: 48px; border-radius: 12px; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}
.tool-tile h3 { font-size: 1.08rem; }
.tool-tile p { color: var(--text-soft); font-size: .93rem; flex-grow: 1; }
.tool-tile .btn { align-self: flex-start; margin-top: .3rem; }

/* --- Section headers --- */
.section { padding-block: 2.6rem; }
.section-head { text-align: center; max-width: 42ch; margin: 0 auto 1.8rem; }
.section-head p { color: var(--text-soft); margin-top: .5rem; }

/* --- Page hero (tool pages) --- */
.page-hero { padding-block: 2rem 1.5rem; text-align: center; }
.page-hero h1 { max-width: 32ch; margin-inline: auto; }
.page-hero .lede { max-width: 50ch; margin: .7rem auto 0; }

/* --- Layout with sidebar --- */
.tool-layout { display: grid; grid-template-columns: 1fr; gap: 1.5rem; align-items: start; }

/* --- Tool card (the hero component) --- */
.tool-card {
  padding: 1.35rem; display: flex; flex-direction: column; gap: 1.1rem;
  box-shadow: var(--shadow);
}
.tool-card[data-state] .state-panel { display: none; }
.tool-card[data-state="idle"] .state-idle,
.tool-card[data-state="ready"] .state-ready,
.tool-card[data-state="loading-engine"] .state-loading,
.tool-card[data-state="working"] .state-working,
.tool-card[data-state="done"] .state-done,
.tool-card[data-state="error"] .state-error { display: flex; flex-direction: column; gap: 1rem; }

/* --- Dropzone --- */
.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 2.6rem 1.5rem; text-align: center; cursor: pointer;
  background: var(--surface-2); transition: border-color .18s var(--ease-out), background .18s var(--ease-out);
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone-icon {
  width: 56px; height: 56px; margin: 0 auto .9rem; border-radius: 16px;
  background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center;
}
.dropzone-icon svg { width: 26px; height: 26px; }
.dropzone-title { font-weight: 700; font-size: 1.05rem; margin-bottom: .3rem; }
.dropzone-sub { color: var(--text-mute); font-size: .88rem; }
.dropzone-mobile-label { display: inline-block; }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dropzone-formats { margin-top: 1rem; font-size: .78rem; color: var(--text-mute); }

/* --- File info panel --- */
.file-info {
  display: flex; align-items: center; gap: 1rem; padding: .9rem 1rem;
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
}
.file-info-thumb {
  width: 56px; height: 56px; border-radius: 10px; overflow: hidden; flex-shrink: 0;
  background: var(--border-soft); display: flex; align-items: center; justify-content: center;
}
.file-info-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-info-main { flex-grow: 1; min-width: 0; }
.file-info-name { font-weight: 600; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-info-meta { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .25rem; }
.meta-chip {
  font-size: .74rem; font-weight: 600; color: var(--text-soft);
  background: var(--surface); border: 1px solid var(--border-soft); padding: .18rem .55rem; border-radius: 999px;
}
.file-info-remove { flex-shrink: 0; color: var(--text-mute); }
.file-info-remove:hover { color: var(--danger); }

/* --- Options --- */
.opt-group { display: flex; flex-direction: column; gap: .55rem; }
.opt-label { font-size: .86rem; font-weight: 700; display: flex; align-items: center; justify-content: space-between; }
.opt-label .val { color: var(--accent); font-weight: 700; }
.opt-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.opt-tabs { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 999px; padding: .25rem; }
.opt-tab {
  padding: .5rem 1rem; border-radius: 999px; font-size: .85rem; font-weight: 700; color: var(--text-soft);
  transition: background .15s var(--ease-out), color .15s var(--ease-out);
}
.opt-tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.chip-btn {
  padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--border);
  font-size: .84rem; font-weight: 600; color: var(--text-soft); background: var(--surface);
}
.chip-btn[aria-pressed="true"], .chip-btn.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }

.field-row { display: flex; gap: .7rem; align-items: flex-end; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: .35rem; flex: 1 1 100px; min-width: 90px; }
.field label { font-size: .78rem; font-weight: 700; color: var(--text-soft); }
.field input[type="number"], .field input[type="text"], .field select {
  padding: .65rem .8rem; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); font-size: .95rem; width: 100%;
}
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%238890a0'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .7rem center; background-size: 1rem; padding-right: 2.2rem; }
.field-lock { display: flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--text-soft); font-weight: 600; padding-bottom: .7rem; }
.dims-arrow { display: flex; align-items: center; justify-content: center; gap: .8rem; font-weight: 700; color: var(--text-mute); font-size: .9rem; padding: .4rem 0; }
.dims-arrow .new { color: var(--accent); }

/* Range slider */
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px;
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--fill, 50%), var(--border) var(--fill, 50%), var(--border) 100%);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 3px solid var(--accent); box-shadow: var(--shadow-sm); cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); cursor: pointer;
}
.range-labels { display: flex; justify-content: space-between; font-size: .76rem; color: var(--text-mute); font-weight: 600; }

/* Checkbox / switch */
.switch { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .86rem; font-weight: 600; color: var(--text-soft); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  width: 36px; height: 21px; border-radius: 999px; background: var(--border); position: relative; flex-shrink: 0;
  transition: background .18s var(--ease-out);
}
.switch-track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-sm); transition: transform .18s var(--ease-out);
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(15px); }

/* --- Progress --- */
.progress-wrap { display: flex; flex-direction: column; gap: .6rem; align-items: center; padding: 1rem 0; text-align: center; }
.spinner {
  width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--border);
  border-top-color: var(--accent); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-bar { width: 100%; max-width: 280px; height: 8px; border-radius: 999px; background: var(--border-soft); overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--accent); border-radius: 999px; width: 0%; transition: width .25s var(--ease-out); }
.progress-label { font-size: .88rem; color: var(--text-soft); font-weight: 600; }
.progress-note { font-size: .78rem; color: var(--text-mute); }

/* --- Result --- */
.result-compare { display: grid; grid-template-columns: 1fr; gap: .9rem; }
.result-figure { border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border-soft); background: var(--surface-2); }
.result-figure img, .result-figure canvas { width: 100%; height: auto; display: block; }
.result-stats { display: flex; align-items: center; justify-content: center; gap: 1.1rem; flex-wrap: wrap; text-align: center; padding: .3rem 0; }
.result-stat-label { font-size: .74rem; color: var(--text-mute); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.result-stat-value { font-size: 1.15rem; font-weight: 800; margin-top: .15rem; }
.result-arrow { color: var(--text-mute); font-size: 1.3rem; }
.saved-badge {
  display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .8rem; border-radius: 999px;
  background: var(--success-soft); color: var(--success); font-weight: 800; font-size: .9rem;
}
.result-title { text-align: center; font-weight: 800; font-size: 1.15rem; }
.result-actions { display: flex; flex-direction: column; gap: .6rem; align-items: stretch; }
.result-actions-row { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }

/* --- Error state --- */
.error-panel {
  display: flex; flex-direction: column; align-items: center; gap: .6rem; text-align: center; padding: 1rem 0;
}
.error-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--danger-soft); color: var(--danger); display: flex; align-items: center; justify-content: center; }
.error-panel p { color: var(--text-soft); font-size: .9rem; max-width: 34ch; }

/* --- Privacy badge / limits --- */
.tool-meta-row { display: flex; flex-direction: column; gap: .5rem; padding-top: .2rem; }
.privacy-badge {
  display: flex; align-items: center; gap: .55rem; padding: .7rem .9rem;
  background: var(--success-soft); border-radius: var(--radius-sm); font-size: .85rem; font-weight: 600; color: var(--success);
}
.privacy-badge svg { flex-shrink: 0; width: 18px; height: 18px; }
.limits-note { font-size: .78rem; color: var(--text-mute); padding: 0 .3rem; }

/* --- Thumbnails list (image to pdf) --- */
.thumb-list { display: flex; flex-direction: column; gap: .6rem; }
.thumb-item { display: flex; align-items: center; gap: .8rem; padding: .6rem; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); }
.thumb-item img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: var(--border-soft); }
.thumb-item-name { flex-grow: 1; min-width: 0; font-size: .85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb-item-size { font-size: .74rem; color: var(--text-mute); flex-shrink: 0; }
.thumb-item-actions { display: flex; gap: .15rem; flex-shrink: 0; }
.thumb-add-more { align-self: flex-start; }

/* --- Crop stage --- */
.crop-stage-wrap { display: flex; flex-direction: column; align-items: center; gap: .9rem; }
.crop-stage {
  position: relative; width: 100%; max-width: 360px; aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm); overflow: hidden; background: repeating-conic-gradient(var(--border-soft) 0% 25%, var(--surface-2) 0% 50%) 50% / 20px 20px;
  touch-action: none; border: 1px solid var(--border-soft); cursor: grab;
}
.crop-stage:active { cursor: grabbing; }
.crop-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.crop-controls-row { display: flex; align-items: center; justify-content: center; gap: .9rem; width: 100%; }
.crop-controls-row .zoom-slider { max-width: 220px; }

/* --- FAQ --- */
.faq-list { display: flex; flex-direction: column; gap: .7rem; }
.faq-item { border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.faq-item summary {
  padding: 1rem 1.1rem; font-weight: 700; font-size: .96rem; cursor: pointer;
  list-style: none; display: flex; justify-content: space-between; align-items: center; 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; font-weight: 400;
  transition: transform .2s var(--ease-out);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding: 0 1.1rem 1.1rem; color: var(--text-soft); font-size: .92rem; }

/* --- Steps --- */
.steps { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.step { padding: 1.3rem; text-align: left; }
.step-num {
  width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-weight: 800; margin-bottom: .8rem;
}
.step h3 { font-size: 1rem; margin-bottom: .3rem; }
.step p { color: var(--text-soft); font-size: .9rem; }

/* --- SEO text block --- */
.prose { max-width: 74ch; margin-inline: auto; color: var(--text-soft); }
.prose h2 { color: var(--text); margin-bottom: .6rem; }
.prose p { margin-bottom: 1rem; }
.prose p:last-child { margin-bottom: 0; }

/* --- Related tools --- */
.related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; }
.related-card {
  padding: 1rem; display: flex; align-items: center; gap: .7rem; transition: border-color .15s var(--ease-out), transform .15s var(--ease-out);
}
.related-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.related-card .icon { font-size: 1.3rem; }
.related-card span { font-size: .88rem; font-weight: 700; }

/* --- Ad slots --- */
.ad-slot {
  display: flex; align-items: center; justify-content: center; text-align: center;
  border: 1px dashed var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
  color: var(--text-mute); font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.ad-leaderboard { min-height: 90px; }
.ad-content { min-height: 100px; }
.ad-sidebar { min-height: 250px; width: 100%; }
.ad-download { min-height: 70px; margin-top: .2rem; }
.ad-mobile-banner { min-height: 60px; }

/* --- All tools page --- */
.tools-category { margin-bottom: 2.4rem; }
.tools-category h2 { margin-bottom: 1rem; font-size: 1.2rem; }
.tools-category-grid { display: grid; grid-template-columns: 1fr; gap: .9rem; }
.upcoming-list { display: flex; flex-wrap: wrap; gap: .55rem; }
.upcoming-chip {
  padding: .5rem 1rem; border-radius: 999px; border: 1px dashed var(--border);
  font-size: .82rem; color: var(--text-mute); font-weight: 600;
}

/* --- Legal / static pages --- */
.static-page { padding-block: 2.5rem 3rem; }
.static-page .prose { max-width: 72ch; margin: 0; }
.static-page h1 { margin-bottom: .4rem; }
.static-page .updated { color: var(--text-mute); font-size: .85rem; margin-bottom: 1.8rem; }
.static-page h2 { margin-top: 1.8rem; margin-bottom: .6rem; font-size: 1.2rem; }

.contact-list { display: flex; flex-direction: column; gap: .8rem; margin-top: 1rem; }
.contact-list li { display: flex; align-items: center; gap: .7rem; }

/* --- Footer --- */
.site-footer { border-top: 1px solid var(--border-soft); padding-block: 2.6rem 1.8rem; margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
.footer-brand p { color: var(--text-soft); font-size: .9rem; margin-top: .6rem; max-width: 32ch; }
.footer-col h4 { font-size: .84rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-mute); margin-bottom: .9rem; }
.footer-col ul { display: flex; flex-direction: column; gap: .6rem; }
.footer-col a { font-size: .9rem; color: var(--text-soft); transition: color .15s var(--ease-out); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  margin-top: 2.2rem; padding-top: 1.4rem; border-top: 1px solid var(--border-soft);
  display: flex; flex-direction: column; gap: .8rem; align-items: center; text-align: center;
  font-size: .82rem; color: var(--text-mute);
}
.footer-credits { font-size: .74rem; color: var(--text-mute); max-width: 60ch; }

/* =============================================================
   6. Effects
   ============================================================= */
.is-visually-hidden { display: none !important; }
[hidden] { display: none !important; }

/* =============================================================
   7. Responsive
   ============================================================= */
@media (min-width: 540px) {
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .result-compare { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .field-row.dims-row { flex-wrap: nowrap; }
}

@media (min-width: 720px) {
  .nav-desktop { display: block; }
  .nav-toggle, .nav-mobile { display: none; }
  .nav-cta { display: inline-flex; }
  .tools-category-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { padding-block: 4.5rem 3rem; }
}

@media (min-width: 960px) {
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
  .tools-category-grid { grid-template-columns: repeat(3, 1fr); }
  .related-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1280px) {
  .tool-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .ad-sidebar-wrap { display: block; }
  .tool-grid { grid-template-columns: repeat(5, 1fr); }
  .hero h1 { max-width: 26ch; }
}

.ad-sidebar-wrap { display: none; }

/* =============================================================
   8. Reduced motion — only intrusive effects
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 1.4s; }
}
