/* ==========================================================================
   AB ANALYSIS DOSSIER — page-specific system
   Warm paper, graphite, terracotta. Data UI inside an editorial frame.
   ========================================================================== */

.analysis-page {
  --pos: #1e5a55;
  --pos-soft: color-mix(in srgb, #1e5a55 12%, transparent);
  --neg: #a64f33;
  --neg-soft: color-mix(in srgb, #a64f33 12%, transparent);
  --warn: #9a6f2f;
  --warn-soft: color-mix(in srgb, #9a6f2f 14%, transparent);
  --info: #3d5f88;
  --panel: #f5f4ee;
  --panel-2: #edede5;
  --data-grid: color-mix(in srgb, var(--rule) 52%, transparent);
}
[data-theme="night"].analysis-page,
[data-theme="night"] .analysis-page {
  --pos: #7cbcb2;
  --pos-soft: color-mix(in srgb, #7cbcb2 14%, transparent);
  --neg: #e59a7d;
  --neg-soft: color-mix(in srgb, #e59a7d 14%, transparent);
  --warn: #d0a35e;
  --warn-soft: color-mix(in srgb, #d0a35e 15%, transparent);
  --info: #93b1d8;
  --panel: #1b1916;
  --panel-2: #23201c;
}

.analysis-page .article { max-width: 1120px; }
.analysis-page .prose { max-width: 100%; }
.analysis-page .prose > p,
.analysis-page .prose > ul,
.analysis-page .prose > ol,
.analysis-page .prose > blockquote { max-width: 780px; }

/* ---------- hero ---------- */
.ab-hero {
  position: relative;
  margin: 42px 0 10px;
  padding: 48px 46px 42px;
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  isolation: isolate;
}
.ab-hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--paper) 9%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--paper) 9%, transparent) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(115deg, transparent 20%, #000 100%);
  z-index: -1;
}
.ab-hero::after {
  content: "";
  position: absolute; right: -90px; top: -120px;
  width: 400px; height: 400px;
  border: 1px solid color-mix(in srgb, var(--paper) 16%, transparent);
  border-radius: 50%;
  box-shadow: 0 0 0 44px color-mix(in srgb, var(--paper) 4%, transparent), 0 0 0 88px color-mix(in srgb, var(--paper) 3%, transparent);
  z-index: -1;
}
.ab-hero .hero-kicker {
  display: flex; align-items: center; gap: 12px;
  font: 10px/1.4 var(--mono); letter-spacing: .18em; text-transform: uppercase;
  color: color-mix(in srgb, var(--paper) 62%, transparent);
}
.ab-hero .hero-kicker .dot { width: 6px; height: 6px; background: var(--accent); }
.ab-hero h1 {
  margin: 26px 0 18px;
  max-width: 880px;
  font-family: var(--sans);
  font-size: clamp(38px, 5.2vw, 64px);
  font-weight: 720;
  line-height: 1.14;
  letter-spacing: -.035em;
  color: var(--paper);
}
.ab-hero h1 em {
  font-style: normal;
  color: var(--accent);
}
.ab-hero .hero-lead {
  max-width: 720px;
  margin: 0;
  color: color-mix(in srgb, var(--paper) 74%, transparent);
  font-size: 16px;
  line-height: 1.85;
}
.ab-hero .hero-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 38px;
  border-top: 1px solid color-mix(in srgb, var(--paper) 18%, transparent);
  background: color-mix(in srgb, var(--paper) 18%, transparent);
}
.ab-hero .hero-meta div {
  padding: 16px 18px 2px 0;
  background: var(--ink);
}
.ab-hero .hero-meta dt {
  font: 9px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase;
  color: color-mix(in srgb, var(--paper) 46%, transparent);
}
.ab-hero .hero-meta dd {
  margin: 7px 0 0; font: 13px/1.5 var(--mono);
  color: color-mix(in srgb, var(--paper) 88%, transparent);
}
.ab-hero .hero-note {
  display: flex; gap: 10px; align-items: baseline;
  margin-top: 22px;
  font: 10.5px/1.7 var(--mono);
  color: color-mix(in srgb, var(--paper) 48%, transparent);
}
.ab-hero .hero-note b { color: var(--accent); font-weight: 500; }

/* ---------- evidence chips ---------- */
.ev {
  display: inline-flex; align-items: center;
  padding: 1px 7px;
  border: 1px solid currentColor;
  font: 9.5px/1.7 var(--mono);
  letter-spacing: .06em;
  white-space: nowrap;
  vertical-align: 2px;
}
.ev-official { color: var(--pos); }
.ev-infer { color: var(--warn); }
.ev-advice { color: var(--info); }
.ev-unknown { color: var(--muted); }

/* ---------- editorial blocks ---------- */
.ab-kicker {
  display: block;
  margin: 0 0 12px;
  font: 10px/1.5 var(--mono); letter-spacing: .16em; text-transform: uppercase;
  color: var(--faint);
}
.ab-hero + .ab-kicker { margin-top: 34px; }

.ab-thesis {
  max-width: 860px;
  margin: 44px 0 8px;
  padding: 26px 30px;
  border-left: 3px solid var(--accent);
  background: var(--panel);
  font-size: 20px;
  line-height: 1.8;
  color: var(--ink);
}
.ab-thesis b { color: var(--accent-2); }

.ab-stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 30px 0 8px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.ab-stat {
  padding: 20px 22px;
  background: var(--card);
}
.ab-stat .n {
  display: block;
  font: 30px/1.1 var(--mono);
  letter-spacing: -.04em;
  color: var(--ink);
}
.ab-stat .l {
  display: block; margin-top: 8px;
  font-size: 12px; line-height: 1.65; color: var(--muted);
}
.ab-stat .s {
  display: block; margin-top: 12px;
  font: 9px/1.5 var(--mono); letter-spacing: .08em; color: var(--faint);
}

.ab-callout {
  margin: 30px 0;
  padding: 20px 24px;
  border: 1px solid var(--rule);
  background: var(--card);
  font-size: 14.5px;
  line-height: 1.85;
}
.ab-callout .t {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 9px;
  font: 10px/1.4 var(--mono); letter-spacing: .13em; text-transform: uppercase;
  color: var(--faint);
}
.ab-callout .t::before { content: ""; width: 16px; height: 1px; background: currentColor; }
.ab-callout p { margin: 0 0 .7em; max-width: none; }
.ab-callout p:last-child { margin-bottom: 0; }
.ab-callout--warn { border-left: 3px solid var(--neg); background: var(--neg-soft); }
.ab-callout--insight { border-left: 3px solid var(--accent); background: var(--warn-soft); }
.ab-callout--technical { border-left: 3px solid var(--info); background: color-mix(in srgb, var(--info) 7%, transparent); }

.ab-principles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 28px 0;
  background: var(--rule);
  border: 1px solid var(--rule);
  counter-reset: principle;
}
.ab-principle {
  position: relative;
  padding: 24px 24px 22px;
  background: var(--card);
  counter-increment: principle;
}
.ab-principle::before {
  content: counter(principle, decimal-leading-zero);
  position: absolute; right: 18px; top: 15px;
  font: 11px var(--mono); color: var(--rule-2);
}
.ab-principle h3 {
  margin: 0 0 8px !important; padding: 0 !important;
  font-size: 15.5px !important; line-height: 1.5 !important; letter-spacing: 0 !important;
  color: var(--ink);
}
.ab-principle h3::before { display: none !important; }
.ab-principle p { margin: 0; font-size: 13.5px; line-height: 1.8; color: var(--ink-2); max-width: none; }

/* ---------- model / flow diagrams ---------- */
.ab-model {
  margin: 34px 0 10px;
  border: 1px solid var(--rule);
  background: var(--card);
}
.ab-model-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 20px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
  font: 9.5px/1.5 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint);
}
.ab-model-body { padding: 22px; }

.ab-layers { display: flex; flex-direction: column; gap: 8px; }
.ab-layer {
  display: grid; grid-template-columns: 144px minmax(0, 1fr);
  gap: 18px; align-items: start;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  background: var(--paper);
}
.ab-layer .name {
  font: 10px/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-2);
}
.ab-layer .body { display: flex; flex-wrap: wrap; gap: 6px; }
.ab-node {
  display: inline-block; padding: 4px 9px;
  background: var(--card); border: 1px solid var(--rule);
  font-size: 11.5px; line-height: 1.5; color: var(--ink-2);
}
.ab-layer.is-core { border-color: color-mix(in srgb, var(--accent) 45%, var(--rule)); }
.ab-layer.is-core .name { color: var(--accent); }

.ab-flow {
  display: flex; align-items: stretch; gap: 0;
  margin: 26px 0;
  overflow-x: auto;
  border: 1px solid var(--rule);
  background: var(--card);
}
.ab-flow-step {
  flex: 1 1 0; min-width: 120px;
  padding: 16px 15px;
  border-right: 1px solid var(--rule);
}
.ab-flow-step:last-child { border-right: 0; }
.ab-flow-step .k { font: 9px var(--mono); letter-spacing: .1em; color: var(--faint); }
.ab-flow-step .v { margin-top: 7px; font-size: 12.5px; line-height: 1.55; color: var(--ink); }
.ab-flow-step .d { margin-top: 4px; font-size: 10.5px; line-height: 1.5; color: var(--muted); }

.ab-path {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
  margin: 22px 0;
}
.ab-path span {
  padding: 5px 10px; background: var(--panel-2);
  font: 10.5px/1.5 var(--mono); color: var(--ink-2);
}
.ab-path i { font-style: normal; color: var(--faint); font-size: 11px; }
.ab-path span.is-end { background: var(--ink); color: var(--paper); }

/* ---------- tables ---------- */
.analysis-page .prose table {
  font-size: 12.5px;
  line-height: 1.65;
  margin: 18px 0 26px;
}
.analysis-page .prose th {
  font: 10px/1.5 var(--mono);
  letter-spacing: .04em;
}
.analysis-page .prose td { vertical-align: top; }
.analysis-page .table-wrap { overflow-x: auto; border: 1px solid var(--rule); }
.analysis-page .prose .table-wrap table { margin: 0; border: 0; }
.analysis-page .prose table.compact th,
.analysis-page .prose table.compact td { padding: 9px 12px; }
.analysis-page .prose table.matrix td:first-child { min-width: 130px; }

/* ---------- demo shell ---------- */
.demo-block {
  margin: 40px 0 16px;
  border: 1px solid var(--rule-2);
  background: var(--panel);
  box-shadow: 0 1px 0 var(--rule), 0 18px 50px -34px color-mix(in srgb, var(--ink) 40%, transparent);
}
.demo-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
  background: var(--card);
}
.demo-head .l { display: flex; align-items: center; gap: 10px; }
.demo-head .lights { display: flex; gap: 5px; }
.demo-head .lights i { width: 7px; height: 7px; border-radius: 50%; background: var(--rule-2); }
.demo-head .lights i:first-child { background: var(--accent); }
.demo-head .file { font: 10px/1.4 var(--mono); letter-spacing: .08em; color: var(--muted); }
.demo-head .tag {
  padding: 2px 7px; border: 1px solid var(--rule);
  font: 9px/1.6 var(--mono); letter-spacing: .07em; color: var(--faint);
}
.demo-note {
  padding: 10px 18px;
  border-bottom: 1px solid var(--rule);
  background: var(--warn-soft);
  font: 10.5px/1.7 var(--mono);
  color: var(--ink-2);
}
.demo-note b { color: var(--warn); }

.demo-body { display: grid; grid-template-columns: 178px minmax(0, 1fr); min-height: 610px; }
.demo-side {
  border-right: 1px solid var(--rule);
  background: var(--card);
  padding: 16px 12px;
}
.demo-side .exp {
  padding: 0 6px 14px; border-bottom: 1px solid var(--rule);
}
.demo-side .exp .id { font: 9px var(--mono); letter-spacing: .1em; color: var(--faint); }
.demo-side .exp .name { margin-top: 5px; font-size: 12.5px; font-weight: 600; line-height: 1.45; }
.demo-side .exp .state {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 8px;
  font: 9.5px var(--mono); color: var(--pos);
}
.demo-side .exp .state::before { content: ""; width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
.demo-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; }
.demo-nav button {
  text-align: left; border: 0; background: transparent;
  padding: 7px 8px; font-size: 11.5px; color: var(--muted);
  border-left: 2px solid transparent;
}
.demo-nav button:hover { color: var(--ink); background: var(--panel); }
.demo-nav button[aria-selected="true"] { color: var(--ink); background: var(--panel); border-left-color: var(--accent); }
.demo-side .foot {
  margin: 22px 6px 0; padding-top: 12px; border-top: 1px solid var(--rule);
  font: 9px/1.7 var(--mono); color: var(--faint);
}

.demo-main { min-width: 0; background: var(--paper); }
.demo-top {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--rule);
  background: var(--card);
}
.demo-top .crumbs { font: 10px/1.5 var(--mono); color: var(--muted); }
.demo-top .crumbs b { color: var(--ink); font-weight: 500; }
.demo-top .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.demo-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border: 1px solid var(--rule-2); background: var(--card);
  font: 10px/1.5 var(--mono); color: var(--ink-2);
}
.demo-btn:hover { border-color: var(--ink); color: var(--ink); }
.demo-btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.demo-btn.primary:hover { background: var(--accent); border-color: var(--accent); }
.demo-btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-2); }

.demo-panel { padding: 18px; }
.demo-panel[hidden] { display: none; }
.demo-panel-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 10px;
  margin-bottom: 14px;
}
.demo-panel-head h4 { margin: 0; font: 13px/1.4 var(--sans); font-weight: 650; }
.demo-panel-head .hint { font: 9.5px/1.5 var(--mono); color: var(--faint); }

.demo-verdict {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px; align-items: center;
  padding: 17px 18px;
  border: 1px solid color-mix(in srgb, var(--pos) 34%, var(--rule));
  background: var(--pos-soft);
}
.demo-verdict .k { font: 9px/1.5 var(--mono); letter-spacing: .1em; color: var(--pos); }
.demo-verdict .v { margin-top: 5px; font-size: 13.5px; line-height: 1.7; }
.demo-verdict .v b { color: var(--pos); }
.demo-verdict .side { text-align: right; font: 9.5px/1.7 var(--mono); color: var(--muted); }
.demo-verdict .side b { display: block; font-size: 19px; color: var(--ink); letter-spacing: -.03em; }

.demo-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-top: 12px; background: var(--rule); border: 1px solid var(--rule); }
.demo-metric { padding: 13px 15px; background: var(--card); }
.demo-metric .k { font: 9px/1.5 var(--mono); letter-spacing: .06em; color: var(--faint); }
.demo-metric .v { display: flex; align-items: baseline; gap: 7px; margin-top: 6px; }
.demo-metric .v b { font: 23px/1.1 var(--mono); letter-spacing: -.04em; }
.demo-metric .v span { font: 9.5px var(--mono); color: var(--muted); }
.demo-metric .d { margin-top: 6px; font: 9px/1.6 var(--mono); color: var(--muted); }
.demo-metric .v.pos b { color: var(--pos); }
.demo-metric .v.neg b { color: var(--neg); }
.demo-metric .v.warn b { color: var(--warn); }

.demo-chart { margin-top: 14px; border: 1px solid var(--rule); background: var(--card); padding: 14px 16px 8px; }
.demo-chart .caption { display: flex; justify-content: space-between; font: 9px/1.5 var(--mono); color: var(--faint); margin-bottom: 12px; }
.demo-bar-row { display: grid; grid-template-columns: 70px minmax(0, 1fr) 104px; gap: 10px; align-items: center; padding: 5px 0; }
.demo-bar-row .lab { font: 10px/1.4 var(--mono); color: var(--muted); }
.demo-bar-row .track { height: 14px; background: var(--panel-2); position: relative; overflow: hidden; }
.demo-bar-row .fill { display: block; height: 100%; background: var(--rule-2); }
.demo-bar-row.is-b .fill { background: var(--accent); }
.demo-bar-row.is-c .fill { background: var(--info); }
.demo-bar-row .val { font: 9.5px/1.4 var(--mono); color: var(--ink-2); text-align: right; }
.demo-bar-row .val b { color: var(--ink); }

.demo-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.demo-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border: 1px solid var(--rule);
  background: var(--card); font: 9px/1.6 var(--mono); color: var(--muted);
}
.demo-chip b { color: var(--ink-2); font-weight: 500; }
.demo-chip.ok { border-color: color-mix(in srgb, var(--pos) 40%, var(--rule)); color: var(--pos); }
.demo-chip.warn { border-color: color-mix(in srgb, var(--warn) 40%, var(--rule)); color: var(--warn); }

/* demo table */
.demo-table { width: 100%; border-collapse: collapse; font-size: 10.5px; line-height: 1.55; }
.demo-table th {
  text-align: left; padding: 7px 8px;
  border-bottom: 1px solid var(--rule-2);
  font: 8.5px/1.4 var(--mono); letter-spacing: .05em; color: var(--faint); white-space: nowrap;
}
.demo-table td { padding: 8px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.demo-table tr:last-child td { border-bottom: 0; }
.demo-table tr.is-selected { background: var(--warn-soft); }
.demo-table tr[data-metric] { cursor: pointer; }
.demo-table tr[data-metric]:hover { background: var(--panel); }
.demo-table .num { font-family: var(--mono); white-space: nowrap; }
.demo-table .metric-name b { display: block; font-weight: 600; font-size: 11px; }
.demo-table .metric-name span { display: block; color: var(--faint); font-size: 9px; }
.demo-table .pos { color: var(--pos); }
.demo-table .neg { color: var(--neg); }
.demo-table .warn { color: var(--warn); }
.demo-table .tagcell { font: 8px/1.4 var(--mono); color: var(--faint); }

.demo-detail {
  margin-top: 12px; padding: 13px 15px;
  border: 1px solid var(--rule); background: var(--panel);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px;
}
.demo-detail .t { font: 9px var(--mono); letter-spacing: .08em; color: var(--faint); }
.demo-detail .v { margin-top: 5px; font-size: 11.5px; line-height: 1.65; }
.demo-detail .v b { color: var(--ink); }

/* audience builder */
.demo-audience { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr); gap: 12px; }
.demo-aud-box { border: 1px solid var(--rule); background: var(--card); }
.demo-aud-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--rule); font: 9px var(--mono); letter-spacing: .07em; color: var(--faint); }
.demo-rule { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--rule); }
.demo-rule:last-child { border-bottom: 0; }
.demo-rule .conn { font: 8px var(--mono); color: var(--faint); text-align: center; }
.demo-rule .cond { font-size: 10.5px; line-height: 1.5; }
.demo-rule .cond b { color: var(--ink); }
.demo-rule .cond span { color: var(--muted); }
.demo-rule .x { border: 0; background: transparent; color: var(--faint); font: 12px var(--mono); }
.demo-rule .x:hover { color: var(--neg); }
.demo-aud-add { padding: 8px 12px; font: 9px var(--mono); color: var(--accent-2); border: 0; background: transparent; }
.demo-aud-side { border: 1px solid var(--rule); background: var(--card); padding: 12px; }
.demo-aud-side .est { font: 9px var(--mono); color: var(--faint); }
.demo-aud-side .big { margin-top: 5px; font: 25px/1.1 var(--mono); letter-spacing: -.04em; }
.demo-aud-side .sub { margin-top: 4px; font: 9px/1.6 var(--mono); color: var(--muted); }
.demo-aud-side .meter { height: 5px; background: var(--panel-2); margin: 12px 0 14px; }
.demo-aud-side .meter i { display: block; height: 100%; width: 23.1%; background: var(--accent); }
.demo-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--rule); border: 1px solid var(--rule); margin: 10px 0; }
.demo-toggle button { border: 0; background: var(--card); padding: 7px 8px; font: 9px/1.45 var(--mono); color: var(--muted); text-align: left; }
.demo-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.demo-warning { margin-top: 10px; padding: 10px 12px; border-left: 2px solid var(--warn); background: var(--warn-soft); font-size: 9.5px; line-height: 1.7; color: var(--ink-2); }
.demo-warning b { color: var(--warn); }
.demo-cohorts { margin-top: 12px; border: 1px solid var(--rule); background: var(--card); }
.demo-cohorts .row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 11px; border-bottom: 1px solid var(--rule); font-size: 10px; }
.demo-cohorts .row:last-child { border-bottom: 0; }
.demo-cohorts .row span:last-child { font-family: var(--mono); color: var(--muted); }

/* drill */
.demo-drill-controls { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.demo-drill-controls button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.demo-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; font: 9.5px var(--mono); color: var(--muted); }
.demo-breadcrumb b { color: var(--ink); }
.demo-breadcrumb i { font-style: normal; color: var(--faint); }
.demo-drill-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .7fr); gap: 12px; }
.demo-drill-chart { border: 1px solid var(--rule); background: var(--card); padding: 12px; }
.demo-dim-row { display: grid; grid-template-columns: 104px minmax(0, 1fr) 64px; gap: 9px; align-items: center; padding: 5px 0; cursor: pointer; }
.demo-dim-row:hover .track { background: var(--panel-2); }
.demo-dim-row .lab { font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-dim-row .track { height: 12px; background: var(--panel); position: relative; }
.demo-dim-row .fill { display: block; height: 100%; background: var(--info); opacity: .75; }
.demo-dim-row.is-selected .fill { background: var(--accent); opacity: 1; }
.demo-dim-row .v { font: 9px var(--mono); color: var(--ink-2); text-align: right; }
.demo-users { border: 1px solid var(--rule); background: var(--card); padding: 11px; }
.demo-users .t { font: 9px var(--mono); color: var(--faint); margin-bottom: 7px; }
.demo-user { display: grid; grid-template-columns: 1fr auto; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--rule); font: 9px/1.5 var(--mono); }
.demo-user:last-child { border-bottom: 0; }
.demo-user .id { color: var(--ink-2); }
.demo-user .val { color: var(--muted); }
.demo-users .more { margin-top: 8px; font: 8.5px/1.6 var(--mono); color: var(--faint); }
.demo-query { margin-top: 12px; border: 1px solid var(--rule); background: var(--ink); color: color-mix(in srgb, var(--paper) 82%, transparent); }
.demo-query .bar { display: flex; justify-content: space-between; gap: 10px; padding: 7px 11px; border-bottom: 1px solid color-mix(in srgb, var(--paper) 16%, transparent); font: 8.5px var(--mono); color: color-mix(in srgb, var(--paper) 50%, transparent); }
.demo-query .bar b { color: var(--pos); font-weight: 500; }
.demo-query pre { margin: 0; padding: 10px 12px; font: 9px/1.75 var(--mono); overflow-x: auto; white-space: pre; color: inherit; background: transparent; border: 0; }
.demo-query .kw { color: #e6a37f; }

/* advanced */
.demo-methods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.demo-method { border: 1px solid var(--rule); background: var(--card); padding: 12px; }
.demo-method .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.demo-method .top b { font-size: 11px; }
.demo-method .top .ev { font-size: 8px; }
.demo-method p { margin: 7px 0 0; font-size: 9.5px; line-height: 1.65; color: var(--muted); max-width: none; }
.demo-method .result { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--rule); font: 9px/1.6 var(--mono); color: var(--ink-2); }
.demo-method .result b { color: var(--pos); }
.demo-switch { border: 1px solid var(--rule-2); background: var(--card); width: 30px; height: 16px; padding: 2px; display: inline-flex; }
.demo-switch i { width: 11px; height: 11px; background: var(--rule-2); transition: transform .18s var(--ease), background .18s; }
.demo-switch[aria-pressed="true"] { border-color: var(--pos); }
.demo-switch[aria-pressed="true"] i { background: var(--pos); transform: translateX(13px); }
.demo-uplift { margin-top: 10px; border: 1px solid var(--rule); background: var(--card); }
.demo-uplift .row { display: grid; grid-template-columns: minmax(0, 1fr) 70px 70px 60px; gap: 8px; padding: 7px 11px; border-bottom: 1px solid var(--rule); font-size: 9.5px; }
.demo-uplift .row:last-child { border-bottom: 0; }
.demo-uplift .row.head { font: 8px var(--mono); letter-spacing: .05em; color: var(--faint); }
.demo-uplift .row .num { font-family: var(--mono); text-align: right; }
.demo-uplift .row .pos { color: var(--pos); }
.demo-uplift .row .muted { color: var(--faint); }

/* toast */
.demo-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px);
  z-index: 200; padding: 9px 15px;
  background: var(--ink); color: var(--paper);
  font: 10px/1.5 var(--mono);
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  max-width: min(90vw, 560px);
}
.demo-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- wireframe ---------- */
.ab-wire {
  margin: 30px 0;
  border: 1px solid var(--rule-2);
  background: var(--card);
  padding: 14px;
}
.ab-wire-top { display: flex; gap: 8px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--rule); }
.ab-wire-top i { width: 6px; height: 6px; border-radius: 50%; background: var(--rule-2); }
.ab-wire-top span { margin-left: auto; font: 8.5px var(--mono); color: var(--faint); }
.ab-wire-grid { display: grid; grid-template-columns: 120px minmax(0, 1fr) 210px; gap: 8px; margin-top: 10px; }
.ab-wire-col { display: flex; flex-direction: column; gap: 6px; }
.ab-wire-box {
  position: relative;
  padding: 8px 10px;
  border: 1px dashed var(--rule-2);
  background: var(--panel);
  font-size: 10px; line-height: 1.5; color: var(--muted);
}
.ab-wire-box b { display: block; font: 8px var(--mono); letter-spacing: .06em; color: var(--accent-2); margin-bottom: 2px; }
.ab-wire-box.tall { flex: 1; min-height: 84px; }
.ab-wire-box.accent { border-style: solid; border-color: color-mix(in srgb, var(--accent) 50%, var(--rule)); }
.ab-wire-legend { margin-top: 10px; font: 9px/1.7 var(--mono); color: var(--faint); }

/* ---------- spec cards ---------- */
.ab-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 26px 0; }
.ab-spec {
  padding: 18px 20px; border: 1px solid var(--rule); background: var(--card);
}
.ab-spec .k { font: 9px/1.5 var(--mono); letter-spacing: .12em; color: var(--accent-2); text-transform: uppercase; }
.ab-spec h3 { margin: 7px 0 8px !important; padding: 0 !important; font-size: 15px !important; line-height: 1.5 !important; }
.ab-spec h3::before { display: none !important; }
.ab-spec p { margin: 0; font-size: 12.5px; line-height: 1.75; color: var(--ink-2); max-width: none; }
.ab-spec ul { margin: 8px 0 0 1.1em; font-size: 12px; }
.ab-spec li { margin: 3px 0; }

/* ---------- PRD ---------- */
.ab-prd { margin: 26px 0; border-top: 1px solid var(--rule-2); }
.ab-prd-row {
  display: grid; grid-template-columns: 118px minmax(0, 1fr) 168px;
  gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--rule);
}
.ab-prd-row .p { font: 9px/1.6 var(--mono); color: var(--accent-2); letter-spacing: .06em; }
.ab-prd-row .what b { display: block; font-size: 14px; margin-bottom: 4px; }
.ab-prd-row .what span { font-size: 12.5px; line-height: 1.7; color: var(--ink-2); }
.ab-prd-row .why { font-size: 11.5px; line-height: 1.7; color: var(--muted); }

/* ---------- refs ---------- */
.ab-refs { margin: 30px 0; counter-reset: ref; }
.ab-refs li { font-size: 12.5px; line-height: 1.8; }
.ab-refs a { word-break: break-word; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .ab-hero { padding: 36px 30px 32px; }
  .ab-hero .hero-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo-body { grid-template-columns: 1fr; }
  .demo-side { display: flex; align-items: center; gap: 14px; overflow-x: auto; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--rule); }
  .demo-side .exp { border-bottom: 0; padding: 0 12px 0 4px; border-right: 1px solid var(--rule); min-width: 150px; }
  .demo-side .foot { display: none; }
  .demo-nav { flex-direction: row; margin: 0; }
  .demo-nav button { white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; }
  .demo-nav button[aria-selected="true"] { border-left-color: transparent; border-bottom-color: var(--accent); }
  .demo-audience { grid-template-columns: 1fr; }
  .demo-drill-grid { grid-template-columns: 1fr; }
  .ab-wire-grid { grid-template-columns: 90px minmax(0, 1fr); }
  .ab-wire-grid > .ab-wire-col:last-child { display: none; }
}

@media (max-width: 680px) {
  .ab-hero { margin-top: 24px; padding: 30px 22px 26px; }
  .ab-hero h1 { font-size: 34px; }
  .ab-hero .hero-lead { font-size: 14.5px; }
  .ab-hero .hero-meta { grid-template-columns: 1fr 1fr; margin-top: 26px; }
  .ab-thesis { padding: 20px; font-size: 17px; }
  .ab-stat-row { grid-template-columns: 1fr; }
  .ab-principles { grid-template-columns: 1fr; }
  .ab-specs { grid-template-columns: 1fr; }
  .ab-flow { flex-direction: column; }
  .ab-flow-step { border-right: 0; border-bottom: 1px solid var(--rule); }
  .ab-flow-step:last-child { border-bottom: 0; }
  .ab-layer { grid-template-columns: 1fr; gap: 7px; }
  .ab-prd-row { grid-template-columns: 1fr; gap: 5px; }
  .demo-metrics { grid-template-columns: 1fr; }
  .demo-verdict { grid-template-columns: 1fr; }
  .demo-verdict .side { text-align: left; }
  .demo-methods { grid-template-columns: 1fr; }
  .demo-table th:nth-child(4), .demo-table td:nth-child(4) { display: none; }
  .demo-bar-row { grid-template-columns: 42px minmax(0, 1fr) 76px; }
  .demo-nav button { font-size: 10.5px; padding: 6px 7px; }
  .demo-top { padding: 10px 12px; }
  .demo-panel { padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .demo-switch i, .demo-toast { transition: none; }
}

/* ---------- homepage special row ---------- */
.analysis-row {
  margin: 14px 0 8px;
  padding: 16px 18px !important;
  border: 1px solid var(--rule-2) !important;
  background: var(--card);
  grid-template-columns: 40px 112px minmax(0, 1fr) 78px !important;
}
.analysis-row::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--accent);
}
.analysis-row { position: relative; }
.analysis-row .row-icon {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--ink); color: var(--paper);
  font: 12px var(--mono);
}
.analysis-row .row-category { color: var(--accent-2); }
.analysis-row .row-title { font-size: 18px; }
.analysis-row .row-description { margin-top: 5px; max-width: 620px; }
@media (max-width: 920px) {
  .analysis-row { grid-template-columns: 34px minmax(0,1fr) 66px !important; gap: 12px; }
  .analysis-row .row-category { display: none; }
  .analysis-row .row-icon { width: 34px; height: 34px; }
}

/* prevent metric numbers from wrapping in narrow demo columns */
.demo-metric .v b { flex: none; white-space: nowrap; }
.demo-metric .v { flex-wrap: wrap; }

@media (min-width: 921px) and (max-width: 1180px) {
  .analysis-page .shell { grid-template-columns: 230px minmax(0, 1fr); }
  .analysis-page .article { padding-left: 40px; padding-right: 40px; }
}
