/* Continue to Grow - site styles
   Tokens and rules from the project spec, section 3. Light theme only,
   mobile-first, breakpoints at 640 / 900 / 1200. */

:root {
  --green: #5ABF92;
  --green-ink: #2A7554;
  --green-display: #3D9E73;  /* brand green darkened to 3.3:1 on white: large display text only (h1 words) */      /* green dark enough to be TEXT (5.6:1 on white) */
  --teal: #1BAFBE;
  --ink: #0F241D;
  --ink-2: #3E5249;
  --mint: #E8F6EF;
  --sky: #E4F5F7;
  --paper: #FFFFFF;
  --paper-2: #F6F9F7;
  --line: #D8E4DD;
  --amber: #D99A2B;
  --red: #C84B3C;
  --red-ink: #BF4436;        /* red dark enough to be TEXT (5.1:1 on white) */

  --max: 1160px;
  --pad: 20px;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15,36,29,.05), 0 8px 24px rgba(15,36,29,.06);
  --shadow-lg: 0 2px 4px rgba(15,36,29,.06), 0 18px 46px rgba(15,36,29,.10);
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: Nunito, var(--sans);
  --sec-y: 56px;
  --motif: url(../img/ctg-mark.svg);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }
img { height: auto; display: block; }

h1, h2, h3, h4 { font-family: var(--display); font-weight: 800; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.65rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.16rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--ink); }

/* Teal on white is 2.65:1, under the 3:1 that WCAG 1.4.11 asks of a focus
   indicator. Ink ring carries the contrast (16.3:1), teal halo keeps it ours. */
:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(27, 175, 190, .40);
  border-radius: 4px;
}

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.section { padding: var(--sec-y) 0; }
.section--tint { background: var(--paper-2); }
.section--mint { background: var(--mint); }
.eyebrow {
  font-size: .78rem; font-weight: 600; letter-spacing: .10em; text-transform: uppercase;
  color: var(--ink-2); margin: 0 0 .7em;
}
.lead { font-size: 1.08rem; color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--ink-2); }
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* ---------- skip link ---------- */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 0 0 10px 0;
  font-weight: 600; text-decoration: none;
}
.skip:focus { left: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-family: var(--sans); font-size: .96rem; font-weight: 600; line-height: 1.2;
  padding: 14px 22px; border-radius: 999px; border: 1.5px solid transparent;
  text-decoration: none; cursor: pointer; transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn--primary { background: var(--green); color: var(--ink); }
.btn--primary:hover { background: #4EB185; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: #1B392E; }
.btn:hover { transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:hover { transform: none; } }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; text-decoration: none; flex: 0 0 auto; }
.brand img { height: 40px; width: auto; }
.nav { margin-left: auto; display: none; align-items: center; gap: 26px; }
.nav a { text-decoration: none; font-size: .94rem; font-weight: 500; color: var(--ink-2); }
.nav a:hover { color: var(--ink); }
.nav .btn { padding: 10px 18px; font-size: .9rem; color: var(--ink); }
.nav-toggle {
  margin-left: auto; display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; padding: 10px; background: none; border: 1px solid var(--line);
  border-radius: 10px; cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; }
@media (min-width: 900px) {
  .nav { display: flex; }
  .nav-toggle { display: none; }
}
/* mobile menu */
.mobile-nav {
  position: fixed; inset: 68px 0 0; z-index: 99; background: var(--paper);
  padding: 24px var(--pad) 40px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
}
.mobile-nav a {
  text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.4rem;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.mobile-nav .btn { margin-top: 20px; align-self: flex-start; border-bottom: 0; font-size: 1rem; font-family: var(--sans); }
.mobile-nav[hidden] { display: none !important; }
@media (min-width: 900px) { .mobile-nav { display: none !important; } }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--mint) 0%, var(--paper) 78%); }
.hero::before {
  content: ""; position: absolute; right: -90px; top: -70px; width: 420px; height: 420px;
  background: var(--motif) center/contain no-repeat; opacity: .06; pointer-events: none;
}
.hero .wrap { position: relative; padding-top: 44px; padding-bottom: 48px; }
.hero-grid { display: grid; gap: 34px; align-items: center; }
.hero h1 { margin-bottom: .45em; }
.hero h1 .brk { display: block; }
.hero h1 em { font-style: normal; color: var(--green-display); }
.hero p.lead { font-size: 1.09rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
@media (min-width: 1000px) {
  .hero-grid { grid-template-columns: 1.02fr .98fr; gap: 46px; }
  .hero .wrap { padding-top: 68px; padding-bottom: 76px; }
}

/* ---------- mini dashboard card ---------- */
.dash {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 18px;
}
.dash-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.dash-head .t { font-family: var(--display); font-weight: 700; font-size: .98rem; }
.dash-head .p { font-size: .7rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink); background: var(--sky); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
/* one tile per row on a phone: a full NOI figure does not fit a 94px column
   at 375px, and the sign-plus-word delta needs the room. */
.tiles { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 520px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile { background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 10px; overflow-wrap: anywhere; }
.tile .k { font-size: .68rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); line-height: 1.25; }
.tile .v { font-family: var(--display); font-weight: 800; font-size: 1.22rem; margin-top: 4px; line-height: 1.1; }
.tile .d { font-size: .72rem; font-weight: 600; margin-top: 3px; line-height: 1.35; }
.tile .d.fav { color: var(--green-ink); }
.tile .d.unf { color: var(--red-ink); }
.tile .d.flat { color: var(--ink-2); font-weight: 500; }
.dash-chart { margin-top: 14px; }
.dash-chart .ct { font-size: .8rem; font-weight: 600; }
.dash-chart .cs { font-size: .72rem; color: var(--ink-2); margin-bottom: 6px; }
.chart-box { position: relative; height: 200px; }
.dash-note { font-size: .74rem; color: var(--ink-2); margin: 12px 0 0; }

/* ---------- proof strip ---------- */
.proof { background: var(--ink); color: #fff; }
.proof .wrap { padding-top: 24px; padding-bottom: 24px; }
.proof ul { display: grid; gap: 14px 26px; grid-template-columns: 1fr; margin: 0; padding: 0; }
.proof li { list-style: none; font-size: .9rem; color: #DCEAE3; display: flex; gap: 9px; align-items: flex-start; }
.proof .dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-top: .55em; }
@media (min-width: 640px) { .proof ul { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .proof ul { grid-template-columns: repeat(4, 1fr); } }

/* ---------- generic card grids ---------- */
.grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid--2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 700px) { .grid--4 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1080px) { .grid--4 { grid-template-columns: repeat(4, 1fr); } }
/* Step grids align to content (P2): a short card stops stretching to the
   tallest one in its row. The columns still set equal widths. */
.grid--steps { align-items: start; }
/* service-card icons (P3): inline two-stroke line icons, 28px, brand teal */
.svc-icon { color: var(--teal); display: block; margin: 0 0 12px; }
/* a row of buttons in a paragraph (P4) */
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.card h3 { margin-bottom: .45em; }
.card p { color: var(--ink-2); margin-bottom: 0; font-size: .95rem; }
.card p + p { margin-top: .8em; }
.card .more { display: inline-block; margin-top: 14px; font-weight: 600; font-size: .92rem; color: var(--ink); text-decoration: none; border-bottom: 2px solid var(--green); padding-bottom: 1px; }
.card-link { display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: transform .16s ease, box-shadow .16s ease; }
.card-link:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
@media (prefers-reduced-motion: reduce) { .card-link { transition: none; } .card-link:hover { transform: none; } }
.tag {
  display: inline-block; font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  background: var(--sky); color: var(--ink); border-radius: 999px; padding: 4px 11px; margin-bottom: 12px;
}
.card dt { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin-top: 12px; }
.card dd { margin: 3px 0 0; font-size: .93rem; color: var(--ink-2); }

/* ---------- numbered steps ---------- */
.step { position: relative; padding-top: 6px; }
.step .n {
  font-family: var(--display); font-weight: 800; font-size: 1.02rem; color: var(--ink);
  width: 36px; height: 36px; border-radius: 50%; background: var(--mint);
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px;
}
.step h3 { margin-bottom: .35em; }
.step p { color: var(--ink-2); font-size: .95rem; margin: 0; }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 22px 0 0; list-style: none; }
.chips li { font-size: .84rem; font-weight: 500; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; color: var(--ink-2); }

/* ---------- guardrail box ---------- */
.guardrail {
  background: var(--mint); border-left: 4px solid var(--green); border-radius: 12px;
  padding: 20px 22px; margin-top: 26px; max-width: 74ch;
}
.guardrail p { margin: 0; font-size: 1rem; }

/* ---------- about ---------- */
.about-grid { display: grid; gap: 28px; align-items: start; }
.about-photo { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); max-width: 320px; }
.about-photo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
@media (min-width: 900px) { .about-grid { grid-template-columns: 320px 1fr; gap: 44px; } }
.education { margin-top: 18px; font-size: .94rem; color: var(--ink-2); }

/* ---------- contact ---------- */
.contact-grid { display: grid; gap: 30px; align-items: start; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: .85fr 1.15fr; gap: 48px; } }
.contact-list { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 14px; }
.contact-list a { font-weight: 600; }
.form { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: .84rem; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; font-size: .95rem; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px;
}
.field textarea { min-height: 118px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--teal); outline: 2px solid rgba(27,175,190,.28); outline-offset: 0; }
.field .err { display: none; color: var(--red-ink); font-size: .8rem; font-weight: 600; margin-top: 5px; }
.field.is-bad input, .field.is-bad textarea { border-color: var(--red); }
.field.is-bad .err { display: block; }
.form-note { font-size: .82rem; color: var(--ink-2); margin: 12px 0 0; }
.form-fail { background: #FBEDEA; border-left: 4px solid var(--red); border-radius: 10px; padding: 14px 16px; font-weight: 600; margin-bottom: 16px; }
.form-ok { display: none; background: var(--mint); border-left: 4px solid var(--green); border-radius: 10px; padding: 14px 16px; font-weight: 600; margin-bottom: 16px; }
.form-ok.show { display: block; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: #DCEAE3; padding: 44px 0 38px; }
.site-footer img { height: 38px; width: auto; margin-bottom: 18px; }
.site-footer a { color: #fff; }
.site-footer p { margin: 0 0 6px; font-size: .92rem; }
.site-footer .fine { margin-top: 18px; font-size: .82rem; color: #9FBCAF; }

/* ---------- reveal on scroll (only when JS is on) ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); }
.js .reveal.is-in { opacity: 1; transform: none; transition: opacity .55s ease, transform .55s ease; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; }
  .js .reveal.is-in { transition: none; }
}

/* ---------- tie-check table (rendered by CTG.renderChecks) ---------- */
.checks-wrap { overflow-x: auto; }
table.checks { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.checks th, table.checks td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.checks thead th { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); border-bottom-width: 2px; }
table.checks .ck-name { font-weight: 500; color: var(--ink); min-width: 15rem; }
table.checks .ck-num { text-align: right; white-space: nowrap; color: var(--ink-2); }
table.checks thead .ck-num { text-align: right; }
table.checks .ck-mark { white-space: nowrap; font-weight: 600; }
table.checks tr.ok .ck-mark { color: var(--green-ink); }
table.checks tr.bad .ck-mark { color: var(--red-ink); }
table.checks tr.bad { background: #FBEDEB; }
.checks-sum { margin: 12px 0 0; font-size: .88rem; font-weight: 600; color: var(--green-ink); }
.checks-sum.bad { color: var(--red-ink); }

/* ---------- print ---------- */
@media print {
  .site-header, .mobile-nav, .nav-toggle, .skip, .hero-cta, .form, .btn { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .section { padding: 14pt 0; }
  .hero { background: #fff; }
  .hero::before { display: none; }
  .card, .dash, .guardrail { box-shadow: none; break-inside: avoid; }
  .proof { background: #fff; color: #000; }
  .proof li { color: #000; }
  .site-footer { background: #fff; color: #000; padding-top: 12pt; }
  .site-footer .fine, .site-footer a { color: #000; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; }
}

/* =====================================================================
   Sample pages (spec 5.3 / 12.2). Everything below is shared by the three
   samples: a report on paper, not a marketing page.
   ===================================================================== */

/* current page in the nav */
.nav a[aria-current="page"], .mobile-nav a[aria-current="page"] {
  color: var(--ink); font-weight: 600; border-bottom: 2px solid var(--green);
}

/* ---------- sample banner (B1) ----------
   The banner is the FIRST ROW INSIDE the sticky site header, so the header is
   one sticky block (banner row + nav row). Nothing is measured at runtime and
   nothing overlaps at any width, inside an iframe included. */
.sample-banner {
  background: var(--ink); color: #fff; text-align: center;
  font-size: .72rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; line-height: 1.5; padding: 8px 16px;
}
.sample-banner .sep { color: var(--green); padding: 0 .35em; }
body.sample {
  /* height of the whole sticky block: two banner lines + the 68px nav row
     below 700px, one banner line above it. A static number, not a measurement:
     it only sets scroll offsets and the mobile menu's top edge. */
  --sample-head-h: 119px;
  background: var(--paper-2);
}
@media (min-width: 700px) { body.sample { --sample-head-h: 102px; } }
body.sample .mobile-nav { top: var(--sample-head-h); }
body.panel-open { overflow: hidden; }

/* ---------- TIE FAIL ---------- */
.tie-fail {
  width: calc(100% - (var(--pad) * 2)); max-width: var(--max);
  margin: 18px auto 0; background: #FBEDEB; border: 2px solid var(--red);
  border-radius: 12px; padding: 14px 18px; color: #8E2C20;
}
.tie-fail strong { display: block; font-family: var(--display); letter-spacing: .04em; }
.tie-fail-list { margin: 6px 0 0; padding-left: 18px; font-size: .9rem; }

/* ---------- sample header ---------- */
.sample-head {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--mint) 0%, var(--paper) 92%);
  border-bottom: 1px solid var(--line);
}
.sample-head::before {
  content: ""; position: absolute; right: -70px; top: -80px; width: 320px; height: 320px;
  background: var(--motif) center/contain no-repeat; opacity: .06; pointer-events: none;
}
.sample-head .wrap { position: relative; padding-top: 30px; padding-bottom: 26px; }
.sample-head .eyebrow { margin-bottom: 6px; }
.sample-head h1 { font-size: clamp(1.75rem, 4vw, 2.6rem); margin-bottom: .3em; }
.sample-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.sample-meta .period { font-weight: 600; }
.sample-meta .asof { color: var(--ink-2); font-size: .88rem; }
.checks-badge {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  background: var(--mint); border: 1px solid #A9DCC4; color: var(--ink);
  border-radius: 999px; padding: 6px 14px; font-size: .84rem; font-weight: 600;
}
.checks-badge:hover { background: #D8F0E4; }
.checks-badge.bad { background: #FBEDEB; border-color: var(--red); color: #8E2C20; }

/* card headings on the hub use h2 (the cards are the section's structure) */
.card h2 { font-size: 1.16rem; font-weight: 700; margin-bottom: .45em; }
.sample-subhead { margin: 30px 0 12px; font-size: 1.05rem; }

/* ---------- section rhythm ---------- */
.sample-section { padding: 30px 0; }
.sample-section > .wrap > h2 {
  font-size: clamp(1.25rem, 2.4vw, 1.6rem); margin-bottom: .2em;
}
.sample-section .section-sub { color: var(--ink-2); font-size: .93rem; margin: 0 0 16px; }
.sample-section[id] { scroll-margin-top: calc(var(--sample-head-h, 80px) + 12px); }
.sample-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}

/* ---------- KPI tiles across the page ---------- */
.tiles--page { grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 640px) { .tiles--page { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1040px) { .tiles--page { grid-template-columns: repeat(6, 1fr); } }
.tiles--page .tile { background: var(--paper); padding: 13px 12px; box-shadow: var(--shadow); }
.tiles--page .tile .v { font-size: 1.3rem; }

/* ---------- charts ---------- */
.chart-grid { display: grid; gap: 16px; }
@media (min-width: 940px) {
  .chart-grid { grid-template-columns: 1fr 1fr; }
  .chart-grid .chart-card:first-child { grid-column: 1 / -1; }
}
.chart-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 14px; box-shadow: var(--shadow);
}
.chart-title { font-size: 1rem; margin-bottom: .15em; }
.chart-sub { font-size: .8rem; color: var(--ink-2); margin: 0 0 10px; }
.chart-card .chart-box { height: 250px; }
@media (min-width: 940px) { .chart-grid .chart-card:first-child .chart-box { height: 300px; } }
.chart-fallback { font-size: .8rem; color: var(--ink-2); margin: 8px 0 0; }
.chart-print { display: none; }

/* ---------- ask this report ---------- */
.ask-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-size: .86rem; font-weight: 500; text-align: left;
  background: var(--paper); color: var(--ink); border: 1px solid var(--line);
  border-radius: 999px; padding: 9px 15px; cursor: pointer;
  transition: background .14s ease, border-color .14s ease;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .chip { transition: none; } }
.ask-answer {
  margin-top: 14px; background: var(--mint); border-radius: 12px; padding: 16px 18px;
}
.ask-hint { margin: 0; color: var(--ink-2); font-size: .92rem; }
.ask-q { font-family: var(--display); font-weight: 700; margin: 0 0 .35em; }
.ask-a { margin: 0 0 .6em; }
.ask-source { margin: 0; font-size: .82rem; color: var(--ink-2); }
.ask-source-k { font-weight: 600; color: var(--ink); }

/* ---------- data tables ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.data-table caption {
  caption-side: top; text-align: left; font-size: .8rem; color: var(--ink-2);
  padding-bottom: 8px;
}
table.data-table th, table.data-table td {
  padding: 7px 9px; border-bottom: 1px solid var(--line); white-space: nowrap;
  vertical-align: top;
}
/* B3: numbers never wrap, text columns do from 1100px up. That is what keeps a
   wide table (the pay list, the portfolio drill) inside its card with no
   horizontal scrollbar. Below 1100px .table-scroll still scrolls. */
@media (min-width: 1100px) {
  table.data-table th.al-left, table.data-table td.al-left { white-space: normal; }
  table.data-table thead th.al-left { hyphens: none; }
}
table.data-table thead th {
  font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-2); border-bottom-width: 2px; position: sticky; top: 0;
  background: var(--paper); z-index: 1;
}
table.data-table tbody th { font-weight: 600; }
table.data-table tfoot th, table.data-table tfoot td {
  font-weight: 700; border-top: 2px solid var(--ink); border-bottom: 0;
  background: var(--paper-2);
}
.al-right { text-align: right; }
.al-left { text-align: left; }
.al-center { text-align: center; }
table.data-table td.fav, table.data-table th.fav { color: var(--green-ink); }
table.data-table td.unf, table.data-table th.unf { color: var(--red-ink); }
.vword { display: block; font-size: .68rem; font-weight: 600; opacity: .9; }
table.data-table tbody tr.is-openable { cursor: pointer; }
table.data-table tbody tr.is-openable:hover { background: var(--mint); }
.drill-table tbody tr.is-open { background: var(--mint); box-shadow: inset 3px 0 0 var(--green); }
.drill-table tbody tr.is-openable th:first-child::after {
  content: " ›"; color: var(--green-ink); font-weight: 700;
}

/* ---------- drill layout and slide-in detail panel (P1) ----------
   The table keeps the full width at every width. The detail opens as a panel
   sliding in from the right over a scrim, one pattern for the whole site:
   close button, Escape closes, focus returns to the row that opened it, and
   deeper levels stack inside the same panel behind a back link. */
.drill-layout { display: grid; gap: 18px; align-items: start; grid-template-columns: minmax(0, 1fr); }
.drill-main {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); min-width: 0;
}
.drill-sub { font-size: .88rem; color: var(--ink-2); margin: 0 0 12px; }
.slide-scrim {
  position: fixed; inset: 0; z-index: 290; background: rgba(15, 36, 29, .38);
}
.slide-scrim[hidden] { display: none !important; }
.drill-panel, .slide-panel {
  position: fixed; top: 0; right: 0; bottom: 0; left: auto; z-index: 300;
  width: min(560px, 92vw); max-width: 100vw;
  background: var(--paper); border: 0; border-left: 1px solid var(--line);
  border-radius: 0; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; min-width: 0;
  animation: slide-in .18s ease both;
}
.drill-panel { overflow: hidden; }
.slide-panel { overflow: auto; }
@keyframes slide-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .drill-panel, .slide-panel { animation: none; } }
.drill-panel[hidden], .slide-panel[hidden] { display: none !important; }
.drill-panel-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.drill-panel-title {
  margin: 0; font-size: 1rem; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere;
}
.drill-panel-title:focus-visible { outline-offset: 3px; }
.drill-back, .drill-close {
  font: inherit; background: none; border: 1px solid var(--line); border-radius: 8px;
  padding: 5px 10px; cursor: pointer; color: var(--ink); flex: 0 0 auto;
}
.drill-close { font-size: 1.2rem; line-height: 1; padding: 4px 10px 6px; }
.drill-back:hover, .drill-close:hover { border-color: var(--ink); background: var(--paper-2); }
.drill-panel-body { padding: 14px 16px 18px; overflow: auto; flex: 1 1 auto; }
.drill-panel-body h4 {
  font-size: .82rem; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-2); margin: 18px 0 8px;
}
.drill-panel-body h4:first-child { margin-top: 0; }
.panel-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 0 0 4px; }
.panel-facts div { border-bottom: 1px dotted var(--line); padding-bottom: 5px; }
.panel-facts dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
.panel-facts dd { margin: 2px 0 0; font-weight: 600; }
.panel-note { font-size: .8rem; color: var(--ink-2); margin: 8px 0 0; }

/* ---------- what if ---------- */
.whatif {
  background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--teal);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
}
.whatif h3 { margin-bottom: .2em; }
.whatif-sub { font-size: .88rem; color: var(--ink-2); margin: 0 0 14px; }
.whatif-control { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.whatif-control label { font-size: .88rem; font-weight: 600; }
.whatif-range { flex: 1 1 220px; accent-color: var(--teal); }
.whatif-toggle { width: 20px; height: 20px; accent-color: var(--teal); }
.whatif-value { font-family: var(--display); font-weight: 800; font-size: 1.05rem; }
.whatif-result { margin-top: 14px; display: grid; gap: 6px; }
.whatif-row { display: flex; justify-content: space-between; gap: 16px; font-size: .93rem; }
.whatif-row .k { color: var(--ink-2); }
.whatif-row .v { font-weight: 700; }
.whatif-caption { margin: 6px 0 0; font-size: .82rem; color: var(--ink-2); }
.whatif-note { margin: 12px 0 0; font-size: .8rem; color: var(--ink-2); }

/* ---------- notes ---------- */
.notes-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.notes-list li {
  background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--green);
  border-radius: 12px; padding: 13px 16px; font-size: .95rem;
}

/* ---------- statement ---------- */
.statement {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow); max-width: 560px;
}
.statement-head h4 { margin: 0 0 2px; font-size: 1.02rem; }
.statement-sub { margin: 0 0 12px; font-size: .82rem; color: var(--ink-2); }
.statement-lines { margin: 0; }
.statement-row {
  display: flex; justify-content: space-between; gap: 18px;
  padding: 8px 0; border-bottom: 1px dotted var(--line);
}
.statement-row dt { margin: 0; }
.statement-row dd { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.statement-row.is-open { font-weight: 600; }
.statement-row.is-out dd { color: var(--red-ink); }
.statement-row.is-close {
  border-bottom: 0; border-top: 2px solid var(--ink); margin-top: 6px;
  padding-top: 11px; font-weight: 700; font-size: 1.04rem;
}
.statement-note { margin: 12px 0 0; font-size: .8rem; color: var(--ink-2); }

/* ---------- how this was built ---------- */
.built-strip { display: grid; gap: 12px; margin-top: 14px; }
@media (min-width: 780px) { .built-strip { grid-template-columns: repeat(4, 1fr); } }
.built-item {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  padding: 15px 16px; position: relative;
}
.built-item h3 {
  font-size: .74rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--green-ink); margin-bottom: .4em;
}
.built-item p { margin: 0; font-size: .9rem; color: var(--ink-2); }
@media (min-width: 780px) {
  /* the arrow sits BEFORE each following block, so the Data block (P5) can be
     added at the end of the strip without an arrow pointing into it */
  .built-item + .built-item:not(.built-item--data)::before {
    content: "→"; position: absolute; left: -16px; top: 50%; transform: translateY(-50%);
    color: var(--green-ink); font-weight: 700;
  }
  .built-item--data { grid-column: 1 / -1; }
}
.built-item--data p { color: var(--ink); }
.built-item--data a { font-weight: 600; color: var(--green-ink); }

/* ---------- print ---------- */
@media print {
  @page { margin: 14mm; }
  .sample-banner, .ask-panel, .whatif, .drill-panel, .chart-fallback,
  .sample-foot-links, .checks-badge { display: none !important; }
  body.sample { padding-top: 0; background: #fff; }
  .sample-head { background: #fff; }
  .sample-head::before { display: none; }
  .sample-section { padding: 10pt 0; break-inside: auto; }
  .chart-card, .drill-main, .statement, .notes-list li, .built-item, .sample-card {
    box-shadow: none; break-inside: avoid;
  }
  .chart-grid { grid-template-columns: 1fr 1fr; }
  .chart-box { height: auto !important; }
  .chart-box canvas { display: none; }
  .chart-print { display: block; width: 100%; height: auto; }
  .drill-layout { grid-template-columns: 1fr; }
  .table-scroll { overflow: visible; }
  table.data-table { font-size: 8.5pt; }
  table.data-table thead { display: table-header-group; }
  table.data-table tr { break-inside: avoid; }
  .built-item::before { display: none; }
}
@media print {
  body.sample .site-footer, body.sample .site-header { display: none !important; }
}
