/* Engagement Platform: the one stylesheet. Tokens mirror _bmad-output/design/engagement-platform/DESIGN.md (spines win). */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/inter-latin-wght-normal.woff2") format("woff2");
}

:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --surface-2: #fbfaf8;
  --border: #e6e3dd;
  --border-strong: #d5d1c9;
  --text: #1c1b19;
  --text-2: #57534e;
  --text-3: #8a847b;
  --accent: #0f6e6a;
  --accent-hover: #0b5955;
  --accent-soft: #e3f1ef;
  --accent-text: #0b5955;
  --positive: #1f7a4d;
  --positive-soft: #e5f3ea;
  --warning: #8a5a00;
  --warning-soft: #fbf0dc;
  --danger: #b4312a;
  --danger-soft: #fbe7e5;
  --info: #2f5da8;
  --info-soft: #e7eef9;
  --neutral-soft: #efede9;
  --rail-bg: #fbfaf8;
  --rail-text: #3a3733;
  --rail-text-2: #8a847b;
  --rail-active-bg: #ffffff;
  --rail-active-text: #0b5955;
  --rail-border: #e6e3dd;
  --focus: 0 0 0 3px rgba(15, 110, 106, 0.28);
  --shadow-1: 0 1px 2px rgba(28, 27, 25, 0.05);
  --shadow-2: 0 4px 16px rgba(28, 27, 25, 0.08);
  --radius-lg: 10px;
  --radius: 8px;
  --radius-sm: 6px;
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s8: 32px;
  --s10: 40px;
  --font: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 22px; line-height: 1.25; letter-spacing: -0.02em; }
h2 { font-size: 15px; line-height: 1.35; }
h3 { font-size: 13px; line-height: 1.4; }
p { margin: 0; }
.num, td.num, .tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: -0.01em; }
.id-short { white-space: nowrap; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.sr-only { 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: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- QA data safety: banner and watermark (also visible in screenshots) ---------- */
.qa-banner { position: sticky; top: 0; z-index: 20; text-align: center; font: 650 11px/1 var(--font); letter-spacing: 0.12em; padding: 6px 8px; color: #6b4600; background: repeating-linear-gradient(135deg, #fbf0dc 0 14px, #f7e6c4 14px 28px); border-bottom: 1px solid #ecd6a8; }
.presenting .qa-banner { color: #fff; background: #0b5955; border-bottom-color: #0b5955; }
.qa-watermark { position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='260'%3E%3Ctext x='20' y='150' transform='rotate(-24 210 130)' font-family='Arial' font-size='26' font-weight='700' fill='%231c1b19'%3ETEST DATA %C2%B7 QA%3C/text%3E%3C/svg%3E"); }
.rail, .topbar { top: 23px; }
.rail { height: calc(100vh - 23px); }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: var(--s6);
  padding: var(--s5) var(--s3);
  background: var(--rail-bg); border-right: 1px solid var(--rail-border); color: var(--rail-text);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 var(--s2); }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; flex: none; }
.brand-mark svg { display: block; }
.brand-name { font-weight: 650; font-size: 14px; letter-spacing: -0.01em; line-height: 1.2; }
.brand-sub { font-size: 11px; color: var(--rail-text-2); line-height: 1.2; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--rail-text-2); padding: var(--s3) var(--s2) var(--s1); }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 7px var(--s2); border-radius: var(--radius-sm);
  color: var(--rail-text); font-weight: 500; text-decoration: none;
}
.nav a:hover { background: rgba(127, 120, 110, 0.08); }
.nav a[aria-current="page"] { background: var(--rail-active-bg); color: var(--rail-active-text); box-shadow: var(--shadow-1); font-weight: 600; }
.nav svg { width: 16px; height: 16px; flex: none; opacity: 0.85; }
.nav .count { margin-left: auto; font-size: 11px; color: var(--rail-text-2); font-variant-numeric: tabular-nums; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--s3); padding: 0 var(--s2); }
.env-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--warning); background: var(--warning-soft); border-radius: 999px; padding: 3px 9px; width: fit-content; }
.env-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.agent { display: flex; align-items: center; gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; font-size: 12px; font-weight: 650; flex: none; }
.avatar.lg { width: 48px; height: 48px; font-size: 17px; }
.agent-name { font-size: 13px; font-weight: 600; line-height: 1.2; }
.agent-mail { font-size: 11px; color: var(--rail-text-2); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; max-width: 150px; white-space: nowrap; }
.agent form { margin-left: auto; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: var(--s4);
  padding: var(--s3) var(--s8); background: rgba(247, 246, 243, 0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; }
.crumbs a { color: var(--text-2); }
.crumbs .sep { color: var(--text-3); }
.crumbs [aria-current] { color: var(--text); font-weight: 500; }
.search { margin-left: auto; position: relative; width: min(380px, 40vw); }
.search input[type="search"] { width: 100%; padding-left: 34px; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-3); }
.content { padding: var(--s6) var(--s8) var(--s10); max-width: 1440px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s6); }
.page-head p { color: var(--text-2); margin-top: 4px; max-width: 72ch; }
.page-actions { display: flex; gap: var(--s2); }

/* ---------- Surfaces ---------- */
.card { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--border); }
.card-head p { color: var(--text-2); font-size: 12px; margin-top: 2px; }
.card-head > svg { width: 18px; height: 18px; flex: none; color: var(--text-3); }
.card-body { padding: var(--s4) var(--s5); }
.card-body.flush { padding: 0; }
.card-foot { padding: var(--s3) var(--s5); border-top: 1px solid var(--border); color: var(--text-2); font-size: 12px; background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.stack { display: flex; flex-direction: column; gap: var(--s4); }
.stack-lg { display: flex; flex-direction: column; gap: var(--s6); }
.row { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s6); align-items: start; }
.split-wide { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: var(--s6); align-items: start; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s4); margin-bottom: var(--s6); }
.kpi { padding: var(--s4) var(--s5); }
.kpi-label { font-size: 12px; color: var(--text-2); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: 28px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.15; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 14px; font-weight: 500; color: var(--text-2); letter-spacing: 0; margin-left: 2px; }
.kpi-note { font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* ---------- Funnel / bars ---------- */
.funnel { display: flex; flex-direction: column; gap: var(--s4); }
.funnel-step { display: grid; grid-template-columns: 200px minmax(0, 1fr) 90px; align-items: center; gap: var(--s4); }
.funnel-name { font-weight: 500; }
.funnel-name span { display: block; font-size: 12px; color: var(--text-3); font-weight: 400; }
.bar { height: 10px; border-radius: 999px; background: var(--neutral-soft); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.funnel-val { text-align: right; font-variant-numeric: tabular-nums; }
.funnel-val b { font-weight: 650; }
.funnel-val span { color: var(--text-3); font-size: 12px; margin-left: 4px; }
.chart { width: 100%; height: auto; display: block; }
.chart .gridline { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart .s-profile { fill: var(--accent); }
.chart .s-device { fill: #7fb7b3; }
.chart .s-consent { fill: #c9a25f; }
.legend { display: flex; gap: var(--s4); font-size: 12px; color: var(--text-2); flex-wrap: wrap; justify-content: flex-end; }
.legend span { white-space: nowrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.data th {
  text-align: left; font-weight: 500; font-size: 12px; color: var(--text-2);
  padding: 10px var(--s4); background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data th:first-child { padding-left: var(--s5); }
table.data td { padding: 11px var(--s4); border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data td:first-child { padding-left: var(--s5); }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--surface-2); }
table.data td.num, table.data th.num { text-align: right; }
.cell-person { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.cell-person .who { font-weight: 550; color: var(--text); }
.cell-person .sub { font-size: 12px; color: var(--text-3); }
a.rowlink { color: inherit; }
a.rowlink:hover .who { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Chips / badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 550; line-height: 1; padding: 4px 8px; border-radius: 999px; white-space: nowrap; background: var(--neutral-soft); color: var(--text-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.9; }
.badge.plain::before, .badge.icon::before { display: none; }
.badge svg { width: 12px; height: 12px; }
.badge.pos { background: var(--positive-soft); color: var(--positive); }
.badge.warn { background: var(--warning-soft); color: var(--warning); }
.badge.neg { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent-soft); color: var(--accent-text); }
.tag { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; color: var(--text-2); border: 1px solid var(--border-strong); border-radius: 4px; padding: 1px 6px; background: var(--surface); }
.stage { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; font-size: 12px; font-weight: 550; }
.stage span { padding: 4px 10px; color: var(--text-3); background: var(--surface); white-space: nowrap; }
.stage span + span { border-left: 1px solid var(--border); }
.stage span.done { color: var(--accent-text); background: var(--accent-soft); }
.stage span.now { color: #fff; background: var(--accent); }

/* ---------- Filters ---------- */
.filters { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s4); }
.seg { display: inline-flex; background: var(--neutral-soft); border-radius: var(--radius); padding: 3px; gap: 2px; }
.seg a { padding: 5px 11px; border-radius: 6px; font-size: 13px; color: var(--text-2); font-weight: 500; text-decoration: none; }
.seg form.inline { display: contents; }
.seg .seg-btn { font: inherit; border: 0; background: transparent; cursor: pointer; padding: 5px 11px; border-radius: 6px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.seg .seg-btn[aria-current="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
form.inline { display: inline; }
.seg a[aria-current="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.seg a .c { color: var(--text-3); margin-left: 4px; font-variant-numeric: tabular-nums; }

/* ---------- Forms ---------- */
input[type="text"], input[type="search"], select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 8px 10px; min-height: 36px;
}
textarea { width: 100%; min-height: 96px; resize: vertical; line-height: 1.5; }
select { padding-right: 28px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 550; color: var(--text-2); }
label.field select, label.field input, label.field textarea { font-size: 14px; font-weight: 400; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.form-grid .full { grid-column: 1 / -1; }
.form-grid > * { min-width: 0; }
label.field select, label.field input { width: 100%; }
.hint { font-size: 12px; color: var(--text-3); font-weight: 400; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 550 13px/1 var(--font); padding: 0 14px; height: 36px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: rgba(127, 120, 110, 0.1); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn svg { width: 15px; height: 15px; }

/* ---------- Key/value ---------- */
dl.kv { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 9px var(--s4); margin: 0; font-size: 13px; }
dl.kv dt { color: var(--text-2); }
dl.kv dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
dl.kv dd .faint { font-size: 12px; }
.provenance { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.not-sent { color: var(--text-3); font-style: italic; }

/* ---------- Consumer header ---------- */
.profile-head { display: flex; align-items: center; gap: var(--s4); padding: var(--s5); }
.profile-head h1 { font-size: 22px; }
.profile-head .ids { display: flex; gap: var(--s3); flex-wrap: wrap; color: var(--text-2); font-size: 12px; margin-top: 4px; }
.profile-head .right { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: var(--s2); }
.profile-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.profile-strip > div { padding: var(--s3) var(--s5); }
.profile-strip > div + div { border-left: 1px solid var(--border); }
.profile-strip .l { font-size: 12px; color: var(--text-2); }
.profile-strip .v { font-weight: 600; margin-top: 2px; display: flex; align-items: center; gap: 6px; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: var(--s2) 0; }
.tl-day { font-size: 12px; font-weight: 600; color: var(--text-2); padding: var(--s3) var(--s5) var(--s2); position: sticky; top: 57px; background: var(--surface); z-index: 1; }
.tl-item { display: grid; grid-template-columns: 56px 28px minmax(0, 1fr); gap: 0 var(--s3); padding: 0 var(--s5); position: relative; }
.tl-time { font-size: 12px; color: var(--text-3); padding-top: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.tl-rail { position: relative; display: flex; justify-content: center; }
.tl-rail::before { content: ""; position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border); }
.tl-item:first-of-type .tl-rail::before { top: 14px; }
.tl-dot { position: relative; margin-top: 10px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-2); }
.tl-dot svg { width: 13px; height: 13px; }
.tl-dot.profile { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.tl-dot.consent-given { background: var(--positive-soft); border-color: transparent; color: var(--positive); }
.tl-dot.consent-withdrawn { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.tl-dot.dev { background: var(--info-soft); border-color: transparent; color: var(--info); }
.tl-dot.care { background: var(--warning-soft); border-color: transparent; color: var(--warning); }
.tl-body { padding: 10px 0 14px; border-bottom: 1px solid var(--border); min-width: 0; }
.tl-item:last-child .tl-body { border-bottom: 0; }
.tl-title { font-weight: 550; display: flex; gap: var(--s2); align-items: baseline; flex-wrap: wrap; }
.tl-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.tl-detail { margin-top: var(--s2); font-size: 13px; color: var(--text-2); }
.tl-detail .kvs { display: flex; flex-wrap: wrap; gap: 4px var(--s4); }
.tl-detail .kvs span b { color: var(--text); font-weight: 500; }
.tl-note { margin-top: var(--s2); padding: var(--s2) var(--s3); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); white-space: pre-wrap; font-size: 13px; }

/* ---------- Devices ---------- */
.device { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: var(--s3); padding: var(--s4) var(--s5); }
.device + .device { border-top: 1px solid var(--border); }
.device-ico { width: 36px; height: 36px; border-radius: 9px; background: var(--info-soft); color: var(--info); display: grid; place-items: center; }
.device-ico svg { width: 18px; height: 18px; }
.device-name { font-weight: 600; }
.device dl.kv { grid-template-columns: 104px minmax(0, 1fr); margin-top: var(--s2); font-size: 12px; gap: 4px var(--s3); }

/* ---------- Consents ---------- */
.consent { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s3) var(--s5); }
.consent + .consent { border-top: 1px solid var(--border); }
.consent-name { font-weight: 550; }
.consent-sub { font-size: 12px; color: var(--text-3); }
.consent .badge { margin-left: auto; }
.history { list-style: none; margin: var(--s2) 0 0; padding: 0; font-size: 12px; color: var(--text-2); }
.history li { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: var(--s2); padding: 2px 0; }
.history li span:last-child { white-space: nowrap; }

/* ---------- Callouts / empty ---------- */
.callout { display: flex; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--radius); background: var(--info-soft); color: #22457d; font-size: 13px; }
.callout.warn { background: var(--warning-soft); color: #6b4600; }
.callout.neg { background: var(--danger-soft); color: #8a241f; }
.callout.neutral { background: var(--neutral-soft); color: var(--text-2); }
.callout svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.callout b { font-weight: 600; }
.empty { padding: var(--s10) var(--s6); text-align: center; color: var(--text-2); }
.empty h3 { color: var(--text); font-size: 14px; margin-bottom: 4px; }
.flash { margin-bottom: var(--s4); }

/* ---------- Integration log ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: flex-end; padding: var(--s4) var(--s5); margin-bottom: var(--s4); }
.filter-bar label.field { min-width: 140px; }
.filter-bar input[type="date"] { font: inherit; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 7px 10px; min-height: 36px; background: var(--surface); color: var(--text); }
table.data.log td { vertical-align: top; font-size: 12.5px; }
table.data tr.selected td { background: var(--accent-soft); }
td.changes { max-width: 240px; }
.scrim { position: fixed; inset: 0; background: rgba(28, 27, 25, 0.28); z-index: 30; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); z-index: 31; box-shadow: var(--shadow-2); display: flex; flex-direction: column; border-left: 1px solid var(--border); }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; padding: var(--s5); border-bottom: 1px solid var(--border); }
.drawer-body { padding: var(--s5); overflow-y: auto; }
.drawer-body > * { flex-shrink: 0; }
.drawer-body h3 { margin-top: var(--s2); }
pre.code { margin: 0; padding: var(--s3); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); font: 12px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto; }
details.collapsed summary { cursor: pointer; font-size: 12px; color: var(--text-2); padding: 4px 0; }
ul.changes-list { margin: 0; padding-left: 18px; font-size: 13px; }
.switch-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi-value.neg { color: var(--danger); }

/* ---------- Coverage ---------- */
.coverage-row { display: grid; grid-template-columns: 220px 120px minmax(0, 1fr); gap: var(--s4); padding: var(--s3) var(--s5); align-items: start; }
.coverage-row + .coverage-row { border-top: 1px solid var(--border); }
.coverage-row .what { font-weight: 550; }

/* ---------- Sign-in ---------- */
.signin { min-height: 100vh; display: grid; place-items: center; padding: var(--s6); background: radial-gradient(1200px 600px at 20% -10%, #e9f3f1 0%, transparent 60%), var(--bg); }
.signin-card { width: min(420px, 100%); padding: var(--s8); }
.signin-card .brand { padding: 0; margin-bottom: var(--s6); }
.signin-card h1 { margin-bottom: 6px; }
.signin-card p { color: var(--text-2); }
.signin-card .btn { width: 100%; height: 42px; margin-top: var(--s6); font-size: 14px; }
.signin-foot { margin-top: var(--s5); font-size: 12px; color: var(--text-3); line-height: 1.5; }

/* ---------- Responsive ---------- */
@media (max-width: 1060px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .split-wide { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-label, .rail-foot .agent-mail { display: none; }
  .rail-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; }
  .topbar, .content { padding-left: var(--s4); padding-right: var(--s4); }
  .grid-2, .grid-3, .profile-strip, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .profile-strip > div + div { border-left: 0; border-top: 1px solid var(--border); }
  .funnel-step, .coverage-row { grid-template-columns: minmax(0, 1fr); gap: var(--s2); }
  .funnel-val { text-align: left; }
  .page-head { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
