/* ═══════════════════════════════════════════════════════════
   MAIN AREA
═══════════════════════════════════════════════════════════ */
/* The sidebar is fixed (hover rail), so the main column reserves the
   rail's width once — hover-expanding overlays it without reflow. */
.main{flex:1;display:flex;flex-direction:column;overflow:hidden;min-width:0;position:relative;container-type:inline-size;container-name:main;margin-left:var(--rail-w);
  /* Persistent-drawer PUSH: the content (header + every chart pane — all
     children of .main) squeezes right when the sidebar expands, TradingView/
     VS Code style, instead of the panel flying out over it. The margin
     animates in LOCKSTEP with the sidebar's clip-path reveal (identical curve,
     duration and delay per direction — see 02-sidebar.css) so the panel edge
     and the content edge move as one piece. Base = no transition so the boot
     restore of the persisted state SNAPS; the motion is armed by body.sb-anim
     (added after first paint / on first toggle by app.js). The LWC price chart,
     the lower canvas panes and the /watchlist CCGraphs panels track the motion
     live via their own ResizeObservers (profiled clean: no long tasks, 3–8ms
     pane frames); app.js gives one settle repaint on transitionend. */
  transition:none;}
/* Arm the push motion (post-boot). Collapse and expand share ONE timing —
   --sb-toggle, the single rail-toggle clock defined and documented at the top
   of 02-sidebar.css (which loads first). The panel edge, every reveal inside
   it and this push all read that one token, so they cannot drift apart; never
   hard-code a duration here. The expanded rule below restates it only so the
   armed transition survives the class swap. Excluded in chart-zen (which snaps
   margin to 0 via !important) so entering / leaving zen keeps snapping. */
body.sb-anim:not(.chart-zen) .main{
  transition:margin-left var(--sb-toggle);
}
/* Sidebar expanded → push the content in (desktop default). Driven by a
   synced body class (matches trade-open / ksd-open; the codebase moved off
   :has() for perf). */
:root.sb-open .main{
  margin-left:var(--sidebar-w);
}
:root.sb-open body.sb-anim:not(.chart-zen) .main{
  transition:margin-left var(--sb-toggle);
}
/* The sidebar push (app.js pushMain) animates .main's margin-left and pins
   the chart block at the wider of its two widths for the toggle (inline
   width). It hangs off .main's right edge (a column flex item aligned to
   the end overflows on the start side), so the price axis, the panes and
   the docks' seams stay put while .main's moving left edge clips it: no
   chart resize on any frame of the motion. */
body.sb-pushing .charts{align-self:flex-end;}
/* Below the tablet breakpoint the content is too narrow to squeeze, so fall
   back to the overlay drawer (Material's modal-on-mobile): the content stays
   put and the sidebar flies out OVER it with the heavier drop shadow. */
@media(max-width:900px){
  :root.sb-open .main{ margin-left:var(--rail-w); }
  /* Overlay drawer shadow lives on the body::before strip now (the
     sidebar's clip-path clips an on-element box-shadow). */
  body::before{ box-shadow:var(--shadow-edge); }
}

/* ── Header strip ─────────────────────────────────────────
   Info bar over the chart: solid --bg-secondary base, and a bottom hairline
   that is THE SAME SEAM as the sidebar's right edge.
   Owner call 2026-07-25: "make the same border contrast on the header panel on
   the chart page. Between the price panel and the header (like the whole
   header) they should be the same type of the border as it is as left side
   panel vertical border." So this reads the SAME token as .sidebar::after in
   02-sidebar.css — --border-default, 1px — which is also what every horizontal
   seam in the sidebar and .chart-resizer::after use.
   It WAS `--text-primary 6%`, a deliberately "fading" glass hairline; at that
   contrast the boundary between the header and the price panel was invisible
   against both themes' surfaces while the seams around it read fine.

   REPLACED, NOT STACKED: this is the same border-bottom declaration recoloured.
   Nothing else draws on this edge — the price panel (.cp/.cp.price) has no
   border-top, .sent-bar (which used to sit between them with an identical 6%
   hairline) is display:none since the toolbar moved into .top-cluster, and no
   later-numbered file redeclares it (08-chart-chrome.css only changes .hdr's
   padding/height inside the <=900px block). A second line here would read
   heavier than the sidebar's and break the parity the owner asked for.

   ZERO LAYOUT DELTA: `*{box-sizing:border-box}` (01-base.css) plus the fixed
   height/min-height of --header-h means this 1px lives INSIDE the strip. Only
   the colour changes, so nothing below moves — the chart never reflows, the
   canvas never resizes, and the fixed trade ticket / #chart-rail / Key Stats
   sheet (all offset from --header-h, which is untouched) stay in sync. Keep it
   a plain border: unlike the sidebar's edge this box is neither clipped nor
   composited, so paint snaps it to one crisp column already (verified). */
.hdr{
  display:flex;align-items:center;gap:0.75rem;
  padding:0 1.25rem;height:var(--header-h);min-height:var(--header-h);
  position:relative;z-index:10;
  background:var(--bg-secondary);
  border-bottom:1px solid var(--border-default);
  flex-shrink:0;
}
.hdr.hidden{display:none!important;}
.hdr:not(.hidden){animation:strip-in .42s var(--ease-out) backwards;}

.hdr-sym{
  font-family:var(--font-display);font-size:0.85rem;font-weight:700;
  letter-spacing:0.05em;color:var(--text-primary);
  text-transform:uppercase;white-space:nowrap;
}
.hdr-price{
  font-family:var(--font-display);font-size:0.95rem;font-weight:700;
  letter-spacing:-0.02em;font-variant-numeric:tabular-nums;
  color:var(--text-primary);
  transition:color .32s ease;
  line-height:1;
}
.up{color:var(--green);}
.down{color:var(--red);}

/* The header stat strip (.hdr-stats / .hs-l / .hs-v) and the LIVE badge
   (.live-r / .live-d / .live-t) were cut from the template on 2026-07-01;
   their rules were removed on 2026-07-26. .hs below is kept: it is a
   two-letter token that could not be proven unused. */
/* The tweet/news sentiment stats moved onto the Stocktwits/News Sentiment
   pane headers (#cp-stats-sent / #cp-stats-news); the row below the header
   now carries only the chart toolbar, which manages its own overflow. The
   per-pane stats do their own responsive shedding (see .cp-stats below). */
.hs{
  display:flex;flex-direction:column;align-items:flex-end;gap:1px;
  padding:0 0.875rem;
  position:relative;
}

/* ── Sentiment / news stat strip ─────────────────────────
   Same glass material as the header above so the two rows
   read as one continuous frosted slab divided by a fading
   inner hairline. */
.sent-bar{
  display:flex;align-items:center;gap:0;
  padding:0 1rem;height:1.75rem;min-height:1.75rem;
  position:relative;z-index:10;
  background:var(--bg-secondary);
  border-bottom:1px solid color-mix(in srgb, var(--text-primary) 6%, transparent);
  flex-shrink:0;
}
.sent-bar.hidden{display:none!important;}
.sent-bar:not(.hidden){animation:strip-in .42s var(--ease-out) 60ms backwards;}

/* ── Merged header (2026-07-01) ──────────────────────────────────────────
   The chart toolbar used to sit as its own 28px strip (.sent-bar) directly
   under the header. It is now re-parented (in app.js) into the right-anchored
   .top-cluster so the header is ONE row: ticker on the left, then
   [toolbar][GRAPHS][Chart] grouped on the right (scales with the trade
   panel). The empty .sent-bar strip is retired. */
.sent-bar{display:none!important;}

/* Toolbar buttons match the GRAPHS + Chart controls in the same cluster
   (30px tall, 15px icons). They're only packed TIGHTER horizontally (small
   padding + thin separators) so the full row still fits beside the ticker. */
/* flex-wrap: the toolbar's own row may wrap too (see .top-cluster —
   "wrap, never underlap"); its min-content width then collapses to the
   widest single control, so the cluster can always fit inside .main
   instead of sliding under the fixed sidebar. Single-line rendering is
   untouched at normal widths. */
.top-cluster .time-controls{margin-left:0;flex-wrap:wrap;justify-content:flex-end;}
/* Thinner buttons, BIGGER glyphs (TradingView density). REM, not px:
   the root font is fluid on viewport width, so px icons shrink
   RELATIVE to everything else on big monitors — 1.25rem is 20px on a
   laptop and 25px on a 27-inch. */
.time-controls .chart-type-btn{height:1.625rem;min-height:var(--ctl-floor);padding:0 0.4375rem;font-size:max(0.625rem, var(--fs-floor));}
.time-controls svg{width:1.125rem;height:1.125rem;}
/* Carets stay small — only the tool glyphs grow for legibility. */
.time-controls .iv-caret{width:0.6875rem;height:0.6875rem;}
.time-controls .chart-type-sep{margin:0 0.3125rem;}
/* Tight tier (stamped by the .main ResizeObserver in app.js): labels are
   already gone; repack paddings + separators so the full toolbar, GRAPHS
   and Chart cluster still fit beside the ticker. */
.time-controls.tc-tight .chart-type-btn{padding:0 0.25rem;gap:0.1875rem;}
.time-controls.tc-tight .chart-type-sep{margin:0 0.125rem;}
.sl{
  font-family:var(--font-mono);color:var(--text-xmuted);font-weight:600;
  font-size:max(0.5rem, var(--fs-floor));letter-spacing:normal;
  text-transform:none;white-space:nowrap;
}
.sv{
  font-family:var(--font-mono);font-weight:700;font-size:0.75rem;
  color:var(--text-primary);
  font-variant-numeric:tabular-nums;
  letter-spacing:0.01em;
}
.s-bull{color:var(--green);}
.s-bear{color:var(--red);}
.s-neut{color:var(--text-muted);}

/* Phase 2.1 — sentiment mini-bars in the stats strip */
.sb-sparkbar{
  display:inline-block;width:1.75rem;height:0.1875rem;
  background:color-mix(in srgb, var(--text-primary) 7%, transparent);border-radius:1px;
  overflow:hidden;vertical-align:middle;flex-shrink:0;
}
.sb-sparkbar i{
  display:block;height:100%;width:0;border-radius:1px;
  transition:width .4s var(--ease-out);
}
.sb-sparkbar-bull i{background:var(--green);}
.sb-sparkbar-bear i{background:var(--red);}
.sb-sparkbar-neut i{background:var(--text-muted);}

/* Per-pane sentiment stats — the tweet counts / bull-bear-neutral split /
   avg score that used to sit in the top header strip now ride inline after
   the pane title, inside the (pointer-events:none) .cp-label. Reuses the
   .sv / .sb-sparkbar atoms above; overrides the label's uppercase+sans so
   the numbers read as data, not a heading. */
.cp-lbl-txt{ flex:0 0 auto; }
.cp-stats{
  display:inline-flex; align-items:center; gap:0.3125rem;
  margin-left:0.875rem;
  font-family:var(--font-mono);
  text-transform:none; letter-spacing:0; white-space:nowrap;
}
.cp-stats .cps-n{
  color:var(--text-primary); font-weight:700; font-size:max(0.6875rem, var(--fs-floor));
  font-variant-numeric:tabular-nums;
}
.cp-stats .cps-l{
  color:var(--text-xmuted); font-weight:600; font-size:max(0.5rem, var(--fs-floor));
  letter-spacing:normal; text-transform:none;
}
.cp-stats .cps-sep{ color:var(--text-xmuted); opacity:0.4; margin:0 0.0625rem; }
.cp-stats .sv{ font-size:max(0.6875rem, var(--fs-floor)); font-weight:700; }
/* Shed the word-labels first, then the whole cluster, before it can crowd
   the right-anchored window slider on narrow panes. Thresholds measured
   against the live gap (labels-on clears the slider down to ~62rem; the
   bare numbers down to ~58rem). */
@container main (max-width: 62rem){ .cp-stats .cps-l{display:none;} }
@container main (max-width: 58rem){ .cp-stats{display:none;} }

@keyframes strip-in{
  from{opacity:0;transform:translateY(-6px);}
  to  {opacity:1;transform:translateY(0);}
}

/* Grok narrative badge — sticky header strip below the stats bar */
.grok-badge{
  display:flex;align-items:center;gap:0.625rem;
  padding:0 1.5rem;height:1.875rem;
  background:var(--bg-secondary);
  border-bottom:1px solid var(--border-subtle);
  flex-shrink:0;font-size:0.75rem;
  cursor:default;
}
.grok-badge{display:none!important;}
.grok-badge.hidden{display:none!important;}
.gb-emoji{font-size:0.9375rem;line-height:1;}
.gb-score{
  font-family:var(--font-mono);font-weight:700;font-size:0.8125rem;
  padding:1px 0.5rem;border-radius:0.1875rem;color:var(--on-accent-bright);
  background:color-mix(in srgb, var(--neut) 60%, transparent);
  min-width:3rem;text-align:center;
}
.gb-score.bullish{background:var(--green);}
.gb-score.cautious-bull{background:var(--tier-cbull);}
.gb-score.neutral{background:var(--text-muted);}
.gb-score.cautious-bear{background:var(--tier-cbear);}
.gb-score.bearish{background:var(--red);}
.gb-themes{display:flex;gap:0.25rem;flex-wrap:nowrap;overflow:hidden;}
.gb-theme{
  font-size:0.75rem;padding:1px 0.4375rem;border-radius:var(--radius-sm);
  background:var(--accent-dim);color:var(--accent);
  border:1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  white-space:nowrap;
}
.gb-narrative{
  flex:1;font-style:italic;color:var(--text-muted);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.75rem;
}
.gb-age{font-family:var(--font-mono);color:var(--text-muted);font-size:0.75rem;}
.gb-age.stale{color:var(--red);}

/* AI advisor badge — Monaco precision telemetry strip */
.advisor-badge{
  display:flex;align-items:center;gap:0;
  padding:0 1rem;height:1.375rem;
  background:var(--bg-secondary);
  border-top:none;
  border-bottom:1px solid color-mix(in srgb, var(--text-primary) 5%, transparent);
  flex-shrink:0;cursor:default;
}
.advisor-badge.hidden{display:none!important;}
/* Signal word — no pill, pure signal color */
.ab-action{
  font-family:var(--font-mono);font-weight:800;font-size:max(0.625rem, var(--fs-floor));
  background:transparent!important;border:none!important;border-radius:0;
  padding:0;min-width:auto;text-align:left;
  letter-spacing:normal;text-transform:none;
}
.ab-action.buy{color:var(--green);}
.ab-action.sell{color:var(--red);}
.ab-action.hold{color:var(--amber);}
/* Conviction — hairline-separated, plain mono. Carries real signal
   (the advisor's confidence) so it gets muted, not xmuted. */
.ab-conviction{
  font-family:var(--font-mono);font-size:max(0.625rem, var(--fs-floor));font-weight:600;
  color:var(--text-muted);white-space:nowrap;
  background:transparent;border:none;border-radius:0;
  padding:0;margin-left:0.875rem;
  letter-spacing:0.06em;
}
/* Rationale — italic, truncated, spaced off the conviction */
.ab-rationale{
  flex:1;color:var(--text-secondary);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  font-size:max(0.625rem, var(--fs-floor));font-style:italic;letter-spacing:0.01em;
  margin-left:0.875rem;
}
.ab-age{
  font-family:var(--font-mono);color:var(--text-muted);
  font-size:max(0.5rem, var(--fs-floor));letter-spacing:0.10em;
  white-space:nowrap;margin-left:auto;padding-left:0.75rem;
}
.ab-age.stale{color:var(--red);}

/* Short-squeeze badge — frosted-glass header strip, sharp-edged to match
   the app's Carbon language. A per-tier --sq colour drives the left accent
   bar, the score chip and its glow so the whole strip "heats up" together. */
.squeeze-badge{
  --sq:var(--neut);
  position:relative;display:flex;align-items:center;gap:11px;
  padding:0 24px;height:32px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--sq) 9%, transparent), transparent 42%),
    linear-gradient(180deg, color-mix(in srgb, var(--text-primary) 2.8%, transparent), transparent);
  backdrop-filter:blur(14px) saturate(140%);
  -webkit-backdrop-filter:blur(14px) saturate(140%);
  border-bottom:1px solid var(--border-subtle);
  flex-shrink:0;font-size:0.75rem;cursor:default;
  transition:--sq .35s, background .35s, border-color .35s;
}
.squeeze-badge.hidden{display:none!important;}
.squeeze-badge.tier-low{--sq:var(--neut);}
.squeeze-badge.tier-moderate{--sq:var(--amber);}
.squeeze-badge.tier-high{--sq:var(--terracotta);}
.squeeze-badge.tier-extreme{--sq:var(--red);}
.sq-label{
  font-family:var(--font-mono);font-weight:700;font-size:max(0.625rem, var(--fs-floor));
  letter-spacing:0.13em;color:var(--text-muted);white-space:nowrap;
}
.sq-emoji{font-size:0.9375rem;line-height:1;}
.sq-score{
  font-family:var(--font-mono);font-weight:700;font-size:0.8125rem;
  padding:2px 9px;min-width:30px;text-align:center;letter-spacing:0.02em;
  color:var(--bg-primary);background:var(--sq);
  box-shadow:0 0 16px -3px var(--sq);
}
/* Low tier (e.g. mega-caps that can't squeeze) stays quiet: muted chip,
   light text, no glow — present but not alarming. */
.squeeze-badge.tier-low .sq-score{
  color:var(--text-primary);background:color-mix(in srgb, var(--text-primary) 7%, transparent);box-shadow:none;
}
.sq-detail{
  flex:1;color:var(--text-secondary);font-size:0.75rem;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.sq-detail .sq-igniting{color:var(--sq);font-weight:700;}
.sq-age{
  font-family:var(--font-mono);color:var(--text-muted);
  font-size:max(0.6875rem, var(--fs-floor));letter-spacing:0.03em;white-space:nowrap;
}
.sq-age.stale{color:var(--red);}

/* The settings rows and the .sq-switch pill that used to live here moved out on
   2026-07-25: the pill is gone (replaced by .stg-2way, a two-segment control
   that spells its states) and .stg-row is redefined as a grid. Both now live
   with the rest of the settings page in 13-widgets.css — a LATER file, and the
   only other place either family was ever mentioned, so the cascade is
   unchanged. Nothing outside #settings-view used them. */

/* Toast — extreme events / new catalyst */
.grok-toast{
  position:fixed;bottom:1.25rem;right:1.25rem;z-index:9999;
  max-width:21.25rem;padding:0.625rem 0.875rem;
  background:var(--bg-elevated);
  border:1px solid var(--border-default);
  border-radius:var(--radius);font-size:0.8125rem;
  color:var(--text-primary);
  box-shadow:var(--shadow-pop);
  transform:translateX(380px);opacity:0;
  transition:transform .25s ease,opacity .25s ease;
  pointer-events:none;
}
.grok-toast.show{transform:translateX(0);opacity:1;pointer-events:auto;}
.grok-toast .gt-title{font-weight:700;margin-bottom:0.25rem;font-size:0.75rem;letter-spacing:normal;text-transform:none;}
.grok-toast .gt-body{color:var(--text-muted);}
.s-bear{color:var(--red);}
.s-neut{color:var(--text-secondary);}

/* Chart toolbar — inner cluster of .sent-bar. Floats to the right
   so the sentiment stats stay left-aligned and the chart controls
   sit "under Price" on the right. No rounded pills, no glass blur. */
.time-controls{
  display:flex;align-items:center;gap:0;
  margin-left:auto;
}
.time-controls.hidden{display:none!important;}

/* Monaco segmented control — pill hover + tinted-pill active state
   (spec docs/superpowers/specs/2026-07-10-chart-header-toolbar-design.md).
   Controls sit in 5 semantic clusters with a .chart-type-sep only at the
   cluster boundaries; high-value controls carry a .ctb-label that folds
   away under 1500px. */
.chart-type-btn{
  display:inline-flex;align-items:center;justify-content:center;
  gap:0.3125rem;
  height:2rem;padding:0 0.5rem;
  border:none;border-radius:var(--radius-sm);
  background:transparent;color:var(--text-secondary);
  font-family:var(--font-mono);font-size:max(0.5625rem, var(--fs-floor));font-weight:700;
  letter-spacing:normal;text-transform:none;
  cursor:pointer;white-space:nowrap;
  transition:color .12s ease,background .12s ease;
}
.chart-type-btn:hover{color:var(--text-primary);background:var(--bg-hover);}
.chart-type-btn.active{
  color:var(--accent);
  background:color-mix(in srgb, var(--accent) 12%, transparent);
  box-shadow:none;
}
.ctb-label{white-space:nowrap;}
/* Density tiers are stamped on #time-controls by a ResizeObserver on .main
   (app.js) — media queries can't see the sidebar/dock/trade-panel space. */
.time-controls.tc-nolabels .ctb-label{display:none;}

.chart-type-sep{width:1px;height:0.875rem;background:color-mix(in srgb, var(--text-primary) 10%, transparent);margin:0 0.4375rem;flex-shrink:0;}

/* Interval dropdown — replaces the inline button row. The trigger reuses
   .chart-type-btn (toolbar height + typography) plus a caret; the menu
   drops DOWN onto the chart (TradingView style) with intervals grouped
   Minutes / Hours / Days. The active pill carries an inset accent ring
   (inset box-shadow, not a 1px border — a border renders as a bowtie X in
   headless screenshots). */
.interval-dd{position:relative;display:inline-flex;align-items:center;}
.iv-trigger{gap:0.25rem;min-width:2.75rem;}
/* Keep the active-interval label mixed-case: lowercase m/h = minutes/hours,
   uppercase D/W/M = day/week/month. Uppercasing would collapse "1m" (one
   minute) and "1M" (one month) into the same glyphs. */
.iv-trigger > span{white-space:nowrap;text-transform:none;}
/* ...but the chart-type name label matches the uppercase toolbar labels. */
.iv-trigger > span.ctb-label{text-transform:none;}
.iv-caret{flex-shrink:0;color:var(--text-muted);transition:transform .15s var(--ease-out);}
.interval-dd.open .iv-trigger{color:var(--accent);background:color-mix(in srgb, var(--accent) 12%, transparent);}
.interval-dd.open .iv-caret{transform:rotate(180deg);color:var(--accent);}

.iv-menu{
  position:absolute;
  top:calc(100% + 0.3125rem);left:0;
  padding:0.5rem;
  border:1px solid var(--border-default);
  border-radius:var(--radius);
  background:var(--bg-elevated);
  z-index:60;
  box-shadow:var(--shadow-rail);
  opacity:0;transform:translateY(-6px);
  transform-origin:top left;
  pointer-events:none;
  transition:opacity .2s var(--ease-out),transform .22s var(--ease-out);
}
.iv-menu[hidden]{display:none;}
.interval-dd.open .iv-menu{opacity:1;transform:translateY(0);pointer-events:auto;}

.iv-group + .iv-group{
  margin-top:0.5rem;padding-top:0.5rem;
  border-top:1px solid color-mix(in srgb, var(--text-primary) 6%, transparent);
}
.iv-group-label{
  margin:0 0 0.375rem 0.125rem;
  font-family:var(--font-mono);font-size:max(0.5rem, var(--fs-floor));font-weight:700;
  letter-spacing:normal;text-transform:none;color:var(--text-muted);
}
.iv-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:0.1875rem;}
.iv-menu .iv-btn{
  height:1.75rem;min-width:2.5rem;padding:0 0.5rem;
  border:none;border-radius:var(--radius-sm);
  background:var(--bg-tertiary);color:var(--text-secondary);
  font-family:var(--font-mono);font-size:max(0.625rem, var(--fs-floor));font-weight:700;
  letter-spacing:0.04em;text-transform:none;
  cursor:pointer;white-space:nowrap;
  transition:background .12s var(--ease-out),color .12s var(--ease-out),box-shadow .12s var(--ease-out);
}
.iv-menu .iv-btn:hover{background:var(--bg-hover);color:var(--text-primary);}
.iv-menu .iv-btn.active{
  color:var(--accent);
  box-shadow:inset 0 0 0 1px var(--accent);
}

/* Chart-type dropdown — reuses the .interval-dd open/caret mechanics; the
   trigger shows the active type's glyph and the menu lists icon + label
   rows grouped (Bars & Candles / Lines / Advanced), TradingView style. */
.ct-trigger{min-width:auto;gap:0.1875rem;padding:0 0.375rem;}
.ct-trigger-ic{display:inline-flex;align-items:center;justify-content:center;}
.ct-trigger-ic svg{display:block;}
.ct-menu{min-width:11.5rem;left:0;}
.ct-group + .ct-group{
  margin-top:0.5rem;padding-top:0.5rem;
  border-top:1px solid color-mix(in srgb, var(--text-primary) 6%, transparent);
}
.ct-group-label{
  margin:0 0 0.3125rem 0.125rem;
  font-family:var(--font-mono);font-size:max(0.5rem, var(--fs-floor));font-weight:700;
  letter-spacing:normal;text-transform:none;color:var(--text-muted);
}
.ct-row{
  display:flex;align-items:center;gap:0.5rem;width:100%;
  height:1.75rem;padding:0 0.5rem;
  border:none;border-radius:var(--radius-sm);
  background:transparent;color:var(--text-secondary);
  font-family:var(--font-mono);font-size:max(0.625rem, var(--fs-floor));font-weight:600;
  letter-spacing:0.02em;text-transform:none;text-align:left;
  cursor:pointer;white-space:nowrap;
  transition:background .12s var(--ease-out),color .12s var(--ease-out),box-shadow .12s var(--ease-out);
}
.ct-row + .ct-row{margin-top:0.0625rem;}
.ct-row .ct-ic{display:inline-flex;align-items:center;justify-content:center;
  width:1rem;height:1rem;flex-shrink:0;color:var(--text-muted);}
.ct-row .ct-ic svg{display:block;}
.ct-row .ct-name{flex:1;}
.ct-row:hover{background:var(--bg-hover);color:var(--text-primary);}
.ct-row:hover .ct-ic{color:var(--text-secondary);}
.ct-row.active{
  color:var(--accent);
  box-shadow:inset 0 0 0 1px var(--accent);
}
.ct-row.active .ct-ic{color:var(--accent);}

/* Session picker — reuses .interval-dd + .ct-row. Rows carry a right-aligned
   muted time-window sub-label; the trigger shows only the active glyph. */
.session-menu{min-width:12.5rem;}
.session-opt .session-sub{
  margin-left:auto;padding-left:0.75rem;flex-shrink:0;
  color:var(--text-muted);font-size:max(0.5625rem, var(--fs-floor));font-weight:600;letter-spacing:0.01em;
}
.session-opt.active .session-sub{color:color-mix(in srgb, var(--accent) 65%, transparent);}
.session-opt:hover .session-sub{color:var(--text-secondary);}
.session-trigger{gap:0.25rem;padding:0 0.4375rem;}
.session-trigger .ct-trigger-ic{display:inline-flex;align-items:center;justify-content:center;width:1rem;height:1rem;}

/* Price-scale picker — reuses the .interval-dd shell. The
   trigger shows a scale glyph + the active mode short label; the menu lists
   mode radios then Auto-fit/Invert/Lock toggles. The SAME menu markup also
   renders as a floating popover (.ps-ctx) on a price-axis right-click. */
.ps-trigger{gap:0.25rem;min-width:auto;padding:0 0.375rem;}
.ps-trigger > span{white-space:nowrap;text-transform:none;font-size:max(0.5625rem, var(--fs-floor));}
.ps-menu{min-width:10.5rem;}
.ps-sep{height:1px;margin:0.375rem 0;background:color-mix(in srgb, var(--text-primary) 6%, transparent);}
.ps-group{display:flex;flex-direction:column;}
.ps-row{
  display:flex;align-items:center;gap:0.5rem;width:100%;
  height:1.75rem;padding:0 0.5rem;
  border:none;border-radius:var(--radius-sm);
  background:transparent;color:var(--text-secondary);
  font-family:var(--font-mono);font-size:max(0.625rem, var(--fs-floor));font-weight:600;
  letter-spacing:0.02em;text-transform:none;text-align:left;
  cursor:pointer;white-space:nowrap;
  transition:background .12s var(--ease-out),color .12s var(--ease-out),box-shadow .12s var(--ease-out);
}
.ps-row + .ps-row{margin-top:0.0625rem;}
.ps-row .ps-check{display:inline-flex;align-items:center;justify-content:center;
  width:0.875rem;height:0.875rem;flex-shrink:0;color:var(--accent);opacity:0;}
.ps-row .ps-name{flex:1;}
.ps-row:hover{background:var(--bg-hover);color:var(--text-primary);}
.ps-row.active{color:var(--accent);}
.ps-row.active .ps-check{opacity:1;}
/* Floating axis-right-click popover: same panel, fixed-positioned. */
.ps-ctx{position:fixed;top:0;left:0;z-index:120;opacity:0;transform:translateY(-4px);
  pointer-events:none;transition:opacity .12s var(--ease-out),transform .14s var(--ease-out);}
.ps-ctx.open{opacity:1;transform:translateY(0);pointer-events:auto;}
.ps-ctx[hidden]{display:none;}

/* Bar Replay control bar — floats bottom-center of the price
   panel while replay is active. Glass panel on ink tokens; circular icon
   buttons; the speed menu drops UP (the bar sits at the chart bottom). */
.replay-bar{
  position:absolute;left:50%;bottom:1.25rem;transform:translateX(-50%);
  z-index:40;display:flex;align-items:center;gap:0.375rem;
  padding:0.3125rem 0.5rem;
  background:var(--bg-elevated);border-radius:calc(var(--radius) + 2px);
  box-shadow:var(--shadow-rail), inset 0 0 0 1px color-mix(in srgb, var(--text-primary) 6%, transparent);
}
.replay-bar[hidden]{display:none;}
.replay-bar .rp-tag{
  font-family:var(--font-mono);font-size:max(0.5rem, var(--fs-floor));font-weight:700;
  letter-spacing:normal;text-transform:none;color:var(--accent);
  padding-left:0.125rem;
}
.replay-bar .rp-date{
  font-family:var(--font-mono);font-size:max(0.5625rem, var(--fs-floor));font-weight:600;
  color:var(--text-secondary);min-width:4.25rem;text-align:center;
  letter-spacing:0.02em;
}
.rp-btn{
  display:inline-flex;align-items:center;justify-content:center;
  width:1.625rem;height:1.625rem;min-width:var(--ctl-floor);min-height:var(--ctl-floor);padding:0;
  border:none;border-radius:50%;
  background:var(--bg-tertiary);color:var(--text-secondary);
  cursor:pointer;
  transition:background .12s var(--ease-out),color .12s var(--ease-out),box-shadow .12s var(--ease-out);
}
.rp-btn:hover{background:var(--bg-hover);color:var(--text-primary);}
.rp-btn svg{display:block;}
.rp-play{background:var(--accent);color:var(--on-accent);}
.rp-play:hover{background:var(--accent);color:var(--on-accent);box-shadow:0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);}
/* play/pause icon swap driven by .playing */
.rp-play .rp-ic-pause{display:none;}
.rp-play.playing .rp-ic-play{display:none;}
.rp-play.playing .rp-ic-pause{display:block;}
.rp-exit{width:1.5rem;height:1.5rem;min-width:var(--ctl-floor);min-height:var(--ctl-floor);}
.rp-exit:hover{color:var(--red);}
/* speed control — a compact pill that drops its menu UPWARD */
.rp-speed{position:relative;display:inline-flex;}
.rp-speed-trigger{
  width:auto;min-width:2rem;height:1.625rem;min-height:var(--ctl-floor);padding:0 0.4375rem;border-radius:var(--radius-sm);
  font-family:var(--font-mono);font-size:max(0.625rem, var(--fs-floor));font-weight:700;letter-spacing:0.02em;
}
.rp-speed.open .rp-speed-trigger{color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent);}
.rp-speed-menu{
  position:absolute;left:50%;transform:translateX(-50%) translateY(4px);
  bottom:calc(100% + 0.375rem);top:auto;
  display:flex;flex-direction:column;gap:0.125rem;min-width:3rem;padding:0.3125rem;
  opacity:0;pointer-events:none;
  transition:opacity .14s var(--ease-out),transform .14s var(--ease-out);
}
.rp-speed.open .rp-speed-menu{opacity:1;transform:translateX(-50%) translateY(0);pointer-events:auto;}
.rp-speed-menu[hidden]{display:none;}
.rp-spd{
  height:1.625rem;min-height:var(--ctl-floor);padding:0 0.5rem;border:none;border-radius:var(--radius-sm);
  background:transparent;color:var(--text-secondary);
  font-family:var(--font-mono);font-size:max(0.625rem, var(--fs-floor));font-weight:700;letter-spacing:0.02em;
  cursor:pointer;text-align:center;
  transition:background .12s var(--ease-out),color .12s var(--ease-out),box-shadow .12s var(--ease-out);
}
.rp-spd:hover{background:var(--bg-hover);color:var(--text-primary);}
.rp-spd.active{color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent);}

/* Timezone select — borderless, inline. Just text + a 14px chevron
   on a transparent surface. Hover lightens the bg subtly. NO box.
   Distinct from the Price trigger (which is a full-height magnetic
   block) and from every other toolbar button (which use icons or
   short labels). */
/* Original .tz-select look — preserved exactly for the new
   .tz-trigger button so the user-visible button shape is unchanged. */
.tz-select{
  margin-left:0.25rem;
  padding:0 1.5rem 0 0.5rem;
  height:1.375rem;min-height:var(--ctl-floor);line-height:1.375rem;
  border:none;border-radius:var(--radius-sm);
  background-color:transparent;
  color:var(--text-muted);
  font-family:var(--font-sans);font-size:max(0.6875rem, var(--fs-floor));font-weight:600;
  cursor:pointer;outline:none;
  appearance:none;-webkit-appearance:none;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='none' stroke='%236b7c93' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><polyline points='4,6 8,10 12,6'/></svg>");
  background-repeat:no-repeat;
  background-position:right 6px center;
  background-size:12px 12px;
  transition:background-color .14s var(--ease-out),color .14s var(--ease-out);
}
.tz-select:hover,.tz-select:focus,
.tz-trigger[aria-expanded="true"]{background-color:var(--bg-tertiary);color:var(--text-primary);}

.tz-dropdown{position:relative;display:inline-flex;align-items:center;}
.tz-select-hidden{
  position:absolute;width:1px;height:1px;
  opacity:0;pointer-events:none;
  border:0;padding:0;margin:0;
  clip:rect(0 0 0 0);overflow:hidden;
}
.tz-trigger{
  display:inline-flex;align-items:center;
  text-align:left;
}
.tz-trigger > span{
  display:inline-block;
  white-space:nowrap;
}

.tz-menu{
  position:absolute;
  /* Open DOWNWARD onto the chart. The toolbar now lives on the top header
     row, so the old bottom:100% (open upward) ran off the top of the page. */
  top:calc(100% + 0.25rem);
  right:0;
  min-width:11.25rem;
  padding:0.25rem;
  border:1px solid var(--border-default);
  border-radius:var(--radius);
  background:var(--bg-elevated);
  overflow:hidden;
  z-index:60;
  box-shadow:var(--shadow-rail);
  opacity:0;
  transform:translateY(-6px);
  transform-origin:top right;
  pointer-events:none;
  transition:
    opacity .22s var(--ease-out),
    transform .26s var(--ease-out);
}
.tz-menu[hidden]{display:none;}
.tz-dropdown.open .tz-menu{
  opacity:1;
  transform:translateY(0);
  pointer-events:auto;
}
.tz-opt{
  position:relative;
  display:block;width:100%;
  height:1.875rem;line-height:1.875rem;
  padding:0 0.75rem;
  border:0;border-radius:var(--radius-sm);
  background:transparent;
  color:var(--text-secondary);
  font-family:var(--font-sans);font-size:0.8125rem;font-weight:500;
  text-align:left;cursor:pointer;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  transition:background .14s var(--ease-out),color .14s var(--ease-out);
}
.tz-opt:hover{background:var(--bg-hover);color:var(--text-primary);}
.tz-opt.active{color:var(--accent);}

