/* ═══════════════════════════════════════════════════════════
   MOBILE
═══════════════════════════════════════════════════════════ */
@media(max-width:640px){
  :root{--sidebar-w:180px;}
  body{height:auto;min-height:100vh;overflow:auto;}
  .main{height:auto;min-height:100vh;overflow:auto;}
  .charts{min-height:65vh;}
  /* Collapse the floating cluster to chips: the dropdown drops its
     label (icon + caret), the Graphs trigger drops its label (icon
     chip only). The 8.5rem padding reserves the compact lane. */
  .view-trigger{min-width:0;}
  .view-trigger-label{display:none;}
  .view-menu{min-width:17.5rem;max-width:calc(100vw - 2rem);}
  .hdr-graphs-btn{padding:0 0.75rem;}
  .hdr-graphs-label{display:none;}
  .hdr-trade-btn{padding:0 0.75rem;}
  .hdr-trade-label{display:none;}
  /* Wrap instead of clip: symbol+price on line 1, the day-change pill
     drops below when it can't fit beside them — nothing slides under
     the floating cluster. */
  .hdr{padding:0.375rem 8.5rem 0.375rem 16px;gap:4px 10px;flex-wrap:wrap;height:auto;min-height:3rem;align-content:center;}
  .sent-bar{padding:0 16px;gap:8px;flex-wrap:wrap;height:auto;padding:6px 16px;}
  .time-controls{padding:8px 16px;}
}

/* ── Chart resizer: drag handle between the price panel and the graphs.
   Dragging it sizes the price pane (--price-h on .charts.price-sized, see
   below; app.js "Price ⇆ graphs divider"): down grows the price and the
   graphs scroll, up squeezes the price to a thin strip and the graphs grow.
   TradingView-style seam: ZERO own height — even 1px here reads as a
   black sliver separating the volume bars from the pane border. The
   visible divider is the first pane's 1px border-top, which the bars
   now sit directly on. ::before is the invisible grab zone; ::after
   paints a 1px teal line over the border on hover/drag. */
.chart-resizer{
  flex:0 0 0;
  position:relative;
  cursor:ns-resize;
  z-index:9;
}
.chart-resizer::before{
  content:'';
  position:absolute;left:0;right:0;
  top:-0.25rem;height:0.5rem;
  cursor:ns-resize;
}
.chart-resizer::after{
  content:'';
  position:absolute;left:0;right:0;top:0;height:1px;
  /* Persistent price↔graphs divider. The resizer lives OUTSIDE
     .charts-scroll, so this line stays pinned at the boundary even when the
     graphs scroll — otherwise the only divider was the first pane's
     border-top, which scrolls up out of view. Uses --border-default (the
     app's standard divider) rather than the faint --border-pane seam so the
     price/graphs split reads clearly, a step above the subtle inter-pane
     seams — you can always tell where the border is, scrolled or not. */
  background:var(--border-default);
  transition:background .15s ease;
  pointer-events:none;
}
.chart-resizer:hover::after,
.chart-resizer.dragging::after{background:var(--accent);}
/* While dragging, force the resize cursor everywhere + kill text selection. */
body.chart-resizing,body.chart-resizing *{cursor:ns-resize!important;user-select:none!important;}

/* ── Price sized by the divider (owner 2026-10-05: squeeze the price chart
   as far as you like). The price takes exactly --price-h, floored at 32px
   (PRICE_MIN_PX in app.js: the price scale keeps a label, LightweightCharts
   keeps a real canvas); the graph wrapper takes the rest. Graph panes keep
   their natural height as a BASIS and never shrink below it (the wrapper
   scrolls instead), but GROW to share any extra height, so squeezing the
   price hands the space to the indicator panes. #indicatorPanes dissolves
   (display:contents, like .price-collapsed) so its panes share it too.
   :has() applies the mode only while a graph is showing: with every pane
   off the price falls back to filling the chart, no empty gap below it. */
.charts.price-sized:not(.price-collapsed):has(#indicatorPanes > .indicator-pane, #charts-scroll > .cp:not(.cp-modal-hidden):not(.perm-hidden), #utk-band:not([hidden])) #cp-price{
  flex:0 0 var(--price-h);
  min-height:32px;
}
.charts.price-sized:not(.price-collapsed):has(#indicatorPanes > .indicator-pane, #charts-scroll > .cp:not(.cp-modal-hidden):not(.perm-hidden), #utk-band:not([hidden])) .charts-scroll{
  flex:1 1 0;
  min-height:0;
}
.charts.price-sized:not(.price-collapsed):has(#indicatorPanes > .indicator-pane, #charts-scroll > .cp:not(.cp-modal-hidden):not(.perm-hidden), #utk-band:not([hidden])) #indicatorPanes{
  display:contents;
}
.charts.price-sized:not(.price-collapsed):has(#indicatorPanes > .indicator-pane, #charts-scroll > .cp:not(.cp-modal-hidden):not(.perm-hidden), #utk-band:not([hidden])) #indicatorPanes > .indicator-pane,
.charts.price-sized:not(.price-collapsed):has(#indicatorPanes > .indicator-pane, #charts-scroll > .cp:not(.cp-modal-hidden):not(.perm-hidden), #utk-band:not([hidden])) .charts-scroll > .cp:not(.cp-collapsed){
  flex-grow:1;
  flex-shrink:0;
}
/* A strip under 80px (.price-thin, set by the drag) drops the OHLC legend,
   which would otherwise overlap the Price label and the strip's own line. */
.charts.price-sized.price-thin:not(.price-collapsed):has(#indicatorPanes > .indicator-pane, #charts-scroll > .cp:not(.cp-modal-hidden):not(.perm-hidden), #utk-band:not([hidden])) .chart-legend{
  display:none;
}

/* ── Collapsed price panel: sentiment graphs own the whole canvas (the
   retired "Signals" page, now an in-page fold — e.g. for a second
   monitor). The price LightweightCharts instance stays alive — the graph
   canvases read their X-axis from its time scale — so it's parked
   off-screen with a real size (visibility:hidden keeps layout) rather
   than display:none. ── */
.charts.price-collapsed{position:relative;}
.charts.price-collapsed #cp-price{
  position:absolute;top:0;left:0;
  width:100%;height:20rem;
  visibility:hidden;pointer-events:none;
}
.charts.price-collapsed #chart-resizer{display:none!important;}
/* The collapsed state keeps the symbol header + stat strip (the floating
   view dropdown lives over the header exactly like the expanded chart);
   the "Graphs" trigger rides along in .time-controls. */
.charts.price-collapsed .charts-scroll{
  flex:1 1 auto;
}
/* Every visible graph stretches to share the whole canvas — this state is
   their dedicated space. Collapsed dot panels stay folded (excluded). */
.charts.price-collapsed .charts-scroll > .cp:not(.cp-collapsed){
  flex:1 1 0;
  min-height:4.375rem;
}
/* Technical indicators (RSI/MACD/…) live in a FIXED-height #indicatorPanes
   wrapper (flex:0 0 auto, 12.5rem/pane). Left alone it would keep that
   fixed height when the price collapses and leave dead space below when no
   sentiment/tape .cp panes are present. Dissolve the wrapper with
   display:contents so each indicator pane becomes a direct flex sibling and
   shares the freed height equally with the other graphs. Each pane's own
   ResizeObserver (IndicatorRender.addPane) refits its canvas on the change. */
.charts.price-collapsed #indicatorPanes{ display:contents; }
.charts.price-collapsed #indicatorPanes > .indicator-pane{
  flex:1 1 0;
  height:auto;
  min-height:4.375rem;
}

/* Restore strip — the collapsed price panel's only visible trace, a thin
   TradingView-style pane header that expands it back. Hidden unless the
   charts wrapper carries .price-collapsed. */
.price-restore-strip{
  display:none;
  flex:0 0 1.75rem;height:1.75rem;width:100%;
  align-items:center;gap:0.5rem;
  padding:0 0.75rem;
  background:color-mix(in srgb, var(--text-primary) 2%, transparent);
  border:none;
  border-bottom:1px solid color-mix(in srgb, var(--text-primary) 6%, transparent);
  border-radius:0;cursor:pointer;
  font-family:var(--font-sans);
  color:var(--text-secondary);
  transition:background .18s ease,color .18s ease;
}
.charts.price-collapsed .price-restore-strip{display:flex;}
.price-restore-strip .prs-label{
  font-size:max(0.625rem, var(--fs-floor));font-weight:700;
  text-transform:none;letter-spacing:normal;
}
.price-restore-strip .prs-hint{
  font-size:max(0.625rem, var(--fs-floor));font-weight:500;color:var(--text-muted);
  letter-spacing:.02em;
}
.price-restore-strip svg{margin-left:auto;transition:transform .18s ease;}
.price-restore-strip:hover{background:color-mix(in srgb, var(--accent) 6%, transparent);color:var(--accent);}
.price-restore-strip:hover svg{transform:translateY(1px);}

/* The price panel's own collapse toggle sits clear of the price-scale
   axis (the topmost scale label renders under right:0), with a dark
   backdrop so chart ink never bleeds through the label. */
/* Match the sentiment panes' "Tweet Scores" toggle exactly: transparent
   (no filled box), a single left-border tab, and its right edge flush on
   the price-scale separator. --pane-axis-w is synced onto #cp-price in JS
   (_syncPriceAxisW) = the price-scale column width; the 3.75rem fallback
   covers the first frame before it is measured. */
.cp-price-collapse{
  right:var(--pane-axis-w, 3.75rem);
}

/* ── Live Lock ───────────────────────────────────────────
   Toolbar padlock: open icon when free, closed icon + accent when
   locked. The .active state reuses the shared toolbar underline. */
#btn-livelock .ll-locked{display:none;}
#btn-livelock.active .ll-locked{display:block;}
#btn-livelock.active .ll-open{display:none;}

/* Small auto-dismissing nudge when a locked chart is grabbed. Centered
   over the chart canvas.

   SURFACE: the toast and the hover panel below are the same feature's
   chrome, so they wear one surface — opaque --bg-elevated, one real 1px
   border, --radius, --shadow-rail. Only the border colour differs: the
   toast rings itself in accent because it is an alert, and the accent
   icon chip carries the rest of that identity. It used to be glass like
   the panel (--bg-secondary at 92% behind a 10px blur) with an ink wash
   down the top 60% and an accent radial out of the top-left corner; both
   washes are gone, since a directional sheen is the one thing no other
   surface on this page does. */
.lock-toast{
  position:fixed;top:8.5rem;left:50%;
  transform:translate(-50%,-8px) scale(.97);
  z-index:1100;
  display:flex;align-items:center;gap:0.625rem;
  max-width:24rem;
  padding:0.625rem 1rem 0.625rem 0.75rem;
  background:var(--bg-elevated);
  border:1px solid color-mix(in srgb, var(--accent) 45%, var(--border-default));
  border-radius:var(--radius);
  box-shadow:var(--shadow-rail);
  font-family:var(--font-sans);font-size:max(0.6875rem, var(--fs-floor));font-weight:500;
  letter-spacing:.01em;line-height:1.45;color:var(--text-muted);
  opacity:0;pointer-events:none;
  transition:opacity .22s ease,transform .22s ease;
}
.lock-toast.show{opacity:1;transform:translate(-50%,0) scale(1);}
.lock-toast .lt-icon{
  flex:none;display:flex;align-items:center;justify-content:center;
  width:1.875rem;height:1.875rem;border-radius:0.5rem;
  color:var(--accent);
  background:color-mix(in srgb, var(--accent) 10%, transparent);
  box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
}
.lock-toast .lt-title{
  display:block;font-weight:700;font-size:max(0.6875rem, var(--fs-floor));
  letter-spacing:normal;text-transform:none;
  color:var(--text-secondary);margin-bottom:1px;
}

/* ── Lock hover panel: visible-window slider + apply. Opens under the
   padlock on hover/focus so multi-monitor charts can be pushed onto
   one shared zoom.

   SURFACE: this is a toolbar dropdown, so it wears the toolbar dropdown
   contract verbatim — the same one .iv-menu (interval / chart type /
   events / scale / session) and .tz-menu use, and those two are literally
   the buttons either side of the padlock. Opaque --bg-elevated, one real
   1px --border-default, --radius, --shadow-rail, no blur and no gradient.
   It used to be a glass card: --bg-secondary at 96% behind a 12px backdrop
   blur, with an ink wash fading out over the top 3rem. That wash made it
   the only non-flat surface in the toolbar — its interior measured a
   top-to-bottom luminance ramp where every peer measures exactly zero —
   and because --text-primary flips with the theme, the one rule sloped
   two different ways: it LIGHTENED the top on dark and DARKENED it on
   cream. --bg-secondary is a recessed token besides, so on cream the
   panel sat ~15 luminance darker than the peers it drops next to. */
.lock-wrap{position:relative;display:inline-flex;}
.lock-panel{
  position:absolute;top:100%;right:-1rem;margin-top:0.5rem;
  width:13.5rem;padding:0.75rem 0.875rem 0.875rem;
  background:var(--bg-elevated);
  border:1px solid var(--border-default);
  border-radius:var(--radius);
  box-shadow:var(--shadow-rail);
  z-index:600;
  opacity:0;pointer-events:none;
  transform:translateY(-4px) scale(.98);transform-origin:top right;
  transition:opacity .18s ease,transform .18s ease;
}
.lock-wrap:hover .lock-panel,
.lock-wrap:focus-within .lock-panel{
  opacity:1;pointer-events:auto;transform:none;
}
.lp-head{
  display:flex;align-items:baseline;justify-content:space-between;
  margin-bottom:0.5rem;
}
.lp-title{
  font-family:var(--font-sans);font-size:max(0.5625rem, var(--fs-floor));font-weight:700;
  letter-spacing:normal;text-transform:none;color:var(--text-muted);
}
.lp-value{
  font-family:var(--font-mono);font-size:max(0.6875rem, var(--fs-floor));font-weight:700;
  color:var(--accent);
}
.lp-slider{width:100%;margin:0 0 0.5rem;}
.lp-hint{
  font-family:var(--font-sans);font-size:max(0.5625rem, var(--fs-floor));font-weight:500;
  letter-spacing:.03em;color:var(--text-muted);text-align:center;
}

/* ── Focus (zen) mode: charts plus the padlock and focus buttons only.
   Built for a dedicated second monitor. */
#btn-fullscreen .fs-exit{display:none;}
body.chart-zen #btn-fullscreen .fs-exit{display:block;}
body.chart-zen #btn-fullscreen .fs-enter{display:none;}
body.chart-zen .sidebar,
body.chart-zen .hdr,
body.chart-zen .grok-badge,
body.chart-zen .advisor-badge,
body.chart-zen .trade-rail,
body.chart-zen .trade-overlay{display:none!important;}
/* mergeHeaderToolbar (app.js) re-parents #time-controls INTO .top-cluster,
   so the cluster must stay alive in zen — hiding it (as this block did
   when the toolbar still lived in .sent-bar) took the Esc/exit pill with
   it and left zen with NO visible way out. Hide the cluster's other
   children instead; rules below keep only padlock + exit inside the
   toolbar. */
body.chart-zen .top-cluster > :not(.time-controls){display:none!important;}
/* The sidebar is a fixed rail; .main reserves its width with a left
   margin that must go too, or zen leaves an empty strip on the left. */
body.chart-zen .main{margin-left:0!important;}
body.chart-zen .time-controls > *:not(.lock-wrap):not(#btn-fullscreen){display:none!important;}
/* The toolbar shrinks to a small floating pill over the chart's
   top-right corner. The pill anchor is .top-cluster (the toolbar's
   post-merge parent); the old .sent-bar strip is retired
   (display:none, see Merged header above) and never shows in zen. */
body.chart-zen .top-cluster{
  position:fixed;top:0.5rem;right:0.75rem;left:auto;
  z-index:500;height:auto;padding:0;
  background:transparent;border:none;box-shadow:none;
}
body.chart-zen .time-controls{
  margin:0;padding:0.25rem 0.375rem;
  background:color-mix(in srgb, var(--bg-secondary) 85%, transparent);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  border-radius:0.5rem;
  box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--text-primary) 8%, transparent),var(--shadow-pop);
}

/* ── Modify-graphs modal ─────────────────────────────────
   Full-page overlay with backdrop blur on everything behind it,
   centered card with one checkbox row per lower panel. */
.gtb-modal{
  position:fixed;inset:0;z-index:1000;
  display:flex;align-items:center;justify-content:center;
  background:color-mix(in srgb, var(--bg-primary) 62%, transparent);
  backdrop-filter:blur(10px) saturate(1.1);
  -webkit-backdrop-filter:blur(10px) saturate(1.1);
  animation:gtb-fade .2s ease;
}
.gtb-modal.hidden{display:none!important;}
@keyframes gtb-fade{from{opacity:0;}to{opacity:1;}}
.gtb-modal-card{
  min-width:21.25rem;max-width:27.5rem;
  background:linear-gradient(180deg,color-mix(in srgb, var(--text-primary) 2.5%, transparent),transparent 4rem),var(--bg-elevated,var(--bg-elevated));
  border:none;
  border-radius:var(--radius-md,0.375rem);
  padding:1.125rem 1.25rem 0.875rem;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--text-primary) 7%, transparent),
    inset 0 1px 0 0 color-mix(in srgb, var(--text-primary) 5%, transparent),
    var(--shadow-pop),
    var(--shadow-modal);
  animation:gtb-rise .26s cubic-bezier(.22,1,.36,1);
}
@keyframes gtb-rise{
  from{opacity:0;transform:translateY(10px) scale(.975);}
  to{opacity:1;transform:translateY(0) scale(1);}
}
@media (prefers-reduced-motion: reduce){
  .gtb-modal{animation:none;}
  .gtb-modal-card{animation:none;}
}
.gtb-modal-head{
  display:flex;align-items:center;justify-content:space-between;
  font-size:0.75rem;font-weight:700;color:var(--text-primary);
  text-transform:none;letter-spacing:normal;
  padding-bottom:0.625rem;margin-bottom:0.5rem;
  border-bottom:1px solid color-mix(in srgb, var(--text-primary) 5%, transparent);
}
/* 19.7 x 19.7 CSS px at a 1440 root — under the 24px pointer floor, and the
   only way out of this modal with a mouse. Floored sub-reference (its 1.4rem
   line box is 30.8px at 3072, i.e. already over the floor there, but the token
   makes that provable instead of arithmetic somebody has to redo). */
.gtb-close{
  min-width:var(--ctl-floor-sub);min-height:var(--ctl-floor-sub);
  background:transparent;border:none;color:var(--text-muted);
  font-size:1.4rem;line-height:1;cursor:pointer;padding:0 0.375rem;
  transition:color .15s ease;
}
/* Layout mode below the reference only — see the note on .si-rm in
   03-sources.css. */
@media (max-width:2907.98px){
  .gtb-close{display:inline-flex;align-items:center;justify-content:center;}
}
.gtb-close:hover{color:var(--text-primary);}
.gtb-modal-body{
  display:flex;flex-direction:column;gap:2px;
  max-height:60vh;overflow-y:auto;
}

