/* Avanti Knowledge Library — Avanti brand palette (black / white / champagne gold) */
:root {
  /* Avanti Black */
  --black: #0B0B0B;
  --black-soft: #1A1A1A;    /* Soft Charcoal — when pure black feels too harsh */
  --black-deep: #000000;
  --ink: #18181b;
  --ink-soft: #5a5a62;
  --muted: #5a5a62;         /* Alias of --ink-soft — several pages reference var(--muted); keep them in one gray */

  /* Champagne Gold — light, restrained, premium */
  --gold: #D9B76A;          /* Primary Digital Gold — borders & accents */
  --gold-soft: #E0C27A;     /* Lighter Champagne Gold — on dark backgrounds */
  --gold-deep: #8A6A2B;     /* Deep gold for TEXT/labels — WCAG-AA readable on white/ivory */

  /* Backgrounds */
  --bg: #F7F3EA;            /* Soft Warm Ivory */
  --card: #FFFFFF;
  --line: #E6E0D2;
  --line-soft: #EFEAE0;
  --platinum: #D8D5CE;      /* Light Platinum Gray */

  --radius: 4px;
  --shadow: 0 1px 2px rgba(11,11,11,.06), 0 8px 24px rgba(11,11,11,.08);

  /* Headlines: editorial serif. Body: clean modern sans. */
  --font-serif: 'Cormorant Garamond', 'Source Serif Pro', 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--black); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .15s; }
a:hover { color: var(--gold-deep); border-bottom-color: var(--gold); text-decoration: none; }

/* Skip-to-content (keyboard a11y) — off-screen until focused, injected by header.js */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 200; background: var(--black); color: #fff; padding: 10px 16px; border-bottom: 2px solid var(--gold); border-radius: 0 0 var(--radius) 0; }
.skip-link:focus { left: 0; }

/* Header */
.site-header { background: var(--black); color: #fff; padding: 0 24px; position: sticky; top: 0; z-index: 100; border-bottom: 2px solid var(--gold); }
.site-header .row { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 24px; padding: 14px 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; font-weight: 700; letter-spacing: 0.02em; color: #fff; border: none; }
.brand:hover { color: var(--gold-soft); border: none; }
.brand-mark { display: inline-flex; width: 42px; height: 42px; }
.brand-mark img { width: 100%; height: 100%; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; font-family: var(--font-serif); font-weight: 700; }
.brand-text small { color: var(--gold-soft); font-weight: 400; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; font-family: var(--font-sans); margin-top: 2px; }
.nav { display: flex; gap: 20px; flex: 1; flex-wrap: wrap; align-items: center; font-family: var(--font-serif); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
.nav a { color: rgba(255,255,255,.85); font-size: 13px; padding: 6px 0; border: none; }
.nav a:hover, .nav a.active { color: var(--gold-soft); border-bottom: 2px solid var(--gold); padding-bottom: 4px; }

/* Carrier Tools dropdown */
.nav-drop { position: relative; display: inline-flex; }
.nav-drop-btn { background: transparent; border: none; color: rgba(255,255,255,.85); font-family: var(--font-serif); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; padding: 6px 0; cursor: pointer; }
.nav-drop-btn:hover, .nav-drop-btn.active { color: var(--gold-soft); }
.nav-drop .caret { font-size: 10px; color: var(--gold); }
.nav-drop-menu { display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); min-width: 210px; background: var(--black); border-top: 2px solid var(--gold); box-shadow: 0 12px 32px rgba(0,0,0,.35); padding: 10px 0; z-index: 120; }
.nav-drop:hover .nav-drop-menu, .nav-drop.open .nav-drop-menu { display: block; }
.nav-drop-menu a { display: block; padding: 9px 20px; color: rgba(255,255,255,.85); font-size: 12px; white-space: nowrap; }
.nav-drop-menu a:hover, .nav-drop-menu a.active { color: var(--gold-soft); border: none; padding-bottom: 9px; background: rgba(217,183,106,.06); }
.user-chip { display: flex; align-items: center; gap: 10px; font-size: 13px; color: rgba(255,255,255,.8); }
.user-chip button { background: transparent; border: none; border-bottom: 1px solid transparent; color: rgba(255,255,255,.7); padding: 6px 14px; border-radius: 0; font-size: 12px; letter-spacing: 0.04em; cursor: pointer; }
.user-chip button:hover { background: transparent; color: var(--gold-soft); border-bottom-color: var(--gold); }

.wrap { max-width: 1280px; margin: 0 auto; padding: 28px 24px 80px; }

/* Hero */
.hero { background: var(--black); color: #fff; border-radius: var(--radius); padding: 64px 48px; margin-bottom: 28px; border-top: 4px solid var(--gold); border-right: 1px solid rgba(217,183,106,0.3); position: relative; overflow: hidden; }
.hero h1 { font-family: var(--font-serif); font-size: 44px; margin: 0 0 10px; font-weight: 700; letter-spacing: -0.01em; }
.hero p { margin: 0; color: rgba(255,255,255,.82); max-width: 720px; font-size: 16px; }
.hero .eyebrow { display: inline-block; color: var(--gold); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 14px; font-weight: 600; border-top: 1px solid var(--gold); padding-top: 18px; }

/* Stat strip */
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: -16px 0 32px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); position: relative; z-index: 2; }
.stat-strip .stat { text-align: center; padding: 6px 12px; border-right: 1px solid var(--line); }
.stat-strip .stat:last-child { border-right: none; }
.stat-strip .stat .n { font-family: var(--font-serif); font-size: 28px; font-weight: 700; color: var(--black); line-height: 1; }
.stat-strip .stat .l { font-size: 11px; color: var(--ink-soft); letter-spacing: 0.1em; text-transform: uppercase; margin-top: 6px; }

/* Search shell */
.search-shell { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 28px; border: 1px solid var(--line); }
.search-row { display: flex; gap: 10px; flex-wrap: wrap; }
.search-input { flex: 1; min-width: 280px; font-size: 16px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); outline: none; font-family: inherit; transition: all .15s; }
.search-input:focus { border-color: var(--black); background: #fff; box-shadow: 0 0 0 3px rgba(217,183,106,.35); }
.btn { background: var(--black); color: #fff; border: none; padding: 13px 22px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; letter-spacing: 0.02em; transition: all .15s; }
.btn:hover { background: var(--black-deep); transform: translateY(-1px); }
.btn-gold { background: var(--gold); color: var(--black); }
.btn-gold:hover { background: var(--gold-deep); color: #fff; }
.btn-ghost { background: transparent; color: var(--black); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--card); border-color: var(--black); }
.search-hint { font-size: 12px; color: var(--ink-soft); margin-top: 12px; }
.search-results { margin-top: 18px; max-height: 480px; overflow-y: auto; }
.search-result { padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 6px; display: block; color: var(--ink); border-left: 2px solid transparent; transition: all .12s; }
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: var(--bg); border-left-color: var(--gold); text-decoration: none; }
.search-result h4 { margin: 0 0 4px; font-size: 15px; font-family: var(--font-serif); color: var(--black); }
.search-result p { margin: 0; font-size: 13px; color: var(--ink-soft); }
.search-result .badge { display: inline-block; font-style: italic; color: var(--ink-soft); background: transparent; padding: 0; border: none; font-size: 11px; margin-right: 8px; margin-top: 6px; }
.search-result mark { background: var(--gold-soft); color: var(--black); padding: 0 2px; border-radius: 2px; }

/* Carrier Appetites */
.ca-h { font-family: var(--font-serif); font-size: 17px; margin: 26px 0 8px; }
.ca-h-good { color: #2a7d4f; }
.ca-h-bad { color: #b23b3b; }
.ca-list { margin: 0 0 8px; padding-left: 20px; }
.ca-list li { margin: 5px 0; font-size: 14px; color: var(--ink); line-height: 1.5; }

/* Status badges */
.status-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.status-published { background: var(--gold); color: var(--black); }
.status-knowledge { background: var(--black); color: #fff; }
.status-draft { background: var(--bg); color: var(--ink-soft); border: 1px solid var(--line); }
.status-upcoming { background: var(--line-soft); color: var(--ink-soft); }

.section-title { font-family: var(--font-serif); font-size: 22px; margin: 32px 0 16px; color: var(--black); display: flex; align-items: center; gap: 12px; font-weight: 700; }
.section-title::before { content: ''; width: 32px; height: 2px; background: var(--gold); display: inline-block; }

/* Category cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.cat-card { background: var(--card); border: none; border-left: 2px solid transparent; border-radius: 4px; padding: 28px 24px; cursor: pointer; transition: all 0.18s ease; display: block; color: var(--ink); }
.cat-card:hover { text-decoration: none; border-left-color: var(--gold); box-shadow: var(--shadow); }
.cat-card .eyebrow { display: block; font-family: var(--font-serif); font-style: italic; color: var(--gold-deep); font-size: 15px; letter-spacing: 0.02em; }
.cat-card h3 { margin: 8px 0 8px; font-family: var(--font-serif); font-size: 18px; color: var(--black); font-weight: 700; }
.cat-card p { margin: 0; font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.cat-card .count { display: inline-block; margin-top: 14px; font-style: italic; color: var(--ink-soft); background: transparent; padding: 0; border: none; font-size: 12px; }

/* Article list */
.article-list { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; }
.article-row { display: flex; align-items: flex-start; gap: 18px; padding: 18px 22px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); border-left: 3px solid transparent; transition: all .12s; }
.article-row:last-child { border-bottom: none; }
.article-row:hover { background: var(--bg); text-decoration: none; border-left-color: var(--gold); }
.article-row .meta-col { flex-shrink: 0; width: 120px; font-size: 12px; color: var(--ink-soft); }
.article-row h4 { margin: 0 0 6px; font-family: var(--font-serif); font-size: 17px; color: var(--black); font-weight: 600; }
.article-row .excerpt { margin: 0; font-size: 13px; color: var(--ink-soft); }
.article-row .tags { margin-top: 8px; }
.tag-pill { display: inline-block; font-style: italic; color: var(--ink-soft); background: transparent; padding: 0; border: none; font-size: 12px; margin-right: 10px; }
.article-row .byline { margin-top: 8px; font-family: var(--font-serif); font-style: italic; color: var(--ink-soft); font-size: 13px; }

/* Article view */
.article-view { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); padding: 48px 56px; max-width: 820px; margin: 0 auto; }
.article-view h1 { font-family: var(--font-serif); color: var(--black); font-size: 32px; margin: 0 0 12px; line-height: 1.2; font-weight: 700; }
.article-view h2 { font-family: var(--font-serif); color: var(--black); font-size: 22px; margin: 32px 0 14px; }
.article-view h3 { font-family: var(--font-serif); color: var(--black); font-size: 18px; margin: 24px 0 10px; }
.article-view p { font-size: 16px; line-height: 1.75; margin: 0 0 16px; }
.article-view .article-meta { color: var(--ink-soft); font-size: 13px; margin-bottom: 28px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.article-view ul, .article-view ol { padding-left: 24px; margin: 0 0 16px; }
.article-view li { margin-bottom: 6px; }
.article-view strong { color: var(--black); }
.article-view code { background: var(--bg); padding: 2px 6px; border-radius: 4px; font-size: 14px; border: 1px solid var(--line); }
.article-view blockquote { border-left: 3px solid var(--gold); margin: 16px 0; padding: 4px 18px; color: var(--ink); background: var(--bg); border-radius: 0 4px 4px 0; }
.article-view a { color: var(--black); border-bottom: 1px solid var(--gold); }
.article-view a:hover { color: var(--gold-deep); }
.article-view table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14px; }
.article-view th, .article-view td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.article-view th { background: var(--black); color: #fff; }
/* Wraps wide markdown tables so they scroll inside their own box instead of
   forcing the whole page to scroll sideways on mobile (JS-injected in article/reference). */
.table-scroll { overflow-x: auto; margin: 18px 0; }
.table-scroll > table { margin: 0; }

/* Data tables */
/* These long directory tables live inside a .data-scroll box (below) so they
   scroll both ways within their own container; the sticky th pins to the top of
   that box (top:0), keeping column headers visible as you scroll the list. */
.data-table { width: 100%; background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); border-collapse: separate; border-spacing: 0; }
.data-table th { background: var(--black); color: #fff; text-align: left; padding: 12px 14px; font-size: 13px; font-weight: 600; letter-spacing: 0.02em; position: sticky; top: 0; z-index: 2; }
/* Scroll container for wide/long data tables: horizontal scroll on mobile +
   a capped height so the sticky header actually pins (a plain overflow-x wrapper
   makes the box a scroll container and silently defeats viewport-level sticky). */
.data-scroll { overflow: auto; max-height: calc(100vh - 190px); border-radius: var(--radius); }
.data-table thead th:first-child { border-top-left-radius: var(--radius); }
.data-table thead th:last-child { border-top-right-radius: var(--radius); }
.data-table tbody tr:last-child td:first-child { border-bottom-left-radius: var(--radius); }
.data-table tbody tr:last-child td:last-child { border-bottom-right-radius: var(--radius); }
.data-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg); }
.table-controls { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.table-filter { flex: 1; min-width: 220px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.last-synced { font-size: 12px; color: var(--ink-soft); margin-top: 12px; }
.last-synced::before { content: '↻ '; color: var(--gold); }

/* Chat widget */
.chat-fab { position: fixed; bottom: 22px; right: 22px; background: var(--gold); color: var(--black); width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; border: none; box-shadow: 0 8px 24px rgba(10,10,10,.3); font-size: 26px; z-index: 50; transition: all .2s; }
.chat-fab:hover { background: var(--black); color: var(--gold); transform: scale(1.05); }
.chat-panel { position: fixed; bottom: 22px; right: 22px; width: 440px; max-width: calc(100vw - 44px); height: 620px; max-height: calc(100vh - 80px); background: var(--card); border-radius: var(--radius); box-shadow: 0 16px 48px rgba(10,10,10,.25); display: none; flex-direction: column; z-index: 60; border: 1px solid var(--line); overflow: hidden; }
.chat-panel.open { display: flex; }
.chat-header { background: var(--black); color: #fff; padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--gold); }
.chat-header h3 { margin: 0; font-size: 15px; font-family: var(--font-serif); font-weight: 700; }
.chat-header small { display: block; font-size: 11px; color: var(--gold-soft); letter-spacing: 0.05em; }
.chat-header button { background: transparent; border: none; color: #fff; font-size: 22px; cursor: pointer; line-height: 1; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--bg); }
.chat-msg { max-width: 90%; padding: 11px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.chat-msg.user { align-self: flex-end; background: var(--black); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.bot { align-self: flex-start; background: var(--card); color: var(--ink); border-bottom-left-radius: 4px; border: 1px solid var(--line); }
.chat-msg.bot .sources { margin-top: 10px; font-size: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.chat-msg.bot .sources strong { color: var(--gold-deep); }
.chat-msg.bot .sources a { display: block; color: var(--black); margin-top: 4px; border-bottom: 1px solid var(--gold); width: fit-content; }
.chat-msg.thinking { color: var(--ink-soft); font-style: italic; }
.chat-input-row { padding: 12px 14px; border-top: 1px solid var(--line); display: flex; gap: 8px; background: var(--card); }
.chat-input { flex: 1; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-family: inherit; resize: none; max-height: 100px; }
.chat-input:focus { outline: none; border-color: var(--black); box-shadow: 0 0 0 3px rgba(217,183,106,.35); }
.chat-send { background: var(--gold); color: var(--black); border: none; border-radius: 8px; padding: 0 16px; font-weight: 700; cursor: pointer; }
.chat-send:hover { background: var(--black); color: var(--gold); }
.chat-send:disabled { opacity: 0.5; cursor: not-allowed; }
.chat-suggestions { padding: 0 14px 12px; display: flex; flex-direction: column; gap: 6px; background: var(--bg); }
.chat-suggestion { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 13px; cursor: pointer; text-align: left; color: var(--black); }
.chat-suggestion:hover { background: var(--bg); border-color: var(--gold); }

/* Identity gate */
.gate { display: flex; align-items: center; justify-content: center; min-height: 70vh; }
.gate-card { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--gold); border-radius: var(--radius); padding: 48px; max-width: 460px; text-align: center; box-shadow: var(--shadow); }
.gate-card .logo { width: 80px; height: 80px; margin: 0 auto 16px; }
.gate-card h1 { font-family: var(--font-serif); color: var(--black); margin: 0 0 8px; }
.gate-card p { color: var(--ink-soft); }

/* Curriculum / First Year */
.curriculum-modules { display: grid; gap: 16px; }
.module-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; transition: all .15s; }
.module-card.completed { border-left: 4px solid var(--gold); }
.module-card.in-progress { border-left: 4px solid var(--black); }
.module-card h2 { font-family: var(--font-serif); margin: 0 0 6px; font-size: 22px; color: var(--black); display: flex; align-items: center; gap: 12px; }
.module-card .module-eyebrow { font-family: var(--font-serif); font-style: italic; color: var(--gold-deep); font-size: 15px; letter-spacing: 0.02em; margin-bottom: 2px; }
.module-card .module-meta { color: var(--ink-soft); font-size: 13px; margin-bottom: 14px; }
.module-card .module-desc { color: var(--ink); font-size: 15px; margin-bottom: 16px; }
.lesson-list { background: var(--bg); border-radius: 8px; padding: 4px; }
.lesson-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 6px; cursor: pointer; color: var(--ink); transition: background .12s; }
.lesson-row:hover { background: var(--card); text-decoration: none; }
.lesson-row .lesson-num { font-family: var(--font-serif); font-style: italic; color: var(--gold-deep); font-size: 14px; min-width: 26px; flex-shrink: 0; text-align: right; }
.lesson-row.done .lesson-num { color: var(--gold); }
.lesson-row.done .lesson-title { color: var(--ink-soft); text-decoration: line-through; }
.lesson-row .lesson-title { flex: 1; font-size: 14px; font-weight: 500; color: var(--black); }
.lesson-row .lesson-meta { font-size: 11px; color: var(--ink-soft); font-style: italic; }
/* Progress quizzes / final exam interleaved into the module — visually set apart
   from the lessons with a gold wash and rule, so the checkpoint reads as an event. */
.lesson-row.checkpoint-row { background: rgba(217,183,106,.09); border-left: 2px solid var(--gold); margin: 4px 0; }
.lesson-row.checkpoint-row:hover { background: rgba(217,183,106,.16); }
.lesson-row.checkpoint-row .lesson-title { font-family: var(--font-serif); font-weight: 600; }
.lesson-row.checkpoint-row .lesson-meta { color: var(--gold-deep); font-weight: 600; font-style: normal; letter-spacing: .04em; text-transform: uppercase; }
.lesson-row.final-row { background: var(--black); border-left-color: var(--gold); }
.lesson-row.final-row:hover { background: var(--black-soft); }
.lesson-row.final-row .lesson-num, .lesson-row.final-row .lesson-title { color: #fff; }
.lesson-row.final-row .lesson-meta { color: var(--gold-soft); }
.module-progress { background: var(--line-soft); border-radius: 999px; height: 6px; overflow: hidden; margin-top: 8px; }
.module-progress-bar { height: 100%; background: var(--gold); transition: width .3s ease; }

.footer { max-width: 1280px; margin: 40px auto 0; padding: 24px 24px 28px; border-top: 1px solid var(--gold); font-family: var(--font-serif); font-style: italic; font-size: 13px; color: var(--ink-soft); text-align: center; }

/* Editorial section labels + Ask AI text button */
.tier-label { font-family: var(--font-serif); font-style: italic; font-size: 19px; font-weight: 500; color: var(--ink-soft); margin: 0 0 16px; }
.btn-askai { background: transparent; border: none; border-bottom: 1px solid var(--gold); border-radius: 0; color: var(--gold-deep); padding: 13px 6px; font-size: 14px; font-weight: 600; letter-spacing: 0.02em; cursor: pointer; transition: all .15s; }
.btn-askai:hover { color: var(--black); border-bottom-color: var(--gold-deep); }

/* Meeting Prep */
.mp-opt { border-left: 2px solid transparent; }
.dossier { background: var(--card); border-radius: var(--radius); border-top: 4px solid var(--gold); padding: 48px 56px; max-width: 860px; margin: 0 auto; box-shadow: var(--shadow); }
.dossier .eyebrow { font-family: var(--font-serif); font-style: italic; color: var(--gold-deep); font-size: 15px; display: block; }
.mp-headline { font-family: var(--font-serif); font-size: 34px; margin: 6px 0 18px; color: var(--black); line-height: 1.2; }
.mp-brief p { font-size: 15.5px; line-height: 1.7; }
.mp-list { padding-left: 22px; margin: 0 0 8px; }
.mp-list li { margin: 8px 0; font-size: 15px; line-height: 1.55; }
.mp-note { font-family: var(--font-serif); font-style: italic; color: var(--ink-soft); font-size: 14px; }
.mp-print-tip { font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; margin: 0 0 18px; padding-left: 12px; border-left: 2px solid var(--gold); }

/* A gate on a conditional ask — e.g. loss runs/dec pages only exist if the
   business is established. Loud enough that nobody asks a startup for them. */
.mp-cond { font-size: 13px; font-weight: 600; color: var(--gold-deep); background: rgba(217,183,106,.10);
  border-left: 2px solid var(--gold); padding: 8px 12px; margin: 0 0 10px; border-radius: 0 var(--radius) var(--radius) 0; }

/* Account-setup fields — a labelled blank the agent fills in, on screen and on paper */
.mp-fields { margin: 4px 0 8px; }
.mp-fieldhead { font-family: var(--font-serif); font-size: 16px; font-weight: 700; color: var(--black); margin: 18px 0 6px; }
.mp-fieldhead .mp-count { font-family: var(--font-sans); font-style: italic; font-weight: 400; font-size: 12.5px; color: var(--ink-soft); margin-left: 8px; }
.mp-fieldlist { list-style: none; padding: 0; margin: 0; }
.mp-fieldlist li { display: flex; align-items: baseline; gap: 10px; padding: 9px 0; font-size: 14.5px; break-inside: avoid; page-break-inside: avoid; }
.mp-fieldlist li > span { flex: 0 0 auto; color: var(--ink); }
.mp-fieldlist li::after { content: ''; flex: 1 1 auto; border-bottom: 1px solid var(--line); transform: translateY(-3px); }
.mp-carrier { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; line-height: 1.6; }
.mp-carrier:last-of-type { border-bottom: none; }
.mp-actions { display: flex; gap: 10px; justify-content: flex-end; margin-bottom: 8px; }
/* Collapsible dossier sections — turns a long quote-ready checklist into a
   scannable accordion (first industry section open; the rest tap to expand). */
.mp-section { border-top: 1px solid var(--line); }
.mp-section summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 0; font-weight: 600; color: var(--ink); font-size: 15px; }
.mp-section summary::-webkit-details-marker { display: none; }
.mp-section summary::after { content: '+'; color: var(--gold-deep); font-size: 20px; line-height: 1; flex-shrink: 0; }
.mp-section[open] summary::after { content: '\2212'; }
.mp-section summary:hover { color: var(--gold-deep); }
.mp-section .mp-count { margin-left: auto; margin-right: 6px; font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--ink-soft); font-size: 13px; }
.mp-section .mp-list { padding-bottom: 10px; margin-top: 0; }

/* ---- Printed dossier -------------------------------------------------------
   An agent carries this into a meeting, so it should read like the Residential
   Risk Audit / Business Risk Diagnostic, not like a web page with the nav
   removed. Borrows that deliverable's vocabulary: serif throughout, gold rule
   with a centre diamond, letter-spaced small-caps labels, and "§ N" section
   numbers in gold italic.
   NOTE: the date/URL/page number in the page corners is the BROWSER's print
   header — no CSS can remove it. Untick "Headers and footers" in the print
   dialog (the .mp-print-tip on screen says so). */
@media print {
  @page { margin: 0.6in; }

  .site-header, .hero, .mp-wizard, .mp-actions, .chat-fab, .chat-panel, .footer,
  .mp-print-tip, .crumb { display: none !important; }
  body { background: #fff; color: #1A1A1A; }
  .wrap { padding: 0; max-width: 100%; }
  #mpDossier { margin-top: 0 !important; }

  .dossier {
    box-shadow: none; border: none; border-radius: 0;
    padding: 0; max-width: 100%; background: #fff;
  }

  /* Masthead — the deliverable's cover language, compressed to a page header */
  .dossier::before {
    content: 'T H E   A V A N T I   G R O U P';
    display: block; text-align: center;
    font-family: var(--font-serif); font-size: 11pt; letter-spacing: .06em;
    color: #101418; padding-bottom: 6pt;
  }
  .dossier .eyebrow {
    display: block; text-align: center;
    font-family: var(--font-serif); font-style: italic;
    font-size: 9.5pt; letter-spacing: .18em; text-transform: uppercase;
    color: #B89B5E;
    border-top: 0.8pt solid #B89B5E;
    padding-top: 7pt; margin-top: 0;
    position: relative;
  }
  /* the gold rule's centre diamond */
  .dossier .eyebrow::before {
    content: ''; position: absolute; top: -3.2pt; left: 50%;
    width: 6pt; height: 6pt; margin-left: -3pt;
    background: #B89B5E; transform: rotate(45deg);
  }
  .mp-headline {
    font-family: var(--font-serif); font-size: 22pt; font-weight: 700;
    text-align: center; color: #101418;
    margin: 10pt 0 4pt; line-height: 1.15;
  }

  /* Sections — "§ N" in gold italic above a serif title, as in the RRA/BRD */
  .mp-section > *:not(summary) { display: block !important; }  /* expand collapsed sections */
  .mp-section summary::after, .mp-section .mp-count { display: none; }
  .mp-section {
    border-top: 0.5pt solid #EDE8DC;
    counter-increment: mpsec;
    break-inside: auto; page-break-inside: auto;
  }
  .dossier { counter-reset: mpsec; }
  .mp-section summary {
    font-family: var(--font-serif); font-size: 13.5pt; font-weight: 700;
    color: #101418; padding: 12pt 0 2pt; display: block;
    break-after: avoid; page-break-after: avoid;
  }
  .mp-section summary::before {
    content: '§ ' counter(mpsec);
    display: block;
    font-style: italic; font-weight: 400; font-size: 9.5pt;
    color: #B89B5E; margin-bottom: 1pt;
  }
  .section-title { break-after: avoid; page-break-after: avoid; }

  .mp-list li, .mp-section li {
    font-size: 10.5pt; line-height: 1.45; color: #1A1A1A;
    margin: 5pt 0;
    break-inside: avoid; page-break-inside: avoid;
  }
  .dossier a { border-bottom: none; color: #1A1A1A; text-decoration: none; }
  .article-list, .article-row { border: none; }
  .mp-note {
    font-family: var(--font-serif); font-style: italic;
    font-size: 9pt; color: #6B6B66;
    border-top: 0.5pt solid #EDE8DC; padding-top: 8pt;
  }

  /* Account-setup fields print as real blanks — this page gets filled in by hand
     whether or not worksheet mode is on, so the rules are always there. */
  .mp-fieldhead {
    font-family: var(--font-serif); font-size: 11.5pt; color: #101418;
    margin: 12pt 0 2pt; break-after: avoid; page-break-after: avoid;
  }
  .mp-fieldhead .mp-count { font-size: 8.5pt; color: #6B6B66; }
  .mp-fieldlist li { padding: 11pt 0 2pt; font-size: 10.5pt; }
  .mp-fieldlist li::after { border-bottom: 0.5pt solid #6B6B66; }
  .mp-cond {
    font-size: 9.5pt; font-weight: 700; color: #A97B2F;
    background: #FAF7F0; border-left: 2pt solid #B89B5E;
    padding: 5pt 8pt; margin: 0 0 6pt; border-radius: 0;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
    break-inside: avoid; page-break-inside: avoid;
  }

  /* ---- Worksheet mode: ruled space to write answers in the meeting ----
     Off by default so the reading copy stays short. */
  .dossier.mp-worksheet .mp-section li {
    padding-bottom: 26pt;
    background-image: repeating-linear-gradient(
      to bottom, transparent, transparent 12pt, #D8D5CE 12pt, #D8D5CE 12.4pt);
    background-position: 0 calc(100% - 2pt);
    background-size: 100% 25pt;
    background-repeat: no-repeat;
  }
  .dossier.mp-worksheet .mp-notes-page {
    display: block !important;
    break-before: page; page-break-before: always;
  }
  .mp-notes-page { display: none; }
  .mp-notes-page h2 {
    font-family: var(--font-serif); font-size: 13.5pt; color: #101418;
    margin: 0 0 10pt;
  }
  .mp-notes-page .mp-rule {
    height: 25pt;
    background-image: repeating-linear-gradient(
      to bottom, transparent, transparent 24pt, #D8D5CE 24pt, #D8D5CE 24.4pt);
  }
}

/* Print furniture for articles — screen-hidden, paper-only.
   A printed article is handed to a CLIENT, so paper leads with the mark and the
   brand rule (the RRA/BRD cover language) and closes with attribution, rather
   than the internal-library chrome. */
.print-mast, .print-foot { display: none; }

@media print {
  @page { margin: 0.6in; }

  .site-header, .footer, .chat-fab, .chat-panel, .card-actions,
  .mp-print-tip, .crumb, .related, .read-time, .article-tags,
  .search-shell, .table-controls { display: none !important; }

  body { background: #fff; color: #1A1A1A; }
  .wrap { padding: 0; max-width: 100%; }

  .article-view {
    box-shadow: none; border: none; border-radius: 0;
    padding: 0; max-width: 100%; background: #fff;
  }

  /* Masthead: mark, letter-spaced wordmark, gold rule with centre diamond */
  .print-mast { display: block; text-align: center; margin: 0 0 14pt; }
  .print-mast .print-mark { width: 34pt; height: 34pt; display: inline-block; }
  .print-mast .print-brand {
    font-family: var(--font-serif); font-size: 10.5pt; letter-spacing: .06em;
    color: #101418; margin-top: 5pt;
  }
  .print-mast .print-rule {
    position: relative; height: 0;
    border-top: 0.8pt solid #B89B5E;
    margin: 9pt auto 0; width: 62%;
  }
  .print-mast .print-rule::after {
    content: ''; position: absolute; top: -3pt; left: 50%; margin-left: -3pt;
    width: 6pt; height: 6pt; background: #B89B5E; transform: rotate(45deg);
  }

  .article-view h1 {
    font-family: var(--font-serif); font-size: 21pt; font-weight: 700;
    color: #101418; text-align: center; line-height: 1.15;
    margin: 12pt 0 6pt;
  }
  .article-view .article-meta {
    text-align: center; border: none; color: #6B6B66;
    font-family: var(--font-serif); font-style: italic; font-size: 9.5pt;
    margin: 0 0 16pt; padding: 0;
  }
  .article-view h2 {
    font-family: var(--font-serif); font-size: 14pt; color: #101418;
    margin: 16pt 0 6pt; break-after: avoid; page-break-after: avoid;
  }
  .article-view h3 {
    font-family: var(--font-serif); font-size: 11.5pt; color: #101418;
    margin: 12pt 0 4pt; break-after: avoid; page-break-after: avoid;
  }
  .article-view p, .article-view li { font-size: 10.5pt; line-height: 1.5; }
  .article-view a { color: #1A1A1A; border-bottom: none; text-decoration: none; }
  .article-view blockquote {
    border-left: 2pt solid #B89B5E; background: #FAF7F0;
    color: #1A1A1A; padding: 6pt 12pt; break-inside: avoid;
  }
  .article-view table { font-size: 9.5pt; break-inside: avoid; page-break-inside: avoid; }
  .article-view th { background: #101418 !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .table-scroll { overflow: visible !important; }
  .article-view img { max-width: 100%; }

  /* Closing attribution */
  .print-foot {
    display: block; margin-top: 22pt; padding-top: 8pt;
    border-top: 0.8pt solid #B89B5E; text-align: center;
  }
  .print-foot-brand {
    font-family: var(--font-serif); font-size: 10pt; color: #101418; letter-spacing: .04em;
  }
  .print-foot-note {
    font-family: var(--font-serif); font-style: italic;
    font-size: 8.5pt; color: #6B6B66; margin-top: 3pt;
  }
}

/* ---- Practice questions (exam prep) --------------------------------------
   Pick an answer, get told, get the why. Options are real <button>s so they are
   keyboard- and screen-reader-native without any extra ARIA. */
.quiz { margin: 8px 0 0; }
.quiz-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  position: sticky; top: var(--header-h, 72px); z-index: 3;
  background: var(--card); border-bottom: 1px solid var(--line); padding: 10px 0; margin-bottom: 6px; }
.quiz-score { font-family: var(--font-serif); font-style: italic; font-size: 15px; color: var(--gold-deep); }
.quiz-list { list-style: none; padding: 0; margin: 0; counter-reset: quizn; }
.quiz-q { counter-increment: quizn; padding: 20px 0; border-bottom: 1px solid var(--line-soft); }
.quiz-q:last-child { border-bottom: none; }
.quiz-stem { font-size: 16px; line-height: 1.5; margin: 0 0 12px; color: var(--ink); font-weight: 500; }
.quiz-stem::before { content: counter(quizn) '. '; font-family: var(--font-serif); font-weight: 700; color: var(--gold-deep); }
.quiz-opts { display: flex; flex-direction: column; gap: 7px; }
.quiz-opt { display: flex; align-items: baseline; gap: 10px; width: 100%; text-align: left;
  font: inherit; font-size: 14.5px; line-height: 1.45; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 13px; cursor: pointer; transition: border-color .12s, background .12s; }
.quiz-opt:hover:not(:disabled) { border-color: var(--gold); background: var(--bg); }
.quiz-opt:disabled { cursor: default; }
.quiz-letter { font-family: var(--font-serif); font-weight: 700; color: var(--gold-deep); flex: 0 0 auto; }
.quiz-opt.is-correct { border-color: #3E6B4F; background: rgba(62,107,79,.07); }
.quiz-opt.is-correct .quiz-letter { color: #3E6B4F; }
.quiz-opt.is-wrong { border-color: #8E2F22; background: rgba(142,47,34,.06); }
.quiz-opt.is-wrong .quiz-letter { color: #8E2F22; }
.quiz-why { margin: 12px 0 0; padding: 12px 14px; background: var(--bg); border-left: 2px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0; }
.quiz-verdict { margin: 0 0 5px; font-weight: 700; font-size: 14px; }
.quiz-q.right .quiz-verdict { color: #3E6B4F; }
.quiz-q.wrong .quiz-verdict { color: #8E2F22; }
.quiz-explain { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink); }
.quiz-lesson { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--gold-deep); border-bottom: 1px solid var(--gold); }
.quiz-done { margin-top: 18px; padding: 16px 18px; border-top: 2px solid var(--gold); background: var(--bg);
  font-size: 15px; line-height: 1.6; }
.quiz-done strong { display: block; font-family: var(--font-serif); font-size: 20px; margin-bottom: 4px; }
/* Tone by band — green when they've cleared the bar, amber when it's back to the
   drawing board. Border/heading carry the signal; the message is always Rich's voice. */
.quiz-done--ace    { border-top-color: #3E6B4F; background: rgba(62,107,79,.06); }
.quiz-done--ace strong,
.quiz-done--pass strong   { color: #3E6B4F; }
.quiz-done--pass   { border-top-color: #3E6B4F; background: rgba(62,107,79,.05); }
.quiz-done--review { border-top-color: var(--gold); background: rgba(217,183,106,.10); }
.quiz-done--review strong { color: var(--gold-deep); }
.quiz-done--rework { border-top-color: #A97B2F; background: rgba(169,123,47,.09); }
.quiz-done--rework strong { color: #A97B2F; }
.quiz-retake { margin-top: 12px; }

/* Reference Cards */
.card-actions { display: flex; gap: 10px; justify-content: flex-end; margin-bottom: 12px; max-width: 820px; margin-left: auto; margin-right: auto; }
.ref-card { background: var(--card); border-radius: var(--radius); border-top: 4px solid var(--gold); padding: 44px 52px; max-width: 820px; margin: 0 auto; box-shadow: var(--shadow); }
.ref-card .eyebrow { display: block; font-family: var(--font-serif); font-style: italic; color: var(--gold-deep); font-size: 15px; }
.ref-card h1 { font-family: var(--font-serif); font-size: 32px; margin: 6px 0 14px; color: var(--black); line-height: 1.2; }
.card-tldr { font-size: 16px; line-height: 1.6; color: var(--ink); font-weight: 500; margin: 0 0 8px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.card-block { margin: 22px 0; }
.card-block h3 { font-family: var(--font-serif); font-size: 18px; color: var(--black); margin: 0 0 10px; }
.card-block ul { margin: 0; padding-left: 20px; }
.card-block li { margin: 6px 0; font-size: 15px; line-height: 1.55; }
.card-block.card-watch li { color: #8a3b2e; }
.card-market { background: var(--bg); border-radius: 4px; padding: 14px 18px; }
.card-market h3 { margin-top: 0; }
.card-obj { margin: 0; }
.card-obj dt { font-weight: 600; color: var(--black); font-size: 15px; margin-top: 12px; }
.card-obj dt::before { content: '“'; color: var(--gold-deep); }
.card-obj dt::after { content: '”'; color: var(--gold-deep); }
.card-obj dd { margin: 4px 0 0; padding-left: 16px; border-left: 2px solid var(--gold); font-size: 15px; line-height: 1.55; color: var(--ink); }

@media print {
  .site-header, .hero, .search-shell, .card-actions, .chat-fab, .chat-panel, .footer { display: none !important; }
  body { background: #fff; }
  .wrap { padding: 0; max-width: 100%; }
  .ref-card { box-shadow: none; border-top: 2px solid #000; border-radius: 0; padding: 0; max-width: 100%; }
  .ref-card a { color: #000; border-bottom: none; }
  .card-block.card-watch li { color: #000; }
}

/* Article scaffolding — breadcrumb, reading time, related */
.crumb { max-width: 820px; margin: 0 auto 14px; font-size: 13px; color: var(--ink-soft); }
.crumb a { color: var(--ink-soft); border-bottom: 1px solid transparent; }
.crumb a:hover { color: var(--gold-deep); border-bottom-color: var(--gold); }
.crumb span { color: var(--ink); }
.read-time { float: right; font-style: italic; color: var(--ink-soft); }
.related { max-width: 820px; margin: 28px auto 0; }
.related .section-title { font-size: 18px; margin: 0 0 12px; }

/* Mobile nav hamburger (hidden on desktop) */
.nav-toggle { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 40px; height: 40px; background: transparent; border: 1px solid rgba(217,183,106,.4); border-radius: 6px; cursor: pointer; padding: 0 9px; margin-left: auto; }
.nav-toggle span { display: block; height: 2px; width: 100%; background: var(--gold-soft); border-radius: 2px; transition: all .2s; }
.site-header.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.site-header.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.empty-state { padding: 40px; text-align: center; color: var(--ink-soft); }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--black); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Collapse the 9-item nav into a drawer once it would start wrapping. */
@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .nav { display: none; flex-basis: 100%; width: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: 6px 0 10px; }
  .site-header.nav-open .nav { display: flex; }
  .nav a { width: 100%; padding: 11px 2px; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 14px; }
  .nav a:hover, .nav a.active { border-bottom: 1px solid var(--gold); padding-bottom: 11px; }
  .nav-drop { position: static; width: 100%; display: block; }
  .nav-drop-btn { width: 100%; text-align: left; padding: 11px 2px; font-size: 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
  .nav-drop-menu { display: none; position: static; transform: none; min-width: 0; width: 100%; box-shadow: none; border-top: none; background: rgba(255,255,255,.04); padding: 0; }
  .nav-drop.open .nav-drop-menu { display: block; }
  .nav-drop-menu a { padding-left: 18px; }
  .read-time { float: none; display: block; margin-top: 4px; }
}

@media (max-width: 720px) {
  .article-view { padding: 28px 24px; }
  .article-row { flex-direction: column; }
  .article-row .meta-col { width: auto; }
  .hero { padding: 28px 22px; }
  .hero h1 { font-size: 26px; }
  .chat-panel { width: 100vw; right: 0; bottom: 0; border-radius: 0; max-height: 100vh; height: 100vh; }
  .chat-fab { bottom: 14px; right: 14px; }
  .stat-strip .stat { border-right: none; border-bottom: 1px solid var(--line); padding: 8px; }
  .stat-strip .stat:last-child { border-bottom: none; }
}
