/* CODITECT WPP — "What is CODITECT AI" explainer site
   Design system: aliases onto the canonical CODITECT brand tokens
   (coditect-core/assets/coditect-brand.css → brand.css, linked first).
   Light default; .dark on <html> flips the brand tokens, and these
   aliases re-resolve automatically. STD-025 conformance. */

:root {
  --bg: var(--color-surface-alt, #f6f7f9);
  --surface: var(--color-surface, #ffffff);
  --surface-2: var(--color-surface-dim, #f0f2f5);
  --border: var(--color-line, #e2e6ec);
  --text: var(--color-body, #1a1f29);
  --text-muted: var(--color-muted, #5a6573);
  --accent: var(--brand-primary, #0D9488);
  --accent-2: #6a5d65;
  --good: #0D9488;
  --warn: #8a6d1b;
  --bad: #b83b3b;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.06);
  --radius: 10px;
  --maxw: 980px;
  --mono: var(--font-mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace);
  --sans: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
  /* Layout */
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 60px;
  --topbar-h: 60px;
  --footer-h: 56px;
}

/* Dark palette. theme.js is the SSOT: it toggles the .dark class on <html>.
   The base surface/text/border tokens are flipped here (the generated brand.css
   dark block keys off [data-theme] and is not the SSOT), plus accent/shadow. */
html.dark {
  --bg: #0d0f12;
  --surface: #16191d;
  --surface-2: #1e2228;
  --border: #2a2f37;
  --text: #e8eaed;
  --text-muted: #9aa0a6;
  --accent: var(--brand-primary-light, #14B8A6);
  --good: #4fd08a;
  --warn: #e0b341;
  --bad: #f0857d;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header__brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.site-header__logo { height: 34px; width: auto; }
.site-header__title { font-weight: 700; font-size: 15px; line-height: 1.2; }
.site-header__subtitle { font-size: 12px; color: var(--text-muted); }
.site-header__actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.site-header__actions a { font-size: 14px; color: var(--text-muted); font-weight: 500; }
.site-header__actions a.active, .site-header__actions a:hover { color: var(--accent); text-decoration: none; }

.theme-toggle {
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font-size: 16px; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
}
.theme-toggle::before { content: "\263E"; }      /* moon (light mode → offer dark) */
html.dark .theme-toggle::before { content: "\2600"; } /* sun */

/* ---------- Layout ---------- */
.site-main { display: flex; flex-direction: column; min-height: calc(100vh - var(--topbar-h) - var(--footer-h)); }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 32px 24px 64px; flex: 1; }

/* ---------- Typography ---------- */
h1 { font-size: 28px; line-height: 1.25; margin: 0 0 8px; }
h2 { font-size: 21px; margin: 36px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
h3 { font-size: 16px; margin: 24px 0 8px; }
p { margin: 0 0 14px; }
.lede { font-size: 17px; color: var(--text-muted); margin-bottom: 24px; }
.muted { color: var(--text-muted); }
small, .small { font-size: 12.5px; color: var(--text-muted); }
code { font-family: var(--mono); background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-size: 90%; }

/* ---------- Cards / sections ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); margin: 0 0 18px;
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat__value { font-size: 24px; font-weight: 700; }
.stat__label { font-size: 12.5px; color: var(--text-muted); }

.pill {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border);
}
.pill.good { color: var(--good); border-color: var(--good); }
.pill.warn { color: var(--warn); border-color: var(--warn); }
.pill.bad  { color: var(--bad);  border-color: var(--bad); }
.pill.accent { color: var(--accent); border-color: var(--accent); }

.banner {
  border-left: 4px solid var(--accent); background: var(--surface-2);
  padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 0 0 18px; font-size: 14px;
}
.banner.internal { border-left-color: var(--warn); }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0 18px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); background: var(--surface-2); }
tbody tr:hover { background: var(--surface-2); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.table-wrap table { margin: 0; }

/* ---------- Forms ---------- */
.field { margin: 0 0 16px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field .hint { font-size: 12.5px; color: var(--text-muted); margin-bottom: 6px; }
input[type=text], input[type=email], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font-family: var(--sans); font-size: 14px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }

.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-row label {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 500; cursor: pointer;
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px; background: var(--surface);
}
.radio-row input { accent-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--accent); color: #fff; border: none; border-radius: 8px;
  padding: 11px 20px; font-size: 15px; font-weight: 600; font-family: var(--sans);
}
.btn:hover { filter: brightness(1.07); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }

.form-status { font-size: 14px; margin-top: 12px; min-height: 20px; }
.form-status.ok { color: var(--good); }
.form-status.err { color: var(--bad); }

/* ---------- Footnotes / sources ---------- */
.sources { font-size: 12.5px; color: var(--text-muted); }
.sources li { margin-bottom: 4px; word-break: break-word; }
sup a { font-size: 11px; padding: 0 1px; }

/* ---------- Footer ---------- */
.site-footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: var(--footer-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 24px; border-top: 1px solid var(--border); background: var(--surface);
  font-size: 12px; color: var(--text-muted);
}
.site-footer__left { display: flex; align-items: center; gap: 10px; }
.site-footer__logo { height: 20px; opacity: .85; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 32px; width: 100%; max-width: 380px; text-align: center; }
.login-card img { height: 40px; margin-bottom: 14px; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%); border: 1px solid var(--border); border-radius: 14px; padding: 28px 28px 24px; margin-bottom: 24px; }
.hero h1 { font-size: 30px; }
.nav-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 8px; }
@media (max-width: 720px) { .nav-cards { grid-template-columns: 1fr; } }
.nav-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; color: var(--text); box-shadow: var(--shadow); }
.nav-card:hover { border-color: var(--accent); text-decoration: none; }
.nav-card h3 { margin: 6px 0; }
.nav-card .pill { margin-bottom: 8px; }

/* ---------- Narrative / pull-quote ---------- */
.hero-tag { font-size: 19px; font-weight: 700; line-height: 1.3; margin: 0 0 10px; color: var(--text); }
.hero-tag em { color: var(--accent); font-style: normal; }

.pullquote {
  border-left: 4px solid var(--accent-2); padding: 14px 20px; margin: 0 0 22px;
  background: var(--surface-2); border-radius: 0 10px 10px 0;
  font-size: 20px; font-weight: 700; line-height: 1.3;
}
.pullquote span { display: block; margin-top: 6px; font-size: 13px; font-weight: 500; color: var(--text-muted); }

.narrative {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 22px 24px; margin: 0 0 20px; box-shadow: var(--shadow);
}
.narrative .kicker { font-size: 22px; font-weight: 800; line-height: 1.25; margin: 0 0 12px; }
.narrative p { font-size: 15px; }
.narrative .ask { margin: 14px 0; padding-left: 4px; list-style: none; }
.narrative .ask li { padding: 7px 0 7px 30px; position: relative; font-size: 15px; border-bottom: 1px solid var(--border); }
.narrative .ask li:last-child { border-bottom: none; }
.narrative .ask li::before {
  content: "?"; position: absolute; left: 0; top: 7px; width: 20px; height: 20px;
  background: var(--accent); color: #fff; border-radius: 50%; font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.narrative .closer { font-weight: 700; font-size: 16px; color: var(--text); margin-bottom: 0; }

/* ===================================================================
   Site-wide enhancements — accessibility, responsive, print, slides
   =================================================================== */

/* Accessibility: skip link + visible keyboard focus */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0; font-weight: 600;
}
.skip-link:focus { left: 0; }
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

/* Responsive header: let the nav wrap / scroll instead of overflowing */
@media (max-width: 760px) {
  .site-header { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .site-header__actions { width: 100%; gap: 10px 14px; flex-wrap: wrap; font-size: 13.5px; }
  .container { padding: 24px 16px 56px; }
  h1 { font-size: 24px; }
  .hero { padding: 22px 18px; }
  .hero h1 { font-size: 24px; }
}
@media (max-width: 420px) {
  .site-header__title { font-size: 14px; }
  .stat__value { font-size: 21px; }
}

/* Honor reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* Print: chrome is hidden; the running header/footer come from @page MARGIN BOXES
   (injected per-page by app.js for regular pages) so they sit in the page margin and
   never cover content. The deck keeps its own one-slide-per-page format. */
@media print {
  .topbar, .sidebar, .sidebar-backdrop, .skip-link, .deck-nav,
  .site-header, .site-footer, .print-footer { display: none !important; }
  html, body, body.has-chrome { padding: 0 !important; margin: 0 !important; background: #fff; color: #000; }
  .site-main { margin: 0 !important; min-height: 0 !important; }
  a { color: #000; text-decoration: underline; }
  .card, .stat, .table-wrap { box-shadow: none; border-color: #ccc; }
  /* Let long tables break between rows so pages fill (no big blank bands).
     The bordered/rounded wrapper resists fragmenting, so flatten it in print. */
  .table-wrap { overflow: visible !important; border: none !important; border-radius: 0 !important; }
  .table-wrap table { overflow: visible !important; }
  table { break-inside: auto; }   /* table breaks between rows; tr stays whole (above) */

  /* Page-break discipline: never split an ATOMIC visual element across a page
     boundary — but let CONTAINERS (.card, dl) flow and break BETWEEN their child
     blocks so pages fill instead of stranding a tall box on the next page.
     (Same principle as tables breaking between rows.) */
  .stat, .metric-card, .keystone, .pullquote, figure, .slide-chart, .slide-illus,
  .nav-card, .banner, blockquote, .map-legend li, img {
    break-inside: avoid !important; page-break-inside: avoid !important;
  }
  /* Containers flow; drop the box edge so a between-child break shows no cut border. */
  .card, dl, dd { break-inside: auto !important; page-break-inside: auto !important; }
  thead { display: table-header-group; }   /* repeat the table header on each page */
  tfoot { display: table-footer-group; }
  h1, h2, h3, h4 { break-inside: avoid; }   /* keep a heading whole; do NOT force-glue to next block (caused half-blank pages) */
  p, li { orphans: 3; widows: 3; }
  img, figure img, .slide-chart svg { max-width: 100% !important; }

  /* Deck pages: the slides speak for themselves — no intro, one slide per page, never split */
  body.deck-page .container > .pill,
  body.deck-page .container > h1,
  body.deck-page .container > .lede { display: none !important; }
  .deck { max-width: none !important; margin: 0 !important; }
  .slide {
    page-break-after: always; break-after: page; page-break-inside: avoid; break-inside: avoid;
    width: auto !important; max-width: none !important; aspect-ratio: auto !important; overflow: visible !important;
    min-height: auto !important; height: auto; box-shadow: none !important; border: none !important;
    border-top: 4px solid #0D9488 !important; border-radius: 0 !important; margin: 0 !important;
    padding: 0 0 6mm !important; justify-content: flex-start; background: #fff !important;
  }
  .slide:last-child { page-break-after: avoid; break-after: auto; }
  .slide-img { max-height: 78mm; }
  /* Keep each slide + its brand foot on ONE page: reclaim bottom padding and
     compact the foot so a content-heavy slide (e.g. s1) doesn't tip the foot
     onto an otherwise-empty page. */
  .slide { padding-bottom: 0 !important; }
  .slide__foot { padding-top: 6px !important; margin-top: 8px !important; }
  .slide--split .slide__foot { grid-column: 1 / -1; }   /* foot spans full width, not one grid cell */
  .slide--split .slide-img, .slide__col-media img { max-height: 64mm; }
  /* Cap the oversized print title heights so a content-heavy slide + its brand
     foot fit ONE page (s1's 54px title was tipping the foot onto an empty page). */
  .slide h2.big { font-size: 32px !important; line-height: 1.15 !important; }
  #s1 h2.big { font-size: 36px !important; }
  /* Match the doc pages' header blank space: 22mm top on every slide too. */
  @page { size: A4 portrait; margin: 22mm 16mm 16mm 16mm; }
}

/* ---------- Pitch deck ---------- */
.deck { max-width: 1080px; margin: 0 auto; }
.deck-progress { font-size: 12.5px; color: var(--text-muted); }
.deck-nav .btn:disabled { opacity: .3; cursor: default; pointer-events: none; }
.slide {
  position: relative;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow);
  /* PowerPoint 16:9 (widescreen) — best-fit to the visible main frame below the topbar */
  width: min(100%, calc((100vh - var(--topbar-h) - 56px) * 16 / 9));
  max-width: 1080px; aspect-ratio: 16 / 9; margin: 0 auto 24px;
  padding: clamp(18px, 2.8vh, 40px) clamp(26px, 3.4vw, 56px);
  display: flex; flex-direction: column; justify-content: center;
  /* 16:9 is the baseline size; a content-heavy slide grows rather than clipping. */
}
.slide__kicker { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px; }
.slide__num { display: none; }  /* per-slide page x/y removed; deck-nav shows the count */

/* Split layout: text left, image right (slides 1-4) */
.slide--split { display: grid; grid-template-columns: 1.05fr 0.95fr; column-gap: clamp(22px, 3.2vw, 48px); align-items: center; }
.slide--split .slide__col-text { min-width: 0; }
.slide--split .slide__col-text > :first-child { margin-top: 0; }
.slide--split .slide__col-media { display: flex; align-items: center; justify-content: center; min-width: 0; }
.slide--split .slide__col-media img {
  width: 100%; max-width: 400px; height: auto; max-height: 64vh; object-fit: contain;
  border-radius: 16px; border: 1px solid var(--border);
  background: var(--surface); box-shadow: 0 8px 28px rgba(16,24,40,.10);
}
.slide--split .slide-illus { margin: 0 auto; max-width: 400px; }
@media (max-width: 720px) {
  .slide--split { grid-template-columns: 1fr; row-gap: 16px; }
  .slide--split .slide__col-media img { max-height: 40vh; }
}
@media print {
  .slide--split { grid-template-columns: 1.05fr 0.95fr !important; }
  .slide--split .slide__col-media img { max-height: 90mm; box-shadow: none; }
}
.slide h2 { font-size: 28px; border: none; margin: 0 0 16px; }
.slide h2.big { font-size: 34px; line-height: 1.2; }
.slide p { font-size: 16px; }
.slide ul { font-size: 15.5px; padding-left: 20px; }
.slide ul li { margin-bottom: 9px; }
.slide .lead { font-size: 19px; color: var(--text-muted); }
.slide__cards { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); margin-top: 8px; }

/* --- deck zing: stronger type, accent cues, hero title slide --- */
.slide { border-top: 4px solid var(--accent); }
.slide__kicker::before { content: ""; display: inline-block; width: 24px; height: 3px; border-radius: 2px;
  background: var(--accent); margin-right: 10px; vertical-align: middle; }
.slide h2 { font-size: 33px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.16; }
.slide h2.big { font-size: 46px; letter-spacing: -0.03em; }
.slide .lead { font-size: 20px; line-height: 1.5; color: var(--text); }
.slide p { font-size: 16.5px; line-height: 1.6; }
.slide__cards .stat { border-radius: 12px; padding: 18px; border-color: var(--border); }
.slide__cards .stat__value { font-size: 30px; font-weight: 800; color: var(--accent); line-height: 1.1; }
.slide__cards .stat__label { font-size: 12.5px; margin-top: 4px; }
.slide ul li strong { color: var(--text); }

/* ---------- Slide charts (N.DA8.5) — inline SVG, theme-reactive, print-safe ---------- */
.slide-chart { margin: 10px 0 4px; }
.slide-chart svg { display: block; width: 100%; height: auto; max-height: clamp(150px, 27vh, 300px); }
.slide-chart .ax { stroke: var(--border); stroke-width: 1; }
.slide-chart .grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; opacity: .8; }
.slide-chart .lbl { fill: var(--text-muted); font: 600 11px/1 var(--sans); }
.slide-chart .lbl-strong { fill: var(--text); font: 700 12px/1 var(--sans); }
.slide-chart .axis-title { fill: var(--text-muted); font: 700 10.5px/1 var(--sans); letter-spacing: .04em; text-transform: uppercase; }
.slide-chart .band { fill: var(--accent); opacity: .18; }
.slide-chart .band-edge { stroke: var(--accent); stroke-width: 2; }
.slide-chart .node { fill: var(--surface); stroke: var(--border); stroke-width: 1.5; }
.slide-chart .node-accent { fill: var(--accent); stroke: var(--accent); }
.slide-chart .node-txt { fill: var(--text); font: 700 12px/1 var(--sans); }
.slide-chart .node-txt-inv { fill: #fff; font: 700 12px/1 var(--sans); }
.slide-chart .node-sub { fill: var(--text-muted); font: 500 10.5px/1.25 var(--sans); }
.slide-chart .flow { stroke: var(--accent); stroke-width: 2; fill: none; marker-end: url(#arrow); }
.slide-chart .dot { fill: var(--text-muted); }
.slide-chart .dot-accent { fill: var(--accent); }
.slide-chart .seg-muted { fill: var(--border); }
.slide-chart__cap { font-size: 11.5px; color: var(--text-muted); margin: 6px 0 0; }
.map-legend { list-style: none; padding: 0; margin: 6px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 22px; font-size: 12px; line-height: 1.4; }
.map-legend li { color: var(--text-muted); }
.map-legend b { color: var(--text); }
.map-legend .key { display: inline-block; min-width: 16px; font-weight: 800; color: var(--accent); }

/* Keystone — the headline thesis callout (must read without hunting) */
.keystone { margin: 16px 0; padding: 18px 22px; border-left: 5px solid var(--accent);
  background: var(--brand-primary-tint, rgba(47,125,84,.10)); border-radius: 12px;
  font-size: 19px; line-height: 1.5; font-weight: 650; color: var(--text); }
.keystone strong { color: var(--accent); }
.slide .keystone { font-size: 20px; margin: 12px 0; }
@media (max-width: 720px) { .keystone { font-size: 16.5px; padding: 14px 16px; } }

/* ---------- Slide illustrations (N.DA8.9 alt) — on-brand inline-SVG, theme-reactive ---------- */
.slide-illus { margin: 10px auto 2px; max-width: 400px; width: 100%; }
.slide-illus svg { display: block; width: 100%; height: auto; max-height: clamp(120px, 21vh, 210px); }
.slide-illus .ln { stroke: var(--text); stroke-width: 1.4; fill: none; opacity: .6; }
.slide-illus .ln-soft { stroke: var(--text); stroke-width: 1; fill: none; opacity: .32; }
.slide-illus .f-top { fill: var(--text); opacity: .06; }
.slide-illus .f-left { fill: var(--text); opacity: .14; }
.slide-illus .f-right { fill: var(--text); opacity: .22; }
.slide-illus .slab-top { fill: var(--accent); opacity: .15; }
.slide-illus .slab-side { fill: var(--accent); opacity: .30; }
.slide-illus .slab-edge { stroke: var(--accent); stroke-width: 1.6; fill: none; }
.slide-illus .seal { fill: var(--good); }
.slide-illus .flow2 { stroke: var(--accent); stroke-width: 1.7; fill: none; marker-end: url(#ar); }
.slide-illus .dot { fill: var(--text); opacity: .07; }
@media print { .slide-illus svg { max-height: 58mm; } }
@media print { .slide-chart svg { max-height: 72mm; } }

/* Opening slide reads like a title card */
#s1 { background: linear-gradient(155deg, var(--surface) 0%, var(--surface-2) 100%); }
#s1 h2.big { font-size: 54px; }
#s1 .slide__kicker { font-size: 14px; }
@media (max-width: 720px) {
  .slide { padding: 28px 20px; min-height: auto; width: 100%; max-width: none; aspect-ratio: auto; overflow: visible; }
  .slide h2 { font-size: 23px; }
  .slide h2.big { font-size: 26px; }
  .slide__cards { grid-template-columns: 1fr; }
}
.deck-nav {
  position: sticky; bottom: var(--footer-h); display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 0; background: linear-gradient(180deg, transparent, var(--bg) 40%);
}

/* ===================================================================
   Application chrome — top bar + collapsible sidebar + search (app.js)
   =================================================================== */
body.has-chrome { padding-top: var(--topbar-h); padding-bottom: var(--footer-h); }

/* Top bar */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h); z-index: 50;
  display: flex; align-items: center; gap: 14px; padding: 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(16,24,40,.02);
}
.topbar__burger {
  flex: 0 0 auto; width: 38px; height: 38px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); border-radius: 9px; cursor: pointer;
  font-size: 16px; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
}
.topbar__burger:hover { border-color: var(--accent); color: var(--accent); }
.topbar__brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex: 0 0 auto; }
.topbar__brand img { border-radius: 6px; }
.topbar__title { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.topbar__sub { color: var(--text-muted); font-weight: 600; }
.topbar__search { position: relative; flex: 1 1 auto; max-width: 460px; margin: 0 auto 0 8px; }
.topbar__search-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 15px; pointer-events: none; }
#siteSearch {
  width: 100%; height: 40px; padding: 0 12px 0 34px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface-2); color: var(--text); font-size: 14px; font-family: var(--sans);
}
#siteSearch:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-primary-tint, rgba(79,70,229,.12)); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
  max-height: 60vh; overflow-y: auto; z-index: 60;
}
.search-result { display: flex; flex-direction: column; gap: 2px; padding: 9px 11px; border-radius: 8px; cursor: pointer; }
.search-result:hover, .search-result.is-active { background: var(--surface-2); }
.search-result__t { font-size: 14px; font-weight: 600; color: var(--text); }
.search-result__u { font-size: 11.5px; color: var(--text-muted); }
.topbar__actions { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  border-radius: 9px; cursor: pointer; font-size: 15px; text-decoration: none; font-weight: 600;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.logout-btn .logout-label, .print-btn .print-label { font-size: 13px; }
.print-btn svg { display: block; }
.logout-btn:hover { border-color: var(--bad); color: var(--bad); }

/* Platform quick-links (header) — mirror of the sidebar Platform group */
.topbar__links { flex: 0 0 auto; display: flex; align-items: center; gap: 2px; }
.topbar__links a {
  display: inline-flex; align-items: center; height: 30px; padding: 0 9px; border-radius: 7px;
  color: var(--text-muted); text-decoration: none; font-size: 12.5px; font-weight: 600;
}
.topbar__links a:hover { color: var(--accent); background: var(--surface-2); }
@media (max-width: 1080px) { .topbar__links { display: none; } }

/* Sidebar */
.sidebar {
  position: fixed; top: var(--topbar-h); bottom: var(--footer-h); left: 0; width: var(--sidebar-w); z-index: 40;
  display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--border);
  overflow-y: auto; transition: width .18s ease, transform .2s ease;
}
.sidebar__nav { padding: 14px 0; display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; }
.sidebar__link {
  display: flex; align-items: center; gap: 13px; padding: 11px 18px; text-decoration: none;
  color: var(--text-muted); font-size: 14.5px; font-weight: 500; border-left: 3px solid transparent; white-space: nowrap;
}
.sidebar__link:hover { color: var(--text); background: var(--surface-2); }
.sidebar__link.active { color: var(--accent); background: var(--brand-primary-tint, rgba(13,148,136,.08)); border-left-color: var(--accent); font-weight: 600; }
.sidebar__ico { flex: 0 0 22px; text-align: center; font-size: 15px; }
.sidebar__group { padding: 12px 18px 4px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.sidebar__nav--platform { flex: 0 0 auto; padding: 2px 0 8px; border-top: 1px solid var(--border); }
.sidebar__link--ext .ext-mark { color: var(--text-muted); font-size: 11px; font-weight: 500; }
.sidebar__link--ext:hover { color: var(--accent); }
body.sidebar-collapsed .sidebar__group, body.sidebar-collapsed .ext-mark { display: none; }
.sidebar__foot { padding: 14px 18px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-muted); }

/* Content offset for the fixed sidebar */
body.has-chrome .site-main { margin-left: var(--sidebar-w); transition: margin-left .18s ease; }
body.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
body.sidebar-collapsed .sidebar__label { display: none; }
body.sidebar-collapsed .sidebar__link { justify-content: center; padding: 11px 0; gap: 0; }
body.sidebar-collapsed .site-main { margin-left: var(--sidebar-w-collapsed); }

/* Mobile: off-canvas drawer */
.sidebar-backdrop { display: none; position: fixed; inset: var(--topbar-h) 0 var(--footer-h) 0; background: rgba(8,12,20,.45); z-index: 39; }
@media (max-width: 860px) {
  .topbar__sub { display: none; }
  .topbar__search { max-width: none; }
  .logout-btn .logout-label, .print-btn .print-label { display: none; }
  .sidebar { transform: translateX(-100%); width: var(--sidebar-w); box-shadow: var(--shadow); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { display: block; }
  body.has-chrome .site-main, body.sidebar-collapsed .site-main { margin-left: 0; }
  body.sidebar-collapsed .sidebar__label { display: inline; }
  body.sidebar-collapsed .sidebar__link { justify-content: flex-start; padding: 11px 18px; gap: 13px; }
}
@media (max-width: 520px) {
  #siteSearch::placeholder { color: transparent; }
  .topbar { gap: 8px; padding: 0 10px; }
}

/* ===================================================================
   One-view dashboard cards (results.html)
   =================================================================== */
.dash { display: grid; gap: 14px; grid-template-columns: repeat(4, 1fr); grid-auto-rows: min-content; }
.metric-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px;
}
.metric-card .metric-value { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.metric-card .metric-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.metric-card .metric-sub { font-size: 12.5px; color: var(--text-muted); }
.metric-card.accent { border-color: var(--accent); }
.metric-card.gap { border-color: var(--warn); }
.dash-chart { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); }
.dash-chart h3 { margin: 0 0 2px; font-size: 14px; }
.dash-chart .chart-box { position: relative; }
.dash-span-2 { grid-column: span 2; }
.dash-span-4 { grid-column: span 4; }
@media (max-width: 900px) { .dash { grid-template-columns: repeat(2, 1fr); } .dash-span-2, .dash-span-4 { grid-column: span 2; } }
@media (max-width: 520px) { .dash { grid-template-columns: 1fr; } .dash-span-2, .dash-span-4 { grid-column: span 1; } }

/* Expandable comment cards (accordion — one open at a time) */
.accordion { display: flex; flex-direction: column; gap: 8px; }
.acc-item { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; }
.acc-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: none; border: none; cursor: pointer; text-align: left; font: inherit; color: var(--text); }
.acc-head:hover { background: var(--surface-2); }
.acc-head__role { font-weight: 600; font-size: 14px; }
.acc-head__meta { font-size: 12.5px; color: var(--text-muted); }
.acc-head__chev { margin-left: auto; transition: transform .18s; color: var(--text-muted); font-size: 13px; }
.acc-item.open .acc-head__chev { transform: rotate(90deg); }
.acc-panel { padding: 0 16px; max-height: 0; overflow: hidden; transition: max-height .22s ease, padding .22s ease; }
.acc-item.open .acc-panel { padding: 2px 16px 16px; max-height: 800px; }
.acc-panel h4 { margin: 12px 0 3px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.acc-panel p { margin: 0; font-size: 14px; white-space: pre-wrap; line-height: 1.55; }
.rec-pill { font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 999px; flex: 0 0 auto; }
.rec-Pursue { background: rgba(47,125,84,.14); color: var(--good); }
.rec-Hold { background: rgba(138,109,27,.16); color: var(--warn); }
.rec-Pass { background: rgba(184,59,59,.14); color: var(--bad); }

/* Glossary definition list */
dl.glossary { margin: 8px 0 0; }
dl.glossary dt { font-weight: 700; margin-top: 14px; color: var(--text); }
dl.glossary dd { margin: 3px 0 0; padding-left: 0; font-size: 14px; color: var(--text-muted); line-height: 1.55; }

/* Generated concept image on a pitch slide */
.slide-img { display: block; width: 100%; max-width: 340px; max-height: clamp(78px, 15vh, 156px); object-fit: contain;
  margin: 12px auto 0; border: 1px solid var(--border); border-radius: 12px; background: #f8f9fa; padding: 5px; }

.print-footer { display: none; }

/* In-page jump navigation (clarity reorg — leads with focus, groups context) */
.jump-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 18px 0 26px;
  padding: 12px 16px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 10px;
  background: var(--surface-2); font-size: 13.5px; }
.jump-nav strong { color: var(--text); }
.jump-nav a { color: var(--accent); text-decoration: none; font-weight: 600; }
.jump-nav a:hover { text-decoration: underline; }
.jump-nav__sep { color: var(--text-muted); font-weight: 600; }

/* Per-slide brand footer — small CODITECT mark + confidentiality line */
.slide__foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 12px;
  border-top: 1px solid var(--border); font-size: 10.5px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-muted); }
.slide__logo { width: 18px; height: 18px; opacity: .92; flex: 0 0 auto; }

/* Sidebar group headers (IA: external / internal / reference) */
.sidebar__group { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted); padding: 14px 16px 4px; opacity: .8; }
body.sidebar-collapsed .sidebar__group { padding-left: 0; text-align: center; font-size: 8px; }
