/* Inter, self-hosted. The previous @import pulled this from Google over two
   chained requests (CSS then font files) on the critical render path — the
   single biggest cost in the mobile PageSpeed report (~2.8s of render-blocking
   on Slow 4G). Self-hosting the variable font as one 48KB latin-subset file,
   served from our own origin with a year-long cache, removes that chain and
   also drops the two font hosts from the Content-Security-Policy.
   font-display:swap paints text immediately in the fallback, then swaps. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;                 /* variable axis — one file, all weights */
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
}

/* ============================================================
   SINGLE PALETTE — Neural Navy (always dark, no mode switching)
   Matched to the /sr-admin panel and login so the public site and
   the admin read as one product.
   ============================================================ */
:root {
  --bg: #050B18;
  --bg-alt: #0A1322;
  --surface: #0D1829;
  --surface-hover: #16233A;
  --card-bg: #101C30;
  --card-bg-hover: #16243C;
  --primary: #2563EB;
  --primary-hover: #3B82F6;
  --accent: #38BDF8;
  --text: #E8EEF7;
  --text-secondary: #A3B3C9;
  --text-muted: #8A9AB0;
  --border: rgba(255,255,255,0.09);
  --border-hover: rgba(255,255,255,0.16);
  --glow: rgba(37,99,235,0.18);
  --input-bg: #0D1829;
  --ink: #E8EEF7;
  --muted: #8A9AB0;
  --line: rgba(255,255,255,0.09);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --card-text: #ffffff;
  --card-text-secondary: #A3B3C9;
  --card-text-muted: #8A9AB0;
  --wrap: 1200px;
  --shadow-soft: 0 8px 24px rgba(0,0,0,0.28);
  --shadow-hover: 0 14px 32px rgba(0,0,0,0.45);
  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;

  /* Surfaces that were hardcoded before the light theme existed. */
  --header-bg: rgba(10,19,34,0.85);
  --glass: rgba(13,24,41,0.5);
  --glass-soft: rgba(13,24,41,0.38);
  --feature-bg: rgba(232,245,240,0.06);
  --footer-bg: #050B18;
  --footer-text: #A3B3C9;
  --footer-strong: #ffffff;
  --shadow-card: 0 4px 12px rgba(0,0,0,0.18);
  --shadow-card-hover: 0 12px 28px rgba(0,0,0,0.30);
  --shadow-nav: 0 8px 24px rgba(0,0,0,0.4);
  --body-glow-1: rgba(56,189,248,0.06);
  --body-glow-2: rgba(37,99,235,0.08);
  --body-glow-3: rgba(56,189,248,0.03);
}

/* ============================================================
   LIGHT THEME
   Dark stays the default (it is what the brand and the admin use);
   html[data-theme="light"] is stamped by the header toggle, and by
   the pre-paint script in app/views/layout.php so there is no flash.
   Only tokens are overridden — no component rules are duplicated.
   ============================================================ */
html[data-theme="light"] {
  --bg: #F5F8FC;
  --bg-alt: #EDF2F9;
  --surface: #FFFFFF;
  --surface-hover: #EEF3FA;
  --card-bg: #FFFFFF;
  --card-bg-hover: #F4F8FD;
  --primary: #1D4ED8;
  --primary-hover: #2563EB;
  --accent: #0369A1;
  --text: #0F172A;
  --text-secondary: #47566B;
  --text-muted: #5A6B80;
  --border: rgba(15,23,42,0.12);
  --border-hover: rgba(29,78,216,0.42);
  --glow: rgba(37,99,235,0.14);
  --input-bg: #FFFFFF;
  --ink: #0F172A;
  --muted: #5A6B80;
  --line: rgba(15,23,42,0.12);
  --card-text: #0F172A;
  --card-text-secondary: #47566B;
  --card-text-muted: #5A6B80;
  --shadow-soft: 0 6px 18px rgba(15,23,42,0.07);
  --shadow-hover: 0 14px 32px rgba(15,23,42,0.13);

  --header-bg: rgba(255,255,255,0.88);
  --glass: rgba(255,255,255,0.72);
  --glass-soft: rgba(255,255,255,0.6);
  --feature-bg: rgba(15,23,42,0.035);
  --footer-bg: #0D1829;
  --footer-text: #A3B3C9;
  --footer-strong: #ffffff;
  --shadow-card: 0 2px 8px rgba(15,23,42,0.07);
  --shadow-card-hover: 0 10px 24px rgba(15,23,42,0.12);
  --shadow-nav: 0 8px 24px rgba(15,23,42,0.14);
  --body-glow-1: rgba(56,189,248,0.10);
  --body-glow-2: rgba(37,99,235,0.08);
  --body-glow-3: rgba(56,189,248,0.05);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 15% 10%, var(--body-glow-1) 0%, transparent 40%),
    radial-gradient(circle at 85% 20%, var(--body-glow-2) 0%, transparent 40%),
    radial-gradient(circle at 50% 80%, var(--body-glow-3) 0%, transparent 50%);
  background-attachment: fixed;
  line-height: 1.6; font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--primary-hover); }
h1,h2,h3,h4 { line-height: 1.2; color: var(--text); margin: 0 0 .5em; font-weight: 700; letter-spacing: -0.02em; }
.display-title { font-size: 48px; font-weight: 800; }
h1 { font-size: 40px; font-weight: 700; }
h2 { font-size: 32px; font-weight: 600; }
h3 { font-size: 26px; }
h4 { font-size: 22px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.wrap-full { max-width: 1400px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--text-muted); }
.lead { font-size: 1.12rem; color: var(--text-muted); max-width: 60ch; font-weight: 400; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--primary); color: #fff; padding: 8px 14px; z-index: 100; border-radius: var(--radius-sm); }
.skip-link:focus { left: 8px; top: 8px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: 0.75rem 1.5rem; border-radius: var(--radius-btn); border: 1px solid transparent;
  font-weight: 600; font-size: 1rem; cursor: pointer; transition: all 0.2s ease;
  text-decoration: none; line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-soft); }
.btn-primary:hover { background: var(--primary-hover); color: #fff; box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-lg { padding: .9em 1.8em; font-size: 1.08rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.linklike { background: none; border: 0; color: var(--primary); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(1.4) blur(16px);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 1.5rem;
  max-width: 1400px; margin: 0 auto; padding: 0 1.5rem;
}
.brand { display: flex; align-items: center; gap: .5em; font-weight: 800; color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; color: var(--text); }
.brand-mark { background: var(--primary); color: #fff; font-size: .72rem; font-weight: 800; padding: .35em .55em; border-radius: 6px; letter-spacing: .05em; }
.brand-name { font-size: 1.15rem; letter-spacing: -.02em; }
.header-search { position: relative; flex: 0 1 280px; }
.header-search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-muted); pointer-events: none;
}
.header-search input {
  width: 100%; padding: 0.55rem 1rem 0.55rem 2.4rem;
  border-radius: 20px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font-size: 0.9rem; transition: border-color 0.2s, box-shadow 0.2s;
}
.header-search input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--glow);
}
.header-search input::placeholder { color: var(--text-muted); }
.site-nav-top { display: flex; align-items: center; gap: 1.25rem; }
.site-nav-top a {
  color: var(--text-secondary); font-weight: 500; font-size: 0.95rem;
  text-decoration: none; transition: color 0.2s;
}
.site-nav-top a:hover { color: var(--text); }
.nav-highlight {
  background: rgba(56,189,248,0.12); color: var(--primary) !important;
  padding: 0.35rem 0.75rem; border-radius: 8px;
}
.nav-toggle {
  display: none; background: transparent; border: none;
  font-size: 1.5rem; color: var(--text); cursor: pointer; padding: 0.4rem;
}

/* Light / dark switch. Shows the icon of the theme you are currently in. */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex: none;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 50%; color: var(--text-muted); cursor: pointer; padding: 0;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.theme-toggle:hover { color: var(--primary); border-color: var(--primary); background: var(--surface-hover); }
.theme-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.theme-toggle .i-sun { display: none; }
html[data-theme="light"] .theme-toggle .i-sun { display: block; }
html[data-theme="light"] .theme-toggle .i-moon { display: none; }
@media (max-width: 900px) {
  .header-inner { flex-wrap: wrap; row-gap: .6rem; }
  .header-search { display: none; }
  .site-nav-top { flex-wrap: wrap; justify-content: center; gap: .85rem; }
}
@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .site-header { position: relative; z-index: 100; }
  .site-nav-top {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-nav);
    padding: 1rem 1.5rem; gap: 0.8rem; z-index: 100;
  }
  .site-nav-top.open { display: flex; }
}

/* ---- Hero Section ---- */
.hero-section {
  text-align: left; padding: 2.5rem 0 1.5rem; margin-bottom: 0.5rem;
  position: relative; overflow: hidden;
}
.hero-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 2rem; position: relative;
}
.hero-text { flex: 1; min-width: 0; max-width: 560px; }
.hero-title {
  font-size: 52px; font-weight: 800; color: var(--text);
  margin-bottom: 1rem; letter-spacing: -0.03em; line-height: 1.08;
}
.hero-accent { color: var(--primary); }
.hero-subtitle {
  font-size: 1.05rem; color: var(--text-secondary);
  margin-bottom: 1.75rem; font-weight: 400; line-height: 1.7;
}
.hero-cta-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.hero-illustration {
  flex: 0 0 420px; height: 360px; pointer-events: none;
}
.hero-illustration svg { width: 100%; height: 100%; }

/* Feature strip — light frosted cards */
/* Below 900px the hero illustration is hidden and .hero-inner collapses to a
   single column, which put the CTA buttons flush against these cards with no
   breathing room at all. The gap is set here rather than under .hero-cta-row
   so it applies in the two-column layout too, where the buttons sit beside
   the illustration and the strip still needs separating from both. */
.feature-strip {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; margin-top: 2rem;
}
.feature-card {
  background: var(--feature-bg);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border); border-radius: 16px;
  padding: 1.1rem 1.2rem; display: flex; align-items: center; gap: 1rem;
}
.feature-card-icon-wrap {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(56,189,248,0.12);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.feature-card-icon { width: 20px; height: 20px; color: var(--primary); }
.feature-card-body { display: flex; flex-direction: column; }
.feature-card-title { font-size: 0.9rem; font-weight: 700; color: var(--text); }
.feature-card-desc { font-size: 0.78rem; color: var(--text-muted); line-height: 1.4; }
@media (max-width: 1100px) {
  .hero-illustration { flex: 0 0 340px; height: 300px; }
}
@media (max-width: 900px) {
  .hero-inner { flex-direction: column; }
  .hero-illustration { display: none; }
  .hero-text { max-width: 100%; }
  .hero-title { font-size: 38px; }
  .feature-strip { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .hero-title { font-size: 28px; }
}

/* ---- Hero search (used on tools/templates hubs) ---- */
.hero-search-wrapper {
  max-width: 680px; margin: 0 auto 1.5rem; position: relative;
}
.hero-search-input {
  width: 100%; padding: 1.25rem 1.5rem 1.25rem 3.5rem;
  border-radius: var(--radius-container); border: 1px solid var(--border);
  background: var(--glass); backdrop-filter: blur(20px);
  font-size: 1.1rem; color: var(--text);
  box-shadow: var(--shadow-soft); transition: all 0.3s ease;
}
.hero-search-input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--glow), var(--shadow-hover);
}
.hero-search-input::placeholder { color: var(--text-muted); }
.hero-search-icon {
  position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); width: 24px; height: 24px;
}
.hero-chips {
  display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap;
}
.hero-chip {
  background: transparent; border: 1px solid var(--border);
  border-radius: 20px; padding: 0.35rem 1rem; font-size: 0.85rem;
  color: var(--text-secondary); cursor: pointer; transition: all 0.2s;
}
.hero-chip:hover, .hero-chip.active {
  background: var(--card-bg); color: #fff; border-color: var(--card-bg);
}

/* ---- Privacy badge ---- */
.privacy-badge {
  display: inline-flex; align-items: center; gap: .4em;
  background: rgba(56,189,248,0.1); color: var(--primary);
  border: 1px solid rgba(56,189,248,0.25); border-radius: 999px;
  padding: .4em 1em; font-size: .9rem; font-weight: 600; margin: .5em 0;
}
.badge-free {
  display: inline-block; background: rgba(56,189,248,0.15); color: var(--primary);
  border-radius: 999px; padding: .2em .65em; font-size: .7rem; font-weight: 700;
  letter-spacing: 0.03em;
}
.disclaimer { background: rgba(245,165,36,0.1); border: 1px solid rgba(245,165,36,0.25); border-radius: var(--radius-sm); padding: .9em 1.1em; margin: 1.5rem 0; font-size: .95rem; color: var(--text-secondary); }
.notice { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 1em; color: var(--text-muted); }

/* ---- App shell: sidebar + content two-column grid ---- */
.app-layout {
  display: grid; grid-template-columns: 250px minmax(0, 1fr);
  gap: 32px; max-width: 1400px; margin: 0 auto;
  padding: 24px; align-items: start;
}
.global-sidebar {
  position: sticky; top: 80px; align-self: start;
  max-height: calc(100vh - 100px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 1.25rem;
  box-shadow: var(--shadow-soft);
}
.sidebar-category { margin-bottom: 1.5rem; }
.sidebar-category:last-child { margin-bottom: 0; }
.sidebar-cat-header {
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.sidebar-cat-icon { width: 14px; height: 14px; color: var(--primary); flex-shrink: 0; }
.sidebar-category .sidebar-cat-title {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
  margin: 0; color: var(--text-muted); font-weight: 700;
}
.sidebar-link {
  display: block; padding: .4rem .6rem; border-radius: 8px;
  font-size: .88rem; color: var(--text-secondary);
  transition: background .2s ease, color .2s ease; text-decoration: none;
}
.sidebar-link:hover { background: rgba(56,189,248,0.1); color: var(--primary); text-decoration: none; }
.sidebar-link.active { background: rgba(56,189,248,0.12); color: var(--primary); font-weight: 600; }
.sidebar-all-tools {
  display: flex; align-items: center; gap: 0.4rem;
  margin-top: 1rem; padding: .6rem .6rem; border-radius: 8px;
  font-size: .88rem; font-weight: 600; color: var(--primary);
  border-top: 1px solid var(--border); text-decoration: none;
}
.sidebar-all-tools:hover { background: rgba(56,189,248,0.08); }

@media (max-width: 1024px) {
  .app-layout { grid-template-columns: 1fr; gap: 0; padding: 0 16px; }
  .global-sidebar { display: none; }
}

/* Homepage already lists every tool in the category grids below — the sidebar just duplicates it. */
.page-home .app-layout { grid-template-columns: 1fr; }
.page-home .global-sidebar { display: none; }
/* The CV builder is a two-pane editor and needs the full width: the tools
   sidebar was squeezing both the form and the A4 preview. */
.page-cv .app-layout { grid-template-columns: 1fr; }
.page-cv .global-sidebar { display: none; }

/* ---- Tool grid + cards ---- */
.tool-grid-section { padding: 0 0 3rem; }
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px; margin: 1rem 0 0;
}
.tool-card {
  display: flex; flex-direction: column; gap: 0.35rem;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 14px; padding: 1rem 1.1rem;
  color: var(--text); text-decoration: none;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-card);
}
.tool-card:hover {
  transform: translateY(-3px); border-color: var(--border-hover);
  box-shadow: var(--shadow-card-hover), 0 0 12px var(--glow);
  background: var(--card-bg-hover); text-decoration: none;
}
.tool-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.25rem;
}
.tool-card-icon { width: 20px; height: 20px; color: var(--primary); flex-shrink: 0; }
.tool-card-title { font-size: 0.92rem; font-weight: 600; color: var(--card-text); line-height: 1.3; }
.tool-card-desc { font-size: 0.78rem; color: var(--card-text-muted); line-height: 1.4; }
.tool-card-name { font-weight: 600; }
.tool-card-lib { font-size: .78rem; color: var(--text-muted); }

/* ---- Template cards ---- */
.template-card {
  display: flex; flex-direction: column; gap: 0.35rem;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 14px; padding: 1rem 1.1rem;
  color: var(--text); text-decoration: none;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-card);
}
.template-card:hover {
  transform: translateY(-3px); border-color: var(--border-hover);
  box-shadow: var(--shadow-card-hover), 0 0 12px var(--glow);
  background: var(--card-bg-hover); text-decoration: none;
}
.template-card-icon { width: 20px; height: 20px; color: var(--primary); flex-shrink: 0; margin-bottom: 0.25rem; }
.template-card-title { font-size: 0.92rem; font-weight: 600; color: var(--card-text); line-height: 1.3; }
.template-card-desc { font-size: 0.78rem; color: var(--card-text-muted); line-height: 1.4; margin-top: 0.15rem; }

/* ---- Category containers ---- */
.category-container {
  background: var(--glass-soft);
  backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
  border: 1px solid var(--border);
  border-radius: 20px; padding: 1.8rem 2rem;
  margin-bottom: 2rem; box-shadow: var(--shadow-soft);
}
.category-header {
  font-size: 20px; font-weight: 700; margin-bottom: 0.75rem; color: var(--text);
}

/* ---- Search/filter visibility ---- */
.is-hidden { display: none !important; }
.no-results { text-align: center; color: var(--text-muted); padding: 2rem; font-size: 1.2rem; }
.cat-block { margin: 0; }

/* ---- Breadcrumbs ---- */
.breadcrumbs {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 14px; color: var(--text-muted); margin-bottom: 1.5rem;
}
.breadcrumbs a { color: var(--text-secondary); font-weight: 500; transition: color 0.2s; }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs span { opacity: 0.5; }
.breadcrumbs span.active { color: var(--text); font-weight: 600; opacity: 1; }

/* ---- Featured cards grid ---- */
.featured-cards-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px; max-width: 1200px; margin: 2rem 0 0; text-align: left;
}
@media (max-width: 900px) { .featured-cards-grid { grid-template-columns: 1fr; } }
.featured-card {
  display: flex; flex-direction: row; justify-content: space-between;
  align-items: flex-start; min-height: 140px;
  position: relative; overflow: hidden;
}
.featured-card-content { display: flex; flex-direction: column; z-index: 2; }
.featured-list {
  list-style: none; padding: 0; margin: 0.75rem 0 0;
  font-size: 13px; color: var(--card-text-secondary);
}
.featured-list li { margin-bottom: 0.3rem; }
.featured-icon {
  font-size: 42px; width: 42px; height: 42px; opacity: 0.2;
  position: absolute; right: -5px; top: 15px; z-index: 1;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.featured-card:hover .featured-icon { opacity: 0.4; transform: scale(1.1); }

/* ---- Page heads / breadcrumb (old style compat) ---- */
.page-head { padding: 1.5rem 0 .5rem; }
.breadcrumb { padding: 1rem 0 .2rem; font-size: .88rem; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4em; padding: 0; margin: 0; color: var(--text-muted); }
.breadcrumb li:not(:last-child)::after { content: '›'; margin-left: .4em; color: var(--text-muted); }

/* ---- Sections (howto/faq/related) ---- */
.howto,.faq,.related,.why-different,.tips { margin: 2.5rem 0; }
.howto-steps { list-style: none; counter-reset: step; padding: 0; display: grid; gap: 1rem; }
.howto-steps li {
  counter-increment: step; background: var(--surface-hover);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.2rem 1.1rem 3.2rem; position: relative; color: var(--text);
}
.howto-steps li::before {
  content: counter(step); position: absolute; left: 1rem; top: 1.1rem;
  width: 1.7em; height: 1.7em; background: var(--primary); color: #fff;
  border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .9rem;
}
.howto-steps h3 { margin: .1em 0 .2em; font-size: 1.05rem; }
.faq-list details {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .8em 1em; margin-bottom: .6rem; background: var(--surface); color: var(--text);
}
.faq-list summary { font-weight: 600; cursor: pointer; }
.faq-list p { margin: .6em 0 0; color: var(--text-muted); }
.related-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.related-list a {
  background: var(--surface-hover); border: 1px solid var(--border);
  border-radius: 999px; padding: .5em 1em; font-size: .92rem; color: var(--text);
}
.related-list a:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.why-different ul,.tips ul { padding-left: 1.2rem; }
.why-different li,.tips li { margin: .4em 0; }

/* ---- Blog ---- */
.blog-cats { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 2rem; }
.blog-cats a { background: var(--surface-hover); border: 1px solid var(--border); border-radius: 999px; padding: .4em 1em; font-size: .9rem; color: var(--text); }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.2rem; }
.blog-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow-soft); color: var(--text); }
.blog-card h2 { font-size: 1.12rem; }
.byline { color: var(--text-muted); font-size: .9rem; margin: .2em 0 1em; }
.blog-post { max-width: 760px; }
.shot { margin: 1rem 0; }
.shot img { border: 1px solid var(--border); border-radius: var(--radius-sm); }
.shot figcaption { font-size: .85rem; color: var(--text-muted); margin-top: .4em; }
.closing-cta { text-align: center; margin: 2.5rem 0; }
.read-more { font-weight: 600; }

/* ---- Prose ---- */
.prose { max-width: 760px; padding-bottom: 3rem; }
.prose p { margin: 1em 0; }
.center-block { text-align: center; padding: 4rem 20px; }

/* ---- Ads ---- */
.ad-slot { margin: 2rem 0; min-height: 90px; display: flex; justify-content: center; background: var(--surface); border-radius: var(--radius-sm); }

/* ---- Footer ---- */
.site-footer { background: var(--footer-bg); color: var(--footer-text); margin-top: 4rem; border-top: 1px solid rgba(56,189,248,0.12); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; padding: 3rem 20px 2rem; }
.footer-col .footer-col-title { color: var(--footer-strong); font-size: .95rem; font-weight: 700; margin: 0 0 .8em; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5em; }
.footer-col a { color: var(--footer-text); }
.footer-col a:hover { color: var(--footer-strong); }
.footer-brand .brand-name { color: var(--footer-strong); }
.footer-brand .privacy-badge { background: transparent; color: var(--primary); border-color: rgba(56,189,248,0.25); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.06); padding: 1.2rem 20px; font-size: .88rem; color: var(--footer-text); }
.site-footer .muted,
.site-footer p,
.site-footer .privacy-badge { color: var(--footer-text); }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; } }

/* ---- Old hero compat ---- */
.hero { background: linear-gradient(180deg, var(--bg-alt), var(--bg)); padding: clamp(2.5rem,6vw,4.5rem) 0 2.5rem; text-align: center; }
.hero h1 { margin-bottom: .3em; }
.hero-sub { font-size: 1.15rem; color: var(--text-muted); max-width: 56ch; margin: 0 auto 1.4em; }
.tool-search { max-width: 560px; margin: 1.5rem auto 0; }
.tool-search input { width: 100%; padding: 1em 1.2em; border: 2px solid var(--border); border-radius: 999px; font-size: 1.05rem; background: var(--surface); color: var(--text); }
.tool-search input:focus { outline: none; border-color: var(--primary); }

/* ---- Old tool grid compat ---- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.chip { width: 14px; height: 14px; border-radius: 4px; background: var(--primary); display: inline-block; }
.cat-title { display: flex; align-items: center; gap: .5em; font-size: 1.35rem; }
.announcement { background: var(--surface); color: var(--text); text-align: center; padding: .5em 1em; font-size: .92rem; }

/* ---- Tool page dark compat ---- */
.tool-options, .cv-form, .cv-sec, .a-panel, .tpl-preview {
  background: var(--surface); border-color: var(--border); color: var(--text);
}
.tool-options input, .tool-options select, .tool-options textarea,
.cvf input, .cvf textarea, .cv-tag-input {
  background: var(--input-bg); color: var(--text); border-color: var(--border);
}
.dropzone { background: var(--bg-alt); border-color: rgba(56,189,248,0.2); }
.cv-preview-wrap { background: var(--bg); }
.skill-chip { background: var(--surface-hover); border-color: var(--border); color: var(--text); }

/* ---- Input/button radius from theme tokens ---- */
input, select, textarea { border-radius: var(--radius-input); }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(56,189,248,0.03); border-radius: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-hover); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

.main-content { padding: 0 4px; min-width: 0; }

@media (max-width: 700px) {
  .category-container { padding: 1.1rem; border-radius: 14px; }
  .tools-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* Uploaded site logo (Settings → Site logo). Falls back to .brand-mark text. */
.brand-logo { height: 34px; width: auto; max-width: 190px; object-fit: contain; display: block; }
@media (max-width: 640px) { .brand-logo { height: 28px; max-width: 150px; } }
