/* ============================================================================
   JHSC Findings — Direction B "Data Console" (Paul's pick, 2026-06-18).
   Dark-slate console rail · Manrope headings · Roboto Mono numerals ·
   light breadcrumb status bar · dark "flagship" panels + light panels ·
   navy→clay sentiment heat-grid. OECTA tokens; no-line tonal surfaces.
   Bar widths / heat opacities passed as data-driven custom props --w / --o.
   ============================================================================ */
:root {
  --navy: #204164; --navy-deep: #142a44; --navy-soft: #3a5f87; --slate: #16293d; --slate-2: #1d3349;
  --amber: #f7a922; --amber-deep: #d9850a;
  --clay: #b04933; --clay-soft: #c77a68;
  --green: #2e9b6b; --green-deep: #2e7d5b;
  --ink: #18222f; --ink-soft: #51616f; --ink-faint: #8090a0;
  --surface: #ffffff; --surface-low: #eef1f5; --surface-lower: #e3e9f0; --surface-sink: #d3dbe5;
  --rail: #0f2034; --rail-2: #16293d; --rail-line: rgba(255,255,255,.07); --rail-txt: #aebccd; --rail-faint: #6b81a0;
  --f-display: 'Manrope', system-ui, sans-serif;
  --f-body: 'Inter', system-ui, sans-serif;
  --f-mono: 'Roboto Mono', ui-monospace, monospace;
  --shadow-sm: 0 1px 2px rgba(20,42,68,.05), 0 2px 10px rgba(20,42,68,.06);
  --shadow-md: 0 6px 18px rgba(20,42,68,.10), 0 18px 40px rgba(20,42,68,.12);
  --radius: 12px; --radius-sm: 8px;
  --focus: 0 0 0 3px rgba(247,169,34,.55);
  --maxw: 1120px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--f-body); color: var(--ink); background: var(--surface-low); font-size: 15.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--navy); }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }

/* ── login gate (dark console card) ── */
#gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(130% 130% at 70% 0%, #1d3a5a 0%, var(--navy-deep) 50%, #0c1a2b 100%); }
.gate-card { width: min(460px, 100%); background: var(--rail-2); border-radius: var(--radius);
  padding: 0; box-shadow: var(--shadow-md); overflow: hidden; border: 1px solid var(--rail-line); }
.gate-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 22px;
  background: var(--rail); border-bottom: 1px solid var(--rail-line); font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; color: var(--rail-faint); }
.gate-head b { color: #fff; font-family: var(--f-display); font-weight: 800; letter-spacing: 0; font-size: 13px; }
.gate-head .lock { color: var(--amber); }
.gate-body { padding: 26px 24px 28px; }
.gate-eyebrow { font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--amber); }
.gate-card h1 { font-family: var(--f-display); font-weight: 800; font-size: 25px; line-height: 1.12; margin: 10px 0 8px; color: #fff; letter-spacing: -.01em; }
.gate-card p { color: #9fb1c6; font-size: 13.5px; margin: 0 0 20px; line-height: 1.5; }
.gate-card label { display: block; font-family: var(--f-mono); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--rail-faint); margin-bottom: 7px; }
.gate-card input { width: 100%; font-size: 16px; font-family: var(--f-mono); padding: 13px 14px; border: 1px solid var(--rail-line); background: #0d1b2c; color: #fff; border-radius: var(--radius-sm); letter-spacing: .12em; }
.gate-card input:focus { box-shadow: var(--focus); }
.gate-btn { margin-top: 16px; width: 100%; border: none; background: var(--amber); color: #20140a; font-family: var(--f-display); font-weight: 800; font-size: 14px; padding: 14px; border-radius: var(--radius-sm); cursor: pointer; letter-spacing: .04em; text-transform: uppercase; }
.gate-btn:hover { background: var(--amber-deep); }
.gate-err { color: var(--clay-soft); font-size: 13px; margin-top: 12px; min-height: 18px; font-weight: 600; font-family: var(--f-mono); }
.gate-foot { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .06em; color: var(--rail-faint); margin-top: 18px; text-transform: uppercase; }
.gate-note { margin-top: 10px; font-size: 12px; color: #7e92aa; line-height: 1.45; }

/* ── app shell ── */
#app { display: none; min-height: 100dvh; grid-template-columns: 244px 1fr; }
#app.show { display: grid; }
.rail { background: var(--rail); color: var(--rail-txt); position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; overflow-y: auto; }
.rail__brand { padding: 20px 20px 16px; border-bottom: 1px solid var(--rail-line); }
.rail__brand b { font-family: var(--f-display); font-weight: 800; color: #fff; font-size: 16px; letter-spacing: .02em; display: inline-flex; align-items: center; gap: 7px; }
.rail__brand b::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.rail__brand span { display: block; font-family: var(--f-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--rail-faint); margin-top: 5px; }
.rail nav { padding: 12px 8px; flex: 1; }
.rail a { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: center; padding: 8px 12px; border-radius: 6px; color: var(--rail-txt); text-decoration: none; font-size: 13.5px; font-weight: 600; margin-bottom: 1px; border-left: 2px solid transparent; }
.rail a .ix { font-family: var(--f-mono); font-size: 11px; color: var(--rail-faint); }
.rail a:hover { background: rgba(255,255,255,.05); color: #fff; }
.rail a.active { background: rgba(247,169,34,.12); color: #fff; border-left-color: var(--amber); }
.rail a.active .ix { color: var(--amber); }
.rail__foot { padding: 14px 18px; border-top: 1px solid var(--rail-line); font-family: var(--f-mono); font-size: 10.5px; color: var(--rail-faint); }
.rail__foot button { background: none; border: 1px solid rgba(255,255,255,.16); color: var(--rail-txt); font-size: 11px; padding: 6px 11px; border-radius: 6px; cursor: pointer; margin-top: 9px; font-family: var(--f-mono); letter-spacing: .04em; text-transform: uppercase; }
.rail__foot button:hover { border-color: var(--amber); color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
.topstrip { background: var(--surface); padding: 11px 30px; font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .04em; display: flex; gap: 14px; align-items: center; box-shadow: 0 1px 0 var(--surface-lower); color: var(--ink-soft); }
.topstrip .crumb { text-transform: uppercase; color: var(--navy); font-weight: 500; }
.topstrip .sep { color: var(--surface-sink); }
.topstrip .spacer { flex: 1; }
.topstrip .pill { font-size: 10.5px; padding: 2px 9px; border-radius: 4px; letter-spacing: .06em; }
.topstrip .pill.live { background: #e2f3ea; color: var(--green-deep); }
.topstrip .pill.interim { background: #fdeccd; color: var(--amber-deep); }
.content { flex: 1; min-height: 0; overflow-y: auto; padding: 28px 30px 80px; }
.wrap { max-width: var(--maxw); margin: 0 auto; }

/* ── headers (Manrope, no serif) ── */
.viewhead { margin: 2px 0 20px; }
.viewhead .eyebrow { font-family: var(--f-mono); font-weight: 500; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--amber-deep); }
.viewhead h1 { font-family: var(--f-display); font-weight: 800; font-size: 32px; line-height: 1.08; margin: 5px 0 8px; color: var(--navy-deep); letter-spacing: -.02em; }
.viewhead p { color: var(--ink-soft); max-width: 78ch; margin: 0; font-size: 14.5px; }
.sechead { font-family: var(--f-mono); font-weight: 500; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--navy); margin: 30px 0 12px; padding-left: 11px; position: relative; }
.sechead::before { content: ''; position: absolute; left: 0; top: 1px; bottom: 1px; width: 3px; background: var(--amber); border-radius: 2px; }

/* ── cards / panels ── */
.card { background: var(--surface); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); margin-bottom: 14px; }
.card > .q { font-family: var(--f-display); font-weight: 700; font-size: 15px; color: var(--ink); margin: 0 0 3px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.card > .q .qcode { font-family: var(--f-mono); font-weight: 500; font-size: 11.5px; color: var(--ink-faint); white-space: nowrap; }
.card > .qmeta { font-size: 12px; color: var(--ink-faint); margin: 0 0 13px; font-family: var(--f-mono); }
.qnote { font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); background: var(--surface-low); border-left: 3px solid var(--amber); border-radius: 0 6px 6px 0; padding: 9px 13px; margin: 0 0 13px; }

/* ── revealings (flagship dark + 2-col grid) ── */
.reveal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.rpanel { background: var(--surface); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.rpanel.flag { background: linear-gradient(135deg, var(--slate) 0%, #0f2236 100%); color: #e8eef5; margin-bottom: 13px; padding: 22px 24px; display: grid; grid-template-columns: 1fr auto; gap: 8px 26px; align-items: start; }
.rpanel.flag h3 { grid-column: 1; }
.rpanel.flag .rnums { grid-column: 1 / -1; }
.rtag { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 9px; }
.rtag.tension { color: var(--clay); }
.rpanel.flag .rtag { color: var(--amber); grid-column: 2; justify-self: end; }
.rpanel h3 { font-family: var(--f-display); font-weight: 700; font-size: 16.5px; line-height: 1.25; margin: 0 0 12px; color: var(--navy-deep); letter-spacing: -.01em; }
.rpanel.flag h3 { color: #fff; font-size: 22px; max-width: 22ch; }
.rnums { display: flex; gap: 18px; flex-wrap: wrap; align-items: baseline; margin-bottom: 10px; }
.rpanel.flag .rnums { gap: 30px; }
.big { font-family: var(--f-display); font-weight: 800; font-size: 26px; color: var(--navy); line-height: 1; font-variant-numeric: tabular-nums; }
.rpanel.flag .big { font-size: 40px; color: #fff; }
.big.neg { color: var(--clay); }
.rpanel.flag .big.neg { color: var(--clay-soft); }
.big small { font-family: var(--f-mono); font-weight: 400; font-size: 11.5px; color: var(--ink-faint); display: block; margin-top: 5px; max-width: 20ch; }
.rpanel.flag .big small { color: #9fb1c6; }
.vs { font-family: var(--f-mono); font-style: normal; color: var(--clay-soft); font-size: 13px; align-self: center; text-transform: uppercase; letter-spacing: .08em; }
.caveat { font-size: 12px; color: var(--ink-soft); font-family: var(--f-mono); line-height: 1.45; }
.rpanel.flag .caveat { color: #9fb1c6; grid-column: 1 / -1; }

/* ── bars ── */
.bars { display: flex; flex-direction: column; gap: 8px; }
.barwrap { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline; margin-bottom: 1px; }
.barwrap .lab { font-size: 13px; }
.barwrap .track2 { grid-column: 1 / -1; height: 18px; background: var(--surface-lower); border-radius: 5px; position: relative; overflow: hidden; }
.barwrap .fill2 { position: absolute; inset: 0 auto 0 0; width: calc(var(--w) * 1%); background: var(--navy); }
.barwrap .fill2.neg { background: var(--clay); }
.barwrap .ciband { position: absolute; top: 3px; bottom: 3px; left: calc(var(--lo) * 1%); width: calc((var(--hi) - var(--lo)) * 1%); border-left: 2px solid var(--amber-deep); border-right: 2px solid var(--amber-deep); border-radius: 1px; pointer-events: none; }
.barwrap .ciband::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1.5px; background: var(--amber-deep); transform: translateY(-50%); }
.barwrap .figs { font-family: var(--f-mono); white-space: nowrap; display: inline-flex; gap: 7px; align-items: baseline; justify-self: end; }
.barwrap .figs .pc { font-weight: 700; color: var(--navy-deep); font-size: 13px; }
.barwrap .figs .ct { color: var(--ink-faint); font-size: 11.5px; }
.barwrap .figs .ci { color: var(--ink-faint); font-size: 10.5px; }

/* ── diverging stacked Likert bar ── */
.divrow { margin: 11px 0; }
.divrow .dlab { font-size: 13px; margin-bottom: 5px; display: flex; justify-content: space-between; gap: 10px; }
.divrow .dlab .net { font-family: var(--f-mono); font-weight: 700; }
.divbar { display: flex; height: 24px; border-radius: 5px; overflow: hidden; background: var(--surface-lower); }
.divseg { height: 100%; display: grid; place-items: center; font-family: var(--f-mono); font-size: 11px; color: #fff; min-width: 0; }
.divseg.s-pos2 { background: var(--navy-deep); } .divseg.s-pos1 { background: var(--navy-soft); }
.divseg.s-neu { background: #aeb9c6; color: #2a3744; }
.divseg.s-neg1 { background: var(--clay-soft); } .divseg.s-neg2 { background: var(--clay); }
.divseg.s-na { background: var(--surface-sink); color: var(--ink-faint); }
.divlegend { display: flex; gap: 13px; flex-wrap: wrap; font-size: 11px; color: var(--ink-soft); margin-top: 8px; font-family: var(--f-mono); }
.divlegend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; vertical-align: middle; margin-right: 4px; }

/* ── heat-grid ── */
.heatwrap { overflow-x: auto; }
.heat { border-collapse: separate; border-spacing: 4px; min-width: 540px; width: 100%; }
.heat th { font-family: var(--f-mono); font-weight: 500; font-size: 10.5px; letter-spacing: .04em; color: var(--ink-soft); text-align: center; padding: 3px 5px; vertical-align: bottom; }
.heat th.rowh { text-align: left; width: 36%; }
.heat td.rl { font-size: 12.5px; color: var(--ink); padding-right: 8px; }
.heat td.cell { text-align: center; border-radius: 5px; font-family: var(--f-mono); font-size: 12.5px; font-weight: 600; padding: 9px 4px; color: var(--ink); position: relative; }
.heat td.cell .v { position: relative; z-index: 1; }
.heat td.cell .bg { position: absolute; inset: 0; border-radius: 5px; opacity: var(--o); }
.heat td.cell.pos .bg { background: var(--navy); } .heat td.cell.neu .bg { background: #8794a3; } .heat td.cell.neg .bg { background: var(--clay); }
.heat td.cell.na { color: var(--ink-faint); }
.heat td.cell.hot { color: #fff; }
.heat td.netc { font-family: var(--f-mono); font-weight: 700; text-align: center; color: var(--navy-deep); font-size: 12px; }
.heatcap { font-size: 12px; color: var(--ink-soft); margin-top: 12px; font-family: var(--f-body); line-height: 1.45; }

/* ── chips / kpis ── */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--surface); border-radius: var(--radius); padding: 15px 18px; box-shadow: var(--shadow-sm); }
.kpi.flag { background: linear-gradient(135deg, var(--slate) 0%, #0f2236 100%); }
.kpi .kl { font-family: var(--f-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); }
.kpi.flag .kl { color: var(--amber); }
.kpi .v { font-family: var(--f-display); font-weight: 800; font-size: 30px; color: var(--navy); line-height: 1.05; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi.flag .v { color: #fff; }
.kpi .v.green { color: var(--green-deep); }
.kpi .ks { font-family: var(--f-mono); font-size: 11px; color: var(--ink-faint); margin-top: 4px; }
.kpi.flag .ks { color: #9fb1c6; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-family: var(--f-mono); font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 5px; background: var(--surface-lower); color: var(--ink-soft); }
.chip.net-pos { background: #e2f3ea; color: var(--green-deep); }
.chip.net-neg, .chip.gap { background: #f6e7e3; color: var(--clay); }
.chip.caution { background: #fdeccd; color: var(--amber-deep); }
.chip.small { background: var(--surface-lower); color: var(--ink-faint); }
.summaryline { display: flex; gap: 9px; flex-wrap: wrap; margin: 10px 0 4px; }

/* ── rating (vital sign) ── */
.rating { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.rating .num { font-family: var(--f-display); font-weight: 800; font-size: 44px; color: var(--navy); line-height: 1; font-variant-numeric: tabular-nums; }
.rating .num small { font-size: 17px; color: var(--ink-faint); }
.rating .sub { font-family: var(--f-mono); font-size: 11.5px; color: var(--ink-soft); }
.dist { display: flex; align-items: flex-end; gap: 4px; height: 62px; }
.dist .b { flex: 1; background: var(--navy-soft); border-radius: 3px 3px 0 0; min-height: 2px; height: calc(var(--w) * 1%); position: relative; }
.dist .b span { position: absolute; top: -15px; left: 0; right: 0; text-align: center; font-family: var(--f-mono); font-size: 10px; color: var(--ink-faint); }
.dist .b em { position: absolute; bottom: -16px; left: 0; right: 0; text-align: center; font-family: var(--f-mono); font-size: 10px; color: var(--ink-faint); font-style: normal; }

/* ── knowledge check ── */
.kc { width: 100%; min-width: 560px; border-collapse: collapse; }
.kc th { font-family: var(--f-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); text-align: right; padding: 8px 10px; border-bottom: 2px solid var(--surface-lower); }
.kc th.l { text-align: left; }
.kc td { padding: 11px 10px; border-bottom: 1px solid var(--surface-low); font-size: 13px; vertical-align: top; }
.kc td.r { text-align: right; font-family: var(--f-mono); }
.kc td .ans { font-family: var(--f-mono); font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 4px; margin-left: 6px; }
.kc td .ans.T { background: #e2f3ea; color: var(--green-deep); } .kc td .ans.F { background: #f6e7e3; color: var(--clay); }
.kc .pcorrect { font-weight: 700; color: var(--navy-deep); }
.kc .cisub { font-size: 10.5px; color: var(--ink-faint); }
.kc tr.worst td { background: #fdf4e3; }

/* ── raw table ── */
.rawctl { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; font-size: 13px; font-family: var(--f-mono); }
.rawctl select, .rawctl button { font-family: var(--f-mono); font-size: 12.5px; padding: 7px 11px; border: none; background: var(--surface); border-radius: 7px; box-shadow: var(--shadow-sm); cursor: pointer; }
.rawrow { background: var(--surface); border-radius: 9px; box-shadow: var(--shadow-sm); margin-bottom: 6px; overflow: hidden; }
.rawrow summary { list-style: none; cursor: pointer; padding: 11px 16px; display: grid; grid-template-columns: 42px 1fr auto auto; gap: 12px; align-items: center; font-family: var(--f-mono); font-size: 12.5px; }
.rawrow summary::-webkit-details-marker { display: none; }
.rawrow .pill { font-family: var(--f-mono); font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 5px; }
.rawrow .pill.v { background: #e2f3ea; color: var(--green-deep); } .rawrow .pill.src { background: var(--surface-lower); color: var(--ink-soft); }
.rawrow .ans { padding: 4px 16px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
.rawrow .ans div { font-size: 12px; border-bottom: 1px solid var(--surface-low); padding: 5px 0; }
.rawrow .ans b { font-family: var(--f-mono); font-weight: 500; color: var(--ink-soft); font-size: 10.5px; display: block; text-transform: uppercase; letter-spacing: .03em; }

/* ── open-text coded themes ── */
.ot-list { display: flex; flex-direction: column; gap: 17px; }
.ot-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.ot-lab { font-family: var(--f-display); font-weight: 700; font-size: 14px; color: var(--ink); }
.ot-n { font-weight: 700; color: var(--navy-deep); font-size: 14px; }
.ot-q { font-size: 13px; color: var(--ink-soft); font-style: italic; margin-top: 7px; padding-left: 12px; border-left: 2px solid var(--surface-sink); line-height: 1.5; }

/* ── methods / prose ── */
.prose { background: var(--surface); border-radius: var(--radius); padding: 24px 26px; box-shadow: var(--shadow-sm); max-width: 80ch; }
.prose h3 { font-family: var(--f-display); font-weight: 800; color: var(--navy); margin: 20px 0 7px; font-size: 15.5px; }
.prose p, .prose li { font-size: 14px; color: var(--ink); }
.prose ul { padding-left: 20px; }
.callout { background: #fdf4e3; border-radius: var(--radius-sm); padding: 13px 17px; font-size: 13px; color: #6b4b12; margin: 14px 0; font-family: var(--f-mono); }

/* ── banners ── */
.banner { background: var(--slate); color: #dce6f1; border-radius: var(--radius-sm); padding: 12px 18px; font-size: 13px; margin-bottom: 18px; line-height: 1.5; }
.banner.warn { background: #fdf4e3; color: #6b4b12; }
.banner b { font-family: var(--f-display); }

/* ── responsive ── */
@media (max-width: 880px) {
  #app.show { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; }
  .rail nav { display: flex; flex-wrap: wrap; gap: 3px; }
  .rail a { margin: 0; border-left: none; }
  .main { height: auto; overflow: visible; }
  .content { height: auto; overflow: visible; padding: 20px 15px 60px; }
  .topstrip { padding: 10px 15px; flex-wrap: wrap; }
  .viewhead h1 { font-size: 26px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .reveal-grid { grid-template-columns: 1fr; }
  .rpanel.flag { grid-template-columns: 1fr; }
  .rpanel.flag .rtag { justify-self: start; grid-column: 1; }
  .rating { grid-template-columns: 1fr; gap: 12px; }
  .rawrow .ans { grid-template-columns: 1fr; }
}
@media (max-width: 520px) { .kpis { grid-template-columns: 1fr; } }
