/* Cella007FX PRO app.css — palette tokens, typography, desktop/tablet layout, state classes, UI shell (SPEC 2.1-2.4, App. D).
   Owner: WP-6. Mobile (< 768 px) rules live in mobile.css. Every selector here maps to an id/class in SPEC 2.5 or to a
   class documented in SPEC 2.4 / 4.5 / 7.1 / Appendix D. #overlay gets its z-index (10) inline from chart/overlay.js —
   never set a lower one here; #countdown sits at z-index 20 above it. */

/* ---- 2.1 palette tokens ------------------------------------------------------------------------------------- */
:root {
  --bg-0:#000000; --bg-1:#121315; --bg-2:#1A1B1E; --bg-3:#232428;
  --line:#2A2B30; --grid:#1A1A1A;
  /* neutral grey-black shell on a pure black chart (owner's reference, 7 Nov); muted text meets WCAG AA (4.5:1) on bg-0..bg-3 */
  --text-0:#E6EDF3; --text-1:#A9B4C3; --text-2:#8894A4;
  --gold:#FFB000; --gold-2:#FFD166; --gold-dim:rgba(255,176,0,.14); --gold-fill:#FFB000;
  --up:#22C55E; --down:#F23645; --warn:#F5A524; --info:#4C9AFF; --err:#F23645; --ok:#22C55E; --entry:#8B92FF;
  --candle-up:#22C55E; --candle-down:#F23645;   /* same pair as --up / --down since 7 Nov: one green, one red everywhere (owner's request) */
  --sess-asia:rgba(245,165,36,.07); --sess-london:rgba(76,154,255,.07); --sess-ny:rgba(242,54,69,.07);
  --ema20:#FFB000; --ema50:#4C9AFF; --ema200:#B8B4AD; --bb:#9C6ADE; --rsi:#B39DDB; --macd:#2962FF; --macd-sig:#FF6D00;
  --atr:#26C6DA; --stoch-k:#4C9AFF; --stoch-d:#F5A524; --vwap:#FFD166;
  /* one hue per meaning: gold = EMA20 / brand, drawings in the text colour, alerts pink, day levels the same grey as pivots */
  --alert:#FF5FD2; --draw:#E6EDF3; --level-day:#90A4AE; --level-pivot:#90A4AE; --line-ctl:#566274;
  --radius:6px; --hdr-h:48px; --tb-h:36px; --legend-h:22px; --status-h:22px; --panel-w:300px; --tap:24px;
  --font-ui:-apple-system,"Segoe UI",Inter,Roboto,Helvetica,Arial,sans-serif;
  --font-mono:"JetBrains Mono","SF Mono",Consolas,"Roboto Mono",monospace;
  /* derived (not in the spec table; used only by this stylesheet) */
  --ok-dim:rgba(34,197,94,.16); --warn-dim:rgba(245,165,36,.16); --err-dim:rgba(242,54,69,.16); --info-dim:rgba(76,154,255,.16);
  --shadow:0 10px 30px rgba(0,0,0,.45);
  color-scheme: dark;
}
html[data-theme="light"] {
  --bg-0:#FFFFFF; --bg-1:#F4F5F7; --bg-2:#E9EBEF; --bg-3:#DDE0E6; --line:#D5D9E0; --grid:#EEF0F3; --line-ctl:#7E8896;
  --text-0:#1B1F26; --text-1:#3C4450; --text-2:#5A6371;
  --gold:#8F5B00; --gold-2:#C77F00; --gold-dim:rgba(143,91,0,.12); --gold-fill:#FFB000;          /* gold as INK is dark; the primary button keeps the bright fill */
  --up:#15803D; --ok:#15803D; --down:#C8232C; --err:#C8232C; --warn:#9A5B00; --info:#1F5FCC; --entry:#4F56D6;
  --candle-up:#16A34A; --candle-down:#E11D2E;
  --ok-dim:rgba(11,122,80,.06); --warn-dim:rgba(154,91,0,.08); --err-dim:rgba(200,35,44,.08); --info-dim:rgba(31,95,204,.08);
  --ema20:#C77F00; --ema50:#1F5FCC; --ema200:#6B6560; --bb:#6B4BB0; --rsi:#7A5CBF; --macd:#1E4FD6; --macd-sig:#C25400;
  --atr:#0E8A96; --stoch-k:#1F5FCC; --stoch-d:#9A5B00; --vwap:#A86400;
  --alert:#B5179E; --draw:#1B1F26; --level-day:#5F7682; --level-pivot:#5F7682;
  --sess-asia:rgba(245,165,36,.10); --sess-london:rgba(76,154,255,.10); --sess-ny:rgba(200,35,44,.10);
  --shadow:0 10px 30px rgba(20,24,32,.18);
  color-scheme: light;
}
@media (pointer: coarse) { :root { --tap: 36px; } }   /* touch devices (phones AND tablets): finger-size row buttons and chips */

/* ---- base / reset ------------------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
/* iOS Safari inflates text in any block it thinks is too wide for the screen (the weekend-banner overflow of 7 Nov 2026
   made the legend balloon and overlap); the layout sets every size itself, so never let the browser rescale fonts */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: var(--bg-0); color: var(--text-0);
  font: 13px/1.35 var(--font-ui);
  -webkit-font-smoothing: antialiased; overflow: hidden; overscroll-behavior: none;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--info); }
::selection { background: var(--gold-dim); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.up { color: var(--up); } .down { color: var(--down); } .flat { color: var(--text-1); }
.spread-ok { color: var(--ok); } .spread-warn { color: var(--warn); } .spread-bad { color: var(--err); }
.gold { color: var(--gold); }
.dim { color: var(--text-2); }

/* ---- 2.3 layout grid (desktop >= 1024; tablet 768-1023 overrides below) ------------------------------------ */
#app {
  display: grid;
  grid-template-rows: var(--hdr-h) var(--tb-h) var(--legend-h) minmax(0, 1fr) auto var(--status-h);
  grid-template-areas: "hdr" "tb" "lg" "stage" "banner" "status";
  /* ONE column that can never grow past the window: with the implicit `auto` column a one-line nowrap child (the
     weekend banner, 670 px) set the column's min-content and pushed header, chart and price scale off a phone screen */
  grid-template-columns: minmax(0, 1fr);
  height: 100vh; height: 100dvh; width: 100%; overflow: hidden;
}
#app > * { min-width: 0; }                                     /* grid items: shrink below their content, never widen the track */
#hdr { grid-area: hdr; } #toolbar { grid-area: tb; } #legend { grid-area: lg; }
#stage { grid-area: stage; } #banner { grid-area: banner; } #statusbar { grid-area: status; }
#stage { display: grid; grid-template-columns: minmax(0, 1fr) var(--panel-w); min-height: 0; min-width: 0; position: relative; }
#stage.panel-closed { grid-template-columns: minmax(0, 1fr); }

/* ---- header --------------------------------------------------------------------------------------------------- */
#hdr {
  display: flex; align-items: center; gap: 16px; padding: 0 12px; min-width: 0;
  background: var(--bg-1); border-bottom: 1px solid var(--line);
}
#brand { font-size: 15px; font-weight: 700; letter-spacing: .12em; white-space: nowrap; color: var(--text-0); }
#brand-sym { margin-left: 12px; font-size: 11px; font-weight: 500; letter-spacing: .08em; color: var(--text-2); }
.pro-tag { display: inline-block; margin-left: 7px; padding: 0 5px; font-size: 9px; line-height: 14px; font-weight: 700; letter-spacing: .16em; color: var(--gold); border: 1px solid var(--gold); border-radius: 3px; vertical-align: 2px; }
/* first-visit guide (ui/welcome.js) */
.welcome ul { margin: 0 0 12px; padding-left: 18px; }
.welcome li { margin: 8px 0; line-height: 1.5; font-size: 13px; }
.welcome li b { color: var(--gold); font-weight: 600; }
.welcome .welcome-note { margin: 0; }
/* 11 Nov 2026 (audit L2): the welcome's account question — two big buttons, the picked one gold */
.welcome .wel-acct { margin: 0 0 10px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2); }
.welcome .wel-acct-q { margin: 0 0 8px; font-size: 13px; line-height: 1.45; }
.welcome .wel-acct-q b { color: var(--text-0); font-weight: 600; }
.welcome .wel-acct-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.welcome .wel-acct-b { min-height: 44px; white-space: normal; line-height: 1.25; }
.welcome .wel-acct-b[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
/* 11 Nov 2026 (review G3-UX-3): "Account not chosen" row on the Lot size tab and the setup card (widgets/calc.js accountAskRow) */
.acct-ask { margin: 6px 0; padding: 8px 10px; border: 1px solid var(--warn); border-radius: 8px; background: var(--warn-dim); }
.acct-ask-q { margin: 0 0 6px; font-size: 12px; line-height: 1.4; color: var(--text-0); }
.acct-ask-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.acct-ask-b { min-height: 44px; white-space: normal; line-height: 1.25; }
/* review G3-UX-4: the header price while prices are paused (DELAYED / OFFLINE) */
#hq-bid.stale { opacity: .5; }
/* a toast that does something when tapped (ui/toast.js onClick) */
.toast.action { cursor: pointer; }
.toast.action .toast-msg::after { content: " \203A"; color: var(--text-2); }
#hdr-quote, #hdr-stats { display: flex; align-items: baseline; gap: 12px; min-width: 0; white-space: nowrap; overflow: hidden; font-size: 13px; color: var(--text-1); }
#hdr-quote { flex: 0 0 auto; overflow: visible; }            /* the price is the one thing that must never truncate */
#hdr-stats { flex: 1 1 0; }                                  /* the trend strip yields instead */
@media (min-width: 768px) and (max-width: 1100px) { #hdr-stats .mtf-hdr-tfs { display: none; } }   /* narrow desktop / tablet: keep the TREND word, drop the five chips (id selector beats the later .mtf-hdr-tfs rule) */
@media (min-width: 768px) and (max-width: 900px) { #brand-sym { display: none; } }
#hdr-quote:empty, #hdr-stats:empty { display: none; }
#hq-bid { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 600; color: var(--text-0); }
#hq-spread { font-size: 13px; }
/* header MTF ribbon strip (widgets/header.js renders into #hdr-stats) */
.mtf-hdr-bias { font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.mtf-hdr-bias.up { color: var(--up); } .mtf-hdr-bias.down { color: var(--down); } .mtf-hdr-bias.flat { color: var(--text-1); }
.mtf-hdr-score { font-size: 11px; color: var(--text-2); }
.mtf-hdr-tfs { display: inline-flex; align-items: center; gap: 6px; }
.mtf-hdr-tf { font-size: 11px; line-height: 22px; min-height: min(var(--tap), 30px); padding: 0 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-3); color: var(--text-1); white-space: nowrap; font-family: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mtf-hdr-tf:hover { border-color: var(--text-2); }
.mtf-hdr-tf.up { color: var(--up); border-color: rgba(34,197,94,.45); }
.mtf-hdr-tf.down { color: var(--down); border-color: rgba(242,54,69,.45); }
.mtf-hdr-tf.flat { color: var(--text-1); }
.mtf-hdr-tf.pending { color: var(--text-2); }
.mtf-hdr-tf.active { font-weight: 700; box-shadow: inset 0 0 0 1px var(--gold); }
#hdr-right { margin-left: auto; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
#clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
#clk-main { font-size: 13px; color: var(--text-0); }
#clk-sess { font-size: 11px; color: var(--text-1); }
#clk-sess.soon { color: var(--warn); }                 /* London / NY opens within 30 min */
#btn-panel { font-size: 18px; line-height: 1; padding: 3px 8px; }
/* 15 Nov 2026 (group 13): after the first-visit guide on a phone the sheet stays closed and ≡ glows three times
   (ui/welcome.js nudgePanelButton); a still gold ring when the device asks for less motion. The ring is drawn INSIDE
   the button (inset): on a portrait phone the button sits on the header's top edge and #hdr clips (review B1) */
#btn-panel.nudge { animation: btnNudge 1.2s ease-in-out 3; }
@keyframes btnNudge { 0%, 100% { box-shadow: inset 0 0 0 0 var(--gold); } 50% { box-shadow: inset 0 0 0 2px var(--gold); } }
@media (prefers-reduced-motion: reduce) { #btn-panel.nudge { animation: none; box-shadow: inset 0 0 0 2px var(--gold); } }

/* ---- 2.4 source pill ---------------------------------------------------------------------------------------- */
#srcpill {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 11px;
  font-size: 11px; font-weight: 600; letter-spacing: .06em; white-space: nowrap; cursor: default; user-select: none;
  background: var(--bg-3); color: var(--text-1); border: 1px solid var(--line);
}
#srcpill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
#srcpill.st-init     { color: var(--text-1); }
#srcpill.st-live     { color: var(--ok);   background: var(--ok-dim);   border-color: transparent; }
#srcpill.st-live::before { animation: pulse 1.6s ease-in-out infinite; }
#srcpill.st-delayed  { color: var(--warn); background: var(--warn-dim); border-color: transparent; }
#srcpill.st-paused   { color: var(--warn); background: var(--warn-dim); border-color: transparent; }
#srcpill.st-closed   { color: var(--text-1); background: var(--bg-3); }
#srcpill.st-fallback { color: var(--warn); background: var(--warn-dim); border-color: var(--warn); }
#srcpill.st-quote    { color: var(--err);  background: var(--err-dim);  border-color: transparent; }
#srcpill.st-offline  { color: var(--err);  background: var(--err-dim);  border-color: var(--err); }

/* ---- toolbar -------------------------------------------------------------------------------------------------- */
#toolbar {
  display: flex; align-items: center; gap: 10px; padding: 0 8px; min-width: 0; overflow: hidden;
  background: var(--bg-1); border-bottom: 1px solid var(--line);
}
#toolbar > div { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }
#toolbar > div + div { padding-left: 10px; border-left: 1px solid var(--line); }
#tb-right { margin-left: auto; }
#toolbar .btn { padding: 4px 8px; min-height: 26px; font-size: 12px; font-weight: 500; }
#tf-strip .btn { min-width: 34px; padding: 4px 6px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
#tb-tools .btn, #tb-toggles .btn, #tb-right .btn { min-width: 30px; }
#tb-tools:not(.open) [data-tool], #tb-tools:not(.open) #btn-tool-cancel { display: none; }   /* five drawing tools fold behind one Draw button */
@media (min-width: 768px) and (max-width: 1100px) { #tb-toggles .btn, #tb-tools .btn, #tb-right .btn { font-size: 11px; padding: 3px 6px; } }
/* tablet / drawer range: the strip can exceed the width (esp. with Draw open) - make it scrollable instead of clipped */
@media (min-width: 768px) and (max-width: 1023px) {
  #toolbar { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  #toolbar::-webkit-scrollbar { display: none; }
  #tb-tools.open ~ #tb-toggles { display: none; }
  #tf-strip .btn { min-width: 30px; padding: 3px 4px; }
}
/* review UX-2 (11 Nov 2026): the #tb-view icons made the bar ~86 px wider, so at 1024-1199 px with Draw open Help and
   Fullscreen were clipped: same treatment as the tablet range (toggles step aside while drawing, the bar may scroll) */
@media (min-width: 1024px) and (max-width: 1199px) {
  #toolbar { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  #toolbar::-webkit-scrollbar { display: none; }
  #tb-tools.open ~ #tb-toggles { display: none; }
}
#tb-type select { min-height: 26px; padding: 2px 6px; font-size: 12px; font-weight: 500; }
#btn-tool-cancel[hidden] { display: none !important; }
/* view buttons (11 Nov 2026): Zoom to area + Auto fit, inline SVG on currentColor (same in both themes, every OS) */
#toolbar .btn.tb-icon { min-width: 30px; padding: 3px 6px; }
.tb-icon svg { display: block; width: 18px; height: 18px; flex: 0 0 auto; }
#tb-view:empty { display: none; }                    /* phone: the buttons live in #tb-right */
@media (pointer: coarse) { #toolbar .btn.tb-icon { min-width: 36px; min-height: 36px; } }

/* ---- buttons -------------------------------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  font: 500 12px/1.2 var(--font-ui); color: var(--text-0); background: var(--bg-3);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 12px; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s; -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: var(--text-2); background: var(--bg-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--gold-fill); border-color: var(--gold-fill); color: #000000; font-weight: 600; }
.btn.primary:hover { background: var(--gold-2); border-color: var(--gold-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-1); }
.btn.ghost:hover { color: var(--text-0); background: var(--bg-3); border-color: transparent; }
.btn.danger { color: var(--err); }
button.active, .btn.active, .btn[aria-pressed="true"] { background: var(--gold-dim); border-color: var(--gold); color: var(--gold); }
/* review UX-1 (11 Nov 2026): touch browsers keep :hover on the last tapped button, and ".btn.ghost:hover" (3 classes)
   beat the 2-class active rule, so the Zoom button / the tapped TF key stayed grey. Same specificity, later = wins. */
.btn.ghost.active, .btn.ghost[aria-pressed="true"] { background: var(--gold-dim); border-color: var(--gold); color: var(--gold); }
.btn.sm { padding: 2px 7px; min-height: var(--tap); min-width: var(--tap); font-size: 11px; }
/* text-link button (status bar Help, setup "change") */
.lnk { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: var(--info); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.lnk:hover { color: var(--text-0); }
.kbd {
  display: inline-block; min-width: 20px; padding: 1px 6px; text-align: center; font: 11px var(--font-mono);
  color: var(--text-0); background: var(--bg-3); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px;
}

/* ---- legend --------------------------------------------------------------------------------------------------- */
/* 16 Nov 2026 (group 12): with more than ~6 indicators the desktop line was cut off at the right edge (overflow hidden),
   so the last indicators were never seen. It now scrolls sideways like the phone legend (mouse wheel or trackpad, see
   ui/legend.js), with no scrollbar; while there is more than fits (.lg-more) the right edge fades out. */
#legend {
  display: flex; align-items: center; gap: 14px; padding: 0 10px; min-width: 0; font-size: 12px; white-space: nowrap;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain;
  color: var(--text-1); background: var(--bg-0); border-bottom: 1px solid var(--line);
}
#legend::-webkit-scrollbar { display: none; }
#legend > * { flex: none; }
#legend.lg-more { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); }
#legend.lg-more::after { content: ''; flex: none; width: 10px; }
#legend .lg-tf { color: var(--gold); font-weight: 600; letter-spacing: .04em; }
#legend .lg-ohlc { color: var(--text-1); }
#legend .lg-ind { display: inline-flex; gap: 5px; align-items: baseline; }
#legend .lg-ind .lg-name { color: var(--text-2); }

/* ---- stage / chart ------------------------------------------------------------------------------------------- */
#chart-wrap { position: relative; overflow: hidden; min-width: 0; min-height: 0; background: var(--bg-0); }
#chart { position: absolute; inset: 0; width: 100%; height: 100%; }
#overlay { position: absolute; left: 0; top: 0; pointer-events: none; }
body.tool-active #chart-wrap { cursor: crosshair; }
/* zoom-to-area mode (tools/zoom-area.js): a layer over the main plot area takes the drag, so the chart neither pans nor
   scales from it and drawing tools never see it; above #overlay (10), below #countdown (20) and the LWC logo (49) */
#zoom-layer { position: absolute; z-index: 12; cursor: crosshair; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.zoom-box { position: absolute; pointer-events: none; border: 1px dashed var(--gold); background: var(--gold-dim); }
.zoom-hint {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 16px); pointer-events: none;
  display: flex; align-items: center; gap: 8px; padding: 2px 3px 2px 12px; font-size: 12px; line-height: 16px; white-space: nowrap;
  color: var(--text-0); background: var(--bg-3); border: 1px solid var(--gold); border-radius: 16px; box-shadow: var(--shadow);
}
.zoom-hint[hidden] { display: none; }
.zoom-hint > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* review UX-3: the way out is on screen (a phone has no Esc); the only part of the hint that takes a pointer */
.zoom-cancel {
  pointer-events: auto; flex: 0 0 auto; min-height: 26px; padding: 3px 10px; font: 600 12px/1 var(--font-ui); cursor: pointer;
  color: var(--gold); background: transparent; border: 1px solid var(--gold); border-radius: 13px;
}
.zoom-cancel:hover { background: var(--gold-dim); }
@media (pointer: coarse) { .zoom-cancel { min-height: 32px; padding: 3px 12px; } }
#countdown {
  position: absolute; right: 0; z-index: 20; pointer-events: none; padding: 1px 6px; font-size: 11px; line-height: 16px;
  color: var(--text-0); background: var(--bg-3); border: 1px solid var(--line); border-right: 0; border-radius: 3px 0 0 3px;
}
#countdown.urgent { color: var(--err); border-color: var(--err); animation: pulse 1s ease-in-out infinite; }
/* price sonar (widgets/sonar.js, 11 Nov 2026): a solid dot with a white ring at the live price on the newest bar (it
   was a hollow ring until 13 Nov) + a halo that grows and fades every 2 s + a thin solid line, fading in towards the
   price axis (solid and faded so it never reads as a dashed SL / TP / bid / ask level). The clip box = the main plot
   area (axis excluded), z 11: above the drawings overlay (10), below the zoom layer (12) and the countdown pin (20).
   JS only moves #sonar (transform, snapped to device pixels), sets the line width and the state classes; the pulse is
   a transform / opacity keyframe. Never takes a pointer. */
#sonar-clip { position: absolute; z-index: 11; overflow: hidden; pointer-events: none; contain: strict; }
body.zoom-drawing #sonar-clip { visibility: hidden; }
.sonar { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; --sonar: var(--gold); will-change: transform; }
/* 15 Nov 2026 (group 11, F4): the dot, its halo and its line take the CANDLE's colour (--candle-up / --candle-down, the
   tokens chart-core paints the candles with). They used --up / --down, the darker text greens / reds of the light theme,
   so on a white chart the dot was a darker shade than the candle it sits on. The line chart stays gold. */
.sonar.up { --sonar: var(--candle-up); } .sonar.down { --sonar: var(--candle-down); } .sonar.flat { --sonar: var(--gold); }
.sonar > span { position: absolute; display: block; pointer-events: none; }
/* 13 Nov 2026 (owner request, option A; main session, not a group 10 builder): a SOLID dot in the candle's colour with a
   white ring, so it reads on a candle body of the same colour in both themes (the hollow ring vanished there); the 1 px
   dark edge keeps the white ring visible on the light theme's white chart. Size unchanged (9 px, SONAR.dot). */
.sonar-dot { left: -4.5px; top: -4.5px; width: 9px; height: 9px; box-sizing: border-box; border-radius: 50%; border: 1.5px solid #fff; background: var(--sonar); box-shadow: 0 0 0 1px rgba(0, 0, 0, .45); }
.sonar-ring { left: -14px; top: -14px; width: 28px; height: 28px; border-radius: 50%; background: var(--sonar); opacity: .22; transform: scale(.6); }
.sonar.live .sonar-ring { animation: sonar-ping 2s cubic-bezier(0, 0, .2, 1) infinite; will-change: transform, opacity; }
.sonar-line { left: 7px; top: -0.5px; height: 1px; opacity: .8; background: linear-gradient(to right, transparent, var(--sonar)); }
.sonar-line[hidden] { display: none; }
/* feed stale (DELAYED / QUOTE_ONLY: the candle close stopped moving): no pulse, the dot stays at full strength */
.sonar.stale .sonar-ring, .sonar.closed .sonar-ring { display: none; }
/* market closed / no feed: no pulse, a dim dot and line so it does not look live */
.sonar.closed .sonar-dot { opacity: .5; }
.sonar.closed .sonar-line { opacity: .4; }
/* 15 Nov 2026 (group 11, F3): the dot stands on a Buy / Sell label (drawn one layer below, z 10): it goes see-through
   and the halo stops, so the label's word stays readable. The dot stays on the price, and the line and the axis label
   still show it. Set by widgets/sonar.js (.over, with hysteresis); after .closed so it wins there too. */
.sonar.over .sonar-dot { opacity: .35; box-shadow: none; }
.sonar.over .sonar-ring { display: none; }
@keyframes sonar-ping { 0% { transform: scale(.3); opacity: .55; } 80%, 100% { transform: scale(1); opacity: 0; } }
/* volume label (chart/chart-core.js _volCaption; 12 Nov 2026, group 8 items 6 + 7): says what the volume bars are
   ("PAXG volume" / "Tick volume") on its own pill in the chart background colour, so bars, lines and price tags never
   run through the words, in both themes. JS sets the text and one transform (the top-left corner of the volume area).
   z 11 like the sonar: above the drawings overlay (10), below the zoom layer (12), the countdown pin (20) and the phone
   sheet. Fixed 16 px height: chart-core places it without reading layout. Never takes a pointer. */
#vol-label {
  position: absolute; left: 0; top: 0; z-index: 11; pointer-events: none; box-sizing: border-box; height: 16px; padding: 0 6px;
  font: 500 10px/14px var(--font-ui); letter-spacing: .02em; white-space: nowrap; user-select: none; -webkit-user-select: none;
  color: var(--text-1); background: var(--bg-0); border: 1px solid var(--line); border-radius: 8px;
}
#vol-label[hidden] { display: none; }
body.zoom-drawing #vol-label { visibility: hidden; }
/* source note (chart/chart-core.js setWatermark; 13 Nov 2026, group 9 item 10a): "Gold spot, PAXG corrected" at the
   top-left of the chart. It was text painted on the chart canvas, so a Supply area box, the PDH line or an alert line
   ran through the words; now it sits on its own pill in the chart background colour, like #vol-label, in both themes.
   Same corner, same 11 px words; 14 px tall so it covers the first candles no more than the words did. z 11: above the
   drawings overlay (10). JS only sets the words, max-width (the plot width) and, for the banner, the right inset.
   .big = a degraded feed (DELAYED / FALLBACK / QUOTE ONLY): the banner centred at the top of the plot. Never takes a
   pointer. */
#src-note {
  position: absolute; left: 4px; top: 0; z-index: 11; pointer-events: none; box-sizing: border-box; height: 14px; padding: 0 3px;
  max-width: calc(100% - 72px); font: 400 11px/14px var(--font-ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  user-select: none; -webkit-user-select: none; color: var(--text-2); background: var(--bg-0); border-radius: 3px;
}
#src-note.big {
  left: 0; right: 64px; top: 2px; width: fit-content; margin: 0 auto; height: auto; padding: 1px 8px; line-height: 1.25;
  color: var(--text-1); border: 1px solid var(--line); border-radius: 10px;
}
#src-note[hidden] { display: none; }
#chart-empty {
  position: absolute; inset: 0; z-index: 15; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: color-mix(in srgb, var(--bg-0) 72%, transparent);
}
#chart-empty .card { width: min(360px, 100%); text-align: center; padding: 20px; box-shadow: var(--shadow); }
#chart-empty-msg { margin: 10px 0 4px; color: var(--text-0); }
#chart-empty .tried { font-size: 11px; color: var(--text-2); margin-bottom: 10px; }
#chart-empty-retry { margin-top: 6px; }
.spinner {
  width: 26px; height: 26px; margin: 0 auto; border-radius: 50%;
  border: 3px solid var(--bg-3); border-top-color: var(--gold); animation: spin .9s linear infinite;
}
#chart-empty.is-offline .spinner { display: none; }

/* ---- panel ---------------------------------------------------------------------------------------------------- */
#panel {
  display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; position: relative;
  background: var(--bg-1); border-left: 1px solid var(--line);
}
#panel-grip { display: none; }
/* width handle (ui/panel-resize.js): an 8 px strip along the panel's left edge, gold while hovered / dragged */
#panel-resizer { position: absolute; left: 0; top: 0; bottom: 0; width: 8px; z-index: 5; cursor: col-resize; touch-action: none; }
#panel-resizer::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: transparent; transition: background .12s; }
#panel-resizer:hover::after, #panel-resizer:focus-visible::after, body.panel-resizing #panel-resizer::after { background: var(--gold); }
#panel-resizer:focus-visible { outline: none; }
body.panel-resizing { cursor: col-resize; user-select: none; }
body.panel-resizing #chart-wrap, body.panel-resizing #panel > section { pointer-events: none; }
#panel-tabs {
  display: flex; flex: 0 0 auto; gap: 0; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); background: var(--bg-1);
}
#panel-tabs::-webkit-scrollbar { display: none; }
#panel-tabs .tab {
  flex: 1 0 auto; min-height: 34px; padding: 6px 5px; font: 500 11px var(--font-ui); color: var(--text-1);   /* 6 tabs must fit the 300 px panel */
  background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; white-space: nowrap;
}
#panel-tabs .tab:hover { color: var(--text-0); }
#panel-tabs .tab[aria-selected="true"], #panel-tabs .tab.active { color: var(--gold); border-bottom-color: var(--gold); background: transparent; }
#panel > section { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 10px; overscroll-behavior: contain; }
#panel > section > div + div { margin-top: 10px; }
#panel h3, .card-title { margin: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-1); }
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.card + .card { margin-top: 10px; }
.card table { width: 100%; border-collapse: collapse; font-size: 12px; }
.card td, .card th { padding: 3px 4px; text-align: left; border-bottom: 1px solid var(--line); }
.card tr:last-child td { border-bottom: 0; }
.card td.num, .card th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.note { font-size: 11px; color: var(--text-2); }
.settings-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* tablet 768-1023: the panel is a right drawer over the chart (SPEC 2.3), toggled by #btn-panel */
@media (min-width: 768px) and (max-width: 1023px) {
  #stage { grid-template-columns: minmax(0, 1fr); }
  #panel.drawer {
    position: absolute; top: 0; right: 0; bottom: 0; width: min(var(--panel-w), 85vw); z-index: 30;
    box-shadow: var(--shadow); transform: translateX(100%); transition: transform .22s ease; visibility: hidden;
  }
  #panel.drawer.open { transform: none; visibility: visible; }
}
@media (min-width: 1024px) {
  #stage.panel-closed > #panel { display: none; }
}

/* ---- indicators list / drawings list / alerts list hooks (WP-3 / WP-4 / WP-5 render, WP-6 styles) --------- */
.ind-row, .draw-row, .alert-row { display: flex; align-items: center; gap: 6px; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.ind-row:last-child, .draw-row:last-child, .alert-row:last-child { border-bottom: 0; }
.ind-swatch { width: 10px; height: 10px; border-radius: 2px; flex: 0 0 auto; }
.ind-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ind-pane, .ind-row .dim { font-size: 10px; color: var(--text-2); }
.ind-row .btn.ghost { padding: 2px 5px; min-height: var(--tap); min-width: var(--tap); }
.ind-empty { padding: 8px 0; color: var(--text-2); font-size: 12px; }
.ind-add-row select { flex: 1 1 auto; min-width: 0; }
.ind-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

/* ---- WP-5 widget / WP-4 list hooks (rendered by widgets/*.js, tools/alerts.js, tools/draw-ui.js; WP-9 integration) - */
.badge { display: inline-block; padding: 0 6px; border-radius: 9px; font-size: 10px; line-height: 16px; background: var(--bg-3); color: var(--text-1); }
.badge.fired { background: var(--warn-dim); color: var(--warn); }
.alert-row.off { opacity: .55; }
.alert-row .mono { font-variant-numeric: tabular-nums; }
/* 12 Nov 2026 (group 8, item 8): the "what it watches" words are long on a one-price feed ('ask (est.) = price + 25 pts').
   They wrap inside their own column and leave the note its room, so a 320 px row neither overflows nor hides the note. */
.alert-row .al-watch { flex: 0 1 auto; min-width: 0; }
.alert-row .ind-name { flex: 1 0 3.5em; }
.alert-row .ind-name:empty { flex-basis: 0; }
/* 13 Nov 2026 (review UX8-3): "hit while away about 12 Nov 22:30" has its own line under the row (indented past the
   on / off box). Inside the row it squeezed the watch words and the note into three thin columns at 320 px. */
.alert-row.has-away { border-bottom: 0; padding-bottom: 0; }
.al-away-line { padding: 0 0 5px 26px; border-bottom: 1px solid var(--line); font-size: 12px; }
.al-away-line:last-child { border-bottom: 0; }
.badge.away { white-space: normal; }
#sess-table tr.open td { color: var(--up); font-weight: 600; background: transparent; }   /* gold is reserved for brand / selection / primary action */
#pv-table tr.pp td { color: var(--text-0); font-weight: 600; }
.regime { font-weight: 600; letter-spacing: .04em; }
.calc-lots { margin: 6px 0; }
.calc-lots .big { font-size: 22px; font-weight: 600; color: var(--text-0); }
.calc-adv { margin-top: 6px; font-size: 12px; }
.calc-adv > summary { cursor: pointer; font-size: 11px; color: var(--text-1); margin-bottom: 6px; }
.calc-out { margin-top: 8px; }
#w-countdown-val { font-size: 18px; font-weight: 600; color: var(--text-0); }
#q-src.state-live { color: var(--ok); } #q-src.state-delayed, #q-src.state-paused, #q-src.state-fallback { color: var(--warn); }
#q-src.state-quote_only, #q-src.state-offline { color: var(--err); } #q-src.state-closed, #q-src.state-init { color: var(--text-1); }
.draw-head { justify-content: space-between; margin-bottom: 4px; }
.draw-count { font-size: 11px; color: var(--text-1); }
.draw-empty { padding: 8px 0; color: var(--text-2); font-size: 12px; }
.draw-row { cursor: pointer; }
.draw-row.active { background: var(--gold-dim); }
.draw-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.draw-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draw-price { font-size: 11px; color: var(--text-2); }
.draw-row .btn.ghost { padding: 2px 5px; min-height: var(--tap); min-width: var(--tap); }
.draw-row:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

/* ---- forms (2.4 helpers) --------------------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; min-width: 0; }
.field label { font-size: 11px; color: var(--text-1); }
.field input, .field select, .field textarea, .ind-add-row select, #tb-type select {
  min-height: 30px; padding: 4px 8px; font-size: 13px; color: var(--text-0); background: var(--bg-0);
  border: 1px solid var(--line); border-radius: 4px; width: 100%; min-width: 0;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); }   /* the global :focus-visible ring stays */
.field :focus-visible { outline-offset: 0; }
.field input[type="checkbox"], .field input[type="radio"] { width: 16px; height: 16px; min-height: 0; margin: 0; accent-color: var(--gold); }
.field input[type="color"] { padding: 2px; height: 30px; }
.field.check { flex-direction: row; align-items: center; gap: 8px; }
.field.check label { font-size: 13px; color: var(--text-0); }
.field.invalid input, .field.invalid select { border-color: var(--err); }
.field .hint { font-size: 11px; color: var(--text-2); }
/* 11 Nov 2026 (review G2-W12): a checkbox row's hint goes UNDER its label (indented to the label), not beside it — at
   320 px the side-by-side layout squeezed "Sound for indicator signals" to one word per line. The box never shrinks. */
.field.check > input[type="checkbox"] { flex-shrink: 0; }
.field.check:not(.switch):has(> .hint) { flex-wrap: wrap; row-gap: 2px; }
.field.check:not(.switch):has(> .hint) > label { flex: 1 1 0; min-width: 0; }
.field.check:not(.switch):has(> .hint) > .hint { flex: 0 0 100%; padding-left: 24px; }
/* titled switch rows (modal.buildForm bool + hint, e.g. SMC settings): text left, a pill toggle right, divider between rows */
.field.check.switch { flex-direction: row-reverse; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; margin: 0; }
.field.check.switch + .field.check.switch { border-top: 1px solid var(--line); }   /* dividers only BETWEEN switch rows (:last-of-type matched any div) */
.field.check.switch + .field:not(.switch) { margin-top: 10px; }                     /* breathing room before the numeric fields */
.field.check.switch .check-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.field.check.switch .check-text label { font-size: 13px; font-weight: 600; color: var(--text-0); cursor: pointer; }
.field.check.switch input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: 0 0 auto; width: 38px; height: 22px; margin: 0; border-radius: 11px; position: relative; cursor: pointer;
  background: var(--bg-3); border: 1px solid var(--line); transition: background .15s, border-color .15s;
}
.field.check.switch input[type="checkbox"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-1); transition: transform .15s, background .15s; }
.field.check.switch input[type="checkbox"]:checked { background: var(--gold-fill); border-color: var(--gold-fill); }
.field.check.switch input[type="checkbox"]:checked::after { transform: translateX(16px); background: #000000; }
.field.check.switch input[type="checkbox"]:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row > * { min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button { opacity: .5; }
select { background-color: var(--bg-0); color: var(--text-0); border: 1px solid var(--line); border-radius: 4px; }

/* ---- banner ---------------------------------------------------------------------------------------------------- */
#banner {
  display: flex; align-items: center; gap: 10px; padding: 4px 12px; min-height: 26px; font-size: 12px;
  border-top: 1px solid var(--line); background: var(--bg-2); color: var(--text-0);
}
#banner .banner-msg { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#banner .banner-details { padding: 1px 7px; min-height: 24px; font-size: 11px; }   /* fixed: the one-line banner must not grow on touch screens */
#banner.lvl-info { background: var(--info-dim); border-top-color: var(--info); }
#banner.lvl-warn { background: var(--warn-dim); border-top-color: var(--warn); }
#banner.lvl-err  { background: var(--err-dim);  border-top-color: var(--err); }

/* ---- status bar ---------------------------------------------------------------------------------------------- */
#statusbar {
  display: flex; align-items: center; gap: 0; padding: 0 10px; min-width: 0; overflow: hidden; white-space: nowrap;
  font-size: 11px; color: var(--text-1); background: var(--bg-1); border-top: 1px solid var(--line);
}
#statusbar .sb { display: inline-flex; align-items: center; }
#statusbar .sb + .sb::before { content: "·"; margin: 0 7px; color: var(--text-2); }
#statusbar .sb-debug { margin-left: 12px; font-family: var(--font-mono); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
#statusbar .sb-right { margin-left: auto; color: var(--text-2); flex: 0 0 auto; }
#statusbar .sb + .sb-right::before { content: none; margin: 0; }   /* same specificity as the "·" rule, declared later: no stray dot */
#statusbar .ok { color: var(--ok); } #statusbar .bad { color: var(--err); } #statusbar .warn { color: var(--warn); }

/* ---- modal ---------------------------------------------------------------------------------------------------- */
#modal-root {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(0, 0, 0, .55); overscroll-behavior: contain;
}
body.modal-open { overflow: hidden; }
.modal {
  display: flex; flex-direction: column; width: min(440px, 100%); max-height: min(90vh, 90dvh);
  background: var(--bg-2); color: var(--text-0); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  animation: modalIn .16s ease-out;
}
.modal.wide { width: min(640px, 100%); }
.modal.stacked { display: none; }
.modal-hd { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.modal-hd h2 { margin: 0; flex: 1 1 auto; font-size: 14px; font-weight: 600; }
.modal-x { font-size: 18px; line-height: 1; padding: 2px 7px; }
.modal-bd { padding: 12px; overflow: auto; min-height: 0; }
.modal-bd p { margin: 0 0 8px; }
.modal-ft { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }

/* ---- toasts --------------------------------------------------------------------------------------------------- */
#toast-root {
  position: fixed; right: 12px; bottom: calc(var(--status-h) + 12px); z-index: 110; display: flex; flex-direction: column; gap: 8px;
  width: min(360px, calc(100vw - 24px)); pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 8px; padding: 9px 12px; font-size: 12px; line-height: 1.35;
  background: var(--bg-2); color: var(--text-0); border: 1px solid var(--line); border-left: 3px solid var(--info);
  border-radius: var(--radius); box-shadow: var(--shadow); cursor: pointer; animation: toastIn .18s ease-out; word-break: break-word;
}
.toast.info { border-left-color: var(--info); } .toast.success { border-left-color: var(--ok); }
.toast.warn { border-left-color: var(--warn); } .toast.error { border-left-color: var(--err); }
.toast .toast-msg { flex: 1 1 auto; min-width: 0; }
.toast .toast-n { font-size: 10px; color: var(--text-2); font-family: var(--font-mono); }
.toast.leaving { opacity: 0; transform: translateX(12px); transition: opacity .18s, transform .18s; }

/* ---- help overlay (#help, ui/shortcuts.js) --------------------------------------------------------------------- */
#help { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .5); }
.help-card { width: min(720px, 100%); max-height: min(90vh, 90dvh); overflow: auto; padding: 14px 16px; box-shadow: var(--shadow); background: var(--bg-2); }
.help-card h2 { margin: 0 0 10px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.help-card h2 .btn { margin-left: auto; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 4px 18px; }
.help-grid h4 { grid-column: 1 / -1; margin: 8px 0 2px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-1); }
.help-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; font-size: 12px; }
.help-row .keys { display: inline-flex; gap: 3px; flex: 0 0 auto; }
.help-row .desc { color: var(--text-1); }

/* ---- animations / motion --------------------------------------------------------------------------------------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes flashUp { 0% { color: var(--up); background: rgba(34,197,94,.25); } 100% { background: transparent; } }
@keyframes flashDown { 0% { color: var(--down); background: rgba(242,54,69,.25); } 100% { background: transparent; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.flash-up { animation: flashUp .3s ease-out; }
.flash-down { animation: flashDown .3s ease-out; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .flash-up, .flash-down { animation: none; }
}

/* ---- scrollbars (dark, thin) ------------------------------------------------------------------------------------ */
* { scrollbar-width: thin; scrollbar-color: var(--bg-3) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 4px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---- lib failure notice (main.js shows it when LWC is missing) --------------------------------------------------- */
#liberr { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; background: var(--bg-0); color: var(--text-0); font-size: 14px; }
/* ---- Trade setup infographic (widgets/setup.js) ---- */
#w-setup { margin-bottom: 10px; }
/* Side badge · since line · headline · price ladder + grade ring · 4 tiles · score bars · chips · controls · lot line. Tokens only. */
.setup-head { display: flex; align-items: center; gap: 8px; }
.setup-head h3 { margin: 0; flex: 1 1 auto; }
.setup-head #su-copy { flex: 0 0 auto; }
.setup-side { font-weight: 700; letter-spacing: .06em; padding: 1px 8px; }
.setup-side.up { background: var(--ok-dim); color: var(--up); border: 1px solid var(--up); }
.setup-side.down { background: var(--err-dim); color: var(--down); border: 1px solid var(--down); }
.setup-since { display: block; font-size: 10px; letter-spacing: .04em; margin-top: 4px; }
.setup-headline { display: block; font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--text-0); margin: 6px 0 8px; }
.setup-info { display: flex; gap: 6px; align-items: center; background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 4px; }
.setup-ladder { flex: 1 1 auto; min-width: 0; color: var(--text-1); }
.setup-ladder-svg { display: block; }
.sl-name { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.sl-price { font-family: var(--font-mono); font-size: 12px; font-weight: 700; }
.sl-sub { font-family: var(--font-mono); font-size: 9px; fill: var(--text-2); }
.setup-gauge { flex: 0 0 112px; display: flex; flex-direction: column; align-items: center; gap: 1px; color: var(--text-1); border-left: 1px solid var(--line); padding-left: 6px; }
.setup-gauge-svg { display: block; width: 100px; height: 118px; }
.sg-letter { font-size: 30px; font-weight: 800; }
.sg-score { font-size: 11px; fill: var(--text-2); font-family: var(--font-mono); }
.setup-age { display: flex; flex-direction: column; align-items: center; margin-top: 6px; }
.setup-age-v { font-size: 12px; font-weight: 600; color: var(--text-0); white-space: nowrap; }
.setup-label { font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-2); }
/* H1 trend setup (beta 9 Nov 2026): record box in place of the grade ring, recent trades, rule line, skip note */
.setup-beta { flex: 0 0 auto; font-size: 9px; letter-spacing: .1em; font-weight: 700; color: var(--warn); border-color: var(--warn); }
.setup-record { justify-content: center; gap: 2px; padding-top: 4px; padding-bottom: 4px; text-align: center; }
.setup-info.no-trade .setup-record { flex: 1 1 auto; border-left: 0; padding-left: 0; }
.setup-ladder[hidden] { display: none; }
.setup-move-hit { flex: 1 1 100%; font-size: 10px; font-weight: 600; } .setup-move-hit.down { color: var(--down); } .setup-move-hit.up { color: var(--up); }
.setup-record-net { font-size: 22px; font-weight: 800; color: var(--text-0); line-height: 1.1; }
.setup-record-net.up { color: var(--up); } .setup-record-net.down { color: var(--down); }
.setup-record-wl { font-size: 12px; font-weight: 600; color: var(--text-0); }
.setup-record-n, .setup-record-from { font-size: 10px; line-height: 1.25; }
.setup-skip { margin: 0 0 6px; font-size: 11px; color: var(--warn); }
.setup-rule { margin-top: 8px; font-size: 10px; color: var(--text-2); line-height: 1.35; }
.setup-recent { display: grid; gap: 2px; margin-top: 8px; }
.setup-recent:empty { display: none; }
.setup-recent-row { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: 6px; align-items: baseline; font-size: 11px; }
.setup-recent-row .up { color: var(--up); } .setup-recent-row .down { color: var(--down); } .setup-recent-row .flat { color: var(--text-1); }
/* price travelled since the signal bar: '4058.09 → 4069.09 +11.00 (+1100 pts) · best +14.20 · worst −3.90' */
.setup-move { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-top: 8px; padding: 6px 10px; font-size: 11px; color: var(--text-1); border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-3); cursor: help; }
.setup-move:empty { display: none; }
.setup-move-l { font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-2); }
.setup-move b { font-weight: 700; }
.setup-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.setup-tile { background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 8px; border-left-width: 3px; min-width: 0; }
.setup-tile.entry { border-left-color: var(--entry); } .setup-tile.stop { border-left-color: var(--down); } .setup-tile.target { border-left-color: var(--up); } .setup-tile.rr { border-left-color: var(--gold); }
.setup-tile-v { display: block; font-size: 15px; font-weight: 700; color: var(--text-0); white-space: nowrap; }
.setup-tile.stop .setup-tile-v { color: var(--down); } .setup-tile.target .setup-tile-v { color: var(--up); }
.setup-tile-sub { display: block; font-size: 10px; color: var(--text-2); font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.setup-bars { margin-top: 8px; display: grid; gap: 3px; }
.setup-bar { display: grid; grid-template-columns: 62px 1fr 38px; grid-template-areas: "l t v" "l x x"; align-items: center; column-gap: 6px; font-size: 10px; }
.setup-bar-label { grid-area: l; color: var(--text-1); }
.setup-bar-track { grid-area: t; height: 6px; background: var(--bg-3); border-radius: 3px; overflow: hidden; }
.setup-bar-fill { display: block; height: 100%; border-radius: 3px; background: var(--gold); }
.setup-bar.ok .setup-bar-fill { background: var(--up); } .setup-bar.weak .setup-bar-fill { background: var(--down); opacity: .8; }   /* green = row earned >= 60 % of its points */
.setup-bar-val { grid-area: v; text-align: right; color: var(--text-2); font-size: 10px; }
.setup-bar-text { grid-area: x; color: var(--text-2); font-size: 9px; line-height: 1.2; }
.setup-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.chip { font-size: 10px; line-height: 16px; padding: 1px 7px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg-3); color: var(--text-1); }
.chip-ok { border-color: rgba(34,197,94,.5); color: var(--up); } .chip-weak { border-color: rgba(242,54,69,.4); color: var(--text-1); } .chip-info { color: var(--text-2); }
.setup-foot { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 8px; }
.setup-foot select { font: inherit; font-size: 11px; background: var(--bg-3); color: var(--text-0); border: 1px solid var(--line); border-radius: 4px; padding: 1px 4px; }
.setup-alertrow { margin-top: 4px; }
.setup-alertstate { flex: 1 1 100%; font-size: 10px; }
.setup-lots { display: block; margin-top: 6px; font-size: 11px; color: var(--text-1); }
.setup-lots.warn { color: var(--warn); }
.setup-disclaimer { margin: 6px 0 0; font-size: 10px; }
.setup-disclaimer .chip { vertical-align: 1px; margin-left: 2px; cursor: help; }

/* ---- Market card (widgets/market.js): date, session chips, countdown line, news filter ---- */
#w-market { margin-bottom: 10px; }
.mk-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.mk-head h3 { margin: 0; flex: 1 1 auto; }
.mk-date { font-size: 11px; color: var(--text-1); white-space: nowrap; }
.mk-date b { color: var(--text-0); font-weight: 600; font-family: var(--font-mono); }
.mk-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.mk-chip { font-size: 11px; line-height: 20px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-3); color: var(--text-2); white-space: nowrap; cursor: default; }
.mk-chip.on { color: var(--up); border-color: rgba(34,197,94,.5); }
.mk-chip.hot { color: var(--gold); border-color: var(--gold); background: var(--gold-dim); font-weight: 600; }
.mk-chip.soon, .mk-chip.warn { color: var(--warn); border-color: rgba(245,165,36,.5); }
.mk-chip.bad { color: var(--err); border-color: rgba(242,54,69,.55); background: rgba(242,54,69,.08); font-weight: 600; }
.mk-line { margin-top: 8px; font-size: 12px; color: var(--text-1); }
.mk-line.closed { color: var(--warn); }
.mk-line #w-countdown-val { font-size: 15px; }
.mk-news { margin-top: 8px; padding: 7px 10px 7px 26px; position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-3); font-size: 11px; color: var(--text-1); line-height: 1.35; }
.mk-news::before { content: ""; position: absolute; left: 10px; top: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--text-2); }
.mk-news.ok::before { background: var(--ok); } .mk-news.warn::before { background: var(--warn); } .mk-news.bad::before { background: var(--err); animation: pulse 1.2s ease-in-out infinite; }
.mk-news.warn { border-color: rgba(245,165,36,.45); } .mk-news.bad { border-color: var(--err); background: rgba(242,54,69,.08); }
.mk-news-title { display: block; font-size: 12px; font-weight: 600; color: var(--text-0); }
.mk-news-sub { display: block; margin-top: 1px; }
.mk-news-dim { display: block; margin-top: 1px; color: var(--text-2); }
.mk-news details { margin-top: 4px; }
.mk-news summary { cursor: pointer; color: var(--text-2); list-style: none; user-select: none; }
.mk-news summary::-webkit-details-marker { display: none; }
.mk-news summary::before { content: "\25B8 "; } .mk-news details[open] summary::before { content: "\25BE "; }
.mk-ev { display: grid; grid-template-columns: 84px 1fr; gap: 6px; padding: 1px 0; font-family: var(--font-mono); font-size: 10px; }
.mk-ev .mk-ev-t { color: var(--text-2); white-space: nowrap; } .mk-ev.hol .mk-ev-n { color: var(--text-2); }

/* ---- Multi-timeframe trend panel (widgets/mtf.js) ---- */
#w-mtf { margin-bottom: 10px; }
.mtf-head { display: flex; align-items: baseline; gap: 8px; }
.mtf-head h3 { margin: 0; flex: 1 1 auto; }
.mtf-ribbon { font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.mtf-grid { display: grid; gap: 3px; margin: 8px 0; }
.mtf-kv { display: grid; grid-template-columns: 54px 1fr 40px auto; align-items: center; gap: 6px; background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 8px; }
.mtf-k { font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); }
.mtf-k2 { text-align: right; }
.mtf-v { font-size: 12px; font-weight: 700; letter-spacing: .03em; }
.mtf-v2 { font-size: 11px; text-align: right; white-space: nowrap; }
.mtf-v.up, .mtf-v2.up, .mtf-trend.up, .mtf-spread.up { color: var(--up); }
.mtf-v.down, .mtf-v2.down, .mtf-trend.down, .mtf-spread.down { color: var(--down); }
.mtf-v.flat, .mtf-trend.flat, .mtf-spread.flat { color: var(--text-1); }
.mtf-v.warn { color: var(--warn, #F5A524); }
.mtf-meter-wrap { display: flex; align-items: center; gap: 6px; }
.mtf-meter { display: inline-block; width: 72px; height: 10px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.mtf-meter-fill { display: block; height: 100%; background: var(--text-2); }
.mtf-meter-fill.hot { background: var(--down); }
.mtf-table-head, .mtf-row { display: grid; grid-template-columns: 52px 1fr 54px 62px; align-items: center; gap: 4px; padding: 3px 8px; }
.mtf-table-head { font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); border-bottom: 1px solid var(--line); }
.mtf-table-head span:nth-child(3), .mtf-table-head span:nth-child(4), .mtf-spread, .mtf-grade { text-align: right; }
.mtf-row { font-size: 11px; border-bottom: 1px solid var(--line); }
.mtf-row:last-child { border-bottom: 0; }
.mtf-row.active { background: var(--bg-3); }
.mtf-tf { font-weight: 700; color: var(--text-1); }
.mtf-row.active .mtf-tf { color: var(--gold); }
.mtf-trend { font-weight: 600; }
.mtf-grade { font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.mtf-grade.g-strong { color: var(--up); } .mtf-grade.g-moderate { color: var(--text-0); } .mtf-grade.g-weak { color: var(--down); } .mtf-grade.g-none { color: var(--text-2); }
.mtf-bias { display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 6px; margin-top: 6px; padding: 4px 8px; background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius); }

