:root {
  --bg: #0b0e14; --panel: #131824; --panel-2: #182031; --line: #232c40; --line-2: #2e3950;
  --text: #e8ecf4; --muted: #8893a8; --dim: #5d6880;
  --accent: #6c8cff; --accent-2: #8fa8ff;
  --green: #2fbf8f; --green-bg: rgba(47,191,143,.12);
  --red: #f0616d; --red-bg: rgba(240,97,109,.12);
  --amber: #e9b44c; --amber-bg: rgba(233,180,76,.12);
  --radius: 14px;
  font-family: Inter, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; }
body { min-height: 100vh; }
a { color: var(--accent-2); text-decoration: none; }
h1 { font-size: 22px; margin: 0; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0 0 12px; font-weight: 600; }
h3 { font-size: 13px; margin: 0; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; }
.num { font-variant-numeric: tabular-nums; }
.pos { color: var(--green); } .neg { color: var(--red); }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 28px; padding: 0 24px;
  height: 60px; background: rgba(11,14,20,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
body.live .topbar { border-bottom: 2px solid var(--red); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand.big { justify-content: center; font-size: 24px; }
.logo { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: #fff; font-size: 16px;
  background: linear-gradient(135deg, #6c8cff, #9b6cff); }
nav { display: flex; gap: 4px; flex: 1; }
nav a { padding: 8px 14px; border-radius: 9px; color: var(--muted); font-weight: 500; }
nav a:hover { color: var(--text); background: var(--panel); }
nav a.active { color: var(--text); background: var(--panel-2); }
.top-right { display: flex; align-items: center; gap: 12px; }
.clock { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }
.pill { padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.pill.paper { background: rgba(108,140,255,.16); color: var(--accent-2); }
.pill.live { background: var(--red); color: #fff; }
.chip { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.chip.ok::before { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }
.chip.bad::before { background: var(--red); box-shadow: 0 0 0 3px var(--red-bg); }
.demo-banner { background: var(--amber-bg); color: var(--amber); text-align: center; padding: 7px; font-size: 13px; font-weight: 600; }

/* layout */
main#view { max-width: 1240px; margin: 0 auto; padding: 26px 24px 80px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g2 { grid-template-columns: 1fr 1fr; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.card + .card, .grid + .card, .card + .grid, .grid + .grid, .status + .grid, .status + .card { margin-top: 16px; }
.grid > .card { margin-top: 0; }
.kpi .value { font-size: 26px; font-weight: 650; margin-top: 6px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.meter { height: 6px; border-radius: 4px; background: var(--line); margin-top: 12px; overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 4px; background: var(--green); transition: width .4s; }
.meter > i.warn { background: var(--amber); } .meter > i.bad { background: var(--red); }

/* status strip */
.status { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel); }
.status .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--dim); flex: none; }
.status.on { border-color: rgba(47,191,143,.45); background: linear-gradient(90deg, var(--green-bg), var(--panel) 60%); }
.status.on .dot { background: var(--green); box-shadow: 0 0 0 5px var(--green-bg); animation: pulse 2s infinite; }
.status.wait .dot { background: var(--amber); box-shadow: 0 0 0 5px var(--amber-bg); }
.status.stop { border-color: rgba(240,97,109,.5); background: linear-gradient(90deg, var(--red-bg), var(--panel) 60%); }
.status.stop .dot { background: var(--red); }
.status .text { flex: 1; min-width: 0; }
.status .title { font-weight: 600; font-size: 16px; }
.status .actions { display: flex; gap: 10px; }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px rgba(47,191,143,0); } }

/* buttons & forms */
.btn { border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); padding: 9px 16px; border-radius: 10px;
  font: inherit; font-weight: 600; cursor: pointer; transition: filter .15s, background .15s; white-space: nowrap; }
.btn:hover { filter: brightness(1.15); } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.go { background: var(--green); border-color: var(--green); color: #06281d; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: transparent; } .btn.small { padding: 5px 11px; font-size: 13px; } .btn.wide { width: 100%; padding: 12px; }
label { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }
input, select { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg); color: var(--text); font: inherit; font-variant-numeric: tabular-nums; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.field { margin-bottom: 16px; } .field .hint { color: var(--dim); font-size: 12.5px; margin-top: 5px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; border-top: 1px solid var(--line); }
.switch-row:first-of-type { border-top: 0; }
.switch-row b { font-weight: 550; } .switch-row .hint { color: var(--dim); font-size: 12.5px; }
.switch { position: relative; width: 44px; height: 25px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 20px; background: var(--line-2); transition: .2s; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + i { background: var(--accent); } .switch input:checked + i::after { transform: translateX(19px); }
.error { color: var(--red); font-size: 13.5px; }
.savebar { position: fixed; left: 0; right: 0; bottom: 0; padding: 14px 24px; background: var(--panel-2); border-top: 1px solid var(--line-2);
  display: flex; justify-content: center; align-items: center; gap: 16px; z-index: 15; }

/* tables */
.table-wrap { overflow-x: auto; margin: 0 -8px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; padding: 8px; white-space: nowrap; }
td { padding: 10px 8px; border-top: 1px solid var(--line); white-space: nowrap; }
th.r, td.r { text-align: right; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--panel-2); color: var(--muted); }
.tag.buy { background: var(--green-bg); color: var(--green); } .tag.sell { background: var(--red-bg); color: var(--red); }
.tag.warn { background: var(--amber-bg); color: var(--amber); } .tag.bad { background: var(--red-bg); color: var(--red); }
.empty { color: var(--dim); padding: 22px 0; text-align: center; }

/* feeds */
.feed { list-style: none; margin: 0; padding: 0; max-height: 330px; overflow-y: auto; }
.feed li { padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; display: flex; gap: 10px; }
.feed li:first-child { border-top: 0; }
.feed time { color: var(--dim); flex: none; font-variant-numeric: tabular-nums; }
.feed .alert { color: var(--red); } .feed .warn { color: var(--amber); } .feed .trade { color: var(--text); font-weight: 550; }
.feed .skipped { color: var(--muted); }

/* steps */
.steps { display: grid; gap: 10px; }
.step { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 10px; background: var(--panel-2); }
.step .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--line-2); flex: none; }
.step.done .n { background: var(--green); color: #06281d; } .step.done { color: var(--muted); }
.step .grow { flex: 1; }

/* chart */
.chart { width: 100%; height: 220px; display: block; }
.chart text { fill: var(--dim); font-size: 11px; }

/* modal & toast */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(4,6,10,.7); display: grid; place-items: center; padding: 20px; }
.modal[hidden], .toast[hidden] { display: none; }
.dialog { width: 100%; max-width: 460px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; padding: 24px; }
.dialog h2 { font-size: 18px; } .dialog .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.dialog ul { padding-left: 18px; color: var(--muted); font-size: 14px; }
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 60; padding: 12px 20px; border-radius: 12px;
  background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: 0 10px 40px rgba(0,0,0,.5); max-width: 90vw; }
.toast.bad { border-color: var(--red); color: #ffd5d8; }
.note { padding: 12px 14px; border-radius: 10px; background: var(--amber-bg); color: #f0d59a; font-size: 13.5px; }
.note.info { background: rgba(108,140,255,.1); color: #c3d0ff; }
code { background: var(--bg); border: 1px solid var(--line); padding: 2px 7px; border-radius: 6px; font-size: 13px; word-break: break-all; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 6px 14px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; }
.seg button.active { background: var(--panel-2); color: var(--text); }
progress { width: 100%; height: 8px; accent-color: var(--accent); }

/* login */
.login-body { display: grid; place-items: center; padding: 20px;
  background: radial-gradient(900px 500px at 50% -10%, rgba(108,140,255,.16), transparent), var(--bg); }
.login-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 32px 28px; }
.login-card form { margin: 22px 0 14px; display: grid; gap: 14px; }

@media (max-width: 900px) {
  .g4 { grid-template-columns: 1fr 1fr; } .g3, .g2, .fields { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 10px; }
  nav { order: 3; flex-basis: 100%; overflow-x: auto; } #broker-chip, .clock { display: none; }
  main#view { padding: 18px 14px 90px; } .status { flex-wrap: wrap; }
}

/* Vani desk — graphite surfaces, mint accents and a persistent workspace rail. */
:root {
  --bg: #0c0f12; --panel: #13171b; --panel-2: #1b2126;
  --line: #262d32; --line-2: #37434a; --text: #edf2f1;
  --muted: #9ca9af; --dim: #8b999f; --accent: #a4e4cf; --accent-2: #b8eddb;
  --green: #8adbb9; --green-bg: rgba(138,219,185,.09);
  --red: #ff8792; --red-bg: rgba(255,135,146,.09);
  --amber: #e9c185; --amber-bg: rgba(233,193,133,.09); --radius: 12px;
  color-scheme: dark;
}
html, body { font-size: 14px; }
body { background: radial-gradient(ellipse at 90% 0, #17222155, transparent 45%), var(--bg); }
::selection { background: #a4e4cf40; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 4px; }
.skip-link { position: fixed; top: -80px; left: 250px; z-index: 100; padding: 12px 20px; background: var(--accent); color: #10251d; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.topbar { position: fixed; inset: 0 auto 0 0; width: 224px; height: 100dvh; padding: 34px 18px 22px; flex-direction: column; align-items: stretch; gap: 0; background: #101417; border: 0; border-right: 1px solid var(--line); backdrop-filter: none; }
body.live .topbar { border-bottom: 0; }
.brand { gap: 12px; padding: 0 12px; font-size: 29px; letter-spacing: -1.5px; }
.logo { width: 37px; height: 40px; border-radius: 11px; background: var(--accent); color: #10271f; font-size: 24px; font-weight: 800; box-shadow: inset 0 0 0 1px #c8ffea30; }
.brand-caption { display: block; font-size: 8px; letter-spacing: 2.4px; font-weight: 600; color: var(--muted); margin-top: -3px; }
.nav-label { font-size: 10px; font-weight: 650; letter-spacing: 1.8px; color: var(--dim); padding: 54px 14px 16px; }
nav { flex-direction: column; gap: 7px; flex: 0; }
nav a { display: flex; align-items: center; gap: 13px; padding: 12px 14px; font-size: 13px; border: 1px solid transparent; border-radius: 8px; transition: background .15s, color .15s; }
nav a.active { color: var(--accent); background: #a4e4cf0d; border-color: #a4e4cf20; }
nav a.active::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-left: auto; }
.nav-icon { display: inline-grid; place-items: center; width: 20px; height: 20px; font-size: 22px; font-weight: 400; line-height: 1; }
.sidebar-footer { margin-top: auto; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding: 20px 5px 0; font-size: 12px; }
.sidebar-footer div span { display: block; color: var(--dim); font-size: 10px; margin-top: 4px; }
.sidebar-monogram { border: 1px solid var(--line-2); border-radius: 8px; padding: 9px 6px; font-size: 10px; color: var(--accent); letter-spacing: 1px; }
.workspace-bar { margin-left: 224px; height: 77px; padding: 0 36px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); background: #0e1215d9; }
.workspace-title { color: var(--dim); font-size: 12px; white-space: nowrap; }
.workspace-title span { margin: 0 13px; color: var(--line-2); }
.workspace-title b { color: var(--text); font-weight: 500; }
.top-right { gap: 16px; }
.clock { font-size: 12px; }
.pill { font-size: 10px; padding: 5px 9px; letter-spacing: 1px; border: 1px solid #a4e4cf25; border-radius: 5px; }
.pill.paper { color: var(--accent); background: #a4e4cf0b; }
.pill.live { color: #fff; background: #a32f40; border-color: var(--red); }
body.live .workspace-bar { box-shadow: inset 0 2px var(--red); }
.chip { font-size: 11px; }
.chip::before { width: 6px; height: 6px; }
.demo-banner { margin-left: 224px; font-size: 11px; letter-spacing: .3px; padding: 8px 20px; }
main#view { max-width: 1690px; margin: 0 0 0 224px; padding: 36px 36px 80px; }
h1 { font-size: 32px; font-weight: 550; letter-spacing: -1.1px; line-height: 1.2; }
h2 { font-size: 14px; font-weight: 600; letter-spacing: -.15px; }
h3 { font-size: 10px; letter-spacing: 1.3px; font-weight: 600; }
.page-head { margin-bottom: 28px; }
.page-head h1 { margin-bottom: 10px; }
.eyebrow { color: var(--dim); font-size: 9px; font-weight: 650; letter-spacing: 1.65px; }
.page-head .eyebrow { margin-bottom: 10px; }
.heading-dot { color: var(--accent); }
.market-state { display: inline-flex; align-items: center; gap: 9px; border: 1px solid var(--line); background: var(--panel); border-radius: 7px; padding: 10px 12px; color: var(--muted); font-size: 11px; }
.market-state i { width: 6px; height: 6px; background: var(--muted); border-radius: 50%; }
.market-state.is-open i { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }
.market-state span { border-left: 1px solid var(--line-2); margin-left: 5px; padding-left: 12px; color: var(--dim); font-size: 10px; }
.card { padding: 23px 24px; box-shadow: 0 3px 12px #0000000c; min-width: 0; }
.grid { gap: 16px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi { position: relative; overflow: hidden; min-height: 153px; }
.kpi:first-child { background: linear-gradient(120deg, #1a2925, var(--panel) 85%); border-color: #344b42; }
.kpi .value { font-size: clamp(25px, 2.3vw, 38px); font-weight: 500; letter-spacing: -1.3px; margin: 16px 0 8px; line-height: 1.1; }
.kpi .sub { font-size: 11px; line-height: 1.5; letter-spacing: 0; }
.kpi .value > .sub { font-size: 13px; }
.meter { height: 4px; margin: 14px 0 8px; }
.status { padding: 18px 22px; border-radius: 10px; gap: 18px; }
.status .dot { width: 8px; height: 8px; }
.status .title { font-size: 13px; margin-bottom: 4px; }
.status .muted { font-size: 11px; line-height: 1.6; }
.status.on { border-color: #355346; background: linear-gradient(90deg, #15251f, var(--panel) 70%); }
.btn { font-size: 12px; border-radius: 7px; padding: 10px 15px; font-weight: 600; transition: background .15s, border-color .15s; }
.btn.primary, .btn.go { color: #112a21; background: var(--accent); border-color: var(--accent); }
.btn.danger { background: #9b3040; border-color: #cf5a69; color: #fff; }
.btn:hover { filter: brightness(1.12); }
.btn.small { font-size: 11px; padding: 6px 10px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 18px; }
.section-head h2 { margin: 0; }
.section-head .small { font-size: 11px; }
.count-badge { display: inline-flex; justify-content: center; min-width: 22px; margin-left: 7px; padding: 3px 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font-size: 10px; }
th { padding: 12px 10px; font-size: 9px; letter-spacing: 1px; background: #0d111480; }
td { padding: 15px 10px; font-size: 12px; }
tbody tr:hover { background: #a4e4cf04; }
td b { font-weight: 600; }
.tag { border-radius: 4px; padding: 4px 7px; font-size: 9px; letter-spacing: .4px; }
.empty { font-size: 12px; padding: 34px 10px; color: var(--muted); }
.position-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding: 28px 0 20px; }
.empty-symbol { font-size: 30px; color: var(--accent); line-height: 1.1; margin-bottom: 6px; }
.position-empty strong { color: var(--text); font-size: 14px; font-weight: 500; }
.position-empty > span:last-child { font-size: 11px; }
.feed li { padding: 14px 0; font-size: 12px; line-height: 1.6; }
.feed time { font-size: 10px; padding-top: 2px; }
.feed li.empty { justify-content: center; padding: 28px 10px; }
input, select { padding: 11px 12px; border-radius: 7px; font-size: 13px; }
.field .hint, .switch-row .hint { line-height: 1.6; }
.note.info { background: #a4e4cf0c; color: #bfdbd1; }
.seg button { font-size: 12px; }
.seg button.active { background: #a4e4cf1a; color: var(--accent); }
.savebar { left: 224px; background: #18211ff5; backdrop-filter: blur(12px); }
.modal { background: #050a0dc9; backdrop-filter: blur(8px); }
.dialog { padding: 30px; box-shadow: 0 24px 100px #0008; }
.dialog h2 { font-size: 21px; }
.toast { background: #202a26; border-color: #446054; }
.login-body { display: grid; grid-template-columns: 1.15fr 1fr; gap: 70px; padding: 70px max(6vw, 24px); background: radial-gradient(ellipse at 5% 50%, #1c3b3038, transparent 60%), var(--bg); }
.login-intro { max-width: 580px; width: 100%; }
.login-intro h1 { font-size: clamp(36px, 4.7vw, 67px); line-height: 1.12; letter-spacing: -2.5px; font-weight: 500; margin: 28px 0 24px; }
.login-intro p { color: var(--muted); font-size: 15px; line-height: 1.8; }
.login-footnote { font-size: 9px; letter-spacing: 1.4px; color: var(--muted); }
.login-footnote span { color: var(--accent); margin: 0 14px; }
.login-card { max-width: 420px; padding: 38px; border-color: #344039; background: linear-gradient(145deg, #18211e, var(--panel) 55%); box-shadow: 0 30px 80px #0003; }
.brand.big { justify-content: flex-start; padding: 0; font-size: 30px; margin-bottom: 40px; }
.login-card h2 { font-size: 29px; font-weight: 500; letter-spacing: -.8px; margin: 9px 0; }
.login-card > p { font-size: 12px; }
.login-card form { margin: 28px 0 22px; gap: 20px; }
.login-card label { font-size: 11px; }
.login-card input { margin-top: 9px; padding: 13px; }
.login-card input[name=code] { letter-spacing: 3px; }
.login-card input[name=code]::placeholder { letter-spacing: 0; }
.login-card .wide { margin-top: 3px; padding: 14px; }
.login-art { height: 160px; margin: 28px 0 35px; display: flex; align-items: center; gap: 17px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(0deg, transparent, transparent 39px, #a4e4cf07 39px, #a4e4cf07 40px); overflow: hidden; }
.login-art span { display: block; flex: 1; max-width: 21px; height: 46px; background: #8adbb93b; border: 1px solid #8adbb960; border-radius: 2px; position: relative; }
.login-art span::before { content: ''; position: absolute; width: 1px; height: calc(100% + 25px); background: #8adbb94f; top: -12px; left: 50%; }
.login-art span:nth-child(3n) { background: #ff87921f; border-color: #ff879250; height: 31px; }
.login-art span:nth-child(4n+1) { transform: translateY(32px); height: 34px; }
.login-art span:nth-child(4n+2) { transform: translateY(12px); height: 55px; }
.login-art span:nth-child(4n+3) { transform: translateY(-12px); }
.login-art span:nth-child(4n) { transform: translateY(-25px); height: 63px; }
@media (min-width: 1900px) { main#view { margin-left: max(224px, calc((100vw - 1466px) / 2)); margin-right: auto; max-width: 1466px; } }
@media (max-width: 1200px) {
  .topbar { width: 194px; padding-left: 12px; padding-right: 12px; }
  .workspace-bar, .demo-banner { margin-left: 194px; }
  main#view { margin-left: 194px; padding: 28px 24px 80px; }
  .workspace-bar { padding: 0 24px; }
  .workspace-title { display: none; }
  .workspace-bar { justify-content: flex-end; }
  .savebar { left: 194px; }
  .card { padding: 20px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .value { font-size: 34px; }
}
@media (max-width: 900px) {
  .topbar { width: 180px; height: 100dvh; flex-wrap: nowrap; padding: 24px 10px; gap: 0; }
  .brand { padding: 0 8px; }
  nav { order: initial; flex-basis: auto; overflow: visible; }
  nav a { padding: 12px 10px; gap: 8px; font-size: 12px; }
  .workspace-bar, .demo-banner { margin-left: 180px; }
  main#view { margin-left: 180px; padding: 26px 20px 90px; }
  .savebar { left: 180px; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .status .actions { width: 100%; padding-left: 26px; flex-wrap: wrap; }
  h1 { font-size: 28px; }
  .login-body { gap: 35px; padding: 35px; }
  .login-card { padding: 26px; }
  .login-intro h1 { font-size: 38px; }
}
@media (max-width: 640px) {
  .topbar { position: relative; width: 100%; height: auto; padding: 17px 16px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { font-size: 25px; padding: 0; }
  .brand .logo { width: 31px; height: 34px; font-size: 21px; }
  .brand-caption { font-size: 7px; }
  .nav-label, .sidebar-footer { display: none; }
  nav { flex-direction: row; overflow-x: auto; margin-top: 18px; gap: 3px; padding-bottom: 12px; }
  nav a { flex-shrink: 0; padding: 9px 11px; font-size: 11px; }
  .nav-icon { display: none; }
  nav a.active::after { display: none; }
  .workspace-bar { margin-left: 0; height: auto; min-height: 55px; padding: 10px 16px; justify-content: flex-start; }
  .top-right { width: 100%; gap: 12px; flex-wrap: wrap; }
  #broker-chip { display: inline-flex; }
  #logout { margin-left: auto; }
  .demo-banner { margin-left: 0; font-size: 10px; }
  main#view { margin: 0; padding: 25px 16px 80px; }
  .page-head { gap: 16px; margin-bottom: 22px; }
  .page-head .eyebrow { font-size: 8px; }
  h1 { font-size: 29px; }
  .market-state { padding: 7px 10px; }
  .card { padding: 17px 15px; }
  .grid { gap: 10px; }
  .kpi { min-height: 140px; }
  .kpi .value { font-size: 28px; }
  .kpi .sub { font-size: 10px; }
  h3 { font-size: 9px; letter-spacing: .8px; }
  .status { padding: 16px; }
  .status .actions { padding-left: 0; gap: 8px; }
  .status .actions .btn { flex: 1; }
  .section-head { align-items: flex-start; flex-wrap: wrap; }
  .savebar { left: 0; padding: 12px 16px; font-size: 12px; }
  .login-body { grid-template-columns: 1fr; gap: 26px; padding: 32px 20px; }
  .login-intro { max-width: 420px; }
  .login-intro h1 { font-size: 35px; letter-spacing: -1.3px; margin: 16px 0; }
  .login-intro p, .login-art, .login-footnote { display: none; }
  .login-card { max-width: 420px; padding: 28px; }
  .brand.big { margin-bottom: 28px; }
  .skip-link { left: 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Focused settings workspace */
.settings-mode { border-color: #344b42; background: linear-gradient(100deg, #182720, var(--panel) 70%); }
.settings-mode.is-live { border-color: #a34d58; background: linear-gradient(100deg, #301b21, var(--panel) 70%); }
.settings-mode h2 { display: flex; align-items: center; gap: 12px; margin-bottom: 5px; }
.settings-mode .switch-row { padding-bottom: 0; }
.settings-mode .hint { max-width: 680px; }
.settings-tabs { display: flex; gap: 6px; padding: 7px; margin: 24px 0 28px; border: 1px solid var(--line); border-radius: 10px; background: #101518; overflow-x: auto; }
.settings-tabs button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 6px; padding: 12px 16px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.settings-tabs button:hover { color: var(--text); background: var(--panel-2); }
.settings-tabs button[aria-selected=true] { color: var(--accent); background: #a4e4cf10; border-color: #a4e4cf24; }
.settings-dirty-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--amber); visibility: hidden; }
.has-changes .settings-dirty-dot { visibility: visible; }
.settings-panel { max-width: 1050px; }
.settings-section-intro { margin: 0 0 20px; }
.settings-section-intro h2 { font-size: 19px; font-weight: 500; margin-bottom: 5px; }
.settings-section-intro p { font-size: 12px; color: var(--muted); margin: 0; }
.settings-panel > .card + .card { margin-top: 16px; }
.settings-panel .card > h2 { margin-bottom: 20px; }
.settings-panel .fields { column-gap: 32px; row-gap: 7px; }
.settings-panel .field { margin-bottom: 16px; }
.settings-panel .switch-row { padding: 18px 0; align-items: flex-start; }
.settings-panel .switch { margin-top: 2px; }
.settings-panel .switch-row .hint { max-width: 690px; margin-top: 5px; }
.settings-advanced summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 4px 0; font-size: 13px; font-weight: 600; list-style: none; cursor: pointer; }
.settings-advanced summary::-webkit-details-marker { display: none; }
.settings-advanced summary::after { content: '+'; color: var(--accent); font-size: 21px; font-weight: 400; }
.settings-advanced[open] > summary::after { content: '−'; }
.settings-advanced summary small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); margin-top: 5px; line-height: 1.6; }
.settings-advanced .advanced-content { padding-top: 22px; margin-top: 18px; border-top: 1px solid var(--line); }
.card > details.settings-advanced { border-top: 1px solid var(--line); padding-top: 15px; margin-top: 10px; }
.settings-panel .card > p { line-height: 1.7; }
@media (max-width: 640px) {
  .settings-tabs { gap: 3px; padding: 5px; margin: 20px 0; }
  .settings-tabs button { flex: none; padding: 11px 12px; font-size: 11px; }
  .settings-mode .switch-row { flex-wrap: wrap; gap: 14px; }
  .settings-panel .fields { grid-template-columns: minmax(0, 1fr); }
  .settings-section-intro h2 { font-size: 18px; }
  #settings-change-count { font-size: 11px; }
}
