/* ═══════════════════════════════════════════════════════════════════════════
   60 TRADING POLISH (2026-10-07)

   Owner: "our UI and UX and panels and EVERYTHING should be very
   professional since its for serious Day traders. make sure its like how
   other professional apps do it". A customer style audit of the trading
   pages (chart, ticket, Key stats, portfolio, competitions, settings, chat
   panel) found UPPERCASE letter spaced labels, a header cluster that wrapped
   over the Key stats panel, and side panes that left the chart ~620px wide
   at 1440. This file holds the fixes that are cross cutting on those pages;
   per feature fixes live in their own files (12, 13, 55, ...).

   Appended LAST so it overrides without being overridden. It claims no new
   class namespace of its own except .tp- (none used yet) and the two state
   classes .cl-icons (header cluster, app.js measured fit) and the
   #session-short label. Everything else is a targeted override of an
   existing selector, named so a grep for that selector finds it here.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Header command cluster: sentence case, one font, measured fit ──────
   Indicators / Key stats / Trade were mono, bold, UPPERCASE, letter spaced.
   Now the app's sans at the 12px data size, normal spacing, words as
   written. Colours and the filled active state are unchanged. */
.hdr-graphs-btn,
.hdr-trade-btn,
.ng-host-btn{
  font-family:var(--font-sans);
  font-size:var(--fs-data);
  font-weight:600;
  letter-spacing:normal;
  text-transform:none;
  padding:0 0.75rem;
  gap:0.375rem;
}
/* The view dropdown kept a 216 to 260px floor for a one word label
   ("Chart"); that floor alone pushed the cluster onto a second row. */
.top-cluster .view-trigger{min-width:8.5rem;}
/* Last measured tier (app.js "Toolbar density follows what actually FITS"):
   the three cluster buttons and the view dropdown go icon only; each keeps
   its title tooltip and aria label. */
.top-cluster.cl-icons .hdr-graphs-label,
.top-cluster.cl-icons .hdr-trade-label,
.top-cluster.cl-icons .view-trigger-label{display:none;}
.top-cluster.cl-icons .hdr-graphs-btn,
.top-cluster.cl-icons .hdr-trade-btn{padding:0 0.5rem;}
.top-cluster.cl-icons .view-trigger{min-width:0;padding:0 0.5rem;gap:0.25rem;}

/* Chart toolbar labels (Candles, Replay, the interval) in sentence case at
   the data size, in the app's sans. */
.time-controls .chart-type-btn,
.time-controls .iv-trigger > span.ctb-label,
.time-controls .ctb-label{
  font-family:var(--font-sans);
  letter-spacing:normal;
  text-transform:none;
}
.time-controls .chart-type-btn{font-size:var(--fs-data);font-weight:500;}
/* The session trigger names the session in words ("RTH", "Ext", "24h"):
   a bare bar glyph read as the letter "I". */
.session-short{font-family:var(--font-sans);font-size:var(--fs-data);font-weight:500;white-space:nowrap;}

/* ── Pane labels ("Price", indicator names, Volume) ──────────────────── */
.cp-label,
.indicator-pane__label{
  font-family:var(--font-sans);
  font-size:var(--fs-data);
  font-weight:500;
  letter-spacing:normal;
  text-transform:none;
  color:var(--text-muted);
}

/* ── Portfolio page section titles (Positions, Sectors, Market breadth,
   Daily P&L, Monthly returns) and figure labels: grey sentence case. The
   wallet view reuses the command center's .cc-section-title, so this is
   scoped to #wallet-view and leaves the watchlist page's own rules alone. */
#wallet-view .cc-section-title,
#wallet-view .pf-eyebrow,
#wallet-view .pf-card-label,
#wallet-view .pf-foot,
#wallet-view .pf-table th{
  font-family:var(--font-sans);
  font-size:var(--fs-data);
  font-weight:500;
  letter-spacing:normal;
  text-transform:none;
  color:var(--text-muted);
}
#wallet-view .cc-section-title{color:var(--text-secondary);font-weight:600;}

/* Performance range (1M 3M 1Y All): a real segmented control, readable
   even when a range is longer than the account's history (disabled). */
.pf-rng{gap:2px;padding:2px;border-radius:var(--radius-lg);background:var(--bg-tertiary);}
.pf-rng button{
  padding:0 0.5rem;border-radius:calc(var(--radius-lg) - 1px);
  font-family:var(--font-sans);font-size:var(--fs-data);letter-spacing:normal;
  color:var(--text-secondary);
}
.pf-rng button.on{background:var(--bg-elevated);color:var(--text-primary);}
.pf-rng button:hover{color:var(--text-primary);}
.pf-rng button:disabled{opacity:1;color:var(--text-muted);}

/* ── Trade ticket section labels (Order, Amount, Available) ──────────── */
.trade-sect-label,
.trade-avail-inline .trade-avail-lbl,
.trade-contract-k{
  font-family:var(--font-sans);
  font-size:var(--fs-data);
  font-weight:500;
  letter-spacing:normal;
  text-transform:none;
  color:var(--text-muted);
}

/* ── Settings and the chat panel header: grey sentence case labels ───── */
.st-sec-title,
.st-field label,
.st-head-meta .k{
  letter-spacing:normal;
  text-transform:none;
}

/* Settings: one font. The page was mono throughout (labels, toggles,
   buttons), which read as a debug console; the app's sans with tabular
   figures, labels grey sentence case at the 12px data size. */
#settings-view,
#settings-view :is(button, input, select, label, span, div, p, h2, h3, li, a){
  font-family:var(--font-sans);
  font-variant-numeric:tabular-nums;
}
#settings-view :is(.st-sec-title, .st-head-id){
  font-size:var(--fs-data);font-weight:600;letter-spacing:normal;text-transform:none;color:var(--text-secondary);
}
#settings-view :is(.st-head-meta .k, .st-field label, .stg-2way-opt, .sub-btn, .sub-grants-title, .ea-s-k, .ea-state){
  letter-spacing:normal;text-transform:none;
}

/* ── Axis chips are ONE compact box each (owner bug 2026-10-21) ─────────
   The last price chip, the bar countdown, the value chips and the crosshair
   chip used to paint a chart-bg box shadow band 12px above and below
   themselves to hide tick numbers half under them. On the axis that band
   read as a bigger panel behind every label, so it is gone: each chip is
   only its own 15px box, nothing behind it. */
/* The price crosshair chip spans the whole axis column like the price tag. */
.cross-tag.cross-tag-price{right:0;text-align:center;padding:0 2px;border-radius:2px;}

/* Key stats EPS graph: the year sits on its own line under the month. */
.ksd-graph-x .ksd-x-yr{display:block;color:var(--text-xmuted);line-height:1.2;}

/* ── Chart keeps its width with both side panes open (pro audit item 12) ─
   Key stats (264px at 1440) + the ticket (257px) left the chart ~620px wide
   at 1440. With BOTH open the two panes go compact, tracking the viewport,
   so the chart keeps about 60% of the area right of the sidebar; at 1920
   and up they reach their usual caps again. One pane alone is unchanged. */
body.ksd-open.trade-open{
  /* min(): on small windows (where the rem is already small) the panes keep
     their usual floor instead of shrinking further. */
  --ksd-w:clamp(min(18.75rem, 240px), 17.5vw, 18.75rem);
  --trade-w:clamp(min(14.5rem, 210px), 15vw, 18.25rem);
}

/* ── Ctrl+K palette reads like the / command line ────────────────────────
   Same row language as cmdline.js: ticker in the sans, bold; the name grey
   with an ellipsis; the class word grey sentence case ("Stock", "ETF"). */
.rsx-og,
.rsx-or-m,
.rsx-pal-foot,
.rsx-cmd-k,
.rsx-pal-esc{
  font-family:var(--font-sans);
  letter-spacing:normal;
  text-transform:none;
}
.rsx-og{font-size:var(--fs-label);font-weight:500;color:var(--text-muted);}
.rsx-or-k{font-family:var(--font-sans);font-size:var(--fs-data);letter-spacing:normal;}
.rsx-or-n{font-size:var(--fs-data);text-overflow:ellipsis;}
.rsx-or-m{font-size:var(--fs-data);font-weight:400;color:var(--text-muted);}

/* ── Create alert: the Condition dropdown (MPMenu) ───────────────────── */
.alert-dd{flex:0 0 168px;position:relative;min-width:0;}
.alert-dd-trigger{
  display:flex;align-items:center;justify-content:space-between;gap:0.375rem;width:100%;
  cursor:pointer;text-align:left;
}
.alert-dd-trigger:hover{background:var(--bg-hover);}
.alert-dd-lbl{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.alert-dd-caret{flex:none;color:var(--text-muted);}
.alert-dd-menu .mpm-item[aria-checked="true"]{background:var(--bg-hover);color:var(--text-primary);}

/* ── Keep the floating assistant button's corner clear (audit item 9) ───
   The button itself is not moved here (the market pages pass docks it app
   wide). Until then, the scroll areas under its corner get room to scroll
   their last row (the leaderboard pager, the last Key stats rows) above it. */
.cmp-inner{padding-bottom:4.5rem;}
.ksd-scroll{padding-bottom:4rem;}
/* Previous close axis chip (app.js _drawRefLine / updatePriceChips): grey
   fill, light text, the same compact box as the other chips. */
.edge-tag.ref-tag{color:var(--on-accent-bright);font-weight:500;}
/* Price alert axis chip (chart/alerts.js axisChips, 2026-11-20): a DOM chip
   in the price pane's chip stack, so it never hides under the previous close
   or last price chip. The line's word sits in a box just left of it, in the
   chip's own fill, where LightweightCharts' label drew it. */
.edge-tag.alert-tag::before,.edge-tag.alert-tag-saving::before{
  content:'alert';position:absolute;top:0;right:100%;margin-right:1px;
  height:15px;line-height:15px;padding:0 4px;border-radius:3px;
  background:inherit;color:inherit;font:inherit;}
.edge-tag.alert-tag-saving::before{content:'saving';}
/* Compact Key stats (both side panes open): the report table's number
   columns pack tighter so the report date keeps its year. */
body.ksd-open.trade-open .ksd-tr{grid-template-columns:minmax(0,1fr) 2.7em 3.2em 3.8em;column-gap:.3rem;}
body.ksd-open.trade-open .ksd-scroll{padding-left:12px;padding-right:8px;}
/* The leaderboard pager sits in the button's corner when the board fits the
   window: its Previous / Next keep clear of it while the button floats. */
.cmp-pager{padding-right:3.75rem;}
