:root {
  color-scheme: light;
  --bg: #f5f3ed;
  --paper: #fff;
  --ink: #233640;
  --muted: #526671;
  --quiet: #61717a;
  --line: #d9e0e0;
  --line-light: #eceeeb;
  --navy: #172c37;
  --navy-deep: #10212b;
  --gold: #c6aa71;
  --gold-soft: #f3ebd9;
  --cream-tint: #f9f6ee;
  --up: #17674f;
  --down: #ae4148;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --sans: Inter, "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: Georgia, "Times New Roman", serif;
  --shadow: 0 1px 2px #10212b0d;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--sans); }
::selection { background: #eee1c4; color: var(--navy-deep); }
h1, h2, h3, p, dl, dd { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
input, textarea, select { color: var(--ink); }
button { color: inherit; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid #98783b; outline-offset: 3px; }
svg:not(.icon-library):not(#price-chart) { flex: 0 0 auto; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 223px; display: flex; flex-direction: column; background: var(--navy-deep); color: var(--paper); border-right: 1px solid #273e49; padding: 23px 17px 19px; z-index: 2; }
.brand { display: flex; align-items: center; gap: 10px; margin: 0 6px; width: fit-content; white-space: nowrap; }
.brand img { flex: none; }
.brand-wordmark { display: grid; gap: 3px; line-height: 1.06; }
.brand-wordmark strong { font-size: 18px; font-weight: 680; letter-spacing: -.045em; }
.brand-wordmark > span { font-size: 10px; color: #e1ca96; font-weight: 610; letter-spacing: .105em; text-transform: uppercase; }
.sidebar :focus-visible { outline-color: var(--gold); }
.rail-main { flex: 1; margin-top: 39px; }
.rail-caption { margin: 0 11px 9px; color: #aabdc7; font-size: 10px; font-weight: 670; letter-spacing: .115em; text-transform: uppercase; }
nav { display: grid; gap: 5px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 11px 11px; border: 1px solid transparent; border-radius: 8px; color: #c3d1d8; font-weight: 560; white-space: nowrap; }
.nav-link:hover { background: #203743; color: var(--paper); }
.nav-link[aria-current="page"] { background: #213a47; border-color: #334d59; box-shadow: inset 2px 0 var(--gold); color: var(--paper); font-weight: 660; }
.nav-link[aria-current="page"] svg { color: #dec99b; }
.account-tile { padding: 14px 13px 13px; border: 1px solid #39505a; border-radius: 10px; background: var(--navy); display: grid; gap: 2px; }
.account-label { display: flex; align-items: center; gap: 7px; color: #dec99b; font-size: 11.5px; font-weight: 650; margin-bottom: 3px; }
.account-label svg:not(.icon-library) { width: 15px; height: 15px; }
.account-tile strong { font-size: 19px; font-weight: 720; letter-spacing: -.045em; }
.account-tile > span { color: #b8c7ce; font-size: 11px; }
.workspace { margin-left: 223px; min-width: 0; }
.topbar { padding: 0 32px; height: 63px; border-bottom: 1px solid var(--line); background: var(--paper); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.crumb, .crumb-parent { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; }
.crumb { font-size: 12px; font-weight: 650; }
.crumb-parent { color: var(--quiet); font-weight: 500; }
.crumb-parent svg:not(.icon-library) { width: 13px; height: 13px; color: #89969b; }
.mode { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; border: 1px solid #eadfc6; border-radius: 30px; background: #faf5e9; color: var(--navy); white-space: nowrap; font-size: 11.5px; font-weight: 675; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #9b804d; }
main { max-width: 1540px; margin: 0 auto; padding: 27px 32px 36px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 23px; }
.page-heading h1 { color: var(--navy-deep); font-family: var(--display); font-size: clamp(30px, 2.92vw, 44px); font-weight: 400; letter-spacing: -.051em; line-height: 1.08; }
.page-heading p { margin-top: 6px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.desk-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.automation-grid { grid-template-columns: minmax(0, 1.14fr) minmax(0, 1fr); }
.automation-grid label .plain-select { display: block; width: 100%; margin-top: 5px; }
.auto-rule-text { margin-top: 9px; min-height: 30px; }
.auto-costs { margin: 8px 0 15px; padding: 8px 0 0; border-top: 1px solid var(--line-light); color: var(--muted); }
.auto-costs summary { cursor: pointer; font-size: 12px; font-weight: 680; }
.auto-costs .field-grid { margin-top: 8px; }
.auto-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.auto-note { margin-bottom: 4px; }
.auto-message { min-height: 18px; font-size: 12px; color: var(--up); }
.auto-message.error { color: var(--down); }
#auto-status, #research-status { font-size: clamp(16px, 1.6vw, 25px); }
#ind-status { font-size: clamp(16px, 1.6vw, 25px); }
.indicator-actions { margin-top: 15px; }
.indicator-rules { margin-bottom: 0; }
.indicator-rules ul { display: grid; gap: 7px; margin: 9px 0 0; padding-left: 18px; font-size: 12px; line-height: 1.5; }
.indicators-ledger .table-scroll, .indicator-history { margin-top: 12px; }
.auto-open { margin: 12px 15px; padding: 8px 9px; border: 1px solid #e8dfc8; border-radius: 6px; background: var(--cream-tint); display: grid; gap: 2px; font-size: 12px; }
.auto-open span + span { color: var(--muted); font-size: 11px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 8px; min-height: 37px; padding: 7px 12px; font-weight: 665; font-size: 12.5px; line-height: 1.2; white-space: nowrap; transition: background .15s, border-color .15s; }
.button svg:not(.icon-library) { width: 16px; height: 16px; }
.button-white { border-color: var(--line); background: var(--paper); box-shadow: var(--shadow); }
.button-white:hover:not(:disabled) { border-color: #c3ad7c; background: #faf7ef; }
.button-soft { background: var(--gold-soft); color: var(--navy-deep); border-color: #eadfc6; }
.button-soft:hover:not(:disabled) { background: #ecdfc2; border-color: #dfcda2; }
.button-primary { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: 0 1px 2px #10212b25; }
.button-primary svg:not(.icon-library) { color: #e4cb96; }
.button-primary:hover:not(:disabled) { background: var(--navy-deep); border-color: var(--navy-deep); }
.button:disabled { opacity: .52; }
.icon-button { width: 36px; height: 35px; min-height: 35px; padding: 0; }
.card { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 17px; }
.metric { min-height: 115px; padding: 12px 15px 13px; }
.metric-label { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--muted); font-size: 12px; line-height: 1.2; font-weight: 650; }
.metric-icon, .market-icon { display: inline-grid; place-items: center; flex: none; color: #6b562f; background: var(--gold-soft); width: 29px; height: 29px; border-radius: 8px; }
.metric-icon svg:not(.icon-library) { width: 16px; height: 16px; }
.metric-value { display: block; margin-top: 3px; font-size: clamp(21px, 2.05vw, 31px); line-height: 1.15; font-weight: 740; letter-spacing: -.048em; }
.metric-sub, .goal-row { margin-top: 7px; color: var(--quiet); font-size: 10.75px; line-height: 1.35; }
.goal-row { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.goal-track { flex: 1; position: relative; min-width: 20px; height: 5px; background: #eee9df; border-radius: 12px; }
.goal-track div { border-radius: inherit; width: 0; height: 100%; background: #a4874f; }
.goal-track i { position: absolute; top: -1px; height: 7px; width: 1px; background: #756342; left: 40%; }
.trade-grid { display: grid; grid-template-columns: minmax(0, 2.18fr) minmax(278px, 1fr); gap: 16px; }
.scanner-card { margin-bottom: 17px; }
.scanner-heading { flex-wrap: wrap; }
.scanner-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.scanner-filter, .fx-performance-controls label { color: var(--muted); font-size: 11.5px; font-weight: 650; display: inline-flex; align-items: center; gap: 7px; }
.scanner-actions .button { min-height: 32px; }
.scanner-table td { vertical-align: top; }
.scanner-table td:last-child { vertical-align: middle; }
.scanner-table .signal-why { white-space: normal; min-width: 142px; max-width: 300px; }
.scanner-table .button { min-height: 30px; padding: 5px 8px; }
.scanner-help { border-top: 1px solid var(--line-light); padding: 8px 16px 9px; font-size: 11.5px; color: var(--muted); }
.scanner-help summary { width: fit-content; cursor: pointer; font-weight: 650; }
.scanner-help p { margin-top: 4px; max-width: 760px; }
#scanner-feedback { color: #6b562f; }
#scanner-feedback:empty { display: none; }
.chart-card, .ticket-card { padding: 16px 17px 0; }
.chart-card { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; align-items: start; }
.chart-header, .ticket-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.instrument { display: flex; align-items: center; gap: 9px; min-width: 0; }
.market-icon { width: 39px; height: 39px; border-radius: 10px; }
.market-icon svg:not(.icon-library) { width: 20px; height: 20px; }
.instrument-text { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
#instrument-name { color: var(--quiet); line-height: 1.25; font-size: 11.5px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.select-wrap { display: inline-flex; position: relative; align-items: center; }
.select-wrap > svg:not(.icon-library) { width: 13px; height: 13px; position: absolute; right: 7px; pointer-events: none; }
.select-wrap select { border: none; appearance: none; height: 28px; padding: 0 23px 0 0; background: none; border-radius: 4px; font-size: 16px; line-height: 1.15; font-weight: 730; }
.symbol-wrap > svg:not(.icon-library) { right: 4px; color: var(--quiet); }
.segmented { flex: none; display: flex; align-items: center; border-radius: 8px; padding: 3px; gap: 2px; border: 1px solid #e9e4d9; background: #f5f3ed; }
.segmented button { border: 1px solid transparent; background: transparent; padding: 4px 9px; min-width: 34px; border-radius: 5px; color: var(--quiet); font-weight: 640; font-size: 11px; }
.segmented button:hover { color: var(--navy-deep); }
.segmented button[aria-pressed="true"] { border-color: #e9e4d9; background: white; color: var(--navy); box-shadow: var(--shadow); }
.direction-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 11px; }
.direction-picker button { min-height: 27px; }
.direction-picker + .entry-row { margin-top: 10px; }
.quote-row { min-height: 52px; display: flex; align-items: baseline; align-content: center; gap: 10px; padding-top: 9px; }
.quote-row > strong { font-size: 27px; font-weight: 745; line-height: 1.2; letter-spacing: -.05em; }
.quote-change { font-size: 11.5px; font-weight: 700; display: inline-flex; gap: 3px; align-items: center; white-space: nowrap; }
.quote-change svg:not(.icon-library) { width: 13px; height: 13px; }
.tone-up { color: var(--up); }
.tone-down { color: var(--down); }
.chart-context { color: var(--quiet); font-size: 10.75px; margin-left: auto; text-align: right; }
.price-chart { width: 100%; height: 287px; position: relative; }
#price-chart { display: block; width: 100%; height: 100%; user-select: none; }
#price-chart text { font-family: var(--mono); font-size: 10px; }
#price-chart .chart-label { fill: #61717a; }
#price-chart .chart-overlay-label { font-size: 9px; font-weight: 650; }
.chart-tooltip { position: absolute; z-index: 1; top: 7px; left: 7px; pointer-events: none; background: #fffffff4; border: 1px solid #e2ddcc; padding: 4px 7px; border-radius: 5px; box-shadow: var(--shadow); font: 10px/1.45 var(--mono); color: var(--muted); }
.replay-footer { margin-top: 7px; min-height: 55px; border-top: 1px solid var(--line-light); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 7px 10px; padding: 8px 0 9px; }
.replay-buttons, .replay-time { display: flex; align-items: center; gap: 7px; }
.replay-buttons .button { min-height: 35px; }
.speed-wrap { padding-left: 7px; height: 34px; border-radius: 7px; }
.speed-wrap select { font-size: 11.5px; font-weight: 650; padding-right: 17px; color: var(--muted); }
.speed-wrap > svg:not(.icon-library) { right: 3px; width: 11px; height: 11px; color: var(--muted); }
.replay-time { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.replay-time svg:not(.icon-library) { width: 15px; height: 15px; }
.replay-state { font-size: 10.5px; color: var(--quiet); background: var(--bg); padding: 2px 6px; border-radius: 5px; }
.ticket-card { padding-bottom: 11px; }
h2 { font-size: 16px; letter-spacing: -.02em; font-weight: 730; line-height: 1.3; }
.ticket-title p { color: var(--quiet); margin-top: 2px; font-size: 11.5px; }
.ticket-icon { width: 32px; height: 32px; border-radius: 8px; }
.ticket-icon svg:not(.icon-library) { width: 18px; height: 18px; }
.entry-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; margin-top: 13px; border-radius: 7px; border: 1px solid #ede5d2; background: var(--cream-tint); color: var(--muted); font-size: 11.5px; font-weight: 550; }
.entry-row strong { color: var(--navy-deep); font-size: 14px; }
.ticket-prices { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 11px; }
.ticket-prices label, .shares-label, .field-grid label, .import-label, #note-form label { display: block; color: #465a66; font-size: 11.5px; font-weight: 650; }
.input-shell { display: flex; align-items: center; gap: 5px; min-height: 34px; margin-top: 4px; border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; color: var(--quiet); background: #fff; }
.input-shell:focus-within { border-color: #9a7b3b; box-shadow: 0 0 0 2px #efe5cb; }
.input-shell input { width: 100%; min-width: 0; padding: 0; border: 0; outline: none; background: transparent; font-size: 12.5px; font-weight: 630; line-height: 1.35; font-variant-numeric: tabular-nums; }
.input-shell input:disabled { background: transparent; color: #697b83; }
input[type=number] { appearance: textfield; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { appearance: none; margin: 0; }
.shares-label { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 10px; }
.text-button { display: inline-flex; align-items: center; gap: 5px; background: none; border: none; padding: 0; color: var(--navy); font-size: 11.5px; font-weight: 690; line-height: 1.25; text-align: left; }
.text-button:hover:not(:disabled) { text-decoration: underline; }
.text-button:disabled { color: var(--quiet); }
.text-button svg:not(.icon-library) { width: 14px; height: 14px; }
.quantity-shell { font-size: 10.5px; }
.order-summary { display: grid; gap: 4px; margin: 11px 0 10px; padding: 10px 0 0; border-top: 1px solid var(--line-light); }
.order-summary div, .scenario-output div { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.order-summary dt { color: var(--muted); font-size: 11.5px; }
.order-summary dd { font-size: 12px; font-weight: 690; }
.order-button { width: 100%; justify-content: space-between; min-height: 36px; }
.ticket-feedback { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 6px; }
.ticket-feedback .text-button { flex: none; font-size: 10.5px; }
.ticket-status { min-height: 15px; color: var(--quiet); font-size: 10.5px; line-height: 1.35; }
.ticket-status.error, #settings-message.error { color: var(--down); }
.desk-bottom { margin-top: 16px; }
.section-heading { padding: 13px 16px; min-height: 47px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line-light); }
.section-heading > span, .section-heading p { font-size: 11px; color: var(--quiet); }
.section-heading p { margin-top: 3px; }
.position-empty, .empty { display: flex; align-items: center; gap: 11px; min-height: 97px; padding: 16px; }
.position-empty strong, .empty strong { display: block; font-size: 12.5px; }
.position-empty p, .empty p { color: var(--quiet); font-size: 11.5px; }
.empty { padding-block: 22px; }
.empty-symbol { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: #f4eedf; color: var(--navy); }
.empty-symbol svg:not(.icon-library) { width: 17px; height: 17px; }
.watch-row { display: grid; width: 100%; grid-template-columns: minmax(0, 1fr) auto 61px; gap: 8px; align-items: center; text-align: left; padding: 7px 15px; min-height: 34px; border: 0; background: none; }
.watch-row + .watch-row { border-top: 1px solid var(--line-light); }
.watch-row:last-child { border-radius: 0 0 12px 12px; }
.watch-row:hover, .watch-row[aria-pressed="true"] { background: #faf7ef; }
.watch-row[aria-pressed="true"] { box-shadow: inset 2px 0 #ae9057; }
.watch-row span:first-child { display: flex; align-items: baseline; gap: 5px; overflow: hidden; }
.watch-row b { font-size: 11.5px; }
.watch-row small { color: var(--quiet); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-row > span:not(:first-child) { text-align: right; font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line-light); }
th:first-child, td:first-child { padding-left: 16px; }
th:last-child, td:last-child { padding-right: 16px; }
tr:last-child td { border-bottom: none; }
th { color: var(--quiet); background: #f7f8f6; font-weight: 650; font-size: 10.5px; }
td strong { font-weight: 700; }
td small { color: var(--quiet); font-size: 10.5px; display: block; }
.journal-card .section-heading { padding: 15px 18px; }
.plain-select { min-height: 32px; padding: 4px 8px; border: 1px solid var(--line); background: var(--paper); border-radius: 7px; font-size: 12px; }
.performance-grid, .settings-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; gap: 16px; }
.padded-card { padding: 17px; }
.card-description { color: var(--muted); font-size: 12px; line-height: 1.55; margin: 5px 0 13px; }
.card-description a { color: var(--navy); text-decoration: underline; white-space: normal; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field-grid .input-shell { min-height: 37px; }
.scenario-output { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; display: grid; gap: 6px; }
.scenario-output dt { font-size: 12px; color: var(--muted); }
.scenario-output dd { text-align: right; font-weight: 700; }
.performance-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.fx-performance-controls { margin: -5px 0 12px; }
.session-hit-rate { color: var(--navy-deep); background: var(--cream-tint); border: 1px solid #ede5d2; border-radius: 7px; padding: 7px 9px; margin: 0 0 10px; font-size: 11px; }
.hist-item { padding: 7px 0 9px; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; border-top: 1px solid var(--line-light); font-size: 12px; font-variant-numeric: tabular-nums; }
.hist-item strong { font-weight: 680; }
.hist-item small { color: var(--quiet); font-size: 10.5px; }
.hist-track { grid-column: 1 / -1; background: var(--bg); height: 5px; border-radius: 6px; margin-top: 5px; position: relative; overflow: hidden; }
.hist-track i { position: absolute; inset: 0 auto 0 50%; width: 1px; background: #a9afb1; }
.hist-track span { position: absolute; height: 100%; border-radius: 5px; background: #58a889; left: 50%; }
.hist-track span.negative { background: #d37d7d; left: auto; right: 50%; }
.settings-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 15px; }
#settings-message, .settings-foot { font-size: 11px; color: var(--quiet); }
.import-box { border-top: 1px solid var(--line); margin-top: 17px; padding-top: 12px; }
.import-box h3 { font-size: 13px; font-weight: 700; }
.import-box p { color: var(--muted); font-size: 11.5px; margin-top: 4px; }
.import-box code { font-size: .92em; overflow-wrap: anywhere; }
.import-box a { color: var(--navy); text-decoration: underline; }
.fx-import-controls { display: flex; flex-wrap: wrap; gap: 7px 12px; margin: 9px 0; }
.fx-import-controls label { display: grid; gap: 4px; color: var(--muted); font-size: 11.5px; font-weight: 650; }
.import-label { margin-top: 8px; }
.import-symbol { margin-bottom: 8px; max-width: 150px; }
.settings-foot { margin-top: 13px; }
dialog { border: 1px solid var(--line); border-radius: 12px; padding: 16px; width: min(92vw, 430px); color: var(--ink); box-shadow: 0 10px 45px #10212b35; }
dialog::backdrop { background: #10212b5c; }
#note-form .section-heading { padding: 0 0 9px; min-height: auto; margin-bottom: 12px; }
#note-form textarea { border: 1px solid var(--line); border-radius: 7px; padding: 8px; margin: 5px 0 10px; display: block; width: 100%; resize: vertical; }
.toast { position: fixed; z-index: 4; right: 20px; bottom: 20px; max-width: min(470px, calc(100vw - 40px)); background: #172c37; color: #fff; padding: 11px 15px; border-radius: 8px; font-size: 12px; box-shadow: 0 4px 16px #10212b40; }
.toast.error { background: #88373a; }
#goal-fill, .hist-track span { transition: width .22s; }

@media (min-width: 1540px) {
  .price-chart { height: 322px; }
}
@media (max-width: 1160px) {
  .sidebar { width: 191px; padding-left: 12px; padding-right: 12px; }
  .workspace { margin-left: 191px; }
  .topbar { padding-inline: 22px; }
  main { padding-inline: 22px; }
  .trade-grid { grid-template-columns: minmax(0, 1.8fr) minmax(261px, 1fr); }
}
@media (max-width: 980px) {
  .sidebar { width: 165px; padding-left: 9px; padding-right: 9px; }
  .workspace { margin-left: 165px; }
  .nav-link { font-size: 12px; gap: 8px; padding-inline: 8px; }
  .brand { gap: 7px; }
  .brand-wordmark strong { font-size: 16px; }
  .topbar, main { padding-inline: 16px; }
  .metric { padding: 10px; }
  .metrics { gap: 9px; }
  .trade-grid { gap: 11px; }
  .chart-card, .ticket-card { padding-inline: 12px; }
  .replay-state { display: none; }
}
@media (max-width: 790px) {
  .sidebar { position: static; width: auto; padding: 11px 13px 0; border-right: 0; border-bottom: 1px solid #344b57; gap: 8px; }
  .workspace { margin-left: 0; }
  .brand { margin-left: 3px; }
  .brand img { width: 34px; height: 34px; }
  .brand-wordmark strong { font-size: 17px; }
  .rail-main { margin: 0 -2px; }
  .rail-caption, .account-tile { display: none; }
  nav { display: flex; overflow-x: auto; gap: 2px; padding: 1px 2px 6px; }
  .nav-link { font-size: 11.5px; padding: 8px; }
  .nav-link svg:not(.icon-library) { width: 15px; height: 15px; }
  .topbar { height: 44px; }
  main { padding-top: 18px; }
  .page-heading { margin-bottom: 17px; }
  .page-heading p { font-size: 12.5px; }
}
@media (max-width: 630px) {
  .trade-grid, .performance-grid, .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 12px; }
  .metric { min-height: 91px; padding: 8px 10px 10px; }
  .metric-icon { width: 25px; height: 25px; }
  .metric-label { font-size: 11.5px; }
  .metric-value { font-size: 23px; }
  .metric-sub, .goal-row { margin-top: 4px; }
  .chart-card, .ticket-card { padding-top: 12px; }
  .price-chart { height: 243px; }
  .quote-row { min-height: 44px; }
  .quote-row > strong { font-size: 25px; }
  .replay-footer { min-height: 49px; }
  .desk-bottom { margin-top: 11px; }
  .page-heading .button { font-size: 10.5px; padding: 6px 8px; min-height: 32px; }
  .page-heading .button svg:not(.icon-library) { width: 13px; height: 13px; }
  html[data-desk-asset="forex"] .page-heading:has(.desk-actions) { align-items: flex-start; flex-wrap: wrap; gap: 9px; }
  .scanner-heading { align-items: flex-start; gap: 8px; }
  .scanner-filter { gap: 5px; }
  .scanner-table, .scanner-table tbody { display: block; width: 100%; }
  .scanner-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .scanner-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "pair action" "setup setup" "level ratio" "pnl pnl"; gap: 7px 8px; padding: 12px 16px; border-bottom: 1px solid var(--line-light); }
  .scanner-table tbody tr:last-child { border-bottom: 0; }
  .scanner-table tbody td { padding: 0; border: 0; white-space: normal; }
  .scanner-table .signal-pair { grid-area: pair; }
  .scanner-table .signal-setup { grid-area: setup; }
  .scanner-table .signal-level { grid-area: level; }
  .scanner-table .signal-pnl { grid-area: pnl; }
  .scanner-table .signal-ratio { grid-area: ratio; text-align: right; }
  .scanner-table .signal-action { grid-area: action; align-self: center; }
  .scanner-table td[data-label]::before { content: attr(data-label); display: block; color: var(--quiet); font-size: 10px; }
}
@media (max-width: 390px) {
  .nav-link { gap: 4px; padding-inline: 6px; font-size: 11px; }
  .nav-link svg:not(.icon-library) { width: 13px; height: 13px; }
  .topbar, main { padding-inline: 11px; }
  .quote-row { gap: 6px; }
  .quote-change { font-size: 10px; }
  .chart-context { font-size: 9.5px; }
  .replay-time svg:not(.icon-library) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
