@font-face{font-family:"Roboto";font-weight:300;font-display:swap;src:url("../../assets/fonts/roboto-300.woff2") format("woff2"),url("../../assets/fonts/roboto-300.woff") format("woff")}
@font-face{font-family:"Roboto";font-weight:400;font-display:swap;src:url("../../assets/fonts/roboto-400.woff2") format("woff2"),url("../../assets/fonts/roboto-400.woff") format("woff")}
@font-face{font-family:"Roboto";font-weight:700;font-display:swap;src:url("../../assets/fonts/roboto-700.woff2") format("woff2"),url("../../assets/fonts/roboto-700.woff") format("woff")}
/* Gap Assessment & AI Prioritization simulated demo: styles. System fonts only, no external assets.
   Palette after the portfolio and the other demos: navy ink, blue actions, purple only for AI. */

:root {
  --bg: #F6F7FC; --surface: #FFFFFF; --surface-2: #F1F3FF; --surface-3: #E5E9FB;
  --ink: #071D49; --text: #1B2850; --muted: #4E5A79; --border: #D8DDF1; --border-strong: #B4BEDF;
  --primary: #0066F5; --primary-ink: #FFFFFF; --primary-soft: #EBF2FF; --primary-text: #0057D1;
  --ai: #8A2ECC; --ai-ink: #FFFFFF; --ai-soft: #F4EBFC; --ai-ring: rgba(138, 46, 204, .22);
  --ok: #2E7D0F; --ok-soft: #EBF6E3; --warn: #A85200; --warn-soft: #FFF2E4; --err: #C23B12; --err-soft: #FDEDE8;
  --t-act: #0057D1; --t-build: #00787A; --t-monitor: #A85200; --t-defer: #5D6787;
  --s-aff: #00787A; --s-reg: #0057D1;
  --h1: #EEF3FF; --h2: #CFDFFF; --h3: #93B8FF; --h4: #2E6BD6; --h5: #0A47B3; --h-ink: #071D49; --h-ink-hi: #FFFFFF;
  --banner-bg: #071D49; --banner-ink: #FFFFFF; --mark-bg: #071D49; --scrim: rgba(7, 29, 73, .45);
  --shadow-sm: 0 1px 2px rgba(7, 29, 73, .06);
  --shadow: 0 1px 2px rgba(7, 29, 73, .06), 0 8px 24px rgba(7, 29, 73, .10);
  --shadow-lg: 0 2px 6px rgba(7, 29, 73, .10), 0 18px 48px rgba(7, 29, 73, .22);
  --font: "Roboto",system-ui,-apple-system,"Segoe UI","Helvetica Neue",Arial,sans-serif;
  --mono: "Roboto",system-ui,-apple-system,"Segoe UI","Helvetica Neue",Arial,sans-serif;
  --tabbar-h: 58px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A1430; --surface: #0F1B3D; --surface-2: #15234D; --surface-3: #1C2C5C;
    --ink: #EFF2FF; --text: #D5DCF1; --muted: #A6B1CE; --border: #263868; --border-strong: #3B5090;
    --primary: #5C9DFF; --primary-ink: #071D49; --primary-soft: #16305F; --primary-text: #8DBBFF;
    --ai: #BB86F2; --ai-ink: #1A0B2E; --ai-soft: #2A1E4E; --ai-ring: rgba(187, 134, 242, .28);
    --ok: #7DC657; --ok-soft: #18321F; --warn: #F2A55E; --warn-soft: #3A2815; --err: #FF8867; --err-soft: #3E1F19;
    --t-act: #79B2FF; --t-build: #5ED3D0; --t-monitor: #F2A55E; --t-defer: #A6B1CE; --s-aff: #5ED3D0; --s-reg: #8DBBFF;
    --h1: #15244B; --h2: #1E3B78; --h3: #2C5DB5; --h4: #4F8CEB; --h5: #9CC4FF; --h-ink: #EFF2FF; --h-ink-hi: #071D49;
    --banner-bg: #18285A; --mark-bg: #24357A; --scrim: rgba(0, 0, 0, .6);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35); --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .45);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .5), 0 18px 48px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A1430; --surface: #0F1B3D; --surface-2: #15234D; --surface-3: #1C2C5C;
  --ink: #EFF2FF; --text: #D5DCF1; --muted: #A6B1CE; --border: #263868; --border-strong: #3B5090;
  --primary: #5C9DFF; --primary-ink: #071D49; --primary-soft: #16305F; --primary-text: #8DBBFF;
  --ai: #BB86F2; --ai-ink: #1A0B2E; --ai-soft: #2A1E4E; --ai-ring: rgba(187, 134, 242, .28);
  --ok: #7DC657; --ok-soft: #18321F; --warn: #F2A55E; --warn-soft: #3A2815; --err: #FF8867; --err-soft: #3E1F19;
  --t-act: #79B2FF; --t-build: #5ED3D0; --t-monitor: #F2A55E; --t-defer: #A6B1CE; --s-aff: #5ED3D0; --s-reg: #8DBBFF;
  --h1: #15244B; --h2: #1E3B78; --h3: #2C5DB5; --h4: #4F8CEB; --h5: #9CC4FF; --h-ink: #EFF2FF; --h-ink-hi: #071D49;
  --banner-bg: #18285A; --mark-bg: #24357A; --scrim: rgba(0, 0, 0, .6);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35); --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .45);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .5), 0 18px 48px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ── Base ── */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden;
  background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); -webkit-text-size-adjust: 100%;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; }
a { color: var(--primary-text); }
p { margin: 0 0 8px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 80; padding: 8px 12px; background: var(--primary); color: var(--primary-ink); border-radius: 8px; text-decoration: none; }
.skip:focus { top: 8px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.hint { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.empty { color: var(--muted); padding: 12px 4px; }
.noscript { padding: 16px; text-align: center; }
.ico { display: inline-grid; place-items: center; width: 18px; height: 18px; flex: none; }
.ico svg, .st-ico svg, .icon-btn svg, .stg-ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.spin svg { animation: spin 1s linear infinite; }
.chev svg { transition: transform .15s; }
details[open] > summary > .chev svg { transform: rotate(90deg); }

/* ── Banner, top bar ── */

.banner { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 14px; padding: 6px 16px; background: var(--banner-bg); color: var(--banner-ink); font-size: 12.5px; line-height: 1.4; text-align: center; }
.banner-link { color: var(--banner-ink); font-weight: 600; text-underline-offset: 2px; }
.banner-link:focus-visible { outline-color: #FFFFFF; }
.topbar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: relative; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mark { position: relative; display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 9px; background: var(--mark-bg); color: #FFFFFF; font: 700 12.5px/1 var(--font); letter-spacing: .04em; }
.mark::after { content: ""; position: absolute; right: -2px; top: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--ai); border: 2px solid var(--surface); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { margin: 0; font-size: 15.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim-badge { flex: none; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; line-height: 1.3; color: var(--ai); background: var(--ai-soft); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.sim-short { display: none; }
.tb-right { display: flex; align-items: center; gap: 4px; flex: none; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; margin-right: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: 12px; text-decoration: none; white-space: nowrap; }
.status-pill:hover { border-color: var(--border-strong); }
.sp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); flex: none; }
.icon-btn { width: 36px; height: 36px; flex: none; display: inline-grid; place-items: center; padding: 8px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.sm { width: 30px; height: 30px; padding: 7px; border-radius: 8px; }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}

/* ── Shell ── */

.shell { flex: 1; min-height: 0; display: grid; grid-template-columns: 228px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.sidebar { min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 14px 10px; background: var(--surface-2); border-right: 1px solid var(--border); overflow-y: auto; }
.nav-title { margin: 2px 10px 6px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--text); text-decoration: none; font-size: 14px; }
.nav a:hover { background: var(--surface-3); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--primary-soft); color: var(--ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--primary); }
.nav a[aria-current="page"] .ico { color: var(--primary); }
.nav-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.nav-sub { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.nav-count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 11.5px; font-weight: 600; text-align: center; color: var(--muted); }
.nav-sep { height: 1px; background: var(--border); margin: 8px 6px; }
.sb-foot { margin-top: auto; padding: 10px 8px 2px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.linklike { border: 0; background: none; padding: 0; color: var(--primary-text); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font-size: inherit; }
main { min-width: 0; min-height: 0; overflow-y: auto; background: var(--bg); }
.view { min-height: 100%; }
.tabbar { display: none; }
.vbody { padding: 18px 24px 28px; max-width: 1360px; }
body.guide-open .vbody { padding-bottom: 250px; }
body.guide-min .vbody { padding-bottom: 84px; }

/* ── Page head, cards, buttons ── */

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.ph-text { min-width: 0; }
.page-head h2 { margin: 0; font-size: 19px; }
.ph-desc { margin: 2px 0 0; font-size: 13px; color: var(--muted); max-width: 820px; }
.ph-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow-sm); min-width: 0; }
.card-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.card-head h3 { margin: 0; font-size: 15px; flex: 1; min-width: 0; }
.card-head .ico { width: 19px; height: 19px; }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.card.error { margin: 24px; }
.card.error pre { white-space: pre-wrap; font-size: 12px; }
.k-ai { color: var(--ai); }
.k-ok { color: var(--ok); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; min-height: 38px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; font-size: 14px; line-height: 1.2; text-decoration: none; white-space: nowrap; }
.btn.sm { padding: 5px 10px; min-height: 32px; font-size: 13px; border-radius: 8px; }
.btn .ico { width: 16px; height: 16px; }
.btn.primary { background: var(--primary); color: var(--primary-ink); }
.btn.primary:hover, .btn.ai:hover { filter: brightness(1.07); }
.btn.ai { background: var(--ai); color: var(--ai-ink); }
.btn.ghost { background: var(--surface); border-color: var(--border-strong); color: var(--ink); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--err); color: #FFFFFF; }
.btn.danger-ghost { background: transparent; border-color: var(--err); color: var(--err); }
.btn.danger-ghost:hover { background: var(--err-soft); }
.btn.danger-ghost[data-armed="1"] { background: var(--err); color: #FFFFFF; }
.btn.link { background: none; border: 0; padding: 4px 6px; min-height: 0; color: var(--primary-text); font-weight: 600; }
.btn.link:hover { text-decoration: underline; }
.btn.is-busy, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; filter: none; }

/* Chips and badges */
.chips { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 13px; white-space: nowrap; }
.chip:hover { background: var(--surface-2); }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 600; }
.chip .n { font-size: 11.5px; opacity: .75; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; line-height: 1.55; }
.badge .ico { width: 13px; height: 13px; }
.b-ai { color: var(--ai); background: var(--ai-soft); border-color: transparent; }
.b-ok { color: var(--ok); background: transparent; border-color: var(--ok); }
.b-warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.b-pri { color: var(--primary-text); background: var(--primary-soft); border-color: transparent; }
.tier { --tc: var(--t-defer); display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; color: var(--tc); border: 1px solid var(--tc); border-color: color-mix(in srgb, var(--tc) 45%, transparent); background: color-mix(in srgb, var(--tc) 10%, transparent); white-space: nowrap; line-height: 1.5; }
.tier::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: currentColor; }
.t-act { --tc: var(--t-act); } .t-build { --tc: var(--t-build); } .t-monitor { --tc: var(--t-monitor); } .t-defer { --tc: var(--t-defer); }
.stc { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.stc::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 2px solid currentColor; }
.s-affiliate { color: var(--s-aff); } .s-regional { color: var(--s-reg); } .s-global { color: var(--ink); }
.s-final { color: var(--ok); } .s-final::before { background: currentColor; }
.s-merged { color: var(--muted); text-decoration: line-through; }
.agree { font-size: 12px; font-weight: 600; white-space: nowrap; }
.a-aligned { color: var(--ok); } .a-mixed { color: var(--warn); } .a-contested { color: var(--err); }
.id { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; }

/* Forms */
input[type="text"], input[type="search"], select, textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface); color: var(--ink); min-height: 38px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
select:disabled, input:disabled { opacity: .6; }
label, legend { font-weight: 600; color: var(--ink); font-size: 13.5px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
input[type="range"] { width: 100%; min-width: 0; margin: 0; accent-color: var(--primary); height: 28px; background: transparent; cursor: pointer; }
input[type="range"]:disabled { cursor: not-allowed; opacity: .55; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--ink); }
.seg button[aria-selected="true"], .seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.seg .ico { width: 15px; height: 15px; }

/* ── Register ── */

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 10px 14px; min-width: 0; }
.kpi b { display: block; font-size: 22px; line-height: 1.2; color: var(--ink); font-weight: 700; }
.kpi span { font-size: 12.5px; color: var(--muted); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 0 0 12px; }
.search { position: relative; flex: 1 1 260px; max-width: 420px; }
.search > .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.search input { padding-left: 34px; }
.selects { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 520px; }
.selects select { flex: 1 1 130px; width: auto; min-width: 0; }
.st-chips { display: flex; flex-wrap: wrap; gap: 6px; flex-basis: 100%; }
.result-row { display: flex; align-items: center; gap: 10px; flex-basis: 100%; font-size: 13px; color: var(--muted); min-height: 26px; }
.count-text { font-weight: 600; }
.g-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.g-head { display: none; }
.g-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "id status" "main main" "prio votes"; gap: 6px 12px; align-items: center; padding: 11px 14px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border); color: inherit; text-decoration: none; box-shadow: var(--shadow-sm); }
.g-row:hover { border-color: var(--border-strong); }
.g-row.is-merged { opacity: .72; }
.c-id { grid-area: id; } .c-main { grid-area: main; min-width: 0; } .c-status { grid-area: status; } .c-prio { grid-area: prio; display: flex; align-items: center; gap: 8px; } .c-votes { grid-area: votes; text-align: right; }
.g-title { display: block; font-size: 14.5px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.g-sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.g-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.g-flags:empty { display: none; }
.sc-num { font: 600 12.5px var(--mono); color: var(--ink); }
.list-empty { text-align: center; padding: 28px 8px; }
@container reg (min-width: 900px) {
  .g-head, .g-row { grid-template-columns: 96px minmax(0, 1fr) 132px 132px 92px; grid-template-areas: "id main status prio votes"; }
  .g-head { display: grid; gap: 12px; padding: 0 15px 2px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
  .c-votes { text-align: left; }
}
.reg { container: reg / inline-size; }

/* ── Gap detail ── */

.d-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 10px; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 600; text-decoration: none; }
.back:hover { text-decoration: underline; }
.pn { display: flex; gap: 6px; }
.d-head { margin: 0 0 12px; }
.d-head h2 { margin: 4px 0 6px; font-size: 21px; }
.meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12.5px; color: var(--muted); }
.stage-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 16px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.stages { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 420px; }
.stg { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 999px; font-size: 12.5px; color: var(--muted); border: 1px solid transparent; }
.stg-ico { width: 16px; height: 16px; display: inline-grid; color: var(--border-strong); }
.stg[data-s="done"] { color: var(--ink); } .stg[data-s="done"] .stg-ico { color: var(--ok); }
.stg[data-s="now"] { color: var(--ink); font-weight: 700; border-color: var(--primary); background: var(--primary-soft); } .stg[data-s="now"] .stg-ico { color: var(--primary); }
.stage-act { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.stage-act .hint { margin: 0; }
.d-wrap { container: dwrap / inline-size; }
.d-grid { display: flex; flex-direction: column; gap: 14px; }
.d-col { display: contents; }
.c-stmt { order: 1; } .c-score { order: 2; } .c-ai { order: 3; } .c-dec { order: 4; } .c-votes-card { order: 5; } .c-ev { order: 6; } .c-inp { order: 7; } .c-log { order: 8; }
@container dwrap (min-width: 940px) {
  .d-grid { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); align-items: start; }
  .d-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
}
.stmt { margin: 0 0 10px; font-size: 15.5px; color: var(--ink); line-height: 1.5; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 5px 14px; margin: 10px 0 0; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.kv select { min-height: 32px; padding: 4px 8px; max-width: 280px; }
.checks { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.checks li { display: flex; align-items: flex-start; gap: 7px; }
.checks .ico { width: 16px; height: 16px; margin-top: 2px; }
.checks .pass .ico { color: var(--ok); }
.checks .fail { color: var(--warn); }
.sub-h { margin: 14px 0 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.plain { margin: 0; padding-left: 18px; font-size: 13.5px; }
.plain li { margin: 3px 0; }
.inputs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.inputs li { padding: 8px 10px; border-radius: 9px; background: var(--surface-2); font-size: 13.5px; }
.in-who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.in-who b { color: var(--ink); font-size: 13px; }
.vrow { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; margin: 10px 0 4px; }
.vcell { display: grid; place-items: center; height: 30px; border-radius: 5px; font: 600 12px var(--mono); background: var(--surface-3); color: var(--muted); }
.vlab { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; font-size: 10.5px; color: var(--muted); text-align: center; }
.v1 { background: var(--h1); color: var(--h-ink); } .v2 { background: var(--h2); color: var(--h-ink); } .v3 { background: var(--h3); color: var(--h-ink); }
.v4 { background: var(--h4); color: var(--h-ink-hi); } .v5 { background: var(--h5); color: var(--h-ink-hi); }
.stats { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 8px 0 0; font-size: 13px; }
.stats b { color: var(--ink); }

/* Scoring */
.dims { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.dim { display: grid; grid-template-columns: minmax(0, 1fr) 96px; grid-template-areas: "lab val" "rng rng" "q q"; gap: 0 10px; align-items: center; }
.dim label { grid-area: lab; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 13.5px; }
.dim-ax { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.dim-val { grid-area: val; text-align: right; font-size: 12.5px; color: var(--ink); font-weight: 600; }
.dim input { grid-area: rng; }
.dim-q { grid-area: q; font-size: 12px; color: var(--muted); }
.live { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 16px; align-items: center; margin: 14px 0 0; padding: 12px 14px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); }
.live-score { grid-row: span 2; font: 700 30px/1 var(--font); color: var(--ink); }
.live-score small { font-size: 13px; font-weight: 600; color: var(--muted); }
.live-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; }
.axes { display: grid; grid-template-columns: auto minmax(60px, 1fr) auto; gap: 3px 8px; align-items: center; font-size: 12px; color: var(--muted); }
.axbar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.axbar span { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
.axv { font: 600 12px var(--mono); color: var(--ink); }
details.wbox { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
details.wbox > summary, details.more > summary, .log > summary { list-style: none; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--primary-text); }
details > summary::-webkit-details-marker { display: none; }
.wts { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; container: wts / inline-size; }
.wt { display: grid; grid-template-columns: minmax(0, 1fr) 70px; grid-template-areas: "l s" "r r"; gap: 0 10px; align-items: center; font-size: 13px; }
.wt label { grid-area: l; font-size: 13px; font-weight: 600; }
.wt input { grid-area: r; }
.wt-sh { grid-area: s; font: 600 12px var(--mono); color: var(--ink); text-align: right; white-space: nowrap; }
@container wts (min-width: 430px) { .wt { grid-template-columns: 140px minmax(0, 1fr) 70px; grid-template-areas: "l r s"; } }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.w-moved { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }

/* AI panel (steps after the REH demo) */
.meter { margin-left: auto; width: 90px; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--ai)); transition: width .35s ease; }
.ai-intro { font-size: 13.5px; margin: 0 0 4px; }
.steps { list-style: none; margin: 12px 0 0; padding: 0; }
.step { position: relative; padding: 0 0 14px 30px; }
.step:not(:last-child)::before { content: ""; position: absolute; left: 9px; top: 24px; bottom: 2px; border-left: 2px solid var(--border); }
.step[data-s="done"]:not(:last-child)::before { border-left-color: color-mix(in srgb, var(--ok) 55%, var(--border)); }
.st-head { display: flex; align-items: flex-start; gap: 8px; }
.st-ico { position: absolute; left: 0; top: 1px; width: 20px; height: 20px; color: var(--border-strong); display: inline-grid; }
.step[data-s="running"] .st-ico { color: var(--ai); }
.step[data-s="done"] .st-ico { color: var(--ok); }
.step[data-s="stopped"] .st-ico { color: var(--warn); }
.st-text { display: flex; flex-direction: column; }
.st-name { font-weight: 600; color: var(--muted); font-size: 14px; }
.step[data-s="running"] .st-name, .step[data-s="done"] .st-name { color: var(--ink); }
.st-desc { font-size: 12.5px; color: var(--muted); }
.st-body { margin-top: 6px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; min-width: 0; }
.step[data-s="running"] .st-body { background: color-mix(in srgb, var(--ai-soft) 65%, var(--surface-2)); }
.notes { margin: 0; padding-left: 18px; }
.notes li { margin: 2px 0; }
.tone-warn { color: var(--warn); } .tone-ok { color: var(--ok); }
.reword { margin: 10px 0 0; padding: 10px 12px; border-radius: 9px; background: var(--surface); border: 1px dashed var(--ai); }
.reword p { margin: 0 0 6px; }
.rw-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ai); }
.dups { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.dup { padding: 9px 11px; border-radius: 9px; background: var(--surface); border: 1px solid var(--border); }
.dup.is-dup { border-color: var(--warn); border-color: color-mix(in srgb, var(--warn) 55%, var(--border)); }
.dup-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.dup-title { font-weight: 600; color: var(--ink); }
.dup-terms { font-size: 12px; color: var(--muted); margin: 3px 0 0; }
.dup-act { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cmp { width: 100%; border-collapse: collapse; font-size: 13px; }
.cmp th, .cmp td { padding: 5px 6px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.cmp th { font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.cmp .n { font: 600 12.5px var(--mono); text-align: center; white-space: nowrap; }
.cmp .n.ai { color: var(--ai); }
.cmp .diff { color: var(--warn); }
.cmp .why { font-size: 12.5px; color: var(--muted); }
.sugg { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.sugg-score { font: 700 22px/1 var(--font); color: var(--ink); }
.conf { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.conf-bar { width: 80px; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.conf-bar span { display: block; height: 100%; background: var(--ai); }
.why-text { margin: 10px 0 0; }
.acts { margin: 0; padding-left: 18px; }
.acts li { margin: 3px 0; }
.caret::after { content: ""; display: inline-block; width: 7px; height: 14px; margin-left: 2px; vertical-align: -2px; background: var(--ai); animation: blink 1s steps(2) infinite; }
.note { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; font-size: 13px; background: var(--surface-2); border-left: 3px solid var(--border-strong); }
.note.warn { background: var(--warn-soft); border-left-color: var(--warn); color: var(--text); }

/* Decision */
.c-dec { border-color: var(--border-strong); box-shadow: var(--shadow); }
.dec-opts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@container dwrap (min-width: 640px) { .dec-opts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.opt { padding: 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.opt h4 { margin: 0; font-size: 14px; }
.opt p { margin: 0; font-size: 13px; }
.opt .btn { align-self: flex-start; }
.opt.ai-opt { border-color: var(--ai); background: var(--ai-soft); border-color: color-mix(in srgb, var(--ai) 40%, var(--border)); background: color-mix(in srgb, var(--ai-soft) 55%, var(--surface)); }
.dec-rec { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }

/* Log viewer */
.log { padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.log > summary { color: var(--ink); width: 100%; gap: 6px; }
.log .ico { width: 15px; height: 15px; }
.log-count { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.log-empty { margin: 8px 0 2px; font-size: 12.5px; color: var(--muted); }
.log-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 240px; overflow-y: auto; font-size: 12px; }
.log-list li { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 8px; padding: 4px 2px; border-top: 1px solid var(--border); }
.log-time { color: var(--muted); }
.log-lvl { font-weight: 700; color: var(--primary-text); }
.lv-ok .log-lvl { color: var(--ok); } .lv-warn .log-lvl { color: var(--warn); } .lv-err .log-lvl { color: var(--err); }
.log-msg { color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.log-det { display: block; color: var(--muted); }

/* ── Prioritization ── */

.p-wrap { container: pwrap / inline-size; }
.p-grid { display: flex; flex-direction: column; gap: 14px; }
@container pwrap (min-width: 980px) {
  .p-grid { display: grid; grid-template-columns: 330px minmax(0, 1fr); align-items: start; }
  .p-weights { position: sticky; top: 12px; }
}
.p-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 0 0 12px; }
.tier-sum { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.tier-sum b { color: var(--ink); }
.rk-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.p-results { container: pres / inline-size; min-width: 0; }
.rk { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: "rank main delta" "rank tier score" "rank band src"; gap: 4px 10px; align-items: center; padding: 9px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: inherit; text-decoration: none; }
.rk:hover { border-color: var(--border-strong); }
.rk-n { grid-area: rank; align-self: start; font: 700 16px/1.4 var(--mono); color: var(--ink); text-align: center; }
.rk-main { grid-area: main; min-width: 0; }
.rk-main .g-title { font-size: 14px; }
.rk-d { grid-area: delta; justify-self: end; font: 600 12px var(--mono); white-space: nowrap; color: var(--muted); }
.rk-d.up { color: var(--ok); } .rk-d.down { color: var(--err); }
.rk-t { grid-area: tier; }
.rk-s { grid-area: score; display: flex; align-items: center; gap: 8px; justify-self: end; }
.rk-b { grid-area: band; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; min-width: 0; }
.rk-src { grid-area: src; justify-self: end; font-size: 12px; color: var(--muted); white-space: nowrap; }
.sbar { width: 96px; height: 7px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.sbar span { display: block; height: 100%; border-radius: 4px; background: var(--tc, var(--primary)); }
.band { position: relative; width: 90px; height: 8px; border-radius: 4px; background: var(--surface-3); flex: none; }
.band span { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: var(--h3); background: color-mix(in srgb, var(--primary) 45%, transparent); }
.band i { position: absolute; top: -2px; width: 4px; height: 12px; margin-left: -2px; border-radius: 2px; background: var(--ink); }
.stale { opacity: .55; }
@container pres (min-width: 560px) {
  .rk { grid-template-columns: 34px minmax(0, 1fr) auto auto auto; grid-template-areas: "rank main main main delta" "rank tier score band src"; }
  .rk-t { justify-self: start; }
  .rk-s { justify-self: start; }
}
@container pres (min-width: 860px) {
  .rk { grid-template-columns: 34px 52px minmax(0, 1fr) 96px 140px 124px 112px; grid-template-areas: "rank delta main tier score band src"; }
  .rk-n { align-self: center; }
  .rk-d { justify-self: start; }
}
.hl-row { border-color: var(--ai) !important; box-shadow: 0 0 0 3px var(--ai-ring); }
.mx-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.mx { display: block; width: 100%; max-width: 760px; height: auto; margin: 0 auto; font-family: var(--font); }
.mx .q1 { fill: var(--ok-soft); fill: color-mix(in srgb, var(--ok) 9%, transparent); }
.mx .q2 { fill: var(--primary-soft); fill: color-mix(in srgb, var(--primary) 8%, transparent); }
.mx .q3 { fill: var(--surface-2); }
.mx .q4 { fill: transparent; }
.mx .frame { fill: none; stroke: var(--border-strong); }
.mx .grid { stroke: var(--border); stroke-dasharray: 3 4; }
.mx .mid { stroke: var(--border-strong); stroke-width: 1.5; }
.mx .ql { fill: var(--muted); font-size: 12px; font-weight: 700; }
.mx .qs { fill: var(--muted); font-size: 10.5px; }
.mx .ax { fill: var(--muted); font-size: 11px; }
.mx .axt { fill: var(--ink); font-size: 12px; font-weight: 700; }
.mx .pt circle { stroke: var(--surface); stroke-width: 2; }
.mx .pt text { fill: #FFFFFF; font: 700 9px var(--mono); pointer-events: none; }
.mx .pt.t-act circle { fill: var(--t-act); } .mx .pt.t-build circle { fill: var(--t-build); } .mx .pt.t-monitor circle { fill: var(--t-monitor); } .mx .pt.t-defer circle { fill: var(--t-defer); }
:root[data-theme="dark"] .mx .pt text { fill: #071D49; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mx .pt text { fill: #071D49; } }
.mx .pt:hover circle, .mx .pt:focus circle { stroke: var(--ink); stroke-width: 2.5; }
.mx .pt:focus { outline: none; }
.mx .pt.hl circle { stroke: var(--ai); stroke-width: 4; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }

/* ── Voting ── */

.heat-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.heat { border-collapse: separate; border-spacing: 3px; font-size: 12.5px; min-width: 100%; }
.heat th { font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 4px 4px; text-align: center; white-space: nowrap; }
.heat th.rh { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 3px 0 0 var(--surface); text-align: left; padding: 4px 10px 4px 8px; min-width: 150px; max-width: 260px; }
.heat th.rh a { display: block; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 12.5px; }
.heat th.rh a:hover .ht { text-decoration: underline; }
.heat th.rh .ht { display: block; font-weight: 400; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.heat td { width: 32px; min-width: 30px; height: 30px; text-align: center; border-radius: 5px; font: 600 12px var(--mono); background: var(--surface-3); color: var(--muted); }
.heat td.sum { background: transparent; font-family: var(--font); color: var(--ink); width: auto; padding: 0 6px; white-space: nowrap; }
.heat th.gsep, .heat td.gsep { padding-left: 10px; }
.heat tr.contested th.rh { box-shadow: inset 3px 0 0 var(--err), 3px 0 0 var(--surface); }
.vote-todo { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.vote-todo li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.vote-todo .vt-main { min-width: 0; flex: 1 1 260px; }
.v-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.scale { display: inline-flex; gap: 3px; vertical-align: middle; margin: 0 4px; }
.scale i { width: 16px; height: 12px; border-radius: 3px; }

/* ── Export, settings ── */

.e-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 1100px) { .e-grid { grid-template-columns: 340px minmax(0, 1fr); align-items: start; } }
.preview { margin: 0; padding: 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font: 12px/1.5 var(--mono); color: var(--ink); max-height: 460px; overflow: auto; white-space: pre; }
.settings { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-content: start; }
.radios { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.radios legend { margin-bottom: 6px; }
.radio { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--border); cursor: pointer; font-weight: 400; }
.radio:hover { background: var(--surface-2); }
.radio input { margin-top: 3px; accent-color: var(--primary); width: 16px; height: 16px; flex: none; }
.radio > span { display: flex; flex-direction: column; min-width: 0; }
.radio b { color: var(--ink); font-weight: 600; }
.radio .muted { font-size: 12.5px; }
.placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 260px; padding: 24px; text-align: center; color: var(--muted); }
.placeholder > .ico { width: 40px; height: 40px; opacity: .55; }

/* ── Guided path ── */

.guide { position: fixed; right: 16px; bottom: 16px; z-index: 30; width: min(380px, calc(100vw - 32px)); }
body.guide-min .guide { width: auto; }
.g-card { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--ai); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 12px 16px 14px; }
.g-card.done { border-top-color: var(--ok); }
.g-head { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.g-kicker { flex: 1; display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ai); }
.g-card.done .g-kicker { color: var(--ok); }
.g-title { margin: 0 0 4px; font-size: 16px; }
.g-text { margin: 0 0 10px; font-size: 13.5px; color: var(--text); }
.g-note { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.g-dots { list-style: none; display: flex; gap: 5px; margin: 0 0 12px; padding: 0; }
.g-dots li { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-3); }
.g-dots li.done { background: var(--ok); }
.g-dots li.now { background: var(--ai); }
.g-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.g-pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--ai); background: var(--surface); color: var(--ink); font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg); }
.g-pill .ico { color: var(--ai); }
.guide-hl { outline: 3px solid var(--ai) !important; outline-offset: 3px; box-shadow: 0 0 0 6px var(--ai-ring); animation: hlpulse 1.8s ease-in-out infinite; }

/* ── Dialog, toast ── */

.dlg { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.dlg::backdrop { background: var(--scrim); }
.dlg[open] { display: flex; flex-direction: column; }
.dlg-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 6px 20px; }
.dlg-head h2 { margin: 0; font-size: 17px; flex: 1; }
.dlg-body { padding: 4px 20px 8px; overflow-y: auto; font-size: 14.5px; }
.dlg-body ul { margin: 0 0 8px; padding-left: 20px; }
.dlg-body li { margin: 3px 0; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--border); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 60; max-width: calc(100vw - 32px); padding: 9px 16px; border-radius: 10px; background: var(--ink); color: var(--bg); font-size: 13.5px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Motion ── */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes hlpulse { 50% { box-shadow: 0 0 0 10px transparent; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ── Responsive ── */

@media (max-width: 1240px) { .brand-sub { display: none; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .tabbar { display: flex; flex: none; min-height: var(--tabbar-h); padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--border); }
  .tabbar a { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 5px 2px; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: 11.5px; font-weight: 600; }
  .tabbar a .ico { width: 20px; height: 20px; }
  .tabbar a[aria-current="page"] { color: var(--primary-text); background: var(--primary-soft); }
  .tabbar .nav-count { position: absolute; top: 1px; left: calc(50% + 6px); margin: 0; min-width: 18px; padding: 0 5px; font-size: 10.5px; line-height: 16px; background: var(--primary); color: var(--primary-ink); border: 0; }
  .guide { left: 8px; right: 8px; bottom: calc(var(--tabbar-h) + 8px + env(safe-area-inset-bottom, 0px)); width: auto; }
  body.guide-min .guide { left: auto; }
  .toast { bottom: calc(var(--tabbar-h) + 16px); }
  .page-head { padding: 12px 16px; }
  .vbody { padding: 14px 16px 22px; }
  .settings { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .topbar { padding: 6px 10px; gap: 6px; }
  .sim-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .sim-short { display: inline; }
  .status-pill .sp-text { display: none; }
  .status-pill { padding: 6px; margin-right: 0; }
  .card { padding: 12px 13px; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .kv dt { margin-top: 6px; }
  .live-score { font-size: 26px; }
  .cmp, .cmp tbody { display: block; }
  .cmp thead { display: none; }
  .cmp tr { display: grid; grid-template-columns: minmax(0, 1fr) 44px 44px; border-bottom: 1px solid var(--border); }
  .cmp th, .cmp td { border-bottom: 0; }
  .cmp td.n::before { content: attr(data-l) " "; font-family: var(--font); font-weight: 400; color: var(--muted); font-size: 11px; }
  .cmp td.why { grid-column: 1 / -1; padding-top: 0; }
  .kpis { gap: 8px; }
  .kpi { padding: 8px 10px; }
  .kpi b { font-size: 18px; }
  .stg { font-size: 12px; padding: 3px 8px 3px 5px; }
  .g-card { padding: 10px 12px 12px; }
  .g-text { font-size: 13px; margin-bottom: 8px; }
  .g-dots { margin-bottom: 9px; }
  .d-head h2 { font-size: 18px; }
}
@media (max-width: 420px) { .status-pill { display: none; } }
@media (max-width: 400px) {
  .brand { gap: 8px; }
  .brand-name { font-size: 14px; }
  .sim-badge { padding: 2px 7px; letter-spacing: .03em; }
  .mark { width: 30px; height: 30px; font-size: 11px; }
  .icon-btn { width: 34px; height: 34px; }
  .page-head h2 { font-size: 17px; }
  .btn { padding: 7px 11px; }
  .tabbar a { font-size: 10.5px; }
}
@media print {
  .banner, .topbar, .sidebar, .tabbar, .guide, .toast, .ph-actions, .toolbar, .card-actions, .p-weights { display: none !important; }
  body { height: auto; overflow: visible; display: block; }
  .shell, main { display: block; overflow: visible; }
}

/* ── Priority heatmap (rank vs International anchor): the 2027 Therapy Area 3 design, synthetic data ── */
.hm-ctl { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; margin: 0 0 12px; }
.hm-seg { display: inline-flex; align-items: center; gap: 8px; }
.hm-k { font-size: 12px; color: var(--muted); }
.hm-card { padding: 14px 14px 12px; }
.hm-title h2 { margin: 0; font-size: 17px; letter-spacing: .01em; text-transform: uppercase; color: #12305F; font-weight: 800; }
:root[data-theme="dark"] .hm-title h2 { color: #DCE6FF; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hm-title h2 { color: #DCE6FF; } }
.hm-title p { margin: 4px 0 10px; font-size: 12px; color: var(--muted); }
.hm-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
table.hm { border-collapse: separate; border-spacing: 2px; font-size: 11.5px; min-width: 1320px; width: 100%; background: var(--surface); }
.hm th, .hm td { padding: 0; text-align: center; white-space: nowrap; }
.hm-groups th.grp { color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 6px 4px; border-radius: 3px; }
.g-area { background: #12305F; } .g-eu { background: #2F6FB5; } .g-ic { background: #2E8B5F; }
.hm-head th { font-size: 9.5px; font-weight: 800; color: #12305F; text-transform: uppercase; letter-spacing: .02em; padding: 6px 3px; vertical-align: bottom; white-space: normal; line-height: 1.15; }
:root[data-theme="dark"] .hm-head th { color: #C9D7FF; }
.hm-head th.hm-area { background: #12305F; color: #fff; border-radius: 3px; vertical-align: middle; }
.hm-head th.hm-area.usa { background: transparent; color: var(--muted); }
.hm-head th.hm-aff { text-transform: none; font-weight: 600; font-size: 10.5px; color: var(--text); min-width: 46px; }
.hm-code { display: block; margin: 0 auto 3px; width: 26px; padding: 2px 0; border-radius: 3px; background: #2F6FB5; color: #fff; font-size: 9px; font-weight: 800; }
.hm-code.ic { background: #2E8B5F; }
.hm .hm-gap { width: 10px; background: transparent; }
.hm .hm-blank { background: transparent; }
.hm-rh { text-align: left !important; min-width: 250px; max-width: 320px; padding: 4px 8px !important; font-size: 11.5px; color: var(--ink); }
.hm tbody th.hm-rh { display: flex; gap: 8px; align-items: baseline; overflow: hidden; }
.hm-rh b { flex: none; font-weight: 700; }
.hm-st { overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 10.5px; }
.hm tbody tr { cursor: pointer; }
.hm tbody tr.flag th.hm-rh { background: #FFF1DC; }
:root[data-theme="dark"] .hm tbody tr.flag th.hm-rh { background: #3A2C14; }
.hm tbody tr:hover td, .hm tbody tr:hover th { filter: brightness(1.06); }
.hm tbody tr.sel th.hm-rh { box-shadow: inset 3px 0 0 #2F6FB5; background: var(--surface-2); }
.hm td { height: 24px; min-width: 34px; border-radius: 3px; font-weight: 700; color: #1C1C1C; position: relative; padding: 0 3px; }
.hm td small { font-weight: 500; font-size: 9px; opacity: .8; }
.hm td.b1 { background: #D9443A; color: #fff; } .hm td.b2 { background: #EE8A3C; color: #fff; } .hm td.b3 { background: #F6C64A; }
.hm td.b4 { background: #A9D27A; } .hm td.b5 { background: #4DB37A; color: #fff; }
.hm td.na { background: var(--surface-2); }
.hm td.usa { background: var(--surface-2); color: var(--muted); font-weight: 600; }
.hm td.c-rng { background: var(--surface-2); color: var(--text); font-weight: 600; }
.hm td.c-rng.hot { background: #F9D4A6; color: #8A4A00; }
.hm td.c-ic { background: var(--surface-2); color: var(--text); font-weight: 600; min-width: 64px; }
.hm td.c-cross { min-width: 70px; }
.hm-ar { font-style: normal; font-size: 8.5px; font-weight: 700; margin-left: 2px; vertical-align: 1px; }
.hm-ar.pale { opacity: .7; font-weight: 500; }
.pin { display: inline-block; width: 9px; height: 9px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: #F2B233; vertical-align: middle; }
.hm-legend { display: flex; flex-wrap: wrap; gap: 6px 4px; align-items: center; margin: 10px 0 0; font-size: 11px; }
.hm-sw { padding: 3px 12px; border-radius: 3px; font-weight: 700; color: #1C1C1C; }
.hm-sw.b1 { background: #D9443A; color: #fff; } .hm-sw.b2 { background: #EE8A3C; color: #fff; } .hm-sw.b3 { background: #F6C64A; } .hm-sw.b4 { background: #A9D27A; } .hm-sw.b5 { background: #4DB37A; color: #fff; }
.hm-note { margin-left: 10px; color: var(--muted); }
.hm-detail { display: grid; gap: 2px; margin: 10px 0 0; padding: 10px 12px; border-left: 3px solid #2F6FB5; border-radius: 6px; background: var(--surface-2); font-size: 12.5px; }
