/* SuperintelligenceLicensing.com stylesheet. Light-first "product site" look:
   white canvas, quiet grid in the hero, glass header, lifted cards. Dark mode is
   opt-in only (the header toggle sets html[data-theme="dark"]); the OS setting
   no longer switches it, so every visitor gets the light page by default.
   NOTE: this file now differs from the two sister sites' shared stylesheet. */
:root {
  /* SITE ACCENT */
  --accent: #9b1c3f;          /* 7.4:1 on white */
  --accent-dark: #7a1531;
  --accent-light: #fdf3f6;
  --accent-mid: #f1c9d4;
  --accent-2: #5b3fd6;        /* violet, gradients and glow only */
  --accent-glow: rgba(155, 28, 63, 0.10);
  --accent-2-glow: rgba(91, 63, 214, 0.09);
  /* END SITE ACCENT */

  --ink: #0f141a;
  --ink-soft: #3d4651;
  --body-ink: #2e353e;
  --ink-faint: #5b6470;       /* 5.9:1 on white */
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --bg-elev: #ffffff;
  --border: #e6e8ec;
  --border-strong: #d5d9e0;
  --grid-line: rgba(15, 20, 26, 0.045);
  --header-bg: rgba(255, 255, 255, 0.78);
  --shadow-sm: 0 1px 2px rgba(15, 20, 26, 0.05);
  --shadow-md: 0 1px 2px rgba(15, 20, 26, 0.04), 0 8px 24px -8px rgba(15, 20, 26, 0.12);
  --shadow-lg: 0 2px 4px rgba(15, 20, 26, 0.04), 0 18px 48px -16px rgba(15, 20, 26, 0.18);
  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 1120px;
  --maxw-text: 660px;         /* 612px text column = ~75 characters at 17px sans */
  /* Type scale (body 17px desktop / 16.5px mobile) */
  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-ui: 1rem;
  --fs-base: 1.0625rem;
  --fs-lg: 1.1875rem;
  --fs-h3: 1.25rem;
  --fs-h2: 1.75rem;
  --fs-h1: 2.5rem;
  --fs-display: 3rem;
  --sans: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --accent: #f29bb2;
  --accent-dark: #f8c3d1;
  --accent-light: #2a161d;
  --accent-mid: #5e3341;
  --accent-2: #a796ff;
  --accent-glow: rgba(242, 155, 178, 0.10);
  --accent-2-glow: rgba(167, 150, 255, 0.10);
  --ink: #eceef1;
  --ink-soft: #c3c8cf;
  --body-ink: #d6dade;
  --ink-faint: #9aa2ad;
  --bg: #15181d;
  --bg-soft: #1c2027;
  --bg-elev: #1c2027;
  --border: #2c313a;
  --border-strong: #3a414c;
  --grid-line: rgba(255, 255, 255, 0.04);
  --header-bg: rgba(21, 24, 29, 0.78);
  --shadow-sm: none;
  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 18px 48px -16px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
body {
  overflow-wrap: break-word;
  font-family: var(--sans);
  color: var(--body-ink);
  background: var(--bg);
  line-height: 1.78;
  font-size: var(--fs-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}
h1, h2, h3, h4, .sans { font-family: var(--sans); color: var(--ink); }
h1 { font-size: var(--fs-h1); line-height: 1.12; letter-spacing: -0.03em; font-weight: 600; }
h2 { font-size: var(--fs-h2); line-height: 1.25; letter-spacing: -0.02em; font-weight: 600; }
h3 { font-size: var(--fs-h3); line-height: 1.35; letter-spacing: -0.01em; font-weight: 600; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-dark); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-mid); color: var(--ink); }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--bg); padding: 12px 16px; z-index: 100; font-weight: 650; border: 2px solid var(--accent); border-radius: 6px; }
.skip-link:focus { left: 8px; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.container-text { max-width: var(--maxw-text); margin: 0 auto; padding: 0 24px; }

/* ---------- Reading progress (articles; set by app.js) ---------- */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--accent), var(--accent-2)); z-index: 60; pointer-events: none; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--border); background: var(--header-bg); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px); }
.header-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 10px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 1.02rem; color: var(--ink); text-decoration: none; letter-spacing: -0.015em; line-height: 1.2; }
.logo:hover { color: var(--ink); text-decoration: none; }
.logo-mark { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 0.95rem; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: var(--shadow-sm); }
:root[data-theme="dark"] .logo-mark { color: #15181d; }
.logo-text { display: block; }
.logo-tld { color: var(--accent); }
.logo small { display: block; font-weight: 500; font-size: var(--fs-xs); color: var(--ink-faint); letter-spacing: 0; }
.nav-wrap { display: flex; align-items: center; gap: 6px; }
.main-nav { display: flex; gap: 2px; flex-wrap: wrap; font-size: var(--fs-sm); }
.main-nav a { color: var(--ink-soft); text-decoration: none; padding: 8px 12px; border-radius: 8px; min-height: 44px; display: inline-flex; align-items: center; font-weight: 550; }
.main-nav a:hover { background: var(--bg-soft); color: var(--ink); }
.main-nav a[aria-current="page"] { color: var(--ink); background: var(--bg-soft); }
.main-nav .nav-cta { color: var(--accent); font-weight: 650; }
.theme-toggle { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--ink-soft); display: inline-grid; place-items: center; cursor: pointer; font: inherit; }
.theme-toggle:hover { color: var(--ink); border-color: var(--border-strong); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------- Home hero ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; padding: 88px 0 64px; border-bottom: 1px solid var(--border); }
/* Quiet engineering grid that fades out toward the edges, plus two soft glows */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 20%, #000 35%, transparent 100%);
  mask-image: radial-gradient(ellipse 75% 70% at 50% 20%, #000 35%, transparent 100%);
}
.hero::after {
  content: ""; position: absolute; z-index: -2; inset: -20% -10% auto -10%; height: 120%;
  background:
    radial-gradient(40% 50% at 18% 20%, var(--accent-glow), transparent 70%),
    radial-gradient(38% 45% at 85% 10%, var(--accent-2-glow), transparent 70%);
}
.hero .kicker, .kicker { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.02em; color: var(--accent); margin-bottom: 18px; }
.hero .kicker { padding: 5px 12px 5px 10px; border: 1px solid var(--accent-mid); border-radius: 999px; background: var(--bg-elev); box-shadow: var(--shadow-sm); }
.hero .kicker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.lede { color: var(--ink-soft); }
.hero h1 { font-size: var(--fs-display); max-width: 18ch; letter-spacing: -0.025em; line-height: 1.1; font-weight: 500; }
.hero h1 .grad { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lede { max-width: 62ch; margin-top: 22px; font-size: var(--fs-lg); line-height: 1.65; }
.article-hero .lede { max-width: 64ch; margin-top: 14px; }
.definition-box { margin-top: 30px; max-width: 68ch; border: 1px solid var(--border); background: var(--bg-elev); padding: 20px 24px; border-radius: var(--radius); box-shadow: var(--shadow-md); position: relative; }
.definition-box::before { content: ""; position: absolute; left: -1px; top: 16px; bottom: 16px; width: 3px; border-radius: 3px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.definition-box p { font-size: var(--fs-lg); line-height: 1.6; }
.definition-box .attribution { font-size: var(--fs-sm); line-height: 1.55; color: var(--ink-faint); margin-top: 8px; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.btn { font-weight: 550; font-size: var(--fs-ui); text-decoration: none; padding: 12px 20px; border-radius: 10px; display: inline-flex; align-items: center; gap: 8px; min-height: 46px; transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--ink); color: var(--bg); box-shadow: var(--shadow-md); }
.btn-primary:hover { background: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn-primary:hover { color: #15181d; }
.btn-secondary { border: 1px solid var(--border-strong); color: var(--ink); background: var(--bg-elev); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { border-color: var(--accent-mid); color: var(--accent); }
@media (prefers-reduced-motion: no-preference) { .btn:hover { transform: translateY(-1px); } }
.btn .arrow { transition: transform .15s ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* Stat strip under the hero */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 44px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elev); box-shadow: var(--shadow-sm); overflow: hidden; }
.stat { padding: 18px 20px; border-left: 1px solid var(--border); min-width: 0; }
.stat:first-child { border-left: 0; }
.stat-num { font-size: 1.75rem; font-weight: 750; letter-spacing: -0.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-num sup { font-size: 0.55em; vertical-align: super; line-height: 0; }
.stat-label { font-size: var(--fs-sm); color: var(--ink-faint); line-height: 1.45; margin-top: 4px; }

/* ---------- Sections and cards ---------- */
.section { padding: 80px 0; }
.section-tight-top { padding-top: 8px; }
.section-flush-top { padding-top: 0; }
.section-alt { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 64ch; margin-bottom: 28px; }
.section-head .eyebrow { font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); margin-bottom: 8px; }
.section-head p { color: var(--ink-soft); margin-top: 10px; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card-grid > * { min-width: 0; }
.card { position: relative; border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 28px; background: var(--bg-elev); box-shadow: var(--shadow-sm); transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.card:hover { border-color: var(--accent-mid); box-shadow: var(--shadow-lg); }
@media (prefers-reduced-motion: no-preference) { .card:hover { transform: translateY(-2px); } }
.card h3 { font-size: var(--fs-lg); margin-bottom: 8px; }
.card h3 a { color: var(--ink); text-decoration: none; }
/* The whole card is the link target; the title stays the accessible link text */
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card h3 a:focus-visible { outline: none; }
.card:has(h3 a:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.card:hover h3 a { color: var(--accent); }
.card p { font-size: var(--fs-ui); color: var(--ink-soft); line-height: 1.6; }
.card-tag { display: inline-block; font-size: var(--fs-xs); font-weight: 650; letter-spacing: 0.01em; color: var(--accent); background: var(--accent-light); border-radius: 999px; padding: 2px 10px; margin-bottom: 12px; }
.prose-section { max-width: calc(var(--maxw-text) - 48px); }
.prose-section p { margin-bottom: 22px; }
.prose-section h2 { margin: 40px 0 14px; }
.prose-section h2:first-child { margin-top: 0; }
.card-grid-lead > .card:first-child { grid-column: 1 / -1; }
.card-grid-lead > .card:first-child p { max-width: 64ch; }

/* ---------- Jurisdiction explorer (home) ---------- */
.jx { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elev); box-shadow: var(--shadow-md); overflow: hidden; }
.jx-tabs { display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid var(--border); background: var(--bg-soft); overflow-x: auto; scrollbar-width: thin; }
.jx-tab { flex: none; font: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-soft); background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 8px 14px; min-height: 40px; cursor: pointer; white-space: nowrap; }
.jx-tab:hover { color: var(--ink); background: var(--bg-elev); }
.jx-tab[aria-selected="true"] { color: var(--ink); background: var(--bg-elev); border-color: var(--border); box-shadow: var(--shadow-sm); }
.jx .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; background: var(--ink-faint); }
.jx .dot-on { background: #16a34a; }
.jx .dot-soon { background: #d97706; }
.jx-panels { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; }
.jx-panel { padding: 24px 26px; border-top: 1px solid var(--border); border-left: 1px solid var(--border); min-width: 0; }
/* With JS, one panel shows at a time; without it, all panels stay visible as a grid */
.jx.is-tabs .jx-panels { display: block; }
.jx.is-tabs .jx-panel { border: 0; }
.jx-panel h3 { font-size: var(--fs-lg); margin-bottom: 4px; }
.jx-status { font-size: var(--fs-sm); color: var(--ink-faint); margin-bottom: 14px; }
.jx-panel dl { display: grid; grid-template-columns: 9.5em 1fr; gap: 10px 18px; font-size: var(--fs-ui); line-height: 1.55; }
.jx-panel dt { color: var(--ink-faint); font-size: var(--fs-sm); font-weight: 600; padding-top: 1px; }
.jx-panel dd { color: var(--ink); }
.jx-panel .pill { display: inline-block; font-size: var(--fs-xs); font-weight: 650; border-radius: 999px; padding: 1px 9px; background: var(--bg-soft); border: 1px solid var(--border); }
.jx-panel .pill-yes { color: var(--accent); background: var(--accent-light); border-color: var(--accent-mid); }
.jx-more { margin-top: 18px; font-size: var(--fs-sm); font-weight: 600; }
.jx-legend { display: block; margin-bottom: 4px; color: var(--ink-soft); }
.jx-legend .dot { margin: 0 6px 0 0; }
.jx-legend .dot:not(:first-child) { margin-left: 14px; }
.jx-foot { padding: 14px 26px; border-top: 1px solid var(--border); font-size: var(--fs-sm); color: var(--ink-faint); background: var(--bg-soft); }

/* ---------- Compute calculator ---------- */
.calc { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elev); box-shadow: var(--shadow-lg); overflow: hidden; }
.calc-grid { display: grid; grid-template-columns: 1fr 1.15fr; }
.calc-inputs { padding: 24px 26px; border-right: 1px solid var(--border); }
.calc-out { padding: 24px 26px; background: var(--bg-soft); min-width: 0; }
.seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 10px; background: var(--bg-soft); border: 1px solid var(--border); margin-bottom: 20px; flex-wrap: wrap; }
.seg button { font: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-soft); background: transparent; border: 0; border-radius: 8px; padding: 7px 12px; min-height: 36px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--bg-elev); color: var(--ink); box-shadow: var(--shadow-sm); }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.field .hint { display: block; font-size: var(--fs-xs); color: var(--ink-faint); font-weight: 500; margin-top: 4px; line-height: 1.45; }
.input-wrap { display: flex; align-items: stretch; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--bg); overflow: hidden; transition: border-color .15s ease, box-shadow .15s ease; }
.input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.input-wrap input { flex: 1; min-width: 0; font: inherit; font-family: var(--mono); font-size: var(--fs-ui); color: var(--ink); background: transparent; border: 0; padding: 10px 12px; outline: none; }
.input-wrap .unit { display: grid; place-items: center; padding: 0 12px; font-size: var(--fs-sm); color: var(--ink-faint); background: var(--bg-soft); border-left: 1px solid var(--border); white-space: nowrap; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.presets-label { font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); margin: 18px 0 8px; }
.chip { font: inherit; font-size: var(--fs-sm); color: var(--ink-soft); background: var(--bg-elev); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; min-height: 36px; cursor: pointer; text-align: left; }
.chip:hover { border-color: var(--accent-mid); color: var(--accent); }
.calc-result-label { font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); }
.calc-result { font-size: 2.4rem; font-weight: 750; letter-spacing: -0.035em; line-height: 1.15; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.calc-result sup { font-size: 0.5em; line-height: 0; vertical-align: super; }
.calc-sub { font-size: var(--fs-sm); color: var(--ink-faint); }
/* Log-scale meter, 10^21 to 10^28 */
.meter { position: relative; margin: 26px 0 34px; height: 10px; border-radius: 999px; background: var(--border); }
.meter-fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .35s cubic-bezier(.2,.7,.2,1); }
.meter-mark { position: absolute; top: -6px; width: 2px; height: 22px; background: var(--ink); opacity: .55; border-radius: 1px; }
.meter-mark span { position: absolute; top: 25px; left: 50%; transform: translateX(-50%); font-size: 0.72rem; font-weight: 650; color: var(--ink-faint); white-space: nowrap; }
.meter-mark span sup { line-height: 0; }
.rules { list-style: none; display: grid; gap: 8px; }
.rule { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elev); }
.rule-badge { grid-row: span 2; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; border-radius: 6px; padding: 3px 8px; margin-top: 2px; min-width: 6.4em; text-align: center; color: var(--ink-faint); background: var(--bg-soft); border: 1px solid var(--border); }
.rule.is-hit { border-color: var(--accent-mid); background: var(--accent-light); }
.rule.is-hit .rule-badge { color: #fff; background: var(--accent); border-color: var(--accent); }
:root[data-theme="dark"] .rule.is-hit .rule-badge { color: #15181d; }
.rule-name { font-size: var(--fs-ui); font-weight: 650; line-height: 1.4; }
.rule-name a { color: inherit; }
.rule-meta { font-size: var(--fs-sm); color: var(--ink-soft); line-height: 1.5; }
.calc-notes { padding: 16px 26px 18px; border-top: 1px solid var(--border); font-size: var(--fs-sm); color: var(--ink-faint); line-height: 1.6; }
.calc-notes p + p { margin-top: 6px; }
.noscript-note { padding: 14px 18px; border: 1px dashed var(--border-strong); border-radius: 10px; color: var(--ink-soft); font-size: var(--fs-sm); margin-top: 12px; }

/* Calculator teaser band (home) */
.calc-band { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }

/* ---------- Article ---------- */
.article-hero { position: relative; padding: 64px 0 32px; }
.crumb { font-size: var(--fs-sm); color: var(--ink-faint); margin-bottom: 14px; }
.crumb a { color: var(--ink-faint); }
.meta-line { font-size: var(--fs-sm); color: var(--ink-faint); margin-top: 14px; line-height: 1.55; }
.meta-line a { color: var(--ink-faint); }
.article-body { padding-bottom: 32px; }
.article-body p { margin-bottom: 22px; }
.article-body .answer-first { font-size: var(--fs-lg); color: var(--ink); margin-bottom: 18px; }
.article-body h2 { margin: 60px 0 18px; scroll-margin-top: 84px; }
.article-body > .container-text > h2:first-child { margin-top: 12px; }
.article-body h3 { margin: 30px 0 10px; scroll-margin-top: 84px; }
.article-body ul, .article-body ol { margin: 0 0 18px 1.3em; }
.article-body li { margin-bottom: 8px; }
.article-body li::marker { color: var(--ink-faint); }
.article-body blockquote { border-left: 3px solid var(--accent-mid); padding: 4px 0 4px 18px; margin: 18px 0; color: var(--ink-soft); font-style: italic; }
.article-body blockquote cite, .article-body blockquote footer { display: block; font-style: normal; font-size: var(--fs-sm); color: var(--ink-faint); margin-top: 6px; }
.article-body blockquote p { margin-bottom: 8px; }
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body blockquote p + p:last-child { font-style: normal; font-size: var(--fs-sm); color: var(--ink-faint); margin-top: 6px; }
.at-a-glance { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px 8px; margin: 8px 0 28px; }
.article-body .at-a-glance h2 { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); margin: 0 0 10px; }
.callout { border: 1px solid var(--accent-mid); background: var(--accent-light); padding: 16px 20px; border-radius: var(--radius); margin: 22px 0; }
.article-body .callout p:last-child { margin-bottom: 0; }
.checklist { list-style: none; }
.article-body .checklist { margin-left: 0; }
.checklist li { padding-left: 28px; position: relative; }
.checklist li::before { content: "☐"; content: "☐" / ""; position: absolute; left: 0; color: var(--accent); }

/* "On this page" (built by app.js from the guide's h2s) */
.toc { border: 1px solid var(--border); border-radius: var(--radius); margin: 0 0 28px; background: var(--bg-elev); }
.toc summary { cursor: pointer; list-style: none; padding: 12px 18px; font-size: var(--fs-sm); font-weight: 650; display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: "+"; font-size: 1.2rem; color: var(--ink-faint); font-weight: 500; }
.toc[open] summary::after { content: "–"; }
.article-body .toc ol { margin: 0; padding: 0 18px 14px 2.3em; font-size: var(--fs-sm); }
.article-body .toc li { margin-bottom: 4px; }
.toc a { color: var(--ink-soft); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }
.toc a.is-active { color: var(--accent); font-weight: 650; }
.heading-link { margin-left: 8px; font-weight: 500; color: var(--ink-faint); text-decoration: none; opacity: 0; transition: opacity .15s ease; font-size: 0.8em; }
h2:hover .heading-link, h3:hover .heading-link, .heading-link:focus-visible { opacity: 1; }

.table-wrap { overflow-x: auto; margin: 20px 0 24px; border: 1px solid var(--border); border-radius: var(--radius); }
.table-wrap {
  background:
    linear-gradient(90deg, var(--bg) 30%, transparent) left / 40px 100% no-repeat local,
    linear-gradient(270deg, var(--bg) 30%, transparent) right / 40px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, color-mix(in srgb, var(--ink) 22%, transparent), transparent) left / 14px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, color-mix(in srgb, var(--ink) 22%, transparent), transparent) right / 14px 100% no-repeat scroll;
}
.article-body table { border-collapse: collapse; width: 100%; font-size: var(--fs-sm); line-height: 1.5; }
.article-body th, .article-body td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.article-body th { background: var(--bg-soft); font-weight: 650; }
.article-body tbody tr:hover td { background: color-mix(in srgb, var(--accent-light) 60%, transparent); }
.article-body tr:last-child td { border-bottom: 0; }
.article-body td { overflow-wrap: break-word; hyphens: auto; }
@media (min-width: 940px) {
  .article-body .table-wrap:has(th:nth-child(4)) { width: 880px; margin-left: calc(50% - 440px); }
}
h1, h2, h3 { overflow-wrap: break-word; }
sup, sub { line-height: 0; }

.faq { border-top: 1px solid var(--border); margin-top: 44px; padding-top: 8px; }
.faq-item h3 { font-size: var(--fs-lg); }
.related { margin-top: 36px; }
.related-list { list-style: none; margin: 0 !important; display: grid; gap: 10px; }
.related-list li { position: relative; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; margin: 0; background: var(--bg-elev); transition: border-color .15s ease, box-shadow .15s ease; }
.related-list li:hover { border-color: var(--accent-mid); box-shadow: var(--shadow-md); }
.related-list a { font-weight: 550; text-decoration: none; }
.related-list a::after { content: ""; position: absolute; inset: 0; }
.related-list p { font-size: var(--fs-ui); color: var(--ink-soft); margin: 4px 0 0; }
.sources { margin-top: 44px; font-size: var(--fs-sm); color: var(--ink-soft); }
.article-body .sources h2 { font-size: var(--fs-lg); }
.sources li { margin-bottom: 6px; overflow-wrap: anywhere; }

/* ---------- Glossary ---------- */
.az { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 24px; }
.az a { display: inline-flex; min-width: 36px; min-height: 36px; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 6px; text-decoration: none; font-weight: 650; }
.glossary dt { font-weight: 700; font-size: var(--fs-lg); line-height: 1.35; margin-top: 28px; scroll-margin-top: 84px; }
.glossary dd { margin: 6px 0 0; color: var(--ink); }
.term-source { font-size: var(--fs-xs); margin-left: 6px; }
.glossary dt:target { color: var(--accent); }

/* ---------- Footer (light) ---------- */
.site-footer { background: var(--bg-soft); color: var(--ink-soft); border-top: 1px solid var(--border); margin-top: 80px; padding: 64px 0 40px; font-size: var(--fs-sm); line-height: 1.6; }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.site-footer p a { text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.15fr; gap: 28px; }
.footer-grid > * { min-width: 0; }
.site-footer a { overflow-wrap: anywhere; }
.footer-brand { font-weight: 650; color: var(--ink); font-size: 1.02rem; margin-bottom: 8px; letter-spacing: -0.015em; }
.footer-brand .logo-tld { color: var(--accent); }
.footer-heading { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink); margin-bottom: 10px; font-weight: 600; }
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 6px; }
.site-footer ul a { display: inline-block; padding: 2px 0; }
.related-note { color: var(--ink-faint); font-size: var(--fs-xs); }
.footer-note { border-top: 1px solid var(--border); margin-top: 32px; padding-top: 20px; font-size: var(--fs-sm); color: var(--ink-faint); }

/* ---------- Scroll reveal (app.js adds .reveal; reduced motion skips it) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
  .reveal.is-in { opacity: 1; transform: none; }
}

@media (max-width: 920px) {
  .card-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--border); }
  .calc-grid { grid-template-columns: 1fr; }
  .calc-inputs { border-right: 0; border-bottom: 1px solid var(--border); }
}
@media (max-width: 620px) {
  :root { --fs-base: 1.03rem; --fs-lg: 1.125rem; --fs-h3: 1.15rem; --fs-h2: 1.45rem; --fs-h1: 1.95rem; --fs-display: 2.15rem; }
  .hero { padding: 48px 0 40px; }
  .section { padding: 56px 0; }
  .section-tight-top { padding-top: 4px; }
  .section-flush-top { padding-top: 0; }
  .container, .container-text, .header-inner { padding-left: 16px; padding-right: 16px; }
  .card-grid { grid-template-columns: 1fr; }
  .header-inner { row-gap: 2px; padding-top: 8px; padding-bottom: 4px; }
  .nav-wrap { width: 100%; justify-content: space-between; }
  .main-nav { gap: 0; margin-left: -8px; }
  .main-nav a { padding: 8px 8px; }
  .logo small { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .stat { padding: 14px 16px; }
  .stat-num { font-size: 1.4rem; }
  .jx-panels { grid-template-columns: 1fr; }
  .jx-panel { border-left: 0; padding: 20px 18px; }
  .jx-panel dl { grid-template-columns: 1fr; gap: 2px; }
  .jx-panel dd { margin-bottom: 10px; }
  .calc-inputs, .calc-out { padding: 20px 18px; }
  .calc-notes { padding: 14px 18px 16px; }
  .calc-result { font-size: 2rem; }
  .calc-band { grid-template-columns: 1fr; }
  .article-body table:has(th:nth-child(4)) { min-width: 36em; }
  .article-body table:has(th:nth-child(4)) :is(th, td) { min-width: 8em; }
  .article-body table:has(th:nth-child(4)) :is(th, td):first-child { position: sticky; left: 0; z-index: 1; background: var(--bg); box-shadow: inset -1px 0 var(--border); }
  .article-body table:has(th:nth-child(4)) th:first-child { background: var(--bg-soft); }
}

@media print {
  .site-header, .site-footer, .skip-link, .related, .progress, .toc, .theme-toggle, .calc, .heading-link { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
.mt { margin-top: 18px; }
.article-body caption { caption-side: top; text-align: left; font-weight: 650; font-size: var(--fs-sm, 15px); color: var(--ink-soft); padding: 10px 12px 6px; }
