/* ============================================================
   Insight Stream — site stylesheet
   Built on Humbug Digital tokens (static/brand/tokens.css).
   Web grammar: square corners, hairline borders, one solid
   accent object per view, Paper ground, Abyss ink.
   ============================================================ */

/* ---- 1. Force the light scheme --------------------------------
   tokens.css ships an unaudited dark scheme. Chart PNGs are white,
   so the site stays light until that scheme is audited. */
html { color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root {
    --hb-bg:            var(--hb-paper);
    --hb-surface:       var(--hb-paper-warm);
    --hb-text:          var(--hb-abyss);
    --hb-text-muted:    var(--hb-neutral-700);
    --hb-border:        var(--hb-neutral-300);
    --hb-action:        var(--hb-signal-600);
    --hb-action-hover:  var(--hb-signal-700);
    --hb-action-active: var(--hb-signal-800);
    --hb-link:          var(--hb-signal-700);
    --hb-link-hover:    var(--hb-signal-900);
    --hb-focus:         var(--hb-signal);
  }
}

/* ---- 2. Legacy aliases ---------------------------------------
   The chart selector, quiz and palette pages carry large inline
   stylesheets written against these names. Mapping them here
   re-skins those pages without a rewrite. */
:root {
  --brand-purple:      var(--hb-indigo);
  --brand-blue:        var(--hb-abyss);
  --brand-light-blue:  var(--hb-signal-200);
  --brand-lavender:    var(--hb-paper-warm);
  --bg-light:          var(--hb-paper-warm);
  --bg-white:          #ffffff;
  --text-primary:      var(--hb-text);
  --text-secondary:    var(--hb-text-muted);
  --accent:            var(--hb-signal-600);
  --good:              var(--hb-success);
  --bad:               var(--hb-danger);
  --ink:               var(--hb-text);
  --muted:             var(--hb-text-muted);
  --card:              #ffffff;
  --white:             #ffffff;
  --pbi-page:          #F3F2F1;   /* Power BI report canvas */
  --pbi-border:        #E6E6E6;
}

/* ---- 3. Base ---------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

h1 { font-size: var(--hb-text-h1); line-height: var(--hb-lh-h1); font-weight: 700; }
h2 { font-size: var(--hb-text-h2); line-height: var(--hb-lh-h2); font-weight: 600; }
h3 { font-size: var(--hb-text-h3); line-height: var(--hb-lh-h3); font-weight: 600; }
h4 { font-size: 18px; line-height: 1.3; font-weight: 600; }
h1, h2, h3, h4 { margin: 0 0 var(--hb-space-3); color: var(--hb-text); text-wrap: balance; }
h2 { margin-top: var(--hb-space-6); }
h3 { margin-top: var(--hb-space-5); }
p  { margin: 0 0 var(--hb-space-4); }
ul, ol { margin: 0 0 var(--hb-space-4); padding-left: 1.25em; }
li { margin: var(--hb-space-1) 0; }
img { max-width: 100%; height: auto; }
button { font: inherit; }
code, pre, kbd { font-family: var(--hb-font-mono); font-size: 0.92em; }
hr { border: 0; border-top: 1px solid var(--hb-border); margin: var(--hb-space-6) 0; }
strong { font-weight: 600; }
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--hb-abyss); color: #fff; padding: 8px 12px; z-index: 100; border: 0; }
.skip-link:focus { left: 8px; }

/* ---- 4. Type helpers ------------------------------------------- */
.lead     { font-size: var(--hb-text-lead); line-height: var(--hb-lh-lead); color: var(--hb-text-muted); max-width: var(--hb-measure); }
.overline { font-family: var(--hb-font-body); font-size: var(--hb-text-overline); line-height: var(--hb-lh-overline); letter-spacing: var(--hb-tracking-overline); text-transform: uppercase; color: var(--hb-signal-700); font-weight: 600; margin: 0 0 var(--hb-space-2); display: block; }
.muted    { color: var(--hb-text-muted); }
.ui       { font-size: var(--hb-text-ui); line-height: var(--hb-lh-ui); }
.prose    { max-width: var(--hb-measure); }
.prose h2 { margin-top: var(--hb-space-6); }
.numeric, table { font-variant-numeric: tabular-nums; }

/* ---- 5. Layout ------------------------------------------------- */
.container { max-width: var(--hb-max-width); margin: 0 auto; padding: 0 var(--hb-gutter); }
main.container { padding-top: var(--hb-space-6); padding-bottom: var(--hb-space-6); }
.section { margin: 0 0 var(--hb-space-7); }
.section-header { margin-bottom: var(--hb-space-5); max-width: var(--hb-measure); }
.section-header h2 { margin-top: 0; }
.section-header p { color: var(--hb-text-muted); margin: 0; }
.grid-2, .grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--hb-space-5); }
.grid-3, .grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--hb-space-5); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--hb-space-5); }
@media (max-width: 1024px) { .grid-3, .grid3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px)  { .grid-2, .grid2, .grid-3, .grid3, .grid-4 { grid-template-columns: 1fr; } }

/* ---- 6. Components --------------------------------------------- */
.card { border: 1px solid var(--hb-border); padding: var(--hb-space-5); background: transparent; display: flex; flex-direction: column; gap: var(--hb-space-2); }
.card--inset { background: var(--hb-surface); }
.card--white { background: #fff; }
.card h3, .card h4 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
a.card { color: inherit; border-bottom-width: 1px; }
a.card:hover { border-color: var(--hb-abyss); color: inherit; }
.card .cta { margin-top: auto; padding-top: var(--hb-space-3); color: var(--hb-link); font-weight: 600; font-size: var(--hb-text-ui); text-transform: uppercase; letter-spacing: .06em; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--hb-space-2); min-height: var(--hb-touch); padding: 0 var(--hb-space-5); background: var(--hb-action); color: #fff; border: 1px solid var(--hb-action); border-radius: var(--hb-radius-sm); font-weight: 600; font-size: var(--hb-text-body); line-height: 1; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--hb-action-hover); border-color: var(--hb-action-hover); color: #fff; }
.btn:active { background: var(--hb-action-active); }
.btn--secondary { background: transparent; color: var(--hb-link); border-color: var(--hb-border); }
.btn--secondary:hover { background: var(--hb-surface); color: var(--hb-link-hover); border-color: var(--hb-abyss); }
.btn--ghost { background: transparent; color: var(--hb-text); border-color: transparent; }
.btn--ghost:hover { background: var(--hb-surface); color: var(--hb-text); border-color: transparent; }
.btn--sm { min-height: 30px; padding: 0 var(--hb-space-3); font-size: var(--hb-text-ui); }
.btn--abyss { background: var(--hb-abyss); border-color: var(--hb-abyss); }
.btn--abyss:hover { background: var(--hb-abyss-800); border-color: var(--hb-abyss-800); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--hb-space-3); }

.chip { display: inline-block; padding: 2px var(--hb-space-3); border: 1px solid var(--hb-border); border-radius: var(--hb-radius-pill); font-size: var(--hb-text-ui); line-height: 1.5; color: var(--hb-text-muted); background: transparent; }
.chip--signal { border-color: var(--hb-signal-300); color: var(--hb-signal-700); background: var(--hb-signal-50); }
.chip--mint { border-color: var(--hb-mint-300); color: var(--hb-mint-700); background: var(--hb-mint-50); }
.chip--warn { border-color: #EBD3A9; color: var(--hb-warning); background: var(--hb-warning-fill); }
.chip--danger { border-color: #E9BDBD; color: var(--hb-danger); background: var(--hb-danger-fill); }

.note, .callout { margin: var(--hb-space-5) 0; padding: var(--hb-space-4) var(--hb-space-5); border-left: 3px solid var(--hb-signal); background: var(--hb-surface); }
.note p:last-child, .callout p:last-child { margin-bottom: 0; }
.note--danger { border-left-color: var(--hb-danger); background: var(--hb-danger-fill); }
.note--success { border-left-color: var(--hb-success); background: var(--hb-success-fill); }

.fig { margin: 0; background: #fff; border: 1px solid var(--hb-border); padding: var(--hb-space-3); box-shadow: var(--hb-shadow-sm); }
.fig img { display: block; width: 100%; height: auto; }
.fig figcaption { margin-top: var(--hb-space-3); font-size: var(--hb-text-ui); line-height: var(--hb-lh-ui); color: var(--hb-text-muted); }
.cap-good { color: var(--hb-success) !important; font-weight: 600; }
.cap-bad  { color: var(--hb-danger) !important; font-weight: 600; }

table.data { width: 100%; border-collapse: collapse; font-size: 15px; }
table.data th, table.data td { padding: var(--hb-space-3) var(--hb-space-4); border-bottom: 1px solid var(--hb-border); text-align: left; vertical-align: top; }
table.data th { font-size: var(--hb-text-ui); text-transform: uppercase; letter-spacing: .06em; color: var(--hb-text-muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }

.breadcrumb { margin: 0 0 var(--hb-space-5); }
.breadcrumb-list { display: flex; flex-wrap: wrap; align-items: center; list-style: none; margin: 0; padding: 0; font-size: var(--hb-text-ui); }
.breadcrumb-separator { margin: 0 var(--hb-space-2); color: var(--hb-neutral-500); }
.breadcrumb-link { border-bottom: 0; }
.breadcrumb-current { color: var(--hb-text-muted); }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--hb-space-5); }
.steps li { counter-increment: step; }
.steps .card { height: 100%; }
.step-num { font-family: var(--hb-font-heading); font-size: 44px; line-height: 1; font-weight: 700; color: var(--hb-signal); }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; } }

/* ---- 7. Header + drawer ---------------------------------------- */
.site-header { background: var(--hb-bg); border-bottom: 1px solid var(--hb-border); position: sticky; top: 0; z-index: 50; }
.site-header__inner { max-width: var(--hb-max-width); margin: 0 auto; padding: 0 var(--hb-gutter); display: flex; align-items: center; gap: var(--hb-space-4); min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: var(--hb-space-3); border: 0; color: var(--hb-text); font-family: var(--hb-font-heading); font-weight: 600; font-size: 22px; letter-spacing: .01em; white-space: nowrap; }
.brand:hover { color: var(--hb-text); border: 0; }
.brand img { width: 36px; height: 36px; display: block; }
.primary-nav { display: flex; gap: var(--hb-space-5); margin-left: var(--hb-space-4); }
.primary-nav a { border: 0; border-bottom: 2px solid transparent; color: var(--hb-text); font-size: var(--hb-text-ui); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 22px 0 20px; }
.primary-nav a:hover, .primary-nav a[aria-current="page"] { border-bottom-color: var(--hb-signal); color: var(--hb-text); }
.search { margin-left: auto; display: flex; }
.search input { min-width: 220px; padding: 0 var(--hb-space-3); height: var(--hb-touch); border: 1px solid var(--hb-border); border-right: 0; background: #fff; color: var(--hb-text); font: inherit; font-size: 16px; }
.search input:focus { outline: 2px solid var(--hb-focus); outline-offset: -1px; }
.search button { height: var(--hb-touch); padding: 0 var(--hb-space-4); background: var(--hb-abyss); color: #fff; border: 1px solid var(--hb-abyss); cursor: pointer; font-weight: 600; }
.search button:hover { background: var(--hb-abyss-800); }
.nav-toggle, .nav-close { width: var(--hb-touch); height: var(--hb-touch); background: transparent; border: 1px solid var(--hb-border); color: var(--hb-text); cursor: pointer; font-size: 18px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.nav-toggle:hover, .nav-close:hover { background: var(--hb-surface); }
@media (max-width: 1100px) { .primary-nav { display: none; } }
@media (max-width: 700px)  { .search { display: none; } .brand span { font-size: 19px; } }

.nav { position: fixed; top: 0; bottom: 0; left: 0; width: min(320px, 90vw); background: var(--hb-surface); border-right: 1px solid var(--hb-border); padding: var(--hb-space-4) var(--hb-space-5) var(--hb-space-6); transform: translateX(-100%); transition: transform .2s ease; z-index: 60; overflow-y: auto; }
.nav.open { transform: none; box-shadow: var(--hb-shadow-lg); }
.nav .nav-close { margin-left: auto; display: flex; }
.nav h3 { font-family: var(--hb-font-body); font-size: var(--hb-text-overline); letter-spacing: var(--hb-tracking-overline); text-transform: uppercase; color: var(--hb-text-muted); margin: var(--hb-space-5) 0 var(--hb-space-2); }
.nav ul { list-style: none; padding: 0; margin: 0; }
.nav li { margin: 0; }
.nav a { display: block; padding: 6px 0; border: 0; color: var(--hb-text); }
.nav a:hover { color: var(--hb-link); }
.nav .search { display: flex; margin: var(--hb-space-4) 0 0; }
.nav .search input { min-width: 0; flex: 1; }

/* ---- 8. Footer -------------------------------------------------- */
.site-footer { background: var(--hb-abyss); color: var(--hb-abyss-200); margin-top: var(--hb-space-8); padding: var(--hb-space-7) 0 var(--hb-space-5); }
.site-footer a { color: var(--hb-abyss-100); border-bottom-color: var(--hb-abyss-700); }
.site-footer a:hover { color: #fff; border-bottom-color: var(--hb-signal-300); }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr 1.6fr; gap: var(--hb-space-6); margin-bottom: var(--hb-space-6); }
.footer-section h4 { font-family: var(--hb-font-body); font-size: var(--hb-text-overline); letter-spacing: var(--hb-tracking-overline); text-transform: uppercase; color: var(--hb-abyss-400); margin: 0 0 var(--hb-space-3); }
.footer-section ul { list-style: none; margin: 0; padding: 0; }
.footer-section li { margin: var(--hb-space-2) 0; }
.footer-section p { margin: 0 0 var(--hb-space-3); color: var(--hb-abyss-200); }
.footer-newsletter-form { display: flex; }
.footer-newsletter-form input { flex: 1; min-width: 0; height: var(--hb-touch); padding: 0 var(--hb-space-3); border: 1px solid var(--hb-abyss-600); border-right: 0; background: var(--hb-abyss-900); color: #fff; font: inherit; font-size: 16px; }
.footer-newsletter-form input::placeholder { color: var(--hb-abyss-500); }
.footer-newsletter-form button { height: var(--hb-touch); padding: 0 var(--hb-space-4); background: var(--hb-signal-300); color: var(--hb-abyss); border: 1px solid var(--hb-signal-300); font-weight: 600; cursor: pointer; }
.footer-newsletter-form button:hover { background: var(--hb-signal-200); }
.footer-note { font-size: var(--hb-text-ui); color: var(--hb-abyss-400); margin: var(--hb-space-2) 0 0; }
.footer-bottom { border-top: 1px solid var(--hb-abyss-700); padding-top: var(--hb-space-5); display: flex; flex-wrap: wrap; align-items: center; gap: var(--hb-space-4) var(--hb-space-6); font-size: var(--hb-text-ui); color: var(--hb-abyss-300); }
.footer-humbug { display: inline-flex; align-items: center; gap: var(--hb-space-3); border: 0; }
.footer-humbug img { height: 40px; width: auto; display: block; }
.footer-legal { margin-left: auto; display: flex; flex-wrap: wrap; gap: var(--hb-space-4); }
.footer-legal a { border: 0; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr; gap: var(--hb-space-5); } .footer-legal { margin-left: 0; } }

/* ---- 9. Cookie banner, back to top ----------------------------- */
.cookie { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; background: var(--hb-surface); border-top: 1px solid var(--hb-border); padding: var(--hb-space-3) var(--hb-gutter); display: flex; flex-wrap: wrap; align-items: center; gap: var(--hb-space-3) var(--hb-space-5); box-shadow: var(--hb-shadow-md); }
.cookie p { margin: 0; flex: 1 1 320px; }
.cookie-actions { display: flex; gap: var(--hb-space-2); }
.cookie-actions button { min-height: 32px; padding: 0 var(--hb-space-4); border: 1px solid var(--hb-border); background: transparent; color: var(--hb-text); cursor: pointer; border-radius: var(--hb-radius-sm); font-weight: 600; font-size: var(--hb-text-ui); }
.cookie-actions button:last-child { background: var(--hb-action); border-color: var(--hb-action); color: #fff; }
.cookie-link { font-size: var(--hb-text-ui); }

.back-to-top { position: fixed; right: var(--hb-space-5); bottom: var(--hb-space-5); width: 40px; height: 40px; background: var(--hb-abyss); color: #fff; border: 0; cursor: pointer; font-size: 18px; opacity: 0; visibility: hidden; transition: opacity .2s; z-index: 40; }
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--hb-abyss-800); }

/* ---- 10. Homepage ---------------------------------------------- */
.hero { padding: var(--hb-space-7) 0 var(--hb-space-6); border-bottom: 1px solid var(--hb-border); margin-bottom: var(--hb-space-7); }
.hero h1 { font-size: clamp(38px, 5vw, var(--hb-text-display)); line-height: .95; max-width: 14ch; margin-bottom: var(--hb-space-4); }
.hero .lead { margin-bottom: var(--hb-space-5); }
.hero-rule { display: flex; gap: var(--hb-space-3); align-items: baseline; margin-top: var(--hb-space-5); padding-top: var(--hb-space-4); border-top: 1px solid var(--hb-border); max-width: var(--hb-measure); }
.hero-rule strong { font-family: var(--hb-font-heading); font-size: 22px; color: var(--hb-signal-700); white-space: nowrap; }

.insight-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--hb-space-5); }
@media (max-width: 900px) { .insight-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .insight-grid { grid-template-columns: 1fr; } }
.insight-card .question { font-family: var(--hb-font-heading); font-size: 22px; font-weight: 600; color: var(--hb-signal-700); margin: 0; }
.insight-card .detail { font-size: 15px; color: var(--hb-text-muted); margin: 0; }
.insight-card .charts { font-size: 15px; margin: 0; }

.quick-search { background: var(--hb-surface); border: 1px solid var(--hb-border); padding: var(--hb-space-5); }
.search-form { position: relative; }
.search-input-wrapper { display: flex; }
.search-input { flex: 1; min-width: 0; height: 44px; padding: 0 var(--hb-space-4); border: 1px solid var(--hb-border); border-right: 0; background: #fff; font: inherit; font-size: 16px; }
.search-button { height: 44px; padding: 0 var(--hb-space-5); background: var(--hb-abyss); color: #fff; border: 1px solid var(--hb-abyss); font-weight: 600; cursor: pointer; }
.search-suggestions { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--hb-border); border-top: 0; z-index: 10; box-shadow: var(--hb-shadow-md); }
.suggestion-item { padding: var(--hb-space-3) var(--hb-space-4); cursor: pointer; border-bottom: 1px solid var(--hb-neutral-100); }
.suggestion-item:hover { background: var(--hb-surface); }
.suggestion-title { font-weight: 600; }
.suggestion-type { font-size: var(--hb-text-ui); color: var(--hb-text-muted); }
.popular-searches, .recent-searches { display: flex; flex-wrap: wrap; align-items: center; gap: var(--hb-space-2); margin-top: var(--hb-space-3); font-size: var(--hb-text-ui); }
.popular-label, .recent-label { color: var(--hb-text-muted); text-transform: uppercase; letter-spacing: .06em; font-size: var(--hb-text-overline); font-weight: 600; margin-right: var(--hb-space-1); }
.popular-tag, .recent-tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px var(--hb-space-3); border: 1px solid var(--hb-border); border-radius: var(--hb-radius-pill); color: var(--hb-text); background: #fff; border-bottom-width: 1px; }
.popular-tag:hover, .recent-tag:hover { border-color: var(--hb-abyss); color: var(--hb-text); }
.recent-tag-remove { border: 0; background: transparent; color: var(--hb-text-muted); cursor: pointer; padding: 0; line-height: 1; }
#recent-searches-list { display: contents; }

.example-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--hb-space-5); }
@media (max-width: 800px) { .example-comparison { grid-template-columns: 1fr; } }
.example-comparison .card h3 { margin-top: 0; }
.example-good h3 { color: var(--hb-success); }
.example-bad h3 { color: var(--hb-danger); }
.example-comparison ul { margin: 0; padding-left: 1.2em; font-size: 15px; }

.audience-card .tag { font-size: var(--hb-text-overline); letter-spacing: var(--hb-tracking-overline); text-transform: uppercase; color: var(--hb-signal-700); font-weight: 600; }
.audience-card h4 { font-family: var(--hb-font-body); font-size: var(--hb-text-ui); text-transform: uppercase; letter-spacing: .06em; color: var(--hb-text-muted); margin: var(--hb-space-3) 0 var(--hb-space-1); }
.audience-card p { margin: 0; font-size: 15px; }
.audience-tip { margin-top: var(--hb-space-3); padding-top: var(--hb-space-3); border-top: 1px solid var(--hb-border); font-size: 15px; }

.newsletter-cta { background: var(--hb-abyss); color: var(--hb-abyss-100); padding: var(--hb-space-6); display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--hb-space-6); align-items: center; }
.newsletter-cta h2 { color: #fff; margin-top: 0; }
.newsletter-cta p { color: var(--hb-abyss-200); }
.newsletter-cta ul { list-style: none; padding: 0; margin: 0; }
.newsletter-cta li { padding-left: 1.2em; position: relative; }
.newsletter-cta li::before { content: "—"; position: absolute; left: 0; color: var(--hb-signal-300); }
.newsletter-cta form { display: flex; flex-direction: column; gap: var(--hb-space-3); }
.newsletter-cta input { height: 44px; padding: 0 var(--hb-space-4); border: 1px solid var(--hb-abyss-600); background: #fff; color: var(--hb-text); font: inherit; font-size: 16px; }
.newsletter-cta .btn { background: var(--hb-signal-300); border-color: var(--hb-signal-300); color: var(--hb-abyss); }
.newsletter-cta .btn:hover { background: var(--hb-signal-200); border-color: var(--hb-signal-200); }
.newsletter-cta .privacy { font-size: var(--hb-text-ui); color: var(--hb-abyss-300); margin: 0; }
.newsletter-cta .privacy a { color: #fff; }
@media (max-width: 800px) { .newsletter-cta { grid-template-columns: 1fr; padding: var(--hb-space-5); } }

/* ---- 11. Visual detail page ------------------------------------ */
.visual { max-width: var(--hb-max-width); }
.visual .intro { font-size: var(--hb-text-lead); line-height: var(--hb-lh-lead); color: var(--hb-text-muted); max-width: var(--hb-measure); }
.toc { border: 1px solid var(--hb-border); background: var(--hb-surface); padding: var(--hb-space-4) var(--hb-space-5); margin: var(--hb-space-5) 0; }
.toc h2 { font-family: var(--hb-font-body); font-size: var(--hb-text-overline); letter-spacing: var(--hb-tracking-overline); text-transform: uppercase; color: var(--hb-text-muted); margin: 0 0 var(--hb-space-2); }
.toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--hb-space-2) var(--hb-space-5); }
.toc li { margin: 0; }
.visual h2 { padding-bottom: var(--hb-space-2); border-bottom: 1px solid var(--hb-border); }
.examples { margin: var(--hb-space-5) 0; }
.examples .grid2 + .grid2 { margin-top: var(--hb-space-5); }
.examples--more { background: var(--hb-surface); border: 1px solid var(--hb-border); padding: var(--hb-space-5); }
.examples--more h2 { margin-top: 0; border: 0; padding: 0; }
.examples--more > p { color: var(--hb-text-muted); }
.visual ul.good, .visual ul.bad, .visual ul.cases { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--hb-space-3); }
.visual ul.good li, .visual ul.bad li, .visual ul.cases li { margin: 0; padding: var(--hb-space-4) var(--hb-space-5); border: 1px solid var(--hb-border); border-left-width: 3px; }
.visual ul.good li { border-left-color: var(--hb-success); }
.visual ul.bad li  { border-left-color: var(--hb-danger); }
.visual ul.cases li { border-left-color: var(--hb-indigo); }
.visual ul.good strong, .visual ul.bad strong, .visual ul.cases strong { display: block; font-family: var(--hb-font-heading); font-size: 20px; font-weight: 600; margin-bottom: var(--hb-space-1); }
.visual ul.good p, .visual ul.bad p, .visual ul.cases p { margin: 0; color: var(--hb-text-muted); }
.story-help { background: var(--hb-abyss); color: #fff; padding: var(--hb-space-5) var(--hb-space-6); margin: var(--hb-space-6) 0 var(--hb-space-4); }
.story-help h2 { color: #fff; border: 0; margin-top: 0; padding: 0; }
.story-help p { margin: 0; font-size: var(--hb-text-lead); line-height: var(--hb-lh-lead); color: var(--hb-abyss-100); }

.common-mistakes, .accessibility-section, .related-visuals { margin-top: var(--hb-space-6); }
.mistakes-intro, .accessibility-intro, .related-intro { color: var(--hb-text-muted); max-width: var(--hb-measure); }
.mistakes-grid, .accessibility-grid, .related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--hb-space-5); }
.mistake-card { border: 1px solid var(--hb-border); border-top: 3px solid var(--hb-danger); padding: var(--hb-space-4) var(--hb-space-5); }
.mistake-icon { display: none; }
.mistake-card h4 { margin: 0 0 var(--hb-space-2); color: var(--hb-danger); }
.mistake-card p { margin: var(--hb-space-2) 0 0; font-size: 15px; color: var(--hb-text-muted); }
.mistake-card strong { color: var(--hb-text); }
.accessibility-card { border: 1px solid var(--hb-border); padding: var(--hb-space-4) var(--hb-space-5); }
.accessibility-icon { display: none; }
.accessibility-card h4 { margin: 0 0 var(--hb-space-2); }
.accessibility-content p { margin: var(--hb-space-2) 0; font-size: 15px; }
.accessibility-content ul { margin: var(--hb-space-1) 0 var(--hb-space-3); font-size: 15px; color: var(--hb-text-muted); }
.accessibility-content strong { color: var(--hb-text); }
.color-palette { display: flex; flex-wrap: wrap; gap: var(--hb-space-2); margin-top: var(--hb-space-2); }
.color-swatch { padding: var(--hb-space-2) var(--hb-space-3); font-family: var(--hb-font-mono); font-size: 13px; font-weight: 600; min-width: 84px; text-align: center; }
.example-text { border-left: 3px solid var(--hb-indigo); padding: var(--hb-space-3) var(--hb-space-4); background: var(--hb-surface); font-style: italic; }
.accessibility-resources { margin-top: var(--hb-space-5); border-top: 1px solid var(--hb-border); padding-top: var(--hb-space-4); }
.accessibility-resources h4 { margin-top: 0; }
.accessibility-resources ul { font-size: 15px; }
.related-card { display: flex; flex-direction: column; border: 1px solid var(--hb-border); padding: var(--hb-space-5); color: inherit; border-bottom-width: 1px; }
.related-card:hover { border-color: var(--hb-abyss); color: inherit; }
.related-header h3 { margin: 0 0 var(--hb-space-2); font-size: 22px; }
.related-desc { flex: 1; color: var(--hb-text-muted); font-size: 15px; margin: 0 0 var(--hb-space-3); }
.related-cta { color: var(--hb-link); font-weight: 600; font-size: var(--hb-text-ui); text-transform: uppercase; letter-spacing: .06em; }

/* ---- 12. Outlier / topic pages --------------------------------- */
.outlier { display: flex; flex-direction: column; gap: var(--hb-space-6); max-width: var(--hb-max-width); }
.outlier-header .intro, article .intro { font-size: var(--hb-text-lead); line-height: var(--hb-lh-lead); color: var(--hb-text-muted); max-width: var(--hb-measure); }
.outlier-header .tagline { color: var(--hb-signal-700); font-weight: 600; margin: 0 0 var(--hb-space-3); }
.method-description { max-width: var(--hb-measure); }
.hero-figure { margin: 0; background: #fff; border: 1px solid var(--hb-border); padding: var(--hb-space-3); box-shadow: var(--hb-shadow-sm); }
.hero-figure img { width: 100%; display: block; }
.hero-figure figcaption { margin-top: var(--hb-space-3); color: var(--hb-text-muted); font-size: var(--hb-text-ui); }
.figure-note { margin: var(--hb-space-2) 0 0; font-size: 13px; color: var(--hb-text-muted); }
.outlier-section { border: 1px solid var(--hb-border); padding: var(--hb-space-5); margin-bottom: var(--hb-space-5); }
.outlier-section h3 { margin-top: 0; }
.code-block { margin: var(--hb-space-4) 0 0; background: var(--hb-abyss-900); color: var(--hb-abyss-100); border: 1px solid var(--hb-abyss-700); padding: var(--hb-space-4) var(--hb-space-5); }
.code-block figcaption { font-size: var(--hb-text-ui); color: var(--hb-abyss-300); margin-bottom: var(--hb-space-2); font-weight: 600; }
.code-block pre { margin: 0; overflow: auto; max-height: 380px; font-size: 13.5px; line-height: 1.5; }
.key-takeaways, .further-reading { border: 1px solid var(--hb-border); padding: var(--hb-space-5); }
.key-takeaways { border-left: 3px solid var(--hb-signal); background: var(--hb-surface); }
.key-takeaways h2, .further-reading h2 { margin-top: 0; }
.key-takeaways ul, .further-reading ul { margin: 0; }

/* ---- 13. Search page ------------------------------------------- */
.search-lg { display: flex; max-width: 720px; margin: var(--hb-space-4) 0 var(--hb-space-6); }
.search-lg input { flex: 1; min-width: 0; height: 44px; padding: 0 var(--hb-space-4); border: 1px solid var(--hb-border); border-right: 0; background: #fff; font: inherit; font-size: 16px; }
.search-lg button { height: 44px; padding: 0 var(--hb-space-5); background: var(--hb-abyss); color: #fff; border: 1px solid var(--hb-abyss); font-weight: 600; cursor: pointer; }
.result-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--hb-space-3); max-width: 800px; }
.result-list li { margin: 0; padding: var(--hb-space-4) var(--hb-space-5); border: 1px solid var(--hb-border); }
.result-list li a { font-family: var(--hb-font-heading); font-size: 22px; font-weight: 600; border: 0; }
.result-list li p { margin: var(--hb-space-1) 0 0; color: var(--hb-text-muted); font-size: 15px; }
.score { margin-left: var(--hb-space-2); color: var(--hb-text-muted); font-size: var(--hb-text-ui); }
.suggestions { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--hb-space-2); }
.suggestions li { margin: 0; }
.suggestions a { display: inline-block; padding: 2px var(--hb-space-3); border: 1px solid var(--hb-border); border-radius: var(--hb-radius-pill); }

/* ---- 14. Report layout guide ----------------------------------- */
.guide { max-width: var(--hb-max-width); }
.guide .prose { max-width: var(--hb-measure); }
.rules { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--hb-space-3); counter-reset: rule; }
.rules li { counter-increment: rule; margin: 0; padding: var(--hb-space-4) var(--hb-space-5) var(--hb-space-4) 64px; border: 1px solid var(--hb-border); position: relative; }
.rules li::before { content: counter(rule, decimal-leading-zero); position: absolute; left: var(--hb-space-5); top: var(--hb-space-4); font-family: var(--hb-font-heading); font-size: 22px; font-weight: 700; color: var(--hb-signal); }
.rules strong { display: block; font-family: var(--hb-font-heading); font-size: 20px; font-weight: 600; margin-bottom: var(--hb-space-1); }
.rules p { margin: 0; color: var(--hb-text-muted); font-size: 15px; }
.wire { background: #fff; border: 1px solid var(--hb-border); padding: var(--hb-space-3); box-shadow: var(--hb-shadow-sm); }
.wire svg { display: block; width: 100%; height: auto; }
.wire figcaption { margin-top: var(--hb-space-3); font-size: var(--hb-text-ui); color: var(--hb-text-muted); }
.wire-notes { margin: var(--hb-space-3) 0 0; padding-left: 1.4em; font-size: 15px; }
.wire-notes li { margin: var(--hb-space-1) 0; }
.wire-notes b { font-family: var(--hb-font-heading); color: var(--hb-signal-700); }
.tier { display: grid; grid-template-columns: 120px 1fr; gap: var(--hb-space-4); padding: var(--hb-space-4) 0; border-top: 1px solid var(--hb-border); }
.tier:last-child { border-bottom: 1px solid var(--hb-border); }
.tier .overline { margin: 0; }
.tier p { margin: 0; }
@media (max-width: 600px) { .tier { grid-template-columns: 1fr; gap: var(--hb-space-1); } }
