:root {
  color-scheme: dark;
  --paper: #091016;
  --paper-raised: #0d171e;
  --panel: #101c24;
  --panel-raised: #15242e;
  --ink: #e8f0f2;
  --ink-soft: #c4d0d5;
  --muted: #8b9ba3;
  --line: #263945;
  --line-strong: #3b5562;
  --blue: #66d9ff;
  --blue-strong: #2bb9e8;
  --orange: #ffbd70;
  --green: #72e0ad;
  --red: #ff8290;
  --shadow: 0 18px 50px rgba(0, 0, 0, .34);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display:none !important; }
html { background: var(--paper); }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 78% -8%, rgba(36, 116, 146, .16), transparent 34rem),
    radial-gradient(circle at 12% 16%, rgba(42, 62, 93, .12), transparent 30rem),
    var(--paper);
  color: var(--ink);
}
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar {
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #0b141b 0%, #0a1218 100%);
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: Georgia, serif; font-size: 19px; font-weight: 700; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(102, 217, 255, .36);
  border-radius: 11px;
  background: #112a36;
  color: var(--blue);
  font: 700 12px/1 ui-monospace, monospace;
  letter-spacing: .08em;
}
.user-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.nav { display: grid; gap: 6px; }
.nav-item {
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  text-align: left;
  padding: 12px 11px;
  border-radius: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 650;
}
.nav-item:hover { background: #13232c; color: var(--ink); border-color: var(--line); }
.nav-item.is-active { background: #173541; color: var(--blue); border-color: #28566a; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.nav-icon { width: 18px; text-align: center; font-size: 18px; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 10px; }
.content { width: min(1400px, 100%); padding: 28px clamp(20px, 4vw, 58px) 60px; margin: auto; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 28px; }
h1, h2 { margin: 0; font-family: Georgia, serif; letter-spacing: -.025em; }
h1 { font-size: clamp(30px, 4vw, 48px); }
h2 { font-size: 22px; }
.eyebrow { margin: 0 0 8px; color: var(--muted); font: 700 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .13em; text-transform: uppercase; }
.muted { color: var(--muted); font-size: 12px; }
.topbar-state { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 13px; font-weight: 700; }
.state-light { width: 9px; height: 9px; border-radius: 50%; background: #51616a; display: inline-block; }
.state-light.is-ready { background: var(--green); box-shadow: 0 0 0 4px rgba(114, 224, 173, .12); }
.state-light.is-bad { background: var(--red); }

.hero-card {
  background: linear-gradient(135deg, #132d38, #10202a 72%);
  color: var(--ink);
  border: 1px solid #275263;
  border-radius: 18px;
  padding: 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow);
}
.hero-card .eyebrow, .hero-card .muted { color: #a5c0c9; }
.hero-state { display: block; font: 700 clamp(28px, 4vw, 46px)/1 Georgia, serif; text-transform: uppercase; }
.control-row { display: flex; flex-wrap: wrap; gap: 8px; }
.button { border: 1px solid transparent; border-radius: 9px; padding: 10px 15px; min-height: 42px; font-weight: 800; letter-spacing: .02em; }
.button-small { min-height: 30px; padding: 6px 10px; font-size: 10px; }
.button-primary { background: var(--blue-strong); color: #061118; }
.button-primary:hover { background: var(--blue); }
.button-soft { background: #1b3441; color: var(--blue); border-color: #315d70; }
.button-soft:hover { background: #234352; }
.button-danger { background: #3d2028; color: var(--red); border-color: #713a48; }
.button-danger:hover { background: #542632; }
.button-quiet { background: transparent; color: var(--ink-soft); border-color: var(--line-strong); }
.button-quiet:hover { background: var(--panel-raised); color: var(--ink); }
.link-button { border: 0; background: transparent; color: var(--blue); padding: 0; font-size: 12px; }

.fit-summary { margin: 18px 0; }
.fit-card { padding: 17px 20px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); display: flex; align-items: center; justify-content: space-between; gap: 20px; box-shadow: 0 4px 18px rgba(0, 0, 0, .12); }
.fit-card strong { font-size: 18px; }
.fit-activation-detail { display: inline-block; margin-top: 5px; color: var(--warning); font-size: 13px; line-height: 1.35; }
.fit-lanes { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.lane-chip, .status-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; text-transform: uppercase; }
.lane-chip { background: #183b4c; color: var(--blue); border: 1px solid #2d647d; }
.status-pill { background: #213038; color: var(--ink-soft); border: 1px solid #384c56; }
.status-pill.source-real, .source-real { color: var(--green); }
.status-pill.source-shadow, .source-shadow { color: var(--orange); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.metric-card { padding: 15px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.metric-card span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.metric-card strong { font: 700 22px/1 ui-monospace, monospace; }
.panel { background: rgba(16, 28, 36, .94); border: 1px solid var(--line); border-radius: 14px; padding: 19px; margin-bottom: 16px; box-shadow: 0 4px 18px rgba(0, 0, 0, .13); }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.panel-heading .eyebrow { margin-bottom: 5px; }
.panel-actions { display: flex; align-items: center; gap: 8px; }
.parallel-feeds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.parallel-feeds .panel { min-width: 0; }
.trade-comparison-panel { grid-column: 1 / -1; }
.trade-comparison-actions { flex-wrap: wrap; justify-content: flex-end; }
.trade-comparison-note { max-width: 820px; margin: -4px 0 14px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.trade-comparison-table { max-height: calc(100vh - 330px); min-height: 280px; border: 1px solid var(--line); border-radius: 9px; }
.trade-comparison-table table { min-width: 980px; }
.trade-comparison-table thead { position: sticky; z-index: 1; top: 0; background: #101c24; }
.trade-comparison-row > td:first-child { border-left: 3px solid transparent; padding-left: 9px; }
.trade-comparison-row.trade-row-presence-both > td:first-child { border-left-color: var(--green); }
.trade-comparison-row.trade-row-presence-real > td:first-child { border-left-color: var(--blue); }
.trade-comparison-row.trade-row-presence-shadow > td:first-child { border-left-color: var(--orange); }
.trade-comparison-row time { white-space: nowrap; color: var(--muted); font: 11px ui-monospace, monospace; }
.trade-side { font: 800 11px ui-monospace, monospace; letter-spacing: .06em; }
.trade-source-cell { width: 29%; min-width: 230px; }
.trade-cell-fill { display: grid; grid-template-columns: minmax(110px, auto) minmax(90px, auto); gap: 3px 12px; padding: 7px 9px; border-radius: 7px; background: rgba(255, 255, 255, .025); }
.trade-cell-fill + .trade-cell-fill { margin-top: 5px; }
.trade-cell-fill strong, .trade-cell-fill > span { font: 700 11px ui-monospace, monospace; }
.trade-cell-fill > span { text-align: right; }
.trade-cell-fill small { grid-column: 1 / -1; color: var(--muted); font-size: 10px; }
.trade-source-real .trade-cell-fill { border-left: 2px solid rgba(114, 224, 173, .5); }
.trade-source-shadow .trade-cell-fill { border-left: 2px solid rgba(255, 189, 112, .5); }
.trade-cell-empty { display: block; min-height: 47px; padding: 14px 10px; color: #52636c; font: 700 13px ui-monospace, monospace; }
.trade-presence { display: inline-flex; white-space: nowrap; padding: 5px 7px; border: 1px solid currentColor; border-radius: 5px; font: 800 9px/1 ui-monospace, monospace; letter-spacing: .06em; }
.trade-presence-both { color: var(--green); }
.trade-presence-real { color: var(--blue); }
.trade-presence-shadow { color: var(--orange); }
.feed-panel-recovered { grid-column: 1 / -1; }
.feed-filter { display: block; width: 100%; border: 1px solid var(--line); background: #0b151c; color: var(--ink); border-radius: 8px; padding: 9px 10px; margin-bottom: 11px; outline: none; }
.feed-filter::placeholder, input::placeholder { color: #6e818b; }
.feed-filter:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(102, 217, 255, .13); }
.feed-list { display: grid; gap: 7px; max-height: 300px; overflow: auto; padding-right: 3px; }
.feed-list.tall { max-height: calc(100vh - 290px); min-height: 260px; }
.feed-row { display: grid; grid-template-columns: 86px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #20313a; font-size: 12px; }
.feed-row:last-child { border-bottom: 0; }
.feed-time { color: var(--muted); font: 11px ui-monospace, monospace; }
.feed-main strong { display: block; font-size: 13px; }
.feed-main small { color: var(--muted); }
.feed-value { text-align: right; font: 700 12px ui-monospace, monospace; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.pending-pnl { color: var(--muted); font-size: 11px; font-weight: 600; }
.warning-pnl { color: var(--orange); font-size: 11px; font-weight: 600; }
.table-shell { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { color: var(--muted); text-align: left; font: 700 10px ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; padding: 9px 8px; border-bottom: 1px solid var(--line-strong); }
td { padding: 11px 8px; border-bottom: 1px solid #20313a; vertical-align: top; }
td.num { text-align: right; font-family: ui-monospace, monospace; }
.table-subtitle { margin: 22px 0 6px; font: 700 13px ui-monospace, monospace; }
.empty { padding: 28px 10px; text-align: center; color: var(--muted); font-size: 13px; }
.section-intro { margin: 8px 0 22px; max-width: 700px; }
.section-intro p:last-child { color: var(--muted); line-height: 1.55; }
.activity-list { display: grid; }
.activity-row { display: grid; grid-template-columns: 135px 85px minmax(0, 1fr); gap: 13px; padding: 13px 0; border-bottom: 1px solid #20313a; font-size: 13px; }
.activity-row:last-child { border-bottom: 0; }
.activity-time { color: var(--muted); font: 11px ui-monospace, monospace; }
.activity-kind { color: var(--blue); font: 700 10px ui-monospace, monospace; text-transform: uppercase; letter-spacing: .07em; }

.fit-history { overflow: auto; }
.outcome-lanes { color: var(--green); }
.outcome-no_lane { color: var(--orange); }
.outcome-insufficient_state, .outcome-unverified_branch { color: var(--muted); }
.fit-detail-row > td { padding: 0; border-bottom: 1px solid var(--line); }
.fit-detail-row details { padding: 8px 12px 12px; }
.fit-detail-row summary { cursor: pointer; color: var(--blue); font-size: 12px; font-weight: 700; }
.fit-boundary-audit > summary { padding: 8px 0; }
.fit-boundary-audit[open] > summary { color: var(--ink); }
.fit-audit-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 12px; }
.fit-proof-card { border: 1px solid var(--line); border-radius: 10px; background: var(--paper-raised); padding: 12px; }
.fit-proof-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.fit-proof-card p { margin: 8px 0; color: var(--muted); line-height: 1.45; font-size: 12px; }
.fit-proof-meta, .fit-missing { font-size: 11px; color: var(--muted); }
.fit-missing { margin-top: 7px; color: var(--orange); }
.parity-exact { color: var(--green); }
.parity-blocked_exact, .parity-not_available { color: var(--orange); }
.parity-mismatch { color: var(--red); }
.shadow-exact, .shadow-available { color: var(--green); }
.shadow-not_started, .shadow-blocked_exact, .shadow-not_available { color: var(--muted); }
.shadow-mismatch { color: var(--red); }
.fit-checks, .fit-lane-audits { margin-top: 12px; }
.fit-checks h4, .fit-lane-audits h4 { margin: 0 0 7px; font-size: 12px; }
.fit-check { display: inline-flex; flex-direction: column; vertical-align: top; width: min(31%, 260px); min-width: 180px; margin: 0 7px 7px 0; padding: 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 11px; background: #0d1920; }
.fit-check small { margin-top: 4px; color: var(--muted); line-height: 1.35; }
.fit-check-passed b, .fit-check-selected { color: var(--green); }
.fit-check-failed b { color: var(--red); }
.audit-section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.audit-section-heading p { margin: 0 0 7px; color: var(--muted); font-size: 11px; }
.fit-lane-audit { border-top: 1px solid var(--line); padding: 7px 0; }
.fit-lane-audit:first-of-type { border-top: 0; }
.fit-lane-audit summary { display: flex; align-items: center; gap: 9px; cursor: pointer; list-style: none; }
.fit-lane-audit summary::-webkit-details-marker { display: none; }
.fit-lane-audit summary::before { content: "＋"; color: var(--muted); font-size: 12px; }
.fit-lane-audit[open] summary::before { content: "−"; color: var(--blue); }
.lane-status { font: 700 10px ui-monospace, monospace; }
.lane-status-selected { color: var(--green); }
.lane-status-rejected { color: var(--orange); }
.lane-summary { margin-left: auto; text-align: right; }
.fit-lane-body { padding: 10px 0 0 27px; }
.lane-decision { padding: 9px 10px; border-left: 2px solid var(--orange); background: #1a1c1b; border-radius: 0 7px 7px 0; }
.fit-lane-selected .lane-decision { border-left-color: var(--green); }
.audit-label { display: block; margin-bottom: 5px; color: var(--ink-soft); font: 700 10px ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; }
.reason-list { display: flex; flex-wrap: wrap; gap: 4px; }
.fit-lane-body ul { margin: 10px 0; padding-left: 18px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.fit-lane-body code { color: var(--muted); font-size: 10px; word-break: break-all; }
.lane-check-heading { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-top: 11px; }
.lane-check-list { border-top: 1px solid var(--line); }
.lane-check-list li { padding: 4px 0; }
.reason-chip { display: inline-flex; flex-direction: column; gap: 2px; margin: 0; padding: 5px 7px; border-radius: 5px; background: #33271e; color: var(--orange); font-size: 11px; }
.reason-chip code { color: #b99a78; font: 9px ui-monospace, monospace; }
.fit-audit-missing { margin-top: 10px; padding: 10px; border: 1px solid #674a32; border-radius: 8px; background: #241e19; color: var(--orange); font-size: 12px; }
.fit-history table { min-width: 1120px; }
.fit-history tbody tr:hover { background: rgba(102, 217, 255, .035); }
.fit-digests { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 8px; font-size: 10px; color: var(--muted); }
.fit-digests span { display: inline-flex; align-items: center; gap: 4px; }
.fit-digests code { color: var(--ink); font: 10px ui-monospace, monospace; }
.shadow-empty { color: var(--muted); }
.fit-table-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 9px; margin: -2px 0 12px; color: var(--muted); font-size: 10px; }
.fit-side-tag { display: inline-flex; align-items: center; min-height: 18px; padding: 3px 6px; border-radius: 4px; font: 800 9px/1 ui-monospace, monospace; letter-spacing: .08em; }
.fit-side-tag-live { color: var(--green); background: rgba(114, 224, 173, .1); border: 1px solid rgba(114, 224, 173, .3); }
.fit-side-tag-shadow { color: var(--orange); background: rgba(255, 189, 112, .1); border: 1px solid rgba(255, 189, 112, .3); }
.fit-legend-diff { display: inline-flex; align-items: center; gap: 4px; margin-left: 5px; color: var(--ink-soft); font: 800 9px ui-monospace, monospace; letter-spacing: .08em; }
.fit-side { display: grid; gap: 5px; min-width: 170px; }
.fit-side-head { display: flex; align-items: center; gap: 7px; }
.fit-side-head strong { font: 800 10px/1.15 ui-monospace, monospace; letter-spacing: .04em; }
.fit-side-live .fit-side-head strong { color: var(--green); }
.fit-side-shadow .fit-side-head strong { color: var(--orange); }
.fit-inline-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.fit-inline-chips .lane-chip { padding: 4px 6px; font-size: 9px; }
.fit-side-meta, .fit-side-empty { color: var(--muted); font-size: 10px; line-height: 1.35; }
.fit-side-empty { font-style: italic; }
.fit-diff { display: flex; align-items: flex-start; gap: 7px; min-width: 150px; }
.fit-diff-indicator { width: 8px; height: 8px; flex: 0 0 auto; margin-top: 2px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 3px rgba(139, 155, 163, .12); }
.fit-diff strong { display: block; font: 800 10px/1.15 ui-monospace, monospace; letter-spacing: .04em; }
.fit-diff small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.25; }
.fit-diff-match .fit-diff-indicator { background: var(--green); box-shadow: 0 0 0 3px rgba(114, 224, 173, .14); }
.fit-diff-match strong { color: var(--green); }
.fit-diff-mismatch .fit-diff-indicator { background: var(--red); box-shadow: 0 0 0 3px rgba(255, 130, 144, .14); }
.fit-diff-mismatch strong { color: var(--red); }
.fit-diff-unverified .fit-diff-indicator { background: var(--orange); box-shadow: 0 0 0 3px rgba(255, 189, 112, .14); }
.fit-diff-unverified strong { color: var(--orange); }
.fit-diff-unavailable .fit-diff-indicator { background: var(--muted); }
.fit-diff-unavailable strong { color: var(--muted); }
.fit-history tbody tr:not(.fit-detail-row) > td { min-height: 58px; }
.fit-history tbody tr:not(.fit-detail-row):hover { background: rgba(102, 217, 255, .045); }
.fit-history tbody tr.fit-summary-row > td:first-child { border-left: 3px solid transparent; padding-left: 9px; }
.fit-history tbody tr.fit-row-match > td:first-child { border-left-color: var(--green); }
.fit-history tbody tr.fit-row-mismatch > td:first-child { border-left-color: var(--red); }
.fit-history tbody tr.fit-row-unverified > td:first-child { border-left-color: var(--orange); }
.fit-history tbody tr.fit-row-unavailable > td:first-child { border-left-color: var(--muted); }
.recovered-fit-panel { margin-top: 16px; }
.recovered-fit-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 8px; }
.recovered-fit-head > div { display: grid; gap: 4px; }
.recovered-fit-note { margin: 0 0 12px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.recovered-fit-table { max-height: 620px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.recovered-fit-table table { min-width: 980px; }
.fit-recovered-badge { display: inline-flex; align-items: center; width: fit-content; padding: 4px 7px; border-radius: 4px; border: 1px solid rgba(255, 189, 112, .3); background: rgba(255, 189, 112, .1); color: var(--orange); font: 800 9px/1.2 ui-monospace, monospace; letter-spacing: .04em; }
.status-pill-warning { color: var(--orange); background: rgba(255, 189, 112, .1); border-color: rgba(255, 189, 112, .35); }
.blacklist-intro { border-color: rgba(255, 189, 112, .28); background: linear-gradient(135deg, rgba(40, 31, 24, .94), rgba(16, 28, 36, .94)); }
.blacklist-intro .section-intro { margin-bottom: 16px; }
.blacklist-safety-note { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 12px; padding: 12px 14px; border-left: 3px solid var(--orange); border-radius: 0 8px 8px 0; background: rgba(255, 189, 112, .08); color: var(--ink-soft); font-size: 12px; line-height: 1.45; }
.blacklist-safety-note strong { color: var(--orange); white-space: nowrap; }
.blacklist-toolbar { display: grid; gap: 14px; margin-bottom: 14px; }
.blacklist-add-form, .blacklist-list-controls { display: grid; grid-template-columns: minmax(110px, .65fr) minmax(220px, 1.5fr) auto; gap: 10px; align-items: end; }
.blacklist-list-controls { grid-template-columns: minmax(200px, 1fr) 160px auto; }
.blacklist-add-form label, .blacklist-list-controls label, .blacklist-edit-dialog label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.blacklist-add-form input, .blacklist-list-controls input, .blacklist-list-controls select, .blacklist-edit-dialog textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #0b151c; color: var(--ink); padding: 10px 11px; outline: none; font: inherit; }
.blacklist-add-form input:focus, .blacklist-list-controls input:focus, .blacklist-list-controls select:focus, .blacklist-edit-dialog textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(102, 217, 255, .13); }
.blacklist-table { border: 1px solid var(--line); border-radius: 9px; }
.blacklist-table table { min-width: 780px; }
.blacklist-table th:last-child, .blacklist-table td:last-child { text-align: right; }
.blacklist-table tbody tr:hover { background: rgba(102, 217, 255, .035); }
.blacklist-symbol-cell { font: 800 12px ui-monospace, monospace; letter-spacing: .04em; }
.blacklist-comment-cell { max-width: 440px; color: var(--ink-soft); white-space: pre-wrap; }
.blacklist-row-actions { display: inline-flex; gap: 6px; justify-content: flex-end; }
.blacklist-row-actions .button { min-height: 30px; padding: 6px 8px; }
.blacklist-load-more { display: block; margin: 13px auto 0; }
.blacklist-edit-dialog { width: min(560px, calc(100% - 28px)); border: 1px solid var(--line-strong); border-radius: 16px; padding: 20px; background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.blacklist-edit-dialog::backdrop { background: rgba(0, 0, 0, .72); }
.blacklist-edit-dialog form { display: grid; gap: 14px; }
.blacklist-edit-dialog .panel-heading { margin-bottom: 0; }
.blacklist-edit-symbol { margin: -3px 0 0; color: var(--blue); font: 800 13px ui-monospace, monospace; }
.blacklist-edit-dialog textarea { resize: vertical; min-height: 118px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

.trade-chart-modal {
  width: min(980px, calc(100% - 28px));
  max-width: 980px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 20px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.trade-chart-modal::backdrop { background: rgba(0, 0, 0, .72); }
.trade-chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.trade-chart-modal h2 { font-size: 24px; }
.trade-chart-modal > p { margin: 10px 0 14px; line-height: 1.45; }
.trade-chart-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #0a1319; }
.trade-chart-wrap svg { display: block; width: 100%; min-width: 680px; height: auto; }
.trade-chart-grid { stroke: #21343e; stroke-width: 1; }
.trade-chart-axis { fill: var(--muted); font: 11px ui-monospace, monospace; }
.trade-chart-line { fill: none; stroke: var(--blue); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.chart-event { stroke: #091016; stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-event-buy { fill: var(--green); }
.chart-event-sell { fill: var(--red); }
.trade-chart-legend { display: flex; gap: 16px; margin-top: 10px; color: var(--muted); font: 11px ui-monospace, monospace; }
.trade-chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chart-dot-buy { background: var(--green); }
.chart-dot-sell { background: var(--red); }

.error-banner { position: fixed; z-index: 10; top: 14px; left: 50%; transform: translateX(-50%); max-width: min(650px, calc(100% - 24px)); display: flex; gap: 10px; align-items: flex-start; background: #321b22; color: var(--red); border: 1px solid #713a48; border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow); font-size: 13px; }
.error-banner button { border: 0; background: transparent; color: inherit; margin-left: auto; font-size: 20px; line-height: 1; }
.session-loading { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.session-loading-card { display: flex; align-items: center; gap: 14px; color: var(--ink-soft); }
.session-loading-card div { display: grid; gap: 4px; }
.session-loading-card strong { font-size: 15px; }
.session-loading-card div > span { color: var(--muted); font-size: 12px; }
.login-panel { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 10%, #173544 0, #091016 46%); }
.login-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 18px; padding: 34px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 42px; margin-bottom: 12px; }
.login-card > p:not(.eyebrow) { color: var(--muted); line-height: 1.5; margin-bottom: 28px; }
.login-card form { display: grid; gap: 14px; }
.login-card label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.login-card input { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #0b151c; color: var(--ink); padding: 11px 12px; outline: none; }
.login-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(102, 217, 255, .13); }

@media (max-width: 900px) {
  .fit-audit-grid { grid-template-columns: 1fr; }
  .fit-check { width: 100%; min-width: 0; }
}
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; padding: 14px 16px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; }
  .user-line { justify-content: flex-end; }
  .nav { grid-column: 1 / -1; display: flex; overflow: auto; }
  .nav-item { white-space: nowrap; }
  .sidebar-bottom { display: flex; grid-column: 1 / -1; justify-content: space-between; align-items: center; }
  .content { padding: 22px 16px 40px; }
  .parallel-feeds { grid-template-columns: 1fr; }
  .feed-list.tall { max-height: none; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .topbar, .hero-card { display: grid; }
  .topbar-state { justify-content: flex-start; flex-wrap: wrap; white-space: normal; }
  .control-row { width: 100%; }
  .control-row .button { flex: 1; }
  .metric-grid { gap: 7px; }
  .metric-card { padding: 12px; }
  .metric-card strong { font-size: 17px; }
  .panel { padding: 14px; }
  .activity-row { grid-template-columns: 1fr 80px; }
  .activity-row .activity-detail { grid-column: 1 / -1; }
  .feed-row { grid-template-columns: 64px minmax(0, 1fr); }
  .feed-value { grid-column: 2; text-align: left; }
  .login-card { padding: 24px; }
  .login-card h1 { font-size: 36px; }
  .lane-summary { font-size: 10px; }
  .blacklist-add-form, .blacklist-list-controls { grid-template-columns: 1fr; }
  .blacklist-safety-note { grid-template-columns: 1fr; gap: 4px; }
}

/* Compact operator console: tabular data and stable, full-width navigation. */
:root { --paper:#101315; --panel:#161a1d; --panel-raised:#20262a; --line:#30373b; --ink:#e4e8ea; --muted:#9ba6ac; --blue:#b4cfde; --blue-strong:#a7c9da; --shadow:none; font-size:12px; font-variant-numeric:tabular-nums; }
body { background:var(--paper); }
.app-shell { display:block; }
.sidebar { padding:10px 18px; display:flex; flex-direction:row; flex-wrap:wrap; align-items:center; gap:16px; border-right:0; border-bottom:1px solid var(--line); background:var(--paper); }
.brand { font:700 13px ui-monospace,monospace; white-space:nowrap; }
.brand-mark { width:28px; height:28px; border-radius:2px; background:transparent; font-size:10px; }
.user-line { margin-left:auto; order:2; }
.nav { display:flex; gap:3px; }
.nav-item { padding:8px 12px; border-radius:2px; font-size:12px; }
.nav-item.is-active { box-shadow:none; background:#28343b; border-color:#435762; }
.nav-icon { display:none; }
.sidebar-bottom { margin:0; display:flex; align-items:center; gap:10px; order:3; }
.content { width:100%; max-width:1920px; padding:16px 18px 32px; margin:0 auto; }
.topbar { margin-bottom:12px; align-items:center; gap:12px; }
h1,h2 { font-family:inherit; letter-spacing:0; }
h1 { font-size:20px; } h2 { font-size:14px; }
.eyebrow { font-size:10px; letter-spacing:.07em; margin:0 0 5px; }
.hero-card { padding:12px 14px; border-radius:2px; background:var(--panel); border-color:var(--line); box-shadow:none; }
.hero-state { display:inline-block; margin-right:10px; font:600 24px/1.2 ui-sans-serif,sans-serif; text-transform:none; }
#bot-detail { display:block; margin-top:7px; max-width:1100px; line-height:1.5; }
.button { min-height:32px; padding:6px 12px; border-radius:3px; font-size:11px; letter-spacing:0; }
.button-small { min-height:26px; padding:4px 8px; }
.panel,.fit-card,.metric-card { background:var(--panel); border-radius:2px; box-shadow:none; padding:12px; }
.panel { margin-bottom:10px; }
.panel-heading { margin-bottom:10px; }
.fit-summary { margin:10px 0; }
.fit-card { padding:10px 12px; gap:12px; }
.fit-card + .fit-card { margin-top:6px; }
.fit-card strong { font-size:13px; }
.lane-chip,.status-pill { border-radius:2px; padding:4px 6px; letter-spacing:0; }
.metric-grid { gap:0; border:1px solid var(--line); margin-bottom:8px; }
.metric-card { border:0; border-right:1px solid var(--line); }
.metric-card:last-child { border-right:0; }
.metric-card span { margin-bottom:6px; }
.metric-card strong { font-size:18px; }
.operational-facts { border:1px solid var(--line); border-top:0; }
.operational-facts dl { margin:0; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); }
.operational-facts dl > div { padding:8px 12px; min-width:0; }
.operational-facts dt { color:var(--muted); font-size:10px; margin-bottom:4px; }
.operational-facts dd { margin:0; overflow-wrap:anywhere; font:12px ui-monospace,monospace; }
.blockers { padding:9px 12px; border-top:1px solid var(--line); color:var(--orange); }
.blockers ul { margin:5px 0 0; padding-left:18px; line-height:1.5; }
.control-help { color:var(--muted); font-size:11px; line-height:1.5; margin:8px 0 12px; }
table { font-size:12px; }
th,td { padding:7px 9px; }
thead { background:#1c2226; }
.table-shell { border-radius:0; }
.trade-comparison-table { max-height:none; min-height:0; }
.trade-comparison-table table { min-width:760px; }
.trade-cell-fill { background:transparent; border-radius:0; padding:4px 7px; }
.trade-cell-empty { min-height:30px; padding:8px; }
.feed-row,.activity-row { padding:7px 0; }
.feed-list.tall { min-height:0; }
.fit-history table { font-size:11px; }
.fit-table-legend { padding:7px 0; }
.login-card { border-radius:3px; box-shadow:none; max-width:380px; }
.login-card h1 { font-size:24px; }
.login-workspace { order:4; color:var(--muted); font-size:11px; }
.login-workspace summary { cursor:pointer; }
.login-workspace label { margin-top:8px; }
.login-card input { border-radius:3px; }
@media(max-width:1000px) {
  .sidebar { gap:10px; }
  .nav { order:4; width:100%; overflow-x:auto; }
  .nav-item { white-space:nowrap; }
  .user-line { order:1; }
  .sidebar-bottom { order:2; }
}
@media(max-width:600px) {
  .content { padding:12px 8px; }
  .sidebar { padding:8px; }
  .sidebar-bottom #runtime-label { display:none; }
  .hero-card { align-items:flex-start; flex-direction:column; }
  .operational-facts dl { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .metric-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .metric-card strong { font-size:14px; }
  .topbar { align-items:flex-start; flex-direction:column; }
}
.report-status { display:flex; flex-wrap:wrap; gap:8px 20px; padding:10px 12px; border:1px solid var(--line); margin-bottom:10px; color:var(--ink-soft); }
.report-status strong { color:var(--orange); }
.report-metrics { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); border:1px solid var(--line); margin-bottom:10px; }
.report-metric { min-width:0; padding:11px; border-right:1px solid var(--line); background:var(--panel); }
.report-metric:last-child { border:0; }
.report-metric > span { display:block; font-size:10px; color:var(--muted); }
.report-metric > strong { display:block; font:600 17px ui-monospace,monospace; padding:7px 0; overflow-wrap:anywhere; }
.report-metric > small { color:var(--muted); font-size:10px; line-height:1.4; }
.report-chart { width:100%; max-height:260px; display:block; }
.report-chart polyline { stroke:var(--green); fill:none; stroke-width:2; }
.report-chart text { fill:var(--muted); font:10px ui-monospace,monospace; }
.report-chart-grid line { stroke:var(--line); stroke-width:1; }
.report-provenance { color:var(--muted); font-size:11px; overflow-wrap:anywhere; }
.report-provenance dd { margin:4px 0 12px; }
@media(max-width:1200px) { .report-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); } .sidebar {gap:10px;} .brand {font-size:12px;} .nav-item {padding:7px 9px;} }
@media(max-width:650px) { .report-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); } .report-metric > strong {font-size:14px;} }
/* Execution desk: one ledger, explicit sources, inline inspection. */
.desk-toolbar {display:flex;align-items:end;gap:16px;border-bottom:1px solid var(--line);padding:0 0 14px;margin-bottom:14px;}
.desk-toolbar label {display:grid;gap:6px;color:var(--muted);font-size:11px;min-width:220px;}
.desk-toolbar input,.desk-toolbar select {padding:8px 10px;border:1px solid var(--line);background:var(--paper);color:var(--ink);border-radius:0;width:100%;}
.desk-toolbar > span {margin-left:auto;color:var(--muted);font-size:11px;padding-bottom:8px;}
.desk-summary {display:grid;grid-template-columns:repeat(4,1fr);border-bottom:1px solid var(--line);margin-bottom:22px;}
.desk-summary > div {padding:6px 16px 16px 0;display:grid;gap:7px;}
.desk-summary small,.desk-summary span {color:var(--muted);font-size:11px;}
.desk-summary strong {font:600 23px ui-monospace,monospace;}
.desk-section-heading {display:flex;align-items:center;justify-content:space-between;gap:12px;margin:20px 0 10px;}
.desk-section-heading h2 {font-size:14px;margin:0;}
.desk-section-heading span,.desk-footnote {color:var(--muted);font-size:11px;line-height:1.6;}
.desk-table {overflow:auto;border-top:1px solid var(--line);border-bottom:1px solid var(--line);}
.desk-table table {width:100%;font-size:12px;white-space:nowrap;}
.desk-table td {padding:10px 9px;vertical-align:top;}
.desk-table th {font:500 10px ui-sans-serif,sans-serif;text-transform:none;letter-spacing:0;position:sticky;top:0;}
.desk-table tbody tr:hover {background:#1c2327;}
.desk-table details {max-width:340px;white-space:normal;}
.desk-table summary {cursor:pointer;color:var(--blue);}
.desk-facts {display:grid;grid-template-columns:100px minmax(140px,1fr);gap:8px;font-size:11px;margin:12px 0;white-space:normal;}
.desk-facts dt {color:var(--muted);}.desk-facts dd {margin:0;overflow-wrap:anywhere;}
.desk-id {display:block;overflow-wrap:anywhere;margin-top:8px;}
.desk-flat {border-left:2px solid var(--green);padding:8px 12px;color:var(--muted);}
.desk-empty {padding:24px!important;color:var(--muted);text-align:center;}
@media(max-width:750px){.desk-toolbar{flex-wrap:wrap;}.desk-toolbar label{min-width:140px;flex:1;}.desk-toolbar>span{display:none;}.desk-summary{grid-template-columns:repeat(2,1fr);}.desk-section-heading{align-items:start;flex-direction:column;}.desk-summary strong{font-size:18px;}}
.fit-reason-text {display:block;max-width:560px;white-space:normal;line-height:1.5;}
