/* Eiwaz Trading System — calm charcoal/slate, off-white text, muted teal / coral / amber / blue.
 * Status color is always paired with text. Chart colors come from the same tokens. */
:root, :root[data-theme="dark"] {
  --bg: #0f1216; --surface: #161a20; --surface-2: #1d232b; --border: #283039; --border-strong: #38424e;
  --text: #e7e9ec; --text-2: #9ba4b0; --text-3: #737d8a;
  --ok: #4fb393; --bad: #e27a70; --warn: #ddaa55; --info: #74a7da; --neutral: #9ba4b0; --violet: #a993d9;
  --ok-bg: rgba(79,179,147,.13); --bad-bg: rgba(226,122,112,.13); --warn-bg: rgba(221,170,85,.13);
  --info-bg: rgba(116,167,218,.13); --neutral-bg: rgba(155,164,176,.10); --violet-bg: rgba(169,147,217,.13);
  --focus: #74a7da; --shadow: 0 1px 2px rgba(0,0,0,.25);
  /* chart layers */
  --c-bull: 38,201,148; --c-bear: 246,103,93; --c-fvg-bull: 84,160,255; --c-fvg-bear: 247,176,64;
  --c-liq: 196,148,255; --c-text: 231,233,236; --c-pd-hi: 246,103,93; --c-pd-lo: 38,201,148;
  --c-on: 10,14,19; --c-pill: 22,26,32;
  --c-armed: 247,176,64; --c-pending: 116,167,218; --c-open: 169,147,217;
}
:root[data-theme="light"] {
  --bg: #f4f5f7; --surface: #ffffff; --surface-2: #f1f3f6; --border: #dde1e7; --border-strong: #c6ccd5;
  --text: #1b222c; --text-2: #55606e; --text-3: #6b7582;
  --ok: #1d7a5b; --bad: #b3443a; --warn: #8f5e0f; --info: #2b62a5; --neutral: #55606e; --violet: #6a4fb0;
  --ok-bg: rgba(29,122,91,.09); --bad-bg: rgba(179,68,58,.08); --warn-bg: rgba(143,94,15,.09);
  --info-bg: rgba(43,98,165,.08); --neutral-bg: rgba(85,96,110,.07); --violet-bg: rgba(106,79,176,.08);
  --focus: #2b62a5; --shadow: 0 1px 2px rgba(20,30,40,.06);
  --c-bull: 10,140,98; --c-bear: 205,57,46; --c-fvg-bull: 30,98,214; --c-fvg-bear: 196,118,0;
  --c-liq: 120,64,210; --c-text: 27,34,44; --c-pd-hi: 205,57,46; --c-pd-lo: 10,140,98;
  --c-on: 255,255,255; --c-pill: 255,255,255;
  --c-armed: 196,118,0; --c-pending: 43,98,165; --c-open: 106,79,176;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.5 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif; overflow-x: hidden; }
.num, .mono, code, td.num { font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: 0; }
h2 { font-size: 16px; line-height: 1.35; }
h3 { font-size: 14px; margin: 16px 0 8px; color: var(--text-2); font-weight: 500; }
.view-title { font-size: 20px; margin: 4px 0 0; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.muted { color: var(--text-2); font-weight: 400; }
.small { font-size: 13px; }
.note { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--text); font-size: 14px; }
.note:empty { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; } .skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 6px 10px; z-index: 20; }
svg.i { width: 16px; height: 16px; flex: none; }
[hidden] { display: none !important; }

/* ---- top bar ---- */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 8px 20px; background: var(--surface); border-bottom: 1px solid var(--border); min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: var(--info-bg); display: grid; place-items: center; }
.logo-mark { width: 18px; height: 18px; fill: none; stroke: var(--info); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.brand-name { font-weight: 600; font-size: 16px; white-space: nowrap; }
.brand-sub { color: var(--text-2); font-size: 14px; white-space: nowrap; }
.nav { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav a { color: var(--text-2); text-decoration: none; padding: 8px 12px; border-radius: 6px; font-size: 14px; font-weight: 500; white-space: nowrap; min-height: 40px; display: inline-flex; align-items: center; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--info); }
.top-meta { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tone, var(--neutral)); }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; transition: background .15s, border-color .15s; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.icon-btn[aria-pressed="true"] { color: var(--info); border-color: var(--info); }

main { padding: 16px 20px 24px; max-width: 1640px; margin: 0 auto; min-width: 0; }
.view { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; min-width: 0; box-shadow: var(--shadow); }
.card > h2 { margin-bottom: 12px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.empty { color: var(--text-2); margin: 0; font-size: 14px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

/* ---- tones ---- */
.t-ok { --tone: var(--ok); --tone-bg: var(--ok-bg); }
.t-bad { --tone: var(--bad); --tone-bg: var(--bad-bg); }
.t-warn { --tone: var(--warn); --tone-bg: var(--warn-bg); }
.t-info { --tone: var(--info); --tone-bg: var(--info-bg); }
.t-neutral { --tone: var(--neutral); --tone-bg: var(--neutral-bg); }
.t-violet { --tone: var(--violet); --tone-bg: var(--violet-bg); }
.tag-tone { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--tone); background: var(--tone-bg); white-space: nowrap; max-width: 100%; }
.tag-tone svg { width: 14px; height: 14px; }
.side { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 12px; padding: 1px 8px; border-radius: 4px; color: var(--tone); background: var(--tone-bg); }
.side svg { width: 13px; height: 13px; }
.pos { color: var(--ok); } .neg { color: var(--bad); }

/* ---- KPI strip ---- */

/* ---- chart ---- */
.price { font-size: 20px; font-weight: 500; }
@keyframes pulse { 50% { opacity: .35; } }
.chart { height: 560px; width: 100%; }
.legend { list-style: none; display: flex; gap: 14px; flex-wrap: wrap; padding: 0; margin: 8px 4px 0; font-size: 13px; color: var(--text-2); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend .sw { width: 14px; height: 10px; border-radius: 2px; background: var(--c); border: 1px solid var(--b, transparent); }
.legend .ln { width: 16px; height: 0; border-top: 2px dashed var(--c); }

.seg { display: inline-grid; grid-auto-flow: column; gap: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--text-2); border-radius: 6px; padding: 4px 12px; font: 500 14px "IBM Plex Sans", sans-serif; cursor: pointer; min-height: 34px; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg button .r { font: 500 11px "IBM Plex Mono", monospace; color: var(--info); margin-left: 4px; }

.ticket-hero { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ticket-hero .big { font-size: 26px; font-weight: 600; }
.levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.levels div { border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; min-width: 0; border-left: 3px solid var(--tone); }
.levels .k { font-size: 12px; color: var(--text-2); } .levels .v { font-size: 14px; overflow-wrap: anywhere; }



/* ---- tables ---- */
.table-wrap { overflow: auto; max-width: 100%; border: 1px solid var(--border); border-radius: 8px; max-height: 460px; }
.table-wrap.tall { max-height: calc(100vh - 210px); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { position: sticky; top: 0; background: var(--surface-2); color: var(--text-2); font-weight: 500; font-size: 13px; z-index: 1; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; } tbody tr.click:hover { background: var(--surface-2); }
tbody tr[aria-current="true"] { background: var(--info-bg); }
td.empty { text-align: center; padding: 18px; white-space: normal; }
.sig-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.timeline { list-style: none; margin: 12px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--border); display: grid; gap: 10px; }
.timeline li { position: relative; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: -20px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--tone, var(--info)); }
.btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font: 500 14px "IBM Plex Sans", sans-serif; cursor: pointer; }
.btn:hover { border-color: var(--info); }

/* ---- stats, bars, equity ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 12px; }
.stat { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }
.stat .k { font-size: 12px; color: var(--text-2); } .stat .v { font-size: 18px; font-weight: 600; }
.equity { height: 220px; }
.equity svg { width: 100%; height: 100%; display: block; }
.equity:has(> .empty) { height: auto; }
.bars { display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 2fr) 56px; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .track { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--tone, var(--info)); }
.bar-row .n { text-align: right; font-family: "IBM Plex Mono", monospace; }

/* ---- strategy ---- */
.model-flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; counter-reset: step; }
.model-flow li { position: relative; border: 1px solid var(--border); border-top: 3px solid var(--tone); border-radius: 8px; padding: 10px 12px; background: var(--surface-2); counter-increment: step; }
.model-flow .h { font-weight: 600; display: flex; gap: 8px; align-items: baseline; }
.model-flow .h::before { content: counter(step); font: 600 12px "IBM Plex Mono", monospace; color: var(--tone); }
.model-flow .tfs { font: 500 13px "IBM Plex Mono", monospace; color: var(--tone); }
.model-flow p { margin: 6px 0 0; font-size: 13px; color: var(--text-2); }
.param-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.kv { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 6px 16px; margin: 0; font-size: 14px; }
.kv dt { color: var(--text-2); } .kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.kv dt code { color: var(--text); font-size: 13px; }
.glossary { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); } .glossary dd { text-align: left; color: var(--text-2); }

/* ---- system ---- */
.diag-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.diag-grid .wide { grid-column: 1 / -1; }
.dq-strip { display: grid; grid-template-columns: repeat(180, minmax(0, 1fr)); gap: 1px; height: 26px; }
.dq-strip span, .dq { display: block; border-radius: 1px; }
.dq { width: 12px; height: 12px; }
.dq.ok, .dq-strip .ok { background: var(--ok); } .dq.syn, .dq-strip .syn { background: var(--info); opacity: .6; } .dq.gap, .dq-strip .gap { background: var(--border-strong); }

/* ---- toasts ---- */
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 30; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--surface); border: 1px solid var(--border-strong); border-left: 4px solid var(--tone); border-radius: 10px; padding: 10px 14px; box-shadow: 0 6px 24px rgba(0,0,0,.3); font-size: 14px; display: grid; gap: 2px; }
.toast b { color: var(--tone); }

.foot { text-align: center; padding: 12px 20px 24px; color: var(--text-3); font-size: 13px; }

/* ---- responsive ---- */
@media (max-width: 1200px) {
  .diag-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sig-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; padding: 8px 16px; gap: 8px; }
  .nav { order: 3; flex-basis: 100%; }
  .brand-sub, #feed-pill { display: none; }
  main { padding: 12px 16px 20px; }
  .two-col, .diag-grid, .model-flow { grid-template-columns: minmax(0, 1fr); }
  .dq-strip { grid-template-columns: repeat(90, minmax(0, 1fr)); }
  .dq-strip span:nth-child(-n+90) { display: none; }
}

/* ---- markets, fullscreen, positions (v2) ---- */
.sym-seg { display: inline-flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.sym-seg button { display: grid; gap: 0; text-align: left; border: 0; background: transparent; color: var(--text-2); border-radius: 8px; padding: 3px 12px; cursor: pointer; font: 600 14px "IBM Plex Sans", sans-serif; min-height: 40px; }
.sym-seg button .p { font: 500 12px "IBM Plex Mono", monospace; color: var(--text-3); }
.sym-seg button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.sym-seg button[aria-selected="true"] .p { color: var(--text-2); }
.filters-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
body.has-max { overflow: hidden; }
@media (max-width: 760px) {
  .sym-seg { order: 2; }
  .sym-seg button { padding: 3px 8px; }
}

/* position levels never break a price over two lines */
.levels { gap: 6px; }
.levels div { padding: 6px; }
.levels .k { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.levels .v { white-space: nowrap; font-size: 13px; overflow-wrap: normal; }

/* ---- chart workspace (web/chart/*) ---- */
body[data-view="chart"] main { max-width: none; padding: 8px 12px 12px; }
.chart-ws { padding: 0; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.ws-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.ws-head { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.ws-title { font-weight: 600; white-space: nowrap; }
.ws-price { color: var(--text-2); }
.ws-spacer { flex: 1; }
.ws-tfs button { min-height: 32px; padding: 3px 11px; }
.ws-trends, .tf-trends { display: flex; gap: 4px; flex-wrap: wrap; }
.tf-trend { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 6px; font: 500 12px "IBM Plex Mono", monospace; border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; }
.tf-trend b { font-weight: 600; color: var(--text); }
.tf-trend.t-bull { color: var(--ok); background: var(--ok-bg); border-color: var(--ok); }
.tf-trend.t-bear { color: var(--bad); background: var(--bad-bg); border-color: var(--bad); }
.tf-trend.t-bull b, .tf-trend.t-bear b { color: inherit; }
.ws-layers-btn[aria-expanded="true"] { border-color: var(--info); color: var(--info); }
.ws-panel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 24px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.ws-panel[hidden] { display: none; }
.ws-group h3 { margin: 0; font-size: 13px; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.ws-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.ws-group > .ws-form { margin-bottom: 6px; }
.ws-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; }
.ws-row label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.ws-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--info); }
.ws-gear { border: 1px solid var(--border); background: transparent; color: var(--text-2); border-radius: 6px; width: 28px; height: 28px; cursor: pointer; font-size: 14px; }
.ws-gear:hover { color: var(--text); border-color: var(--border-strong); }
.ws-form { padding: 6px 0 8px 24px; }
.ws-form[hidden] { display: none; }
.ws-fields { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; }
.ws-field { display: grid; gap: 2px; font-size: 12px; color: var(--text-2); }
.ws-field input { width: 92px; padding: 4px 6px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); color: var(--text); font: 13px "IBM Plex Mono", monospace; }
.ws-check { grid-auto-flow: column; align-items: center; justify-content: start; gap: 6px; }
.ws-check input { width: 16px; height: 16px; accent-color: var(--info); }
.btn-quiet { min-height: 28px; padding: 3px 10px; font-size: 12px; }
.ws-slot { position: relative; height: calc(100vh - 150px); min-height: 480px; }
.ws-chart { position: absolute; inset: 0 0 0 44px; }
.ws-chart.ws-drawing { cursor: crosshair; }
.ws-chart.ws-hover { cursor: pointer; }
.ws-draw { position: absolute; left: 0; top: 0; bottom: 0; width: 44px; z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; border-right: 1px solid var(--border); background: var(--surface); }
.ws-draw button { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text-2); cursor: pointer; padding: 0; }
.ws-draw button svg { width: 20px; height: 20px; }
.ws-draw button:hover { background: var(--surface-2); color: var(--text); }
.ws-draw button[aria-pressed="true"] { color: var(--info); border-color: var(--info); background: var(--info-bg); }
.ws-draw-sep { width: 22px; height: 1px; background: var(--border); margin: 4px 0; }
.ws-readout { position: absolute; left: 54px; top: 6px; z-index: 3; color: var(--text-2); pointer-events: none; background: color-mix(in srgb, var(--surface) 80%, transparent); padding: 1px 6px; border-radius: 4px; }
.ws-readout:empty { display: none; }
.ws-note { position: absolute; left: 54px; top: 30px; z-index: 3; font-size: 13px; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; }
.chart-ws:fullscreen, .chart-ws.ws-max { position: fixed; inset: 0; z-index: 50; border-radius: 0; border: 0; margin: 0; background: var(--surface); }
.chart-ws:fullscreen .ws-slot, .chart-ws.ws-max .ws-slot { flex: 1; height: auto; min-height: 0; }
/* trades panel under the chart (web/chart/trading.js) */
.chart-ws.ws-trades-open:not(.ws-max):not(:fullscreen) .ws-slot { height: calc(100vh - 330px); min-height: 420px; }
.ws-trades { border-top: 1px solid var(--border); background: var(--surface); flex: none; }
.ws-trade-head { display: flex; align-items: center; gap: 10px; padding: 6px 10px; }
.ws-trade-tabs button { min-height: 30px; padding: 3px 11px; font-size: 13px; }
.ws-trade-status { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ws-trade-body { max-height: 170px; overflow: auto; border-top: 1px solid var(--border); }
.ws-trade-body[hidden] { display: none; }
.chart-ws:fullscreen .ws-trade-body, .chart-ws.ws-max .ws-trade-body { max-height: 30vh; }
.ws-trade-table { font-size: 13px; }
.ws-trade-table th, .ws-trade-table td { padding: 6px 9px; }
.ws-trade-row { cursor: pointer; } .ws-trade-row:hover { background: var(--surface-2); }
.ws-trade-events td { background: var(--surface-2); white-space: normal; }
.ws-trade-events ol { margin: 0; padding-left: 18px; font-size: 12px; color: var(--text-2); display: grid; gap: 2px; }
.ws-trade-empty { margin: 0; padding: 14px 12px; font-size: 13px; color: var(--text-2); }
.ws-token { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ws-token input, .ws-dialog input { padding: 5px 8px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); color: var(--text); font: 13px "IBM Plex Mono", monospace; }
.ws-badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 12px; font-weight: 500; border: 1px solid currentColor; }
.b-pending { color: var(--info); } .b-active { color: var(--violet); } .b-closed { color: var(--text-2); }
.b-canceled { color: var(--text-3); } .b-rejected, .b-error { color: var(--bad); }
.ws-draw .ws-trade-btn { color: var(--warn); }
.ws-draw .ws-trade-btn:hover { background: var(--warn-bg); color: var(--warn); }
.ws-dialog { border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text); padding: 18px 20px; width: min(440px, calc(100vw - 32px)); box-shadow: 0 8px 30px rgba(0,0,0,.35); }
.ws-dialog::backdrop { background: rgba(0,0,0,.45); }
.ws-dialog h2 { margin: 0 0 4px; font-size: 17px; }
.ws-dialog .ws-fields { margin: 12px 0; }
.ws-dialog .ws-field input { width: 130px; }
.ws-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 8px 0; font-size: 13px; }
.ws-dl dt { color: var(--text-2); } .ws-dl dd { margin: 0; text-align: right; }
.ws-dlg-msg { min-height: 18px; margin: 8px 0; font-size: 13px; color: var(--warn); }
.ws-dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }
.ws-go { color: #fff; border: 0; }
.ws-go.go-long { background: var(--ok); } .ws-go.go-short { background: var(--bad); }
.ws-go:disabled { opacity: .5; cursor: not-allowed; }
/* the toolbar repeats the trend strip only where the top bar is not visible */
.chart-ws:not(.ws-max):not(:fullscreen) .ws-trends { display: none; }
@media (max-width: 1100px) { .tf-trends { display: none; } .chart-ws .ws-trends { display: flex !important; } .ws-panel { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .ws-slot { height: 70vh; min-height: 380px; } .ws-trends { order: 5; } }


/* ---- sign in (web/login.html) ---- */
.logout-form { display: inline; margin: 0; }
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: min(380px, 100%); padding: 24px 26px; display: grid; gap: 12px; }
.login h1 { margin: 4px 0 0; font-size: 20px; }
.login-form { display: grid; gap: 12px; }
.login-form label { display: grid; gap: 4px; font-size: 13px; color: var(--text-2); }
.login-form input { padding: 9px 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface-2); color: var(--text); font: 15px "IBM Plex Sans", sans-serif; }
.login-form input:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
.login-btn { justify-content: center; min-height: 40px; background: var(--info); border-color: var(--info); color: #fff; }
.login-warn { margin: 0; font-size: 13px; color: var(--warn); background: var(--warn-bg); padding: 8px 10px; border-radius: 8px; }
.login-err { margin: 0; font-size: 13px; color: var(--bad); background: var(--bad-bg); padding: 8px 10px; border-radius: 8px; }
.b-origin { color: var(--warn); margin-left: 4px; }
.ws-trade-acts { display: flex; gap: 6px; }
.ws-attn { border-color: var(--warn); color: var(--warn); }
.ws-raw { margin-top: 6px; color: var(--text-2); word-break: break-word; }
.ws-link { border: 0; background: none; padding: 0; color: var(--info); font: inherit; cursor: pointer; text-decoration: underline dotted; }
.ws-link:hover { text-decoration: underline; }
