/* ============================================================
   MeteoEdge — design tokens
   ============================================================ */
:root {
  --bg-0: #06070c;
  --bg-1: #0a0c14;
  --bg-2: #0e111a;
  --surface-1: #11141d;
  --surface-2: #161a26;
  --surface-3: #1c2230;
  --border-1: #1b2030;
  --border-2: #262d3e;
  --border-3: #3a4358;
  --border-glow: rgba(76,201,240,.32);

  --text-1: #e7ecf3;
  --text-2: #aab3c5;
  --text-3: #707a8e;
  --text-4: #4a5267;
  --text-5: #2f3548;

  --cyan: #4cc9f0;
  --cyan-d: #2a9bc8;
  --cyan-glow: rgba(76,201,240,.5);
  --green: #4ade80;
  --green-d: #16a34a;
  --red: #ef4444;
  --red-d: #b91c1c;
  --amber: #fbbf24;
  --blue: #60a5fa;
  --violet: #a78bfa;

  --w-cold: #60a5fa;
  --w-cool: #93c5fd;
  --w-warm: #fdba74;
  --w-hot: #f87171;

  --f-mono: 'JetBrains Mono', 'SF Mono', 'Menlo', 'Consolas', ui-monospace, monospace;
  --f-sans: 'Inter Tight', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  --shadow-1: 0 1px 0 0 rgba(255,255,255,.02) inset, 0 0 0 1px var(--border-1);
  --shadow-2: 0 1px 0 0 rgba(255,255,255,.03) inset, 0 0 0 1px var(--border-2), 0 24px 48px -24px rgba(0,0,0,.6);
  --shadow-glow: 0 0 0 1px var(--border-glow), 0 0 24px -4px var(--cyan-glow);

  --r-s: 4px;
  --r-m: 8px;
  --r-l: 12px;

  --pad-s: 8px;
  --pad-m: 12px;
  --pad-l: 16px;
}

/* ============================================================
   reset + base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
html {
  background: var(--bg-0);
  color: var(--text-1);
  font-family: var(--f-sans);
  font-size: 14px;
  line-height: 1.45;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  position: relative;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(76,201,240,.05), transparent 50%),
    radial-gradient(900px 500px at 90% 110%, rgba(74,222,128,.04), transparent 50%),
    var(--bg-0);
  background-attachment: fixed;
  overflow-x: hidden;
}
body::before {
  /* fine grid */
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.012) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; background: none; border: 0; outline: 0; }
table { border-collapse: collapse; width: 100%; }
svg { display: block; }

::selection { background: rgba(76,201,240,.35); color: #fff; }

/* mono cells with tabular figures */
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.num  { font-family: var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.tt   { text-transform: uppercase; letter-spacing: .12em; font-size: 10px; font-weight: 600; color: var(--text-3); }

/* ============================================================
   topbar
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 52px;
  padding: 0 16px;
  background: rgba(8,10,16,.7);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  border-bottom: 1px solid var(--border-1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-sans);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -.01em;
  color: var(--text-1);
}
.brand-mark {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #4cc9f0 0%, #4ade80 100%);
  border-radius: 5px;
  box-shadow: 0 0 0 1px rgba(76,201,240,.35), 0 0 18px -2px rgba(76,201,240,.4);
}
.brand-mark::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 2px;
  background: var(--bg-0);
  transform: rotate(45deg);
}
.brand-name { letter-spacing: .02em; }
.brand-name b { color: var(--cyan); }
.brand-sep { color: var(--text-5); margin: 0 4px; }
.brand-env {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--text-3);
  border: 1px solid var(--border-2);
  padding: 1px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-btn {
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color .15s, background .15s;
}
.nav-btn:hover { color: var(--text-1); background: rgba(255,255,255,.03); }
.nav-btn[aria-current="page"] {
  color: var(--text-1);
  background: rgba(76,201,240,.08);
  box-shadow: inset 0 0 0 1px rgba(76,201,240,.18);
}
.nav-btn[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px;
  bottom: -1px;
  height: 2px;
  background: var(--cyan);
  border-radius: 2px;
  box-shadow: 0 0 12px var(--cyan-glow);
}
.nav-btn .kbd {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--text-4);
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid var(--border-2);
  margin-left: 4px;
}

.spacer { flex: 1; }

.search-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-3);
  min-width: 220px;
  transition: border .15s;
}
.search-trigger:hover { border-color: var(--border-2); }
.search-trigger .kbd {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--text-3);
  background: var(--bg-1);
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid var(--border-2);
  margin-left: auto;
}

.status-pill {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-2);
  padding: 5px 10px;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: 100px;
}
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 2px rgba(74,222,128,.18), 0 0 8px rgba(74,222,128,.6);
  animation: pulse-dot 2.2s ease-in-out infinite;
}
.dot.warn { background: var(--amber); box-shadow: 0 0 0 2px rgba(251,191,36,.18), 0 0 8px rgba(251,191,36,.6); }
.dot.bad  { background: var(--red);   box-shadow: 0 0 0 2px rgba(239,68,68,.18),  0 0 8px rgba(239,68,68,.6); }
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

.user-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: 100px;
  font-size: 12px;
  color: var(--text-2);
}
.user-pill .avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  display: grid; place-items: center;
  color: #fff; font-size: 10px; font-weight: 700;
}

/* ============================================================
   tape ticker
   ============================================================ */
.ticker {
  height: 30px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border-1);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
}
.ticker-label {
  flex: 0 0 auto;
  background: var(--surface-2);
  border-right: 1px solid var(--border-1);
  height: 100%;
  display: grid; place-items: center;
  padding: 0 12px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cyan);
}
.ticker-track {
  flex: 1;
  display: flex;
  white-space: nowrap;
  animation: marquee 110s linear infinite;
  font-family: var(--f-mono);
  font-size: 11.5px;
  color: var(--text-2);
}
.ticker-track > span { padding: 0 24px; position: relative; }
.ticker-track > span::after {
  content: "·";
  position: absolute;
  right: -3px;
  color: var(--text-5);
}
.ticker-track > span b { color: var(--text-1); font-weight: 600; }
.ticker-track > span em { color: var(--green); font-style: normal; }
.ticker-track > span i  { color: var(--red); font-style: normal; }
.ticker-track > span u  { color: var(--cyan); text-decoration: none; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ============================================================
   stage + views
   ============================================================ */
.stage {
  position: relative;
  z-index: 1;
}
.view { display: none; }
html[data-view="wall"]    .view-wall    { display: block; }
html[data-view="market"]  .view-market  { display: block; }
html[data-view="lab"]     .view-lab     { display: block; }
html[data-view="landing"] .view-landing { display: block; }

/* ============================================================
   view: wall
   ============================================================ */
.wall-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 14px;
  padding: 14px;
  min-height: calc(100vh - 82px);
}
@media (max-width: 1100px) { .wall-grid { grid-template-columns: 1fr; } }

.map-panel {
  position: relative;
  background: linear-gradient(180deg, var(--surface-1) 0%, var(--bg-1) 100%);
  border: 1px solid var(--border-1);
  border-radius: var(--r-l);
  overflow: hidden;
  min-height: 540px;
  display: flex; flex-direction: column;
}
.panel-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-1);
  background: rgba(255,255,255,.01);
}
.panel-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text-1);
}
.panel-title b { color: var(--cyan); font-weight: 600; }
.panel-sub { font-family: var(--f-mono); font-size: 10.5px; color: var(--text-3); }
.panel-head-actions { margin-left: auto; display: flex; gap: 6px; }
.icon-btn {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 6px;
  border: 1px solid var(--border-1);
  color: var(--text-3);
  background: var(--surface-1);
  transition: all .15s;
}
.icon-btn:hover { color: var(--text-1); border-color: var(--border-2); }
.icon-btn svg { width: 14px; height: 14px; }

.map-canvas {
  flex: 1;
  position: relative;
  padding: 16px;
  min-height: 460px;
}
.map-svg { width: 100%; height: 100%; }
.map-svg .land {
  fill: rgba(76,201,240,.025);
  stroke: rgba(76,201,240,.18);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}
.map-svg .grat {
  stroke: rgba(255,255,255,.04);
  stroke-width: .5;
  fill: none;
}
.poi-grp { cursor: pointer; }
.poi-ring {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 1.2;
  opacity: .8;
  transform-origin: center;
  transform-box: fill-box;
  animation: ring-pulse 2.4s ease-out infinite;
}
.poi-ring.warm { stroke: var(--w-warm); }
.poi-ring.hot  { stroke: var(--red); }
.poi-ring.cold { stroke: var(--w-cold); }
.poi-ring.neut { stroke: var(--text-3); opacity: .35; }

@keyframes ring-pulse {
  0% { r: 4; opacity: .9; }
  100% { r: 18; opacity: 0; }
}
.poi-core {
  fill: var(--cyan);
  filter: drop-shadow(0 0 5px var(--cyan-glow));
}
.poi-core.warm { fill: var(--w-warm); filter: drop-shadow(0 0 5px rgba(253,186,116,.6)); }
.poi-core.hot  { fill: var(--red);   filter: drop-shadow(0 0 5px rgba(239,68,68,.6)); }
.poi-core.cold { fill: var(--w-cold); filter: drop-shadow(0 0 5px rgba(96,165,250,.6)); }
.poi-core.neut { fill: var(--text-3); filter: none; }

.poi-grp text {
  font-family: var(--f-mono);
  font-size: 9.5px;
  fill: var(--text-2);
  letter-spacing: .04em;
}
.poi-grp:hover text { fill: var(--text-1); }
.poi-grp:hover .poi-core { transform: scale(1.4); transform-origin: center; transform-box: fill-box; }

.map-legend {
  position: absolute;
  bottom: 16px; left: 16px;
  display: flex; gap: 14px;
  background: rgba(8,10,16,.7);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-1);
  padding: 8px 12px;
  border-radius: 8px;
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--text-2);
}
.legend-key { display: flex; align-items: center; gap: 6px; }
.legend-key i {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.map-stats {
  position: absolute;
  top: 16px; right: 16px;
  display: flex;
  gap: 18px;
  background: rgba(8,10,16,.7);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-1);
  padding: 10px 14px;
  border-radius: 8px;
}
.mstat-k { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; }
.mstat-v { font-family: var(--f-mono); font-size: 14px; color: var(--text-1); font-weight: 600; }
.mstat-v.up   { color: var(--green); }
.mstat-v.down { color: var(--red); }

/* sidebar opportunities */
.opps-panel {
  display: flex; flex-direction: column;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-l);
  overflow: hidden;
}
.opps-tools {
  display: flex; align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-1);
  gap: 6px;
}
.chip {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  color: var(--text-2);
  font-weight: 500;
  letter-spacing: .01em;
  cursor: pointer;
  transition: all .12s;
}
.chip:hover { color: var(--text-1); border-color: var(--border-2); }
.chip[aria-pressed="true"] {
  color: var(--bg-0);
  background: var(--cyan);
  border-color: var(--cyan);
}
.chip .kbd {
  font-family: var(--f-mono);
  font-size: 9px;
  margin-left: 4px;
  color: inherit;
  opacity: .6;
}

.opps-list {
  flex: 1;
  overflow: auto;
  padding: 8px;
  display: flex; flex-direction: column;
  gap: 6px;
}

.opp-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-m);
  cursor: pointer;
  transition: all .15s;
  position: relative;
  overflow: hidden;
}
.opp-card:hover { border-color: var(--border-3); transform: translateY(-1px); background: var(--surface-2); }
.opp-card.featured {
  border-color: rgba(76,201,240,.35);
  box-shadow: 0 0 0 1px rgba(76,201,240,.15), 0 12px 28px -16px rgba(76,201,240,.4);
}
.opp-card.featured::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--green));
}
.opp-glyph {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: .04em;
}
.opp-glyph.hot  { color: var(--red);   border-color: rgba(239,68,68,.3); background: rgba(239,68,68,.06); }
.opp-glyph.cold { color: var(--w-cold);border-color: rgba(96,165,250,.3); background: rgba(96,165,250,.06); }
.opp-glyph.warm { color: var(--w-warm);border-color: rgba(253,186,116,.3); background: rgba(253,186,116,.06); }

.opp-body { min-width: 0; }
.opp-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-1);
  display: flex; align-items: center; gap: 8px;
}
.opp-title .badge {
  font-family: var(--f-mono);
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(255,255,255,.04);
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.opp-meta {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  color: var(--text-3);
}
.opp-meta b { color: var(--text-1); font-weight: 500; }
.opp-meta em { color: var(--green); font-style: normal; }
.opp-meta i  { color: var(--red); font-style: normal; }

.opp-edge {
  text-align: right;
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
}
.opp-edge .num {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.opp-edge .num.pos { color: var(--green); }
.opp-edge .num.neg { color: var(--red); }
.opp-edge .sub { font-size: 9.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; }

.sparkline { display: block; height: 18px; margin-top: 4px; }

/* footer strip */
.wall-strip {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: var(--border-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-m);
  overflow: hidden;
}
.strip-cell {
  padding: 10px 14px;
  background: var(--surface-1);
  display: flex; flex-direction: column; gap: 2px;
}
.strip-k { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; }
.strip-v { font-family: var(--f-mono); font-size: 14px; color: var(--text-1); font-weight: 600; }
.strip-v.pos { color: var(--green); }
.strip-v.neg { color: var(--red); }

/* ============================================================
   view: market detail
   ============================================================ */
.mkt-shell {
  padding: 14px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  min-height: calc(100vh - 82px);
}
.mkt-head {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px;
  background: linear-gradient(180deg, var(--surface-1), var(--bg-1));
  border: 1px solid var(--border-1);
  border-radius: var(--r-l);
}
.mkt-back {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border: 1px solid var(--border-1);
  border-radius: 8px;
  color: var(--text-3);
  transition: all .15s;
}
.mkt-back:hover { color: var(--text-1); border-color: var(--border-2); }
.mkt-title h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text-1);
}
.mkt-title h1 small {
  color: var(--text-3);
  font-weight: 500;
  font-size: 12px;
  margin-left: 8px;
}
.mkt-crumbs { font-family: var(--f-mono); font-size: 10.5px; color: var(--text-3); margin-top: 2px; }
.mkt-crumbs span { color: var(--cyan); }

.mkt-quick {
  margin-left: auto;
  display: flex; gap: 22px;
  padding-right: 6px;
}
.qk { text-align: right; }
.qk-k { font-size: 9.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .12em; }
.qk-v { font-family: var(--f-mono); font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.qk-v.up   { color: var(--green); }
.qk-v.down { color: var(--red); }
.qk-v.warm { color: var(--w-warm); }
.qk-v.cold { color: var(--w-cold); }

.mkt-body {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 14px;
  min-height: 0;
}
@media (max-width: 1100px) { .mkt-body { grid-template-columns: 1fr; } }

.fan-panel, .book-panel {
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-l);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.fan-panel .panel-head { border-bottom-color: var(--border-1); }
.fan-canvas { flex: 1; min-height: 360px; padding: 8px; }

.fan-legend {
  display: flex; gap: 14px;
  padding: 8px 16px 12px;
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--text-2);
}
.fan-legend .key { display: flex; align-items: center; gap: 6px; }
.fan-legend .swatch { width: 14px; height: 8px; border-radius: 2px; }

/* right column stack */
.right-col {
  display: flex; flex-direction: column; gap: 14px;
  min-height: 0;
}

.book {
  font-family: var(--f-mono);
  font-size: 11.5px;
}
.book-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 3px 14px;
  position: relative;
}
.book-row > span:nth-child(1) { text-align: left; }
.book-row > span:nth-child(2) { text-align: right; color: var(--text-2); }
.book-row > span:nth-child(3) { text-align: right; color: var(--text-3); }
.book-row.ask::before, .book-row.bid::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; right: 0;
  pointer-events: none;
}
.book-row.ask { color: var(--red); }
.book-row.bid { color: var(--green); }
.book-row.ask::before { background: linear-gradient(90deg, transparent, rgba(239,68,68,.07)); width: var(--depth, 0%); }
.book-row.bid::before { background: linear-gradient(90deg, transparent, rgba(74,222,128,.08)); width: var(--depth, 0%); }
.book-mid {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px;
  margin: 4px 0;
  background: var(--bg-2);
  border-top: 1px solid var(--border-1);
  border-bottom: 1px solid var(--border-1);
  font-family: var(--f-mono);
  font-size: 13px;
}
.book-mid .last { color: var(--text-1); font-weight: 600; }
.book-mid .last small { color: var(--text-3); margin-left: 6px; font-size: 10px; }
.book-mid .spread { color: var(--text-3); font-size: 10.5px; }
.book-head {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 6px 14px;
  font-family: var(--f-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-3);
  border-bottom: 1px solid var(--border-1);
}
.book-head > span:not(:first-child) { text-align: right; }

.edge-card {
  padding: 16px;
  background: linear-gradient(180deg, rgba(76,201,240,.04), transparent 60%), var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-l);
}
.edge-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0;
}
.edge-row + .edge-row { border-top: 1px dashed var(--border-1); }
.edge-row .k { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }
.edge-row .v { font-family: var(--f-mono); font-size: 13px; color: var(--text-1); font-weight: 600; }
.edge-big {
  margin-top: 14px;
  padding: 14px;
  border-radius: 10px;
  background: rgba(74,222,128,.06);
  border: 1px solid rgba(74,222,128,.25);
  display: flex; align-items: baseline; justify-content: space-between;
}
.edge-big .lbl { font-size: 11px; color: var(--green); text-transform: uppercase; letter-spacing: .1em; }
.edge-big .val { font-family: var(--f-mono); font-size: 28px; font-weight: 800; color: var(--green); letter-spacing: -.02em; }
.edge-big .val small { font-size: 13px; color: var(--green-d); margin-left: 6px; font-weight: 500; }

.cta {
  margin-top: 12px;
  display: flex; gap: 8px;
}
.btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
  transition: all .15s;
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text-1);
}
.btn:hover { transform: translateY(-1px); border-color: var(--border-3); }
.btn.primary {
  background: linear-gradient(135deg, #f8fafc 0%, var(--cyan) 50%, var(--green) 100%);
  color: var(--bg-0);
  border-color: transparent;
  box-shadow: 0 6px 20px -8px var(--cyan-glow);
}
.btn.primary:hover { box-shadow: 0 10px 30px -8px var(--cyan-glow); }
.btn.ghost { background: transparent; }

/* bottom row */
.mkt-foot {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 14px;
}
@media (max-width: 1100px) { .mkt-foot { grid-template-columns: 1fr; } }

.ensemble-table-panel, .trade-feed-panel {
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-l);
  overflow: hidden;
}

table.dense th, table.dense td {
  padding: 7px 12px;
  font-size: 11.5px;
  text-align: left;
  border-bottom: 1px solid var(--border-1);
}
table.dense th {
  font-family: var(--f-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-3);
  background: var(--bg-2);
  font-weight: 500;
}
table.dense td.num, table.dense td .num { font-family: var(--f-mono); }
table.dense td.pos { color: var(--green); }
table.dense td.neg { color: var(--red); }
table.dense tr:hover td { background: rgba(255,255,255,.018); }

.model-bar {
  display: inline-block;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-2);
  width: 90px;
  vertical-align: middle;
  margin-left: 8px;
  position: relative;
}
.model-bar > i {
  position: absolute;
  top: -1px; bottom: -1px;
  left: 50%;
  background: var(--cyan);
  border-radius: 2px;
  box-shadow: 0 0 6px var(--cyan-glow);
}

.trade-row {
  display: grid;
  grid-template-columns: 56px 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-1);
  font-family: var(--f-mono);
  font-size: 11.5px;
}
.trade-row .tm { color: var(--text-3); }
.trade-row .side { font-weight: 600; }
.trade-row .side.buy  { color: var(--green); }
.trade-row .side.sell { color: var(--red); }
.trade-row .price { color: var(--text-1); }
.trade-row .pnl.pos { color: var(--green); }
.trade-row .pnl.neg { color: var(--red); }

/* ============================================================
   view: strategy lab
   ============================================================ */
.lab-shell {
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 14px;
  min-height: calc(100vh - 82px);
}
@media (max-width: 1100px) { .lab-shell { grid-template-columns: 1fr; } }

.lab-main, .lab-side {
  display: flex; flex-direction: column;
  gap: 14px;
}

.signals-panel {
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-l);
  overflow: hidden;
}
.lab-filter {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-1);
  background: rgba(255,255,255,.01);
  flex-wrap: wrap;
}
.lab-filter .sep { width: 1px; height: 16px; background: var(--border-1); margin: 0 4px; }

.signal-row {
  display: grid;
  grid-template-columns: 64px 1.2fr 70px 70px 90px 90px auto;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-1);
  font-size: 12px;
  transition: background .12s;
}
.signal-row:hover { background: rgba(255,255,255,.018); }
.signal-row .sig-t  { font-family: var(--f-mono); font-size: 10.5px; color: var(--text-3); }
.signal-row .sig-mkt { display: flex; align-items: center; gap: 10px; }
.signal-row .sig-mkt .glyph {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  border-radius: 6px;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
}
.signal-row .sig-mkt .nm { font-weight: 600; color: var(--text-1); }
.signal-row .sig-mkt .sub { font-size: 10.5px; color: var(--text-3); font-family: var(--f-mono); }
.signal-row .num.big { font-size: 13px; font-weight: 600; }
.signal-row .edge-num {
  font-family: var(--f-mono);
  font-size: 14px;
  font-weight: 700;
}
.signal-row .edge-num.pos { color: var(--green); }
.signal-row .edge-num.neg { color: var(--red); }
.signal-row .act {
  font-family: var(--f-mono);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.signal-row .act.buy   { color: var(--green); border-color: rgba(74,222,128,.4); background: rgba(74,222,128,.08); }
.signal-row .act.sell  { color: var(--red);   border-color: rgba(239,68,68,.4);  background: rgba(239,68,68,.08); }
.signal-row .act.watch { color: var(--text-3); border-color: var(--border-2); }
.signal-row .arrow { color: var(--text-4); }

.bt-card, .api-card {
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-l);
  overflow: hidden;
}
.bt-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--border-1);
}
.bt-stat {
  padding: 14px;
  background: var(--surface-1);
}
.bt-stat .k { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; }
.bt-stat .v { font-family: var(--f-mono); font-size: 22px; font-weight: 700; margin-top: 4px; letter-spacing: -.01em; }
.bt-stat .v.pos { color: var(--green); }
.bt-stat .v.neg { color: var(--red); }
.bt-curve { height: 110px; padding: 0 8px 8px; }

.api-body { padding: 14px 16px; }
.api-key {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: var(--f-mono);
  font-size: 11.5px;
  color: var(--text-2);
}
.api-key b { color: var(--text-1); font-weight: 500; }
.api-key .copy {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-3);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-2);
}
.codebox {
  margin-top: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--f-mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-2);
  white-space: pre;
  overflow-x: auto;
}
.codebox .k { color: var(--violet); }
.codebox .s { color: var(--green); }
.codebox .c { color: var(--text-4); }

/* ============================================================
   view: landing
   ============================================================ */
.landing {
  padding: 0;
}
.hero {
  position: relative;
  padding: 96px 24px 80px;
  text-align: center;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 800px 500px at 50% 0%, rgba(76,201,240,.16), transparent 60%),
    radial-gradient(ellipse 600px 400px at 50% 100%, rgba(74,222,128,.08), transparent 60%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: .18em;
  padding: 5px 12px;
  border-radius: 100px;
  border: 1px solid rgba(76,201,240,.3);
  background: rgba(76,201,240,.05);
}
.hero h1 {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.04;
  margin: 24px 0 18px;
  color: var(--text-1);
}
.hero h1 .gr {
  background: linear-gradient(135deg, #f8fafc 0%, var(--cyan) 50%, var(--green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p.lead {
  font-size: 17px;
  color: var(--text-2);
  max-width: 620px;
  margin: 0 auto 32px;
  line-height: 1.55;
}
.hero-ctas { display: flex; gap: 12px; justify-content: center; }

.hero-vis {
  position: relative;
  max-width: 1080px;
  margin: 48px auto 0;
  padding: 0 24px;
}
.hero-vis-frame {
  border: 1px solid var(--border-2);
  background: var(--surface-1);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 60px 120px -40px rgba(0,0,0,.7), 0 0 0 1px rgba(76,201,240,.08);
  transform: perspective(2000px) rotateX(4deg);
}
.hero-vis-frame img-fake {
  display: block;
  height: 360px;
  background:
    radial-gradient(circle at 20% 30%, rgba(76,201,240,.2), transparent 30%),
    radial-gradient(circle at 80% 70%, rgba(74,222,128,.15), transparent 30%),
    linear-gradient(180deg, #11141d, #0a0c14);
}

.section { padding: 80px 24px; }
.section-inner { max-width: 1100px; margin: 0 auto; }
.section .tag-eye {
  font-family: var(--f-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--cyan);
}
.section h2 {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 8px 0 12px;
}
.section .lead2 {
  color: var(--text-2);
  font-size: 16px;
  max-width: 640px;
  margin-bottom: 48px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 900px) { .features-grid { grid-template-columns: 1fr; } }
.feature {
  position: relative;
  padding: 24px;
  background: linear-gradient(180deg, var(--surface-1), transparent);
  border: 1px solid var(--border-1);
  border-radius: 14px;
  overflow: hidden;
}
.feature::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-2), transparent);
}
.feature .num-eye {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: .12em;
}
.feature h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 8px 0 8px;
  letter-spacing: -.01em;
}
.feature p { color: var(--text-2); font-size: 13.5px; margin: 0; line-height: 1.6; }
.feature-vis { margin-top: 18px; height: 80px; }

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 900px) { .pricing-grid { grid-template-columns: 1fr; } }
.plan {
  position: relative;
  padding: 28px 24px;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: 14px;
  display: flex; flex-direction: column;
}
.plan.featured {
  border-color: var(--cyan);
  box-shadow: 0 30px 80px -32px var(--cyan-glow);
}
.plan.featured::before {
  content: "POPULAR";
  position: absolute;
  top: -10px; left: 24px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .14em;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--cyan);
  color: var(--bg-0);
  font-weight: 700;
}
.plan-name { font-size: 14px; color: var(--text-3); text-transform: uppercase; letter-spacing: .14em; font-weight: 600; }
.plan-price { display: flex; align-items: baseline; gap: 6px; margin: 14px 0 6px; }
.plan-price b { font-family: var(--f-mono); font-size: 44px; font-weight: 800; letter-spacing: -.025em; color: var(--text-1); }
.plan-price small { color: var(--text-3); font-size: 13px; }
.plan-desc { color: var(--text-2); font-size: 13px; margin-bottom: 22px; }
.plan-feats { list-style: none; padding: 0; margin: 0 0 26px; display: flex; flex-direction: column; gap: 10px; }
.plan-feats li { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--text-2); }
.plan-feats li::before {
  content: "";
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1px solid var(--border-3);
  margin-top: 2px;
  flex: 0 0 14px;
  background:
    radial-gradient(circle at center, var(--cyan) 0%, var(--cyan) 35%, transparent 35%);
  background-size: 6px 6px;
  background-repeat: no-repeat;
  background-position: center;
}
.plan-feats li.dim { color: var(--text-4); }
.plan-feats li.dim::before { background: transparent; }
.plan .btn { margin-top: auto; }

.footer-area {
  padding: 60px 24px 36px;
  border-top: 1px solid var(--border-1);
  background: var(--bg-1);
}
.footer-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
}
.footer-grid h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--text-3); margin: 0 0 16px; }
.footer-grid a { display: block; color: var(--text-2); font-size: 13px; padding: 4px 0; }
.footer-grid a:hover { color: var(--text-1); }
.footer-credits {
  max-width: 1100px;
  margin: 48px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--border-1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-4);
}

/* ============================================================
   cmdk
   ============================================================ */
.cmdk-back {
  position: fixed;
  inset: 0;
  background: rgba(2,4,8,.7);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
}
.cmdk-back[data-open="true"] { display: flex; }
.cmdk {
  width: min(560px, 92vw);
  background: var(--surface-1);
  border: 1px solid var(--border-2);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,.7), 0 0 0 1px rgba(76,201,240,.18);
}
.cmdk-input {
  width: 100%;
  padding: 16px 18px;
  font-size: 15px;
  font-family: var(--f-sans);
  border-bottom: 1px solid var(--border-1);
  color: var(--text-1);
}
.cmdk-list {
  max-height: 360px;
  overflow: auto;
  padding: 6px;
}
.cmdk-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
}
.cmdk-item:hover, .cmdk-item.active { background: var(--surface-2); color: var(--text-1); }
.cmdk-item .glyph { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 4px; background: var(--surface-3); font-family: var(--f-mono); font-size: 10px; }
.cmdk-item .sub { margin-left: auto; font-size: 11px; color: var(--text-4); font-family: var(--f-mono); }

/* ============================================================
   utils
   ============================================================ */
.flash-up { animation: flash-up .8s ease-out; }
.flash-dn { animation: flash-dn .8s ease-out; }
@keyframes flash-up { 0% { background: rgba(74,222,128,.25); } 100% { background: transparent; } }
@keyframes flash-dn { 0% { background: rgba(239,68,68,.25); } 100% { background: transparent; } }

.scroll-thin::-webkit-scrollbar { width: 6px; height: 6px; }
.scroll-thin::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
.scroll-thin::-webkit-scrollbar-thumb:hover { background: var(--border-3); }

/* ============================================================
   STAR BUTTON (pinning affordance)
   ============================================================ */
.star-btn {
  width: 26px; height: 26px;
  display: inline-grid; place-items: center;
  border-radius: 5px;
  color: var(--text-4);
  border: 1px solid transparent;
  margin-left: 8px;
  transition: all .15s;
  vertical-align: middle;
  cursor: pointer;
}
.star-btn:hover { color: var(--amber); border-color: var(--border-2); background: var(--surface-2); }
.star-btn.star-active {
  color: var(--amber);
  filter: drop-shadow(0 0 4px rgba(251,191,36,.4));
}
.star-btn svg { width: 14px; height: 14px; }

.opp-card { position: relative; }
.opp-card .star-btn {
  position: absolute;
  top: 6px; right: 6px;
  margin: 0;
  background: rgba(8,10,16,.65);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .15s, color .15s;
}
.opp-card:hover .star-btn,
.opp-card .star-btn.star-active { opacity: 1; }

/* ============================================================
   PIN RAIL
   ============================================================ */
.pin-rail {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px;
  background: linear-gradient(180deg, rgba(251,191,36,.025), transparent), var(--bg-1);
  border-bottom: 1px solid var(--border-1);
  position: sticky;
  top: 52px;
  z-index: 30;
  backdrop-filter: blur(8px);
}
.pin-rail-label {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--amber);
  white-space: nowrap;
}
.pin-rail-list {
  display: flex; align-items: center; gap: 6px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.pin-rail-list::-webkit-scrollbar { display: none; }
.pin-rail-hint {
  font-family: var(--f-mono);
  font-size: 9.5px;
  color: var(--text-4);
  letter-spacing: .04em;
  white-space: nowrap;
}
.pin-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 4px 5px 6px;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: 100px;
  font-size: 11.5px;
  cursor: pointer;
  transition: all .15s;
  flex: 0 0 auto;
  color: var(--text-1);
}
.pin-chip:hover { border-color: var(--border-3); transform: translateY(-1px); background: var(--surface-2); }
.pin-chip .pc-tag {
  font-family: var(--f-mono);
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  background: var(--surface-3);
  letter-spacing: .04em;
  color: var(--text-1);
}
.pin-chip.hot  .pc-tag { color: var(--red);    background: rgba(239,68,68,.1); }
.pin-chip.cold .pc-tag { color: var(--w-cold); background: rgba(96,165,250,.1); }
.pin-chip.warm .pc-tag { color: var(--w-warm); background: rgba(253,186,116,.1); }
.pin-chip .pc-name { color: var(--text-2); }
.pin-chip .pc-edge { font-family: var(--f-mono); font-size: 12px; font-weight: 600; }
.pin-chip .pc-edge.pos { color: var(--green); }
.pin-chip .pc-edge.neg { color: var(--red); }
.pin-chip .pc-close {
  color: var(--text-4);
  font-size: 14px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 50%;
  cursor: pointer;
}
.pin-chip .pc-close:hover { color: var(--red); background: rgba(239,68,68,.1); }
.pin-rail-empty {
  color: var(--text-3);
  font-size: 11.5px;
  font-style: italic;
  padding: 4px 0;
}
.pin-rail-empty kbd {
  font-family: var(--f-mono);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  color: var(--amber);
}

/* ============================================================
   WATCHLIST TOGGLE (Wall filter)
   ============================================================ */
.wl-toggle {
  display: inline-flex;
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: 100px;
  padding: 2px;
}
.wl-btn {
  padding: 5px 12px;
  font-size: 11.5px;
  border-radius: 100px;
  color: var(--text-2);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .15s;
  cursor: pointer;
}
.wl-btn:hover { color: var(--text-1); }
.wl-btn[aria-pressed="true"] {
  background: var(--surface-2);
  color: var(--text-1);
  box-shadow: 0 0 0 1px var(--border-2), inset 0 1px 0 rgba(255,255,255,.03);
}
.wl-count {
  font-family: var(--f-mono);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 100px;
  background: var(--amber);
  color: var(--bg-0);
  font-weight: 700;
  min-width: 18px;
  text-align: center;
}

/* ============================================================
   CITY DOSSIER VIEW
   ============================================================ */
html[data-view="dossier"] .view-dossier { display: block; }

.dossier-shell {
  padding: 14px;
  display: flex; flex-direction: column;
  gap: 14px;
  min-height: calc(100vh - 122px);
}

.dossier-head {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 20px 22px;
  background: linear-gradient(180deg, var(--surface-1), var(--bg-1));
  border: 1px solid var(--border-1);
  border-radius: var(--r-l);
  position: relative;
  overflow: hidden;
}
.dossier-head::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 700px 240px at 18% -20%, rgba(253,186,116,.07), transparent 60%),
              radial-gradient(ellipse 500px 200px at 90% 120%, rgba(76,201,240,.05), transparent 60%);
  pointer-events: none;
}
.dossier-hero {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.city-meta { min-width: 240px; }
.city-name { display: flex; align-items: center; gap: 4px; }
.city-name h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.025em;
  color: var(--text-1);
}
.city-name h1 small {
  color: var(--text-3);
  font-weight: 500;
  font-size: 14px;
  margin-left: 6px;
}
.city-sub {
  margin-top: 8px;
  display: flex; align-items: center; gap: 8px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-3);
  flex-wrap: wrap;
}
.city-sub b { color: var(--text-1); font-weight: 500; }
.dot-sep { color: var(--text-5); }

.city-kpis {
  display: flex; gap: 28px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.kpi { text-align: left; min-width: 92px; }
.kpi-k { font-size: 9.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .12em; }
.kpi-v {
  font-family: var(--f-mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.025em;
  margin: 4px 0 2px;
  color: var(--text-1);
}
.kpi-v.warm { color: var(--w-warm); }
.kpi-v.cold { color: var(--w-cold); }
.kpi-v.pos  { color: var(--green); }
.kpi-v.neg  { color: var(--red); }
.kpi-sub { font-family: var(--f-mono); font-size: 9.5px; color: var(--text-4); letter-spacing: .04em; }

.dossier-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
}
@media (max-width: 1100px) { .dossier-grid { grid-template-columns: 1fr; } }
.dossier-grid .span-2 { grid-column: 1 / -1; }

.dos-card {
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-l);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.dos-side {
  display: flex; flex-direction: column;
  gap: 14px;
}

.acc-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--border-1);
  border-top: 1px solid var(--border-1);
}
.acc-stat {
  padding: 10px 12px;
  background: var(--surface-1);
}
.acc-stat .k { font-size: 9.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .12em; display: block; }
.acc-stat .v { font-family: var(--f-mono); font-size: 14px; color: var(--text-1); font-weight: 600; display: block; margin-top: 2px; }
.acc-stat .v.pos { color: var(--green); }
.acc-stat .v.neg { color: var(--red); }

.outcome {
  font-family: var(--f-mono);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 3px;
  letter-spacing: .08em;
  font-weight: 700;
  display: inline-block;
}
.outcome.win  { color: var(--green); background: rgba(74,222,128,.08); border: 1px solid rgba(74,222,128,.25); }
.outcome.lose { color: var(--red);   background: rgba(239,68,68,.06);  border: 1px solid rgba(239,68,68,.22); }

.past-foot {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--border-1);
}
.past-stat { padding: 10px 14px; background: var(--surface-1); }
.past-stat .k { font-size: 9.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .12em; display: block; }
.past-stat .v { font-family: var(--f-mono); font-size: 13px; font-weight: 600; display: block; margin-top: 2px; }
.past-stat .v.pos { color: var(--green); }
.past-stat .v.neg { color: var(--red); }

.alerts-list { padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.alert-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  font-size: 12px;
  color: var(--text-2);
  background: var(--bg-2);
  border-radius: 6px;
  border: 1px solid var(--border-1);
}
.alert-chk { color: var(--green); }
.alert-chk.off { color: var(--text-4); }
.alert-rule b { color: var(--text-1); font-weight: 600; }
.alert-rule b.mono { font-family: var(--f-mono); }
.alert-ch { font-family: var(--f-mono); font-size: 9.5px; color: var(--text-3); letter-spacing: .1em; }

.notes {
  width: 100%;
  resize: vertical;
  min-height: 110px;
  background: var(--bg-2);
  border: 0;
  outline: 0;
  padding: 12px 14px;
  font-family: var(--f-sans);
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.55;
  display: block;
}
.notes:focus { background: var(--surface-2); color: var(--text-1); }


/* ============================================================
   v0.2 — auth chrome bits + upgrade modal + tier gating
   ============================================================ */
.user-pill.anon { gap: 8px; padding-left: 10px; padding-right: 10px; }
.user-pill .link-btn {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--text-1);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}
.user-pill .link-btn:hover { background: var(--surface-2); }
.user-pill .link-btn.primary {
  background: linear-gradient(135deg, #4cc9f0, #4ade80);
  color: #06070c;
  border-color: transparent;
  font-weight: 700;
}
.user-pill .upgrade-btn {
  background: linear-gradient(135deg, #fbbf24, #f97316);
  color: #06070c;
  border: none;
  padding: 4px 9px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  cursor: pointer;
  margin-left: 4px;
  font-family: inherit;
}

/* Upgrade modal */
.upgrade-back {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  display: none;
  align-items: center; justify-content: center;
  z-index: 9000;
}
.upgrade-back.open { display: flex; }
.upgrade-modal {
  background: var(--surface-1);
  border: 1px solid var(--border-2);
  border-radius: 12px;
  padding: 28px 28px 22px;
  width: 100%;
  max-width: 720px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.upgrade-modal h2 { margin: 0 0 6px; font-size: 22px; }
.upgrade-modal p.sub { margin: 0 0 18px; color: var(--text-2, #94a3b8); font-size: 13px; }
.tiers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
.tier-card {
  background: var(--bg-1);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  padding: 16px;
  display: flex; flex-direction: column;
}
.tier-card.featured { border-color: #4cc9f0; box-shadow: 0 0 0 2px rgba(76,201,240,.15); }
.tier-card h3 { margin: 0 0 4px; font-size: 16px; }
.tier-card .price { font-size: 22px; font-weight: 800; margin: 4px 0 4px; }
.tier-card .price small { font-size: 12px; font-weight: 400; color: var(--text-2, #94a3b8); }
.tier-card ul { padding-left: 18px; margin: 8px 0 14px; font-size: 12.5px; color: var(--text-2, #94a3b8); line-height: 1.55; }
.tier-card ul li { margin-bottom: 2px; }
.tier-card button {
  background: linear-gradient(135deg, #4cc9f0, #4ade80);
  color: #06070c; border: none; padding: 9px 12px;
  border-radius: 7px; font-weight: 700; font-size: 13px;
  cursor: pointer; font-family: inherit;
  margin-top: auto;
}
.tier-card button.ghost {
  background: var(--surface-2); color: var(--text-1);
  border: 1px solid var(--border-2);
}
.tier-card button:disabled { opacity: .5; cursor: not-allowed; }
.upgrade-close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; color: var(--text-2, #94a3b8);
  font-size: 22px; cursor: pointer; line-height: 1;
}

/* Tier gating — applied to elements with data-tier-min that the current user
   doesn't satisfy. Lock pill overlays in CSS only; the DOM stays complete. */
[data-tier-min].tier-locked {
  position: relative;
  filter: blur(4px) saturate(.6);
  pointer-events: none;
  user-select: none;
}
[data-tier-min].tier-locked::after {
  content: '🔒 ' attr(data-tier-label, 'Edge');
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(6,7,12,.92);
  color: #fbbf24;
  padding: 6px 12px;
  border-radius: 6px;
  font: 700 11px 'JetBrains Mono', monospace;
  letter-spacing: .5px;
  filter: blur(0);
  pointer-events: auto;
}

/* Spider-pending banner — visible until ensemble data is wired. */
.spider-pending-banner {
  margin: 8px 14px 0;
  padding: 8px 12px;
  background: rgba(251, 191, 36, .08);
  border: 1px solid rgba(251, 191, 36, .25);
  border-radius: 8px;
  color: #fcd34d;
  font-size: 12.5px;
  line-height: 1.45;
}
.spider-pending-banner code {
  background: rgba(0,0,0,.3);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
}

/* Strategy Lab is fully ensemble-driven — show pending banner over the
   backtester canvas until Spider lands. The mockup curve stays as a preview. */
.view-lab .bt-curve::before {
  content: '🛰 Backtester is ensemble-driven — connects automatically when Spider creds are configured.';
  display: block;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: rgba(251, 191, 36, .08);
  border: 1px solid rgba(251, 191, 36, .25);
  border-radius: 8px;
  color: #fcd34d;
  font-size: 12.5px;
}
