/* ------------------------------------------------------------------ */
/* Tokens                                                              */
/* ------------------------------------------------------------------ */
:root {
  --bg:        #12161d;
  --surface:   #1a212b;
  --surface-2: #222a36;
  --border:    #2b3444;
  --border-soft: #232b38;

  --text:       #e9edf3;
  --text-muted: #8d97a8;
  --text-faint: #626c7c;

  --accent:      #e3a23c;
  --accent-dim:  #8a6428;
  --accent-text: #1a1207;

  --s0: #c1544c; /* not in place */
  --s1: #c98a4b; /* partially in place */
  --s2: #7f9c5c; /* mostly in place */
  --s3: #4e9e72; /* fully in place */

  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/* Layout                                                              */
/* ------------------------------------------------------------------ */
.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------ */
/* Site banner (demo.html — a marketing-style page, not the app shell) */
/* ------------------------------------------------------------------ */
.site-banner {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.site-banner-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  align-items: center;
}
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.site-brand svg { flex-shrink: 0; display: block; }
.site-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.site-brand-name {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 15.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
}
.site-brand-sub {
  font-family: 'Oswald', sans-serif;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-faint);
}
@media (max-width: 560px) {
  .site-banner-inner { padding: 14px 20px; }
}

/* On the app page the banner sits above a full-width sidebar layout,
   not the ~880px-wide marketing pages, so align it to the sidebar's
   own left padding instead of centering it in a narrower column. */
.site-banner--app .site-banner-inner {
  max-width: none;
  padding-left: 20px;
}

/* ------------------------------------------------------------------ */
/* Sidebar                                                             */
/* ------------------------------------------------------------------ */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: calc(100vh - 73px); /* 73px = .site-banner's rendered height */
  overflow-y: auto;
}

@media (max-width: 860px) {
  .sidebar { position: static; height: auto; }
}

.brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 32px;
}

.brand-mark {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent-text);
  background: var(--accent);
  padding: 4px 7px;
  border-radius: 4px;
  line-height: 1;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

/* ------------------------------------------------------------------ */
/* Assessment switcher                                                 */
/* ------------------------------------------------------------------ */
.assessment-switcher {
  position: relative;
  margin-bottom: 18px;
}

.assessment-toggle {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  text-align: left;
  position: relative;
}
.assessment-toggle:hover { border-color: var(--accent-dim); }

.a-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.a-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.a-chev {
  position: absolute;
  right: 12px;
  top: 12px;
  font-size: 11px;
  color: var(--text-faint);
}

.assessment-menu {
  display: none;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}
.assessment-menu.open { display: block; }

.assessment-item {
  display: flex;
  align-items: center;
  border-top: 1px solid var(--border-soft);
}
.assessment-item:first-child { border-top: none; }
.assessment-item.active { background: var(--surface-2); }

.a-select {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 10px;
  text-align: left;
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.assessment-item.active .a-select { color: var(--text); font-weight: 500; }

.a-rename, .a-delete {
  background: transparent;
  border: none;
  color: var(--text-faint);
  padding: 8px 9px;
  font-size: 12px;
}
.a-rename:hover, .a-delete:hover { color: var(--text); }
.a-delete:disabled { opacity: .35; cursor: not-allowed; }

.a-new {
  width: 100%;
  background: transparent;
  border: none;
  border-top: 1px solid var(--border-soft);
  color: var(--accent);
  padding: 10px;
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
}
.a-new:hover { background: var(--surface-2); }

/* ------------------------------------------------------------------ */
/* Scoring mode switcher (Essential / Full)                            */
/* ------------------------------------------------------------------ */
.mode-switcher {
  margin-bottom: 18px;
}

.mode-toggle-track {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
}

.mode-toggle-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 7px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  transition: background .12s ease, color .12s ease;
}
.mode-toggle-btn:hover { color: var(--text); }
.mode-toggle-btn.active {
  background: var(--accent);
  color: var(--accent-text);
}

.mode-toggle-note {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  margin-top: 6px;
  line-height: 1.4;
}

.category-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-phase-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 18px 10px 6px;
}
.nav-phase-label:first-child { margin-top: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  text-align: left;
  font-size: 13.5px;
  font-weight: 500;
  transition: background .12s ease, color .12s ease;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--surface-2); color: var(--text); }

.nav-item .num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  width: 18px;
  flex-shrink: 0;
}
.nav-item.active .num { color: var(--accent); }

.nav-item .status {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
}
.nav-item.complete .status { color: var(--s3); }

.nav-item.home {
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.nav-item.home:hover, .nav-item.home.active { color: var(--text); }

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  transition: border-color .12s ease, color .12s ease;
}
.btn-ghost:hover { border-color: var(--accent-dim); color: var(--text); }
.btn-ghost:disabled { opacity: .4; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--accent-text);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  transition: opacity .12s ease;
}
.btn-primary:hover { opacity: .88; }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }

/* ------------------------------------------------------------------ */
/* Shared (read-only) view banner                                      */
/* ------------------------------------------------------------------ */
.shared-banner {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 6px;
  background: var(--surface-2);
}
.shared-banner-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 4px;
}
.shared-banner-sub {
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.5;
}

/* ------------------------------------------------------------------ */
/* Topbar                                                              */
/* ------------------------------------------------------------------ */
.topbar {
  padding: 28px 40px 0;
}

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 14px;
}
.breadcrumb a { color: var(--text-faint); text-decoration: none; }
.breadcrumb a:hover { color: var(--text-muted); }

.phase-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 5px;
  margin-bottom: 12px;
}
.phase-tag.prevention { background: rgba(227,162,60,.14); color: var(--accent); }
.phase-tag.recovery   { background: rgba(78,158,114,.14); color: var(--s3); }

.page-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 30px;
  margin: 0 0 6px;
}

.page-meta {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
  margin-bottom: 22px;
}

.content {
  padding: 4px 40px 60px;
  max-width: 780px;
}

/* ------------------------------------------------------------------ */
/* Overview / Home page                                                */
/* ------------------------------------------------------------------ */
.hero-desc {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.65;
  max-width: 620px;
  margin-bottom: 30px;
}

.gauge-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 26px 22px;
  margin-bottom: 30px;
}

.gauge-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}

.gauge-score {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 600;
}
.gauge-score .of100 { font-size: 15px; color: var(--text-faint); font-weight: 400; }

.gauge-status {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}

.gauge-bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  display: flex;
  margin-bottom: 14px;
}
.gauge-bar-prevention {
  background: var(--accent);
  height: 100%;
}
.gauge-bar-recovery {
  background: var(--s3);
  height: 100%;
}

.gauge-legend {
  display: flex;
  gap: 22px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
}
.gauge-legend .dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.dot.prevention-dot { background: var(--accent); }
.dot.recovery-dot { background: var(--s3); }

.weight-note {
  color: var(--text-faint);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 34px;
}

.scale-legend {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 40px;
}
.scale-chip {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
}
.scale-chip .n {
  font-family: var(--font-mono);
  font-weight: 600;
  margin-right: 6px;
}
.scale-chip.s0 .n { color: var(--s0); }
.scale-chip.s1 .n { color: var(--s1); }
.scale-chip.s2 .n { color: var(--s2); }
.scale-chip.s3 .n { color: var(--s3); }

.section-block { margin-bottom: 36px; }
.section-heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
}
.section-sub {
  color: var(--text-faint);
  font-size: 13px;
  margin-bottom: 14px;
}

.cat-grid {
  display: grid;
  gap: 10px;
}

.cat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  text-align: left;
  color: var(--text);
  transition: border-color .12s ease;
}
.cat-card:hover { border-color: var(--accent-dim); }

.cat-card .cnum {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
  width: 20px;
}
.cat-card .ctitle { font-weight: 500; font-size: 14.5px; flex: 1; }
.cat-card .cweight {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
}
.cat-card .cstatus {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  min-width: 60px;
  text-align: right;
}
.cat-card.complete .cstatus { color: var(--s3); }

.disclaimer {
  border-top: 1px solid var(--border-soft);
  margin-top: 30px;
  padding-top: 20px;
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.7;
}
.disclaimer strong { color: var(--text-muted); }

.results-cta { margin: -6px 0 36px; }
.results-cta-link {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent);
  text-decoration: none;
}
.results-cta-link:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ */
/* Results page                                                        */
/* ------------------------------------------------------------------ */
.exec-summary {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px 18px;
  margin-bottom: 20px;
}
.exec-summary p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
}

.top-gaps {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px 18px;
  margin-bottom: 20px;
}

.top-gaps-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.gap-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gap-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border-soft);
}
.gap-item:first-child { border-top: none; padding-top: 4px; }

.gap-rank {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  width: 18px;
  flex-shrink: 0;
  padding-top: 1px;
}

.gap-body { flex: 1; min-width: 0; }
.gap-cat {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 3px;
}
.gap-prompt {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 3px;
}
.gap-current {
  font-size: 12px;
  color: var(--text-muted);
}
.gap-current strong { color: var(--s1); }

.gap-points {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--s3);
  text-align: right;
  padding-top: 1px;
}
.gap-points-label {
  display: block;
  font-size: 9px;
  font-weight: 400;
  color: var(--text-faint);
  text-transform: uppercase;
}

.nist-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 6px;
  white-space: nowrap;
}

.nist-citation {
  color: var(--text-faint);
  font-size: 11.5px;
  line-height: 1.6;
  margin: 20px 0 0;
}

.charts-block {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 24px 0;
}

.chart-card {
  flex: 1 1 300px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px 16px 10px;
}

.chart-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 10px;
}

.radar-chart {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.radar-ring { fill: none; stroke: var(--border); stroke-width: 1; }
.radar-spoke { stroke: var(--border-soft); stroke-width: 1; }
.radar-area { fill: rgba(227, 162, 60, 0.22); stroke: var(--accent); stroke-width: 2; }
.radar-dot { fill: var(--accent); }
.radar-label {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--text);
  dominant-baseline: middle;
}

.ov-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 4px 0 8px;
}

.ov-bar-row {
  display: grid;
  grid-template-columns: 118px 1fr 32px;
  align-items: center;
  gap: 8px;
}

.ov-bar-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ov-bar-track {
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.ov-bar-fill { height: 100%; border-radius: 999px; }
.ov-bar-fill.s0 { background: var(--s0); }
.ov-bar-fill.s1 { background: var(--s1); }
.ov-bar-fill.s2 { background: var(--s2); }
.ov-bar-fill.s3 { background: var(--s3); }

.ov-bar-pct {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-faint);
  text-align: right;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 26px 0 24px;
}

.result-row {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  padding: 14px 16px;
}

.result-row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 10px;
}

.rnum {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  width: 18px;
}

.rtitle { font-weight: 500; font-size: 14px; }

.rphase-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
}
.rphase-tag.prevention { background: rgba(227,162,60,.14); color: var(--accent); }
.rphase-tag.recovery   { background: rgba(78,158,114,.14); color: var(--s3); }

.rscore {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
}

.result-bar-track {
  height: 7px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 8px;
}
.result-bar { height: 100%; border-radius: 999px; }
.result-bar.s0 { background: var(--s0); }
.result-bar.s1 { background: var(--s1); }
.result-bar.s2 { background: var(--s2); }
.result-bar.s3 { background: var(--s3); }

.result-row-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
}

.result-guidance {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.results-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 12px;
}

.results-note {
  color: var(--text-faint);
  font-size: 12.5px;
  line-height: 1.6;
}

/* ------------------------------------------------------------------ */
/* Category page                                                       */
/* ------------------------------------------------------------------ */
.question-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 14px;
  overflow: hidden;
}

.question-head {
  padding: 18px 20px 16px;
}

.question-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tier-badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-faint);
}
.tier-badge.advanced { color: var(--accent); border-color: var(--accent-dim); }

.question-prompt {
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 16px;
}

.score-row {
  display: flex;
  gap: 8px;
}

.score-btn {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  padding: 10px 6px;
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  transition: all .12s ease;
}
.score-btn:hover { border-color: var(--accent-dim); color: var(--text); }

.score-btn[data-val="0"].selected { background: var(--s0); border-color: var(--s0); color: #1a0d0b; }
.score-btn[data-val="1"].selected { background: var(--s1); border-color: var(--s1); color: #1a1006; }
.score-btn[data-val="2"].selected { background: var(--s2); border-color: var(--s2); color: #0e1409; }
.score-btn[data-val="3"].selected { background: var(--s3); border-color: var(--s3); color: #06140d; }

.detail-toggle {
  width: 100%;
  background: var(--surface-2);
  border: none;
  border-top: 1px solid var(--border-soft);
  color: var(--text-muted);
  padding: 11px 20px;
  font-size: 12.5px;
  font-family: var(--font-body);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.detail-toggle:hover { color: var(--text); }
.detail-toggle .chev { transition: transform .15s ease; font-size: 11px; }
.detail-toggle.open .chev { transform: rotate(180deg); }

.detail-panel {
  display: none;
  padding: 4px 20px 18px;
  background: var(--surface-2);
}
.detail-panel.open { display: block; }

.level-row {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border-soft);
  font-size: 13px;
  line-height: 1.55;
}
.level-row:first-child { border-top: none; }

.level-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.level-row[data-val="0"] .level-badge { background: rgba(193,84,76,.18); color: var(--s0); }
.level-row[data-val="1"] .level-badge { background: rgba(201,138,75,.18); color: var(--s1); }
.level-row[data-val="2"] .level-badge { background: rgba(127,156,92,.18); color: var(--s2); }
.level-row[data-val="3"] .level-badge { background: rgba(78,158,114,.18); color: var(--s3); }

.level-text { color: var(--text-muted); }
.level-row.is-answer .level-text { color: var(--text); }
.answer-flag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  margin-left: 8px;
}

.cat-nav-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 28px;
}
.nav-arrow {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
}
.nav-arrow:hover { border-color: var(--accent-dim); color: var(--text); }
.nav-arrow:disabled { opacity: .35; cursor: not-allowed; }

/* ------------------------------------------------------------------ */
/* Print (PDF export via the browser's print dialog)                   */
/* ------------------------------------------------------------------ */
@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  :root {
    --bg:        #ffffff;
    --surface:   #ffffff;
    --surface-2: #f4f4f4;
    --border:    #cccccc;
    --border-soft: #dddddd;
    --text:       #111111;
    --text-muted: #333333;
    --text-faint: #666666;
  }

  .sidebar,
  .breadcrumb,
  .results-actions,
  .results-note,
  .results-cta,
  .cat-nav-footer,
  .detail-toggle {
    display: none !important;
  }

  .app { display: block; }
  .main { width: 100%; }
  .content { max-width: 100%; padding: 0 6px 40px; }
  .topbar { padding: 0 6px; }

  .detail-panel { display: block !important; }

  .result-row, .gauge-card, .question-card, .chart-card, .exec-summary, .top-gaps, .gap-item {
    break-inside: avoid;
    box-shadow: none;
  }

  .charts-block {
    gap: 12px;
  }
}
