/* ── Graphs panel as a LEFT DOCKED DRAWER (no blur) ───────────────────
   Scoped to #gtb-modal ONLY — the shared .gtb-modal class still drives the
   centered-blur look for #settings-modal. Clones the retired ss-panel
   geometry: slides via transform (no width animation → no chart redraw
   jank); the chart is pushed by snapping .main's left padding. */
#gtb-modal.gtb-drawer{
  /* Docks flush against the sidebar (rail-w), IN FRONT of the drawing-tools
     column: opening the drawer pushes #chart-rail forward to the drawer's
     right edge (see body.gtb-open #chart-rail) so the order reads
     sidebar → drawer → drawing rail → chart, never drawer-behind-rail. */
  position:fixed;inset:auto;left:var(--rail-w);top:0;bottom:0;width:var(--ss-w);
  /* FULL-HEIGHT (top:0) so the drawer covers the whole left column like the
     sidebar — no gap at the top, right edge is one continuous line. Its
     title sits flush at the TOP (padding:0 on the card, see below) so the
     panel name starts at the very top, not below the header. z-index sits
     ABOVE the header command cluster (.top-cluster, absolutely positioned,
     z50) so the drawer's opaque card covers the toolbar within its own
     column instead of colliding with it. */
  z-index:55;display:block;align-items:initial;justify-content:initial;
  background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none;
  animation:none;
  /* Closed = fully left of the viewport. -100% (its own width) alone is NOT
     enough: this box's static `left` is not always 0 — the sb-open rule below
     sets left:var(--sidebar-w), so a plain -100% only tucks the right edge
     back to `left - width`, which lands at `sidebar-w - width`, still inside
     the viewport whenever sidebar-w < width (measured: left -89.98px,
     right 191.53px at a 1440px window with the sidebar expanded — a ~190px
     slice sitting on screen, QA 2026-09, sidebar link collision writeup).
     It happened to render harmlessly there only because the sidebar itself
     (z-index 56, above this drawer's 55) is opaque and exactly as wide,
     painting over the slice, and this box keeps pointer-events:none — but
     that is two coincidences doing the work of one CSS rule, and neither
     holds at every width/state (e.g. mid toggle, or if the two ever drift).
     Subtracting var(--sidebar-w) as well guarantees the right edge lands at
     `left - width - sidebar-w`, which is <= -width regardless of which of
     rail-w/sidebar-w supplied the static `left` (sidebar-w is always the
     larger of the two) — i.e. always negative, so the box is provably fully
     off-canvas, not merely covered by something else. */
  transform:translateX(calc(-100% - var(--sidebar-w) - 4px));
  transition:transform .22s var(--ease-glide),left .34s var(--ease-glide) .1s;
  pointer-events:none;
}
#gtb-modal.gtb-drawer.open{transform:translateX(0);pointer-events:auto;}
/* Safety net: the drawer belongs to the chart view ONLY. setView() closes it
   on a per-stock view switch, but jumping to the command center is a separate
   path that can leave body.gtb-open lingering — which (now the drawer is
   full-height) would cover the board. Force it hidden on ANY no-charts view,
   mirroring the Key Stats dock's `body.no-charts .ksd-panel{width:0}` rule. */
body.no-charts #gtb-modal.gtb-drawer{ transform:translateX(calc(-100% - var(--sidebar-w) - 4px))!important; pointer-events:none; box-shadow:none; }
/* Zen hides the sidebar, exposing the drawer's 61px protrusion (its closed
   translateX(-101%) is relative to its own width, but its static left is
   var(--rail-w), so the right edge normally hides UNDER the rail). Hide it
   fully in zen, and drop the chart push in case it was open. */
body.chart-zen #gtb-modal.gtb-drawer{ transform:translateX(calc(-100% - var(--sidebar-w) - 4px))!important; pointer-events:none; box-shadow:none; visibility:hidden; }
body.chart-zen .charts{margin-left:0!important;}
/* Dock against the sidebar's CURRENT edge so the two never overlap when the
   sidebar is expanded (mirrors .main's margin-left; --left transition too). */
:root.sb-open #gtb-modal.gtb-drawer{left:var(--sidebar-w);}
@media(max-width:900px){ :root.sb-open #gtb-modal.gtb-drawer{left:var(--rail-w);} }
/* NO chart push at all — the drawer is a pure overlay and the chart never
   moves. Every push variant was tried and rejected: lockstep margin glide
   (0718/0724) made the canvases "pull" toward the drawer via per-frame LWC
   refits; the covered-strip snap (0723/0724) jumped the uncovered chart in
   one frame. The sanctioned model is the context-menu "Add indicator" path
   (which always opened the drawer as an overlay) and the Key Stats sheet:
   the opaque card simply covers the chart's left strip while open
   (owner 2026-07-24). Only #chart-rail rides (below) so the drawing tools
   stay in front of the drawer instead of underneath it.

   margin-right NO LONGER TRANSITIONS (2026-07-25). The old comment here
   claimed the right edge "only moves the price axis, not the content, so its
   glide is calm". Measured: false. Narrowing the chart by N px translates
   EVERY candle left by exactly N px (probe: 266.5px width change → -268px on
   every timeToCoordinate, barSpacing unchanged), and it did so by re-laying
   out the block and re-rendering all 7 LWC canvases + 6 pane canvases on
   EVERY animation frame — 20 LWC canvas resizes, 30 pane paints and ~65
   layouts per 220ms toggle, which the main thread could only deliver 5-7
   times. The drawer beside it slides on a composited transform at full
   refresh rate, so the chart lurched up to 185px per frame while the panel
   glided: the "not synced / not smooth" report.
   The reservation now SNAPS (one layout, one resize) and the visual glide is
   done by a composited translate on the axis-anchored layers — see the
   "Composited dock glide" block in 14-chart-extras.css + js/chart/dock-glide.js. */
/* Push the drawing-tools column (absolute in .main, normally at left:0) out to
   the drawer's right edge so it rides IN FRONT of the drawer, not behind it.
   Same curve as the .charts margin above so both edges move with the drawer. */
body:not(.chart-zen) #chart-rail{transition:left .22s var(--ease-glide);}
body.gtb-open #chart-rail{left:var(--ss-w);}
#gtb-modal.gtb-drawer .gtb-modal-card{
  min-width:0;max-width:none;width:100%;height:100%;box-sizing:border-box;
  /* No top padding: the title sits flush at the very top of the viewport and
     the opaque card bg fills the full height, top to bottom. */
  border-radius:0;padding:0;
  display:flex;flex-direction:column;
  background:var(--bg-secondary);
  /* Crisp divider on BOTH sides so the drawer reads as its own column: the
     right edge (drawer↔chart) already had one; the left edge (sidebar↔drawer)
     matches the Key Stats↔Trade line (1px var(--border-default)) — the
     sidebar's own border there is only 5% and too faint to separate them. */
  border-left:1px solid var(--border-default);
  border-right:1px solid var(--border-default);
  /* No shadow by default: the CLOSED drawer sits just off-screen left and an
     8px/24px drop shadow bled ~24px past its edge into view (a grey smudge on
     the drawing rail in light mode, esp. with the sidebar collapsed). The 1px
     border dividers define the edge; a soft shadow returns only when OPEN and
     only in dark mode (below), matching the "no cast shadows in light" rule
     already applied to the sidebar seam. */
  box-shadow:none;
  animation:none;
}
:root[data-theme="dark"] #gtb-modal.gtb-drawer.open .gtb-modal-card{
  box-shadow:6px 0 20px color-mix(in srgb, var(--shadow-ink) 35%, transparent);
}
#gtb-modal.gtb-drawer .gtb-modal-head{
  padding:0.875rem 1rem 0.75rem;margin-bottom:0;
  border-bottom:1px solid var(--border-default);
}
#gtb-modal.gtb-drawer .gtb-modal-body{
  flex:1;max-height:none;overflow-y:auto;
  padding:0.5rem 0.75rem 1.5rem;
}
@media (prefers-reduced-motion: reduce){
  #gtb-modal.gtb-drawer{transition:none;}
  /* Whole toggle snaps — drawer AND the rail ride it drives. */
  .charts,#chart-rail{transition:none;}
}
/* The data-graph rows have a gear but no param-summary before it, so push it
   to the row's right edge (indicator rows get that from .gtb-sum). */
.gtb-row-gearable .gtb-gear{margin-left:auto;}

/* "Technical Indicators" section divider inside the Modify-graphs modal */
.gtb-section{
  font-size:max(0.625rem, var(--fs-floor));font-weight:700;color:var(--text-muted);
  text-transform:none;letter-spacing:normal;
  margin-top:0.75rem;padding:0.5rem 0.375rem 0.25rem;
  border-top:1px solid color-mix(in srgb, var(--text-primary) 5%, transparent);
}
/* Indicator search — filters the rows below live (IndicatorMenu.render).
   Same visual family as .gtb-set-input: bg-primary + inset border ring,
   mono type, accent focus. Sits between the section header and the rows. */
.gtb-ind-search{
  display:block;width:calc(100% - 0.75rem);
  margin:0.25rem 0.375rem 0.125rem;
  padding:0.3125rem 0.5rem;border-radius:0.1875rem;
  border:none;background:var(--bg-primary);
  box-shadow:inset 0 0 0 1px var(--border-default);
  color:var(--text-primary);font-family:var(--font-mono);font-size:0.6875rem;
  transition:box-shadow .18s ease;
}
.gtb-ind-search::placeholder{color:var(--text-muted);}
.gtb-ind-search:focus{
  outline:none;
  box-shadow:inset 0 0 0 1px var(--accent);
}
.gtb-ind-search::-webkit-search-cancel-button{-webkit-appearance:none;}
/* empty-state row when the search matches nothing */
.gtb-ind-none{
  font-size:0.6875rem;color:var(--text-muted);
  padding:0.5rem 0.375rem;
}
/* ── "My Indicators" (user-defined formulas, Knight+) ──
   Rows reuse .gtb-row/.gtb-gear; only the editor's extras live here. */
.gtb-mine-new{
  display:block;width:calc(100% - 0.75rem);
  margin:0.125rem 0.375rem 0.25rem;
  padding:0.3125rem 0.5rem;border-radius:0.1875rem;
  border:none;background:transparent;
  box-shadow:inset 0 0 0 1px var(--border-default);
  color:var(--text-secondary);font-size:0.6875rem;font-weight:600;
  text-align:left;cursor:pointer;
  transition:box-shadow .18s ease,color .18s ease;
}
.gtb-mine-new:hover{
  color:var(--accent);
  box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
}
.gtb-mine-name{width:9.5rem;text-align:left;}
/* formula textarea gets the row's full width under its label */
.gtb-formula-row{flex-wrap:wrap;cursor:default;}
.gtb-formula{
  flex:1 1 100%;min-height:2.25rem;resize:vertical;
  padding:0.3125rem 0.4375rem;border-radius:0.1875rem;
  border:none;background:var(--bg-primary);
  box-shadow:inset 0 0 0 1px var(--border-default);
  color:var(--text-primary);font-family:var(--font-mono);font-size:0.6875rem;
  line-height:1.4;
  transition:box-shadow .18s ease;
}
.gtb-formula:focus{
  outline:none;
  box-shadow:inset 0 0 0 1px var(--accent);
}
/* server-side validation message, inline under the fields */
.gtb-mine-err{
  font-size:0.6875rem;line-height:1.35;color:var(--red);
  padding:0 0.375rem 0.25rem;
}
/* per-category sub-header (momentum / overlay / volatility / volume) */
.gtb-cat{
  font-size:max(0.5625rem, var(--fs-floor));font-weight:700;color:var(--text-muted);
  text-transform:none;letter-spacing:normal;
  opacity:.55;padding:0.4375rem 0.375rem 2px;
}
.gtb-row{
  display:flex;align-items:center;gap:0.625rem;
  padding:0.4375rem 0.375rem;border-radius:0.1875rem;cursor:pointer;
  font-size:0.8125rem;color:var(--text-primary);
  transition:background .15s ease;
}
.gtb-row:hover{background:var(--bg-row-hover);}
.gtb-row input[type=checkbox]{
  accent-color:var(--accent);
  width:0.875rem;height:0.875rem;cursor:pointer;flex-shrink:0;
}
/* sentiment-behavior hint: a short muted explainer under a section head */
.gtb-hint{
  font-size:max(0.6875rem, var(--fs-floor));line-height:1.35;color:var(--text-muted);
  padding:0 0.375rem 0.375rem;
}
/* slider rows in the modal: label, mono readout, then a range filling the row */
.gtb-slider-row{cursor:default;}
.gtb-slider-val{
  margin-left:auto;flex-shrink:0;min-width:2.75rem;text-align:right;
  font-family:var(--font-mono);font-size:max(0.6875rem, var(--fs-floor));letter-spacing:.02em;
  color:var(--text-secondary);
}
.gtb-range{
  flex:0 0 9rem;height:0.25rem;border-radius:0.25rem;cursor:pointer;
  -webkit-appearance:none;appearance:none;
  background:var(--bg-tertiary);outline:none;
}
.gtb-range:hover{background:var(--border-default);}
.gtb-range::-webkit-slider-thumb{
  -webkit-appearance:none;appearance:none;
  width:0.875rem;height:0.875rem;border-radius:50%;cursor:pointer;
  background:var(--accent);transition:transform .1s ease;
}
.gtb-range::-webkit-slider-thumb:hover{transform:scale(1.15);}
.gtb-range::-moz-range-thumb{
  width:0.875rem;height:0.875rem;border:none;border-radius:50%;cursor:pointer;
  background:var(--accent);
}

/* Right-edge padding on the two sentiment rows of the "Modify graphs" list
   (Stocktwits + News). The inline gear that used to sit here, and the
   sentiment-line drawer it opened, were retired; the padding stays because
   the rows still read as a pair against the rest of the list. */
.gtb-row-gearable{padding-right:0.1875rem;}
/* Inline story-grouping sliders in the News Graph control bar — compact
   Link / Memory knobs sitting beside the Sort / Updates pills. Champagne
   label + mono value + a short range, sized to share the --ctl-h row. */
.ng-ctl{
  display:inline-flex;align-items:center;gap:0.4375rem;height:var(--ctl-h, 2.125rem);
  padding:0 0.75rem;border-radius:0.5rem;background:var(--bg-primary);
  box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--champagne) 35%, transparent),var(--shadow-pop);
}
.ng-ctl-lbl{
  font-family:var(--font-mono);font-size:max(0.625rem, var(--fs-floor));font-weight:700;
  letter-spacing:normal;text-transform:none;color:var(--champagne);
}
.ng-ctl-val{
  font-family:var(--font-mono);font-size:max(0.625rem, var(--fs-floor));letter-spacing:.02em;
  color:var(--text-secondary);min-width:2.25rem;text-align:right;
  font-variant-numeric:tabular-nums;
}
.ng-ctl-range{
  flex:0 0 4.5rem;height:0.25rem;border-radius:0.25rem;cursor:pointer;
  -webkit-appearance:none;appearance:none;background:color-mix(in srgb, var(--champagne) 22%, transparent);outline:none;
}
.ng-ctl-range::-webkit-slider-thumb{
  -webkit-appearance:none;appearance:none;width:0.8125rem;height:0.8125rem;
  border-radius:50%;cursor:pointer;background:var(--champagne);transition:transform .1s ease;
}
.ng-ctl-range::-webkit-slider-thumb:hover{transform:scale(1.15);}
.ng-ctl-range::-moz-range-thumb{
  width:0.8125rem;height:0.8125rem;border:none;border-radius:50%;
  cursor:pointer;background:var(--champagne);
}
.ng-ctl-range:focus-visible{box-shadow:inset 0 0 0 1px var(--champagne);}
/* resolution-picker rows: a label + a compact <select> pushed right */
.gtb-res-row{cursor:default;}
/* 22.25px tall at a 1440 root. A <select> is a real pointer target and this is
   the resolution picker, so it takes the sub-reference floor. */
.gtb-sel{
  margin-left:auto;flex-shrink:0;
  min-height:var(--ctl-floor-sub);
  background:color-mix(in srgb, var(--text-primary) 4%, transparent);color:var(--text-primary);
  border:1px solid color-mix(in srgb, var(--text-primary) 10%, transparent);border-radius:0.25rem;
  font-family:var(--font-mono);font-size:max(0.6875rem, var(--fs-floor));letter-spacing:.02em;
  padding:0.1875rem 0.375rem;cursor:pointer;
  transition:border-color .15s ease,background .15s ease;
}
.gtb-sel:hover{border-color:color-mix(in srgb, var(--text-primary) 22%, transparent);background:color-mix(in srgb, var(--text-primary) 6%, transparent);}
.gtb-sel:focus{outline:none;border-color:var(--accent);}
/* current param summary, pushed to the row's right edge: "14" / "12 · 26 · 9" */
.gtb-sum{
  margin-left:auto;font-family:var(--font-mono);font-size:max(0.625rem, var(--fs-floor));
  color:var(--text-muted);letter-spacing:.02em;white-space:nowrap;
}
.gtb-gear{
  display:flex;align-items:center;justify-content:center;
  width:1.375rem;height:1.375rem;min-width:var(--ctl-floor);min-height:var(--ctl-floor);flex-shrink:0;border:none;border-radius:0.1875rem;
  background:transparent;color:var(--text-muted);cursor:pointer;
  transition:color .15s ease,background .15s ease;
}
.gtb-gear svg{transition:transform .3s cubic-bezier(.22,1,.36,1);}
.gtb-gear:hover{color:var(--accent);background:color-mix(in srgb, var(--accent) 8%, transparent);}
.gtb-gear:hover svg{transform:rotate(30deg);}
.gtb-gear.open{color:var(--accent);background:color-mix(in srgb, var(--green) 10%, transparent);}
.gtb-gear.open svg{transform:rotate(90deg);}
/* inline settings accordion under an indicator row. Opens by animating
   grid-template-rows 0fr -> 1fr (the only smooth height-auto technique
   that needs no measured pixels); the inner wrapper clips overflow. */
.gtb-settings{
  display:grid;grid-template-rows:0fr;
  margin:0 0.375rem 0 1.5rem;
  opacity:0;
  transition:grid-template-rows .26s cubic-bezier(.22,1,.36,1),
             opacity .2s ease,margin .26s cubic-bezier(.22,1,.36,1);
}
.gtb-settings.open{grid-template-rows:1fr;opacity:1;margin-bottom:0.375rem;}
.gtb-settings-inner{
  overflow:hidden;min-height:0;
  display:flex;flex-direction:column;gap:0.375rem;
  padding:0 0.625rem;
  background:color-mix(in srgb, var(--text-primary) 2%, transparent);border-radius:0.1875rem;
  transition:padding .26s cubic-bezier(.22,1,.36,1);
}
.gtb-settings.open .gtb-settings-inner{padding:0.5rem 0.625rem;}
.gtb-set-row{display:flex;align-items:center;justify-content:space-between;gap:0.625rem;}
.gtb-set-label{font-size:max(0.6875rem, var(--fs-floor));color:var(--text-secondary);}
.gtb-set-input{
  width:4.25rem;padding:0.25rem 0.4375rem;border-radius:0.1875rem;
  border:none;background:var(--bg-primary);
  box-shadow:inset 0 0 0 1px var(--border-default);
  color:var(--text-primary);font-family:var(--font-mono);font-size:max(0.6875rem, var(--fs-floor));
  text-align:right;
  transition:box-shadow .18s ease;
}
.gtb-set-input:focus{
  outline:none;
  box-shadow:inset 0 0 0 1px var(--accent);
}
/* Flat minus / plus around a number field (app.js _numStepper). No native
   spinner arrows anywhere; these are plain text buttons in the field's own
   row height. */
.num-step{display:inline-flex;align-items:center;gap:0.125rem;}
.num-step-b{
  display:inline-flex;align-items:center;justify-content:center;
  width:1.375rem;height:1.375rem;padding:0;border:none;border-radius:0.1875rem;
  background:transparent;color:var(--text-muted);cursor:pointer;
  font-family:var(--font-mono);font-size:max(0.75rem, var(--fs-floor));line-height:1;
  transition:color .12s ease, background .12s ease;
}
.num-step-b:hover{color:var(--text-primary);background:var(--bg-hover);}
.gtb-set-btns{display:flex;justify-content:flex-end;gap:0.375rem;margin-top:0.125rem;}
.gtb-set-apply,.gtb-set-reset{
  padding:0.25rem 0.6875rem;border-radius:0.1875rem;font-size:max(0.625rem, var(--fs-floor));
  font-weight:600;letter-spacing:.04em;cursor:pointer;border:none;
  transition:background .15s ease,color .15s ease,box-shadow .15s ease,transform .12s ease;
}
.gtb-set-apply:active,.gtb-set-reset:active{transform:scale(.96);}
.gtb-set-apply{
  background:color-mix(in srgb, var(--accent) 14%, transparent);color:var(--accent);
  box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
}
.gtb-set-apply:hover{background:color-mix(in srgb, var(--accent) 24%, transparent);}
.gtb-set-apply:focus-visible{outline:none;box-shadow:inset 0 0 0 1px var(--accent);}
.gtb-set-reset{
  background:transparent;color:var(--text-muted);
  box-shadow:inset 0 0 0 1px var(--border-default);
}
.gtb-set-reset:hover{color:var(--text-secondary);box-shadow:inset 0 0 0 1px var(--border-strong);}
.gtb-set-reset:focus-visible{outline:none;box-shadow:inset 0 0 0 1px var(--border-strong);}
@media (prefers-reduced-motion: reduce){
  .gtb-settings,.gtb-settings-inner,.gtb-gear svg{transition:none;}
}

/* Hidden by the modal's checkbox toggle. Separate from .cp-collapsed
   (which folds within the layout) — this removes the panel entirely. */
.cp.cp-modal-hidden{display:none!important;}

/* Permission-driven cosmetic hide (server still enforces every gate):
   StockTwits panels/rows for Knights, the settings entry for non-Wardens. */
.perm-hidden{display:none!important;}

