/* Swing Regime — obsidian-glass page, same observatory palette as /dashboard/. */

:root {
  --ink: #0b0e15;
  --panel: rgba(20, 25, 38, 0.72);
  --line: rgba(255, 255, 255, 0.09);
  --text: #e6e9f2;
  --dim: #98a0b3;
  --orange: #f7931a;
  --orange-hot: #ffb14d;
  --teal: #14b8a6;
  --green: #4caf50;
  --amber: #f59e0b;
  --red: #ef5350;
  --sky: #38bdf8;
  --violet: #8b5cf6;
  --mint: #34d399;
  --disp: "Unbounded", sans-serif;
  --body: "Sora", sans-serif;
  --mono: "IBM Plex Mono", monospace;
  /* phase colors — shared with the chart band shading */
  --ph-capitulation: var(--violet);
  --ph-accumulation: var(--teal);
  --ph-early_expansion: var(--sky);
  --ph-markup: var(--mint);
  --ph-distribution: var(--amber);
  --ph-markdown: var(--red);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background:
    radial-gradient(50% 35% at 85% 0%, rgba(247, 147, 26, .10), transparent 65%),
    radial-gradient(45% 35% at 8% 100%, rgba(20, 184, 166, .08), transparent 65%),
    var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-weight: 300;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
b { font-weight: 600; }
a { color: inherit; }

a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--orange-hot);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- nav (matches /dashboard/) ---------- */
.nav { display: flex; justify-content: space-between; align-items: center; padding: 18px clamp(16px, 4vw, 48px); flex-wrap: wrap; gap: 10px; }
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-coin {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  font-weight: 700; color: #1a1205;
  background: radial-gradient(circle at 32% 28%, #ffd27a, var(--orange) 62%, #c46f08);
  box-shadow: 0 0 18px rgba(247, 147, 26, .5);
}
.brand-word { font-family: var(--disp); font-weight: 300; font-size: 13px; letter-spacing: .14em; }
.brand-word b { color: var(--orange); font-weight: 700; }
.nav-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.nav-cta {
  text-decoration: none; font-size: 13.5px; color: var(--text);
  border: 1px solid rgba(247, 147, 26, .55); border-radius: 999px; padding: 8px 16px;
  transition: background .2s;
}
.nav-cta:hover { background: rgba(247, 147, 26, .14); }

/* ---------- header (section A) ---------- */
.head { text-align: center; padding: clamp(14px, 3vh, 36px) 20px 6px; }
.head h1 { font-family: var(--disp); font-weight: 900; font-size: clamp(26px, 4.4vw, 48px); }
.accent {
  background: linear-gradient(100deg, var(--orange-hot), var(--orange) 55%, var(--amber));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.head-meta {
  display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 14px; font-family: var(--mono); font-size: 12.5px; color: var(--dim);
}
.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px;
  font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--text);
  background: rgba(11, 14, 21, .6);
}
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #26a69a; }
.status-pill.live .dot { animation: pulse 1.8s infinite; }
.status-pill.cached .dot, .status-pill.delayed .dot { background: var(--amber); animation: none; }
.status-pill.demo { border-color: rgba(245, 158, 11, .65); color: var(--amber); }
.status-pill.demo .dot { background: var(--amber); animation: none; }
.status-pill.unavailable .dot { background: var(--red); animation: none; }
@keyframes pulse { 50% { opacity: .5; } }
.method-link { color: var(--sky); text-decoration: underline dotted; }
.head-disclaimer { max-width: 860px; margin: 10px auto 0; font-size: 12px; color: var(--dim); }

.demo-banner {
  max-width: 860px; margin: 14px auto 0; padding: 10px 16px;
  border: 1px solid rgba(245, 158, 11, .55); border-radius: 12px;
  background: rgba(245, 158, 11, .08); color: var(--amber);
  font-family: var(--mono); font-size: 12.5px; text-align: center;
}
.demo-banner[hidden] { display: none; }

/* horizon selector */
.horizon-row { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.hz-group { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: rgba(11, 14, 21, .55); }
.hz-btn {
  border: 0; background: transparent; color: var(--dim); cursor: pointer;
  font-family: var(--mono); font-size: 12.5px; font-weight: 600; padding: 9px 18px;
  transition: color .2s, background .2s;
}
.hz-btn[aria-checked="true"] { color: #10131c; background: linear-gradient(100deg, var(--orange-hot), var(--orange)); }
.hz-context {
  border: 1px dashed var(--line); background: transparent; color: var(--dim); cursor: pointer;
  font-family: var(--mono); font-size: 12.5px; padding: 9px 16px; border-radius: 999px;
}
.hz-context[aria-expanded="true"] { color: var(--text); border-color: var(--sky); }
.context-panel {
  max-width: 760px; margin: 12px auto 0; padding: 12px 18px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel);
  font-size: 13px; color: var(--dim); text-align: center;
}
.context-panel[hidden] { display: none; }
.context-panel .chips { display: inline-flex; gap: 8px; margin-left: 8px; vertical-align: middle; }
.chip-link {
  display: inline-block; text-decoration: none; font-family: var(--mono); font-size: 12px;
  color: var(--text); border: 1px solid rgba(56, 189, 248, .5); border-radius: 999px; padding: 4px 12px;
}
.chip-link:hover { background: rgba(56, 189, 248, .12); }

/* ---------- layout ---------- */
.page { max-width: 1220px; margin: 0 auto; padding: 20px clamp(12px, 3vw, 32px) 60px; }
.block { margin: 34px 0; }
.block-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.block-head h2 { font-family: var(--disp); font-weight: 700; font-size: clamp(17px, 2.3vw, 24px); }
.block-sub { color: var(--dim); font-size: 13px; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 20px; position: relative;
}
.sect-error {
  border: 1px solid rgba(239, 83, 80, .5); border-radius: 12px; background: rgba(239, 83, 80, .07);
  color: #f8b4b4; font-size: 13px; padding: 12px 16px;
}
.mini-badge {
  display: inline-block; font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  color: var(--amber); border: 1px solid rgba(245, 158, 11, .55); border-radius: 6px;
  padding: 1px 7px; vertical-align: middle; margin-left: 8px;
}
.mini-badge[hidden] { display: none; }

/* skeletons */
.sk {
  display: block; height: 14px; border-radius: 6px; margin: 8px 0;
  background: linear-gradient(100deg, rgba(255, 255, 255, .07) 35%, rgba(255, 255, 255, .18) 50%, rgba(255, 255, 255, .07) 65%);
  background-size: 220% 100%;
  animation: sk-slide 1.6s linear infinite;
}
@keyframes sk-slide { from { background-position: 130% 0; } to { background-position: -90% 0; } }

/* ---------- hero (section B) ---------- */
.hero-grid { display: grid; grid-template-columns: minmax(240px, 1.1fr) minmax(260px, 1.4fr) minmax(220px, 1fr); gap: 16px; }
.hero-phase-card { text-align: center; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.hero-phase {
  font-family: var(--disp); font-weight: 900; font-size: clamp(26px, 3.4vw, 40px); line-height: 1.15;
  color: var(--ph, var(--teal));
  text-shadow: 0 0 34px color-mix(in srgb, var(--ph, var(--teal)) 35%, transparent);
}
.hero-sub { font-size: 13px; color: var(--dim); }
.status-chip {
  display: inline-block; font-family: var(--mono); font-size: 12px; font-weight: 600;
  border-radius: 999px; padding: 4px 13px; margin: 0 auto;
  border: 1px solid var(--line); color: var(--dim); background: rgba(255, 255, 255, .04);
}
.status-chip.confirmed { color: var(--teal); border-color: rgba(20, 184, 166, .55); background: rgba(20, 184, 166, .1); }
.status-chip.developing { color: var(--sky); border-color: rgba(56, 189, 248, .55); background: rgba(56, 189, 248, .1); }
.status-chip.watch { color: var(--dim); }
.status-chip.weakening { color: var(--amber); border-color: rgba(245, 158, 11, .55); background: rgba(245, 158, 11, .1); }
.status-chip.invalidated { color: var(--red); border-color: rgba(239, 83, 80, .55); background: rgba(239, 83, 80, .1); }

/* probability bars */
.prob-row { display: grid; grid-template-columns: 118px 1fr 52px; align-items: center; gap: 10px; margin: 7px 0; }
.prob-name { font-family: var(--mono); font-size: 11.5px; color: var(--dim); display: flex; align-items: center; gap: 6px; }
.prob-name .swatch { width: 8px; height: 8px; border-radius: 2px; background: var(--ph, #787b86); flex: 0 0 auto; }
.prob-track { display: block; height: 10px; border-radius: 5px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.prob-fill { display: block; height: 100%; border-radius: 5px; background: var(--ph, var(--teal)); transition: width .8s cubic-bezier(.2, .7, .2, 1); }
.prob-row.current .prob-name { color: var(--text); font-weight: 600; }
.prob-val { font-family: var(--mono); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }

/* confidence dial */
@property --p { syntax: "<number>"; inherits: false; initial-value: 0; }
.conf-card { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.conf-ring {
  --p: 0; --gc: var(--sky);
  position: relative; width: 118px; height: 118px; border-radius: 50%;
  background: conic-gradient(from -90deg, var(--gc) calc(var(--p) * 3.6deg), rgba(255, 255, 255, .07) 0);
  transition: --p 1.2s cubic-bezier(.2, .7, .2, 1);
  box-shadow: 0 0 34px color-mix(in srgb, var(--gc) 24%, transparent);
}
.conf-ring::after {
  content: ""; position: absolute; inset: 9px; border-radius: 50%;
  background: radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .10), transparent 55%), #0e1220;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .6);
}
.conf-val {
  position: absolute; inset: 0; z-index: 1; display: grid; place-items: center;
  font-family: var(--disp); font-weight: 700; font-size: 28px; font-variant-numeric: tabular-nums;
}
.conf-comps { width: 100%; }
.conf-comp { display: grid; grid-template-columns: 76px 1fr 34px; gap: 8px; align-items: center; font-family: var(--mono); font-size: 10.5px; color: var(--dim); margin: 4px 0; }
.conf-comp .prob-track { height: 6px; }
.conf-comp .prob-fill { background: var(--sky); }
.conf-penalties { font-family: var(--mono); font-size: 10.5px; color: var(--amber); line-height: 1.7; list-style: none; }

/* risk / bottoming strips */
.gauge-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.gauge { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.gauge .k { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; color: var(--dim); text-transform: uppercase; }
.gauge .v { display: block; font-family: var(--disp); font-weight: 700; font-size: 21px; margin: 2px 0; }
.gauge .s { display: block; font-size: 11.5px; color: var(--dim); line-height: 1.45; }

/* data-health mini panel */
.dh-mini { font-family: var(--mono); font-size: 11.5px; color: var(--dim); }
.dh-mini h3 { font-family: var(--disp); font-weight: 700; font-size: 13.5px; color: var(--text); margin-bottom: 8px; }
.dh-row { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px dashed rgba(255, 255, 255, .06); }
.dh-row:last-child { border-bottom: 0; }
.dh-tag { font-weight: 600; }
.dh-tag.ok, .dh-tag.live { color: var(--teal); }
.dh-tag.demo, .dh-tag.stale, .dh-tag.cached, .dh-tag.delayed { color: var(--amber); }
.dh-tag.missing, .dh-tag.unavailable { color: var(--red); }
.dh-notes { margin-top: 8px; line-height: 1.7; }

/* ---------- transition watch (C) ---------- */
.tr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.tr-card { display: flex; flex-direction: column; gap: 9px; }
.tr-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.tr-label { font-family: var(--disp); font-weight: 700; font-size: 14px; line-height: 1.35; }
.tr-prob { font-family: var(--disp); font-weight: 900; font-size: 25px; font-variant-numeric: tabular-nums; }
.tr-deltas { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.delta-up { color: var(--teal); }
.delta-down { color: var(--red); }
.tr-list { list-style: none; font-size: 12px; line-height: 1.55; }
.tr-list li { padding-left: 20px; position: relative; margin: 3px 0; }
.tr-list li::before { position: absolute; left: 0; font-family: var(--mono); }
.tr-list.confirmed li { color: var(--text); }
.tr-list.confirmed li::before { content: "✓"; color: var(--teal); }
.tr-list.missing li { color: var(--dim); }
.tr-list.missing li::before { content: "○"; color: var(--dim); }
.tr-kicker { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--dim); text-transform: uppercase; margin-top: 5px; }
.tr-invalidation { font-size: 11.5px; color: #f8b4b4; border-top: 1px dashed rgba(239, 83, 80, .35); padding-top: 7px; margin-top: auto; }
.tr-invalidation::before { content: "⚠ "; }

/* ---------- chart (D) ---------- */
.chart-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.range-btn, .scale-btn {
  border: 1px solid var(--line); background: rgba(255, 255, 255, .03); color: var(--dim);
  border-radius: 8px; padding: 5px 12px; cursor: pointer;
  font-family: var(--mono); font-size: 12px; font-weight: 600;
}
.range-btn[aria-pressed="true"], .scale-btn[aria-pressed="true"] { color: #10131c; background: var(--orange-hot); border-color: var(--orange-hot); }
.chart-wrap { position: relative; height: clamp(320px, 48vh, 520px); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: rgba(11, 14, 21, .5); }
#swing-chart { position: absolute; inset: 0; }
.chart-status {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 3;
  font-family: var(--mono); font-size: 13px; color: var(--dim); background: rgba(11, 14, 21, .5);
}
.chart-status[hidden] { display: none; }
.overlay-legend { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ol-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px; color: var(--dim);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px;
}
.ol-chip .swatch { width: 10px; height: 3px; border-radius: 2px; background: var(--c, #999); }
.ol-chip.off { opacity: .55; text-decoration: line-through; }
.overlay-note { font-family: var(--mono); font-size: 11.5px; color: var(--amber); margin-top: 8px; }
.overlay-note[hidden] { display: none; }

/* ---------- confluence matrix (E) ---------- */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip {
  border: 1px solid var(--line); background: rgba(255, 255, 255, .03); color: var(--dim);
  border-radius: 999px; padding: 5px 13px; cursor: pointer;
  font-family: var(--mono); font-size: 11.5px; font-weight: 600;
}
.chip[aria-pressed="true"] { color: #10131c; background: var(--teal); border-color: var(--teal); }
.matrix-wrap { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); overflow: hidden; }
.matrix { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.matrix th, .matrix td { padding: 9px 12px; text-align: left; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.matrix th { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; color: var(--dim); font-weight: 600; background: rgba(255, 255, 255, .03); text-transform: uppercase; }
.matrix tr:last-child td { border-bottom: 0; }
.matrix .mono { font-family: var(--mono); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.mx-info {
  border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer;
  border-radius: 8px; padding: 3px 9px; font-family: var(--body); font-size: 12.5px; text-align: left;
}
.mx-info:hover { border-color: var(--sky); }
.mx-info .info-i { font-family: var(--mono); font-size: 10px; color: var(--sky); margin-left: 5px; }
.sig { display: inline-block; font-family: var(--mono); font-size: 10.5px; font-weight: 600; border-radius: 7px; padding: 2px 8px; }
.sig.bullish { color: var(--teal); background: rgba(20, 184, 166, .12); border: 1px solid rgba(20, 184, 166, .4); }
.sig.bearish { color: var(--red); background: rgba(239, 83, 80, .1); border: 1px solid rgba(239, 83, 80, .4); }
.sig.neutral { color: var(--dim); background: rgba(255, 255, 255, .05); border: 1px solid var(--line); }
.dir { font-family: var(--mono); font-size: 11.5px; }
.fresh-ok { color: var(--teal); }
.fresh-stale { color: var(--amber); }
.mx-note { font-family: var(--mono); font-size: 11px; color: var(--dim); margin-top: 8px; }

/* ---------- contribution chart (F) ---------- */
.contrib-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contrib-col h3 { font-family: var(--disp); font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.contrib-col h3 .pct { color: var(--dim); font-family: var(--mono); font-size: 12px; font-weight: 400; margin-left: 8px; }
.cb-row { display: grid; grid-template-columns: 132px 1fr 46px; gap: 8px; align-items: center; margin: 6px 0; font-size: 11.5px; }
.cb-name { font-family: var(--mono); font-size: 10.5px; color: var(--dim); }
.cb-track { position: relative; height: 10px; border-radius: 5px; background: rgba(255, 255, 255, .05); }
.cb-track::before { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: rgba(255, 255, 255, .18); }
.cb-fill { position: absolute; top: 0; height: 100%; border-radius: 5px; }
.cb-fill.pos { left: 50%; background: var(--teal); }
.cb-fill.neg { right: 50%; background: var(--red); }
.cb-val { font-family: var(--mono); font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.contrib-note { font-family: var(--mono); font-size: 11px; color: var(--dim); margin-top: 10px; }

/* ---------- details (G) ---------- */
.detail { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); margin: 10px 0; overflow: hidden; }
.detail summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 13px 18px; font-family: var(--disp); font-weight: 700; font-size: 14.5px;
}
.detail summary::-webkit-details-marker { display: none; }
.detail summary::after { content: "+"; font-family: var(--mono); color: var(--dim); font-size: 16px; }
.detail[open] summary::after { content: "−"; }
.detail-body { padding: 0 18px 16px; font-size: 13px; color: var(--dim); }
.fam-block { border-top: 1px dashed rgba(255, 255, 255, .08); padding: 10px 0; }
.fam-block h4 { font-size: 13px; color: var(--text); font-weight: 600; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.fam-block h4 .mono { font-family: var(--mono); font-size: 11.5px; color: var(--dim); font-weight: 400; }
.fam-block ul { list-style: none; margin-top: 5px; }
.fam-block li { font-size: 12px; padding: 2px 0; }
.fam-block li b { font-variant-numeric: tabular-nums; }
.src-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 8px; }
.src-card { border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-family: var(--mono); font-size: 11px; }
.src-card .id { color: var(--text); font-weight: 600; }

/* ---------- explanation (H) + evidence ---------- */
.explain h3 { font-family: var(--disp); font-weight: 700; font-size: clamp(15px, 2vw, 19px); margin-bottom: 10px; }
.explain p { font-size: 13.5px; color: var(--dim); margin: 8px 0; }
.ev-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-top: 14px; }
.ev-col h4 { font-family: var(--mono); font-size: 11px; letter-spacing: .13em; text-transform: uppercase; margin-bottom: 6px; }
.ev-col ul { list-style: none; font-size: 12px; color: var(--dim); }
.ev-col li { padding: 2px 0 2px 14px; position: relative; }
.ev-col li::before { content: "·"; position: absolute; left: 0; }
.ev-bullish h4 { color: var(--teal); }
.ev-bearish h4 { color: var(--red); }
.ev-conflicting h4 { color: var(--amber); }
.ev-missing h4 { color: var(--dim); }

/* ---------- events (I) ---------- */
/* ---- swing signal (playbook) cards ---- */
.sig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sig-card { display: flex; flex-direction: column; gap: 8px; border-top: 2px solid transparent; }
.sig-card.sig-long { border-top-color: rgba(20, 184, 166, .55); }
.sig-card.sig-short { border-top-color: rgba(239, 83, 80, .5); }
.sig-head { display: flex; justify-content: space-between; align-items: baseline; }
.sig-side { font-family: var(--disp); font-weight: 700; font-size: 15px; letter-spacing: .06em; }
.sig-side.long { color: var(--teal); }
.sig-side.short { color: var(--red); }
.sig-window { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.sig-state-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sig-state-chip {
  font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: .12em;
  padding: 4px 12px; border-radius: 999px; border: 1px solid;
}
.sig-state-chip.ready { color: #0b0e15; background: var(--teal); border-color: var(--teal); box-shadow: 0 0 18px rgba(20, 184, 166, .45); }
.sig-state-chip.forming { color: var(--amber); border-color: rgba(245, 158, 11, .5); background: rgba(245, 158, 11, .08); }
.sig-state-chip.no_setup { color: var(--dim); border-color: rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .03); }
.sig-state-chip.invalidated { color: var(--red); border-color: rgba(239, 83, 80, .5); background: rgba(239, 83, 80, .08); }
.sig-counts { font-size: 11px; color: var(--dim); }
.cond-list { list-style: none; margin: 0; padding: 0; }
.cond { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; font-size: 12.5px; border-bottom: 1px dashed rgba(255, 255, 255, .05); }
.cond:last-child { border-bottom: 0; }
.cond-mark { font-family: var(--mono); width: 14px; flex: 0 0 14px; text-align: center; }
.cond.met .cond-mark { color: var(--teal); }
.cond.not_met .cond-mark { color: var(--red); }
.cond.unknown { color: var(--dim); }
.cond.unknown .cond-mark { color: var(--dim); }
.cond-list.supporting .cond { font-size: 12px; color: var(--dim); }
.cond-list.supporting .cond.met { color: var(--text); }
.sig-invalidation { font-family: var(--mono); font-size: 11px; color: var(--red); opacity: .85; margin: 2px 0 0; }
.sig-state-invalidated .sig-invalidation { font-weight: 600; opacity: 1; }
.sig-note { font-size: 11px; color: var(--dim); margin: 0; }
@media (max-width: 760px) { .sig-grid { grid-template-columns: 1fr; } }

.event-row { display: grid; grid-template-columns: 96px 170px 1fr; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px dashed rgba(255, 255, 255, .06); font-size: 12.5px; }
.event-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-row:last-child { border-bottom: 0; }
.event-date { font-family: var(--mono); font-size: 11.5px; color: var(--dim); }
.event-type { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--sky); }
.event-title .dir-word { font-family: var(--mono); font-size: 10.5px; margin-left: 8px; }
.dir-word.bullish { color: var(--teal); }
.dir-word.bearish { color: var(--red); }
.prov-badge {
  font-family: var(--mono); font-size: 10px; color: var(--amber);
  border: 1px solid rgba(245, 158, 11, .5); border-radius: 6px; padding: 0 6px; margin-left: 8px;
}

/* ---------- metric drawer (section 21) ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 40; }
.drawer-backdrop[hidden] { display: none; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(430px, 100vw); z-index: 41;
  background: #10141f; border-left: 1px solid var(--line);
  padding: 22px 24px; overflow-y: auto;
  transform: translateX(102%); transition: transform .28s cubic-bezier(.2, .7, .2, 1);
}
.drawer.open { transform: translateX(0); }
.drawer[hidden] { display: none; }
.drawer h3 { font-family: var(--disp); font-weight: 700; font-size: 17px; margin: 4px 0 4px; }
.drawer-close {
  float: right; border: 1px solid var(--line); background: transparent; color: var(--text);
  border-radius: 8px; width: 32px; height: 32px; cursor: pointer; font-size: 15px;
}
.tag-chip { display: inline-block; font-family: var(--mono); font-size: 10.5px; font-weight: 600; border-radius: 7px; padding: 2px 9px; margin: 4px 0 10px; }
.tag-chip.leading { color: var(--sky); border: 1px solid rgba(56, 189, 248, .5); }
.tag-chip.confirmation { color: var(--teal); border: 1px solid rgba(20, 184, 166, .5); }
.tag-chip.risk { color: var(--amber); border: 1px solid rgba(245, 158, 11, .5); }
.tag-chip.context { color: var(--dim); border: 1px solid var(--line); }
.drawer dl { margin-top: 8px; }
.drawer dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--dim); margin-top: 13px; }
.drawer dd { font-size: 13px; color: var(--text); margin-top: 3px; line-height: 1.55; }
.drawer .sub-warn { margin-top: 14px; font-size: 12px; color: var(--amber); border: 1px dashed rgba(245, 158, 11, .5); border-radius: 10px; padding: 8px 12px; }

/* ---------- methodology dialog ---------- */
.method-panel { max-width: 860px; margin: 14px auto 0; text-align: left; font-size: 13px; color: var(--dim); }
.method-panel[hidden] { display: none; }
.method-panel h3 { font-family: var(--disp); font-size: 15px; color: var(--text); margin-bottom: 8px; }
.method-panel p { margin: 6px 0; }

.footer { text-align: center; font-size: 12px; color: var(--dim); padding: 26px 16px 40px; }

/* ---------- mobile ---------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr 1fr; }
  .hero-grid > .conf-panel { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .hero-grid, .contrib-grid, .gauge-strip { grid-template-columns: 1fr; }
  /* the matrix flips from table to cards — no sideways scrolling on phones */
  .matrix, .matrix tbody, .matrix tr, .matrix td { display: block; width: 100%; }
  .matrix thead { display: none; }
  .matrix tr { border-bottom: 1px solid rgba(255, 255, 255, .08); padding: 10px 12px; }
  .matrix td { border: 0; padding: 3px 0; display: grid; grid-template-columns: 108px 1fr; gap: 8px; align-items: baseline; }
  .matrix td::before { content: attr(data-label); font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
  .matrix td.mx-name-cell { display: block; }
  .matrix td.mx-name-cell::before { content: none; }
  .event-row { grid-template-columns: 86px 1fr; }
  .event-row .event-type { grid-column: 2; }
  .prob-row { grid-template-columns: 96px 1fr 46px; }
  .cb-row { grid-template-columns: 104px 1fr 44px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .sk { animation: none; background: rgba(255, 255, 255, .1); }
  .status-pill .dot { animation: none; }
  .prob-fill, .conf-ring { transition: none; }
  .drawer { transition: none; }
}
