/* ════════════════════════════════════════════
   MeoCalculators.com  ·  Light + Dark · Inter + JetBrains Mono
   ════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #F7F7FB;
  --bg2:     #FFFFFF;
  --bg3:     #F0F0F8;
  --bg4:     #E8E8F4;
  --border:  #E4E4EF;
  --border2: #D0D0E4;
  --text:    #1C1C2E;
  --muted:   #6B6B85;
  --dim:     #A0A0BC;
  --accent:  #5C6BC0;
  --accent2: #4A58B0;
  --green:   #10B981;
  --amber:   #F59E0B;
  --red:     #EF4444;
  --shadow:  0 1px 3px rgba(92,107,192,.08), 0 4px 16px rgba(92,107,192,.06);
  --shadow-hover: 0 4px 12px rgba(92,107,192,.14), 0 8px 32px rgba(92,107,192,.10);
  --c-basic:  #7C6FF7;
  --c-sci:    #06B6D4;
  --c-fin:    #F59E0B;
  --c-health: #F87171;
  --c-unit:   #EC4899;
  --c-date:   #3B82F6;
  --c-math:   #A855F7;
  --c-prog:   #10B981;
}

/* ── DARK MODE ──────────────────────────────── */
[data-theme="dark"] {
  color-scheme: dark;
  --bg:      #0E0E1A;
  --bg2:     #15152A;
  --bg3:     #1C1C30;
  --bg4:     #222238;
  --border:  #2A2A44;
  --border2: #363658;
  --text:    #E0E0F2;
  --muted:   #8080A4;
  --dim:     #52527A;
  --shadow:  0 1px 3px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
  --shadow-hover: 0 4px 12px rgba(0,0,0,.5), 0 8px 32px rgba(0,0,0,.4);
}
[data-theme="dark"] nav {
  background: rgba(14,14,26,.96);
}
[data-theme="dark"] .sd-name mark {
  background: rgba(92,107,192,.25);
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--text);
  font-family: 'Inter', sans-serif; font-size: 14px;
  line-height: 1.6; min-height: 100vh;
  display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: 'Inter', sans-serif; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg3); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── NAV ──────────────────────────────────── */
nav {
  display: flex; align-items: center; gap: 16px;
  padding: 0 36px; height: 60px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  background: rgba(247,247,251,.96); backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 var(--border);
}
.logo { font-size: 17px; font-weight: 800; flex-shrink: 0; letter-spacing: -.4px; display: flex; align-items: center; }
.logo span:not(.logo-icon) { color: var(--accent); }
.logo-icon {
  display: inline-flex; align-items: center; justify-content: center; margin-right: 4px;
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--accent); color: #ffffff;
  font-size: 16px; font-family: Georgia, 'Times New Roman', serif; font-weight: 900;
  flex-shrink: 0; line-height: 1; padding-bottom: 1px;
  text-rendering: geometricPrecision;
}

.nav-search-wrap { flex: 1; max-width: 340px; }
.nav-search {
  display: flex; align-items: center; gap: 9px;
  background: var(--bg3); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 7px 13px; transition: border-color .2s, box-shadow .2s;
}
.nav-search svg { color: var(--muted); flex-shrink: 0; }
.nav-search input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-family: 'Inter', sans-serif; font-size: 13px;
}
.nav-search input::placeholder { color: var(--dim); }
.nav-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(92,107,192,.12);
}
.nav-right {
  margin-left: auto; flex-shrink: 0;
  display: flex; align-items: center; gap: 6px;
}
.nav-link {
  font-size: 12px; font-weight: 600; padding: 6px 12px;
  border-radius: 7px; color: var(--muted); transition: all .2s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--accent); background: rgba(92,107,192,.08); }

/* ── FOOTER ──────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 36px 28px;
  background: var(--bg2);
}
.footer-inner {
  max-width: 900px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  text-align: center;
}
.footer-brand { font-size: 17px; font-weight: 800; letter-spacing: -.3px; }
.footer-brand span { color: var(--accent); }
.footer-nav {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 6px 20px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  width: 100%;
}
.footer-nav a { font-size: 12.5px; color: var(--muted); transition: color .15s; font-weight: 500; text-decoration: none; }
.footer-nav a:hover { color: var(--accent); }
.footer-note {
  font-size: 11px; color: var(--dim);
  font-family: 'JetBrains Mono', monospace;
}

/* ════════════════════════════════════════════
   HOMEPAGE
   ════════════════════════════════════════════ */
.hero {
  padding: 48px 36px 44px;
  position: relative; overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(92,107,192,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(92,107,192,.04) 1px, transparent 1px);
  background-size: 44px 44px;
}
.hero-glow {
  position: absolute; top: -80px; left: 50%; transform: translateX(-50%);
  width: 680px; height: 360px;
  background: radial-gradient(ellipse, rgba(92,107,192,.08) 0%, transparent 68%);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(92,107,192,.08); border: 1.5px solid rgba(92,107,192,.18);
  border-radius: 20px; padding: 5px 16px;
  font-size: 10px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: var(--accent); margin-bottom: 24px;
}
/* legacy hero h1 styles moved to .hero-headline above */
.hero-sub {
  font-size: 14px; color: var(--muted); max-width: 460px;
  margin: 0 auto 36px; font-family: 'JetBrains Mono', monospace; line-height: 1.9;
}
.hero-stats { display: flex; justify-content: center; gap: 44px; }
.stat-n { font-size: 30px; font-weight: 800; letter-spacing: -1px; color: var(--accent); }
.stat-l { font-size: 10px; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; margin-top: 2px; font-weight: 600; }

/* ── HERO LAYOUT ─────────────────────────── */
.hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 52px;
  max-width: 980px;
  margin: 0 auto;
  position: relative; z-index: 1;
}

.hero-headline {
  font-size: clamp(28px, 3.2vw, 46px);
  font-weight: 800; line-height: 1.1; letter-spacing: -2px;
  margin-bottom: 14px; color: var(--text);
}
.hero-headline em { font-style: normal; color: var(--accent); }

.hero-intro .hero-sub {
  margin: 0 0 20px; max-width: 340px;
}

.hero-badges {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 24px;
}

.hero-cta {
  display: inline-flex; align-items: center;
  padding: 10px 22px;
  background: var(--accent); color: #fff;
  border-radius: 10px; font-size: 13px; font-weight: 700;
  transition: background .18s, transform .1s, box-shadow .18s;
  box-shadow: 0 2px 10px rgba(92,107,192,.30);
}
.hero-cta:hover {
  background: var(--accent2);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(92,107,192,.40);
}

/* ── HERO CALCULATOR ─────────────────────── */
.hero-calc {
  position: relative; z-index: 1;
  background: var(--bg2);
  border: 1.5px solid var(--border2);
  border-radius: 20px;
  padding: 14px;
  width: 300px;
  box-shadow: 0 8px 40px rgba(92,107,192,.16), 0 2px 8px rgba(92,107,192,.08);
  transition: width .2s ease;
}
.hero-calc.sci { width: 452px; }

.hc-tabs {
  display: flex;
  background: var(--bg3);
  border-radius: 9px;
  padding: 3px;
  margin-bottom: 10px;
}
.hc-tab {
  flex: 1; padding: 5px;
  border: none; background: transparent;
  border-radius: 7px;
  font-size: 11px; font-weight: 700; letter-spacing: .2px;
  color: var(--muted); cursor: pointer;
  transition: all .2s;
}
.hc-tab.active {
  background: var(--bg2);
  color: var(--accent);
  box-shadow: 0 1px 4px rgba(0,0,0,.10);
}

.hc-display {
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px 7px;
  text-align: right;
  margin-bottom: 10px;
  min-height: 58px;
}
.hc-expr {
  font-size: 10px; color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  min-height: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hc-ans {
  font-size: 26px; font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text); letter-spacing: -1.5px;
  word-break: break-all; line-height: 1.15;
  margin-top: 1px;
}
.hc-ans.err { color: var(--red); font-size: 14px; }

.hc-body {
  display: flex;
  gap: 8px;
}

.hc-sci {
  display: none;
  grid-template-columns: repeat(3, 42px);
  grid-template-rows: repeat(4, 1fr);
  gap: 5px;
  flex-shrink: 0;
  align-self: stretch;
}
.hc-sci.visible { display: grid; }

.hc-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.hc-btn {
  height: 44px; padding: 0;
  border: 1.5px solid transparent;
  border-radius: 9px;
  font-size: 14px; font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1; user-select: none;
  transition: transform .1s, background .12s, box-shadow .12s;
}
.hc-btn:active { transform: scale(.93); }
.hc-btn.span2  { grid-column: span 2; }

.hc-num {
  background: var(--bg3); color: var(--text);
  border-color: var(--border);
}
.hc-num:hover { background: var(--bg4); border-color: var(--border2); }

.hc-op {
  background: rgba(92,107,192,.08); color: var(--accent);
  border-color: rgba(92,107,192,.2); font-size: 16px;
}
.hc-op:hover { background: rgba(92,107,192,.15); }

.hc-eq {
  background: var(--accent); color: #fff;
  border-color: transparent; font-size: 17px;
  box-shadow: 0 2px 10px rgba(92,107,192,.35);
}
.hc-eq:hover { background: var(--accent2); box-shadow: 0 4px 14px rgba(92,107,192,.45); }

.hc-clr {
  background: rgba(239,68,68,.07); color: var(--red);
  border-color: rgba(239,68,68,.2);
}
.hc-clr:hover { background: rgba(239,68,68,.14); }

.hc-sci-btn {
  background: rgba(6,182,212,.07); color: #0891b2;
  border-color: rgba(6,182,212,.2);
  font-size: 10px; font-weight: 700;
  height: auto;
}
.hc-sci-btn:hover { background: rgba(6,182,212,.14); }

/* Search */
.hs-wrap { padding: 0 36px 44px; max-width: 620px; margin: 0 auto; }
.hs {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg2); border: 1.5px solid var(--border2);
  border-radius: 14px; padding: 13px 20px;
  transition: border-color .2s, box-shadow .2s;
  box-shadow: var(--shadow);
}
.hs:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(92,107,192,.12), var(--shadow);
}
.hs svg { color: var(--muted); flex-shrink: 0; }
.hs input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-family: 'Inter', sans-serif; font-size: 15px;
}
.hs input::placeholder { color: var(--dim); }
.hs kbd {
  font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--muted);
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 5px; padding: 2px 8px; font-weight: 500;
}

/* Category tabs */
.cat-tabs {
  display: flex; gap: 7px; overflow-x: auto;
  padding: 0 36px 28px; scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.ct {
  flex-shrink: 0; display: flex; align-items: center; gap: 7px;
  padding: 7px 16px; border-radius: 9px;
  border: 1.5px solid var(--border); background: var(--bg2);
  transition: all .18s; font-size: 12px; font-weight: 600;
  color: var(--muted); white-space: nowrap; cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.ct:hover { background: var(--bg3); border-color: var(--border2); color: var(--text); }
.ct.active { border-color: var(--accent); color: var(--accent); background: rgba(92,107,192,.07); }
.ct-dot { width: 6px; height: 6px; border-radius: 50%; }

/* Sections */
.sections { padding: 0 36px 72px; }
.section { margin-bottom: 52px; }
.sec-header { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.sec-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; flex-shrink: 0;
}
.sec-title { font-size: 16px; font-weight: 700; letter-spacing: -.2px; }
.sec-link {
  margin-left: auto; font-size: 11px; color: var(--muted);
  font-family: 'JetBrains Mono', monospace; transition: color .2s; font-weight: 500;
}
.sec-link:hover { color: var(--accent); }

/* Tool grid & cards */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 10px;
}
.tool-card {
  display: block; position: relative;
  background: var(--bg2); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 16px 17px;
  transition: border-color .2s, transform .18s, box-shadow .2s;
  overflow: hidden; color: inherit;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.tool-card:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}
.tc-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; line-height: 1.3; color: var(--text); }
.tc-desc { font-size: 11px; color: var(--muted); font-family: 'JetBrains Mono', monospace; line-height: 1.55; }
.tc-tag {
  position: absolute; top: 10px; right: 10px;
  font-size: 9px; font-weight: 700; letter-spacing: .8px;
  padding: 2px 7px; border-radius: 4px; text-transform: uppercase;
}
.tag-new { background: rgba(16,185,129,.1); color: var(--green); border: 1px solid rgba(16,185,129,.2); }
.tag-pop { background: rgba(245,158,11,.1); color: var(--amber); border: 1px solid rgba(245,158,11,.2); }

/* Section color themes */
.s-basic  .sec-icon { background:rgba(124,111,247,.12); color:var(--c-basic);  }
.s-sci    .sec-icon { background:rgba(6,182,212,.11);   color:var(--c-sci);    }
.s-fin    .sec-icon { background:rgba(245,158,11,.11);  color:var(--c-fin);    }
.s-health .sec-icon { background:rgba(248,113,113,.11); color:var(--c-health); }
.s-unit   .sec-icon { background:rgba(236,72,153,.11);  color:var(--c-unit);   }
.s-date   .sec-icon { background:rgba(59,130,246,.11);  color:var(--c-date);   }
.s-math   .sec-icon { background:rgba(168,85,247,.11);  color:var(--c-math);   }
.s-prog   .sec-icon { background:rgba(16,185,129,.11);  color:var(--c-prog);   }

.s-basic  .sec-title { color:var(--c-basic);  }
.s-sci    .sec-title { color:var(--c-sci);    }
.s-fin    .sec-title { color:var(--c-fin);    }
.s-health .sec-title { color:var(--c-health); }
.s-unit   .sec-title { color:var(--c-unit);   }
.s-date   .sec-title { color:var(--c-date);   }
.s-math   .sec-title { color:var(--c-math);   }
.s-prog   .sec-title { color:var(--c-prog);   }

.s-basic  .tool-card:hover { border-color:rgba(124,111,247,.35); }
.s-sci    .tool-card:hover { border-color:rgba(6,182,212,.35);   }
.s-fin    .tool-card:hover { border-color:rgba(245,158,11,.35);  }
.s-health .tool-card:hover { border-color:rgba(248,113,113,.35); }
.s-unit   .tool-card:hover { border-color:rgba(236,72,153,.35);  }
.s-date   .tool-card:hover { border-color:rgba(59,130,246,.35);  }
.s-math   .tool-card:hover { border-color:rgba(168,85,247,.35);  }
.s-prog   .tool-card:hover { border-color:rgba(16,185,129,.35);  }

.no-results {
  padding: 60px 40px; text-align: center;
  color: var(--muted); font-family: 'JetBrains Mono', monospace; font-size: 13px;
}

/* ════════════════════════════════════════════
   CATEGORY PAGE
   ════════════════════════════════════════════ */
.cat-page { max-width: 1180px; margin: 0 auto; padding: 48px 36px 72px; }
.cat-ph { margin-bottom: 36px; }
.cat-ph-icon {
  width: 54px; height: 54px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; margin-bottom: 14px;
}
.cat-ph-title { font-size: 36px; font-weight: 800; letter-spacing: -1.5px; margin-bottom: 8px; }
.cat-ph-desc { font-size: 13px; color: var(--muted); font-family: 'JetBrains Mono', monospace; }

/* ════════════════════════════════════════════
   TOOL PAGE
   ════════════════════════════════════════════ */
.tool-page { max-width: 820px; margin: 0 auto; padding: 44px 36px 80px; }

.breadcrumb {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--muted); margin-bottom: 28px;
  font-family: 'JetBrains Mono', monospace;
}
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: var(--dim); }

.tool-header { margin-bottom: 32px; }
.tool-header-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.tool-ico {
  width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800;
}
.tool-title  { font-size: 30px; font-weight: 800; letter-spacing: -.8px; }
.tool-tagline { font-size: 13px; color: var(--muted); font-family: 'JetBrains Mono', monospace; }

/* Hint */
.calc-hint {
  font-size: 12px; color: var(--muted); font-family: 'JetBrains Mono', monospace;
  background: rgba(92,107,192,.06); border: 1.5px solid rgba(92,107,192,.14);
  border-radius: 9px; padding: 10px 15px; margin-bottom: 14px;
}

/* Calc card & form */
.calc-card {
  background: var(--bg2); border: 1.5px solid var(--border);
  border-radius: 16px; padding: 28px; margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.fg { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.fg:last-of-type { margin-bottom: 0; }
.fl {
  font-size: 11px; font-weight: 700; letter-spacing: .7px;
  text-transform: uppercase; color: var(--muted);
}
.fi, .fs {
  background: var(--bg3); border: 1.5px solid var(--border);
  border-radius: 9px; padding: 11px 14px;
  color: var(--text); font-family: 'Inter', sans-serif; font-size: 14px;
  width: 100%; outline: none; transition: border-color .18s, box-shadow .18s;
  -webkit-appearance: none;
}
.fi:focus, .fs:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(92,107,192,.12);
  background: var(--bg2);
}
.fs { cursor: pointer; }
.fs option { background: var(--bg2); color: var(--text); }
textarea.fi { resize: vertical; min-height: 80px; }

.fg-check label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; cursor: pointer; margin-bottom: 10px; font-weight: 500;
}
.fg-check input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; }

.btn-go {
  width: 100%; padding: 13px; margin-top: 12px;
  background: var(--accent); color: #fff; border: none;
  border-radius: 10px; font-size: 14px; font-weight: 700; letter-spacing: .3px;
  transition: background .18s, transform .1s, box-shadow .18s;
  box-shadow: 0 2px 8px rgba(92,107,192,.30);
}
.btn-go:hover {
  background: var(--accent2);
  box-shadow: 0 4px 16px rgba(92,107,192,.40);
}
.btn-go:active { transform: scale(.99); }

/* Error */
.calc-error {
  background: rgba(239,68,68,.06); border: 1.5px solid rgba(239,68,68,.2);
  border-radius: 9px; padding: 11px 15px; color: var(--red);
  font-size: 12px; font-family: 'JetBrains Mono', monospace; margin-bottom: 14px;
}

/* Color preview */
.color-preview {
  height: 54px; border-radius: 10px; border: 1.5px solid var(--border);
  margin: 14px 0;
}

/* Results */
.results {
  background: linear-gradient(135deg, rgba(92,107,192,.04) 0%, rgba(92,107,192,.02) 100%);
  border: 1.5px solid rgba(92,107,192,.18);
  border-radius: 14px; padding: 22px; margin-top: 14px;
  animation: fadeUp .22s ease;
  box-shadow: 0 2px 12px rgba(92,107,192,.08);
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.res-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--accent); margin-bottom: 14px;
  opacity: .7;
}
.res-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px,1fr)); gap: 10px; }
.res-item {
  background: var(--bg2); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 13px 15px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.ri-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 5px; font-weight: 600; }
.ri-val   { font-size: 19px; font-weight: 800; letter-spacing: -.3px; font-family: 'JetBrains Mono', monospace; word-break: break-all; color: var(--text); }
.ri-val.accent { color: var(--accent); }
.ri-val.green  { color: var(--green);  }
.ri-val.amber  { color: var(--amber);  }
.ri-val.red    { color: var(--red);    }

/* Preformatted text result */
.res-pre {
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  line-height: 1.8; white-space: pre-wrap; word-break: break-all;
  color: var(--accent);
}

/* Related */
.related { margin-top: 44px; }
.related-title {
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted); margin-bottom: 14px;
}
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px,1fr)); gap: 8px; }

/* ── LIVE SEARCH DROPDOWN ─────────────────── */
.search-wrap { position: relative; }
.search-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--bg2); border: 1.5px solid var(--border2);
  border-radius: 14px; box-shadow: 0 8px 40px rgba(92,107,192,.16);
  z-index: 200; overflow: hidden;
  display: none;
  animation: fadeUp .16s ease;
}
.search-dropdown.open { display: block; }

.sd-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px; cursor: pointer;
  transition: background .12s; text-decoration: none; color: inherit;
  border-bottom: 1px solid var(--border);
}
.sd-item:last-child { border-bottom: none; }
.sd-item:hover, .sd-item.focused {
  background: rgba(92,107,192,.06);
}
.sd-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.sd-body { flex: 1; min-width: 0; }
.sd-name { font-size: 13px; font-weight: 600; }
.sd-name mark {
  background: rgba(92,107,192,.15); color: var(--accent);
  border-radius: 3px; padding: 0 2px;
}
.sd-desc { font-size: 11px; color: var(--muted); font-family: 'JetBrains Mono', monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-cat { font-size: 10px; font-weight: 700; color: var(--muted); flex-shrink: 0; }

.sd-empty {
  padding: 18px 16px; text-align: center; color: var(--muted);
  font-size: 13px; font-family: 'JetBrains Mono', monospace;
}
.sd-footer {
  padding: 9px 16px; border-top: 1px solid var(--border);
  font-size: 11px; color: var(--dim); font-family: 'JetBrains Mono', monospace;
  display: flex; align-items: center; justify-content: space-between;
}
.sd-footer kbd {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 6px; font-family: inherit; font-size: 10px; color: var(--muted);
}

/* Nav dropdown is smaller */
.nav-search-wrap .search-dropdown { top: calc(100% + 8px); border-radius: 12px; }

/* ── SKIP LINK ──────────────────────────────── */
.skip-link {
  position: absolute; top: -40px; left: 16px;
  background: var(--accent); color: #fff;
  padding: 6px 14px; border-radius: 0 0 8px 8px;
  font-size: 12px; font-weight: 600; z-index: 9999;
  transition: top .2s;
}
.skip-link:focus { top: 0; }

/* ── DARK MODE TOGGLE ───────────────────────── */
.theme-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; border: none;
  background: var(--bg3); color: var(--muted);
  transition: background .18s, color .18s;
  flex-shrink: 0;
}
.theme-btn:hover { background: var(--bg4); color: var(--text); }

/* Sun visible in light mode, moon in dark mode */
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun  { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* ── BACK TO TOP ────────────────────────────── */
.btt {
  position: fixed; bottom: 24px; right: 24px; z-index: 500;
  width: 38px; height: 38px; border-radius: 10px; border: none;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(92,107,192,.40);
  opacity: 0; pointer-events: none;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
}
.btt.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.btt:hover { background: var(--accent2); }

/* ── COPY BUTTON ────────────────────────────── */
.res-item {
  position: relative;
}
.copy-btn {
  position: absolute; top: 8px; right: 8px;
  display: flex; align-items: center; gap: 4px;
  padding: 3px 7px; border-radius: 6px; border: 1.5px solid var(--border);
  background: var(--bg2); color: var(--muted);
  font-size: 10px; font-weight: 600;
  opacity: 0;
  transition: opacity .15s, background .15s, color .15s, border-color .15s;
  cursor: pointer;
}
.res-item:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: var(--bg3); color: var(--text); border-color: var(--border2); }
.copy-btn.copied {
  opacity: 1;
  background: rgba(16,185,129,.1);
  color: var(--green);
  border-color: rgba(16,185,129,.3);
}
.copy-btn.copied .copy-label::before { content: 'Copied!'; }
.copy-btn:not(.copied) .copy-label::before { content: 'Copy'; }
.copy-label { font-size: 10px; }

/* ── KEYBOARD HINT ──────────────────────────── */
.hc-hint {
  text-align: center;
  font-size: 10px; color: var(--dim);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 10px; letter-spacing: .3px;
}

/* ── 404 PAGE ───────────────────────────────── */
.not-found {
  max-width: 680px; margin: 0 auto;
  padding: 72px 36px 80px; text-align: center;
}
.nf-code {
  font-size: 80px; font-weight: 800; letter-spacing: -4px;
  color: var(--accent); opacity: .18; line-height: 1;
  font-family: 'JetBrains Mono', monospace;
}
.nf-title {
  font-size: 26px; font-weight: 800; letter-spacing: -.5px;
  margin-top: 4px; margin-bottom: 10px;
}
.nf-sub {
  font-size: 13px; color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 28px;
}
.nf-home {
  display: inline-flex; align-items: center;
  font-size: 13px; font-weight: 600; color: var(--accent);
  padding: 9px 18px; border-radius: 9px;
  border: 1.5px solid rgba(92,107,192,.25);
  background: rgba(92,107,192,.07);
  transition: background .18s;
}
.nf-home:hover { background: rgba(92,107,192,.14); }
.nf-popular { margin-top: 52px; }
.nf-popular-title {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted); margin-bottom: 14px;
}
.nf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

/* Responsive */
@media (max-width: 720px) {
  nav { padding: 0 16px; }
  .nav-search-wrap { display: none; }
  .hero { padding: 32px 16px 28px; }
  .hero-inner { grid-template-columns: 1fr; gap: 28px; }
  .hero-intro { text-align: center; }
  .hero-intro .hero-sub { max-width: 100%; }
  .hero-badges { justify-content: center; }
  .hero-calc,
  .hero-calc.sci { width: 100%; }
  .hc-body { flex-direction: column; }
  .hc-sci {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto;
    width: 100%;
    margin-bottom: 5px;
  }
  .hc-sci-btn { height: 36px; }
  .hc-btn { height: 50px; }
  .hs-wrap, .sections, .cat-tabs { padding-left: 16px; padding-right: 16px; }
  .tool-page, .cat-page { padding: 28px 16px 60px; }
  .btt { bottom: 16px; right: 16px; }
  .not-found { padding: 52px 16px 60px; }
  .nf-code { font-size: 56px; }
}

/* ════════════════════════════════════════════
   TOOL CONTENT SECTIONS (SEO)
   ════════════════════════════════════════════ */
.tool-section {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 24px 28px;
  margin-top: 20px;
  box-shadow: var(--shadow);
}

.ts-title {
  font-size: 13px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--accent);
  opacity: .8; margin-bottom: 14px;
}

.ts-body {
  font-size: 13px; color: var(--muted);
  line-height: 1.8; font-family: 'Inter', sans-serif;
}

.ts-note {
  font-size: 11px; color: var(--dim);
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.7; margin-top: 10px;
}

/* ── Formula ─────────────────────────────── */
.formula-box {
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex; flex-direction: column; gap: 6px;
}
.formula-line {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; font-weight: 500;
  color: var(--accent); letter-spacing: .2px;
}

/* ── Worked Example ──────────────────────── */
.example-box {
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
}
.ex-scenario {
  font-size: 13px; color: var(--text); font-weight: 500;
  margin-bottom: 12px; line-height: 1.5;
}
.ex-steps {
  padding-left: 20px;
  display: flex; flex-direction: column; gap: 5px;
  margin-bottom: 14px;
}
.ex-steps li {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: var(--muted); line-height: 1.6;
}
.ex-result {
  font-size: 13px; font-weight: 700;
  color: var(--green);
  background: rgba(16,185,129,.07);
  border: 1.5px solid rgba(16,185,129,.2);
  border-radius: 8px;
  padding: 9px 14px;
  font-family: 'JetBrains Mono', monospace;
}

/* ── Quick Reference Table ───────────────── */
.qt-wrap { overflow-x: auto; }
.qt {
  width: 100%; border-collapse: collapse;
  font-size: 12px;
}
.qt th {
  text-align: left; padding: 8px 12px;
  font-size: 10px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; color: var(--muted);
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}
.qt td {
  padding: 8px 12px; color: var(--text);
  border-bottom: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
}
.qt tbody tr:last-child td { border-bottom: none; }
.qt tbody tr:hover td { background: var(--bg3); }

/* ── FAQ ─────────────────────────────────── */
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color .18s;
}
.faq-item[open] { border-color: rgba(92,107,192,.35); }
.faq-q {
  padding: 13px 16px;
  font-size: 13px; font-weight: 600; color: var(--text);
  cursor: pointer; list-style: none;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  transition: background .15s;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after {
  content: '+'; font-size: 18px; font-weight: 400;
  color: var(--accent); flex-shrink: 0; line-height: 1;
  transition: transform .2s;
}
.faq-item[open] .faq-q::after { transform: rotate(45deg); }
.faq-q:hover { background: var(--bg3); }
.faq-a {
  padding: 0 16px 14px;
  font-size: 13px; color: var(--muted); line-height: 1.75;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* ── Static pages (About, Privacy, Terms, Contact) ───────────────────────── */
.static-page { min-height: 70vh; }

.static-hero {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2, #7c4dff) 100%);
  color: #fff;
  padding: 56px 24px 48px;
  text-align: center;
}
.static-hero-inner { max-width: 680px; margin: 0 auto; }
.static-hero h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 800; margin: 0 0 12px; }
.static-lead { font-size: 1.1rem; opacity: .88; margin: 0; }

.static-body { padding: 48px 24px 72px; }
.container { max-width: 860px; margin: 0 auto; }

.static-section { margin-bottom: 40px; }
.static-section h2 {
  font-size: 1.15rem; font-weight: 700;
  color: var(--text); margin: 0 0 12px;
  padding-bottom: 8px; border-bottom: 2px solid var(--accent);
  display: inline-block;
}
.static-section h3 { font-size: 1rem; font-weight: 600; margin: 18px 0 8px; color: var(--text); }
.static-section p { color: var(--muted); line-height: 1.8; margin: 0 0 12px; }
.static-section ul { color: var(--muted); line-height: 1.8; padding-left: 20px; margin: 0 0 12px; }
.static-section li { margin-bottom: 6px; }
.static-section a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.static-section a:hover { opacity: .8; }
.static-section code {
  background: var(--bg3); padding: 2px 6px; border-radius: 4px;
  font-family: var(--mono, 'JetBrains Mono', monospace); font-size: .85em;
}

/* About — category cards */
.about-cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.about-cat-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px; border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--bg2);
  text-decoration: none !important;
  transition: border-color .15s, transform .15s;
}
.about-cat-card:hover { border-color: var(--cat-color); transform: translateY(-2px); }
.about-cat-icon { font-size: 1.5rem; line-height: 1; }
.about-cat-label { font-size: .9rem; font-weight: 700; color: var(--cat-color) !important; text-decoration: none; }
.about-cat-desc { font-size: .78rem; color: var(--muted) !important; line-height: 1.4; }

/* Contact layout */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 640px) { .contact-layout { grid-template-columns: 1fr; } }

.contact-email-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 1rem; font-weight: 600;
  color: var(--accent) !important;
  text-decoration: none !important;
}
.contact-email-link:hover { opacity: .8; }

/* Contact form */
.contact-form-wrap h2 {
  font-size: 1.15rem; font-weight: 700; margin: 0 0 20px;
  padding-bottom: 8px; border-bottom: 2px solid var(--accent);
  display: inline-block; color: var(--text);
}
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.cf-group { display: flex; flex-direction: column; gap: 6px; }
.cf-group label { font-size: .85rem; font-weight: 600; color: var(--text); }
.cf-group input,
.cf-group select,
.cf-group textarea {
  padding: 10px 14px; border-radius: 8px;
  border: 1.5px solid var(--border); background: var(--bg2); color: var(--text);
  font-size: .95rem; font-family: inherit;
  transition: border-color .15s;
}
.cf-group input:focus,
.cf-group select:focus,
.cf-group textarea:focus { outline: none; border-color: var(--accent); }
.cf-group textarea { resize: vertical; min-height: 120px; }
.cf-submit {
  padding: 12px 28px; border-radius: 8px; border: none;
  background: var(--accent); color: #fff;
  font-size: .95rem; font-weight: 700; cursor: pointer;
  transition: opacity .15s, transform .1s;
  align-self: flex-start;
}
.cf-submit:hover { opacity: .88; transform: translateY(-1px); }

.contact-success {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; border-radius: 10px;
  background: color-mix(in srgb, #22c55e 12%, transparent);
  border: 1.5px solid #22c55e; color: #16a34a;
  font-weight: 600;
}
[data-theme="dark"] .contact-success { color: #4ade80; }

.contact-error {
  padding: 12px 16px; border-radius: 8px;
  background: color-mix(in srgb, #ef4444 12%, transparent);
  border: 1.5px solid #ef4444; color: #dc2626;
  font-size: .9rem; font-weight: 600;
}
[data-theme="dark"] .contact-error { color: #f87171; }

/* Footer legal links */
.footer-legal {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 4px 16px;
}
.footer-legal a {
  font-size: 11.5px; color: var(--dim);
  text-decoration: none; transition: color .15s; font-weight: 500;
}
.footer-legal a:hover { color: var(--accent); }
