:root {
  --bg: #0d1117;
  --panel: #151b24;
  --panel-2: #1b2330;
  --border: #263041;
  --text: #e6edf3;
  --muted: #8b98a9;
  --accent: #3b82f6;
  --accent-text: #ffffff;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
  --purple: #a78bfa;
  --radius: 10px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f7fa; --panel: #ffffff; --panel-2: #f0f3f7; --border: #dde3ea;
    --text: #111827; --muted: #5b6676; --green: #16a34a; --red: #dc2626;
    color-scheme: light;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 Inter, system-ui, sans-serif;
  display: grid; grid-template-columns: var(--nav-w, 240px) 1fr; min-height: 100vh;
  transition: grid-template-columns .18s ease;
}
.mono, td.num, .num { font-family: "JetBrains Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
a { color: var(--accent); text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.pos { color: var(--green); }
.neg { color: var(--red); }

.sidebar {
  background: var(--panel); border-right: 1px solid var(--border);
  padding: 18px 12px; display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 0; height: 100vh;
}
.brand { font-weight: 700; font-size: 17px; padding: 0 8px; }
.logo { color: var(--accent); display: flex; }
nav { display: flex; flex-direction: column; gap: 2px; }
nav a { color: var(--muted); padding: 7px 10px; border-radius: 8px; font-weight: 500; }
nav a .nav-label { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.nav-title { color: var(--text); }
nav a:not(.active):not(:hover) .nav-title { color: inherit; }
.nav-sub { font-size: 11.5px; font-weight: 400; color: var(--muted); white-space: normal; }
.nav-section { margin: 14px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); opacity: .8; }
.nav-section:first-child { margin-top: 0; }
nav a:hover { background: var(--panel-2); color: var(--text); }
nav a.active { background: var(--panel-2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
/* menu groups, each with its own colour: the icon's tile, the section title, the page you're on */
.t-home { --nc: var(--accent); } .t-ai { --nc: var(--purple); } .t-bots { --nc: #14b8a6; }
.t-hand { --nc: var(--amber); } .t-live { --nc: var(--red); } .t-help { --nc: #94a3b8; }
nav { min-height: 0; overflow-y: auto; scrollbar-width: thin; }
nav a[class*="t-"] > svg { box-sizing: content-box; width: 16px; height: 16px; padding: 6px; border-radius: 9px; color: var(--nc);
  background: color-mix(in srgb, var(--nc) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--nc) 24%, transparent);
  transition: transform .15s ease, background .15s ease, color .15s ease; }
nav a[class*="t-"]:hover > svg { background: color-mix(in srgb, var(--nc) 26%, transparent); transform: scale(1.07) rotate(-3deg); }
nav a[class*="t-"]:hover { background: color-mix(in srgb, var(--nc) 7%, var(--panel-2)); }
nav a[class*="t-"].active { background: color-mix(in srgb, var(--nc) 13%, var(--panel)); box-shadow: inset 3px 0 0 var(--nc); }
nav a[class*="t-"].active > svg { background: var(--nc); color: #fff; box-shadow: 0 3px 10px color-mix(in srgb, var(--nc) 40%, transparent); }
nav a[class*="t-"].active .nav-sub { color: color-mix(in srgb, var(--nc) 55%, var(--muted)); }
.nav-section[class*="t-"] { display: flex; align-items: center; gap: 8px; color: var(--nc); opacity: 1; margin-top: 16px; }
.nav-section[class*="t-"]::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, color-mix(in srgb, var(--nc) 45%, transparent), transparent); }
body.nav-rail .nav-section[class*="t-"] { background: color-mix(in srgb, var(--nc) 50%, transparent); margin: 8px 6px; }
body.nav-rail .nav-section[class*="t-"]::after { display: none; }
@media (prefers-reduced-motion: reduce) { nav a[class*="t-"] > svg { transition: none; } nav a[class*="t-"]:hover > svg { transform: none; } }
.sidebar-foot { margin-top: auto; padding: 0 8px; display: flex; flex-direction: column; gap: 6px; }
.brand, nav a, .nav-btn { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
nav a svg, .nav-btn svg { flex: none; }
.sidebar { overflow: hidden; }
.nav-controls { display: flex; flex-direction: column; gap: 2px; margin: 4px -8px 0; }
.nav-btn { background: none; border: none; color: var(--muted); padding: 7px 10px; border-radius: 8px; font: inherit;
  font-weight: 500; cursor: pointer; text-align: left; width: 100%; }
.nav-btn:hover { background: var(--panel-2); color: var(--text); }
.nav-btn[aria-pressed="true"] { color: var(--accent); }
.nav-edge { display: none; }

/* Collapsed: an icon rail. */
body.nav-rail { --nav-w: 64px; }
body.nav-rail .sidebar { padding-left: 10px; padding-right: 10px; }
body.nav-rail .nav-label { display: none; }
body.nav-rail .nav-section { margin: 8px 6px; height: 1px; background: var(--border); }
body.nav-rail .brand { justify-content: center; padding: 0; }
body.nav-rail nav a, body.nav-rail .nav-btn { justify-content: center; padding: 9px 0; }
body.nav-rail .sidebar-foot { padding: 0; align-items: center; }
body.nav-rail .nav-controls { margin: 4px 0 0; }
body.nav-rail #nav-collapse svg { transform: rotate(180deg); }

/* Auto-hide, like the taskbar: out of the layout, slides in over the page from the left edge. */
body.nav-auto { --nav-w: 0px; display: block; }
body.nav-auto .sidebar { position: fixed; left: 0; top: 0; width: 240px; z-index: 40; transform: translateX(-100%);
  transition: transform .18s ease, box-shadow .18s ease; }
body.nav-auto.nav-peek .sidebar { transform: none; box-shadow: 8px 0 28px #0005; }
body.nav-auto .nav-edge { display: block; position: fixed; left: 0; top: 0; width: 6px; height: 100vh; z-index: 39; }
body.nav-auto .nav-edge:hover { background: linear-gradient(90deg, var(--accent), transparent); opacity: .5; }
body.nav-auto #nav-collapse { display: none; }

main { padding: 24px 28px 60px; min-width: 0; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 15px; margin: 0 0 12px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 20px; font-weight: 600; margin-top: 4px; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border); width: fit-content; }
.badge.paper { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 40%, transparent); }
.badge.live { color: var(--red); border-color: color-mix(in srgb, var(--red) 50%, transparent); }
.badge.testnet { color: var(--purple); border-color: color-mix(in srgb, var(--purple) 50%, transparent); }
.badge.paper-tag { color: var(--muted); font-weight: 500; }
.badge.on { color: var(--green); }
.badge.off { color: var(--muted); }
.badge.auto { color: var(--purple); }
.ai-pick { font-size: 22px; font-weight: 700; }
.reasons { margin: 8px 0 0; padding-left: 18px; }
.reasons li { margin-bottom: 4px; }
tr.chosen td { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover { background: var(--panel-2); }
.table-wrap { overflow-x: auto; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

button, .btn {
  font: inherit; font-weight: 600; border-radius: 8px; padding: 8px 14px; cursor: pointer;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
}
button:hover { border-color: var(--muted); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.danger { color: var(--red); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.sm { padding: 5px 10px; font-size: 12px; }

.builder { display: grid; grid-template-columns: var(--col-a, minmax(320px, 400px)) 0 minmax(0, 1fr); gap: 16px 8px; align-items: start; }
.builder.swapped { grid-template-columns: minmax(0, 1fr) 0 var(--col-a, minmax(320px, 400px)); }
.builder.swapped > [data-zone="a"] { order: 3; }
.builder.swapped > .col-split { order: 2; }
.builder.swapped > [data-zone="b"] { order: 1; }
.builder > * { min-width: 0; } /* one-line hints must not widen a column */
form .group { margin-bottom: 16px; }
form .group-title { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 8px; font-weight: 600; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 12px; color: var(--muted); }
.field.check { flex-direction: row; align-items: center; gap: 8px; }
.field.check { flex-wrap: wrap; }
.field.check .check-help { flex-basis: 100%; padding-left: 24px; margin-top: -2px; min-width: 0; max-width: 100%; }
input, select {
  font: inherit; background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 7px; padding: 7px 9px; width: 100%; min-width: 0;
}
input[type=checkbox], input[type=radio] { width: auto; }
input:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 0; }
.seg { display: flex; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: none; background: transparent; color: var(--muted); padding: 6px; }
.seg button.on { background: var(--panel-2); color: var(--text); }
.lim-seg { max-width: 420px; }
.lim-input { display: flex; align-items: center; gap: 6px; }
.lim-input input { flex: 1; min-width: 0; }
.lim-unit { color: var(--muted); font-size: 13px; min-width: 2.5em; }
/* each live limit's on/off switch */
.lim-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lim-head > label { margin: 0; }
.lim-sw { position: relative; display: inline-block; width: 34px; height: 19px; flex: none; cursor: pointer; }
.lim-sw input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.lim-sw span { position: absolute; inset: 0; border-radius: 999px; background: var(--border); transition: background .15s; pointer-events: none; }
.lim-sw span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: transform .15s; }
.lim-sw input:checked + span { background: var(--accent); }
.lim-sw input:checked + span::after { transform: translateX(15px); }
.lim-sw input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.lim-field.off .lim-input, .lim-lev.off .lim-input, .lim-field.off .lim-eq { opacity: .45; }
.lim-field.off .lim-head > label::after, .lim-lev.off .lim-head > label::after { content: " · off"; color: var(--muted); font-weight: 400; }
.lim-eq { color: var(--accent); min-height: 1.2em; }
.form-actions { display: flex; gap: 8px; position: sticky; bottom: 0; background: var(--panel); padding-top: 10px; }
.form-actions button { flex: 1; }
.form-actions.plain { position: static; padding-top: 4px; flex-wrap: wrap; }
.form-actions.plain button { flex: 0 0 auto; min-width: 140px; }
.errors { color: var(--red); font-size: 13px; margin-top: 8px; white-space: pre-line; }

.chart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; flex-wrap: wrap; }
.chart-head .price { font-size: 20px; font-weight: 600; }
.tf { display: flex; gap: 2px; flex-wrap: wrap; }
.tf button { padding: 4px 8px; font-size: 12px; border: none; background: transparent; color: var(--muted); }
.tf button.on { background: var(--panel-2); color: var(--text); }
.chart { height: var(--chart-h, 420px); }
.chart.small { height: 220px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 16px; }
.kv div span { display: block; color: var(--muted); font-size: 12px; }
.kv div b span { display: inline; color: inherit; font-size: inherit; }
.kv div b .pos { color: var(--green); }
.kv div b .neg { color: var(--red); }
.callout { border-left: 3px solid var(--amber); padding: 8px 12px; background: var(--panel-2); border-radius: 6px; font-size: 13px; }
.callout.err { border-color: var(--red); }

.toast { position: fixed; right: 20px; bottom: 20px; background: var(--panel-2); border: 1px solid var(--border);
  padding: 10px 14px; border-radius: 8px; max-width: 420px; box-shadow: 0 8px 30px rgb(0 0 0 / .3); z-index: 10; }
.toast.err { border-color: var(--red); }

.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.checks .check { display: inline-flex; align-items: center; gap: 6px; }

@media (max-width: 900px) {
  body, body.nav-rail, body.nav-auto { grid-template-columns: 1fr; }
  body.nav-auto .sidebar { position: static; width: auto; transform: none; box-shadow: none; }
  body.nav-rail .nav-label, body.nav-auto .nav-label { display: revert; }
  .nav-edge, body.nav-auto .nav-edge, .nav-controls, #exchange-name, #app-version { display: none; }
  .nav-controls.nav-account { display: flex; margin: 0; }  /* (sign out stays reachable on a phone) */
  nav a svg, .nav-sub, .nav-section, .nav-section[class*="t-"] { display: none; }
  nav a[class*="t-"].active { box-shadow: inset 0 -2px 0 var(--nc); }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; padding: 10px 16px; }
  nav { flex-direction: row; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  nav a { flex: none; }
  .sidebar-foot { margin: 0 0 0 auto; }
  main { padding: 16px; }
  .builder, .builder.swapped { grid-template-columns: 1fr; }
  .builder > [data-zone] { order: 0 !important; }
  .col-split { display: none; }
  .chart { height: var(--chart-h, 320px); }
  .fields { grid-template-columns: minmax(0, 1fr); }
}

/* The hidden attribute must win over display rules like .field { display: flex }. */
[hidden] { display: none !important; }
.field.disabled { opacity: .45; }
.field.disabled input, .field.disabled select { cursor: not-allowed; }

/* Prominent on/off card (Smart Trade: hidden orders) */
.toggle-card { border: 1px solid var(--accent); border-radius: 10px; padding: 12px 14px;
  background: color-mix(in srgb, var(--accent) 10%, transparent); }
.toggle-card.off { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 10%, transparent); }
.toggle { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.field .toggle { font-size: 13px; color: var(--text); }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bot-onoff { white-space: nowrap; }
.bot-switch { display: inline-flex; vertical-align: middle; margin-right: 6px; cursor: pointer; }
.bot-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bot-del-cell { width: 1%; text-align: right; white-space: nowrap; position: sticky; right: 0; z-index: 1;
  background: var(--panel); box-shadow: -10px 0 10px -8px rgb(0 0 0 / .35); }  /* (always in view when the table scrolls) */
.bot-edit, .bot-clone { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border-radius: 8px;
  background: transparent; border: 1px solid transparent; color: var(--muted); }
.bot-edit:hover, .bot-edit:focus-visible, .bot-clone:hover, .bot-clone:focus-visible { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent); }
.bot-del { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border-radius: 8px;
  background: transparent; border: 1px solid transparent; color: var(--muted); }
.bot-del:hover, .bot-del:focus-visible { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent);
  background: color-mix(in srgb, var(--red) 8%, transparent); }
.ask-kv { margin-top: 10px; color: var(--text); }
.safety-checks { margin: 6px 0 0; padding-left: 18px; }
.safety-checks li { margin: 3px 0; overflow-wrap: anywhere; }
.safety-details summary { cursor: pointer; color: var(--muted); }
.warn-mark { color: var(--amber); font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.toggle .switch { flex: none; position: relative; width: 44px; height: 24px; border-radius: 12px; margin-top: 1px;
  background: var(--amber); transition: background .15s; }
.toggle .switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle input:checked + .switch { background: var(--accent); }
.toggle input:checked + .switch::after { transform: translateX(20px); }
.toggle input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle-text { display: flex; flex-direction: column; gap: 3px; }
.toggle-text b { font-size: 14px; }
.toggle-state { color: var(--accent); }
.toggle-card.off .toggle-state { color: var(--amber); }
.toggle-desc { color: var(--muted); font-size: 12px; line-height: 1.4; }

/* Collapsible hints: one line with an (i) until opened */
details.hint { color: var(--muted); font-size: 12px; line-height: 1.45; min-width: 0; max-width: 100%; }
details.hint summary { list-style: none; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
details.hint summary::-webkit-details-marker { display: none; }
details.hint summary::before { content: "i"; display: inline-grid; place-items: center; width: 13px; height: 13px;
  margin-right: 6px; border: 1px solid currentColor; border-radius: 50%; font: italic 600 9px/1 Georgia, serif;
  vertical-align: 1px; }
details.hint[open] summary { white-space: normal; }
details.hint summary:hover { color: var(--text); }
.page-head > div { min-width: 0; }
.toggle-card .toggle-desc { margin: 6px 0 0 56px; }

/* deal start conditions */
.field-desc:empty { display: none; }
.field-desc { margin-top: 2px; }
.conds { display: flex; flex-direction: column; gap: 8px; }
.cond { border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.cond-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: end; }
.cond-line > select[data-k=indicator] { flex: 1 1 180px; min-width: 0; }
.cond-line > .cond-tf { flex: 0 0 76px; }
.cond-param { display: flex; flex-direction: column; gap: 2px; flex: 1 1 70px; min-width: 64px; font-size: 11px; color: var(--muted); }
.cond-del { padding: 4px 10px; font-size: 16px; line-height: 1; }
.cond-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 11px; }
.cond-now:empty { display: none; }
.add-cond { align-self: flex-start; margin-top: 8px; font-size: 12px; padding: 5px 10px; }
.copy-row { display: flex; gap: 6px; }
.copy-row input { flex: 1; min-width: 0; font-size: 12px; }
.webhook .field { margin-bottom: 8px; }
.cond-param:has(select) { min-width: 116px; }

/* chart: toolbar, legend, expand / floating / fullscreen / pop-out window */
.chart-panel { display: flex; flex-direction: column; }
.chart-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; max-width: 100%; justify-content: flex-end; }
.chart-modes { display: flex; gap: 2px; border-left: 1px solid var(--border); padding-left: 8px; }
.chart-modes button { padding: 4px 6px; border: none; background: transparent; color: var(--muted); display: grid; place-items: center; }
.chart-modes button:hover { color: var(--text); background: var(--panel-2); }
.chart-modes button.on { color: var(--accent); background: var(--panel-2); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; min-height: 16px; margin-bottom: 4px; }
.chart { position: relative; }
/* drawings over the chart, and their tool bar */
.draw-layer { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.draw-layer.placing { pointer-events: all; cursor: crosshair; touch-action: none; }
.draw-layer .hit { stroke: transparent; stroke-width: 12; fill: none; pointer-events: auto; cursor: move; touch-action: none; }
.draw-layer .hit.area { fill: transparent; stroke-width: 6; }
.draw-layer.placing .hit, .draw-layer.placing .h { pointer-events: none; }
.draw-layer .locked .hit { cursor: default; }
.draw-layer .h { fill: var(--panel); stroke-width: 2; pointer-events: auto; cursor: grab; touch-action: none; }
.draw-layer .sel line:not(.hit), .draw-layer .sel path:not(.hit), .draw-layer .sel rect:not(.hit) { filter: drop-shadow(0 0 3px rgb(80 120 255 / .7)); }
.dw-label { font: 600 11px Inter, sans-serif; paint-order: stroke; stroke: var(--panel); stroke-width: 3px; stroke-linejoin: round; }
.dw-measure { font-size: 12px; }
.dw-note { font: 600 14px Inter, sans-serif; paint-order: stroke; stroke: var(--panel); stroke-width: 4px; stroke-linejoin: round; }
.draw-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 4px; margin-bottom: 6px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); }
.draw-bar[hidden] { display: none; }
.draw-bar button { padding: 5px 6px; border: none; background: transparent; color: var(--muted); display: grid; place-items: center; border-radius: 6px; }
.draw-bar button:hover:not(:disabled) { color: var(--text); background: var(--panel); }
.draw-bar button.on { color: #fff; background: var(--accent); }
.draw-bar button:disabled { opacity: .35; }
.db-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.db-colors { display: flex; gap: 3px; }
.draw-bar .db-color { width: 18px; height: 18px; padding: 0; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 2px rgb(0 0 0 / .15); }
.draw-bar .db-color:hover:not(:disabled) { background: var(--c); transform: scale(1.15); }
.draw-bar .db-color.on { background: var(--c); box-shadow: 0 0 0 2px var(--panel-2), 0 0 0 4px var(--c); }
.draw-bar.floating { position: absolute; z-index: 5; margin: 0; display: grid; grid-template-columns: repeat(2, 30px); gap: 2px;
  max-height: calc(100% - 4px); overflow-y: auto; background: var(--panel); box-shadow: 0 8px 24px #0005; }
.draw-bar.floating[hidden] { display: none; }
.draw-bar.floating button { padding: 5px; }
.draw-bar.floating .db-sep { grid-column: 1 / -1; width: auto; height: 1px; margin: 3px 2px; }
.draw-bar.floating .db-colors { display: contents; }
.draw-bar.floating .db-color { justify-self: center; margin: 3px 0; }
.db-grip { grid-column: 1 / -1; height: 12px; cursor: grab; touch-action: none; border-radius: 4px; opacity: .7;
  background: radial-gradient(circle, var(--muted) 1.1px, transparent 1.6px) center / 6px 6px; }
.db-grip:active { cursor: grabbing; }
/* right-click menu of a drawing */
.draw-menu { position: fixed; z-index: 120; min-width: 230px; max-height: calc(100vh - 16px); overflow-y: auto; padding: 6px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px #0006; animation: tcm-in .12s ease-out; }
.dm-head { font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 8px 6px; }
.dm-colors, .dm-widths { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 8px; }
.dm-colors .db-color { width: 20px; height: 20px; padding: 0; border: none; border-radius: 50%; background: var(--c); cursor: pointer;
  box-shadow: inset 0 0 0 2px rgb(0 0 0 / .15); }
.dm-colors .db-color.on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--c); }
.dm-widths button { padding: 3px 4px; border: 1px solid var(--border); border-radius: 6px; background: transparent; color: var(--text); display: grid; place-items: center; }
.dm-widths button.on { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.dm-sep { height: 1px; background: var(--border); margin: 5px 4px; }
.draw-menu > button { display: flex; align-items: center; gap: 6px; width: 100%; padding: 7px 8px; border: none; border-radius: 6px;
  background: transparent; color: var(--text); text-align: left; cursor: pointer; font-size: 13px; }
.draw-menu > button:hover:not(:disabled), .draw-menu > button:focus-visible { background: var(--panel-2); }
.draw-menu > button:disabled { opacity: .4; cursor: default; }
.draw-menu > button[data-act="delete"]:not(:disabled) { color: var(--red); }
.dm-check { width: 16px; color: var(--accent); font-weight: 700; flex: none; }
/* the chart's right-click menu: orders and levels at a price */
.price-menu { min-width: 270px; max-width: min(360px, calc(100vw - 16px)); }
.pm-head { padding: 6px 8px 4px; font-size: 15px; }
.price-menu > .dm-sep:first-of-type { margin-top: 6px; }
.pm-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; margin: 0 3px; background: var(--muted); }
.pm-buy, .pm-tp { background: var(--green); }
.pm-sell, .pm-sl { background: var(--red); }
.pm-tp, .pm-sl { border-radius: 50%; }
.pm-move { background: var(--accent); border-radius: 50%; }
.pm-draw { background: transparent; border: 2px solid var(--accent); height: 2px; border-width: 2px 0 0; border-radius: 0; }
.pm-plain { background: transparent; box-shadow: inset 0 0 0 1px var(--border); }
.pm-label { flex: 1; }
.pm-note { color: var(--muted); font-size: 11.5px; margin-left: 10px; white-space: nowrap; }
.price-menu > button:disabled .pm-note { display: none; }
/* the note editor, beside the spot */
.note-ed { --nc: var(--accent); position: fixed; z-index: 120; width: 320px; max-width: calc(100vw - 16px); display: flex; flex-direction: column; gap: 8px;
  padding: 12px; background: var(--panel); border: 1px solid color-mix(in srgb, var(--nc) 45%, var(--border)); border-radius: 14px;
  box-shadow: 0 14px 36px #0006, 0 0 0 4px color-mix(in srgb, var(--nc) 12%, transparent); animation: ne-in .18s cubic-bezier(.2, 1.4, .4, 1); }
.note-ed.ne-out { animation: ne-out .14s ease-in forwards; }
.ne-top { display: flex; justify-content: space-between; align-items: center; }
.ne-title { font-weight: 700; }
.ne-count { font-size: 11px; color: var(--muted); }
.note-ed textarea { width: 100%; resize: vertical; min-height: 38px; padding: 8px 10px; border-radius: 9px; font: 600 15px Inter, sans-serif;
  border: 1px solid var(--border); background: var(--panel-2); outline: none; transition: border-color .15s, box-shadow .15s; }
.note-ed textarea:focus { border-color: var(--nc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--nc) 20%, transparent); }
.ne-emoji { display: flex; flex-wrap: wrap; gap: 2px; }
.ne-emoji button { padding: 3px 5px; border: none; border-radius: 7px; background: transparent; font-size: 17px; line-height: 1; cursor: pointer; transition: transform .12s; }
.ne-emoji button:hover { background: var(--panel-2); transform: scale(1.2) rotate(-6deg); }
.ne-emoji button.pop { animation: ne-pop .3s ease-out; }
.ne-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.ne-colors { display: flex; gap: 4px; }
.ne-colors .db-color { width: 18px; height: 18px; padding: 0; border: none; border-radius: 50%; background: var(--c); cursor: pointer;
  box-shadow: inset 0 0 0 2px rgb(0 0 0 / .15); transition: transform .12s; }
.ne-colors .db-color:hover { transform: scale(1.15); }
.ne-colors .db-color.on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--c); }
.ne-sizes { display: flex; gap: 2px; }
.ne-sizes button { width: 28px; height: 26px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: transparent; color: var(--text);
  font-weight: 700; display: grid; place-items: center; cursor: pointer; }
.ne-sizes button.on { border-color: var(--nc); color: var(--nc); background: color-mix(in srgb, var(--nc) 12%, transparent); }
.ne-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ne-btns { display: flex; gap: 6px; }
.ne-btns button { padding: 6px 12px; white-space: nowrap; }
.ne-hint { font-size: 11px; line-height: 1.3; }
.ne-ok { background: var(--nc) !important; border-color: var(--nc) !important; }
.note-pin { --nc: var(--accent); position: fixed; z-index: 119; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: var(--nc); box-shadow: 0 0 0 0 color-mix(in srgb, var(--nc) 60%, transparent); animation: ne-ping 1.2s ease-out infinite; pointer-events: none; }
@keyframes ne-in { from { opacity: 0; transform: translateY(6px) scale(.94); } }
@keyframes ne-out { to { opacity: 0; transform: scale(.96); } }
@keyframes ne-pop { 50% { transform: scale(1.5) rotate(10deg); } }
@keyframes ne-ping { 80%, 100% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--nc) 0%, transparent); } }
@media (prefers-reduced-motion: reduce) { .note-ed, .note-pin, .ne-emoji button, .draw-menu { animation: none !important; } }
.chart-busy { position: absolute; left: 8px; top: 8px; z-index: 3; font-size: 11px; color: var(--muted);
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; }
.chart-panel.chart-expanded { margin-bottom: 16px; }
.chart-panel.chart-expanded .chart { height: 70vh; min-height: 360px; }
.chart-panel.chart-floating { position: fixed; z-index: 20; resize: both; overflow: hidden; padding: 10px 12px 14px;
  box-shadow: 0 18px 50px rgb(0 0 0 / .45); min-width: 320px; min-height: 240px; }
.chart-panel.chart-floating .chart-head { cursor: move; user-select: none; touch-action: none; }
.chart-panel.chart-floating .chart,
.chart-panel:fullscreen .chart,
.chart-panel.chart-fs .chart,
.chart-window .chart-panel .chart { flex: 1; height: auto; min-height: 0; }
.chart-panel:fullscreen { border-radius: 0; border: none; padding: 14px 18px; background: var(--panel); }
.chart-panel.chart-fs { position: fixed; inset: 0; z-index: 30; border-radius: 0; resize: none;
  left: 0 !important; top: 0 !important; width: auto !important; height: auto !important; }
body.chart-window { display: block; }
body.chart-window .sidebar, body.chart-window .nav-edge { display: none; }
body.chart-window main { padding: 0; }
body.chart-window .topbar { display: none; }
body.chart-window .chart-panel { height: 100vh; border: none; border-radius: 0; }
.fields > * { min-width: 0; } /* one-line hints must not widen the form on phones */

/* pairs: most-used chips and coin icons */
.pair-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pair-chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 5px; font-size: 12px; border-radius: 999px; }
.chip.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.coin { display: inline-block; vertical-align: middle; flex: none; border-radius: 50%; }
.coin-letter { display: inline-grid; place-items: center; background: var(--panel-2); color: var(--muted);
  border: 1px solid var(--border); font-weight: 600; font-family: Inter, sans-serif; }
.pair { display: inline-flex; align-items: center; gap: 6px; }
.chart-title { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; min-width: 0; }
.chart-coin { grid-row: span 2; display: flex; }
.chart-coin:empty { display: none; }

/* chart pair picker: the pair at the chart's top left opens every pair of its exchange */
.pp-btn { display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: center; justify-items: start; text-align: left;
  padding: 3px 8px 3px 4px; border: 1px solid transparent; background: transparent; color: var(--text); border-radius: 8px; min-width: 0; }
.pp-btn:hover:not(:disabled), .pp-btn[aria-expanded="true"] { background: var(--panel-2); border-color: var(--border); }
.pp-btn:disabled { opacity: 1; cursor: default; }
.pp-name { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; white-space: nowrap; }
.pp-tag { font-size: 10px; font-weight: 600; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
.pp-tag:empty { display: none; }
.pp-caret { color: var(--muted); transition: transform .15s; }
.pp-btn[aria-expanded="true"] .pp-caret { transform: rotate(180deg); }
.pp-sub { grid-column: 2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pp-sub:empty { display: none; }
.pp-star, .pp-fav { border: none; background: transparent; color: var(--muted); padding: 2px 4px; font-size: 15px; line-height: 1; }
.pp-star.on, .pp-fav.on { color: var(--amber); }
.pp-star:hover, .pp-fav:hover { color: var(--amber); }
.pp-pop { position: fixed; z-index: 160; display: flex; flex-direction: column; min-height: 260px; padding: 8px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 16px 40px #0007; animation: tcm-in .12s ease-out; }
.pp-pop.pp-sheet { left: 0; right: 0; bottom: 0; top: auto; width: auto; height: 82vh; max-height: none; border-radius: 14px 14px 0 0;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
.pp-top { display: flex; gap: 6px; }
.pp-q { flex: 1; min-width: 0; }
.pp-x { padding: 4px 10px; }
.pp-tabs { display: flex; gap: 2px; margin-top: 8px; border-bottom: 1px solid var(--border); }
.pp-tabs button { border: none; background: transparent; color: var(--muted); padding: 6px 10px; border-radius: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 13px; }
.pp-tabs button.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.pp-quotes { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.pp-quotes .chip { padding: 2px 9px; }
.pp-cols, .pp-row { display: grid; grid-template-columns: 24px minmax(0, 1.5fr) minmax(0, 1fr) 64px minmax(0, .8fr); align-items: center; gap: 6px; }
.pp-cols { margin-top: 6px; padding: 0 6px; }
.pp-cols button { border: none; background: transparent; color: var(--muted); font-size: 11px; padding: 4px 0; text-align: right; }
.pp-cols button:first-child { text-align: left; grid-column: span 2; }
.pp-cols button.on { color: var(--text); }
.pp-cols button.on::after { content: attr(data-dir); margin-left: 3px; font-size: 9px; }
.pp-list { position: relative; flex: 1; min-height: 180px; overflow-y: auto; overscroll-behavior: contain; }
.pp-rows { position: absolute; inset: 0 0 auto 0; }
.pp-row { position: absolute; left: 0; right: 0; height: 36px; padding: 0 6px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.pp-p { display: flex; align-items: center; gap: 2px; min-width: 0; overflow: hidden; white-space: nowrap; }
.pp-p > .coin { margin-right: 6px; }
.pp-row:hover, .pp-row.on { background: var(--panel-2); }
.pp-row.on { box-shadow: inset 2px 0 0 var(--accent); }
.pp-row.here b { color: var(--accent); }
.pp-last, .pp-chg, .pp-vol { text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-chg.up { color: var(--green); }
.pp-chg.down { color: var(--red); }
.pp-lev { font-size: 11px; margin-left: 4px; }
.pp-p .suggest-tag { margin-left: 5px; font-size: 10px; }
.pp-empty { padding: 18px 8px; text-align: center; font-size: 12px; }
.pp-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-top: 8px; margin-top: 4px; border-top: 1px solid var(--border); font-size: 12px; }
@media (max-width: 600px) {
  .pp-cols, .pp-row { grid-template-columns: 24px minmax(0, 1.4fr) minmax(0, 1fr) 62px; }
  .pp-vol, .pp-cols [data-sort="volume"] { display: none; }
}
#b-name { display: flex; align-items: center; gap: 10px; }

/* pair search dropdown */
.pair-search { position: relative; }
.pair-suggest { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 25; max-height: 320px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 12px 32px rgb(0 0 0 / .3); padding: 4px; }
.suggest-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 6px; cursor: pointer; }
.suggest-row:hover, .suggest-row.on { background: var(--panel-2); }
.suggest-row.on { box-shadow: inset 2px 0 0 var(--accent); }
.suggest-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-name u { text-decoration: none; color: var(--accent); }
.suggest-tag { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; }
.suggest-empty { padding: 10px; font-size: 12px; }
.pair-suggest.stale .suggest-row { opacity: .5; }

/* Analyze panel in the DCA / Grid builders */
.an-table td:first-child { white-space: normal; min-width: 140px; }
.an-table td, .an-table th { padding: 8px 6px; }
.an-kv { grid-template-columns: repeat(2, 1fr); }

/* page layout: grips, drop placeholder, collapsing, chart height bar, column splitter */
[data-pk] { position: relative; }
.grip { position: absolute; top: 1px; left: 50%; transform: translateX(-50%) rotate(90deg); padding: 0 2px; border: none;
  background: transparent; color: var(--muted); opacity: 0; cursor: grab; touch-action: none; line-height: 0; z-index: 2; }
[data-pk]:hover > .grip, .grip:focus-visible { opacity: .6; }
.grip:hover, .grip:focus-visible { opacity: 1; color: var(--text); }
@media (hover: none) { .grip { opacity: .45; } }
.chart-expanded > .grip, .chart-floating > .grip, .chart-fs > .grip, :fullscreen > .grip, .chart-window .grip { display: none; }
[data-pk].dragging { box-shadow: 0 12px 32px #0006; opacity: .92; }
body.panel-dragging, body.panel-dragging * { cursor: grabbing !important; user-select: none; }
.panel-ph { border: 2px dashed color-mix(in srgb, var(--accent) 55%, transparent); border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 6%, transparent); }
body.panel-dragging [data-zone] { min-height: 80px; }
[data-pk] > h2, [data-pk] > :has(> h2) > h2 { cursor: pointer; user-select: none; }
[data-pk] > h2::after, [data-pk] > :has(> h2) > h2::after { content: "▾"; margin-left: 6px; color: var(--muted); font-size: 12px; display: inline-block; transition: transform .15s; }
[data-pk].collapsed > h2, [data-pk].collapsed > :has(> h2) { margin-bottom: 0; }
[data-pk].collapsed > h2::after, [data-pk].collapsed > :has(> h2) > h2::after { transform: rotate(-90deg); }
[data-pk].collapsed > :not(h2):not(.grip):not(.ptools):not(.pname):not(:has(> h2)) { display: none !important; }
.chart-resize { height: 10px; margin: 4px -16px -12px; cursor: row-resize; position: relative; touch-action: none; }
.chart-resize::after { content: ""; position: absolute; left: 50%; top: 4px; width: 36px; height: 3px; border-radius: 2px;
  transform: translateX(-50%); background: var(--border); }
.chart-resize:hover::after, .chart-resize:focus-visible::after { background: var(--accent); }
.chart-expanded > .chart-resize, .chart-floating > .chart-resize, .chart-fs > .chart-resize, :fullscreen > .chart-resize { display: none; }
.col-split { align-self: stretch; position: relative; cursor: col-resize; touch-action: none; }
.col-split::before { content: ""; position: absolute; inset: 0 -8px; }
.col-split::after { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; border-radius: 1px; background: transparent; }
.col-split:hover::after { background: color-mix(in srgb, var(--accent) 60%, transparent); }
.layout-tools { display: flex; gap: 6px; margin-left: auto; }
.layout-tools button { color: var(--muted); font-weight: 500; }
.an-row { grid-template-columns: repeat(4, 1fr) auto; align-items: end; margin-top: 10px; }
.st-row { grid-template-columns: repeat(3, 1fr) auto; }
.st-verdict { margin: 14px 0 10px; }
.st-table tr.st-best td { background: color-mix(in srgb, var(--green) 9%, transparent); }
.st-best .badge { color: var(--green); border-color: color-mix(in srgb, var(--green) 45%, transparent); padding: 1px 7px; font-size: 11px; }
.st-meta { margin-top: 8px; line-height: 1.5; }
.st-table th, .st-table td { padding-left: 8px; padding-right: 8px; }
.st-table td:first-child { white-space: normal; min-width: 130px; }
.an-go { padding: 7px 18px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.an-go:hover { filter: brightness(1.1); border-color: var(--accent); }
#an-panel, #st-panel { container-type: inline-size; }
@container (max-width: 620px) {  /* the panel's width, which the sidebar and builder columns decide */
  .an-row { grid-template-columns: 1fr 1fr; }
  .st-row { grid-template-columns: 1fr 1fr 1fr; }
  .an-go { grid-column: 1 / -1; justify-self: start; }
}
@container (max-width: 420px) { .st-row { grid-template-columns: 1fr 1fr; } }
@container (max-width: 300px) { .an-row { grid-template-columns: 1fr; } }

/* live trading */
.acct-note { margin-top: 6px; color: var(--muted); }
#form.is-live { border-color: color-mix(in srgb, var(--red) 55%, var(--border)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--red) 30%, transparent); }
#form.is-live #go-btn, .live-go { background: var(--red); border-color: var(--red); color: #fff; }
.modal-back { position: fixed; inset: 0; z-index: 100; background: rgb(0 0 0 / .55); display: grid; place-items: center; padding: 16px; }
.modal { width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; }

/* questions (ask()): one look for every confirmation */
.ask-back { z-index: 200; background: rgb(8 10 14 / .5); backdrop-filter: blur(6px) saturate(1.1); animation: ask-fade .16s ease-out; }
.ask { --tone: var(--accent); width: min(420px, 100%); background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  padding: 26px 24px 20px; text-align: center; position: relative; overflow: hidden auto; max-height: calc(100dvh - 32px);
  box-shadow: 0 24px 60px rgb(0 0 0 / .45), 0 0 0 1px color-mix(in srgb, var(--tone) 18%, transparent);
  animation: ask-pop .2s cubic-bezier(.2, .9, .3, 1.2); }
.ask::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, transparent, var(--tone), transparent); }
.ask-danger, .ask-live { --tone: var(--red); }
.ask-warn { --tone: var(--amber); }
.ask-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; color: var(--tone);
  background: radial-gradient(circle, color-mix(in srgb, var(--tone) 22%, transparent), color-mix(in srgb, var(--tone) 8%, transparent));
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--tone) 7%, transparent); }
.ask h2 { margin: 0 0 8px; font-size: 1.15rem; }
.ask-body { color: var(--muted); line-height: 1.5; }
.ask-body p { margin: 0 0 8px; }
.ask-input { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; padding: 0 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; }
.ask-input:focus-within { border-color: var(--tone); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone) 20%, transparent); }
.ask-input input { flex: 1; min-width: 0; border: 0; background: transparent; color: inherit; font: inherit; font-size: 1.05rem; padding: 10px 0; outline: none; text-align: center; }
.ask-input span { color: var(--muted); }
.ask-input input::-webkit-inner-spin-button, .ask-input input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.ask-input input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.ask-err { color: var(--red); margin-top: 6px; }
.ask-choices { display: grid; gap: 6px; margin: 4px 0 14px; }
.ask-choice { display: flex; gap: 10px; align-items: flex-start; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; text-align: left; }
.ask-choice:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.ask-choice input { flex: none; margin-top: 3px; accent-color: var(--accent); }
.ask-choice > span { flex: 1; display: grid; gap: 2px; justify-items: start; }
.ask-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.ask-actions button { padding: 10px 14px; border-radius: 10px; font-weight: 600; }
.ask-yes { background: var(--tone); border-color: var(--tone); color: var(--accent-text); }
.ask-danger .ask-yes, .ask-live .ask-yes { color: #fff; }
.ask-warn .ask-yes { color: #1a1300; }
.ask-back.closing { animation: ask-fade .14s ease-in reverse forwards; }
.ask-back.closing .ask { animation: ask-pop .14s ease-in reverse forwards; }
@keyframes ask-fade { from { opacity: 0; } }
@keyframes ask-pop { from { opacity: 0; transform: translateY(8px) scale(.96); } }
@media (prefers-reduced-motion: reduce) { .ask-back, .ask, .ask-back.closing, .ask-back.closing .ask { animation: none; } }
.kill-on { border-color: color-mix(in srgb, var(--red) 55%, var(--border)); }
[data-acct] details summary { cursor: pointer; color: var(--accent, var(--text)); font-weight: 600; }
[data-acct] .field input { width: 100%; }
#lv pre { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; white-space: pre-wrap; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  margin: -24px -28px 20px; padding: 10px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }

/* live look (applyEnvLook): real money is never mistaken for paper */
body.env-live { --env-c: var(--red); }
body.env-testnet { --env-c: var(--purple); }
body.env-live button.primary, body.env-live button.real { background: var(--red); border-color: var(--red); color: #fff; }
body.env-testnet button.primary, body.env-testnet button.real { background: var(--purple); border-color: var(--purple); color: #fff; }
.topbar { row-gap: 10px; }
.tb-banner { flex: 0 0 calc(100% + 56px); order: -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: -10px -28px 0; padding: 4px 28px; font-size: 12.5px; font-weight: 600; color: #fff; background: var(--env-c); }
.tb-banner[hidden] { display: none; }
.lb-tag { font-weight: 800; letter-spacing: .08em; font-size: 11px; padding: 1px 8px; border-radius: 999px; color: var(--env-c); background: #fff; }
.lb-tag::first-letter { animation: lb-pulse 1.6s ease-in-out infinite; }
@keyframes lb-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .lb-tag::first-letter { animation: none; } }
.tb-banner > b { color: #fff; }
.lb-where { font-weight: 500; color: rgba(255,255,255,.88); }
.tb-banner .sm { padding: 3px 10px; font-size: 12px; }
.lb-kill { margin-left: auto; background: #fff; color: var(--env-c); border-color: #fff; font-weight: 700; }
.lb-kill:hover { background: #fee2e2; }
.lb-paused { margin-left: auto; color: #fff; text-decoration: underline; }
.lb-paper { margin-left: auto; background: transparent; color: #fff; border-color: rgba(255,255,255,.7); font-weight: 600; }
.lb-paper:hover { background: rgba(255,255,255,.15); border-color: #fff; }
.lb-paper + .lb-kill, .lb-paper + .lb-paused { margin-left: 8px; }
.tb-livechip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; text-decoration: none;
  padding: 3px 10px; border-radius: 999px; border: 1px solid; }
.tb-livechip[hidden] { display: none; }
.tb-livechip.live { color: var(--red); border-color: color-mix(in srgb, var(--red) 55%, transparent); background: color-mix(in srgb, var(--red) 10%, transparent); }
.tb-livechip.testnet { color: var(--purple); border-color: color-mix(in srgb, var(--purple) 55%, transparent); }
.tb-livechip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: live-pulse 1.6s ease-in-out infinite; }
tr.row-live td:first-child { box-shadow: inset 3px 0 0 var(--red); }
tr.row-testnet td:first-child { box-shadow: inset 3px 0 0 var(--purple); }
#form.is-testnet { border-color: color-mix(in srgb, var(--purple) 55%, var(--border)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--purple) 30%, transparent); }
#form.is-testnet #go-btn { background: var(--purple); border-color: var(--purple); color: #fff; }
body.chart-window.env-live::before, body.chart-window.env-testnet::before { position: fixed; bottom: 8px; left: 50%; transform: translateX(-50%);
  z-index: 91; pointer-events: none; padding: 2px 10px; border-radius: 999px; background: var(--env-c); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .06em; }
body.chart-window.env-live::before { content: "● LIVE · REAL MONEY"; }
body.env-live .chart-panel:fullscreen, body.env-testnet .chart-panel:fullscreen { box-shadow: inset 0 0 0 3px var(--env-c); }
body.env-live .chart-panel:fullscreen::after, body.env-testnet .chart-panel:fullscreen::after { position: absolute; bottom: 8px; left: 50%;
  transform: translateX(-50%); z-index: 5; pointer-events: none; padding: 2px 10px; border-radius: 999px; background: var(--env-c);
  color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .06em; }
body.env-live .chart-panel:fullscreen::after { content: "● LIVE · REAL MONEY"; }
body.env-testnet .chart-panel:fullscreen::after { content: "● TESTNET"; }
body.chart-window.env-testnet::before { content: "● TESTNET"; }
/* exchange logos */
.ex-label { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }
.ex-logo { border-radius: 22%; flex: none; object-fit: cover; vertical-align: middle; box-shadow: 0 0 0 1px rgb(127 127 127 / .2); }
.check .ex-logo { margin-right: 6px; }
.ex-head { display: flex; align-items: center; gap: 10px; }
.conn-cta-art { position: relative; }
.conn-cta-art .ex-logo { display: block; border-radius: 12px; }
.conn-plug { position: absolute; right: -10px; bottom: -8px; font-size: 20px; }
.wiz-ex { display: inline-flex; align-items: center; gap: 8px; }
#ex-seg button { display: inline-flex; justify-content: center; }

/* connecting an exchange: the step-by-step dialog */
.conn-cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px; border-radius: 12px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 12%, var(--panel-2)), color-mix(in srgb, var(--green) 10%, var(--panel-2)));
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--border)); }
.conn-cta > div:nth-child(2) { flex: 1 1 220px; }
.conn-cta-art { font-size: 34px; animation: wiz-bob 2.4s ease-in-out infinite; }
.conn-cta-art .ex-logo { width: 44px; height: 44px; }
.wiz { width: min(600px, 100%); position: relative; display: flex; flex-direction: column; gap: 16px; padding: 22px 24px; overflow-x: hidden; }
.wiz-x { position: absolute; top: 10px; right: 12px; border: 0; background: transparent; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 8px; }
.wiz-top { display: flex; flex-direction: column; gap: 10px; }
.wiz-ex { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.wiz-steps { display: flex; justify-content: space-between; gap: 4px; }
.wiz-dot { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; min-width: 0; color: var(--muted); }
.wiz-dot span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700;
  border: 2px solid var(--border); background: var(--panel); transition: all .25s; }
.wiz-dot small { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.wiz-dot.on { color: var(--text); }
.wiz-dot.on span { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); transform: scale(1.08); }
.wiz-dot.done span { border-color: var(--green); background: var(--green); color: #fff; }
.wiz-bar { height: 4px; border-radius: 4px; background: var(--panel-2); overflow: hidden; }
.wiz-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--green)); transition: width .4s ease; }
.wiz-body { display: flex; flex-direction: column; gap: 12px; }
.wiz-body.wiz-anim { animation: wiz-in .3s ease-out; }
.wiz-body h2 { margin: 0; font-size: 21px; }
.wiz-body p { margin: 0; }
.wiz-art { font-size: 44px; line-height: 1; }
.wiz-art.pop { animation: wiz-pop .5s cubic-bezier(.2, 1.6, .4, 1); }
.wiz-art.spin { animation: wiz-bob 1s ease-in-out infinite; }
.wiz-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wiz-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; padding: 16px; border-radius: 12px; cursor: pointer;
  border: 2px solid var(--border); background: var(--panel-2); color: inherit; font: inherit; transition: transform .15s, border-color .15s, box-shadow .15s; }
.wiz-choice:hover { transform: translateY(-2px); }
.wiz-choice.live:hover, .wiz-choice.live.on { border-color: var(--red); box-shadow: 0 10px 30px -14px var(--red); }
.wiz-choice.test:hover, .wiz-choice.test.on { border-color: var(--purple); box-shadow: 0 10px 30px -14px var(--purple); }
.wc-art { font-size: 30px; }
.wiz-link { display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 9px 14px; border-radius: 10px; font-weight: 600;
  background: color-mix(in srgb, var(--accent) 14%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.wiz-checks { display: flex; flex-direction: column; gap: 8px; }
.wiz-check { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); cursor: pointer; transition: background .15s, border-color .15s; }
.wiz-check input { position: absolute; opacity: 0; pointer-events: none; }
.wiz-check .wc-box { flex: none; width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--border); display: grid; place-items: center;
  color: transparent; font-weight: 800; font-size: 13px; transition: all .2s; }
.wiz-check.on { border-color: color-mix(in srgb, var(--green) 55%, var(--border)); background: color-mix(in srgb, var(--green) 8%, transparent); }
.wiz-check.on .wc-box { background: var(--green); border-color: var(--green); color: #fff; transform: scale(1.1); }
.wiz-check:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.wiz-input { display: flex; gap: 6px; }
.wiz-input input { flex: 1; min-width: 0; font-family: "JetBrains Mono", monospace; }
.wiz-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.wiz-run { display: flex; flex-direction: column; gap: 8px; }
.wr { display: flex; align-items: center; gap: 10px; color: var(--muted); transition: color .2s; }
.wr-i { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.wr.busy { color: var(--text); }
.wr.busy .wr-i { border-color: var(--accent); border-top-color: transparent; animation: wiz-spin .8s linear infinite; }
.wr.done { color: var(--text); }
.wr.done .wr-i { background: var(--green); border-color: var(--green); color: #fff; }
.wr.done .wr-i::after { content: "✓"; }
.wiz-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.wiz-nav-r { display: flex; gap: 8px; }
.wiz-done-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.confetti { position: fixed; top: -12px; width: 9px; height: 14px; border-radius: 2px; z-index: 210; pointer-events: none; animation: confetti-fall linear forwards; }
@keyframes confetti-fall { to { transform: translate(var(--dx), 105vh) rotate(var(--r)); opacity: .9; } }
@keyframes wiz-in { from { opacity: 0; transform: translateX(14px); } }
@keyframes wiz-pop { from { transform: scale(.3); opacity: 0; } }
@keyframes wiz-bob { 50% { transform: translateY(-5px); } }
@keyframes wiz-spin { to { transform: rotate(360deg); } }
@media (max-width: 600px) { .wiz { padding: 18px 16px; } .wiz-choices { grid-template-columns: 1fr; } .wiz-dot small { display: none; } }
@media (prefers-reduced-motion: reduce) { .wiz *, .conn-cta-art { animation: none !important; transition: none !important; } }

/* news warnings */
.tb-news { display: inline-flex; align-items: center; gap: 6px; max-width: 320px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; border: 1px solid; background: transparent; cursor: pointer; }
.tb-news[hidden] { display: none; }
.tb-news.high { color: var(--red); border-color: color-mix(in srgb, var(--red) 55%, transparent); background: color-mix(in srgb, var(--red) 10%, transparent); }
.tb-news.medium { color: #f97316; border-color: color-mix(in srgb, #f97316 55%, transparent); background: color-mix(in srgb, #f97316 10%, transparent); }
.news-pop { width: min(520px, 100%); border-top: 4px solid #f97316; }
.news-pop.high { border-top-color: var(--red); box-shadow: 0 0 0 1px color-mix(in srgb, var(--red) 35%, transparent), 0 20px 60px color-mix(in srgb, var(--red) 25%, transparent); }
.nw-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nw-impact { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 2px 10px; border-radius: 999px; color: #fff; background: #f97316; }
.news-pop.high .nw-impact { background: var(--red); }
.nw-cur { font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--panel-2); }
.news-pop h2 { margin: 0; font-size: 22px; }
.nw-count { display: flex; align-items: baseline; gap: 12px; }
.nw-count #nw-count { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.news-pop.high #nw-count { color: var(--red); }
.nw-actions { flex-wrap: wrap; }
.nw-dot, .ns-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #f97316; margin-right: 4px; vertical-align: middle; }
.nw-dot.high, .ns-item.high .ns-dot { background: var(--red); }
.news-strip { margin-bottom: 16px; padding: 12px 16px; }
.ns-head { display: flex; align-items: center; justify-content: space-between; }
.ns-head h2 { margin: 0 0 8px; font-size: 15px; }
.ns-list { display: flex; flex-direction: column; gap: 2px; }
.ns-item { display: grid; grid-template-columns: auto 44px 1fr auto; align-items: center; gap: 8px; text-align: left; width: 100%;
  background: transparent; border: 0; border-radius: 6px; padding: 5px 6px; color: inherit; font: inherit; cursor: pointer; }
.ns-item:hover { background: var(--panel-2); }
.ns-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) { .ns-item { grid-template-columns: auto 40px 1fr; } .ns-when { grid-column: 2 / -1; } }
.env-notice { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; cursor: pointer;
  background: color-mix(in srgb, var(--env-n) 22%, rgba(0, 0, 0, .72)); animation: en-in .25s ease-out; }
.env-notice.live { --env-n: var(--red); }
.env-notice.testnet { --env-n: var(--purple); }
.env-notice.out { opacity: 0; transition: opacity .3s; }
.en-card { text-align: center; padding: 28px 36px; border-radius: 16px; max-width: min(92vw, 520px); color: #fff;
  border: 2px solid var(--env-n); background: color-mix(in srgb, var(--env-n) 18%, #0d1117);
  box-shadow: 0 0 60px color-mix(in srgb, var(--env-n) 45%, transparent); animation: en-pop .3s ease-out; }
.en-tag { display: inline-block; font-weight: 800; letter-spacing: .1em; padding: 3px 12px; border-radius: 999px; background: var(--env-n); margin-bottom: 12px; }
.en-title { font-size: 22px; font-weight: 700; }
.en-sub { margin-top: 8px; opacity: .85; }
@keyframes en-in { from { opacity: 0; } }
@keyframes en-pop { from { transform: scale(.92); opacity: 0; } }
.tb-acct { position: relative; }
/* Paper / Live: the app's mode. Live wears a pulsing red light. */
.tb-mode { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel-2); }
.tb-mode button { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; border-radius: 999px;
  padding: 5px 14px; font-weight: 700; font-size: 13px; color: var(--muted); cursor: pointer; }
.tb-mode button:hover:not(.on) { color: var(--text); }
.tb-mode button.on[data-mode="paper"] { background: var(--panel); color: var(--text); box-shadow: 0 0 0 1px var(--border); }
.tb-mode button.on[data-mode="live"] { background: #b91c1c; color: #fff; }
.tb-mode .light, .acct-mode .light { width: 9px; height: 9px; border-radius: 50%; background: color-mix(in srgb, var(--muted) 60%, transparent); flex: none; }
.tb-mode button.on[data-mode="live"] .light, .acct-mode.live .light { background: #ff3b3b; animation: live-pulse 1.4s ease-out infinite; }
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 59, 59, .85); opacity: 1; }
  50% { opacity: .55; }
  70% { box-shadow: 0 0 0 7px rgba(255, 59, 59, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 59, 59, 0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .tb-mode .light, .acct-mode .light { animation: none !important; } }
.acct-mode { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 8px; font-weight: 700;
  background: var(--panel-2); border: 1px solid var(--border); margin-bottom: 6px; }
.acct-mode.live { background: color-mix(in srgb, var(--red) 14%, var(--panel)); border-color: color-mix(in srgb, var(--red) 50%, var(--border)); color: var(--text); }
.mode-gate { max-width: 520px; margin: 60px auto; text-align: center; padding: 28px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.mode-gate .actions { justify-content: center; display: flex; gap: 10px; margin-top: 16px; }
.tb-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; }
.tb-tag { font-size: 11px; font-weight: 700; letter-spacing: .03em; padding: 1px 6px; border-radius: 4px; border: 1px solid; }
.tb-tag.paper { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 45%, transparent); }
.tb-tag.live { color: var(--red); border-color: color-mix(in srgb, var(--red) 55%, transparent); }
.tb-tag.testnet { color: var(--purple); border-color: color-mix(in srgb, var(--purple) 55%, transparent); }
.tb-tag.live { background: color-mix(in srgb, var(--red) 14%, transparent); }
.tb-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; min-width: 220px; display: flex; flex-direction: column;
  gap: 2px; padding: 6px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 30px #0006; }
.tb-menu button { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: none; background: transparent; text-align: left; }
.tb-menu button:hover, .tb-menu button.on { background: var(--panel-2); }
.tb-menu a { padding: 6px 10px; }
@keyframes tcm-in { from { opacity: 0; transform: translateY(-4px); } }
.tb-item { display: flex; flex-direction: column; line-height: 1.25; color: inherit; text-decoration: none; }
.tb-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tb-link:hover b { color: var(--accent); }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; max-width: 100%; }
.tb-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.tb-dot.ok { background: var(--green); } .tb-dot.slow { background: var(--amber); } .tb-dot.bad { background: var(--red); }
.tb-eye { display: inline-grid; place-items: center; padding: 5px 7px; }
.hide-money .money { position: relative; color: transparent !important; user-select: none; }
.hide-money .money * { color: transparent !important; visibility: hidden; }
.hide-money .money::after { content: "••••"; position: absolute; inset: 0; color: var(--muted); text-align: inherit; visibility: visible; overflow: hidden; }
.hide-money td.money::after { padding: inherit; }
.bg-auto { margin-left: auto; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.log-new { animation: log-new 2.5s ease-out; }
@keyframes log-new { from { background: color-mix(in srgb, var(--accent) 18%, transparent); } to { background: transparent; } }
.bg-export { display: inline-flex; gap: 6px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: 12px; }
.link-btn:hover { text-decoration: underline; }
.log-copy { float: right; margin-left: 8px; opacity: .55; }
.log-row:hover .log-copy { opacity: 1; }
.hide-money #b-settings .money { display: inline-block; min-width: 3em; }
@media (max-width: 900px) {
  .topbar { margin: -16px -16px 14px; padding: 8px 16px; gap: 14px; }
  .tb-banner { flex-basis: calc(100% + 32px); margin: -8px -16px 0; padding: 6px 16px; gap: 8px; font-size: 12px; }
  .lb-where { flex-basis: 100%; order: 3; }
  .tb-news, .tb-livechip { max-width: calc(100vw - 40px); }
  .tb-wide { display: none; }
}

/* long words (order ids, links, error codes) wrap instead of running out of their box */
body { overflow-wrap: break-word; }
.ask, .ask-body, .modal, .callout, details.hint, #toast, .toast, .kv > div, .field-msg, .ask-err { overflow-wrap: anywhere; min-width: 0; }

/* the app's own pop-ups (instead of the browser's): hover tips, form checks, a picture full size */
.app-tip { position: fixed; z-index: 400; max-width: min(320px, calc(100vw - 16px)); padding: 6px 9px; border-radius: 7px;
  background: var(--panel); color: var(--text); border: 1px solid var(--border); box-shadow: 0 6px 22px rgb(0 0 0 / .35);
  font-size: 12px; line-height: 1.4; white-space: pre-line; overflow-wrap: anywhere; pointer-events: none; }
.is-invalid { border-color: var(--red) !important; box-shadow: 0 0 0 2px color-mix(in srgb, var(--red) 25%, transparent); }
.field-msg, .field-msg.small { color: var(--red); margin-top: 4px; overflow-wrap: anywhere; }
.img-modal { width: min(1100px, 100%); }
.img-modal img { width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--border); display: block; }

/* bug reports */
.warn { color: var(--amber); }
.br-preview { width: 100%; border: 1px solid var(--border); border-radius: 6px; }
.modal textarea { width: 100%; resize: vertical; font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.bg-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.bg-filters .seg { flex: 0 1 auto; }
.bg-filters .seg button { padding: 5px 10px; white-space: nowrap; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.shot { border: 1px solid var(--border); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.shot-img { padding: 0; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--bg); aspect-ratio: 16 / 10; display: grid; place-items: center; }
.shot-img img { width: 100%; height: 100%; object-fit: cover; object-position: top left; display: block; }
.shot-note { white-space: pre-wrap; overflow-wrap: anywhere; }
.shot-detail { grid-column: 1 / -1; max-height: 320px; overflow: auto; border-top: 1px solid var(--border); padding-top: 8px; }
.shot-detail td { vertical-align: top; overflow-wrap: anywhere; }
.log-msg { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 760px; }
#bg-log pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 300px; overflow: auto; margin: 4px 0 0; }
.hide-money .money .money::after { content: none; }
/* a screenshot copies amounts without what's inside them: inline ones keep room for their "••••" */
.capturing :is(span, b, strong, em, i, small, a).money { display: inline-block; min-width: 3em; }

/* ---------- sign-in screen ---------- */
body.auth-on { overflow: hidden; }
body.auth-on > .sidebar, body.auth-on > main, body.auth-on > .nav-edge { visibility: hidden; }
/* until the sign-in is known: nothing of the app shows before the login page */
body.booting > .sidebar, body.booting > main, body.booting > .nav-edge { visibility: hidden; }
#auth { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(120% 90% at 50% 0%, #142038 0%, #0a0e16 55%, #06080d 100%); color: #e6edf3;
  animation: auth-in .5s ease-out; overflow: auto; }
#auth.leaving { animation: auth-out .45s ease-in forwards; }
@keyframes auth-in { from { opacity: 0; } }
@keyframes auth-out { to { opacity: 0; transform: scale(1.03); } }
.auth-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.auth-orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: auth-float 18s ease-in-out infinite alternate; }
.auth-orb.a { width: 46vmax; height: 46vmax; left: -12vmax; top: -16vmax; background: radial-gradient(circle, #2f6bff 0%, transparent 65%); }
.auth-orb.b { width: 38vmax; height: 38vmax; right: -10vmax; bottom: -14vmax; background: radial-gradient(circle, #16c784 0%, transparent 65%); animation-delay: -6s; }
.auth-orb.c { width: 26vmax; height: 26vmax; right: 18vw; top: 8vh; background: radial-gradient(circle, #8b5cf6 0%, transparent 65%); opacity: .35; animation-delay: -11s; }
@keyframes auth-float { to { transform: translate(4vmax, 3vmax) scale(1.12); } }
.auth-candles { position: absolute; left: 0; width: 200%; height: 46vh; }
.auth-candles line { stroke-width: .35; vector-effect: non-scaling-stroke; }
.auth-candles .up line, .auth-candles .up rect { stroke: #22c55e; fill: #22c55e; }
.auth-candles .down line, .auth-candles .down rect { stroke: #ef4444; fill: #ef4444; }
.auth-candles.far { bottom: 30vh; opacity: .10; animation: auth-drift 120s linear infinite; }
.auth-candles.near { bottom: -4vh; height: 52vh; opacity: .18; animation: auth-drift 70s linear infinite;
  -webkit-mask-image: linear-gradient(to top, transparent, #000 40%); mask-image: linear-gradient(to top, transparent, #000 40%); }
@keyframes auth-drift { to { transform: translateX(-50%); } }
.auth-grid { position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 48px 48px; -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%); mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%); }

.auth-card { position: relative; width: min(400px, 100%); padding: 34px 32px 26px; border-radius: 20px;
  background: linear-gradient(160deg, rgba(30, 41, 62, .72), rgba(14, 19, 30, .78));
  border: 1px solid rgba(255, 255, 255, .09); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7), 0 0 0 1px rgba(59, 130, 246, .06), inset 0 1px 0 rgba(255, 255, 255, .06);
  display: flex; flex-direction: column; gap: 14px; animation: auth-card-in .6s cubic-bezier(.2, .8, .2, 1); }
.auth-card::before { content: ""; position: absolute; inset: -1px; border-radius: 21px; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--auth-angle, 0deg), transparent 0 70%, rgba(59,130,246,.9) 80%, rgba(34,197,94,.9) 88%, transparent 96%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: auth-spin 6s linear infinite; }
@property --auth-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes auth-spin { to { --auth-angle: 360deg; } }
@keyframes auth-card-in { from { opacity: 0; transform: translateY(18px) scale(.98); } }
.auth-card.shake { animation: auth-shake .42s ease; }
@keyframes auth-shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.auth-logo { width: 72px; height: 72px; margin: 0 auto 2px; display: grid; place-items: center; border-radius: 20px; color: #3b82f6;
  background: radial-gradient(circle at 30% 25%, rgba(59,130,246,.28), rgba(59,130,246,.06) 70%); border: 1px solid rgba(59,130,246,.3);
  box-shadow: 0 0 40px -6px rgba(59,130,246,.55); animation: auth-glow 3.2s ease-in-out infinite alternate; }
@keyframes auth-glow { to { box-shadow: 0 0 56px -4px rgba(34,197,94,.45); } }
.auth-brand { text-align: center; font-weight: 700; letter-spacing: .32em; text-transform: uppercase; font-size: 12px; color: #8b98a9; }
.auth-card h1 { margin: 0; text-align: center; font-size: 28px; letter-spacing: -.02em;
  background: linear-gradient(90deg, #e6edf3, #9cc3ff 50%, #86efac); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-sub { margin: -4px 0 6px; text-align: center; color: #9aa7b8; line-height: 1.5; }
.auth-field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: #aab6c6; }
.auth-input { position: relative; display: flex; }
.auth-input input { flex: 1; width: 100%; padding: 12px 44px 12px 14px; font: 15px/1.2 Inter, system-ui, sans-serif; color: #e6edf3;
  background: rgba(6, 9, 15, .55); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
.auth-input input:focus { border-color: rgba(59,130,246,.8); box-shadow: 0 0 0 4px rgba(59,130,246,.18); }
.auth-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: 6px; border-radius: 8px;
  color: #7d8a9c; cursor: pointer; display: grid; place-items: center; }
.auth-eye:hover, .auth-eye.on { color: #e6edf3; background: rgba(255,255,255,.06); }
.auth-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: -4px; }
.auth-meter i { height: 4px; border-radius: 4px; background: rgba(255,255,255,.08); transition: background .25s; }
.auth-meter[data-score="1"] i:nth-child(-n+1) { background: #ef4444; }
.auth-meter[data-score="2"] i:nth-child(-n+2) { background: #f59e0b; }
.auth-meter[data-score="3"] i:nth-child(-n+3) { background: #84cc16; }
.auth-meter[data-score="4"] i { background: #22c55e; box-shadow: 0 0 10px rgba(34,197,94,.5); }
.auth-meter-label { margin-top: -8px; color: #8b98a9; }
.auth-error { padding: 9px 12px; border-radius: 10px; font-size: 13px; color: #fecaca; background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.35); }
.auth-go { margin-top: 4px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 16px; border: 0; border-radius: 12px;
  font: 600 15px Inter, system-ui, sans-serif; color: #fff; cursor: pointer; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #2563eb, #3b82f6 45%, #16a34a); background-size: 180% 100%; background-position: 0 0;
  box-shadow: 0 10px 30px -10px rgba(59,130,246,.8); transition: background-position .4s, transform .15s, box-shadow .2s; }
.auth-go:hover { background-position: 100% 0; box-shadow: 0 14px 34px -10px rgba(34,197,94,.7); }
.auth-go:active { transform: translateY(1px) scale(.99); }
.auth-go svg { transition: transform .2s; }
.auth-go:hover svg { transform: translateX(3px); }
.auth-go:disabled { opacity: .7; cursor: progress; }
.auth-go:disabled span::after { content: "…"; }
.auth-go::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.28) 50%, transparent 65%);
  transform: translateX(-100%); animation: auth-sheen 3.6s ease-in-out infinite 1.2s; }
@keyframes auth-sheen { 30%, 100% { transform: translateX(100%); } }
.auth-foot { text-align: center; color: #7d8a9c; line-height: 1.5; }
.auth-passkey { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 13px 16px; border-radius: 12px; font: inherit;
  font-weight: 700; font-size: 15px; color: #e6edf3; cursor: pointer; background: rgba(255,255,255,.06); border: 1px solid rgba(167,139,250,.55);
  box-shadow: 0 0 0 0 rgba(167,139,250,.4); transition: background .2s, box-shadow .2s, transform .1s; }
.auth-passkey svg { color: #a78bfa; }
.auth-passkey:hover { background: rgba(167,139,250,.14); box-shadow: 0 10px 30px -12px rgba(167,139,250,.8); }
.auth-passkey:active { transform: translateY(1px) scale(.99); }
.auth-passkey:disabled { opacity: .7; cursor: progress; }
.auth-or { display: flex; align-items: center; gap: 10px; color: #7d8a9c; font-size: 12px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.12); }
.pk-add { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.pk-add .field { flex: 1 1 220px; }
.pk-add button svg, td svg { vertical-align: -4px; }
.auth-foot .mono { color: #aab6c6; font-size: 11.5px; word-break: break-word; }
@media (prefers-reduced-motion: reduce) {
  #auth, #auth *, #auth *::before, #auth *::after { animation: none !important; transition: none !important; }
  .env-notice, .en-card, .tb-livechip .dot { animation: none !important; transition: none !important; }
}

/* ---------- long / short ---------- */
.badge.long { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.badge.short { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.badge.neutral { color: var(--purple); background: color-mix(in srgb, var(--purple) 12%, transparent); border-color: color-mix(in srgb, var(--purple) 40%, transparent); }
.seg button.dir-long { color: color-mix(in srgb, var(--green) 70%, var(--muted)); }
.seg button.dir-short { color: color-mix(in srgb, var(--red) 70%, var(--muted)); }
.seg button.dir-neutral { color: color-mix(in srgb, var(--purple) 70%, var(--muted)); }
.seg button.dir-long.on { color: #fff; background: var(--green); box-shadow: 0 2px 10px -2px color-mix(in srgb, var(--green) 60%, transparent); }
.seg button.dir-short.on { color: #fff; background: var(--red); box-shadow: 0 2px 10px -2px color-mix(in srgb, var(--red) 60%, transparent); }
.seg button.dir-neutral.on { color: #fff; background: var(--purple); box-shadow: 0 2px 10px -2px color-mix(in srgb, var(--purple) 60%, transparent); }
.seg button.dir-long:disabled, .seg button.dir-short:disabled { opacity: .4; }
.dir-word.long { color: var(--green); font-weight: 600; }
.dir-word.short { color: var(--red); font-weight: 600; }

/* draggable level lines and quick chart actions */
.chart.line-grab canvas, .chart.line-dragging canvas { cursor: ns-resize !important; }
.chart.line-dragging { touch-action: none; user-select: none; }
.chart-quick { position: absolute; left: 8px; bottom: 34px; z-index: 4; display: flex; gap: 6px; }
.be { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.be-go { font-weight: 700; }
.be-off { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); }
.be-off input { width: 64px; padding: 4px 6px; }
.be-chart { background: color-mix(in srgb, var(--panel) 88%, transparent); border: 1px solid var(--border); border-radius: 999px;
  padding: 3px 8px 3px 3px; box-shadow: 0 4px 14px rgba(0,0,0,.18); backdrop-filter: blur(6px); }
.be-chart .be-go { border-radius: 999px; padding: 4px 10px; background: linear-gradient(135deg, var(--amber), color-mix(in srgb, var(--amber) 60%, var(--green)));
  color: #111; border: 0; transition: transform .15s ease, box-shadow .15s ease; }
.be-chart .be-go:hover { transform: translateY(-1px); box-shadow: 0 4px 12px color-mix(in srgb, var(--amber) 45%, transparent); }
.be-chart .be-off input { width: 54px; padding: 2px 4px; }
@media (prefers-reduced-motion: reduce) { .be-chart .be-go { transition: none; } }
.chart-quick[hidden] { display: none; }

/* panel views: expand, float, own window */
.ptools { position: absolute; top: 3px; right: 8px; display: flex; gap: 2px; z-index: 3; opacity: 0; transition: opacity .15s; }
[data-pk]:hover > .ptools, .ptools:focus-within, .p-floating > .ptools, .p-expanded > .ptools { opacity: 1; }
@media (hover: none) { .ptools { opacity: .6; } }
.ptools button { border: 0; background: transparent; color: var(--muted); padding: 2px 3px; line-height: 0; border-radius: 5px; cursor: pointer; }
.ptools button:hover, .ptools button:focus-visible { color: var(--text); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.ptools button.on { color: var(--accent); }
.ptools svg { width: 13px; height: 13px; }
.p-expanded { position: fixed !important; inset: 24px; z-index: 80; overflow: auto; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45), 0 20px 60px rgba(0,0,0,.4);
  animation: p-pop .16s ease-out; }
.p-expanded > .grip { display: none; }
.p-floating { position: fixed !important; z-index: 70; overflow: auto; resize: both; min-width: 280px; min-height: 120px;
  box-shadow: 0 16px 48px rgba(0,0,0,.35); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); animation: p-pop .16s ease-out; }
.p-floating > .grip { opacity: .8; cursor: move; transform: none; top: 0; left: 0; right: 0; width: 100%; height: 14px; border-radius: 0; }
.p-floating > .grip svg { transform: rotate(90deg); }
@keyframes p-pop { from { transform: scale(.97); opacity: .4; } }
.panel-away { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-style: dashed; }
body.panel-window { padding: 12px; min-height: 100vh; }
body.panel-window .pw-main > [data-pk] > .grip, body.panel-window [data-pt="expand"], body.panel-window [data-pt="float"] { display: none; }
body.panel-window::after { display: none; }
/* auto-hiding form column (builder pages) */
.builder.hide-a, .builder.hide-a.swapped { grid-template-columns: minmax(0, 1fr); column-gap: 0; }
.builder.hide-a > [data-zone="b"] { grid-column: 1 / -1; }
.builder.hide-a > .col-split { display: none; }
.builder.hide-a > [data-zone="a"] { position: fixed; z-index: 60; overflow: auto; visibility: hidden; opacity: 0; transform: translateX(-16px);
  transition: opacity .18s ease, transform .18s ease, visibility 0s .18s; box-shadow: 0 18px 50px rgba(0,0,0,.35); border-radius: var(--radius); }
.builder.hide-a.swapped > [data-zone="a"] { transform: translateX(16px); }
.builder.hide-a > [data-zone="a"].peek { visibility: visible; opacity: 1; transform: none; transition: opacity .18s ease, transform .18s ease; }
.hide-tab { position: fixed; top: 42vh; z-index: 61; writing-mode: vertical-rl; transform: rotate(180deg); padding: 12px 5px; border-radius: 0 10px 10px 0;
  border: 1px solid var(--border); border-left: 0; background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #8b5cf6));
  color: #fff; font-weight: 700; font-size: 12px; letter-spacing: .04em; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.hide-tab.right { transform: none; border-radius: 0 10px 10px 0; border-left: 1px solid var(--border); border-right: 0; }
.hide-tab.open { opacity: .35; }
.layout-tools .on { color: var(--accent); border-color: var(--accent); }
@media (max-width: 900px) {
  .builder.hide-a, .builder.hide-a.swapped { grid-template-columns: 1fr; }
  .builder.hide-a > [data-zone="a"] { position: static; visibility: visible; opacity: 1; transform: none; box-shadow: none; }
  .hide-tab { display: none; }
  .layout-tools [data-layout="hide"], .layout-tools [data-layout="swap"] { display: none; }  /* (one column on a phone) */
}
@media (prefers-reduced-motion: reduce) { .p-expanded, .p-floating { animation: none; } .builder.hide-a > [data-zone="a"] { transition: none; } }

/* exchange account panel */
.book { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.book-head { display: flex; align-items: center; gap: 8px; }
.book-acct { flex-wrap: wrap; align-self: flex-start; }
.book-acct button { display: inline-flex; align-items: center; gap: 6px; }
.book-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.stat.sm { padding: 8px 10px; }
.stat.sm .value { font-size: 15px; }
.book-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: thin; }
.book-tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; padding: 7px 10px; color: var(--muted);
  font-weight: 600; white-space: nowrap; }
.book-tabs button:hover { color: var(--text); }
.book-tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.book-n { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 3px; border-radius: 999px; font-size: 11px; line-height: 17px; text-align: center;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.book-body table td, .book-body table th { white-space: nowrap; }
.book-bot { font-weight: 600; }
.book-flowsum { margin-bottom: 10px; }
.book-exp { display: flex; flex-direction: column; gap: 8px; }
.be-row { display: grid; grid-template-columns: minmax(120px, 170px) 1fr auto auto; gap: 10px; align-items: center; }
.be-bar { height: 10px; border-radius: 5px; background: color-mix(in srgb, var(--border) 60%, transparent); overflow: hidden; }
.be-bar span { display: block; height: 100%; border-radius: 5px; }
.be-bar .long { background: var(--green); } .be-bar .short { background: var(--red); }
@media (max-width: 700px) { .be-row { grid-template-columns: 1fr auto; } .be-row .be-bar { grid-column: 1 / -1; } }

/* each panel's name, top left */
.pname { position: absolute; top: 3px; left: 10px; z-index: 2; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: color-mix(in srgb, var(--muted) 75%, transparent); pointer-events: none; user-select: none; }
[data-pk] { padding-top: 20px; }
.chart-window .pname, body.panel-window .pname { display: none; }

/* ---------- the order form: sections, pills, steppers, quick sizes, target ladder ---------- */
form .group.sect { --hc: hsl(var(--hue, 220) 70% 55%); position: relative; margin-bottom: 12px; padding: 10px 12px 12px;
  border: 1px solid color-mix(in srgb, var(--border) 85%, var(--hc)); border-radius: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--hc) 7%, var(--panel)), var(--panel) 46px); }
form .group.sect::before { content: ""; position: absolute; left: -1px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--hc); opacity: .75; }
form .group.sect > .group-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; cursor: pointer; user-select: none;
  text-transform: none; letter-spacing: 0; font-size: 13.5px; color: var(--text); font-weight: 700; border-radius: 8px; }
form .group.sect > .group-title:focus-visible { outline: 2px solid var(--hc); outline-offset: 3px; }
.g-n { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 11px; font-weight: 800; color: #fff;
  background: var(--hc); box-shadow: 0 2px 8px -2px var(--hc); flex: none; }
.g-ic { font-size: 15px; line-height: 1; }
.g-t { flex: none; }
.g-sum { flex: 1; min-width: 0; font-size: 11.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .2s; }
.g-fold { color: var(--muted); font-size: 12px; transition: transform .2s; margin-left: auto; }
form .group.sect.folded { padding-bottom: 10px; }
form .group.sect.folded > .group-title { margin-bottom: 0; }
form .group.sect.folded .g-sum { opacity: 1; }
form .group.sect.folded .g-fold { transform: rotate(-90deg); }
form .group.sect.folded > :not(.group-title) { display: none !important; }
form .group.plain { margin-bottom: 12px; }
/* futures-only settings are hidden on spot */
.field.disabled { display: none; }
/* pills for short choices */
select.as-pills { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.seg.pills { flex-wrap: wrap; }
.seg.pills button { flex: 1 1 auto; padding: 6px 8px; font-size: 13px; white-space: nowrap; text-transform: capitalize; font-weight: 600; border-radius: 6px; transition: background .15s, color .15s, transform .1s; }
.seg.pills button:hover:not(.on):not(:disabled) { color: var(--text); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.seg.pills button.on { background: var(--accent); color: #fff; box-shadow: 0 2px 10px -3px var(--accent); }
.seg.pills button:active { transform: scale(.97); }
/* numbers with their unit and minus / plus */
.stepper { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); overflow: hidden;
  transition: border-color .15s, box-shadow .15s; }
.stepper:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.stepper input { border: 0; border-radius: 0; background: transparent; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; padding: 7px 2px; -moz-appearance: textfield; }
.stepper input:focus { outline: none; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.num-b { border: 0; border-radius: 0; background: transparent; color: var(--muted); width: 30px; flex: none; padding: 0; font-size: 16px; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.num-b:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.num-b:active { transform: scale(.9); }
.num-u { display: none; align-self: center; padding-right: 4px; color: var(--muted); font-size: 12px; font-weight: 600; }
.stepper.has-u .num-u { display: block; }
.stepper:has(input:disabled) { opacity: .5; }
/* quick sizes */
.quick-size { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.quick-size button { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--border); background: var(--bg); color: var(--muted); }
.quick-size button:hover { color: var(--text); border-color: var(--accent); }
.quick-size button.on { background: color-mix(in srgb, var(--accent) 14%, transparent); border-color: var(--accent); color: var(--accent); }
/* target ladder */
.tp-ladder { border: 1px dashed var(--border); border-radius: 10px; padding: 26px 14px 8px; background: color-mix(in srgb, var(--bg) 60%, transparent); }
.tl-track { position: relative; height: 26px; margin: 0 28px; }  /* (room for the labels of the end points) */
.tl-track::before { content: ""; position: absolute; left: 0; right: 0; top: 12px; height: 2px; border-radius: 1px; background: linear-gradient(90deg, var(--red), var(--muted) 34%, var(--green)); opacity: .45; }
.tl-risk { position: absolute; top: 10px; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--red) 30%, transparent); }
.tl-pt { position: absolute; top: -14px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; white-space: nowrap; gap: 2px; }
.tl-pt::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--panel); box-shadow: 0 1px 4px rgba(0,0,0,.25); order: 1; }
.tl-pt b { order: 0; font-size: 11px; line-height: 1; }
.tl-pt i { order: 2; font-style: normal; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.tl-pt.sl::before { background: var(--red); }
.tl-pt.sl b { color: var(--red); }
.tl-pt.en::before { background: var(--muted); }
.tl-pt.tp::before { background: var(--green); width: calc(10px * var(--sz, 1) + 4px); height: calc(10px * var(--sz, 1) + 4px); }
.tl-pt.tp b { color: var(--green); }
.tl-foot { margin-top: 26px; text-align: center; }
.tl-pt[data-k] { cursor: ew-resize; touch-action: none; user-select: none; }
.tl-pt[data-k]:hover::before { transform: scale(1.25); }
body.tl-dragging { cursor: ew-resize; user-select: none; }
/* the submit button */
#form .form-actions { padding: 10px 0 2px; background: linear-gradient(180deg, transparent, var(--panel) 30%); }
#go-btn { position: relative; overflow: hidden; font-weight: 800; letter-spacing: .02em; padding: 11px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #8b5cf6)); box-shadow: 0 8px 22px -10px var(--accent); }
#go-btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.28) 50%, transparent 70%);
  transform: translateX(-100%); transition: transform .6s; }
#go-btn:hover::after { transform: translateX(100%); }
@media (prefers-reduced-motion: reduce) { #go-btn::after, .g-fold, .g-sum { transition: none; } }

.ex-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ex-chip { padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg); font-weight: 600; }

/* the exchange picker: rows of up to three */
#ex-seg { flex-wrap: wrap; }
#ex-seg button { flex: 1 1 calc(33% - 4px); min-width: 0; justify-content: center; }
#ex-seg .ex-label { justify-content: center; }

.tb-ccy { width: auto; padding: 4px 6px; font-size: 12px; font-weight: 700; border-radius: 8px; background: var(--bg); cursor: pointer; }

/* number columns: right-aligned figures, but headers in the same type as the others */
th.num { font-family: inherit; }
.bot-settings div span { margin-bottom: 2px; }
.bot-settings div b { font-weight: 600; font-size: 13px; }

/* the floating camera (screenshot of any screen) */
.shot-fab { position: fixed; right: 18px; bottom: 18px; z-index: 150; width: 44px; height: 44px; padding: 0; border-radius: 50%;
  display: grid; place-items: center; color: var(--text); background: color-mix(in srgb, var(--panel) 92%, transparent);
  border: 1px solid var(--border); box-shadow: 0 6px 20px -8px rgba(0,0,0,.45); backdrop-filter: blur(6px); cursor: grab; touch-action: none;
  opacity: .8; transition: opacity .15s, transform .15s, color .15s; }
.shot-fab:hover, .shot-fab:focus-visible { opacity: 1; color: var(--accent); transform: scale(1.06); }
.shot-fab.dragging { cursor: grabbing; transform: scale(1.1); opacity: 1; }
.shot-fab.busy { pointer-events: none; animation: fab-busy .8s ease-in-out infinite; }
@keyframes fab-busy { 50% { opacity: .35; } }
body.auth-on .shot-fab, body.chart-window .shot-fab { display: none; }
.shot-modal { width: min(760px, 94vw); }

/* "I hold it": the account's holdings to pick from */
.held-box > label { display: block; margin-bottom: 6px; }
.held-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.held-list button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 12.5px; }
.held-list button:hover { border-color: var(--accent); }
.book-adopt { padding: 2px 9px; font-size: 11.5px; }
.manual-tag { background: var(--panel-2); color: var(--muted); border: 1px solid var(--border); }
.book-convert { padding: 2px 9px; font-size: 11.5px; margin-left: 4px; }
.link-box { display: grid; gap: 6px; justify-items: start; }
/* padlocks on the order lines that can be dragged */
.line-locks { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
/* P&L tags on order lines: name | size | P&L, sitting on the line at the chart's left */
.line-tags { position: absolute; inset: 0; pointer-events: none; z-index: 3; overflow: hidden; }
.line-tag { position: absolute; left: 10px; transform: translateY(-50%); display: inline-flex; align-items: stretch; pointer-events: auto;
  font: 600 11px/1 "JetBrains Mono", ui-monospace, monospace; border: 1px solid var(--c, var(--muted)); border-radius: 4px; overflow: hidden;
  background: color-mix(in srgb, var(--panel) 92%, transparent); box-shadow: 0 1px 4px rgb(0 0 0 / .25); white-space: nowrap; }
.line-tag[hidden] { display: none; }
.line-tag > span { padding: 4px 7px; display: inline-flex; align-items: center; gap: 4px; }
.lt-name { background: var(--c, var(--muted)); color: #fff; }
.lt-qty { color: var(--muted); border-right: 1px solid color-mix(in srgb, var(--c, var(--muted)) 40%, transparent); }
.lt-pnl { color: var(--muted); }
.lt-pnl.pos { color: var(--green); }
.lt-pnl.neg { color: var(--red); }
.lt-pct { font-weight: 500; opacity: .85; }
.hide-money .line-tag .money { min-width: 3em; }
.hide-money .line-tag .money::after { display: flex; align-items: center; justify-content: center; }
.line-lock { position: absolute; transform: translateY(-50%); pointer-events: auto; display: grid; place-items: center;
  width: 22px; height: 20px; padding: 0; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--c, var(--muted)) 55%, var(--border));
  background: color-mix(in srgb, var(--panel) 88%, transparent); color: var(--c, var(--muted)); opacity: .55; cursor: pointer; }
.line-lock:hover { opacity: 1; }
.line-lock.on { opacity: 1; background: var(--c, var(--muted)); color: #fff; border-color: transparent; }
.line-lock svg { width: 13px; height: 13px; }

.ign-limits { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 8px; cursor: pointer; }
.ign-limits[hidden] { display: none; }
.ign-limits:has(input:checked) { color: var(--amber); }
.limits-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }

/* Convert to Smart Trade: the holding is fixed, only the exits can be changed */
#form .convert-box { margin-bottom: 12px; }
#form .group.convert-locked { opacity: .5; }
.badge.kind-smart, .badge.kind-managed { display: inline-flex; align-items: center; gap: 4px; }
.badge.kind-smart { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 45%, transparent); }
.badge.kind-managed { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.smart-more { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.smart-more .lv-smart, .convert-smart { display: inline-flex; align-items: center; gap: 4px; }
/* Experiments page (app/web/features.js): its panels use the page layout like every other page. */
.rs-sim { color: var(--muted); }
.rs-bar { display: flex; align-items: end; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 16px; }
.rs-pick { display: flex; flex-direction: column; gap: 4px; min-width: 220px; }
.rs-tabs { display: flex; align-items: center; gap: 2px; min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--border); flex: 1; }
.rs-tabs::-webkit-scrollbar { display: none; }
.rs-tabs a { flex: none; padding: 9px 12px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.rs-tabs a:hover { color: var(--text); }
.rs-tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.rs-sep { flex: none; width: 1px; height: 18px; background: var(--border); margin: 0 6px; }
.rs-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 600; margin-left: 2px; }
.rs-form { display: flex; flex-direction: column; gap: 14px; }
.rs-form h2 { margin: 0; }
.rs-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 12px; }
.rs-fields .field > span { font-size: 12px; color: var(--muted); }
.rs-fields input, .rs-fields select { width: 100%; min-width: 0; }
.rs-row { align-items: end; }
.rs-go button { width: 100%; }
.rs-check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.rs-edit { border: 1px solid var(--border); border-radius: 8px; padding: 0 12px; background: var(--panel-2); }
.rs-edit > summary { cursor: pointer; padding: 10px 0; font-weight: 500; }
.rs-edit[open] { padding-bottom: 12px; }
.rs-edit[open] > summary { margin-bottom: 4px; }
.rs-edit .rs-fields { margin-top: 8px; }
.rs-edit .rs-reset { margin-top: 10px; }
.rs-diff > span, .rs-check.rs-diff { color: var(--accent); }
.rs-diff input, .rs-diff select { border-color: var(--accent); }
.rs-blank { padding: 28px 12px; text-align: center; }
.rs-blank b { display: block; margin-bottom: 4px; }
.rs-blank p { margin: 0 auto; max-width: 420px; }
.rs-sub { margin: 18px 0 8px; font-size: 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rs-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 14px; }
.rs-tile { background: var(--panel-2); border-radius: 8px; padding: 10px 12px; min-width: 0; }
.rs-tile span { display: block; color: var(--muted); font-size: 12px; }
.rs-tile b { display: block; font-size: 17px; margin-top: 2px; overflow-wrap: anywhere; }
.rs-compare td:first-child { color: var(--muted); }
/* charts */
.rs-chart { display: block; width: 100%; }
.rs-chart-box { position: relative; margin-top: 4px; }
.rs-price { height: 260px; background: var(--panel-2); border-radius: 8px; }
.rs-axis { position: absolute; top: 6px; bottom: 6px; right: 8px; display: flex; flex-direction: column; justify-content: space-between;
  font-size: 11px; color: var(--muted); pointer-events: none; text-align: right; }
.rs-price .up line, .rs-price .up rect { stroke: var(--green); fill: var(--green); }
.rs-price .down line, .rs-price .down rect { stroke: var(--red); fill: var(--red); }
.rs-lvl { stroke-dasharray: 5 5; stroke-width: 1; opacity: .75; stroke: var(--muted); }
.rs-lvl.target { stroke: var(--green); } .rs-lvl.stop { stroke: var(--red); } .rs-lvl.safety { stroke: var(--accent); } .rs-lvl.entry { stroke: var(--amber); }
.rs-fill { stroke: var(--panel); stroke-width: 1.5; }
.rs-fill.buy, .rs-dot.buy { fill: var(--accent); background: var(--accent); }
.rs-fill.sell, .rs-dot.sell { fill: var(--amber); background: var(--amber); }
.rs-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.rs-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); padding: 2px 8px; border-radius: 999px; background: var(--panel-2); }
.rs-chip b { color: var(--text); font-weight: 500; }
.rs-chip::before { content: ""; width: 10px; height: 0; border-top: 2px dashed currentColor; }
.rs-chip:last-child::before { display: none; }
.rs-chip.target { color: var(--green); } .rs-chip.stop { color: var(--red); } .rs-chip.safety { color: var(--accent); } .rs-chip.entry { color: var(--amber); }
.rs-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.rs-player { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 10px 0 0; }
.rs-player input[type=range] { flex: 1 1 160px; min-width: 120px; accent-color: var(--accent); }
.rs-player .mono { white-space: nowrap; }
.rs-eq { height: 120px; }
.rs-spark { height: 46px; }
.rs-line { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.rs-line.neg { stroke: var(--red); }
.rs-line.was { stroke: var(--muted); stroke-dasharray: 4 4; stroke-width: 1.5; }
.rs-area { fill: color-mix(in srgb, var(--accent) 12%, transparent); stroke: none; }
.rs-zero { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 4; }
.rs-key { display: inline-block; width: 14px; height: 0; border-top: 2px solid var(--accent); vertical-align: middle; margin: 0 4px 0 8px; }
.rs-key.was { border-top: 2px dashed var(--muted); }
.rs-at { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 14px; align-items: start; }
.rs-events { margin: 0; padding: 0; list-style: none; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.rs-events li { padding: 6px 10px; border-radius: 6px; background: var(--panel-2); }
/* stress */
.rs-stress .rs-bar-col { width: 22%; min-width: 80px; }
.rs-hbar { display: block; height: 8px; width: var(--w); border-radius: 4px; background: var(--green); }
.rs-hbar.neg { background: var(--red); }
.rs-worst td { background: color-mix(in srgb, var(--red) 7%, transparent); }
/* experiments */
.rs-xps { display: flex; flex-direction: column; gap: 12px; }
.rs-xp { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.rs-xp-head { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.rs-xp-name { display: flex; gap: 8px; align-items: start; min-width: 0; }
.rs-xp-name img { margin-top: 2px; }
.rs-xp-body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; }
.rs-xp-pnl { display: flex; flex-direction: column; }
.rs-xp-pnl b { font-size: 20px; }
.rs-xp-kv { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
.rs-xp-actions { display: flex; gap: 8px; justify-content: flex-end; }
/* exposure */
.rs-group + .rs-group { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 16px; }
.rs-group h3 { margin: 0 0 10px; font-size: 15px; }
.rs-group h4 { margin: 0 0 8px; font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.rs-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px 24px; margin-bottom: 14px; }
.rs-meter { display: grid; grid-template-columns: minmax(110px, 1fr) 2fr 44px; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.rs-meter > span { display: flex; align-items: center; gap: 6px; min-width: 0; }
.rs-meter i { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--accent) var(--w), var(--panel-2) var(--w)); }
.rs-meter b { text-align: right; font-weight: 500; }
/* decisions, versions, inbox */
.rs-timeline, .rs-versions, .rs-inbox { list-style: none; margin: 12px 0 0; padding: 0; }
.rs-timeline li { border-left: 2px solid var(--border); padding: 0 0 0 14px; position: relative; }
.rs-timeline li::before { content: ""; position: absolute; left: -5px; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.rs-timeline li.ev-position::before, .rs-timeline li.ev-pnl::before { background: var(--accent); }
.rs-timeline li.ev-settings::before, .rs-timeline li.ev-restore::before { background: var(--purple); }
.rs-timeline li.sev-warning::before, .rs-timeline li.ev-error::before { background: var(--red); }
.rs-timeline summary { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 8px 0; cursor: pointer; list-style: none; }
.rs-timeline summary::-webkit-details-marker { display: none; }
.rs-timeline summary:hover .rs-msg { color: var(--text); }
.rs-ev { font-weight: 600; font-size: 13px; }
.rs-msg { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.rs-detail { padding: 4px 0 12px; display: flex; flex-direction: column; gap: 10px; }
.rs-changes { margin: 0; padding-left: 18px; font-size: 13px; }
.rs-raw summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.rs-raw pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 300px; overflow: auto; font-size: 12px; background: var(--panel-2); padding: 10px; border-radius: 6px; }
.rs-versions li { padding: 12px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.rs-versions li:last-child { border-bottom: none; }
.rs-v-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rs-v-head button { margin-left: auto; }
.rs-diff-table { width: auto; font-size: 13px; }
.rs-diff-table td { padding: 3px 12px 3px 0; border: none; white-space: normal; }
.rs-diff-table td:first-child { color: var(--muted); }
.rs-inbox li { padding: 10px 0 10px 12px; border-bottom: 1px solid var(--border); border-left: 3px solid transparent; }
.rs-inbox li.unread { border-left-color: var(--accent); }
.rs-inbox li > div { display: flex; justify-content: space-between; gap: 8px; }
.rs-inbox p { margin: 4px 0 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.rs-links { display: flex; flex-wrap: wrap; gap: 6px; }
.pt-chat { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.pt-chat .field { flex: 1 1 160px; min-width: 0; }
.pt-chatlist { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.pt-rules { border: 0; padding: 0; margin: 4px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2px 12px; }
.pt-rules legend { padding: 0; margin-bottom: 4px; }
.rs-taxform { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; margin: 6px 0 14px; }
.rs-taxform label { display: grid; gap: 4px; min-width: 0; }
.rs-taxform input { width: 7em; }
.rs-taxform select { max-width: 100%; }
.rs-taxdl { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.rs-inline { display: inline-flex; align-items: center; gap: 6px; }
.rs-promote .rs-cmp-body { display: flex; flex-direction: column; gap: 10px; }
.rs-promote .rs-tiles { margin: 0; }
.rs-verdict { margin: 0; font-size: 14px; }
.rs-promote-table th { font-weight: 500; color: var(--muted); font-size: 12px; text-align: left; padding: 3px 12px 3px 0; }
@media (max-width: 700px) {
  .rs-bar { flex-direction: column; align-items: stretch; }
  .rs-tabs { flex: none; }
  .rs-at { grid-template-columns: 1fr; }
  .rs-price { height: 200px; }
  .rs-timeline summary { grid-template-columns: minmax(0, 1fr) auto; }
  .rs-timeline .rs-msg { grid-column: 1 / -1; grid-row: 2; }
  .rs-meter { grid-template-columns: minmax(90px, 1fr) 1.4fr 40px; }
  .rs-xp-body { grid-template-columns: 1fr; gap: 6px; }
}
/* ---------- Protection page (protect.js) */
.pt-account { padding: 12px 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.pt-account:first-child { border-top: none; padding-top: 4px; }
.pt-account-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pt-account .callout { margin: 0; }
.pt-account .callout .form-actions { margin-top: 8px; }
.badge.pt-stop { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); }
.pt-meter { margin: 0; }
.pt-meter.pt-near i { background: linear-gradient(90deg, var(--amber) var(--w), var(--panel-2) var(--w)); }
.pt-meter.pt-hit i { background: linear-gradient(90deg, var(--red) var(--w), var(--panel-2) var(--w)); }
.pt-meter b { white-space: nowrap; }
tr.pt-costly td { background: color-mix(in srgb, var(--red) 7%, transparent); }
.pt-recon-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.pt-trail li > div { align-items: baseline; }
.pt-trail li p { margin: 2px 0 0; }
.pt-limits { display: flex; flex-direction: column; gap: 8px; }
.pt-limit { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pt-pct { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.pt-pct input { width: 90px; }
.rs-meter.pt-meter { grid-template-columns: minmax(110px, 1fr) minmax(60px, 1.2fr) auto; }
@media (max-width: 700px) {
  .rs-meter.pt-meter { grid-template-columns: minmax(0, 1fr) minmax(60px, 1fr); }
  .pt-meter b { grid-column: 1 / -1; text-align: left; }
}
/* back, forward and where you are (navTrail): the last row of the top bar */
.tb-path { flex: 0 0 calc(100% + 56px); order: 99; position: relative; display: flex; align-items: center; gap: 4px; min-width: 0;
  margin: 0 -28px -10px; padding: 3px 24px; border-top: 1px solid var(--border); font-size: 12.5px; }
.tb-navbtn { display: inline-grid; place-items: center; width: 26px; height: 24px; padding: 0; border: 0; border-radius: 6px;
  background: none; color: var(--text); cursor: pointer; }
.tb-navbtn:hover:not(:disabled) { background: var(--border); }
.tb-navbtn:disabled { opacity: .3; cursor: default; }
.tb-crumbs { display: flex; align-items: center; min-width: 0; margin: 0 0 0 8px; padding: 0; list-style: none; overflow: hidden; }
.tb-crumbs li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-crumbs li + li::before { content: "›"; margin: 0 7px; color: var(--muted); }
.tb-crumbs a { color: var(--muted); text-decoration: none; }
.tb-crumbs a:hover { color: var(--text); text-decoration: underline; }
.tb-crumbs b { font-weight: 600; }
.tb-crumbs .tb-ell { display: none; }
.tb-crumbs .tb-ell + li::before { content: none; }
.tb-recent { top: 100%; min-width: 220px; }
.tb-recent-head { padding: 4px 10px 2px; }
@media (max-width: 900px) {
  .tb-path { flex-basis: calc(100% + 32px); margin: 0 -16px -8px; padding: 3px 12px; }
  .tb-crumbs.deep li:not(:last-child):not(.tb-ell) { display: none; }
  .tb-crumbs.deep .tb-ell { display: block; }
}
