/* ═══ THE CHART TOOLBAR, REBUILT, AND CHARTS ON SCREEN (chart build phase 2, 17 Nov 2026) ════════════════════════
   The owner: "I hated how the chart toolbar was" and "how the squares represent quad and dual". The approved proposal
   (version 8, passed by the design reviewer at 9.5; the owner picked the list in words and numbers) is built here on the
   real page. 25 controls become 16, in this order:
     symbol search | four starred intervals and the list of all six | chart type, Indicators, Alert, Replay
     ........................................ Charts on screen, the saved layout's name | undo, redo | picture, settings, full screen
   The range and the price scale (Auto / Log / %) move under the chart, with the chart's reset. No square stands for a
   layout anywhere: the charts are chosen from a list in words and numbers.

   Every rule is scoped to html.cdp-tb2 (the switch, set in chart.html's head; ?chart=v1 draws the old toolbar). The
   controls are the page's own (same id, tracking name and handler), placed by `order` in the bar whose groups are
   display: contents (css/chart-desk-page.css "ONE ROW"). Loaded last; no !important: each rule out-ranks the older
   one by weight. Colours, radii and sizes are the design system's tokens (css/tokens.css) and the desk's own colours.

   Sizes (the proposal's version 7, the design reviewer's): toolbar controls 36px, 4px corners, no box (a ground on
   hover); the chosen interval is teal, bold and underlined; menus 12px corners. A phone keeps its own row (below). */

/* ── THE TWO NEW ARRANGEMENTS (every width, both toolbars: a saved layout may hold them) ─────────────────────────── */
.cdp-grid[data-layout="stack"] { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
.cdp-grid[data-layout="tri"] { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
.cdp-grid[data-layout="tri"] > .cdp-cell:first-child { grid-row: 1 / 3; }
.cdp-grid[data-layout="stack"] .cdp-cell,
.cdp-grid[data-layout="tri"] .cdp-cell { min-height: 0; background: var(--cdp-panel); }
@media (max-width: 1100px) {
  .cdp-grid[data-layout="tri"] { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-rows: minmax(220px, 1fr); }
  .cdp-grid[data-layout="tri"] > .cdp-cell:first-child { grid-row: auto; }
}
/* the locked pane's card in a half-height or small pane: the quad treatment (css/chart-desk-sharp.css, PLANS 5) */
html body.cdp .cdp-grid:is([data-layout="stack"], [data-layout="tri"]) .cdp-cell-lock { padding: 10px 14px 12px; max-width: 360px; gap: 4px; }
html body.cdp .cdp-grid:is([data-layout="stack"], [data-layout="tri"]) .cdp-cell-lock .cdp-cell-lock-b { display: none; }
html body.cdp .cdp-grid:is([data-layout="stack"], [data-layout="tri"]) .cdp-cell-lock .cdp-cell-lock-t { font-size: 13px; order: -2; }
html body.cdp .cdp-grid:is([data-layout="stack"], [data-layout="tri"]) .cdp-cell[data-locked] .cdp-cell-lock { max-height: calc(100% - 16px); }
html body.cdp .cdp-grid:is([data-layout="stack"], [data-layout="tri"]) .cdp-cell-lock .cdp-cell-lock-k { display: none; }
html body.cdp .cdp-grid:is([data-layout="stack"], [data-layout="tri"]) .cdp-cell-lock .cdp-cell-lock-foot { order: -1; margin-top: 0; }

/* ── THE BAR ─────────────────────────────────────────────────────────────────────────────────────────────────── */
@media (min-width: 768px) {
  html.cdp-tb2 body.cdp .cdp-tierbar { gap: 2px; padding: 4px 10px; min-height: 44px; }
  /* every group is its own contents, so each control takes its place by `order` (css/chart-desk-sharp.css made the
     Indicators group one inline box) */
  html.cdp-tb2 body.cdp .cdp-tierbar :is(.cdp-tierchips, #cdpTbCluster, .cdp-tbgroup, .cdp-workspace) { display: contents; }
  /* what leaves the bar: the teaching level, the squares and their label, Sync (now a switch in Charts on screen), the
     Layout button (its dialog opens from the saved layout's name), the old Layouts and watchlist chips, the zoom reset
     (on the chart now), the range (under the chart) */
  html.cdp-tb2 body.cdp .cdp-tierbar :is(#cdpTier, #cdpLayout, #cdpSync, #cdpViewBtn, #cdpWlToggle, #cdpSave, .cdp-group-label, #cdpRangeChips) { display: none; }
  html.cdp-tb2 body.cdp .cdp-tierbar .cdp-tbtn[data-tool="reset"] { display: none; }
  /* Replay is on the bar; the header's own button (js/replay/replay-desk.js) stays for the phone's symbol switcher */
  html.cdp-tb2 body.cdp #cdpChrome .cdp-sub-row #cdpReplayBtn { display: none; }
  /* the three dots are the overflow: drawn only when the bar is too narrow for its last controls (fitToolbar) */
  html.cdp-tb2 body.cdp .cdp-tierbar:not(.cdp-fit2-more) #cdpMore { display: none; }

  /* the order */
  html.cdp-tb2 body.cdp .cdp-tierbar > .cdp-search-desk { order: 1; }
  html.cdp-tb2 body.cdp .cdp-tierbar .cdp-tb2-sep[data-sep="a"] { order: 2; }
  html.cdp-tb2 body.cdp .cdp-tierbar #cdpTf { order: 3; }
  html.cdp-tb2 body.cdp .cdp-tierbar .cdp-tb2-sep[data-sep="b"] { order: 4; }
  html.cdp-tb2 body.cdp .cdp-tierbar [data-tool="ctype"] { order: 5; }
  html.cdp-tb2 body.cdp .cdp-tierbar #cdpIndicators { order: 6; }
  html.cdp-tb2 body.cdp .cdp-tierbar [data-tool="alert"] { order: 7; }
  html.cdp-tb2 body.cdp .cdp-tierbar #cdpTbReplay { order: 8; }
  html.cdp-tb2 body.cdp .cdp-tierbar #cdpCharts { order: 10; margin-left: auto; }
  html.cdp-tb2 body.cdp .cdp-tierbar #cdpWsName { order: 11; }
  html.cdp-tb2 body.cdp .cdp-tierbar .cdp-tb2-sep[data-sep="c"] { order: 12; }
  html.cdp-tb2 body.cdp .cdp-tierbar [data-tool="undo"] { order: 13; }
  html.cdp-tb2 body.cdp .cdp-tierbar [data-tool="redo"] { order: 14; }
  html.cdp-tb2 body.cdp .cdp-tierbar .cdp-tb2-sep[data-sep="d"] { order: 15; }
  html.cdp-tb2 body.cdp .cdp-tierbar #cdpSnap { order: 16; }
  html.cdp-tb2 body.cdp .cdp-tierbar #cdpGear { order: 17; }
  html.cdp-tb2 body.cdp .cdp-tierbar [data-tool="full"] { order: 18; }
  html.cdp-tb2 body.cdp .cdp-tierbar #cdpMore { order: 19; }

  /* the hairlines between the groups */
  html.cdp-tb2 body.cdp .cdp-tierbar .cdp-tb2-sep { flex: 0 0 1px; width: 1px; height: 24px; margin: 0 6px; background: var(--cdp-hairline); }

  /* ONE CONTROL LOOK: 36px, 4px corners, the site's control line (every control has a visible border: the owner's rule,
     --cdp-border is its 3:1 line in light and dark); a ground under the pointer. */
  html.cdp-tb2 body.cdp .cdp-tierbar :is(.cdp-chip, .cdp-tbtn, .cdp-tb2-btn, .cdp-tfb, .cdp-tf-more) {
    height: 36px; min-height: 36px; border: 1px solid var(--cdp-border); border-radius: var(--jag-r-xs);
    background: transparent; box-shadow: none; color: var(--cdp-text); font: inherit; font-size: 13px; font-weight: 600;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; cursor: pointer;
  }
  html.cdp-tb2 body.cdp .cdp-tierbar :is(.cdp-chip, .cdp-tbtn, .cdp-tb2-btn, .cdp-tfb, .cdp-tf-more):hover { background: var(--cdp-panel-2); border-color: var(--cdp-border); color: var(--cdp-text); }
  html.cdp-tb2 body.cdp .cdp-tierbar :is(.cdp-chip, .cdp-tbtn, .cdp-tb2-btn, .cdp-tfb, .cdp-tf-more):focus-visible { outline: 2px solid var(--cds-accent); outline-offset: -2px; }
  html.cdp-tb2 body.cdp .cdp-tierbar :is(.cdp-chip, .cdp-tbtn-named, .cdp-tb2-btn) { padding: 0 8px; }
  html.cdp-tb2 body.cdp .cdp-tierbar :is(.cdp-tbtn:not(.cdp-tbtn-named), .cdp-tb2-ico) { width: 36px; min-width: 36px; padding: 0; }
  html.cdp-tb2 body.cdp .cdp-tierbar :is(.cdp-tbtn, .cdp-tb2-btn) svg { width: 18px; height: 18px; flex: 0 0 auto; }
  html.cdp-tb2 body.cdp .cdp-tierbar :is(.cdp-tbtn, .cdp-tb2-btn) .cdp-tb2-caret,
  html.cdp-tb2 body.cdp .cdp-tierbar .cdp-tf-more svg { width: 10px; height: 6px; color: var(--cdp-muted); }
  /* an open menu's button, and a switched-on tool (full screen), keep the house's chosen look: outlined in the accent */
  html.cdp-tb2 body.cdp .cdp-tierbar :is(.cdp-tb2-btn, .cdp-tbtn-named, #cdpIndicators)[aria-expanded="true"] { background: var(--jag-accent-tint-soft); border-color: var(--cds-accent); color: var(--cds-accent); }

  /* the symbol search, first: the box shows the symbol on the chart and searches when typed into */
  html.cdp-tb2 body.cdp .cdp-tierbar > .cdp-search-desk { flex: 0 0 auto; width: 216px; margin: 0 2px 0 0; display: flex; }
  html.cdp-tb2 body.cdp .cdp-tierbar > .cdp-search-desk .cdp-symsearch { flex: 1 1 auto; max-width: none; margin: 0; }
  html.cdp-tb2 body.cdp .cdp-tierbar > .cdp-search-desk .cdp-symsearch-input { height: 36px; font-size: 15px; font-weight: 800; border-radius: var(--jag-r-sm); }
  html.cdp-tb2 body.cdp .cdp-tierbar > .cdp-search-desk .cdp-symsearch-input::placeholder { font-size: 13px; font-weight: 600; }

  /* the intervals: the starred ones as plain words, the one in use teal, bold and underlined; the old chips stay in the
     DOM (they carry the state and the handler) and the words below press them */
  html.cdp-tb2 body.cdp .cdp-tierbar #cdpTf { display: inline-flex; align-items: center; gap: 0; padding: 0; border: 0; overflow: visible; }
  html.cdp-tb2 body.cdp .cdp-tierbar #cdpTf > :is(.cdp-chip, .cdp-ctl-k) { display: none; }
  html.cdp-tb2 body.cdp .cdp-tierbar #cdpTf .cdp-tfb { min-width: 36px; padding: 0 8px; color: var(--cdp-muted); font-variant-numeric: tabular-nums; }
  html.cdp-tb2 body.cdp .cdp-tierbar #cdpTf .cdp-tfb:hover { color: var(--cdp-text); }
  html.cdp-tb2 body.cdp .cdp-tierbar #cdpTf .cdp-tfb[aria-pressed="true"] { color: var(--cds-accent); font-weight: 800; box-shadow: inset 0 -2px 0 var(--cds-accent); }
  html.cdp-tb2 body.cdp .cdp-tierbar #cdpTf .cdp-tfb.pending { color: var(--cdp-text); box-shadow: inset 0 -2px 0 var(--cdp-hairline); }
  html.cdp-tb2 body.cdp .cdp-tierbar #cdpTf .cdp-tf-more { width: 28px; min-width: 28px; padding: 0; }   /* was 24 wide (Reviewer 5) */
  /* the three dots (More chart actions, from 1024 and under) are as wide as the bar's other picture buttons (they were 30) */
  html.cdp-tb2 body.cdp .cdp-tierbar #cdpMore { width: 36px; min-width: 36px; padding: 0; }
  /* one segmented group: the starred intervals and the list's caret share their edges (no doubled line between two) */
  html.cdp-tb2 body.cdp .cdp-tierbar #cdpTf :is(.cdp-tfb, .cdp-tf-more) { border-radius: 0; }
  html.cdp-tb2 body.cdp .cdp-tierbar #cdpTf .cdp-tfb + :is(.cdp-tfb, .cdp-tf-more) { margin-left: -1px; }
  html.cdp-tb2 body.cdp .cdp-tierbar #cdpTf > :is(:not(.cdp-tfb) + .cdp-tfb, .cdp-tfb:first-child) { border-radius: var(--jag-r-xs) 0 0 var(--jag-r-xs); }
  html.cdp-tb2 body.cdp .cdp-tierbar #cdpTf .cdp-tf-more { border-radius: 0 var(--jag-r-xs) var(--jag-r-xs) 0; }
  html.cdp-tb2 body.cdp .cdp-tierbar #cdpTf :is(.cdp-tfb, .cdp-tf-more):is(:hover, :focus-visible) { position: relative; z-index: 1; }

  /* chart type: its picture and a caret (the name is its tooltip) */
  html.cdp-tb2 body.cdp .cdp-tierbar [data-tool="ctype"] :is(i, b) { display: none; }
  html.cdp-tb2 body.cdp .cdp-tierbar [data-tool="ctype"] .cdp-caret { font-size: 11px; color: var(--cdp-muted); }
  html.cdp-tb2 body.cdp .cdp-tierbar [data-tool="alert"] b { font-size: 13px; font-weight: 600; }
  /* Indicators, with the number on the chart */
  html.cdp-tb2 body.cdp .cdp-tierbar #cdpIndicators .cdp-tb2-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--jag-r-pill); background: var(--jag-accent-tint-soft); color: var(--cds-accent); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
  html.cdp-tb2 body.cdp .cdp-tierbar #cdpIndicators .cdp-tb2-count[hidden] { display: none; }

  /* Charts on screen: "1 chart" and "4 charts" are one width, so the open menu does not move */
  html.cdp-tb2 body.cdp .cdp-tierbar #cdpCharts { min-width: 106px; justify-content: flex-start; }
  html.cdp-tb2 body.cdp .cdp-tierbar #cdpCharts b { font-weight: 800; font-variant-numeric: tabular-nums; }
  html.cdp-tb2 body.cdp .cdp-tierbar #cdpCharts .cdp-tb2-caret { margin-left: auto; }
  /* the saved layout's name */
  html.cdp-tb2 body.cdp .cdp-tierbar #cdpWsName span { max-width: 168px; overflow: hidden; text-overflow: ellipsis; color: var(--cdp-muted); }

  /* ── FITTING A NARROWER WINDOW (fitToolbar in js/app/chart-desk-boot.js measures the bar and takes these steps) ── */
  /* 1. words: Alert and Replay keep their pictures, the search box and the layout's name get narrower */
  html.cdp-tb2 body.cdp .cdp-tierbar.cdp-fit2-words [data-tool="alert"] b,
  html.cdp-tb2 body.cdp .cdp-tierbar.cdp-fit2-words #cdpTbReplay span { display: none; }
  html.cdp-tb2 body.cdp .cdp-tierbar.cdp-fit2-words > .cdp-search-desk { width: 150px; }
  html.cdp-tb2 body.cdp .cdp-tierbar.cdp-fit2-words #cdpWsName span { max-width: 110px; }
  /* 2. the overflow: undo, redo and the picture go into the three dots, which appear */
  html.cdp-tb2 body.cdp .cdp-tierbar.cdp-fit2-more :is([data-tool="undo"], [data-tool="redo"], #cdpSnap, .cdp-tb2-sep[data-sep="c"]) { display: none; }
  /* 3. Replay and the layout's name go into the three dots as well */
  html.cdp-tb2 body.cdp .cdp-tierbar.cdp-fit2-less :is(#cdpTbReplay, #cdpWsName) { display: none; }
  html.cdp-tb2 body.cdp .cdp-tierbar.cdp-fit2-less > .cdp-search-desk { width: 120px; }
  html.cdp-tb2 body.cdp .cdp-tierbar.cdp-fit2-less #cdpCharts { min-width: 0; }
  html.cdp-tb2 body.cdp .cdp-tierbar.cdp-fit2-less .cdp-tb2-sep { margin: 0 2px; }
  /* 4. still too narrow: the bar scrolls sideways (an older rule pins it to one row), so nothing is out of reach */
  html.cdp-tb2 body.cdp .cdp-tierbar.cdp-fit2-wrap { overflow-x: auto; scrollbar-width: thin; }
}

/* ── THE MENUS: ALL INTERVALS, CHARTS ON SCREEN ──────────────────────────────────────────────────────────────── */
html.cdp-tb2 .cdp-tb2-menu { min-width: 240px; padding: 6px; border-radius: var(--jag-r-md); box-shadow: var(--jag-shadow-float); }
html.cdp-tb2 .cdp-tb2-menu .cdp-tb2-mh { margin: 2px 8px 6px; font-size: 12px; font-weight: 700; color: var(--cdp-muted); }
html.cdp-tb2 .cdp-tb2-menu .cdp-tb2-mh small { font-size: 11px; font-weight: 600; margin-left: 6px; }
html.cdp-tb2 body.cdp .cdp-tb2-menu .cdp-tb2-row { border: 1px solid transparent; background: transparent; }
html.cdp-tb2 body.cdp .cdp-tb2-menu .cdp-tb2-row:hover { background: var(--cdp-panel-2); }
html.cdp-tb2 .cdp-tb2-menu .cdp-tb2-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 10px; border-radius: var(--jag-r-sm); font-size: 13px; font-weight: 600; text-align: left; }
html.cdp-tb2 .cdp-tb2-menu .cdp-tb2-row[aria-checked="true"] { background: var(--jag-accent-tint-soft); color: var(--cds-accent); }
html.cdp-tb2 .cdp-tb2-menu .cdp-tb2-row[aria-checked="true"] .cdp-tb2-rw b { color: var(--cds-accent); font-weight: 800; }
html.cdp-tb2 .cdp-tb2-menu .cdp-tb2-num { flex: 0 0 22px; text-align: center; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--cdp-text); }
html.cdp-tb2 .cdp-tb2-menu .cdp-tb2-row[aria-checked="true"] .cdp-tb2-num { color: var(--cds-accent); }
html.cdp-tb2 .cdp-tb2-menu .cdp-tb2-rw { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
html.cdp-tb2 .cdp-tb2-menu .cdp-tb2-rw b { font-size: 13px; font-weight: 700; color: var(--cdp-text); }
html.cdp-tb2 .cdp-tb2-menu .cdp-tb2-rw small { font-size: 12px; font-weight: 400; color: var(--cdp-muted); white-space: normal; }
html.cdp-tb2 .cdp-tb2-menu .cdp-tb2-tick { flex: 0 0 16px; width: 16px; height: 16px; color: var(--cds-accent); }
html.cdp-tb2 .cdp-tb2-menu .cdp-tb2-tag { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px; border-radius: var(--jag-r-xs); border: 1px solid var(--cds-pro); color: var(--cds-pro); font-size: 11px; font-weight: 700; }
html.cdp-tb2 .cdp-tb2-menu .cdp-tb2-tag svg { width: 11px; height: 11px; }
html.cdp-tb2 .cdp-tb2-menu .cdp-tb2-tag.is-plain { border-color: var(--cdp-border); color: var(--cdp-muted); }
html.cdp-tb2 .cdp-tb2-menu .cdp-tb2-sec { margin-top: 6px; padding: 8px 8px 2px; border-top: 1px solid var(--cdp-hairline); }
html.cdp-tb2 .cdp-tb2-menu .cdp-tb2-sw { display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: 13px; font-weight: 600; color: var(--cdp-text); cursor: pointer; }
html.cdp-tb2 .cdp-tb2-menu .cdp-tb2-sw input { width: 16px; height: 16px; margin: 0; accent-color: var(--cds-accent); }
html.cdp-tb2 .cdp-tb2-menu .cdp-tb2-note { margin: 4px 0 2px; font-size: 12px; color: var(--cdp-muted); }
/* all intervals: a row and its star */
html.cdp-tb2 .cdp-tb2-menu .cdp-tb2-tfrow { display: flex; align-items: center; gap: 2px; }
html.cdp-tb2 .cdp-tb2-menu .cdp-tb2-tfrow .cdp-tb2-row { flex: 1 1 auto; min-height: 36px; }
html.cdp-tb2 .cdp-tb2-menu .cdp-tb2-star { flex: 0 0 36px; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0; color: var(--cdp-muted); }
html.cdp-tb2 .cdp-tb2-menu .cdp-tb2-star[aria-pressed="true"] { color: var(--cds-pro); }
html.cdp-tb2 .cdp-tb2-menu .cdp-tb2-star svg { width: 16px; height: 16px; }

/* ── UNDER THE CHART: RANGE, PRICE SCALE, RESET ──────────────────────────────────────────────────────────────── */
html.cdp-tb2 body.cdp .cdp-chartfoot { display: flex; align-items: center; gap: 4px; min-height: 40px; padding: 2px 8px; border-top: 1px solid var(--cdp-hairline); background: var(--cdp-panel); }
html.cdp-tb2 body.cdp .cdp-chartfoot[hidden] { display: none; }
html.cdp-tb2 body.cdp .cdp-chartfoot .cdp-cf-grow { flex: 1 1 auto; }
html.cdp-tb2 body.cdp .cdp-chartfoot .cdp-cf-range { display: inline-flex; align-items: center; gap: 0; }
html.cdp-tb2 body.cdp .cdp-chartfoot :is(.cdp-tfb, .cdp-cf-scale button, .cdp-cf-reset) {
  height: 36px; min-width: 36px; padding: 0 8px; border: 1px solid var(--cdp-border); border-radius: var(--jag-r-xs); background: transparent;
  color: var(--cdp-muted); font: inherit; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
html.cdp-tb2 body.cdp .cdp-chartfoot :is(.cdp-tfb, .cdp-cf-scale button, .cdp-cf-reset):hover { background: var(--cdp-panel-2); color: var(--cdp-text); }
html.cdp-tb2 body.cdp .cdp-chartfoot :is(.cdp-tfb, .cdp-cf-scale button, .cdp-cf-reset):focus-visible { outline: 2px solid var(--cds-accent); outline-offset: -2px; }
html.cdp-tb2 body.cdp .cdp-chartfoot :is(.cdp-tfb, .cdp-cf-scale button)[aria-pressed="true"] { color: var(--cds-accent); font-weight: 800; border-bottom: 2px solid var(--cds-accent); }
/* the range and the price scale are segmented groups: neighbours share an edge */
html.cdp-tb2 body.cdp .cdp-chartfoot :is(.cdp-cf-range, .cdp-cf-scale) > button { border-radius: 0; }
html.cdp-tb2 body.cdp .cdp-chartfoot :is(.cdp-cf-range, .cdp-cf-scale) > button + button { margin-left: -1px; }
html.cdp-tb2 body.cdp .cdp-chartfoot :is(.cdp-cf-range, .cdp-cf-scale) > button:first-child { border-radius: var(--jag-r-xs) 0 0 var(--jag-r-xs); }
html.cdp-tb2 body.cdp .cdp-chartfoot :is(.cdp-cf-range, .cdp-cf-scale) > button:last-child { border-radius: 0 var(--jag-r-xs) var(--jag-r-xs) 0; }
html.cdp-tb2 body.cdp .cdp-chartfoot :is(.cdp-cf-range, .cdp-cf-scale) > button:only-child { border-radius: var(--jag-r-xs); }
html.cdp-tb2 body.cdp .cdp-chartfoot :is(.cdp-cf-range, .cdp-cf-scale) > button:is(:hover, :focus-visible) { position: relative; z-index: 1; }
html.cdp-tb2 body.cdp .cdp-chartfoot .cdp-tfb:disabled { opacity: .45; cursor: default; background: transparent; }
html.cdp-tb2 body.cdp .cdp-chartfoot .cdp-cf-scale { display: inline-flex; align-items: center; gap: 0; }
html.cdp-tb2 body.cdp .cdp-chartfoot .cdp-cf-reset { padding: 0; }
html.cdp-tb2 body.cdp .cdp-chartfoot .cdp-cf-reset svg { width: 16px; height: 16px; }

/* ── A PHONE (767px and under): the toolbar is the phone's own row; the new desktop controls are not drawn there ── */
@media (max-width: 767px) {
  html.cdp-tb2 body.cdp .cdp-tb2x:not(.cdp-tb2-phone),
  html.cdp-tb2 body.cdp #cdpTf .cdp-tfb { display: none; }
  html.cdp-tb2 body.cdp .cdp-chartfoot { display: none; }
}

/* the overflow's rows for Replay and the saved layout's name (the three dots, fitToolbar's third step) */
html.cdp-tb2 .cdp-menu .cdp-tb2-fitrows { display: flex; flex-direction: column; gap: 2px; }
html.cdp-tb2 .cdp-menu .cdp-tb2-fitrows[hidden] { display: none; }
/* the Layout dialog's square tiles are not drawn with this toolbar: Charts on screen is the one place to choose */
html.cdp-tb2 .cdp-viewmenu .cdp-vm-sec.cdp-tb2-off { display: none; }

/* ── THE PHONE (767px and under): the range under the chart, then five buttons, each with its word ─────────────── */
@media (min-width: 768px) {
  html.cdp-tb2 body.cdp .cdp-tb2-phone { display: none; }
}
@media (max-width: 767px) {
  html.cdp-tb2 body.cdp.cdp-phone-layout #cdpPhoneRow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 0 -12px -12px; padding: 6px 8px; border-top: 1px solid var(--cdp-hairline); }
  /* five buttons, each with the site's control line (every control has a visible border) */
  html.cdp-tb2 body.cdp.cdp-phone-layout #cdpPhoneRow > :is(.cdp-ph-btn, .cdp-tbtn, #cdpToolsBtn) {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; min-height: 48px; height: 48px; width: auto;
    margin: 0; padding: 0 2px; border: 1px solid var(--cdp-border); border-radius: var(--jag-r-xs); background: transparent; box-shadow: none; color: var(--cdp-muted);
    font: inherit; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden;   /* the site's 12px floor (Reviewer 5: it was 11) */
  }
  html.cdp-tb2 body.cdp.cdp-phone-layout #cdpPhoneRow > :is(.cdp-ph-btn, .cdp-tbtn, #cdpToolsBtn) svg { display: block; width: 20px; height: 20px; color: var(--cdp-text); }
  html.cdp-tb2 body.cdp.cdp-phone-layout #cdpPhoneRow > .cdp-ph-btn b { font-size: 15px; font-weight: 800; line-height: 20px; color: var(--cdp-text); font-variant-numeric: tabular-nums; }
  html.cdp-tb2 body.cdp.cdp-phone-layout #cdpPhoneRow > :is(.cdp-ph-btn, .cdp-tbtn, #cdpToolsBtn)[aria-expanded="true"] { border-color: var(--cds-accent); background: var(--jag-accent-tint-soft); color: var(--cds-accent); }
  html.cdp-tb2 body.cdp.cdp-phone-layout #cdpPhoneRow > :is(.cdp-ph-btn, .cdp-tbtn, #cdpToolsBtn):active { background: var(--cdp-panel-2); }
  html.cdp-tb2 body.cdp.cdp-phone-layout #cdpPhoneRow > .cdp-tbtn :is(i, b, .cdp-caret) { display: none; }
  html.cdp-tb2 body.cdp.cdp-phone-layout #cdpPhoneRow > #cdpToolsBtn::after { content: none; }
  /* the range and the intervals open from Interval, so the row under the chart is the five buttons alone */
  html.cdp-tb2 body.cdp.cdp-phone-layout #cdpPhoneCtl > :is(#cdpRangeChips, #cdpTf) { display: none; }
  /* not tucked 10px under the chart (the old row's pull-up): the buttons' top line would be drawn under the time axis */
  html.cdp-tb2 body.cdp.cdp-phone-layout #cdpPhoneCtl { gap: 0; padding-top: 0; margin-top: 0; }
  html.cdp-tb2 body.cdp.cdp-phone-layout #cdpPhoneRow { margin-top: 0; border-top: 0; }
  /* edge to edge: out-ranks the old row's margin-right (chart-desk-sharp.css) */
  html.cdp-tb2 body.cdp.cdp-phone-layout #cdpPhoneCtl > #cdpPhoneRow { margin: 0 -12px -12px; }
  html.cdp-tb2 body.cdp.cdp-phone-layout #cdpPhoneRow > .cdp-tbtn::after { content: "Type"; }
  html.cdp-tb2 body.cdp.cdp-phone-layout #cdpPhoneRow > #cdpPhTf { order: 1; }
  html.cdp-tb2 body.cdp.cdp-phone-layout #cdpPhoneRow > .cdp-tbtn[data-tool="ctype"] { order: 2; }
  html.cdp-tb2 body.cdp.cdp-phone-layout #cdpPhoneRow > #cdpPhInd { order: 3; }
  html.cdp-tb2 body.cdp.cdp-phone-layout #cdpPhoneRow > #cdpToolsBtn { order: 4; }
  html.cdp-tb2 body.cdp.cdp-phone-layout #cdpPhoneRow > #cdpPhMore { order: 5; }
  /* the menus open as a sheet from the foot of the screen */
  html.cdp-tb2 .cdp-tb2-menu.is-sheet { left: 0; right: 0; top: auto; bottom: 0; width: auto; min-width: 0; max-height: 80vh; z-index: 12100; border-radius: var(--jag-r-lg) var(--jag-r-lg) 0 0; padding: 8px 8px calc(12px + env(safe-area-inset-bottom, 0px)); }
  html.cdp-tb2 .cdp-tb2-menu.is-sheet .cdp-tb2-row { min-height: 48px; font-size: 15px; }
  html.cdp-tb2 .cdp-tb2-menu.is-sheet .cdp-tb2-rw b { font-size: 15px; }
  html.cdp-tb2 .cdp-tb2-menu.is-sheet .cdp-tb2-mh { font-size: 13px; }
  html.cdp-tb2 .cdp-tb2-menu.is-sheet .cdp-tb2-star { flex-basis: 44px; width: 44px; height: 44px; }
  html.cdp-tb2 .cdp-tb2-menu.is-sheet .cdp-tb2-ico { flex: 0 0 22px; width: 22px; height: 22px; color: var(--cdp-text); }
  html.cdp-tb2 .cdp-tb2-menu.is-sheet .cdp-tb2-tfgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0 4px 8px; }
  html.cdp-tb2 .cdp-tb2-menu.is-sheet .cdp-tb2-tfgrid button { min-height: 44px; border: 1px solid var(--cdp-border); border-radius: var(--jag-r-xs); background: var(--cdp-panel); color: var(--cdp-text); font: inherit; font-size: 15px; font-weight: 600; }
  html.cdp-tb2 .cdp-tb2-menu.is-sheet .cdp-tb2-tfgrid button[aria-pressed="true"] { border: 2px solid var(--cds-accent); color: var(--cds-accent); font-weight: 800; }
  html.cdp-tb2 .cdp-tb2-menu.is-sheet .cdp-tb2-tfgrid button:disabled { opacity: .45; }
}
/* a sheet's head: its name and the close */
html.cdp-tb2 .cdp-tb2-menu .cdp-tb2-shh { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 0 4px 4px 8px; }
html.cdp-tb2 .cdp-tb2-menu .cdp-tb2-shh b { font-size: 16px; font-weight: 800; color: var(--cdp-text); }
html.cdp-tb2 .cdp-tb2-menu .cdp-tb2-shh .cdp-tb2-x { width: 44px; height: 44px; }

/* ── AN × ON EACH CHART (two or more charts, none locked; js/app/chart-desk-boot.js paintX / closeChartAt) ───────── */
html.cdp-tb2 body.cdp .cdp-cell-head .cdp-cell-x {
  position: relative; flex: 0 0 26px; width: 26px; height: 26px; margin: 0 -6px 0 auto; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--cdp-border); border-radius: var(--jag-r-xs); background: transparent; box-shadow: none;
  color: var(--cdp-muted); cursor: pointer;
}
html.cdp-tb2 body.cdp .cdp-cell-head .cdp-cell-x[hidden] { display: none; }
html.cdp-tb2 body.cdp .cdp-cell-head .cdp-cell-x svg { width: 14px; height: 14px; }
html.cdp-tb2 body.cdp .cdp-cell-head .cdp-cell-x:hover { background: var(--cdp-panel); color: var(--cdp-text); }
html.cdp-tb2 body.cdp .cdp-cell-head .cdp-cell-x:focus-visible { outline: 2px solid var(--cds-accent); outline-offset: -2px; }
/* a phone: the same 26 px mark with a 44 px place to tap. The chart's head is 30 px tall and cut its overflow, so the place
   to tap measured 38x30 (Reviewer 5). It now reaches from the head's top into the chart under it (2 px up, 16 down; 14 to
   the left, 4 to the right, the head's edge), and the head lets it: it holds only the symbol, the last price and the change. */
@media (max-width: 767px) {
  html.cdp-tb2 body.cdp .cdp-grid:not([data-layout="single"]) .cdp-cell-head { overflow: visible; }
  html.cdp-tb2 body.cdp .cdp-cell-head .cdp-cell-x { z-index: 2; }
  html.cdp-tb2 body.cdp .cdp-cell-head .cdp-cell-x::before { content: ""; position: absolute; inset: -3px -5px -17px -15px; }   /* from inside the 1 px border */
}
