/* ============================================================
   SwiftTools — Design System (Gen Z refresh)
   Clean minimal base + electric indigo energy.
   Light/dark via [data-theme="dark"]. Single file, no frameworks.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --st-accent: #5f2ded;
  --st-accent-hover: #4c1fd4;
  --st-accent-soft: #efe9ff;
  --st-accent-ink: #3f0fae;
  --st-grad: linear-gradient(100deg, #7c3aed 0%, #4f46e5 55%, #3b82f6 100%);

  --st-bg: #ffffff;
  --st-bg-soft: #f7f7fb;
  --st-bg-card: #ffffff;
  --st-bg-header: rgba(255, 255, 255, 0.86);

  --st-text: #14141c;
  --st-text-muted: #5c5c70;
  --st-text-faint: #8f8fa3;

  --st-border: #e8e8f1;
  --st-border-soft: #f2f2f8;

  --st-shadow-sm: 0 1px 2px rgba(20, 20, 40, 0.05);
  --st-shadow-md: 0 6px 18px rgba(20, 20, 40, 0.08);
  --st-shadow-lg: 0 16px 44px rgba(20, 20, 40, 0.14);

  --st-success: #16a34a;
  --st-warning: #d97706;
  --st-danger: #dc2626;
  --st-info: #0284c7;

  --st-radius: 18px;
  --st-radius-sm: 12px;
  --st-radius-xs: 8px;
  --st-pill: 999px;

  --st-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --st-display: "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  --st-font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;

  --st-header-h: 66px;
  --st-maxw: 1160px;
}

[data-theme="dark"] {
  --st-accent: #a78bfa;
  --st-accent-hover: #c4b5fd;
  --st-accent-soft: #20164a;
  --st-accent-ink: #d9ccff;
  --st-grad: linear-gradient(100deg, #a78bfa 0%, #818cf8 55%, #60a5fa 100%);

  --st-bg: #0b0b13;
  --st-bg-soft: #11111b;
  --st-bg-card: #14141f;
  --st-bg-header: rgba(11, 11, 19, 0.86);

  --st-text: #f1f1f8;
  --st-text-muted: #a9a9c0;
  --st-text-faint: #71718a;

  --st-border: #23232f;
  --st-border-soft: #1a1a26;

  --st-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --st-shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
  --st-shadow-lg: 0 16px 44px rgba(0, 0, 0, 0.55);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

/* Global list reset — no bullet leaks in chrome components.
   Semantic lists are re-styled explicitly below (.prose, .steps, .checklist). */
ul, ol { margin: 0; padding: 0; list-style: none; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--st-font);
  background: var(--st-bg);
  color: var(--st-text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { max-width: 100%; }
img { height: auto; }

/* CRITICAL: icon sizing guard — inline SVGs must never render at
   browser default size. Every icon context sets an explicit size. */
svg.icon {
  display: block;
  width: 1.2em;
  height: 1.2em;
  flex-shrink: 0;
}

a { color: var(--st-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--st-display);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  font-weight: 700;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 4.6vw, 2.9rem); }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.75rem); margin-top: 1.6em; }
h3 { font-size: 1.12rem; }

p { margin: 0 0 1em; }
main { display: block; }

.container {
  width: 100%;
  max-width: var(--st-maxw);
  margin: 0 auto;
  padding: 0 20px;
}
.container.narrow { max-width: 720px; }

section { padding: 44px 0; }

.lead { font-size: 1.12rem; color: var(--st-text-muted); }

/* Gradient accent word (hero headline) */
.grad {
  background: var(--st-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* ---------- Accessibility ---------- */
:focus-visible {
  outline: 3px solid var(--st-accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--st-accent);
  color: #fff;
  padding: 10px 16px;
  z-index: 500;
  border-radius: 0 0 10px 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; color: #fff; }

/* Standard visually-hidden clip pattern (do not "simplify" this) */
.visually-hidden,
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

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

/* ============================================================
   HEADER — sticky glass bar. Uses min-height (never fixed height)
   so nothing can be clipped at the viewport edge.
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--st-bg-header);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--st-border);
  overflow: visible;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: var(--st-header-h);
  padding-top: 8px;
  padding-bottom: 8px;
  /* NOTE: not positioned — the mobile .main-nav panel anchors to
     .site-header (sticky) so it spans the full viewport width. */
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--st-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--st-text);
  flex-shrink: 0;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 34px;
  height: 34px;
  padding: 7px;
  box-sizing: border-box;
  border-radius: 11px;
  background: var(--st-grad);
  color: #fff;
  display: block;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(95, 45, 237, 0.35);
}
.site-footer .logo-mark { display: none; }

/* ---------- Primary nav: horizontal row, no bullets ---------- */
.main-nav { display: flex; align-items: center; margin-left: 6px; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-menu > li { display: flex; align-items: center; }

.nav-menu > li > a,
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: var(--st-pill);
  color: var(--st-text-muted);
  font-weight: 600;
  font-size: 0.94rem;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: var(--st-font);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.nav-menu > li > a:hover,
.nav-btn:hover {
  color: var(--st-text);
  background: var(--st-bg-soft);
  text-decoration: none;
}
.nav-btn::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.7;
  transition: transform 0.18s;
}
.nav-dropdown.open .nav-btn::after { transform: rotate(-135deg); }

/* ---------- Categories dropdown ---------- */
.nav-dropdown { position: relative; }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 264px;
  max-width: 320px;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: var(--st-bg-card);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  box-shadow: var(--st-shadow-lg);
  display: none;
  z-index: 210;
}
.nav-dropdown.open .dropdown-menu { display: block; }

.dropdown-menu li { margin: 0; padding: 0; list-style: none; }
.dropdown-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--st-text);
  font-size: 0.94rem;
  font-weight: 500;
}
.dropdown-menu a:hover {
  background: var(--st-accent-soft);
  color: var(--st-accent-ink);
  text-decoration: none;
}
.dropdown-menu a .count {
  font-size: 0.75rem;
  color: var(--st-text-faint);
  background: var(--st-bg-soft);
  border-radius: var(--st-pill);
  padding: 2px 9px;
  font-weight: 600;
}
.dropdown-menu a:hover .count {
  background: rgba(255, 255, 255, 0.6);
  color: var(--st-accent-ink);
}

/* ---------- Hamburger (mobile only) ---------- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  margin-left: auto;
  background: var(--st-bg-soft);
  border: 1px solid var(--st-border);
  border-radius: 12px;
  cursor: pointer;
  color: var(--st-text);
  padding: 0;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle:hover { border-color: var(--st-accent); color: var(--st-accent); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Header search ---------- */
.header-search {
  position: relative;
  margin-left: auto;
  width: min(300px, 32vw);
  flex-shrink: 1;
}
.header-search input {
  width: 100%;
  padding: 10px 16px 10px 38px;
  border: 1px solid var(--st-border);
  border-radius: var(--st-pill);
  background: var(--st-bg-soft) 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='%238f8fa3' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 13px center;
  color: var(--st-text);
  font-size: 0.9rem;
  font-family: var(--st-font);
}
.header-search input:focus {
  outline: none;
  border-color: var(--st-accent);
  background-color: var(--st-bg-card);
  box-shadow: 0 0 0 3px var(--st-accent-soft);
}
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--st-bg-card);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  box-shadow: var(--st-shadow-lg);
  max-height: 340px;
  overflow-y: auto;
  display: none;
  z-index: 220;
  padding: 6px;
}
.search-results.open { display: block; }
.search-results ul { margin: 0; padding: 0; list-style: none; }
.search-results li { margin: 0; padding: 0; }
.search-results a {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--st-text);
}
.search-results a:hover { background: var(--st-accent-soft); text-decoration: none; }
.sr-name { font-weight: 600; font-size: 0.92rem; }
.sr-cat { font-size: 0.76rem; color: var(--st-text-faint); }
.sr-empty { padding: 14px; color: var(--st-text-muted); font-size: 0.9rem; }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--st-border);
  background: var(--st-bg-soft);
  color: var(--st-text-muted);
  cursor: pointer;
  font-size: 1.15rem;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s, transform 0.15s;
}
.theme-toggle:hover { color: var(--st-accent); border-color: var(--st-accent); transform: rotate(20deg); }
.theme-toggle .icon { width: 1em; height: 1em; }

/* ============================================================
   BUTTONS
   ============================================================ */
.st-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--st-pill);
  border: 1px solid transparent;
  font-family: var(--st-font);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s, background 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.st-btn:hover { text-decoration: none; transform: translateY(-1px); }
.st-btn:active { transform: translateY(0); }
.st-btn-primary {
  background: var(--st-grad);
  color: #fff;
  box-shadow: 0 6px 16px rgba(95, 45, 237, 0.32);
}
.st-btn-primary:hover { box-shadow: 0 8px 22px rgba(95, 45, 237, 0.42); color: #fff; }
.st-btn-secondary {
  background: var(--st-bg-card);
  border-color: var(--st-border);
  color: var(--st-text);
}
.st-btn-secondary:hover { border-color: var(--st-accent); color: var(--st-accent); }
.st-btn-danger { background: var(--st-danger); color: #fff; }
.st-btn-group { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  text-align: center;
  padding: 76px 0 60px;
  position: relative;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 260px at 50% -40px, var(--st-accent-soft), transparent 70%);
  pointer-events: none;
}
.hero .container { position: relative; }
.hero h1 {
  font-size: clamp(2.3rem, 5.4vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  margin: 0 auto 16px;
  max-width: 18ch;
}
.hero-sub {
  font-size: clamp(1.02rem, 2vw, 1.2rem);
  color: var(--st-text-muted);
  max-width: 44ch;
  margin: 0 auto 30px;
}
.hero-search {
  position: relative;
  display: flex;
  gap: 8px;
  max-width: 560px;
  margin: 0 auto 18px;
  background: var(--st-bg-card);
  border: 1px solid var(--st-border);
  border-radius: var(--st-pill);
  padding: 6px;
  box-shadow: var(--st-shadow-md);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.hero-search:focus-within {
  border-color: var(--st-accent);
  box-shadow: 0 0 0 4px var(--st-accent-soft), var(--st-shadow-md);
}
.hero-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 10px 18px;
  font-size: 1rem;
  color: var(--st-text);
  font-family: var(--st-font);
}
.hero-search input:focus { outline: none; }
.hero-note {
  font-size: 0.86rem;
  color: var(--st-text-faint);
  font-weight: 500;
  margin: 0;
}

/* ============================================================
   SECTIONS & GRIDS
   ============================================================ */
.home-section { padding: 30px 0; }
.home-section h2, .section-head h2 { margin: 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.view-all { font-weight: 600; font-size: 0.92rem; white-space: nowrap; }

.card-grid, .cards-grid, .related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

/* ============================================================
   ICON CHIPS — compact 44px tinted chips, never giant.
   Per-category hue via --chip-fg; background is a soft tint that
   adapts to light/dark automatically (color-mix).
   ============================================================ */
.tool-card-icon,
.category-card-icon,
.tool-header-icon {
  --chip-fg: var(--st-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--st-accent-soft);
  background: color-mix(in srgb, var(--chip-fg) 13%, var(--st-bg-card));
  color: var(--chip-fg);
}
.tool-card-icon { width: 44px; height: 44px; border-radius: 14px; }
.tool-card-icon .icon { width: 22px; height: 22px; }
.category-card-icon { width: 50px; height: 50px; border-radius: 16px; }
.category-card-icon .icon { width: 25px; height: 25px; }
.tool-header-icon { width: 58px; height: 58px; border-radius: 18px; }
.tool-header-icon .icon { width: 29px; height: 29px; }

/* Per-category hues — tool cards (data-category) */
.tool-card[data-category="PDF Tools"] .tool-card-icon { --chip-fg: #e11d48; }
.tool-card[data-category="Image Tools"] .tool-card-icon { --chip-fg: #ea580c; }
.tool-card[data-category="Document Tools"] .tool-card-icon { --chip-fg: #2563eb; }
.tool-card[data-category="Text Tools"] .tool-card-icon { --chip-fg: #0d9488; }
.tool-card[data-category="Calculators"] .tool-card-icon { --chip-fg: #059669; }
.tool-card[data-category="Converters"] .tool-card-icon { --chip-fg: #0891b2; }
.tool-card[data-category="Developer Tools"] .tool-card-icon { --chip-fg: #4f46e5; }
.tool-card[data-category="SEO Tools"] .tool-card-icon { --chip-fg: #65a30d; }
.tool-card[data-category="URL Tools"] .tool-card-icon { --chip-fg: #0284c7; }
.tool-card[data-category="QR Code Tools"] .tool-card-icon { --chip-fg: #7c3aed; }
.tool-card[data-category="Security Tools"] .tool-card-icon { --chip-fg: #dc2626; }
.tool-card[data-category="Career Tools"] .tool-card-icon { --chip-fg: #be185d; }
.tool-card[data-category="Student Tools"] .tool-card-icon { --chip-fg: #a16207; }
.tool-card[data-category="Business Tools"] .tool-card-icon { --chip-fg: #9333ea; }
.tool-card[data-category="Social Media Tools"] .tool-card-icon { --chip-fg: #db2777; }

/* Per-category hues — category cards (href) */
.category-card[href="/pdf-tools/"] .category-card-icon { --chip-fg: #e11d48; }
.category-card[href="/image-tools/"] .category-card-icon { --chip-fg: #ea580c; }
.category-card[href="/document-tools/"] .category-card-icon { --chip-fg: #2563eb; }
.category-card[href="/text-tools/"] .category-card-icon { --chip-fg: #0d9488; }
.category-card[href="/calculators/"] .category-card-icon { --chip-fg: #059669; }
.category-card[href="/converters/"] .category-card-icon { --chip-fg: #0891b2; }
.category-card[href="/developer-tools/"] .category-card-icon { --chip-fg: #4f46e5; }
.category-card[href="/seo-tools/"] .category-card-icon { --chip-fg: #65a30d; }
.category-card[href="/url-tools/"] .category-card-icon { --chip-fg: #0284c7; }
.category-card[href="/qr-tools/"] .category-card-icon { --chip-fg: #7c3aed; }
.category-card[href="/security-tools/"] .category-card-icon { --chip-fg: #dc2626; }
.category-card[href="/career-tools/"] .category-card-icon { --chip-fg: #be185d; }
.category-card[href="/student-tools/"] .category-card-icon { --chip-fg: #a16207; }
.category-card[href="/business-tools/"] .category-card-icon { --chip-fg: #9333ea; }
.category-card[href="/social-media-tools/"] .category-card-icon { --chip-fg: #db2777; }

/* ============================================================
   TOOL CARDS
   ============================================================ */
.tool-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--st-bg-card);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  padding: 18px;
  color: var(--st-text);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.tool-card:hover {
  text-decoration: none;
  transform: translateY(-4px);
  box-shadow: var(--st-shadow-md);
  border-color: var(--st-accent);
}
.tool-card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding-top: 2px;
}
.tool-card-body strong {
  font-family: var(--st-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--st-text);
}
.tool-card-body span {
  font-size: 0.86rem;
  color: var(--st-text-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: var(--st-pill);
  background: var(--st-accent-soft);
  color: var(--st-accent-ink);
  border: 1px solid color-mix(in srgb, var(--st-accent) 25%, transparent);
}
.tool-card[data-status="coming-soon"] { opacity: 0.85; }

/* ============================================================
   CATEGORY CARDS
   ============================================================ */
.category-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  background: var(--st-bg-card);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  padding: 22px 20px;
  color: var(--st-text);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.category-card:hover {
  text-decoration: none;
  transform: translateY(-4px);
  box-shadow: var(--st-shadow-md);
  border-color: var(--st-accent);
}
.category-card strong {
  font-family: var(--st-display);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.category-card span:last-child {
  font-size: 0.88rem;
  color: var(--st-text-muted);
  line-height: 1.5;
}

/* ============================================================
   BLOG
   ============================================================ */
.blog-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--st-bg-card);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  padding: 22px;
  color: var(--st-text);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.blog-card:hover {
  text-decoration: none;
  transform: translateY(-4px);
  box-shadow: var(--st-shadow-md);
  border-color: var(--st-accent);
}
.blog-card strong {
  font-family: var(--st-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.blog-date {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--st-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.blog-card > span:last-child {
  font-size: 0.92rem;
  color: var(--st-text-muted);
}
.blog-article { max-width: 760px; margin: 0 auto; }
.article-meta {
  color: var(--st-text-faint);
  font-size: 0.88rem;
  margin-bottom: 24px;
}
.article-body { font-size: 1.05rem; line-height: 1.75; }
.article-body p, .article-body ul, .article-body ol { margin-bottom: 1.2em; }

/* ============================================================
   PAGE CHROME — headers, breadcrumbs, directory search
   ============================================================ */
.page-header { padding: 44px 0 8px; text-align: left; }
.page-header h1 { margin-bottom: 8px; }
.page-header .lead { margin: 0; max-width: 60ch; }

.breadcrumb { padding: 18px 0 0; font-size: 0.86rem; }
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.breadcrumb li { display: inline-flex; align-items: center; gap: 8px; }
.breadcrumb li + li::before { content: "/"; color: var(--st-text-faint); }
.breadcrumb [aria-current="page"] { color: var(--st-text-muted); font-weight: 500; }

.tool-search-row { margin: 22px 0 6px; max-width: 520px; }
.tool-search-row input {
  width: 100%;
  padding: 13px 20px;
  border: 1px solid var(--st-border);
  border-radius: var(--st-pill);
  background: var(--st-bg-card);
  color: var(--st-text);
  font-size: 1rem;
  font-family: var(--st-font);
  box-shadow: var(--st-shadow-sm);
}
.tool-search-row input:focus {
  outline: none;
  border-color: var(--st-accent);
  box-shadow: 0 0 0 3px var(--st-accent-soft);
}
.search-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--st-text-muted);
  font-size: 1.02rem;
  display: none;
}

/* ============================================================
   TOOL PAGE
   ============================================================ */
.tool-page { padding-bottom: 40px; }
.tool-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 36px 0 10px;
}
.tool-header h1 { margin: 0 0 6px; font-size: clamp(1.7rem, 3.6vw, 2.4rem); }
.tool-header .tagline, .tool-header .lead { margin: 0; font-size: 1.05rem; color: var(--st-text-muted); }

.tool-ui { margin: 22px 0; }
.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
  align-items: start;
}
.tool-main { min-width: 0; }
.tool-panel {
  background: var(--st-bg-card);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  padding: 26px;
  box-shadow: var(--st-shadow-sm);
}
.tool-description { color: var(--st-text-muted); }

.content-section { margin: 30px 0; }
.content-section h2 { margin-bottom: 14px; }

ol.steps {
  list-style: decimal;
  padding-left: 1.5em;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  counter-reset: steps;
}
ol.steps li { padding-left: 4px; color: var(--st-text-muted); }
ol.steps li::marker { color: var(--st-accent); font-weight: 700; }

ul.checklist {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
ul.checklist li {
  position: relative;
  padding-left: 34px;
  color: var(--st-text-muted);
}
ul.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 1px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--st-accent-soft);
  color: var(--st-accent-ink);
  font-size: 0.78rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

ul.tips-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
ul.tips-list li {
  position: relative;
  padding-left: 34px;
  color: var(--st-text-muted);
}
ul.tips-list li::before {
  content: "💡";
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.why-card {
  background: var(--st-bg-card);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  padding: 22px 20px;
}
.why-card h3 {
  font-size: 1.02rem;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.why-card h3::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 4px;
  background: var(--st-grad);
  flex-shrink: 0;
}
.why-card p { margin: 0; font-size: 0.92rem; color: var(--st-text-muted); }

.privacy-note {
  background: var(--st-accent-soft);
  border: 1px solid color-mix(in srgb, var(--st-accent) 22%, transparent);
  border-radius: var(--st-radius);
  padding: 22px 24px;
}
.privacy-note h2 { margin-top: 0; font-size: 1.15rem; }
.privacy-note p { margin: 0; color: var(--st-accent-ink); font-size: 0.95rem; }
[data-theme="dark"] .privacy-note p { color: var(--st-text); }

.legal-page { max-width: 780px; }
.legal-page h1 { margin: 34px 0 18px; }

/* Coming soon */
.coming-soon-box {
  text-align: center;
  padding: 56px 28px;
  background: var(--st-bg-soft);
  border: 1px dashed var(--st-border);
  border-radius: var(--st-radius);
}
.coming-soon-box .cs-icon { font-size: 2.6rem; }
.coming-soon-box h2 { margin: 12px 0 8px; }
.coming-soon-box p { color: var(--st-text-muted); max-width: 52ch; margin: 0 auto 10px; }

/* ============================================================
   FAQ
   ============================================================ */
.faq-list { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }
.faq-item {
  background: var(--st-bg-card);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  overflow: hidden;
}
.faq-item summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  font-family: var(--st-display);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.3rem;
  color: var(--st-accent);
  font-weight: 400;
  flex-shrink: 0;
  transition: transform 0.18s;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-answer { padding: 0 20px 18px; color: var(--st-text-muted); }

/* ============================================================
   TOOL UI PRIMITIVES (st-*)
   ============================================================ */
.st-field { margin-bottom: 18px; }
.st-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 8px;
}
.st-input, .st-textarea, .st-select {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-bg);
  color: var(--st-text);
  font-size: 0.97rem;
  font-family: var(--st-font);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.st-input:focus, .st-textarea:focus, .st-select:focus {
  outline: none;
  border-color: var(--st-accent);
  box-shadow: 0 0 0 3px var(--st-accent-soft);
}
.st-textarea { min-height: 130px; resize: vertical; font-family: var(--st-font-mono); font-size: 0.9rem; }
input[type="range"].st-input { padding: 0; accent-color: var(--st-accent); }
input[type="color"].st-input { padding: 4px; height: 46px; cursor: pointer; }
input[type="checkbox"].st-input, input[type="radio"].st-input {
  width: 1.15em; height: 1.15em; accent-color: var(--st-accent); flex-shrink: 0;
}

.st-hint { font-size: 0.85rem; color: var(--st-text-faint); margin-top: 6px; }
.st-error {
  display: none;
  background: color-mix(in srgb, var(--st-danger) 10%, var(--st-bg-card));
  border: 1px solid color-mix(in srgb, var(--st-danger) 35%, transparent);
  color: var(--st-danger);
  padding: 12px 16px;
  border-radius: var(--st-radius-sm);
  margin: 14px 0;
  font-size: 0.92rem;
  font-weight: 500;
}
.st-error.show { display: block; }
.st-error:not([hidden]) { display: block; }
.st-result {
  display: none;
  margin-top: 18px;
  padding: 20px;
  background: var(--st-bg-soft);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  word-break: break-word;
}
.st-result.show { display: block; animation: st-fade 0.25s ease; }
.st-result:not([hidden]) { display: block; animation: st-fade 0.25s ease; }
@keyframes st-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.st-drop {
  border: 2px dashed var(--st-border);
  border-radius: var(--st-radius);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
  background: var(--st-bg-soft);
}
.st-drop:hover { border-color: var(--st-accent); }
.st-drop.st-drop-over {
  border-color: var(--st-accent);
  background: var(--st-accent-soft);
  transform: scale(1.01);
}
.st-drop .drop-icon { font-size: 2.2rem; margin-bottom: 8px; }
.st-drop p { margin: 4px 0; color: var(--st-text-muted); font-size: 0.94rem; }

.st-progress {
  display: none;
  height: 10px;
  background: var(--st-bg-soft);
  border-radius: var(--st-pill);
  overflow: hidden;
  margin: 14px 0;
  border: 1px solid var(--st-border);
}
.st-progress.show { display: block; }
.st-progress-bar {
  height: 100%;
  width: 0;
  background: var(--st-grad);
  border-radius: var(--st-pill);
  transition: width 0.25s ease;
}

.st-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.st-output {
  background: var(--st-bg);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  padding: 16px;
  font-family: var(--st-font-mono);
  font-size: 0.88rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow-y: auto;
  margin: 12px 0;
}

.st-table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 0.93rem; }
.st-table th, .st-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--st-border);
  text-align: left;
}
.st-table th { font-weight: 700; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--st-text-muted); }
.st-table tr:last-child td { border-bottom: 0; }

.st-checkrow { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.st-checkrow .check-label { font-size: 0.94rem; }

.st-stat {
  background: var(--st-bg-soft);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  padding: 16px;
  text-align: center;
}
.st-stat-value {
  font-family: var(--st-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--st-accent);
  letter-spacing: -0.02em;
}
.st-stat-label { font-size: 0.8rem; color: var(--st-text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }

.st-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--st-pill);
  border: 1px solid var(--st-border);
  background: var(--st-bg-card);
  color: var(--st-text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--st-font);
  transition: border-color 0.15s, color 0.15s;
}
.st-copy-btn:hover { border-color: var(--st-accent); color: var(--st-accent); }
.st-copy-btn.copied { border-color: var(--st-success); color: var(--st-success); }

/* ============================================================
   AD SLOTS — single label only. consent.js injects the
   .ad-label into .ad-body after advertising consent; build.py
   renders no static label (prevents doubled text).
   ============================================================ */
.ad-slot {
  margin: 26px auto;
  max-width: 970px;
  /* Reserve space for a standard 90px leaderboard so a late-loading ad
     does not push page content down (layout shift). Real ad units should
     use fixed-size slots that fit inside this reservation. */
  min-height: 90px;
  border: 1px dashed var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-bg-soft);
  text-align: center;
  padding: 10px;
}
.ad-slot .ad-body:empty { min-height: 70px; }
.ad-slot .ad-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}
.ad-label {
  display: inline-block;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--st-text-faint);
  font-weight: 600;
  padding: 6px 0;
}
.ad-slot.ad-disabled { display: none; }

/* ============================================================
   COOKIE CONSENT
   ============================================================ */
.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 400;
  background: var(--st-bg-card);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  box-shadow: var(--st-shadow-lg);
  padding: 20px 22px;
  display: none;
  max-width: 560px;
  margin-left: auto;
}
.cookie-banner.show { display: block; animation: st-fade 0.3s ease; }
.cookie-banner p { font-size: 0.9rem; color: var(--st-text-muted); margin: 0 0 14px; }
.cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 20, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 450;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.cookie-modal-backdrop.show { display: flex; }
.cookie-modal {
  background: var(--st-bg-card);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 26px;
  box-shadow: var(--st-shadow-lg);
}
.cookie-modal h2 { margin-top: 0; font-size: 1.25rem; }
.cookie-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--st-border-soft);
}
.cookie-toggle-row:last-of-type { border-bottom: 0; }
.cookie-toggle-row .ct-title { font-weight: 700; font-size: 0.95rem; }
.cookie-toggle-row .ct-desc { font-size: 0.85rem; color: var(--st-text-muted); margin-top: 2px; }
.cookie-toggle { position: relative; width: 48px; height: 28px; flex-shrink: 0; }
.cookie-toggle input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.cookie-toggle .ct-track {
  position: absolute;
  inset: 0;
  background: var(--st-border);
  border-radius: var(--st-pill);
  transition: background 0.2s;
  pointer-events: none;
}
.cookie-toggle .ct-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--st-shadow-sm);
  transition: transform 0.2s;
}
.cookie-toggle input:checked + .ct-track { background: var(--st-accent); }
.cookie-toggle input:checked + .ct-track::after { transform: translateX(20px); }
.cookie-toggle input:disabled { cursor: not-allowed; }
.cookie-toggle input:disabled + .ct-track { opacity: 0.6; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  margin-top: 60px;
  border-top: 1px solid var(--st-border);
  background: var(--st-bg-soft);
  padding: 52px 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 36px;
  padding-bottom: 40px;
}
.footer-brand .logo { margin-bottom: 12px; }
.footer-brand p { font-size: 0.9rem; color: var(--st-text-muted); max-width: 34ch; }
.site-footer nav h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--st-text-faint);
  margin: 0 0 14px;
  font-family: var(--st-font);
  font-weight: 700;
}
.site-footer nav ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; }
.site-footer nav a { color: var(--st-text-muted); font-size: 0.92rem; }
.site-footer nav a:hover { color: var(--st-accent); text-decoration: none; }
.footer-bottom {
  border-top: 1px solid var(--st-border);
  padding: 20px;
  text-align: center;
}
.footer-bottom p { margin: 0; font-size: 0.85rem; color: var(--st-text-faint); }

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--st-border);
  background: var(--st-bg-card);
  color: var(--st-text);
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: var(--st-shadow-md);
  display: none;
  z-index: 300;
  transition: transform 0.15s, color 0.15s;
}
.back-to-top.show { display: block; }
.back-to-top:hover { transform: translateY(-3px); color: var(--st-accent); }

/* ============================================================
   PROSE / MISC PAGES
   ============================================================ */
.prose { max-width: 780px; }
.prose h2 { margin-top: 2em; }
.prose ul { list-style: disc; padding-left: 1.5em; margin: 0 0 1.2em; }
.prose ol { list-style: decimal; padding-left: 1.5em; margin: 0 0 1.2em; }
.prose li { margin-bottom: 0.4em; }
.prose img { border-radius: var(--st-radius-sm); }

.alert-todo {
  background: color-mix(in srgb, var(--st-warning) 10%, var(--st-bg-card));
  border: 1px solid color-mix(in srgb, var(--st-warning) 40%, transparent);
  color: var(--st-text);
  border-radius: var(--st-radius-sm);
  padding: 14px 18px;
  font-size: 0.92rem;
  margin: 16px 0;
}

.contact-form { max-width: 620px; }
.form-note { font-size: 0.88rem; color: var(--st-text-muted); }
.form-success {
  background: color-mix(in srgb, var(--st-success) 10%, var(--st-bg-card));
  border: 1px solid color-mix(in srgb, var(--st-success) 40%, transparent);
  padding: 18px;
  border-radius: var(--st-radius-sm);
  display: none;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .tool-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .header-search { width: 220px; }
}

@media (max-width: 760px) {
  /* Hamburger becomes visible; menu collapses into a clean panel */
  .nav-toggle { display: inline-flex; }
  .header-search { display: none; }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    background: var(--st-bg-card);
    border-bottom: 1px solid var(--st-border);
    box-shadow: var(--st-shadow-lg);
    padding: 10px 16px 20px;
    z-index: 190;
  }
  .main-nav.open { display: block; animation: st-fade 0.22s ease; }

  .nav-menu { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-menu > li { display: block; }
  .nav-menu > li > a,
  .nav-btn {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 14px;
    font-size: 1rem;
  }
  .nav-dropdown { display: block; }
  .nav-dropdown .dropdown-menu {
    position: static;
    display: none;
    box-shadow: none;
    border: 0;
    border-left: 2px solid var(--st-border);
    border-radius: 0;
    padding: 4px 0 4px 8px;
    margin: 2px 0 6px 14px;
    min-width: 0;
    max-width: none;
  }
  .nav-dropdown.open .dropdown-menu { display: block; }
  .dropdown-menu a { padding: 10px 12px; }

  .hero { padding: 52px 0 42px; }
  .hero-search { flex-direction: column; border-radius: var(--st-radius); padding: 8px; }
  .hero-search .st-btn { width: 100%; }

  .card-grid, .cards-grid, .related-grid { grid-template-columns: 1fr 1fr; }
  .category-grid { grid-template-columns: 1fr 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
  .st-grid-2 { grid-template-columns: 1fr; }

  .tool-header { flex-direction: column; align-items: flex-start; gap: 14px; }
  .tool-panel { padding: 20px 16px; }

  section { padding: 32px 0; }
}

@media (max-width: 420px) {
  .container { padding: 0 14px; }
  .card-grid, .cards-grid, .related-grid,
  .category-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .tool-card { padding: 15px; }
  .hero-search input { font-size: 16px; } /* no iOS zoom */
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .site-header, .site-footer, .nav-toggle, .back-to-top,
  .cookie-banner, .cookie-modal-backdrop, .ad-slot, .theme-toggle {
    display: none !important;
  }
  body { background: #fff; color: #000; font-size: 12pt; }
  .tool-card, .tool-panel, .category-card { break-inside: avoid; box-shadow: none; }
  a { color: #000; }
}

/* No-JS / slow-load fallback inside the tool mount point. Replaced by the
   tool script once it runs; visible to crawlers and slow connections. */
.st-fallback { border: 1px solid var(--st-border); border-radius: var(--st-radius); padding: 16px 18px; background: var(--st-bg-card); }
.st-fallback ol { margin: 10px 0 10px 20px; }
.st-fallback p { margin: 6px 0; }
