:root {
  color-scheme: dark;
  --bg: #080b10;
  --panel: #11161e;
  --panel2: #171e28;
  --line: #293241;
  --text: #f4f7fb;
  --muted: #91a0b5;
  --good: #68e0a8;
  --raw: #7db7ff;
  --warn: #ffcc66;
  --bad: #ff8b8b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
a { color: inherit; }
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  padding: 24px 30px 18px;
  border-bottom: 1px solid var(--line);
  background: #0b1017;
}
.eyebrow { color: var(--raw); font-size: 11px; letter-spacing: .11em; }
h1 { margin: 4px 0 0; font: 700 26px/1.15 system-ui, sans-serif; }
h2 { margin: 0; font: 700 18px/1.2 system-ui, sans-serif; }
p { margin: 5px 0 0; color: var(--muted); }
.top-actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.top-actions label { display: flex; gap: 7px; align-items: center; color: var(--muted); }
select, button, .secondary {
  border: 1px solid #3b4656;
  border-radius: 7px;
  background: #121922;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
  text-decoration: none;
}
button { cursor: pointer; }
button:hover, .secondary:hover { border-color: var(--raw); }
main { max-width: 1500px; margin: 0 auto; padding: 20px 26px 54px; }
.policy-strip {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  padding: 11px 14px;
  margin-bottom: 18px;
  background: #15130d;
  border: 1px solid #413719;
  border-radius: 9px;
  color: #f1d992;
}
.policy-strip strong { color: var(--warn); }
.overview-status {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #2b3a4d;
  border-radius: 9px;
  background: #0d141d;
  color: var(--muted);
  font-size: 11px;
}
.overview-status strong { color: var(--warn); }
.overview-status span { padding-right: 12px; border-right: 1px solid #293241; }
.overview-status span:last-child { border-right: 0; padding-right: 0; }
.hero-card, .definitions {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 18px;
}
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.products-head { margin: 26px 0 12px; }
.legend { display: flex; gap: 13px; flex-wrap: wrap; color: var(--muted); font-size: 11px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.dot.confirmed { background: var(--good); }
.dot.raw { background: var(--raw); }
.dot.unknown { background: #566171; }
.funnel-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 26px;
}
.stage-card {
  position: relative;
  min-height: 150px;
  padding: 15px;
  border: 1px solid #303a49;
  border-radius: 11px;
  background: var(--panel2);
}
.stage-card:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -22px;
  top: 58px;
  color: #576477;
  font-size: 22px;
}
.stage-index { color: #69788d; font-size: 11px; }
.stage-label { margin-top: 3px; font-weight: 700; }
.stage-value { margin-top: 14px; font: 700 33px/1 system-ui, sans-serif; color: var(--good); }
.stage-value.confirmed { color: var(--good); }
.stage-value.raw, .stage-value.diagnostic { color: var(--raw); }
.stage-value.unknown { color: #697586; }
.stage-raw { margin-top: 8px; color: var(--raw); font-size: 12px; }
.stage-coverage { margin-top: 6px; color: var(--muted); font-size: 11px; }
.product-grid { display: grid; gap: 13px; }
.product-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}
.product-title {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
}
.product-title h3 { margin: 0; font: 700 16px/1.2 system-ui, sans-serif; }
.product-meta { color: var(--muted); font-size: 11px; margin-top: 3px; }
.status-pill { border: 1px solid #3c4757; border-radius: 999px; padding: 4px 8px; font-size: 11px; }
.status-pill.live { color: var(--good); border-color: #285c47; }
.status-pill.unavailable { color: var(--bad); border-color: #704040; }
.product-funnel {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}
.product-stage {
  min-width: 0;
  padding: 13px 15px;
  border-right: 1px solid var(--line);
}
.product-stage:last-child { border-right: 0; }
.product-stage .name { color: var(--muted); font-size: 11px; }
.product-stage .main { margin-top: 4px; font: 700 22px/1.1 system-ui, sans-serif; color: var(--good); }
.product-stage .main.confirmed { color: var(--good); }
.product-stage .main.raw, .product-stage .main.diagnostic { color: var(--raw); }
.product-stage .main.unknown { color: #687485; }
.product-stage .raw { color: var(--raw); margin-top: 4px; font-size: 11px; }
.product-stage .note { color: #7e8b9d; margin-top: 6px; font-size: 10px; line-height: 1.35; }
.discovery-details {
  padding: 10px 15px 12px;
  border-top: 1px solid var(--line);
  background: #0d141d;
}
.discovery-details .title { color: var(--raw); font-size: 11px; font-weight: 700; margin-bottom: 7px; }
.discovery-details-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.discovery-detail { border: 1px solid #253243; border-radius: 7px; padding: 8px; background: #101923; }
.discovery-detail b { display: block; color: var(--muted); font-size: 10px; margin-bottom: 4px; }
.discovery-detail span { display: block; color: #c6d5e8; font-size: 10px; overflow-wrap: anywhere; }
.bottleneck {
  padding: 9px 15px;
  border-top: 1px solid var(--line);
  color: var(--warn);
  background: #15130d;
  font-size: 12px;
}
.warning-list { padding: 8px 15px 11px; color: #bfaa70; font-size: 11px; border-top: 1px solid #2b2a20; }
.definitions { margin-top: 26px; }
.distribution-attribution { margin-top: 26px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: 18px; }
.attribution-grid { display: grid; gap: 13px; }
.attribution-card { border: 1px solid var(--line); border-radius: 10px; background: #0e141c; padding: 12px; overflow-x: auto; }
.attribution-card h3 { margin: 0 0 9px; font: 700 15px/1.2 system-ui, sans-serif; }
.attribution-card table { width: 100%; border-collapse: collapse; font-size: 11px; }
.attribution-card th, .attribution-card td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.attribution-card th { color: var(--muted); font-weight: 400; }
.state-attributed { color: var(--good); }
.state-unattributed { color: var(--warn); }
.state-not_measurable { color: #697586; }
.attribution-empty { color: var(--muted); font-size: 11px; }
.definition-grid { margin-top: 13px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; }
.definition { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #0e141c; }
.definition b { display: block; margin-bottom: 4px; }
.definition span { color: var(--muted); font-size: 11px; }
.error-box { padding: 30px; border: 1px solid #613b3b; background: #1a1010; border-radius: 12px; color: var(--bad); }
@media (max-width: 1000px) {
  .funnel-grid { grid-template-columns: 1fr; gap: 8px; }
  .stage-card:not(:last-child)::after { content: "↓"; right: 50%; top: auto; bottom: -22px; z-index: 2; }
  .product-funnel { grid-template-columns: 1fr 1fr; }
  .product-stage { border-bottom: 1px solid var(--line); }
  .definition-grid { grid-template-columns: 1fr 1fr; }
  .discovery-details-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .topbar { align-items: start; flex-direction: column; padding: 18px; }
  main { padding: 15px; }
  .section-head { align-items: start; flex-direction: column; }
  .product-funnel, .definition-grid { grid-template-columns: 1fr; }
  .product-stage { border-right: 0; }
}
