/* Patient Journey demo: DataView 360° console look, rebuilt for clarity. */
:root {
  --side: #2e7895;
  --side-active: rgba(255, 255, 255, 0.16);
  --tab-accent: #5db8a6;
  --brand: #3f7d70;
  --brand-strong: #33685d;
  --brand-soft: #e6f2ef;

  --ink: #1b2230;
  --ink-2: #454f61;
  --muted: #5e6879;
  --bg: #f3f5f8;
  --card: #ffffff;
  --line: #e3e7ed;
  --line-soft: #eef1f5;
  --axis: #c9d0da;

  --data: #2b7a99;
  --data-strong: #1d5d76;
  --data-soft: #d3e7ef;
  --data-track: #edf3f6;

  --leak: #c2570c;
  --leak-ink: #93400a;
  --leak-soft: #fbe0c9;

  --good: #23784a;
  --good-soft: #e2f2e8;
  --late: #e0a12e;
  --bad: #b42318;
  --bad-soft: #fdeceb;

  --warn-bg: #fff7eb;
  --warn-line: #f2dab4;
  --warn-ink: #6e3805;

  --hatch: repeating-linear-gradient(135deg, #eef1f4 0 6px, #f8f9fb 6px 12px);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 14px rgba(16, 24, 40, 0.04);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Poppins, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--data-strong); }
button { font: inherit; color: inherit; }
p { margin: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--data); outline-offset: 2px; border-radius: 4px; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--side); color: #fff; display: flex; flex-direction: column; padding: 22px 14px 18px; position: sticky; top: 0; height: 100vh; }
.brand { padding: 4px 10px 26px; }
.brand img { width: 120px; height: auto; display: block; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 8px; font-size: 14px; font-weight: 500; color: #fff; }
.side-item.active { background: var(--side-active); }
.side-item.program { font-size: 12px; letter-spacing: 0.04em; }
.switch-pill { border: 1px solid rgba(255, 255, 255, 0.8); border-radius: 6px; padding: 1px 6px; font-size: 10px; letter-spacing: 0.08em; margin-left: auto; }
.side-ico svg { width: 22px; height: 22px; display: block; }
.side-sub { margin-left: 18px; padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, 0.35); display: flex; flex-direction: column; gap: 2px; }
.side-foot { margin-top: auto; font-size: 11px; color: rgba(255, 255, 255, 0.85); padding: 0 10px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: stretch; justify-content: space-between; gap: 16px; padding: 0 32px; min-height: 60px; position: sticky; top: 0; z-index: 5; }
.tabs { display: flex; gap: 28px; align-items: stretch; overflow-x: auto; }
.tab { display: inline-flex; align-items: center; font-size: 15px; color: var(--ink-2); text-decoration: none; border-bottom: 3px solid transparent; padding-top: 3px; white-space: nowrap; min-height: 44px; }
.tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--tab-accent); font-weight: 500; }
.tab.inert { color: var(--muted); cursor: default; }
.top-tools { display: flex; align-items: center; gap: 14px; }
.search { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; height: 36px; width: 250px; color: var(--muted); }
.search input { border: 0; outline: 0; background: transparent; font: inherit; font-size: 12px; flex: 1; min-width: 0; }
.search svg, .top-ico svg { width: 20px; height: 20px; display: block; }
.top-ico { color: var(--side); }

#view { padding: 24px 32px 56px; max-width: 1640px; width: 100%; outline: none; }

/* ---------- page header ---------- */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 18px 24px; }
.ph-main { min-width: 0; flex: 1 1 420px; }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; margin: 0; }
h1:focus { outline: none; }
.question { margin-top: 6px; font-size: 15px; color: var(--ink-2); max-width: 680px; }
.context { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 13px; color: var(--muted); }
.context li { display: inline-flex; align-items: center; gap: 6px; }
.context svg { width: 15px; height: 15px; }
.demo-badge { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--warn-ink); background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 999px; padding: 3px 10px; }
.ph-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

.switch { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.switch-label { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.seg { display: inline-flex; flex-wrap: wrap; background: #e9edf2; border-radius: 12px; padding: 4px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--ink-2); padding: 0 18px; min-height: 42px; border-radius: 9px; cursor: pointer; font-size: 14px; font-weight: 500; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(16, 24, 40, 0.12); font-weight: 600; }
.seg button:not([aria-pressed="true"]):hover { color: var(--ink); }

.subnav-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0 18px; border-bottom: 1px solid var(--line); }
.subnav-row .btn { flex: none; }
.subnav { display: flex; gap: 28px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 500; padding: 10px 0 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.subnav a:hover { color: var(--ink); }
.subnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brand); font-weight: 600; }

/* ---------- buttons ---------- */
.btn { min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-strong); }
.btn.primary:disabled { background: #a9c3bd; cursor: not-allowed; }
.btn.secondary, .btn.ghost { background: #fff; color: var(--ink); border-color: #cfd6df; }
.btn.secondary:hover, .btn.ghost:hover { background: #f5f7fa; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; background: #fff; border-color: #cfd6df; color: var(--ink); }
.btn.small:hover { background: #f5f7fa; }
.btn.small svg { width: 15px; height: 15px; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; cursor: pointer; color: var(--data-strong); font-weight: 600; font-size: 13px; text-decoration: none; min-height: 32px; }
.link-btn svg { width: 15px; height: 15px; transition: transform 0.15s; }
.link-btn:hover svg { transform: translateX(3px); }

.info { border: 0; background: transparent; padding: 0; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); cursor: help; border-radius: 50%; vertical-align: middle; flex: none; }
.info svg { width: 16px; height: 16px; }
.info:hover { color: var(--ink); background: var(--line-soft); }

.notice { display: flex; gap: 12px; align-items: flex-start; background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-size: 13.5px; }
.notice svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.notice strong { font-weight: 600; }

/* ---------- insights ---------- */
.insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; margin-bottom: 16px; }
.insight { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.ins-top { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.ins-ico { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--data-track); color: var(--data-strong); flex: none; }
.ins-ico svg { width: 18px; height: 18px; }
.insight.leak .ins-ico { background: var(--leak-soft); color: var(--leak-ink); }
.insight.blind .ins-ico { background: #eceff3; color: var(--ink-2); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.ins-value { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.insight.leak .ins-value { color: var(--leak-ink); }
.ins-text { font-size: 13.5px; color: var(--ink-2); flex: 1; }
.insight .link-btn { margin-top: 4px; align-self: flex-start; }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 0; }
.kpi-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.kpi h3 { font-size: 13.5px; font-weight: 500; color: var(--ink-2); margin: 0; }
.kpi-value { font-size: 32px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; margin-top: 6px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.kpi-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.kpi-viz { margin-top: 14px; }
.kpi-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 12px; font-size: 12.5px; font-weight: 600; color: var(--data-strong); text-decoration: none; align-self: flex-start; min-height: 24px; }
.kpi-link svg { width: 14px; height: 14px; transition: transform 0.15s; }
.kpi-link:hover svg { transform: translateX(3px); }
.kpi.is-blind { background: var(--hatch); border: 1.5px dashed #bcc4cf; box-shadow: none; }
.kpi-blind { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 600; color: var(--ink-2); margin-top: 10px; }
.kpi-blind svg { width: 20px; height: 20px; }
.kpi-sub.need, .need { color: var(--leak-ink); font-weight: 600; }

.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 2px 8px; letter-spacing: 0; align-self: center; white-space: nowrap; }
.delta svg { width: 12px; height: 12px; }
.delta.up { background: var(--good-soft); color: var(--good); }
.delta.down { background: var(--bad-soft); color: var(--bad); }

.spark { position: relative; height: 40px; }
.spark svg { width: 100%; height: 100%; display: block; overflow: visible; }
.spark-area { fill: var(--data-soft); opacity: 0.7; }
.spark-line { fill: none; stroke: var(--data); stroke-width: 2px; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark-dot { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--data); border: 2px solid #fff; transform: translate(-50%, -50%); box-shadow: 0 0 0 1px var(--data); }
.mini-bars { display: flex; align-items: flex-end; gap: 4px; height: 40px; }
.mini-bars span { flex: 1; background: var(--data); border-radius: 3px 3px 0 0; min-height: 3px; }
.mini-bars span.hot { background: var(--leak); }
.mini-axis { display: flex; justify-content: space-between; gap: 4px; font-size: 11px; color: var(--muted); margin-top: 5px; }
.mini-bars + .mini-axis span { flex: 1; text-align: center; }
.mini-bars + .mini-axis span:first-child { text-align: left; }
.mini-bars + .mini-axis span:last-child { text-align: right; }
.meter { height: 10px; background: var(--data-track); border-radius: 999px; overflow: hidden; margin-top: 18px; }
.meter span { display: block; height: 100%; background: var(--data); border-radius: 999px; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; margin-bottom: 20px; min-width: 0; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px 20px; margin-bottom: 20px; }
.card-head > div { min-width: 0; }
.card-head h2 { font-size: 16.5px; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 4px; letter-spacing: -0.005em; }
.card-head p { margin-top: 3px; font-size: 13px; color: var(--muted); }
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 20px; margin-bottom: 20px; }
.pair > .card { margin-bottom: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.note { font-size: 12px; color: var(--muted); margin-top: 8px; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lg-bar { background: var(--data); }
.lg-leak { background: var(--leak-soft); box-shadow: inset 0 0 0 1px var(--leak); }
.lg-blind { background: var(--hatch); box-shadow: inset 0 0 0 1px #b2bac6; }

.chart-note { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink-2); margin-top: 14px; }
.chart-note svg { width: 17px; height: 17px; flex: none; margin-top: 1px; color: var(--data); }
.chart-note b { font-weight: 600; color: var(--ink); }
.chart-note.warn { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 10px; padding: 10px 12px; color: var(--warn-ink); }
.chart-note.warn svg { color: var(--leak); }
.chart-note.warn b { color: var(--warn-ink); }

/* ---------- blind panel ---------- */
.blind-panel { background: var(--hatch); border: 1.5px dashed #bcc4cf; border-radius: 12px; padding: 28px 20px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; color: var(--ink-2); min-height: 200px; justify-content: center; }
.blind-ico { width: 44px; height: 44px; border-radius: 50%; background: #fff; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08); margin-bottom: 4px; }
.blind-ico svg { width: 22px; height: 22px; }
.blind-panel strong { color: var(--ink); font-size: 15px; font-weight: 600; }
.blind-panel > span:not(.blind-ico) { font-size: 13px; }
.blind-panel .btn { margin-top: 8px; }

/* ---------- flow chart ---------- */
.flow-wrap { container-type: inline-size; }
.flow { display: block; }
.flow-heads, .flow-foot { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.flow-heads li { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 6px 14px; min-width: 0; }
.fh-name { font-size: 13px; font-weight: 500; color: var(--ink-2); line-height: 1.3; min-height: 2.6em; display: flex; align-items: flex-end; justify-content: center; }
.fh-val { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; margin-top: 4px; font-variant-numeric: tabular-nums; }
.fh-val.unknown { color: #9aa3b0; }
.fh-meta { font-size: 12px; color: var(--muted); }
.flow-plot { position: relative; height: clamp(120px, 19vh, 190px); border-bottom: 1px solid var(--axis); }
.flow-ribbons { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rib { fill: var(--data-soft); opacity: 0.75; }
.rib.leak { fill: var(--leak-soft); opacity: 1; }
.flow-bar { position: absolute; bottom: 0; background: var(--data); border-radius: 6px 6px 0 0; transition: filter 0.15s; }
.flow-bar:hover { filter: brightness(1.12); }
.flow-blind { position: absolute; top: 0; bottom: 0; background: var(--hatch); border: 1.5px dashed #b6bec9; border-bottom: 0; border-radius: 6px 6px 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--warn-ink); font-size: 11px; font-weight: 600; line-height: 1.35; text-align: center; padding: 0 8px; }
.flow-blind svg { width: 20px; height: 20px; }
.flow-drops { position: relative; height: 62px; }
.drop { position: absolute; top: 10px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; line-height: 1.25; padding: 5px 10px; border-radius: 9px; background: #f2f5f8; white-space: nowrap; cursor: default; }
.drop b { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.drop span { font-size: 11px; color: var(--muted); }
.drop em { font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--leak-ink); }
.drop.leak { background: var(--leak-soft); top: 4px; }
.drop.leak b { color: var(--leak-ink); }
.drop.leak span { color: var(--warn-ink); }
.flow-foot li { display: flex; justify-content: center; padding: 0 4px; min-width: 0; }
.src { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-2); background: #f2f5f8; border-radius: 999px; padding: 4px 10px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); flex: none; }
.src.off { background: var(--warn-bg); color: var(--warn-ink); }
.src.off i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--leak); }

.flow-list { display: none; list-style: none; margin: 0; padding: 0; }
.flow-list > li + li { margin-top: 4px; }
.fl-step { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 6px 0; }
.fl-name { display: flex; flex-direction: column; min-width: 0; }
.fl-name b { font-size: 14px; font-weight: 600; }
.fl-name span { font-size: 12px; color: var(--muted); }
.fl-val { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.fl-val.unknown { color: #9aa3b0; }
.fl-track { grid-column: 1 / -1; height: 12px; background: var(--data-track); border-radius: 999px; overflow: hidden; }
.fl-track span { display: block; height: 100%; background: var(--data); border-radius: 999px; }
.fl-track.blind-track { background: var(--hatch); box-shadow: inset 0 0 0 1px #c3cad4; }
.fl-need { grid-column: 1 / -1; font-size: 12px; font-weight: 600; color: var(--leak-ink); }
.fl-drop { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 4px 10px; background: #f2f5f8; border-radius: 999px; margin: 2px 0; }
.fl-drop svg { width: 13px; height: 13px; }
.fl-drop.leak { background: var(--leak-soft); color: var(--leak-ink); font-weight: 600; }

@container (max-width: 700px) {
  .fw-6 .flow { display: none; }
  .fw-6 .flow-list { display: block; }
}
@container (max-width: 400px) {
  .fw-4 .flow { display: none; }
  .fw-4 .flow-list { display: block; }
}

/* ---------- line chart ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-axis { fill: var(--muted); font-size: 12px; font-family: inherit; }
.ch-axis.last { fill: var(--ink); font-weight: 600; }
.ch-area { fill: var(--data-soft); opacity: 0.55; }
.ch-line { fill: none; stroke: var(--data); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.ch-dot { fill: var(--data); stroke: #fff; stroke-width: 2; }
.ch-dot.last { fill: var(--data-strong); }
.ch-val { fill: var(--ink-2); font-size: 12px; font-weight: 500; font-family: inherit; }
.ch-val.last { fill: var(--ink); font-size: 14px; font-weight: 700; }
.ch-hit { fill: transparent; cursor: default; }
.ch-hit:hover { fill: rgba(43, 122, 153, 0.06); }

/* ---------- histogram ---------- */
.hist { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; align-items: end; height: 230px; border-bottom: 1px solid var(--axis); }
.hcol { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; min-width: 0; }
.htags { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.tag { font-size: 10.5px; font-weight: 600; color: var(--data-strong); background: var(--data-track); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.hval { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hbar { width: 100%; max-width: 64px; background: var(--data); border-radius: 6px 6px 0 0; min-height: 4px; }
.hcol.late .hbar { background: var(--leak); }
.hcol.late .hval { color: var(--leak-ink); }
.hlabels { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-top: 8px; }
.hlabels span { text-align: center; font-size: 12px; color: var(--muted); }

/* ---------- actions (blockers) ---------- */
.act-list { list-style: none; margin: 0; padding: 0; }
.act { display: grid; grid-template-columns: 136px minmax(0, 1fr) 150px 36px; gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.act:first-child { border-top: 0; padding-top: 0; }
.stage { justify-self: start; font-size: 11.5px; font-weight: 600; color: var(--data-strong); background: var(--data-track); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.act-main { display: flex; flex-direction: column; min-width: 0; }
.act-main b { font-size: 14px; font-weight: 600; }
.act-main span { font-size: 12.5px; color: var(--muted); }
.act-impact { display: flex; flex-direction: column; min-width: 0; }
.act-num { font-size: 20px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.act-num-label { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.act-blind { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.act-blind svg { width: 15px; height: 15px; }
.act.is-blind .act-main b { color: var(--ink-2); }
.act-link { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--data-strong); border: 1px solid var(--line); }
.act-link:hover { background: var(--data-track); }
.act-link svg { width: 17px; height: 17px; }

/* ---------- coverage ---------- */
.cov-count { font-size: 14px; color: var(--muted); }
.cov-count b { font-size: 22px; color: var(--ink); font-weight: 600; }
.cov-meter { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin: -6px 0 16px; }
.cov-meter span { height: 8px; border-radius: 999px; background: #e1e6ec; }
.cov-meter span.on { background: var(--brand); }
.cov-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); column-gap: 32px; }
.cov-list li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.cov-ico { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--good-soft); color: var(--good); }
.cov-list li.off .cov-ico { background: var(--warn-bg); color: var(--leak); }
.cov-ico svg { width: 16px; height: 16px; }
.cov-list b { display: block; font-size: 13.5px; font-weight: 600; }
.cov-list div span { font-size: 12px; color: var(--muted); }
.cov-state { font-size: 12px; font-weight: 600; color: var(--good); }

/* ---------- conversion: stuck ---------- */
.stuck-list { list-style: none; margin: 0; padding: 0; }
.stuck-list li { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(120px, 1fr) 80px; gap: 20px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.stuck-list li:first-child { border-top: 0; padding-top: 0; }
.stuck-main { display: flex; flex-direction: column; min-width: 0; }
.stuck-main b { font-size: 14px; font-weight: 600; }
.stuck-main span { font-size: 12.5px; color: var(--muted); }
.stuck-bar { height: 12px; background: var(--data-track); border-radius: 999px; overflow: hidden; }
.stuck-bar span { display: block; height: 100%; background: var(--data); border-radius: 999px; }
.stuck-num { font-size: 20px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; line-height: 1.2; }
.stuck-num small { font-size: 11.5px; font-weight: 500; color: var(--muted); }

/* ---------- persistence ---------- */
.equation { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1.2fr); align-items: stretch; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; overflow: hidden; }
.eq-term { padding: 20px 24px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.eq-term.result { background: var(--warn-bg); }
.eq-label { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.eq-val { font-size: 34px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.eq-val.good { color: var(--good); }
.eq-val.bad { color: var(--leak-ink); }
.eq-sub { font-size: 12.5px; color: var(--muted); }
.eq-term.result .eq-sub { color: var(--warn-ink); }
.eq-op { display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 300; color: #9aa3b0; padding: 0 4px; }

.timing { display: grid; gap: 16px; }
.stack { display: flex; gap: 2px; height: 30px; border-radius: 8px; overflow: hidden; }
.stack span { min-width: 4px; }
.stack .ok, .stack-legend i.ok { background: var(--data); }
.stack .late, .stack-legend i.late { background: var(--late); }
.stack .lapsed, .stack-legend i.lapsed { background: var(--bad); }
.stack-legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px 20px; }
.stack-legend li { display: flex; gap: 10px; align-items: flex-start; }
.stack-legend i { width: 12px; height: 12px; border-radius: 3px; margin-top: 7px; flex: none; }
.stack-legend b { display: block; font-size: 20px; font-weight: 600; line-height: 1.3; font-variant-numeric: tabular-nums; }
.stack-legend span { font-size: 12.5px; color: var(--muted); }
.stack-legend li.median { border-left: 1px solid var(--line); padding-left: 20px; }

.worklist .card-head { margin-bottom: 14px; }
.wl-stats { display: flex; gap: 22px; }
.wl-stats span { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); line-height: 1.3; }
.wl-stats b { font-size: 28px; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.wl-stats .hot b { color: var(--bad); }
.wl-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }

.scroll-box { position: relative; max-height: 440px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 620px; }
th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #f8f9fb; position: sticky; top: 0; z-index: 1; }
td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafbfc; }
td.strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.cb { width: 44px; padding-right: 0; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; margin: 0; vertical-align: middle; }
.overdue { display: flex; align-items: center; gap: 10px; }
.od-track { width: 90px; height: 8px; background: var(--data-track); border-radius: 999px; overflow: hidden; flex: none; }
.od-track span { display: block; height: 100%; background: var(--leak); border-radius: 999px; }
.overdue b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.urgency { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--bad); background: var(--bad-soft); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.urgency svg { width: 13px; height: 13px; }

/* ---------- tooltip & toast ---------- */
#tip { position: fixed; z-index: 50; max-width: 300px; background: #1b2230; color: #fff; font-size: 12px; line-height: 1.45; padding: 8px 10px; border-radius: 8px; pointer-events: none; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 8px); background: #1b2230; color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 13px; opacity: 0; transition: opacity 0.2s, transform 0.2s; pointer-events: none; z-index: 60; max-width: calc(100vw - 32px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1000px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side-item.program { white-space: nowrap; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; padding: 10px 16px; gap: 12px; }
  .brand { padding: 0; }
  .brand img { width: 92px; }
  .side-nav { flex-direction: row; gap: 0; margin-left: auto; }
  .side-nav > .side-item, .side-sub, .side-foot { display: none; }
  .side-nav > .side-item.program { display: flex; padding: 6px 8px; }
  .topbar { padding: 0 16px; }
  .search { display: none; }
  #view { padding: 20px 16px 40px; }
  .equation { grid-template-columns: 1fr; }
  .eq-op { padding: 0; height: 22px; font-size: 22px; }
  .eq-term { padding: 14px 20px; }
}
@media (max-width: 720px) {
  h1 { font-size: 23px; }
  .card { padding: 18px 16px; }
  .act { grid-template-columns: minmax(0, 1fr) 36px; gap: 8px 12px; }
  .act .stage { grid-column: 1 / -1; }
  .act-main { grid-column: 1; }
  .act-impact { grid-column: 1; flex-direction: row; align-items: baseline; gap: 8px; }
  .act-link, .act-link-empty { grid-column: 2; grid-row: 2 / span 2; }
  .stuck-list li { grid-template-columns: minmax(0, 1fr) 64px; gap: 8px 16px; }
  .stuck-bar { grid-column: 1 / -1; grid-row: 2; }
  .hist, .hlabels { gap: 6px; }
  .hlabels span { font-size: 11px; }
  .stack-legend li.median { border-left: 0; padding-left: 0; }
  .ph-actions { width: 100%; }
}

/* ---------- print (Download PDF) ---------- */
@media print {
  .sidebar, .topbar, .switch, .btn, .wl-actions, .info, .skip, .subnav, .link-btn, .kpi-link, .act-link, .cb { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
  #view { padding: 0; max-width: none; }
  .card, .kpi, .insight, .equation { box-shadow: none; break-inside: avoid; }
  .scroll-box { max-height: none; overflow: visible; }
  .split { grid-template-columns: 1fr; }
}

/* ---------- unlock panel (whole screen blind) ---------- */
.unlock { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; padding: 36px; background: var(--card); }
.unlock-intro { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.unlock-intro h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin: 6px 0 0; line-height: 1.3; }
.unlock-intro p { color: var(--ink-2); font-size: 14px; max-width: 460px; }
.unlock-intro .btn { margin-top: 8px; }
.unlock-intro .blind-ico { background: var(--line-soft); box-shadow: none; }
.unlock-list { background: var(--hatch); border: 1.5px dashed #bcc4cf; border-radius: 12px; padding: 20px 22px; }
.unlock-list ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
.unlock-list li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; align-items: center; background: #fff; border-radius: 10px; padding: 10px 12px; }
.unlock-list li .cov-ico { background: var(--line-soft); color: var(--muted); }
.unlock-list b { display: block; font-size: 13.5px; font-weight: 600; }
.unlock-list li div span { font-size: 12px; color: var(--muted); }
@media (max-width: 900px) { .unlock { grid-template-columns: 1fr; padding: 22px 18px; } }


/* ---------- review pass ---------- */
/* #2/#9: step sub-label (e.g. "reached 3rd fill") */
.fh-sub { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
/* #3: five-step conversion path switches to the list when narrow */
@container (max-width: 560px) {
  .fw-5 .flow { display: none; }
  .fw-5 .flow-list { display: block; }
}
/* #15: chrome that is not part of the demo looks inactive */
.side-nav .side-item:not(.active), .tab.inert, .search, .top-ico { opacity: 0.55; cursor: not-allowed; }
/* #16: the PDF records the view */
.print-only { display: none; }
/* D: blockers table */
.table-wrap { overflow-x: auto; position: relative; }
table.blockers { min-width: 760px; }
.blockers tbody { border-top: 1px solid var(--line); }
.blockers td { vertical-align: top; padding-top: 14px; padding-bottom: 14px; }
.blockers th.blk-step { position: static; text-align: left; vertical-align: top; width: 200px; padding: 14px; background: #fbfcfd; font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; white-space: normal; color: var(--ink); border-bottom: 0; }
.blk-step .stage { display: inline-block; margin-bottom: 8px; }
.blk-loss { display: block; font-size: 24px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.blk-loss.blind { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); }
.blk-loss.blind svg { width: 15px; height: 15px; }
.blk-loss-label { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.blk-main b { display: block; font-size: 14px; font-weight: 600; }
.blk-act { display: flex; flex-wrap: wrap; gap: 5px; align-items: baseline; font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.blk-act b { display: inline; font-size: 17px; color: var(--ink); font-variant-numeric: tabular-nums; }
.blk-act.need { color: var(--leak-ink); font-weight: 600; align-items: center; }
.blk-act svg { width: 14px; height: 14px; }
.blk-int { font-size: 13px; color: var(--ink-2); }
.blk-owner { font-size: 13px; font-weight: 600; white-space: nowrap; }
.blk-link { width: 56px; text-align: right; }
.blockers tr.is-blind .blk-main b { color: var(--ink-2); }
/* #4/#5: persistence headline and growth check */
.headline { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 26px; margin-bottom: 20px; }
.hl-main { font-size: 24px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; color: var(--leak-ink); }
.hl-main span { color: var(--ink-2); font-weight: 500; }
.hl-sub { margin-top: 6px; font-size: 14px; color: var(--ink-2); }
.gc-terms { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.gc-term { display: flex; gap: 14px; align-items: baseline; background: #f7f9fb; border-radius: 12px; padding: 14px 18px; }
.gc-val { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; flex: none; }
.gc-val.good { color: var(--good); }
.gc-val.bad { color: var(--leak-ink); }
.gc-label { font-size: 13px; color: var(--ink-2); }
.gc-say { margin-top: 14px; font-size: 14px; color: var(--warn-ink); background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 10px; padding: 10px 14px; }
/* #20: conversion in Hub + app view */
.conv-hub { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 20px; }
.conv-hub .unlock { margin-bottom: 0; }
/* C / #18: jump targets clear the sticky top bar and flash once */
[id] { scroll-margin-top: 76px; }
@keyframes flash-ring { from { box-shadow: 0 0 0 3px var(--leak); } to { box-shadow: 0 0 0 3px transparent; } }
@keyframes flash-bg { from { background-color: var(--warn-bg); } to { background-color: transparent; } }
.card.flash { animation: flash-ring 1.8s ease-out; }
tbody.flash td, tbody.flash th { animation: flash-bg 1.8s ease-out; }
@media (max-width: 1180px) { .conv-hub { grid-template-columns: minmax(0, 1fr); } }
@media print {
  .print-only { display: block; }
  .print-meta { font-size: 12px; font-weight: 600; margin: 8px 0 12px; }
  .subnav-row { display: none !important; }
  .blk-link { display: none; }
}

/* hub-only corrections: quieter blind states */
.flow-blind b { font-size: 22px; font-weight: 600; color: #9aa3b0; line-height: 1; }
.flow-blind span { color: var(--ink-2); font-weight: 500; }
.kpi-merged { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: var(--hatch); border: 1.5px dashed #bcc4cf; box-shadow: none; }
.kpi-merged h3 { font-size: 17px; font-weight: 600; color: var(--ink); }
.kpi-merged .km-text { min-width: 0; flex: 1 1 260px; }
.blk-why { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.blk-more td { padding: 14px; background: #fbfcfd; font-size: 13px; color: var(--ink-2); }
.blk-more .link-btn { margin-left: 8px; vertical-align: middle; }
@media (max-width: 1100px) { .kpi-merged { grid-column: 1 / -1 !important; } }
