/* TraderSkim — terminal UI. Open layout, hairline separators, no card stacks. */
:root {
  --bg: #090b0f; --bg-2: #0d1015; --bg-3: #151920; --hover: rgba(255,255,255,.03); --sel: rgba(31,209,196,.06);
  --line: rgba(255,255,255,.055); --line-2: rgba(255,255,255,.095);
  --up-a: rgba(46,189,133,.12); --down-a: rgba(246,70,93,.12); --ease: cubic-bezier(.2,.7,.2,1);
  --ink: #e7e9ee; --ink-2: #a3aab8; --ink-3: #6b7280; --ink-4: #4a505c;
  --accent: #1fd1c4; --accent-2: #5fe3d8; --accent-ink: #03201d;
  --up: #2ebd85; --down: #f6465d; --warn: #e0a84e; --info: #7aa2f7;
  --side-up: #097a50; --side-up-hi: #0a8253; --side-up-lo: #076640; --side-down: #d42a45; --side-down-hi: #d92f48; --side-down-lo: #b11f38;
  --sans: Inter, "SF Pro Text", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r: 6px; --top: 48px; --side: 340px; --mk: 264px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 13px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
body { overflow: hidden; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; opacity: .45; }
:focus-visible { outline: 2px solid rgba(31,209,196,.8); outline-offset: 2px; border-radius: 3px; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.sm { font-size: 11.5px; } .xs { font-size: 10.5px; }
.dim { color: var(--ink-3); } .dim2 { color: var(--ink-2); }
.up { color: var(--up) !important; } .down { color: var(--down) !important; } .warn { color: var(--warn); } .accent { color: var(--accent); }
.grow { flex: 1; }
.label { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.07); border-radius: 8px; } ::-webkit-scrollbar-track { background: transparent; }

/* ── primitives ── */
.brand { display: flex; align-items: center; gap: 8px; font-weight: 650; letter-spacing: .24em; font-size: 12.5px; color: var(--ink); }
.brand-mark { width: 18px; height: 18px; object-fit: contain; flex: none; }
.brand.lg { font-size: 15px; } .brand.lg .brand-mark { width: 20px; height: 20px; }
.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); padding: 0 14px; flex: none; overflow-x: auto; scrollbar-width: none; }
.tab { position: relative; padding: 11px 0 10px; color: var(--ink-3); font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; transition: color .15s var(--ease); }
.tab:hover { color: var(--ink-2); }
.tab.on { color: var(--ink); }
.tab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: var(--accent); }
.count { font: 500 10.5px var(--mono); color: var(--ink-3); }
.tab.on .count { color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); padding: 2px; gap: 2px; }
.seg button { padding: 4px 10px; border-radius: 4px; color: var(--ink-3); font-weight: 500; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--bg-3); color: var(--ink); }
.seg.sm button { padding: 2px 8px; font-size: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--line-2); color: var(--ink); font-weight: 500; transition: border-color .15s, background .15s; }
.btn:hover:not(:disabled) { border-color: rgba(255,255,255,.2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: var(--accent-2); border-color: var(--accent-2); }
.btn.ghost { border-color: transparent; color: var(--ink-2); } .btn.ghost:hover:not(:disabled) { color: var(--ink); border-color: var(--line-2); }
.btn.danger { color: var(--down); border-color: rgba(246,70,93,.4); } .btn.danger:hover:not(:disabled) { background: rgba(246,70,93,.08); border-color: var(--down); }
.btn.sm { height: 26px; padding: 0 10px; font-size: 12px; }
.btn.block { width: 100%; }
.ibtn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r); color: var(--ink-2); } .ibtn:hover { background: var(--hover); color: var(--ink); }
.field { display: grid; gap: 5px; }
.field > span { font-size: 11.5px; color: var(--ink-3); }
input:not([type=checkbox]):not([type=range]), select {
  height: 32px; width: 100%; background: transparent; border: 1px solid var(--line-2); border-radius: var(--r); padding: 0 10px; outline: none; transition: border-color .15s;
}
input:focus, select:focus { border-color: rgba(31,209,196,.6); }
input::placeholder { color: var(--ink-4); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 14px; padding-right: 26px; }
select option { background: var(--bg-2); }
input[type=number] { font-family: var(--mono); -moz-appearance: textfield; } input::-webkit-inner-spin-button { -webkit-appearance: none; }
input[type=range] { width: 100%; accent-color: var(--accent); height: 18px; }
input.invalid { border-color: rgba(246,70,93,.6); }
.hint { margin: 0; font-size: 11.5px; color: var(--ink-3); }
.form-error { margin: 0; min-height: 16px; font-size: 12px; color: var(--down); }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-4); flex: none; }
.dot.ok { background: var(--up); box-shadow: 0 0 0 3px rgba(46,189,133,.12); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--down); }
.switch { position: relative; width: 34px; height: 20px; border-radius: 20px; background: var(--bg-3); border: 1px solid var(--line-2); transition: background .2s, border-color .2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--ink-3); transition: transform .2s, background .2s; }
.switch.on { background: rgba(46,189,133,.2); border-color: rgba(46,189,133,.5); } .switch.on::after { transform: translateX(14px); background: var(--up); }
.empty { padding: 28px 16px; text-align: center; color: var(--ink-3); }
.empty b { display: block; color: var(--ink-2); font-weight: 500; margin-bottom: 2px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; }
.kv > span:first-child { color: var(--ink-3); }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 1px 6px; border-radius: 3px; color: var(--ink-2); background: var(--bg-3); }
.pill.demo { color: var(--info); background: rgba(122,162,247,.1); } .pill.dim { color: var(--ink-3); }
.pill.up { background: rgba(46,189,133,.1); } .pill.down { background: rgba(246,70,93,.1); } .pill.warn { color: var(--warn); background: rgba(224,168,78,.1); }
.pill.ai { color: var(--accent); background: rgba(31,209,196,.08); }

/* ── auth ── */
.auth { position: fixed; inset: 0; display: grid; grid-template-columns: 1.1fr 1fr; overflow: auto;
  background: linear-gradient(135deg, #0b1422 0%, #070c15 54%, #03060b 100%); }
.auth-side { position: relative; isolation: isolate; overflow: hidden; padding: 40px 56px; display: flex; flex-direction: column; gap: 40px;
  background: radial-gradient(circle at 28% 42%, rgba(31, 209, 196, .09) 0, rgba(31, 209, 196, .028) 28%, transparent 62%); }
.auth-side::after { content: "TRADERSKIM"; position: absolute; inset: 50% 0 auto; transform: translateY(-50%); z-index: 0; pointer-events: none;
  color: rgba(146, 190, 208, .035); font: 700 clamp(42px, 7vw, 116px)/1 var(--sans); letter-spacing: .16em; text-align: center; white-space: nowrap; user-select: none; }
.auth-copy { margin-top: auto; max-width: 520px; }
.auth-side > * { position: relative; z-index: 1; }
.auth-copy h1 { font-size: 34px; line-height: 1.15; font-weight: 600; letter-spacing: -.02em; margin: 0 0 16px; }
.auth-copy h1 span { color: var(--ink-3); }
.auth-copy p { color: var(--ink-2); font-size: 14px; max-width: 460px; margin: 0; }
.auth-tape { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.tape-item { padding: 14px 16px 0 0; display: grid; gap: 2px; }
.tape-item + .tape-item { padding-left: 16px; border-left: 1px solid var(--line); }
.tape-item canvas { width: 100%; height: 34px; margin-top: 6px; }
.fine { font-size: 11px; color: var(--ink-4); margin: 0; max-width: 520px; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; background: rgba(3, 6, 11, .22); }
.auth-form { width: min(360px, 100%); display: grid; gap: 14px; }
.field > .pw-wrap { position: relative; display: block; font-size: inherit; color: inherit; }
.pw-wrap input { padding-right: 36px; }
.pw-eye { position: absolute; right: 2px; top: 2px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--r); color: var(--ink-3); }
.pw-eye:hover, .pw-eye:focus-visible { color: var(--ink); }
.pw-eye svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pw-eye .eye-off { display: none; } .pw-eye[aria-pressed=true] .eye-open { display: none; } .pw-eye[aria-pressed=true] .eye-off { display: inline; }
.agree { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--ink-2); cursor: pointer; }
.agree input { margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.agree a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.auth-form .tabs { padding: 0; margin-bottom: 8px; }
.auth-form [hidden] { display: none !important; }
.auth-step { display: grid; gap: 4px; }
.auth-step b { font-size: 15px; font-weight: 600; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; min-height: 18px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--ink-2); font: inherit; font-size: 12px; cursor: pointer; }
.linkbtn:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ── terminal grid ── */
.term { position: fixed; inset: 0; display: grid; grid-template-columns: var(--mk) minmax(0, 1fr) var(--side); grid-template-rows: var(--top) minmax(0, 1fr); grid-template-areas: "top top top" "mk center side"; }
.top { grid-area: top; display: flex; align-items: center; gap: 14px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); min-width: 0; }
.top .brand { padding-right: 14px; border-right: 1px solid var(--line); height: 20px; }
.top-sym { display: flex; align-items: baseline; gap: 10px; min-width: 0; white-space: nowrap; }
.top-sym #topName { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.status { display: flex; align-items: center; gap: 7px; color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.acct { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 8px 0 10px; border-radius: var(--r); border: 1px solid var(--line-2); white-space: nowrap; }
.wallet-bal { display: flex; align-items: baseline; gap: 10px; } .wallet-bal b { font-size: 22px; font-weight: 600; }
.grid.compact td { padding: 5px 6px; } .grid.compact td:first-child { padding-left: 0; } .grid.compact td:last-child { padding-right: 0; }
.acct:hover { border-color: rgba(255,255,255,.18); }
.acct-type { font-size: 10.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.acct-type.demo { color: var(--info); } .acct-type.live { color: var(--accent); }
/* Demo | Live switcher — one compact segmented control; the active account is the server's (aria-checked) */
.acct-switch { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line-2); border-radius: var(--r); white-space: nowrap; }
.acct-opt { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 9px; border-radius: 3px; color: var(--ink-3); }
.acct-opt b { font-weight: 500; color: var(--ink-3); font-size: 12px; }
.acct-opt:hover { color: var(--ink-2); }
.acct-opt.on { background: var(--bg-3); } .acct-opt.on b { color: var(--ink); font-weight: 600; }
#acctLive.on { box-shadow: inset 0 -1px 0 var(--accent); }
.acct-st { font-size: 10px; letter-spacing: .04em; color: var(--ink-3); } .acct-st.warn { color: var(--warn); } .acct-st.down { color: var(--down); } .acct-st.up { color: var(--up); }
/* order context strip above the ticket */
.ctx { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 14px; border-bottom: 1px solid var(--line); font-size: 12px; flex: none; }
.ctx-k { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.ctx.demo .ctx-k { color: var(--info); } .ctx.live .ctx-k { color: var(--accent); }
.ctx-v { color: var(--ink-3); flex: 1; min-width: 120px; }
.ctx.live { box-shadow: inset 2px 0 0 var(--accent); }
/* Live status panel + checklist (open layout, subtle separators) */
.live-panel { display: grid; gap: 8px; }
.live-st { display: grid; gap: 2px; } .live-st b { font-size: 13px; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; }
.checklist li { display: grid; grid-template-columns: 14px 1fr auto; gap: 8px; align-items: baseline; padding: 4px 0; border-top: 1px solid var(--line); font-size: 12px; }
.checklist li.ok i { color: var(--up); } .checklist li.todo { color: var(--ink-2); } .checklist li.todo i { color: var(--ink-3); }
.checklist li .xs { text-align: right; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-acts { display: flex; gap: 8px; flex-wrap: wrap; } .live-acts:empty { display: none; }
.ai-acct { display: flex; align-items: center; gap: 10px; }
.ai-acct .seg button[aria-pressed=true] { color: var(--ink); background: var(--bg-3); }
.sell-btn { height: 22px; padding: 0 8px; font-size: 11px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-2); color: var(--ink-2); font-weight: 600; font-size: 11.5px; }
.avatar:hover { border-color: var(--accent); color: var(--accent); }

/* markets */
.markets { grid-area: mk; display: flex; flex-direction: column; border-right: 1px solid var(--line); min-height: 0; background: var(--bg); }
.m-head { padding: 12px 12px 8px; display: grid; gap: 10px; }
.search { position: relative; } .search svg { position: absolute; left: 9px; top: 9px; color: var(--ink-3); width: 14px; height: 14px; }
.search > input:not([type=checkbox]) { padding-left: 30px; height: 32px; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { padding: 3px 8px; border-radius: 4px; color: var(--ink-3); font-size: 11.5px; font-weight: 500; }
.chip:hover { color: var(--ink); } .chip.on { color: var(--ink); background: var(--bg-3); }
.m-cols { display: flex; justify-content: space-between; padding: 4px 14px 6px; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-4); border-bottom: 1px solid var(--line); }
.m-list { overflow-y: auto; flex: 1; padding: 4px 0 12px; }
.m-group { padding: 12px 14px 4px; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-4); }
.m-row { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 14px 6px 10px; cursor: pointer; border-left: 2px solid transparent; }
.m-row:hover { background: var(--hover); }
.m-row.on { background: var(--sel); border-left-color: var(--accent); }
.m-row .star { color: var(--ink-4); display: grid; place-items: center; } .m-row .star svg { width: 13px; height: 13px; }
.m-row .star.on { color: var(--accent); } .m-row .star.on svg { fill: var(--accent); }
.m-row .star:hover { color: var(--accent); }
.m-name { min-width: 0; } .m-name b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-name span { font-size: 10.5px; color: var(--ink-3); font-family: var(--mono); }
.m-px { text-align: right; font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.m-px small { display: block; font-size: 10.5px; color: var(--ink-3); }
.m-px.flash-up { color: var(--up); } .m-px.flash-down { color: var(--down); }
.m-closed { font-size: 10.5px; color: var(--ink-4); text-transform: uppercase; letter-spacing: .06em; }

/* center */
.center { grid-area: center; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(190px, 1fr) auto auto minmax(160px, 30%); min-width: 0; min-height: 0; }
.chart-bar { display: flex; align-items: center; gap: 18px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; row-gap: 8px; }
.cb-title { display: flex; align-items: baseline; gap: 8px; } .cb-title b { font-size: 16px; font-weight: 600; letter-spacing: -.015em; }
.cb-quote { display: flex; align-items: baseline; gap: 8px; padding-left: 16px; border-left: 1px solid var(--line); } .cb-quote b { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.mstate { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); display: inline-flex; align-items: center; gap: 5px; }
.chart-wrap { position: relative; min-height: 0; }
.chart-wrap canvas { position: absolute; inset: 0; display: block; touch-action: pan-y; }
.chart-pos { display: flex; gap: 22px; padding: 7px 16px; border-top: 1px solid var(--line); font-size: 12px; overflow-x: auto; white-space: nowrap; min-height: 33px; align-items: center; color: var(--ink-3); }
.chart-pos b { color: var(--ink); font-weight: 500; }
.dock { display: flex; flex-direction: column; border-top: 1px solid var(--line); min-height: 0; min-width: 0; }
.dock-body { flex: 1; min-height: 0; overflow: auto; }

/* tables */
table.grid { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.grid th { position: sticky; top: 0; background: var(--bg); text-align: left; font-weight: 500; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-4); padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1; }
.grid td { padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.grid tr:hover td { background: rgba(255,255,255,.015); }
.grid .r { text-align: right; }
.grid td.act, .grid th.act { position: sticky; right: 0; background: var(--bg); box-shadow: -12px 0 12px -8px var(--bg); } .grid td.r { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.grid .wrap { white-space: normal; min-width: 180px; color: var(--ink-3); font-size: 12px; }
.grid th:first-child, .grid td:first-child { padding-left: 16px; } .grid th:last-child, .grid td:last-child { padding-right: 16px; }
.ct { display: flex; align-items: center; gap: 8px; } .ct b { font-weight: 500; }
.side-mark { width: 3px; height: 22px; border-radius: 2px; background: var(--ink-4); } .side-mark.up { background: var(--up); } .side-mark.down { background: var(--down); }
.prog { width: 90px; height: 3px; background: var(--bg-3); border-radius: 3px; overflow: hidden; display: inline-block; vertical-align: middle; }
.prog i { display: block; height: 100%; background: var(--accent); transition: width .4s linear; }
.pane-bar { display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }

/* performance */
.kpis { display: flex; flex-wrap: wrap; padding: 14px 16px 6px; row-gap: 14px; }
.kpi { padding-right: 26px; margin-right: 26px; border-right: 1px solid var(--line); display: grid; gap: 2px; }
.kpi:last-child { border-right: 0; }
.kpi b { font: 500 16px var(--mono); font-variant-numeric: tabular-nums; }
.perf-body { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(240px, 1fr); gap: 0; padding: 4px 0 12px; }
.perf-body > div { padding: 8px 16px; min-width: 0; }
.perf-body > div + div { border-left: 1px solid var(--line); }
.eq { width: 100%; height: 150px; display: block; margin-top: 8px; }

/* side panel */
.side { grid-area: side; display: flex; flex-direction: column; border-left: 1px solid var(--line); min-height: 0; }
.side-body { flex: 1; overflow-y: auto; min-height: 0; }
.sec { padding: 14px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 12px; }
.sec:last-child { border-bottom: 0; }
.sec-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* Side selector — meaning by colour: up (Rise/Higher/Touch/Even/Over/Matches) green, down red.
   Selected = solid; the other stays in its colour but subdued. Both always readable. */
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.inline { display: flex; gap: 6px; } .inline > input { flex: 1; min-width: 0; } .inline > select { width: 84px; flex: none; }
.quick { display: flex; gap: 4px; } .quick button { flex: 1; font: 500 11.5px var(--mono); color: var(--ink-3); padding: 3px 0; border-radius: 4px; }
.quick button:hover { color: var(--ink); background: var(--hover); }
.pred-line { grid-auto-flow: column; justify-content: space-between; align-items: baseline; }
.pred-line b { color: var(--ink); font-size: 13px; } .pred-line a { color: var(--accent); text-decoration: none; margin-left: 6px; } .pred-line a:hover { text-decoration: underline; }

/* ── Live digits: one horizontal strip under the chart (real ticks only) ── */
.digits { border-top: 1px solid var(--line); container-type: inline-size; min-width: 0; }
.dg-sec { display: grid; gap: 4px; padding: 8px 16px 7px; }
.dg-head { display: flex; align-items: center; gap: 14px; min-width: 0; white-space: nowrap; }
.dg-head > .label { color: var(--ink-2); }
.dg-status { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-3); white-space: nowrap; flex: none; max-width: 100%; min-width: 0; }
.dg-status span { overflow: hidden; text-overflow: ellipsis; }
.pill.even { color: var(--info); background: rgba(122,162,247,.08); } .pill.odd { color: var(--accent); background: rgba(31,209,196,.08); }
.dg-row { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); }
.dg { position: relative; display: grid; justify-items: center; gap: 3px; padding: 8px 2px 3px; background: none; border: 0; cursor: default; color: var(--ink-3); min-width: 0; border-radius: 4px; }
.dg + .dg::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 8px; width: 1px; background: var(--line); }
/* pointers: tiny carets above the digit — green = most frequent, red = least frequent (real-tick window) */
.dg-ptr { position: absolute; top: 1px; left: 50%; width: 0; height: 0; transform: translateX(-50%) translateY(-2px); opacity: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid transparent; transition: opacity .2s var(--ease), transform .2s var(--ease); }
.dg.ptr-hi .dg-ptr { border-top-color: var(--up); opacity: 1; transform: translateX(-50%); }
.dg.ptr-lo .dg-ptr { border-top-color: var(--down); opacity: 1; transform: translateX(-50%); }
.dg-n { width: min(100%, 42px); height: 30px; border-radius: 5px; display: grid; place-items: center; font: 500 15px var(--mono); border: 1px solid transparent; color: var(--ink-2); }
/* no colour transitions on digit tiles: the live-digit highlight moves in one frame, so two digits never look current */
.dg-pct small { font-size: .85em; } .dg-pct { font: 10px var(--mono); color: var(--ink-4); letter-spacing: -.01em; white-space: nowrap; }
.dg-pct.hi { color: var(--up); } .dg-pct.lo { color: var(--down); }
.dg:disabled { opacity: 1; cursor: default; } /* read-only in non-digit contracts, but the live data stays full strength */
.dg-row.selectable .dg { cursor: pointer; }
.dg-row.selectable .dg:hover .dg-n { border-color: var(--line-2); background: var(--hover); color: var(--ink); }
.dg:focus-visible { outline: none; } .dg:focus-visible .dg-n { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px rgba(31,209,196,.8); }
.dg.na .dg-n { opacity: .35; } .dg.na { cursor: not-allowed !important; }
/* contract zones (Over/Under, Even) — a thin underline tint, not boxes */
.dg.z-up .dg-n { box-shadow: inset 0 -2px 0 rgba(46,189,133,.55); color: var(--ink); }
.dg.z-down .dg-n { box-shadow: inset 0 -2px 0 rgba(246,70,93,.5); color: var(--ink); }
.dg.z-even .dg-n { box-shadow: inset 0 -2px 0 rgba(122,162,247,.55); color: var(--ink); }
/* selected prediction: accent ring */
.dg.sel .dg-n { border-color: var(--accent); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.dg.sel .dg-pct { color: var(--accent); }
/* current live digit: solid accent tile */
.dg.cur .dg-n { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; transform: translateY(-1px); box-shadow: 0 0 0 3px rgba(31,209,196,.16); }
.dg.cur .dg-pct { color: var(--accent); }
.dg.cur.sel .dg-n { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--accent); }
.dg.cur.pulse .dg-n { animation: dgPulse .5s var(--ease); }
@keyframes dgPulse { from { box-shadow: 0 0 0 0 rgba(31,209,196,.5); } to { box-shadow: 0 0 0 8px rgba(31,209,196,0); } }
.dg-row.dim-cur .dg.cur .dg-n { background: transparent; color: var(--accent); border-style: dashed; box-shadow: none; transform: none; }
@container (max-width: 820px) {
  .dg-head { flex-wrap: wrap; row-gap: 4px; } .dg-hist { flex: 1 1 100%; order: 5; }
  .dg-legend { flex-wrap: wrap; row-gap: 3px; white-space: normal; } .dg-hint { flex-basis: 100%; padding-left: 0; border-left: 0; }
}
@container (max-width: 420px) { .dg-sec { padding: 6px 12px; } .dg-pct small { display: none; } .dg-pct { font-size: 9.5px; } .dg-n { font-size: 13.5px; height: 28px; } .dg-legend { gap: 10px; } .dg-quote { padding-left: 0; border-left: 0; } }
@media (prefers-reduced-motion: reduce) { .dg-n, .dg, .dg-ptr, .buy-btn { transition: none; } .dg.cur.pulse .dg-n { animation: none; } .dg.cur .dg-n { transform: none; } }
/* contract actions: each side is its own direct trade button (semantic up/down tint; accent ✓ ring = last selected) */
.buy { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.buy-btn { position: relative; display: grid; align-content: center; justify-items: center; gap: 4px; min-width: 0; min-height: 88px; padding: 16px 12px; text-align: center; border-radius: var(--r); border: 1px solid transparent; color: #fff;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease), transform .08s var(--ease); }
/* thick, filled trading buttons: strong green (up side) / strong red (down side), white text (shared with the Auto AI contract panel) */
.buy-btn.up, .sel-ct.up { --side: var(--side-up); --side-hi: var(--side-up-hi); --side-lo: var(--side-up-lo); }
.buy-btn.down, .sel-ct.down { --side: var(--side-down); --side-hi: var(--side-down-hi); --side-lo: var(--side-down-lo); }
.buy-btn.up, .buy-btn.down { background: var(--side); border-color: var(--side-lo); color: #fff !important; } /* beats the .up/.down text utilities */
.buy-btn.up:hover:not(:disabled), .buy-btn.down:hover:not(:disabled) { background: var(--side-hi); }
.buy-btn:active:not(:disabled) { background: var(--side-lo); transform: translateY(1px); }
.buy-btn.on { border-color: #fff; box-shadow: inset 0 0 0 1px #fff; }
.buy-btn[aria-busy=true] { background: var(--side-lo); }
.buy-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.buy-btn:disabled { opacity: .45; cursor: not-allowed; }
.buy-btn .bt { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 2px 10px; max-width: 100%; min-width: 0; font-weight: 800; font-size: 17px; letter-spacing: .06em; text-transform: uppercase; }
.buy-btn .bl { display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.buy-btn .bk { color: #fff; font-weight: 800; flex: none; }
.buy-btn .bt .sm { font-size: 12px; font-weight: 700; letter-spacing: 0; text-transform: none; flex: 0 0 100%; text-align: center; color: rgba(255,255,255,.9); }
.buy-btn .bs { font: 12px var(--mono); color: rgba(255,255,255,.88); min-height: 16px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.buy-btn .be { font-size: 11px; color: #fff; line-height: 1.3; }
.buy-btn.busy { cursor: progress; pointer-events: none; }
.buy-btn.busy .bs { color: #fff; }
.acct-cap.demo { color: var(--info); } .acct-cap.live { color: var(--accent); }
.exec { display: grid; gap: 6px; font-size: 12px; }
.steps { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-4); flex-wrap: wrap; }
.steps span { display: inline-flex; align-items: center; gap: 5px; } .steps span::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.steps .ok { color: var(--up); } .steps .fail { color: var(--down); } .steps .active { color: var(--accent); } .steps .warn { color: var(--warn); }
.steps i { width: 10px; height: 1px; background: var(--line-2); }
.checks { display: grid; gap: 2px; font-size: 11.5px; margin-top: 2px; }
.checks div { display: flex; gap: 6px; color: var(--ink-3); } .checks div.fail { color: var(--down); }
.riskbar { border-top: 1px solid var(--line); padding: 10px 16px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; font-size: 12px; flex: none; }
.riskbar .rk { display: flex; justify-content: space-between; gap: 8px; } .riskbar .rk span:first-child { color: var(--ink-3); }
.riskbar .rh { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
.meter { height: 2px; background: var(--bg-3); border-radius: 2px; overflow: hidden; grid-column: 1 / -1; } .meter i { display: block; height: 100%; background: var(--accent); } .meter.hot i { background: var(--down); }
.notice { font-size: 12px; color: var(--ink-2); padding: 10px 12px; border-left: 2px solid var(--accent); background: rgba(31,209,196,.04); }
.notice.bad { border-left-color: var(--down); background: rgba(246,70,93,.05); }

/* AI */
.ai-head { display: flex; align-items: center; gap: 12px; }
.ai-state { display: grid; gap: 1px; flex: 1; min-width: 0; } .ai-state b { font-weight: 600; font-size: 14px; } .ai-state span { font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; }
.pipe { display: grid; }
.stage { display: grid; grid-template-columns: 14px 92px minmax(0, 1fr); align-items: start; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.stage:last-child { border-bottom: 0; }
.stage .sd { margin-top: 5px; width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--ink-4); }
.stage.active .sd { border-color: var(--accent); background: var(--accent); animation: pulse 1.4s infinite; }
.stage.ok .sd { border-color: var(--up); background: var(--up); } .stage.fail .sd { border-color: var(--down); background: var(--down); } .stage.warn .sd { border-color: var(--warn); background: var(--warn); }
.stage .sn { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding-top: 1px; }
.stage .sx { color: var(--ink-2); overflow-wrap: anywhere; } .stage.idle .sx { color: var(--ink-4); }
@keyframes pulse { 50% { opacity: .35; } }
.conf { position: relative; height: 4px; background: var(--bg-3); border-radius: 4px; margin: 8px 0 4px; }
.conf i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 4px; }
.conf .mk { position: absolute; top: -4px; width: 1px; height: 12px; background: var(--ink-2); }
.conf .mk.be { background: var(--down); }
.conf-legend { display: flex; gap: 14px; font-size: 11px; color: var(--ink-3); } .conf-legend span::before { content: ""; display: inline-block; width: 8px; height: 1px; vertical-align: middle; margin-right: 5px; background: var(--ink-2); } .conf-legend span.be::before { background: var(--down); }
.stats-line { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 12px; }
.stats-line div { display: grid; gap: 1px; } .stats-line b { font: 500 13px var(--mono); }
.ai-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ai-actions .btn { height: 36px; padding: 0 8px; font-size: 11.5px; letter-spacing: .04em; font-weight: 600; white-space: nowrap; }
.scan-meta { display: flex; gap: 8px; align-items: center; }
.scan-line { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; }
.scan-line > span { display: inline-flex; align-items: baseline; gap: 6px; }
.scan-line i, .why i { font-style: normal; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.scan-line em { font-style: normal; color: var(--ink-3); font-size: 11px; }
.mk-scan > summary { cursor: pointer; }
.kvs .kv { padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.kvs .kv:last-child { border-bottom: 0; }
.kvs .kv b { font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.why { display: grid; gap: 6px; font-size: 12px; }
.why ul { margin: 2px 0 0; padding-left: 16px; color: var(--ink-2); display: grid; gap: 2px; }
.why p { margin: 0; }
.alts { display: grid; gap: 6px; }
.mini-t { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.mini-t th { text-align: left; font-weight: 500; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 3px 6px 3px 0; }
.mini-t td { padding: 4px 6px 4px 0; border-top: 1px solid var(--line); color: var(--ink-2); }
details.params > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
details.params > summary::-webkit-details-marker { display: none; }
details.params > summary svg { transition: transform .2s; color: var(--ink-3); } details.params[open] > summary svg { transform: rotate(180deg); }
.params-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.params-grid .full { grid-column: 1 / -1; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--up); animation: pulse 1.4s infinite; }
.ai-scan-hero, .ai-setup-hero { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px 14px; border:1px solid rgba(31,209,196,.28); border-radius:var(--r); background:linear-gradient(135deg,rgba(31,209,196,.10),rgba(214,164,72,.06)); }
.ai-scan-hero b, .ai-setup-hero b { display:block; font-size:16px; letter-spacing:.02em; }
.ai-setup-hero span:not(.eyebrow) { display:block; margin-top:3px; color:var(--ink-3); font-size:11px; }
.eyebrow { color:var(--accent); font-size:9px; letter-spacing:.14em; font-weight:700; }
.scan-live { color:var(--up); font:700 10px var(--mono); letter-spacing:.12em; }
.condition-grid, .setup-conditions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; margin-top:9px; }
.condition-card, .setup-condition { display:grid; grid-template-columns:1fr auto; gap:2px 8px; padding:9px 10px; border:1px solid var(--line); border-radius:var(--r); background:rgba(255,255,255,.015); }
.condition-card span, .setup-condition span { color:var(--ink-2); font-size:11px; }
.condition-card b, .setup-condition b { color:var(--accent); font-size:14px; }
.condition-card i { grid-column:1/-1; height:3px; background:var(--bg-3); border-radius:4px; overflow:hidden; }
.condition-card em { display:block; height:100%; background:linear-gradient(90deg,var(--accent),var(--up)); border-radius:4px; }
.ai-setup-empty { display:grid; gap:5px; padding:14px; border:1px dashed var(--line-2); border-radius:var(--r); }
.ai-setup-empty b { font-size:14px; }
.ai-setup-meta { display:flex; justify-content:space-between; margin-top:9px; }


/* drawer */
.scrim { position: fixed; inset: 0; background: rgba(4,5,8,.55); z-index: 50; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--bg-2); border-left: 1px solid var(--line-2); z-index: 60; display: flex; flex-direction: column; animation: slidein .2s ease-out; }
@keyframes slidein { from { transform: translateX(24px); opacity: 0; } }
.drawer-h { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer-b { overflow-y: auto; flex: 1; }

/* toasts */
.toasts { position: fixed; top: calc(var(--top) + 10px); left: 50%; transform: translateX(-50%); display: grid; justify-items: center; gap: 6px; z-index: 80; width: max-content; max-width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast { padding: 10px 14px; background: var(--bg-3); border: 1px solid var(--line-2); border-left: 2px solid var(--ink-3); border-radius: var(--r); font-size: 12.5px; opacity: 0; transform: translateY(-6px); transition: opacity .2s, transform .2s; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.toast.in { opacity: 1; transform: none; }
.toast.ok { border-left-color: var(--up); } .toast.bad { border-left-color: var(--down); } .toast.warn { border-left-color: var(--warn); }

.mnav { display: none; }
.t-only { display: none; }

/* ── phone: auth screen + tables ── */
@media (max-width: 767px) {
  body { overflow: hidden; }
  .auth { grid-template-columns: 1fr; } .auth-side { padding: 28px 22px; gap: 24px; border-right: 0; border-bottom: 0; } .auth-copy h1 { font-size: 26px; } .auth-tape { grid-template-columns: repeat(2, 1fr); } .tape-item:nth-child(3) { padding-left: 0; border-left: 0; }
  .grid th, .grid td { padding: 8px 10px; }
  .kpi { padding-right: 16px; margin-right: 16px; }
}

/* real-money section (drawer) — same open layout, no boxes */
.cs-open { display: flex; gap: 6px; margin: 8px 0 10px; } /* account drawer → canonical cashier */
.dep-row { display: flex; gap: 8px; align-items: flex-end; }
.dep-row .btn { white-space: nowrap; }
.chip:disabled { opacity: .45; cursor: not-allowed; }
.hint.warn { color: var(--warn); }
select { background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r); height: 32px; padding: 0 8px; color: var(--ink); max-width: 100%; }

/* chart timeframe bar + data-source strip */
.seg.tf { overflow-x: auto; scrollbar-width: none; max-width: 100%; flex-wrap: nowrap; }
.seg.tf button { padding: 4px 8px; white-space: nowrap; }
.chart-src { display: flex; align-items: center; gap: 10px; padding: 5px 14px; border-bottom: 1px solid var(--line); font-size: 11px; white-space: nowrap; overflow: hidden; min-width: 0; }
.chart-src .src-lbl { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); font-weight: 600; }
.chart-src .feed { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); }
.chart-src .feed[data-state="stale"], .chart-src .feed[data-state="waiting"] { color: var(--warn); }
.chart-src .feed[data-state="disconnected"], .chart-src .feed[data-state="unavailable"], .chart-src .feed[data-state="closed"] { color: var(--down); }
.chart-src .src-note { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 720px) { .chart-src .src-note { display: none; } }

/* Payment methods: open list, hairline separators; only "available" is green. */
.pm-list { display: flex; flex-direction: column; margin: 10px 0 6px; border-top: 1px solid var(--line); }
.pm { display: grid; grid-template-columns: 16px 1fr auto; align-items: center; gap: 8px; padding: 6px 2px; border-bottom: 1px solid var(--line); font-size: 12px; cursor: pointer; }
.pm.off { cursor: default; } .pm.off .pm-name { color: var(--ink-2); } .pm.soon { opacity: .6; }
.pm input { margin: 0; accent-color: var(--accent); } .pm input:disabled { opacity: .35; }
.pm-st { font-size: 11px; white-space: nowrap; } .pm-st.dim { color: var(--ink-3, var(--ink-2)); }
.btn.xs { height: 22px; padding: 0 8px; font-size: 11px; }
/* Operator console */
body.admin { overflow: auto; }
.adm-top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.adm-top .brand-sm { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; letter-spacing: .08em; color: var(--accent); } .brand-sm .brand-mark { width: 17px; height: 17px; object-fit: contain; }
.adm-main { padding: 12px 16px 40px; max-width: 1280px; }
.adm-t { width: 100%; margin: 6px 0 14px; } .adm-t tr.sub td { padding-top: 0; border-top: 0; }
.adm-detail { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 0 0 8px; }
.adm-h { display: block; margin: 16px 0 4px; }
.adm-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.nowrap { white-space: nowrap; }

/* ── security: drawer section + step-up dialog (open layout, hairline separators only) ── */
.sec-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sec-flow { display: grid; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.codes { margin: 0; padding: 8px 0; font-size: 12.5px; line-height: 1.7; color: var(--ink); column-count: 2; user-select: all; }
.sel { user-select: all; }
.stepup-scrim { z-index: 90; }
.stepup { position: fixed; z-index: 91; top: 18vh; left: 50%; transform: translateX(-50%); width: min(360px, calc(100vw - 32px)); display: grid; gap: 12px;
  padding: 18px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: 0 18px 50px rgba(0,0,0,.5); }
.stepup b { font-size: 14px; font-weight: 600; }
.stepup-a { display: flex; justify-content: flex-end; gap: 8px; }
.adm-kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 18px; font-size: 12.5px; }
.adm-kv > span { color: var(--ink-3); } .adm-kv > b { font-weight: 500; }
.adm-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
/* operator console: state line, 7-state rail, level steps, checks — text + hairlines only (no cards / boxes) */
.adm-banner { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 4px 0 8px; border-bottom: 1px solid var(--line); }
.adm-banner > b { font-size: 15px; font-weight: 600; letter-spacing: .02em; }
.adm-rail { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 4px 0 6px; padding: 0; list-style: none; font-size: 10.5px; letter-spacing: .04em; color: var(--ink-3); }
.adm-rail li.on { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--accent); }
.adm-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 0 32px; }
.adm-checks { margin: 0; padding: 0; list-style: none; font-size: 12px; line-height: 1.6; }
.adm-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 0 6px; }
.adm-lv { display: inline-flex; gap: 2px; vertical-align: middle; } .adm-lv i { width: 10px; height: 3px; border-radius: 1px; background: var(--line-2); } .adm-lv i.on { background: var(--ink-3); }
.adm-detail-b { padding: 2px 0 10px 12px; border-left: 1px solid var(--line); }
.ok-msg { min-height: 1em; margin: 0; color: var(--ink-2); }
.adm-t td.mono.dim, .adm-t td.dim { overflow-wrap: anywhere; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.check input { margin-top: 2px; accent-color: var(--accent, #d9b36c); }


/* ═════ Terminal refinement: header tools, timeframe popup, chart tools, digits circles, ticket hierarchy ═════ */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.chart-bar { position: relative; gap: 14px; }
.hdr-tools { margin-left: auto; flex: none; }
.hbtn, .ai-chip b { white-space: nowrap; }
.cb-title > span, .cb-quote > * { white-space: nowrap; }
.cb-title b { min-width: 0; }
@media (max-width: 1599px) { #btnSupport .hb-l { display: none; } .cb-title #cbSym { display: none; } }
@media (min-width: 1024px) { .chart-bar { flex-wrap: nowrap; } .cb-title { min-width: 0; overflow: hidden; } .cb-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }
.chg-lbl { font: 500 9.5px var(--mono); letter-spacing: .06em; color: var(--ink-4); text-transform: uppercase; align-self: center; }

/* timeframe: one compact trigger + floating 4-column menu */
.tfpop { position: relative; }
.tf-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px 0 10px; border-radius: var(--r); color: var(--ink); font: 500 12px var(--mono); box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow .15s var(--ease), background-color .15s var(--ease); }
.tf-btn:hover, .tf-btn[aria-expanded=true] { background: var(--hover); box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
.tf-btn svg { width: 13px; height: 13px; color: var(--ink-3); transition: transform .18s var(--ease); }
.tf-btn[aria-expanded=true] svg { transform: rotate(180deg); }
.tf-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; display: grid; grid-template-columns: repeat(4, 52px); gap: 2px; padding: 6px; border-radius: 8px;
  background: var(--bg-2); box-shadow: 0 0 0 1px var(--line-2), 0 18px 40px -12px rgba(0,0,0,.7); animation: popIn .14s var(--ease); }
.tf-menu button { height: 28px; border-radius: 4px; font: 500 12px var(--mono); color: var(--ink-2); transition: background-color .12s var(--ease), color .12s var(--ease); }
.tf-menu button:hover, .tf-menu button:focus-visible { background: var(--hover); color: var(--ink); outline: none; box-shadow: inset 0 0 0 1px var(--line-2); }
.tf-menu button[aria-checked=true] { color: var(--accent); background: var(--sel); }
.tf-menu button[data-tf=live] { grid-column: span 1; color: var(--up); }
@keyframes popIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

/* chart header tools: AI chip, bell, support */
.hdr-tools { display: flex; align-items: center; gap: 2px; }
.hbtn { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border-radius: var(--r); color: var(--ink-2); font-size: 12px; transition: color .15s var(--ease), background-color .15s var(--ease); }
.hbtn:hover, .hbtn[aria-expanded=true] { color: var(--ink); background: var(--hover); }
.hbtn svg { width: 16px; height: 16px; }
.badge { position: absolute; top: 1px; right: 1px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font: 700 9.5px/15px var(--mono); text-align: center; }
.ai-chip b { font-weight: 500; color: var(--ink); font-size: 11.5px; }
.ai-chip .hb-l { font-weight: 600; letter-spacing: .06em; font-size: 10.5px; color: var(--ink-3); }
.ai-chip[data-state=off] .dot, .ai-chip[data-state=loading] .dot { background: var(--ink-4); }
.ai-chip[data-state=scanning] .dot { background: var(--info); animation: blink 1.2s infinite; }
.ai-chip[data-state=analysis_ready] .dot, .ai-chip[data-state=manual] .dot { background: var(--accent); }
.ai-chip[data-state=auto_running] .dot { background: var(--up); box-shadow: 0 0 0 3px rgba(46,189,133,.14); }
.ai-chip[data-state=paused] .dot { background: var(--warn); }
.ai-chip[data-state=risk_stopped] .dot, .ai-chip[data-state=provider_unavailable] .dot { background: var(--down); }
@keyframes blink { 50% { opacity: .35; } }

/* header popovers */
.hpop { position: absolute; top: calc(100% + 4px); right: 12px; z-index: 60; width: 340px; max-width: calc(100vw - 24px); display: flex; flex-direction: column; max-height: min(70vh, 560px);
  background: var(--bg-2); border-radius: 8px; box-shadow: 0 0 0 1px var(--line-2), 0 24px 48px -16px rgba(0,0,0,.75); animation: popIn .14s var(--ease); }
.hpop.wide { width: 400px; }
.hp-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.hp-h b { font-weight: 600; font-size: 13px; }
.hp-b { overflow-y: auto; min-height: 0; }
.hp-b > .kv, .hp-b > .sec-row { padding-left: 14px; padding-right: 14px; }
.hp-empty { padding: 26px 14px; text-align: center; color: var(--ink-3); font-size: 12px; }
.hp-note { display: grid; gap: 3px; margin: 10px 14px; padding: 8px 10px; border-left: 2px solid var(--accent); font-size: 12px; color: var(--ink-2); }
.hp-note.bad { border-left-color: var(--down); } .hp-note b { color: var(--ink); font-weight: 600; }
.nt { display: grid; grid-template-columns: 8px 1fr; gap: 10px; width: 100%; text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); transition: background-color .12s var(--ease); }
.nt:hover { background: var(--hover); } .nt:last-child { border-bottom: 0; }
.nt-dot { width: 6px; height: 6px; margin-top: 6px; border-radius: 50%; background: transparent; }
.nt.unread .nt-dot { background: var(--accent); } .nt.unread .nt-dot.bad { background: var(--down); } .nt.unread .nt-dot.ok { background: var(--up); } .nt.unread .nt-dot.warn { background: var(--warn); }
.nt-b { display: grid; gap: 2px; min-width: 0; } .nt-b b { font-weight: 500; font-size: 12.5px; color: var(--ink-2); } .nt.unread .nt-b b { color: var(--ink); font-weight: 600; }
.nt-b > span { font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
/* support */
.sup-form { display: grid; gap: 10px; padding: 12px 14px; }
.sup-form textarea { width: 100%; min-height: 90px; resize: vertical; background: var(--bg); color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--r); padding: 8px 10px; font: inherit; }
.sup-form textarea:focus { outline: none; border-color: rgba(31,209,196,.6); }
.sup-list { border-top: 1px solid var(--line); }
.sup-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.sup-row:hover { background: var(--hover); } .sup-row > span:first-child { display: grid; gap: 1px; min-width: 0; }
.sup-row .xs { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sup-t { display: grid; gap: 0; } .sup-th { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.sup-msgs { display: grid; gap: 10px; padding: 12px 14px; }
.sup-m { display: grid; gap: 3px; padding-left: 10px; border-left: 2px solid var(--line-2); } .sup-m.staff, .sup-m.admin { border-left-color: var(--accent); }
.sup-m p { margin: 0; font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* profile menu: exactly five actions */
.menu { position: fixed; top: calc(var(--top) - 4px); right: 10px; z-index: 80; width: 240px; padding: 6px; border-radius: 8px; background: var(--bg-2);
  box-shadow: 0 0 0 1px var(--line-2), 0 24px 48px -16px rgba(0,0,0,.75); animation: popIn .14s var(--ease); display: flex; flex-direction: column; }
.pm-head { display: grid; gap: 1px; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.pm-head b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; } .pm-head .xs { overflow: hidden; text-overflow: ellipsis; }
.pm-item { text-align: left; padding: 8px 10px; border-radius: 5px; color: var(--ink-2); font-size: 12.5px; transition: background-color .12s var(--ease), color .12s var(--ease); }
.pm-item:hover, .pm-item:focus-visible { background: var(--hover); color: var(--ink); outline: none; }
.pm-item.danger { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 5px 5px; color: var(--ink-3); } .pm-item.danger:hover { color: var(--down); }

/* chart viewport tools (wheel / pinch / drag are on the canvas itself) */
.chart-wrap canvas { cursor: crosshair; touch-action: none; }
.chart-wrap canvas.grabbing { cursor: grabbing; }
.chart-wrap canvas:focus-visible { outline: none; box-shadow: inset 0 0 0 1px rgba(31,209,196,.35); border-radius: 0; }
.chart-tools { position: absolute; left: 10px; bottom: 30px; display: flex; align-items: center; gap: 2px; padding: 2px; border-radius: var(--r); background: rgba(13,16,21,.72);
  backdrop-filter: blur(6px); box-shadow: 0 0 0 1px var(--line); opacity: .55; transition: opacity .18s var(--ease); }
.chart-wrap:hover .chart-tools, .chart-tools:focus-within { opacity: 1; }
.chart-tools button { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 4px; font-size: 11px; color: var(--ink-2); }
.chart-tools button:hover { background: var(--hover); color: var(--ink); }
.chart-tools .live { color: var(--up); } .chart-tools .live svg { width: 12px; height: 12px; }
.ct-note { font-size: 10.5px; color: var(--ink-3); padding: 0 6px; } .ct-note:empty { display: none; }

/* Live Digits: ten circles — digit + real %, pointer above, subtle ring on the current digit */
.dg-sec { gap: 2px; padding: 6px 16px 8px; }
.dg-head { gap: 8px; }
.dg-title { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
.dg-status .dot { width: 5px; height: 5px; }
.dg-row { justify-items: center; gap: 4px; padding-top: 6px; }
.dg { width: min(100%, 50px); aspect-ratio: 1; padding: 0; border-radius: 50%; display: grid; place-content: center; gap: 0; line-height: 1.1; border: 1px solid var(--line-2);
  background: rgba(255,255,255,.012); transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease); }
.dg + .dg::before { display: none; }
.dg .dg-n { width: auto; height: auto; border: 0 !important; background: none !important; box-shadow: none !important; transform: none !important; font: 600 15px var(--mono); color: var(--ink); animation: none !important; }
.dg .dg-pct { font: 500 9.5px var(--mono); color: var(--ink-3); text-align: center; }
.dg .dg-pct small { font-size: .9em; opacity: .8; }
.dg .dg-pct.hi, .dg .dg-pct.lo { color: var(--ink-2); }
.dg-ptr { top: -7px; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid transparent; }
.dg.ptr-hi .dg-ptr { border-top: 0; border-bottom: 5px solid var(--up); top: -8px; }
.dg.ptr-lo .dg-ptr { border-top: 5px solid var(--down); }
.dg.ptr-hi { border-color: rgba(46,189,133,.45); } .dg.ptr-lo { border-color: rgba(246,70,93,.45); }
.dg.cur { border-color: rgba(31,209,196,.85); box-shadow: 0 0 0 3px rgba(31,209,196,.1); background: rgba(31,209,196,.05); }
.dg.cur .dg-n { color: var(--accent); }
.dg.cur.pulse { animation: dgRing .5s var(--ease); }
@keyframes dgRing { from { box-shadow: 0 0 0 6px rgba(31,209,196,.22); } to { box-shadow: 0 0 0 3px rgba(31,209,196,.1); } }
.dg-row.dim-cur .dg.cur { border-style: dashed; background: transparent; box-shadow: none; animation: none; }
.dg.sel { box-shadow: inset 0 0 0 1px var(--accent); } .dg.sel .dg-pct { color: var(--accent); }
.dg.cur.sel { box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 3px rgba(31,209,196,.14); }
.dg-row.selectable .dg:hover { background: var(--hover); border-color: rgba(255,255,255,.2); }
.dg:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px rgba(31,209,196,.8); }
.dg.na { opacity: .35; }
.dg.z-up { background: rgba(46,189,133,.05); } .dg.z-down { background: rgba(246,70,93,.05); } .dg.z-even { background: rgba(122,162,247,.06); }
.dg.z-up .dg-n, .dg.z-down .dg-n, .dg.z-even .dg-n { color: var(--ink); }

/* ticket hierarchy */
.terms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.terms > .pred-line, .terms > .field.full { grid-column: 1 / -1; }
.stake-row { display: grid; gap: 6px; }
.payout { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-top: 2px; }
.payout > div { display: grid; gap: 2px; } .payout b { font-size: 13.5px; font-weight: 600; }
.payout .label { font-size: 9.5px; }
.tgt-host { grid-template-columns: minmax(0, 1fr); min-width: 0; } .tgt-host > * { min-width: 0; }
.tgt-host .sec-h { flex-wrap: wrap; row-gap: 2px; }
.tgt-host .row2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .tgt-host .row2 input { width: 100%; min-width: 0; }
.tgt-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; } .tgt-line > span, .tgt-line > b { white-space: nowrap; } .tgt-line b { font-size: 13px; }
.tgt-line .btn { height: 26px; padding: 0 10px; font-size: 11.5px; white-space: nowrap; flex: none; }
.tgt-hit { overflow-wrap: anywhere; }
.tgt-hit { display: grid; gap: 4px; }
.tgt-host .row2 input::placeholder { color: var(--ink-4); }

@media (max-width: 1023px) { .hbtn .hb-l { display: none; } .ai-chip .hb-l { display: inline; } }
@media (max-width: 767px) {
  .hpop, .hpop.wide { position: fixed; top: calc(var(--top) + 6px); left: 8px; right: 8px; width: auto; max-height: calc(100vh - var(--top) - 80px); }
  .menu { right: 8px; left: auto; }
  .ai-chip .hb-l { display: none; }
  .hdr-tools { order: 3; }
  .tf-menu { grid-template-columns: repeat(4, 56px); }
  .tf-menu button { height: 34px; }
  .chart-tools { bottom: 26px; opacity: 1; }
  .dg { width: min(100%, 40px); } .dg .dg-n { font-size: 13px; } .dg .dg-pct { font-size: 8.5px; }
  .dg-sec { padding: 4px 8px 6px; }
  .term[data-view=trade] .dg-head { display: none; }
}
@media (prefers-reduced-motion: reduce) { .tf-menu, .hpop, .menu { animation: none; } .dg.cur.pulse { animation: none; } .ai-chip .dot { animation: none !important; } }

/* ═════════════════ PREMIUM CLEAN TERMINAL ═════════════════
   Header · maximum chart (floating Live Digits at its bottom centre) · continuous right trade panel.
   Left contextual drawers (Markets, workspace, Active trade) overlay the chart — one at a time — and never resize it. */
:root { --side: 312px; --ld: 312px; --cbh: 46px; --bg-d: #0c0f14; }
@media (min-width: 1600px) { :root { --side: 320px; --ld: 320px; } }
.term { grid-template-columns: minmax(0, 1fr) var(--side); grid-template-rows: var(--top) minmax(0, 1fr); grid-template-areas: "top top" "center side"; }
.center { grid-template-rows: var(--cbh) minmax(0, 1fr) auto; }

/* header: brand | tools · Demo/Live · wallet · profile */
.top { gap: 10px; padding: 0 10px 0 16px; }
.top .brand { border-right: 0; padding-right: 0; }
#stFeed { margin-left: -2px; } #stFeed .dot { width: 5px; height: 5px; }
.top-sym { display: none; }
.hdr-tools { position: relative; display: flex; align-items: center; gap: 2px; margin-left: 0; }
.hbtn { height: 32px; min-width: 32px; justify-content: center; padding: 0 8px; }
.ai-chip { gap: 6px; } .ai-chip .hb-l { font: 600 11px var(--sans); letter-spacing: .08em; color: var(--ink-2); display: inline !important; }
.ai-chip:hover .hb-l, .ai-chip[aria-expanded=true] .hb-l { color: var(--ink); }
.hpop { top: calc(100% + 8px); right: 0; }
.acct-switch { margin-left: 6px; }
#btnDrawer { margin-left: 2px; }
/* tooltips (mouse + keyboard focus) */
[data-tip] { position: relative; }
[data-tip]::after { content: attr(data-tip); position: absolute; top: calc(100% + 6px); left: 50%; transform: translate(-50%, -2px); padding: 4px 8px; border-radius: 4px; background: #1b2029; color: var(--ink);
  font: 500 11px var(--sans); letter-spacing: 0; text-transform: none; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s var(--ease), transform .12s var(--ease); z-index: 70; box-shadow: 0 0 0 1px var(--line-2); }
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); transition-delay: .25s; }
[data-tip][aria-expanded=true]::after, .dock-nav .tab.on[data-tip]::after { display: none; }
#btnDrawer[data-tip]::after { left: auto; right: 0; transform: translateY(-2px); } #btnDrawer[data-tip]:hover::after, #btnDrawer[data-tip]:focus-visible::after { transform: none; }

/* center: chart header, working chart, and grounded Live Digits row */
.center { position: relative; grid-template-rows: var(--cbh) minmax(0, 1fr) auto; overflow: hidden; }
.chart-bar { height: var(--cbh); padding: 0 10px 0 8px; gap: 12px; border-bottom: 0; flex-wrap: nowrap; min-width: 0; z-index: 2; }
.cb-mkt { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px; border-radius: var(--r); min-width: 0; max-width: 42%; transition: background-color .15s var(--ease); }
.cb-mkt:hover, .cb-mkt[aria-expanded=true] { background: var(--hover); }
.cb-mkt b { font-size: 15px; font-weight: 600; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cb-mkt svg { width: 14px; height: 14px; color: var(--ink-3); transition: transform .18s var(--ease); } .cb-mkt[aria-expanded=true] svg { transform: rotate(180deg); }
.cb-quote { padding-left: 0; border-left: 0; gap: 10px; flex: none; } .cb-quote b { font-size: 15px; }
.cb-feed { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--warn); white-space: nowrap; min-width: 0; overflow: hidden; }
.cb-feed[data-state=live] .cf-t { display: none; }
.cb-feed[data-state=disconnected], .cb-feed[data-state=closed], .cb-feed[data-state=unavailable] { color: var(--down); }
.tf-btn { height: 30px; }
.dock-nav { display: flex; align-items: center; gap: 2px; flex: none; }
.dock-nav .tab { height: 30px; padding: 0 9px; border-radius: var(--r); color: var(--ink-3); font-size: 12px; gap: 6px; }
.dock-nav .tab::after { display: none; }
.dock-nav .tab.on::after { display: none; }
.dock-nav .tab:hover { color: var(--ink); background: var(--hover); }
.dock-nav .tab.on { color: var(--ink); background: var(--bg-3); }
.dock-nav .tab svg { width: 15px; height: 15px; }
.dock-nav .count { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font: 700 10px/16px var(--mono); text-align: center; }
.dock-nav .count[data-n="0"], .dock-nav .count:empty { display: none; }
@media (max-width: 1499px) { .dock-nav .dn-l { display: none; } .dock-nav .tab { padding: 0 7px; } }
.chart-wrap { container-type: size; }
.chart-pos { display: none !important; }

/* grounded Live Digits beneath the working space; it never covers chart data or controls */
.center > .digits { position: relative; z-index: 2; width: 100%; max-width: none; min-width: 0; border-top: 1px solid var(--line); background: var(--bg); }
.center > .digits .dg-sec { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 6px 12px 8px; }
.center > .digits .dg-status { display: none !important; }
.center > .digits .dg-row { display: flex; justify-content: center; gap: 5px; padding-top: 8px; }
.center > .digits .dg { width: clamp(30px, calc((100cqw - 110px) / 11), 48px); height: auto; aspect-ratio: 1; flex: none; }
.center > .digits .dg .dg-n { font-size: clamp(12.5px, 1.7cqw, 16px); }
.center > .digits .dg .dg-pct { font-size: clamp(8px, 1cqw, 10px); }
.center > .digits .dg-ptr { top: -9px; }
/* live cursor under the digits: real ticks only (digits.js); glides between real positions, never moves on its own */
.dg-track { position: relative; display: grid; min-width: 0; }
.dg-cursor { position: relative; height: 7px; pointer-events: none; }
.dg-cursor i { position: absolute; left: 0; top: 3px; width: var(--w, 16px); height: 2px; border-radius: 2px; background: var(--accent);
  transform: translateX(calc(var(--x, 0px) - 50%)); transition: transform .26s var(--ease), opacity .2s var(--ease); will-change: transform; }
.dg-cursor[data-state=idle] i { opacity: 0; }
.dg-cursor[data-state=paused] i { opacity: .4; }
.dg-cursor.snap i { transition: none; }
@media (prefers-reduced-motion: reduce) { .dg-cursor i { transition: none; } }
.chart-wrap .dg.ptr-hi .dg-ptr { top: -9px; }
/* chart view tools: bottom-left in the same reserved band; top-left when the chart is narrow */
.chart-tools { left: 10px; bottom: 34px; }
@container (max-width: 760px) { .chart-tools { top: 8px; bottom: auto; } }
/* Keep the follow-latest control in the DOM for chartview.js, but do not show it in the workspace. */
#chartLive { display: none !important; }

/* left contextual drawers (overlay; never resize or push the chart) */
.ldrawer { position: absolute; top: var(--cbh); bottom: 0; left: 0; width: min(var(--ld), calc(100% - 32px)); z-index: 30; display: flex; flex-direction: column; min-height: 0;
  background: var(--bg-d); border-right: 1px solid var(--line-2); box-shadow: 28px 0 48px -28px rgba(0,0,0,.85);
  transform: translateX(-104%); visibility: hidden; transition: transform .24s var(--ease), visibility 0s linear .24s; }
.ldrawer.open { transform: none; visibility: visible; transition: transform .24s var(--ease), visibility 0s; }
.ld-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 42px; padding: 0 6px 0 14px; border-bottom: 1px solid var(--line); flex: none; }
.ld-h b { font-weight: 600; font-size: 12.5px; letter-spacing: .02em; }
.ld-x { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: var(--r); color: var(--ink-3); } .ld-x:hover { color: var(--ink); background: var(--hover); }
.markets { grid-area: auto; border-right: 1px solid var(--line-2); }
.dock { border-top: 0; }
.dock .dock-body { flex: 1; min-height: 0; overflow: auto; }
.dock .riskbar { border-top: 1px solid var(--line); padding: 10px 14px 12px; }
.ai-engine { border-top: 1px solid var(--line); }
.ai-engine .sec { padding: 12px 14px; }
.ai-engine .params-grid { grid-template-columns: 1fr 1fr; }
/* narrow tables: each row stacks as label / value lines (labels come from the column headers) */
.ldrawer table.grid, .ldrawer table.grid tbody { display: block; }
.ldrawer table.grid thead { display: none; }
.ldrawer table.grid tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3px 14px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.ldrawer table.grid tr:hover td { background: none; }
.ldrawer table.grid td, .ldrawer .grid td:first-child, .ldrawer .grid td:last-child { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 0; border: 0; white-space: normal; font-size: 12px; min-width: 0; text-align: right; }
.ldrawer table.grid td::before { content: attr(data-l); flex: none; color: var(--ink-4); font: 500 9.5px var(--sans); letter-spacing: .06em; text-transform: uppercase; text-align: left; }
.ldrawer table.grid td:first-child { grid-column: 1 / -1; text-align: left; justify-content: flex-start; }
.ldrawer table.grid td:first-child::before { display: none; }
.ldrawer table.grid td.wrap { grid-column: 1 / -1; min-width: 0; }
.ldrawer table.grid td.act { position: static; box-shadow: none; background: none; }
.ldrawer .prog { width: 64px; }
.ldrawer .pane-bar { padding: 8px 14px; gap: 6px 12px; }
.ldrawer .kpis { padding: 12px 14px 4px; } .ldrawer .kpi { padding-right: 14px; margin-right: 14px; }
.ldrawer .perf-body { grid-template-columns: 1fr; } .ldrawer .perf-body > div + div { border-left: 0; border-top: 1px solid var(--line); } .ldrawer .perf-body > div { padding: 8px 14px; }
.ldrawer .empty { padding: 28px 14px; }

/* active-trade drawer */
.td-body { flex: 1; overflow-y: auto; min-height: 0; }
.td-card { display: grid; gap: 10px; padding: 14px; border-bottom: 1px solid var(--line); animation: tdIn .22s var(--ease); }
@keyframes tdIn { from { opacity: 0; transform: translateX(-8px); } }
.td-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; }
.td-ct { font-size: 15px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; } .td-ct.up { color: var(--up); } .td-ct.down { color: var(--down); }
.td-mkt { color: var(--ink-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.td-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 0; }
.td-kv div { display: grid; gap: 1px; } .td-kv dt { font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-4); } .td-kv dd { margin: 0; font-size: 14px; font-weight: 500; }
.td-prog { height: 2px; background: var(--bg-3); border-radius: 2px; overflow: hidden; } .td-prog i { display: block; height: 100%; background: var(--accent); transition: width .9s linear; }
.td-foot { display: flex; align-items: center; gap: 8px; min-height: 24px; } .td-st { font-size: 11.5px; font-weight: 600; } .td-st.dim { color: var(--ink-3); font-weight: 500; }
.td-sell { margin-left: auto; }
.td-result .td-res { display: flex; align-items: baseline; justify-content: space-between; }
.td-result .td-rs { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.td-result .td-res b { font-size: 20px; font-weight: 600; }
.td-result.won { box-shadow: inset 2px 0 0 var(--up); } .td-result.won .td-rs { color: var(--up); }
.td-result.lost { box-shadow: inset 2px 0 0 var(--down); } .td-result.lost .td-rs { color: var(--down); }

/* right trade panel: one continuous column, hairline separators, no cards */
.side { border-left: 1px solid var(--line); background: var(--bg); }
.side-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex: none; }
.seg-tabs { display: grid; grid-template-columns: 1fr 1fr; flex: 1; gap: 2px; padding: 2px; border-radius: var(--r); background: rgba(255,255,255,.025); border: 0; }
.seg-tabs .tab { justify-content: center; padding: 0; height: 30px; border-radius: 4px; font: 600 11.5px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.seg-tabs .tab.on { background: var(--bg-3); color: var(--ink); } .seg-tabs .tab.on::after { display: none; }
.side .ctx { padding: 0; border: 0; flex: none; gap: 6px; flex-wrap: nowrap; box-shadow: none; }
.side .ctx .ctx-k { font-size: 10.5px; letter-spacing: .12em; }
.side .ctx .pill { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .sec { padding: 14px; gap: 10px; }
.side .sec-h .label, .side .pair .label { color: var(--ink-3); }
/* contract family selector: one compact control showing the ACTIVE family. Its floating drawer is family-first:
   the family list; one click selects a family. Absolute: it overlays a
   small area of the ticket under the selector and never moves the layout. */
.ct-fam-wrap { position: relative; justify-self: start; min-width: 0; max-width: 100%; }
.ct-fam, .cd-fam { -webkit-tap-highlight-color: transparent; }
.ct-fam { display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 176px; max-width: 100%; height: 34px; padding: 0 10px 0 12px; border-radius: var(--r);
  border: 1px solid var(--line-2); color: var(--ink); font: 700 11.5px var(--sans); letter-spacing: .05em; text-transform: uppercase; transition: border-color .15s var(--ease); }
.ct-fam:hover, .ct-fam.open { border-color: rgba(31,209,196,.45); }
.ct-fam:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(31,209,196,.18); }
.cf-chev { width: 14px; height: 14px; fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .16s var(--ease); flex: none; }
.ct-fam.open .cf-chev { transform: rotate(180deg); }
.ct-drawer { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; width: max(100%, 224px); max-width: min(260px, calc(100vw - 28px)); padding: 4px; border-radius: 8px; background: var(--bg-2);
  box-shadow: 0 0 0 1px var(--line-2), 0 18px 40px -12px rgba(0,0,0,.7); animation: popIn .14s var(--ease); max-height: min(62vh, 300px); overflow-y: auto; overscroll-behavior: contain; }
.ct-drawer[hidden] { display: none; }
.cd-fam { display: flex; align-items: center; gap: 6px; width: 100%; height: 32px; padding: 0 8px 0 10px; border-radius: 5px; color: var(--ink-2); text-align: left; transition: background-color .12s var(--ease), color .12s var(--ease); }
.cd-fam .cd-f { flex: 1; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-fam:hover, .cd-fam:focus-visible { background: var(--hover); color: var(--ink); outline: none; }
.cd-fam:focus-visible { box-shadow: inset 0 0 0 1px rgba(31,209,196,.5); }
.cd-fam.on { background: var(--sel); color: var(--accent); }
.cd-k { font-style: normal; font-size: 11px; flex: none; }
@media (hover: none) { .cd-fam { height: 40px; } } /* touch targets */
.terms { gap: 8px; } .terms .field > span em { font-style: normal; color: var(--ink-4); font-size: 10.5px; margin-left: 4px; }
.pred-line { display: grid; gap: 6px; grid-auto-flow: row; justify-content: stretch; }
.pred-line > span { font-size: 11.5px; color: var(--ink-3); }
.pred-row { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; }
.pred-row button { height: 28px; border-radius: 4px; font: 600 12.5px var(--mono); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.pred-row button:hover:not(:disabled) { color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.pred-row button.on { color: var(--accent-ink); background: var(--accent); box-shadow: none; }
/* paired values: STAKE | PAYOUT, TARGET PROFIT | TARGET LOSS */
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; }
.pair > .pair-a { padding-right: 12px; } .pair > .pair-b { padding-left: 12px; border-left: 1px solid var(--line); }
.pair .field { gap: 6px; } .pair .field > span.label { font-size: 10px; }
.pair input { width: 100%; min-width: 0; height: 36px; font-size: 15px; font-weight: 600; }
.payout, .pair-b.payout { display: grid; grid-template-columns: 1fr; gap: 2px; align-content: start; padding-top: 0; }
.payout > .label { font-size: 10px; margin-bottom: 4px; }
.payout > b, .pair-a > b { font-size: 18px; font-weight: 600; line-height: 1.25; }
.pay-ret { font-size: 11.5px; } .pay-ret b { font-weight: 600; }
.pair > div.pair-a { display: grid; gap: 2px; align-content: start; } .pair > div.pair-a > .label { font-size: 10px; margin-bottom: 4px; }
.quick { gap: 4px; } .quick button { height: 24px; box-shadow: inset 0 0 0 1px var(--line); }
.tgt-host .tgt-pair input { font-size: 13.5px; height: 32px; }
.tgt-line { gap: 4px 8px; }
.tgt-line .btn { height: 24px; padding: 0 9px; font-size: 11px; }
/* selected contract + execute */
.exec { padding-top: 2px; } .exec:empty { display: none; }
.notice { padding: 8px 10px; font-size: 11.5px; }
/* Auto */
.ai-top { gap: 10px; }
.ai-acct { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ai-head { gap: 10px; } .ai-state b { font-size: 13.5px; } 
.kvs.kv2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 14px; }
.kvs.kv2 .kv { flex-direction: column; gap: 1px; padding: 4px 0; border-bottom: 0; } .kvs.kv2 .kv > span:first-child { font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; }
.kvs.kv2 .kv b { text-align: left; font-size: 12.5px; }
details.why > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
details.why > summary::-webkit-details-marker { display: none; }
details.why > summary svg { color: var(--ink-3); transition: transform .2s; } details.why[open] > summary svg { transform: rotate(180deg); }
details.why[open] { gap: 8px; }
.ai-empty { padding: 2px 0; }
.rec-line b { font-size: 12.5px; }
.adm-bar { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
.rec-pending { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 0 8px; border-bottom: 1px solid var(--line); }
.rec-pending .mono { flex-basis: 100%; color: var(--ink-3); }
.sel-ct { display: grid; align-content: center; justify-items: center; gap: 4px; min-height: 88px; padding: 16px 12px; border-radius: var(--r); font-size: 12px; text-align: center; color: #fff; border: 1px solid transparent; }
.sel-ct b { font-size: 17px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #fff; }
.sel-ct span { color: rgba(255,255,255,.88); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sel-ct.up, .sel-ct.down { background: var(--side); border-color: var(--side-lo); color: #fff !important; } /* beats the .up/.down text utilities */
.ai-exec { gap: 8px; } .ai-exec .ai-actions .btn { height: 40px; } #aiMore { justify-self: start; color: var(--ink-3); }

/* ── tablet ── */
@media (max-width: 1279px) and (min-width: 768px) {
  :root { --side: 300px; --ld: 300px; }
  .top .brand span { display: none; }
  .acct-opt { padding: 0 7px; gap: 6px; }
  .cb-mkt { max-width: 38%; }
}
@media (max-width: 1023px) and (min-width: 768px) { .acct-opt:not(.on) b { display: none; } .tf-btn { padding: 0 6px 0 8px; } }

/* tablet: the compact navigation exposes only Trade and Positions; Auto stays inside Trade */
@media (max-width: 1023px) and (min-width: 768px) {
  .term { grid-template-columns: 1fr; grid-template-rows: var(--top) 38vh minmax(0, 1fr) 54px; grid-template-areas: "top" "chartv" "main" "nav"; }
  .markets { display: none; }
  .center { grid-area: main; display: none; }
  .side { grid-area: main; border-left: 0; display: none; }
  .term[data-view=positions] .center, .term[data-view=markets] .center { display: grid; grid-area: main; }
  .term[data-view=trade] .center, .term[data-view=auto] .center { display: grid; grid-area: chartv; border-bottom: 1px solid var(--line); }
  .term[data-view=trade] .side, .term[data-view=auto] .side { display: flex; }
  .term[data-view=markets] #markets { transform: none; visibility: visible; top: var(--cbh); width: 100%; box-shadow: none; border-right: 0; }
  .term[data-view=positions] #dock { transform: none; visibility: visible; top: var(--cbh); width: 100%; box-shadow: none; border-right: 0; }
  .term[data-view=trade] .side-head .seg-tabs, .term[data-view=auto] .side-head .seg-tabs { display: grid; }
  .chart-bar { padding: 0 6px; gap: 6px; }
  .cb-mkt { max-width: 38%; }
  .center > .digits { border-top: 0; padding-top: 4px; }
  .dock-nav { display: none; }
  .mnav { grid-area: nav; display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); background: var(--bg); padding-bottom: env(safe-area-inset-bottom); }
  .mnav button { color: var(--ink-3); font-size: 11.5px; font-weight: 500; position: relative; }
  .mnav button.on { color: var(--ink); }
  .mnav button.on::before { content: ""; position: absolute; top: -1px; left: 30%; right: 30%; height: 1px; background: var(--accent); }
}

/* ── phone: chart priority; views via the bottom navigation; Active trade = compact bottom sheet ── */
@media (max-width: 767px) {
  .term { grid-template-columns: 1fr; grid-template-rows: var(--top) minmax(0, 1fr) 54px; grid-template-areas: "top" "main" "nav"; }
  .top { gap: 6px; padding: 0 8px 0 12px; } .top .brand span, #stFeed { display: none; }
  .acct-opt { gap: 6px; padding: 0 7px; } .acct-opt:not(.on) b, .acct-st { display: none; }
  .acct-switch { margin-left: 2px; }
  .hbtn { min-width: 30px; padding: 0 6px; } .top { gap: 4px; } .acct-switch { margin-left: 0; } .top .brand { margin-right: 2px; }
  .center { grid-area: main; display: none; }
  .side { grid-area: main; border-left: 0; display: none; }
  .term[data-view=chart] .center, .term[data-view=markets] .center, .term[data-view=positions] .center { display: grid; }
  .term[data-view=trade] .side, .term[data-view=auto] .side { display: flex; }
  .term[data-view=trade], .term[data-view=auto] { grid-template-rows: var(--top) 34vh minmax(0, 1fr) 54px; grid-template-areas: "top" "chartv" "main" "nav"; }
  .term[data-view=trade] .center, .term[data-view=auto] .center { display: grid; grid-area: chartv; border-bottom: 1px solid var(--line); }
  .term[data-view=trade] .side-head .seg-tabs, .term[data-view=auto] .side-head .seg-tabs { display: grid; }
  .side-head { padding: 8px 12px; justify-content: flex-end; }
  .chart-bar { padding: 0 6px; gap: 8px; } .cb-mkt { max-width: 44%; } .cb-mkt b { font-size: 14px; } .cb-quote b { font-size: 14px; } .cb-quote .sm { font-size: 11px; }
  .dock-nav { display: none; }
  .center { grid-template-rows: var(--cbh) minmax(0, 1fr) auto; }
  .center > .digits { border-top: 0; }
  .center > .digits .dg-sec { gap: 4px; padding: 4px 6px 6px; }
  .center > .digits .dg-row { gap: 3px; }
  .center > .digits .dg { width: clamp(22px, calc((100cqw - 64px) / 10.6), 44px); }
  .term[data-view=trade] .center > .digits .dg .dg-pct, .term[data-view=auto] .center > .digits .dg .dg-pct { display: none; }
  /* Markets / workspace = full views under the chart header */
  .ldrawer { top: var(--cbh); width: 100%; box-shadow: none; border-right: 0; transition: none; }
  .term[data-view=markets] #markets, .term[data-view=positions] #dock { transform: none; visibility: visible; }
  .term[data-view=markets] #markets .ld-x, .term[data-view=positions] #dock .ld-x { display: none; }
  /* Active trade: bottom sheet (never a full-screen desktop drawer) */
  #tradeDrawer { top: auto; bottom: 0; height: auto; max-height: 62%; border-top: 1px solid var(--line-2); border-radius: 12px 12px 0 0; transform: translateY(104%); transition: transform .24s var(--ease), visibility 0s linear .24s; }
  #tradeDrawer.open { transform: none; transition: transform .24s var(--ease), visibility 0s; }
  .term:not([data-view=chart]) #tradeDrawer { display: none; }
  .mnav { grid-area: nav; display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); background: var(--bg); padding-bottom: env(safe-area-inset-bottom); }
  .mnav button { color: var(--ink-3); font-size: 11.5px; font-weight: 500; position: relative; }
  .mnav button.on { color: var(--ink); } .mnav button.on::before { content: ""; position: absolute; top: -1px; left: 30%; right: 30%; height: 1px; background: var(--accent); }
  .hpop, .hpop.wide { position: fixed; top: calc(var(--top) + 6px); left: 8px; right: 8px; width: auto; }
}
@media (prefers-reduced-motion: reduce) { .ldrawer, #tradeDrawer, .td-card, .td-prog i { transition: none !important; animation: none !important; } }
/* a left drawer is open: keep the floating digits fully visible in the uncovered part of the chart */
@media (min-width: 768px) {
  .chart-wrap .digits { transition: left .24s var(--ease); }
  .term[data-ld] .chart-wrap .digits { left: calc(50% + min(var(--ld), 100% - 32px) / 2); max-width: calc(100% - min(var(--ld), 100% - 32px) - 16px); }
  .term[data-ld] .chart-wrap .dg { width: clamp(26px, calc((100cqw - var(--ld) - 110px) / 11), 48px); }
  .term[data-ld] .chart-wrap .dg .dg-pct { font-size: clamp(7.5px, 0.9cqw, 10px); }
}
.tgt-line .btn.ghost { padding: 0 6px; }
.ldrawer table.grid td:has(> .ct) { grid-column: 1 / -1; justify-content: flex-start; text-align: left; }
.ldrawer table.grid td:has(> .ct)::before { display: none; }
.ldrawer table.grid td:first-child:not(:has(> .ct)) { color: var(--ink-3); font-size: 11px; }
.ldrawer .ct > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; } .ldrawer .ct .xs { flex-basis: 100%; }
@media (max-width: 767px) {
  .hdr-tools { order: 0; margin-left: auto; } .top .grow { display: none; }
  
}

/* ── Cashier: header Deposit/Withdraw + drawer view (cashier.js) ── */
.cbtn { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 9px; border-radius: var(--r); border: 1px solid var(--line-2); color: var(--ink-2); font-size: 12px; font-weight: 500; white-space: nowrap; transition: color .15s var(--ease), border-color .15s var(--ease); }
.cbtn:hover { color: var(--ink); border-color: var(--ink-3); }
.cbtn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cbtn.dep { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.cbtn.dep:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--accent-ink); }
#btnDeposit { margin-left: 6px; }
.cs-tabs { display: grid; grid-template-columns: repeat(3, 1fr); flex: none; margin: 10px 16px 0; }
.cs-b { padding: 0 16px 16px; }
.cs-bal { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding: 14px 0 10px; border-bottom: 1px solid var(--line); }
.cs-bal .label { color: var(--ink-3); } .cs-bal b { font-size: 20px; font-weight: 600; } .cs-sub { flex-basis: 100%; color: var(--ink-3); font-size: 11.5px; }
.cs-sub:empty { display: none; }
.cs-sec { display: grid; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cs-sec:last-child { border-bottom: 0; }
.cs-sec .label { color: var(--ink-3); }
.cs-pm { margin: 0; }
.cs-chips { margin-top: -2px; }
.cs-min { margin: -2px 0 0; }
.cs-go { width: 100%; height: 36px; }
.cs-quote, .cs-next { font-size: 12px; color: var(--ink-2); }
.cs-addr { margin-top: 4px; word-break: break-all; font-size: 11.5px; color: var(--ink); }
.cs-tag { justify-self: start; font-size: 11px; color: var(--warn); }
.cs-status .btn { justify-self: start; }
.cs-line { margin: 0; color: var(--ink-2); font-size: 12.5px; }
.cs-hist { width: 100%; margin-top: 6px; } .cs-hist td { padding: 7px 4px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 12px; }
.cs-b .form-error:empty { display: none; }
@media (max-width: 1023px) { .cbtn span { display: none; } .cbtn { padding: 0 7px; } }
@media (max-width: 767px) { #btnWithdraw { display: none; } #btnDeposit { margin-left: 0; height: 30px; } }
@media (max-width: 420px) {
  .top { gap: 2px; padding-right: 6px; } .acct-opt { padding: 0 5px; gap: 5px; }
  .top .hbtn { min-width: 28px; padding: 0 4px; } #btnDeposit { height: 28px; padding: 0 6px; } .avatar { flex: none; }
}
@media (max-width: 380px) {
  .top { padding-left: 8px; } .top .brand { display: none; }
  .acct-opt { padding: 0 4px; gap: 4px; } .acct-opt b { font-size: 11px; } .hdr-tools { gap: 0; }
}

/* ═════ Chart workspace + dashboard refinement (live marker, tool rail, zoom, account selector, Accounts & wallets, theme) ═════ */
/* top chart toolbar: market · quote · feed | timeframe + zoom | workspace */
.cb-zoom { display: inline-flex; align-items: center; gap: 0; flex: none; height: 30px; border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line-2); }
.cb-zoom .zb { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; color: var(--ink-2); border-radius: var(--r); transition: background-color .12s var(--ease), color .12s var(--ease); }
.cb-zoom .zb + .zb { box-shadow: inset 1px 0 0 var(--line-2); border-radius: 0 var(--r) var(--r) 0; } .cb-zoom .zb:first-child { border-radius: var(--r) 0 0 var(--r); }
.cb-zoom .zb:hover { background: var(--hover); color: var(--ink); } .cb-zoom svg { width: 14px; height: 14px; }
.tfpop { flex: none; }
.chart-bar .tfpop { margin-left: 2px; } .chart-bar .cb-zoom { margin-left: -6px; }

/* floating tool rail (left, inside the chart): icons only, name on hover — disappears the moment the pointer leaves */
.chart-rail { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); z-index: 5; display: flex; flex-direction: column; gap: 2px; padding: 3px;
  border-radius: 8px; background: color-mix(in srgb, var(--bg-2) 82%, transparent); backdrop-filter: blur(6px); box-shadow: 0 0 0 1px var(--line); }
.rail-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px; color: var(--ink-3); transition: background-color .12s var(--ease), color .12s var(--ease); }
.rail-btn:hover, .rail-btn[aria-expanded=true] { color: var(--ink); background: var(--hover); }
.rail-btn.on { color: var(--accent); } .rail-btn svg { width: 16px; height: 16px; }
.rail-btn[data-rtip]::after { content: attr(data-rtip); position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%); padding: 4px 8px; border-radius: 4px; white-space: nowrap;
  background: var(--bg-3); color: var(--ink); font: 500 11px var(--sans); box-shadow: 0 0 0 1px var(--line-2); pointer-events: none; display: none; z-index: 7; }
.rail-btn[data-rtip]:hover::after { display: block; } /* no delay, no fade: shown only while hovered */
.rail-btn[aria-expanded=true]::after { display: none !important; }
.rail-pop { position: absolute; left: 46px; z-index: 6; min-width: 200px; max-width: calc(100% - 60px); padding: 6px; border-radius: 8px; background: var(--bg-2);
  box-shadow: 0 0 0 1px var(--line-2), 0 18px 40px -12px rgba(0,0,0,.6); animation: popIn .12s var(--ease); display: grid; gap: 2px; }
.rp-h { padding: 6px 8px 2px; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.rp-seg { margin: 2px 6px 4px; display: grid; grid-template-columns: 1fr 1fr; }
.rp-note { padding: 0 8px 4px; font-size: 11px; color: var(--ink-3); }
.rp-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 8px; font-size: 12.5px; color: var(--ink-2); border-radius: 5px; }
.rp-row:hover { background: var(--hover); }
.rp-item { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 5px; font-size: 12.5px; color: var(--ink-2); text-align: left; }
.rp-item:hover:not(:disabled), .rp-item:focus-visible { background: var(--hover); color: var(--ink); outline: none; }
.rp-item.on { color: var(--accent); background: var(--sel); } .rp-item svg { width: 15px; height: 15px; } .rp-n { margin-left: auto; color: var(--ink-3); font-size: 11px; }
.chart-wrap canvas.drawing { cursor: copy; }
.chart-tools { left: auto; right: 82px; bottom: 34px; } /* Live / history note: bottom-right, clear of the rail and the digits */

/* header account selector: only the active account; the menu lists Demo and Live */
.acct-switch { position: relative; padding: 0; border: 0; gap: 0; }
.acct-cur { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px 0 10px; border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line-2); white-space: nowrap; transition: background-color .12s var(--ease), box-shadow .12s var(--ease); }
.acct-cur:hover, .acct-cur[aria-expanded=true] { background: var(--hover); box-shadow: inset 0 0 0 1px var(--ink-4); }
.acct-cur b { font-weight: 600; font-size: 12.5px; color: var(--ink); }
.acct-cur[data-cur=live] { box-shadow: inset 0 0 0 1px var(--line-2), inset 0 -1px 0 var(--accent); }
.acct-chev { width: 13px; height: 13px; color: var(--ink-3); transition: transform .16s var(--ease); } .acct-cur[aria-expanded=true] .acct-chev { transform: rotate(180deg); }
.acct-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 80; min-width: 100%; width: max-content; padding: 4px; display: grid; gap: 2px; border-radius: 8px; background: var(--bg-2);
  box-shadow: 0 0 0 1px var(--line-2), 0 18px 40px -12px rgba(0,0,0,.6); animation: popIn .12s var(--ease); }
.acct-pop .acct-opt { justify-content: flex-start; height: 34px; padding: 0 10px; border-radius: 5px; gap: 10px; }
.acct-pop .acct-opt b { margin-left: auto; padding-left: 14px; }
.acct-pop .acct-opt:hover, .acct-pop .acct-opt:focus-visible { background: var(--hover); outline: none; }
.acct-pop .acct-opt[aria-checked=true] { background: var(--bg-3); } .acct-pop .acct-opt[aria-checked=true] b { color: var(--ink); }
#acctLive.on { box-shadow: none; }
.acct-pop .acct-st { display: inline !important; }

/* Accounts & wallets / Settings drawer: open sections, hairline separators, compact tables */
.aw .aw-sec { gap: 10px; }
.aw-sub { display: grid; gap: 8px; padding-top: 10px; margin-top: 4px; border-top: 1px solid var(--line); }
.aw-sub .live-panel { display: grid; gap: 8px; }
.aw-scroll { overflow-x: auto; margin: 0 -2px; padding: 0 2px; }
.aw-table { width: 100%; min-width: 360px; } .aw-table th { padding: 4px 6px; position: static; background: none; } .aw-table th:first-child { padding-left: 0; }
.aw-table td { vertical-align: top; } .aw-methods { min-width: 0; }
.aw-empty { padding: 2px 0; }
/* grid children default to min-width:auto, which let wide tables push the whole drawer sideways: let them shrink and wrap
   long cells so the tables fit the drawer (any remaining excess scrolls inside .aw-scroll, never the drawer body) */
.aw > .aw-sec > *, .aw-sub > *, .aw .sec-h { min-width: 0; }
.aw table.grid td { white-space: normal; } .aw table.grid td.r.mono { white-space: nowrap; }
.aw table.grid td.xs.mono, .aw table.grid td .mono.dim, .aw table.grid td .dim.xs.mono { overflow-wrap: anywhere; } /* long IDs / references only */
.aw table.grid td .acct-type, .aw table.grid td .btn, .aw #acctOverview .pill { white-space: nowrap; }
.aw-table td .pill { white-space: normal; text-align: left; line-height: 1.35; }
.aw-table td.nowrap { min-width: 64px; }
.aw table.grid td { padding: 7px 6px; } .aw table.grid td:first-child { padding-left: 0; } .aw table.grid td:last-child { padding-right: 0; }
@media (max-width: 480px) { .aw-table th { font-size: 9px; letter-spacing: .03em; } .aw-table [data-col=type] .aw-kind { font-size: 11.5px; } .aw-table [data-col=date], .aw-table [data-col=type] .dim { font-size: 10.5px; } .aw-table .pill { letter-spacing: .03em; padding: 1px 5px; } .aw table.grid td, .aw-table th { padding: 6px 4px; } .aw-table td.nowrap, .aw-table td.xs.mono { min-width: 0; } .aw-table { min-width: 0; } }
@media (max-width: 380px) { .aw table.grid td, .aw-table th { padding: 6px 3px; } .aw-table .pill { letter-spacing: .02em; padding: 1px 4px; } .aw-table th { letter-spacing: .02em; } }
.aw-acts { display: flex; flex-wrap: wrap; gap: 2px 6px; margin-top: 4px; } .aw-acts .btn { height: 22px; padding: 0 6px; margin-left: -6px; }
.aw-table td.xs.mono { word-break: break-all; min-width: 60px; }
.nowrap { white-space: nowrap; }
.aw-seg, .set-seg { display: inline-grid; grid-auto-flow: column; gap: 2px; padding: 2px; border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); }
.aw-seg button, .set-seg button { height: 24px; padding: 0 10px; border-radius: 4px; font-size: 11.5px; color: var(--ink-3); }
.aw-seg button.on, .set-seg button.on { color: var(--ink); background: var(--bg-3); }
.set-seg { justify-self: start; }
@media (max-width: 767px) { .aw-table { min-width: 300px; } .acct-pop { left: auto; right: 0; } }
@media (max-width: 420px) { .acct-cur { padding: 0 6px; gap: 6px; } .acct-cur b { font-size: 11.5px; } .acct-chev { display: none; } }
@media (max-width: 767px) { .chart-tools { right: 76px; bottom: 30px; } .cb-zoom .zb { width: 28px; } .chart-bar .cb-zoom { margin-left: -2px; } }

/* light theme (presentation only) */
html[data-theme=light] {
  color-scheme: light;
  --bg: #f5f6f8; --bg-2: #ffffff; --bg-3: #eaedf1; --hover: rgba(15,20,30,.045); --sel: rgba(11,148,136,.09);
  --line: rgba(15,20,30,.08); --line-2: rgba(15,20,30,.15);
  --up-a: rgba(14,159,103,.12); --down-a: rgba(220,48,72,.12);
  --ink: #151922; --ink-2: #3f4654; --ink-3: #697181; --ink-4: #9ba2ae;
  --accent: #0b9488; --accent-2: #0fa597; --accent-ink: #ffffff;
  --up: #0e9f67; --down: #dc3048; --warn: #b7791f; --info: #2f62d8;
}
html[data-theme=light] ::-webkit-scrollbar-thumb { background: rgba(15,20,30,.14); }
html[data-theme=light] .btn:hover:not(:disabled), html[data-theme=light] .acct:hover, html[data-theme=light] .dg-row.selectable .dg:hover { border-color: rgba(15,20,30,.25); }
html[data-theme=light] .grid tr:hover td { background: rgba(15,20,30,.025); }
html[data-theme=light] .seg-tabs { background: rgba(15,20,30,.03); }
html[data-theme=light] .tf-btn:hover, html[data-theme=light] .tf-btn[aria-expanded=true] { box-shadow: inset 0 0 0 1px rgba(15,20,30,.22); }
html[data-theme=light] .chart-tools { background: rgba(255,255,255,.85); }
html[data-theme=light] [data-tip]::after { background: #ffffff; }
html[data-theme=light] .chart-wrap .dg-sec { background: rgba(255,255,255,.78); }
html[data-theme=light] .dg { background: rgba(15,20,30,.02); }
html[data-theme=light] .menu, html[data-theme=light] .ct-drawer, html[data-theme=light] .hpop, html[data-theme=light] .tf-menu, html[data-theme=light] .rail-pop, html[data-theme=light] .acct-pop { box-shadow: 0 0 0 1px var(--line-2), 0 18px 40px -16px rgba(15,20,30,.25); }
html[data-theme=light] .toast { box-shadow: 0 10px 30px rgba(15,20,30,.15); }
/* short chart areas (phone Trade/Auto split view): the rail would cover the price or the digit row — it stays on the full Chart view */
@container (max-height: 300px) { .chart-rail, .rail-pop { display: none !important; } }
/* narrow chart bars (tablet portrait, phone): the zoom group must not squeeze the market name or overflow */
@media (max-width: 1023px) {
  .chart-bar { gap: 6px; }
  .chart-bar .cb-zoom { margin-left: 0; } .cb-zoom, .cb-zoom .zb { height: 28px; } .cb-zoom .zb { width: 24px; }
  .dock-nav { gap: 0; } .dock-nav .tab { padding: 0 6px; }
}
@media (max-width: 767px) { .chart-bar { gap: 4px; padding: 0 4px; } .cb-zoom .zb { width: 24px; } }
/* the right-most zoom tooltip is right-anchored so it never extends past the chart bar (same treatment as #btnDrawer) */
#chartZoomIn[data-tip]::after { left: auto; right: 0; transform: translateY(-2px); } #chartZoomIn[data-tip]:hover::after, #chartZoomIn[data-tip]:focus-visible::after { transform: none; }
/* Auto: your base stake + Martingale; recovery sequence & stop screens (round 28) */
.stake-in .seg { margin-top: 4px; }
.stake-opts { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; }
.stake-opts .mult { display: inline-flex; align-items: center; gap: 6px; } .stake-opts .mult input { width: 64px; height: 26px; font-size: 12.5px; }
.seq { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 5px; margin-top: 6px; font-size: 10.5px; letter-spacing: .04em; }
.seq .sq { display: inline-flex; align-items: baseline; gap: 4px; color: var(--ink-3); } .seq .sq b { font-size: 12px; color: var(--ink); letter-spacing: 0; }
.seq .sq.loss { color: var(--down); } .seq .sq.win { color: var(--up); } .seq .sq.active { color: var(--warn); } .seq .sq-a { color: var(--ink-3); font-style: normal; }
.rec-done, .rec-stop { display: grid; gap: 4px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.rec-done > b, .rec-stop > b { font-size: 11.5px; letter-spacing: .06em; } .rec-stop > b { color: var(--down); }
.rec-stop[data-reason="session_target_profit"] > b { color: var(--up); }

/* M-Pesa cashier dialog: same canonical cashier and APIs, presented as a focused modal. */
#scrim:not([hidden]) { background:rgba(3,8,16,.72); -webkit-backdrop-filter:blur(7px); backdrop-filter:blur(7px); }

/* Premium dashboard support mark and compact active-account context. */
.support-btn { gap: 6px; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent); }
.support-btn:hover, .support-btn[aria-expanded=true] { color: var(--accent-ink); background: var(--accent); box-shadow: 0 5px 16px color-mix(in srgb, var(--accent) 24%, transparent); }
.support-mark { width: 17px !important; height: 17px !important; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.support-label { font-size: 11px; font-weight: 700; letter-spacing: .05em; }
.acct-cur > .acct-type { display: inline-grid; place-items: center; width: 19px; height: 19px; border-radius: 6px; font-size: 11px; letter-spacing: .03em; color: var(--accent-ink); background: var(--info); box-shadow: 0 0 0 1px color-mix(in srgb, var(--info) 42%, transparent), 0 4px 12px color-mix(in srgb, var(--info) 18%, transparent); }
.acct-cur[data-cur=live] > .acct-type { background: var(--accent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 42%, transparent), 0 4px 12px color-mix(in srgb, var(--accent) 18%, transparent); }
@media (max-width: 767px) { .support-label { display: none; } }
.drawer[data-view="cashier"] { top:50%; right:auto; bottom:auto; left:50%; width:min(520px,calc(100vw - 32px)); max-height:min(820px,calc(100dvh - 40px)); transform:translate(-50%,-50%); border:1px solid rgba(125,164,205,.25); border-radius:12px; background:linear-gradient(155deg,#111d2c,#0b1320 72%); box-shadow:0 32px 100px rgba(0,0,0,.55); animation:cashier-pop .18s ease-out; }
@keyframes cashier-pop { from { opacity:0; transform:translate(-50%,-48%) scale(.985); } }
.drawer[data-view="cashier"] .cs-h { flex:none; min-height:68px; padding:15px 20px; border-bottom-color:rgba(139,173,211,.15); }
.drawer[data-view="cashier"] .cs-h #csTitle { display:block; color:#f2f7fc; font-size:17px; font-weight:650; letter-spacing:-.02em; }
.cs-head-sub { display:block; margin-top:2px; color:#8fa3b8; font-size:11px; letter-spacing:.04em; }
.drawer[data-view="cashier"] .cs-tabs { margin:10px 20px 0; }
.drawer[data-view="cashier"] .cs-b { padding:0 20px 18px; overflow:auto; }
.drawer[data-view="cashier"] .cs-bal { padding:14px 0 11px; }
.drawer[data-view="cashier"] .cs-bal b { color:#f3f8fc; }
.drawer[data-view="cashier"] .cs-sec { padding:13px 0; border-bottom-color:rgba(139,173,211,.12); }
.drawer[data-view="cashier"] .cs-sec .label { color:#d0deed; font-size:12px; }
.mpesa-identity { display:flex; align-items:center; gap:12px; min-height:45px; }
.mpesa-mark { display:grid; place-items:center; width:38px; height:38px; border-radius:10px; background:#55e0c1; color:#06241f; font-size:21px; font-weight:850; letter-spacing:-.1em; padding-right:3px; }
.mpesa-identity b { display:block; color:#f5fafc; font-size:14px; font-weight:700; }
.mpesa-identity small { display:block; color:#8fa3b8; font-size:11px; margin-top:1px; }
.drawer[data-view="cashier"] .field { gap:6px; }
.drawer[data-view="cashier"] .field > span { color:#aebed0; font-size:11px; }
.drawer[data-view="cashier"] #csDepPhoneInput,.drawer[data-view="cashier"] #csWdDest,.drawer[data-view="cashier"] #csDepAmt,.drawer[data-view="cashier"] #csWdAmt { min-height:44px; border:1px solid rgba(141,174,210,.22); border-radius:7px; background:#091321; color:#f3f8fc; padding:0 12px; font-size:15px; }
.drawer[data-view="cashier"] #csDepPhoneInput:focus,.drawer[data-view="cashier"] #csDepAmt:focus,.drawer[data-view="cashier"] #csWdAmt:focus { border-color:#31d6f2; outline:2px solid rgba(49,214,242,.18); }
.drawer[data-view="cashier"] #csWdDest { color:#b5c6d8; }
.drawer[data-view="cashier"] .cs-chips { margin-top:3px; }
.drawer[data-view="cashier"] .cs-go { min-height:46px; border-radius:7px; font-weight:700; font-size:14px; letter-spacing:.03em; background:#1976f3; border-color:#1976f3; color:#fff; }
.drawer[data-view="cashier"] .cs-go:hover:not(:disabled) { background:#3188fb; border-color:#3188fb; }
.drawer[data-view="cashier"] .cs-go:disabled { opacity:.52; }
.drawer[data-view="cashier"] .cs-next-title { margin-top:5px; color:#55e0c1; font-size:14px; font-weight:700; }
.drawer[data-view="cashier"] .cs-quote { padding:10px 0; border-top:1px solid rgba(139,173,211,.12); border-bottom:1px solid rgba(139,173,211,.12); color:#c5d3e1; }
.drawer[data-view="cashier"] .cs-status { padding:14px; border:1px solid rgba(85,224,193,.23); border-radius:8px; background:rgba(85,224,193,.045); margin-top:8px; }
.drawer[data-view="cashier"] .cs-hist { margin-top:10px; }
.drawer[data-view="cashier"] .cs-hist td { padding:10px 5px; }
@media(max-width:600px) {
 .drawer[data-view="cashier"] { top:auto; left:0; bottom:0; width:100vw; max-height:calc(100dvh - env(safe-area-inset-top)); height:auto; border-radius:15px 15px 0 0; border-bottom:0; transform:none; padding-bottom:env(safe-area-inset-bottom); animation:cashier-sheet .2s ease-out; }
 @keyframes cashier-sheet { from { opacity:0; transform:translateY(14px); } }
 .drawer[data-view="cashier"] .cs-h { padding:14px 16px; }
 .drawer[data-view="cashier"] .cs-b { padding:0 16px 16px; }
 .drawer[data-view="cashier"] .cs-tabs { margin-left:16px; margin-right:16px; }
}
@media(prefers-reduced-motion:reduce) { .drawer[data-view="cashier"] { animation:none; } }

/* Provider-sourced Live quote review — terms and readiness are server-issued, never derived from the Deriv preview. */
.live-quote-details { margin-top: 12px; padding: 12px 14px; border: 1px solid rgba(72, 180, 220, .24); border-radius: 12px; background: rgba(9, 24, 38, .52); }
.live-quote-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #dff8ff; font-size: 12px; }
.live-quote-head > span { color: var(--muted, #9aabba); font-size: 11px; }
.live-quote-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; padding: 12px 0 5px; }
.live-quote-grid > div { min-width: 0; display: grid; gap: 3px; }
.live-quote-grid small { color: var(--muted, #9aabba); font-size: 10px; }
.live-quote-grid b { color: var(--text, #f2f7fb); font: 600 12px var(--mono, monospace); overflow-wrap: anywhere; }
.live-quote-details .hint { margin: 8px 0; font-size: 10px; }
.live-checks { display: grid; gap: 5px; margin-top: 8px; }
.live-check { display: grid; grid-template-columns: 80px 1fr; gap: 8px; font-size: 10px; line-height: 1.4; }
.live-check b { color: #7ee1b3; }
.live-check.failed b, .live-check.unavailable b { color: #ff9eaa; }
.live-check.warning b, .live-check.not.verified b { color: #ffd58a; }
@media (max-width: 540px) {
  .live-quote-details { padding: 10px; }
  .live-quote-grid { gap: 9px; }
  .live-quote-grid b { font-size: 11px; }
  .live-check { grid-template-columns: 72px 1fr; }
}
.live-exec-timeline { display: grid; gap: 2px; margin: 10px 0; }
.exec-stage { display: grid; grid-template-columns: 102px minmax(115px, .8fr) minmax(120px, 2fr); align-items: baseline; gap: 8px; padding: 6px 0; border-bottom: 1px solid rgba(137, 162, 181, .12); }
.exec-stage b { color: #91a5b5; font: 700 9px var(--mono, monospace); letter-spacing: .04em; }
.exec-stage > span { color: var(--text, #f2f7fb); font-size: 10px; }
.exec-stage small { color: var(--muted, #9aabba); font-size: 9px; overflow-wrap: anywhere; }
.exec-stage.passed b { color: #7ee1b3; }
.exec-stage.failed b { color: #ff9eaa; }
.exec-stage.unknown b { color: #ffd58a; }
@media (max-width: 540px) { .exec-stage { grid-template-columns: 74px 1fr; gap: 4px 7px; } .exec-stage small { grid-column: 2; } }

/* Premium trading ticket: keep account context in the top bar, not beside Manual/Auto. */
.side .ctx { display: none; }

/* Keep the contract selector functional while removing redundant dashboard clutter. */
#tPayout { display: none !important; }
#aiRecovery, #aiSelected, #aiScanner, #aiMore, #aiHint { display: none !important; }
#aiStakeIn .stake-opts { display: none !important; }

/* Compact, high-contrast trade actions for Manual and Auto. */
.buy-btn { min-height: 60px; padding: 10px 9px; }
.buy-btn .bt { font-size: 14px; }
.buy-btn .bs { min-height: 12px; font-size: 10.5px; }
.ai-exec .ai-actions .btn { height: 32px; min-height: 32px; padding: 0 10px; font-size: 10.5px; }
.sel-ct { min-height: 56px; padding: 10px; }
.sel-ct b { font-size: 14px; }

/* Dim semantic colours: On/Take Profit = green, Off/Stop Loss = red. */
#aiMg [data-mg="1"] { color: rgba(46,189,133,.82); }
#aiMg [data-mg="0"] { color: rgba(246,70,93,.82); }
#aiMg [data-mg="1"].on { background: rgba(46,189,133,.18); color: var(--up); box-shadow: inset 0 0 0 1px rgba(46,189,133,.32); }
#aiMg [data-mg="0"].on { background: rgba(246,70,93,.16); color: var(--down); box-shadow: inset 0 0 0 1px rgba(246,70,93,.32); }
.tgt-pair .pair-a > span { color: rgba(46,189,133,.78); }
.tgt-pair .pair-b > span { color: rgba(246,70,93,.78); }
.tgt-pair .pair-a input:focus { border-color: rgba(46,189,133,.58); }
.tgt-pair .pair-b input:focus { border-color: rgba(246,70,93,.58); }

/* Compact premium AI action: a deep scan card with an always-visible live bot. */
.ai-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.deep-scan { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 5px 8px 5px 6px; border: 1px solid rgba(31,209,196,.26); border-radius: 9px; background: linear-gradient(135deg, rgba(31,209,196,.12), rgba(31,209,196,.025)); color: var(--ink); transition: border-color .16s var(--ease), background .16s var(--ease), transform .16s var(--ease); }
.deep-scan:hover:not(:disabled), .deep-scan.on { border-color: rgba(31,209,196,.62); background: linear-gradient(135deg, rgba(31,209,196,.2), rgba(31,209,196,.05)); transform: translateY(-1px); }
.deep-scan:disabled { opacity: .55; }
.deep-bot { position: relative; display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid rgba(31,209,196,.52); border-radius: 8px; background: rgba(4,28,31,.8); box-shadow: 0 0 0 3px rgba(31,209,196,.06); }
.deep-bot::before { content: ""; width: 10px; height: 8px; border: 1px solid var(--accent); border-radius: 4px; }
.deep-bot::after { content: ""; position: absolute; top: 3px; width: 5px; height: 2px; border-radius: 2px; background: var(--accent); box-shadow: 7px 0 var(--accent); }
.deep-bot i { position: absolute; bottom: 3px; width: 3px; height: 3px; border-radius: 50%; background: var(--up); box-shadow: 6px 0 var(--up); }
.deep-copy { display: grid; gap: 0; text-align: left; line-height: 1.05; }
.deep-copy b { font-size: 10.5px; letter-spacing: .11em; }
.deep-copy small { color: var(--ink-3); font-size: 9px; margin-top: 3px; }
.deep-live { color: var(--up); font: 700 9px var(--mono); letter-spacing: .08em; padding-left: 4px; }
.deep-live::before { content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 4px 1px 0; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 3px rgba(46,189,133,.12); }

/* ── flat premium dashboard seams: no hard card or border between workspace, digits, and trade panel ── */
.center, .side { border: 0; box-shadow: none; }
.center > .digits { border: 0; background: transparent; box-shadow: none; }
.side { background: transparent; }
.side-head, .side .sec { border-bottom-color: transparent; background: transparent; }
.term[data-view=trade] .center, .term[data-view=auto] .center { border-bottom: 0; }

/* ── working-space atmosphere: restrained depth behind the live chart ── */
.chart-wrap {
  background:
    radial-gradient(circle at 78% 44%, rgba(31, 209, 196, .075) 0, rgba(31, 209, 196, .028) 24%, transparent 58%),
    linear-gradient(135deg, #0b1422 0%, #070c15 48%, #03060b 100%);
  isolation: isolate;
}
.chart-wrap::before {
  content: "LIVE MARKET";
  position: absolute;
  inset: 50% 0 auto;
  transform: translateY(-50%);
  z-index: 0;
  pointer-events: none;
  color: rgba(146, 190, 208, .035);
  font: 700 clamp(42px, 8vw, 116px)/1 var(--sans);
  letter-spacing: .18em;
  text-align: center;
  white-space: nowrap;
  user-select: none;
}
.chart-wrap canvas { z-index: 1; }

/* ── Binary.Trade mobile dashboard refinement v1 ── */
@media (max-width: 767px) {
  /* Give the chart priority while retaining a scrollable trade ticket. */
  .term[data-view=trade],
  .term[data-view=auto] {
    grid-template-rows: var(--top) minmax(285px, 38vh) minmax(0, 1fr) calc(54px + env(safe-area-inset-bottom));
  }

  /* Restore the existing Manual / Auto selector on phones. */
  .term[data-view=trade] .side-head,
  .term[data-view=auto] .side-head {
    display: flex;
    min-height: 42px;
    padding: 5px 12px;
    justify-content: stretch;
    border-bottom: 1px solid var(--line);
  }
  .term[data-view=trade] .side-head .seg-tabs,
  .term[data-view=auto] .side-head .seg-tabs {
    display: grid;
    flex: 1;
    gap: 3px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg-2);
  }
  .side-head .seg-tabs .tab {
    height: 30px;
    font-size: 11px;
    letter-spacing: .06em;
  }
  .side-head .seg-tabs .tab.on {
    color: var(--accent);
    background: var(--bg-3);
  }

  /* Compact existing ticket sections without hiding their controls. */
  .side-body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .side .sec {
    padding: 8px 12px;
    gap: 7px;
  }
  .side #liveGate,
  .side #tFamily,
  .side #tgtTrade {
    padding-top: 7px;
    padding-bottom: 7px;
  }
  .side .live-panel { gap: 5px; }
  .side #tStakeSec { gap: 7px; }
  .side .ct-fam { min-width: 160px; height: 32px; }
  .side .tgt-pair { gap: 8px; }
  .side .tgt-pair .field { gap: 4px; }
  .side .tgt-pair input { height: 32px; font-size: 13px; }
  .side .tgt-line { gap: 4px 6px; }
  .side .tgt-line .btn { height: 24px; padding: 0 7px; font-size: 10px; }
  .side #tStakeSec .quick button { height: 28px; }

  /* Keep the existing Even / Odd trade buttons prominent and usable. */
  .side #tSideSec { padding-top: 8px; padding-bottom: 10px; }
  .side .buy { gap: 8px; }
  .side .buy-btn {
    min-height: 60px;
    padding: 8px;
    border-radius: 8px;
  }
  .side .buy-btn .bt { font-size: 14px; }
  .side .buy-btn .bs { font-size: 10px; }

  /* Show the existing live digit percentages, as in the reference. */
  .term[data-view=trade] .center > .digits .dg .dg-pct,
  .term[data-view=auto] .center > .digits .dg .dg-pct {
    display: block;
    line-height: 1.1;
  }
  .center > .digits .dg-sec { padding: 5px 6px 6px; }
  .center > .digits .dg-row { padding-top: 3px; }
}

@supports (height: 1svh) {
  @media (max-width: 767px) {
    .term[data-view=trade],
    .term[data-view=auto] {
      grid-template-rows: var(--top) minmax(285px, 38svh) minmax(0, 1fr) calc(54px + env(safe-area-inset-bottom));
    }
  }
}

/* Mobile: prioritize the chart working space */
@media (max-width: 767px) {
  .term[data-view=trade],
  .term[data-view=auto] {
    grid-template-rows: var(--top) minmax(320px, 50vh) minmax(0, 1fr) calc(54px + env(safe-area-inset-bottom));
  }
}

@supports (height: 1svh) {
  @media (max-width: 767px) {
    .term[data-view=trade],
    .term[data-view=auto] {
      grid-template-rows: var(--top) minmax(320px, 50svh) minmax(0, 1fr) calc(54px + env(safe-area-inset-bottom));
    }
  }
}

/* Restore Manual / Auto tabs on mobile */
@media (max-width: 767px) {
  .term[data-view="trade"] .side-head,
  .term[data-view="auto"] .side-head {
    display: flex !important;
    visibility: visible !important;
    min-height: 42px;
    flex: 0 0 42px;
  }

  .term[data-view="trade"] #sideTabs,
  .term[data-view="auto"] #sideTabs {
    display: grid !important;
    visibility: visible !important;
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  #sideTabs > button {
    display: inline-flex !important;
    visibility: visible !important;
    justify-content: center;
    align-items: center;
  }
}

/* Auto terminal layout v1 — stake/scanner, targets/multiplier, execution actions */

/* Auto terminal layout v1 — stake/scanner, targets/multiplier, execution actions */
.ai-control-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  padding: 10px 12px;
}
#aiStakeIn {
  display: grid;
  align-content: start;
  gap: 9px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
#aiStakeIn .field, #aiMultiplier .field {
  display: grid;
  gap: 4px;
  min-width: 0;
}
#aiStakeIn .field input, #aiMultiplier .field input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 8px;
}
.ai-mg-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}
.ai-mg-control > .label { font-size: 10px; }
.ai-mg-control .seg {
  display: grid;
  grid-template-columns: repeat(2, minmax(34px, 1fr));
  gap: 2px;
  min-width: 76px;
  margin: 0;
}
.ai-mg-control .seg button { min-width: 34px; padding: 4px 7px; }

.ai-scan-column {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.ai-scan-column .sec-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-width: 0;
}
.ai-scan-column .sec-h .label { font-size: 9.5px; letter-spacing: .1em; }
.ai-scan-column #aiStateMeta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-scan-column .ai-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}
.ai-scan-column .deep-scan {
  width: 100%;
  min-height: 54px;
  justify-content: space-between;
  padding: 7px;
  gap: 5px;
}
.ai-scan-column .deep-copy b { font-size: 11px; }
.ai-scan-column .deep-live { color: var(--accent); font-size: 8px; }
.ai-scan-column .deep-live::before { background: var(--accent); }
.ai-scan-column .ai-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}
.ai-scan-column .ai-state > span {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 10px;
}
.ai-scan-column #aiRescan,
.ai-scan-column #aiSetup {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.ai-scan-column .ai-setup-empty,
.ai-scan-column .ai-setup-hero { padding: 5px 0; gap: 3px; }
.ai-scan-column #aiSetup * { overflow-wrap: anywhere; }

.ai-risk-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 8px;
  padding: 8px 12px;
}
.ai-risk-row #tgtAuto {
  grid-column: 1 / span 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.ai-risk-row #tgtAuto .tgt-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  min-width: 0;
}
.ai-risk-row #tgtAuto .field {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.ai-risk-row #tgtAuto .field > span,
.ai-risk-row #aiMultiplier .field > span { font-size: 9px; }
.ai-risk-row #tgtAuto .field input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 7px;
  font-size: 12px;
}
.ai-risk-row #tgtAuto .tgt-line {
  grid-column: 1 / -1;
  gap: 4px 5px;
  font-size: 9px;
}
.ai-risk-row #tgtAuto .tgt-line .btn {
  height: 22px;
  padding: 0 6px;
  font-size: 9px;
}
.ai-risk-row #tgtAuto .tgt-hit {
  grid-column: 1 / -1;
  font-size: 10px;
}
.ai-risk-row #aiMultiplier {
  grid-column: 3;
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.ai-risk-row #aiMultiplier .ai-mult-note {
  color: var(--ink-3);
  font-size: 9px;
  line-height: 1.2;
}
.ai-exec { gap: 0; padding: 8px 12px 10px; }
.ai-exec .ai-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}
.ai-exec .ai-actions .btn {
  width: 100%;
  min-width: 0;
  height: 40px;
  min-height: 40px;
  padding: 0 7px;
  font-size: 10px;
  letter-spacing: .03em;
}

/* Binary.Trade — Auto panel simplified information view */
#paneAuto #aiAcct,
#paneAuto .ai-scan-column > .sec-h,
#paneAuto #aiStateMeta,
#paneAuto #aiHead .ai-state,
#paneAuto #aiSetup,
#paneAuto #aiRecovery,
#paneAuto #aiSelected,
#paneAuto #aiMore,
#paneAuto .ai-engine {
  display: none !important;
}


/* Binary.Trade mobile terminal — clean trading layout */
@media (max-width: 767px) {
  #sideTabs > [data-side="auto"] { order: -1; }
  #sideTabs > [data-side="trade"] { order: 0; }
  #sideTabs [data-side="auto"].on {
    color:#10cfa0 !important;
    background:rgba(0,190,140,.13) !important;
    border-color:rgba(0,190,140,.25) !important;
  }
  #paneAuto .ai-control-row {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px; padding:12px 10px;
  }
  #paneAuto #aiStakeIn { display:grid; align-content:center; gap:4px; }
  #paneAuto #aiStakeIn .ai-base-field > span {
    color:var(--ink-3); font-size:10px; font-weight:700;
    letter-spacing:.12em; text-transform:uppercase;
  }
  #paneAuto #aiStakeIn .ai-base-field input {
    height:58px; min-height:58px; padding:0 12px;
    border-radius:11px; font-size:23px; font-weight:700;
  }
  #paneAuto .ai-mg-control { display:none !important; }
  #paneAuto .ai-scan-column { justify-content:center; gap:6px; }
  #paneAuto #aiHead .deep-scan {
    width:100%; min-height:76px; padding:10px; border-radius:13px;
    border:1px solid rgba(145,105,255,.42);
    background:linear-gradient(135deg,rgba(107,75,220,.24),rgba(48,31,91,.38));
  }
  #paneAuto #aiHead .deep-copy b { font-size:13px; }
  #paneAuto #aiHead .deep-copy small { font-size:10px; color:#a9a2c7; }
  #paneAuto #aiHead .deep-live { color:#b59aff; }
  #paneAuto #aiHead .deep-live::before { background:#a98aff; }
  #paneAuto #aiRescan { display:none !important; }

  #paneAuto .ai-risk-row {
    display:grid; grid-template-columns:repeat(3,minmax(0,1fr));
    gap:7px; padding:9px 10px;
  }
  #paneAuto .ai-risk-row #tgtAuto { grid-column:1 / span 2; }
  #paneAuto .ai-risk-row #tgtAuto .tgt-pair {
    grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px;
  }
  #paneAuto .ai-risk-row #aiMultiplier {
    display:grid !important; grid-column:3; min-width:0;
  }
  #paneAuto .ai-risk-row #tgtAuto .field > span,
  #paneAuto .ai-risk-row #aiMultiplier .field > span {
    font-size:9px; font-weight:700; letter-spacing:.06em;
    text-transform:uppercase;
  }
  #paneAuto .ai-risk-row #tgtAuto .pair-a .label { color:#12c99a; }
  #paneAuto .ai-risk-row #tgtAuto .pair-b .label { color:#ff587c; }
  #paneAuto .ai-risk-row #aiMultiplier .label { color:#efbd43; }
  #paneAuto .ai-risk-row #tgtAuto .field input,
  #paneAuto .ai-risk-row #aiMultiplier .field input {
    width:100%; min-width:0; height:48px; min-height:48px;
    padding:0 7px; border-radius:9px; font-size:16px; font-weight:700;
  }
  #paneAuto .ai-risk-row #aiMultiplier .ai-mult-note { display:none !important; }
  #paneAuto .ai-risk-row #tgtAuto .tgt-line {
    display:flex; justify-content:flex-end; gap:5px; margin-top:5px;
  }
  #paneAuto .ai-risk-row #tgtAuto .tgt-line > :not(.grow):not(button) {
    display:inline !important;
  }
  #paneAuto .ai-risk-row #tgtAuto .tgt-line .btn {
    height:23px; min-height:23px; padding:0 7px; font-size:9px;
  }
  #paneAuto .ai-exec { padding:9px 10px 12px; }
  #paneAuto .ai-exec .ai-actions {
    display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px;
  }
  #paneAuto .ai-exec .ai-actions .btn {
    width:100%; height:48px; min-height:48px;
    border-radius:9px; font-size:11px; font-weight:800;
  }
  #paneAuto #aiManual {
    color:#d8deea; background:#171d29; border:1px solid #30394a;
  }
  #paneAuto #aiAuto { color:#fff; background:#08b985; border-color:#08b985; }
}

/* Binary.Trade — final mobile terminal alignment */
@media (max-width: 767px) {
  #paneAuto .ai-control-row {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) !important;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
  }

  #paneAuto #aiStakeIn .ai-stake-stepper {
    display: grid;
    grid-template-columns: 42px 22px minmax(0, 1fr) 42px;
    align-items: center;
    min-width: 0;
    min-height: 58px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 5px / 6px;
    background: var(--panel, transparent);
  }
  #paneAuto #aiStakeIn .ai-stake-stepper button {
    height: 58px;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ink-2);
    font-size: 25px;
    font-weight: 500;
  }
  #paneAuto #aiStakeIn .ai-stake-currency {
    color: var(--ink-3);
    text-align: center;
    font-size: 17px;
  }
  #paneAuto #aiStakeIn .ai-stake-stepper input {
    width: 100%;
    min-width: 0;
    height: 56px;
    padding: 0 2px !important;
    border: 0 !important;
    border-radius: 0;
    background: transparent !important;
    text-align: center;
    font-size: 21px;
    font-weight: 700;
  }

  #paneAuto .ai-risk-row {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 7px;
    padding: 9px 10px;
  }
  #paneAuto .ai-risk-row #tgtAuto {
    grid-column: 1 / span 2;
  }
  #paneAuto .ai-risk-row #aiMultiplier {
    grid-column: 3;
  }
  #paneAuto .ai-risk-row .money-affix,
  #paneAuto .ai-risk-row .ai-prefix-input {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
  }
  #paneAuto .ai-risk-row .money-affix > span,
  #paneAuto .ai-risk-row .ai-prefix-input > span {
    position: absolute;
    z-index: 1;
    left: 9px;
    font-size: 15px;
    font-weight: 600;
    pointer-events: none;
  }
  #paneAuto .ai-risk-row .money-affix > span { color: var(--ink-3); }
  #paneAuto .ai-risk-row .ai-prefix-input > span { color: #efbd43; }
  #paneAuto .ai-risk-row .money-affix input,
  #paneAuto .ai-risk-row .ai-prefix-input input {
    padding-left: 27px !important;
  }
}

/* Binary.Trade mobile Auto layout v4 */
@media (max-width: 767px) {
  #paneAuto .ai-control-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
    padding: 8px 10px;
  }
  #paneAuto .ai-risk-row {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 7px;
    padding: 8px 10px 4px;
  }
  #paneAuto .ai-risk-row #tgtAuto,
  #paneAuto .ai-risk-row #tgtAuto .tgt-pair {
    display: contents !important;
  }
  #paneAuto .ai-risk-row #tgtAuto .pair-a {
    grid-column: 1;
    min-width: 0;
  }
  #paneAuto .ai-risk-row #tgtAuto .pair-b {
    grid-column: 2;
    min-width: 0;
  }
  #paneAuto .ai-risk-row #aiMultiplier {
    display: grid !important;
    grid-column: 3 !important;
    min-width: 0;
  }
  #paneAuto .ai-risk-row #tgtAuto .tgt-line,
  #paneAuto .ai-risk-row #tgtAuto .tgt-hit {
    grid-column: 1 / -1;
  }
  #paneAuto .ai-exec {
    margin-top: 0 !important;
    padding: 2px 10px 10px !important;
  }
  #paneAuto .ai-exec .ai-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
    width: 100%;
    margin: 0;
  }
  #paneAuto .ai-exec .ai-actions .btn {
    width: 100%;
    min-height: 46px;
    height: 46px;
  }
}
@media(max-width:767px){#paneAuto .ai-control-row{grid-template-columns:repeat(2,minmax(0,1fr))!important;align-items:start!important;overflow:visible!important}#paneAuto .ai-scan-column{width:100%;min-width:0;overflow:visible!important;align-self:start}#paneAuto .ai-scan-column .ai-head{display:flex;width:100%;min-width:0;overflow:visible}#paneAuto .ai-scan-column .deep-scan{display:flex;width:100%;min-width:0;min-height:72px;height:auto;box-sizing:border-box;overflow:visible}#paneAuto .ai-risk-row #tgtAuto .pair-a{grid-column:1!important;grid-row:1!important}#paneAuto .ai-risk-row #tgtAuto .pair-b{grid-column:2!important;grid-row:1!important}#paneAuto .ai-risk-row #aiMultiplier{grid-column:3!important;grid-row:1!important}#paneAuto .ai-risk-row #tgtAuto .tgt-line{grid-column:1/-1!important;grid-row:2!important;display:flex!important;justify-content:space-between;min-width:0}#paneAuto .ai-risk-row #tgtAuto .tgt-hit{grid-column:1/-1!important;grid-row:3!important}}
@media(max-width:767px){#paneAuto #aiHead .deep-scan{height:58px!important;min-height:58px!important;max-height:58px;margin-top:15px!important;box-sizing:border-box;justify-content:flex-start!important;gap:6px!important;padding:5px 7px!important}#paneAuto #aiHead .deep-bot{width:20px;height:20px;flex:0 0 20px}#paneAuto #aiHead .deep-copy{display:flex;flex-direction:column;justify-content:center;gap:0!important;line-height:1}#paneAuto #aiHead .deep-copy b{font-size:11px;line-height:1;margin:0;letter-spacing:.04em}#paneAuto #aiHead .deep-copy small{font-size:9px;line-height:1;margin:0!important}}
@keyframes aiStopPulse{0%,100%{opacity:1;box-shadow:0 0 0 0 rgba(246,70,93,.35)}50%{opacity:.78;box-shadow:0 0 0 6px rgba(246,70,93,0)}}.ai-stop-pulse{background:#d93650!important;border-color:#d93650!important;color:#fff!important;animation:aiStopPulse 1.2s ease-in-out infinite}@media(prefers-reduced-motion:reduce){.ai-stop-pulse{animation:none}}

/* AI Auto session summary — separate from Manual */
#paneAuto .ai-risk-row #tgtAuto .ai-session-line {
  display: flex !important;
  align-items: center;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
  gap: 5px;
  width: 100%;
  min-width: 0;
  margin-top: 0;
  white-space: nowrap;
  line-height: 1;
}
#paneAuto .ai-session-title {
  color: var(--ink-3);
  font-size: 10px;
  white-space: nowrap;
}
#paneAuto .ai-session-count {
  color: var(--ink);
  font-size: 10px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#paneAuto .ai-session-pnl {
  font-size: 12px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#paneAuto .ai-session-eye {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 3px;
  vertical-align: -2px;
  color: var(--accent);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform-origin: center;
  animation: aiSessionEyeBlink 1.8s ease-in-out infinite;
}
@keyframes aiSessionEyeBlink {
  0%, 88%, 100% { transform: scaleY(1); }
  93%, 96% { transform: scaleY(.12); }
}
@media (prefers-reduced-motion: reduce) {
  #paneAuto .ai-session-eye { animation: none; }
}

/* Binary.Trade charting space refinement v1 */
:root { --side: 296px; }
@media (min-width: 1600px) { :root { --side: 304px; } }
@media (min-width: 1024px) and (max-width: 1279px) {
  :root { --side: 288px; }
}
@media (min-width: 1024px) {
  .side { border-left: 0 !important; box-shadow: none !important; }
  .center { border-right: 0 !important; }
}
.center > .digits .dg-row { gap: 2px !important; }
@media (max-width: 767px) {
  .center > .digits .dg-row { gap: 1px !important; }
}


/* Live digit frequency colours */
.center > .digits .dg.ptr-hi .dg-n { color: var(--up) !important; }
.center > .digits .dg.ptr-lo .dg-n { color: var(--down) !important; }

/* Live Digits: compact spacing and seamless workspace boundary */
.center > .digits {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.center > .digits .dg-sec {
  padding: 2px 6px 3px;
}
.center > .digits .dg-row {
  padding-top: 2px;
}
.term[data-view=trade] .center,
.term[data-view=auto] .center {
  border-bottom: 0;
}


/* Binary.Trade phone header and navigation drawer */
.drawer-trigger svg,
#btnBell svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 767px) {
  .top .brand,
  .top .top-sym,
  #stFeed,
  #btnSettings,
  #btnProfile {
    display: none !important;
  }

  .top {
    display: flex;
    align-items: center;
    gap: 5px;
    padding-left: 7px;
    padding-right: 7px;
  }

  .top .grow {
    display: none !important;
  }

  #btnDrawer {
    display: inline-flex;
    order: 0;
    flex: 0 0 30px;
    min-width: 30px;
    width: 30px;
    height: 32px;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
  }

  .hdr-tools {
    order: 1;
    flex: 0 0 auto;
    margin-left: auto;
    gap: 2px;
  }

  #btnBell {
    min-width: 30px;
    width: 30px;
    height: 32px;
    padding: 0;
  }

  .acct-switch {
    order: 2;
    flex: 0 1 auto;
    min-width: 0;
    margin: 0;
  }

  #btnDeposit {
    order: 3;
    display: inline-flex !important;
    flex: 0 0 auto;
    height: 30px;
    margin-left: 0;
    padding-left: 7px;
    padding-right: 7px;
    white-space: nowrap;
  }

  #btnWithdraw {
    order: 4;
    display: inline-flex !important;
    flex: 0 0 auto;
    height: 30px;
    margin-left: 0;
    padding-left: 7px;
    padding-right: 7px;
    white-space: nowrap;
  }
}

@media (max-width: 380px) {
  .top {
    gap: 3px;
    padding-left: 5px;
    padding-right: 5px;
  }

  #btnDrawer,
  #btnBell {
    min-width: 27px;
    width: 27px;
  }

  #btnDeposit,
  #btnWithdraw {
    padding-left: 5px;
    padding-right: 5px;
    font-size: 11px;
  }

  .acct-opt {
    padding-left: 4px;
    padding-right: 4px;
    gap: 3px;
  }
}


/* BINARY_TRADE_DIGIT_RESULT_BLINK */
@keyframes dgTradeExecuting {
  0%, 100% { box-shadow: 0 0 0 0 rgba(96, 165, 250, 0); opacity: 1; }
  50% { box-shadow: 0 0 0 3px rgba(96, 165, 250, .8); opacity: .45; }
}

@keyframes dgTradeWin {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 189, 133, 0); }
  50% { box-shadow: 0 0 0 3px rgba(46, 189, 133, .95); }
}

@keyframes dgTradeLoss {
  0%, 100% { box-shadow: 0 0 0 0 rgba(246, 70, 93, 0); }
  50% { box-shadow: 0 0 0 3px rgba(246, 70, 93, .95); }
}

#dgRow .dg.trade-executing {
  animation: dgTradeExecuting .65s ease-in-out infinite;
}

#dgRow .dg.trade-win {
  animation: dgTradeWin .55s ease-in-out infinite;
}

#dgRow .dg.trade-loss {
  animation: dgTradeLoss .55s ease-in-out infinite;
}

/* AI Deep Scanner — responsive popup */
.deep-scanner-launch { margin:12px 0; }
.deep-scanner-open {
  width:100%; display:flex; align-items:center; gap:13px;
  padding:14px 16px; border:1px solid rgba(157,112,255,.4);
  border-radius:13px; background:linear-gradient(110deg,rgba(113,72,190,.2),rgba(35,30,58,.5));
  color:inherit; text-align:left; cursor:pointer;
}
.deep-scanner-icon,.deep-scanner-mark {
  display:grid; place-items:center; flex:0 0 40px; height:40px;
  border-radius:12px; background:rgba(157,112,255,.18);
  color:#bd9aff; font-size:23px;
}
.deep-scanner-open b,.deep-scanner-open small { display:block; }
.deep-scanner-open small { margin-top:3px; opacity:.68; }
.deep-scanner-overlay {
  position:fixed; inset:0; z-index:10000; display:flex;
  align-items:center; justify-content:center; padding:18px;
  background:rgba(4,5,13,.76); backdrop-filter:blur(9px);
  -webkit-backdrop-filter:blur(9px);
}
.deep-scanner-overlay[hidden] { display:none!important; }
.deep-scanner-modal {
  position:relative; width:min(100%,500px); max-height:90dvh;
  overflow-y:auto; padding:25px; border-radius:19px;
  border:1px solid rgba(166,132,255,.25);
  background:#111321; color:#f4f1ff;
  box-shadow:0 24px 90px rgba(0,0,0,.55);
}
.deep-scanner-close {
  position:absolute; top:12px; right:14px; width:36px; height:36px;
  border:0; border-radius:10px; background:rgba(255,255,255,.07);
  color:inherit; font-size:25px; cursor:pointer;
}
.deep-scanner-heading { display:flex; align-items:center; gap:13px; padding-right:30px; }
.deep-scanner-heading h2 { margin:0; font-size:20px; font-weight:700; }
.deep-scanner-heading p { margin:6px 0 0; color:#aaaabd; font-size:13px; line-height:1.5; }
.deep-scanner-market-label { display:block; margin:25px 0 8px; color:#b9b7ca; font-size:13px; }
#deepScannerMarket {
  width:100%; min-height:46px; padding:0 12px; border-radius:10px;
  border:1px solid #343448; background:#191b2b; color:#f4f1ff;
}
.deep-scanner-progress-label {
  display:flex; justify-content:space-between; gap:12px;
  margin:22px 0 9px; color:#b9b7ca; font-size:12px;
}
.deep-scanner-progress-label b { color:#e5dcff; font-variant-numeric:tabular-nums; }
.deep-scanner-progress { height:7px; overflow:hidden; border-radius:20px; background:#29283b; }
.deep-scanner-progress span {
  display:block; width:0; height:100%; border-radius:20px;
  background:linear-gradient(90deg,#8053d6,#c09aff);
  transition:width .25s ease;
}
.deep-scanner-start,.deep-scanner-load {
  width:100%; min-height:47px; margin-top:17px; border:0;
  border-radius:11px; font-weight:700; cursor:pointer;
}
.deep-scanner-start { background:#8053d6; color:white; }
.deep-scanner-load { margin-top:10px; background:#29243b; color:#d9c8ff; border:1px solid #604a8d; }
.deep-scanner-start:disabled,.deep-scanner-load:disabled {
  opacity:.48; cursor:not-allowed;
}
.deep-scanner-start:disabled:not(:empty) { cursor:wait; }
@media(max-width:600px) {
  .deep-scanner-overlay { padding:12px; align-items:center; }
  .deep-scanner-modal { width:100%; max-height:88dvh; padding:21px 18px; border-radius:16px; }
  .deep-scanner-heading h2 { font-size:18px; }
  .deep-scanner-heading p { font-size:12px; }
  .deep-scanner-open { padding:12px; }
}
@media(min-width:601px) and (max-width:1024px) {
  .deep-scanner-modal { width:min(90%,520px); }
}

/* BINARY_TRADE_PHONE_CASHIER_LABELS */
@media (max-width: 767px) {
  .top .cbtn span { display: inline; }
}


/* Registration phone country selector */
.phone-country-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 13px;
  margin: 5px 0 8px;
  border: 1px solid var(--line, #343a46);
  border-radius: 9px;
  background: var(--panel, #171c25);
  color: inherit;
  cursor: pointer;
  font: inherit;
}
.phone-country-drawer {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0,0,0,.65);
}
.phone-country-drawer[hidden] { display: none !important; }
.phone-country-panel {
  width: min(100%, 430px);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line, #343a46);
  border-radius: 14px;
  background: var(--panel, #171c25);
  color: inherit;
  box-shadow: 0 15px 50px rgba(0,0,0,.35);
}
.phone-country-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.phone-country-heading button {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 26px;
  cursor: pointer;
}
.phone-country-panel input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  border-radius: 8px;
}
.phone-country-list {
  overflow-y: auto;
  min-height: 100px;
}
.phone-country-option {
  display: block;
  width: 100%;
  padding: 11px 9px;
  border: 0;
  border-bottom: 1px solid var(--line, #343a46);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.phone-country-option:hover {
  background: rgba(128,128,128,.13);
}


/* ── Auto ticket v11: reference layout (phone only) ── */
@media (max-width: 767px) {
  .term[data-view=auto] {
    --tk: clamp(58px, 9vh, 72px);
    grid-template-rows: var(--top) minmax(220px, 1fr) auto calc(54px + env(safe-area-inset-bottom));
  }
  .term[data-view=auto] .side { max-height: 58vh; }

  /* Row 1: AUTO | MANUAL halves with dots */
  .term[data-view=auto] .side-head { display: flex !important; padding: 0; min-height: var(--tk); flex: 0 0 var(--tk); border-bottom: 1px solid var(--line); }
  .term[data-view=auto] #sideTabs { display: grid !important; grid-template-columns: 1fr 1fr; flex: 1; gap: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
  .term[data-view=auto] #sideTabs .tab { height: var(--tk); display: inline-flex !important; align-items: center; justify-content: center; gap: 10px; border-radius: 0; font-size: 15px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-3); background: transparent; box-shadow: none; }
  .term[data-view=auto] #sideTabs .tab[data-side=auto] { order: -1; }
  .term[data-view=auto] #sideTabs .tab[data-side=trade] { border-left: 1px solid var(--line); }
  .term[data-view=auto] #sideTabs .tab::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; position: static; }
  .term[data-view=auto] #sideTabs .tab::after { display: none; }
  .term[data-view=auto] #sideTabs .tab.on { color: #0fcf8b; background: rgba(15,207,139,.08); }

  /* Row 2: Stake stepper | AI scanner */
  .term[data-view=auto] #paneAuto .ai-control-row { display: grid; grid-template-columns: 60fr 40fr; gap: 0; padding: 0; align-items: stretch; border-bottom: 1px solid var(--line); }
  .term[data-view=auto] #paneAuto #aiStakeIn { display: block; position: relative; min-height: var(--tk); padding: 0; border: 0; border-right: 1px solid var(--line); }
  .term[data-view=auto] #paneAuto #aiStakeIn .ai-base-field { display: block; height: 100%; }
  .term[data-view=auto] #paneAuto #aiStakeIn .ai-base-field > span.label { display: block !important; position: absolute; top: calc(var(--tk) * .14); left: 20.7%; right: 20.7%; text-align: center; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); pointer-events: none; }
  .term[data-view=auto] #paneAuto #aiStakeIn .ai-stake-stepper { display: grid; grid-template-columns: 20.7% 12% minmax(0, 1fr) 20.7%; align-items: stretch; height: var(--tk); gap: 0; }
  .term[data-view=auto] #paneAuto #aiStakeIn .ai-stake-stepper button { background: transparent !important; border: 0; border-radius: 0; box-shadow: none; color: var(--ink-3); font-size: 28px; font-weight: 300; }
  .term[data-view=auto] #paneAuto #aiStakeIn button[data-stake-step="-1"] { grid-column: 1; border-right: 1px solid var(--line); }
  .term[data-view=auto] #paneAuto #aiStakeIn button[data-stake-step="1"] { grid-column: 4; border-left: 1px solid var(--line); }
  .term[data-view=auto] #paneAuto #aiStakeIn .ai-stake-currency { grid-column: 2; align-self: end; padding: 0 0 calc(var(--tk) * .19) 8px; font-size: 20px; color: var(--ink-3); text-align: left; }
  .term[data-view=auto] #paneAuto #aiStakeIn .ai-stake-stepper input { grid-column: 3; align-self: end; width: 100%; height: auto; padding: 0 0 calc(var(--tk) * .16); border: 0; background: transparent; box-shadow: none; text-align: center; font-size: 22px; font-weight: 700; color: #fff; }

  .term[data-view=auto] #paneAuto .deep-scanner-open { display: grid !important; grid-template-columns: auto auto; justify-content: center; align-content: center; column-gap: 8px; row-gap: 2px; width: 100%; height: 100%; min-height: var(--tk); margin: 0 !important; padding: 0 8px; border: 0 !important; border-radius: 0 !important; box-shadow: none; text-align: center; background: linear-gradient(135deg, #1b2050, #261b45) !important; }
  .term[data-view=auto] #paneAuto .deep-scanner-open > span:not(.deep-scanner-icon) { display: contents; }
  .term[data-view=auto] #paneAuto .deep-scanner-open b { font-size: 15px; font-weight: 700; color: #a5adff; white-space: nowrap; }
  .term[data-view=auto] #paneAuto .deep-scanner-open small { grid-column: 1 / -1; font-size: 12px; color: #6e7496; }
  .term[data-view=auto] #paneAuto .deep-scanner-icon { font-size: 18px; color: #8f98ff; }

  /* Row 3: Take profit | Stop loss | Multiplier */
  .term[data-view=auto] #paneAuto .ai-risk-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; padding: 0; align-items: stretch; border-bottom: 1px solid var(--line); }
  .term[data-view=auto] #paneAuto .ai-risk-row #tgtAuto,
  .term[data-view=auto] #paneAuto .ai-risk-row #tgtAuto .tgt-pair { display: contents; }
  .term[data-view=auto] #paneAuto .ai-risk-row #tgtAuto .pair-a { grid-area: 1 / 1; }
  .term[data-view=auto] #paneAuto .ai-risk-row #tgtAuto .pair-b { grid-area: 1 / 2; }
  .term[data-view=auto] #paneAuto .ai-risk-row #aiMultiplier { grid-area: 1 / 3; display: block; padding: 0; border: 0; }
  .term[data-view=auto] #paneAuto .ai-risk-row .field { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: var(--tk); height: 100%; padding: 6px 8px; border-right: 1px solid var(--line); }
  .term[data-view=auto] #paneAuto .ai-risk-row #aiMultiplier .field { border-right: 0; }
  .term[data-view=auto] #paneAuto .ai-risk-row .field > .label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
  .term[data-view=auto] #paneAuto .ai-risk-row .pair-a > .label { color: #2ebd85; }
  .term[data-view=auto] #paneAuto .ai-risk-row .pair-b > .label { color: #f6465d; }
  .term[data-view=auto] #paneAuto .ai-risk-row #aiMultiplier .field > .label { color: #f0b429; }
  .term[data-view=auto] #paneAuto .ai-risk-row .money-affix,
  .term[data-view=auto] #paneAuto .ai-risk-row #aiMultiplier .field > div { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; width: 100%; }
  .term[data-view=auto] #paneAuto .ai-risk-row .pair-a .money-affix > span { color: #2ebd85; }
  .term[data-view=auto] #paneAuto .ai-risk-row .pair-b .money-affix > span { color: #f6465d; }
  .term[data-view=auto] #paneAuto .ai-risk-row #aiMultiplier .field > div > span { color: #f0b429; }
  .term[data-view=auto] #paneAuto .ai-risk-row .field input { width: 100%; height: auto; padding: 0; border: 0; background: transparent; box-shadow: none; text-align: center; font-size: 20px; font-weight: 700; color: #fff; }
  .term[data-view=auto] #paneAuto .ai-risk-row #aiMultiplier .ai-mult-note { display: none !important; }
  .term[data-view=auto] #paneAuto .ai-risk-row #tgtAuto > .sec-h { grid-area: 1 / 1 / 2 / 3; align-self: start; padding: 10px 12px 0; }
  .term[data-view=auto] #paneAuto .ai-risk-row #tgtAuto > .dim { grid-area: 1 / 1 / 2 / 3; align-self: end; padding: 0 12px 10px; }
  .term[data-view=auto] #paneAuto .ai-risk-row #tgtAuto .tgt-line { grid-area: 2 / 1 / 3 / 4; padding: 5px 12px; border-top: 1px solid var(--line); font-size: 11px; }
  .term[data-view=auto] #paneAuto .ai-risk-row #tgtAuto .tgt-hit { grid-area: 3 / 1 / 4 / 4; margin: 0; }

  .term[data-view=auto] #paneAuto #aiRecovery:empty,
  .term[data-view=auto] #paneAuto #aiSelected[hidden] { display: none; }

  /* Row 4: full-width action buttons */
  .term[data-view=auto] #paneAuto .ai-exec { position: sticky; bottom: 0; z-index: 5; display: flex; flex-direction: column-reverse; gap: 0; padding: 0; border: 0; background: var(--bg); }
  .term[data-view=auto] #paneAuto .ai-exec .ai-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
  .term[data-view=auto] #paneAuto .ai-exec .ai-actions .btn { height: var(--tk); min-height: var(--tk); padding: 0 8px; border: 0; border-radius: 0; font-size: 16px; font-weight: 700; letter-spacing: .04em; color: var(--ink-2); background: var(--bg-2) !important; box-shadow: none; }
  .term[data-view=auto] #paneAuto .ai-exec .ai-actions #aiAuto { order: -1; color: #fff; background: #00b97d !important; }
  .term[data-view=auto] #paneAuto .ai-exec .ai-actions #aiStopBtn { color: #fff; background: #ff2557 !important; }
  .term[data-view=auto] #paneAuto .ai-exec .ai-actions .btn:disabled { opacity: .45; }
  .term[data-view=auto] #paneAuto .ai-exec #aiMore { align-self: flex-end; justify-self: auto; padding: 4px 12px; }

  /* Bottom bar: Trade | Positions with icons */
  .mnav button { display: flex; align-items: center; justify-content: center; flex-direction: row-reverse; gap: 10px; font-size: 16px; font-weight: 600; }
  .mnav button::after { content: ""; width: 22px; height: 22px; background: currentColor; -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
  .mnav button[data-view=trade] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M6 20v-4M12 20V8M18 20v-7'/%3E%3C/svg%3E"); }
  .mnav button[data-view=positions] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
  .mnav button.on { color: #0fcf8b; }
  .mnav button.on::before { display: none; }
}


/* MOBILE AUTO REFERENCE MATCH v1 */
@media (max-width: 767px) {
  .term[data-side="auto"] {
    --tk: clamp(64px, 10vh, 80px);
  }

  /* AUTO / MANUAL tabs */
  .term[data-side="auto"] .side-head {
    display:flex!important;
    width:100%;
    min-height:var(--tk);
    flex:0 0 var(--tk);
    padding:0;
    border:0;
    border-bottom:1px solid var(--line);
    border-radius:0;
  }

  .term[data-side="auto"] #acctCtx {
    display:none!important;
  }

  .term[data-side="auto"] #sideTabs {
    display:grid!important;
    width:100%;
    flex:1 1 100%;
    grid-template-columns:1fr 1fr;
    gap:0;
    margin:0;
    padding:0;
    border:0;
    border-radius:0;
    background:transparent;
    overflow:hidden;
  }

  .term[data-side="auto"] #sideTabs .tab {
    display:inline-flex!important;
    height:var(--tk);
    align-items:center;
    justify-content:center;
    gap:10px;
    padding:0 8px;
    border:0;
    border-radius:0;
    background:transparent;
    box-shadow:none;
    color:#737b8a;
    font-size:15px;
    font-weight:700;
    letter-spacing:.04em;
    text-transform:uppercase;
  }

  .term[data-side="auto"] #sideTabs .tab[data-side="auto"] {
    order:-1;
    border-right:1px solid var(--line);
  }

  .term[data-side="auto"] #sideTabs .tab::before {
    content:"";
    position:static;
    display:inline-block;
    width:9px;
    height:9px;
    flex:0 0 9px;
    border-radius:50%;
    background:#737b8a;
  }

  .term[data-side="auto"] #sideTabs .tab.on {
    color:#12c995;
    background:rgba(18,201,149,.10);
  }

  .term[data-side="auto"] #sideTabs .tab[data-side="auto"].on::before {
    background:#12c995;
  }

  .term[data-side="auto"] #sideTabs .tab::after {
    display:none!important;
  }

  /* Stake and AI Scanner */
  .term[data-side="auto"] #paneAuto .ai-control-row {
    display:grid!important;
    grid-template-columns:60% 40%;
    align-items:stretch;
    gap:0;
    padding:0;
    min-height:calc(var(--tk) * 2.4);
    border-bottom:1px solid var(--line);
    overflow:visible;
  }

  .term[data-side="auto"] #paneAuto #aiStakeIn {
    display:block;
    position:relative;
    min-width:0;
    min-height:calc(var(--tk) * 2.4);
    height:100%;
    padding:0;
    border:0;
    border-right:1px solid var(--line);
  }

  .term[data-side="auto"] #paneAuto #aiStakeIn .ai-base-field {
    display:block;
    position:relative;
    height:100%;
    min-height:calc(var(--tk) * 2.4);
    margin:0;
  }

  .term[data-side="auto"] #paneAuto #aiStakeIn .ai-base-field > .label {
    display:block!important;
    position:absolute;
    z-index:2;
    top:12px;
    left:20%;
    right:20%;
    margin:0;
    color:#aab2c0;
    text-align:center;
    font-size:14px;
    font-weight:700;
    letter-spacing:.08em;
  }

  .term[data-side="auto"] #paneAuto #aiStakeIn .ai-stake-stepper {
    display:grid;
    grid-template-columns:20% 12% minmax(0,1fr) 20%;
    align-items:center;
    gap:0;
    width:100%;
    min-height:calc(var(--tk) * 1.5);
    height:100%;
    padding-top:22px;
    box-sizing:border-box;
  }

  .term[data-side="auto"] #paneAuto #aiStakeIn .ai-stake-stepper button {
    display:flex;
    width:100%;
    height:100%;
    align-items:center;
    justify-content:center;
    padding:0;
    border:0;
    border-radius:0;
    background:transparent!important;
    box-shadow:none;
    color:#aab2c0;
    font-size:30px;
  }

  .term[data-side="auto"] #paneAuto #aiStakeIn button[data-stake-step="-1"] {
    grid-column:1;
    border-right:1px solid var(--line);
  }

  .term[data-side="auto"] #paneAuto #aiStakeIn .ai-stake-currency {
    grid-column:2;
    align-self:center;
    padding:14px 0 0 8px;
    color:#aab2c0;
    font-size:24px;
  }

  .term[data-side="auto"] #paneAuto #aiStakeIn .ai-stake-stepper input {
    grid-column:3;
    align-self:center;
    width:100%;
    min-width:0;
    height:auto;
    margin-top:14px;
    padding:0;
    border:0;
    border-radius:0;
    background:transparent;
    box-shadow:none;
    color:#fff;
    text-align:center;
    font-size:30px;
    font-weight:700;
  }

  .term[data-side="auto"] #paneAuto #aiStakeIn button[data-stake-step="1"] {
    grid-column:4;
    border-left:1px solid var(--line);
  }

  .term[data-side="auto"] #paneAuto .deep-scanner-open {
    display:grid!important;
    grid-template-columns:auto auto;
    align-content:center;
    align-items:center;
    justify-content:center;
    column-gap:10px;
    row-gap:8px;
    width:100%;
    min-width:0;
    min-height:calc(var(--tk) * 1.5);
    height:100%;
    margin:0;
    padding:12px 8px;
    box-sizing:border-box;
    border:1px solid #55428e!important;
    border-radius: 0 0 6px 6px / 0 0 7px 7px;
    background:linear-gradient(135deg,#211b3e,#17152d)!important;
    box-shadow:none;
    text-align:center;
  }

  .term[data-side="auto"] #paneAuto .deep-scanner-open > span:not(.deep-scanner-icon) {
    display:contents;
  }

  .term[data-side="auto"] #paneAuto .deep-scanner-open .deep-scanner-icon {
    grid-column:1;
    grid-row:1;
    color:#a58cff;
    font-size:25px;
  }

  .term[data-side="auto"] #paneAuto .deep-scanner-open b {
    grid-column:2;
    grid-row:1;
    color:#aeb5ff;
    font-size:17px;
    font-weight:700;
    white-space:nowrap;
  }

  .term[data-side="auto"] #paneAuto .deep-scanner-open small {
    grid-column:1/-1;
    grid-row:2;
    color:#85849f;
    font-size:14px;
  }

  /* Three flat risk columns */
  .term[data-side="auto"] #paneAuto .ai-risk-row {
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr));
    align-items:stretch;
    gap:0;
    min-height:calc(var(--tk) * 1.5);
    padding:0;
    border:0;
    border-bottom:1px solid var(--line);
  }

  .term[data-side="auto"] #paneAuto .ai-risk-row #tgtAuto,
  .term[data-side="auto"] #paneAuto .ai-risk-row #tgtAuto .tgt-pair {
    display:contents!important;
  }

  .term[data-side="auto"] #paneAuto .ai-risk-row #tgtAuto .pair-a {
    grid-area:1/1;
  }

  .term[data-side="auto"] #paneAuto .ai-risk-row #tgtAuto .pair-b {
    grid-area:1/2;
  }

  .term[data-side="auto"] #paneAuto .ai-risk-row #aiMultiplier {
    grid-area:1/3;
    display:block;
    min-width:0;
    padding:0;
    border:0;
  }

  .term[data-side="auto"] #paneAuto .ai-risk-row .field {
    display:flex;
    min-width:0;
    min-height:calc(var(--tk) * 1);
    height:100%;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:10px;
    margin:0;
    padding:12px 8px;
    border:0;
    border-right:1px solid var(--line);
    border-radius:0;
    background:transparent;
    box-shadow:none;
  }

  .term[data-side="auto"] #paneAuto .ai-risk-row #aiMultiplier .field {
    border-right:0;
  }

  .term[data-side="auto"] #paneAuto .ai-risk-row .field > .label {
    display:block;
    width:100%;
    color:#aab2c0;
    text-align:center;
    font-size:14px;
    font-weight:700;
    letter-spacing:.06em;
    text-transform:uppercase;
  }

  .term[data-side="auto"] #paneAuto .ai-risk-row .pair-a > .label {
    color:#16c995;
  }

  .term[data-side="auto"] #paneAuto .ai-risk-row .pair-b > .label {
    color:#f45b83;
  }

  .term[data-side="auto"] #paneAuto .ai-risk-row #aiMultiplier .field > .label {
    color:#e8b83f;
  }

  .term[data-side="auto"] #paneAuto .ai-risk-row .money-affix,
  .term[data-side="auto"] #paneAuto .ai-risk-row #aiMultiplier .field > div {
    display:flex;
    width:100%;
    min-width:0;
    align-items:center;
    justify-content:center;
    gap:8px;
    border:0;
    border-radius:0;
    background:transparent;
    box-shadow:none;
  }

  .term[data-side="auto"] #paneAuto .ai-risk-row .pair-a .money-affix > span {
    color:#16c995;
  }

  .term[data-side="auto"] #paneAuto .ai-risk-row .pair-b .money-affix > span {
    color:#f45b83;
  }

  .term[data-side="auto"] #paneAuto .ai-risk-row #aiMultiplier .field > div > span {
    color:#e8b83f;
  }

  .term[data-side="auto"] #paneAuto .ai-risk-row .field input {
    width:100%;
    min-width:0;
    height:auto;
    margin:0;
    padding:0;
    border:0;
    border-radius:0;
    background:transparent;
    box-shadow:none;
    color:#fff;
    text-align:center;
    font-size:26px;
    font-weight:700;
  }

  .term[data-side="auto"] #paneAuto .ai-risk-row #aiMultiplier .ai-mult-note {
    display:none!important;
  }

  /* Session summary row */
  .term[data-side="auto"] #paneAuto .ai-risk-row #tgtAuto .tgt-line {
    grid-area:2/1/3/4;
    display:flex!important;
    width:100%;
    min-width:0;
    min-height:calc(var(--tk) * 1);
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin:0;
    padding:12px 24px;
    box-sizing:border-box;
    border:0;
    background:#11151f;
    color:#818a9b;
    font-size:16px;
    white-space:nowrap;
    overflow:visible;
  }

  .term[data-side="auto"] #paneAuto .ai-risk-row #tgtAuto .tgt-line.ai-session-line {
    display:flex;
    width:100%;
    min-width:0;
    align-items:center;
    justify-content:space-between;
    gap:12px;
  }

  .term[data-side="auto"] #paneAuto .ai-risk-row #tgtAuto .tgt-line.ai-session-line > :last-child {
    margin-left:auto;
    color:#12c995;
    font-weight:700;
    text-align:right;
  }

  .term[data-side="auto"] #paneAuto .ai-risk-row #tgtAuto .tgt-hit {
    grid-area:3/1/4/4;
    margin:0;
  }
}

/* AUTO MOBILE — match desktop control heights only */
@media (max-width: 767px) {
  /* Stake */
  .term[data-side="auto"] #paneAuto #aiStakeIn .ai-stake-stepper {
    min-height: 36px !important;
    height: 36px !important;
  }
  .term[data-side="auto"] #paneAuto #aiStakeIn .ai-stake-stepper button {
    height: 36px !important;
  }
  .term[data-side="auto"] #paneAuto #aiStakeIn .ai-stake-stepper input {
    height: 36px !important;
  }

  /* Deep Scanner */
  .term[data-side="auto"] #paneAuto .deep-scanner-open {
    min-height: 54px !important;
    height: 54px !important;
    max-height: 54px !important;
  }

  /* Take Profit, Stop Loss and Multiplier */
  .term[data-side="auto"] #paneAuto .ai-risk-row .field {
    min-height: 54px !important;
    height: 54px !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    gap: 4px !important;
  }
  .term[data-side="auto"] #paneAuto .ai-risk-row .field input {
    height: 36px !important;
    min-height: 36px !important;
  }

  /* Session summary */
  .term[data-side="auto"] #paneAuto .ai-risk-row #tgtAuto .tgt-line {
    min-height: 0 !important;
    height: auto !important;
    padding: 5px 12px !important;
    gap: 5px !important;
  }
  .term[data-side="auto"] #paneAuto .ai-risk-row #tgtAuto .tgt-line.ai-session-line {
    min-height: 0 !important;
    height: auto !important;
    gap: 5px !important;
  }
}

/* AUTO MOBILE — align control heights with desktop */
@media (max-width: 767px) {

  /* Stake and Deep Scanner row */
  .term[data-side="auto"] #paneAuto .ai-control-row {
    min-height: 94px !important;
    height: 94px !important;
  }

  .term[data-side="auto"] #paneAuto #aiStakeIn {
    min-height: 74px !important;
    height: 74px !important;
    align-self: center !important;
  }

  .term[data-side="auto"] #paneAuto #aiStakeIn .ai-base-field {
    min-height: 74px !important;
    height: 74px !important;
  }

  .term[data-side="auto"] #paneAuto #aiStakeIn .ai-stake-stepper {
    min-height: 74px !important;
    height: 74px !important;
    padding-top: 0 !important;
  }

  .term[data-side="auto"] #paneAuto #aiStakeIn .ai-stake-stepper input {
    height: 36px !important;
    min-height: 36px !important;
    margin-top: 0 !important;
  }

  .term[data-side="auto"] #paneAuto #aiStakeIn .ai-stake-stepper button {
    height: 36px !important;
    min-height: 36px !important;
  }

  .term[data-side="auto"] #paneAuto .deep-scanner-open {
    min-height: 94px !important;
    height: 94px !important;
    max-height: 94px !important;
  }

  /* Stop Loss, Take Profit and Multiplier */
  .term[data-side="auto"] #paneAuto .ai-risk-row {
    min-height: 72px !important;
    height: 72px !important;
  }

  .term[data-side="auto"] #paneAuto .ai-risk-row .field {
    min-height: 72px !important;
    height: 72px !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    gap: 4px !important;
  }

  .term[data-side="auto"] #paneAuto .ai-risk-row .field input {
    height: 36px !important;
    min-height: 36px !important;
  }

  /* Session */
  .term[data-side="auto"] #paneAuto .ai-risk-row #tgtAuto .tgt-line {
    min-height: 20px !important;
    height: 20px !important;
    padding: 2px 12px !important;
    align-items: center !important;
    gap: 8px !important;
    box-sizing: border-box !important;
  }

  .term[data-side="auto"] #paneAuto .ai-risk-row #tgtAuto .tgt-line.ai-session-line {
    min-height: 20px !important;
    height: 20px !important;
    padding: 0 !important;
    align-items: center !important;
    gap: 8px !important;
  }
}

/* AUTO MOBILE — final session spacing and action overlap fix */
@media (max-width: 767px) {
  .term[data-side="auto"] #paneAuto .ai-risk-row {
    height: 92px !important;
    min-height: 92px !important;
  }

  .term[data-side="auto"] #paneAuto #tgtAuto .tgt-line.ai-session-line {
    height: 20px !important;
    min-height: 20px !important;
    padding: 2px 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    line-height: normal !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }

  .term[data-side="auto"] #paneAuto #tgtAuto .tgt-line.ai-session-line > * {
    line-height: normal !important;
    flex-shrink: 0 !important;
  }
}

/* FINAL MOBILE TWEAKS — navigation height and stake label */
@media (max-width: 767px) {
  .term .mnav button {
    height: 20px !important;
    min-height: 20px !important;
    max-height: 20px !important;
    box-sizing: border-box !important;
  }

  .term[data-side="auto"] #paneAuto #aiStakeIn .ai-base-field > .label,
  .term[data-view="auto"] #paneAuto #aiStakeIn .ai-base-field > span.label {
    display: none !important;
    visibility: hidden !important;
  }
}

/* FINAL MOBILE SCANNER HEIGHT — 64px */
@media (max-width: 767px) {
  .term[data-side="auto"] #paneAuto .ai-control-row {
    min-height: 64px !important;
    height: auto !important;
  }

  .term[data-side="auto"] #paneAuto .deep-scanner-open {
    min-height: 64px !important;
    height: 64px !important;
    max-height: 64px !important;
    box-sizing: border-box !important;
  }
}

/* FINAL MOBILE MANUAL/AUTO TAB HEIGHT — 44px */
@media (max-width: 767px) {
  .term[data-side="auto"] #sideTabs .tab,
  .term[data-view="auto"] #sideTabs .tab {
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    align-self: center !important;
    box-sizing: border-box !important;
  }
}

/* FINAL MOBILE STAKE HEIGHT — 44px */
@media (max-width: 767px) {
  .term[data-side="auto"] #paneAuto #aiStakeIn {
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    align-self: center !important;
    box-sizing: border-box !important;
  }
  .term[data-side="auto"] #paneAuto #aiStakeIn .ai-base-field,
  .term[data-side="auto"] #paneAuto #aiStakeIn .ai-stake-stepper {
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    box-sizing: border-box !important;
  }
}


/* FINAL MOBILE SCANNER — MATCH STAKE HEIGHT */
@media (max-width: 767px) {
.term[data-side="auto"] #paneAuto .ai-control-row { min-height:44px !important; height:auto !important; align-items:stretch !important; }
.term[data-side="auto"] #paneAuto .deep-scanner-open { height:44px !important; min-height:44px !important; max-height:44px !important; padding:2px 4px !important; column-gap:4px !important; row-gap:0 !important; box-sizing:border-box !important; }
.term[data-side="auto"] #paneAuto .deep-scanner-open .deep-scanner-icon { font-size:14px !important; line-height:1 !important; }
.term[data-side="auto"] #paneAuto .deep-scanner-open b { font-size:10px !important; line-height:1 !important; }
.term[data-side="auto"] #paneAuto .deep-scanner-open small { font-size:8px !important; line-height:1 !important; }
}
