:root {
  color-scheme: dark;
  --bg: #090a0a;
  --panel: #101212;
  --panel-2: #141616;
  --line: #2b3030;
  --line-strong: #3a4240;
  --text: #f2f3f0;
  --muted: #9ba29f;
  --signal: #55dfad;
  --signal-dim: #173b30;
  --danger: #ff737b;
  --danger-dim: #421d21;
  --warning: #e5bd64;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
body { margin: 0; background: var(--bg); color: var(--text); min-width: 320px; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.rh-shell { min-height: 100vh; padding: 0 clamp(14px, 2.4vw, 42px) 54px; }
.rh-topbar { min-height: 86px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand-lockup { display: flex; align-items: center; gap: clamp(26px, 4vw, 70px); min-width: 0; }
.brand-name { font-weight: 800; letter-spacing: -.03em; }
.workspace-nav { display: flex; align-self: stretch; gap: 30px; }
.workspace-nav a { position: relative; display: grid; place-items: center; color: #8d9390; font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.workspace-nav a:hover, .workspace-nav a.is-active { color: var(--text); }
.workspace-nav a.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--signal); }
.member-chip { display: flex; align-items: center; min-width: 220px; gap: 12px; border: 1px solid var(--line-strong); padding: 10px 13px; border-radius: 12px; }
.member-chip:hover { border-color: #4a665d; }
.member-mark { width: 30px; height: 30px; border: 1px solid #386252; border-radius: 50%; display: grid; place-items: center; color: var(--signal); font: 700 10px/1 ui-monospace, monospace; }
.member-chip span:nth-child(2) { display: grid; gap: 3px; flex: 1; }
.member-chip b { font-size: 12px; }.member-chip small { color: var(--muted); font: 600 8px/1.2 ui-monospace, monospace; }
.member-chip i { width: 7px; height: 7px; border-radius: 50%; background: #626866; }
.member-chip.is-live i { background: var(--signal); box-shadow: 0 0 0 4px rgba(85,223,173,.09); }

.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 40px; padding: clamp(40px, 6vw, 84px) 0 34px; }
.surface-label { color: var(--signal); font: 750 9px/1 ui-monospace, monospace; letter-spacing: .1em; }
h1 { margin: 13px 0 12px; font-size: clamp(30px, 4.5vw, 64px); line-height: .98; letter-spacing: -.035em; }
.page-heading p { max-width: 68ch; margin: 0; color: #b8bfbc; font-size: 13px; line-height: 1.7; }
.capability-strip { display: grid; grid-template-columns: repeat(4, minmax(104px, 1fr)); border: 1px solid var(--line); min-width: min(100%, 590px); }
.capability-strip span { padding: 16px; border-right: 1px solid var(--line); color: var(--muted); font: 650 8px/1.2 ui-monospace, monospace; }
.capability-strip span:last-child { border-right: 0; }
.capability-strip b { display: block; margin-top: 9px; color: #d6d9d7; font-size: 10px; }
.capability-strip .ready b { color: var(--signal); }.capability-strip .blocked b { color: var(--danger); }

main { display: grid; gap: 30px; }
.route-workbench { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(360px, .72fr); border: 1px solid var(--line); background: var(--panel); }
.route-board, .plan-ticket { min-width: 0; }
.plan-ticket { border-left: 1px solid var(--line); }
.section-heading { min-height: 80px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.section-heading h2 { margin: 0; font-size: 15px; letter-spacing: -.01em; }
.section-heading p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.section-heading time, .section-heading > span { color: var(--signal); font: 700 9px/1 ui-monospace, monospace; }
.ticket-header-actions { display: flex; align-items: center; flex: 0 0 auto; gap: 10px; }
.ticket-header-actions > span { min-height: 34px; padding: 0 10px; display: inline-flex; align-items: center; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font: 700 8px/1 ui-monospace, monospace; white-space: nowrap; }
.fit-parameters-control { display: grid; grid-template-columns: 62px 72px; min-height: 34px; border: 1px solid var(--line-strong); background: var(--panel-2); }
.fit-range-select, .fit-parameters-action { min-width: 0; min-height: 32px; border: 0; background: transparent; color: var(--signal); font: 750 8px/1 ui-monospace, monospace; white-space: nowrap; }
.fit-range-select { padding: 0 8px; border-right: 1px solid var(--line-strong); color-scheme: dark; cursor: pointer; }
.fit-range-select:hover:not(:disabled), .fit-parameters-action:hover:not(:disabled) { background: var(--signal-dim); color: var(--text); }
.fit-range-select:focus-visible, .fit-parameters-action:focus-visible { outline: 2px solid var(--signal); outline-offset: -2px; position: relative; z-index: 1; }
.fit-range-select:disabled { cursor: wait; opacity: .72; }
.fit-parameters-action { padding: 0 10px; }
.fit-parameters-action:disabled { cursor: wait; opacity: .72; }
.fit-parameters-action.is-loading { position: relative; padding-left: 27px; }
.fit-parameters-action.is-loading::before { content: ""; position: absolute; left: 11px; top: 50%; width: 9px; height: 9px; margin-top: -5px; border: 1px solid transparent; border-top-color: currentColor; border-right-color: currentColor; border-radius: 50%; animation: fit-spin .75s linear infinite; }
@keyframes fit-spin { to { transform: rotate(360deg); } }
.market-controls { display: grid; grid-template-columns: 1fr 1fr auto; border-bottom: 1px solid var(--line); }
.market-controls label { display: grid; gap: 8px; padding: 17px 20px; border-right: 1px solid var(--line); }
.market-controls span, .ticket-grid label > span, .mode-switch legend { color: var(--muted); font: 650 8px/1 ui-monospace, monospace; }
select, input { border: 0; outline: 0; background: transparent; color: var(--text); min-width: 0; }
.market-controls select, .market-controls input { font: 750 15px/1.2 ui-monospace, monospace; }
.market-controls button, #reloadPlans { border: 0; border-left: 1px solid var(--line); background: transparent; color: #c3c9c6; padding: 0 24px; font: 700 9px/1 ui-monospace, monospace; }
.market-controls button:hover, #reloadPlans:hover { color: var(--signal); background: var(--signal-dim); }
.venue-tape { display: grid; grid-template-columns: 1fr 42px 1fr; border-bottom: 1px solid var(--line); }
.venue-tape div { padding: 18px 21px; display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 7px 14px; }
.venue-tape div:first-child { text-align: right; }.venue-tape div:first-child span { grid-column: 1; }
.venue-tape span { color: #d9ddda; font: 750 9px/1 ui-monospace, monospace; }
.venue-tape b { color: var(--text); font: 750 12px/1 ui-monospace, monospace; }
.venue-tape small { grid-column: 1 / -1; color: #737b78; font: 650 7px/1 ui-monospace, monospace; }
.venue-tape i { display: grid; place-items: center; border-left: 1px solid var(--line); border-right: 1px solid var(--line); color: var(--signal); font-style: normal; }
.route-ledger { min-height: 255px; }
.route-row { display: grid; grid-template-columns: 94px minmax(150px, 1.3fr) minmax(150px, 1.3fr) repeat(3, minmax(76px, .7fr)); min-height: 112px; border-bottom: 1px solid var(--line); }
.route-row:last-child { border-bottom: 0; }
.route-row > div { padding: 20px 16px; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; gap: 7px; }
.route-row > div:last-child { border-right: 0; }
.route-direction strong { font: 800 11px/1 ui-monospace, monospace; }.route-direction span { color: var(--muted); font: 650 8px/1 ui-monospace, monospace; }
.route-leg span, .route-metric span { color: var(--muted); font: 650 7px/1 ui-monospace, monospace; }
.route-leg b, .route-metric b { font: 750 13px/1.25 ui-monospace, monospace; }
.route-leg small, .route-metric small { color: #868e8a; font: 600 8px/1.3 ui-monospace, monospace; }
.route-row.is-best { background: #0f211b; box-shadow: inset 3px 0 0 var(--signal); }
.route-row.is-positive .route-net b { color: var(--signal); }.route-row.is-negative .route-net b { color: var(--danger); }
.side-buy { color: var(--signal); }.side-sell { color: var(--danger); }
.route-empty { min-height: 255px; display: grid; place-items: center; color: var(--muted); font: 650 10px/1 ui-monospace, monospace; }
.route-method { border-top: 1px solid var(--line); padding: 17px 22px; display: grid; grid-template-columns: 100px 1fr; gap: 18px; background: #0d1512; }
.route-method strong { color: var(--signal); font: 750 8px/1.4 ui-monospace, monospace; }.route-method p { margin: 0; color: #aeb8b4; font-size: 10px; line-height: 1.6; }

.plan-ticket form { padding: 20px; }
.optimal-backtest { margin-bottom: 16px; border: 1px solid var(--line-strong); background: var(--panel-2); }
.optimal-backtest[hidden] { display: none; }
.optimal-backtest > header { min-height: 48px; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.optimal-backtest > header div { display: grid; gap: 5px; }
.optimal-backtest > header span { color: var(--signal); font: 700 7px/1 ui-monospace, monospace; }
.optimal-backtest > header b { font-size: 11px; }
.optimal-backtest > header strong { color: var(--signal); font: 700 8px/1 ui-monospace, monospace; }
.optimal-backtest.is-fallback > header strong { color: var(--warning); }
.optimal-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
.optimal-metrics div { min-width: 0; padding: 12px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.optimal-metrics div:nth-child(3n) { border-right: 0; }
.optimal-metrics dt { color: var(--muted); font: 650 7px/1 ui-monospace, monospace; }
.optimal-metrics dd { margin: 7px 0 0; color: var(--text); font: 750 13px/1 ui-monospace, monospace; }
.optimal-metrics .is-gain dd { color: var(--signal); }
.optimal-metrics .is-risk dd { color: var(--danger); }
.optimal-backtest > p { margin: 0; padding: 10px 14px; color: var(--muted); font: 600 7px/1.6 ui-monospace, monospace; }
.ticket-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.ticket-grid label { padding: 15px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; gap: 12px; }
.ticket-grid .exit-threshold-field { background: #1c1516; }
.ticket-grid .exit-threshold-field > span, .ticket-grid .exit-threshold-field input { color: #ff8b94; }
.ticket-grid label > div { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 8px; }
.ticket-grid input { width: 100%; font: 750 15px/1 ui-monospace, monospace; }
.ticket-grid b { color: #737b78; font: 650 7px/1 ui-monospace, monospace; }
.mode-switch { display: grid; grid-template-columns: repeat(3, 1fr); padding: 0; margin: 20px 0 0; border: 1px solid var(--line); }
.mode-switch legend { padding: 0 7px; }
.mode-switch label { display: flex; gap: 11px; padding: 15px; align-items: center; }
.mode-switch label + label { border-left: 1px solid var(--line); }
.mode-switch input { accent-color: var(--signal); }
.mode-switch span { font-size: 11px; font-weight: 700; }.mode-switch small { display: block; margin-top: 4px; color: var(--muted); font: 600 7px/1 ui-monospace, monospace; }
.mode-switch label:has(input:disabled) { opacity: .42; cursor: not-allowed; }
.paper-balance { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px; border: 1px solid #356653; border-top: 0; background: #0f1c17; }
.paper-balance > span { display: grid; gap: 5px; }.paper-balance > span b { font-size: 10px; }.paper-balance > span small { color: #9bb9ad; font-size: 8px; }
.paper-balance > div { display: flex; align-items: baseline; gap: 9px; }.paper-balance input { width: 120px; text-align: right; color: var(--signal); font: 750 14px/1 ui-monospace, monospace; }.paper-balance > div b { color: #7f9b90; font: 650 7px/1 ui-monospace, monospace; }
.live-ack { display: flex; align-items: flex-start; gap: 10px; padding: 14px 0; color: #ffd0d2; font-size: 10px; line-height: 1.55; }
.live-ack input { margin-top: 2px; accent-color: var(--danger); }
.edge-guard { margin-top: 18px; border: 1px solid var(--line-strong); background: var(--panel-2); transition: border-color .18s ease-out, background-color .18s ease-out; }
.edge-guard > header { min-height: 42px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.edge-guard > header b { color: var(--text); font-size: 10px; }.edge-guard > header strong { font: 800 8px/1 ui-monospace, monospace; }
.edge-guard-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.edge-guard-metrics > div { min-width: 0; padding: 13px 14px; border-right: 1px solid var(--line); }.edge-guard-metrics > div:last-child { border-right: 0; }
.edge-guard-metrics span, .edge-guard-metrics small { display: block; color: var(--muted); font: 650 7px/1.35 ui-monospace, monospace; }
.edge-guard-metrics b { display: block; margin: 7px 0 5px; color: var(--text); font: 800 13px/1 ui-monospace, monospace; }
.edge-guard > p { margin: 0; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; line-height: 1.5; overflow-wrap: anywhere; }
.edge-guard.is-valid { border-color: var(--signal); background: var(--signal-dim); }.edge-guard.is-valid > header strong, .edge-guard.is-valid .edge-guard-metrics > div:last-child b { color: var(--signal); }
.edge-guard.is-blocked { border-color: var(--danger); background: var(--danger-dim); }.edge-guard.is-blocked > header strong, .edge-guard.is-blocked .edge-guard-metrics > div:last-child b, .edge-guard.is-blocked > p { color: var(--danger); }
.ticket-risk { margin-top: 18px; padding: 15px; border: 1px solid #414844; background: #171a18; }
.ticket-risk span { color: var(--warning); font: 750 8px/1 ui-monospace, monospace; }.ticket-risk p { margin: 8px 0 0; color: #b9bfbc; font-size: 10px; line-height: 1.55; }
.primary-action { width: 100%; min-height: 48px; margin-top: 16px; border: 1px solid var(--signal); background: #123528; color: #9af2d1; font: 750 10px/1 ui-monospace, monospace; }
.primary-action:hover:not(:disabled) { background: #194a38; }.primary-action:disabled { opacity: .4; cursor: not-allowed; }
.form-feedback { min-height: 18px; margin: 10px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }.form-feedback.is-error { color: var(--danger); }.form-feedback.is-success { color: var(--signal); }

.plans-section { border: 1px solid var(--line); background: var(--panel); }
.plans-heading button { align-self: stretch; }
.plan-list { display: grid; }
.plan-empty { min-height: 150px; display: grid; place-items: center; color: var(--muted); font: 650 10px/1 ui-monospace, monospace; }
.plan-row { display: grid; grid-template-columns: minmax(210px,.7fr) minmax(280px,.95fr) minmax(410px,1.4fr) minmax(340px,1.15fr); border-top: 1px solid var(--line); }
.plan-row:first-child { border-top: 0; }
.plan-row > div { padding: 22px; border-right: 1px solid var(--line); }.plan-row > div:last-child { border-right: 0; }
.plan-identity header { display: flex; justify-content: space-between; gap: 10px; }.plan-identity h3 { margin: 0; font-size: 19px; }.plan-identity small { color: var(--muted); font: 650 8px/1.4 ui-monospace, monospace; }
.status-badge { color: var(--signal); border: 1px solid #2d7158; padding: 6px 8px; font: 700 8px/1 ui-monospace, monospace; height: fit-content; }.status-badge.is-risk { color: var(--danger); border-color: #7f353b; }
.plan-actions { display: flex; gap: 8px; margin-top: 22px; }.plan-actions button { min-height: 34px; border: 1px solid var(--line-strong); background: transparent; color: #c5cbc8; padding: 0 12px; font: 700 8px/1 ui-monospace, monospace; }.plan-actions button:hover:not(:disabled) { border-color: var(--signal); color: var(--signal); }.plan-actions button.danger:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); }.plan-actions button:disabled { opacity: .35; }
.plan-metrics { display: grid; grid-template-columns: repeat(2,1fr); padding: 0 !important; }.plan-metrics > .plan-metric { padding: 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }.plan-metrics > .plan-metric:nth-of-type(even) { border-right: 0; }.plan-metrics > .plan-metric span { display: block; color: var(--muted); font: 650 7px/1 ui-monospace, monospace; }.plan-metrics > .plan-metric b { display: block; margin-top: 8px; font: 750 13px/1.2 ui-monospace, monospace; }
.plan-metrics .is-exit { background: #1c1516; }.plan-metrics .is-exit span, .plan-metrics .is-exit b { color: #ff8b94; }
.plan-position-list { grid-column: 1 / -1; min-width: 0; background: #0d100f; }
.plan-position-row { min-width: 0; min-height: 72px; display: grid; grid-template-columns: .85fr 1fr 1.35fr 1.15fr; border-bottom: 1px solid var(--line); }
.plan-position-row:last-child { border-bottom: 0; }.plan-position-row > div { min-width: 0; padding: 13px 10px; border-right: 1px solid var(--line); }.plan-position-row > div:last-child { border-right: 0; }
.position-venue { display: flex; flex-direction: column; justify-content: center; gap: 7px; }.position-venue strong { overflow: hidden; text-overflow: ellipsis; color: #d9dedb; font: 800 9px/1 ui-monospace, monospace; }.position-venue span { color: #747d79; font: 650 6px/1 ui-monospace, monospace; white-space: nowrap; }.position-venue em { font-style: normal; }.position-venue em.is-long { color: var(--signal); }.position-venue em.is-short { color: var(--danger); }.position-venue em.is-flat { color: #8b9490; }
.position-cell { display: flex; flex-direction: column; justify-content: center; }.position-cell > span { color: #717b76; font: 650 6px/1 ui-monospace, monospace; }.position-cell > b { margin-top: 7px; overflow: hidden; text-overflow: ellipsis; color: #edf1ef; font: 750 9px/1.1 ui-monospace, monospace; white-space: nowrap; }.position-cell > small { margin-top: 5px; overflow: hidden; text-overflow: ellipsis; color: #747d79; font: 600 6px/1 ui-monospace, monospace; white-space: nowrap; }
.position-pnl > b.is-positive { color: var(--signal); }.position-pnl > b.is-negative { color: var(--danger); }
.plan-books { min-width: 0; border-right: 1px solid var(--line); background: #0d0f0f; }
.plan-books-heading { min-height: 48px; padding: 11px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.plan-books-heading div { display: grid; gap: 5px; }.plan-books-heading strong { font-size: 10px; }.plan-books-heading span, .plan-books-heading time { color: var(--muted); font: 650 7px/1 ui-monospace, monospace; }
.route-side-books { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.route-side-book { min-width: 0; }.route-side-book + .route-side-book { border-left: 1px solid var(--line); }
.route-side-book > header { min-height: 46px; padding: 9px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); }
.route-side-book > header div { min-width: 0; display: grid; gap: 5px; }.route-side-book > header strong { font: 800 9px/1 ui-monospace, monospace; }.route-side-book > header span { color: #a9b3ae; font: 650 7px/1 ui-monospace, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.route-side-book > header time { flex: 0 0 auto; color: #7f8884; font: 650 7px/1 ui-monospace, monospace; }
.route-book-leg > header { min-height: 30px; padding: 7px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #101312; }
.route-book-leg.is-label-top > header { border-bottom: 1px solid var(--line); }.route-book-leg.is-label-bottom > header { border-top: 1px solid var(--line); }
.route-book-leg > header strong, .route-book-leg > header span { font: 750 7px/1 ui-monospace, monospace; }.route-book-leg.is-buy > header strong { color: var(--signal); }.route-book-leg.is-sell > header strong { color: var(--danger); }.route-book-leg > header span { color: #7f8884; }
.route-book-leg table { width: 100%; border-collapse: collapse; table-layout: fixed; font: 650 8px/1 ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.route-book-leg th, .route-book-leg td { height: 20px; padding: 0 12px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route-book-leg th { height: 23px; color: #6f7874; font-size: 7px; border-bottom: 1px solid var(--line); }.route-book-leg th:first-child, .route-book-leg td:first-child { text-align: left; }
.route-book-leg .book-ask td:first-child { color: var(--danger); }.route-book-leg .book-bid td:first-child { color: var(--signal); }.route-book-leg tbody td:last-child { color: #aeb5b2; }
.route-book-spread { min-height: 34px; padding: 0 12px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 3px 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #111514; font: 700 7px/1 ui-monospace, monospace; }
.route-book-spread span { color: #88928d; }.route-book-spread b { grid-row: 1 / span 2; grid-column: 2; font-size: 10px; }.route-book-spread small { color: #69726e; font-size: 7px; }.route-book-spread.is-positive b { color: var(--signal); }.route-book-spread.is-negative b { color: var(--danger); }.route-book-spread.is-empty b { color: var(--muted); }
.book-leg-empty td { height: 100px; text-align: center !important; color: var(--muted); }
.route-side-book.is-empty { min-height: 306px; }.route-side-book.is-empty p { min-height: 259px; margin: 0; display: grid; place-items: center; color: var(--muted); font: 650 8px/1 ui-monospace, monospace; }
.plan-log { min-width: 0; }.plan-log > p { margin: 0 0 13px; color: #d5d9d6; font-size: 10px; line-height: 1.5; }.log-lines { max-height: 124px; overflow: auto; font: 600 8px/1.6 ui-monospace, monospace; color: #929a96; }.log-lines p { margin: 0; }.log-lines .error { color: var(--danger); }.log-lines .success { color: var(--signal); }.log-lines .warning { color: var(--warning); }
.paper-ledger { grid-column: 1 / -1; padding: 0 !important; border-top: 1px solid #356653; background: #0c1210; }
.paper-ledger-head { min-height: 58px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); background: #0f1513; }
.paper-ledger-head > div { display: grid; gap: 6px; }.paper-ledger-head strong { color: #e6ece9; font-size: 12px; }.paper-ledger-head span { color: #76837d; font: 650 7px/1 ui-monospace, monospace; }
.paper-ledger-head button { min-width: 94px; min-height: 34px; border: 1px solid #37755c; background: #10261d; color: var(--signal); font: 750 8px/1 ui-monospace, monospace; }.paper-ledger-head button:hover:not(:disabled) { background: #153328; border-color: var(--signal); }.paper-ledger-head button:disabled { opacity: .35; cursor: not-allowed; }
.paper-summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.paper-summary div { padding: 16px 18px; border-right: 1px solid var(--line); }.paper-summary div:last-child { border-right: 0; }
.paper-summary span { display: block; color: #8ea098; font: 650 7px/1.2 ui-monospace, monospace; }.paper-summary b { display: block; margin-top: 8px; font: 750 13px/1.2 ui-monospace, monospace; }
.paper-summary .is-positive { color: var(--signal); }.paper-summary .is-negative, .paper-summary .paper-fees { color: var(--danger); }
.paper-open { padding: 13px 18px; border-bottom: 1px solid var(--line); color: #aebbb5; font: 650 8px/1.5 ui-monospace, monospace; display: grid; grid-template-columns: minmax(220px, .8fr) minmax(320px, 1.35fr) minmax(240px, 1fr); align-items: center; gap: 10px 22px; }.paper-open span { min-width: 0; overflow-wrap: anywhere; }.paper-open strong { color: var(--warning); margin-right: 10px; }.paper-fill-audit { color: #d9c981; }.paper-fill-audit b { color: var(--warning); margin-right: 7px; }.paper-capacity { color: #9bb9ad; }.paper-capacity b { color: var(--signal); margin-right: 7px; }
.paper-history-wrap { width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.paper-history { width: 100%; min-width: 1320px; border-collapse: collapse; font: 650 8px/1.35 ui-monospace, monospace; font-variant-numeric: tabular-nums; }.paper-history th, .paper-history td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }.paper-history th { position: sticky; top: 0; z-index: 1; color: #7f8a85; background: #101513; font-size: 7px; letter-spacing: .05em; }.paper-history tbody tr { transition: background-color .15s ease-out; }.paper-history tbody tr:hover { background: #121a17; }.paper-history tbody tr:last-child td { border-bottom: 0; }.paper-history td:last-child { font-weight: 800; }.paper-history td b, .paper-history td strong { display: block; font: 800 8px/1.25 ui-monospace, monospace; }.paper-history td small { display: block; margin-top: 5px; color: #727e78; font: 650 6px/1 ui-monospace, monospace; }.paper-history time { color: #c5ceca; }.paper-history .is-positive { color: var(--signal); }.paper-history .is-negative { color: var(--danger); }.paper-history .paper-slip { color: var(--warning); }.paper-unavailable { display: inline-flex; padding: 4px 6px; border: 1px solid #4f4732; color: #bea85f; background: #1b1912; font-size: 7px; }
.paper-ledger-note { margin: 0; padding: 12px 18px; border-top: 1px solid var(--line); color: #78857f; font: 650 7px/1.55 ui-monospace, monospace; }.paper-empty { margin: 0; padding: 18px; color: var(--muted); font-size: 9px; }

.toast { position: fixed; right: 24px; bottom: 24px; max-width: 420px; padding: 14px 17px; border: 1px solid var(--line-strong); background: #1a1d1c; color: var(--text); font-size: 11px; line-height: 1.5; box-shadow: 12px 16px 32px rgba(0,0,0,.42); transform: translateY(18px); opacity: 0; pointer-events: none; transition: transform .22s cubic-bezier(.16,1,.3,1), opacity .18s ease-out; }.toast.show { transform: translateY(0); opacity: 1; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

@media (max-width: 1320px) {
  .plan-row { grid-template-columns: 1fr 1fr; }.plan-books, .plan-log { grid-column: 1 / -1; border-top: 1px solid var(--line); }.plan-books { border-right: 0; }
}
@media (max-width: 1180px) {
  .page-heading { align-items: stretch; flex-direction: column; }.capability-strip { min-width: 0; }
  .route-workbench { grid-template-columns: 1fr; }.plan-ticket { border-left: 0; border-top: 1px solid var(--line); }
  .plan-row { grid-template-columns: 1fr 1fr; }.plan-books, .plan-log { grid-column: 1 / -1; border-top: 1px solid var(--line); }.plan-books { border-right: 0; }
  .paper-open { grid-template-columns: 1fr 1fr; }.paper-capacity { grid-column: 1 / -1; }
  .paper-summary { grid-template-columns: repeat(3, 1fr); }.paper-summary div:nth-child(3) { border-right: 0; }.paper-summary div:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .rh-shell { padding: 0 12px 30px; }.rh-topbar { align-items: flex-start; padding: 18px 0; gap: 18px; }.brand-lockup { display: grid; gap: 16px; }.workspace-nav { gap: 15px; overflow-x: auto; max-width: calc(100vw - 24px); padding-bottom: 4px; }.member-chip { min-width: 0; }.member-chip span:nth-child(2) { display: none; }
  .page-heading { padding-top: 38px; }.capability-strip { grid-template-columns: repeat(2,1fr); }.capability-strip span:nth-child(2) { border-right: 0; }.capability-strip span:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .market-controls { grid-template-columns: 1fr 1fr; }.market-controls button { min-height: 48px; grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); }
  .route-row { grid-template-columns: 80px 1fr 1fr; }.route-metric { border-top: 1px solid var(--line); }.route-row .route-metric:nth-last-child(3) { grid-column: 1; }.route-row .route-metric:nth-last-child(2) { grid-column: 2; }.route-row .route-metric:nth-last-child(1) { grid-column: 3; }
  .ticket-header-actions { align-items: flex-end; flex-direction: column-reverse; gap: 8px; }.optimal-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }.optimal-metrics div:nth-child(3n) { border-right: 1px solid var(--line); }.optimal-metrics div:nth-child(2n) { border-right: 0; }.optimal-backtest > header { align-items: flex-start; flex-direction: column; gap: 8px; }.ticket-grid { grid-template-columns: 1fr; }.mode-switch { grid-template-columns: 1fr; }.mode-switch label + label { border-left: 0; border-top: 1px solid var(--line); }.paper-balance { align-items: stretch; flex-direction: column; }.paper-balance > div { justify-content: space-between; }.edge-guard-metrics { grid-template-columns: 1fr; }.edge-guard-metrics > div { border-right: 0; border-bottom: 1px solid var(--line); }.edge-guard-metrics > div:last-child { border-bottom: 0; }.plan-row { grid-template-columns: 1fr; }.plan-row > div { border-right: 0; border-bottom: 1px solid var(--line); }.plan-books, .plan-log { grid-column: auto; border-top: 0; }.plan-books { border-bottom: 1px solid var(--line); }.route-side-books { grid-template-columns: 1fr; }.route-side-book + .route-side-book { border-left: 0; border-top: 1px solid var(--line); }
  .paper-ledger { grid-column: auto; }.paper-ledger-head { align-items: flex-start; flex-direction: column; padding: 14px; }.paper-ledger-head button { width: 100%; }.paper-summary { grid-template-columns: repeat(2, 1fr); }.paper-summary div:nth-child(3) { border-right: 1px solid var(--line); }.paper-summary div:nth-child(even) { border-right: 0; }.paper-summary div:nth-child(-n+4) { border-bottom: 1px solid var(--line); }.paper-open { grid-template-columns: 1fr; }.paper-capacity { grid-column: auto; }.paper-history { min-width: 1280px; }
}
