/* ==========================================================================
   SkillScope

   Colour tokens are the validated data-viz reference palette, used unchanged
   against its own surfaces (light #fcfcfb / dark #1a1a19) so the published
   contrast and CVD results still hold. Dark mode is a selected set of steps for
   the dark surface, not an inverted light palette.

   Chart forms in use, and why:
     overall score        hero figure + meter   (a single value is not a chart)
     skill profile        horizontal bars       (magnitude; ONE hue, not a ramp
                                                 and not banded by status)
     claim vs evidence    dumbbell              (before → after per item)
     role fit             horizontal bars       (ranked magnitude)
     gap to requirement   diverging bar         (Δ to target, gray midpoint)
   ========================================================================== */

:root {
  color-scheme: light;

  --surface:        #fcfcfb;  /* card / chart surface */
  --plane:          #f9f9f7;  /* page plane */
  --raised:         #f2f1ed;
  --ink:            #0b0b0b;
  --ink-2:          #52514e;
  --ink-muted:      #898781;
  --grid:           #e1e0d9;
  --baseline:       #c3c2b7;
  --ring:           rgba(11, 11, 11, .10);
  --ring-strong:    rgba(11, 11, 11, .22);

  --series-1:       #2a78d6;  /* categorical slot 1 — the only series hue used */
  /* Dumbbell ends: two steps of the sequential blue ramp, not two hues.
     blue 300 measures 2.44:1 on this surface, under the 3:1 bar, so the relief
     rule applies and is honoured: every dumbbell row carries a visible delta
     label and the figure ships a table view, so the value is never colour-only. */
  --dumb-claim:     #6da7ec;  /* blue 300 — self-report end */
  --dumb-evidence:  #1c5cab;  /* blue 550 — evidence end */
  --meter-track:    #cde2fb;  /* blue 100 — lighter step of the same ramp */
  --diverge-pos:    #2a78d6;  /* blue  — at or above requirement */
  --diverge-neg:    #e34948;  /* red   — short of requirement */
  --diverge-mid:    #f0efec;  /* neutral gray midpoint */

  --good:           #0ca30c;
  --warning:        #fab219;
  --serious:        #ec835a;
  --critical:       #d03b3b;
  --success-text:   #006300;

  --radius: 12px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(11, 11, 11, .04), 0 8px 24px -16px rgba(11, 11, 11, .16);
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --surface:        #1a1a19;
    --plane:          #0d0d0d;
    --raised:         #242422;
    --ink:            #ffffff;
    --ink-2:          #c3c2b7;
    --ink-muted:      #898781;
    --grid:           #2c2c2a;
    --baseline:       #383835;
    --ring:           rgba(255, 255, 255, .10);
    --ring-strong:    rgba(255, 255, 255, .22);

    --series-1:       #3987e5;
    --dumb-claim:     #9ec5f4;  /* blue 200 */
    --dumb-evidence:  #3987e5;  /* blue 400 */
    --meter-track:    #184f95;  /* blue 600 — darker step of the same ramp */
    --diverge-pos:    #3987e5;
    --diverge-neg:    #e66767;
    --diverge-mid:    #383835;
    --success-text:   #0ca30c;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --surface:        #1a1a19;
  --plane:          #0d0d0d;
  --raised:         #242422;
  --ink:            #ffffff;
  --ink-2:          #c3c2b7;
  --ink-muted:      #898781;
  --grid:           #2c2c2a;
  --baseline:       #383835;
  --ring:           rgba(255, 255, 255, .10);
  --ring-strong:    rgba(255, 255, 255, .22);

  --series-1:       #3987e5;
  --dumb-claim:     #9ec5f4;
  --dumb-evidence:  #3987e5;
  --meter-track:    #184f95;
  --diverge-pos:    #3987e5;
  --diverge-neg:    #e66767;
  --diverge-mid:    #383835;
  --success-text:   #0ca30c;
}

/* -------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--plane);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, figure { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.hide { display: none !important; }
.muted { color: var(--ink-2); }
.centred { text-align: center; }

/* -------------------------------------------------------------- chrome */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--plane) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ring);
}
.topbar-in {
  max-width: 860px; margin: 0 auto; padding: 11px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { font-weight: 620; letter-spacing: -.015em; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

.wrap { max-width: 860px; margin: 0 auto; padding: 32px 20px 40px; }
.screen { animation: rise .28s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
  * { transition-duration: .01ms !important; }
}

h1 { font-size: clamp(26px, 4.6vw, 34px); line-height: 1.14; letter-spacing: -.024em; font-weight: 640; }
.lede { color: var(--ink-2); margin-top: 10px; max-width: 62ch; }
h2.section { font-size: 20px; letter-spacing: -.016em; font-weight: 620; margin: 36px 0 12px; }
.h-sm { font-size: 14px; font-weight: 620; letter-spacing: .005em; margin: 24px 0 10px; }
.h-sm:first-child { margin-top: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--ring);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-top: 20px;
}
.card + .card { margin-top: 14px; }

/* -------------------------------------------------------------- buttons */
.btn {
  cursor: pointer; border-radius: var(--radius-sm);
  border: 1px solid var(--ring-strong); background: var(--surface);
  padding: 10px 17px; font-weight: 500;
  transition: background .14s, border-color .14s, transform .06s;
}
.btn:hover { background: var(--raised); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; }
.btn.primary {
  background: var(--series-1); border-color: var(--series-1);
  color: #fff; font-weight: 600;
}
.btn.primary:hover { background: color-mix(in srgb, var(--series-1) 86%, #000); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--raised); color: var(--ink); }
.btn.tiny { padding: 5px 11px; font-size: 13px; }
.btn.icon { padding: 5px 9px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-group { display: flex; gap: 8px; }

.actions { display: flex; gap: 10px; align-items: center; margin-top: 22px; }
.actions.split { justify-content: space-between; }
.micro { font-size: 12.5px; color: var(--ink-muted); }
kbd {
  font: inherit; font-size: 11.5px; padding: 1px 5px; border-radius: 5px;
  border: 1px solid var(--ring-strong); background: var(--raised);
}

/* -------------------------------------------------------------- intro */
.statrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat {
  background: var(--raised); border: 1px solid var(--ring);
  border-radius: var(--radius-sm); padding: 12px 14px;
}
.stat-v { display: block; font-size: 20px; font-weight: 620; letter-spacing: -.02em; }
.stat-l { display: block; font-size: 12px; color: var(--ink-2); margin-top: 1px; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  border: 1px solid var(--ring-strong); border-radius: 999px;
  padding: 5px 12px; font-size: 13px; color: var(--ink-2);
  background: transparent;
}
.chips.picker .chip { cursor: pointer; transition: .14s; }
.chips.picker .chip:hover { background: var(--raised); }
.chips.picker .chip[aria-pressed="true"] {
  background: var(--series-1); border-color: var(--series-1); color: #fff;
}

.ticks { list-style: none; padding: 0; display: grid; gap: 11px; }
.ticks li { position: relative; padding-left: 22px; font-size: 14.5px; color: var(--ink-2); }
.ticks li::before {
  content: ""; position: absolute; left: 4px; top: .62em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--series-1);
}
.ticks b { color: var(--ink); font-weight: 600; }

.note {
  font-size: 13.5px; color: var(--ink-2); background: var(--raised);
  border: 1px solid var(--ring); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-top: 18px;
}

/* -------------------------------------------------------------- forms */
.field { margin-bottom: 18px; }
.field:last-of-type { margin-bottom: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label, .label { display: block; font-size: 13.5px; font-weight: 560; margin-bottom: 6px; }
.opt-tag, .opt { color: var(--ink-muted); font-weight: 400; }
.hint { display: block; font-size: 12.5px; color: var(--ink-muted); margin-top: 5px; }

input[type="text"], select, textarea {
  width: 100%; background: var(--plane);
  border: 1px solid var(--ring-strong); border-radius: var(--radius-sm);
  padding: 10px 12px; transition: border-color .14s;
}
input[type="text"]:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--series-1);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--series-1) 18%, transparent);
}
textarea { resize: vertical; line-height: 1.6; min-height: 96px; }
select { appearance: none; background-image: none; cursor: pointer; }

/* -------------------------------------------------------------- gate */
.tabs {
  display: flex; gap: 4px; margin-bottom: 22px;
  border-bottom: 1px solid var(--grid);
}
.tab {
  border: 0; background: none; cursor: pointer; padding: 9px 14px;
  color: var(--ink-muted); font-size: 14px; font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--series-1); }
.tab:focus-visible { outline: 2px solid var(--series-1); outline-offset: -2px; border-radius: 4px; }

.turnstile { margin: 4px 0 18px; min-height: 66px; }
.formerror {
  font-size: 13.5px; color: var(--ink); margin: 0 0 4px;
  border-left: 2px solid var(--critical); padding: 7px 0 7px 11px;
  background: color-mix(in srgb, var(--critical) 7%, transparent);
  border-radius: 0 6px 6px 0;
}

/* -------------------------------------------------------------- quiz */
.progress { height: 4px; background: var(--grid); border-radius: 99px; overflow: hidden; }
.progress > i {
  display: block; height: 100%; width: 0;
  background: var(--series-1); transition: width .3s ease;
}
.progress-meta {
  display: flex; justify-content: space-between;
  font-size: 12.5px; color: var(--ink-muted); margin: 7px 0 0;
}
.q-tag {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-muted); margin-bottom: 9px;
}
.q-text {
  font-size: clamp(18px, 2.6vw, 21px); line-height: 1.34;
  letter-spacing: -.014em; font-weight: 560; margin-bottom: 20px;
}
.opts { display: grid; gap: 8px; }
.opt-btn {
  display: flex; gap: 12px; align-items: flex-start; text-align: left;
  width: 100%; cursor: pointer; padding: 13px 15px;
  background: var(--surface); border: 1px solid var(--ring-strong);
  border-radius: var(--radius-sm); transition: border-color .14s, background .14s;
}
.opt-btn:hover { border-color: var(--baseline); background: var(--raised); }
.opt-btn:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; }
.opt-btn .key {
  flex: 0 0 22px; width: 22px; height: 22px; margin-top: 1px;
  border-radius: 50%; border: 1px solid var(--baseline);
  display: grid; place-items: center; font-size: 11px; color: var(--ink-muted);
}
.opt-btn[aria-checked="true"] {
  border-color: var(--series-1);
  background: color-mix(in srgb, var(--series-1) 8%, var(--surface));
}
.opt-btn[aria-checked="true"] .key {
  background: var(--series-1); border-color: var(--series-1); color: #fff; font-weight: 700;
}

.answer-meta { display: flex; justify-content: space-between; margin-top: 7px; }
.loading { display: flex; gap: 14px; align-items: flex-start; }
.loading b { display: block; margin-bottom: 3px; }
.loading p { font-size: 14px; max-width: 52ch; }
.spinner {
  flex: 0 0 18px; width: 18px; height: 18px; margin-top: 3px;
  border: 2px solid var(--grid); border-top-color: var(--series-1);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ======================================================================
   CHARTS
   ====================================================================== */

figure { margin: 0; }
figcaption {
  font-size: 12.5px; color: var(--ink-muted); margin-bottom: 14px; max-width: 60ch;
}

/* --- hero figure + meter (the overall number is not a chart) --- */
.hero { display: flex; gap: 26px; flex-wrap: wrap; align-items: flex-start; }
.hero-fig { min-width: 132px; }
.hero-num {
  font-size: 60px; line-height: 1; font-weight: 640; letter-spacing: -.04em;
  /* proportional figures, deliberately: tabular-nums reads loose at this size */
}
.hero-num small { font-size: 20px; font-weight: 500; color: var(--ink-muted); letter-spacing: 0; }
.hero-lab { font-size: 12.5px; color: var(--ink-muted); margin-top: 2px; }
.meter { margin-top: 12px; height: 8px; width: 100%; background: var(--meter-track); border-radius: 99px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--series-1); border-radius: 0 99px 99px 0; }
.hero-body { flex: 1 1 300px; }
.hero-body p { color: var(--ink-2); font-size: 14.5px; margin-top: 8px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 560; padding: 3px 10px 3px 8px;
  border-radius: 999px; border: 1px solid var(--ring-strong); background: var(--raised);
  color: var(--ink);
}
/* Status colour never carries the meaning alone — the dot is paired with the
   band name as text, per the status-palette rule. */
.badge .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.badge .dot.good     { background: var(--good); }
.badge .dot.warning  { background: var(--warning); }
.badge .dot.serious  { background: var(--serious); }
.badge .dot.critical { background: var(--critical); }

/* --- horizontal bar chart --- */
.bars { display: grid; gap: 3px; }
.bar-row {
  display: grid; grid-template-columns: minmax(96px, 152px) 1fr auto;
  gap: 12px; align-items: center;
  min-height: 28px;                 /* ≥24px hit target */
  padding: 3px 4px; margin: 0 -4px;
  border-radius: 6px; cursor: default;
  border: 0; background: none; width: 100%; text-align: left;
}
.bar-row:hover, .bar-row:focus-visible { background: var(--raised); }
.bar-row:focus-visible { outline: 2px solid var(--series-1); outline-offset: -2px; }
.bar-name { font-size: 13.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track {
  position: relative; height: 14px;              /* ≤24px, thin marks */
  border-left: 1px solid var(--baseline);        /* solid hairline baseline */
}
.bar-fill {
  position: absolute; left: 0; top: 0; height: 100%;
  background: var(--series-1);
  border-radius: 0 4px 4px 0;                    /* rounded data-end, square at baseline */
  transition: width .5s cubic-bezier(.2, .7, .3, 1);
}
.bar-val { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; min-width: 30px; text-align: right; }

/* --- dumbbell: self-report → evidence --- */
.dumb-row {
  display: grid; grid-template-columns: minmax(96px, 152px) 1fr auto;
  gap: 12px; align-items: center; min-height: 30px;
  padding: 3px 4px; margin: 0 -4px; border-radius: 6px;
  border: 0; background: none; width: 100%; text-align: left;
}
.dumb-row:hover, .dumb-row:focus-visible { background: var(--raised); }
.dumb-row:focus-visible { outline: 2px solid var(--series-1); outline-offset: -2px; }
.dumb-track { position: relative; height: 14px; }
.dumb-track::before {
  content: ""; position: absolute; inset: 6px 0 auto; height: 1px; background: var(--grid);
}
.dumb-link { position: absolute; top: 6px; height: 2px; background: var(--dumb-evidence); opacity: .5; }
.dumb-dot {
  position: absolute; top: 1px; width: 12px; height: 12px; border-radius: 50%;
  margin-left: -6px;
  box-shadow: 0 0 0 2px var(--surface);          /* 2px surface ring, not a border */
}
.dumb-dot.claim { background: var(--dumb-claim); }
.dumb-dot.evidence { background: var(--dumb-evidence); }
.dumb-delta { font-size: 13px; font-variant-numeric: tabular-nums; min-width: 42px; text-align: right; color: var(--ink-2); }

.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 14px; }
.legend-item { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); }
.legend-swatch { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 11px; }

/* --- diverging bar: gap to a role's requirement --- */
.div-row {
  display: grid; grid-template-columns: minmax(96px, 152px) 1fr auto;
  gap: 12px; align-items: center; min-height: 28px;
  padding: 3px 4px; margin: 0 -4px; border-radius: 6px;
  border: 0; background: none; width: 100%; text-align: left;
}
.div-row:hover, .div-row:focus-visible { background: var(--raised); }
.div-row:focus-visible { outline: 2px solid var(--series-1); outline-offset: -2px; }
.div-track { position: relative; height: 14px; background: var(--diverge-mid); border-radius: 3px; }
.div-track::after {
  content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px;
  width: 1px; background: var(--baseline);
}
.div-fill { position: absolute; top: 0; height: 100%; }
.div-fill.neg { background: var(--diverge-neg); border-radius: 4px 0 0 4px; }
.div-fill.pos { background: var(--diverge-pos); border-radius: 0 4px 4px 0; }
.div-axis {
  display: grid; grid-template-columns: minmax(96px, 152px) 1fr auto; gap: 12px;
  font-size: 11.5px; color: var(--ink-muted); margin-top: 6px;
}
.div-axis-in { display: flex; justify-content: space-between; }

/* --- table view twin (every chart has one) --- */
.tableview { margin-top: 14px; }
.tableview > summary {
  cursor: pointer; font-size: 12.5px; color: var(--ink-muted);
  padding: 4px 0; list-style: none;
}
.tableview > summary::-webkit-details-marker { display: none; }
.tableview > summary::before { content: "▸ "; }
.tableview[open] > summary::before { content: "▾ "; }
.tableview > summary:hover { color: var(--ink); }
.tv-scroll { overflow-x: auto; margin-top: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 7px 12px 7px 0; border-bottom: 1px solid var(--grid); }
th { font-weight: 560; color: var(--ink-2); font-size: 12px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; padding-right: 0; }

/* -------------------------------------------------------------- tooltip */
.tooltip {
  position: fixed; z-index: 90; pointer-events: none; opacity: 0;
  max-width: 264px; padding: 9px 11px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--ring-strong); border-radius: 8px;
  box-shadow: 0 4px 20px -6px rgba(0, 0, 0, .35);
  font-size: 12.5px; line-height: 1.45;
  transition: opacity .12s;
}
.tooltip.on { opacity: 1; }
.tooltip b { display: block; margin-bottom: 2px; }
.tooltip .tt-num { font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------------- results */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 10px; }

.role {
  border: 1px solid var(--ring); border-radius: var(--radius-sm);
  padding: 14px 16px; margin-bottom: 8px; background: var(--surface);
}
.role-top { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; }
.role-name { font-size: 15px; font-weight: 600; }
.role-fit { font-variant-numeric: tabular-nums; font-weight: 620; white-space: nowrap; font-size: 15px; }
.role-fam { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-muted); }
.role p { font-size: 13.5px; color: var(--ink-2); margin-top: 6px; }
.role .risk { border-left: 2px solid var(--serious); padding-left: 10px; margin-top: 9px; }
.role-bar { height: 5px; background: var(--grid); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.role-bar > i { display: block; height: 100%; background: var(--series-1); border-radius: 0 99px 99px 0; }

.flags { display: grid; gap: 9px; }
.flag {
  display: flex; gap: 10px; font-size: 13.5px; color: var(--ink-2);
  border-left: 2px solid var(--warning); padding-left: 11px;
}
.flag b { color: var(--ink); }

.plan { border: 1px solid var(--ring); border-radius: var(--radius-sm); padding: 18px; margin-bottom: 12px; }
.plan-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.plan-arrow { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.plan-arrow .from { color: var(--ink-2); font-weight: 500; }
.plan-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.plan h4 { font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-muted); margin: 18px 0 8px; font-weight: 560; }
.steps { list-style: none; padding: 0; display: grid; gap: 0; }
.steps li { position: relative; padding: 0 0 16px 24px; border-left: 1px solid var(--grid); margin-left: 5px; }
.steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps li::before {
  content: ""; position: absolute; left: -5px; top: 5px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--series-1); box-shadow: 0 0 0 2px var(--surface);
}
.step-phase { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.step-action { font-size: 14.5px; margin-top: 1px; }
.step-ev { font-size: 13px; color: var(--ink-2); margin-top: 3px; }
.step-ev::before { content: "→ "; color: var(--success-text); }
.first-move {
  background: var(--raised); border: 1px solid var(--ring);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-top: 16px; font-size: 14px;
}
.first-move b { display: block; font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 3px; font-weight: 560; }

/* narrative */
.narrative { font-size: 15.5px; }
.narrative h2 {
  font-size: 17px; font-weight: 620; letter-spacing: -.014em;
  margin: 30px 0 10px; padding-top: 18px; border-top: 1px solid var(--grid);
}
.narrative h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.narrative p { margin-bottom: 13px; color: var(--ink-2); line-height: 1.65; }
.narrative strong { color: var(--ink); font-weight: 600; }
.narrative ul { padding-left: 20px; margin-bottom: 13px; color: var(--ink-2); }
.narrative li { margin-bottom: 5px; }
.caret {
  display: inline-block; width: 7px; height: 15px; vertical-align: -2px;
  background: var(--series-1); animation: blink 1.05s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.quote-card {
  border-left: 2px solid var(--series-1); padding: 2px 0 2px 13px; margin-bottom: 14px;
}
.quote-card .q { font-size: 13.5px; color: var(--ink-2); }
.quote-card .a { font-size: 14px; margin-top: 4px; }
.quote-card .grade { font-size: 12.5px; color: var(--ink-muted); margin-top: 4px; }

.foot {
  max-width: 860px; margin: 0 auto; padding: 28px 20px 56px;
  font-size: 12.5px; color: var(--ink-muted); line-height: 1.6;
}
.foot p { max-width: 74ch; }

/* ======================================================================
   ADAPTIVE-SPECIFIC COMPONENTS
   ====================================================================== */

/* Emphasis inside body copy. Kept here rather than inline so the generated
   content in results can be assembled without style attributes. */
figcaption b, .hero-body p b, .role p b, .quote-card .grade b, .plan-p b,
.note b, .flag b { color: var(--ink); font-weight: 600; }

.lede.small { font-size: 14.5px; }
.micro.warn { color: var(--serious); }
.warn-note { border-left: 2px solid var(--warning); }

/* --- "why this question?" ------------------------------------------------
   Python's own targeting reason for the current block, shown verbatim. It costs
   nothing and it is the clearest demonstration that the adaptivity is real. */
.linkish {
  border: 0; background: none; padding: 0; cursor: pointer;
  font-size: 12.5px; color: var(--ink-muted); text-decoration: underline;
  text-underline-offset: 3px;
}
.linkish:hover { color: var(--ink); }
.linkish:focus-visible { outline: 2px solid var(--series-1); outline-offset: 3px; border-radius: 3px; }
.why {
  margin-top: 9px; font-size: 13px; color: var(--ink-2);
  background: var(--raised); border: 1px solid var(--ring);
  border-radius: var(--radius-sm); padding: 11px 13px;
}

/* --- uncertainty band on a bar -----------------------------------------
   Wider where the skill was measured from fewer items. Drawn behind the bar's
   own end, and always duplicated as a ± column in the table twin, so the width
   is never the only way to read it. */
.bar-band {
  position: absolute; top: 50%; height: 5px; transform: translateY(-50%);
  background: color-mix(in srgb, var(--series-1) 26%, transparent);
  border-radius: 3px; pointer-events: none;
}
.bar-val small {
  font-size: 11px; color: var(--ink-muted); margin-left: 3px; font-weight: 400;
}

/* --- roles and plans ---------------------------------------------------- */
.rolelist { margin-top: 16px; }
.role.bare { border: 0; padding: 0 0 14px; }
.plan-p { font-size: 14px; color: var(--ink-2); margin-bottom: 8px; }

/* --- graded answers, with the follow-up shown ---------------------------- */
.quote-card .fu {
  font-size: 13px; color: var(--ink-2); margin-top: 6px;
  border-left: 2px solid var(--baseline); padding-left: 10px;
}
.quote-card .fu b { color: var(--ink); }

/* --- grounded Q&A panel ------------------------------------------------- */
.qa-log { display: grid; gap: 12px; margin: 4px 0 16px; }
.qa-log:empty { margin: 0; }
.qa-turn { font-size: 14.5px; }
.qa-turn > b {
  display: block; font-size: 11px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-muted); margin-bottom: 3px; font-weight: 560;
}
.qa-turn p { color: var(--ink-2); margin-bottom: 8px; line-height: 1.6; }
.qa-turn.you { border-left: 2px solid var(--baseline); padding-left: 12px; }
.qa-turn.them { border-left: 2px solid var(--series-1); padding-left: 12px; }
.qa-turn.pending p { opacity: .7; }
.qa-form { display: flex; gap: 8px; align-items: flex-start; }
.qa-form input { flex: 1 1 auto; }
.qa-left { margin-top: 6px; }

/* -------------------------------------------------------------- responsive */
@media (max-width: 640px) {
  .statrow, .field-row { grid-template-columns: 1fr; }
  .card { padding: 17px; }
  .wrap { padding: 22px 14px 32px; }
  .hero-num { font-size: 48px; }
  .bar-row, .dumb-row, .div-row, .div-axis { grid-template-columns: minmax(74px, 96px) 1fr auto; gap: 9px; }
  .bar-name { font-size: 12.5px; }
  .qa-form { flex-direction: column; }
  .qa-form .btn { width: 100%; }
}

/* -------------------------------------------------------------- print */
@media print {
  :root { --surface: #fff; --plane: #fff; --raised: #fff; --ink: #000; --ink-2: #333; }
  .topbar, .btn, .tooltip, .caret { display: none !important; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .tableview[open] > summary { display: none; }
  .plan, .role { break-inside: avoid; }
}
