/* =============================================================
   VITALIS — styles.css
   1. Tokens  2. Reset  3. Utilities  4. Typography  5. Layout
   6. Nav  7. Buttons  8. Forms  9. Cards & tool card  10. Results
   11. Disclaimers  12. Tables  13. FAQ  14. Ad slots  15. Footer
   16. Journal  17. Search  18. Sections  19. Responsive  20. Print
   21. Reduced motion
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #f5f8fb;
  --surface: #ffffff;
  --surface-alt: #eef3f8;
  --border: #dde5ed;
  --border-strong: #c3d0dc;
  --text: #16232e;
  --text-muted: #526176;
  --text-faint: #7c8a9c;

  --brand: #0e6ba8;
  --brand-dark: #084c7a;
  --brand-light: #e7f2fb;
  --accent: #0f9d8c;
  --accent-light: #e3f7f4;

  --danger: #d1372c;
  --danger-bg: #fdecea;
  --danger-border: #f3b8b2;
  --warning: #a15c07;
  --warning-bg: #fef3da;
  --warning-border: #f0cf8a;
  --success: #157a4a;
  --success-bg: #e7f7ee;
  --success-border: #a9ddc0;
  --info: #0e6ba8;
  --info-bg: #e7f2fb;
  --info-border: #b7d9f2;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(16, 34, 51, 0.06);
  --shadow: 0 4px 16px rgba(16, 34, 51, 0.08);
  --shadow-lg: 0 12px 32px rgba(16, 34, 51, 0.12);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Lexend", var(--sans);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --header-h: 68px;
  --container: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1620;
    --surface: #121f2b;
    --surface-alt: #16232f;
    --border: #253746;
    --border-strong: #34495a;
    --text: #eaf1f7;
    --text-muted: #a9bacb;
    --text-faint: #7c8a9c;

    --brand: #4fa3e0;
    --brand-dark: #2e7fc0;
    --brand-light: #142c3d;
    --accent: #35c9b4;
    --accent-light: #10312c;

    --danger: #f27166;
    --danger-bg: #341918;
    --danger-border: #6b2b26;
    --warning: #e3ac4c;
    --warning-bg: #372a10;
    --warning-border: #6b501f;
    --success: #4bcf8e;
    --success-bg: #10301f;
    --success-border: #235a3b;
    --info: #4fa3e0;
    --info-bg: #142c3d;
    --info-border: #29506c;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);
  }
}
:root[data-theme="dark"] {
  --bg: #0c1620;
  --surface: #121f2b;
  --surface-alt: #16232f;
  --border: #253746;
  --border-strong: #34495a;
  --text: #eaf1f7;
  --text-muted: #a9bacb;
  --text-faint: #7c8a9c;
  --brand: #4fa3e0;
  --brand-dark: #2e7fc0;
  --brand-light: #142c3d;
  --accent: #35c9b4;
  --accent-light: #10312c;
  --danger: #f27166;
  --danger-bg: #341918;
  --danger-border: #6b2b26;
  --warning: #e3ac4c;
  --warning-bg: #372a10;
  --warning-border: #6b501f;
  --success: #4bcf8e;
  --success-bg: #10301f;
  --success-border: #235a3b;
  --info: #4fa3e0;
  --info-bg: #142c3d;
  --info-border: #29506c;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
input, select, textarea { font: inherit; color: inherit; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.15; font-family: var(--display); font-weight: 700; }
ul, ol { padding-left: 1.2em; }
::selection { background: var(--brand); color: #fff; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 9999;
  padding: .7rem 1.1rem; background: var(--text); color: var(--bg);
  border-radius: var(--radius-sm); font-weight: 600;
  transition: top .2s var(--ease-out);
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   3. Utilities
   ============================================================= */
.container { max-width: var(--container); margin-inline: auto; padding-inline: 1.25rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.stack { display: flex; flex-direction: column; }
.gap-xs { gap: .5rem; } .gap-sm { gap: .85rem; } .gap-md { gap: 1.5rem; } .gap-lg { gap: 2.5rem; }
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .78rem; }
.mt-0 { margin-top: 0; }
.center { text-align: center; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--border); border: 0; margin: 2rem 0; }

/* =============================================================
   4. Typography
   ============================================================= */
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); letter-spacing: -0.01em; margin-bottom: .6rem; }
h3 { font-size: 1.2rem; margin-bottom: .4rem; }
p + p, p + ul, ul + p { margin-top: .85rem; }
.lede { font-size: 1.1rem; color: var(--text-muted); max-width: 62ch; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--brand);
}
.prose { max-width: 72ch; }
.prose h2 { margin-top: 2.2rem; }
.prose h3 { margin-top: 1.6rem; }
.prose a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.prose li + li { margin-top: .35rem; }

/* =============================================================
   5. Layout
   ============================================================= */
main { display: block; min-height: 60vh; }
section { padding-block: clamp(2.5rem, 5vw, 4.5rem); }
section.tight { padding-block: clamp(1.5rem, 3vw, 2.5rem); }
.section-head { max-width: 68ch; margin-bottom: 2rem; }

/* =============================================================
   6. Header / Nav
   ============================================================= */
.site-header {
  position: sticky; top: 0; z-index: 500;
  height: var(--header-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .55rem; font-family: var(--display); font-weight: 800; font-size: 1.15rem; color: var(--text); }
.brand-mark { width: 34px; height: 34px; color: var(--brand); flex: none; }
.brand small { display: block; font-family: var(--sans); font-weight: 500; font-size: .68rem; color: var(--text-muted); letter-spacing: .02em; }

.nav-links { display: none; align-items: center; gap: 1.6rem; list-style: none; padding: 0; }
.nav-links a { font-size: .92rem; font-weight: 600; color: var(--text-muted); transition: color .18s var(--ease-out); white-space: nowrap; }
.nav-links a:hover, .nav-links a.is-active { color: var(--brand); }

.header-actions { display: flex; align-items: center; gap: .6rem; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  color: var(--text-muted); transition: background .18s var(--ease-out), color .18s var(--ease-out);
}
.icon-btn:hover { background: var(--surface-alt); color: var(--brand); }
.icon-btn svg { width: 20px; height: 20px; }

.nav-toggle { display: inline-flex; }
.mobile-nav {
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 450;
  background: var(--bg); overflow-y: auto;
  padding: 1.5rem 1.25rem 3rem;
  transform: translateY(-8px); opacity: 0; pointer-events: none;
  transition: opacity .2s var(--ease-out), transform .2s var(--ease-out);
}
.mobile-nav.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.mobile-nav ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .1rem; }
.mobile-nav a { display: block; padding: .95rem .25rem; font-size: 1.05rem; font-weight: 600; border-bottom: 1px solid var(--border); }
.mobile-nav a.is-active { color: var(--brand); }

/* Breadcrumbs */
.breadcrumbs { padding-block: .9rem; font-size: .82rem; color: var(--text-faint); }
.breadcrumbs ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: .35rem; color: var(--border-strong); }

/* =============================================================
   7. Buttons
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .85rem 1.4rem; border-radius: var(--radius-sm);
  font-weight: 700; font-size: .95rem; line-height: 1;
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out), background .15s var(--ease-out), border-color .15s var(--ease-out);
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-dark); box-shadow: var(--shadow); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(0.92); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1.5px solid var(--border-strong); }
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--brand-light); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(0.92); }
.btn-block { width: 100%; }
.btn-lg { padding: 1.05rem 1.8rem; font-size: 1.02rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: translateY(1px); }

/* =============================================================
   8. Forms
   ============================================================= */
.field { display: flex; flex-direction: column; gap: .4rem; }
.field label, .field legend { font-size: .86rem; font-weight: 700; color: var(--text); padding: 0; }
.field .hint { font-size: .78rem; color: var(--text-faint); }
.input, .select, textarea.input {
  width: 100%; padding: .75rem .9rem; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-size: .98rem; transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.input:focus, .select:focus, textarea.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); outline: none; }
.input-group { display: flex; }
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .select { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: 0; max-width: 9rem; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 1.1rem; }
fieldset { border: 0; padding: 0; }

.segmented { display: flex; flex-wrap: wrap; gap: .5rem; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  display: flex; flex-direction: column; gap: .1rem;
  padding: .6rem .9rem; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: .84rem; font-weight: 600; cursor: pointer; background: var(--surface);
  transition: border-color .15s var(--ease-out), background .15s var(--ease-out), color .15s var(--ease-out);
}
.segmented label span.pts { font-weight: 400; color: var(--text-faint); font-size: .72rem; }
.segmented input:checked + label { border-color: var(--brand); background: var(--brand-light); color: var(--brand-dark); }
.segmented input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 2px; }

.check-row { display: flex; align-items: flex-start; gap: .65rem; padding: .3rem 0; cursor: pointer; }
.check-row input { margin-top: .28rem; width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.check-row .check-label { font-weight: 600; font-size: .92rem; }
.check-row .check-desc { font-size: .78rem; color: var(--text-faint); }

/* =============================================================
   9. Cards & tool card
   ============================================================= */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow-sm);
}
.grid-cards { display: grid; grid-template-columns: 1fr; gap: 1.1rem; }
.tool-mini-card {
  display: flex; flex-direction: column; gap: .6rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.3rem; transition: border-color .18s var(--ease-out), transform .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
.tool-mini-card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow); }
.tool-mini-card .icon-wrap {
  width: 42px; height: 42px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-light); color: var(--brand); flex: none;
}
.tool-mini-card .icon-wrap svg { width: 22px; height: 22px; }
.tool-mini-card h3 { font-size: 1.02rem; }
.tool-mini-card p { font-size: .86rem; color: var(--text-muted); }
.tool-mini-card .tag { font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }

.tool-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 2rem); box-shadow: var(--shadow);
}
.tool-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.3rem; }
.tool-card__head h2 { margin: 0; font-size: 1.3rem; }

/* =============================================================
   10. Results
   ============================================================= */
.result-panel {
  margin-top: 1.4rem; padding: 1.3rem; border-radius: var(--radius);
  border: 1.5px solid var(--border); background: var(--surface-alt);
  animation: resultIn .35s var(--ease-out);
}
@keyframes resultIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.result-panel.is-success { background: var(--success-bg); border-color: var(--success-border); }
.result-panel.is-warning { background: var(--warning-bg); border-color: var(--warning-border); }
.result-panel.is-danger { background: var(--danger-bg); border-color: var(--danger-border); }
.result-panel.is-info { background: var(--info-bg); border-color: var(--info-border); }
.result-headline { font-family: var(--display); font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 800; line-height: 1.1; }
.result-panel.is-success .result-headline { color: var(--success); }
.result-panel.is-warning .result-headline { color: var(--warning); }
.result-panel.is-danger .result-headline { color: var(--danger); }
.result-panel.is-info .result-headline { color: var(--brand); }
.result-sub { margin-top: .3rem; color: var(--text-muted); font-size: .95rem; }
.result-meta { margin-top: .9rem; display: grid; gap: .4rem; font-size: .84rem; }
.result-meta div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dashed var(--border); padding-bottom: .35rem; }

.source-note {
  margin-top: 1.1rem; padding: .9rem 1rem; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  font-size: .78rem; color: var(--text-faint); line-height: 1.55;
}
.source-note strong { color: var(--text-muted); }
.source-note a { color: var(--brand); text-decoration: underline; }

/* =============================================================
   11. Disclaimers
   ============================================================= */
.disclaimer {
  display: flex; gap: .8rem; align-items: flex-start;
  padding: 1rem 1.1rem; border-radius: var(--radius); border: 1.5px solid;
  font-size: .87rem; line-height: 1.55;
}
.disclaimer svg { width: 22px; height: 22px; flex: none; margin-top: .1rem; }
.disclaimer strong { display: block; margin-bottom: .15rem; font-size: .92rem; }
.disclaimer.info { background: var(--info-bg); border-color: var(--info-border); color: var(--text); }
.disclaimer.info svg { color: var(--info); }
.disclaimer.warning { background: var(--warning-bg); border-color: var(--warning-border); color: var(--text); }
.disclaimer.warning svg { color: var(--warning); }
.disclaimer.danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--text); }
.disclaimer.danger svg { color: var(--danger); }
.disclaimer + .disclaimer { margin-top: .8rem; }
.page-disclaimer { margin-bottom: 1.5rem; }

/* =============================================================
   12. Tables
   ============================================================= */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 480px; }
thead th { text-align: left; background: var(--surface-alt); font-weight: 700; padding: .7rem .9rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody td { padding: .65rem .9rem; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-alt); }
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.badge.low { background: var(--info-bg); color: var(--info); }
.badge.normal { background: var(--success-bg); color: var(--success); }
.badge.high { background: var(--danger-bg); color: var(--danger); }
.badge.mid { background: var(--warning-bg); color: var(--warning); }
.badge.neutral { background: var(--surface-alt); color: var(--text-muted); }

/* =============================================================
   13. FAQ
   ============================================================= */
.faq-list { display: flex; flex-direction: column; gap: .6rem; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.faq-item summary {
  cursor: pointer; list-style: none; padding: 1rem 1.2rem; font-weight: 700; font-size: .96rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; font-size: 1.3rem; color: var(--brand); flex: none; font-weight: 400;
  transition: transform .2s var(--ease-out);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-body { padding: 0 1.2rem 1.1rem; color: var(--text-muted); font-size: .92rem; }

/* =============================================================
   14. Ad slots
   ============================================================= */
.ad-slot {
  display: flex; align-items: center; justify-content: center;
  min-height: 100px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
  color: var(--text-faint); font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  background: var(--surface-alt); margin-block: 2rem;
}
.ad-slot.leaderboard { min-height: 90px; }
.ad-slot.in-content { min-height: 120px; }

/* =============================================================
   15. Footer
   ============================================================= */
.site-footer { background: var(--surface-alt); border-top: 1px solid var(--border); padding-block: 3rem 1.5rem; margin-top: 3rem; }
.footer-top { display: grid; grid-template-columns: 1fr; gap: 2rem; padding-bottom: 2.2rem; }
.footer-brand p { font-size: .88rem; color: var(--text-muted); max-width: 34ch; margin-top: .6rem; }
.footer-col h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); margin-bottom: .8rem; }
.footer-col ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.footer-col a { font-size: .88rem; color: var(--text-muted); }
.footer-col a:hover { color: var(--brand); }

.network-strip { border-top: 1px solid var(--border); padding-top: 1.8rem; margin-top: .5rem; }
.network-strip h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); margin-bottom: 1rem; }
.network-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.network-chip {
  display: flex; flex-direction: column; gap: .1rem; padding: .7rem .85rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color .18s var(--ease-out);
}
.network-chip:hover { border-color: var(--brand); }
.network-chip .name { font-weight: 700; font-size: .82rem; }
.network-chip .desc { font-size: .72rem; color: var(--text-faint); }

.footer-bottom { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; padding-top: 1.6rem; border-top: 1px solid var(--border); margin-top: 1.6rem; font-size: .78rem; color: var(--text-faint); }
.footer-bottom .legal-links { display: flex; gap: 1.1rem; flex-wrap: wrap; }

/* =============================================================
   16. Journal
   ============================================================= */
.journal-toolbar { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; justify-content: space-between; margin-bottom: 1.3rem; }
.journal-entry { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.3rem; background: var(--surface); }
.journal-entry + .journal-entry { margin-top: .8rem; }
.journal-entry__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.journal-entry__date { font-weight: 700; font-size: .92rem; }
.journal-entry__meta { display: flex; flex-wrap: wrap; gap: .4rem .9rem; margin-top: .5rem; font-size: .82rem; color: var(--text-muted); }
.journal-entry__meta span strong { color: var(--text); }
.journal-entry__notes { margin-top: .6rem; font-size: .88rem; color: var(--text-muted); }
.journal-entry__actions { display: flex; gap: .4rem; }
.journal-empty { text-align: center; padding: 3rem 1rem; color: var(--text-faint); }
.journal-empty svg { width: 48px; height: 48px; margin: 0 auto 1rem; color: var(--border-strong); }

/* =============================================================
   17. Search overlay
   ============================================================= */
dialog.search-dialog {
  border: 0; border-radius: var(--radius-lg); padding: 0; width: min(560px, 92vw);
  background: var(--surface); box-shadow: var(--shadow-lg); color: var(--text);
}
dialog.search-dialog::backdrop { background: rgba(10, 20, 30, .55); backdrop-filter: blur(2px); }
.search-box { display: flex; align-items: center; gap: .6rem; padding: 1.1rem 1.2rem; border-bottom: 1px solid var(--border); }
.search-box svg { width: 20px; height: 20px; color: var(--text-faint); flex: none; }
.search-box input { flex: 1; border: 0; font-size: 1.05rem; background: transparent; outline: none; }
.search-results { max-height: 60vh; overflow-y: auto; padding: .6rem; }
.search-result { display: flex; flex-direction: column; gap: .1rem; padding: .75rem .9rem; border-radius: var(--radius-sm); }
.search-result:hover, .search-result.is-active { background: var(--brand-light); }
.search-result .t { font-weight: 700; font-size: .92rem; }
.search-result .d { font-size: .78rem; color: var(--text-faint); }
.search-empty { padding: 2rem 1rem; text-align: center; color: var(--text-faint); font-size: .9rem; }

/* =============================================================
   18. Common sections
   ============================================================= */
.hero { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(2rem, 4vw, 3rem); }
.hero-grid { display: grid; gap: 2rem; align-items: center; }
.hero-badges { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.3rem; }
.pill { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .8rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: .78rem; font-weight: 600; color: var(--text-muted); }
.pill svg { width: 15px; height: 15px; }
.hero-visual { display: flex; align-items: center; justify-content: center; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }

.stat-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 2rem; }
.stat-box { padding: 1.1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.stat-box .num { font-family: var(--display); font-size: 1.7rem; font-weight: 800; color: var(--brand); }
.stat-box .lbl { font-size: .78rem; color: var(--text-faint); margin-top: .2rem; }

.category-strip { display: flex; gap: .6rem; overflow-x: auto; padding-bottom: .4rem; margin-bottom: 1.6rem; }
.category-chip { flex: none; padding: .55rem 1rem; border-radius: 999px; border: 1.5px solid var(--border-strong); font-size: .84rem; font-weight: 700; color: var(--text-muted); }
.category-chip.is-active, .category-chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }

.guide-card { display: flex; flex-direction: column; gap: .5rem; padding: 1.3rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.guide-card h3 { font-size: 1.02rem; }
.guide-card p { font-size: .86rem; color: var(--text-muted); }
.guide-card .tool-link { font-size: .82rem; font-weight: 700; color: var(--brand); margin-top: .3rem; }

.source-list { display: flex; flex-direction: column; gap: 1.2rem; }
.source-entry { padding: 1.1rem 1.3rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.source-entry h3 { font-size: .98rem; }
.source-entry a { font-size: .84rem; color: var(--brand); word-break: break-word; }
.source-entry .meta { font-size: .78rem; color: var(--text-faint); margin-top: .3rem; }

/* =============================================================
   19. Responsive
   ============================================================= */
@media (min-width: 540px) {
  .grid-cards { grid-template-columns: repeat(2, 1fr); }
  .form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .network-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 720px) {
  .hero-grid { grid-template-columns: 1.1fr .9fr; }
  .stat-row { grid-template-columns: repeat(4, 1fr); }
  .footer-top { grid-template-columns: 1.3fr repeat(4, 1fr); }
}
@media (min-width: 960px) {
  .nav-links { display: flex; }
  .nav-toggle { display: none; }
  .grid-cards.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .network-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1280px) {
  .grid-cards { grid-template-columns: repeat(3, 1fr); }
}

/* =============================================================
   20. Print (health journal PDF-style preview / print)
   ============================================================= */
@media print {
  .site-header, .site-footer, .breadcrumbs, .ad-slot, .journal-toolbar, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .tool-card, .card, .journal-entry { box-shadow: none; border: 1px solid #ccc; }
}

/* =============================================================
   21. Reduced motion — only intrusive effects gated
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .result-panel { animation: none; }
}
