:root {
  color-scheme: dark;
  --bg: #0d1113;
  --surface: #11181c;
  --surface-2: #162025;
  --surface-3: #1b282b;
  --line: #273136;
  --line-strong: #3a494f;
  --text: #e1e9ec;
  --muted: #a7b2b8;
  --subtle: #81949d;
  --teal: #50d9b5;
  --teal-soft: rgba(33, 230, 193, 0.11);
  --violet: #ab8cff;
  --violet-soft: rgba(171, 140, 255, 0.11);
  --amber: #f6bc62;
  --red: #ff667d;
  --green: #43e5a2;
  --mono: "SFMono-Regular", "Roboto Mono", Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 8px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body[data-radar-api] .metrics-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -.01em;
}

button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .42; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 1000; padding: 10px 14px; background: var(--teal); color: #07100f; border-radius: 6px; font-weight: 800; text-decoration: none; }
.skip-link:focus { top: 12px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px clamp(18px, 3vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 9, 13, .86);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { position: relative; width: 31px; height: 31px; border: 1px solid rgba(33,230,193,.35); border-radius: 8px; transform: rotate(45deg); box-shadow: inset 0 0 18px rgba(33,230,193,.1); }
.brand-mark i { position: absolute; display: block; background: var(--teal); box-shadow: 0 0 10px rgba(33,230,193,.55); }
.brand-mark i:first-child { width: 13px; height: 2px; top: 9px; left: 8px; }
.brand-mark i:last-child { width: 2px; height: 13px; top: 9px; left: 14px; background: var(--violet); box-shadow: 0 0 10px rgba(171,140,255,.55); }
.brand > span:last-child { display: grid; line-height: 1.05; }
.brand strong { font: 750 15px/1 var(--mono); letter-spacing: .08em; }
.brand small { margin-top: 5px; color: var(--muted); font: 600 9px/1 var(--mono); letter-spacing: .18em; }
.brand small b { color: var(--violet); }
.workspace-nav { display:flex; align-items:center; gap:16px; flex-wrap:wrap; }
.workspace-nav a { color:var(--muted); text-decoration:none; font-size:12px; white-space:nowrap; }
.workspace-nav a[aria-current="page"] { color:var(--teal); }
.workspace-nav a:focus-visible { outline:2px solid var(--teal); outline-offset:3px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.refresh-controls { display: grid; justify-items: stretch; gap: 4px; }
.refresh-speeds { display: flex; justify-content: center; gap: 4px; }
.speed-option { position: relative; display: inline-flex; }
.speed-button { min-width: 29px; padding: 3px 5px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); background: #0d1117; font: 700 10px/1.1 var(--mono); }
.speed-button.is-active { color: var(--teal); border-color: rgba(33,230,193,.45); background: var(--teal-soft); }
.speed-button:disabled { color: #596170; opacity: .55; cursor: not-allowed; pointer-events: none; }
.speed-option::after { content: attr(data-tooltip); position: absolute; z-index: 30; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); padding: 5px 7px; border: 1px solid var(--line-strong); border-radius: 4px; background: #171c24; color: var(--text); font: 600 10px/1 var(--mono); white-space: nowrap; opacity: 0; visibility: hidden; pointer-events: none; }
.speed-option:hover::after, .speed-option:focus-within::after { opacity: 1; visibility: visible; }
.mode-switch { display: flex; padding: 3px; border: 1px solid var(--line); background: #090c11; border-radius: 8px; }
.mode-button { border: 0; border-radius: 5px; padding: 7px 12px; color: var(--muted); background: transparent; font: 700 10px/1 var(--mono); letter-spacing: .08em; }
.mode-button.is-active { color: #04110e; background: var(--teal); box-shadow: 0 0 16px rgba(33,230,193,.2); }
.mode-button[data-mode="demo"].is-active { color: #0d0718; background: var(--violet); box-shadow: 0 0 16px rgba(171,140,255,.2); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 8px 12px; border: 1px solid transparent; border-radius: 7px; color: var(--text); background: transparent; font-size: 12px; font-weight: 700; }
.button-quiet { border-color: var(--line); background: rgba(255,255,255,.025); color: #bcc3cc; }
.button-quiet:hover { border-color: var(--line-strong); background: rgba(255,255,255,.05); }
.button-primary { color: #081914; background: var(--teal); }
.button-primary:hover { background: #45efcf; }
.button-paper { border-color: rgba(171,140,255,.35); color: #d7caff; background: var(--violet-soft); }
.button-kill { border-color: rgba(255,102,125,.35); color: #ff9dac; background: rgba(255,102,125,.08); }
.button-arm { color: #06130f; background: var(--green); }
.button-icon { font: 700 13px/1 var(--mono); }
.refresh-icon.is-spinning { display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.shell { width: min(1560px, 100%); margin: 0 auto; padding: 36px 28px 72px; }
.status-strip { display: grid; grid-template-columns: minmax(260px, 1fr) auto; align-items: center; gap: 20px 26px; padding-bottom: 26px; }
.eyebrow { display: flex; align-items: center; gap: 7px; color: #778291; font: 700 9px/1.2 var(--mono); letter-spacing: .13em; text-transform: uppercase; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--subtle); box-shadow: 0 0 0 3px rgba(255,255,255,.035); }
.live-dot.is-live { background: var(--green); box-shadow: 0 0 0 3px rgba(67,229,162,.1), 0 0 12px rgba(67,229,162,.5); }
.live-dot.is-error { background: var(--red); box-shadow: 0 0 0 3px rgba(255,102,125,.1); }
.status-lead h1 { margin: 8px 0 4px; font-size: clamp(24px, 2vw, 34px); line-height: 1.1; letter-spacing: -.045em; }
.status-lead p { max-width: 590px; margin: 0; color: var(--muted); font-size: 12px; }
.status-meta { display: flex; gap: 22px; padding: 0 22px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.status-controls { display: flex; align-items: center; gap: 16px; }
.status-meta div { display: grid; gap: 4px; }
.status-meta span { color: var(--subtle); font-size: 10px; }
.status-meta strong { font: 650 11px/1.2 var(--mono); color: #bcc4ce; white-space: nowrap; }
.source-grid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 9px; }
.source-card { position: relative; overflow: hidden; min-height: 78px; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.02); }
.source-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 2px; background: var(--source-color, var(--subtle)); }
.source-head, .source-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.source-head strong { font: 700 11px/1 var(--mono); }
.source-status { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.source-status i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.source-status.ok { color: var(--green); }.source-status.error { color: var(--red); }.source-status.loading { color: var(--amber); }
.source-count { margin: 8px 0 5px; font: 700 18px/1 var(--mono); }
.source-foot { color: var(--subtle); font: 500 9px/1.2 var(--mono); }
.source-error { margin-top: 5px; color: #ff9dac; font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-detail { margin-top: 5px; color: var(--muted); font-size: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-skeleton { width: 70%; height: 10px; margin-top: 18px; border-radius: 10px; background: linear-gradient(90deg,#171b23,#222833,#171b23); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.metric-card { position: relative; min-height: 104px; display: grid; align-content: center; gap: 5px; padding: 18px 22px; border-right: 1px solid var(--line); }
.metric-card:last-child { border: 0; }
.metric-card > span { color: var(--muted); font-size: 11px; }
.metric-card > strong { font: 720 25px/1 var(--mono); letter-spacing: -.04em; }
.metric-card > small { color: var(--subtle); font-size: 10px; }
.metric-card.metric-accent::before { content:""; position:absolute; left:0; top:25%; bottom:25%; width:2px; background:var(--teal); box-shadow:0 0 14px var(--teal); }
.metric-accent > strong { color: var(--teal); }
.auto-state { font-size: 17px !important; letter-spacing: .05em !important; }
.auto-state.is-armed { color: var(--green); }.auto-state.is-killed { color: var(--red); }.auto-state.is-disarmed { color: var(--muted); }

.notice { display: flex; align-items: center; gap: 11px; margin: 12px 0 16px; padding: 10px 13px; border: 1px solid rgba(246,188,98,.15); border-radius: 8px; background: rgba(246,188,98,.045); }
.notice.is-demo { border-color: rgba(171,140,255,.24); background: var(--violet-soft); }
.notice.is-auth { border-color: rgba(67,229,162,.24); background: rgba(67,229,162,.06); }
.notice.is-error { border-color: rgba(255,102,125,.25); background: rgba(255,102,125,.07); }
.notice-icon { flex: 0 0 21px; width: 21px; height: 21px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; color: var(--amber); font: 700 11px/1 var(--mono); }
.notice.is-demo .notice-icon { color: var(--violet); }.notice.is-error .notice-icon { color: var(--red); }
.notice.is-auth .notice-icon { color: var(--green); }
.notice strong { display: inline; margin-right: 8px; font-size: 11px; }
.notice p { display: inline; margin: 0; color: var(--muted); font-size: 10px; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 354px; gap: 14px; align-items: start; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.panel-header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.panel-header.compact { min-height: 66px; }
.panel-header h2 { margin: 5px 0 0; font-size: 16px; line-height: 1; }
.panel-actions { display: flex; gap: 7px; }
.text-button { padding: 0; border: 0; color: var(--muted); background: none; font-size: 10px; text-decoration: underline; text-decoration-color: rgba(255,255,255,.2); text-underline-offset: 3px; }
.text-button:hover { color: var(--text); }

.settings-panel { padding: 16px 18px; border-bottom: 1px solid var(--line); background: #0d1117; }
.settings-heading { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 13px; }
.settings-heading strong { font-size: 12px; }.settings-heading span { max-width: 560px; color: var(--muted); font-size: 10px; }
.form-grid { display: grid; gap: 10px; }
.settings-grid { grid-template-columns: repeat(4, minmax(100px,1fr)); }
.form-grid label { display: grid; gap: 5px; color: var(--muted); font-size: 9px; }
.form-grid input, select, .search-field { min-width: 0; border: 1px solid var(--line); border-radius: 6px; color: var(--text); background: #090c11; }
.form-grid input { width: 100%; height: 34px; padding: 0 9px; font: 600 11px/1 var(--mono); }
.settings-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 11px; }
.settings-footer p { margin: 0; color: var(--subtle); font-size: 9px; }

.filterbar { display: grid; grid-template-columns: minmax(180px, 1fr) repeat(4, auto); gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.filterbar select { height: 36px; padding: 0 29px 0 10px; font-size: 10px; }
.search-field { display: flex; align-items: center; gap: 7px; padding: 0 10px; }
.search-field > span { color: var(--subtle); font: 700 17px/1 var(--mono); }
.search-field input { width: 100%; height: 34px; padding: 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 11px; }
.search-field input::placeholder { color: #525a66; }
.check-filter { display: flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 10px; cursor: pointer; }
.check-filter input { accent-color: var(--teal); }
.moneyness-filters { display: flex; grid-column: 1 / -1; align-items: center; flex-wrap: wrap; gap: 6px 14px; min-width: 0; margin: 0; padding: 0; border: 0; color: var(--muted); font-size: 11px; }
.moneyness-filters legend { padding: 0; font-weight: 600; }
.moneyness-filters label { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; cursor: pointer; }
.moneyness-filters input { accent-color: var(--teal); }

.table-wrap { position: relative; max-width: 100%; min-height: 430px; overflow-x: auto; overflow-y: auto; overscroll-behavior-inline: contain; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
.comparison-table { table-layout: fixed; min-width: 760px; }
.comparison-table th:nth-child(1) { width: 20%; }
.comparison-table th:nth-child(2) { width: 10%; }
.comparison-table th:nth-child(3), .comparison-table th:nth-child(4) { width: 13%; }
.comparison-table th:nth-child(5) { width: 17%; }
.comparison-table th:nth-child(6) { width: 10%; }
.comparison-table th:nth-child(7) { width: 8%; }
.comparison-table th:nth-child(8) { width: 9%; }
th { position: sticky; top: 0; z-index: 4; height: 39px; padding: 0 12px; border-bottom: 1px solid var(--line); color: #91a2ab; background: var(--surface-2); text-align: left; font-size: 10px; font-weight: 600; white-space: nowrap; }
th button { width: 100%; padding: 0; border: 0; color: inherit; background: none; text-align: inherit; font: inherit; }
th button span { margin-left: 3px; color: #3a414c; }
th[aria-sort] button { color: #c5cbd3; }
th[aria-sort] button span { color: var(--teal); }
th.num, td.num { text-align: right; }
th.venue-buy { color: rgba(33,230,193,.72); } th.venue-sell { color: rgba(171,140,255,.76); }
td { height: 62px; padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,.052); vertical-align: middle; white-space: nowrap; }
.comparison-table th, .comparison-table td { padding-right: 8px; padding-left: 8px; }
.comparison-table th { line-height: 1.2; white-space: normal; overflow-wrap: anywhere; }
.comparison-table td { overflow: hidden; }
.comparison-table .contract-main, .comparison-table .bbo { min-width: 0; }
.comparison-table .contract-main small, .comparison-table .bbo small { white-space: normal; line-height: 1.25; overflow-wrap: anywhere; }
.comparison-table .net-cell small { white-space: normal; line-height: 1.2; }
.comparison-table .expiry-cell small { white-space: normal; line-height: 1.2; }
.comparison-table .direction { flex-wrap: wrap; }
.comparison-table .status-pill { max-width: 100%; white-space: normal; line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
tbody tr { cursor: pointer; transition: background .15s ease; }
tbody tr:hover { background: rgba(255,255,255,.025); }
tbody tr.is-selected { background: rgba(33,230,193,.045); box-shadow: inset 2px 0 var(--teal); }
.contract-cell { display: grid; grid-template-columns: 35px minmax(0,1fr); gap: 9px; align-items: center; }
.asset-icon { width: 35px; height: 35px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.025); font: 700 10px/1 var(--mono); }
.contract-main { display: grid; gap: 3px; }
.contract-main strong { font: 700 11px/1.1 var(--mono); }.contract-main small { color: var(--subtle); font-size: 9px; }
.expiry-cell { display: grid; gap: 3px; }.expiry-cell strong { font: 600 10px/1.1 var(--mono); }.expiry-cell small { color: var(--subtle); font-size: 9px; }
.bbo { display: grid; gap: 3px; justify-items: start; font-family: var(--mono); }.bbo strong { font-size: 10px; }.bbo small { color: var(--subtle); font-size: 8px; }
.bbo .bid { color: var(--green); }.bbo .ask { color: #e6b3bb; }
.quote-venue { margin-bottom: 1px; }
.execution-price.buy { color: #e6b3bb; }.execution-price.sell { color: var(--green); }
.direction { display: flex; align-items: center; gap: 5px; font: 650 9px/1 var(--mono); }
.venue-tag { padding: 4px 6px; border-radius: 4px; background: rgba(255,255,255,.04); }
.venue-tag.paradex { color: var(--teal); background: var(--teal-soft); }.venue-tag.derive { color: var(--violet); background: var(--violet-soft); }
.venue-tag.deribit { color: #66d99c; background: rgba(75,207,137,.1); }.venue-tag.bybit { color: #ffc55b; background: rgba(247,166,0,.1); }
.venue-tag.okx { color: #d8dee8; background: rgba(216,222,232,.08); }.venue-tag.binance { color: #f0b90b; background: rgba(240,185,11,.1); }.venue-tag.thalex { color: #7db5ff; background: rgba(94,161,255,.1); }
.venue-tag.callput { color: #ff8db7; background: rgba(255,141,183,.1); }
.venue-tag.callput-robinhood { color: #00c805; background: rgba(0,200,5,.1); }
.direction-arrow { color: var(--subtle); }
.net-cell { display: grid; gap: 3px; justify-items: end; }.net-cell strong { font: 700 12px/1 var(--mono); }.net-cell small { color: var(--subtle); font: 500 8px/1 var(--mono); }
.net-cell.is-positive strong { color: var(--green); }.net-cell.is-unverified strong { color: var(--amber); }.net-cell.is-negative strong, .net-cell.is-unavailable strong { color: var(--muted); }
.status-pill { display: inline-flex; align-items: center; padding: 4px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.025); font: 700 8px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.status-pill.status-candidate { border-color: rgba(67,229,162,.2); color: var(--green); background: rgba(67,229,162,.07); }
.status-pill.status-blocked { border-color: rgba(246,188,98,.18); color: var(--amber); background: rgba(246,188,98,.055); }
.status-pill.status-stale { border-color: rgba(255,102,125,.18); color: #ff9dac; background: rgba(255,102,125,.055); }
.status-pill[data-blockers] { cursor: help; }
.blocker-tooltip { position: fixed; z-index: 1000; max-width: min(320px, calc(100vw - 16px)); padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: #1b282b; color: var(--text); font: 12px/1.5 var(--sans); white-space: normal; overflow-wrap: anywhere; box-shadow: 0 8px 24px rgba(0,0,0,.35); pointer-events: none; }
.empty-state { position: absolute; inset: 40px 0 0; display: grid; place-content: center; justify-items: center; padding: 30px; text-align: center; }
.empty-state[hidden] { display: none; }
.empty-state > span { color: var(--subtle); font-size: 34px; }.empty-state strong { margin-top: 10px; font-size: 13px; }.empty-state p { max-width: 340px; margin: 5px 0 14px; color: var(--muted); font-size: 10px; }
.table-footer { display: flex; justify-content: space-between; align-items: center; min-height: 51px; padding: 8px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.pagination { display: flex; align-items: center; gap: 8px; }.pagination button { width: 29px; height: 29px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: rgba(255,255,255,.025); }.pagination span { min-width: 42px; text-align: center; font: 600 9px/1 var(--mono); }

.side-stack { min-width: 0; display: grid; gap: 14px; }
.ticket-panel, .automation-panel, .activity-panel { overflow: hidden; }
.ticket-empty { min-height: 250px; display: grid; place-content: center; justify-items: center; padding: 25px 38px; text-align: center; }
.ticket-empty span { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--subtle); font-size: 18px; }
.ticket-empty p { margin: 12px 0 0; color: var(--muted); font-size: 11px; }
#ticket-content { padding: 16px; }
.ticket-contract { display: flex; justify-content: space-between; gap: 15px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.ticket-contract > div:first-child { display: grid; gap: 2px; }.ticket-contract > div > span { color: var(--muted); font-size: 10px; }.ticket-contract > div > strong { font: 700 20px/1 var(--mono); }
.ticket-contract dl { display: flex; gap: 18px; margin: 0; }.ticket-contract dl div { display: grid; align-content: start; gap: 2px; text-align: right; }.ticket-contract dt { color: var(--subtle); font-size: 8px; }.ticket-contract dd { margin: 0; font: 600 9px/1.2 var(--mono); }
.direction-picker { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; padding: 12px 0 0; color: var(--muted); font-size: 9px; }
.direction-picker select { width: 100%; height: 34px; padding: 0 28px 0 9px; font-size: 9px; }
.legs { display: grid; gap: 7px; padding: 14px 0; }
.leg { display: grid; grid-template-columns: 39px 1fr auto; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.02); }
.leg-side { padding: 5px 0; border-radius: 4px; text-align: center; font: 800 8px/1 var(--mono); letter-spacing: .06em; }.leg-side.buy { color: var(--teal); background: var(--teal-soft); }.leg-side.sell { color: var(--violet); background: var(--violet-soft); }
.leg-main { display: grid; gap: 2px; }.leg-main strong { font-size: 10px; }.leg-main small { color: var(--subtle); font-size: 8px; }.leg-price { font: 700 12px/1 var(--mono); text-align: right; }.leg-price small { display: block; margin-top: 4px; color: var(--subtle); font-size: 8px; font-weight: 500; }
.venue-comparison { margin-bottom: 13px; padding: 11px 0 5px; border-top: 1px solid var(--line); }
.venue-comparison-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 7px; }.venue-comparison-head strong { font-size: 10px; }.venue-comparison-head span { color: var(--subtle); font-size: 8px; }
.venue-quote-list { display: grid; gap: 5px; }
.venue-quote-row { display: grid; grid-template-columns: max-content minmax(0,1fr) max-content; align-items: center; gap: 8px; padding: 7px 8px; border: 1px solid rgba(255,255,255,.055); border-radius: 6px; background: rgba(255,255,255,.016); }
.venue-quote-row > div { min-width: 0; display: grid; gap: 2px; }.venue-quote-row strong { min-width: 0; display: flex; flex-wrap: wrap; gap: 3px 5px; font: 650 9px/1 var(--mono); }.venue-quote-row strong i { color: var(--subtle); font-style: normal; }.venue-quote-row .bid { color: var(--green); }.venue-quote-row .ask { color: #e6b3bb; }
.venue-quote-row small { color: var(--subtle); font-size: 7px; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; }.venue-quote-row > span:last-child { color: var(--muted); font: 550 8px/1 var(--mono); white-space: nowrap; }
.calculation { display: grid; gap: 7px; padding: 13px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.capital-allocation { display: grid; gap: 9px; padding: 12px 0; border-top: 1px solid var(--line); }
.capital-allocation > strong { font-size: 10px; color: var(--text); }
.capital-allocation .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.capital-allocation p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
.capital-allocation input::placeholder { color: var(--subtle); }
.calculation-total strong.metric-unverified { color: var(--amber); }
.calculation-total strong.metric-negative, .calculation-total strong.metric-unavailable { color: var(--muted); }
.calculation > div { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 9px; }.calculation strong { color: #c4cad2; font: 650 9px/1 var(--mono); }.calculation-total { margin: 3px 0; padding-top: 10px; border-top: 1px dashed var(--line-strong); align-items: baseline; }.calculation-total span { color: var(--text); font-weight: 700; }.calculation-total strong { color: var(--green); font-size: 16px; }
.risk-list { display: grid; gap: 7px; padding: 13px 0 4px; }
.risk-item { display: flex; gap: 7px; color: var(--muted); font-size: 9px; }.risk-item span { color: var(--amber); font: 700 10px/1.2 var(--mono); }
.ticket-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 12px; }.ticket-actions .button { padding-left: 7px; padding-right: 7px; }
.execution-boundary { margin: 10px 0 0; color: var(--subtle); font-size: 8px; text-align: center; }

.auto-badge { padding: 5px 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font: 800 8px/1 var(--mono); letter-spacing: .06em; }.auto-badge.is-armed { color: var(--green); border-color: rgba(67,229,162,.3); background: rgba(67,229,162,.07); }.auto-badge.is-killed { color: var(--red); border-color: rgba(255,102,125,.3); background: rgba(255,102,125,.07); }
.panel-copy { margin: 0; padding: 13px 16px 0; color: var(--muted); font-size: 9px; }
.automation-grid { grid-template-columns: 1fr 1fr; padding: 13px 16px; }
.live-confirm { display: none; align-items: flex-start; gap: 8px; margin: -2px 16px 13px; color: var(--muted); font-size: 9px; cursor: pointer; }
.live-confirm.is-visible { display: flex; }
.live-confirm input { margin: 2px 0 0; accent-color: var(--teal); }
.auto-reason { display: flex; gap: 8px; margin: 0 16px 13px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,255,.02); }.auto-reason span { color: var(--muted); font-size: 7px; }.auto-reason p { margin: 0; color: var(--muted); font-size: 9px; }
.auto-reason.is-armed span { color: var(--green); }.auto-reason.is-killed span { color: var(--red); }
.auto-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 7px; padding: 0 16px 16px; }
.activity-panel .panel-header { min-height: 57px; }.activity-panel .panel-header h2 { font-size: 14px; }
.activity-list { max-height: 240px; overflow: auto; padding: 4px 15px 12px; }
.history-note { margin: 10px 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
.history-error { color: var(--red); font-size: 10px; }
.opportunity-entry .history-profit { color: var(--amber); }
.activity-entry { display: grid; grid-template-columns: 55px 1fr; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }.activity-entry time { color: var(--subtle); font: 500 8px/1.4 var(--mono); }.activity-entry div { display: grid; gap: 2px; }.activity-entry strong { font-size: 9px; }.activity-entry p { margin: 0; color: var(--muted); font-size: 8px; overflow-wrap: anywhere; }.muted { color: var(--subtle); font-size: 9px; }

.footer { display: flex; justify-content: space-between; gap: 20px; width: min(1800px,100%); margin: 0 auto; padding: 5px clamp(18px,3vw,48px) 30px; color: var(--subtle); font: 600 8px/1.5 var(--mono); letter-spacing: .08em; }
.footer p { margin: 0; }.footer nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 15px; }.footer a { text-decoration: none; }.footer a:hover { color: var(--text); }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 8px; width: min(360px, calc(100vw - 40px)); pointer-events: none; }
.toast { padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 8px; color: #d7dce2; background: #171c24; box-shadow: 0 14px 38px rgba(0,0,0,.42); font-size: 10px; animation: toast-in .2s ease-out; }.toast.error { border-color: rgba(255,102,125,.35); }.toast.success { border-color: rgba(67,229,162,.35); }
@keyframes toast-in { from { opacity:0; transform: translateY(7px); } }

@media (max-width: 1250px) {
  .status-strip { grid-template-columns: 1fr auto; }.source-grid { grid-column: 1 / -1; }.workspace { grid-template-columns: minmax(0,1fr) 326px; }.settings-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 980px) {
  .status-controls { flex-wrap: wrap; justify-content: flex-end; }
  .workspace { grid-template-columns: minmax(0,1fr); }.side-stack { grid-template-columns: repeat(2,minmax(0,1fr)); }.activity-panel { grid-column: 1/-1; }.metrics-grid { grid-template-columns: 1fr 1fr; }.metric-card:nth-child(2) { border-right: 0; }.metric-card:nth-child(-n+2) { border-bottom: 1px solid var(--line); }.filterbar { grid-template-columns: 1fr 1fr 1fr; }.search-field { grid-column: 1/-1; }.status-meta { border-right: 0; }
}
@media (max-width: 680px) {
  .status-controls { justify-content: flex-start; margin: 12px 0; }
  .topbar { position: relative; align-items: flex-start; padding: 14px 16px; }.topbar-actions { flex-wrap: wrap; justify-content: flex-end; }.topbar .button-quiet { display: none; }.button-primary { min-height: 33px; padding: 7px 9px; }.button-primary .button-icon + * { display: none; }
  .shell { padding: 21px 12px 35px; }.status-strip { display: block; }.status-meta { margin: 17px 0; padding: 0; border: 0; }.source-grid { grid-template-columns: 1fr 1fr; }.metrics-grid { grid-template-columns: 1fr 1fr; }.metric-card { min-height: 90px; padding: 15px; }.metric-card > strong { font-size: 20px; }
  .notice { align-items: flex-start; }.notice strong, .notice p { display: block; }.notice p { margin-top: 3px; }
  .panel-header { padding: 14px; }.panel-actions .button { padding: 7px 8px; font-size: 9px; }.settings-grid, .automation-grid { grid-template-columns: 1fr 1fr; }.settings-heading { display: grid; }
  .filterbar { grid-template-columns: 1fr 1fr; }.search-field { grid-column: 1/-1; }.check-filter { justify-content: center; }
  .table-wrap { min-height: 390px; }.side-stack { grid-template-columns: minmax(0,1fr); }.activity-panel { grid-column: auto; }
  .footer { display: grid; padding: 5px 16px 25px; }.footer nav { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }

/* Separate vanilla and vertical-spread comparison surfaces. */
.comparison-menu { display:flex; align-items:center; gap:6px; padding:12px 0; flex-wrap:wrap; }
.quote-scope { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:11px; }
.quote-scope { margin-left:auto; }
.quote-scope select { max-width:100%; padding:8px 10px; }
.venue-filter { position:relative; color:var(--muted); font-size:11px; }
.venue-filter summary { padding:8px 10px; border:1px solid var(--line); border-radius:6px; background:var(--surface); cursor:pointer; }
.venue-filter summary:focus-visible { outline:2px solid var(--teal); outline-offset:2px; }
.venue-filter-panel { position:absolute; top:100%; right:0; z-index:10; min-width:170px; margin:0; padding:8px 12px 12px; border:1px solid var(--line-strong); border-radius:8px; background:var(--surface); }
.venue-filter-panel legend { padding:0 4px; background:var(--surface); }
.venue-filter-actions { display:flex; gap:12px; }
.venue-filter-actions button { min-height:28px; }
.venue-filter-options label { display:flex; align-items:center; gap:7px; min-height:28px; white-space:nowrap; cursor:pointer; }
.venue-filter-options input { accent-color:var(--teal); }
.comparison-mode { border:1px solid var(--line); border-radius:7px; padding:10px 18px; background:var(--surface); color:var(--muted); font-size:12px; font-weight:650; }
.comparison-mode.is-active { color:var(--teal); border-color:rgba(33,230,193,.4); background:var(--teal-soft); }
.shell > .settings-panel { border:1px solid var(--line); border-radius:var(--radius); margin-bottom:16px; }
/* Shared vanilla components also style call/put spread surfaces. */
.venue-identity { display:inline-flex; align-items:center; gap:5px; vertical-align:middle; white-space:nowrap; }
.venue-name-stacked { display:grid; gap:1px; line-height:.95; white-space:normal; }
.venue-logo { flex:0 0 16px; width:16px; height:16px; object-fit:contain; border-radius:3px; }
.source-head { gap:6px; }
.source-head .venue-logo { width:18px; height:18px; flex-basis:18px; }
.source-head .venue-identity { gap:6px; }
.direction .venue-logo { width:12px; height:12px; flex-basis:12px; }
.activity-entry .venue-logo { width:12px; height:12px; flex-basis:12px; }
#spread-workspace { margin-top:0; }
.spread-filters { grid-template-columns:repeat(3,minmax(0,1fr)); }
.spread-filters label { display:grid; gap:5px; color:var(--muted); font-size:9px; min-width:0; }
.spread-filters input,.spread-filters select { width:100%; min-width:0; height:36px; padding:0 9px; border:1px solid var(--line); border-radius:6px; color:var(--text); background:#090c11; font-size:10px; }
.spread-filters .spread-candidate { display: flex; align-self: end; align-items: center; font-size: 10px; }
.spread-filters .spread-candidate input { width: auto; height: auto; }
.spread-summary { padding:10px 14px; margin:0; color:var(--muted); font-size:9px; border-bottom:1px solid var(--line); }
#spread-body tr { cursor:pointer; }
#spread-body .contract-main strong { white-space:normal; overflow-wrap:anywhere; }
.spread-empty { padding:32px!important; color:var(--muted); text-align:center; white-space:normal!important; }
.spread-detail-content { padding:0 15px 15px; font-size:10px; }
.spread-detail-content .muted { color:var(--muted); font-size:9px; line-height:1.7; }
.spread-detail-content h3 { font-size:10px; margin:14px 0 9px; }
.spread-detail-content > .direction-picker { margin:12px 0; }
.spread-legs { display:grid; gap:8px; margin:10px 0; }
.spread-legs .leg-main small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.spread-costs { display:grid; gap:7px; margin:12px 0; }
.spread-costs > span { display:flex; justify-content:space-between; gap:10px; color:var(--muted); font-size:9px; }
.spread-costs b { color:#c4cad2; font:650 9px var(--mono); }
.spread-costs b.metric-unverified { color:var(--amber); }
.spread-costs b.metric-negative { color:var(--muted); }
.spread-block { display:block; color:var(--muted); font-size:9px; margin-top:5px; }
.spread-blockers { color:var(--amber); font-size:9px; line-height:1.7; }
#spread-watches { padding:12px 15px; border-top:1px solid var(--line); color:var(--muted); font-size:9px; }
#spread-watches summary { cursor:pointer; }
.spread-watch-row { display:flex; align-items:center; gap:8px; justify-content:space-between; padding-top:10px; }
@media(min-width:681px) and (max-width:980px) { #spread-workspace .activity-panel { grid-column:auto; } }
@media(max-width:680px) { .spread-filters { grid-template-columns:repeat(2,minmax(0,1fr)); } .comparison-menu span { display:none; } .comparison-mode { padding:9px 13px; } }
@media(max-width:420px) { .comparison-menu { position:relative; }.quote-scope { margin-left:0; }.venue-filter { position:static; } }
