/* ==========================================================================
   ToolsPulse Hub — main.css
   Mobile-first. Theming via CSS custom properties on [data-theme].
   Sections: 1 Tokens · 2 Base · 3 Layout · 4 Header · 5 Buttons & forms
             6 Cards & grids · 7 Tool UI · 8 Article (prose) · 9 FAQ
             10 Ads · 11 Footer · 12 Cookie banner · 13 Utilities · 14 Motion
   ========================================================================== */

/* 1. TOKENS ---------------------------------------------------------------- */
/* Light theme: white / soft-blue surfaces with cyan-blue accents. */
:root {
  --bg: #f3f7fd;
  --surface: #ffffff;
  --surface-2: #eef4fc;
  --surface-3: #e1eaf7;
  --border: #d2deef;
  --border-strong: #afc1dc;
  --text: #0a1530;
  --text-muted: #45536f;
  --text-faint: #5b6987;
  --brand: #0369a1;
  --brand-strong: #075985;
  --brand-soft: #e0f2fe;
  --brand-contrast: #ffffff;
  --accent-blue: #2563eb;
  --accent-purple: #7c3aed;
  --ring: rgba(3, 105, 161, .28);
  --pulse: #f0532d;           /* decorative accent only, never for text on white */
  --pulse-soft: #fde9e3;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --success: #067647;
  --success-soft: #e5f5ec;
  --warning: #93510a;
  --warning-soft: #fdf3e2;
  --focus: #1d4ed8;
  --chart-1: #0284c7;
  --chart-2: #f0532d;
  --chart-3: #7c3aed;
  --chart-4: #c79a1e;
  --grad-primary: linear-gradient(135deg, #0b78c9 0%, #3056e8 100%);
  --grad-purple: linear-gradient(135deg, #6d28d9 0%, #4f46e5 100%);
  --grad-text: linear-gradient(90deg, #0e7490 0%, #1d4ed8 100%);
  --glass: rgba(255, 255, 255, .82);
  --glass-solid: #ffffff;
  --glass-border: rgba(37, 99, 235, .16);
  --card-bg: #ffffff;
  --card-hi: inset 0 1px 0 rgba(255, 255, 255, .9);
  --shadow-sm: 0 1px 2px rgba(10, 21, 48, .06);
  --shadow: 0 1px 2px rgba(10, 21, 48, .05), 0 12px 30px -14px rgba(37, 99, 235, .28);
  --shadow-glow: 0 10px 26px -12px rgba(37, 99, 235, .55);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --maxw: 1240px;
  --gutter: 16px;
  --header-h: 64px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

/* Dark theme: deep navy / midnight, cyan primary, electric blue, a little purple. */
[data-theme="dark"] {
  --bg: #070c1b;
  --surface: #0e1730;
  --surface-2: #132042;
  --surface-3: #1a2a52;
  --border: #23345e;
  --border-strong: #34497e;
  --text: #eaf1ff;
  --text-muted: #a9b8d6;
  --text-faint: #8a9ac0;
  --brand: #38d9f5;
  --brand-strong: #8ae9fb;
  --brand-soft: #0b2b45;
  --brand-contrast: #03131f;
  --accent-blue: #4f8cff;
  --accent-purple: #a78bfa;
  --ring: rgba(56, 217, 245, .32);
  --pulse: #ff7a59;
  --pulse-soft: #3a1d17;
  --danger: #ff8a7a;
  --danger-soft: #3b1714;
  --success: #5fd49a;
  --success-soft: #0f2e20;
  --warning: #f5b955;
  --warning-soft: #33250c;
  --focus: #9cc2ff;
  --chart-1: #38d9f5;
  --chart-2: #ff7a59;
  --chart-3: #a78bfa;
  --chart-4: #e6bf4f;
  --grad-text: linear-gradient(90deg, #22d3ee 0%, #4f8cff 100%);
  --glass: rgba(7, 12, 27, .78);
  --glass-solid: #0a1226;
  --glass-border: rgba(120, 165, 255, .18);
  --card-bg: linear-gradient(180deg, #111d3d 0%, #0d1630 100%);
  --card-hi: inset 0 1px 0 rgba(255, 255, 255, .05);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 14px 34px -16px rgba(0, 0, 0, .7);
  --shadow-glow: 0 10px 28px -12px rgba(59, 130, 246, .75);
  color-scheme: dark;
}

/* No-JS fallback: follow the OS setting. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #070c1b; --surface: #0e1730; --surface-2: #132042; --surface-3: #1a2a52;
    --border: #23345e; --border-strong: #34497e; --text: #eaf1ff; --text-muted: #a9b8d6;
    --text-faint: #8a9ac0; --brand: #38d9f5; --brand-strong: #8ae9fb; --brand-soft: #0b2b45;
    --brand-contrast: #03131f; --focus: #9cc2ff; --ring: rgba(56, 217, 245, .32);
    --glass: rgba(7, 12, 27, .78); --glass-solid: #0a1226; --card-bg: #0e1730; color-scheme: dark;
  }
}

/* 2. BASE ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, canvas, video { max-width: 100%; }
img { height: auto; display: block; }
h1, h2, h3, h4 { line-height: 1.22; margin: 0 0 .5em; letter-spacing: -.012em; color: var(--text); }
h1 { font-size: clamp(1.7rem, 1.25rem + 2vw, 2.45rem); font-weight: 800; letter-spacing: -.022em; }
h2 { font-size: clamp(1.3rem, 1.1rem + .9vw, 1.65rem); font-weight: 750; }
h3 { font-size: 1.12rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--brand); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--brand-strong); }
code, kbd, pre, samp { font-family: var(--font-mono); font-size: .92em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--brand-soft); color: var(--text); }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
table { border-collapse: collapse; width: 100%; }
[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;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200; padding: 10px 16px;
  background: var(--brand); color: var(--brand-contrast); border-radius: var(--radius-sm);
  font-weight: 700; text-decoration: none; transition: top .15s;
}
.skip-link:focus { top: 10px; color: var(--brand-contrast); }
main:focus { outline: none; }

/* 3. LAYOUT ---------------------------------------------------------------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: 860px; }
.section { padding-block: 40px; }
.section-head { margin-bottom: 20px; }
.section-head p { color: var(--text-muted); margin: 0; max-width: 62ch; }
.page-head { padding-block: 20px 8px; }
.page-head .lead { font-size: 1.08rem; color: var(--text-muted); max-width: 70ch; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
.main-col { min-width: 0; }
.sidebar { display: none; }
/* Tool-page sidebar (holds the sidebar ad slot). It appears only from 1200 px, with a
   wide column gap so the ad stays at least 150 px from every tool control horizontally
   (gap 136 px + the tool card's 24 px padding and border). Below 1200 px it is hidden. */
@media (min-width: 1200px) {
  .layout--sidebar { grid-template-columns: minmax(0, 1fr) 300px; column-gap: 136px; }
  .sidebar { display: block; }
  .sidebar-inner { position: sticky; top: calc(var(--header-h) + 20px); }
}
@media (min-width: 640px) { :root { --gutter: 24px; } }

/* 4. HEADER ---------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--glass-solid);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 12px; height: var(--header-h); position: relative; }
.logo { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text); flex-shrink: 0; }
.logo:hover { color: var(--text); }
.logo-bg { fill: var(--brand); }
[data-theme="dark"] .logo-bg { fill: #0e8f78; }
.logo-text { font-weight: 800; font-size: 1.14rem; letter-spacing: -.02em; white-space: nowrap; }
.logo-hub { color: var(--brand); font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 0;
  border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--text);
  cursor: pointer; transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); }
.theme-toggle .i-sun, [data-theme="dark"] .theme-toggle .i-moon { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: block; }
.menu-toggle .i-close, .menu-toggle[aria-expanded="true"] .i-menu { display: none; }
.menu-toggle[aria-expanded="true"] .i-close { display: block; }

/* Mobile nav = dropdown panel */
.main-nav {
  display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
  background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
  padding: 8px var(--gutter) 16px;
}
.main-nav.is-open { display: block; }
.main-nav ul { list-style: none; margin: 0; padding: 0; }
.main-nav a {
  display: block; padding: 12px 10px; border-radius: 8px; text-decoration: none;
  color: var(--text); font-weight: 600;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-strong); }
[data-theme="dark"] .main-nav a:hover, [data-theme="dark"] .main-nav a[aria-current="page"] { color: var(--brand-strong); }

/* Search */
.header-search {
  display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
  padding: 10px var(--gutter) 14px; background: var(--surface); border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.header-search.is-open { display: block; }
.search-icon { position: absolute; left: calc(var(--gutter) + 12px); top: 23px; color: var(--text-faint); pointer-events: none; }
.search-input {
  width: 100%; height: 44px; padding: 0 14px 0 40px; font: inherit; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
}
.search-input:focus { border-color: var(--brand); background: var(--surface); outline: 2px solid transparent; box-shadow: 0 0 0 3px var(--ring); }
.search-input::-webkit-search-cancel-button { cursor: pointer; }
.search-results {
  list-style: none; margin: 8px 0 0; padding: 6px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
  max-height: min(70vh, 420px); overflow-y: auto;
}
.search-results li { border-radius: 8px; }
.search-results a { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; text-decoration: none; color: var(--text); border-radius: 8px; }
.search-results .sr-ico { flex-shrink: 0; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); }
.search-results .sr-name { font-weight: 650; display: block; line-height: 1.3; }
.search-results .sr-desc { font-size: .84rem; color: var(--text-muted); display: block; line-height: 1.35; }
.search-results li[aria-selected="true"] a, .search-results a:hover { background: var(--surface-2); }
.search-results .sr-empty { padding: 12px; color: var(--text-muted); font-size: .92rem; }

@media (min-width: 1100px) {
  .main-nav { display: block; position: static; background: none; border: 0; box-shadow: none; padding: 0; margin-left: 14px; }
  .main-nav ul { display: flex; gap: 2px; }
  .main-nav a { padding: 8px 11px; font-size: .95rem; }
  .menu-toggle, .search-toggle { display: none; }
  .header-search { display: block; position: relative; top: auto; left: auto; right: auto; width: 270px; padding: 0; background: none; border: 0; box-shadow: none; margin-left: auto; }
  .header-actions { margin-left: 4px; }
  .search-icon { left: 12px; top: 13px; }
  .search-input { height: 42px; }
  .header-search .search-results { position: absolute; top: 46px; right: 0; width: 360px; }
}

/* Breadcrumbs */
.breadcrumbs { font-size: .88rem; color: var(--text-muted); margin: 6px 0 14px; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 4px; }
.breadcrumbs li + li::before { content: "/"; color: var(--text-faint); margin-right: 2px; }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs [aria-current] { color: var(--text); font-weight: 600; }

/* 5. BUTTONS & FORMS ------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; font: inherit; font-weight: 650; font-size: .95rem; line-height: 1.2;
  border-radius: 10px; border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--brand-contrast); }
.btn-primary:hover { background: var(--brand-strong); color: var(--brand-contrast); }
[data-theme="dark"] .btn-primary:hover { background: var(--brand-strong); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { min-height: 38px; padding: 7px 13px; font-size: .88rem; }
.btn .icon { width: 18px; height: 18px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.is-done { background: var(--success); color: #fff; border-color: var(--success); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--text-muted); cursor: pointer; text-decoration: underline; text-underline-offset: .18em; }
.link-btn:hover { color: var(--brand); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label, .field > .flex > label { font-weight: 650; font-size: .92rem; color: var(--text); }
.field .hint { font-size: .82rem; color: var(--text-muted); line-height: 1.4; }
.field .error-msg { font-size: .84rem; color: var(--danger); font-weight: 600; line-height: 1.35; }
.field .error-msg:empty { display: none; }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; font: inherit; font-size: 1rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: 2px solid transparent; border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--ring);
}
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220, 70, 60, .2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent); }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667580' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.textarea { min-height: 180px; resize: vertical; line-height: 1.5; }
.textarea.mono, .input.mono { font-family: var(--font-mono); font-size: .9rem; }
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button { opacity: .6; }
input[type="range"] { width: 100%; accent-color: var(--brand); min-height: 32px; }
input[type="color"] { width: 52px; height: 44px; padding: 3px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); width: 18px; height: 18px; margin: 0; flex-shrink: 0; }

.input-group { display: flex; align-items: stretch; width: 100%; }
.input-group .affix {
  display: inline-flex; align-items: center; padding: 0 11px; font-weight: 600; color: var(--text-muted);
  background: var(--surface-2); border: 1px solid var(--border-strong); white-space: nowrap; font-size: .95rem;
}
.input-group .affix:first-child { border-radius: 10px 0 0 10px; border-right: 0; }
.input-group .affix:last-child { border-radius: 0 10px 10px 0; border-left: 0; }
.input-group .input { border-radius: 0; min-width: 0; }
.input-group .input:first-child { border-radius: 10px 0 0 10px; }
.input-group .input:last-child { border-radius: 0 10px 10px 0; }
.input-group .input:only-child { border-radius: 10px; }
.input-group .select { border-radius: 0 10px 10px 0; width: auto; flex-shrink: 0; border-left: 0; }

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: .95rem; line-height: 1.4; padding: 4px 0; }
.check input { margin-top: 2px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 6px 16px; }

/* Segmented control (radio group) */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; max-width: 100%; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  padding: 7px 13px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--text-muted);
  min-height: 36px; display: inline-flex; align-items: center;
}
.seg input:checked + label { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 1px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; font-weight: 650; font-size: .92rem; margin-bottom: 6px; }

/* 6. CARDS & GRIDS --------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
@media (min-width: 640px) { .card-pad { padding: 26px; } }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.tool-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.tool-card:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-2px); }
.tool-card:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 35%, transparent); }
.tool-card .tc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tool-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); flex-shrink: 0; }
.tool-card h3 { margin: 4px 0 0; font-size: 1.06rem; }
.tool-card h3 a { color: var(--text); text-decoration: none; }
.tool-card h3 a::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: inherit; } /* not "inset": Safari 14.0 lacks it */
.tool-card h3 a:focus-visible { outline: none; }
.tool-card p { margin: 0; color: var(--text-muted); font-size: .93rem; line-height: 1.5; flex-grow: 1; }
.tool-card .tc-cta { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .9rem; color: var(--brand); margin-top: 4px; }
.tool-card .tc-cta .icon { width: 16px; height: 16px; transition: transform .18s; }
.tool-card:hover .tc-cta .icon { transform: translateX(3px); }
.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  font-size: .76rem; font-weight: 700; letter-spacing: .01em; color: var(--text-muted); background: var(--surface-2);
  border: 1px solid var(--border); white-space: nowrap; text-decoration: none;
}
a.tag:hover { color: var(--brand); border-color: var(--brand); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: .9rem;
  font-weight: 600; cursor: pointer; text-decoration: none;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-contrast); }
.chip .icon { width: 16px; height: 16px; }

/* Hero (homepage) */
.hero { position: relative; padding: 28px 0 36px; overflow: hidden; }
.hero-inner { position: relative; max-width: 820px; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .85rem; color: var(--brand); background: var(--brand-soft); padding: 5px 12px; border-radius: 999px; margin-bottom: 14px; }
.hero h1 { font-size: clamp(2rem, 1.3rem + 3.2vw, 3.2rem); line-height: 1.08; margin-bottom: 14px; }
.hero h1 .accent { color: var(--brand); }
.hero .lead { font-size: clamp(1.02rem, .95rem + .3vw, 1.16rem); color: var(--text-muted); max-width: 60ch; }
.hero-search { position: relative; margin: 22px 0 16px; max-width: 640px; }
.hero-search .search-input { height: 56px; font-size: 1.05rem; padding-left: 48px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.hero-search .search-icon { left: 16px; top: 18px; }
.hero-search .search-results { position: absolute; left: 0; right: 0; top: 60px; z-index: 30; }
.popular { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.popular-label { font-size: .86rem; font-weight: 700; color: var(--text-muted); margin-right: 2px; }
@keyframes pulse-draw { to { stroke-dashoffset: 0; } }
@media (min-width: 900px) { .hero { padding: 48px 0 52px; } }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 16px; }
.feature { padding: 20px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.feature .tool-ico { margin-bottom: 12px; }
.feature h3 { font-size: 1.02rem; }
.feature p { margin: 0; color: var(--text-muted); font-size: .94rem; }

.cat-block { margin-bottom: 40px; }
.cat-block-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.cat-block-head h2 { margin: 0; display: flex; align-items: center; gap: 10px; }
.cat-block-head a { font-weight: 650; font-size: .92rem; }

/* 7. TOOL UI --------------------------------------------------------------- */
.tool-hero { margin-bottom: 18px; }
.tool-hero .tag { margin-bottom: 10px; }
.answer-block { font-size: 1.06rem; color: var(--text); max-width: 75ch; margin-bottom: 10px; }
.meta-line { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .86rem; color: var(--text-muted); margin: 0; }
.meta-line span { display: inline-flex; align-items: center; gap: 6px; }
.meta-line .icon { width: 16px; height: 16px; color: var(--brand); }

.tool-app { padding: 18px; margin-bottom: 8px; }
@media (min-width: 640px) { .tool-app { padding: 24px; } }
.tool-grid-2 { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .tool-grid-2 { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; } }
.form-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 520px) { .form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.span-all { grid-column: 1 / -1; }
.tool-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.tool-subhead { font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 10px; }
.form-section:not(:first-child) { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--border); }
.tool-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.result-panel { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.result-main { margin-bottom: 14px; }
.result-label { font-size: .86rem; font-weight: 700; color: var(--text-muted); margin: 0 0 2px; }
.result-value { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.5rem); font-weight: 800; letter-spacing: -.02em; color: var(--brand); line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
[data-theme="dark"] .result-value { color: var(--brand-strong); }
.result-sub { font-size: .9rem; color: var(--text-muted); margin: 4px 0 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr)); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; min-width: 0; }
.stat .k { display: block; font-size: .78rem; font-weight: 700; color: var(--text-muted); line-height: 1.3; }
.stat .v { display: block; font-size: 1.08rem; font-weight: 750; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat.good .v { color: var(--success); }
.stat.bad .v { color: var(--danger); }
.breakdown { list-style: none; margin: 0; padding: 0; font-size: .93rem; }
.breakdown li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.breakdown li:last-child { border-bottom: 0; }
.breakdown .total { font-weight: 800; }
.breakdown .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: 0; }
.bar-split { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--surface-3); margin: 10px 0 4px; }
.bar-split span { display: block; height: 100%; }

.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; font-size: .92rem; line-height: 1.5; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.notice .icon { flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; }
.notice--warn { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 35%, transparent); }
.notice--warn .icon { color: var(--warning); }
.notice--error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.notice--error .icon { color: var(--danger); }
.notice--ok { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 35%, transparent); }
.notice--ok .icon { color: var(--success); }
.notice p { margin: 0; }

.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
.table-wrap:focus-visible { outline: 3px solid var(--focus); }
.data-table { font-size: .9rem; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: 9px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--border); }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table thead th { position: sticky; top: 0; background: var(--surface-2); font-weight: 700; color: var(--text-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.data-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.table-scroll { max-height: 420px; overflow-y: auto; }

.chart-box { position: relative; width: 100%; height: 260px; margin-top: 6px; }
.chart-box canvas { width: 100%; height: 100%; display: block; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .85rem; color: var(--text-muted); margin-top: 8px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.chart-tip { position: absolute; pointer-events: none; z-index: 5; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: 8px; padding: 7px 10px; font-size: .8rem; line-height: 1.45; white-space: nowrap; font-variant-numeric: tabular-nums; }

.output-box { position: relative; }
.code-out {
  margin: 0; padding: 14px; min-height: 120px; max-height: 480px; overflow: auto; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px; font-family: var(--font-mono); font-size: .86rem; line-height: 1.55;
  white-space: pre; tab-size: 2; color: var(--text);
}
.code-out.wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.code-line { display: block; }
.is-stale { opacity: .3; filter: grayscale(1); pointer-events: none; user-select: none; }
.code-line.is-error { background: var(--danger-soft); box-shadow: inset 3px 0 0 var(--danger); }
.ln { display: inline-block; min-width: 3ch; margin-right: 12px; color: var(--text-faint); text-align: right; user-select: none; }
.counter { font-size: .8rem; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.counter.is-warn { color: var(--warning); font-weight: 700; }
.counter.is-over { color: var(--danger); font-weight: 700; }
.meter { height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter > span { display: block; height: 100%; width: 0; border-radius: inherit; transition: width .25s, background-color .25s; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  padding: 28px 16px; border: 2px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2);
  cursor: pointer; transition: border-color .15s, background .15s; min-height: 150px;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone .icon { width: 34px; height: 34px; color: var(--brand); }
.dropzone strong { font-size: 1rem; }
.dropzone span { font-size: .86rem; color: var(--text-muted); }
.file-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.file-item { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.file-item img, .file-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: var(--surface-3); }
.file-meta { min-width: 0; font-size: .88rem; }
.file-meta .name { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.file-meta .sizes { color: var(--text-muted); }
.file-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
@media (min-width: 560px) { .file-item { grid-template-columns: 64px minmax(0, 1fr) auto; } .file-actions { grid-column: auto; } }
.preview-box { display: grid; place-items: center; min-height: 200px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background-color: var(--surface-2);
  background-image: linear-gradient(45deg, var(--surface-3) 25%, transparent 25%), linear-gradient(-45deg, var(--surface-3) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--surface-3) 75%), linear-gradient(-45deg, transparent 75%, var(--surface-3) 75%);
  background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; }
.preview-box img, .preview-box canvas, .preview-box svg { max-height: 360px; width: auto; max-width: 100%; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; z-index: 300;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: .92rem;
  transition: opacity .2s, transform .2s; pointer-events: none; max-width: calc(100vw - 32px);
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* SERP / social previews (meta tag tool) */
.serp { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; font-family: Arial, Helvetica, sans-serif; }
.serp-site { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.serp-fav { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--text-muted); }
.serp-name { font-size: 14px; color: var(--text); line-height: 1.3; }
.serp-url { font-size: 12px; color: var(--text-muted); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 520px; }
.serp-title { font-size: 20px; line-height: 1.3; color: #1a0dab; margin: 2px 0 3px; overflow-wrap: anywhere; }
[data-theme="dark"] .serp-title { color: #99c3ff; }
.serp-desc { font-size: 14px; line-height: 1.58; color: var(--text-muted); overflow-wrap: anywhere; }
.social-card { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); max-width: 520px; }
.social-img { aspect-ratio: 1.91 / 1; background: var(--surface-3); display: grid; place-items: center; color: var(--text-muted); font-size: .85rem; overflow: hidden; }
.social-img img { width: 100%; height: 100%; object-fit: cover; }
.social-body { padding: 10px 12px; border-top: 1px solid var(--border); }
.social-domain { font-size: .76rem; text-transform: uppercase; color: var(--text-muted); letter-spacing: .02em; }
.social-title { font-weight: 700; font-size: .98rem; line-height: 1.3; margin: 2px 0; overflow-wrap: anywhere; }
.social-desc { font-size: .86rem; color: var(--text-muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Readability highlights */
.hl-long { background: rgba(245, 185, 85, .28); background: color-mix(in srgb, var(--warning) 22%, transparent); border-radius: 3px; }
.hl-vlong { background: rgba(240, 100, 90, .26); background: color-mix(in srgb, var(--danger) 22%, transparent); border-radius: 3px; }
.highlight-out { padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); line-height: 1.75; max-height: 420px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.pw-out { font-family: var(--font-mono); font-size: clamp(1rem, .9rem + .8vw, 1.35rem); padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; overflow-wrap: anywhere; word-break: break-all; min-height: 56px; }

/* 8. ARTICLE (PROSE) ------------------------------------------------------- */
.prose { max-width: 76ch; font-size: 1.02rem; line-height: 1.72; }
.prose h2 { margin-top: 2.1em; padding-top: .2em; }
.prose h3 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.35em; margin: 0 0 1.1em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--brand); font-weight: 700; }
.prose strong { font-weight: 700; }
.prose table { margin: 1em 0 1.4em; font-size: .94rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); }
.prose .table-wrap table { margin: 0; }
.prose .table-wrap th, .prose .table-wrap td { border-width: 0 0 1px; }
.prose blockquote { margin: 1.2em 0; padding: 4px 0 4px 18px; border-left: 4px solid var(--brand); color: var(--text-muted); }
.prose code { background: var(--surface-2); border: 1px solid var(--border); padding: 1px 5px; border-radius: 5px; font-size: .88em; overflow-wrap: anywhere; }
.formula {
  margin: 1em 0 1.3em; padding: 14px 16px; border-radius: 12px; background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent); font-family: var(--font-mono); font-size: .92rem;
  line-height: 1.7; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text);
}
.example { margin: 1em 0 1.4em; padding: 16px 18px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--pulse); }
.example > :last-child { margin-bottom: 0; }
.example-title { font-weight: 800; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.disclaimer-line { font-size: .88rem; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 14px; margin-top: 28px; }
.legal h2 { font-size: 1.3rem; }
.legal h3 { font-size: 1.06rem; }
.toc { padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin: 0 0 24px; font-size: .95rem; }
.toc ol { margin: 6px 0 0; padding-left: 1.3em; columns: 2 220px; column-gap: 28px; }
.toc li { margin-bottom: 4px; break-inside: avoid; }

/* 9. FAQ ------------------------------------------------------------------- */
.faq { margin-top: 36px; max-width: 76ch; }
.faq-list { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.faq-item + .faq-item { border-top: 1px solid var(--border); }
.faq-item h3 { margin: 0; font-size: 1rem; }
.faq-q {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 18px; background: none; border: 0; text-align: left; font: inherit; font-weight: 650; color: var(--text);
  cursor: pointer; line-height: 1.4;
}
.faq-q:hover { background: var(--surface-2); }
.faq-q .icon { flex-shrink: 0; transition: transform .2s; color: var(--text-muted); }
.faq-q[aria-expanded="true"] .icon { transform: rotate(180deg); color: var(--brand); }
.faq-a { padding: 0 18px 16px; color: var(--text-muted); line-height: 1.65; }
.faq-a p:last-child { margin-bottom: 0; }

.related { margin-top: 40px; }
.related .tool-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }

.side-box { padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); margin-top: 20px; }
.side-box h2 { font-size: 1rem; margin-bottom: 10px; }
.side-box ul { list-style: none; margin: 0; padding: 0; }
.side-box li a { display: flex; align-items: center; gap: 10px; padding: 7px 0; text-decoration: none; color: var(--text); font-weight: 600; font-size: .92rem; }
.side-box li a:hover { color: var(--brand); }
.side-box .icon { color: var(--brand); width: 18px; height: 18px; flex-shrink: 0; }

/* 10. AD SLOTS ------------------------------------------------------------- */
/* Fixed min-heights reserve space so ads cannot shift the layout (CLS = 0).
   Generous margins keep every slot well away from buttons and inputs. */
.ad-slot { display: block; width: 100%; margin: 28px auto; overflow: hidden; }
/* Empty slots take no space until an ad unit (<ins class="adsbygoogle">) is placed inside.
   Two separate rules, so browsers without :has() still apply the first one. */
.ad-slot:empty { display: none !important; }
.ad-slot:not(:has(ins.adsbygoogle)) { display: none !important; }
.ad-slot--header { min-height: 100px; margin: 16px auto 8px; max-width: 970px; }
.ad-slot--incontent { min-height: 280px; margin: 40px auto; }
.ad-slot--midarticle { min-height: 280px; margin: 36px auto; }
.ad-slot--sidebar { min-height: 600px; margin: 0; }
.ad-slot--footer { min-height: 100px; margin: 40px auto 28px; max-width: 970px; }
@media (min-width: 768px) {
  .ad-slot--header, .ad-slot--footer { min-height: 90px; }
}

/* 11. FOOTER --------------------------------------------------------------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding-top: 36px; font-size: .94rem; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer-brand p { color: var(--text-muted); margin: 12px 0 0; max-width: 36ch; }
.footer-note { display: flex; gap: 8px; align-items: flex-start; font-size: .88rem; }
.footer-note .icon { color: var(--brand); flex-shrink: 0; margin-top: 2px; }
.footer-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-bottom: 10px; font-weight: 800; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 4px; }
.site-footer nav a, .site-footer .link-btn { display: inline-block; padding: 5px 0; color: var(--text); text-decoration: none; font-size: .94rem; }
.site-footer nav a:hover, .site-footer .link-btn:hover { color: var(--brand); text-decoration: underline; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; padding-block: 20px 28px; margin-top: 28px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: .85rem; }
.footer-bottom p { margin: 0; }

/* 12. COOKIE BANNER -------------------------------------------------------- */
.cookie-banner {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 250; max-width: 760px; margin-inline: auto;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: 0 10px 40px -10px rgba(0,0,0,.35);
  padding: 14px 16px;
}
.cookie-inner { display: flex; flex-direction: column; gap: 12px; }
.cookie-text { margin: 0; font-size: .88rem; line-height: 1.5; color: var(--text); }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cookie-actions .btn { flex: 1 1 140px; }
@media (min-width: 700px) {
  .cookie-inner { flex-direction: row; align-items: center; }
  .cookie-actions { flex-wrap: nowrap; }
  .cookie-actions .btn { flex: 0 0 auto; }
}

/* Contact form */
.contact-grid { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .contact-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } }

/* 404 */
.notfound { text-align: center; padding: 40px 0 20px; }
.notfound .code { font-size: clamp(4rem, 3rem + 6vw, 7rem); font-weight: 900; color: var(--brand); line-height: 1; letter-spacing: -.04em; }

/* 13. UTILITIES ------------------------------------------------------------ */
.muted { color: var(--text-muted); }
.small { font-size: .88rem; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.flex { display: flex; } .gap-1 { gap: 8px; } .items-center { align-items: center; } .wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }

/* 14. MOTION --------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .hero-pulse path { stroke-dashoffset: 0; }
}
@media print {
  .site-header, .site-footer, .ad-slot, .cookie-banner, .sidebar, .tool-actions, .related { display: none !important; }
  body { background: #fff; color: #000; }
}

/* Homepage refinements */
.cat-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
@media (max-width: 639px) {
  .chip-row--scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: thin; }
  .chip-row--scroll .chip { flex-shrink: 0; }
}
.result-label { margin-top: 0; }
.result-value { margin: 0 0 4px; }

/* Editor's tip (shared component at the end of each tool article) */
.editor-tip { margin: 2em 0 0; padding: 16px 18px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand); }
.editor-tip p { margin: 0; }
.editor-tip-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px !important; }
.editor-tip-title .icon { color: var(--brand); }
.editor-tip-text { font-size: .98rem; }
.editor-tip-sig { margin-top: 8px !important; font-size: .88rem; color: var(--text-muted); }

/* ==========================================================================
   15. PREMIUM VISUAL LAYER (visual only: colours, surfaces, hero, featured)
   Glass effects use backdrop-filter with the -webkit- prefix; browsers
   without support (e.g. older Safari) get a solid background instead.
   ========================================================================== */

/* Header: glass bar */
.site-header { border-bottom: 1px solid var(--glass-border); }
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .site-header { background: var(--glass); -webkit-backdrop-filter: saturate(1.5) blur(14px); backdrop-filter: saturate(1.5) blur(14px); }
}
.logo-mark svg { filter: drop-shadow(0 4px 10px rgba(34, 211, 238, .35)); }
.logo-bg, [data-theme="dark"] .logo-bg { fill: #0b78c9; }
.logo-hub { color: var(--brand); }
.main-nav a { color: var(--text); }
@media (min-width: 1100px) {
  .main-nav a { position: relative; color: var(--text-muted); }
  .main-nav a:hover, .main-nav a[aria-current="page"] { background: transparent; color: var(--text); }
  .main-nav a[aria-current="page"]::after, .main-nav a:hover::after {
    content: ""; position: absolute; left: 11px; right: 11px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--grad-primary);
  }
  .header-search { width: 300px; }
  .header-search .search-input { border-color: var(--border-strong); background: var(--surface); padding-right: 64px; border-radius: 999px; }
  .header-search .kbd-hint { display: inline-block; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }
}
.kbd-hint {
  display: none; font: 600 .72rem/1 var(--font-sans); color: var(--text-muted); padding: 5px 7px; border-radius: 7px;
  border: 1px solid var(--border-strong); background: var(--surface-2); pointer-events: none;
}
.header-search .search-input:focus ~ .kbd-hint { opacity: 0; }
.icon-btn { border-radius: 12px; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); }
/* Theme toggle becomes a sun/moon switch from 640 px (icon button below that). */
@media (min-width: 640px) {
  .theme-toggle { width: 66px; height: 38px; border-radius: 999px; border-color: var(--border-strong); background: var(--surface-2); position: relative; display: inline-flex; align-items: center; justify-content: space-between; padding: 0 9px; }
  .theme-toggle .icon { display: block !important; width: 16px; height: 16px; position: relative; z-index: 1; color: var(--text-muted); transition: color .2s; }
  .theme-toggle .i-sun { order: 0; } .theme-toggle .i-moon { order: 1; }
  .theme-toggle::before { content: ""; position: absolute; top: 4px; left: 4px; width: 28px; height: 28px; border-radius: 50%; background: var(--grad-primary); box-shadow: var(--shadow-glow); transition: transform .22s ease; }
  [data-theme="dark"] .theme-toggle::before { transform: translateX(28px); }
  [data-theme="light"] .theme-toggle .i-sun, [data-theme="dark"] .theme-toggle .i-moon { color: #fff; }
}

/* Buttons */
.btn { border-radius: 12px; }
.btn-primary { background: #0b78c9; background-image: var(--grad-primary); color: #fff; box-shadow: var(--shadow-glow); }
.btn-primary:hover, [data-theme="dark"] .btn-primary:hover { background: #0a68ae; background-image: linear-gradient(135deg, #0a68ae 0%, #2747d0 100%); color: #fff; }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); }
[data-theme="dark"] .btn-secondary { background: rgba(19, 32, 66, .6); border-color: #3a5290; }
.btn-secondary:hover { border-color: var(--brand); color: var(--text); }
.btn.is-done { background: var(--success); background-image: none; color: #fff; }

/* Surfaces: cards, panels, FAQ, sidebar */
.card, .tool-card, .feature, .faq-list, .side-box, .toc, .editor-tip, .example, .file-item, .serp, .social-card {
  background: var(--card-bg); box-shadow: var(--card-hi), var(--shadow-sm);
}
.tool-card { border-radius: var(--radius-lg); }
.tool-card:hover { border-color: var(--brand); box-shadow: var(--card-hi), var(--shadow); }
[data-theme="dark"] .tool-card:hover { box-shadow: var(--card-hi), 0 0 0 1px rgba(56, 217, 245, .25), 0 16px 36px -18px rgba(34, 211, 238, .45); }
.tool-ico { background: var(--brand-soft); color: var(--brand); border: 1px solid var(--glass-border); }
[data-theme="dark"] .tool-ico { background: linear-gradient(135deg, rgba(34, 211, 238, .16), rgba(79, 140, 255, .14)); }
.tag { background: var(--surface-2); border-color: var(--border); }
[data-theme="dark"] .tag { background: rgba(79, 140, 255, .12); border-color: rgba(120, 165, 255, .28); color: #cfe0ff; }
.chip { border-color: var(--border-strong); background: var(--surface); }
[data-theme="dark"] .chip { background: rgba(14, 23, 48, .7); border-color: rgba(120, 165, 255, .3); }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip[aria-pressed="true"] { background: #0b78c9; background-image: var(--grad-primary); border-color: transparent; color: #fff; }
.chip .icon { color: var(--brand); }
.chip[aria-pressed="true"] .icon { color: #fff; }

/* Tool UI */
.tool-app { border-radius: var(--radius-lg); }
[data-theme="dark"] .tool-app { border-color: rgba(120, 165, 255, .22); box-shadow: var(--card-hi), 0 20px 50px -30px rgba(34, 211, 238, .35); }
.result-panel { border-radius: var(--radius); background: var(--surface-2); box-shadow: var(--card-hi); }
[data-theme="dark"] .result-panel { background: linear-gradient(180deg, #16244a 0%, #111c3b 100%); border-color: rgba(56, 217, 245, .22); }
.stat { border-radius: 12px; }
[data-theme="dark"] .stat { background: rgba(10, 18, 38, .65); }
.input, .select, .textarea { border-radius: 12px; }
[data-theme="dark"] .input, [data-theme="dark"] .select, [data-theme="dark"] .textarea, [data-theme="dark"] .search-input { background: #0a1329; }
.input-group .affix { background: var(--surface-2); }
.seg { border-radius: 14px; }
.seg input:checked + label { background: var(--surface); color: var(--text); }
[data-theme="dark"] .seg input:checked + label { background: #0b78c9; background-image: var(--grad-primary); color: #fff; }
.data-table thead th { background: var(--surface-2); }
.formula { background: var(--brand-soft); border-color: var(--glass-border); }
.example { border-left-color: var(--accent-purple); }
.dropzone { border-radius: var(--radius); }
.dropzone:hover, .dropzone.is-over { border-color: var(--brand); background: var(--brand-soft); }
.notice--warn { border-color: rgba(245, 185, 85, .45); }
.notice--error { border-color: rgba(220, 70, 60, .45); }
.notice--ok { border-color: rgba(60, 190, 130, .45); }
.faq-q[aria-expanded="true"] { color: var(--brand); }

/* Footer */
.site-footer { background: var(--surface); border-top-color: var(--glass-border); }
[data-theme="dark"] .site-footer { background: linear-gradient(180deg, #0a1226 0%, #070c1b 100%); }

/* Cookie banner: glass */
.cookie-banner { border-color: var(--glass-border); }
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  [data-theme="dark"] .cookie-banner { background: rgba(14, 23, 48, .88); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
}

/* ---------- Homepage hero ---------- */
.hero { padding: 26px 0 30px; isolation: isolate; }
.hero-bg { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 70% at 78% 30%, rgba(34, 211, 238, .14), transparent 70%),
    radial-gradient(40% 50% at 98% 0%, rgba(124, 58, 237, .10), transparent 70%),
    radial-gradient(50% 60% at 0% 0%, rgba(37, 99, 235, .08), transparent 70%);
}
[data-theme="dark"] .hero-bg {
  background:
    radial-gradient(60% 70% at 78% 32%, rgba(34, 211, 238, .20), transparent 70%),
    radial-gradient(40% 55% at 100% 0%, rgba(139, 92, 246, .22), transparent 70%),
    radial-gradient(55% 65% at 0% 0%, rgba(37, 99, 235, .18), transparent 70%),
    linear-gradient(180deg, #0a1430 0%, #070c1b 100%);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 24px; }
.hero-inner { max-width: 720px; }
.hero-eyebrow { color: var(--brand); background: var(--brand-soft); border: 1px solid var(--glass-border); letter-spacing: .04em; text-transform: uppercase; font-size: .78rem; }
[data-theme="dark"] .hero-eyebrow { background: rgba(34, 211, 238, .08); border-color: rgba(56, 217, 245, .35); }
.hero h1 { font-size: clamp(2.1rem, 1.3rem + 3.6vw, 3.6rem); line-height: 1.06; letter-spacing: -.03em; }
.hero h1 .accent { color: var(--brand); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero h1 .accent { background-image: var(--grad-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
}
.hero .lead { color: var(--text-muted); }
.hero-search { margin: 24px 0 18px; max-width: 680px; }
.hero-search .search-input {
  height: 60px; padding-right: 118px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
}
[data-theme="dark"] .hero-search .search-input { background: #0b1430; border-color: rgba(79, 140, 255, .45); box-shadow: 0 0 0 1px rgba(34, 211, 238, .08), 0 18px 40px -20px rgba(34, 211, 238, .5); }
.hero-search .search-icon { left: 18px; top: 20px; }
.hero-search-btn { position: absolute; right: 7px; top: 7px; min-height: 46px; padding: 0 22px; border-radius: 12px; font-size: 1rem; }
.hero-search .search-results { top: 66px; }
.popular-label { color: var(--text); }
.hero-visual { display: none; }
.hero-art { display: block; width: 100%; height: auto; max-width: 560px; margin-inline: auto; }
@media (min-width: 960px) {
  .hero { padding: 44px 0 46px; }
  .hero-grid { grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: 32px; }
  .hero-visual { display: block; }
}
/* Hero artwork colours (inline SVG classes) */
.ha-glow { opacity: .45; }
[data-theme="dark"] .ha-glow { opacity: 1; }
.ha-podium { fill: rgba(37, 99, 235, .08); }
[data-theme="dark"] .ha-podium { fill: rgba(30, 58, 138, .35); }
.ha-podium-inner { stroke: rgba(14, 116, 144, .25); stroke-width: 2; }
[data-theme="dark"] .ha-podium-inner { stroke: rgba(103, 232, 249, .3); }
.ha-orbit { opacity: .8; }
.ha-panel-a { stop-color: #ffffff; stop-opacity: .95; }
.ha-panel-b { stop-color: #dbeafe; stop-opacity: .8; }
[data-theme="dark"] .ha-panel-a { stop-color: #ffffff; stop-opacity: .16; }
[data-theme="dark"] .ha-panel-b { stop-color: #ffffff; stop-opacity: .03; }
.ha-sheen { fill: rgba(255, 255, 255, .55); }
[data-theme="dark"] .ha-sheen { fill: rgba(255, 255, 255, .05); }
.ha-pulse-glow { opacity: .18; }
[data-theme="dark"] .ha-pulse-glow { opacity: .3; }
.ha-tile { fill: #ffffff; stroke: rgba(37, 99, 235, .35); stroke-width: 1.5; }
[data-theme="dark"] .ha-tile { fill: rgba(17, 30, 64, .88); stroke: rgba(103, 232, 249, .55); }
.ha-t2, .ha-t4 { stroke: rgba(124, 58, 237, .35); }
[data-theme="dark"] .ha-t2, [data-theme="dark"] .ha-t4 { stroke: rgba(167, 139, 250, .6); }
.ha-tile-hi { fill: rgba(37, 99, 235, .05); }
[data-theme="dark"] .ha-tile-hi { fill: rgba(255, 255, 255, .05); }
.ha-glyph { fill: none; stroke: #0e7490; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ha-glyph-fill { fill: #0e7490; stroke: none; }
[data-theme="dark"] .ha-glyph { stroke: #67e8f9; }
[data-theme="dark"] .ha-glyph-fill { fill: #67e8f9; }
.ha-t2 + .ha-tile-hi + .ha-glyph, .ha-t4 + .ha-tile-hi + .ha-glyph { stroke: #6d28d9; }
.ha-t2 + .ha-tile-hi + .ha-glyph .ha-glyph-fill, .ha-t4 + .ha-tile-hi + .ha-glyph .ha-glyph-fill { fill: #6d28d9; }
[data-theme="dark"] .ha-t2 + .ha-tile-hi + .ha-glyph, [data-theme="dark"] .ha-t4 + .ha-tile-hi + .ha-glyph { stroke: #c4b5fd; }
[data-theme="dark"] .ha-t2 + .ha-tile-hi + .ha-glyph .ha-glyph-fill, [data-theme="dark"] .ha-t4 + .ha-tile-hi + .ha-glyph .ha-glyph-fill { fill: #c4b5fd; }
.ha-card { fill: #ffffff; stroke: rgba(124, 58, 237, .28); stroke-width: 1.5; }
[data-theme="dark"] .ha-card { fill: rgba(17, 30, 64, .85); stroke: rgba(167, 139, 250, .45); }
.ha-card-lines rect { fill: rgba(37, 99, 235, .22); }
[data-theme="dark"] .ha-card-lines rect { fill: rgba(147, 197, 253, .4); }
.ha-float { animation: ha-float 7s ease-in-out infinite; transform-box: fill-box; }
@keyframes ha-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.ha-pulse-line { stroke-dasharray: 700; stroke-dashoffset: 700; animation: pulse-draw 2.4s ease-out .3s forwards; }

/* ---------- Explore popular tools ---------- */
.section--featured { padding-top: 12px; }
.section-head--row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; }
.section-head--row h2 { margin-bottom: 4px; }
.view-all { border-radius: 999px; }
.featured-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.feature-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 22px; border-radius: var(--radius-lg);
  background: var(--card-bg); border: 1px solid var(--border); box-shadow: var(--card-hi), var(--shadow);
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
[data-theme="dark"] .feature-card { background: #111c3a; border-color: rgba(120, 165, 255, .22); }
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  [data-theme="dark"] .feature-card { background: linear-gradient(180deg, rgba(30, 46, 92, .55) 0%, rgba(14, 23, 48, .62) 100%); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
}
.feature-card:hover { transform: translateY(-3px); border-color: var(--brand); }
[data-theme="dark"] .feature-card:hover { box-shadow: var(--card-hi), 0 0 0 1px rgba(56, 217, 245, .3), 0 22px 44px -22px rgba(34, 211, 238, .55); }
.fc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.fc-ico { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--glass-border); }
[data-theme="dark"] .fc-ico { background: linear-gradient(135deg, rgba(34, 211, 238, .12), rgba(139, 92, 246, .12)); }
.feature-card h3 { font-size: 1.12rem; margin: 6px 0 0; }
.feature-card p { margin: 0; color: var(--text-muted); font-size: .93rem; flex-grow: 1; }
.fc-btn { align-self: flex-start; margin-top: 6px; border-radius: 999px; }
.featured-grid > .feature-card:nth-child(even) .fc-btn { background: #6d28d9; background-image: var(--grad-purple); }
.trust-strip { list-style: none; margin: 26px 0 0; padding: 16px 18px; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr);
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
[data-theme="dark"] .trust-strip { background: rgba(14, 23, 48, .7); border-color: rgba(120, 165, 255, .18); }
.trust-strip li { display: flex; align-items: center; gap: 12px; font-size: .95rem; color: var(--text-muted); }
.trust-strip strong { color: var(--text); font-weight: 700; }
.trust-strip .icon { flex-shrink: 0; color: var(--brand); }
@media (min-width: 860px) {
  .trust-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 18px 22px; }
  .trust-strip li + li { border-left: 1px solid var(--border); padding-left: 18px; }
}

/* Remaining homepage sections */
.feature { border-radius: var(--radius-lg); }
.cat-grid .tool-card { border-radius: var(--radius-lg); }
.section-head h2 { letter-spacing: -.02em; }

@media (prefers-reduced-motion: reduce) {
  .ha-float { animation: none; }
  .ha-pulse-line { stroke-dashoffset: 0; animation: none; }
  .feature-card:hover, .tool-card:hover { transform: none; }
}

/* ---------- Share row (tool pages) and footer social links ---------- */
.share-row { margin: 36px 0 8px; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card-bg); box-shadow: var(--card-hi); }
[data-theme="dark"] .share-row { background: rgba(14, 23, 48, .7); border-color: rgba(120, 165, 255, .2); }
.share-title { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-weight: 800; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text); }
.share-title .icon { color: var(--brand); }
.share-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.share-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: 600 .9rem/1 var(--font-sans);
  text-decoration: none; cursor: pointer; transition: border-color .15s, color .15s, background .15s;
}
[data-theme="dark"] .share-btn { background: rgba(14, 23, 48, .7); border-color: rgba(120, 165, 255, .3); }
.share-btn .icon { color: var(--brand); flex-shrink: 0; }
.share-btn:hover { border-color: var(--brand); color: var(--brand); }
.share-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.footer-social { margin-top: 16px; }
.footer-social-title { margin: 0 0 8px; font-weight: 700; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.social-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.social-link { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); }
.social-link:hover { border-color: var(--brand); color: var(--brand); }
.social-link:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media print { .share-row { display: none !important; } }
