/* Valix CMMC Readiness - stylesheet.
   Self-contained except for the optional Google Fonts link in index.html
   (system fallbacks are defined; the page renders fine offline). */

:root {
  /* surfaces & ink */
  --paper: #f2f4f8;
  --panel: #ffffff;
  --ink: #161b2b;
  --muted: #59627a;
  --line: #dde2ee;
  --line-strong: #c3cbdf;

  /* brand */
  --violet: #6c4cf5;
  --violet-deep: #4a30c4;
  --violet-wash: rgba(108, 76, 245, 0.08);

  /* the instrument rail (dark panel) */
  --rail-bg: #191238;
  --rail-panel: #221a49;
  --rail-ink: #efedff;
  --rail-muted: #9d94d6;
  --rail-line: rgba(255, 255, 255, 0.14);
  --rail-accent: #a995ff;

  /* status - validated trio (light surface); always paired with a label */
  --met: #1e7a55;
  --partial: #c8860a;
  --gap: #b3362b;

  --radius: 12px;

  --font-display: 'Space Grotesk', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', 'Cascadia Code', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

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

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
a { color: var(--violet-deep); }

:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
  border-radius: 4px;
}

.mono { font-family: var(--font-mono); }

/* ── Header ─────────────────────────────────────────────────────────── */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.logo { height: 36px; width: auto; display: block; }
.header-note {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  text-align: right;
}

/* ── Layout shell ───────────────────────────────────────────────────── */

.shell {
  max-width: 1160px;
  margin: 0 auto;
  padding: 32px 24px 96px;
}
.with-rail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: start;
}
@media (max-width: 1023px) {
  .with-rail { grid-template-columns: minmax(0, 1fr); }
}

/* ── Intro screen ───────────────────────────────────────────────────── */

.intro { max-width: 780px; margin: 0 auto; padding-top: 28px; }
.intro .eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--violet-deep);
  margin-bottom: 14px;
}
.intro h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(32px, 5.4vw, 52px);
  line-height: 1.06;
  letter-spacing: -0.015em;
  margin-bottom: 18px;
}
.intro h1 .score-range { color: var(--violet); white-space: nowrap; }
.intro .lede { font-size: 18px; color: var(--muted); max-width: 640px; margin-bottom: 28px; }

.intro-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 30px;
}
.intro-facts > div { background: var(--panel); padding: 16px 18px; }
.intro-facts .fact-n {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  display: block;
}
.intro-facts .fact-l { font-size: 13px; color: var(--muted); }
@media (max-width: 600px) { .intro-facts { grid-template-columns: 1fr; } }

.intro-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.privacy-note { font-size: 13px; color: var(--muted); max-width: 320px; }

/* ── Gate (email + access code) ─────────────────────────────────────── */

.gate-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}
.gate-card h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}
.gate-card .gate-sub { font-size: 14px; color: var(--muted); margin-bottom: 18px; max-width: 560px; }
.gate-card-narrow { max-width: 480px; margin: 60px auto 0; }
.gate-error { font-size: 13.5px; color: var(--gap); margin-bottom: 12px; }
.code-input {
  width: 100%;
  max-width: 280px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 30px;
  letter-spacing: 12px;
  text-align: center;
  margin-bottom: 14px;
  background: var(--panel);
}
.code-input:focus { border-color: var(--violet); outline: none; }

/* ── Buttons ────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15.5px;
  padding: 12px 22px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.btn-primary { background: var(--violet); color: #fff; }
.btn-primary:hover { background: var(--violet-deep); }
.btn-primary:active { transform: translateY(1px); }
.btn-secondary { background: var(--panel); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--violet); color: var(--violet-deep); }
.btn-ghost { color: var(--muted); padding: 12px 10px; }
.btn-ghost:hover { color: var(--ink); }
.btn[disabled] { opacity: 0.55; cursor: default; pointer-events: none; }

/* ── Flow: progress + back ──────────────────────────────────────────── */

.flow-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.back-fab {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  font-size: 17px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.12s ease, color 0.12s ease;
}
.back-fab:hover { border-color: var(--violet); color: var(--violet-deep); }
.back-fab[disabled] { opacity: 0.35; cursor: default; pointer-events: none; }
.flow-progress {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
.flow-progress > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: var(--violet);
  transition: width 0.3s ease;
}
.flow-progress-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  min-width: 92px;
  text-align: right;
  white-space: nowrap;
}

/* ── Flow: the stage (one question per screen) ──────────────────────── */

.stage { min-height: 420px; }
.stage-card.enter { animation: stage-in 0.28s cubic-bezier(0.22, 1, 0.36, 1); }
.stage-card.enter-back { animation: stage-in-back 0.28s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes stage-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes stage-in-back { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }

.q-eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--violet-deep);
  margin-bottom: 12px;
}
.q-eyebrow .q-fam-id { color: var(--muted); text-transform: none; letter-spacing: 0.02em; margin-left: 8px; }
.q-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(21px, 3vw, 28px);
  line-height: 1.22;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
  max-width: 640px;
}
.q-help {
  font-size: 14.5px;
  color: var(--muted);
  max-width: 600px;
  margin-bottom: 8px;
}

/* big answer buttons */
.answers-lg { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; max-width: 560px; }
.answer-lg {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 14px 16px;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.1s ease;
}
.answer-lg:hover { border-color: var(--violet); transform: translateX(2px); }
.answer-lg .key-badge {
  flex: 0 0 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.answer-lg .al-body { display: flex; flex-direction: column; gap: 1px; }
.answer-lg .al-label { font-weight: 600; font-size: 16px; }
.answer-lg .al-hint { font-size: 12.5px; color: var(--muted); }
.answer-lg .al-check { margin-left: auto; opacity: 0; color: var(--violet-deep); font-weight: 700; }
.answer-lg[aria-pressed='true'] { border-color: var(--violet); background: var(--violet-wash); }
.answer-lg[aria-pressed='true'] .al-check { opacity: 1; }
.answer-lg[aria-pressed='true'] .key-badge { border-color: var(--violet); color: var(--violet-deep); }
.answer-lg.confirmed { border-color: var(--violet); }
.answer-lg[disabled] { cursor: default; }
.answer-lg[disabled]:not([aria-pressed='true']) { opacity: 0.45; }

/* answer color accents by value */
.answer-lg[data-val='yes'][aria-pressed='true'] { border-color: var(--met); background: rgba(30, 122, 85, 0.08); }
.answer-lg[data-val='yes'][aria-pressed='true'] .al-check { color: var(--met); }
.answer-lg[data-val='no'][aria-pressed='true'] { border-color: var(--gap); background: rgba(179, 54, 43, 0.07); }
.answer-lg[data-val='no'][aria-pressed='true'] .al-check { color: var(--gap); }
.answer-lg[data-val='partial'][aria-pressed='true'] { border-color: var(--partial); background: rgba(200, 134, 10, 0.09); }
.answer-lg[data-val='partial'][aria-pressed='true'] .al-check { color: #8a5c06; }

.stage-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  max-width: 560px;
  flex-wrap: wrap;
}
.kbd-hint { font-size: 12.5px; color: var(--muted); }
.kbd-hint b {
  font-family: var(--font-mono);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 11.5px;
}
.skip-link { font-size: 13.5px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.skip-link:hover { color: var(--ink); }

.qmaps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 22px; }
.map-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 2px 9px;
}
.map-chip b { color: var(--violet-deep); font-weight: 600; }

/* multi-select tiles + inputs */
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-top: 18px; }
.opt-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14.5px;
  text-align: left;
  background: var(--panel);
  transition: border-color 0.12s ease, background 0.12s ease;
}
.opt-tile:hover { border-color: var(--violet); }
.opt-tile[aria-pressed='true'] { border-color: var(--violet); background: var(--violet-wash); }
.opt-tile .env-tag {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--paper);
  color: var(--muted);
}
.opt-tile .env-tag.gov { background: rgba(30, 122, 85, 0.12); color: var(--met); }

.text-input {
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 15px;
  background: var(--panel);
}
.text-input:focus { border-color: var(--violet); outline: none; }
.text-input-lg { margin-top: 18px; padding: 14px 16px; font-size: 17px; max-width: 460px; }

/* ── The instrument rail (signature element) ────────────────────────── */

.rail {
  position: sticky;
  top: 20px;
  background: var(--rail-bg);
  color: var(--rail-ink);
  border-radius: 16px;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.rail h3 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rail-muted);
}

.altimeter { display: flex; gap: 18px; align-items: stretch; }
.alt-track {
  position: relative;
  width: 46px;
  border-radius: 8px;
  background: var(--rail-panel);
  overflow: hidden;
  min-height: 220px;
}
.alt-fill {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, var(--rail-accent), var(--violet));
  transition: height 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.alt-zero { position: absolute; left: 0; right: 0; height: 1px; background: var(--rail-line); }
.alt-zero::after {
  content: '0';
  position: absolute;
  right: 4px;
  top: -14px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--rail-muted);
}
.alt-readout { display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.alt-score {
  font-family: var(--font-mono);
  font-size: 44px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}
.alt-score.negative { color: #f0a08e; }
.alt-label { font-size: 12.5px; color: var(--rail-muted); max-width: 170px; }
.alt-range { font-family: var(--font-mono); font-size: 11px; color: var(--rail-muted); margin-top: 6px; }

.rail-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rail-stat { background: var(--rail-panel); border-radius: 8px; padding: 8px 10px; }
.rail-stat .n { font-family: var(--font-mono); font-size: 18px; font-weight: 600; display: block; }
.rail-stat .l { font-size: 11px; color: var(--rail-muted); }

.fam-list { display: flex; flex-direction: column; gap: 7px; }
.fam-row { display: grid; grid-template-columns: 34px 1fr 44px; align-items: center; gap: 8px; font-size: 11.5px; }
.fam-row .fam-id { font-family: var(--font-mono); color: var(--rail-muted); }
.fam-row .fam-bar { height: 5px; border-radius: 3px; background: var(--rail-panel); overflow: hidden; }
.fam-row .fam-bar > i {
  display: block;
  height: 100%;
  background: var(--rail-accent);
  border-radius: 3px;
  transition: width 0.35s ease;
}
.fam-row .fam-count { font-family: var(--font-mono); color: var(--rail-muted); text-align: right; }

.ticker {
  border-top: 1px solid var(--rail-line);
  padding-top: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--rail-muted);
  min-height: 34px;
}
.ticker .tick-desc { color: var(--rail-ink); }
.ticker .tick-minus { color: #f0a08e; }
.ticker .tick-ok { color: #8fd9b6; }

/* compact mobile scorebar */
.scorebar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--rail-bg);
  color: var(--rail-ink);
  padding: 10px 18px;
  align-items: center;
  gap: 14px;
}
.scorebar .alt-score { font-size: 22px; }
.scorebar .sb-progress { flex: 1; height: 5px; border-radius: 3px; background: var(--rail-panel); overflow: hidden; }
.scorebar .sb-progress > i { display: block; height: 100%; background: var(--rail-accent); }
.scorebar .sb-label { font-family: var(--font-mono); font-size: 11px; color: var(--rail-muted); }
@media (max-width: 1023px) {
  .rail { display: none; }
  .scorebar.active { display: flex; }
}

/* ── Results ────────────────────────────────────────────────────────── */

.results-hero {
  background: var(--rail-bg);
  color: var(--rail-ink);
  border-radius: 16px;
  padding: 34px 32px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 36px;
  align-items: center;
  margin-bottom: 26px;
}
@media (max-width: 700px) { .results-hero { grid-template-columns: 1fr; } }
.score-dial { position: relative; width: 190px; height: 190px; }
.score-dial svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-dial .dial-num {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
}
.score-dial .dial-num .v { font-size: 42px; font-weight: 600; line-height: 1; }
.score-dial .dial-num .v.negative { color: #f0a08e; }
.score-dial .dial-num .of { font-size: 11.5px; color: var(--rail-muted); margin-top: 4px; }
.results-hero h2 { font-family: var(--font-display); font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.results-hero .hero-sub { color: var(--rail-muted); font-size: 14.5px; max-width: 520px; }
.hero-counts { display: flex; gap: 18px; margin-top: 18px; flex-wrap: wrap; }
.hero-counts .hc { font-size: 13px; color: var(--rail-muted); }
.hero-counts .hc b { font-family: var(--font-mono); font-size: 16px; color: var(--rail-ink); display: block; }

.res-section { margin-bottom: 26px; }
.res-section > h3 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 12px;
}

/* findings */
.finding {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
}
.finding .sev-bar { border-radius: 5px; }
.finding[data-sev='high'] .sev-bar { background: var(--gap); }
.finding[data-sev='medium'] .sev-bar { background: var(--partial); }
.finding[data-sev='info'] .sev-bar { background: var(--line-strong); }
.finding[data-sev='good'] .sev-bar { background: var(--met); }
.finding .f-title { font-weight: 600; font-size: 15px; }
.finding .f-sev {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-left: 8px;
}
.finding[data-sev='high'] .f-sev { color: var(--gap); }
.finding[data-sev='medium'] .f-sev { color: #8a5c06; }
.finding[data-sev='info'] .f-sev { color: var(--muted); }
.finding[data-sev='good'] .f-sev { color: var(--met); }
.finding .f-detail { font-size: 13.5px; color: var(--muted); margin-top: 3px; }

/* family coverage bars */
.coverage {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.cov-row { display: grid; grid-template-columns: 210px 1fr 58px; gap: 12px; align-items: center; padding: 5px 0; }
@media (max-width: 640px) { .cov-row { grid-template-columns: 130px 1fr 58px; } }
.cov-row .cov-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cov-row .cov-name .mono { color: var(--muted); font-size: 11px; margin-right: 6px; }
.cov-track { height: 12px; border-radius: 6px; background: var(--paper); overflow: hidden; display: flex; }
.cov-track .seg-met { background: var(--met); height: 100%; }
.cov-track .seg-partial { background: var(--partial); height: 100%; margin-left: 2px; }
.cov-count { font-family: var(--font-mono); font-size: 12px; color: var(--muted); text-align: right; }
.cov-legend { display: flex; gap: 16px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.cov-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.cov-legend .lg-met i { background: var(--met); }
.cov-legend .lg-partial i { background: var(--partial); }
.cov-legend .lg-open i { background: var(--paper); border: 1px solid var(--line-strong); }

/* gap plan table */
.gap-table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); }
.gap-table { width: 100%; border-collapse: collapse; background: var(--panel); }
.gap-table th {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  color: var(--muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.gap-table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 13.5px; }
.gap-table tr:last-child td { border-bottom: none; }
.gap-table .g-pts { font-family: var(--font-mono); font-weight: 600; color: var(--gap); white-space: nowrap; }
.gap-table .g-pts.zero { color: var(--muted); }
.gap-table .g-q { font-weight: 600; max-width: 320px; }
.gap-table .g-ids { font-family: var(--font-mono); font-size: 11px; color: var(--muted); display: block; margin-top: 4px; font-weight: 400; }
.gap-table .g-fix { color: var(--muted); max-width: 380px; }
.gap-table .g-ans { font-family: var(--font-mono); font-size: 11px; white-space: nowrap; }

/* submit block */
.submit-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.submit-card h3 { font-family: var(--font-display); font-size: 19px; font-weight: 700; margin-bottom: 6px; }
.submit-card .s-sub { font-size: 14px; color: var(--muted); margin-bottom: 18px; max-width: 560px; }
.submit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 5px; }
.field input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 14.5px;
}
.field input:focus { border-color: var(--violet); outline: none; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); margin-bottom: 18px; max-width: 560px; }
.consent input { margin-top: 3px; accent-color: var(--violet); }
.submit-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.submit-status { font-size: 13.5px; }
.submit-status.ok { color: var(--met); font-weight: 600; }
.submit-status.err { color: var(--gap); }

.banner {
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 14px;
  margin-bottom: 18px;
  border: 1px solid;
}
.banner.warn { background: rgba(200, 134, 10, 0.07); border-color: rgba(200, 134, 10, 0.35); color: #6d4a05; }
.banner.crit { background: rgba(179, 54, 43, 0.06); border-color: rgba(179, 54, 43, 0.3); color: var(--gap); }

.footnote { font-size: 12px; color: var(--muted); margin-top: 30px; max-width: 640px; }
.footnote a { color: var(--muted); }

/* util */
.hidden { display: none !important; }

/* the raw-JSON secondary link sits quietly to the far right of the CTA row */
.submit-actions .btn-json { margin-left: auto; font-size: 13px; }

/* Optional customer logo picker on the results screen (client-side only). It
   feeds the customer-brand header of the PDF; nothing is uploaded to a server. */
.logo-tool {
  margin: 4px 0 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.logo-tool-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo-tool-copy { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 2px; }
.logo-tool-title { font-weight: 600; font-size: 14px; }
.logo-tool-opt { color: var(--muted); font-weight: 400; }
.logo-tool-hint { font-size: 12px; color: var(--muted); line-height: 1.4; }
.logo-input-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.logo-pick { white-space: nowrap; }
.logo-tool-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  flex-wrap: wrap;
}
.logo-tool-preview img {
  max-height: 44px;
  max-width: 180px;
  width: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 6px;
  background: #fff;
}
.logo-tool-ok { font-size: 12px; color: var(--met); flex: 1; min-width: 140px; }
.logo-remove { font-size: 13px; color: var(--gap); text-decoration: underline; }
.logo-tool-error { margin-top: 8px; font-size: 12.5px; color: var(--gap); }

/* ── Branded PDF report ──────────────────────────────────────────────────
   Hidden on screen; @media print reveals ONLY #pdf-report (and only once
   body.report-ready is set, so a stray Cmd/Ctrl+P elsewhere still prints the
   page normally). The customer's "Download PDF report" button fills this
   container from the same assessment the results screen uses, then calls
   window.print(). No pop-up, no PDF library, no new dependency. */

#pdf-report { display: none; }

/* Extra bottom margin reserves a band for the fixed running footer so page
   content never prints on top of it. */
@page { size: Letter; margin: 0.6in 0.6in 0.85in; }

@media print {
  /* When a report is ready, the interactive app disappears and only the
     print-optimized report remains. */
  body.report-ready > *:not(#pdf-report) { display: none !important; }
  body.report-ready #pdf-report { display: block; }
  body.report-ready { background: #fff; }

  #pdf-report {
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 10.5px;
    line-height: 1.5;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  /* Brand fills (dark bands, coverage bars, badges) must survive printing. */
  #pdf-report * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  .pdf-avoid, .pdf-hero, .pdf-head, .pdf-ssp,
  .pdf-finding, .pdf-cov, .pdf-gap, .pdf-foot { break-inside: avoid; }
  .pdf-section > h2 { break-after: avoid; }

  /* Header band. The CUSTOMER is the brand; Valix is the preparer, in the
     corner. Left: customer logo (if uploaded) or company name, shown large,
     then the report title. Right: a small "Prepared by Valix" mark. */
  .pdf-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 2px 0 12px;
    margin-bottom: 16px;
    border-bottom: 3px solid var(--violet);
  }
  .pdf-head-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
  .pdf-cust-logo { max-height: 52px; max-width: 210px; width: auto; height: auto; object-fit: contain; }
  .pdf-cust-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 22px;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--ink);
    max-width: 300px;
  }
  .pdf-head-titles { padding-left: 14px; border-left: 1px solid var(--line-strong); }
  .pdf-head-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    line-height: 1.15;
    letter-spacing: -0.01em;
  }
  .pdf-head-for { font-size: 10px; color: var(--ink); margin-top: 2px; }
  .pdf-head-sub {
    font-family: var(--font-mono);
    font-size: 7.5px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
    margin-top: 3px;
  }
  .pdf-head-prep { text-align: right; white-space: nowrap; padding-top: 2px; }
  .pdf-prep-label {
    font-family: var(--font-mono);
    font-size: 7px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 3px;
  }
  .pdf-prep-logo { height: 20px; width: auto; display: inline-block; }
  .pdf-prep-date { font-family: var(--font-mono); font-size: 8.5px; color: var(--muted); margin-top: 4px; }

  /* Score hero / verdict */
  .pdf-hero {
    display: flex;
    gap: 18px;
    border: 1px solid var(--line);
    border-left: 6px solid var(--violet);
    border-radius: 10px;
    padding: 15px 18px;
    margin-bottom: 14px;
    background: var(--violet-wash);
  }
  .pdf-score {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    min-width: 118px;
    padding-right: 18px;
    border-right: 1px solid var(--line-strong);
  }
  .pdf-score-num { font-family: var(--font-mono); font-weight: 600; font-size: 50px; line-height: 1; color: var(--violet-deep); }
  .pdf-score-num.neg { color: var(--gap); }
  .pdf-score-scale { font-family: var(--font-mono); font-size: 8px; color: var(--muted); margin-top: 6px; }
  .pdf-hero-body { flex: 1; }
  .pdf-verdict-label {
    font-family: var(--font-mono);
    font-size: 8.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--violet-deep);
    margin-bottom: 4px;
  }
  .pdf-verdict { font-size: 12px; line-height: 1.4; margin-bottom: 9px; }
  .pdf-chips { display: flex; gap: 7px; flex-wrap: wrap; }
  .pdf-chip { border: 1px solid var(--line-strong); border-radius: 99px; padding: 2px 10px; font-size: 9px; color: var(--muted); }
  .pdf-chip b { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink); }

  /* SSP blocker */
  .pdf-ssp {
    border: 1px solid rgba(179, 54, 43, 0.35);
    background: rgba(179, 54, 43, 0.06);
    color: var(--gap);
    border-radius: 8px;
    padding: 9px 13px;
    font-size: 10px;
    margin-bottom: 14px;
  }

  /* Sections */
  .pdf-section { margin-bottom: 16px; }
  .pdf-section > h2 {
    font-family: var(--font-display);
    font-size: 13.5px;
    font-weight: 700;
    margin-bottom: 9px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--line);
  }
  .pdf-section > h2 .pdf-h2-note {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 9px;
    color: var(--muted);
    margin-left: 8px;
  }

  /* Assessment context grid */
  .pdf-ctx-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 26px; }
  .pdf-ctx { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dotted var(--line); padding: 3px 0; font-size: 9.5px; }
  .pdf-ctx-l { color: var(--muted); }
  .pdf-ctx-v { font-weight: 600; text-align: right; }

  /* Findings */
  .pdf-finding { border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: 6px; padding: 8px 12px; margin-bottom: 7px; }
  .pdf-finding[data-sev='high'] { border-left-color: var(--gap); }
  .pdf-finding[data-sev='medium'] { border-left-color: var(--partial); }
  .pdf-finding[data-sev='good'] { border-left-color: var(--met); }
  .pdf-finding-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
  .pdf-finding-title { font-weight: 600; font-size: 10.5px; }
  .pdf-finding-sev {
    font-family: var(--font-mono);
    font-size: 8px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
  }
  .pdf-finding[data-sev='high'] .pdf-finding-sev { color: var(--gap); }
  .pdf-finding[data-sev='medium'] .pdf-finding-sev { color: #8a5c06; }
  .pdf-finding[data-sev='good'] .pdf-finding-sev { color: var(--met); }
  .pdf-finding-detail { font-size: 9.5px; color: var(--muted); margin-top: 3px; }

  /* Coverage bars */
  .pdf-cov { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
  .pdf-cov-row { display: grid; grid-template-columns: 195px 1fr 40px; gap: 12px; align-items: center; padding: 2.5px 0; font-size: 9.5px; }
  .pdf-cov-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pdf-cov-name b { font-family: var(--font-mono); color: var(--muted); margin-right: 5px; font-weight: 600; }
  .pdf-cov-track { height: 9px; border-radius: 5px; background: var(--paper); border: 1px solid var(--line); overflow: hidden; display: flex; }
  .pdf-seg-met { background: var(--met); height: 100%; }
  .pdf-seg-part { background: var(--partial); height: 100%; }
  .pdf-cov-count { font-family: var(--font-mono); font-size: 9px; color: var(--muted); text-align: right; }
  .pdf-cov-legend { display: flex; gap: 16px; margin-top: 9px; font-size: 8.5px; color: var(--muted); }
  .pdf-cov-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
  .pdf-cov-legend .lg-met { background: var(--met); }
  .pdf-cov-legend .lg-part { background: var(--partial); }
  .pdf-cov-legend .lg-open { background: var(--paper); border: 1px solid var(--line-strong); }

  /* Gap plan cards (the full list) */
  .pdf-gap { border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: 6px; padding: 8px 12px; margin-bottom: 6px; }
  .pdf-gap[data-pri='high'] { border-left-color: var(--gap); }
  .pdf-gap[data-pri='med'] { border-left-color: var(--partial); }
  .pdf-gap[data-pri='req'] { border-left-color: var(--muted); }
  .pdf-gap-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; }
  .pdf-gap-rank { font-family: var(--font-mono); font-size: 8.5px; color: var(--muted); }
  .pdf-gap-pts { font-family: var(--font-mono); font-weight: 600; font-size: 10.5px; color: var(--gap); }
  .pdf-gap[data-pri='req'] .pdf-gap-pts { color: var(--muted); }
  .pdf-gap-pri {
    font-family: var(--font-mono);
    font-size: 7.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    padding: 1px 5px;
    color: var(--muted);
  }
  .pdf-gap-fam { font-size: 8.5px; color: var(--muted); }
  .pdf-gap-ans { margin-left: auto; font-family: var(--font-mono); font-size: 8px; color: var(--muted); }
  .pdf-gap-q { font-weight: 600; font-size: 10px; margin-bottom: 3px; }
  .pdf-gap-fix { font-size: 9.5px; color: var(--muted); }
  .pdf-gap-fix-l {
    font-family: var(--font-mono);
    font-size: 7.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--violet-deep);
    margin-right: 6px;
  }
  .pdf-gap-ids { font-family: var(--font-mono); font-size: 7.5px; color: var(--muted); margin-top: 4px; }

  /* What happens next */
  .pdf-steps { padding-left: 18px; }
  .pdf-steps li { font-size: 10px; margin-bottom: 5px; }
  .pdf-empty { font-size: 10.5px; color: var(--muted); }

  /* Footer (end of document: preparer line + legal disclaimer) */
  .pdf-foot { margin-top: 18px; padding-top: 9px; border-top: 2px solid var(--violet); }
  .pdf-foot-brand { font-family: var(--font-display); font-weight: 500; font-size: 10px; color: var(--violet-deep); }
  .pdf-foot-conf { font-size: 7.5px; color: var(--muted); margin-top: 4px; line-height: 1.45; }

  /* Per-page running footer. position:fixed repeats on every printed page, so
     the customer keeps branding even after turning OFF the browser's own
     headers/footers (which is what prints the localhost URL). It sits inside
     the enlarged @page bottom margin, over a white band so nothing shows
     through. Page numbers are intentionally not relied on (no cross-browser
     @page margin-box support); the branded line is the guarantee. */
  .pdf-running-foot {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 4px 0 2px;
    font-family: var(--font-body);
    font-size: 7.5px;
    letter-spacing: 0.02em;
    color: var(--muted);
    text-align: center;
    background: #fff;
    border-top: 1px solid var(--line);
  }
}
