:root {
  /* Ink & paper — deep warm charcoal, not cold blue */
  --ink:          #0a0b0e;
  --ink-deep:     #07080b;
  --paper:        #101117;
  --paper-lift:   #14161e;
  --rule:         #1c1e28;
  --rule-em:      #2a2d38;
  /* Text — warm off-whites */
  --text:         #e8e4d9;
  --text-dim:     #a8a49c;
  --text-mute:    #7a776c;
  /* Sole chrome accent — warm tungsten */
  --amber:        #d9a86a;
  --amber-hot:    #f0c17f;
  --amber-soft:   rgba(217,168,106,0.12);
  --amber-faint:  rgba(217,168,106,0.04);
  /* Data semantic — refined, not cartoon */
  --bull:         #7ec095;
  --bull-glow:    rgba(126,192,149,0.14);
  --bear:         #d87070;
  --bear-glow:    rgba(216,112,112,0.14);
  --info:         #8ab5c7;
  --warn:         #e8b868;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }
body {
  background: var(--ink);
  color: var(--text);
  font-family: 'IBM Plex Sans Condensed', sans-serif;
  font-size: 12px;
  font-weight: 400;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

/* Subtle film-grain overlay */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 999;
  opacity: 0.025; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 0.85   0 0 0 0 0.78   0 0 0 0 0.62   0 0 0 1 0'/></filter><rect width='220' height='220' filter='url(%23n)'/></svg>");
}

/* Page-load staggered reveal */
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.masthead     { animation: rise .45s ease-out both; animation-delay: .00s; }
.ticker-strip { animation: rise .50s ease-out both; animation-delay: .09s; }
#chart-area   { animation: rise .55s ease-out both; animation-delay: .18s; }
#bottom-area  { animation: rise .55s ease-out both; animation-delay: .27s; }

/* ─── Masthead ─────────────────────────────────────────────────── */
.masthead {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 40px;
  padding: 0 18px;
  background: var(--ink-deep);
  border-bottom: 1px solid var(--rule);
  position: relative;
  z-index: 30;
}
.masthead::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--amber) 24%, var(--amber) 76%, transparent 100%);
  opacity: 0.35;
}

.mast-left, .mast-right { display: flex; align-items: center; gap: 12px; }
.mast-right { justify-content: flex-end; }
.mast-center { display: flex; align-items: center; justify-content: center; gap: 1px; min-width: 0; }

/* Ad slot — reserves the masthead-center band for sponsor content without
   forcing any space until populated. :empty collapses the slot so the
   masthead looks identical to today's UI when no ad is rendered. Populate
   either by injecting a child node from a Django template (gated on a
   `show_ads` context flag) or via JS once an ad provider is wired up. */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 728px;          /* IAB leaderboard width cap */
  width: 100%;
  overflow: hidden;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.ad-slot:empty { display: none; }
.ad-slot img,
.ad-slot iframe { max-width: 100%; max-height: 100%; display: block; }
.ad-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 728px;
  max-width: 100%;
  height: 90px;
  background: #ffffff;
  color: #111;
  letter-spacing: 0.24em;
  font-weight: 600;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}
.wordmark-logo {
  height: 22px;
  width: auto;
  display: block;
}

.mast-sep {
  color: var(--text-mute);
  font-size: 11px;
  user-select: none;
}

.symbol {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

.mast-tg {
  display: inline-flex;
  align-items: center;
  color: var(--text-dim);
  line-height: 0;
  transition: color 120ms ease;
}
.mast-tg:hover { color: var(--amber); }

.tf-btn {
  background: transparent;
  border: none;
  color: var(--text-mute);
  padding: 4px 10px;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  position: relative;
  transition: color .18s ease;
}
.tf-btn span { font-size: 9px; opacity: 0.7; margin-left: 1px; }
.tf-btn::after {
  content: ''; position: absolute;
  left: 10px; right: 10px; bottom: 3px;
  height: 1px; background: var(--amber);
  transform: scaleX(0); transform-origin: left;
  transition: transform .22s ease;
}
.tf-btn:hover { color: var(--text-dim); }
.tf-btn:hover::after { transform: scaleX(0.5); }
.tf-btn.active { color: var(--amber); }
.tf-btn.active::after { transform: scaleX(1); }


.status { display: inline-flex; align-items: center; gap: 6px; }
.conn-indicator {
  width: 6px; height: 6px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
}
.conn-on  { background: var(--bull); box-shadow: 0 0 6px var(--bull); animation: pulse 2.4s ease-in-out infinite; }
.conn-off { background: var(--bear); box-shadow: 0 0 6px var(--bear); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.status-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
}

.mast-menu { position: relative; }
.mast-menu-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-dim);
  background: var(--paper-lift);
  border: 1px solid var(--rule-em);
  border-radius: 3px;
  padding: 1px 7px;
  cursor: pointer;
  line-height: 1.4;
  transition: color 0.15s, border-color 0.15s;
}
.mast-menu-btn:hover,
.mast-menu-btn.open { color: var(--text); border-color: var(--text-dim); }
.mast-menu-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 140px;
  background: var(--paper-lift);
  border: 1px solid var(--rule-em);
  border-radius: 4px;
  list-style: none;
  margin: 0;
  padding: 4px 0;
  z-index: 200;
  box-shadow: 0 6px 16px rgba(0,0,0,0.6);
}
.mast-menu-dropdown.open { display: block; }
.mast-menu-dropdown li a {
  display: block;
  padding: 7px 14px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.12s, background 0.12s;
}
.mast-menu-dropdown li a:hover { color: var(--amber); background: var(--rule); }

/* ─── Signal search ────────────────────────────────────────────── */
#signal-search-wrap {
  position: relative;
}
#signal-search-input {
  width: 180px;
  background: var(--paper-lift);
  border: 1px solid var(--rule-em);
  border-radius: 3px;
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  padding: 4px 8px;
  outline: none;
  transition: border-color 0.15s;
}
#signal-search-input:focus {
  border-color: var(--amber);
}
#signal-search-input::placeholder {
  color: var(--text-mute);
}
#signal-search-list {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 280px;
  background: var(--paper-lift);
  border: 1px solid var(--rule-em);
  border-radius: 3px;
  list-style: none;
  z-index: 200;
  max-height: 320px;
  overflow-y: auto;
}
#signal-search-list.hidden { display: none; }
#signal-search-list li {
  padding: 6px 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--rule);
}
#signal-search-list li:last-child { border-bottom: none; }
#signal-search-list li:hover,
#signal-search-list li.active { background: var(--amber-faint); color: var(--text); }
#signal-search-list li .ss-dir { font-weight: 600; }
#signal-search-list li .ss-dir.long  { color: var(--bull); }
#signal-search-list li .ss-dir.short { color: var(--bear); }
#signal-search-list li .ss-grade { color: var(--amber); }
#signal-search-list li .ss-ts  { color: var(--text-mute); margin-left: auto; }
#signal-search-list li .ss-loading { color: var(--text-mute); font-style: italic; }

/* ─── Ticker strip (hero price + metric rail + chart toggles) ─────
   Two-column grid:
     left  — price block + metric rail combined (Range, 24h Vol, Liquidity)
     right — chart-toggle buttons in a 2-row grid (formerly an overlay
             on the chart area; moved here so the upper-right space is
             actually used and the chart isn't covered).
*/
.ticker-strip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  height: var(--ticker-height);
  padding: 8px 18px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  align-items: center;
  position: relative;
  z-index: 20;
}
.ticker-center {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-width: 0;
}

.ticker-left {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-right: 18px;
  position: relative;
}

.ticker-price {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-width: 200px;
  height: 100%;
  position: relative;
}

.price-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
#price-tag {
  font-family: 'Instrument Serif', serif;
  font-size: 28px;
  font-weight: 400;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  transition: color .25s ease;
}
.price-delta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}

.ticker-rail {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 18px;
  row-gap: 4px;
  align-content: center;
  padding: 0 18px;
  height: 100%;
}
.rail-row {
  display: contents;
}
.rail-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--text-mute);
  text-transform: uppercase;
  align-self: center;
}
.rail-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  align-self: center;
  text-align: right;
}
.rail-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--text-mute);
  text-transform: uppercase;
  margin-left: 6px;
}
.rail-session {
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.liq-green  { color: #4caf81; }
.liq-orange { color: #f5a623; }
.liq-red    { color: #e05c5c; }

/* ─── Chart area ───────────────────────────────────────────────── */
/* --bottom-height drives both #chart-area and #bottom-area so the drag
   handle at the top of the bottom panel keeps the chart laid out in lockstep.
   --ticker-height matches .ticker-strip's height so the chart math stays in
   sync if the ticker resizes (was a 72→90 drift bug pre-2026-04-29). */
:root {
  --bottom-height: 260px;
  --ticker-height: 108px;
  --footer-height: 40px;
}
#chart-area {
  position: relative;
  width: 100%;
  height: calc(100vh - 40px - var(--ticker-height) - var(--bottom-height) - var(--footer-height));
  background: var(--paper);
}
/* When the Btm toggle hides the bottom panel, reclaim its space for the chart. */
body.bottom-hidden #bottom-area { display: none; }
body.bottom-hidden #chart-area  { height: calc(100vh - 40px - var(--ticker-height) - var(--footer-height)); }

/* Liq panel — third bottom-panel tab, lives next to volume-area + tech-area
   inside #bottom-area. Default hidden; revealed by showBottomPanel('liq'). */
#liq-stats, #readout-stats {
  display: none;
  gap: 18px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

/* Corner brackets — editorial frame */
.bracket {
  position: absolute;
  width: 14px; height: 14px;
  pointer-events: none;
  z-index: 6;
  opacity: 0.55;
}
.bracket-tl { top: 0;    left: 0;    border-top:    1px solid var(--amber); border-left:   1px solid var(--amber); }
.bracket-tr { top: 0;    right: 0;   border-top:    1px solid var(--amber); border-right:  1px solid var(--amber); }
.bracket-bl { bottom: 0; left: 0;    border-bottom: 1px solid var(--amber); border-left:   1px solid var(--amber); }
.bracket-br { bottom: 0; right: 0;   border-bottom: 1px solid var(--amber); border-right:  1px solid var(--amber); }

/* ─── Hover info (top-left, ephemeral) ─────────────────────────── */
#hover-info {
  position: absolute; top: 14px; left: 14px; z-index: 10;
  background: rgba(7,8,11,0.88);
  border: 1px solid var(--rule-em);
  border-top: 1px solid var(--amber);
  padding: 8px 14px 7px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text);
  display: flex; flex-direction: column; gap: 4px;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  backdrop-filter: blur(6px) saturate(1.2);
  box-shadow: 0 1px 0 var(--amber-soft), 0 8px 24px rgba(0,0,0,0.5);
}
#hover-info .hi-row {
  display: flex; gap: 16px;
  white-space: nowrap;
}
#hover-info .hi-label {
  color: var(--text-mute);
  margin-right: 5px;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
#hover-info.hidden { display: none; }

/* ─── Signal overlay (bottom-left, persistent card) ────────────── */
#signal-overlay {
  position: absolute; bottom: 14px; left: 14px; z-index: 10;
  background: rgba(7,8,11,0.82);
  border: 1px solid var(--rule-em);
  min-width: 236px;
  font-size: 13px;
  backdrop-filter: blur(8px) saturate(1.2);
  transition: opacity .25s ease, transform .25s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.55);
}
#signal-overlay.hidden { opacity: 0; pointer-events: none; transform: translateY(4px); }

.overlay-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 12px 6px;
  border-bottom: 1px solid var(--rule-em);
  background: linear-gradient(180deg, var(--amber-faint) 0%, transparent 100%);
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.overlay-header.dragging { cursor: grabbing; }
.overlay-title {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 14px;
  color: var(--amber-hot);
  line-height: 1;
}
.overlay-controls {
  display: flex; align-items: center; gap: 10px;
}
.overlay-size-btn {
  background: transparent;
  border: none;
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 15px;
  line-height: 1;
  padding: 2px 4px 3px;
  cursor: pointer;
  transition: color .18s ease;
}
.overlay-size-btn:hover { color: var(--text); }
.overlay-close {
  background: transparent;
  border: none;
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 15px;
  line-height: 1;
  padding: 2px 5px 3px;
  cursor: pointer;
  transition: color .18s ease;
}
.overlay-close:hover { color: var(--amber-hot); }

.sig-section {
  padding: 8px 12px 7px;
  border-bottom: 1px dashed var(--rule);
}
.sig-section:last-child { border-bottom: none; }

.section-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.69em;
  font-weight: 500;
  letter-spacing: 0.24em;
  color: var(--text);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.sig-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 2px 0;
  gap: 10px;
}
.sig-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.77em;
  color: var(--text);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 400;
  flex: 0 0 64px;
}
.sig-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1em;
  color: var(--text);
  text-align: left;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  flex: 1 1 auto;
  min-width: 0;
}

/* Semantic data colors */
.green, .bull  { color: var(--bull); }
.red,   .bear  { color: var(--bear); }
.dim           { color: var(--text-dim); }
.amber-text    { color: var(--amber); }

/* Absorption intensity bar (embedded in sig-value) */
.abs-bar {
  display: inline-block;
  width: 54px;
  height: 6px;
  margin-left: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.abs-fill {
  display: block;
  height: 100%;
  transition: width 250ms ease-out;
}
.abs-fill.green-bg { background: var(--bull); }
.abs-fill.red-bg   { background: var(--bear); }

/* Badges (structure) */
.badge {
  display: inline-block;
  padding: 2px 7px 1px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  border-radius: 1px;
  border: 1px solid currentColor;
}
.badge-bull { color: var(--bull); background: var(--bull-glow); border-color: rgba(126,192,149,0.35); }
.badge-bear { color: var(--bear); background: var(--bear-glow); border-color: rgba(216,112,112,0.35); }
.badge-neut { color: var(--text-dim); background: rgba(120,117,108,0.08); border-color: var(--rule-em); }

/* ─── Chart toggles (now in upper-right of ticker strip) ──────────
   Was an absolute overlay on the chart at top: 14px right: 14px. Moved
   into the ticker so the chart itself is uncluttered and the empty
   ticker space is filled. 2-row × 8-col grid holds 15 buttons (one
   slot empty at row 2 col 8). Justify content right so the grid hugs
   the right edge regardless of viewport width.
*/
/* Right-side toggle panel. Lives inside .ticker-strip's right column.
   Bleeds out to the strip's own borders (negative margins cancel the
   strip's 8px vertical / 18px horizontal padding on the right side) so
   the panel feels integrated, not floated. No outer border or background:
   it inherits the strip's paper colour; a single left rule separates it
   from the price/metric rail. */
#chart-toggles {
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-self: end;
  align-self: stretch;
  margin: -8px -18px -8px 0;
  border-left: 1px solid var(--rule);
  background: transparent;
  width: 460px;
  max-width: 100%;
}
.ct-row {
  display: grid;
  gap: 0;
  flex: 1 1 0;
}
.ct-tfs     { grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--rule); }
.ct-toggles { grid-template-columns: repeat(7, 1fr); }
.ct-toggles + .ct-toggles { border-top: 1px solid var(--rule); }
.ct-row > .chart-btn { border-right: 1px solid var(--rule); }
.ct-row > .chart-btn:last-child { border-right: none; }
.chart-btn {
  background: transparent;
  border: none;
  color: var(--text-mute);
  padding: 0 6px;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  position: relative;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color .18s ease, background .18s ease;
}
/* TF buttons live in #chart-toggles now — the .chart-btn rules already
   handle layout; this just keeps the small "m"/"h" suffix readable. */
.tf-btn.chart-btn { font-size: 12px; letter-spacing: 0.08em; text-transform: none; }
.tf-btn.chart-btn span { font-size: 10px; opacity: 0.7; margin-left: 1px; }
.tf-btn.chart-btn::after { left: 8px; right: 8px; bottom: 4px; }
.chart-btn::after {
  content: ''; position: absolute;
  left: 5px; right: 5px; bottom: 2px;
  height: 1px; background: var(--amber);
  transform: scaleX(0); transform-origin: left;
  transition: transform .24s cubic-bezier(.2,.6,.2,1);
}
.chart-btn:hover { color: var(--text-dim); background: var(--amber-faint); }
.chart-btn:hover::after { transform: scaleX(0.6); }
.chart-btn.active { color: var(--amber); }
.chart-btn.active::after { transform: scaleX(1); }

/* ─── Trade profile — volume-at-price per candle (live) ──────────── */
/* Canvas-based overlay. Must share origin with chart (top:0) so pixel
   coordinates from priceToCoordinate/timeToCoordinate line up. */
#trade-profile {
  position: absolute;
  top: 0;
  left: 0;
  right: 60px;    /* clear price-scale labels, same as ladder */
  bottom: 0;
  pointer-events: none;
  z-index: 4;     /* below depth-ladder (z:6) so strata overlap cleanly */
}
#trade-profile canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
}
#session-vp-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 60px;
  bottom: 0;
  pointer-events: none;
  z-index: 3;     /* below trade-profile (z:4) */
}

/* ─── Bottom panel ─────────────────────────────────────────────── */
#bottom-area {
  width: 100%;
  height: var(--bottom-height);
  background: var(--paper);
  border-top: 1px solid var(--rule-em);
  position: relative;
}
#bottom-area::before {
  content: ''; position: absolute; left: 0; right: 0; top: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--amber) 30%, var(--amber) 70%, transparent 100%);
  opacity: 0.25;
}

/* Drag handle — 6px hit area sitting on the top edge of the bottom panel. */
#bottom-resize-handle {
  position: absolute;
  top: -3px;
  left: 0;
  right: 0;
  height: 6px;
  cursor: ns-resize;
  z-index: 10;
  background: transparent;
}
#bottom-resize-handle::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 1px;
  transform: translateX(-50%);
  width: 36px;
  height: 3px;
  border-radius: 2px;
  background: var(--text-mute);
  opacity: 0;
  transition: opacity 120ms ease-out;
}
#bottom-resize-handle:hover::after,
body.resizing-bottom #bottom-resize-handle::after { opacity: 0.6; }
body.resizing-bottom { cursor: ns-resize; user-select: none; }

.bottom-header {
  position: absolute; top: 0; left: 0; right: 0;
  height: 30px;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 14px;
  z-index: 10;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

#bottom-tabs {
  display: flex; gap: 4px;
  align-items: center;
}
.bottom-tab {
  background: transparent;
  border: none;
  color: var(--text-mute);
  padding: 4px 10px 5px;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  position: relative;
  transition: color .18s ease;
}
.bottom-tab::after {
  content: ''; position: absolute;
  left: 10px; right: 10px; bottom: 1px;
  height: 1px; background: var(--amber);
  transform: scaleX(0); transform-origin: left;
  transition: transform .22s ease;
}
.bottom-tab:hover { color: var(--text-dim); }
.bottom-tab:hover::after { transform: scaleX(0.5); }
.bottom-tab.active { color: var(--amber); }
.bottom-tab.active::after { transform: scaleX(1); }

#vol-stats {
  display: flex;
  gap: 18px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.vol-stat {
  display: inline-flex; align-items: center; gap: 5px;
}
.vol-dot {
  width: 5px; height: 5px; border-radius: 1px;
}
.vol-dot-total { background: var(--text-dim); }
.vol-dot-buy   { background: var(--bull); }
.vol-dot-sell  { background: var(--bear); }
.stat-label {
  color: var(--text-mute);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-right: 2px;
}
#vs-buy, #vs-sell, #vs-pct, #vs-delta {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
#vs-buy   { color: var(--bull); }
#vs-sell  { color: var(--bear); }

#volume-area, #tech-area, #liq-area, #readout-area {
  position: absolute;
  top: 30px; left: 0;
  width: 100%;
  height: calc(100% - 30px);
}
#tech-area    { visibility: hidden; }
#liq-area     { visibility: hidden; }
#readout-area { visibility: hidden; overflow-y: auto; padding: 8px 18px; }

/* Split mode — when bottom-area.split is set, the primary panel takes the
   left half and the secondary panel takes the right half. Both have
   .panel-primary / .panel-secondary classes added by JS. A vertical rule
   separates them. */
#bottom-area.split #volume-area.panel-primary,
#bottom-area.split #tech-area.panel-primary,
#bottom-area.split #liq-area.panel-primary,
#bottom-area.split #readout-area.panel-primary {
  width: 50%;
  left: 0;
  border-right: 1px solid var(--rule-em);
}
#bottom-area.split #volume-area.panel-secondary,
#bottom-area.split #tech-area.panel-secondary,
#bottom-area.split #liq-area.panel-secondary,
#bottom-area.split #readout-area.panel-secondary {
  width: 50%;
  left: 50%;
  visibility: visible;
}
/* In split mode, stats containers can sit side-by-side; the JS reveals both
   for primary + secondary. */
#bottom-area.split .bottom-header > div[id$="-stats"].stats-secondary {
  margin-left: 18px;
  border-left: 1px solid var(--rule-em);
  padding-left: 12px;
}

/* Split-toggle button — sits to the right of the tab row. */
.bottom-split-btn {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--rule-em);
  color: var(--text-mute);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  height: 22px;
  cursor: pointer;
  border-radius: 2px;
  transition: color 0.12s, border-color 0.12s;
}
.bottom-split-btn:hover { color: var(--text); border-color: var(--text-dim); }
.bottom-split-btn.active { color: var(--amber); border-color: var(--amber); }

/* Pinned-secondary tab — shown when split is on and a tab is in the
   secondary slot. Distinct from .active (primary). */
.bottom-tab.pinned-secondary {
  color: var(--amber);
  border-bottom: 2px solid var(--amber);
}

/* Readout bottom-panel — restyle the cloned overlay markup for the wider,
   shorter slot. Sections inline rather than stacked when there's room. */
#readout-area .sig-section { margin-bottom: 8px; }
#readout-area .section-label {
  color: var(--text-mute);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 3px;
}
#readout-area .sig-row {
  display: flex;
  justify-content: space-between;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  padding: 1px 0;
}
#readout-area .sig-label { color: var(--text-dim); }
#readout-area .sig-value { color: var(--text); font-variant-numeric: tabular-nums; }

/* Tech panel: 5 verdict rows, summary up in the header */
#tech-stats {
  display: none;
  gap: 18px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
#tech-area {
  display: flex;
  flex-direction: column;
  padding: 10px 18px;
  gap: 2px;
  overflow: hidden;
}
.tech-row {
  display: grid;
  grid-template-columns: 150px 110px 1fr;
  align-items: center;
  padding: 7px 10px;
  border-bottom: 1px solid var(--rule);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
}
.tech-row:last-child { border-bottom: none; }
.tech-row.bias-row {
  padding: 9px 10px 11px;
  border-bottom: 1px solid var(--rule-em);
  margin-bottom: 4px;
}
.tech-row.bias-row .tech-label {
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
}
.tech-row.bias-row .tech-verdict {
  font-size: 11px;
  padding: 3px 12px;
}
.tech-label {
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 10px;
}
.tech-verdict {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  width: fit-content;
}
.tech-verdict.buy       { background: rgba(126,192,149,0.18); color: var(--bull); border: 1px solid rgba(126,192,149,0.45); }
.tech-verdict.sell      { background: rgba(216,112,112,0.18); color: var(--bear); border: 1px solid rgba(216,112,112,0.45); }
.tech-verdict.neutral   { background: rgba(83,81,74,0.18);    color: var(--text-dim); border: 1px solid rgba(83,81,74,0.40); }
.tech-detail {
  color: var(--text-mute);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  padding-left: 14px;
}

/* ─── Responsive nudges ────────────────────────────────────────── */
@media (max-width: 1100px) {
  #price-tag { font-size: 30px; }
  .ticker-rail { padding: 0 12px; column-gap: 12px; }
  .rail-value { font-size: 12px; }
}

/* ─── Site footer ──────────────────────────────────────────────── */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--footer-height, 40px);
  border-top: 1px solid var(--rule-em);
  background: var(--ink-deep);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  z-index: 80;
}
.footer-disclaimer {
  font-family: 'IBM Plex Sans Condensed', sans-serif;
  font-size: 11px;
  color: var(--text-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.footer-attribution {
  font-family: 'IBM Plex Sans Condensed', sans-serif;
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
}
.footer-attribution a { color: inherit; text-decoration: underline; }
.footer-contact {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}
/* On home/help pages, push content above the fixed footer */
body.page-home .home-shell,
body.page-help .help-shell { padding-bottom: calc(var(--footer-height, 40px) + 60px); }
