/* No scrollbars anywhere — scrolling still works (wheel/trackpad). Global + !important so it also beats any per-element
   ::-webkit-scrollbar rule (e.g. the fixtures strip), and it removes the ladder's width-flicker from the reserved bar. */
::-webkit-scrollbar { width: 0 !important; height: 0 !important; display: none !important; }
* { scrollbar-width: none !important; -ms-overflow-style: none !important; }

/* ── desk Live — persistent, context-aware smart-money rail ── */
#dlive { position: fixed; top: var(--dl-top, 96px); right: 0; bottom: 0; width: var(--dl-w, 340px); z-index: 350; display: flex; }
#dlive.dl-collapsed { width: 0; }
#dlive.dl-collapsed #dl-body, #dlive.dl-collapsed #dl-resize { display: none; }
#dl-tab { display: none; position: fixed; right: 0; top: 140px; z-index: 351; flex-direction: column; align-items: center; gap: 6px;
  background: var(--panel2); border: 1px solid var(--line); border-right: 0; border-radius: 8px 0 0 8px; color: var(--txt);
  padding: 10px 6px; cursor: pointer; font-size: 15px; box-shadow: -4px 0 18px rgba(0,0,0,.28); }
#dl-tab b { writing-mode: vertical-rl; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); font-weight: 700; }
#dl-tab:hover { color: var(--txt); } #dl-tab:hover b { color: var(--txt); }
#dlive.dl-collapsed #dl-tab { display: flex; }
#dl-resize { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; cursor: ew-resize; z-index: 2; }
#dl-resize:hover { background: color-mix(in srgb, var(--back) 45%, transparent); }
#dl-body { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--panel); border-left: 1px solid var(--line); box-shadow: -8px 0 30px rgba(0,0,0,.22); }
#dl-head { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-bottom: 1px solid var(--line); }
.dl-brand { font-weight: 800; font-size: 13px; letter-spacing: .01em; }
.dl-ctx { flex: 1; min-width: 0; font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-ic { flex: 0 0 auto; background: none; border: 0; color: var(--dim); cursor: pointer; font-size: 13px; padding: 2px 4px; border-radius: 6px; }
.dl-ic:hover { color: var(--txt); background: var(--panel2); }
.dl-ic.on { color: var(--back); }
#dl-controls { display: flex; align-items: center; gap: 8px; padding: 8px 11px; border-bottom: 1px solid var(--line); }
.dl-scope { flex: 1; } .dl-scope button { flex: 1; padding: 5px 4px; font-size: 11px; }
.dl-chk { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--dim); cursor: pointer; white-space: nowrap; }
.dl-press { height: 4px; display: flex; margin: 8px 11px 0; border-radius: 2px; overflow: hidden; background: var(--grid); }
.dl-press .b { background: var(--green); } .dl-press .s { background: var(--red); }
.dl-feed { flex: 1; overflow-y: auto; padding: 6px 6px 12px; }
.dl-dim { color: var(--dim); font-size: 12px; padding: 16px 8px; text-align: center; }
.dl-trow { display: grid; grid-template-columns: 30px 34px 1fr auto; align-items: center; gap: 7px; padding: 6px 7px; border-radius: 7px; cursor: pointer; font-size: 12px; }
.dl-trow:hover { background: var(--panel2); }
.dl-tt { color: var(--dim); font-size: 10.5px; text-align: right; }
.dl-side { font-size: 10px; font-weight: 800; text-transform: uppercase; text-align: center; border-radius: 4px; padding: 2px 0; }
.dl-side.up { color: var(--green); background: color-mix(in srgb, var(--green) 15%, transparent); }
.dl-side.dn { color: var(--red); background: color-mix(in srgb, var(--red) 15%, transparent); }
/* fill/current price — a small green/red bubble next to the Yes/No, like Polymarket (dl-fpx: NOT dl-px, which is the ✕ button) */
.dl-fpx { font-weight: 700; font-variant-numeric: tabular-nums; padding: 0 4px; border-radius: 4px; white-space: nowrap; }
.dl-fpx.up { color: var(--green); background: color-mix(in srgb, var(--green) 16%, transparent); }
.dl-fpx.dn { color: var(--red); background: color-mix(in srgb, var(--red) 16%, transparent); }
.dl-fpx.flat { color: var(--dim); background: color-mix(in srgb, var(--dim) 14%, transparent); }
.dl-mid { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.dl-nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-sub { color: var(--dim); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-usd { font-weight: 800; font-variant-numeric: tabular-nums; }
.dl-usd.big { color: var(--back); }
.dl-prof { border-top: 1px solid var(--line); background: var(--panel2); max-height: 46%; overflow-y: auto; padding: 10px 11px; }
.dl-ph { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.dl-ph b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-followbtn { background: var(--panel); border: 1px solid var(--line); color: var(--txt); border-radius: 6px; padding: 4px 8px; font-size: 11px; cursor: pointer; }
.dl-followbtn.on { border-color: var(--green); color: var(--green); }
.dl-pstats { display: flex; gap: 14px; font-size: 11.5px; color: var(--dim); margin-bottom: 8px; }
.dl-pstats b { color: var(--txt); } .dl-pstats .up { color: var(--green); } .dl-pstats .dn { color: var(--red); }
.dl-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 9px; }
.dl-tag { background: var(--panel); border: 1px solid var(--line); color: var(--dim); border-radius: 999px; padding: 2px 9px; font-size: 10.5px; cursor: pointer; }
.dl-tag.on { border-color: var(--back); color: var(--back); }
.dl-wp { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; font-size: 11.5px; padding: 3px 0; }
.dl-wp .t { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--dim); }
.dl-scanwhale { cursor: pointer; border-radius: 5px; padding: 3px 4px; }
.dl-scanwhale:hover { background: var(--panel); }
.dl-scansub { font-size: 10px; color: var(--dim); margin: 7px 0 3px; }
.dl-scanacts { display: flex; gap: 8px; margin-top: 9px; }
.dl-scanacts .dl-tag { cursor: pointer; }
.dl-up { color: var(--green); } .dl-dn { color: var(--red); }
.dl-sharp { margin-left: 3px; font-size: 10px; cursor: help; }
.dl-scanrow { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 7px; cursor: pointer; font-size: 12px; }
.dl-scanrow:hover { background: var(--panel2); }
.dl-rk { color: var(--dim); font-size: 11px; font-weight: 800; text-align: center; }
.dl-scanrow .dl-sub b { color: var(--back); }
.dl-usd.top::before { content: ''; }
.dl-why { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--dim); margin: 2px 0 9px; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.dl-why b { color: var(--txt); } .dl-w-sharp { color: var(--txt); }
.dl-atags { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-bottom: 9px; }
.dl-atl { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); margin-right: 2px; }
.dl-atag { background: color-mix(in srgb, var(--back) 14%, transparent); border: 1px solid color-mix(in srgb, var(--back) 40%, transparent); color: var(--back); border-radius: 999px; padding: 2px 9px; font-size: 10.5px; font-weight: 700; }
body.dl-open #home { padding-right: var(--dl-w, 340px); }
@media (max-width: 720px) { body.dl-open #home { padding-right: 0; } }
/* App-global popup (order rejections etc.) — floats bottom-right over everything, click / ✕ to dismiss. */
#bjp-toast {
  position: fixed; bottom: 18px; right: 18px;  transform: translateY(12px);
  z-index: 100000; max-width: 380px; min-width: 240px; display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: 10px; font-size: 13px; line-height: 1.4; cursor: pointer;
  background: var(--panel2); color: var(--txt); border: 1px solid var(--line);
  box-shadow: 0 12px 40px rgba(0,0,0,.35); opacity: 0; pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}
#bjp-toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
#bjp-toast.error { border-color: var(--red); background: color-mix(in srgb, var(--red) 12%, var(--panel2)); }
#bjp-toast.error .bjp-toast-msg::before { content: "⚠ "; color: var(--red); font-weight: 700; }
#bjp-toast.success { border-color: var(--green); background: color-mix(in srgb, var(--green) 12%, var(--panel2)); }
#bjp-toast .bjp-toast-msg { flex: 1; }
#bjp-toast .bjp-toast-x { flex: 0 0 auto; background: none; border: 0; color: inherit; opacity: .55;
  cursor: pointer; font-size: 13px; line-height: 1; padding: 2px 4px; }
#bjp-toast .bjp-toast-x:hover { opacity: 1; }

/* Desk — one font throughout, tabular numerals, dark + light themes. */
:root {
  --bg: #0b0e13; --panel: #12151c; --panel2: #171b24; --line: #232a36; --grid: #2b3342;
  --txt: #f2f4f8; --dim: #8b93a7;
  --focusline: color-mix(in srgb, var(--txt) 28%, var(--line));   /* focus/hover border — the SAME thin border, just deepened slightly toward the foreground (white in dark) */
  --back: #3d84e6; --back-bg: rgba(61,132,230,.18); --back-txt: #a9c7ff;   /* blue / buy / back */
  --lay: #e0555f;  --lay-bg: rgba(224,85,95,.18);  --lay-txt: #f2b3b7;     /* pink / sell / lay */
  --green: #2ea043; --red: #e5383b; --ltp: #ffd21e; --ltp-bg: #26304a;   /* LTP marker: bold yellow on a dark box, so the last-traded price stands out */
  --mm-accent: #9aa7ff;   /* market-modal label accent — soft periwinkle, deliberately NOT the green/blue/pink trading semantics */
  --titlebar-bg: #000000;   /* very-top window bar: black in dark mode */
}
:root[data-theme='light'] {
  --bg: #f5f7fb; --panel: #ffffff; --panel2: #eef1f7; --line: #dbe1ec; --grid: #e4e9f2;
  --txt: #12151d; --dim: #5b6472;
  --focusline: color-mix(in srgb, var(--txt) 28%, var(--line));
  --back: #2f6fd0; --back-bg: rgba(47,111,208,.14); --back-txt: #1c5bc0;
  --lay: #d8434f;  --lay-bg: rgba(216,67,79,.13);   --lay-txt: #c02c38;
  --green: #1a8f38; --red: #d42f2f; --ltp: #12151d; --ltp-bg: #fdf0bf;
  --mm-accent: #5a5fd6;   /* market-modal label accent (light theme — deeper periwinkle for contrast on white) */
  --titlebar-bg: #ffffff;   /* light mode: leave the top bar light */
}
/* Focus ring — ONE treatment everywhere: the same slightly-deepened white used on
   active panels & the crypto view, never Chromium's default blue. Elements with their
   own :focus styling (inputs use #id:focus, higher specificity) keep it. */
:focus-visible { outline: 1.5px solid var(--focusline); outline-offset: 1px; }
/* custom OS title bar (native chrome hidden) — draggable, logo sits right of the traffic lights */
#titlebar { position: relative; flex: 0 0 auto; height: 40px; background: var(--titlebar-bg); border-bottom: 1px solid var(--line); -webkit-app-region: drag; }
.brand-logo { height: 26px; width: auto; display: block; }   /* app brand, top-left of the nav row */
.logo-light { display: none; }                               /* dark theme = default → show the dark logo */
:root[data-theme='light'] .logo-dark { display: none; }
:root[data-theme='light'] .logo-light { display: block; }
/* Heatmap tiles are a translucent green/red over the panel — in light mode that's a pale tile, so white text vanishes.
   Flip the tile text to dark (with a light shadow for legibility) and darken the live dot / hover outline. */
:root[data-theme='light'] .heat-name,
:root[data-theme='light'] .heat-sub { color: #14161a; text-shadow: 0 1px 2px rgba(255,255,255,.7); }
:root[data-theme='light'] .heat-live { background: #14161a; box-shadow: 0 0 6px rgba(0,0,0,.45); }
:root[data-theme='light'] .heat-tile:hover { outline-color: #14161a; }
:root[data-theme='light'] .heat-scale i { color: #14161a; text-shadow: 0 1px 1px rgba(255,255,255,.6); }
* { box-sizing: border-box; }
/* ONE font family everywhere; tabular-nums keeps numbers aligned without monospace. */
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--txt); font-variant-numeric: tabular-nums;
  font: 13px/1.35 -apple-system, 'Segoe UI', system-ui, sans-serif; -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; }

/* global account header — one per app (brand, cash, portfolio, theme) */
/* one unified header panel: account row + market nav row, no internal divider */
#header { display: flex; flex-direction: column; background: var(--panel); border-bottom: 1px solid var(--line); }
#hdr-row1 { display: flex; align-items: center; gap: 10px; padding: 10px 14px 6px; }
#hdr-nav { display: flex; align-items: center; gap: 12px; padding: 4px 14px 9px; }
body[data-view="workspace"] #hdr-nav { display: none; }   /* keep the trading canvas header compact */
body[data-view="workspace"] #hdr-funds, body[data-view="workspace"] #hdr-withdraw { display: none; }   /* funding lives on the markets page — off the trading canvas */
#hdr-cats { display: flex; align-items: center; gap: 4px; overflow-x: auto; flex: 1 1 auto; min-width: 0; }
#hdr-cats::-webkit-scrollbar { height: 0; }
#hdr-cats .cat { padding: 6px 13px; border-radius: 999px; border: 1px solid transparent; background: transparent;
  color: var(--dim); cursor: pointer; font: 13px inherit; white-space: nowrap; }
#hdr-cats .cat.on { background: var(--panel2); color: var(--txt); font-weight: 600; }
#hdr-cats .cat:hover:not(.on) { color: var(--txt); }
#hdr-nav #home-search { flex: 0 0 240px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel2); color: var(--txt); font: 13px inherit; }
#hdr-nav #home-search:focus { outline: none; border-color: var(--back); }
/* sport / league / fixtures drill-down rows */
#hdr-sports, #hdr-leagues { align-items: center; gap: 4px; padding: 6px 14px; overflow-x: auto; border-top: 1px solid var(--line); }
#hdr-leagues { background: var(--panel2); }   /* deeper level reads as a sub-row */
/* cap the fixtures chip row so a long slate (all of tennis = 100+ live matches) can't balloon the header and squeeze
   the heatmap/markets below it off-screen — it scrolls within this bound instead. */
#hdr-fixtures { align-items: center; gap: 6px; padding: 6px 14px; border-top: 1px solid var(--line); background: var(--panel2); flex-wrap: wrap; max-height: 22vh; overflow-y: auto; }
#hdr-fixtures::-webkit-scrollbar { width: 8px; }
#hdr-fixtures::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--txt) 18%, transparent); border-radius: 4px; }
#hdr-sports::-webkit-scrollbar, #hdr-leagues::-webkit-scrollbar { height: 0; }
body[data-view="workspace"] #hdr-sports, body[data-view="workspace"] #hdr-leagues, body[data-view="workspace"] #hdr-fixtures { display: none !important; }
.subhdr { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); padding-right: 4px; }
.fx-day { min-width: 74px; text-align: center; color: var(--txt); }
.fx-nav { background: var(--panel); border: 1px solid var(--line); color: var(--txt); border-radius: 6px; width: 24px; height: 24px; cursor: pointer; font-size: 11px; line-height: 1; flex: 0 0 auto; }
.fx-nav:hover { border-color: var(--txt); }
.fx-none { font-size: 12px; color: var(--dim); }
.subcat { padding: 5px 12px; border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--dim);
  cursor: pointer; font: 12.5px inherit; white-space: nowrap; }
.subcat.on { background: var(--back); border-color: var(--back); color: #fff; font-weight: 600; }
.subcat:hover:not(.on) { color: var(--txt); }
.subcat.lg { font-size: 12px; }
.subcat .lg-n { margin-left: 6px; padding: 1px 5px; border-radius: 999px; background: var(--line); color: var(--dim);
  font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums; vertical-align: 1px; }
.subcat.on .lg-n { background: rgba(255,255,255,.22); color: #fff; }
.subcat.fx { border-color: var(--line); background: var(--panel); color: var(--txt); font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.fx-when { font-size: 10px; font-weight: 700; letter-spacing: .03em; color: var(--dim); background: var(--panel2); border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 5px; flex: 0 0 auto; text-transform: uppercase; }
.fx-when.live { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.subcat.fx:hover { border-color: var(--back); }
.subcat.fx.live { border-color: rgba(240,85,99,.5); }
.fx-all { display: inline-flex; align-items: center; justify-content: center; margin: -2px -6px -2px 2px; padding: 2px 5px;
  border-radius: 5px; color: var(--dim); font-size: 13px; line-height: 1; cursor: pointer; }
.fx-all:hover { color: var(--back); background: color-mix(in srgb, var(--back) 18%, transparent); }
.subcat.inplay { display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; border-color: rgba(240,85,99,.45); color: var(--txt); }
.subcat.inplay.on { background: var(--red); border-color: var(--red); color: #fff; }
.subcat.inplay:not(.on) .fxdot { animation: none; opacity: .55; }   /* only pulse when the filter is active */
.fxdot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); animation: livepulse 1.4s ease-in-out infinite; }
.subcat.inplay.on .fxdot { background: #fff; }
body[data-view="home"] #add-panel, body[data-view="home"] #add-chart, body[data-view="home"] #add-stats { display: none; }   /* panel/chart/stats adders live in the workspace only */
/* top-row nav actions — plain text (no button chrome), BLOCK CAPS, sized to match the
   category menu row directly below (13px). */
#add-panel, #add-chart, #add-stats, #add-sonar, #show-home {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; color: var(--txt);
  padding: 5px 10px; cursor: pointer; font-family: inherit; font-size: 12px; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 6px; }
#add-panel:hover, #add-chart:hover, #add-stats:hover, #add-sonar:hover, #show-home:hover { border-color: var(--txt); }
/* header wallet controls — Enable Trading (CTA) · Add Funds · Withdraw */
.hdr-wallet { display: inline-flex; align-items: center; gap: 8px; }
#hdr-funds, #hdr-withdraw { background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 6px;
  padding: 5px 10px; cursor: pointer; font: 12px inherit; font-weight: 600; white-space: nowrap; }
#hdr-funds:hover, #hdr-withdraw:hover { border-color: var(--txt); }
.wallet-cta { border: 1px solid transparent; border-radius: 6px; padding: 5px 12px; cursor: pointer; font: 12px inherit; font-weight: 700;
  white-space: nowrap; color: #fff; background: linear-gradient(135deg, var(--blue, #4f8cff), var(--purple, #9b6cff));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--blue, #4f8cff) 40%, transparent), 0 2px 10px color-mix(in srgb, var(--blue, #4f8cff) 30%, transparent);
  animation: cta-pulse 2s ease-in-out infinite; }
.wallet-cta:hover { filter: brightness(1.08); }
@keyframes cta-pulse { 50% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--blue, #4f8cff) 60%, transparent), 0 2px 16px color-mix(in srgb, var(--blue, #4f8cff) 55%, transparent); } }
@media (prefers-reduced-motion: reduce) { .wallet-cta { animation: none; } }
.ic { display: inline-block; vertical-align: middle; flex: 0 0 auto; }
#theme, #hidecash, #lb-btn, #activity, #profile, #hdr-telegram { display: inline-flex; align-items: center; justify-content: center; line-height: 0; background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 6px; padding: 5px 9px; cursor: pointer; }
#theme .ic, #hidecash .ic, #lb-btn .ic, #activity .ic, #profile .ic, #hdr-telegram .ic { opacity: .85; }
#theme:hover .ic, #hidecash:hover .ic, #lb-btn:hover .ic, #activity:hover .ic, #profile:hover .ic, #hdr-telegram:hover .ic { opacity: 1; }
/* Open-position count badge on the Orders/Positions button — a persistent "you're holding real money" cue (never lose a position again). */
#activity { position: relative; overflow: visible; }
.nav-badge { position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; line-height: 1; color: #fff; background: var(--accent, #4c8dff); border: 1px solid var(--bg, #08090d); border-radius: 999px; pointer-events: none; }
/* two top-level views — the market browser (home) and the trading canvas (workspace) — one shown at a time */
body[data-view="home"] #workspace { display: none; }
body[data-view="workspace"] #home { display: none; }
/* Pop-out window (prototype): a bare single-market ladder in its own OS window — hide the browse chrome + Live rail
   (keep the titlebar for traffic lights / dragging), and hide the pop-out button itself so it can't recurse. */
body[data-pop] #header, body[data-pop] #dlive { display: none; }
body[data-pop] #pop-panel, body[data-pop] #cpop { display: none; }

/* ── Home: market browser ── */
#home { flex: 1 1 auto; overflow: auto; padding: 18px 22px 40px; }
/* trader cockpit: a market toolbar (sort/timeframe) over a grid-primary body with a sticky Movers rail */
#markets-bar { display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 6;               /* pin to the top of the #home scroll area, below whichever nav row is open */
  background: var(--bg);                                /* opaque so market cards scroll UNDER it, not through it */
  margin: 0 -22px 14px; padding: 10px 22px;            /* bleed over #home's 22px side padding so the pinned bg spans full width */
  border-bottom: 1px solid transparent; }
#home.mk-pinned #markets-bar { border-bottom-color: var(--line); }  /* subtle divider only once it's actually pinned */
#markets-bar .mk-title { font-size: 20px; font-weight: 700; color: var(--txt); }
/* fixture section below the heatmap — cards reuse .mcard so they match the market grid */
#home-fixtures { margin-bottom: 22px; }
.fxc-bar { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.fxc-bar .mk-title { font-size: 20px; font-weight: 700; color: var(--txt); }
.fxc-bar .fxc-day { font-size: 12px; font-weight: 600; color: var(--dim); }
.fxc-toggle { align-self: center; background: none; border: none; color: var(--dim); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.fxc-toggle:hover { color: var(--txt); }
.fxc-count { font-size: 11px; font-weight: 700; color: var(--dim); background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; align-self: center; }
.fxc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.sort-wrap { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dim); }
#sort-sel { background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 8px;
  padding: 6px 10px; font: 13px inherit; cursor: pointer; }
#sort-sel:focus { outline: none; border-color: var(--back); }
#markets-bar #grid-tf { margin-left: auto; }

/* ── Live market heatmap (treemap hero) ── */
#heatmap { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; min-height: 320px; }
#heat-bar { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.heat-title { font-size: 12px; font-weight: 700; color: var(--txt); }
.heat-meta { font-size: 11px; color: var(--dim); }
.heat-scale { margin-left: auto; display: flex; align-items: center; }
.heat-scale i { font-style: normal; font-size: 9px; font-weight: 700; color: #fff; padding: 3px 8px; min-width: 20px; text-align: center; text-shadow: 0 1px 1px rgba(0,0,0,.55); }
.heat-scale i:first-child { border-radius: 4px 0 0 4px; }
.heat-scale i:last-child { border-radius: 0 4px 4px 0; }
#heat-body { flex: 1 1 auto; position: relative; min-height: 0; }
.heat-empty { color: var(--dim); padding: 30px; }
/* every tile centres its content (logo → name → % · change), stacked in the middle */
.heat-tile { position: absolute; overflow: hidden; box-sizing: border-box; border: 1px solid rgba(0,0,0,.32); cursor: pointer;
  padding: 6px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 4px; }
.heat-tile:hover { outline: 2px solid #fff; outline-offset: -2px; z-index: 3; }
.heat-name { display: block; overflow: hidden; max-height: 2.6em; line-height: 1.2; font-size: 11px; font-weight: 600; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.6); }   /* up to 2 lines; if a name needs more it's dropped in JS (no clipped bleed) */
.heat-sub { font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6);
  display: flex; gap: 6px; align-items: baseline; justify-content: center; max-width: 100%; }
.heat-sub .hc { font-size: 10px; opacity: .92; }
.heat-tile.statsonly .heat-sub { flex-direction: column; gap: 0; align-items: center; }   /* small tiles: % over change, never overflow */
.heat-tile.big { gap: 8px; padding: 12px; }
.heat-ic { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; box-shadow: 0 2px 8px rgba(0,0,0,.45); }
.heat-tile.big .heat-name { font-size: 15px; font-weight: 700; }
.heat-tile.big .heat-sub { font-size: 13px; }
.heat-live { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 7px #fff; animation: livepulse 1.4s ease-in-out infinite; z-index: 2; }
#home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.home-empty { grid-column: 1 / -1; color: var(--dim); padding: 40px; text-align: center; }
/* Grid | List view toggle */
#markets-bar #home-view { flex: 0 0 auto; }
.view-seg { display: inline-flex; gap: 2px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.view-seg .vw { background: none; border: 0; color: var(--dim); font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 6px; cursor: pointer; }
.view-seg .vw:hover { color: var(--txt); }
.view-seg .vw.on { background: var(--accent, #4c8dff); color: #fff; }
/* Grid forward day-picker (replaces the removed fixtures strip's ◀ day ▶) */
.day-seg { display: inline-flex; align-items: center; gap: 2px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.day-seg .day-nav { background: none; border: 0; color: var(--dim); font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 6px; cursor: pointer; line-height: 1; }
.day-seg .day-nav:hover:not([disabled]) { color: var(--txt); background: var(--panel); }
.day-seg .day-nav[disabled] { opacity: .35; cursor: default; }
.day-seg .day-lbl { color: var(--txt); font-size: 12px; font-weight: 600; padding: 0 6px; min-width: 74px; text-align: center; font-variant-numeric: tabular-nums; }
/* List browse mode — collapsible events → their categorised sub-markets (the Grid alternative) */
#home-grid.listmode { display: block; }
/* Crypto category rail (Polymarket-style) — left menu + grid, crypto only.
   #home becomes a fixed-height flex column so the rail and grid each scroll INDEPENDENTLY (the page itself doesn't scroll). */
/* Crypto page scrolls like every other tab: news + heatmap scroll away, the Markets bar pins at the top (it's already
   position:sticky), and BELOW it the rail + grid each become their own viewport-tall scroll pane. The panes are
   position:sticky so once the Markets bar anchors they fill the remaining viewport and scroll independently. Their
   height needs the header-stack + bar heights — measured at runtime into --cx-headerH / --cx-barH (fallbacks below). */
#home.cx-page { padding-bottom: 0; }
#home.cx-page #footer, #home.cx-page #home-fixtures { display: none !important; }   /* only the page footer is hidden (it added dead scroll below the panes) */
#home-grid.cx-mode { display: block; }
.cx-layout { display: flex; gap: 18px; align-items: flex-start; }
.cx-rail, .cx-grid { position: sticky; top: var(--cx-barH, 56px); height: calc(100dvh - var(--cx-headerH, 92px) - var(--cx-barH, 56px)); overflow-y: auto; }
.cx-rail { flex: 0 0 210px; overflow-x: hidden; display: flex; flex-direction: column; gap: 1px; padding: 2px 6px 24px 0; scrollbar-width: thin; }
.cx-grid { flex: 1 1 auto; min-width: 0; align-content: start; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; padding: 0 4px 40px 0; }
.cx-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--txt); }
.cx-item:hover { background: var(--panel2); }
.cx-item.on { background: var(--panel2); font-weight: 700; }
.cx-item.cx-sub { padding-left: 28px; font-size: 12.5px; color: var(--dim); }
.cx-item.cx-sub.on { color: var(--txt); }
.cx-exp { width: 12px; flex: 0 0 auto; text-align: center; color: var(--dim); font-size: 10px; }
.cx-lbl { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-n { color: var(--dim); font-size: 11px; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.cx-item.on .cx-n { color: var(--txt); }
.cx-div { height: 1px; background: var(--line); margin: 8px 6px; flex: 0 0 auto; }
@media (max-width: 720px) { #home.cx-page { padding-bottom: 40px; } .cx-layout { flex-direction: column; } .cx-rail, .cx-grid { position: static; height: auto; overflow: visible; } .cx-rail { flex-basis: auto; width: 100%; } }
.mlist { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel); }
.ml-row { display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-top: 1px solid var(--grid); cursor: pointer; font-size: 13px; }
.mlist > .ml-row:first-child { border-top: 0; }
.ml-row:hover { background: var(--panel2); }
.ml-row.open { background: var(--panel2); font-weight: 600; }
.ml-caret { width: 11px; color: var(--dim); font-size: 10px; flex: 0 0 auto; text-align: center; }
.ml-live { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: 0 0 auto; }
.ml-title { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-vol { color: var(--dim); font-size: 11px; flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.ml-mv { flex: 0 0 auto; background: transparent; border: 0; padding: 1px 5px; font-size: 12px; line-height: 1; cursor: pointer; color: var(--dim); border-radius: 4px; opacity: .6; }   /* ⊞ on a fixture list row → both players (bug 111) */
.ml-mv:hover { opacity: 1; color: var(--accent, #4c8dff); background: var(--grid); }
.ml-time { color: var(--dim); font-size: 11px; flex: 0 0 auto; min-width: 78px; font-variant-numeric: tabular-nums; }   /* match START time in the user's timezone, Betfair-style; aligned in a column */
.ml-time.live { color: var(--green); font-weight: 600; }   /* in-play → the live period + score reads green */
.ml-time.ended { color: var(--faint, #5b6474); }   /* finished match — muted */
.p-tz { background: var(--panel2); color: var(--txt); border: 1px solid var(--grid); border-radius: 6px; padding: 5px 9px; font-size: 12px; max-width: 280px; }   /* Settings timezone picker */

/* ── Betfair-style tennis GRID (trial): score block · stacked players · matched · Back/Lay per player ── */
.gx-head, .gx-row { display: grid; grid-template-columns: 100px minmax(150px, 1fr) 78px 214px; align-items: center; gap: 10px; }
.mlist.gxfb .gx-head, .mlist.gxfb .gx-row { grid-template-columns: 108px minmax(140px, 1fr) 72px 330px; }   /* football = 3-way (1/X/2) → wider prices column + room for the period chip */
.gx-head { padding: 8px 14px 6px; color: var(--dim); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; border-bottom: 1px solid var(--grid); position: sticky; top: 0; background: var(--panel); z-index: 2; }
.gx-row { padding: 8px 14px; border-top: 1px solid var(--grid); cursor: pointer; font-size: 13px; }
.mlist.gxmode > .ml-grp + .ml-grpbody .gx-row:first-child { border-top: 0; }
.gx-row:hover { background: var(--panel2); }
.gx-lead { display: flex; align-items: center; }
.gx-sc { display: flex; flex-direction: column; gap: 2px; width: 42px; }
.gx-gg { display: flex; flex-direction: column; gap: 2px; }
.gx-sc span { background: var(--green); color: #fff; font-weight: 700; font-size: 11.5px; line-height: 1; padding: 4px 0; text-align: center; border-radius: 3px; font-variant-numeric: tabular-nums; }
.gx-sc.gx-fb { flex-direction: row; align-items: center; width: auto; gap: 4px; }   /* football: period chip + goals side by side */
.gx-sc.gx-fb .gx-gg { flex: 0 0 auto; }
.gx-sc.gx-fb .gx-gg span { min-width: 22px; }
.gx-per { background: #0a5a28; color: #fff; font-size: 8.5px; font-weight: 800; letter-spacing: .03em; padding: 4px 4px; border-radius: 3px; line-height: 1; text-align: center; }   /* HT / 1H / 2H … */
.gx-sc.gx-live { justify-content: center; }
.gx-sc.gx-live i { display: block; width: 42px; height: 13px; background: var(--green); border-radius: 3px; position: relative; }
.gx-sc.gx-live i::after { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 5px; height: 5px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0 rgba(255,255,255,.7); animation: gxpulse 1.6s infinite; }
@keyframes gxpulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.6); } 70% { box-shadow: 0 0 0 5px rgba(255,255,255,0); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }
.gx-when { color: var(--dim); font-size: 11px; }
.gx-when.gx-ended { color: var(--faint, #5b6474); }
.gx-names { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.gx-p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gx-matched { color: var(--dim); font-size: 11px; font-variant-numeric: tabular-nums; }
.gx-prices { display: flex; gap: 6px; }
.gx-sel { flex: 1; display: flex; gap: 3px; background: transparent; border: 0; padding: 0; cursor: pointer; }
.gx-b, .gx-l { flex: 1; text-align: center; padding: 8px 0; border-radius: 3px; font-weight: 700; font-size: 12.5px; font-variant-numeric: tabular-nums; transition: background .12s; }
.gx-b { background: rgba(60,130,230,.18); color: #9ec5ff; }   /* Back = blue */
.gx-l { background: rgba(240,110,140,.15); color: #f2a6bb; }  /* Lay = pink */
.gx-sel:hover .gx-b { background: rgba(60,130,230,.32); }
.gx-sel:hover .gx-l { background: rgba(240,110,140,.28); }
.gx-sel-off { flex: 1; display: flex; gap: 3px; opacity: .4; cursor: default; }   /* no token this side → inert, greyed */
.gx-hcol { flex: 1; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 10px; }
.gx-hcol b { flex: 1 0 100%; text-align: center; color: var(--dim); font-weight: 600; margin-bottom: 2px; }
.gx-hcol i { flex: 1; text-align: center; font-style: normal; }
.ml-sub { border-top: 1px solid var(--grid); background: color-mix(in srgb, var(--panel2) 55%, transparent); padding: 2px 0 8px; }
.ml-cat { color: var(--accent, #4c8dff); font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 9px 14px 3px 34px; }
.ml-mkt { padding: 5px 14px 5px 34px; font-size: 12.5px; color: var(--txt); cursor: pointer; }
.ml-mkt:hover { background: var(--panel); color: var(--blue-lt, #5a9bff); }
/* Betfair-style group headers (crypto timeframe / tennis tournament) — collapsible menu with a live count. */
.ml-grp { display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-top: 1px solid var(--grid); cursor: pointer; font-size: 13px; font-weight: 700; background: var(--panel2); }
.mlist > .ml-grp:first-child { border-top: 0; }
.ml-grp:hover { background: color-mix(in srgb, var(--panel2) 82%, var(--blue-lt) 18%); }
.ml-gcaret { width: 11px; color: var(--dim); font-size: 10px; flex: 0 0 auto; text-align: center; }
.ml-gtitle { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-grp-n { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--line); color: var(--dim); font-size: 11px; font-weight: 700; flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.ml-grp.open .ml-grp-n { background: var(--blue, #3d84e6); color: #fff; }
.ml-grpbody[hidden] { display: none; }
.ml-grpbody > .ml-row { padding-left: 30px; }
.ml-load { padding: 8px 14px 8px 34px; color: var(--dim); font-size: 12px; }
.mcard { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 15px 15px 13px; cursor: pointer;
  display: flex; flex-direction: column; gap: 11px; transition: border-color .12s, transform .12s, box-shadow .12s;
  content-visibility: auto; contain-intrinsic-size: auto 300px; }  /* skip layout/paint for off-screen cards → smooth scroll + fast paint with 100s of cards */
.mcard:hover { border-color: var(--focusline); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.28); }
.mc-top { display: flex; align-items: center; gap: 10px; }
.mc-ic { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--panel2), var(--line)); }
.mc-ic.ph { display: inline-block; }
.mc-q { font-size: 12.5px; font-weight: 600; color: var(--txt); line-height: 1.28;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }   /* smaller + 3 lines so long titles aren't cut to "…" (Alex, Aug 2026) */
.mc-spark { width: 100%; height: 48px; display: block; }
.mc-mid { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.mc-prob { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.mc-pct { font-size: 24px; font-weight: 700; color: var(--txt); line-height: 1; letter-spacing: -.01em; }
.mc-name { font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-chg { font-size: 12px; font-weight: 600; color: var(--dim); flex: 0 0 auto; }
.mc-chg.up { color: var(--green); }
.mc-chg.down { color: var(--red); }
.mc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--dim); padding-top: 2px; border-top: 1px solid var(--line); margin-top: 1px; }
.mc-livefoot { display: inline-flex; align-items: center; gap: 5px; color: var(--red); font-weight: 700; white-space: nowrap; flex: 0 0 auto; }
.mc-livefoot > i { width: 6px; height: 6px; border-radius: 50%; background: var(--red); display: inline-block; animation: livepulse 1.4s ease-in-out infinite; }
/* multi-outcome grid card: top outcomes as clickable rows, each with a probability bar under it */
.mc-orows { display: flex; flex-direction: column; gap: 6px; }
.mc-orow { display: flex; flex-direction: column; gap: 4px; padding: 4px 8px; border-radius: 7px; }
.mc-orow:hover { background: var(--panel2); }
.mc-orow-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mc-oname { font-size: 12px; color: var(--txt); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mc-opct { font-size: 14px; font-weight: 700; color: var(--txt); flex: 0 0 auto; font-variant-numeric: tabular-nums; }
/* probability bar: 100% = full width, scaled; desk-blue fill on a faint track (Alex, Aug 2026) */
.mc-obar { height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--back) 16%, transparent); overflow: hidden; }
.mc-obar > i { display: block; height: 100%; border-radius: 3px; background: var(--back); }
.mcard.multi .mc-spark { height: 38px; }
/* LIVE (in-play) badge */
.mcard.islive { border-color: rgba(240,85,99,.45); }
.mc-live { position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 800; letter-spacing: .06em; color: var(--red);
  background: var(--panel2); border: 1px solid rgba(240,85,99,.4); border-radius: 999px; padding: 2px 8px; }
.mc-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--red); display: inline-block; animation: livepulse 1.4s ease-in-out infinite; }
@keyframes livepulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
/* watchlist star — top-right of every market card (sits left of the LIVE badge when present) */
.mc-star { position: absolute; top: 7px; right: 9px; z-index: 3; background: transparent; border: 0; padding: 3px; font-size: 16px; line-height: 1; cursor: pointer; color: var(--dim); opacity: .7; transition: color .12s, opacity .12s, transform .12s; }
.mc-star:hover { opacity: 1; color: var(--txt); transform: scale(1.15); }
.mc-star.on { color: #f5b301; opacity: 1; }
/* ⊞ match button on a fixture card — opens both players as ladders (bug 111); sits left of the star */
.mc-mv { position: absolute; top: 7px; right: 30px; z-index: 3; background: transparent; border: 0; padding: 2px 4px; font-size: 13px; line-height: 1; cursor: pointer; color: var(--dim); opacity: .7; border-radius: 4px; transition: color .12s, opacity .12s, background .12s; }
.mc-mv:hover { opacity: 1; color: var(--accent, #4c8dff); background: var(--panel2); }
.mcard.fixture .mc-q { padding-right: 44px; }   /* keep the (now short) category clear of the ⊞ + ★ */
.mcard .mc-top { padding-right: 24px; }   /* reserve room so the question clears the star */
.mcard.islive .mc-live { right: 32px; }    /* make room for the star on live cards */
/* ⊞ Match view button — fixture cards only (no star there), top-right; shift the LIVE badge left to clear it */
.mc-all { position: absolute; top: 7px; right: 8px; z-index: 3; background: transparent; border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 5px; font-size: 13px; line-height: 1.2; cursor: pointer; color: var(--dim);
  opacity: .8; transition: color .12s, border-color .12s, opacity .12s; }
.mc-all:hover { opacity: 1; color: var(--back); border-color: var(--back); }

/* ── Footer ── */
#footer { margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 26px; }
.ft-brand strong { font-size: 18px; letter-spacing: .02em; }
.ft-brand p { color: var(--dim); font-size: 13px; margin-top: 5px; }
.ft-h { font-size: 12px; font-weight: 700; color: var(--txt); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }
#ft-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px 20px; }
.ft-topic { display: flex; flex-direction: column; cursor: pointer; text-decoration: none; }
.ft-topic b { color: var(--txt); font-size: 13px; font-weight: 600; }
.ft-topic span { color: var(--dim); font-size: 11px; margin-top: 1px; }
.ft-topic:hover b { color: var(--back); }
#ft-more { align-self: flex-start; margin-top: 14px; background: transparent; border: 1px solid var(--line); color: var(--txt);
  border-radius: 8px; padding: 7px 14px; font: 600 12px inherit; cursor: pointer; }
#ft-more:hover { border-color: var(--txt); }
.ft-cols { display: flex; flex-wrap: wrap; gap: 40px; }
.ft-col { display: flex; flex-direction: column; gap: 8px; min-width: 130px; }
.ft-link { color: var(--dim); font-size: 13px; text-decoration: none; cursor: pointer; }
.ft-link:hover { color: var(--txt); }
.ft-status { display: inline-flex; align-items: center; gap: 6px; }
.ft-status .trade-light { margin-right: 0; cursor: pointer; }   /* reuse the header dot's colour states; align it inline with the label */
.ft-legal { border-top: 1px solid var(--line); padding-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.ft-legal-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--dim); }
.ft-disc { font-size: 11px; color: var(--dim); line-height: 1.5; max-width: 900px; }

/* ── News ticker: crawling headline strip, category-aware ── */
#newsbar { display: flex; align-items: stretch; background: #ffe600; border-radius: 8px; margin-bottom: 18px; overflow: hidden; }
.nb-label { flex: 0 0 auto; display: flex; align-items: center; background: #d81f27; color: #fff;
  font-weight: 800; font-size: 13px; letter-spacing: .12em; padding: 11px 16px; }
.nb-viewport { flex: 1 1 auto; overflow: hidden; min-width: 0; padding: 9px 0; }
/* animation lives in CSS (with a JS-set duration var) so the :hover pause can override it — an inline
   `animation` shorthand would pin animation-play-state and beat the hover rule */
.nb-track { display: inline-flex; align-items: center; white-space: nowrap; will-change: transform;
  animation: nb-scroll var(--nb-dur, 40s) linear infinite; }
#newsbar:hover .nb-track { animation-play-state: paused; }   /* pause so you can read / click */
.nb-item { display: inline-flex; align-items: baseline; gap: 7px; color: #4a4a4a; text-decoration: none;
  font-size: 13px; cursor: pointer; padding: 0 6px; }
.nb-item:hover { color: #000; }
.nb-item b { color: #262626; font-weight: 700; font-size: 12px; }
.nb-item i { color: #7d7d7d; font-style: normal; font-size: 11px; }
.nb-item.dim { color: #6a5f10; cursor: default; }
.nb-sep { color: #c9b200; padding: 0 12px; font-weight: 700; }
.nb-dot { width: 7px; height: 7px; border-radius: 50%; align-self: center; flex: 0 0 auto; }
.nb-dot.pos { background: #1a8f38; } .nb-dot.neg { background: #d43a48; }
#nb-toggle { flex: 0 0 auto; background: transparent; border: none; color: #7a6a00; cursor: pointer; font-size: 13px; padding: 0 14px; }
#nb-toggle:hover { color: #000; }
/* neutral pill shown when the whole banner is hidden — no yellow to distract */
#news-show { margin-bottom: 16px; background: var(--panel2); border: 1px solid var(--line); color: var(--dim);
  border-radius: 8px; padding: 7px 13px; font: 600 12px inherit; cursor: pointer; align-items: center; }
#news-show:hover { color: var(--txt); border-color: var(--txt); }
@keyframes nb-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ── Home hero: spotlight carousel + movers rail ── */
/* fixed hero height = room for up to 8 movers; the heatmap fills it, slack falls below the movers list */
#home-hero { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; margin-bottom: 22px; height: 440px; }
@media (max-width: 900px) { #home-hero { grid-template-columns: 1fr; height: auto; } #heatmap, #movers { min-height: 300px; grid-column: auto; } }
#home-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
#home-heading > span { font-size: 20px; font-weight: 700; color: var(--txt); }
/* shared timeframe toggle (spotlight + cards) */
.sp-tf, #grid-tf { display: inline-flex; gap: 2px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.sp-tf .tf, #grid-tf .tf { border: none; background: transparent; color: var(--dim); cursor: pointer; font: 600 11px inherit;
  padding: 4px 9px; border-radius: 6px; }
.sp-tf .tf.on, #grid-tf .tf.on { background: var(--back); color: #fff; }
.sp-tf .tf:hover:not(.on), #grid-tf .tf:hover:not(.on) { color: var(--txt); }
/* chart top-bar dropdowns (candle type / timeframe): one compact button showing the current pick + a click-away menu */
.chartpanel .cdd { position: relative; display: inline-flex; }
.chartpanel .cdd-btn { display: inline-flex; align-items: center; gap: 5px; background: var(--panel2); border: 1px solid var(--line); color: var(--txt);
  border-radius: 6px; cursor: pointer; font: 600 11px inherit; line-height: 1; padding: 5px 9px; white-space: nowrap; }
.chartpanel .cdd-btn:hover { border-color: var(--txt); }
.chartpanel .cdd.open .cdd-btn { border-color: var(--back); color: var(--back); }
.chartpanel .cdd-car { color: var(--dim); font-size: 9px; }
.chartpanel .cdd.open .cdd-car { color: var(--back); }
.chartpanel .cdd-menu { position: absolute; top: calc(100% + 5px); left: 0; z-index: 7; min-width: 128px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 4px; box-shadow: 0 10px 28px rgba(0,0,0,.38); display: flex; flex-direction: column; gap: 2px; }
.chartpanel .cdd-menu button { display: block; width: 100%; text-align: left; border: none; background: transparent; color: var(--txt); cursor: pointer;
  font: 600 12px inherit; padding: 6px 10px; border-radius: 6px; white-space: nowrap; }
.chartpanel .cdd-menu button:hover { background: var(--panel2); }
.chartpanel .cdd-menu button.on { background: var(--back); color: #fff; }

#spotlight { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px; min-height: 264px; display: flex; flex-direction: column; }
.sp-body { display: flex; gap: 18px; flex: 1 1 auto; min-height: 0; }
.sp-empty, .mv-empty { color: var(--dim); padding: 30px; margin: auto; }
.sp-left { flex: 0 0 288px; display: flex; flex-direction: column; gap: 13px; min-width: 0; }
.sp-top { display: flex; gap: 11px; align-items: flex-start; }
.sp-ic { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; background: linear-gradient(135deg, var(--panel2), var(--line)); }
.sp-q { font-size: 19px; font-weight: 700; color: var(--txt); line-height: 1.2;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sp-outs { display: flex; flex-direction: column; gap: 8px; }
.sp-out { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; background: var(--panel2); border-radius: 9px; }
.sp-out .sp-name { color: var(--dim); font-size: 13px; }
.sp-out .sp-val { font-size: 18px; font-weight: 700; color: var(--txt); }
.sp-out.yes .sp-val { color: var(--back); }
.sp-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--dim); margin-top: auto; }
.sp-open { padding: 10px; border-radius: 9px; border: none; background: var(--back); color: #fff; font: 600 13px inherit; cursor: pointer; }
.sp-open:hover { filter: brightness(1.08); }
.sp-right { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.sp-chart { width: 100%; flex: 1 1 auto; min-height: 200px; display: block; cursor: crosshair; }
.sp-rtop { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 6px; }
.sp-legend { display: flex; flex-wrap: wrap; gap: 5px 14px; flex: 1 1 auto; min-width: 0; }
.sp-rctrl { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.lg-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--dim); }
.lg-item i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.lg-item b { color: var(--txt); font-weight: 700; }
.sp-cdot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 7px; flex: 0 0 auto; }
.sp-outs.multi .sp-out { cursor: pointer; }
.sp-outs.multi .sp-out:hover { background: var(--line); }
.sp-outs.multi .sp-name { display: inline-flex; align-items: center; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-badge { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.sp-live { font-size: 11px; font-weight: 700; color: var(--red); letter-spacing: .03em; }
.sp-count { font-size: 12px; font-weight: 600; color: var(--dim); background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.sp-nav { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 10px; }
.sp-dots { display: flex; gap: 5px; align-items: center; }
.sp-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line); cursor: pointer; transition: width .15s, background .15s; }
.sp-dot.on { background: var(--back); width: 18px; border-radius: 3px; }
.sp-prev, .sp-next { background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 6px;
  width: 24px; height: 24px; cursor: pointer; line-height: 1; font-size: 14px; }
.sp-prev:hover, .sp-next:hover { border-color: var(--txt); }

#movers { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; overflow: hidden; }
.mv-list { display: flex; flex-direction: column; }
#movers.expanded .mv-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; }   /* Explore all → scroll within the fixed hero height */
.mv-hdr { font-size: 13px; font-weight: 700; color: var(--txt); padding: 4px 6px 10px; display: flex; align-items: baseline; gap: 8px; }
.mv-hdr span { font-size: 11px; font-weight: 500; color: var(--dim); }
.mv-row { display: flex; align-items: center; gap: 9px; padding: 8px 6px; border-radius: 8px; cursor: pointer; }
.mv-row:hover { background: var(--panel2); }
.mv-rank { color: var(--dim); font-size: 12px; width: 12px; flex: 0 0 auto; text-align: center; }
.mv-ic { width: 24px; height: 24px; border-radius: 6px; object-fit: cover; flex: 0 0 auto; background: var(--panel2); }
.mv-ic.ph { display: inline-block; }
.mv-q { flex: 1 1 auto; font-size: 12.5px; color: var(--txt); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mv-pct { font-size: 13px; font-weight: 700; color: var(--txt); flex: 0 0 auto; }
.mv-chg { font-size: 11px; font-weight: 600; flex: 0 0 auto; width: 44px; text-align: right; }
.mv-chg.up { color: var(--green); }
.mv-chg.down { color: var(--red); }
.mv-all { margin-top: 10px; padding: 9px; border-radius: 9px; border: 1px solid var(--line); background: transparent; color: var(--txt); font: 600 12px inherit; cursor: pointer; }
.mv-all:hover { border-color: var(--txt); }

/* workspace — a canvas of free-floating, draggable ladder panels */
#header { flex: 0 0 auto; }
#workspace { position: relative; flex: 1 1 auto; overflow: auto; }
.panel { position: absolute; width: 480px; max-height: 94vh; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.45); overflow: hidden;
  display: flex; flex-direction: column; resize: both; min-width: 360px; min-height: 340px; }
.panel > #bar { flex: 0 0 auto; }        /* pinned control bar (drag handle moved to the title row above) */
.panel.active { border-color: var(--focusline); box-shadow: 0 10px 40px rgba(0,0,0,.5); }   /* focused panel — thin border, just deepened toward white (no blue ring) */
/* Match view — the runner ladders form ONE grid (pro terminals): square, flush, no drop shadow, a single
   shared divider between columns, and NO blue focus box (the whole match is the unit, not each ladder). */
.panel.mv { border-radius: 0; box-shadow: none; resize: none; }
/* drag-to-resize divider between tiled match ladders (sits on the column's right edge) */
.mv-grip { position: absolute; top: 0; right: 0; width: 6px; height: 100%; cursor: ew-resize; z-index: 20; }
.mv-grip:hover { background: color-mix(in srgb, var(--accent, #4c8dff) 55%, transparent); }
/* width-resize grips for the match grid — overlays on the workspace (above the panels + their scrollbars) so the seam
   between borderless columns is always visible AND grabbable. `left` + `height` are set inline by reflow(). */
.mv-xgrip { position: absolute; top: 0; width: 12px; margin-left: -6px; cursor: ew-resize; }   /* z-index set inline — tracks the match's stack level so charts dragged on top still overlay */
.mv-xgrip::before { content: ''; position: absolute; left: 5px; top: 0; bottom: 0; width: 2px; background: var(--line); transition: background .12s, width .12s; }
.mv-xgrip:hover::before { left: 4px; width: 4px; border-radius: 2px; background: color-mix(in srgb, var(--accent, #4c8dff) 70%, transparent); }
.mv-hgrip { position: absolute; left: 0; right: 6px; bottom: 0; height: 6px; cursor: ns-resize; z-index: 20; }
.mv-hgrip:hover { background: color-mix(in srgb, var(--accent, #4c8dff) 55%, transparent); }
.panel.mv.active { border-color: var(--line); box-shadow: none; }
.panel.mv + .panel.mv { border-left: 0; }
/* ── Chart panel (Lightweight Charts) ── */
.chartpanel { width: 580px; height: 420px; max-height: none; resize: both; overflow: hidden; }
.chartpanel > #cbar { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 7px 10px 7px 12px;
  background: var(--panel); border-bottom: 1px solid var(--line); cursor: move; }
.chartpanel #cmarket { flex: 1 1 auto; min-width: 0; background: var(--panel2); border: 1px solid var(--line); color: var(--txt);
  border-radius: 6px; padding: 5px 8px; font: 12px inherit; }
.chartpanel #cclose, .chartpanel #ckeys, .chartpanel #cind, .chartpanel #cdraw, .chartpanel #cbookbtn, .chartpanel #cwhatif, .chartpanel #ccentre { background: var(--panel2); border: 1px solid var(--line); color: var(--dim); border-radius: 6px;
  cursor: pointer; font-size: 12px; line-height: 1; padding: 4px 8px; }
.chartpanel #cclose:hover { border-color: var(--red); color: var(--red); }
.chartpanel #cind:hover, .chartpanel #cdraw:hover, .chartpanel #cbookbtn:hover, .chartpanel #cwhatif:hover, .chartpanel #ccentre:hover { border-color: var(--txt); color: var(--txt); }
.chartpanel #cbookbtn.on { border-color: var(--back); color: var(--back); background: color-mix(in srgb, var(--back) 14%, var(--panel2)); }
.chartpanel #cdraw.on { border-color: var(--back); color: var(--back); background: color-mix(in srgb, var(--back) 14%, var(--panel2)); }
.cdrawcolor { width: 24px; height: 24px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--panel2); cursor: pointer; }
.cdrawcolor::-webkit-color-swatch-wrapper { padding: 2px; }
.cdrawcolor::-webkit-color-swatch { border: none; border-radius: 3px; }
.p-color { width: 42px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--panel2); cursor: pointer; }
.p-color::-webkit-color-swatch-wrapper { padding: 2px; }
.p-color::-webkit-color-swatch { border: none; border-radius: 4px; }
.ccd { font: 600 11px ui-monospace, monospace; color: var(--dim); min-width: 34px; text-align: center; }
.cscore { color: var(--green); min-width: auto; white-space: nowrap; }   /* live match score chip in the chart header (matches the ladder's in-play colour) */
.chartpanel #ckeys { margin-left: auto; }
.chartpanel #ckeys:hover { border-color: var(--txt); color: var(--txt); }
/* on = solid blue, matching the Candles / 1m active state (.sp-tf .tf.on) */
.chartpanel #ckeys.on, .chartpanel #cwhatif.on, .chartpanel #ccentre.on { background: var(--back); border-color: var(--back); color: #fff; }
/* ── Match Stats panel (api-football) ── */
/* ── Profile panel (Positions / History / Settings) ── */
.profilepanel { width: 620px; height: 560px; max-height: none; resize: none; overflow: hidden; }
/* Custom bottom-right resize grip — larger hit area than the native ::-webkit-resizer, layered ABOVE #pbody's
   scrollbar so grabbing the corner can't seize the scroll thumb (which used to race the history list to the bottom
   on every resize — Tony bug 47). */
.profilepanel > #p-resize { position: absolute; right: 1px; bottom: 1px; width: 22px; height: 22px; cursor: nwse-resize; z-index: 6; opacity: .45;
  background: linear-gradient(-45deg, transparent 0 44%, var(--dim) 44% 52%, transparent 52% 66%, var(--dim) 66% 74%, transparent 74%); }
.profilepanel > #p-resize:hover { opacity: .9; }
.profilepanel > #pbar { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: var(--panel); border-bottom: 1px solid var(--line); cursor: move; }
.profilepanel .p-title { font-size: 13px; font-weight: 700; color: var(--txt); }
.profilepanel #prefresh, .profilepanel #pclose { background: var(--panel2); border: 1px solid var(--line); color: var(--dim); border-radius: 6px; cursor: pointer; font-size: 12px; line-height: 1; padding: 5px 8px; }
.profilepanel #prefresh:hover { border-color: var(--txt); color: var(--txt); }
.profilepanel #pclose:hover { border-color: var(--red); color: var(--red); }
.profilepanel #ptabs { flex: 0 0 auto; align-self: flex-start; margin: 8px 12px 0; }
.profilepanel > #pbody { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 10px 12px 16px; }

/* ── desk Leaderboard panel ── */
.lbpanel { width: 460px; height: 560px; max-height: none; resize: both; overflow: hidden; }
.lbpanel > #lbbar { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: var(--panel); border-bottom: 1px solid var(--line); cursor: move; }
.lbpanel .p-title { font-size: 13px; font-weight: 700; color: var(--txt); }
.lbpanel .lb-tagline { font-size: 11px; color: var(--dim); }
.lbpanel #lb-win { margin-left: auto; }
.lbpanel #lb-refresh, .lbpanel #lb-close { background: var(--panel2); border: 1px solid var(--line); color: var(--dim); border-radius: 6px; cursor: pointer; font-size: 12px; line-height: 1; padding: 5px 8px; }
.lbpanel #lb-refresh:hover { border-color: var(--txt); color: var(--txt); }
.lbpanel #lb-close:hover { border-color: var(--red); color: var(--red); }
#lb-you { flex: 0 0 auto; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--panel2); }
.lb-you-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.lb-you-tag { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); }
.lb-you-rk { font-weight: 800; color: var(--txt); font-variant-numeric: tabular-nums; }
.lb-you-vol { font-weight: 700; color: var(--green); font-variant-numeric: tabular-nums; }
.lb-you-nk { color: var(--txt); flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-you-cta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--txt); }
.lb-you-cta > span:first-child { color: var(--dim); }
#lb-nick { background: var(--panel); border: 1px solid var(--line); color: var(--txt); border-radius: 6px; padding: 5px 8px; font: 13px inherit; width: 160px; }
#lb-nick:focus { border-color: var(--blue); outline: none; }
.lb-mini { background: var(--panel); border: 1px solid var(--line); color: var(--dim); border-radius: 6px; cursor: pointer; font: 600 12px inherit; padding: 5px 10px; }
.lb-mini:hover { color: var(--txt); border-color: var(--txt); }
.lb-mini.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.lb-mini.on:hover { color: #fff; }
.lb-mini.lb-danger:hover { color: var(--red); border-color: var(--red); }
.p-lbrow { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.p-lbrow #p-lbnick { background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 6px; padding: 5px 8px; font: 13px inherit; width: 150px; }
.p-lbrow #p-lbnick:focus { border-color: var(--blue); outline: none; }
.p-lbrow .p-lbdel:hover { color: var(--red); border-color: var(--red); }
.p-lbmsg { font-size: 12px; color: var(--dim); }
.lb-note { font-size: 12px; color: var(--amber); }
.lb-dim { color: var(--dim); }
#lb-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 0 12px; }
.lb-row { display: grid; grid-template-columns: 1fr 84px auto; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); font-size: 13px; }
.lb-row.me { background: color-mix(in srgb, var(--back) 12%, transparent); }
.lb-nm { display: flex; align-items: baseline; gap: 10px; min-width: 0; }   /* rank + name as one left-aligned group */
.lb-rk { color: var(--dim); font-weight: 700; font-variant-numeric: tabular-nums; min-width: 16px; text-align: left; flex: 0 0 auto; }   /* left-aligned so the rank sits under the USERNAME header */
.lb-row.me .lb-rk { color: var(--back); }
.lb-nk { color: var(--txt); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.lb-vol { color: var(--txt); font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
/* column headers — Username above the rank+name group, Volume traded above the value (symmetric insets) */
.lb-head { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 10px 14px 7px; border-bottom: 1px solid var(--line); }
.lb-head span { color: var(--dim); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.lb-head .lb-vol { color: var(--dim); font-weight: 700; }
/* volume meter — #1 fills the bar, everyone else scales to the leader, in keeping with the app's gauges */
.lb-meter { align-self: center; height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--line) 65%, transparent); overflow: hidden; }
.lb-meter > i { display: block; height: 100%; border-radius: 999px; background: var(--back); }   /* desk blue — same token as the active 30D toggle (--blue is undefined in this theme) */
.lb-empty { padding: 30px 16px; text-align: center; color: var(--dim); font-size: 13px; }
.p-empty { color: var(--dim); text-align: center; padding: 36px 10px; font-size: 13px; }
.p-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 14px; }
.p-claim { border-color: color-mix(in srgb, var(--green) 45%, var(--line)) !important; }
.p-claim-btn { display: block; width: 100%; margin: 0 0 14px; padding: 9px 12px; border: 1px solid color-mix(in srgb, var(--green) 55%, var(--line)); border-radius: 8px; background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); font-weight: 700; font-size: 13px; cursor: pointer; transition: background .12s; }
.p-claim-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--green) 26%, transparent); }
.p-claim-btn:disabled { opacity: .6; cursor: default; }
.p-sum > div { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; }
.p-sl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--dim); }
.p-sv { font-size: 15px; font-weight: 700; color: var(--txt); font-variant-numeric: tabular-nums; }
.p-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.p-tbl th { text-align: right; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--dim); padding: 4px 8px; border-bottom: 1px solid var(--line); }
.p-tbl th:first-child { text-align: left; }
.p-tbl td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.p-posrow { cursor: pointer; }
.p-posrow:hover td { background: var(--panel2); }   /* clickable position → opens its market */
.p-num { text-align: right; font-variant-numeric: tabular-nums; color: var(--txt); white-space: nowrap; }
.p-mt { font-weight: 600; color: var(--txt); line-height: 1.25; }
.p-mo { font-size: 11px; color: var(--dim); margin-top: 1px; }
.p-pct { display: block; font-size: 10px; opacity: .8; }
.p-num.up, .p-sv.up { color: var(--green); }
.p-num.down, .p-sv.down { color: var(--red); }
.p-redeem { color: var(--green); font-weight: 600; }
.p-ordhd { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--dim); margin: 14px 0 4px; display: flex; align-items: center; gap: 6px; }
.p-ordhd:first-child { margin-top: 4px; }
.p-ordn { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 0 7px; font-size: 10px; color: var(--txt); }
.p-cancel { background: transparent; border: 1px solid var(--line); color: var(--dim); border-radius: 6px; cursor: pointer; font-size: 12px; line-height: 1; padding: 3px 7px; }
.p-cancel:hover { border-color: var(--red); color: var(--red); }
.p-subtabs { margin-bottom: 10px; }
.p-side { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .04em; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line); }
.p-side.buy { color: var(--green); border-color: color-mix(in srgb, var(--green) 45%, var(--line)); }
.p-side.sell { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, var(--line)); }
.p-side.redeem { color: var(--dim); }
.p-side.close { color: var(--dim); border-color: var(--line); }   /* a SELL fill shown as a close in the sports trade-log view */
/* per-trade fee breakdown (History → Trades): row expands to reveal the exact Polymarket + Desk fee it paid */
.p-tbl-fee .p-trow.clk { cursor: pointer; }
.p-tbl-fee .p-trow.clk:hover { background: color-mix(in srgb, var(--txt) 4%, transparent); }
.p-feetag { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--line); color: var(--dim); font-variant-numeric: tabular-nums; font-size: 10px; white-space: nowrap; }
.p-feechev { font-style: normal; transition: transform .12s ease; line-height: 1; }
.p-trow.open .p-feechev { transform: rotate(180deg); }
.p-feerow > td { padding: 0 8px 10px !important; border-bottom: 1px solid var(--line); }
.p-fee { display: flex; flex-direction: column; gap: 5px; padding: 10px 12px; border-radius: 8px; background: color-mix(in srgb, var(--txt) 4%, transparent); border: 1px solid var(--line); }
.p-fee-r { display: grid; grid-template-columns: 1fr auto minmax(70px, auto); align-items: baseline; gap: 12px; font-size: 12px; }
.p-fee-k { color: var(--txt); font-weight: 600; }
.p-fee-m { color: var(--dim); font-size: 11px; text-align: right; }
.p-fee-v { text-align: right; font-variant-numeric: tabular-nums; color: var(--txt); }
.p-fee-tot { padding-top: 5px; margin-top: 1px; border-top: 1px solid var(--line); }
.p-fee-tot .p-fee-k, .p-fee-tot .p-fee-v { font-weight: 800; }
.p-fee-note { color: var(--dim); font-size: 10px; line-height: 1.35; margin-top: 2px; }
.p-histlang { margin-bottom: 8px; align-items: center; }
.p-hl-lbl { color: var(--dim); font-size: 11px; font-weight: 600; margin: 0 4px 0 2px; }
.p-note { font-size: 10.5px; color: var(--dim); margin-top: 10px; line-height: 1.4; }
.p-range { margin-bottom: 12px; }
/* PnL calendar (History → Calendar) */
.p-cal-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.p-cal-title { font-size: 14px; font-weight: 700; min-width: 130px; }
.p-cal-arrow { width: 26px; height: 26px; border: 1px solid var(--line); background: var(--panel2); color: var(--txt); border-radius: 7px; cursor: pointer; font-size: 15px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.p-cal-arrow:hover { border-color: var(--txt); }
.p-cal-arrow.off { opacity: .35; cursor: default; }
.p-cal-tot { margin-left: auto; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.p-cal-tot.up { color: var(--green); } .p-cal-tot.down { color: var(--red); }
.p-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.p-cal-dows { margin-bottom: 6px; }
.p-cal-dow { text-align: center; font-size: 10.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .04em; padding-bottom: 2px; }
.p-cal-cell { position: relative; aspect-ratio: 1 / 1; border-radius: 9px; background: var(--panel2); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; overflow: hidden; }
.p-cal-cell.empty { background: transparent; border-color: transparent; }
.p-cal-cell.flat { color: var(--dim); }
.p-cal-cell.up, .p-cal-cell.dn { border-color: transparent; color: var(--txt); }
.p-cal-cell.hot { color: #fff; }
.p-cal-d { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.p-cal-pl { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.p-caltip { position: fixed; z-index: 99999; display: none; min-width: 190px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; box-shadow: 0 8px 28px rgba(0,0,0,.35); pointer-events: none; font-size: 12px; }
.p-caltip.show { display: block; }
.p-caltip-hd { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; font-weight: 700; }
.p-caltip-hd .up { color: var(--green); } .p-caltip-hd .down { color: var(--red); }
.p-caltip-sub { font-size: 10.5px; color: var(--dim); margin: 2px 0 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.p-caltip-rows { display: flex; flex-direction: column; gap: 5px; }
.p-caltip-rows > div { display: flex; justify-content: space-between; gap: 16px; }
.p-caltip-rows > div > span:first-child { color: var(--dim); }
.p-caltip-rows > div > span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }
.pl-section { margin-bottom: 18px; }
.pl-h { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); margin-bottom: 9px; }
.pl-row { display: grid; grid-template-columns: 120px 1fr 66px; align-items: center; gap: 10px; margin-bottom: 6px; }
.pl-lbl { font-size: 12px; color: var(--txt); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-track { height: 15px; background: var(--panel2); border-radius: 4px; overflow: hidden; }
.pl-bar { height: 100%; border-radius: 4px; min-width: 2px; }
.pl-bar.up { background: var(--green); }
.pl-bar.down { background: var(--red); }
.pl-val { text-align: right; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pl-val.up { color: var(--green); }
.pl-val.down { color: var(--red); }
.p-settings { display: flex; flex-direction: column; gap: 6px; }
.p-srow { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.p-slbl { font-size: 13px; font-weight: 600; color: var(--txt); display: flex; flex-direction: column; gap: 2px; }
.p-shint { font-size: 10.5px; font-weight: 400; color: var(--dim); }
.p-seg { flex: 0 0 auto; }
.p-subtabs { align-self: flex-start; margin-bottom: 6px; }
/* standalone pill button (e.g. Auto) */
.p-btn { background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 7px; padding: 5px 12px; cursor: pointer; font: 12px inherit; font-weight: 600; opacity: .8; }
.p-btn:hover { opacity: 1; border-color: var(--txt); }
/* connected pill groups — same look as the .seg toggles */
.p-btns { display: inline-flex; border: 1px solid var(--grid); border-radius: 7px; overflow: hidden; flex: 0 0 auto; }
.p-btns .p-btn { border: 0; border-right: 1px solid var(--line); border-radius: 0; opacity: .7; }
.p-btns .p-btn:last-child { border-right: 0; }
.p-wd { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: 1; }
.p-wd-in { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; color: var(--txt); font: inherit; font-size: 12px; padding: 6px 8px; }
.p-wd-in { width: 240px; } .p-wd-amt { width: 90px; }
.p-wd-msg { font-size: 11px; color: var(--dim); flex-basis: 100%; text-align: right; }
.p-dep-addr { flex: 1; min-width: 0; font-family: ui-monospace, "SF Mono", monospace; font-size: 11px; word-break: break-all; color: var(--txt); background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
/* Wallet action dialog (Add funds / Withdraw) — centred popup over the app */
#bjp-modal { position: fixed; inset: 0; z-index: 100001; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.5); }
.bjp-modal-card { width: min(420px, calc(100vw - 40px)); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.45); overflow: hidden; }
.bjp-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.bjp-modal-title { font-weight: 700; font-size: 14px; color: var(--txt); }
.bjp-modal-x { background: none; border: 0; color: var(--dim); font-size: 15px; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.bjp-modal-x:hover { color: var(--txt); background: var(--panel2); }
.bjp-modal-body { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.bjp-modal-body .modal-note { font-size: 12px; line-height: 1.5; color: var(--dim); }
.bjp-modal-body .modal-note b { color: var(--txt); }
.bjp-modal-body .modal-row { display: flex; align-items: center; gap: 8px; }
.bjp-modal-body .modal-in { flex: 1; min-width: 0; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; color: var(--txt); font: inherit; font-size: 12px; padding: 8px 10px; }
.bjp-modal-body .modal-amt { flex: 0 0 120px; }
.bjp-modal-body .modal-sweep { align-self: flex-start; }
/* ── pro-terminal-style market modal (grid card → gather all of an event's markets) ── */
.bjp-modal-card.mm-card { width: min(760px, calc(100vw - 40px)); }
.mm-card .bjp-modal-head { align-items: flex-start; gap: 12px; padding: 14px 16px; }
.mm-card .mm-ic { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; flex: 0 0 auto; background: var(--panel2); }
.mm-card .mm-ic.ph { display: inline-block; }
.mm-card .mm-htext { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mm-card .mm-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--mm-accent); text-transform: uppercase; }
.mm-livesc { color: var(--red); display: inline-flex; align-items: center; gap: 5px; }
.mm-livesc > i { width: 6px; height: 6px; border-radius: 50%; background: var(--red); display: inline-block; animation: livepulse 1.4s ease-in-out infinite; }
.mm-card .mm-title { font-size: 17px; font-weight: 700; color: var(--txt); line-height: 1.25; }
.mm-card .mm-mv { flex: 0 0 auto; background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 7px; font: inherit; font-size: 12px; font-weight: 600; padding: 6px 10px; cursor: pointer; }
.mm-card .mm-mv:hover { border-color: var(--accent, #4c8dff); }
.mm-card .mm-hstar { flex: 0 0 auto; background: none; border: 0; color: var(--dim); font-size: 16px; cursor: pointer; padding: 2px 4px; }
.mm-card .mm-hstar.on { color: #f6c945; }
.mm-card .bjp-modal-body { gap: 0; padding: 4px 0 8px; max-height: min(66vh, 640px); overflow-y: auto; }
.mm-card .mm-load { padding: 22px 16px; color: var(--dim); font-size: 13px; }
.mm-sec { border-top: 1px solid var(--line); }
.mm-sec:first-child { border-top: 0; }
.mm-cat { display: flex; align-items: center; gap: 8px; padding: 11px 16px; cursor: pointer; user-select: none; }
.mm-cat:hover { background: var(--panel2); }
.mm-caret { color: var(--dim); font-size: 11px; width: 12px; flex: 0 0 auto; }
.mm-clabel { font-size: 12px; font-weight: 700; letter-spacing: .05em; color: var(--mm-accent); text-transform: uppercase; }
.mm-ccount { font-size: 12px; color: var(--dim); font-weight: 600; }
.mm-rows { display: flex; flex-direction: column; }
.mm-rows[hidden] { display: none; }   /* explicit display above beats the [hidden] UA rule → restore it so collapse works */
.mm-mkt { display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 36px; cursor: pointer; border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.mm-mkt:hover { background: var(--panel2); }
.mm-mlbl { flex: 1 1 auto; min-width: 0; font-size: 14px; color: var(--txt); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-vol { flex: 0 0 auto; font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.mm-cht { flex: 0 0 auto; background: none; border: 1px solid var(--line); color: var(--dim); border-radius: 6px; font: inherit; font-size: 11px; padding: 3px 8px; cursor: pointer; opacity: 0; transition: opacity .1s; }
.mm-mkt:hover .mm-cht { opacity: 1; }
.mm-cht:hover { color: var(--txt); border-color: var(--accent, #4c8dff); }
.mm-open { flex: 0 0 auto; color: var(--dim); font-size: 14px; }
.mm-mkt:hover .mm-open { color: var(--txt); }
.bjp-modal-body .p-wd-msg { flex-basis: auto; text-align: left; min-height: 14px; }
.p-btns .p-btn:hover { opacity: 1; }
.p-checks { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; flex: 1 1 auto; }
.p-check { display: inline-flex; align-items: center; gap: 4px; background: var(--panel2); border: 1px solid var(--line); color: var(--dim); border-radius: 12px; padding: 3px 9px; cursor: pointer; font-size: 11px; }
.p-check.on { border-color: var(--accent, #4c8dff); color: var(--txt); }
.p-check input { margin: 0; }
.p-colorwrap { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.p-elems { display: flex; flex-direction: column; gap: 6px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.p-elemrow { display: grid; grid-template-columns: 1fr auto 112px; align-items: center; gap: 10px; }   /* fixed pop/dock column → Expand/Collapse aligns on every row */
.p-elemrow-4 { grid-template-columns: 1fr repeat(4, auto); gap: 8px; }   /* chart tools: name + arm · show/hide · fold · pop — grid keeps the 4 groups column-aligned across rows */
.p-elemrow-4 .p-mini { padding: 5px 9px; }   /* four control groups per row — trim so it fits the settings width comfortably */
.p-elemrow-4 .p-mini-na { padding: 5px 9px; }
.p-elemname { font-size: 12px; color: var(--txt); }
.p-elemctl { display: inline-flex; justify-self: end; }
.p-elemctl:has(.p-mini) { border: 1px solid var(--grid); border-radius: 7px; overflow: hidden; }
.p-armcol { display: inline-flex; justify-self: end; }
.p-armcol:has(.p-mini) { border: 1px solid var(--grid); border-radius: 7px; overflow: hidden; }
.p-mini { border: 0; border-right: 1px solid var(--line); background: var(--panel2); color: var(--txt); opacity: .7; padding: 5px 12px; cursor: pointer; font: 12px inherit; font-weight: 600; transition: opacity .12s; }
.p-mini:last-child { border-right: 0; }
.p-mini:hover { opacity: 1; }
.p-mini.on { background: #1f6feb; color: #fff; opacity: 1; }
.p-mini-na { color: var(--dim); opacity: .4; font-size: 11px; padding: 5px 12px; }
.statspanel { width: 470px; height: 590px; max-height: none; resize: both; overflow: hidden; }
.statspanel > #sbar { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: var(--panel); border-bottom: 1px solid var(--line); cursor: move; }
.statspanel #smarket { flex: 1 1 auto; min-width: 0; background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 6px; padding: 5px 8px; font: 12px inherit; }
.statspanel #slink, .statspanel #srefresh, .statspanel #sclose { background: var(--panel2); border: 1px solid var(--line); color: var(--dim); border-radius: 6px; cursor: pointer; font-size: 12px; line-height: 1; padding: 5px 8px; }
.statspanel #sclose:hover { border-color: var(--red); color: var(--red); }
.statspanel #slink:hover, .statspanel #srefresh:hover { border-color: var(--txt); color: var(--txt); }
#smanual { flex: 0 0 auto; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--panel2); }
#ssearch { width: 100%; background: var(--panel); border: 1px solid var(--line); color: var(--txt); border-radius: 6px; padding: 6px 8px; font: 12px inherit; }
#sresults { margin-top: 6px; max-height: 170px; overflow-y: auto; }
.s-res { padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.s-res:hover { background: var(--panel); }
#sfixture { flex: 0 0 auto; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.s-empty { color: var(--dim); font-size: 12px; padding: 20px 12px; text-align: center; line-height: 1.5; }
/* ── match events timeline ── */
.ev-list { display: flex; flex-direction: column; }
.ev-row { display: grid; grid-template-columns: 34px 20px 1fr; align-items: start; gap: 8px; padding: 7px 10px;
  border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
.ev-row.home { border-left-color: var(--back); } .ev-row.away { border-left-color: var(--lay); }
.ev-row.goal { background: color-mix(in srgb, var(--green) 9%, transparent); }
.ev-min { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 12px; color: var(--dim); text-align: right; padding-top: 1px; }
.ev-ic { font-size: 14px; line-height: 1.2; }
.ev-body { min-width: 0; font-size: 12.5px; line-height: 1.35; }
.ev-body b { font-weight: 600; }
.ev-assist, .ev-sub { color: var(--dim); font-size: 11px; }
.ev-detail { color: var(--dim); font-size: 11px; margin-top: 1px; }
.s-fx { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.s-team { display: flex; align-items: center; gap: 8px; flex: 1 1 0; min-width: 0; font-weight: 700; font-size: 13px; }
.s-team.away { justify-content: flex-end; text-align: right; }
.s-team img { width: 26px; height: 26px; object-fit: contain; flex: 0 0 auto; }
.s-score { flex: 0 0 auto; text-align: center; font-weight: 800; font-size: 20px; line-height: 1.1; }
.s-ko { font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.s-status { font-size: 10px; font-weight: 700; color: var(--dim); margin-top: 2px; }
.s-status.live { color: var(--green); }
.s-league { font-size: 10px; color: var(--dim); font-weight: 400; margin-top: 1px; }
.statspanel #stabs { flex: 0 0 auto; align-self: flex-start; margin: 8px 12px 0; }
.statspanel > #sbody { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 10px 12px 16px; }

/* ── Sonar panel — on-chain intelligence ── */
.sonarpanel { width: 720px; height: 560px; max-height: none; resize: both; overflow: hidden; }
.sonarpanel .sn-scope { flex: 0 0 auto; }   /* the scope tabs (This market / Global / Leaders / Following) never shrink → "Following" can't get clipped; the market name (sn-mkt) takes the slack instead */
.sonarpanel > #snbar { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 7px 10px; background: var(--panel); border-bottom: 1px solid var(--line); cursor: move; }
.sonarpanel .sn-brand { font-weight: 700; letter-spacing: .02em; color: var(--accent, #4c8dff); flex: 0 0 auto; }
.sonarpanel .sn-mkt { color: var(--dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; min-width: 0; }
.sonarpanel #sn-close { background: var(--panel2); border: 1px solid var(--line); color: var(--dim); border-radius: 6px; cursor: pointer; padding: 4px 8px; line-height: 1; }
.sonarpanel #sn-close:hover { border-color: var(--red); color: var(--red); }
.sonarpanel > #snbody { flex: 1 1 auto; min-height: 0; display: flex; }
.sonarpanel .sn-col { flex: 1 1 50%; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.sonarpanel .sn-holders { border-right: 1px solid var(--line); }
.sonarpanel.sn-global .sn-holders { display: none; }               /* global mode: tape spans the panel */
.sonarpanel.sn-global .sn-tape { flex: 1 1 100%; }
.sonarpanel .sn-h { flex: 0 0 auto; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); padding: 9px 12px 6px; display: flex; align-items: center; gap: 8px; }
.sonarpanel .sn-flt { margin-left: auto; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--dim); cursor: pointer; }
.sonarpanel .sn-flt input { vertical-align: middle; margin-right: 3px; }
.sonarpanel #sn-hlist, .sonarpanel #sn-tlist { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 6px 10px; }
.sonarpanel .sn-dim { color: var(--dim); font-size: 12px; padding: 14px 12px; text-align: center; line-height: 1.5; }
.sonarpanel .sn-side { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--dim); padding: 9px 8px 3px; letter-spacing: .05em; }
.sonarpanel .sn-hrow, .sonarpanel .sn-trow { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.sonarpanel .sn-hrow:hover, .sonarpanel .sn-trow:hover { background: var(--panel2); }
.sonarpanel .sn-rk { color: var(--dim); width: 14px; text-align: right; flex: 0 0 auto; font-size: 11px; }
.sonarpanel .sn-nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sonarpanel .sn-sh { flex: 0 0 auto; color: var(--dim); width: 46px; text-align: right; }
.sonarpanel .sn-av { flex: 0 0 auto; color: var(--dim); width: 34px; text-align: right; }
.sonarpanel .sn-pl { flex: 0 0 auto; width: 64px; text-align: right; font-weight: 600; }
.sonarpanel .sn-tt { flex: 0 0 auto; color: var(--dim); width: 28px; font-size: 11px; }
.sonarpanel .sn-side2 { flex: 0 0 auto; width: 34px; font-weight: 700; font-size: 11px; }
.sonarpanel .sn-out { flex: 0 1 auto; min-width: 0; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }   /* show the FULL outcome when the panel is wide (cap relative to width, not a hard 64px); truncate only under pressure */
.sonarpanel .sn-fpx { flex: 0 0 auto; font-weight: 700; font-size: 11px; font-variant-numeric: tabular-nums; padding: 0 5px; border-radius: 4px; }
.sonarpanel .sn-fpx.up { color: var(--green); background: color-mix(in srgb, var(--green) 16%, transparent); }
.sonarpanel .sn-fpx.dn { color: var(--red); background: color-mix(in srgb, var(--red) 16%, transparent); }
.sonarpanel .sn-fpx.flat { color: var(--dim); background: color-mix(in srgb, var(--dim) 14%, transparent); }
.sonarpanel .sn-mk { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); }
.sonarpanel .sn-usd { flex: 0 0 auto; margin-left: auto; font-weight: 700; padding-left: 6px; }
.sonarpanel .up { color: var(--green); } .sonarpanel .dn { color: var(--red); }
.sonarpanel .sn-lbl { display: inline-block; margin-left: 5px; font-size: 9px; font-weight: 700; width: 14px; height: 14px; line-height: 14px; text-align: center; border-radius: 3px; color: #fff; vertical-align: middle; }
.sonarpanel .l-experienced { background: #2ea043; } .sonarpanel .l-bot { background: #b072e0; } .sonarpanel .l-recreational { background: #d99a2b; }
.sonarpanel .sn-wallet { flex: 0 0 auto; max-height: 46%; overflow-y: auto; border-top: 1px solid var(--line); background: var(--panel2); padding: 8px 12px 12px; font-size: 12px; }
.sonarpanel .sn-wh { display: flex; align-items: center; margin-bottom: 6px; }
.sonarpanel .sn-wx { background: transparent; border: 0; color: var(--dim); cursor: pointer; font-size: 13px; }
.sonarpanel .sn-wx:hover { color: var(--red); }
.sonarpanel .sn-wstats { display: flex; gap: 18px; margin-bottom: 8px; color: var(--dim); }
.sonarpanel .sn-wstats b { color: var(--txt); }
.sonarpanel .sn-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.sonarpanel .sn-tagslbl { color: var(--dim); font-size: 11px; margin-right: 2px; }
.sonarpanel .sn-tag { background: var(--panel); border: 1px solid var(--line); color: var(--dim); border-radius: 12px; padding: 3px 10px; cursor: pointer; font: 11px inherit; text-transform: capitalize; }
.sonarpanel .sn-tag:hover { border-color: var(--txt); color: var(--txt); }
.sonarpanel .sn-tag.on { border-color: var(--accent, #4c8dff); color: var(--txt); }
.sonarpanel .sn-wp { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.sonarpanel .sn-wpt { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sonarpanel .sn-wpo { flex: 0 1 auto; min-width: 0; color: var(--dim); max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }   /* outcome + price chip: show fully when the panel is wide (was a hard 54px that clipped "Juventus" and the price) */
.sonarpanel .sn-when { flex: 0 0 auto; font-size: 9.5px; font-weight: 700; letter-spacing: .02em; padding: 1px 6px; border-radius: 999px; white-space: nowrap; }
.sonarpanel .sn-when:empty { display: none; }
.sonarpanel .sn-when.live { color: #fff; background: rgba(34,197,94,.92); }
.sonarpanel .sn-when.soon { color: var(--txt); background: var(--panel2); border: 1px solid var(--line); }
.sonarpanel .sn-when.done { color: var(--dim); background: var(--panel2); }
.sonarpanel .sn-ext { display: inline-block; margin-top: 8px; color: var(--accent, #4c8dff); cursor: pointer; font-size: 11px; }
/* whale-flow chart */
.sonarpanel > #sn-flowwrap { flex: 0 0 auto; height: 94px; border-bottom: 1px solid var(--line); padding: 6px 12px 8px; display: flex; flex-direction: column; }
.sonarpanel .sn-flowhd { display: flex; align-items: baseline; justify-content: space-between; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--dim); margin-bottom: 3px; }
.sonarpanel .sn-flownet { font-size: 11px; font-weight: 700; letter-spacing: 0; text-transform: none; }
.sonarpanel .sn-flownet.up { color: var(--green); } .sonarpanel .sn-flownet.dn { color: var(--red); }
.sonarpanel #sn-flow { flex: 1 1 auto; width: 100%; min-height: 0; display: block; }
/* buy/sell pressure bar (tape) */
.sonarpanel .sn-press { display: flex; height: 4px; margin: 0 8px 6px; border-radius: 2px; overflow: hidden; background: var(--line); }
.sonarpanel .sn-press i { display: block; height: 100%; }
.sonarpanel .sn-press .b { background: var(--green); } .sonarpanel .sn-press .s { background: var(--red); }
.sonarpanel.sn-global .sn-press { display: none; }
/* inline data-bars behind holder + wallet-position rows */
.sonarpanel .sn-hrow, .sonarpanel .sn-wp { position: relative; }
.sonarpanel .sn-hrow::before, .sonarpanel .sn-wp::before { content: ''; position: absolute; left: 0; top: 2px; bottom: 2px; width: var(--bw, 0%); background: var(--accent, #4c8dff); opacity: .10; border-radius: 5px; pointer-events: none; }
.sonarpanel .sn-hrow > *, .sonarpanel .sn-wp > * { position: relative; }
/* leaderboard (Leaders scope) */
.sonarpanel .sn-lb { flex: 1 1 auto; min-height: 0; display: none; flex-direction: column; }
.sonarpanel.sn-leaders .sn-lb { display: flex; }
.sonarpanel.sn-leaders > #sn-flowwrap, .sonarpanel.sn-leaders > #snbody { display: none; }
.sonarpanel .sn-lbhd { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.sonarpanel #sn-lblist { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 8px 10px; }
.sonarpanel .sn-lbrow { position: relative; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.sonarpanel .sn-lbrow:hover { background: var(--panel2); }
.sonarpanel .sn-lbrow::before { content: ''; position: absolute; left: 0; top: 2px; bottom: 2px; width: var(--bw, 0%); background: var(--accent, #4c8dff); opacity: .10; border-radius: 5px; pointer-events: none; }
.sonarpanel .sn-lbrow > * { position: relative; }
.sonarpanel .sn-lbv { margin-left: auto; font-weight: 700; }
.sonarpanel .sn-lbv.up { color: var(--green); } .sonarpanel .sn-lbv.dn { color: var(--red); }
/* Following scope */
.sonarpanel .sn-fl { flex: 1 1 auto; min-height: 0; display: none; flex-direction: column; }
.sonarpanel.sn-following .sn-fl { display: flex; }
.sonarpanel.sn-following > #sn-flowwrap, .sonarpanel.sn-following > #snbody, .sonarpanel.sn-following > #sn-lb { display: none; }
.sonarpanel #sn-fllist { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 6px 8px 10px; }
.sonarpanel .sn-flrow { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.sonarpanel .sn-flrow:hover { background: var(--panel2); }
.sonarpanel .sn-flhdr { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 10px; font-size: 11px; color: var(--dim); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.sonarpanel .sn-flv { margin-left: auto; font-weight: 700; }
.sonarpanel .sn-flrow .sn-pl { flex: 0 0 auto; width: 64px; text-align: right; font-weight: 600; }
.sonarpanel .sn-unfollow { flex: 0 0 auto; background: transparent; border: 0; color: var(--dim); cursor: pointer; font-size: 12px; padding: 2px 4px; }
.sonarpanel .sn-unfollow:hover { color: var(--red); }
/* follow button + following marker */
.sonarpanel .sn-followbtn { background: var(--panel); border: 1px solid var(--line); color: var(--txt); border-radius: 12px; padding: 3px 11px; margin-left: 10px; cursor: pointer; font: 11px inherit; font-weight: 600; }
.sonarpanel .sn-followbtn:hover { border-color: var(--txt); }
.sonarpanel .sn-followbtn.on { background: color-mix(in srgb, var(--accent, #4c8dff) 18%, transparent); border-color: var(--accent, #4c8dff); color: var(--accent, #4c8dff); }
.sonarpanel .sn-follows { color: var(--accent, #4c8dff); font-size: 8px; margin-left: 5px; vertical-align: middle; }
/* search ANY trader → follow/copy (pinned at the bottom of the Following tab) */
.sonarpanel .sn-flsearch { flex: 0 0 auto; border-top: 1px solid var(--line); padding: 8px; background: var(--panel); }
.sonarpanel .sn-flsrow { display: flex; align-items: center; gap: 7px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; }
.sonarpanel .sn-flsrow:focus-within { border-color: var(--accent, #4c8dff); }
.sonarpanel .sn-flsico { color: var(--dim); font-size: 13px; flex: 0 0 auto; }
.sonarpanel #sn-flq { flex: 1 1 auto; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--txt); font: 12px inherit; }
.sonarpanel #sn-flq::placeholder { color: var(--dim); }
.sonarpanel .sn-flres { max-height: 190px; overflow-y: auto; margin-top: 6px; }
.sonarpanel .sn-flres:empty { display: none; }
.sonarpanel .sn-flrrow { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.sonarpanel .sn-flrrow:hover { background: var(--panel2); }
.sonarpanel .sn-flrsub { color: var(--dim); font-size: 10.5px; margin-left: 7px; }
.s-stats { display: flex; flex-direction: column; gap: 12px; }
.s-strow { display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 8px; }
.s-sv { font-weight: 700; font-size: 13px; }
.s-sv.right { text-align: right; }
.s-slabel { text-align: center; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); font-weight: 700; }
.s-slabel.nocase { text-transform: none; letter-spacing: normal; }   /* keep "xG" as-is */
.s-sbar { grid-column: 1 / -1; display: flex; height: 5px; border-radius: 3px; overflow: hidden; background: var(--line); margin-top: 5px; }
.s-sfill.home { background: var(--back); }
.s-sfill.away { background: var(--green); }
.s-lu-note { text-align: center; font-size: 11px; color: var(--dim); padding: 4px 8px; margin: 2px 0 6px; background: color-mix(in srgb, var(--dim) 12%, transparent); border-radius: 5px; }
.s-lineups { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.s-lu-h { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.s-lu-h img { width: 20px; height: 20px; object-fit: contain; }
.s-coach { font-size: 11px; margin: 3px 0 6px; }
.s-lu-sec { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); font-weight: 700; margin: 8px 0 4px; border-bottom: 1px solid var(--line); padding-bottom: 3px; }
.s-pl { font-size: 12px; padding: 3px 0; display: flex; align-items: center; gap: 6px; }
.s-pl.sub { opacity: .72; }
.s-num { display: inline-block; min-width: 18px; text-align: center; color: var(--dim); font-weight: 700; font-size: 11px; }
/* ── Lineups pitch view ── */
.s-lineups2 { display: flex; flex-direction: column; gap: 12px; }
.s-pitch-hd { display: flex; justify-content: space-between; font-size: 12px; color: var(--txt); }
.s-pitch-hd b { color: var(--dim); font-weight: 700; }
.s-pitch { position: relative; width: 100%; aspect-ratio: 7 / 5; border-radius: 10px; overflow: hidden;
  background: repeating-linear-gradient(90deg, #1f7d40 0 7.14%, #1c743b 7.14% 14.28%); box-shadow: inset 0 0 0 2px rgba(255,255,255,.14); }
.s-pitch::before { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: rgba(255,255,255,.22); }
.s-pitch::after { content: ''; position: absolute; left: 50%; top: 50%; width: 22%; aspect-ratio: 1; transform: translate(-50%,-50%); border: 2px solid rgba(255,255,255,.22); border-radius: 50%; }
.s-pp { position: absolute; transform: translate(-50%,-50%); width: 54px; text-align: center; z-index: 1; }
.s-pp-img { position: relative; width: 34px; height: 34px; margin: 0 auto; border-radius: 50%; background-size: cover; background-position: center top; background-color: rgba(0,0,0,.35); border: 2px solid #fff; }
.s-pp-num { position: absolute; right: -4px; bottom: -4px; min-width: 15px; height: 15px; line-height: 15px; padding: 0 2px; border-radius: 8px; font-size: 9px; font-weight: 700; color: #fff; box-shadow: 0 0 0 1.5px rgba(0,0,0,.35); }
.s-pp-nm { margin-top: 2px; font-size: 9px; font-weight: 600; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-lu-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.s-lu-team { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.s-lu-team img { width: 20px; height: 20px; object-fit: contain; }
.s-face { display: inline-block; width: 22px; height: 22px; border-radius: 50%; background-size: cover; background-position: center top; background-color: var(--panel2); flex: 0 0 auto; }
.s-face.sm { width: 18px; height: 18px; }
.s-coachrow { display: flex; align-items: center; gap: 7px; font-size: 12px; padding: 2px 0; }
.s-injrow { display: flex; align-items: center; gap: 7px; font-size: 12px; padding: 3px 0; }
.s-injnm { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-injr { margin-left: auto; text-align: right; font-size: 10px; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-advice { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12px; margin-bottom: 12px; }
.s-winbar { display: flex; height: 26px; border-radius: 6px; overflow: hidden; margin-bottom: 14px; font-size: 11px; font-weight: 700; color: #fff; }
.s-wseg { display: flex; align-items: center; justify-content: center; overflow: hidden; }
.s-wseg.home { background: var(--back); }
.s-wseg.draw { background: var(--dim); }
.s-wseg.away { background: var(--green); }
.s-subtabs { align-self: flex-start; margin-bottom: 12px; }
.s-radar-mode { display: flex; justify-content: center; margin-bottom: 6px; }
.s-radar { width: 100%; max-width: 300px; height: auto; display: block; margin: 0 auto; }
.s-radar-leg { display: flex; justify-content: center; gap: 18px; margin-top: 6px; font-size: 12px; font-weight: 600; }
.s-radar-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.s-dot.home { background: var(--back); }
.s-dot.away { background: var(--green); }
/* indicators popover */
.indpop { position: absolute; top: 40px; right: 44px; z-index: 6; width: 244px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.5); padding: 10px; font-size: 12px; }
.indpop-h { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); font-weight: 700; margin-bottom: 8px; }
.indempty { color: var(--dim); padding: 4px 0 8px; }
.indrow { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.indrow:last-child { border-bottom: none; }
.indrow-head { display: flex; align-items: center; gap: 6px; }
.indrow-head .indname { flex: 1 1 auto; font-weight: 700; }
.indrow .indsw { width: 20px; height: 20px; padding: 0; border: 1px solid var(--line); border-radius: 5px; background: none; cursor: pointer; flex: 0 0 auto; }
.indrow-head .inddup, .indrow-head .indrm { background: transparent; border: none; color: var(--dim); cursor: pointer; font-size: 13px; padding: 2px 4px; }
.indrow-head .inddup:hover { color: var(--txt); }
.indrow-head .indrm:hover { color: var(--red); }
.indrow-cfg { display: flex; flex-direction: column; gap: 5px; padding-left: 2px; }
.indrow-cfg label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--dim); font-size: 11px; }
.indrow-cfg input[type=number] { width: 62px; background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 5px; padding: 3px 6px; font: 12px inherit; text-align: right; }
.indrow-cfg .indfix { color: var(--txt); }
.indrow-cfg .indpct { min-width: 44px; background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 5px; padding: 3px 8px; font: 700 11px inherit; cursor: pointer; }
.indrow-cfg .indpct.on { background: var(--back); border-color: var(--back); color: #fff; }   /* on = blue, matching the app's other On/Off toggles */
.indpop-add { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.indpop-add span { color: var(--dim); }
.indpop-add button { background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 6px; padding: 4px 10px; font: 700 11px inherit; cursor: pointer; }
.indpop-add button:hover { border-color: var(--txt); }
.chartpanel > #cbody { flex: 1 1 auto; min-height: 0; display: flex; }
#cbody > #cchart { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; }
#cchart > #cmain { flex: 1 1 auto; min-height: 0; position: relative; }   /* positioning context for trend-line endpoint marks */
/* tiny Desk mark on a trend line's endpoints (and the pending first point), positioned over the canvas in JS */
.tl-mark { position: absolute; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; pointer-events: none; z-index: 5; display: none; -webkit-user-drag: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.clegend { position: absolute; top: 5px; left: 10px; z-index: 4; display: flex; flex-wrap: wrap; gap: 4px 12px; pointer-events: none;
  font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--txt); text-shadow: 0 1px 3px var(--panel); }
.clegend .lg-ohlc { color: var(--dim); letter-spacing: .01em; }
.clegend .lg-ohlc b { font-weight: 800; }
.clegend .lg-up { color: var(--green); }
.clegend .lg-dn { color: var(--red); }
#cchart > #cosc { flex: 0 0 30%; min-height: 0; border-top: 1px solid var(--line); }
/* On-chart trade layer (click → order chip; TradingView-style). Overlays the chart canvas; only its chips take clicks. */
.cot-layer { position: absolute; inset: 0; pointer-events: none; z-index: 6; overflow: hidden; }
.cot-chip { position: absolute; right: 66px; transform: translateY(-50%); display: flex; align-items: center; gap: 6px;
  padding: 3px 5px; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 2px 10px rgba(0,0,0,.45);
  pointer-events: auto; white-space: nowrap; font-size: 12px; }
.cot-chip::after { content: ''; position: absolute; right: -8px; top: 50%; transform: translateY(-50%); border: 4px solid transparent; border-left-color: var(--line); }  /* little pointer toward the price axis */
.cot-chip .cot-price { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 40px; text-align: center; color: var(--txt); }
.cot-chip .cot-side { border: none; border-radius: 4px; padding: 3px 9px; cursor: pointer; color: #fff; font-weight: 600; line-height: 1.1; }
.cot-chip .cot-back { background: var(--back); }
.cot-chip .cot-lay { background: var(--lay); }
.cot-chip .cot-side small { display: block; font-size: 9px; opacity: .85; font-weight: 400; }
.cot-chip .cot-size { width: 40px; background: var(--bg); border: 1px solid var(--line); color: var(--txt); border-radius: 4px; padding: 2px 4px; font-size: 11px; text-align: right; }
.cot-chip .cot-x { cursor: pointer; color: var(--dim); padding: 0 3px; font-weight: 700; }
.cot-chip .cot-x:hover { color: var(--txt); }
.cot-chip .cot-brkbtn { cursor: ns-resize; font-weight: 700; font-size: 10px; padding: 3px 6px; border-radius: 4px; border: 1px dashed; }   /* press & drag out a what-if TP/SL from the entry chip */
.cot-chip .cot-brkbtn.tp { color: var(--green); border-color: color-mix(in srgb, var(--green) 55%, transparent); }
.cot-chip .cot-brkbtn.sl { color: var(--red); border-color: color-mix(in srgb, var(--red) 55%, transparent); }
/* Resting-order pill on the chart line — side/size label + an attached ✕ to cancel (TradingView-style). Sits on the
   order's price line, just left of the price axis, so the cancel reads as part of the order. */
.cot-ordpill { position: absolute; right: 84px; transform: translateY(-50%); pointer-events: auto; display: flex; align-items: center; gap: 5px;
  padding: 1px 3px 1px 7px; border-radius: 5px; font-size: 11px; font-weight: 700; color: #fff; white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,.45); }
.cot-ordpill.bk { background: var(--back); }
.cot-ordpill.ly { background: var(--lay); }
.cot-ordpill .cot-ordlbl { font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.cot-ordpill .cot-ordx { cursor: pointer; width: 15px; height: 15px; line-height: 14px; text-align: center; font-size: 10px;
  border-radius: 3px; background: rgba(255,255,255,.22); transition: background .1s; }
.cot-ordpill .cot-ordx:hover { background: rgba(255,255,255,.5); }
/* Phase 2: TP/SL pills, shaded zones, add-chips */
.cot-zone { position: absolute; left: 0; right: 60px; pointer-events: none; }   /* shaded profit/loss region entry→level; stops at the price axis */
.cot-zone.tp { background: color-mix(in srgb, var(--green) 14%, transparent); border-top: 1px solid color-mix(in srgb, var(--green) 40%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--green) 40%, transparent); }
.cot-zone.sl { background: color-mix(in srgb, var(--red) 14%, transparent); border-top: 1px solid color-mix(in srgb, var(--red) 40%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--red) 40%, transparent); }
.cot-brkt { position: absolute; right: 84px; transform: translateY(-50%); pointer-events: auto; cursor: ns-resize; display: flex; align-items: center; gap: 4px;
  padding: 1px 3px 1px 4px; border-radius: 5px; font-size: 11px; font-weight: 700; color: #fff; white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,.45); }
.cot-brkt.tp { background: var(--green); }
.cot-brkt.sl { background: var(--red); }
.cot-brkt.pend { outline: 1px dashed rgba(255,255,255,.75); }
.cot-brkt .cb-grip { opacity: .8; letter-spacing: -1px; padding: 0 1px; }
.cot-brkt .cb-lbl { font-variant-numeric: tabular-nums; }
.cot-brkt .cb-ok, .cot-brkt .cb-x { cursor: pointer; width: 15px; height: 15px; line-height: 14px; text-align: center; font-size: 10px; border-radius: 3px; background: rgba(255,255,255,.22); transition: background .1s; }
.cot-brkt .cb-ok:hover, .cot-brkt .cb-x:hover { background: rgba(255,255,255,.5); }
/* Both add-boxes sit ON the entry line, side by side (TP left of SL) — like TradingView. No vertical offset, so there's
   no misleading "up = profit" implication (TP is up for stocks but DOWN in sports mode); the drag decides direction. */
.cot-add { position: absolute; transform: translateY(-50%); pointer-events: auto; cursor: ns-resize; font-size: 10px; font-weight: 700; white-space: nowrap;
  padding: 1px 6px; border-radius: 5px; border: 1px dashed; background: var(--panel); box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.cot-add.tp { color: var(--green); border-color: color-mix(in srgb, var(--green) 55%, transparent); right: 120px; }
.cot-add.sl { color: var(--red); border-color: color-mix(in srgb, var(--red) 55%, transparent); right: 84px; }
/* tools panel rows */
.cs-tool { display: flex; align-items: center; gap: 5px; font-size: 12px; }
.cs-tool > label { flex: 0 0 42px; color: var(--dim); }
.ctoolnum { width: 34px; background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 5px; padding: 4px 5px; font: 12px inherit; text-align: right; }
.cs-unit { color: var(--dim); margin-left: -2px; }
.cs-tv { flex: 1 1 auto; text-align: right; font-weight: 600; font-size: 11px; color: var(--dim); }
.ctarm { flex: 0 0 auto; background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 5px; padding: 4px 8px; font: 700 11px inherit; cursor: pointer; }
.ctarm:hover { border-color: var(--txt); }
.ctarm.on { background: var(--red); border-color: var(--red); color: #fff; }
.cs-keyleg { font-size: 10px; line-height: 1.7; color: var(--dim); border-top: 1px solid var(--line); padding-top: 8px; margin-top: auto; }
.cs-keyleg b { color: var(--txt); }
.cs-keyleg kbd { display: inline-block; background: var(--panel2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 3px;
  padding: 0 4px; margin-right: 2px; font: 700 10px inherit; color: var(--txt); }
#cbody > #cside { flex: 0 0 var(--cside-w, 208px); display: flex; flex-direction: column; gap: 10px; padding: 10px;
  border-left: 1px solid var(--line); background: var(--panel); overflow-y: auto; position: relative; }
.cs-sec { display: flex; flex-direction: column; gap: 7px; }
.cs-toolpanel { display: flex; flex-direction: column; gap: 8px; }
.cs-tp-body { display: flex; flex-direction: column; }
/* section each tool off with a divider, like the ladder's Tools panel */
.cs-tp-body > .cs-toolcard { padding: 10px 0; border-bottom: 1px solid var(--line); }
.cs-tp-body > .cs-toolcard:first-child { padding-top: 0; }
.cs-tp-body > .cs-toolcard:last-child { border-bottom: 0; padding-bottom: 0; }
.cs-toolcard[data-chidden="1"] { display: none !important; }   /* Settings show/hide, independent of position-gating */
/* per-tool expandables + pop-outs: chevron folds the card to its title; ⧉ floats it as a draggable card */
.cs-cardtog, .cs-cardpop { background: none; border: 0; color: var(--dim); cursor: pointer; line-height: 1; padding: 0; opacity: .55; }
.cs-cardtog { font-size: 9px; } .cs-cardpop { font-size: 10px; }
.cs-cardtog:hover, .cs-cardpop:hover { opacity: 1; color: var(--txt); }
.cs-toolcard.cardcoll > *:not(.cs-h) { display: none !important; }
/* popped-out floating tool card — drag by its header, dock with the ⤓ button */
.cs-toolcard.cardfloat { position: fixed; z-index: 60; width: 250px; max-width: 92vw; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 14px 44px rgba(0,0,0,.5); padding: 10px 12px !important; }
.cs-toolcard.cardfloat > .cs-h { cursor: move; }
/* compact, equal-width segment buttons inside tool rows (fixes the squashed "Cancel") */
.cs-tool .cs-seg button { flex: 1 1 0; min-width: 0; overflow: hidden; font-size: 11px; padding: 4px 6px; }
.cs-atmax { flex: 1 1 auto; width: 100%; }
.cs-atmaxlbl { font-size: 10px; color: var(--dim); margin-left: 2px; }
/* TradingView-style bottom Positions & Orders strip on the chart */
.cpospanel { flex: 0 0 auto; border-top: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; }
.cpp-grip { flex: 0 0 auto; height: 6px; margin-top: -3px; cursor: ns-resize; }
.cpp-grip:hover, .cpp-grip.dragging { background: var(--accent, #4c8dff); opacity: .55; }
.cpospanel.cpp-collapsed .cpp-grip { display: none; }
.cpp-head { display: flex; align-items: center; gap: 8px; padding: 4px 10px; cursor: pointer; user-select: none; font-size: 11px; }
.cpp-head:hover { background: var(--panel2); }
.cpp-caret { color: var(--dim); font-size: 9px; transition: transform .15s; }
.cpospanel:not(.cpp-collapsed) .cpp-caret { transform: rotate(180deg); }
.cpp-title { text-transform: uppercase; letter-spacing: .06em; color: var(--dim); font-weight: 700; }
.cpp-sum { color: var(--txt); font-variant-numeric: tabular-nums; margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cpp-ssum b.up { color: var(--green); } .cpp-ssum b.down { color: var(--red); }
.cpp-ochip { border-radius: 4px; padding: 1px 5px; font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cpp-ochip.bk { background: color-mix(in srgb, var(--back) 22%, transparent); color: var(--back); }
.cpp-ochip.ly { background: color-mix(in srgb, var(--lay) 22%, transparent); color: var(--lay); }
.cpp-flat { color: var(--dim); }
.cpp-body { display: none; max-height: 168px; overflow-y: auto; padding: 4px 10px 8px; flex-direction: column; gap: 3px; }
.cpospanel:not(.cpp-collapsed) .cpp-body { display: flex; }
.cpp-row { display: flex; align-items: center; gap: 8px; font-size: 12px; font-variant-numeric: tabular-nums; padding: 2px 0; border-bottom: 1px solid var(--grid); }
.cpp-tag { min-width: 34px; text-align: center; border-radius: 4px; padding: 1px 5px; font-size: 10px; font-weight: 700; }
.cpp-tag.bk { background: color-mix(in srgb, var(--back) 22%, transparent); color: var(--back); }
.cpp-tag.ly { background: color-mix(in srgb, var(--lay) 22%, transparent); color: var(--lay); }
.cpp-tag.done { background: color-mix(in srgb, var(--txt) 12%, transparent); color: var(--muted); }
.cpp-tag.rest { background: color-mix(in srgb, #f5a623 20%, transparent); color: #f5a623; }
.cs-settle { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }
.cs-settle b { font-size: 12.5px; }
.cs-wif { position: absolute; z-index: 6; pointer-events: none; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; font-size: 11px; font-weight: 700; white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.cs-wif .up { color: var(--green); } .cs-wif .dn { color: var(--red); }
.cs-wif-px { color: var(--dim); font-weight: 500; }
.cpp-cell { flex: 1 1 auto; }
.cpp-pl.up { color: var(--green); } .cpp-pl.down { color: var(--red); }
.cpp-x { background: none; border: 0; color: var(--dim); cursor: pointer; font-size: 12px; } .cpp-x:hover { color: var(--red); }
.cpp-empty { color: var(--dim); font-size: 11px; padding: 4px 0; }
.cpp-loghead { color: var(--dim); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; border-bottom: none; padding-top: 6px; }
.cpp-log { opacity: .85; }
.cpp-log-t { color: var(--dim); font-size: 11px; margin-left: auto; }
.cs-danger { background: color-mix(in srgb, var(--red) 16%, var(--panel2)) !important; border: 1px solid color-mix(in srgb, var(--red) 55%, transparent) !important; color: var(--red) !important; }
.cs-danger:hover { background: color-mix(in srgb, var(--red) 30%, var(--panel2)) !important; border-color: var(--red) !important; }
.cs-arminfo { display: flex; }
.cs-armed { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-variant-numeric: tabular-nums; border-radius: 5px; padding: 2px 6px; }
.cs-armed.bk { background: color-mix(in srgb, var(--back) 16%, var(--panel2)); border: 1px solid color-mix(in srgb, var(--back) 45%, transparent); }
.cs-armed.ly { background: color-mix(in srgb, var(--lay) 16%, var(--panel2)); border: 1px solid color-mix(in srgb, var(--lay) 45%, transparent); }
.cs-armed b { cursor: pointer; color: var(--dim); font-weight: 400; } .cs-armed b:hover { color: var(--red); }
.cs-alertlist { display: flex; flex-wrap: wrap; gap: 4px; }
.cs-alert { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-variant-numeric: tabular-nums; background: color-mix(in srgb, #f5a623 15%, var(--panel2)); border: 1px solid color-mix(in srgb, #f5a623 40%, transparent); border-radius: 5px; padding: 1px 5px; }
.cs-alert b { cursor: pointer; color: var(--dim); font-weight: 400; } .cs-alert b:hover { color: var(--red); }
/* drag the left edge to widen the chart's tools panel */
.cside-resize { position: absolute; left: 0; top: 0; bottom: 0; width: 6px; cursor: ew-resize; z-index: 5; }
.cside-resize:hover { background: color-mix(in srgb, var(--back) 40%, transparent); }
/* chart adaptive-display bar (Mode / Price / Language) — labels centred above their tabs, equal-width buttons */
.cs-disp { display: flex; flex-direction: column; gap: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.cs-disp-head { display: flex; align-items: center; gap: 5px; }
.cs-disp-title { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--dim); font-weight: 700; }
.cs-disp-coll { background: none; border: none; color: var(--dim); cursor: pointer; font-size: 11px; line-height: 1; padding: 0 2px; transition: transform .15s; }
.cs-disp-coll.coll { transform: rotate(-90deg); }
.cs-disp-body { display: flex; flex-direction: column; gap: 8px; }
.cs-disp-grp { display: flex; flex-direction: column; gap: 3px; }
.cs-dlbl { text-align: center; font-size: 9px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); font-weight: 700; }
.cs-seg { display: flex; }
/* higher specificity than base `.seg button` (which is defined later) so these actually apply; overflow:hidden keeps
   the label inside its own (blue when active) box instead of spilling into the next tab on a narrow panel */
.cs-disp .cs-seg button { flex: 1 1 0; min-width: 0; overflow: hidden; text-align: center; font-size: 10px; padding: 3px 2px; letter-spacing: 0; white-space: nowrap; }
/* order-type toggle: shrink to fit the narrow chart sidebar, and WRAP to a second row when it still won't fit */
.cs-sec .cs-otype { flex-wrap: wrap; }
.cs-sec .cs-otype > button { flex: 1 1 44px; min-width: 0; overflow: hidden; font-size: 11px; padding: 4px 4px; }

/* ── order book / depth-of-market panel (chart) ── */
#cbody > #cbook { flex: 0 0 236px; display: flex; flex-direction: column; min-height: 0;
  border-left: 1px solid var(--line); background: var(--panel); }
/* SVP volume-profile panel (chart) — its own toggle-able column between the DOM and the display panel */
#cbody > #c-svp { flex: 0 0 154px; display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: var(--panel); }
.csvp-head { flex: 0 0 auto; display: flex; justify-content: space-between; align-items: baseline; padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
.csvp-sub { text-transform: none; letter-spacing: 0; opacity: .7; }
#c-svp-body { flex: 1 1 auto; overflow-y: auto; padding: 8px 10px; font-variant-numeric: tabular-nums; }
.cs-vempty { padding: 12px 0; color: var(--dim); font-size: 11px; }
.cs-vrow { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; align-items: center; padding: 3px 0; font-size: 11px; }
.cs-vrow.cur { background: color-mix(in srgb, var(--txt) 7%, transparent); }
.cs-vbar { position: absolute; top: 1px; bottom: 1px; right: 0; display: flex; z-index: 0; border-radius: 2px; overflow: hidden; }
.cs-vbar .cs-vg { background: color-mix(in srgb, var(--green) 30%, transparent); }
.cs-vbar .cs-vs { background: color-mix(in srgb, var(--red) 30%, transparent); }
.cs-vp, .cs-vv { position: relative; z-index: 1; }
.cs-vp { font-weight: 600; color: var(--dim); }
.cs-vrow.cur .cs-vp { color: var(--txt); }
.cs-vv { text-align: right; font-weight: 600; color: var(--txt); }
.cb-tabs { flex: 0 0 auto; display: flex; border-bottom: 1px solid var(--line); }
.cb-tab { flex: 1 1 0; background: transparent; border: 0; color: var(--dim); cursor: pointer; font-size: 12px;
  padding: 8px 4px; font-weight: 600; border-bottom: 2px solid transparent; }
.cb-tab.on { color: var(--txt); border-bottom-color: var(--back); background: var(--panel2); }
.cb-flip { flex: 0 0 auto; background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--dim);
  cursor: pointer; font-size: 13px; padding: 8px 10px; }
.cb-flip:hover { color: var(--txt); }
#cbook-body { flex: 1 1 auto; overflow-y: auto; padding: 8px 10px; font-variant-numeric: tabular-nums; }
.cb-empty { color: var(--dim); font-size: 12px; text-align: center; padding: 18px 0; }
.cb-imb { display: flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 700; margin-bottom: 8px; }
.cb-imbL { color: var(--green); } .cb-imbR { color: var(--red); }
.cb-imbBar { flex: 1; height: 5px; border-radius: 3px; overflow: hidden; display: flex; background: var(--panel2); }
.cb-imbBuy { background: var(--green); } .cb-imbSell { background: var(--red); }
.cb-head { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; font-size: 9.5px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--dim); padding: 2px 0 5px; }
.cb-head > :nth-child(2) { text-align: right; } .cb-head > :nth-child(3) { text-align: right; }
.cb-row { position: relative; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; align-items: center;
  font-size: 11.5px; padding: 2px 0; line-height: 1.5; }
.cb-bar { position: absolute; top: 1px; bottom: 1px; right: 0; border-radius: 2px; z-index: 0; }
.cb-row.ask .cb-bar { background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--red) 34%, transparent)); }
.cb-row.bid .cb-bar { background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--green) 32%, transparent)); }
.cb-p, .cb-s, .cb-t { position: relative; z-index: 1; }
.cb-s { text-align: right; color: var(--txt); } .cb-t { text-align: right; color: var(--txt); }
.cb-row.ask .cb-p { color: var(--red); font-weight: 600; } .cb-row.bid .cb-p { color: var(--green); font-weight: 600; }
.cb-spread { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; font-size: 11px; color: var(--dim);
  padding: 6px 0; margin: 4px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cb-spread > :nth-child(2) { text-align: right; color: var(--txt); } .cb-spread > :nth-child(3) { text-align: right; }
/* feature 85: the DOM shows a single depth unit (Shares OR $ Value), matching the ladder toggle → 2-column book */
.cb-book2 .cb-head, .cb-book2 .cb-row, .cb-book2 .cb-spread { grid-template-columns: 1fr 1fr; }
.cb-trow { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; font-size: 11.5px; padding: 2px 0; line-height: 1.5; }
.cb-trow .cb-p { font-weight: 600; } .cb-trow.ask .cb-p { color: var(--red); } .cb-trow.bid .cb-p { color: var(--green); }
.cb-dim { color: var(--dim); }
.cs-row2 { display: flex; gap: 6px; }
.cs-row2 > .tbtn { flex: 1 1 0; text-align: center; }
.cs-row2 > .tstake { flex: 1 1 0; }
.cs-row2 > .sp-tf { flex: 1 1 0; }
.cs-h { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.cs-hbtn { margin-left: auto; }
.cs-dim { color: var(--dim); font-size: 12px; }
#cposinfo { font-size: 13px; line-height: 1.5; }
.cs-pl { font-weight: 700; font-size: 15px; }
.tbtn { border: none; border-radius: 6px; padding: 6px 12px; cursor: pointer; font: 700 12px inherit; color: #fff; white-space: nowrap; }
.tbtn.back { background: var(--back); }
.tbtn.lay { background: var(--lay); }
.tbtn.flat { background: var(--panel2); color: var(--txt); border: 1px solid var(--line); font-size: 13px; padding: 8px; }
.tbtn.flat:hover { border-color: var(--txt); filter: none; }
#cexits .tbtn.flat { padding: 6px; font-size: 12px; }
#cexits .tbtn.flat.on { border-color: var(--txt); color: var(--txt); background: var(--line); }
.tbtn:hover { filter: brightness(1.08); }
.tbtn:active { transform: translateY(1px); filter: brightness(.9); }   /* instant press feedback */
.tbtn.sending { pointer-events: none; animation: tbtn-pulse .55s ease-in-out infinite; }   /* click registered → pulses through order lag */
@keyframes tbtn-pulse { 0%, 100% { filter: brightness(1); box-shadow: 0 0 0 0 transparent; } 50% { filter: brightness(1.32); box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent); } }
.tstake { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--dim);
  background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; }
.cs-stake { width: 100%; }   /* own full-width row so large amounts aren't clipped */
.cs-otype { width: 100%; display: flex; }   /* order-type toggle fills the sidebar width */
.cs-otype > button { flex: 1 1 0; }
.tstake input, .tlimit { background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 6px; padding: 5px 6px; font: 13px inherit; }
.tstake input { flex: 1 1 auto; min-width: 0; border: none; background: transparent; padding: 7px 2px; text-align: right; font-weight: 600; }
.tlimit { width: 100%; }
#cstatus { font-size: 11px; color: var(--dim); min-height: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: auto; }
/* Content scrolls VERTICALLY when the panel is short. overflow-x must be stated explicitly: with only overflow-y set,
   CSS computes the other axis from `visible` to `auto`, giving an unintended horizontal scrollbar. That bar steals
   ~15px of HEIGHT, and the rung count is measured from #app.clientHeight — so width and height start chasing each
   other (scrollbar → less height → fewer rungs → vertical scrollbar toggles → width changes → repeat) and it flickers.
   The ladder is width:100% with percentage columns, so it never needs to scroll sideways. */
.panel > #app { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; min-height: 0; }
/* Smart Green (opti-hedge) — clickable trade-out routes under the metrics strip */
/* Single compact row with a fixed height so the strip occupies the SAME space flat or filled — entering a
   position must not reflow the ladder below it. Border + real content only appear via .filled. */
#smartgreen { display: flex; flex-direction: row; align-items: center; flex-wrap: nowrap; gap: 8px;
  padding: 6px 12px; height: 40px; box-sizing: border-box; border-top: 1px solid transparent; overflow: hidden; }
#smartgreen.filled { border-top-color: var(--line); }
#smartgreen .sg-lbl { align-self: center; flex: 0 0 auto; }
#smartgreen .sg-chip { flex: 0 0 auto; }
.sg-lbl { align-self: center; font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: var(--dim); }
.sg-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid var(--line);
  border-radius: 7px; background: var(--panel2); color: var(--txt); cursor: pointer; font-size: 12px; line-height: 1; }
.sg-chip:hover { border-color: var(--txt); }
.sg-chip.best { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.sg-chip .sg-c { color: var(--dim); }
.sg-chip.pos .sg-pl { color: var(--green); font-weight: 600; }
.sg-chip.neg .sg-pl { color: var(--red); font-weight: 600; }
.sg-tag { font-style: normal; font-size: 9px; text-transform: uppercase; letter-spacing: .05em;
  background: var(--green); color: #06240f; padding: 1px 5px; border-radius: 4px; }
#bar { display: flex; flex-direction: column; gap: 5px; padding: 5px 12px; background: var(--panel);
  border-bottom: 1px solid var(--line); }
.barrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* armed auto-tools strip — always-visible banner of what will auto-fire on this ladder, with disarm-all */
.armed-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; row-gap: 3px; padding: 4px 9px; font-size: 11px;
  background: color-mix(in srgb, #f5a623 13%, var(--panel)); border-top: 1px solid color-mix(in srgb, #f5a623 38%, transparent); border-bottom: 1px solid color-mix(in srgb, #f5a623 38%, transparent); }
.armed-lbl { font-size: 9px; font-weight: 700; letter-spacing: .09em; color: #f5a623; }
.armed-tag { background: color-mix(in srgb, #f5a623 22%, var(--panel2)); border-radius: 4px; padding: 1px 6px; font-weight: 600; color: var(--txt); }
.armed-off { margin-left: auto; background: var(--panel2); border: 1px solid var(--line); border-radius: 5px; padding: 2px 8px; font: 700 10px inherit; cursor: pointer; color: var(--txt); }
.armed-off:hover { border-color: var(--red); color: var(--red); }
#bar > .barrow { flex-wrap: nowrap; }   /* never wrap the top row — a wrapping status used to drop the ✕ to a 2nd line and jolt the ladder */
#bar > .barrow > #mkt-selects { min-width: 0; overflow: hidden; }   /* let the selects shrink instead of pushing the row */
#mkt-selects { display: flex; gap: 8px; align-items: center; flex: 1 1 auto; min-width: 0; flex-wrap: wrap; }
#mkt-collapse { flex: 0 0 auto; background: transparent; border: 0; color: var(--dim); cursor: pointer; font-size: 13px; padding: 2px 5px; border-radius: 4px; }
#mkt-collapse:hover { color: var(--txt); background: var(--panel2); }
#close-panel { background: var(--panel2); border: 1px solid var(--line); color: var(--dim); border-radius: 6px;
  cursor: pointer; font-size: 12px; line-height: 1; padding: 4px 8px; }
#close-panel:hover { border-color: var(--red); color: var(--red); }
#clip-panel { background: var(--panel2); border: 1px solid var(--line); color: var(--dim); border-radius: 6px;
  cursor: pointer; font-size: 12px; line-height: 1; padding: 4px 7px; }   /* bug 98: unclip/reclip a match-view ladder */
#clip-panel:hover { border-color: var(--back); color: var(--back); }
/* stacked control rows: each label sits in front of its own toggle, labels aligned */
.barrow.controls { flex-direction: column; align-items: stretch; gap: 5px; }
.ctrl { display: flex; align-items: center; gap: 8px; }
.ctrl > .lbl { min-width: 58px; }
.pushr { margin-left: auto; }   /* push this element (and the group after it) to the right */
#bar select { background: var(--panel2); color: var(--txt); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; font: inherit; max-width: 340px; }
/* "all markets for this match" secondary dropdown (ladder + chart) — accent-tinted so it reads as a drill-in */
.mkt2 { max-width: 280px; -webkit-appearance: none; appearance: none; cursor: pointer; font: inherit; font-weight: 600;
  background-color: var(--panel2) !important; color: var(--back-txt) !important;
  border: 1px solid color-mix(in srgb, var(--back) 38%, var(--line)) !important; border-radius: 6px; padding: 5px 26px 5px 10px !important;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a9c7ff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>") !important;
  background-repeat: no-repeat !important; background-position: right 9px center !important; }
.mkt2:hover { border-color: var(--focusline) !important; }
.mkt2:focus { outline: none; border-color: var(--focusline) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--txt) 14%, transparent); }
.lbl { color: var(--txt); opacity: .6; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
/* divider before Price / Language so the three control groups read as distinct sections */
.barrow .lbl:not(:first-child) { border-left: 1px solid var(--line); padding-left: 12px; }
.seg { display: inline-flex; border: 1px solid var(--grid); border-radius: 7px; overflow: hidden; }
.seg button { border: 0; border-right: 1px solid var(--line); background: var(--panel2); color: var(--txt); opacity: .7; padding: 5px 12px; font: 12px inherit; font-weight: 600; cursor: pointer; transition: opacity .12s; }
.seg button:hover { opacity: 1; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: #1f6feb; color: #fff; opacity: 1; }
.seg.mode button.on { background: var(--green); }
#theme, #hidecash, #reverse, #autocentre { background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 6px; padding: 5px 9px; cursor: pointer; }
#reverse.on, #autocentre.on { border-color: var(--back); color: var(--back-txt); background: var(--back-bg); }
#cash, #port { font-size: 13px; font-weight: 700; }
#port { color: var(--dim); }
#cash.hidden, #port.hidden { filter: blur(7px); user-select: none; }
/* trading-status light next to the balance */
.trade-light { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: 0 0 auto; margin-right: 2px; cursor: help;
  vertical-align: middle; box-shadow: 0 0 0 1px rgba(0,0,0,.25) inset; }
.trade-light.on { background: var(--green, #34d399); box-shadow: 0 0 6px 1px color-mix(in srgb, var(--green, #34d399) 60%, transparent); }
.trade-light.off { background: var(--red, #e0555f); box-shadow: 0 0 6px 1px color-mix(in srgb, var(--red, #e0555f) 55%, transparent); animation: tl-pulse 1.6s ease-in-out infinite; }
.trade-light.unknown { background: var(--faint, #5b657e); }
.trade-light.warn { background: #f5a623; box-shadow: 0 0 6px 1px color-mix(in srgb, #f5a623 55%, transparent); }   /* Polymarket degraded / maintenance */
#trade-light { cursor: pointer; }   /* header status dot is clickable → opens Polymarket status (bug 121); overrides the base help cursor */
@keyframes tl-pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .trade-light.off { animation: none; } }
/* Status/feedback line — a pinned footer OUTSIDE the scrolling #app, so a message can never shift the ladder */
.panel > #statusbar { flex: 0 0 auto; }
#statusbar { display: flex; align-items: center; height: 24px; padding: 0 12px; background: var(--panel); border-top: 1px solid var(--line); }
#status { color: var(--dim); font-size: 11px; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#status:empty::before { content: 'ready'; opacity: .5; }
#mktend { font-size: 12px; font-weight: 600; color: var(--dim); }
#mktend.soon { color: var(--red); }   /* <1h to close — flatten */
#mktend.ended { color: var(--red); text-decoration: line-through; }
#mktend.settling { color: #f5a623; font-weight: 600; }   /* event decided, awaiting Polymarket settlement — informative amber, NOT crossed out */
#mktend.live { color: var(--green); font-weight: 700; }   /* in-play (kicked off, still trading) */
/* live-score staleness (Polymarket batches scores ~2-3 min): a small "·age" tag, and a dim when >90s old so a stale score isn't mistaken for the live state */
.sc-age { font-size: .82em; font-weight: 400; opacity: .6; margin-left: 1px; font-variant-numeric: tabular-nums; }
#mktend.sc-stale, .cscore.sc-stale { opacity: .5; }

#app { width: 100%; }   /* fills the panel so a wider panel scales the ladder columns */
#head { display: flex; flex-direction: column; gap: 4px; padding: 5px 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
#head-top { display: flex; align-items: center; gap: 6px; }
#head-body { display: flex; flex-direction: column; gap: 4px; }
#head.hcollapsed > #head-body { display: none; }   /* collapsed → metrics hidden, the ▾ header stays so you can re-expand */
/* Pinned market-title row — the FIRST child of .panel, so it sits at the very top and never scrolls with #app.
   Always shows WHICH market this ladder is, even with every panel collapsed and scrolled — vital with several open. */
.panel > #mkt-title { flex: 0 0 auto; cursor: move; }   /* drag the whole panel by the title row · dbl-click = snap length */
#mkt-title { display: flex; align-items: center; padding: 6px 12px; background: var(--panel); border-bottom: 1px solid var(--line); user-select: none; }
/* Trade zone — stake buttons + figures in ONE fixed-height block below News, so the depth never jumps */
#trade-zone { flex: 0 0 auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--panel); }
#trade-zone #pad { border: 0; }
/* Per-ladder figures (pro-terminal-style), sat just above the depth: "if this wins" headline + trade-out group */
.mkt-figs { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 12px 6px; min-height: 26px; }
.mf-ifwin, .mf-out { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.mf-out { margin-left: auto; }
.mf-ifwin { gap: 12px; flex-wrap: nowrap; overflow: hidden; }   /* one figure per outcome (2 for tennis, 3 for football); clip if very narrow */
.mf-if { display: inline-flex; align-items: baseline; gap: 4px; min-width: 0; }
.mf-if-nm { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--dim); white-space: nowrap; }
.mf-if-nm:empty { display: none; }   /* single-runner market → no label, just the number */
.mf-if-v { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }   /* match the trade-out figure on the right */
.mf-if-v.preview { text-decoration: underline dashed; text-underline-offset: 3px; opacity: .9; }   /* Phase C — a what-if projection, not your live figure */
#mkt-figs #hedge { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
#mkt-figs #totalhedged { font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
/* "⟳ syncing" — steady while your last order settles on-chain (driven by posPending), then off. No flicker. */
.mf-sync { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--back); background: color-mix(in srgb, var(--back) 14%, transparent); border: 1px solid color-mix(in srgb, var(--back) 40%, transparent); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.mkt-figs.syncing .mf-out { margin-left: 10px; }   /* the badge takes the auto-margin while syncing — figures sit right after it */
.mf-sync > i { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; border-top-color: transparent; animation: mf-spin 0.7s linear infinite; }
@keyframes mf-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mf-sync > i { animation: none; } }
#mkt-figs .hedge-clk { cursor: pointer; }
#mkt-figs .hedge-clk:hover { text-decoration: underline; }
/* Green-mode selector (Hedge / Zero / Net) in the Close-out tool */
.hmode-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.hmode-lbl { font-size: 11px; color: var(--dim); white-space: nowrap; }
#hmode { flex: 0 0 auto; }
#hmode button { font-size: 11px; padding: 3px 9px; }
.chip.mode-tag { background: color-mix(in srgb, var(--back) 14%, var(--panel2)); border-color: var(--back); color: var(--txt); font-weight: 600; }
.p-subhead { margin-top: 15px; }
.toolbtn.danger { border-color: color-mix(in srgb, var(--red) 55%, var(--line)); color: color-mix(in srgb, var(--red) 85%, var(--txt)); font-weight: 600; }
.toolbtn.danger:hover { background: color-mix(in srgb, var(--red) 16%, var(--panel2)); border-color: var(--red); }
/* Tick-offset config row */
.off-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.off-fld { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--dim); }
.off-fld .toolnum { width: 44px; }
.off-lbl { font-size: 11px; color: var(--dim); white-space: nowrap; }
#off-torp button, #sl-torp button { font-size: 11px; padding: 3px 8px; }
/* Scale-orders popout */
/* Position Reduction modal */
.pr-modal { display: flex; flex-direction: column; gap: 12px; min-width: 380px; }
/* Reserve a fixed height so hover previews (shorter/longer text) never resize the note → the centred modal can't jump. */
.pr-note { font-size: 12px; color: var(--dim); line-height: 1.45; min-height: 3.6em; }
.pr-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.pr-tbl th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--dim); font-weight: 700; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.pr-tbl th.r, .pr-tbl td.r { text-align: right; }
.pr-tbl td { padding: 6px 8px; border-bottom: 1px solid var(--grid); }
.pr-name { font-weight: 600; }
.pr-pnl { font-variant-numeric: tabular-nums; font-weight: 700; }
.pr-pnl.up { color: var(--green); } .pr-pnl.down { color: var(--red); }
.pr-pnl.preview { text-decoration: underline dashed; text-underline-offset: 3px; opacity: .95; }
.pr-btn { background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 6px; padding: 3px 8px; font: 11px inherit; font-weight: 700; cursor: pointer; }
.pr-btn:hover:not(:disabled) { border-color: var(--back); color: var(--back); background: color-mix(in srgb, var(--back) 12%, var(--panel2)); }
.pr-btn:disabled { opacity: .35; cursor: default; }
.pr-btn.zero { white-space: nowrap; }
.pr-btn.zero:hover:not(:disabled) { border-color: var(--green); color: var(--green); background: color-mix(in srgb, var(--green) 12%, var(--panel2)); }
.pr-edit { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 4px; border-top: 1px solid var(--grid); }
.pr-edit-lbl { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.pr-edit label { font-size: 12px; color: var(--dim); display: inline-flex; align-items: center; gap: 3px; }
.pr-edit input.pr-pct { width: 48px; background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 5px; padding: 3px 6px; font: 12px inherit; text-align: right; }
.sc-modal { display: flex; flex-direction: column; gap: 13px; }
.sc-row { display: flex; align-items: center; gap: 12px; }
.sc-lbl { flex: 0 0 74px; font-size: 12px; color: var(--dim); }
.sc-modal .toolnum { width: 56px; }
.sc-unit { font-size: 12px; color: var(--dim); }
.sc-preview { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 12px; line-height: 1.7; font-variant-numeric: tabular-nums; color: var(--txt); }
.sc-preview b { color: var(--dim); font-weight: 600; }
.sc-warn { color: var(--red); }
.sc-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 4px; }
.p-btn.primary { border-color: var(--back); color: #fff; background: color-mix(in srgb, var(--back) 30%, var(--panel2)); }
.p-btn.primary:hover { background: color-mix(in srgb, var(--back) 45%, var(--panel2)); }
/* Visual scale drag — highlight the rungs in the dragged range */
td.f.scale-hl { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--back) 65%, transparent); }
#rows:has(td.scale-hl), .panel #ladder.scaling { cursor: crosshair; }
/* Market context in the top drag bar (Betfair/a pro terminal feel) — centred, past the traffic lights */
#app-title { position: absolute; left: 50%; top: 0; transform: translateX(-50%); line-height: 40px; font-size: 12.5px; font-weight: 600; letter-spacing: .02em; color: var(--txt); white-space: nowrap; pointer-events: none; }
#mkt-title > #sel { flex: 1; min-width: 0; }
/* close X inside the runner-name cell (match view) — prominent, right-aligned */
.mkt-close { flex: 0 0 auto; margin-left: 6px; background: transparent; border: 0; color: var(--dim);
  border-radius: 4px; padding: 0 4px; line-height: 1; font-size: 13px; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; }   /* compact borderless glyph — must not deepen the title row (match-view alignment) */
.mkt-close:hover { color: var(--red); background: var(--panel2); }
#sel { font-weight: 600; font-size: 12.5px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* the outcome, one tight line */
#sel .sel-ctx { color: var(--dim); font-weight: 500; margin-left: 5px; }   /* grey eyebrow: opponent / competition context on a match-winner ladder */
/* Heatmap + Movers collapse toggles (same idea as the news hide) */
.hero-collapse, .mv-collapse { background: transparent; border: 0; color: var(--dim); cursor: pointer; font-size: 12px; padding: 2px 6px; border-radius: 4px; line-height: 1; flex: 0 0 auto; }
.hero-collapse:hover, .mv-collapse:hover { color: var(--txt); background: var(--panel2); }
#heat-bar .hero-collapse { margin-left: 8px; }
.mv-hdr .mv-collapse { margin-right: 4px; }
/* Expand pills shown when a hero box is collapsed (same look as #news-show) */
#hero-pills { display: flex; gap: 8px; margin-bottom: 16px; }
.hero-show { background: var(--panel2); border: 1px solid var(--line); color: var(--dim); border-radius: 8px; padding: 6px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
.hero-show:hover { color: var(--txt); border-color: var(--txt); }
/* Pin each hero box to its own grid column so collapsing one doesn't move/resize the other (it just leaves a gap) */
#heatmap { grid-column: 1; }
#movers { grid-column: 2; }
#metrics { display: flex; align-items: center; gap: 8px; }
/* left + right columns share the slack EQUALLY so the middle (touch/spread) sits dead-centre of the box */
#metrics > .hcol:first-child { flex: 1; min-width: 0; }   /* left metric (To win) — hugs the left */
.hcol { display: flex; flex-direction: column; line-height: 1.3; }
.hcol.mid { flex: 0 0 auto; }                             /* natural width, centred between the two flex columns */
.hcol.right { flex: 1; min-width: 0; text-align: right; }  /* right metric (Trade out) — equal slack, hugs the right */
#winpl { color: var(--green); font-weight: 700; font-size: 13px; }
#hedge { color: var(--green); font-weight: 700; font-size: 13px; }
#totalhedged { color: var(--dim); font-size: 12px; }   /* pale total-hedged */
.hedge-clk { cursor: pointer; border-radius: 4px; transition: background .12s; }   /* click the P/L to flatten (green up / cut) */
.hedge-clk:hover { background: var(--panel2); box-shadow: 0 0 0 1px var(--line); }
.hcol.mid { align-items: center; }
#touch { font-weight: 700; font-size: 13px; color: var(--txt); white-space: nowrap; }
#spread { font-size: 11px; color: var(--dim); }

#pad { display: flex; align-items: center; gap: 8px; padding: 5px 12px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
#pad .smode { margin-left: auto; }
#pad .smode button { padding: 4px 9px; font-size: 11px; }
#stake { width: 104px; background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 6px; padding: 6px 8px; font: 14px inherit; text-align: center; }   /* fits large stakes ($100k+) without clipping */
.stakebtn { background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 6px; padding: 6px 12px; font: 13px inherit; cursor: pointer; }
.stakebtn.on { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }

/* ── tools panel: collapsible + poppable (floating/draggable) ── */
#tools { background: var(--panel); border-bottom: 1px solid var(--line); }
.tools-head { display: flex; align-items: center; gap: 8px; padding: 4px 10px; border-bottom: 1px solid var(--grid); }
.tools-title { flex: 1; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
.thbtn { background: transparent; border: 0; color: var(--dim); cursor: pointer; font-size: 13px; padding: 2px 6px; border-radius: 4px; line-height: 1; }
.thbtn:hover { color: var(--txt); background: var(--panel2); }
#tools-pop, #disp-pop { border: 1px solid var(--line); font-size: 11px; font-weight: 600; padding: 3px 9px; }
#tools-pop:hover, #disp-pop:hover { border-color: var(--txt); }
/* Display panel (Mode / Price / Language) — same chrome as Tools */
#display { background: var(--panel); border-bottom: 1px solid var(--line); }
#disp-body { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 9px 12px; }
#display.collapsed #disp-body { display: none; }
#display.collapsed .tools-head { border-bottom: 0; }
#display.floating { position: fixed; width: 430px; max-width: 92vw; max-height: 90vh; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 14px 44px rgba(0,0,0,.5); z-index: 50; overflow: hidden; display: flex; flex-direction: column; resize: both; min-width: 300px; min-height: 130px; }
#display.floating .tools-head { cursor: move; background: var(--panel2); flex: 0 0 auto; }
#display.floating #disp-body { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
/* a single tool as a tidy control block: header (name + aligned actions), readout, footnote */
.tool { padding: 8px 12px; position: relative; transition: background .12s ease; }
.tool + .tool { border-top: 1px solid var(--grid); }
/* active-tool highlight — the card currently armed (arm-then-click) or selected in program mode */
.tool.armed { background: rgba(79,140,255,.10); box-shadow: inset 3px 0 0 var(--blue, #4f8cff); }
.tool.armed .tool-name { color: var(--blue, #4f8cff); }
.tool-hdr { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tool-name { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
.tool-actions { display: flex; gap: 6px; align-items: center; }
.tool-actions .toolbtn { min-width: 78px; text-align: center; }
.fok-secs { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--dim); white-space: nowrap; }
.fok-secs input[type=number] { width: 46px; background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 5px; padding: 3px 6px; font: 12px inherit; text-align: right; }
.p-num input[type=number] { width: 54px; background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 5px; padding: 3px 6px; font: 12px inherit; text-align: right; margin-right: 4px; }
/* customisable quick-stake amounts (Settings → Ladder / Financial chart) */
.p-stakes { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.p-stkk { display: inline-flex; align-items: center; gap: 3px; font: 12px inherit; color: var(--dim); font-variant-numeric: tabular-nums; }
.p-stkk b { color: var(--blue); font-weight: 700; }
.p-stk { width: 96px; background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 5px; padding: 3px 6px; font: 12px inherit; text-align: right; margin-left: 2px; }   /* wide enough for up to $1,000,000 + the number spinner */
.p-stk:focus { border-color: var(--blue); outline: none; }
.tool-readout { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; min-height: 22px; }
.readout-empty { font-size: 12px; color: var(--dim); opacity: .6; }
.delaynote { margin-top: 6px; font-size: 11px; line-height: 1.35; color: #d9a441; background: rgba(217,164,65,.10); border: 1px solid rgba(217,164,65,.28); border-radius: 6px; padding: 5px 8px; }
/* hotkeys tool */
#hk-toggle.on { background: rgba(46,160,67,.18); border-color: var(--green); color: var(--green); }
#hk-toggle.prog { background: rgba(79,140,255,.20); border-color: var(--blue, #4f8cff); color: var(--blue, #4f8cff); }
.hk-legend { font-size: 11px; color: var(--dim); gap: 8px; }
.hk-legend .hk-sep { opacity: .5; }
.hk-legend .hk-dim { opacity: .55; }
.hk-legend .hk-prog-on { color: var(--blue, #4f8cff); font-weight: 700; }
.hk-legend kbd { background: var(--panel2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px;
  padding: 0 5px; font: 11px inherit; font-weight: 700; color: var(--txt); }
#tools.collapsed #tools-body { display: none; }
#tools.collapsed .tools-head { border-bottom: 0; }
/* per-market News panel */
#news { border-bottom: 1px solid var(--grid); }
#news.collapsed #news-body { display: none; }
#news.collapsed .tools-head { border-bottom: 0; }
/* Live match section (football score/minute/momentum) — collapsible + pop-out, mirrors #positions */
#live { border-bottom: 1px solid var(--grid); }
#live.collapsed #live-body { display: none; }
#live.collapsed .tools-head { border-bottom: 0; }
/* popped-out Live card: drag the header to move, drag the bottom-right corner to resize (both axes) — like the other pop-outs.
   Flex column so the momentum SVG grows to fill the height as you drag taller, and stretches wider as you drag wider. */
#live.floating { position: fixed; width: 340px; height: 280px; max-width: 92vw; max-height: 90vh; min-width: 240px; min-height: 150px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel); z-index: 60; box-shadow: 0 8px 30px rgba(0,0,0,.45);
  display: flex; flex-direction: column; overflow: hidden; resize: both; }
#live.floating .tools-head { cursor: move; background: var(--panel2); flex: 0 0 auto; }
#live.floating #live-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
#live.floating #live-scoreline { flex: 0 0 auto; }
#live.floating #live-mom { flex: 1 1 auto; min-height: 0; display: flex; }
#live.floating #live-mom > div { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
#live.floating #live-mom svg { flex: 1 1 auto; min-height: 0; height: auto !important; }
/* chart-sidebar Live card — same behaviour, chart's card chrome */
#clive.collapsed #clive-body { display: none; }
#clive.floating { position: fixed; width: 320px; height: 260px; max-width: 92vw; max-height: 90vh; min-width: 240px; min-height: 150px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel); z-index: 60; box-shadow: 0 8px 30px rgba(0,0,0,.45);
  display: flex; flex-direction: column; overflow: hidden; resize: both; }
#clive.floating .cs-disp-head { cursor: move; background: var(--panel2); flex: 0 0 auto; }
#clive.floating #clive-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
#clive.floating #clive-scoreline { flex: 0 0 auto; }
#clive.floating #clive-mom { flex: 1 1 auto; min-height: 0; display: flex; }
#clive.floating #clive-mom > div { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
#clive.floating #clive-mom svg { flex: 1 1 auto; min-height: 0; height: auto !important; }
/* collapsed while floating → shrink to just the header, no resize grip */
#live.floating.collapsed, #clive.floating.collapsed { height: auto !important; min-height: 0 !important; resize: none; }
.news-topic { font-size: 11px; color: var(--dim); font-weight: 500; text-transform: none; letter-spacing: 0; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#news-body { padding: 8px 10px 10px; }
.news-search { display: flex; gap: 6px; margin-bottom: 8px; }
#news-q { flex: 1 1 auto; min-width: 0; background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 6px; padding: 5px 8px; font: 12px inherit; }
#news-list { display: flex; flex-direction: column; gap: 1px; max-height: 230px; overflow-y: auto; }
.news-item { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 6px; border-radius: 6px; text-decoration: none; color: var(--txt); cursor: pointer; }
.news-item:hover { background: var(--panel2); }
.news-item .nb-dot { position: absolute; left: 6px; top: 9px; }
.news-t { font-size: 12px; line-height: 1.3; padding-left: 14px; }
.news-m { font-size: 10px; color: var(--dim); padding-left: 14px; }
.news-m b { color: var(--dim); font-weight: 700; }
.news-dim { color: var(--dim); font-size: 12px; padding: 10px; text-align: center; }
/* popped-out floating card — drag by the header, pin (dock) with the ⧉/📌 button */
#tools.floating { position: fixed; width: 380px; max-width: 92vw; max-height: 90vh; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 14px 44px rgba(0,0,0,.5); z-index: 50; overflow: hidden;
  display: flex; flex-direction: column; resize: both; min-width: 240px; min-height: 150px; }
#tools.floating .tools-head { cursor: move; background: var(--panel2); flex: 0 0 auto; }
#tools.floating #tools-body { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
/* collapsed while floating → shrink to just the header (drop the min-height + any resized height) */
#tools.floating.collapsed, #display.floating.collapsed, #positions.floating.collapsed, #chartwrap.floating.collapsed { min-height: 0 !important; height: auto !important; resize: none; }
.toolbtn:disabled { opacity: .38; cursor: not-allowed; }
.toolbtn:disabled:hover { border-color: var(--line); }
/* one-click Green/Cut — filled by profit/loss so it reads at a glance */
#flatten { min-width: 138px; }
#flatten.green { background: rgba(46,160,67,.18); border-color: var(--green); color: var(--green); }
#flatten.green:hover { background: rgba(46,160,67,.28); }
#flatten.red { background: rgba(240,85,99,.16); border-color: var(--red); color: var(--red); }
#flatten.red:hover { background: rgba(240,85,99,.26); }
#exit-note { display: block; margin-top: 6px; font-size: 11px; color: var(--dim); }
#exit-note.arming { color: var(--back-txt); font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 5px; margin-right: 6px; }
.chip.stop { color: var(--red); background: rgba(240,85,99,.14); }
.chip.target { color: var(--green); background: rgba(46,160,67,.16); }
.chip.back { color: var(--back-txt); background: var(--back-bg); }
.chip.lay { color: var(--lay-txt); background: var(--lay-bg); }
.chip.alert { color: #f0b020; background: rgba(255,176,32,.14); }
.toolnum { width: 46px; background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 6px; padding: 4px 6px; font: 12px inherit; font-weight: 600; text-align: center; }
.chip small { opacity: .7; font-weight: 600; }
.chip b { cursor: pointer; opacity: .65; font-weight: 700; }
.chip b:hover { opacity: 1; }
.toolbtn { background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 6px;
  padding: 5px 11px; font: 12px inherit; font-weight: 600; cursor: pointer; }
.toolbtn:hover { border-color: var(--txt); }
.toolbtn.on { border-color: var(--txt); background: var(--panel); }
/* ladder rows carrying the armed exits — red accent for the stop, green for the target */
tr.stoprow td { box-shadow: inset 0 -1px 0 rgba(240,85,99,.5), inset 0 1px 0 rgba(240,85,99,.5); }
tr.stoprow .c-price { background: rgba(240,85,99,.22); }
tr.targetrow td { box-shadow: inset 0 -1px 0 rgba(46,160,67,.55), inset 0 1px 0 rgba(46,160,67,.55); }
tr.targetrow .c-price { background: rgba(46,160,67,.22); }
tr.entryrow td { box-shadow: inset 0 -1px 0 rgba(79,140,255,.6), inset 0 1px 0 rgba(79,140,255,.6); }
tr.entryrow .c-price { background: rgba(79,140,255,.22); }

/* arming banner — unmistakable that clicks now SET A LEVEL, not trade */
#arm-banner { display: none; padding: 7px 12px; background: var(--back); color: #fff; font-weight: 700;
  font-size: 12px; text-align: center; letter-spacing: .03em; }

/* ── ladder ── */
/* macOS/Intel paint fix (bug 95, "draws in stages"): promote the ladder to its OWN GPU compositing layer so the
   compositor re-rasterises the whole tbody as one unit instead of in bands. Same code paints atomically on Windows +
   Apple Silicon; Intel Macs' GPU path banded the per-wave innerHTML repaint. translateZ(0) on the table = the layer;
   contain:paint on #rows bounds the repaint region. No effect on platforms that already paint atomically. Depth bars
   stay put — their positioning context is the position:relative cell (.c-lay/.c-back), closer than #rows. */
#ladder { width: 100%; border-collapse: collapse; font-size: var(--rungf, 13px); table-layout: fixed;
  transform: translateZ(0); backface-visibility: hidden; }
#rows { contain: paint; }

/* ── Loading skeletons (delay-gated shimmer — see skeletonCtl / LAD_SKELETON / GRID_SKELETON) ── */
@keyframes skel-shimmer { 0% { background-position: 150% 0; } 100% { background-position: -150% 0; } }
/* Visible neutral shimmer on the dark ladder: a light sheen SWEEPS across a faint grey bar. The old gradient used
   two near-identical dark tones (var(--line) ↔ line+panel) so the animation moved but was invisible — hence "no shimmer". */
.skel-bar { display: inline-block; border-radius: 4px; vertical-align: middle;
  background: linear-gradient(90deg, rgba(255,255,255,.05) 25%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.05) 75%);
  background-size: 200% 100%; animation: skel-shimmer 1.1s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .skel-bar { animation: none; background: rgba(255,255,255,.08); } }
/* ladder: greyed rungs while the book streams in (neutral — no red/blue depth tint) */
tr.skel-row td { border-color: var(--grid); }
tr.skel-row .skel-bar { height: 10px; }
tr.skel-row .c-lay .skel-bar, tr.skel-row .c-back .skel-bar { width: 60%; }
tr.skel-row .skel-px { width: 62%; }
/* grid: greyed cards while markets fetch — mirrors .mcard's box so the layout doesn't shift when real cards land */
.grid-skel-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 15px 15px 13px;
  display: flex; flex-direction: column; gap: 11px; min-height: 120px; }
.grid-skel-card .gsk-top { display: flex; align-items: center; gap: 10px; }
.grid-skel-card .gsk-ic { width: 36px; height: 36px; border-radius: 9px; flex: 0 0 auto; }
.grid-skel-card .gsk-ttl { height: 15px; flex: 1 1 auto; }
.grid-skel-card .gsk-row { height: 12px; width: 100%; }
.grid-skel-card .gsk-row.short { width: 55%; }
#ladder.frozen { box-shadow: inset 3px 0 0 color-mix(in srgb, var(--back) 60%, transparent); }   /* subtle accent = rungs held while hovered */
#ladder th { color: var(--txt); font-weight: 700; font-size: 12px; padding: 6px 0; background: var(--panel);
  position: sticky; top: 0; border-bottom: 1px solid var(--line); }
#ladder th.c-hist { border: 0; background: transparent; }   /* keep History header clean */
#ladder td { height: var(--rungh, 22px); text-align: center; cursor: pointer; user-select: none; }
/* ladder zoom buttons */
#ldr-zoom { display: inline-flex; gap: 2px; }
.zbtn { width: 22px; height: 22px; line-height: 1; padding: 0; background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 5px; cursor: pointer; font-size: 15px; font-weight: 700; }
.zbtn:hover:not(:disabled) { border-color: var(--txt); }
.zbtn:disabled { opacity: .35; cursor: default; }
/* faint grey grid on the trading cells; history column stays clear */
.c-lay, .c-price, .c-back { border: 1px solid var(--grid); position: relative; }
/* columns are PERCENTAGES so table-layout:fixed scales them to fill whatever width the panel is */
.c-hist { width: 15%; border: 0; padding: 0; overflow: hidden; }
/* Matchstick TRAIL: fixed time COLUMNS across the width (equal-width slots so every rung shares one time axis). Each
   slot holds a matchstick only if that time's trade landed at this row's price → reading left→right traces the price
   path across the rungs (bug 71). Stick = faint shaft + coloured END (green tip up · red tip down). */
.c-hist .msrow { display: flex; height: 100%; min-height: 15px; align-items: center; }
.c-hist .msslot { flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; }
/* thin grey shaft with a small coloured HEAD, matching a pro ladder's candlestick: green head at the TOP = up-tick, red head at
   the BOTTOM = down-tick (the head points the way the price moved). */
.c-hist .mstick { width: 2px; height: 16px; box-sizing: border-box; background: color-mix(in srgb, var(--dim) 55%, transparent); }
.c-hist .mstick.up { border-top: 3px solid var(--green); }
.c-hist .mstick.dn { border-bottom: 3px solid var(--red); }
.c-pl { width: 15%; border: 1px solid var(--grid); font-size: 12px; }
.pl-pos { color: var(--green); } .pl-neg { color: var(--red); }
.c-pl.clk { cursor: pointer; } .c-pl.clk:hover { filter: brightness(1.5); outline: 1px solid var(--grid); }
.c-unm { width: 14%; border: 1px solid var(--grid); position: relative; }   /* trader's unmatched bets — relative so the queue gauge sits behind the figure */
/* Queue gauge: how much of the money that was AHEAD of you is still there. Full when you join, drains to empty as
   the front clears and you approach the touch. Same visual idiom as the weight-of-money depth bars. */
.unm-gauge { position: absolute; top: 2px; bottom: 2px; left: 0; border-radius: 2px; pointer-events: none; transition: width .2s ease-out; }
.unm-back .unm-gauge { background: rgba(61,132,230,.30); }
.unm-lay  .unm-gauge { background: rgba(224,85,95,.30); }
.unm-txt { position: relative; }
.c-lay, .c-back { width: 20%; }   /* WoM bars scale to the cell */
.c-price { width: 16%; color: var(--txt); background: var(--panel); font-weight: 600; line-height: 1.05; overflow: hidden; }   /* trimmed 19→16 to fund the wider Hist column while keeping depth cols full-width (Alex) */
/* traded volume at this price — faint buy-green/sell-red bar behind the price, small matched figure below (careful not to obscure the price). The td STAYS a table-cell; the price + figure are stacked block spans it vertically centres. */
.cp-vbar { position: absolute; left: 0; top: 0; bottom: 0; display: flex; z-index: 0; pointer-events: none; }
.cp-vbar .cp-vg { background: rgba(46,160,67,.17); }
.cp-vbar .cp-vs { background: rgba(240,85,99,.17); }
.cp-px { position: relative; z-index: 1; display: block; }
.cp-vol { position: relative; z-index: 1; display: block; font-size: 9px; line-height: 1; color: var(--dim); font-weight: 600; }
/* last-traded price pill in the price-column header — high-contrast, theme-aware */
#price-hdr { padding: 4px 0; }
.lastpill { display: inline-block; background: var(--txt); color: var(--bg); font-weight: 700; font-size: 13px; padding: 2px 9px; border-radius: 5px; cursor: pointer; }
#price-hdr { cursor: pointer; }                                                     /* the whole pill cell toggles auto-centre */
#price-hdr.ac-on .lastpill { background: var(--red); color: #fff; }                 /* AC ON → red pill · OFF → the normal (white) pill */
.c-lay { color: var(--lay-txt); } .c-back { color: var(--back-txt); }
.c-lay.f { background: var(--lay-bg); } .c-back.f { background: var(--back-bg); }
tr.ltp .c-price { background: var(--ltp-bg); color: var(--ltp); font-weight: 700; }
tr:hover td.f { filter: brightness(1.35); }
/* hover cue: solid accent = clicking fills now; dashed = order will rest (join the queue) */
#ladder td.f.will-fill:hover { outline: 2px solid var(--accent, #4c8dff); outline-offset: -2px; }
#ladder td.f.will-rest:hover { outline: 1px dashed var(--dim); outline-offset: -2px; }
.wom { display: flex; height: 4px; }
.wom.rev { flex-direction: row-reverse; }   /* reversed ladder → flip the WoM bar to match */
.wom > i { display: block; height: 100%; }
.wom .l { background: var(--lay); } .wom .b { background: var(--back); }
.spread td { height: 3px; padding: 0; border: 0; background: transparent; }
.spread .spreadbar { background: var(--line); }   /* grey bar stops before the History column */
.hcell i { display: inline-block; width: 4px; height: 12px; margin: 0 1px; vertical-align: middle; }

/* matched / unmatched — bold white, centred */
#chartwrap { background: var(--panel); border-top: 1px solid var(--line); }
#chartwrap #chart-body { padding: 8px 12px; }
.chart-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--grid); }
.chart-stats > div { display: flex; align-items: baseline; justify-content: space-between; font-size: 11.5px; }
.chart-stats .k { color: var(--dim); }
.chart-stats .v { color: var(--txt); font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-stats .v.up { color: var(--green); } .chart-stats .v.dn { color: var(--red); }
.panel > #chartwrap { flex: 0 0 auto; }   /* pinned footer — always visible below the (tall) scrolling ladder */
#chartwrap > .tools-head { padding: 4px 10px; border-bottom: 1px solid var(--grid); }
#chart-pop { border: 1px solid var(--line); font-size: 11px; font-weight: 600; padding: 3px 9px; }
#chart-pop:hover { border-color: var(--txt); }
#chartwrap.collapsed #chart-body { display: none; }
#chartwrap.collapsed > .tools-head { border-bottom: 0; }
#chartwrap.floating { position: fixed; width: 420px; max-width: 92vw; max-height: 80vh; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 14px 44px rgba(0,0,0,.5); z-index: 50; overflow: hidden; display: flex; flex-direction: column; resize: both; min-width: 340px; min-height: 220px; }
#chartwrap.floating > .tools-head { cursor: move; background: var(--panel2); }
#chartwrap.floating #chart-body { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
#chartwrap.floating #chart { flex: 1 1 auto; height: auto; min-height: 96px; }
#chart-head { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
#chart-last { font-size: 15px; font-weight: 700; }
#chart-chg { font-size: 12px; font-weight: 600; }
#tf { margin-left: auto; }
#tf button { padding: 3px 9px; font-size: 11px; }
#chart { width: 100%; height: 96px; display: block; }

/* positions list */
#positions { border-top: 1px solid var(--line); background: var(--panel); }
/* Pinned footer — reserve height so opening your first position doesn't shrink #app and jolt the ladder centre.
   It stays BOUNDED and scrolls internally; --posh (set by dragging the top grip) is the only thing that grows it,
   so it never quietly eats the ladder. */
.panel > #positions { flex: 0 0 auto; min-height: 92px; height: var(--posh, auto); max-height: var(--posh, 150px); }
.pos-grip { flex: 0 0 auto; height: 6px; margin-top: -3px; cursor: ns-resize; }
.pos-grip:hover, .pos-grip.dragging { background: var(--accent, #4c8dff); opacity: .55; }
#positions.floating > .pos-grip, #positions.collapsed > .pos-grip { display: none; }
/* The HEAD stays put and the LIST scrolls beneath it. (Sticky alone wasn't enough: .posrow.hist uses opacity, which
   creates a stacking context, so those rows painted over a sticky header.) */
.panel > #positions { display: flex; flex-direction: column; }
#positions > .tools-head { flex: 0 0 auto; }
#poslist { padding: 0 12px 8px; flex: 1 1 auto; overflow-y: auto; min-height: 0; }
#pos-pop { border: 1px solid var(--line); font-size: 11px; font-weight: 600; padding: 3px 9px; }
#pos-pop:hover { border-color: var(--txt); }
#positions.collapsed #poslist { display: none; }
#positions.collapsed > .tools-head { border-bottom: 0; }
.panel > #positions.collapsed { min-height: 0; }
#positions.floating { position: fixed; width: 420px; max-width: 92vw; max-height: 80vh; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 14px 44px rgba(0,0,0,.5); z-index: 50; overflow: hidden;
  display: flex; flex-direction: column; resize: both; min-width: 320px; min-height: 140px; }
#positions.floating > .tools-head { cursor: move; background: var(--panel2); }
#positions.floating #poslist { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
/* one shared 4-column grid so unmatched orders and matched positions line up column-for-column:
   [tag] [runner] [SIDE $stake @ odds] [Cancel / P&L] — every row emits the same 4 cells so they align */
.posrow { display: grid; grid-template-columns: 84px minmax(44px, 0.7fr) minmax(168px, 1.3fr) 78px; gap: 8px; align-items: baseline; padding: 5px 0; font-size: 12px; border-top: 1px solid var(--grid); }
.posrow .posnow { opacity: .68; }   /* "· now $X" live value — secondary to the entry stake it sits beside */
.posrow .postag { justify-self: start; }
.posrow .postitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.posrow .posmid { color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.posrow .pospnl { text-align: right; font-weight: 600; }
.posrow .poscancel, .posrow .posclose { justify-self: end; }
.posrow.histhead { grid-column: 1 / -1; color: var(--dim); font-size: 9.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 8px 0 3px; border-top: 1px solid var(--line); }
.posrow.hist { opacity: .8; }
.posrow.hist .posmid { font-variant-numeric: tabular-nums; }
.posrow.closed .postitle { color: var(--dim); }
.posrow.dim { grid-column: 1 / -1; color: var(--dim); border: 0; }
.posrow.resting { background: rgba(255,255,255,.02); }
/* account panel (Orders, Positions & History): reuse the ladder-footer rows, grouped under a spelled-out market header */
.posrow.mkthead { grid-column: 1 / -1; color: var(--txt); font-weight: 700; font-size: 12px; padding: 11px 0 4px; border-top: 1px solid var(--line); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.posrow.mkthead:first-child { border-top: 0; padding-top: 4px; }
.posrow.mkthead:hover { color: var(--back); }
.p-poslist .posrow[data-open] { cursor: pointer; }
.p-poslist .posrow[data-open]:hover { background: rgba(127,127,127,.06); }
/* clear POSITION vs RESTING tag on each row */
.postag { flex: 0 0 auto; font-size: 9px; font-weight: 700; letter-spacing: .04em; padding: 1px 5px;
  border-radius: 4px; align-self: center; }
.postag.pos { background: rgba(46,160,67,.16); color: var(--green); }
.postag.rest { background: rgba(255,176,32,.16); color: #f0b020; }
.postag.done { background: rgba(139,147,167,.16); color: var(--dim); }
.postag.close { background: rgba(79,140,255,.18); color: #6ea2ff; }   /* a SELL that closes/reduces a position — distinct from a new RESTING bet */
.ord-back { color: var(--back-txt); } .ord-lay { color: var(--lay-txt); }
.poscancel { flex: 0 0 auto; background: transparent; border: 1px solid var(--line); color: var(--red);
  border-radius: 5px; padding: 2px 9px; font: 11px inherit; cursor: pointer; align-self: center; }
.poscancel:hover { background: rgba(240,85,99,.14); border-color: var(--red); }
/* resting order shown in the ladder's Unmatched column */
.c-unm.unm-back { color: var(--back-txt); background: var(--back-bg); font-weight: 700; }
.c-unm.unm-lay { color: var(--lay-txt); background: var(--lay-bg); font-weight: 700; }
.c-unm[data-cancel] { cursor: grab; position: relative; }
.c-unm[data-cancel]:active { cursor: grabbing; }
.c-unm[data-cancel]:hover { filter: brightness(1.4); outline: 1px solid var(--grid); }
.c-unm.unm-pending { opacity: .45; font-style: italic; cursor: default; }
.c-unm .unm-dots { animation: unm-blink 1s steps(1) infinite; }
@keyframes unm-blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .c-unm .unm-dots { animation: none; } }
.c-unm .q-ahead { font-size: 8px; font-weight: 700; opacity: .8; margin-left: 1px; vertical-align: super; }
.c-unm .q-front { font-size: 7px; opacity: .85; margin-left: 1px; vertical-align: super; }
/* the row a resting order is being dragged onto */
tr.move-target td { box-shadow: inset 0 -2px 0 var(--blue, #4f8cff), inset 0 2px 0 var(--blue, #4f8cff); }
tr.move-target .c-price { background: rgba(79,140,255,.28); }
#rows:has(td.c-unm[data-cancel]:active) { cursor: grabbing; }
/* right-click order menu */
.order-menu { position: fixed; z-index: 200; background: var(--panel, #121722); border: 1px solid var(--line, #232b3d);
  border-radius: 9px; padding: 4px; box-shadow: 0 10px 30px rgba(0,0,0,.45); display: flex; flex-direction: column; min-width: 190px; }
.order-menu button { text-align: left; background: none; border: 0; color: var(--txt, #e7ebf4); font: 12px inherit;
  padding: 8px 10px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.order-menu button:hover { background: var(--panel2, #171d2b); }
.order-menu button.danger { color: var(--red, #e0555f); }
#unm-total { font-size: 11px; color: var(--dim); font-weight: 700; }
#chart-wom { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
#chart-wom .wom { flex: 1; height: 6px; border-radius: 3px; overflow: hidden; }
#wom-pct { font-size: 11px; color: var(--dim); font-weight: 700; min-width: 34px; }

/* ── Wallet onboarding overlay ── */
.onboarding { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.72); display: flex; align-items: center; justify-content: center; }
.ob-card { width: 440px; max-width: 92vw; max-height: 90vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 26px 26px 20px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.ob-logo { font-size: 22px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 8px; color: var(--txt); }
.ob-sub { font-size: 12.5px; color: var(--dim); line-height: 1.5; margin-bottom: 18px; }
.ob-sub b { color: var(--txt); }
.ob-tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 8px; }
.ob-tab { background: var(--panel2); border: 0; border-right: 1px solid var(--line); color: var(--dim); padding: 7px 16px; font: 13px inherit; font-weight: 600; cursor: pointer; }
.ob-tab:last-child { border-right: 0; }
.ob-tab.on { background: #1f6feb; color: #fff; }
.ob-l { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--dim); margin: 12px 0 5px; }
.ob-hint { text-transform: none; font-weight: 400; margin-left: 8px; color: var(--dim); opacity: .8; }
.ob-in { width: 100%; box-sizing: border-box; background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 8px; padding: 9px 11px; font: 13px inherit; }
.ob-in:focus { outline: none; border-color: var(--accent, #4c8dff); }
.ob-seg { margin-top: 2px; }
.ob-btn { width: 100%; margin-top: 18px; background: #1f6feb; border: 0; color: #fff; border-radius: 9px; padding: 11px; font: 14px inherit; font-weight: 700; cursor: pointer; }
.ob-btn:hover { background: #3a82ff; }
.ob-btn:disabled { opacity: .5; cursor: default; }
.ob-wc-qr { text-align: center; margin-top: 16px; }
.ob-wc-qrimg { width: 220px; height: 220px; border-radius: 10px; background: #fff; padding: 8px; box-sizing: border-box; }
#ob-wc-status { font-weight: 600; color: var(--txt); margin-top: 10px; }
.ob-note { font-size: 12px; color: var(--dim); line-height: 1.5; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.ob-note b { color: var(--txt); }
.ob-link { color: var(--accent, #4c8dff); cursor: pointer; text-decoration: none; font-weight: 600; }
.ob-link:hover { text-decoration: underline; }
.ob-fine { font-size: 11px; line-height: 1.45; color: var(--dim); opacity: .85; margin-top: 8px; }
.ob-fine b { color: var(--txt); }
.ob-preview { font-size: 12px; color: var(--txt); background: color-mix(in srgb, var(--green) 13%, transparent); border: 1px solid color-mix(in srgb, var(--green) 45%, transparent); border-radius: 8px; padding: 9px 11px; margin: 2px 0; }
.ob-preview b { color: var(--txt); font-variant-numeric: tabular-nums; }
.ob-preview code { font-size: 11px; color: var(--dim); }
/* geoblock banner — Polymarket restricts trading by region; shown when the user's IP is blocked */
.geo-banner { position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999; background: color-mix(in srgb, var(--red) 90%, #000); color: #fff; font-size: 12px; line-height: 1.5; padding: 9px 16px; text-align: center; box-shadow: 0 -2px 14px rgba(0,0,0,.45); }
.geo-banner b { font-weight: 700; }
.geo-banner .geo-note { opacity: .82; }
/* Polymarket API-degraded banner — a Polymarket-side outage (post-only mode / order manager down / 5xx) is rejecting
   orders. Amber (warning, transient) vs the geoblock red (hard block). Auto-clears on the next fill or a 2-min timeout. */
.api-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 9998; background: color-mix(in srgb, #f0a828 93%, #000); color: #201400; font-size: 12px; line-height: 1.5; font-weight: 600; padding: 8px 42px 8px 16px; text-align: center; box-shadow: 0 2px 14px rgba(0,0,0,.4); }
.api-banner b { font-weight: 800; }
.api-banner .api-x { position: absolute; right: 12px; top: 6px; cursor: pointer; opacity: .65; font-weight: 700; }
.api-banner .api-x:hover { opacity: 1; }
.ob-adv { text-align: center; margin: 6px 0 2px; }
.ob-adv a { color: var(--dim); font-size: 11.5px; cursor: pointer; }
.ob-adv a:hover { color: var(--txt); }
.ob-warn { font-size: 11.5px; line-height: 1.5; color: var(--txt); background: color-mix(in srgb, var(--red) 12%, transparent); border: 1px solid color-mix(in srgb, var(--red) 40%, transparent); border-radius: 8px; padding: 9px 11px; margin-bottom: 10px; }
.ob-keybox { display: flex; align-items: center; gap: 8px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; margin-top: 5px; }
.ob-keybox code { flex: 1 1 auto; min-width: 0; font-size: 11px; word-break: break-all; color: var(--txt); }
.ob-mini { flex: 0 0 auto; background: var(--panel); border: 1px solid var(--line); color: var(--txt); border-radius: 6px; padding: 4px 9px; cursor: pointer; font: 11px inherit; }
.ob-addr { font-size: 12px; color: var(--dim); margin-top: 8px; }
.ob-addr code { color: var(--txt); word-break: break-all; }
.ob-check { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--txt); margin-top: 12px; cursor: pointer; }
.ob-err { color: var(--red); font-size: 12px; min-height: 16px; margin-top: 10px; }
.ob-err.ob-ok { color: var(--dim); }   /* progress/status (not an error) — neutral, so "Connected — approve…" doesn't read red */
.ob-foot { margin-top: 14px; text-align: center; }
.ob-foot a { color: var(--dim); font-size: 12px; cursor: pointer; }
.ob-foot a:hover { color: var(--txt); }
/* Partial greening only modifies WHEN tick offset fires — greyed out while the tool itself is disarmed */
.toolbtn:disabled { opacity: .38; cursor: not-allowed; }
.toolbtn:disabled:hover { background: inherit; border-color: var(--line); }

/* ── Copy trading (paper) — Following-row button + the config/shadow-log panel (openCopyPanel) ── */
.sn-copy { background: var(--panel); border: 1px solid var(--line); color: var(--dim); border-radius: 999px; padding: 2px 9px; font-size: 10.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.sn-copy:hover { border-color: var(--back); color: var(--back); }
.sn-copy.on { border-color: var(--green); color: var(--green); }

.copypanel { width: 520px; height: 580px; max-height: none; resize: both; overflow: hidden; min-width: 400px; min-height: 380px; }
.copypanel > #cpbar { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: var(--panel); border-bottom: 1px solid var(--line); cursor: move; }
.copypanel .p-title { font-size: 13px; font-weight: 700; color: var(--txt); }
.copypanel #cp-sub { flex: 1 1 auto; min-width: 0; font-size: 11px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copypanel #cp-close { flex: 0 0 auto; margin-left: auto; background: var(--panel2); border: 1px solid var(--line); color: var(--dim); border-radius: 6px; cursor: pointer; font-size: 12px; line-height: 1; padding: 5px 8px; }
.copypanel #cp-close:hover { border-color: var(--red); color: var(--red); }
.copypanel > #cp-body { flex: 1 1 auto; overflow-y: auto; padding: 12px; }
.cp-wrap { display: flex; flex-direction: column; gap: 12px; }
.cp-paper { font-size: 11.5px; line-height: 1.45; color: var(--dim); background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; }
.cp-paper b { color: var(--txt); }
.cp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cp-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; font-weight: 700; color: var(--txt); }
.cp-grid label span { font-weight: 400; font-size: 10px; color: var(--dim); }
.cp-grid input { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; color: var(--txt); padding: 6px 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
.cp-grid input:focus { outline: none; border-color: var(--back); }
.cp-grid input:disabled { opacity: .55; }
.cp-actions { display: flex; align-items: center; gap: 12px; }
.cp-btn { background: var(--green); border: 0; color: #fff; border-radius: 7px; padding: 8px 16px; font-size: 12.5px; font-weight: 800; cursor: pointer; }
.cp-btn.on { background: var(--red); }
.cp-dim { color: var(--dim); font-size: 11px; }
.cp-status { font-size: 11.5px; color: var(--dim); background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px; line-height: 1.6; }
.cp-status b { color: var(--txt); font-variant-numeric: tabular-nums; }
.cp-loghdr { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--dim); font-weight: 800; margin-top: 2px; }
.cp-log { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: var(--panel); }
.cp-logrow { display: grid; grid-template-columns: 42px 1fr auto; align-items: baseline; gap: 8px; font-size: 11.5px; padding: 3px 4px; border-radius: 5px; }
.cp-logrow:hover { background: var(--panel2); }
.cp-k { font-size: 9.5px; font-weight: 800; text-align: center; padding: 1px 0; border-radius: 4px; letter-spacing: .03em; }
.cp-txt { color: var(--txt); min-width: 0; }
.cp-t { color: var(--dim); font-size: 10px; white-space: nowrap; }
.cp-entry .cp-k { color: var(--green); background: color-mix(in srgb, var(--green) 16%, transparent); }
.cp-exit .cp-k  { color: var(--red);   background: color-mix(in srgb, var(--red) 16%, transparent); }
.cp-skip .cp-k  { color: var(--dim);   background: color-mix(in srgb, var(--dim) 14%, transparent); }
.cp-skip .cp-txt { color: var(--dim); }
.cp-info .cp-k  { color: var(--back);  background: var(--back-bg); }

/* Copy-trade: open simulated positions list */
.cp-pos { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: var(--panel); }
.cp-posrow { display: grid; grid-template-columns: 1fr auto auto auto auto; align-items: baseline; gap: 10px; font-size: 11.5px; padding: 3px 4px; border-radius: 5px; }
.cp-pos-x { background: none; border: 0; color: var(--dim); cursor: pointer; font-size: 11px; line-height: 1; padding: 2px 3px; border-radius: 4px; align-self: center; }
.cp-pos-x:hover { color: var(--red); background: color-mix(in srgb, var(--red) 14%, transparent); }
.cp-loghdr { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.cp-hdr-act { display: flex; gap: 6px; }
.cp-hdr-act button { background: var(--panel2); border: 1px solid var(--line); color: var(--dim); border-radius: 5px; cursor: pointer; font-size: 10px; font-weight: 700; letter-spacing: 0; text-transform: none; padding: 2px 8px; }
.cp-hdr-act button:hover { border-color: var(--txt); color: var(--txt); }
.cp-posrow:hover { background: var(--panel2); }
.cp-pos-t { color: var(--txt); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-pos-sh, .cp-pos-px { color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cp-pos-pnl { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.cp-pos-pnl.up { color: var(--green); } .cp-pos-pnl.dn { color: var(--red); }

/* Clickable market names (copy panel positions + log; desk Live tape + trader positions) */
.mkt-open { cursor: pointer; }
.cp-postot { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 4px; padding: 6px 4px 2px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--dim); }
.cp-postot b { color: var(--txt); font-variant-numeric: tabular-nums; }
.cp-posrow.mkt-open:hover .cp-pos-t, .cp-logrow.mkt-open:hover .cp-txt { text-decoration: underline; }
.dl-sub.mkt-open:hover, .dl-wp.mkt-open:hover .t, .sn-wp.mkt-open:hover .sn-wpt { text-decoration: underline; }

/* Copy panel: secondary action button (Paper account) */
.cp-btn2 { background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 7px; padding: 8px 12px; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.cp-btn2:hover { border-color: var(--back); color: var(--back); }

/* ── Paper account panel (Positions / Trades / P&L) ── */
.paperpanel { width: 560px; height: 600px; max-height: none; resize: both; overflow: hidden; min-width: 420px; min-height: 380px; }
.paperpanel > #ppbar { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: var(--panel); border-bottom: 1px solid var(--line); cursor: move; }
.paperpanel .p-title { font-size: 13px; font-weight: 700; color: var(--txt); }
.paperpanel #pp-sub { flex: 1 1 auto; min-width: 0; font-size: 11px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paperpanel #pp-close { flex: 0 0 auto; background: var(--panel2); border: 1px solid var(--line); color: var(--dim); border-radius: 6px; cursor: pointer; font-size: 12px; line-height: 1; padding: 5px 8px; }
.paperpanel #pp-close:hover { border-color: var(--red); color: var(--red); }
.pp-tabs { flex: 0 0 auto; display: flex; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.pp-tabs .tf { background: var(--panel2); border: 1px solid var(--line); color: var(--dim); border-radius: 6px; padding: 4px 12px; font-size: 12px; font-weight: 700; cursor: pointer; }
.pp-tabs .tf.on { border-color: var(--back); color: var(--back); }
.paperpanel > #pp-body { flex: 1 1 auto; overflow-y: auto; padding: 10px; }

/* Trades tab */
.pp-log { display: flex; flex-direction: column; gap: 2px; }
.pp-trow { display: grid; grid-template-columns: 42px 1fr auto auto auto auto; align-items: baseline; gap: 10px; font-size: 11.5px; padding: 4px 5px; border-radius: 5px; }
.pp-trow:hover { background: var(--panel2); }
.pp-trow.mkt-open:hover .pp-tmkt { text-decoration: underline; }
.pp-tside { font-size: 9.5px; font-weight: 800; text-align: center; padding: 1px 0; border-radius: 4px; }
.pp-tside.pp-buy { color: var(--green); background: color-mix(in srgb, var(--green) 16%, transparent); }
.pp-tside.pp-sell { color: var(--red); background: color-mix(in srgb, var(--red) 16%, transparent); }
.pp-tmkt { color: var(--txt); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-tsh, .pp-tusd, .pp-tt { color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pp-tpnl { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.pp-tpnl.up { color: var(--green); } .pp-tpnl.dn { color: var(--red); }
.pp-manual { color: var(--dim); font-weight: 400; font-size: 9px; margin-left: 5px; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }

/* P&L tab */
.pp-summary { display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.pp-pnlbig { display: flex; flex-direction: column; align-items: flex-start; font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; padding: 8px 0 6px; }
.pp-pnlbig.up { color: var(--green); } .pp-pnlbig.dn { color: var(--red); }
.pp-pnllbl { font-size: 11px; font-weight: 400; color: var(--dim); margin-top: 2px; }
.pp-srow { display: flex; justify-content: space-between; font-size: 13px; color: var(--dim); }
.pp-srow span:last-child { color: var(--txt); font-variant-numeric: tabular-nums; font-weight: 700; }
.pp-srow span.up { color: var(--green); } .pp-srow span.dn { color: var(--red); }
.pp-sdiv { height: 1px; background: var(--line); margin: 4px 0; }

/* Paper account — global (all traders): trader tag, History sub-views (by market / by trader) */
.pp-trtag { display: inline-block; margin-left: 6px; font-size: 9px; font-weight: 700; color: var(--dim); background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; vertical-align: middle; }
.pp-modeseg { margin-bottom: 12px; }
.pp-modeseg button[data-pm="live"].on { background: var(--red); }
.pp-histhdr { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.pp-histhdr .p-subtabs, .pp-histhdr .p-range { margin-bottom: 0; }
.pp-mkts { display: flex; flex-direction: column; gap: 3px; }
.pp-mrow { display: grid; grid-template-columns: 1fr auto auto; align-items: baseline; gap: 12px; font-size: 12px; padding: 5px 6px; border-radius: 6px; }
.pp-mrow:hover { background: var(--panel2); }
.pp-mtitle { color: var(--txt); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-mn { color: var(--dim); font-size: 10.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pp-mpnl { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.pp-mpnl.up { color: var(--green); } .pp-mpnl.dn { color: var(--red); }

/* Copy panel: Paper / Live mode control + live styling */
.cp-mode { display: flex; align-items: center; gap: 10px; }
.cp-modelbl { font-size: 11px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; }
.cp-modeseg { display: inline-flex; gap: 2px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.cp-modeseg button { border: none; background: transparent; color: var(--dim); cursor: pointer; font: 700 11px inherit; padding: 3px 12px; border-radius: 6px; }
.cp-modeseg button.on { background: var(--back); color: #fff; }
.cp-modeseg button[data-m="live"].on { background: var(--red); }
.cp-modeseg button:disabled { opacity: .5; cursor: default; }
.cp-paper.cp-live { background: color-mix(in srgb, var(--red) 12%, var(--panel2)); border-color: color-mix(in srgb, var(--red) 45%, var(--line)); }
.cp-btn.cp-btn-live { background: var(--red); }

/* ── Crypto "worm" view (bug 124) — dedicated timed Up/Down interface ── */
.cryptopanel { position: absolute; width: 900px; height: 580px; min-width: 480px; min-height: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.45); display: flex; flex-direction: column; overflow: hidden; resize: both; }
.cryptopanel.active { border-color: var(--focusline); box-shadow: 0 10px 40px rgba(0,0,0,.5); }
#xbar { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 4px 10px; border-bottom: 1px solid var(--line); cursor: move; background: var(--panel2); }
.x-title { font-weight: 700; font-size: 13px; color: var(--txt); flex: 0 0 auto; }
.x-cd { display: inline-flex; align-items: center; font-variant-numeric: tabular-nums; font-weight: 900; font-size: 15px; letter-spacing: .01em; line-height: 1; }
.x-cd .cd-d { display: inline-block; height: 1em; overflow: hidden; width: .62em; }
.x-cd .cd-col { display: flex; flex-direction: column; transition: transform .45s cubic-bezier(.2, .85, .25, 1); will-change: transform; }
.x-cd .cd-col > span { height: 1em; display: flex; align-items: center; justify-content: center; }
.x-cd .cd-sep { padding: 0 .02em; }
@media (prefers-reduced-motion: reduce) { .x-cd .cd-col { transition: none; } }
.x-cd-white { color: var(--txt); }
.x-cd-orange { color: #f5a623; }
.x-cd-red { color: var(--red, #e0555f); animation: xcdpulse 1s ease-in-out infinite; }
@keyframes xcdpulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .x-cd-red { animation: none; } }
.x-zb { background: var(--panel); border: 1px solid var(--line); color: var(--txt); width: 24px; height: 22px; border-radius: 5px; cursor: pointer; font-size: 14px; line-height: 1; }
.x-zb:hover { border-color: var(--txt); }
#xbar .pushr { margin-left: auto; background: transparent; border: 0; color: var(--dim); cursor: pointer; font-size: 14px; padding: 2px 6px; }
#xbar .pushr:hover { color: var(--txt); }
.x-head { flex: 0 0 auto; display: grid; grid-template-columns: 1fr 1.4fr 1fr 1fr; gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.x-cell { background: var(--panel); padding: 4px 10px; display: flex; flex-direction: column; gap: 2px; }
.x-k { font-size: 9px; font-weight: 800; letter-spacing: .08em; color: var(--dim); text-transform: uppercase; }
.x-prob { font-size: 22.5px; font-weight: 800; color: var(--txt); font-variant-numeric: tabular-nums; }
.x-diffcell { background: color-mix(in srgb, var(--accent, #4c8dff) 8%, var(--panel)); }
.x-diff { font-size: 22.5px; font-weight: 900; color: var(--txt); font-variant-numeric: tabular-nums; }
.x-diff.up { color: var(--green, #34d399); } .x-diff.dn { color: var(--red, #e0555f); }
.x-px { font-size: 22.5px; font-weight: 800; color: var(--txt); font-variant-numeric: tabular-nums; }
.x-px.est { color: var(--dim); font-style: italic; }
.x-px.tsmall { font-size: 15px; }   /* pre-event placeholder ("Starting soon" / "Syncing…") — shrink to fit the cell */
.x-legend { flex: 0 0 auto; display: flex; gap: 6px; flex-wrap: wrap; padding: 4px 8px; background: var(--panel); border-bottom: 1px solid var(--line); }
.x-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; font-size: 10px; font-weight: 700; letter-spacing: .02em; color: var(--txt); background: color-mix(in srgb, var(--txt) 6%, var(--panel)); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; user-select: none; transition: opacity .12s; }
.x-chip { position: relative; }
.x-chip i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; cursor: pointer; box-shadow: 0 0 0 0 rgba(255,255,255,0); transition: box-shadow .12s; }
.x-chip i:hover { box-shadow: 0 0 0 2px color-mix(in srgb, var(--txt) 35%, transparent); }
.x-chip.off { opacity: .4; }
.x-chip.off i { filter: grayscale(1); opacity: .7; }
.x-swpick { position: absolute; left: 4px; bottom: -2px; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
/* T60 chip: fill-translucency control (right of the label) + its slider popup */
.x-chip .x-fillbtn { width: 11px; height: 11px; border-radius: 3px; margin-left: 3px; border: 1px solid color-mix(in srgb, var(--txt) 35%, transparent); background: linear-gradient(135deg, rgba(255,255,255,.75), rgba(255,255,255,.06)); box-shadow: none; opacity: .75; }
.x-chip .x-fillbtn:hover { opacity: 1; box-shadow: 0 0 0 2px color-mix(in srgb, var(--txt) 25%, transparent); }
.x-fillpop { position: fixed; z-index: 90; display: flex; align-items: center; gap: 8px; background: #16181d; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; box-shadow: 0 12px 30px rgba(0,0,0,.55); }
.x-fillpop-lbl { font-size: 9px; font-weight: 800; letter-spacing: .06em; color: var(--dim); text-transform: uppercase; }
.x-fillpop input[type=range] { width: 110px; accent-color: var(--txt); cursor: pointer; }
.x-fillpop-val { font-size: 11px; font-weight: 700; color: var(--txt); font-variant-numeric: tabular-nums; min-width: 36px; text-align: right; }
.x-worm { flex: 1 1 auto; min-height: 120px; position: relative; background: var(--bg, #0b0d12); }
.x-worm canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
/* CEX order-flow strip (Binance): buy/sell imbalance meter + round CVD */
.x-flow { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 4px 8px; background: var(--panel); border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.xf-lbl { color: var(--muted, #8a93a6); }
.xf-toggle { background: none; border: 0; color: var(--muted, #8a93a6); cursor: pointer; font-size: 10px; line-height: 1; padding: 0 2px; }
.xf-toggle:hover { color: var(--txt); }
.x-flow.collapsed .xf-meter, .x-flow.collapsed .xf-pct, .x-flow.collapsed .xf-cvd { display: none; }
.xf-meter { flex: 1 1 auto; display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: color-mix(in srgb, var(--txt) 8%, var(--panel)); min-width: 60px; }
.xf-meter i { display: block; height: 100%; transition: width .3s ease; }
.xf-buy { background: #16c784; } .xf-sell { background: #ea3943; }
.xf-pct { font-variant-numeric: tabular-nums; color: var(--txt); min-width: 62px; text-align: right; }
.xf-cvd { font-variant-numeric: tabular-nums; min-width: 78px; text-align: right; color: var(--muted, #8a93a6); }
.xf-cvd.pos { color: #16c784; } .xf-cvd.neg { color: #ea3943; }
.x-tl { flex: 0 0 60px; border-top: 1px solid var(--line); background: var(--panel); position: relative; }
.x-tl canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.xtl-tip { position: absolute; z-index: 80; background: #16181d; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 11px; color: var(--txt); box-shadow: 0 10px 28px rgba(0,0,0,.55); pointer-events: none; white-space: nowrap; }
.xtl-tip .tip-win { font-weight: 700; margin-bottom: 3px; }
.xtl-tip .tip-t { color: var(--dim); }
.xtl-tip .tip-d.up { color: #34d399; } .xtl-tip .tip-d.dn { color: #e0555f; } .xtl-tip .tip-d.live { color: #34d399; font-weight: 700; }
.x-next { margin-left: 10px; background: color-mix(in srgb, #34d399 20%, var(--panel)); border: 1px solid #34d399; color: #34d399; font-size: 11px; font-weight: 800; letter-spacing: .03em; border-radius: 8px; padding: 4px 10px; cursor: pointer; animation: xnextpulse 1.4s ease-in-out infinite; }
.x-next:hover { background: color-mix(in srgb, #34d399 32%, var(--panel)); }
@keyframes xnextpulse { 0%,100% { box-shadow: 0 0 0 0 rgba(52,211,153,.45); } 50% { box-shadow: 0 0 0 4px rgba(52,211,153,0); } }
@media (prefers-reduced-motion: reduce) { .x-next { animation: none; } }
.x-bookbtn { background: transparent; border: 0; color: var(--dim); cursor: pointer; font-size: 15px; padding: 2px 6px; margin-left: 8px; }
.x-bookbtn:hover, .x-bookbtn.on { color: var(--txt); }
/* SIGNAL ⇄ CHANCE view toggle — sits top-right of the header (label = the view you'll switch to) */
.x-mode { margin-left: auto; background: var(--panel); border: 1px solid var(--line); color: var(--dim); cursor: pointer; font-size: 11px; font-weight: 800; letter-spacing: .05em; border-radius: 6px; padding: 3px 10px; }
.x-mode:hover { color: var(--txt); border-color: var(--txt); }
/* segmented chart-view switch (Price / Odds / Depth) */
.x-modeseg { margin-left: auto; display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.x-modeseg button { background: var(--panel); color: var(--dim); cursor: pointer; font-size: 11px; font-weight: 800; letter-spacing: .05em; padding: 3px 10px; border: 0; border-left: 1px solid var(--line); }
.x-modeseg button:first-child { border-left: 0; }
.x-modeseg button:hover { color: var(--txt); }
.x-modeseg button.on { background: var(--panel2); color: var(--txt); }
.cryptopanel.depth-view #x-flow { display: none; }   /* DEPTH view: no FLOW/CVD strip */
.x-x { background: transparent; border: 0; color: var(--dim); cursor: pointer; font-size: 14px; padding: 2px 6px; margin-left: 4px; }
.x-x:hover { color: var(--txt); }

/* ── crypto Live Trades tape (dockable panel) ── */
.ctape { position: absolute; width: 560px; height: 560px; min-width: 380px; min-height: 260px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.45); display: flex; flex-direction: column; overflow: hidden; resize: both; }
.ctape.active { border-color: var(--focusline); box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.ct-bar { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-bottom: 1px solid var(--line); cursor: move; background: var(--panel2); }
.ct-title { font-weight: 700; font-size: 13px; color: var(--txt); }
.ct-count { font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--dim); text-transform: uppercase; }
.ct-bar .pushr { margin-left: auto; background: transparent; border: 0; color: var(--dim); cursor: pointer; font-size: 14px; padding: 2px 6px; }
.ct-bar .pushr:hover { color: var(--txt); }
.ct-head, .ct-row { display: grid; grid-template-columns: 1.4fr 0.9fr 0.9fr 0.8fr 0.7fr 0.8fr 1fr; align-items: center; gap: 6px; padding: 5px 12px; }
.ct-head { flex: 0 0 auto; font-size: 8.5px; font-weight: 800; letter-spacing: .07em; color: var(--dim); border-bottom: 1px solid var(--line); }
.ct-head .ct-r, .ct-row .ct-r { text-align: right; }
.ct-body { flex: 1 1 auto; overflow-y: auto; min-height: 0; font-variant-numeric: tabular-nums; }
.ct-row { font-size: 11.5px; border-bottom: 1px solid color-mix(in srgb, var(--line) 45%, transparent); }
.ct-row:hover { background: var(--panel2); }
.ct-tr { color: var(--dim); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-act { font-weight: 800; font-size: 10.5px; } .ct-act.buy { color: #34d399; } .ct-act.sell { color: #e0555f; }
.ct-tok.up { color: #34d399; } .ct-tok.dn { color: #e0555f; }
.ct-tm { color: var(--dim); }
.ct-empty { padding: 18px; color: var(--dim); font-size: 12px; }
.ctape { position: relative; }
.ct-h { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; user-select: none; }
.ct-h.ct-r { justify-content: flex-end; }
.ct-fun { width: 9px; height: 9px; flex: 0 0 auto; opacity: .5; background: currentColor; -webkit-mask: no-repeat center/contain; mask: no-repeat center/contain; -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M1 2h10L7 7v4L5 9.5V7L1 2z' fill='black'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M1 2h10L7 7v4L5 9.5V7L1 2z' fill='black'/></svg>"); }
.ct-h:hover .ct-fun { opacity: .9; }
.ct-h.on { color: var(--txt); } .ct-h.on .ct-fun { opacity: 1; color: #4ac2e0; }
.ct-pop { position: absolute; z-index: 70; background: #16181d; border: 1px solid var(--line); border-radius: 10px; padding: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.55); min-width: 190px; }
.ct-pop-t { font-size: 9px; font-weight: 800; letter-spacing: .08em; color: var(--dim); text-transform: uppercase; margin-bottom: 8px; }
.ct-pop input[type=text], .ct-pop input[type=number] { width: 100%; box-sizing: border-box; background: #0f1116; border: 1px solid var(--line); border-radius: 7px; color: var(--txt); font-size: 12px; padding: 6px 8px; }
.ct-pop .ct-two { display: flex; gap: 6px; }
.ct-pop label { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--txt); padding: 4px 0; cursor: pointer; }
.ct-pop label input { accent-color: #4ac2e0; width: 14px; height: 14px; }
.ct-pop-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.ct-pop-btns button { font-size: 11px; font-weight: 700; border-radius: 7px; padding: 5px 11px; cursor: pointer; border: 0; }
.ct-pop-clear { background: transparent; color: var(--dim); } .ct-pop-clear:hover { color: var(--txt); }
.ct-pop-apply { background: #4ac2e0; color: #06222b; }
.ct-paused { color: #f5a623; }

/* ── layout: chart (left) + order-book column (right), timeline full-width below ── */
.x-body { flex: 1 1 auto; display: flex; min-height: 0; }
.cryptopanel.obook-left .x-body { flex-direction: row-reverse; }   /* Settings → Crypto: order book docks left */
.x-left { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.xb-split { flex: 0 0 6px; background: var(--line); cursor: col-resize; position: relative; }
.xb-split::after { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 2px; height: 34px; border-radius: 2px; background: color-mix(in srgb, var(--txt) 28%, transparent); }
.xb-split:hover::after { background: color-mix(in srgb, var(--txt) 55%, transparent); }
.x-obook { flex: 0 0 300px; display: flex; flex-direction: column; min-height: 0; background: var(--panel); }
.x-obook.hidden, .x-obook.hidden + .xb-split, .xb-split.hidden { display: none; }
/* DEPTH view: the chart goes full-width; COB/SVP live in this panel (below a COMPACT buy strip) as a canvas whose price
   rows are pixel-aligned to the heatmap. Hide the DOM book list + controls + the trade sub-rows, show the COB/SVP canvas. */
.x-cobsvp { display: none; }
.cryptopanel.depth-view .xb-ctrls,
.cryptopanel.depth-view .xb-head,
.cryptopanel.depth-view .xb-body,
.cryptopanel.depth-view .xb-tape-wrap,
.cryptopanel.depth-view #xt-status,
.cryptopanel.depth-view #xt-pos,
.cryptopanel.depth-view #xt-orders { display: none; }
.cryptopanel.depth-view .x-obook { flex-basis: 232px; position: relative; }
/* COB/SVP ladder fills the FULL panel height so its price rows align top-to-bottom with the heatmap (Bookmap-style). */
.cryptopanel.depth-view .x-cobsvp { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
/* quick-buy floats as a compact translucent bar over the bottom (lowest, least-important price rows) — trading stays available without stealing ladder height. */
.cryptopanel.depth-view .x-trade { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; flex: 0 0 auto; padding: 7px 9px; background: color-mix(in srgb, var(--panel) 80%, transparent); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); border-top: 1px solid var(--line); }
.xb-ctrls { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.xb-row2 { display: flex; align-items: center; gap: 6px; }
.xb-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.xb-seg button { background: transparent; border: 0; color: var(--dim); font-size: 11px; font-weight: 700; letter-spacing: .02em; padding: 5px 9px; cursor: pointer; white-space: nowrap; }
.xb-seg button.on { background: color-mix(in srgb, var(--txt) 8%, var(--panel)); color: var(--txt); }
.xb-side button.on.up { background: color-mix(in srgb, #34d399 22%, var(--panel)); color: #34d399; }
.xb-side button.on.dn { background: color-mix(in srgb, #e0555f 22%, var(--panel)); color: #e0555f; }
.xb-dd { position: relative; }
.xb-dd-btn { display: inline-flex; align-items: center; gap: 8px; background: #1b1d22; color: #fff; border: 1px solid var(--line); border-radius: 8px; font-size: 11px; font-weight: 700; padding: 5px 9px; cursor: pointer; }
.xb-dd-chev { color: #fff; font-size: 12px; line-height: 1; }
.xb-dd-menu { position: absolute; top: calc(100% + 4px); right: 0; min-width: 132px; background: #1b1d22; border: 1px solid var(--line); border-radius: 8px; padding: 4px; display: none; z-index: 60; box-shadow: 0 10px 28px rgba(0,0,0,.55); }
.xb-dd.open .xb-dd-menu { display: block; }
.xb-dd-menu button { display: block; width: 100%; text-align: left; background: transparent; border: 0; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .02em; padding: 7px 24px 7px 10px; border-radius: 6px; cursor: pointer; position: relative; }
.xb-dd-menu button:hover { background: rgba(255,255,255,.08); }
.xb-dd-menu button.sel::after { content: '✓'; position: absolute; right: 9px; color: #fff; }
/* compact quick-trade widget at the top of the crypto order-book column — market BUY UP / BUY DOWN */
.x-trade { flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.x-trade.hidden { display: none; }
.xt-amtrow { display: flex; align-items: center; gap: 6px; }
.xt-cur { color: var(--dim); font-weight: 800; font-size: 13px; }
.xt-amt { width: 58px; flex: 0 0 auto; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; color: var(--txt); font: 800 14px inherit; font-variant-numeric: tabular-nums; padding: 5px 7px; text-align: right; }
.xt-amt:focus { outline: none; border-color: var(--focusline); }
.xt-presets { display: flex; gap: 4px; margin-left: auto; }
.xt-presets button { background: var(--panel2); border: 1px solid var(--line); color: var(--dim); border-radius: 6px; font: 700 11px inherit; padding: 4px 7px; cursor: pointer; }
.xt-presets button:hover { color: var(--txt); border-color: var(--txt); }
.xt-btns { display: flex; gap: 6px; }
.xt-buy { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 1px; border: 1px solid transparent; border-radius: 8px; padding: 7px 6px; cursor: pointer; font-family: inherit; }
.xt-buy b { font-size: 12px; font-weight: 800; letter-spacing: .03em; }
.xt-buy .xt-est { font-size: 9px; font-weight: 700; opacity: .8; font-variant-numeric: tabular-nums; min-height: 11px; }
.xt-buy.up { background: color-mix(in srgb, var(--green) 20%, var(--panel)); border-color: color-mix(in srgb, var(--green) 55%, transparent); color: var(--green); }
.xt-buy.up:hover { background: color-mix(in srgb, var(--green) 32%, var(--panel)); }
.xt-buy.dn { background: color-mix(in srgb, var(--red) 20%, var(--panel)); border-color: color-mix(in srgb, var(--red) 55%, transparent); color: var(--red); }
.xt-buy.dn:hover { background: color-mix(in srgb, var(--red) 32%, var(--panel)); }
.xt-buy:disabled { opacity: .5; cursor: default; }
.xt-status { font-size: 10px; font-weight: 600; color: var(--dim); min-height: 12px; text-align: center; }
.xt-status.ok { color: var(--green); } .xt-status.err { color: var(--red); }
/* open-position rows with a one-click CLOSE (full flatten via the guarded SELL path) */
.xt-pos { display: flex; flex-direction: column; gap: 4px; }
.xt-pos:empty { display: none; }
.xt-posrow { display: flex; flex-direction: column; gap: 5px; background: var(--panel2); border: 1px solid var(--line); border-radius: 7px; padding: 6px 7px; }
.xt-posline { display: flex; align-items: center; gap: 6px; }
.xt-poslbl { font-weight: 800; font-size: 10px; letter-spacing: .04em; padding: 1px 5px; border-radius: 4px; flex: 0 0 auto; }
.xt-posrow.up .xt-poslbl { color: var(--green); background: color-mix(in srgb, var(--green) 16%, transparent); }
.xt-posrow.dn .xt-poslbl { color: var(--red); background: color-mix(in srgb, var(--red) 16%, transparent); }
.xt-posdet { flex: 1 1 auto; min-width: 0; color: var(--dim); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xt-posline b { flex: 0 0 auto; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.xt-posline b.pos { color: var(--green); } .xt-posline b.neg { color: var(--red); }
.xt-close { width: 100%; text-align: center; background: var(--panel); border: 1px solid var(--line); color: var(--txt); border-radius: 6px; font: 800 11px inherit; letter-spacing: .04em; padding: 6px 8px; cursor: pointer; }
.xt-close:hover { border-color: var(--txt); background: color-mix(in srgb, var(--txt) 9%, var(--panel)); }
/* resting/pending open orders on the round's tokens (normally none for crypto FAK) + one-click cancel */
.xt-orders { display: flex; flex-direction: column; gap: 4px; }
.xt-orders:empty { display: none; }
.xt-ordrow { display: flex; align-items: center; gap: 6px; background: color-mix(in srgb, var(--dim) 10%, var(--panel)); border: 1px dashed var(--line); border-radius: 7px; padding: 5px 7px; font-size: 11px; }
.xt-ordlbl { font-weight: 800; font-size: 9px; letter-spacing: .05em; color: var(--dim); flex: 0 0 auto; }
.xt-orddet { flex: 1 1 auto; min-width: 0; color: var(--txt); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xt-ordx { flex: 0 0 auto; background: transparent; border: 1px solid color-mix(in srgb, var(--red) 45%, transparent); color: var(--red); border-radius: 6px; font: 800 10px inherit; padding: 3px 8px; cursor: pointer; }
.xt-ordx:hover { background: color-mix(in srgb, var(--red) 14%, transparent); }
.xb-head { flex: 0 0 auto; display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 8px 12px 4px; font-size: 8px; font-weight: 800; letter-spacing: .08em; color: var(--dim); }
.xb-head span:nth-child(2) { text-align: center; } .xb-head span:nth-child(3) { text-align: right; }
.xb-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; }
.xb-body::-webkit-scrollbar { width: 8px; }
/* CEX size-aware tape (Binance): buys green / sells red, size-scaled bar, big prints bold */
.xb-tape-wrap { flex: 0 0 auto; width: 208px; min-width: 168px; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--panel); }
.xb-tape-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 6px 12px 3px; font-size: 8px; font-weight: 800; letter-spacing: .08em; color: var(--dim); }
.xb-tape-minl { display: inline-flex; align-items: center; }
.xb-tape-min { width: 44px; background: color-mix(in srgb, var(--txt) 6%, var(--panel)); border: 1px solid var(--line); border-radius: 4px; color: var(--txt); font-size: 10px; padding: 1px 4px; text-align: right; font-variant-numeric: tabular-nums; }
.xb-tape { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.xb-tape::-webkit-scrollbar { width: 8px; } .xb-tape::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
.xt-row { position: relative; display: grid; grid-template-columns: 1.1fr 1fr auto; align-items: center; padding: 2px 12px; font-size: 11px; font-variant-numeric: tabular-nums; }
.xt-row .xt-bar { position: absolute; left: 0; top: 0; bottom: 0; opacity: .16; }
.xt-row.buy .xt-bar { background: #16c784; } .xt-row.sell .xt-bar { background: #ea3943; }
.xt-row .xt-sz { position: relative; font-weight: 700; }
.xt-row.buy .xt-sz { color: #16c784; } .xt-row.sell .xt-sz { color: #ea3943; }
.xt-row .xt-px { position: relative; color: var(--txt); }
.xt-row .xt-tm { position: relative; color: var(--dim); font-size: 9px; text-align: right; }
.xt-row.big .xt-sz { font-size: 13px; } .xt-row.big { font-weight: 800; }
.xb-body::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--txt) 16%, transparent); border-radius: 4px; }
.xb-row { position: relative; display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; padding: 4px 12px; font-size: 11px; font-variant-numeric: tabular-nums; flex: 1 1 0; }
.xb-row .xb-bar-fill { position: absolute; top: 1px; bottom: 1px; right: 0; border-radius: 3px 0 0 3px; z-index: 0; }
.xb-row.ask .xb-bar-fill { background: rgba(224,85,95,.14); } .xb-row.bid .xb-bar-fill { background: rgba(52,211,153,.14); }
.xb-row > span { position: relative; z-index: 1; }
.xb-px { font-weight: 700; } .xb-row.ask .xb-px { color: #e0555f; } .xb-row.bid .xb-px { color: #34d399; }
.xb-sh { text-align: center; color: var(--dim); } .xb-tot { text-align: right; font-weight: 700; color: var(--txt); }
.xb-mid { flex: 0 0 auto; display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; padding: 5px 12px; background: var(--panel2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 9.5px; color: var(--dim); }
/* SVP panel (own column, CEX venue) — a volume profile: matched buy-green / sell-red per price, toggled like the tape */
.xb-svp-wrap { flex: 0 0 auto; width: 150px; min-width: 118px; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--panel); }
.cryptopanel.depth-view .xb-svp-wrap { display: none !important; }
.xb-svp-head { flex: 0 0 auto; display: flex; justify-content: space-between; align-items: baseline; padding: 8px 10px 4px; font-size: 8px; font-weight: 800; letter-spacing: .08em; color: var(--dim); }
.xb-svp-sub { font-weight: 700; letter-spacing: 0; opacity: .7; }
.xb-svp-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; }
.xb-svp-body::-webkit-scrollbar { width: 8px; }
.xb-svp-body::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--txt) 16%, transparent); border-radius: 4px; }
.xb-svp-empty { padding: 12px; color: var(--dim); font-size: 11px; }
.xs-row { position: relative; display: flex; justify-content: space-between; align-items: center; padding: 3px 10px; font-size: 10.5px; font-variant-numeric: tabular-nums; flex: 1 1 0; }
.xs-row.cur { background: color-mix(in srgb, var(--txt) 7%, transparent); }
.xs-fill { position: absolute; top: 1px; bottom: 1px; right: 0; display: flex; z-index: 0; border-radius: 3px 0 0 3px; overflow: hidden; }   /* full-row background bar behind both figures, right-anchored like the DOM */
.xs-fill .xs-g { background: rgba(52,211,153,.30); }
.xs-fill .xs-s { background: rgba(224,85,95,.30); }
.xs-px, .xs-v { position: relative; z-index: 1; }
.xs-px { color: var(--dim); font-weight: 700; }
.xs-row.cur .xs-px { color: var(--txt); }
.xs-v { text-align: right; font-weight: 700; color: var(--txt); }
.xb-mid .xb-last { text-align: center; font-size: 12px; font-weight: 800; color: var(--txt); }
.xb-mid .xb-spread { text-align: right; }
.x-book, .x-trades { background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.x-sec-h { flex: 0 0 auto; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); padding: 6px 10px; border-bottom: 1px solid var(--grid, var(--line)); }
.x-book-body, .x-trades-body { flex: 1 1 auto; overflow-y: auto; min-height: 0; font-variant-numeric: tabular-nums; }
.x-brow { display: flex; justify-content: space-between; padding: 2px 10px; font-size: 12px; }
.x-brow.ask .x-bpx { color: var(--red, #e0555f); } .x-brow.bid .x-bpx { color: var(--green, #34d399); }
.x-bsz { color: var(--dim); }
.x-bmid { text-align: center; font-size: 11px; font-weight: 800; color: var(--dim); padding: 3px 0; border-top: 1px solid var(--grid, var(--line)); border-bottom: 1px solid var(--grid, var(--line)); }
.x-trow { display: grid; grid-template-columns: auto auto 1fr auto; gap: 8px; padding: 2px 10px; font-size: 12px; align-items: center; }
.x-tk { font-weight: 800; font-size: 9px; padding: 1px 4px; border-radius: 3px; }
.x-trow.up .x-tk { color: var(--green, #34d399); background: color-mix(in srgb, var(--green, #34d399) 15%, transparent); }
.x-trow.dn .x-tk { color: var(--red, #e0555f); background: color-mix(in srgb, var(--red, #e0555f) 15%, transparent); }
.x-tt { color: var(--dim); font-size: 10px; }


/* ===== web-overrides.css ===== */
/* ── Web-clone CSS overrides (appended to styles.css by web-build.mjs) ─────────────────────────────
   Only the handful of places where the browser shell legitimately differs from the Electron app.
   Keep this tiny; prefer fixing the shared styles.css when a change helps both shells. */

/* Connect pane: the onboarding pane was built for the desktop WalletConnect (QR) flow. The web clone
   connects via the one-click browser extension, so there's no QR to scan — hide the QR image and the
   "scan with mobile / copy link" helper, and show a clean spinner + status while the signature is pending. */
.ob-wc-qrimg { display: none !important; }
#ob-wc-qr .ob-fine + .ob-fine { display: none !important; }   /* the 2nd .ob-fine = "Scan with MetaMask mobile…" */
#ob-wc-qr { text-align: center; margin-top: 18px; }
#ob-wc-qr::before {
  content: ""; display: block; width: 30px; height: 30px; margin: 4px auto 16px;
  border: 3px solid rgba(255, 255, 255, 0.14); border-top-color: #5b8cff;
  border-radius: 50%; animation: deskweb-spin 0.8s linear infinite;
}
@keyframes deskweb-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #ob-wc-qr::before { animation: none; } }

/* Resume prompt (web only): shown on reload when a stored trade-only session exists, instead of silently
   logging in. One click resumes (no wallet prompt); Disconnect clears it. */
#resume-prompt {
  position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(3px); padding: 16px;
}
#resume-prompt .resume-card {
  width: 100%; max-width: 420px; background: #14181d; border: 1px solid #262c34; border-radius: 16px;
  padding: 28px 26px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); text-align: left;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: #e8edf2;
}
#resume-prompt h2 { margin: 0 0 10px; font-size: 22px; font-weight: 700; }
#resume-prompt p { margin: 0 0 20px; font-size: 14.5px; line-height: 1.55; color: #aeb8c2; }
#resume-prompt p b { color: #e8edf2; }
#resume-prompt .resume-addr { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: #e8edf2; }
#resume-prompt .resume-btn {
  display: block; width: 100%; padding: 13px 16px; border: none; border-radius: 11px; cursor: pointer;
  background: #4f6bff; color: #fff; font-size: 15.5px; font-weight: 650; transition: background 0.15s, opacity 0.15s;
}
#resume-prompt .resume-btn:hover { background: #3f5aff; }
#resume-prompt .resume-btn:disabled { opacity: 0.6; cursor: default; }
#resume-prompt .resume-link {
  display: block; width: 100%; margin-top: 12px; padding: 8px; border: none; background: none; cursor: pointer;
  color: #9aa7b2; font-size: 13.5px; text-align: center;
}
#resume-prompt .resume-link:hover { color: #cdd6df; }

/* ===== wallet picker (EIP-6963) — shown in onboarding when >1 extension is installed ===== */
#ob-wc-wallets { display: flex; flex-direction: column; gap: 8px; }
.ob-wallet-btn { display: flex; align-items: center; justify-content: center; gap: 10px; }
.ob-wallet-ico { width: 20px; height: 20px; border-radius: 5px; flex: 0 0 auto; }
.ob-wallet-btn span { font-weight: 600; }

/* ===== cold-start funding banner (C1b) — directs an unfunded wallet to Polymarket ===== */
.fund-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9997;
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
  background: #16263e; color: #dce8f7; border-bottom: 1px solid #244a79;
  font-size: 13px; line-height: 1.5; font-weight: 500; padding: 9px 44px 9px 16px; text-align: center;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.4);
}
.fund-banner b { font-weight: 800; color: #fff; }
.fund-banner .fund-msg { max-width: 820px; }
.fund-banner .fund-cta {
  flex: 0 0 auto; background: #4f6bff; color: #fff; border: none; border-radius: 8px;
  padding: 7px 14px; font-weight: 700; font-size: 12.5px; cursor: pointer; white-space: nowrap;
}
.fund-banner .fund-cta:hover { background: #3f5aff; }
.fund-banner .fund-x { position: absolute; right: 14px; top: 8px; cursor: pointer; opacity: 0.6; font-weight: 700; }
.fund-banner .fund-x:hover { opacity: 1; }
