/* ================================================================
   Compat layer — bridges legacy content-page class names into the
   new design system so pre-existing pages render correctly.
   Load AFTER design.css.
   ================================================================ */

/* layout primitives */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); width: 100%; }
.section-tight { padding: 48px 0; }
.bg-soft { background: var(--paper-2); }
.bg-blue-soft { background: color-mix(in oklch, var(--shield-tint) 55%, var(--paper)); }
.bg-coral-soft { background: var(--warn-tint); }

/* legacy topbar + hardcoded nav/footer: hide so JS-injected ones take over */
.topbar, a.skip-link { display: none !important; }
.nav-wrap, footer.site-footer { display: none !important; }

/* page-header — magazine-style */
.page-header {
  padding: clamp(56px, 7vw, 112px) 0 clamp(32px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--paper-2) 0%, var(--paper) 100%);
  position: relative;
}
.page-header::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--shield-2) 0%, var(--go) 50%, var(--warn) 100%);
  opacity: 0.85;
}
.page-header .container { display: flex; flex-direction: column; }
.page-header h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(40px, 5.5vw, 80px);
  line-height: 0.98; letter-spacing: -0.02em;
  margin: 14px 0 20px;
  max-width: 22ch;
  color: var(--ink);
}
.page-header h1 em { font-style: italic; color: var(--shield-2); }
.page-header p.lead {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(19px, 1.6vw, 26px);
  color: var(--ink-2);
  max-width: 60ch;
  line-height: 1.35;
  letter-spacing: -0.005em;
  margin: 0;
}
.page-header .ph-meta {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  margin-top: 28px; padding-top: 20px;
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  color: var(--ink-3);
}
.page-header .ph-meta .dot { opacity: 0.4; }
.page-header .ph-meta .tag {
  display: inline-block;
  background: var(--shield-tint); color: var(--shield);
  padding: 4px 10px; border-radius: 999px;
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid color-mix(in oklch, var(--shield) 22%, transparent);
}
.breadcrumb { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 14px; }
.breadcrumb a { color: var(--ink-3); text-decoration: none; }
.breadcrumb a:hover { color: var(--ink); }

@media (max-width: 600px) {
  .page-header h1 { font-size: clamp(30px, 9vw, 44px); line-height: 1; }
  .page-header p.lead { font-size: 17px; }
}

/* Page-header CTA row — visible above the fold on every content page */
.page-header .ph-ctas {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-top: 28px;
}
.ph-ctas .btn {
  padding: 13px 20px;
  font-size: 14.5px;
  font-weight: 500;
}
.ph-ctas .ph-cta-primary {
  background: var(--ink);
  color: var(--paper) !important;
  border-color: var(--ink);
}
.ph-ctas .ph-cta-primary:hover {
  background: var(--shield);
  border-color: var(--shield);
}
.ph-ctas .ph-cta-emergency {
  background: transparent;
  color: var(--stop) !important;
  border: 1px solid var(--stop);
}
.ph-ctas .ph-cta-emergency:hover {
  background: var(--stop);
  color: var(--paper) !important;
}
.ph-ctas .ph-cta-emergency svg { stroke: currentColor; }
@media (max-width: 560px) {
  .page-header .ph-ctas { width: 100%; }
  .ph-ctas .btn { flex: 1; justify-content: center; min-width: 140px; }
}

/* section-head */
.section-head { text-align: center; max-width: 720px; margin: 0 auto 48px; }
.section-head p { color: var(--ink-2); font-size: 18px; }
.section-head .eyebrow { justify-content: center; display: inline-flex; }

/* prose — editorial long-form treatment */
.prose { max-width: 72ch; margin: 0 auto; }
.prose > h2:first-child,
.prose > p:first-child { margin-top: 0; }

/* First paragraph gets a lede treatment */
.prose > p:first-of-type {
  font-size: clamp(18px, 1.3vw, 21px);
  line-height: 1.55;
  color: var(--ink);
  font-weight: 400;
}
.prose > p:first-of-type::first-letter {
  font-family: var(--serif);
  font-size: 2.8em;
  line-height: 0.9;
  float: left;
  padding: 8px 10px 0 0;
  color: var(--shield-2);
  font-weight: 400;
}

.prose h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(28px, 3vw, 42px); line-height: 1.08;
  margin-top: 2em; color: var(--ink);
  position: relative;
  padding-top: 0.2em;
}
.prose h2::before {
  content: "";
  display: block;
  width: 40px; height: 2px;
  background: var(--shield-2);
  margin-bottom: 16px;
  opacity: 0.5;
}
.prose h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(20px, 1.8vw, 26px); line-height: 1.15; margin-top: 1.5em; color: var(--ink); }
.prose p { font-size: 17px; line-height: 1.65; color: var(--ink-2); }

/* Pull-quote utility */
.prose blockquote {
  font-family: var(--serif);
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.25;
  font-style: italic;
  color: var(--ink);
  margin: 36px 0;
  padding: 8px 0 8px 28px;
  border-left: 3px solid var(--shield-2);
  max-width: none;
}
.prose ul, .prose ol { color: var(--ink-2); padding-left: 1.25rem; }
.prose ul li, .prose ol li { margin-bottom: 0.5em; }
.prose code { font-family: var(--mono); background: var(--paper-2); padding: 2px 6px; border-radius: 4px; font-size: 0.92em; color: var(--ink); }
.prose dl dt { font-weight: 600; color: var(--ink); margin-top: 1em; }
.prose dl dd { margin-left: 0; color: var(--ink-2); margin-bottom: 0.75em; }

/* callouts — map legacy color names to the design system */
.callout {
  padding: 20px 24px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--paper-2);
  color: var(--ink); display: block; margin: 28px 0;
  position: relative;
  border-left-width: 4px;
  border-left-color: var(--shield-2);
}
.callout strong { display: block; margin-bottom: 4px; color: var(--ink); font-weight: 600; }
.callout.coral { background: var(--warn-tint); border-color: color-mix(in oklch, var(--warn) 35%, transparent); border-left-color: var(--warn); color: oklch(0.38 0.1 75); }
.callout.coral strong { color: oklch(0.3 0.1 75); }
.callout.warn  { background: var(--warn-tint); border-color: color-mix(in oklch, var(--warn) 40%, transparent); border-left-color: var(--warn); color: oklch(0.38 0.1 75); }
.callout.warn strong { color: oklch(0.3 0.1 75); }
.callout.green { background: var(--go-tint); border-color: color-mix(in oklch, var(--go) 30%, transparent); border-left-color: var(--go); color: var(--go); }
.callout.green strong { color: color-mix(in oklch, var(--go) 80%, var(--ink)); }

/* checklist — monospace numbered counters (matches design's .steps pattern) */
.checklist { list-style: none; padding: 0; margin: 18px 0; counter-reset: chk; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.checklist li { counter-increment: chk; background: var(--paper); padding: 16px 20px 16px 64px; position: relative; color: var(--ink-2); margin: 0; font-size: 15.5px; line-height: 1.55; }
.checklist li::before {
  content: counter(chk, decimal-leading-zero);
  position: absolute; left: 20px; top: 16px;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.05em;
  color: var(--shield-2);
  font-weight: 500;
}
.checklist li strong { color: var(--ink); }

/* toc */
.toc { background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 20px 24px; margin: 28px 0; }
.toc h4 { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-3); margin: 0 0 12px; font-weight: 400; }
.toc ol { padding-left: 20px; margin: 0; }
.toc li { margin-bottom: 6px; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--shield); }

/* article meta row */
.meta { display: flex; gap: 14px; flex-wrap: wrap; font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin-bottom: 20px; align-items: center; }
.meta .tag { display: inline-block; background: var(--shield-tint); color: var(--shield); padding: 4px 10px; border-radius: 999px; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; border: 1px solid color-mix(in oklch, var(--shield) 25%, transparent); }

/* legacy button classes */
.btn-primary { display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; background: var(--ink); color: var(--paper) !important; text-decoration: none; border-radius: 8px; font-weight: 500; font-size: 15px; border: 1px solid var(--ink); cursor: pointer; font-family: var(--sans); }
.btn-primary:hover { background: var(--shield); border-color: var(--shield); }
.btn-secondary { display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; font-weight: 500; font-size: 15px; text-decoration: none; cursor: pointer; font-family: var(--sans); }
.btn-secondary:hover { background: var(--paper-2); border-color: var(--ink-3); }
.btn-coral { display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; background: var(--stop); color: var(--paper) !important; border: 1px solid var(--stop); border-radius: 8px; font-weight: 500; font-size: 15px; text-decoration: none; font-family: var(--sans); }
.btn-coral:hover { background: oklch(0.48 0.18 25); }
.btn-ghost { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; background: transparent; color: var(--shield); text-decoration: none; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.btn-block { width: 100%; justify-content: center; }

/* generic grid */
.grid { display: grid; gap: 24px; }
.grid.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid.grid-3, .grid.grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid.grid-2, .grid.grid-3, .grid.grid-4 { grid-template-columns: 1fr; } }

/* content cards */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 28px; display: flex; flex-direction: column; gap: 10px; transition: border-color 0.2s, transform 0.15s; text-decoration: none; color: inherit; }
.card:hover { border-color: var(--shield-2); }
.card h3 { font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 1.15; margin: 6px 0 4px; color: var(--ink); }
.card p { color: var(--ink-2); font-size: 15px; margin: 0; }
.card .icon { width: 44px; height: 44px; background: var(--shield-tint); color: var(--shield); border-radius: 10px; display: grid; place-items: center; margin-bottom: 6px; }
.card .icon.coral { background: var(--warn-tint); color: oklch(0.5 0.14 75); }
.card .icon svg { width: 22px; height: 22px; }
.card-link { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); text-decoration: none; margin-top: auto; display: inline-flex; align-items: center; gap: 6px; }
.card-link::after { content: " →"; transition: transform 0.15s; }
.card:hover .card-link::after { transform: translateX(4px); }

/* tool card */
.card-tool { display: flex; flex-direction: column; gap: 12px; }
.card-tool .logo-ph { width: 48px; height: 48px; background: var(--shield-tint); color: var(--shield); border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-family: var(--mono); font-size: 16px; }

/* legacy badges */
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 10px; padding: 4px 10px; background: var(--paper-2); border: 1px solid var(--line); color: var(--ink-2); border-radius: 999px; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; }
.badge.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.badge-green { background: var(--go-tint); color: var(--go); border-color: color-mix(in oklch, var(--go) 25%, transparent); }
.badge-blue  { background: var(--shield-tint); color: var(--shield); border-color: color-mix(in oklch, var(--shield) 25%, transparent); }
.badge-coral { background: var(--warn-tint); color: oklch(0.48 0.13 75); border-color: color-mix(in oklch, var(--warn) 25%, transparent); }
.badge-red   { background: var(--stop-tint); color: var(--stop); border-color: color-mix(in oklch, var(--stop) 25%, transparent); }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* legacy article-card */
.article-card { display: flex; flex-direction: column; gap: 10px; padding: 22px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: inherit; transition: border-color 0.2s; }
.article-card:hover { border-color: var(--shield-2); }
.article-card h3 { font-family: var(--serif); font-weight: 400; font-size: 20px; line-height: 1.2; margin: 0; }
.article-card h3 a { color: var(--ink); text-decoration: none; }
.article-card:hover h3 a, .article-card h3 a:hover { color: var(--shield); }
.article-card p { color: var(--ink-2); font-size: 15px; margin: 0; }
.article-card .meta { margin-bottom: 0; }

/* comparison table */
.table-wrap { border: 1px solid var(--line); border-radius: 10px; overflow: auto; background: var(--paper); }
table.compare { width: 100%; border-collapse: collapse; font-size: 14px; }
table.compare th, table.compare td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); color: var(--ink-2); }
table.compare th { background: var(--paper-2); font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); font-weight: 400; }
table.compare td strong { color: var(--ink); font-weight: 600; }
table.compare tr:last-child td { border-bottom: 0; }

/* forms */
.form-row { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.form-row label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.form-row input, .form-row textarea, .form-row select { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; font-family: var(--sans); font-size: 15px; background: var(--paper); color: var(--ink); transition: border-color 0.15s, box-shadow 0.15s; }
.form-row input:focus, .form-row textarea:focus, .form-row select:focus { outline: none; border-color: var(--shield-2); box-shadow: 0 0 0 4px color-mix(in oklch, var(--shield-2) 18%, transparent); }
.form-row textarea { min-height: 140px; resize: vertical; }
.form-inline { display: flex; gap: 8px; flex-wrap: wrap; }
.form-inline input { flex: 1; min-width: 240px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; font-family: var(--sans); font-size: 15px; background: var(--paper); color: var(--ink); }
.form-inline input:focus { outline: none; border-color: var(--shield-2); box-shadow: 0 0 0 4px color-mix(in oklch, var(--shield-2) 18%, transparent); }
.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; }

/* misc utilities */
.text-center { text-align: center; }
.muted { color: var(--ink-3); }
.small { font-size: 14px; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 16px; } .mb-4 { margin-bottom: 32px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }

/* ================================================================
   (Editorial treatments removed per user request 2026-04-22.)
   The following selectors are no longer emitted; they were removed.
   ================================================================ */
/* Editorial treatments removed */

/* ================================================================
   Browser compatibility fallbacks (phase — older Safari/Firefox/etc.)
   oklch() is Chrome 111+, Safari 15.4+, Firefox 113+. Older browsers
   fall back to transparent. Provide RGB fallbacks as @supports else-case.
   ================================================================ */
@supports not (color: oklch(0.5 0.1 250)) {
  :root {
    --ink: #0f1c2e;
    --ink-2: #334155;
    --ink-3: #64748b;
    --paper: #fafaf7;
    --paper-2: #f1f0ea;
    --line: #dfe3ea;
    --line-2: #e8ebf0;
    --shield: #364c8c;
    --shield-2: #3b72d4;
    --shield-tint: #e6edf9;
    --go: #1f8a5c;
    --go-tint: #e7f5ec;
    --stop: #c14d38;
    --stop-tint: #fbeae5;
    --warn: #d4a34b;
    --warn-tint: #fbf2de;
  }
  /* Replace color-mix() with static rgba fallbacks at point of use */
  .callout.shield { background: rgba(59, 114, 212, 0.08); border-color: rgba(59, 114, 212, 0.3); }
  .pill.shield { background: #e6edf9; color: #3b72d4; }
  .mega-menu { box-shadow: 0 18px 48px -12px rgba(15, 28, 46, 0.3); }
  .site-search input:focus { box-shadow: 0 0 0 4px rgba(59, 114, 212, 0.2); }
  .nav { background: rgba(250, 250, 247, 0.92); }
}

/* Prefix backdrop-filter for Safari (still requires -webkit- in older versions) */
.nav { -webkit-backdrop-filter: saturate(1.2) blur(10px); }

/* ================================================================
   Mobile usability — tap targets, iOS input zoom prevention
   ================================================================ */
/* Minimum 44x44 tap target for all interactive elements (Apple HIG) */
@media (pointer: coarse) {
  .nav-links a, .nav-cta, .btn, .btn-primary, .btn-secondary, .btn-coral,
  .card-foot, .pill, .badge, .site-print-btn {
    min-height: 44px;
    line-height: 1.2;
  }
  .nav-links a { padding-top: 12px; padding-bottom: 12px; }
}

/* Prevent iOS Safari auto-zoom on input focus (requires font-size >= 16px) */
input, select, textarea {
  font-size: 16px !important;
}
@media (min-width: 721px) {
  input, select, textarea { font-size: 15px !important; }
}

/* Prevent horizontal overflow from any rogue wide content */
html, body { overflow-x: hidden; }
.wrap, .container, .prose, main, section { max-width: 100%; }

/* Images never exceed their container */
img, svg, video { max-width: 100%; height: auto; }

/* Tables that might be too wide on mobile get horizontal scroll */
.prose table, table.compare { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Tighter hero + visual on narrow screens */
@media (max-width: 600px) {
  .hero { padding: 48px 0 32px; }
  .hero-visual { padding: 18px; }
  .hero-meta { gap: 18px; margin-top: 24px; padding-top: 18px; }
  .hero-meta .item b { font-size: 22px; }
  .hero-cta-row .btn { flex: 1; min-width: 140px; justify-content: center; }
  .eyebrow::before { display: none; }
  .page-header { padding: 32px 0 24px; }
  .page-header h1 { font-size: clamp(28px, 8vw, 40px); }
}

/* ================================================================
   Homepage-specific mobile fixes (inline-styled sections)
   The design bundle uses inline grids; force them to stack on mobile.
   ================================================================ */
@media (max-width: 760px) {
  /* Mission: 1fr 2fr → stacked */
  section[data-screen-label="Home · Mission"] .wrap > div[style*="grid-template-columns: 1fr 2fr"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  /* Device picker header: 1fr 1fr → stacked */
  section[data-screen-label="Home · Device picker"] .wrap > div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    align-items: start !important;
  }
  section[data-screen-label="Home · Device picker"] .wrap > div p[style*="justify-self"] {
    justify-self: start !important;
  }
  /* Latest articles header: flex wrap cleanly */
  section[data-screen-label="Home · Latest"] .wrap > div[style*="justify-content:space-between"] {
    align-items: flex-start !important;
  }
  /* Reposition the rotated "START HERE" tag so it doesn't overflow */
  .hero aside > div[style*="rotate(2deg)"] {
    top: -8px !important;
    right: 8px !important;
    font-size: 10px !important;
    padding: 6px 10px !important;
  }
}

/* Hero checklist card spacing on mobile */
@media (max-width: 600px) {
  .hero aside > div[style*="border:1px solid var(--line)"] { padding: 18px !important; }
  .hero aside > div li {
    padding: 8px 0 !important;
  }
}

/* Newsletter card in homepage footer — prevent edge-touching on small screens */
@media (max-width: 600px) {
  section[data-screen-label="Home · Newsletter"] .wrap > div[style*="border:1px solid var(--line)"] {
    padding: 28px 22px !important;
  }
}

/* Homepage "Our promise" pills — wrap gracefully at narrow widths */
@media (max-width: 560px) {
  section[data-screen-label="Home · Promise"] .wrap > div[style*="inline-flex"] {
    gap: 12px !important;
  }
  section[data-screen-label="Home · Promise"] .wrap h2 {
    font-size: clamp(28px, 9vw, 40px) !important;
  }
}

/* Make sure the mega-menu never overflows mobile even if JS fails */
@media (max-width: 860px) {
  .mega-menu { display: none !important; }
  .nav-has-mega:hover .mega-menu,
  .nav-has-mega:focus-within .mega-menu { display: none !important; }
}

/* Better line-length on small screens */
@media (max-width: 600px) {
  p, .prose p, .prose li { font-size: 16.5px; line-height: 1.58; }
}

/* ================================================================
   Accessibility improvements (phase 1a)
   ================================================================ */

/* visible skip-link on focus */
a.skip-link { display: block !important; }
a.skip-link { position: absolute; left: -10000px; top: 0; width: 1px; height: 1px; overflow: hidden; }
a.skip-link:focus {
  position: fixed; left: 16px; top: 12px;
  width: auto; height: auto; padding: 10px 16px;
  background: var(--ink); color: var(--paper);
  border-radius: 8px; z-index: 100;
  font-family: var(--sans); font-weight: 500; font-size: 15px;
  overflow: visible;
  text-decoration: none;
}

/* :focus-visible states that don't disrupt the hover aesthetic */
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--shield-2);
  outline-offset: 3px;
  border-radius: 4px;
}
.device:focus-visible, .card:focus-visible, .article-card:focus-visible {
  outline: 3px solid var(--shield-2); outline-offset: 4px;
}
.section.ink a:focus-visible,
.section.ink button:focus-visible,
.footer a:focus-visible {
  outline-color: oklch(0.85 0.08 245);
}

/* bump base font size on content pages for readability */
body { font-size: 18px; }
.prose p, .prose ul li, .prose ol li { font-size: 17.5px; }

/* eyebrow slightly larger for older readers */
.eyebrow { font-size: 13px; }

/* ================================================================
   Design refinements (ship everything)
   ================================================================ */

/* Emergency CTA — coral/stop treatment so it doesn't disappear in nav */
.nav-cta-emergency {
  background: var(--stop) !important;
  color: var(--paper) !important;
  border: 1px solid var(--stop) !important;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.nav-cta-emergency:hover {
  background: oklch(0.48 0.19 25) !important;
  border-color: oklch(0.48 0.19 25) !important;
  color: var(--paper) !important;
}
.nav-cta-emergency svg { stroke: currentColor; }

/* Subtle visited-state for content links so returning readers can track what they've seen */
.prose a:visited,
.article-card:visited h3,
.article-card:visited h3 a,
.card.link:visited h3 {
  color: color-mix(in oklch, var(--shield) 60%, var(--ink-2));
}
.prose a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in oklch, var(--shield-2) 40%, transparent); }
.prose a:hover { text-decoration-color: var(--shield-2); color: var(--shield); }

/* Contrast tuning for paper-2 backgrounds — raise ink-3 a touch */
.bg-soft .muted, .page-header .muted,
.callout .small.muted { color: oklch(0.42 0.03 250); }

/* Eyebrow contrast fix on ink sections */
.section.ink .eyebrow { color: oklch(0.78 0.04 245); }

/* Article page header — elevated editorial treatment */
body[data-page="resources"] .page-header,
body[data-page="resources"] .page-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  padding: clamp(56px, 7vw, 112px) 0 clamp(36px, 4vw, 64px);
}
body[data-page="resources"] .page-header h1 {
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.02;
  max-width: 22ch;
}
body[data-page="resources"] .page-header p.lead {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(19px, 1.5vw, 24px);
  color: var(--ink-2);
  max-width: 56ch;
  line-height: 1.35;
}

/* Article meta row inside .prose — show date/tag prominently at top */
.prose .meta:first-child,
.prose > :first-child.meta { margin-top: -8px; margin-bottom: 28px; }

/* First H2 in article prose sits closer to meta */
.prose .meta + h2 { margin-top: 0.4em; }

/* Printable-resource page polish — subtle paper-sheet look on screen */
body[data-page="resources"] .prose .no-print + .prose,
.no-print + h2 { margin-top: 1.2em; }

/* Device picker shadow on dark cards for depth */
.section.ink .device {
  box-shadow: 0 1px 0 oklch(0.3 0.03 250), 0 0 0 0 transparent;
}
.section.ink .device:hover {
  box-shadow: 0 1px 0 oklch(0.35 0.05 245), 0 12px 40px -10px oklch(0.1 0.05 250);
}

/* Emergency page — callouts need more urgency, subtle left-rule */
body[data-page="emergency"] .callout.warn {
  border-left: 4px solid var(--stop);
}

/* ================================================================
   Print styles (ship on every page — phase 1b)
   ================================================================ */
@media print {
  .no-print, .nav, .footer, .topbar, .skip-link, .site-print-btn,
  .site-search, .mega-menu, .related-guides, .sticky-toc { display: none !important; }

  /* Neutralize dark sections for print */
  .section.ink, .hero { background: #fff !important; color: #000 !important; padding: 0 !important; }
  .section.ink h1, .section.ink h2, .section.ink h3, .section.ink p,
  .section.ink a, .section.ink .eyebrow { color: #000 !important; }
  .device, .hero-visual, .newsletter-card { background: #fff !important; color: #000 !important; border: 1px solid #ccc !important; }

  body { font-size: 11pt; color: #000; background: #fff; line-height: 1.45; }
  .wrap, .container { max-width: 100% !important; padding: 0 !important; }
  .section { padding: 16px 0 !important; border-top: 0 !important; }
  .page-header { background: #fff !important; border-bottom: 2px solid #000 !important; padding: 8px 0 !important; }

  .prose { max-width: 100% !important; }
  .prose h2 { font-size: 16pt; margin-top: 18pt; page-break-after: avoid; }
  .prose h3 { font-size: 13pt; page-break-after: avoid; }
  .prose p { orphans: 3; widows: 3; }
  .checklist li, .steps li, .card, .callout, .toc { page-break-inside: avoid; border-color: #000 !important; }

  /* show URLs after external links but not after in-page anchors or internal site links */
  a[href^="http"]:not([href*="secureyourkidsdevice.com"])::after {
    content: " (" attr(href) ")";
    font-family: monospace; font-size: 9pt; color: #666;
  }

  a { color: #000; text-decoration: underline; }
  img, svg { max-width: 100%; }

  /* small print-only header */
  main::before {
    content: "SecureYourKidsDevice.com — printed for personal use";
    display: block;
    font-family: monospace; font-size: 9pt; color: #666;
    border-bottom: 1px solid #ccc;
    padding-bottom: 4px; margin-bottom: 16px;
  }
}

/* ================================================================
   Inline print toolbar — refined, editorial, less banner-y
   ================================================================ */
.print-toolbar {
  background: transparent;
  border-bottom: 1px solid var(--line);
  padding: 18px 0 22px;
}
.print-toolbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
}
.print-toolbar-msg {
  display: flex; flex-direction: row; gap: 10px; align-items: baseline;
  font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3);
}
.print-toolbar-msg strong {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 12px;
  color: var(--ink);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.print-toolbar-msg span { color: var(--ink-3); }
.print-toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.print-toolbar-actions .btn {
  padding: 10px 16px; font-size: 13px; font-weight: 500;
  border-radius: 999px;
  min-height: 0;
}
.print-toolbar-actions .btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.print-action { cursor: pointer; }

@media (max-width: 720px) {
  .print-toolbar-inner { flex-direction: column; align-items: stretch; gap: 12px; }
  .print-toolbar-msg { justify-content: flex-start; }
  .print-toolbar-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .print-toolbar-actions .btn { justify-content: center; }
}

/* ================================================================
   Site-print button (shows on guide/article/resource pages)
   ================================================================ */
.site-print-btn {
  position: fixed; right: 20px; bottom: 20px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: var(--ink); color: var(--paper);
  border: 0; border-radius: 999px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  box-shadow: 0 6px 20px -6px color-mix(in oklch, var(--ink) 60%, transparent);
  cursor: pointer; z-index: 40;
}
.site-print-btn:hover { background: var(--shield); }
.site-print-btn svg { width: 14px; height: 14px; }
@media (max-width: 640px) {
  .site-print-btn { right: 12px; bottom: 12px; padding: 10px 14px; }
  .site-print-btn span.label { display: none; }
}

/* ================================================================
   Mega-menu dropdown (phase 2b)
   ================================================================ */
.nav-has-mega { position: relative; }
.mega-menu {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  min-width: 760px; max-width: calc(100vw - 40px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 48px -12px color-mix(in oklch, var(--ink) 30%, transparent);
  padding: 24px;
  display: none;
  z-index: 60;
}
.nav-has-mega:hover .mega-menu,
.nav-has-mega:focus-within .mega-menu,
.nav-has-mega.open .mega-menu { display: grid; }
.mega-menu { grid-template-columns: repeat(4, 1fr); gap: 20px 28px; }
.mega-menu h5 {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-3);
  margin: 0 0 10px; font-weight: 400;
  padding-bottom: 8px; border-bottom: 1px solid var(--line-2);
}
.mega-menu ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.mega-menu a {
  display: block; padding: 6px 8px; border-radius: 6px;
  color: var(--ink-2); text-decoration: none; font-size: 14px;
  font-family: var(--sans);
}
.mega-menu a:hover { background: var(--paper-2); color: var(--ink); }
@media (max-width: 1080px) { .mega-menu { min-width: 640px; grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) { .mega-menu { display: none !important; } }

/* ================================================================
   Site search (phase 2c)
   ================================================================ */
.site-search { position: relative; }
.site-search input {
  width: 180px; padding: 8px 12px 8px 34px;
  border: 1px solid var(--line); border-radius: 999px;
  font-family: var(--sans); font-size: 14px;
  background: var(--paper); color: var(--ink);
  transition: width 0.2s, border-color 0.15s;
}
.site-search input:focus {
  outline: none; width: 260px;
  border-color: var(--shield-2);
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--shield-2) 18%, transparent);
}
.site-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--ink-3); pointer-events: none; }
.site-search-results {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 360px; max-height: 420px; overflow-y: auto;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 18px 48px -12px color-mix(in oklch, var(--ink) 25%, transparent);
  padding: 6px; z-index: 60; display: none;
}
.site-search-results.open { display: block; }
.site-search-results a {
  display: block; padding: 10px 12px; border-radius: 6px;
  text-decoration: none; color: var(--ink); font-size: 14px;
}
.site-search-results a:hover, .site-search-results a.active { background: var(--paper-2); }
.site-search-results .cat { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 2px; }
.site-search-results .empty { padding: 18px 12px; color: var(--ink-3); font-size: 14px; }
@media (max-width: 900px) { .site-search { display: none; } .site-search-mobile { display: block !important; } }

/* ================================================================
   Guide hero illustration (accent after page-header, not above it)
   ================================================================ */
.guide-hero {
  padding: clamp(12px, 2vw, 28px) 0 clamp(20px, 3vw, 40px);
  background: transparent;
  border: 0;
}
.guide-hero img {
  display: block;
  width: 100%;
  max-width: 640px;         /* smaller so it doesn't dominate */
  margin: 0 auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
}
/* On mobile, shrink further so body content starts sooner */
@media (max-width: 700px) {
  .guide-hero { padding: 8px 0 16px; }
  .guide-hero img { max-width: 420px; }
}

/* ================================================================
   Vendor "Official resources" block (at end of guide pages)
   ================================================================ */
.vendor-resources {
  margin: 48px auto 0;
  max-width: 72ch;
  padding: 28px 32px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  border-left: 4px solid var(--shield-2);
}
.vendor-resources .vr-eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-3);
  margin: 0 0 8px;
}
.vendor-resources h3 {
  font-family: var(--serif); font-weight: 400; font-size: 22px;
  margin: 0 0 12px; color: var(--ink); line-height: 1.2;
}
.vendor-resources .vr-note {
  font-size: 14px; color: var(--ink-2); line-height: 1.5;
  margin: 0 0 16px;
}
.vendor-resources ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 0;
  border-top: 1px solid var(--line);
}
.vendor-resources li {
  margin: 0; border-bottom: 1px solid var(--line);
}
.vendor-resources li a {
  display: block;
  padding: 12px 2px;
  color: var(--shield);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  transition: color 0.15s, background 0.15s;
}
.vendor-resources li a:hover {
  color: var(--shield-2);
  background: color-mix(in oklch, var(--shield-tint) 60%, transparent);
  padding-left: 10px;
}

/* ================================================================
   Related guides block (phase 2d)
   ================================================================ */
.related-guides { padding: clamp(56px, 7vw, 96px) 0; border-top: 1px solid var(--line); background: var(--paper-2); }
.related-guides h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 3vw, 36px); margin: 0 0 24px; }
.related-guides-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 860px) { .related-guides-grid { grid-template-columns: 1fr; } }
.related-guides a {
  display: flex; flex-direction: column; gap: 6px;
  padding: 20px 22px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 10px;
  text-decoration: none; color: inherit;
  transition: border-color 0.2s;
}
.related-guides a:hover { border-color: var(--shield-2); }
.related-guides .cat { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.related-guides h3 { font-family: var(--serif); font-size: 19px; line-height: 1.2; margin: 0; color: var(--ink); }

/* ================================================================
   Sticky TOC (phase 2d)
   ================================================================ */
.sticky-toc {
  position: sticky; top: 88px;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 18px 20px;
  max-height: calc(100vh - 110px); overflow-y: auto;
  font-size: 14px;
}
.sticky-toc h4 {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-3);
  margin: 0 0 10px; font-weight: 400;
}
.sticky-toc ol, .sticky-toc ul { list-style: none; padding: 0; margin: 0; }
.sticky-toc li { margin-bottom: 6px; }
.sticky-toc a { color: var(--ink-2); text-decoration: none; display: block; padding: 3px 0; border-left: 2px solid transparent; padding-left: 10px; margin-left: -10px; }
.sticky-toc a:hover { color: var(--ink); }
.sticky-toc a.active { color: var(--shield); border-left-color: var(--shield-2); font-weight: 500; }
.has-toc { display: grid; grid-template-columns: 240px 1fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
@media (max-width: 980px) {
  .has-toc { grid-template-columns: 1fr; }
  .sticky-toc { position: static; max-height: none; margin-bottom: 16px; }
}

