/* Warm surfaces, technical sans typography and a compact operations workspace. */
:root {
  color-scheme: light;
  --ink: #f6f3eb;
  --panel: #fffdf8;
  --panel-2: #f1eee5;
  --panel-3: #eae6db;
  --line: #dcd7cb;
  --line-strong: #b7b3a5;
  --muted: #656b61;
  --text: #282c27;
  --paper: #fffdf8;
  --acid: #355e49;
  --acid-soft: #e8eee4;
  --orange: #995629;
  --blue: #3c6479;
  --danger: #ae3a33;
  --points-pill-bg: #eef1ea;
  --points-pill-text: #536955;
  --points-pill-border: #dfe4d9;
  --cost-pill-bg: #f5eeeb;
  --cost-pill-text: #8b605c;
  --cost-pill-border: #e7d9d3;
  --radius: 6px;
  --display: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, Menlo, monospace;
  --control-height: 46px;
  --gutter: clamp(20px, 2vw, 40px);
}

/* Dedicated SL/TP experiment results; ordinary journals keep their layout. */
.modal:has(.sltp-experiment) { width: 100%; max-width: none; }
.sltp-experiment, .sltp-live-chart { width: 100%; max-width: none; }
.sltp-live { display: grid; gap: 14px; min-width: 0; }
.sltp-live-heading, .sltp-live-pair-heading { display: flex; align-items: center; gap: 14px; }
.sltp-live-heading { flex-wrap: wrap; }
.sltp-live-heading h4 { margin: 0; font-size: 20px; }
.sltp-live-heading .sltp-live-stage { width: auto; margin-left: auto; min-width: 200px; }
.sltp-live-status { color: var(--blue); font-size: 13px; }
.sltp-live > .field-help { margin: 0; }
.sltp-live > .field-help[data-stale="true"] { color: var(--orange); }
.sltp-live-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.sltp-live-pair { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.sltp-live-pair[data-phase="holding"] { border-color: var(--acid); }
.sltp-live-pair[data-phase="closing"], .sltp-live-pair[data-phase="needs_attention"] { border-color: var(--orange); }
.sltp-live-letter { display: grid; place-items: center; width: 52px; height: 58px; flex: 0 0 52px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--panel-2); color: var(--acid); font: 650 38px/1 var(--display); }
.sltp-live-strategy { flex: 1; min-width: 0; }
.sltp-live-strategy-name { margin: 0 0 5px; font-size: 17px; line-height: 1.5; }
.sltp-live-strategy p { margin: 0; font-size: 12px; }
.sltp-live-strategy .sltp-live-strategy-subtitle { margin-bottom: 6px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.sltp-live-timer { display: grid; gap: 5px; text-align: right; }
.sltp-live-timer strong { color: var(--acid); font: 600 25px/1.2 var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sltp-live-timer span { color: var(--muted); font-size: 11px; }
.sltp-live-feedback { display: grid; gap: 9px; margin: 16px 0 12px; padding: 12px 14px; background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: 4px; min-width: 0; }
.sltp-live-feedback-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sltp-live-phase { flex: 1; margin: 0; font-size: 15px; line-height: 1.5; color: var(--blue); overflow-wrap: anywhere; }
.sltp-live-feedback .sltp-live-timer { flex: 0 0 auto; max-width: 240px; }
.sltp-live-feedback .sltp-live-timer strong { font-size: 21px; }
.sltp-live-activity { flex: 0 0 15px; width: 15px; height: 15px; border: 2px solid var(--line-strong); border-radius: 50%; }
.sltp-live-activity[data-active="true"] { border-top-color: var(--blue); animation: sltp-live-spin 1.1s linear infinite; }
.sltp-live-feedback-context { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 13px; color: var(--muted); font-size: 11px; line-height: 1.5; min-width: 0; }
.sltp-live-latest { flex: 1 1 45%; margin: 0; overflow-wrap: anywhere; }
.sltp-live-feedback-age { margin-left: auto; font-variant-numeric: tabular-nums; }
.sltp-live-feedback-counters { color: var(--blue); font-variant-numeric: tabular-nums; }
.sltp-live-progress { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.sltp-live-progress-item { flex: 1 1 220px; display: grid; gap: 4px; min-width: 0; }
.sltp-live-progress-item[hidden] { display: none; }
.sltp-live-progress-item > span { color: var(--muted); font-size: 11px; line-height: 1.5; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sltp-live-progress progress { display: block; width: 100%; height: 5px; border: 0; border-radius: 4px; appearance: none; overflow: hidden; background: var(--line); color: var(--acid); }
.sltp-live-progress progress::-webkit-progress-bar { background: var(--line); border-radius: 4px; }
.sltp-live-progress progress::-webkit-progress-value { background: var(--acid); border-radius: 4px; }
.sltp-live-progress progress::-moz-progress-bar { background: var(--acid); border-radius: 4px; }
.sltp-live-progress progress:indeterminate { background: repeating-linear-gradient(100deg, var(--line) 0%, var(--line) 30%, var(--blue) 40%, var(--line) 50%); background-size: 200% 100%; animation: sltp-live-progress 1.8s linear infinite; }
.sltp-live-progress progress:indeterminate::-webkit-progress-bar { background: transparent; }
.sltp-live-progress progress:indeterminate::-moz-progress-bar { background: transparent; }
.sltp-live-progress progress[data-paused="true"] { animation-play-state: paused; }
.sltp-live-feedback[data-stale="true"] { border-left-color: var(--orange); }
.sltp-live-feedback[data-stale="true"] .sltp-live-phase, .sltp-live-feedback[data-stale="true"] .sltp-live-feedback-age { color: var(--orange); }
@keyframes sltp-live-spin { to { transform: rotate(360deg); } }
@keyframes sltp-live-progress { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sltp-live-activity[data-active="true"], .sltp-live-progress progress:indeterminate { animation: none; } }
.sltp-live-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 7px; padding: 0; margin: 0 0 15px; list-style: none; counter-reset: live-step; }
.sltp-live-steps li { display: flex; gap: 7px; padding: 9px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); font-size: 12px; line-height: 1.5; counter-increment: live-step; }
.sltp-live-steps li::before { content: counter(live-step); font: 500 12px/1.5 var(--mono); }
.sltp-live-steps li[data-status="current"], .sltp-live-steps li[data-status="active"] { border-color: var(--blue); color: var(--blue); background: var(--panel-2); }
.sltp-live-steps li[data-status="done"], .sltp-live-steps li[data-status="completed"], .sltp-live-steps li[data-status="confirmed"] { color: var(--acid); background: var(--acid-soft); }
.sltp-live-steps li[data-status="failed"] { color: var(--danger); border-color: var(--danger); }
.sltp-live-wallets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.sltp-live-wallet { min-width: 0; background: var(--panel-2); border-left: 3px solid var(--acid); padding: 13px; }
.sltp-live-wallet[data-side="short"] { border-left-color: var(--danger); }
.sltp-live-wallet h6 { margin: 0 0 10px; font-size: 13px; font-weight: 600; }
.sltp-live-position { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px 14px; margin: 0; }
.sltp-live-position dt { color: var(--muted); font-size: 11px; margin-bottom: 3px; }
.sltp-live-position dd { margin: 0; font: 500 12px/1.5 var(--mono); overflow-wrap: anywhere; }
.sltp-live-position dd[data-sign="positive"] { color: var(--acid); }
.sltp-live-position dd[data-sign="negative"] { color: var(--danger); }
.sltp-live-protection { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; font: 11px/1.5 var(--mono); color: var(--muted); }
.sltp-live-protection-item[data-status="confirmed"] { color: var(--acid); }
.sltp-live-observation { display: block; margin-top: 8px; color: var(--muted); font-size: 10px; }
.sltp-live-chart { min-width: 0; }
.sltp-live-chart .lighter-chart-compact .lighter-chart-stage { grid-template-columns: minmax(0, 1fr); }
.sltp-live-chart .lighter-chart-entry-rail { display: none; }
.sltp-live-levels { display: flex; flex-wrap: wrap; gap: 5px 13px; margin-top: 8px; font: 11px/1.6 var(--mono); }
.sltp-live-levels span[data-side="long"] { color: var(--acid); }
.sltp-live-levels span[data-side="short"] { color: var(--danger); }
.sltp-live-levels span[data-kind="liquidation"] { color: var(--orange); }
.sltp-live-recovery { color: var(--orange); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.sltp-live-pair-log, .sltp-live-log, .sltp-live-accounting { margin-top: 12px; font-size: 12px; }
.sltp-live-pair-log summary, .sltp-live-log summary, .sltp-live-accounting summary { cursor: pointer; color: var(--blue); }
.sltp-live-events { max-height: 280px; overflow-y: auto; display: grid; gap: 7px; list-style: none; padding: 0; margin: 12px 0 0; }
.sltp-live-events li { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px 12px; padding-bottom: 7px; border-bottom: 1px solid var(--line); line-height: 1.6; }
.sltp-live-events time { color: var(--muted); font: 11px/1.6 var(--mono); }
.sltp-live-events code { color: var(--orange); font-size: 11px; overflow-wrap: anywhere; }
.sltp-live-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 13px 0; position: sticky; top: 0; background: var(--panel); z-index: 3; border-bottom: 1px solid var(--line); }
.sltp-live-controls p { flex: 1 1 100%; margin: 0; }
@media (max-width: 760px) {
  .sltp-live-pair { padding: 12px; }
  .sltp-live-pair-heading { flex-wrap: wrap; gap: 10px; }
  .sltp-live-letter { width: 42px; height: 48px; flex-basis: 42px; font-size: 30px; }
  .sltp-live-strategy-name { font-size: 14px; }
  .sltp-live-timer { width: 100%; text-align: left; display: flex; align-items: center; justify-content: space-between; }
  .sltp-live-timer strong { font-size: 21px; }
  .sltp-live-feedback { padding: 10px; }
  .sltp-live-feedback-main { flex-wrap: wrap; }
  .sltp-live-feedback .sltp-live-timer { flex: 1 1 100%; max-width: none; }
  .sltp-live-feedback-age { margin-left: 0; }
  .sltp-live-wallets { grid-template-columns: minmax(0, 1fr); }
  .sltp-live-position { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sltp-live-heading .sltp-live-stage { width: 100%; margin-left: 0; }
  .sltp-live-chart .lighter-chart-canvas { height: 320px; }
}
.sltp-results { display: grid; gap: 16px; min-width: 0; }
.sltp-results-heading, .sltp-results-report-heading { display: flex; align-items: start; gap: 12px; flex-wrap: wrap; }
.sltp-results-heading { justify-content: space-between; }
.sltp-results-heading h3 { margin: 0 0 5px; font-size: 22px; }
.sltp-results-heading p, .sltp-results-report-heading p { margin: 0; }
.sltp-results-layout { display: grid; grid-template-columns: minmax(190px, 250px) minmax(0, 1fr); gap: 20px; align-items: start; }
.sltp-results-sidebar, .sltp-results-detail { min-width: 0; }
.sltp-results-sidebar { display: grid; gap: 12px; border-right: 1px solid var(--line); padding-right: 18px; }
.sltp-results-sidebar h4, .sltp-results-detail h4 { margin: 0; font-size: 15px; }
.sltp-results-list { display: grid; gap: 8px; max-height: 570px; overflow-y: auto; padding: 2px; }
.sltp-results-item { width: 100%; display: grid; gap: 5px; text-align: left; padding: 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); cursor: pointer; }
.sltp-results-item strong { font: 600 14px/1.4 var(--body); }
.sltp-results-item span { color: var(--blue); font-size: 12px; }
.sltp-results-item small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.sltp-results-item:hover { background: var(--panel-2); border-color: var(--line-strong); }
.sltp-results-item[aria-pressed="true"] { background: var(--acid-soft); border-color: var(--acid); box-shadow: inset 3px 0 var(--acid); }
.sltp-results-detail { display: grid; gap: 14px; }
.sltp-results-report-heading { align-items: center; }
.sltp-results-report-heading p { width: 100%; }
.sltp-results-badge { color: var(--blue); background: var(--panel-2); padding: 4px 8px; border: 1px solid var(--line); border-radius: 4px; font-size: 12px; }
.sltp-results-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.sltp-results-card { padding: 14px; display: grid; gap: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); }
.sltp-results-card span { font-size: 12px; line-height: 1.4; color: var(--muted); }
.sltp-results-card strong { color: var(--text); font: 600 27px/1.15 var(--display); font-variant-numeric: tabular-nums; }
.sltp-results-card small { font-size: 11px; color: var(--muted); line-height: 1.4; }
.sltp-results-notice { margin: 0; padding: 12px 14px; color: var(--blue); background: var(--panel-2); border-left: 3px solid var(--blue); font-size: 13px; line-height: 1.6; }
.sltp-results-empty { margin: 0; padding: 28px 18px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); font-size: 14px; line-height: 1.6; }
.sltp-results-table { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.sltp-results-table table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sltp-results-table th { padding: 11px 12px; background: var(--panel-2); color: var(--muted); text-align: left; font-weight: 500; white-space: nowrap; }
.sltp-results-table td { padding: 12px; vertical-align: top; border-top: 1px solid var(--line); line-height: 1.6; font-variant-numeric: tabular-nums; }
.sltp-results-table tbody tr:hover { background: var(--panel-2); }
.sltp-results-pair-table { min-width: 1040px; }
.sltp-results-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.sltp-results-filters label > span { color: var(--muted); font-size: 12px; }
.sltp-results-filters select { min-width: 0; }
.sltp-results-pair-details summary { color: var(--blue); cursor: pointer; white-space: nowrap; }
.sltp-results-pair-details dl { display: grid; gap: 5px; margin: 12px 0 0; min-width: 230px; max-width: 350px; }
.sltp-results-pair-details dt { color: var(--muted); font-size: 11px; }
.sltp-results-pair-details dd { margin: 0 0 5px; overflow-wrap: anywhere; font: 12px/1.6 var(--mono); }
.sltp-results :is(button, select, summary):focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
@media (max-width: 1080px) {
  .sltp-results-layout { grid-template-columns: minmax(160px, 200px) minmax(0, 1fr); gap: 14px; }
  .sltp-results-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .sltp-results-layout { grid-template-columns: minmax(0, 1fr); }
  .sltp-results-sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 14px; }
  .sltp-results-list { max-height: 235px; }
  .sltp-results-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }



/* A compact horizontal masthead leaves the full page width to the ledger. */
.app-shell { min-height: 100vh; }
.masthead {
  display: flex; align-items: center; gap: 28px; min-height: 64px;
  padding: 8px var(--gutter); border-bottom: 1px solid var(--line);
  background: var(--panel); position: relative; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 7px; background: var(--acid); color: var(--paper); }
.brand-mark svg { width: 23px; height: 23px; }
.brand strong { display: block; color: var(--text); font: 750 20px/1.15 var(--display); letter-spacing: -.035em; }
.brand small { display: none; }
.nav { display: flex; align-items: stretch; gap: 3px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.nav-item { display: flex; justify-content: center; align-items: center; flex: 0 0 auto; min-height: 44px; padding: 9px 12px; background: transparent; border: 0; border-radius: var(--radius); color: var(--muted); cursor: pointer; font: 500 14px/1.3 var(--body); white-space: nowrap; }
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active { color: var(--acid); background: var(--acid-soft); font-weight: 650; }
.connection-status { position: relative; flex: 0 0 auto; color: var(--muted); font-size: 13px; }
.connection-status > summary { display: flex; align-items: center; gap: 8px; padding: 12px 0; cursor: pointer; list-style: none; }
.connection-status > summary::-webkit-details-marker { display: none; }
.connection-status > summary::after { content: "⌄"; margin-left: 2px; }
.side-status { position: absolute; right: 0; top: calc(100% + 8px); width: 255px; padding: 8px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 36px #433b2415; }
.status-line { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.status-line:last-child { border-bottom: 0; }
.status-line b { color: var(--orange); font: 13px var(--mono); }
.status-line b.ok { color: var(--acid); }
.pulse { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 0 4px var(--acid-soft); }
.skip-link { position: fixed; top: 8px; left: 8px; transform: translateY(-150%); z-index: 100; padding: 12px 18px; background: var(--acid); color: var(--paper); border-radius: var(--radius); }
.skip-link:focus { transform: none; }

.workspace { min-width: 0; }
.topbar {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px var(--gutter);
  border-bottom: 1px solid var(--line);
  background: var(--ink);
  backdrop-filter: blur(15px);
}
.eyebrow {
  margin: 0 0 5px;
  color: var(--acid);
  font: 600 12px var(--body);
  letter-spacing: .05em;
  text-transform: none;
}
.topbar h1, .modal h2 {
  margin: 0;
  font: 700 28px/1.15 var(--display);
  letter-spacing: -.025em;
  text-transform: none;
}
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.clock { padding: 10px 12px; border: 1px solid var(--line); color: var(--muted); font: 13px var(--mono); }

.view { padding: 22px var(--gutter) 48px; animation: view-in .28s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }

.loading-panel, .empty-state {
  min-height: 360px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  border: 1px dashed var(--line);
  color: var(--muted);
}
.loader { width: 25px; height: 25px; border: 2px solid var(--line); border-top-color: var(--acid); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}
.metric-card {
  grid-column: span 3;
  min-height: 146px;
  position: relative;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.metric-card::after {
  content: attr(data-index);
  position: absolute;
  right: -7px;
  bottom: -20px;
  color: rgba(40,44,39,.035);
  font: 90px/.8 var(--display);
}
.metric-card.acid { background: var(--acid); color: var(--ink); border-color: var(--acid); }
.metric-label { font: 13px var(--mono); letter-spacing: .09em; text-transform: none; opacity: .68; }
.metric-value { margin-top: 18px; font: 650 50px/.85 var(--display); }
.metric-meta { margin-top: 12px; color: var(--muted); font-size: 13px; }
.metric-card.acid .metric-meta { color: #e8eee4; }

.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }
.span-12 { grid-column: span 12; }
.panel {
  border: 1px solid var(--line);
  background: var(--panel);
}
.panel-head {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}
.panel-title { margin: 0; font: 650 19px var(--display); text-transform: none; letter-spacing: .01em; }
.panel-subtitle { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.panel-body { padding: 16px; }

.pipeline { display: grid; grid-template-columns: 1fr 30px 1fr 30px 1fr; align-items: stretch; gap: 8px; }
.pipeline-step { min-height: 118px; padding: 14px; border: 1px solid var(--line); background: var(--panel-2); }
.pipeline-step.ready { border-color: rgba(53,94,73,.42); }
.pipeline-no { color: var(--acid); font: 13px var(--mono); }
.pipeline-step strong { display: block; margin: 22px 0 7px; font: 650 18px var(--display); text-transform: none; }
.pipeline-step small { color: var(--muted); line-height: 1.45; }
.pipeline-arrow { display: grid; place-items: center; color: var(--line-strong); font: 18px var(--mono); }

.section-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.section-toolbar h2 { margin: 0 0 6px; font: 650 24px var(--display); text-transform: none; }
.section-toolbar p { margin: 0; color: var(--muted); font-size: 13px; }
.button-row { display: flex; gap: 8px; flex-wrap: wrap; }

.primary-button, .ghost-button, .danger-button, .table-action, .icon-button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  cursor: pointer;
  transition: .16s ease;
}
.primary-button, .ghost-button, .danger-button { min-height: var(--control-height); padding: 10px 18px; font: 600 14px/1.4 var(--body); letter-spacing: 0; text-transform: none; }
.primary-button { background: var(--acid); color: var(--ink); border-color: var(--acid); font-weight: 700; }
.primary-button:hover { background: #284c3a; border-color: #284c3a; }
.ghost-button:hover, .table-action:hover { border-color: var(--muted); background: var(--panel-3); }
.danger-button { border-color: rgba(174,58,51,.45); color: var(--danger); background: rgba(174,58,51,.07); }
button:disabled { opacity: .36; cursor: not-allowed; transform: none !important; }
.icon-button { width: 46px; height: 46px; flex: 0 0 46px; display: grid; place-items: center; font-size: 20px; }

.notice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  padding: 15px 16px;
  margin-bottom: 18px;
  border: 1px solid rgba(153,86,41,.35);
  background: rgba(153,86,41,.07);
}
.notice strong { display: block; color: var(--orange); font: 13px var(--mono); text-transform: none; }
.notice p { margin: 5px 0 0; color: var(--text); font-size: 13px; line-height: 1.55; }
.notice-icon { color: var(--orange); font: 20px var(--mono); }

.table-shell { overflow: auto; border: 1px solid var(--line); background: var(--panel); }
.data-table { width: 100%; border-collapse: collapse; min-width: 900px; }
.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  text-align: left;
  font: 13px var(--mono);
  letter-spacing: .09em;
  text-transform: none;
}
.data-table td { padding: 16px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 14px; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .14s ease; }
.data-table tbody tr:hover { background: rgba(40,44,39,.018); }
.number-cell { color: var(--acid); font: 13px var(--mono); }
.address { display: inline-flex; align-items: center; gap: 7px; font: 13px var(--mono); color: var(--text); white-space: nowrap; }
.copy-mini { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 2px; }
.copy-mini:hover { color: var(--acid); }
.subline { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }

.badge { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 7px; border: 1px solid var(--line); color: var(--text); font: 13px var(--mono); text-transform: none; }
.badge.ok { color: var(--acid); border-color: rgba(53,94,73,.32); background: var(--acid-soft); }
.badge.warn { color: var(--orange); border-color: rgba(153,86,41,.35); }
.badge.blue { color: var(--blue); border-color: rgba(60,100,121,.34); }
.badge.danger { color: var(--danger); border-color: rgba(174,58,51,.35); }

.wallet-balance-table { min-width: 1420px; }
.project-table-shell { overflow-x: auto; }
.project-balance-table {
  width: 100%;
  min-width: 1120px;
  table-layout: fixed;
}
.project-balance-table th {
  padding: 9px 6px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .065em;
}
.project-balance-table td { padding: 7px 6px; }
.project-balance-table th:nth-child(1), .project-balance-table td:nth-child(1) { width: 34px; }
.project-balance-table th:nth-child(2), .project-balance-table td:nth-child(2) { width: 30px; }
.project-balance-table th:nth-child(3), .project-balance-table td:nth-child(3) { width: 78px; }
.project-balance-table th:nth-child(4), .project-balance-table td:nth-child(4) { width: 88px; }
.project-balance-table th:nth-child(5), .project-balance-table td:nth-child(5) { width: 82px; }
.project-balance-table th:nth-child(n+6):nth-child(-n+10),
.project-balance-table td:nth-child(n+6):nth-child(-n+10) { width: 93px; }
.project-balance-table th:nth-child(11), .project-balance-table td:nth-child(11) { width: 190px; }
.project-balance-table th:nth-child(12), .project-balance-table td:nth-child(12) { width: 153px; }
.project-position-head { color: var(--acid) !important; font-size: 13px !important; text-align: center !important; }
.project-position-cell { padding-inline: 2px !important; text-align: center; font-size: 13px; }
.project-wallet-cell { overflow: hidden; }
.project-wallet-cell strong { display: block; color: var(--text); font: 700 13px var(--mono); }
.project-wallet-cell .subline { overflow: hidden; margin-top: 3px; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.project-address-cell { overflow: hidden; }
.compact-address { max-width: 100%; gap: 3px; font-size: 13px; }
.project-bitget-cell { overflow: hidden; }
.project-bitget-cell strong, .project-bitget-cell span {
  display: block;
  overflow: hidden;
  font-family: var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-bitget-cell strong { color: var(--text); font-size: 13px; }
.project-bitget-cell span { margin-top: 3px; color: var(--acid); font-size: 13px; }
.select-column-head, .select-cell { width: 46px; min-width: 46px; padding: 0 !important; text-align: center !important; }
.row-selector { display: inline-grid; place-items: center; width: 44px; height: 44px; cursor: pointer; }
.row-selector input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.row-selector span {
  position: relative;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--panel);
  box-shadow: inset 0 0 0 3px var(--panel);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}
.row-selector:hover span { border-color: var(--acid); transform: scale(1.08); }
.row-selector input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.row-selector input:checked + span { border-color: var(--acid); background: var(--acid); box-shadow: inset 0 0 0 3px var(--panel), 0 0 12px rgba(53,94,73,.28); }
.row-selector input:checked + span::after { content: ""; position: absolute; inset: 4px; background: var(--acid); }
.row-selector input:indeterminate + span { border-color: var(--blue); background: var(--blue); box-shadow: inset 0 0 0 3px var(--panel), 0 0 12px rgba(60,100,121,.25); }
.wallet-data-row.is-selected > td { background: rgba(53,94,73,.035); }
.wallet-data-row.is-selected > td:first-child { box-shadow: inset 3px 0 0 var(--acid); }
.wallet-data-row.is-selected:hover > td { background: rgba(53,94,73,.055); }
.network-column-head { min-width: 112px; color: var(--blue) !important; text-align: center !important; }
.network-balance-column { min-width: 112px; padding: 5px !important; }
.project-balance-table .network-column-head,
.project-balance-table .network-balance-column { min-width: 0; }
.project-balance-table .network-column-head { color: var(--blue) !important; font-size: 13px; }
.wallet-data-row.is-scanning > td { background: rgba(60,100,121,.018); }
.wallet-scan-row { display: none; }
.wallet-scan-row.is-scanning { display: table-row; }
.wallet-scan-row > td { padding: 0 12px 10px !important; background: rgba(60,100,121,.018); }
.wallet-scan-panel {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  min-height: 44px;
  padding: 7px 11px 10px;
  border: 1px solid rgba(60,100,121,.62);
  background:
    linear-gradient(90deg, rgba(60,100,121,.16), rgba(60,100,121,.035) 62%),
    var(--panel);
  box-shadow: inset 3px 0 0 var(--blue), 0 0 18px rgba(60,100,121,.07);
  animation: scan-panel-in .24s ease both;
}
.wallet-scan-radar {
  position: relative;
  width: 23px;
  height: 23px;
  border: 1px solid rgba(60,100,121,.58);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(60,100,121,.2);
}
.wallet-scan-radar::before, .wallet-scan-radar::after {
  content: "";
  position: absolute;
  background: rgba(60,100,121,.38);
}
.wallet-scan-radar::before { left: 50%; top: 2px; bottom: 2px; width: 1px; }
.wallet-scan-radar::after { top: 50%; left: 2px; right: 2px; height: 1px; }
.wallet-scan-radar i {
  position: absolute;
  inset: 3px;
  border-top: 2px solid var(--blue);
  border-right: 2px solid transparent;
  border-radius: 50%;
  animation: spin .72s linear infinite;
}
.wallet-scan-copy { display: grid; gap: 2px; min-width: 0; }
.wallet-scan-copy b { color: var(--blue); font: 700 13px var(--mono); letter-spacing: .12em; }
.wallet-scan-copy small { overflow: hidden; color: var(--blue); font: 13px var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.wallet-scan-count { color: var(--blue); font: 700 13px var(--mono); font-variant-numeric: tabular-nums; }
.wallet-scan-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(60,100,121,.12);
}
.wallet-scan-track i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--blue);
  box-shadow: 0 0 9px rgba(60,100,121,.8);
  transition: width .32s cubic-bezier(.2,.8,.2,1);
}
.wallet-scan-row.scan-finished .wallet-scan-panel { border-color: rgba(53,94,73,.62); box-shadow: inset 3px 0 0 var(--acid), 0 0 18px rgba(53,94,73,.08); }
.wallet-scan-row.scan-finished .wallet-scan-radar { border-color: var(--acid); background: var(--acid); box-shadow: 0 0 12px rgba(53,94,73,.36); }
.wallet-scan-row.scan-finished .wallet-scan-radar i { display: none; }
.wallet-scan-row.scan-finished .wallet-scan-copy b, .wallet-scan-row.scan-finished .wallet-scan-count { color: var(--acid); }
.wallet-scan-row.scan-finished .wallet-scan-track i { background: var(--acid); box-shadow: 0 0 9px rgba(53,94,73,.8); }
.wallet-scan-row.scan-failed .wallet-scan-panel { border-color: rgba(174,58,51,.62); box-shadow: inset 3px 0 0 var(--danger); }
.wallet-scan-row.scan-failed .wallet-scan-copy b, .wallet-scan-row.scan-failed .wallet-scan-count { color: var(--danger); }
.balance-cell {
  position: relative;
  overflow: hidden;
  min-height: 46px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  background: var(--panel);
  transition: border-color .24s ease, background .24s ease, box-shadow .24s ease;
}
.balance-value { display: grid; gap: 4px; color: var(--text); font: 13px/1.25 var(--mono); white-space: nowrap; }
.balance-asset { display: flex; align-items: center; justify-content: space-between; gap: 7px; min-height: 12px; }
.balance-symbol { color: var(--muted); }
.balance-amount { color: var(--text); font-variant-numeric: tabular-nums; }
.project-balance-table .balance-cell { min-height: 45px; padding: 7px; }
.project-balance-table .balance-value { gap: 3px; font-size: 13px; line-height: 1.25; }
.project-balance-table .balance-asset { gap: 4px; min-height: 13px; }
.project-balance-table .balance-symbol { color: var(--muted); font-size: 13px; letter-spacing: .02em; }
.project-balance-table .balance-amount { overflow: hidden; color: var(--text); font-size: 13px; font-weight: 650; text-overflow: ellipsis; }
.balance-asset.error .balance-amount, .balance-cell.error .balance-asset.error .balance-amount { color: var(--danger); }
.balance-cell.is-refreshing {
  border-color: rgba(60,100,121,.42);
  background: linear-gradient(135deg, rgba(60,100,121,.075), var(--panel) 58%);
  box-shadow: inset 0 0 18px rgba(60,100,121,.035);
}
.balance-cell.is-refreshing::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 -45%;
  width: 42%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(60,100,121,.11), transparent);
  transform: skewX(-16deg);
  animation: balance-scan 1.45s ease-in-out infinite;
}
.balance-asset.is-pending .balance-symbol { color: var(--muted); animation: balance-dim 1.2s ease-in-out infinite; }
.balance-spinner {
  display: inline-block;
  width: 9px;
  height: 9px;
  border: 1px solid var(--line-strong);
  border-top-color: var(--blue);
  border-right-color: rgba(60,100,121,.65);
  border-radius: 50%;
  animation: spin .62s linear infinite;
}
.balance-asset.is-arriving { animation: balance-arrive .5s cubic-bezier(.2,.8,.2,1) both; }
.balance-cell.is-complete { animation: balance-confirm .65s ease both; }
.ghost-button.is-loading { opacity: .82; border-color: rgba(60,100,121,.5); color: var(--blue); }
@keyframes balance-scan { 0% { left: -45%; } 75%, 100% { left: 115%; } }
@keyframes scan-panel-in { from { opacity: 0; transform: translateY(-4px); } }
@keyframes balance-dim { 50% { opacity: .38; } }
@keyframes balance-arrive { from { opacity: 0; transform: translateY(4px); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes balance-confirm { 0% { border-color: rgba(53,94,73,.75); box-shadow: inset 0 0 18px rgba(53,94,73,.12); } 100% { border-color: var(--line); box-shadow: none; } }

.bulk-action-dock {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(255px, .8fr) auto minmax(330px, 1.1fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--acid);
  background:
    linear-gradient(90deg, rgba(53,94,73,.07), transparent 28%),
    var(--panel);
  box-shadow: 0 14px 34px rgba(53,45,31,.08), inset 0 1px rgba(40,44,39,.025);
  backdrop-filter: blur(16px);
}
.bulk-selection-status { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-width: 0; padding: 5px 8px; }
.bulk-selection-status > div { min-width: 0; }
.bulk-selection-status b, .bulk-selection-status small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulk-selection-status b { color: var(--text); font: 13px var(--mono); text-transform: none; }
.bulk-selection-status small { margin-top: 4px; color: var(--muted); font: 13px var(--mono); }
.bulk-selection-signal { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid rgba(53,94,73,.36); border-radius: 50%; }
.bulk-selection-signal i { width: 6px; height: 6px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 10px var(--acid); animation: bulk-pulse 1.6s ease-in-out infinite; }
.bulk-clear { border: 0; background: transparent; color: var(--muted); font: 13px var(--mono); text-transform: none; cursor: pointer; }
.bulk-clear:not(:disabled):hover { color: var(--acid); }
.bulk-action-cluster { display: grid; grid-template-columns: repeat(3, minmax(82px, 1fr)); gap: 6px; }
.bulk-command { display: grid; grid-template-columns: auto 1fr; grid-template-rows: 1fr 1fr; align-items: center; column-gap: 7px; min-width: 92px; padding: 6px 9px; border: 1px solid var(--line); background: var(--panel); text-align: left; cursor: pointer; }
.bulk-command > span { grid-row: 1 / -1; color: var(--blue); font: 17px var(--mono); }
.bulk-command > b { color: var(--text); font: 13px var(--mono); text-transform: none; }
.bulk-command > small { color: var(--muted); font: 13px var(--mono); text-transform: none; }
.bulk-command.acid > span { color: var(--acid); }
.bulk-command.orange > span { color: var(--orange); }
.bulk-command:not(:disabled):hover { border-color: var(--muted); background: var(--panel-2); transform: translateY(-1px); }
.bulk-route-command { display: grid; gap: 5px; padding-left: 14px; border-left: 1px solid var(--line); }
.bulk-route-command label { color: var(--muted); font: 13px var(--mono); letter-spacing: .08em; text-transform: none; }
.bulk-route-command > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.bulk-route-command select, .bulk-route-command button { min-width: 0; height: 34px; border: 1px solid var(--line); background: var(--panel); color: var(--text); padding: 0 9px; font: 13px var(--mono); text-transform: none; }
.bulk-route-command button { border-color: rgba(60,100,121,.42); color: var(--blue); background: rgba(60,100,121,.07); cursor: pointer; }
.bulk-route-command button:not(:disabled):hover { background: rgba(60,100,121,.14); }
.batch-wallet-strip { display: flex; flex-wrap: wrap; gap: 5px; padding: 10px; border: 1px solid var(--line); background: var(--panel); }
.batch-wallet-strip span, .batch-wallet-strip b { padding: 5px 7px; border: 1px solid var(--line-strong); color: var(--muted); font: 13px var(--mono); }
.batch-wallet-strip b { color: var(--acid); border-color: rgba(53,94,73,.35); }
.batch-total-line { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; margin-top: 14px; padding: 12px 13px; border-left: 3px solid var(--blue); background: rgba(60,100,121,.06); }
.batch-total-line span { color: var(--muted); font: 13px var(--mono); text-transform: none; }
.batch-total-line b { color: var(--blue); font: 13px var(--mono); }
.batch-total-line small { grid-column: 1 / -1; color: var(--muted); font: 13px var(--mono); }
.batch-skip-notice { margin-bottom: 10px; padding: 9px 11px; border: 1px solid rgba(153,86,41,.38); color: var(--orange); background: rgba(153,86,41,.06); font: 13px var(--mono); }
@keyframes bulk-pulse { 50% { opacity: .35; transform: scale(.68); } }

.route-control-cell { min-width: 290px; padding: 7px !important; }
.project-balance-table .route-control-cell { min-width: 0; padding: 5px !important; }
.project-balance-table .route-control { min-width: 0; gap: 5px; padding: 6px; }
.route-control {
  display: grid;
  gap: 7px;
  min-width: 270px;
  padding: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  transition: border-color .25s ease, box-shadow .25s ease;
}
.route-control.active { border-color: rgba(60,100,121,.55); box-shadow: inset 3px 0 0 var(--blue), 0 0 18px rgba(60,100,121,.06); }
.route-control.complete { border-color: rgba(53,94,73,.46); box-shadow: inset 3px 0 0 var(--acid); }
.route-control.failed { border-color: rgba(174,58,51,.5); box-shadow: inset 3px 0 0 var(--danger); }
.route-picker-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.route-picker-line select {
  min-width: 0;
  height: 29px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 0 7px;
  font: 13px var(--mono);
  text-transform: none;
}
.project-balance-table .route-picker-line select { height: 31px; padding: 0 6px; font-size: 13px; font-weight: 650; }
.project-balance-table .route-run-button { min-width: 66px; height: 31px; font-size: 13px; font-weight: 700; }
.project-balance-table .route-state-line { font-size: 13px; }
.route-run-button {
  min-width: 72px;
  height: 29px;
  border: 1px solid rgba(53,94,73,.36);
  background: rgba(53,94,73,.07);
  color: var(--acid);
  font: 13px var(--mono);
  text-transform: none;
  cursor: pointer;
}
.route-run-button.attention { border-color: rgba(174,58,51,.48); color: var(--danger); background: rgba(174,58,51,.07); }
.route-run-button.active { color: var(--blue); border-color: rgba(60,100,121,.4); }
.route-run-button.active i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 4px;
  border: 1px solid rgba(60,100,121,.35);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .65s linear infinite;
}
.route-progress, .route-log-progress { height: 3px; overflow: hidden; background: var(--panel-2); }
.route-progress i, .route-log-progress i { display: block; height: 100%; background: var(--blue); box-shadow: 0 0 7px rgba(60,100,121,.68); transition: width .45s cubic-bezier(.2,.8,.2,1); }
.route-control.active .route-progress i { position: relative; background: linear-gradient(90deg, var(--blue), var(--blue), var(--blue)); background-size: 180% 100%; animation: route-flow 1.25s linear infinite; }
.route-control.complete .route-progress i { background: var(--acid); box-shadow: 0 0 8px rgba(53,94,73,.8); }
.route-control.failed .route-progress i { background: var(--danger); }
.route-state-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font: 13px var(--mono); }
.route-state-line span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route-state-line b { color: var(--text); font-weight: 500; }
@keyframes route-flow { to { background-position: -180% 0; } }

.route-catalog { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.route-card {
  position: relative;
  overflow: hidden;
  min-height: 330px;
  padding: 20px;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(circle at 88% 8%, rgba(60,100,121,.14), transparent 31%),
    linear-gradient(145deg, var(--panel-2), var(--panel) 65%);
  box-shadow: inset 4px 0 0 var(--blue);
}
.route-card.reverse { box-shadow: inset 4px 0 0 var(--acid); background: radial-gradient(circle at 88% 8%, rgba(53,94,73,.11), transparent 31%), linear-gradient(145deg, var(--panel-2), var(--panel) 65%); }
.route-card::after { content: "ROUTE"; position: absolute; right: -10px; bottom: -22px; color: rgba(40,44,39,.025); font: 90px var(--display); transform: rotate(-4deg); pointer-events: none; }
.route-card-head, .route-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.route-card h3 { max-width: 620px; margin: 27px 0 8px; font: 650 26px/.95 var(--display); text-transform: none; }
.route-card > p { max-width: 640px; min-height: 34px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.route-chain { display: flex; align-items: center; gap: 7px; margin: 22px 0; overflow-x: auto; }
.route-chain b { flex: 0 0 auto; padding: 8px 9px; border: 1px solid var(--line-strong); color: var(--text); background: var(--panel); font: 13px var(--mono); }
.route-chain i { color: var(--blue); font: 14px var(--mono); }
.route-card.reverse .route-chain i { color: var(--acid); }
.route-step-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 20px; margin: 0; padding: 0; list-style: none; counter-reset: route-step; }
.route-step-list li { counter-increment: route-step; color: var(--muted); font-size: 13px; }
.route-step-list li::before { content: "0" counter(route-step) " / "; color: var(--muted); font: 13px var(--mono); }
.route-card-foot { position: absolute; left: 20px; right: 20px; bottom: 18px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font: 13px var(--mono); text-transform: none; }
.route-runs-table { min-width: 1250px; }
.route-log-progress { width: 150px; margin-bottom: 5px; }

.farm-notice { border-color: rgba(60,100,121,.3); background: rgba(60,100,121,.055); }
.farm-notice strong, .farm-notice .notice-icon { color: var(--blue); }
.farm-cycle-wait { align-items: flex-start; }
.farm-cycle-wait-spinner { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 1px; border: 2px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
.farm-cycle-wait small { display: block; margin-top: 9px; color: var(--muted); font: 13px var(--mono); font-variant-numeric: tabular-nums; }
.farm-cycle-live { margin: 16px 0 22px; padding: 18px; border: 1px solid var(--line); border-top-color: var(--blue); border-radius: var(--radius); background: var(--panel); }
.farm-cycle-live.is-complete { border-color: var(--acid); background: var(--acid-soft); }
.farm-cycle-live.is-complete .farm-cycle-live-heading { color: var(--acid); font-size: 24px; }
.farm-cycle-result-icon { display: grid; flex: 0 0 40px; height: 40px; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: 24px; }
.farm-cycle-result-message { margin: 10px 0 18px; color: var(--text); font-size: 13px; line-height: 1.6; }
.farm-cycle-live.is-complete .farm-cycle-progress > span { background: var(--acid); transition: none; }
.farm-cycle-live.is-stopped { border-top-color: var(--orange); }
.farm-cycle-live.is-stopped .farm-cycle-result-icon { color: var(--orange); }
.farm-cycle-live-heading { display: flex; align-items: center; gap: 10px; font: 600 14px/1.5 var(--body); font-variant-numeric: tabular-nums; }
.farm-cycle-live-dot { flex: 0 0 7px; height: 7px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 0 4px var(--acid-soft); animation: farm-cycle-pulse .8s ease-in-out infinite; }
.farm-cycle-stages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 16px 0 12px; padding: 0; list-style: none; color: var(--muted); font: 13px/1.5 var(--mono); }
.farm-cycle-stages li { padding-top: 7px; border-top: 2px solid var(--line); overflow-wrap: anywhere; }
.farm-cycle-stages .is-current { color: var(--blue); border-color: var(--blue); }
.farm-cycle-stages .is-done, .farm-cycle-leg .is-done { color: var(--acid); border-color: var(--acid); }
.farm-cycle-progress { height: 5px; overflow: hidden; border-radius: 4px; background: var(--line); }
.farm-cycle-progress > span { display: block; height: 100%; background: var(--blue); transition: width .8s linear; }
.farm-cycle-progress.is-indeterminate > span { width: 30%; animation: farm-cycle-travel .9s ease-in-out infinite; }
.farm-cycle-live-legs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 10px; margin-top: 16px; }
.farm-cycle-leg { padding: 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); }
.farm-cycle-leg > strong, .farm-cycle-leg > span { display: block; font-size: 13px; line-height: 1.5; }
.farm-cycle-leg > span { margin: 4px 0 12px; color: var(--muted); }
.farm-cycle-leg dl { display: grid; gap: 8px; margin: 0; }
.farm-cycle-leg dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.farm-cycle-leg dt { color: var(--muted); font: 13px/1.5 var(--body); }
.farm-cycle-leg dd { margin: 0; text-align: right; overflow-wrap: anywhere; font: 13px/1.5 var(--mono); }
.farm-cycle-market { display: grid; gap: 6px; margin-top: 14px; padding: 12px 0; border-top: 1px solid var(--line); color: var(--text); font: 13px/1.5 var(--mono); }
.farm-cycle-market.is-stale, .farm-cycle-market small, .farm-cycle-connection { color: var(--muted); }
.farm-cycle-connection { margin: 14px 0 0; font: 13px/1.6 var(--mono); font-variant-numeric: tabular-nums; }
.farm-cycle-live.is-stale .farm-cycle-connection { color: var(--orange); }
.farm-cycle-live.is-stale .farm-cycle-live-dot { background: var(--orange); box-shadow: none; animation: none; }
.farm-cycle-live.is-stale .farm-cycle-progress.is-indeterminate > span { animation: none; background: var(--muted); }
@keyframes farm-cycle-pulse { 50% { opacity: .4; } }
@keyframes farm-cycle-travel { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }
#farm-cycle-form input:disabled, #farm-cycle-form select:disabled,
:is(#farm-batch-form, .standard-trading-form) input:disabled, :is(#farm-batch-form, .standard-trading-form) select:disabled { opacity: .55; cursor: not-allowed; }
.farm-batch-summary { color: var(--muted); font: 13px/1.8 var(--mono); }
.farm-batch-table-shell { margin: 18px 0; }
.farm-batch-table { min-width: 520px; }
.farm-batch-table td { vertical-align: top; }
.farm-batch-progress { display: flex; align-items: flex-start; gap: 10px; }
.farm-batch-progress > div { display: grid; gap: 6px; }
.farm-batch-progress strong { font-size: 13px; font-weight: 500; }
.farm-batch-progress span, .farm-batch-progress small { color: var(--muted); font: 13px/1.5 var(--mono); }
.farm-full-journal { max-height: 360px; overflow: auto; overscroll-behavior: contain; }
.farm-full-journal pre { grid-column: 1 / -1; margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); font: 13px/1.5 var(--mono); }
@media (prefers-reduced-motion: reduce) {
  .farm-cycle-wait-spinner, .farm-cycle-live-dot, .farm-cycle-progress.is-indeterminate > span { animation: none; }
  .farm-cycle-progress > span { transition: none; }
}
.farm-filters { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) minmax(240px, 1.3fr); gap: 14px; margin-bottom: 18px; }
.farm-action-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-left: 3px solid var(--acid); background: var(--panel); }
.farm-selection-status { display: grid; gap: 5px; }
.farm-selection-status b { color: var(--text); font: 13px var(--mono); }
.farm-selection-status small { color: var(--muted); font-size: 13px; }
.farm-feedback { padding: 12px 14px; margin-top: 12px; border: 1px solid rgba(53,94,73,.3); background: rgba(53,94,73,.045); color: var(--acid); font-size: 13px; line-height: 1.6; }
.farm-feedback.error { border-color: rgba(174,58,51,.4); color: var(--danger); background: rgba(174,58,51,.045); }
.farm-feedback button { margin-left: 10px; }
.farm-table-summary { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 18px; padding: 15px 0 10px; color: var(--muted); font-size: 13px; }
.farm-table-summary > div { display: flex; flex-wrap: wrap; gap: 7px 16px; }
.farm-table-summary b { margin-left: 4px; color: var(--text); font: 13px var(--mono); }
.farm-loading { min-height: 230px; }
.farm-table { min-width: 1120px; table-layout: fixed; }
.farm-table th { padding: 10px 8px; font-size: 13px; letter-spacing: .035em; }
.farm-table td { padding: 10px 8px; }
.farm-table th .subline { font: 13px var(--body); text-transform: none; letter-spacing: 0; }
.farm-col-select { width: 36px; }
.farm-col-wallet { width: 145px; }
.farm-col-account { width: 123px; }
.farm-col-balance { width: 100px; }
.farm-col-volume { width: 130px; }
.farm-col-points { width: 120px; }
.farm-col-positions { width: 70px; }
.farm-col-status { width: 179px; }
.farm-col-snapshot { width: 117px; }
.farm-table .select-cell, .farm-table .select-column-head { min-width: 36px; width: 36px; }
.farm-table tbody tr.is-selected { background: rgba(53,94,73,.045); }
.farm-table tbody tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--acid); }
.farm-table .row-selector:has(input:disabled) { cursor: not-allowed; opacity: .45; }
.farm-wallet-cell > strong { font: 13px var(--mono); white-space: nowrap; }
.farm-table .compact-address { font-size: 13px; }
.farm-number { font: 13px var(--mono) !important; overflow-wrap: anywhere; }
.farm-number strong { font-weight: 500; }
.farm-number .subline { color: var(--muted); font: 13px var(--mono); }
.farm-metric-stack { display: grid; gap: 5px; font: 13px var(--mono); }
.farm-metric-stack > span { display: grid; grid-template-columns: 35px minmax(0, 1fr); align-items: baseline; gap: 5px; }
.farm-metric-stack small { color: var(--muted); font: 13px var(--body); }
.farm-metric-stack b { font-weight: 400; overflow-wrap: anywhere; }
.farm-status-cell .badge { max-width: 100%; line-height: 1.45; font-size: 13px; text-transform: none; }
.farm-snapshot-cell { color: var(--text); font: 13px/1.7 var(--mono) !important; }
.farm-future-actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; padding: 17px 0; margin-top: 18px; border-top: 1px solid var(--line); }
.farm-future-actions > div:first-child { display: grid; gap: 6px; }
.farm-future-actions b { color: var(--text); font: 13px var(--mono); }
.farm-future-actions small { color: var(--muted); font-size: 13px; }
.farm-provisions-table-shell { border: 0; }
.farm-provisions-table { min-width: 960px; }
.farm-provisions-table td { font-size: 13px; }
.farm-provisions-panel .panel-head { flex-wrap: wrap; }
.farm-provisions-panel .farm-feedback { margin: 12px; }
.farm-provisions-empty { font-size: 13px; line-height: 1.6; }
.farm-provision-wallet { display: grid; gap: 6px; margin: 0 0 18px; padding: 12px; border: 1px solid var(--line); background: var(--panel); }
.farm-provision-wallet strong { color: var(--text); font: 13px var(--mono); }
.farm-provision-wallet > span { color: var(--muted); overflow-wrap: anywhere; font: 13px/1.5 var(--mono); }
.farm-topup-toggle { display: flex; align-items: flex-start; gap: 10px; margin-top: 18px; padding: 13px; border: 1px solid var(--line); cursor: pointer; }
.farm-topup-toggle input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--acid); }
.farm-topup-toggle span { display: grid; gap: 5px; }
.farm-topup-toggle b { font-size: 13px; }
.farm-topup-toggle small { color: var(--muted); font-size: 13px; line-height: 1.5; }
.farm-topup-fields { padding: 14px 0; }
.farm-topup-fields[hidden] { display: none; }
.farm-provision-access-note { margin-top: 16px; }
.farm-provision-values { margin-top: 0; }
.farm-provision-values .preview-row { grid-template-columns: minmax(120px, .85fr) minmax(0, 1fr); }
.farm-provision-steps { display: grid; gap: 1px; margin: 16px 0 0; padding: 0; list-style: none; border: 1px solid var(--line); }
.farm-provision-steps li { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px; border-bottom: 1px solid var(--line); }
.farm-provision-steps li:last-child { border-bottom: 0; }
.farm-provision-steps li > b { color: var(--acid); font: 13px var(--mono); }
.farm-provision-steps li > div { display: grid; gap: 5px; }
.farm-provision-steps strong { font-size: 13px; font-weight: 500; }
.farm-provision-steps small { color: var(--muted); font-size: 13px; }
.farm-provision-events { margin-top: 16px; color: var(--text); font-size: 13px; }
.farm-provision-events summary { cursor: pointer; }
.farm-provision-events .sweep-event-log span { font-size: 13px; }
.farm-provision-events .sweep-event-log b { font: 13px/1.45 var(--body); }
.farm-provision-actions { flex-wrap: wrap; }
.farm-provision-complete { border-color: rgba(53,94,73,.35); background: rgba(53,94,73,.045); }
.farm-provision-complete strong, .farm-provision-complete .notice-icon { color: var(--acid); }
.farm-provision-loading { padding: 25px 0; color: var(--muted); font-size: 13px; }

.account-grid, .project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 22px; }
.binance-registry { min-width: 0; }
.binance-registry .section-toolbar { flex-wrap: wrap; }
.binance-registry .account-grid { grid-template-columns: minmax(0, 560px); margin-top: 18px; }
.binance-account-card h3 { overflow-wrap: anywhere; text-transform: none; }
.binance-group-list { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.binance-group-list > div { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; padding: 12px 15px; border: 1px solid var(--line); background: var(--panel); }
.binance-group-list strong { color: var(--text); font: 13px var(--mono); }
.binance-group-list > div > span:not(.badge) { color: var(--muted); font-size: 13px; }
.binance-table-tools { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.binance-table-tools .field { flex: 1 1 280px; max-width: 530px; }
.binance-table-tools > span { font: 13px var(--mono); padding-bottom: 10px; }
.binance-address-table { min-width: 1000px; }
.binance-full-address { color: var(--text); font: 13px var(--mono); white-space: nowrap; user-select: all; }
.binance-dialog-intro { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.binance-preview-table { max-height: 420px; overflow: auto; }
.binance-preview-table .data-table { min-width: 470px; table-layout: fixed; }
.binance-preview-address { overflow-wrap: anywhere; color: var(--text); font: 13px/1.6 var(--mono); user-select: all; }
.binance-registry .table-shell:focus-visible, .binance-preview-table:focus-visible { outline: 2px solid var(--acid); outline-offset: 3px; }
.binding-group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin: 0 0 18px; }
.account-card, .project-card { position: relative; padding: 16px; border: 1px solid var(--line); background: var(--panel); overflow: hidden; }
.binding-group-card { position: relative; padding: 14px; border: 1px solid var(--line); background: linear-gradient(135deg, rgba(60,100,121,.05), var(--panel) 56%); overflow: hidden; }
.binding-group-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--blue); }
.binding-group-card h3 { margin: 7px 0 4px; font: 650 19px var(--display); text-transform: none; }
.binding-group-card p { margin: 0; color: var(--muted); font-size: 13px; }
.account-card::before, .project-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--blue); }
.project-card::before { background: var(--acid); }
.account-card h3, .project-card h3 { margin: 4px 0 6px; font: 650 19px var(--display); text-transform: none; }
.account-card p, .project-card p { margin: 0; color: var(--muted); font-size: 13px; }
.card-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 18px; border-top: 1px solid var(--line); }
.card-stat { padding: 11px 5px 0; }
.card-stat b { display: block; font: 20px var(--display); }
.card-stat span { color: var(--muted); font: 13px var(--mono); text-transform: none; }
.project-card { cursor: pointer; transition: .18s ease; }
.project-card:hover { transform: translateY(-2px); border-color: var(--muted); }
.project-group-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: -5px 0 16px; }
.project-group-chip {
  display: grid;
  gap: 3px;
  min-width: 180px;
  padding: 9px 11px;
  border: 1px solid rgba(60,100,121,.32);
  border-left: 3px solid var(--blue);
  background: linear-gradient(90deg, rgba(60,100,121,.07), var(--panel) 55%);
}
.project-group-chip b { color: var(--blue); font: 13px var(--mono); }
.project-group-chip small { color: var(--muted); font-size: 13px; }

.address-stack { display: flex; flex-wrap: wrap; gap: 5px; max-width: 520px; }
.route-pill { display: inline-flex; gap: 6px; align-items: center; padding: 5px 7px; background: var(--panel); border: 1px solid var(--line); font: 13px var(--mono); }
.route-pill b { color: var(--acid); font-weight: 500; }

.pair-builder { display: grid; grid-template-columns: 1fr 62px 1fr; gap: 12px; align-items: stretch; margin-bottom: 18px; }
.pair-column { padding: 17px; border: 1px solid var(--line); background: var(--panel); }
.pair-column label { display: block; margin-bottom: 9px; color: var(--muted); font: 13px var(--mono); text-transform: none; }
.pair-column select {
  width: 100%;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  min-height: var(--control-height);
  font-size: 15px;
  outline: none;
}
.pair-column select:focus { border-color: var(--acid); box-shadow: 0 0 0 2px var(--acid-soft); }
.pair-link { display: grid; place-items: center; color: var(--acid); font: 26px var(--mono); }
.pair-builder-groups { grid-template-columns: minmax(0, 1fr) 88px minmax(0, 1fr); }
.pair-group-meta {
  min-height: 37px;
  margin-top: 9px;
  padding: 10px 11px;
  border-left: 2px solid var(--line-strong);
  background: var(--panel);
  color: var(--muted);
  font: 13px/1.5 var(--mono);
}
.pair-group-link {
  display: grid;
  place-content: center;
  place-items: center;
  gap: 3px;
  border: 1px dashed var(--line-strong);
  background: linear-gradient(135deg, rgba(53,94,73,.06), transparent);
  color: var(--acid);
}
.pair-group-link b { font: 26px/.9 var(--display); }
.pair-group-link span { color: var(--muted); font: 13px var(--mono); letter-spacing: .12em; }
.pair-group-link .danger-text { color: var(--danger); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { color: var(--muted); font: 500 13px/1.5 var(--body); letter-spacing: 0; text-transform: none; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--acid); box-shadow: 0 0 0 2px var(--acid-soft); }
.field textarea { resize: vertical; min-height: 96px; font: 13px/1.55 var(--mono); }
.field-help { color: var(--muted); font-size: 13px; line-height: 1.45; }
.farm-field-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 8px; min-width: 0; }
.farm-field-heading label { margin: 0; }
.farm-current-price, .farm-reference-refresh, .farm-balance-trigger { border: 0; padding: 0; background: transparent; color: var(--acid); font: 500 12px/1.5 var(--body); cursor: pointer; }
.farm-current-price { margin-left: auto; white-space: nowrap; border-bottom: 1px dotted currentColor; }
.farm-current-price:disabled { color: var(--muted); cursor: default; border-bottom-color: transparent; }
.farm-current-price:focus-visible, .farm-reference-refresh:focus-visible, .farm-balance-trigger:focus-visible { outline: 2px solid var(--acid); outline-offset: 3px; border-radius: 2px; }
.farm-price-increment { color: var(--muted); font-size: 11px; margin-left: auto; }
.farm-reference-bar { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; color: var(--muted); font-size: 12px; }
.farm-reference-refresh { flex-shrink: 0; text-decoration: underline; text-underline-offset: 3px; }
.farm-reference-refresh:disabled { opacity: .55; cursor: wait; }
.farm-balance-help { position: relative; display: inline-flex; }
.farm-balance-trigger { color: var(--muted); font-size: 13px; border-bottom: 1px dotted currentColor; }
.farm-balance-tooltip { position: absolute; z-index: 30; bottom: calc(100% + 7px); left: 0; width: 250px; max-height: 65vh; overflow-y: auto; max-width: calc(100vw - 48px); padding: 14px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 8px 28px #282c271c; color: var(--text); font: 400 13px/1.4 var(--body); display: none; }
.farm-balance-help::before { content: ""; position: absolute; bottom: 100%; left: 0; width: 250px; height: 9px; }
.farm-balance-help:not([data-dismissed="true"]):hover .farm-balance-tooltip, .farm-balance-help:not([data-dismissed="true"]):focus-within .farm-balance-tooltip { display: grid; gap: 10px; }
.farm-balance-caption { display: block; color: var(--muted); font-size: 11px; }
.farm-balance-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 4px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.farm-balance-row > span:last-child { text-align: right; }
.farm-balance-row b { font-weight: 500; }
.farm-balance-checked { margin-top: 8px; }
.file-detection {
  display: grid;
  gap: 5px;
  padding: 12px 13px;
  border: 1px dashed var(--line-strong);
  background: var(--panel);
}
.file-detection b { color: var(--blue); font: 13px var(--mono); text-transform: none; }
.file-detection span { color: var(--muted); font-size: 13px; line-height: 1.45; }
.file-detection.working { border-color: rgba(60,100,121,.5); }
.file-detection.success { border-style: solid; border-color: rgba(53,94,73,.42); background: var(--acid-soft); }
.file-detection.success b { color: var(--acid); }
.file-detection.error { border-style: solid; border-color: rgba(174,58,51,.5); }
.file-detection.error b { color: var(--danger); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }

.selection-bar { display: flex; gap: 9px; align-items: end; margin: 14px 0; }
.binding-picker { max-height: 300px; overflow: auto; border: 1px solid var(--line); }
.binding-option { display: grid; grid-template-columns: 26px 45px 1fr 1fr; gap: 8px; align-items: center; padding: 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.binding-option:last-child { border-bottom: 0; }
.binding-option:hover { background: rgba(40,44,39,.02); }
.binding-option.selected { background: var(--acid-soft); }
.binding-option input { accent-color: var(--acid); }
.selection-head { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin: 18px 0 9px; }
.selection-head > div { display: grid; gap: 3px; }
.selection-head b { color: var(--text); font: 13px var(--mono); text-transform: none; }
.selection-head small { color: var(--muted); font-size: 13px; }
.selection-head > span { color: var(--acid); font: 13px var(--mono); }
.binding-group-picker { display: grid; gap: 7px; max-height: 330px; overflow: auto; }
.binding-group-option {
  display: grid;
  grid-template-columns: 24px minmax(130px, 1fr) 55px minmax(120px, .8fr) 92px;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  transition: .16s ease;
}
.binding-group-option:hover { border-color: var(--muted); background: var(--panel-2); }
.binding-group-option.selected { border-color: rgba(53,94,73,.48); background: var(--acid-soft); box-shadow: inset 3px 0 0 var(--acid); }
.binding-group-option.locked { cursor: default; border-color: rgba(60,100,121,.28); background: rgba(60,100,121,.045); box-shadow: inset 3px 0 0 var(--blue); opacity: .72; }
.binding-group-option.locked:hover { border-color: rgba(60,100,121,.28); background: rgba(60,100,121,.045); }
.binding-group-option input { accent-color: var(--acid); }
.binding-group-option.locked input { accent-color: var(--blue); }
.binding-group-option-main, .binding-group-option-count, .binding-group-option-range { display: grid; gap: 3px; }
.binding-group-option-main b { color: var(--text); font: 13px var(--mono); }
.binding-group-option-main small, .binding-group-option-count small, .binding-group-option-range small { color: var(--muted); font-size: 13px; }
.binding-group-option-count { text-align: center; }
.binding-group-option-count b { color: var(--acid); font: 22px/.9 var(--display); }
.binding-group-option-range { color: var(--text); font: 13px var(--mono); }
.binding-group-option-status { color: var(--blue); font: 13px/1.35 var(--mono); text-align: right; }
.binding-group-option-status.ready { color: var(--acid); }
.inline-empty { padding: 18px; border: 1px dashed var(--line); color: var(--muted); font: 13px var(--mono); text-align: center; }
.binding-confirm-check {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: start;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid rgba(153,86,41,.38);
  background: rgba(153,86,41,.055);
  cursor: pointer;
}
.binding-confirm-check:hover { border-color: rgba(153,86,41,.65); }
.binding-confirm-check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--orange); }
.binding-confirm-check span { display: grid; gap: 4px; }
.binding-confirm-check b { color: var(--danger); font: 13px/1.45 var(--mono); text-transform: none; }
.binding-confirm-check small { color: var(--muted); font-size: 13px; line-height: 1.45; }

.operation-direction { font: 13px var(--mono); }
.operation-direction.in { color: var(--acid); }
.operation-direction.out { color: var(--orange); }
.operation-preview { display: grid; gap: 8px; margin-top: 14px; padding: 13px; border: 1px solid var(--line); background: var(--panel); }
.relay-delivery-path { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 18px 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.relay-delivery-path span { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.relay-delivery-values .preview-row > :last-child { overflow-wrap: anywhere; }
.relay-delivery-next { margin-top: 20px; padding: 15px; border: 1px solid rgba(53,94,73,.3); background: var(--acid-soft); }
.relay-delivery-next > strong { color: var(--text); font-size: 13px; }
.relay-delivery-next > p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.funding-route-screen { display: grid; gap: 16px; }
.funding-route-screen .farm-provision-wallet { margin: 0; }
.funding-route-screen #funding-route-amount-form { max-width: 520px; }
.funding-route-screen #funding-route-amount { min-height: 46px; font-size: 15px; font-family: var(--mono); }
.funding-route-status { color: var(--text); font-size: 13px; line-height: 1.6; margin: 0 0 12px; }
.funding-route-stages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.funding-route-stage { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 7px 8px; align-content: start; text-align: left; padding: 14px 12px; background: var(--acid-soft); border: 1px solid rgba(53,94,73,.45); color: var(--text); cursor: pointer; }
.funding-route-stage:not(:disabled):hover { border-color: var(--acid); background: var(--panel-2); }
.funding-route-stage:focus-visible { outline: 2px solid var(--acid); outline-offset: 3px; }
.funding-route-stage:disabled { opacity: 1; cursor: default; background: var(--panel); border-color: var(--line); }
.funding-route-stage-number { grid-column: 1; grid-row: 1 / 4; color: var(--acid); font: 14px/1.5 var(--mono); }
.funding-route-stage > strong, .funding-route-stage > small, .funding-route-stage > em { grid-column: 2; overflow-wrap: anywhere; }
.funding-route-stage > strong { font-size: 13px; line-height: 1.5; }
.funding-route-stage > small { color: var(--muted); font-size: 13px; line-height: 1.6; }
.funding-route-stage > em { color: var(--text); font-size: 13px; font-style: normal; line-height: 1.6; }
.funding-route-stage:disabled:not(.is-complete):not(.is-running) > strong, .funding-route-stage:disabled:not(.is-complete):not(.is-running) > .funding-route-stage-number { color: var(--muted); }
.funding-route-stage.is-complete { border-color: rgba(53,94,73,.2); }
.funding-route-stage.is-running { border-color: rgba(60,100,121,.45); background: rgba(60,100,121,.06); }
.funding-route-stage.is-running > em { color: var(--blue); }
.funding-route-budget { display: flex; flex-wrap: wrap; gap: 10px 25px; padding: 14px 0; margin-top: 12px; border-top: 1px solid var(--line); }
.funding-route-budget > span { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.funding-route-budget b { color: var(--text); font: 14px/1.5 var(--mono); }
.funding-route-balances { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 5px; }
.funding-route-balances > div { display: grid; align-content: start; gap: 5px; padding: 10px; background: var(--panel); border: 1px solid var(--line); }
.funding-route-balances small, .funding-route-balances span { color: var(--muted); font-size: 13px; line-height: 1.6; }
.funding-route-balances strong { font: 13px/1.6 var(--mono); color: var(--text); overflow-wrap: anywhere; }
.funding-route-screen .sweep-event-log > .funding-route-child { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 12px; }
.funding-route-screen .funding-route-child > span { color: var(--text); font: 13px/1.6 var(--mono); overflow-wrap: anywhere; }
.funding-route-screen .funding-route-child > small { color: var(--muted); font-size: 13px; line-height: 1.6; }
.funding-route-screen .funding-route-child > b { color: var(--text); font-size: 13px; }
@media (max-width: 620px) {
  .funding-route-stages, .funding-route-balances { grid-template-columns: minmax(0, 1fr); }
  .funding-route-stage { min-height: 84px; }
}
.preview-row { display: grid; grid-template-columns: 130px 1fr; gap: 12px; font-size: 13px; }
.preview-row span:first-child { color: var(--muted); }
.preview-row span:last-child { font-family: var(--mono); word-break: break-all; }

.funding-autobuy { padding: 14px; gap: 10px; border: 1px solid var(--line); background: var(--panel); }
.funding-autobuy-toggle { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.funding-autobuy-toggle input { flex: 0 0 16px; width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--acid); }
.funding-autobuy-toggle span { font-size: 13px; line-height: 1.5; color: var(--text); }
.funding-autobuy-toggle:has(input:disabled) { cursor: default; opacity: .55; }
.funding-autobuy [data-funding-buy-budget] { margin-top: 4px; }
.funding-autobuy [hidden] { display: none; }
.funding-plan .preview-row { grid-template-columns: minmax(130px, .9fr) minmax(0, 1fr); font-size: 13px; line-height: 1.5; }
.funding-progress { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; padding: 0; list-style: none; }
.funding-progress li { display: flex; align-items: center; flex: 1 1 145px; gap: 8px; padding: 10px; border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.funding-progress b { font: 13px var(--mono); }
.funding-progress .complete { color: var(--acid); border-color: rgba(53,94,73,.28); }
.funding-actions { flex-wrap: wrap; }
.funding-continuation { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.funding-continuation p { color: var(--muted); font-size: 13px; line-height: 1.65; }
.project-operation-list li { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 7px 0; }
.project-operation-list li > span { min-width: 0; }
.project-operation-list li small { display: block; margin-top: 4px; color: var(--muted); }
.project-operation-list .table-action { flex-shrink: 0; }
@media (max-width: 540px) {
  .funding-plan .preview-row { grid-template-columns: minmax(100px, .85fr) minmax(0, 1fr); gap: 8px; }
  .funding-actions > button { flex: 1 1 145px; }
}

.table-action { min-height: var(--control-height); padding: 10px 14px; font: 500 14px/1.4 var(--body); text-transform: none; }
.table-action.acid { color: var(--acid); border-color: rgba(53,94,73,.35); }
.table-action.orange { color: var(--orange); border-color: rgba(153,86,41,.35); }
.actions-cell { display: flex; gap: 6px; white-space: nowrap; }
.project-balance-table .actions-cell { display: table-cell; white-space: normal; }
.project-row-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.project-row-actions > .table-action, .project-row-actions .smart-max-button {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding-inline: 5px;
  font-size: 13px;
  font-weight: 700;
}

.smart-sweep-control { display: grid; gap: 4px; min-width: 126px; }
.project-row-actions .smart-sweep-control { min-width: 0; }
.smart-max-button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 126px; overflow: hidden; }
.smart-max-button b { font: 800 13px var(--mono); letter-spacing: .06em; }
.smart-max-button.is-running { color: var(--blue); border-color: rgba(60,100,121,.46); background: rgba(60,100,121,.07); }
.smart-max-button.is-running i { width: 8px; height: 8px; border: 1px solid rgba(60,100,121,.34); border-top-color: var(--blue); border-radius: 50%; animation: spin .65s linear infinite; }
.smart-max-button.attention { color: var(--orange); border-color: rgba(174,58,51,.5); }
.sweep-mini-progress { display: block; height: 2px; overflow: hidden; background: var(--line); }
.sweep-mini-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--blue)); box-shadow: 0 0 8px rgba(60,100,121,.75); transition: width .45s ease; }
.sweep-last-ok, .sweep-last-state { overflow: hidden; max-width: 126px; color: var(--muted); font: 13px var(--mono); text-overflow: ellipsis; }
.project-row-actions .sweep-last-ok, .project-row-actions .sweep-last-state { grid-column: 1 / -1; max-width: 143px; }
.sweep-last-ok { color: var(--acid); }

.smart-max-notice { border-left-color: var(--orange); background: linear-gradient(90deg, rgba(153,86,41,.08), transparent 70%); }
.smart-max-notice .notice-icon { width: 44px; color: var(--orange); font-size: 13px; letter-spacing: .06em; }
.smart-max-rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 14px; }
.smart-max-rules > div { display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; padding: 10px; border: 1px solid var(--line); background: var(--panel); }
.smart-max-rules b { grid-row: 1 / 3; color: var(--orange); font: 15px var(--display); }
.smart-max-rules span { color: var(--text); font: 13px var(--mono); text-transform: none; }
.smart-max-rules small { color: var(--muted); font: 13px var(--mono); }
.sweep-plan-grid { display: grid; gap: 9px; max-height: 330px; overflow: auto; padding-right: 3px; }
.sweep-plan-card { border: 1px solid var(--line); background: var(--panel); }
.sweep-plan-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; border-bottom: 1px solid var(--line); }
.sweep-plan-head b, .sweep-plan-head small { display: block; }
.sweep-plan-head b { color: var(--text); font: 13px var(--mono); }
.sweep-plan-head small { margin-top: 3px; color: var(--muted); font: 13px var(--mono); }
.sweep-plan-head > span { padding: 4px 6px; border: 1px solid rgba(153,86,41,.35); color: var(--orange); font: 13px var(--mono); text-transform: none; }
.sweep-asset-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sweep-asset-list > div { display: grid; grid-template-columns: 72px 1fr; gap: 3px 8px; padding: 8px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sweep-asset-list span { color: var(--muted); font: 13px var(--mono); text-transform: none; }
.sweep-asset-list b { overflow: hidden; color: var(--text); font: 13px var(--mono); text-overflow: ellipsis; }
.sweep-asset-list small { grid-column: 2; color: var(--muted); font: 13px var(--mono); }
.smart-max-footnote { display: grid; gap: 4px; margin-top: 12px; padding: 10px 12px; border-left: 3px solid var(--acid); background: rgba(53,94,73,.045); }
.smart-max-footnote b { color: var(--acid); font: 13px var(--mono); text-transform: none; }
.smart-max-footnote span { color: var(--muted); font: 13px/1.5 var(--mono); }
.sweep-event-log { display: grid; gap: 1px; max-height: 230px; margin-top: 12px; overflow: auto; border: 1px solid var(--line); }
.sweep-event-log > div { display: grid; grid-template-columns: 105px 1fr; gap: 10px; padding: 8px 10px; background: var(--panel); border-bottom: 1px solid var(--line); }
.sweep-event-log span { color: var(--muted); font: 13px var(--mono); }
.sweep-event-log b { color: var(--text); font: 13px/1.4 var(--mono); }
.danger-text { color: var(--orange) !important; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(45,44,34,.24);
  backdrop-filter: blur(3px);
}
.modal-backdrop[hidden] { display: none; }
.modal {
  width: min(720px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  border-radius: 10px; box-shadow: 0 24px 80px rgba(53,45,31,.16);
  animation: modal-in .2s ease both;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.985); } }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal h2 { font-size: 25px; }
.modal-body { padding: 20px; }

.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 70; display: grid; gap: 8px; width: min(360px, calc(100vw - 36px)); }
.toast { padding: 13px 14px; border: 1px solid var(--line-strong); background: var(--panel-2); box-shadow: 0 12px 32px rgba(53,45,31,.08); font-size: 13px; animation: toast-in .2s ease both; }
.toast.error { border-color: rgba(174,58,51,.58); color: var(--danger); }
.toast.success { border-color: rgba(53,94,73,.45); }
@keyframes toast-in { from { opacity: 0; transform: translateX(15px); } }

code { color: var(--acid); font-family: var(--mono); }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.mt-18 { margin-top: 18px; }

@media (max-width: 1180px) {
  .metric-card { grid-column: span 6; }
  .span-7, .span-5 { grid-column: span 12; }
  .route-catalog { grid-template-columns: 1fr; }
  .bulk-action-dock { position: relative; grid-template-columns: 1fr 1fr; }
  .bulk-route-command { grid-column: 1 / -1; padding: 10px 0 0; border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 820px) {
  .masthead { flex-wrap: wrap; gap: 12px; padding: 14px 20px; }
  .nav { flex: 1 1 100%; order: 3; }
  .connection-status { margin-left: auto; }
  .topbar { min-height: 96px; padding: 20px; }
  .topbar h1 { font-size: 27px; }
  .view { padding: 20px; }
  .pair-builder { grid-template-columns: 1fr; }
  .pair-link { transform: rotate(90deg); min-height: 36px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .binding-group-option { grid-template-columns: 24px minmax(0, 1fr) 54px; }
  .binding-group-option-range { grid-column: 2 / 3; }
  .binding-group-option-status { grid-column: 3; grid-row: 2; }
  .bulk-action-dock { grid-template-columns: 1fr; }
  .bulk-route-command { grid-column: auto; }
  .smart-max-rules, .sweep-asset-list { grid-template-columns: 1fr; }
  .farm-filters { grid-template-columns: 1fr; }
  .farm-action-bar .button-row { width: 100%; }
}

@media (max-width: 560px) {
  .metric-card { grid-column: span 12; }
  .topbar-actions .ghost-button { display: none; }
  .pipeline { grid-template-columns: 1fr; }
  .pipeline-arrow { transform: rotate(90deg); }
  .section-toolbar { align-items: stretch; flex-direction: column; }
  .button-row { width: 100%; }
  .button-row button { flex: 1; }
}

/* Project workspace: transport and farming share one wallet list. */
.project-workspace { min-width: 0; container-type: inline-size; }
.project-workspace > header, .project-workspace-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin-bottom: 20px;
}
.project-workspace > header > div, .project-workspace-header > div { min-width: 0; }
.project-workspace > header h2, .project-workspace-header h2 {
  margin: 12px 0 6px;
  font: 650 30px/1.1 var(--display);
  text-transform: none;
}
.project-workspace > header p, .project-workspace-header p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.project-workspace .section-toolbar { flex-wrap: wrap; }
.project-workspace-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.project-summary-item { min-width: 0; padding: 15px 16px; border: 1px solid var(--line); background: var(--panel); }
.project-summary-item label { display: block; color: var(--muted); font: 13px/1.5 var(--mono); letter-spacing: .035em; text-transform: none; }
.project-summary-item strong { display: block; margin-top: 9px; color: var(--text); font: 650 28px/1.1 var(--display); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.project-summary-item small { display: block; margin-top: 7px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.project-summary-item strong > small { display: inline; margin: 0; font: 500 16px/1.1 var(--display); white-space: nowrap; }
.project-summary-item.acid { border-color: rgba(53,94,73,.35); background: rgba(53,94,73,.045); }
.project-summary-item.acid strong { color: var(--acid); }

.project-workflow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 20px; }
.project-workflow > * {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  align-content: start;
  gap: 5px 10px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  text-align: left;
  text-decoration: none;
}
.project-workflow > button, .project-workflow > a { cursor: pointer; }
.project-workflow > button:not(:disabled):hover, .project-workflow > a:hover { border-color: var(--acid); background: var(--panel-2); }
.project-workflow > :is(.active, [aria-current="step"], [aria-current="true"]) { border-color: rgba(53,94,73,.5); background: var(--acid-soft); }
.project-workflow > * > span { grid-column: 1; grid-row: 1 / 3; color: var(--acid); font: 13px/1.5 var(--mono); }
.project-workflow b { grid-column: 2; color: var(--text); font-size: 13px; line-height: 1.5; font-weight: 600; }
.project-workflow small { grid-column: 2; color: var(--muted); font-size: 13px; line-height: 1.5; }
.project-workflow > :disabled > span { color: var(--muted); }
.project-workflow > [aria-disabled="true"] { border-style: dashed; background: transparent; }
.project-workflow > [aria-disabled="true"] :is(span, b) { color: var(--muted); }
.project-workspace :is(button, select, input, summary):focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.project-workspace-tools { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; margin: 18px 0 12px; }
.project-workspace-tools > div { min-width: 0; }
.project-workspace-tools > .button-row { margin-left: auto; }
.project-workspace-tools .field { flex: 1 1 160px; min-width: 160px; margin: 0; }
.project-workspace-tools .field:has(input[type="search"]) { flex-grow: 1.35; }
.project-workspace-tools :is(select, input[type="search"]) { min-width: 0; max-width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text); font-size: 13px; }
.project-workspace-tools input[type="search"] { flex: 1 1 230px; }
.project-workspace-tools input::placeholder { color: var(--muted); }
.project-workspace-tools label { color: var(--muted); font-size: 13px; }
.project-workspace .project-table-shell {
  container-type: inline-size;
  max-width: 100%;
  max-height: min(76vh, 840px);
  overflow: auto;
  overscroll-behavior-x: contain;
  scroll-padding-left: 226px;
  scrollbar-color: var(--line-strong) var(--panel);
}
.project-table-caption { margin: 13px 0 10px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.project-unified-table { width: 100%; min-width: 1250px; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.project-unified-table th { top: 0; z-index: 3; padding: 12px 10px; color: var(--text); font-size: 13px; line-height: 1.5; letter-spacing: .025em; }
.project-unified-table td { padding: 13px 10px; font-size: 13px; }
.project-unified-table :is(th, td):first-child:not([colspan]) { width: 36px; min-width: 36px; }
.project-unified-table :is(th, td):nth-child(2):not([colspan]) { width: 190px; }
.project-unified-table :is(th, td):nth-child(3):not([colspan]) { width: 160px; }
.project-unified-table :is(th, td):nth-child(4):not([colspan]) { width: 130px; }
.project-unified-table :is(th, td):nth-child(5):not([colspan]) { width: 120px; }
.project-unified-table :is(th, td):nth-child(6):not([colspan]) { width: 100px; }
.project-unified-table :is(th, td):last-child:not([colspan]) { width: 200px; }
/* Status takes the remaining width; fixed selection width keeps sticky offsets exact. */
.project-unified-table > thead > tr > th:first-child,
.project-unified-table > tbody > .wallet-data-row > td:first-child { position: sticky; left: 0; z-index: 2; background: var(--panel-2); }
.project-unified-table > thead > tr > th:nth-child(2),
.project-unified-table > tbody > .wallet-data-row > .project-wallet-cell { position: sticky; left: 36px; z-index: 2; background: var(--panel-2); box-shadow: 1px 0 0 var(--line); }
.project-unified-table > thead > tr > th:first-child,
.project-unified-table > thead > tr > th:nth-child(2) { z-index: 4; background: var(--panel); }
.project-unified-table > tbody > .wallet-data-row:hover > :is(td:first-child, .project-wallet-cell) { background: var(--panel-2); }
.project-unified-table > tbody > .wallet-data-row.is-selected > :is(td:first-child, .project-wallet-cell) { background: var(--panel-2); }
.project-unified-table .actions-cell { display: table-cell; white-space: normal; }
.project-workspace .project-wallet-cell { overflow: visible; }
.project-workspace .project-wallet-cell > strong { color: var(--acid); font: 700 13px/1.5 var(--mono); }
.project-workspace .project-wallet-cell > strong > small { margin-left: 6px; color: var(--muted); font: 500 13px/1.5 var(--mono); white-space: nowrap; }
.project-workspace .project-wallet-cell .subline { margin-top: 5px; font-size: 13px; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.project-workspace .project-wallet-cell .compact-address { margin-top: 5px; color: var(--text); font-size: 13px; }
.project-workspace .project-wallet-cell .copy-mini { min-width: 26px; min-height: 28px; }
.project-funds-cell, .project-dex-cell { font-variant-numeric: tabular-nums; }
.project-funds-cell > div { display: grid; gap: 2px; min-width: 0; }
.project-funds-cell > div + div { margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line); }
.project-funds-cell > div > small { color: var(--blue); font: 13px/1.4 var(--mono); }
.project-funds-cell > div > strong { display: block; color: var(--text); font: 600 13px/1.5 var(--mono); overflow-wrap: anywhere; }
.project-funds-cell > div > strong > span { color: var(--muted); font-size: 13px; font-weight: 400; }
.project-funds-cell > div > span { display: block; color: var(--text); font: 13px/1.5 var(--mono); overflow-wrap: anywhere; }
.project-funds-cell > strong, .project-dex-cell > strong { display: block; color: var(--text); font: 600 13px/1.5 var(--mono); }
.project-funds-cell .subline, .project-dex-cell .subline { font-size: 13px; line-height: 1.6; }
.project-funds-cell small, .project-dex-cell small { color: var(--muted); font-size: 13px; }
.project-status-cell { min-width: 180px; }
.project-status-cell .badge { max-width: 100%; font-size: 13px; line-height: 1.5; text-transform: none; white-space: normal; }
.project-status-cell > span { display: block; }
.project-status-cell > .badge { margin-bottom: 6px; }
.project-status-cell > small { display: block; margin-top: 7px; color: var(--muted); font: 13px/1.6 var(--mono); }
.project-status-cell .subline { font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.project-unified-table .farm-metric-stack { gap: 7px; font-size: 13px; }
.project-unified-table .farm-metric-stack small { font-size: 13px; }
.project-wallet-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 7px; }
.project-wallet-actions > *, .project-wallet-actions .smart-sweep-control { min-width: 0; }
.project-wallet-actions :is(.table-action, .smart-max-button) { width: 100%; min-width: 0; min-height: 36px; padding: 7px 5px; font-size: 13px; line-height: 1.4; letter-spacing: 0; text-transform: none; white-space: normal; }
.project-wallet-actions .smart-max-button b { font-size: 13px; letter-spacing: 0; }
.project-wallet-actions .table-action.blue { color: var(--blue); border-color: rgba(60,100,121,.4); }
.project-wallet-actions > [data-sweep-control] { display: grid; gap: 4px; }
.project-wallet-actions :is(.sweep-last-ok, .sweep-last-state) { max-width: 100%; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.project-wallet-actions > .subline { grid-column: 1 / -1; }

.project-wallet-details-row[hidden] { display: none; }
.project-unified-table .project-wallet-details-row > td { padding: 0; background: var(--panel); }
.project-wallet-details {
  position: sticky;
  left: 0;
  display: grid;
  gap: 16px;
  width: 100cqw;
  max-width: 100%;
  padding: 18px;
  border-top: 1px solid rgba(53,94,73,.2);
  border-bottom: 1px solid var(--line);
}
.project-wallet-details > * { min-width: 0; }
.project-wallet-details :is(h3, h4) { margin: 0 0 10px; color: var(--text); font: 600 13px/1.5 var(--mono); }
.project-wallet-details p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.project-details-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) repeat(2, minmax(0, 1fr)); gap: 12px; }
.project-details-grid > section { min-width: 0; padding: 14px; border: 1px solid var(--line); background: var(--panel); }
.project-details-grid p + p { margin-top: 8px; }
.project-details-grid :is([data-route-control], button) { margin-top: 12px; }
.project-details-grid [data-route-control] button { margin-top: 0; }
.project-details-grid ul { display: grid; gap: 8px; margin: 0 0 12px; padding-left: 17px; color: var(--text); font: 13px/1.6 var(--mono); }
.project-details-grid li { overflow-wrap: anywhere; }
.project-network-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
.project-network-grid > * { min-width: 0; }
.project-network-grid :is(h4, strong) { display: block; margin: 0 0 8px; color: var(--blue); font: 500 13px/1.5 var(--mono); }
.project-network-grid .balance-cell { padding: 11px; min-height: 72px; }
.project-network-grid .balance-value { gap: 7px; font-size: 13px; line-height: 1.5; }
.project-network-grid .balance-symbol { color: var(--muted); font-size: 13px; }
.project-network-grid .balance-amount { min-width: 0; overflow-wrap: anywhere; white-space: normal; text-align: right; }
.project-wallet-details .route-control { min-width: 0; max-width: 560px; padding: 12px; }
.project-wallet-details :is(.route-picker-line select, .route-run-button) { height: 37px; font-size: 13px; }
.project-wallet-details .route-state-line { font-size: 13px; line-height: 1.5; }
.project-wallet-details .route-state-line span { white-space: normal; overflow-wrap: anywhere; }
.project-wallet-details .farm-metric-stack { font-size: 13px; }
.project-wallet-details .farm-metric-stack small { font-size: 13px; }
.project-history { margin-top: 18px; border: 1px solid var(--line); background: var(--panel); }
.project-history > summary { padding: 16px; color: var(--text); font-size: 13px; line-height: 1.5; cursor: pointer; }
.project-history > summary::marker { color: var(--acid); }
.project-history > summary small { margin-left: 9px; color: var(--muted); font-size: 13px; }
.project-history > summary > strong { font-weight: 600; }
.project-history > summary > span { margin-left: 12px; color: var(--muted); font: 13px var(--mono); white-space: nowrap; }
.project-history[open] > summary { border-bottom: 1px solid var(--line); }
.project-history > .panel { margin-top: 0; border: 0; }
.project-history-body { display: grid; gap: 14px; min-width: 0; padding: 16px; }
.project-history-body > .button-row { justify-content: flex-end; }
.project-history-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.project-history-item { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 18px; padding: 14px 0; border-top: 1px solid var(--line); }
.project-history-item > div:first-child { display: grid; gap: 5px; min-width: 0; flex: 1 1 260px; }
.project-history-item > div:last-child { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.project-history-item strong { color: var(--text); font: 600 13px/1.5 var(--mono); }
.project-history-item span { color: var(--text); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.project-history-item small { color: var(--muted); font: 13px/1.5 var(--mono); }
.project-history-item .badge { font-size: 13px; text-transform: none; }
.project-history-item .table-action { min-height: 36px; font-size: 13px; text-transform: none; }

.project-workspace .bulk-action-dock { position: relative; display: flex; align-items: stretch; flex-wrap: wrap; gap: 12px; padding: 12px; box-shadow: none; }
.project-workspace .bulk-selection-status { flex: 1 1 230px; padding: 5px 0; }
.project-workspace .bulk-selection-status b { font-size: 13px; line-height: 1.5; white-space: normal; }
.project-workspace .bulk-selection-status small { color: var(--muted); font-size: 13px; line-height: 1.5; white-space: normal; }
.project-workspace .bulk-clear { min-height: 34px; padding: 6px; font-size: 13px; }
.project-workspace .bulk-action-cluster { display: flex; flex: 2 1 460px; flex-wrap: wrap; gap: 7px; }
.project-workspace .bulk-command { flex: 1 1 108px; min-width: 108px; min-height: 49px; padding: 8px 10px; }
.project-workspace .bulk-command > b { font-size: 13px; line-height: 1.5; text-transform: none; }
.project-workspace .bulk-command > small { color: var(--muted); font-size: 13px; line-height: 1.5; text-transform: none; }
.project-workspace .bulk-route-command { flex: 1 1 310px; padding: 0 0 0 12px; border-top: 0; border-left: 1px solid var(--line); }
.project-workspace .bulk-route-command label { font-size: 13px; }
.project-workspace .bulk-route-command :is(select, button) { min-height: 37px; height: auto; padding: 8px; font-size: 13px; letter-spacing: 0; }

@container (max-width: 1050px) {
  .project-workspace-summary { gap: 8px; }
  .project-summary-item { padding: 13px; }
  .project-network-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .project-details-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-details-grid > section:last-child { grid-column: 1 / -1; }
  .project-workspace .bulk-route-command { flex-basis: 100%; padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--line); }
}
@container (max-width: 700px) {
  .project-workspace-summary, .project-workflow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-workspace-tools { align-items: stretch; }
  .project-workspace-tools > .button-row { width: 100%; margin-left: 0; }
  .project-workspace-tools .field { flex: 1 1 160px; }
  .project-workspace-tools > select { flex: 1 1 160px; }
  .project-workspace .project-table-shell { max-height: 72vh; }
  .project-network-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-wallet-details { gap: 14px; padding: 14px; }
  .project-details-grid { grid-template-columns: minmax(0, 1fr); }
  .project-details-grid > section { padding: 12px; }
  .project-history .panel-head { align-items: flex-start; }
  .project-history > summary small { display: block; margin: 5px 0 0 16px; }
  .project-history > summary > span { display: block; margin: 6px 0 0 16px; }
  .project-history-body { padding: 14px; }
}
@container (max-width: 400px) {
  .project-workflow > * { grid-template-columns: 20px minmax(0, 1fr); gap: 5px 7px; padding: 11px 9px; }
  .project-workflow b { font-size: 13px; }
  .project-summary-item { padding: 12px; }
  .project-summary-item strong { font-size: 25px; }
  .project-workspace .bulk-selection-status { flex-basis: 100%; }
  .project-workspace .bulk-action-cluster { flex-basis: 100%; }
  .project-workspace .bulk-command { flex-basis: calc(50% - 7px); }
  .project-network-grid { grid-template-columns: minmax(0, 1fr); }
  .project-wallet-details .route-picker-line { grid-template-columns: minmax(0, 1fr); }
  .project-workspace-tools > .button-row > button { flex: 1 1 140px; }
}

.binance-target-list,
.binance-operation-list { margin-top: 18px; border: 1px solid var(--line); max-height: 280px; overflow: auto; }
.binance-target-list > div,
.binance-operation-list > div { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.binance-target-list > div:last-child,
.binance-operation-list > div:last-child { border-bottom: 0; }
.binance-target-list b,
.binance-target-list small,
.binance-target-list span,
.binance-operation-list small { display: block; overflow-wrap: anywhere; }
.binance-target-list small,
.binance-target-list span,
.binance-operation-list small { margin-top: 4px; color: var(--muted); font-size: 13px; }
.binance-operation-list > div { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.binance-operation-list > p { padding: 0 14px; }

/* Shared control scale: regular forms and ledger actions stay equally legible. */
button, select, input, textarea, summary, a { -webkit-tap-highlight-color: transparent; }
:is(button, select, input, textarea, summary, a):focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--acid); }
:is(.field, .project-workspace-tools) :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea),
.route-picker-line select, .bulk-route-command select { min-height: var(--control-height); height: auto; padding: 10px 12px; border-radius: var(--radius); font: 15px/1.5 var(--body); }
:is(.field, .project-workspace-tools) input[type="number"] { font-variant-numeric: tabular-nums; }
.field textarea { min-height: 110px; }
.form-grid { gap: 20px 24px; }
.form-actions { gap: 12px; margin-top: 24px; padding-top: 20px; }
.panel, .metric-card, .table-shell, .notice, .toast, .route-card { border-radius: var(--radius); }
.badge { border-radius: 4px; font: 500 12px/1.5 var(--body); padding: 3px 8px; }
.table-action, .route-run-button, .bulk-route-command button { min-height: var(--control-height); height: auto; font: 500 14px/1.4 var(--body); padding: 10px 14px; }
.copy-mini { min-width: 28px; min-height: 28px; }
.preview-row { font-size: 15px; }
.modal { width: min(840px, 100%); }
.modal-head { padding: 24px 28px; }
.modal-body { padding: 28px; }
.modal h2 { font-size: 30px; }
.notice p, .field-help { font-size: 13px; line-height: 1.65; }

/* Projects: compact context above a table, with prominent task controls. */
body.is-project-workspace .topbar { display: none; }
body.is-project-workspace .view { padding-top: 18px; }
.project-workspace-header { margin-bottom: 12px; align-items: center; gap: 12px 20px; min-height: 42px; }
.project-workspace-identity { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.project-workspace-header h2 { font: 750 26px/1.2 var(--display); letter-spacing: -.025em; margin: 0; }
.project-workspace-header #back-projects { display: grid; place-items: center; width: 34px; height: 34px; min-height: 34px; padding: 6px 10px 6px 0; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--muted); font-size: 13px; }
.project-header-actions { display: flex; align-items: center; gap: 8px; }
.project-header-actions > button, .project-header-actions .project-commandbar-more > summary { min-height: 38px; padding: 8px 12px; font-size: 13px; }
.project-workspace-summary { grid-template-columns: minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.15fr); gap: 10px; padding: 0; margin-bottom: 12px; }
.project-summary-item { display: grid; grid-template-columns: 22px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; align-content: start; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.project-summary-icon { grid-column: 1; grid-row: 1; display: grid; place-items: center; width: 22px; height: 22px; color: var(--acid); }
.project-summary-icon svg, .project-summary-icon img { display: block; width: 20px; height: 20px; }
.project-summary-icon img { width: 12px; height: 22px; object-fit: contain; }
.project-summary-item label { grid-column: 2; grid-row: 1; font: 500 13px/1.4 var(--body); letter-spacing: 0; }
.project-summary-item strong { grid-column: 1 / -1; grid-row: 2; justify-self: start; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; max-width: 100%; margin: 0; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); font: 700 23px/1.2 var(--body); letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.project-summary-item.project-points-summary > strong { background: var(--points-pill-bg); color: var(--points-pill-text); border-color: var(--points-pill-border); }
.project-summary-item.project-cost-summary > strong { background: var(--cost-pill-bg); color: var(--cost-pill-text); border-color: var(--cost-pill-border); }
.project-summary-item strong > small { font: 500 12px/1.2 var(--body); letter-spacing: 0; }
.project-summary-item > small { grid-column: 1 / -1; grid-row: 3; margin: 0; font: 400 11px/1.4 var(--body); }
.project-workspace-tools { margin: 0; gap: 12px; align-items: center; justify-content: flex-start; }
.project-workspace-tools .project-compact-filter { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; gap: 9px; }
.project-workspace-tools .project-compact-filter label { margin: 0; font-size: 12px; white-space: nowrap; }
.project-workspace-tools .project-compact-filter select { width: 245px; height: 40px; min-height: 40px; padding-block: 8px; font-size: 14px; }
.project-workspace-tools .project-compact-filter #project-farm-venue { width: 220px; }
.project-workspace-tools .button-row { align-items: center; margin-left: auto; }
.project-workspace-tools .button-row > button { min-height: 40px; padding: 8px 12px; font-size: 13px; }
.project-commandbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 8px 10px 8px 12px; margin-bottom: 12px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 2px 3px #282c2704; }
.project-commandbar-actions { display: grid; gap: 8px; flex: 1 1 100%; min-width: 0; }
.project-commandbar .bulk-selection-status { flex: 1; padding: 0; grid-template-columns: minmax(0,1fr) auto; }
.project-commandbar .bulk-selection-signal { display: none; }
.project-commandbar .bulk-selection-status b { font: 650 15px/1.5 var(--body); }
.project-commandbar .bulk-selection-status small { font: 13px/1.5 var(--body); }
.project-commandbar .bulk-clear { min-height: 40px; font: 13px var(--body); padding: 8px; }
.project-commandbar-main { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: stretch; gap: 8px; width: 100%; min-width: 0; }
.project-commandbar-trading { grid-template-columns: repeat(6, minmax(0, 1fr)); padding-top: 8px; border-top: 1px solid var(--line); }
.project-commandbar-trading > .project-commandbar-more > summary { min-height: 46px; height: 100%; justify-content: center; }
.project-commandbar-main .project-main-action { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 56px; padding: 8px 16px; border: 1px solid var(--acid); font: 700 16px/1.3 var(--body); background: var(--acid-soft); color: var(--acid); }
.project-commandbar-main .project-main-action > span { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; white-space: normal; }
.project-commandbar-main .project-main-action.is-balance { border-color: var(--line-strong); background: var(--panel); color: var(--text); }
.project-commandbar-main .project-main-action.is-balance.is-loading .project-action-icon { animation: spin 1s linear infinite; }
.project-commandbar-main .project-main-action.is-funding { background: var(--acid); color: var(--paper); }
.project-commandbar-main .project-main-action:not(:disabled):hover { background: #dce7d9; border-color: #284c3a; }
.project-commandbar-main .project-main-action.is-funding:not(:disabled):hover { background: #284c3a; }
.project-commandbar-main .project-main-action:disabled { opacity: 1; color: #83887d; background: var(--panel-2); border-color: var(--line); }
.project-commandbar-main button small { display: block; margin: 0; font: 500 12px/1.3 var(--body); opacity: .85; }
.project-action-icon { width: 20px; height: 20px; flex: 0 0 20px; }
.project-action-icon svg { display: block; width: 100%; height: 100%; }
.project-commandbar-more { position: relative; }
.project-commandbar-more > summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; min-height: var(--control-height); padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); font: 600 14px/1.4 var(--body); }
.project-commandbar-more > summary::-webkit-details-marker { display: none; }
.project-commandbar-more > summary::after { content: "⌄"; color: var(--muted); }
.project-commandbar-more[open] > summary { border-color: var(--line-strong); }
.project-commandbar-more > div { position: absolute; z-index: 9; top: calc(100% + 8px); right: 0; display: grid; gap: 8px; min-width: 280px; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 16px 44px #433b241a; }
.project-commandbar-more > div > button { text-align: left; }
.project-commandbar-more .bulk-route-command { padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.project-inline-workspace { border: 1px solid var(--line-strong); border-top: 3px solid var(--acid); border-radius: var(--radius); margin: 0 0 24px; background: var(--panel); scroll-margin-top: 20px; }
.project-inline-workspace[hidden] { display: none; }
.project-inline-workspace > header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 26px; border-bottom: 1px solid var(--line); }
.project-inline-workspace > header small { color: var(--muted); font-size: 12px; letter-spacing: .04em; }
.project-inline-workspace > header h3 { margin: 5px 0 0; font: 700 23px/1.2 var(--display); }
#project-operation-body { padding: 26px; }
#project-operation-body > form { max-width: 1120px; }
#project-operation-body > :is(#farm-batch-form, .standard-trading-form):has(.farm-tier-sidebar) { max-width: none; display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(300px, 1fr); column-gap: 24px; align-items: start; }
:is(#farm-batch-form, .standard-trading-form) > * { grid-column: 1; min-width: 0; }
:is(#farm-batch-form, .standard-trading-form) > .farm-launch-summary { grid-column: 1 / -1; }
/* Keep the controls in one column so tall tier panels cannot enlarge their rows. */
:is(#farm-batch-form, .standard-trading-form) > .farm-launch-main { display: flow-root; min-width: 0; }
:is(#farm-batch-form, .standard-trading-form) > .farm-tier-sidebar { grid-column: 2; grid-row: 2; margin-top: 0; }
#project-operation-body > #farm-cycle-form:has(.farm-tier-sidebar) { max-width: none; }
.farm-legacy-trading-layout:has(.farm-tier-sidebar) { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(300px, 1fr); gap: 24px; align-items: start; }
.farm-legacy-trading-layout > * { min-width: 0; }
.farm-tier-sidebar { display: grid; gap: 16px; }
@media (max-width: 1250px) {
  #project-operation-body > :is(#farm-batch-form, .standard-trading-form):has(.farm-tier-sidebar), .farm-legacy-trading-layout:has(.farm-tier-sidebar) { display: block; }
  .farm-tier-sidebar { margin-top: 16px; }
  :is(#farm-batch-form, .standard-trading-form) > .farm-tier-sidebar { margin-top: 16px; }
}
#project-operation-body .form-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
#project-operation-body .form-grid > .full { grid-column: 1 / -1; }
#project-operation-body .form-grid > .field:has(textarea) { grid-column: 1 / -1; }
#project-operation-body p { max-width: 1000px; }
:is(#farm-batch-form, .standard-trading-form) .farm-a11y-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:is(#farm-batch-form, .standard-trading-form) .farm-launch-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; margin-bottom: 18px; font-size: 13px; }
:is(#farm-batch-form, .standard-trading-form) .farm-launch-summary strong { font-weight: 600; }
:is(#farm-batch-form, .standard-trading-form) .farm-launch-summary > span { color: var(--muted); }
:is(#farm-batch-form, .standard-trading-form, .rh-scenario-editor) .farm-launch-toolbar { display: grid; gap: 12px; margin-bottom: 16px; }
:is(#farm-batch-form, .standard-trading-form, .rh-scenario-editor) .farm-market-selection { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
:is(#farm-batch-form, .standard-trading-form, .rh-scenario-editor) .farm-market-selection legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
:is(#farm-batch-form, .standard-trading-form, .rh-scenario-editor) .farm-market-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
:is(#farm-batch-form, .standard-trading-form, .rh-scenario-editor) .farm-market-category-label { margin: 12px 0 7px; font-size: 12px; color: var(--muted); }
:is(#farm-batch-form, .standard-trading-form, .rh-scenario-editor) .farm-market-selected-label { margin: 12px 0 7px; font-size: 12px; color: var(--muted); }
:is(#farm-batch-form, .standard-trading-form, .rh-scenario-editor) .farm-market-selected-section { margin-bottom: 16px; }
:is(#farm-batch-form, .standard-trading-form, .rh-scenario-editor) .farm-market-selected-section .farm-market-selected-label { margin-top: 0; line-height: 18px; }
:is(#farm-batch-form, .standard-trading-form) > .farm-reference-bar,
:is(#farm-batch-form, .standard-trading-form) > .farm-launch-main > .farm-reference-bar { margin-bottom: 16px; }
:is(#farm-batch-form, .standard-trading-form, .rh-scenario-editor) .farm-market-selection-row { display: flex; align-items: stretch; gap: 8px; }
:is(#farm-batch-form, .standard-trading-form, .rh-scenario-editor) .farm-market-selected { flex: 1; min-height: 44px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
:is(#farm-batch-form, .standard-trading-form, .rh-scenario-editor) .farm-market-chip { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 32px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); color: var(--muted); font: 500 12px/1.5 var(--body); cursor: pointer; }
:is(#farm-batch-form, .standard-trading-form, .rh-scenario-editor) .farm-market-chip.is-selected { background: var(--acid-soft); color: var(--acid); border-color: #cfdcc9; }
:is(#farm-batch-form, .standard-trading-form, .rh-scenario-editor) .farm-market-chip[hidden] { display: none; }
:is(#farm-batch-form, .standard-trading-form, .rh-scenario-editor) .farm-market-chip span { color: inherit; opacity: .7; font-size: 14px; line-height: 1; }
:is(#farm-batch-form, .standard-trading-form, .rh-scenario-editor) .farm-market-chip:disabled { opacity: .5; cursor: default; }
:is(#farm-batch-form, .standard-trading-form, .rh-scenario-editor) .farm-market-chip:focus-visible { outline: 2px solid var(--acid); outline-offset: 2px; }
:is(#farm-batch-form, .standard-trading-form) [data-farm-market-selection], :is(#farm-batch-form, .standard-trading-form) [data-farm-margin-status] { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.5; }
:is(#farm-batch-form, .standard-trading-form) .farm-reference-bar { margin: 0; gap: 16px; }
:is(#farm-batch-form, .standard-trading-form) .farm-market-groups, :is(#farm-batch-form, .standard-trading-form) .farm-setting-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
:is(#farm-batch-form, .standard-trading-form) .farm-setting-groups { margin-top: 14px; }
:is(#farm-batch-form, .standard-trading-form) .farm-setting-group { min-inline-size: 0; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
:is(#farm-batch-form, .standard-trading-form) .farm-group-heading { min-height: 27px; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
:is(#farm-batch-form, .standard-trading-form) .farm-group-heading strong { font-size: 14px; font-weight: 600; }
:is(#farm-batch-form, .standard-trading-form) .farm-group-heading > span { color: var(--muted); font-size: 12px; }
:is(#farm-batch-form, .standard-trading-form) .farm-market-ticker { padding: 3px 9px; background: var(--acid-soft); color: var(--acid); border-radius: 4px; line-height: 1.5; }
:is(#farm-batch-form, .standard-trading-form) .farm-paired-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
:is(#farm-batch-form, .standard-trading-form) .field { min-width: 0; gap: 5px; }
:is(#farm-batch-form, .standard-trading-form) .field label { font-size: 12px; white-space: nowrap; }
:is(#farm-batch-form, .standard-trading-form) .field input, :is(#farm-batch-form, .standard-trading-form) .field select { min-width: 0; min-height: 42px; height: 42px; padding: 8px 10px; font-size: 13px; }
:is(#farm-batch-form, .standard-trading-form) .farm-balance-tooltip { left: auto; right: 0; }
:is(#farm-batch-form, .standard-trading-form) .farm-balance-help::before { left: auto; right: 0; }
:is(#farm-batch-form, .standard-trading-form) .farm-launch-note { margin: 12px 0 6px; color: var(--muted); font-size: 12px; }
:is(#farm-batch-form, .standard-trading-form) .farm-launch-help { margin: 0; font-size: 12px; }
:is(#farm-batch-form, .standard-trading-form) .farm-launch-help > summary { cursor: pointer; color: var(--muted); width: fit-content; padding: 4px 0; }
:is(#farm-batch-form, .standard-trading-form) .farm-launch-help p { margin: 8px 0; font-size: 12px; }
:is(#farm-batch-form, .standard-trading-form) .form-actions { margin-top: 12px; padding-top: 14px; }
@media (max-width: 1000px) {
  :is(#farm-batch-form, .standard-trading-form) .farm-market-groups, :is(#farm-batch-form, .standard-trading-form) .farm-setting-groups { grid-template-columns: 1fr; }
  :is(#farm-batch-form, .standard-trading-form) .farm-launch-toolbar { align-items: stretch; flex-direction: column; gap: 12px; }
  :is(#farm-batch-form, .standard-trading-form) .farm-market-select { flex-basis: auto; max-width: 350px; }
  :is(#farm-batch-form, .standard-trading-form) .farm-reference-bar { margin-bottom: 0; }
}
.project-table-caption { font-size: 13px; margin: 18px 0 12px; }
.project-workspace .project-table-shell { max-height: 78vh; border-radius: var(--radius); scroll-padding-left: 278px; }
.project-unified-table { --project-metric-top-inset: 22px; min-width: 1840px; table-layout: fixed; }
.project-unified-table th { padding: 12px 18px; background: var(--panel-2); font: 700 13px/1.5 var(--body); }
.project-unified-table td { padding: 14px 18px; font-size: 15px; }
.project-unified-table :is(th, td):first-child:not([colspan]) { width: 48px; min-width: 48px; }
/* Fixed context columns keep network amounts on one line in Safari. Five metric
   columns share the remaining width; positions do not absorb it on their own. */
.project-unified-table :is(th, td):nth-child(2):not([colspan]) { width: 230px; }
.project-unified-table :is(th, td):nth-child(3):not([colspan]) { width: 330px; }
.project-unified-table :is(th, td):nth-child(n + 4):not([colspan]) { width: auto; }
.project-unified-table :is(th, td):nth-child(8):not([colspan]) { width: 240px; }
.project-column-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; white-space: nowrap; }
.project-column-label .project-summary-icon { width: 17px; height: 17px; flex: 0 0 17px; }
.project-column-label .project-summary-icon svg { width: 17px; height: 17px; }
.project-unified-table > thead > tr > th:nth-child(n + 2):nth-child(-n + 8),
.project-unified-table > tbody > .wallet-data-row > td:nth-child(n + 2):nth-child(-n + 8) { border-right: 1px solid var(--line-strong); }
.project-unified-table > thead > tr > th:nth-child(2),
.project-unified-table > tbody > .wallet-data-row > .project-wallet-cell { left: 48px; box-shadow: none; }
.project-unified-table > thead > tr > th:first-child,
.project-unified-table > thead > tr > th:nth-child(2) { background: var(--panel-2); }
.project-wallet-heading-line { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.project-wallet-heading-line > strong { flex: 0 0 auto; font: 700 16px/1.5 var(--body); font-variant-numeric: tabular-nums; color: var(--text); }
.project-wallet-heading-line > .compact-address { min-width: 0; padding-left: 9px; border-left: 1px solid var(--line-strong); }
.project-workspace .project-wallet-cell .subline { font: 13px/1.55 var(--body); }
.project-workspace .project-wallet-cell .compact-address { margin-top: 0; font-size: 13px; }
.project-funds-cell > div > strong, .project-dex-cell > strong { font: 650 16px/1.5 var(--body); font-variant-numeric: tabular-nums; }
.project-funds-cell > div > span { font-size: 13px; }
.project-funds-cell > div > small { font: 500 12px/1.5 var(--body); color: var(--muted); }
.project-funds-cell > div + div { border: 0; padding-top: 4px; }
.project-dex-cell .subline { font: 13px/1.65 var(--body); margin-top: 8px; }
.project-funds-cell > .project-balance-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
.project-network-balance { min-width: 0; padding: 8px 8px; }
.project-network-balance:nth-child(2n) { border-left: 1px solid var(--line); }
.project-network-balance:nth-child(n + 3) { border-top: 1px solid var(--line); }
.project-network-balance h4 { margin: 0 0 8px; font: 700 13px/1.4 var(--body); color: var(--text); }
.project-network-balance .balance-cell { min-width: 0; min-height: 0; padding: 0; background: none; border: 0; }
.project-network-balance .balance-value { display: grid; gap: 3px; }
.project-network-balance .balance-asset { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; min-width: 0; font: 500 13px/1.4 var(--body); }
.project-network-balance .balance-symbol { flex: 0 0 auto; font: inherit; color: var(--muted); }
.project-network-balance .balance-amount { min-width: 0; flex-shrink: 0; font: inherit; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow-wrap: normal; color: var(--text); text-align: right; }
.project-network-balance .balance-asset.error .balance-amount { color: var(--danger); }
/* Both views keep the same network tiles; expansion adds the remaining assets. */
.project-funds-cell > .project-funds-layout-tiles { gap: 6px; }
.project-funds-layout-tiles > .project-network-balance { padding: 5px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel-2); }
.project-funds-layout-tiles:not(.project-gas-grid) h4 { margin: 0 0 5px; color: var(--muted); font: 500 11px/18px var(--body); }
.project-funds-layout-tiles:not(.project-gas-grid) .balance-asset { line-height: 18px; }
.project-funds-layout-tiles:not(.project-gas-grid) .balance-symbol { font-size: 10px; }
.project-funds-layout-tiles.project-gas-grid > .project-network-balance { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 5px; }
.project-funds-layout-tiles.project-gas-grid h4 { margin: 0; color: var(--muted); font: 500 11px/18px var(--body); }
.project-funds-layout-tiles.project-gas-grid .balance-asset { flex-direction: row-reverse; justify-content: flex-start; gap: 3px; line-height: 18px; }
.project-funds-layout-tiles.project-gas-grid .balance-symbol { font-size: 10px; }
.project-funds-layout-tiles.project-gas-grid .balance-amount { text-align: left; }
.project-funds-layout-tiles.project-gas-grid [data-balance-network="bsc"] .balance-symbol { display: none; }
.project-funds-toggle { display: flex; align-items: center; justify-content: center; gap: 5px; width: 100%; min-height: 25px; margin: 6px auto 0; padding: 3px 8px; border: solid var(--line); border-width: 1px 0 0; border-radius: 0; background: transparent; color: var(--acid); font: 500 12px/1.4 var(--body); }
.project-funds-toggle svg { width: 13px; height: 13px; }
.project-funds-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.project-funds-toggle:hover { background: var(--acid-soft); border-color: var(--line-strong); }
.project-funds-toggle:focus-visible { outline: 2px solid var(--acid); outline-offset: 2px; }
.project-proxy { display: flex; align-items: center; gap: 5px; margin-top: 8px; font: 11px/20px var(--body); color: var(--muted); white-space: nowrap; }
.project-proxy svg { width: 14px; height: 14px; flex: 0 0 14px; color: var(--acid); }
.project-proxy b { min-width: 0; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.project-proxy em { font-style: normal; font-size: 10px; }
.project-volume { margin-top: 0; }
.project-volume > span { display: block; font: 12px/1.5 var(--body); color: var(--muted); }
.project-volume > span > small { font: inherit; }
.project-volume > strong { display: block; margin-top: 2px; font: 650 16px/1.4 var(--body); font-variant-numeric: tabular-nums; }
.project-volume > strong > small { font: 500 12px/1.4 var(--body); }
.project-volume .project-metric-warning { display: block; color: var(--danger); font: 12px/1.4 var(--body); }
.project-volume > small, .project-points-cell > small { display: block; margin-top: 5px; color: var(--muted); font: 12px/1.4 var(--body); }
.project-points-cell > strong { display: block; color: var(--text); font: 650 16px/1.4 var(--body); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.project-points-cell > .project-metric-warning { color: var(--danger); }
.project-unified-table .subline.project-metric-warning { color: var(--danger); }
.project-period-controls, .project-period-dates, .project-period-dates > label { display: flex; align-items: center; gap: 8px; }
.project-period-controls { flex-wrap: wrap; }
.project-workspace-tools .project-compact-filter #project-period-filter { width: 176px; }
.project-period-dates[hidden] { display: none; }
.project-period-dates > label > span, .project-period-dates > small { color: var(--muted); font-size: 12px; }
.project-workspace-tools .project-period-dates input[type="date"] { width: 140px; min-height: 40px; height: 40px; padding: 7px 9px; font: 13px var(--body); color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.project-workspace-tools .project-period-dates input[type="date"]:focus { border-color: var(--acid); box-shadow: 0 0 0 2px var(--acid-soft); }
.project-economics-summary { display: contents; }
.project-economics-summary .project-metric-warning { color: var(--danger); }
.project-capital-summary { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 3px 16px; margin-top: 5px; color: var(--muted); font-size: 11px; }
.project-capital-summary b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.project-capital-summary > small { flex-basis: 100%; font-size: 11px; }
.project-capital-ledger { margin-block: 16px; }
.project-cost-cell > strong { display: block; font: 650 16px/1.5 var(--body); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.project-cost-cell > small { display: block; color: var(--muted); font-size: 11px; }
.project-cost-status { display: block; margin-top: 8px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.project-cost-status.is-partial { color: var(--blue); }
.project-cost-cell .project-cost-toggle { display: block; min-height: 32px; margin: 7px 0 0; padding: 5px 0; border: 0; background: transparent; font: 500 12px/1.4 var(--body); color: var(--acid); text-decoration: underline; text-underline-offset: 3px; }
/* Every balance and metric starts at the same inset, independent of its notes or expanded content. */
.project-unified-table > tbody > .wallet-data-row > :is(.project-funds-cell, .project-dex-cell, .project-volume-cell, .project-points-cell, .project-cost-cell, .project-point-cost-cell, .project-positions-cell) { padding-top: var(--project-metric-top-inset); vertical-align: top; }
.project-wallet-cell .project-account-badge { display: flex; align-items: center; gap: 4px; width: fit-content; max-width: 100%; min-height: 22px; margin: 7px 0; padding: 2px 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); color: var(--muted); font: 500 10px/16px var(--body); }
.project-account-badges { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin: 7px 0; }
.project-wallet-cell .project-account-badges .project-account-badge { margin: 0; }
.project-account-badge svg { width: 12px; height: 12px; flex: 0 0 12px; }
.project-account-badge > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-dex-cell > strong, .project-volume > strong, .project-points-cell > strong, .project-cost-cell > strong, .project-point-cost-cell > strong { display: flex; align-items: baseline; gap: 4px; width: fit-content; max-width: 100%; min-height: 34px; margin: 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); color: var(--text); font: 650 16px/20px var(--body); font-variant-numeric: tabular-nums; white-space: nowrap; }
.project-points-cell > strong { background: var(--points-pill-bg); color: var(--points-pill-text); border-color: var(--points-pill-border); }
.project-cost-cell > strong { background: var(--cost-pill-bg); color: var(--cost-pill-text); border-color: var(--cost-pill-border); }
.project-dex-cell > strong > small, .project-volume > strong > small, .project-cost-cell > strong > small, .project-point-cost-cell > strong > small { font: 500 10px/20px var(--body); white-space: nowrap; }
.project-dex-cell .subline, .project-volume > small, .project-points-cell > small, .project-cost-status { margin-top: 6px; font: 400 11px/1.4 var(--body); }
.project-cost-cell > small { margin-top: 4px; }
.project-positions-list { display: grid; gap: 6px; }
.project-position-card { min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.project-position-card[data-project-position-open] { display: block; width: 100%; text-align: left; cursor: pointer; color: var(--text); font: inherit; }
.project-position-card[data-project-position-open]:hover { background: var(--panel-2); border-color: var(--acid); }
.project-position-card[data-project-position-open]:focus-visible { outline: 2px solid var(--acid); outline-offset: 2px; }
.project-position-card .project-position-size { display: block; }
.project-position-card.is-long { border-color: #cfdcc9; }
.project-position-card.is-short { border-color: #e5c8c4; }
.project-position-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 6px; }
.project-position-heading > strong { min-width: 0; color: var(--text); font: 600 12px/1.4 var(--body); overflow-wrap: anywhere; }
.project-position-side { padding: 2px 5px; border-radius: 4px; background: var(--panel-2); color: var(--muted); font: 650 10px/1.4 var(--body); }
.project-position-card.is-long .project-position-side { background: var(--acid-soft); color: var(--acid); }
.project-position-card.is-short .project-position-side { background: #f7e7e4; color: var(--danger); }
.project-position-size { margin-top: 6px; color: var(--text); font: 650 14px/1.4 var(--body); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.project-position-size > small { color: var(--muted); font: 500 10px/1.4 var(--body); white-space: nowrap; }
.project-position-empty { display: block; width: fit-content; max-width: 100%; padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); color: var(--muted); font: 500 12px/18px var(--body); }
.project-position-empty.is-unknown { background: var(--panel); }
.project-unified-table .project-metric-caption { display: flex; align-items: center; gap: 5px; max-width: 100%; margin-top: 6px; color: var(--muted); font: 400 11px/16px var(--body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-metric-caption svg { width: 12px; height: 12px; flex: 0 0 12px; }
.project-metric-caption time { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.project-unified-table .project-metric-caption.is-stale { color: var(--blue); }
.project-cost-journal { padding: 24px; border-bottom: 1px solid var(--line); background: var(--panel); white-space: normal; }
.project-cost-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 18px; margin-bottom: 18px; }
.project-cost-heading h4, .project-cost-journal > h4 { margin: 0; font: 600 18px/1.4 var(--body); }
.project-cost-heading > span { color: var(--muted); font-size: 12px; }
.project-cost-breakdown { display: flex; flex-wrap: wrap; gap: 20px 36px; }
.project-cost-breakdown > div { display: grid; gap: 4px; min-width: 180px; }
.project-cost-breakdown > div > span { color: var(--muted); font-size: 13px; }
.project-cost-breakdown strong { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.project-cost-breakdown small { color: var(--muted); font-size: 12px; font-weight: 400; }
.project-cost-basis { margin: 14px 0; max-width: 1100px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.project-cost-metrics { display: flex; flex-wrap: wrap; gap: 8px 24px; padding-block: 12px; border-block: 1px solid var(--line); font-size: 13px; }
.project-cost-metrics b { font-weight: 600; font-variant-numeric: tabular-nums; }
.project-cost-warning, .project-cost-issues { color: var(--blue); font-size: 12px; line-height: 1.6; }
.project-cost-issues { padding-left: 18px; }
.project-cost-ledger > summary { width: fit-content; cursor: pointer; font-size: 13px; font-weight: 600; padding: 6px 0; }
.project-cost-ledger > summary > span { color: var(--muted); font-weight: 400; margin-left: 8px; }
.project-cost-ledger-scroll { max-height: 320px; overflow: auto; margin-top: 10px; border: 1px solid var(--line); border-radius: var(--radius); }
.project-cost-ledger table { width: 100%; min-width: 700px; border-collapse: collapse; table-layout: auto; }
.project-unified-table .project-cost-ledger :is(th, td):nth-child(n):not([colspan]) { position: static; width: auto; min-width: 0; padding: 10px 12px; font-size: 12px; box-shadow: none; border-bottom: 1px solid var(--line); white-space: normal; }
.project-unified-table .project-cost-ledger th { font-weight: 600; }
.project-cost-ledger td small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
@media (max-width: 900px) {
  .project-capital-summary { justify-content: flex-start; }
  .project-period-dates { flex-wrap: wrap; }
}
.project-wallet-actions { display: flex; }
.project-wallet-actions .table-action { font: 500 14px/1.4 var(--body); min-height: var(--control-height); padding: 10px 12px; }
.project-activity-cell > small, [data-project-activity-content] > small { display: block; margin-top: 7px; font-size: 12px; color: var(--muted); }
.project-activity-cell > span, [data-project-activity-content] > span { display: block; margin-top: 5px; }
.project-activity { padding: 2px 0; }
.project-activity > strong { display: flex; align-items: center; gap: 9px; font: 600 15px/1.5 var(--body); color: var(--blue); }
.project-activity-amount { display: block; margin-top: 7px; font: 500 14px/1.5 var(--mono); }
.project-activity > small { display: block; margin-top: 5px; font: 13px/1.55 var(--body); color: var(--muted); overflow-wrap: anywhere; }
.project-activity .table-action, .project-activity-cell > .table-action { min-height: 36px; margin-top: 9px; padding: 6px 10px; font-size: 13px; background: transparent; }
.project-activity-pulse { width: 14px; height: 14px; flex: 0 0 14px; border: 2px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: spin 1s linear infinite; }
.project-activity-progress { height: 5px; border-radius: 5px; background: var(--line); overflow: hidden; margin: 12px 0 8px; }
.project-activity-progress > i { display: block; height: 100%; background: var(--blue); transition: width .6s; }
.project-activity.is-complete > strong { color: var(--acid); }
.project-activity.is-complete .project-activity-progress > i { background: var(--acid); }
.project-activity.is-error > strong, .project-activity-connection.error { color: var(--danger); }
.project-journal { padding: 24px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.project-journal h4 { margin: 0 0 14px; font: 500 22px/1.3 var(--display); }
.project-funding-child-journals { margin-top: 24px; }
.project-funding-child { border-top: 1px solid var(--line); }
.project-funding-child > summary { padding: 16px 0; cursor: pointer; font-size: 15px; font-weight: 600; }
.project-funding-child .project-journal { margin-bottom: 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.project-history-inline summary { cursor: pointer; padding: 14px 0; font-size: 14px; }
.project-history-inline summary small { margin-left: 14px; color: var(--muted); font-size: 12px; }
.project-history-inline details + details, details.project-history-inline + details.project-history-inline { border-top: 1px solid var(--line); }
.project-history-inline details[open], details.project-history-inline[open] { padding-bottom: 18px; }
.project-details-grid :is(h4, p) { font-size: 14px; }
.project-wallet-details { padding: 24px; }
.project-inline-workspace .farm-cycle-live { margin: 0 0 24px; }
.farm-cycle-live-heading { font-size: 18px; }
.farm-cycle-result-message { font-size: 15px; }
.farm-cycle-leg > strong, .farm-cycle-leg > span, .farm-cycle-market { font-size: 14px; }
.farm-cycle-leg dt, .farm-cycle-leg dd, .farm-cycle-connection { font-size: 13px; }
@media (max-width: 1280px) {
  .masthead { gap: 18px; }
  .brand small { display: none; }
  .nav-item { padding-inline: 9px; }
  .project-commandbar { flex-wrap: wrap; gap: 14px; }
  .project-commandbar-main { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .project-commandbar .bulk-selection-status { flex: 1 1 210px; }
  #project-operation-body .form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 820px) {
  .project-commandbar-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-commandbar-main .project-main-action { justify-content: flex-start; }
  .project-commandbar-main .project-main-action > span { white-space: normal; }
  .project-inline-workspace > header, #project-operation-body { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
/* Selection text remains aligned with the primary commands. */
.project-selection { display: flex; align-items: center; flex: 0 0 auto; gap: 5px; }
.project-selection > div { display: grid; gap: 1px; white-space: nowrap; }
.project-selection b { font-size: 13px; font-weight: 600; line-height: 1.2; }
.project-selection small { font-size: 10px; line-height: 1.2; color: var(--muted); }
.project-selection > button { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; min-height: 28px; background: transparent; border-color: transparent; padding: 4px; color: var(--muted); }
.project-selection > button .project-action-icon { width: 15px; height: 15px; }
.operation-preview { gap: 12px; padding: 20px; border-radius: var(--radius); }
.preview-row { grid-template-columns: minmax(180px, 270px) minmax(0, 1fr); gap: 20px; align-items: baseline; font-size: 15px; line-height: 1.55; }
.preview-row span:last-child { word-break: normal; overflow-wrap: anywhere; }
#project-operation-body .operation-preview { max-width: 1120px; }
#project-operation-body > h3 { margin: 24px 0 12px; font: 500 23px/1.3 var(--display); }
#project-operation-body > .muted { font-size: 14px; }
#project-operation-body > .form-actions { justify-content: flex-start; }

/* Native Safari selects use the same box as other controls. */
select:not([multiple]), .field select:not([multiple]), .project-workspace-tools select:not([multiple]), .route-picker-line select:not([multiple]), .bulk-route-command select:not([multiple]), .pair-column select:not([multiple]) { -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23656b61' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px !important; }
:is(.field, .route-picker-line, .bulk-route-command) select:not([multiple]) { height: var(--control-height); }
.project-workspace-tools .project-compact-filter select:not([multiple]) { height: 40px; min-height: 40px; }
.project-workspace > .project-table-caption { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.project-wallet-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: relative; }
#project-wallet-search-toggle { display: grid; place-items: center; width: 30px; height: 30px; padding: 5px; border: 1px solid transparent; border-radius: 5px; color: var(--muted); background: transparent; cursor: pointer; }
#project-wallet-search-toggle svg { width: 18px; height: 18px; }
#project-wallet-search-toggle:hover, #project-wallet-search-toggle[aria-expanded="true"] { color: var(--acid); background: var(--acid-soft); border-color: var(--line); }
#project-wallet-search-toggle.has-query { color: var(--paper); background: var(--acid); }
#project-wallet-search-panel { position: absolute; top: calc(100% + 12px); left: -6px; z-index: 12; width: 310px; padding: 14px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 8px 24px #282c271c; font: 14px/1.4 var(--body); letter-spacing: 0; }
#project-wallet-search-panel label { display: block; margin-bottom: 8px; color: var(--text); font-weight: 600; }
#project-wallet-search { display: block; width: 100%; height: 42px; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--panel); color: var(--text); font: 15px/1.4 var(--body); }
#project-wallet-search-panel .project-wallet-search-field { display: flex; align-items: center; gap: 6px; }
#project-wallet-search-panel .project-wallet-search-field input { min-width: 0; flex: 1; }
#project-wallet-search-panel #project-wallet-search-close { display: grid; place-items: center; width: 34px; height: 42px; flex: 0 0 34px; padding: 6px; border-color: transparent; background: transparent; color: var(--muted); }
#project-wallet-search-panel #project-wallet-search-clear { margin-top: 10px; background: transparent; }
#project-wallet-search-panel button { min-height: 34px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 4px; color: var(--text); background: var(--panel); font: 600 13px/1.3 var(--body); cursor: pointer; }
.project-unified-table thead th:nth-child(2):has(#project-wallet-search-panel:not([hidden])) { z-index: 8; }
.project-table-shell:has(#project-wallet-search-panel:not([hidden])) { min-height: 240px; }
.project-workspace .inline-empty { font: 14px/1.5 var(--body); }
@media (max-width: 1280px) {
  .project-workspace-identity { gap: 10px; }
  .project-workspace-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .project-summary-item strong { font-size: 21px; }
  .project-workspace-tools .project-compact-filter label { display: none; }
  .project-commandbar { gap: 10px; }
  .project-commandbar-main .project-main-action { padding-inline: 14px; }
}
@media (max-width: 900px) {
  .project-workspace-summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .project-workspace-tools .button-row { width: auto; }
  .project-workspace-tools .project-compact-filter { flex: 0 1 auto; }
}
@media (max-width: 520px) {
  .project-workspace-summary { grid-template-columns: minmax(0, 1fr); }
}

/* Project filters and wallet actions share one compact toolbar. */
.project-commandbar .project-workspace-tools { flex: 0 1 auto; max-width: 100%; }
.project-commandbar .project-compact-filter { gap: 6px; }
.project-commandbar .project-compact-filter label { font-size: 11px; }
.project-commandbar .project-compact-filter select:not([multiple]) { width: 180px; height: 40px; min-height: 40px; padding-block: 0; padding-left: 10px; font: 13px/38px var(--body); }
.project-commandbar .project-compact-filter #project-group-filter { width: auto; max-width: min(420px, 75vw); }
.project-commandbar .project-compact-filter #project-farm-venue { width: 180px; }
.project-commandbar .project-compact-filter #project-period-filter { width: 120px; }
.project-commandbar .project-commandbar-main { gap: 6px; }
.project-commandbar .project-main-action { min-height: 46px; padding: 6px 11px; gap: 7px; font-size: 14px; }
.project-commandbar .project-main-action small { font-size: 11px; }
.project-commandbar-actions > .project-commandbar-more > summary { min-height: 40px; padding: 8px 10px; font-size: 13px; }

/* Named selections sit beside More; they never change exchange bindings. */
.project-commandbar-trading > .project-commandbar-more { grid-column: 1; }
.project-wallet-presets { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; padding: 2px 4px 2px 8px; }
.project-wallet-presets-label { flex: 0 0 auto; margin-right: 3px; color: var(--muted); font: 500 11px/1.4 var(--body); }
.project-wallet-preset { position: relative; display: inline-flex; max-width: 230px; min-width: 0; border: 2px dashed var(--line-strong); border-radius: 7px; background: var(--panel); }
.project-wallet-preset.is-active { border-color: var(--acid); background: var(--acid-soft); }
.project-wallet-preset-select { display: flex; align-items: center; gap: 7px; max-width: 100%; min-width: 0; min-height: 34px; padding: 6px 25px 6px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--text); font: 600 12px/1.4 var(--body); text-align: left; }
.project-wallet-preset-select > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-wallet-presets .project-wallet-preset-select small { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 4px; background: var(--acid); color: var(--paper); font: 600 10px/1 var(--body); font-variant-numeric: tabular-nums; opacity: 1; }
.project-wallet-preset-select:hover { background: var(--panel-2); }
.project-wallet-preset.is-active .project-wallet-preset-select { color: var(--acid); }
.project-wallet-preset-delete { position: absolute; top: 2px; right: 2px; display: grid; place-items: center; width: 20px; min-width: 20px; height: 20px; min-height: 20px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font: 500 16px/1 var(--body); }
.project-wallet-preset-delete:hover { color: var(--danger); background: var(--panel-2); }
.project-wallet-preset-add { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; min-height: 34px; padding: 0; border: 1px dashed var(--line-strong); border-radius: 7px; background: var(--panel); color: var(--acid); }
.project-wallet-preset-add > svg { display: block; width: 18px; height: 18px; }
.project-wallet-preset-add:hover { border-color: var(--acid); background: var(--acid-soft); }
.project-wallet-preset-add[hidden] { display: none; }
.project-wallet-presets button:focus-visible { outline: 2px solid var(--acid); outline-offset: 2px; }
.project-wallet-presets-note { color: var(--muted); font: 400 11px/1.4 var(--body); }
.project-wallet-presets-note.is-error { color: var(--danger); }
@media (max-width: 900px) {
  .project-wallet-presets { grid-column: 1 / -1; padding-left: 0; }
}

/* M4: one compact comparison, aligned amounts and grouped source settings. */
.exit-panel { max-width: 1160px; margin: 0 auto; font-size: 14px; }
.exit-sourcebar, .exit-calculation, .exit-footer, .exit-run-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.exit-settings-card { border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; background: var(--panel-2); }
.exit-sourcebar { align-items: flex-start; padding-bottom: 15px; margin-bottom: 15px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.exit-sourcebar b { color: var(--text); }
.exit-source-balances { position: relative; }
.exit-balance-trigger { display: inline-flex; align-items: center; gap: 5px; padding: 3px 0; border: 0; border-bottom: 1px dotted currentColor; background: transparent; color: var(--acid); font-size: 12px; cursor: pointer; }
.exit-balance-trigger:focus-visible { outline: 2px solid var(--acid); outline-offset: 3px; }
.exit-balance-popover { position: absolute; top: calc(100% + 8px); left: 0; z-index: 15; width: 320px; max-width: calc(100vw - 64px); padding: 14px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--panel); box-shadow: 0 8px 25px #282c271a; color: var(--text); }
.exit-balance-popover::before { content: ""; position: absolute; left: 0; right: 0; top: -9px; height: 9px; }
.exit-balance-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.exit-balance-heading strong { font-size: 13px; }
.exit-balance-heading .table-action { min-height: 24px; padding: 0; border: 0; background: transparent; color: var(--acid); font-size: 11px; }
.exit-balance-popover p { margin: 7px 0 10px; color: var(--muted); font-size: 11px; line-height: 1.45; }
#exit-balances-list { max-height: min(330px,45vh); overflow-y: auto; }
.exit-balance-row { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 12px; }
.exit-balance-row > span:last-child { text-align: right; }
.exit-balance-row b { font-variant-numeric: tabular-nums; font-weight: 600; }
.exit-balance-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
#exit-balances-status:not(:empty) { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; }
.exit-source-identity { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; min-width: 0; }
.exit-wallet-selection { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 5px 10px; }
.exit-sourcebar > .table-action { flex: 0 0 auto; max-width: 100%; min-height: 26px; padding: 2px 0; border: 0; background: transparent; color: var(--muted); font-size: 12px; white-space: normal; text-align: left; }
.exit-sourcebar > .table-action:hover { color: var(--text); text-decoration: underline; }
.exit-inputs { display: grid; grid-template-columns: minmax(210px,1fr) minmax(230px,1fr); gap: 18px; align-items: start; }
.exit-inputs.is-batch { grid-template-columns: minmax(210px,1.05fr) minmax(230px,1fr) minmax(230px,1fr); }
.exit-inputs > .field { min-width: 0; gap: 8px; }
.exit-inputs > .field > label, .exit-range legend, .exit-all-note > span { display: block; font: 500 12px/18px var(--body); color: var(--muted); }
.exit-inputs input, .exit-inputs select, .exit-limits input { min-height: 40px; height: 40px; padding: 8px 11px; font-size: 14px; }
.exit-inputs .field select:not([multiple]) { min-height: 40px; height: 40px; }
.exit-inputs input, .exit-inputs select { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background-color: var(--panel); color: var(--text); }
.exit-inputs input:focus, .exit-inputs select:focus { border-color: var(--acid); box-shadow: 0 0 0 2px var(--acid-soft); }
.exit-settings-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-top: 14px; }
.exit-settings-footer > button { flex: 0 0 auto; min-width: 190px; min-height: 40px; padding: 8px 14px; }
.exit-form-notes { display: grid; gap: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.exit-retry-note summary { width: fit-content; cursor: pointer; }
.exit-retry-note p { max-width: 640px; margin: 5px 0 0; }
.exit-sample-note { padding: 10px 0 0; margin: 12px 0 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.5; }
.exit-sample-note b { color: var(--text); }
.exit-range { display: block; min-width: 0; padding: 0; margin: 0; border: 0; }
.exit-range legend { width: 100%; padding: 0; margin-bottom: 8px; }
.exit-range-controls { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.exit-range-controls label { position: relative; min-width: 0; }
.exit-range-controls label > span { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 11px; pointer-events: none; }
.exit-range-controls input { margin: 0; padding-left: 34px; }
.exit-all-note p { display: flex; align-items: center; min-height: 40px; margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.exit-empty { border: 1px dashed var(--line); padding: 24px; margin-top: 22px; color: var(--muted); border-radius: 8px; text-align: center; }
.exit-calculation { justify-content: flex-start; gap: 30px; padding: 15px 0; margin-top: 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.exit-calculation b { margin-left: 6px; color: var(--text); font-weight: 600; }
.exit-comparison { border: 1px solid var(--line); border-radius: 8px; overflow: auto; }
.exit-comparison table { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 760px; }
.exit-column-route { width: 29%; }
.exit-column-amount { width: 32%; }
.exit-column-cost { width: 27%; }
.exit-column-time { width: 12%; }
.exit-comparison-status { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.exit-loading-value { display: inline-flex; align-items: center; gap: 7px; min-height: 1em; color: var(--muted); font-weight: 400; }
.exit-loading-spinner { flex: 0 0 10px; width: 10px; height: 10px; border: 1px solid var(--line-strong); border-top-color: var(--blue); border-right-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
.exit-comparison.is-loading .exit-route-choice { cursor: default; }
.exit-comparison th { text-align: left; font-size: 11px; font-weight: 500; letter-spacing: .02em; color: var(--muted); background: #f4f3ec; padding: 10px 14px; }
.exit-comparison td { padding: 8px 14px; border-top: 1px solid var(--line); vertical-align: middle; font-size: 13px; }
.exit-comparison .exit-bridge-heading th { padding: 8px 14px; border-top: 1px solid var(--line-strong); background: var(--panel-2); color: var(--text); font-size: 13px; font-weight: 600; letter-spacing: 0; }
.exit-bridge-group:first-of-type .exit-bridge-heading th { border-top-color: var(--line); }
.exit-network-row td:first-child { padding-left: 28px; }
.exit-comparison td > small, .exit-route-choice small { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.exit-route-unavailable { display: block; max-width: 32ch; color: var(--muted); font-size: 11px; line-height: 1.4; }
.exit-network-row.is-unavailable .exit-route-choice { cursor: default; color: var(--muted); }
.exit-comparison td > strong { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.exit-comparison tr.is-best { background: #f0f6ed; }
.exit-comparison tr.is-selected td:first-child { box-shadow: inset 3px 0 #355e4b; }
.exit-route-choice { display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 35px; }
.exit-route-choice > span { min-width: 0; }
.exit-route-choice input { flex-shrink: 0; width: 16px; height: 16px; margin: 0; accent-color: #355e4b; }
.exit-route-choice strong { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; font-weight: 500; }
.exit-route-choice em { font-size: 9px; font-style: normal; padding: 2px 5px; color: #355e4b; background: #dcebd6; border-radius: 4px; font-weight: 500; }
.exit-comparison details { margin-top: 3px; color: var(--muted); font-size: 10px; }
.exit-comparison details > div { padding-top: 6px; line-height: 1.65; }
.exit-comparison summary, .exit-limits summary, .exit-journal summary { cursor: pointer; }
.funding-comparison-heading { margin-top: 24px; }
.funding-comparison-heading h3 { margin-bottom: 6px; }
.funding-comparison table { min-width: 680px; }
.funding-comparison th:first-child { width: 30%; }
.funding-comparison th:nth-child(2) { width: 38%; }
#project-operation-body > .funding-compact { max-width: 1160px; }
.funding-compact .exit-range.is-fixed .exit-range-controls { grid-template-columns: minmax(0,1fr); }
.funding-compact .exit-range.is-fixed .exit-range-controls label:last-child,
.funding-compact .exit-range.is-fixed .exit-range-controls label > span { display: none; }
.funding-compact .exit-range.is-fixed input { padding-left: 11px; }
.funding-compact #project-funding-message:empty,
.funding-compact #project-funding-start-message:empty { display: none; }
.funding-compact .funding-wallet-preview table { min-width: 640px; }
.funding-compact .funding-wallet-preview th:first-child { width: 14%; }
.funding-budget { margin-top: 16px; color: var(--muted); }
.funding-budget summary { color: var(--text); }
.funding-budget-rows { padding: 8px 0; max-width: 600px; }
.funding-budget small { display: block; font-size: 11px; line-height: 1.5; }
.funding-compact [hidden] { display: none !important; }
.funding-source-groups { max-width: 100%; overflow-wrap: anywhere; }
.funding-direct-route { margin-bottom: 18px; }
.funding-direct .funding-wallet-preview table { min-width: 780px; }
.funding-direct .funding-wallet-preview td small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.funding-direct .exit-wallet-selection b { overflow-wrap: anywhere; }
.funding-source-choice { display: inline-flex; align-items: center; gap: 8px; }
.funding-source-choice select { width: 125px; min-height: 32px; padding: 5px 28px 5px 9px; font-size: 12px; }
#project-funding-footer-note { display: flex; align-items: center; gap: 7px; }
.funding-batch-table .project-funding-child { background: transparent; border: 0; padding: 0; margin-top: 10px; }
.funding-batch-table .project-funding-child > summary { padding: 0; font-size: 11px; font-weight: 500; color: var(--muted); }
.funding-batch-table .project-activity { min-width: 230px; }
.funding-batch-table .project-activity > strong { font-size: 14px; }
.funding-batch-table .project-activity > small { font-size: 12px; }
.funding-batch-table .project-activity .exit-batch-error { color: var(--danger); }
.funding-batch-table .project-activity-progress { margin-top: 10px; }
@media (prefers-reduced-motion: reduce) {
 .funding-batch-panel .project-activity-pulse { animation: none; }
 .funding-batch-panel .project-activity-progress > i { transition: none; }
}
.project-funding-preview .data-table th:first-child { min-width: 108px; white-space: nowrap; }
.exit-footer { padding-top: 16px; align-items: flex-start; }
.exit-footer > div { max-width: 65%; }
.exit-footer small { display: block; margin-top: 8px; font-size: 11px; line-height: 1.5; color: var(--muted); }
.exit-footer > button { appearance: none; -webkit-appearance: none; flex-shrink: 0; white-space: nowrap; min-width: 232px; min-height: 42px; transition: background-color .16s ease, border-color .16s ease, color .16s ease; }
.exit-limits { font-size: 12px; }
.exit-limits label { display: flex; align-items: center; gap: 15px; margin-top: 10px; }
.exit-limits input { width: 150px; }
.exit-run-heading { align-items: baseline; }
.exit-run-heading > span { font-size: 12px; color: var(--muted); }
.exit-progress { display: grid; grid-template-columns: repeat(6,1fr); padding: 0; list-style: none; margin: 24px 0 18px; gap: 5px; }
.exit-progress li { padding: 9px 6px; border-top: 3px solid var(--line); color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 7px; }
.exit-progress li span { font-variant-numeric: tabular-nums; }
.exit-progress .is-done { border-color: #355e4b; color: #355e4b; }
.exit-progress .is-current { border-color: #b49543; color: var(--text); font-weight: 600; }
.exit-result { display: flex; gap: 50px; padding: 18px 22px; background: #f0f6ed; border: 1px solid #c6d6bf; border-radius: 8px; margin-bottom: 20px; }
.exit-result small { display: block; color: var(--muted); font-size: 12px; }
.exit-result strong { display: block; font-size: 23px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.exit-journal { margin-top: 16px; font-size: 12px; }
.exit-journal p { margin: 9px 0; }
.exit-journal time { margin-right: 10px; color: var(--muted); }
.exit-history { display: grid; gap: 8px; }
.exit-history button { display: flex; justify-content: space-between; gap: 20px; }
.exit-batch-summary { display: flex; flex-wrap: wrap; gap: 12px 26px; padding: 16px 0 4px; color: var(--muted); font-size: 12px; }
.exit-batch-summary b { margin-left: 5px; color: var(--text); font-variant-numeric: tabular-nums; }
.exit-batch-table table { min-width: 740px; }
.exit-batch-table td { vertical-align: top; }
.exit-batch-start > span { white-space: nowrap; font-variant-numeric: tabular-nums; }
.exit-batch-table td > small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.exit-batch-table td > .exit-batch-error { color: var(--danger); }
.exit-batch-table details { margin-top: 8px; font-size: 11px; }
.exit-batch-table details p { max-width: 360px; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) {
 .exit-loading-spinner { animation: none; }
}
@media (max-width: 860px) {
 .exit-inputs, .exit-inputs.is-batch { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .exit-sourcebar { flex-wrap: wrap; gap: 8px; }
 .exit-source-identity { gap: 8px 14px; }
 .exit-calculation { flex-wrap: wrap; gap: 10px 18px; }
 .exit-footer, .exit-run-heading { flex-direction: column; align-items: stretch; }
 .exit-footer > div { max-width: none; }
 .exit-progress { grid-template-columns: repeat(3,1fr); }
 .exit-result { gap: 20px; flex-wrap: wrap; }
}
@media (max-width: 560px) {
 .exit-settings-card { padding: 13px; }
 .exit-inputs, .exit-inputs.is-batch { grid-template-columns: minmax(0,1fr); gap: 14px; }
 .exit-settings-footer { flex-direction: column; align-items: stretch; gap: 12px; }
 .exit-settings-footer > button { width: 100%; }
}

/* Robinhood/Core shares the compact project cards and action rhythm. */
.farm-cross-readiness { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:16px 0; }
.farm-cross-account { border:1px solid var(--line); border-radius:var(--radius); padding:14px; display:flex; flex-direction:column; gap:7px; background:var(--panel); }
.farm-cross-account small { color:var(--muted); overflow-wrap:anywhere; }
.farm-cross-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:18px 0; }
.farm-cross-fields label { display:flex; flex-direction:column; gap:7px; color:var(--muted); font-size:12px; }
.farm-cross-tools,.farm-tier-actions { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin:10px 0; }
.farm-cross-tiers { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.farm-tier-panel { margin:0; border:1px solid var(--line); border-radius:var(--radius); background:var(--panel); overflow:hidden; }
.farm-tier-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:16px 18px; border-bottom:1px solid var(--line); background:var(--panel-2); }
.farm-tier-heading span { color:var(--muted); font-size:12px; }
.farm-tier-heading h4 { margin:4px 0 0; font-size:15px; font-weight:600; }
.farm-tier-heading .table-action { flex-shrink:0; }
.farm-tier-content { padding:0 18px 16px; }
.farm-tier-content p { font-size:12px; line-height:1.5; }
.farm-tier-accounts { display:grid; gap:0; margin:0 0 16px; }
.farm-tier-account { padding:16px 0; border-bottom:1px solid var(--line); font-size:13px; }
.farm-tier-account-title { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; margin-bottom:5px; }
.farm-tier-badge { padding:3px 9px; border-radius:4px; color:var(--acid); background:var(--acid-soft); font-size:12px; font-weight:600; }
.farm-tier-fees { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:12px; color:var(--muted); font-size:12px; }
.farm-tier-fees span { display:flex; flex-wrap:wrap; justify-content:space-between; gap:6px; }
.farm-tier-fees b { color:var(--text); font-variant-numeric:tabular-nums; }
.farm-tier-accounts small { color:var(--muted); }
.farm-tier-actions { align-items:end; }
.farm-tier-actions label { display:grid; gap:7px; flex:1; min-width:110px; font-size:12px; color:var(--muted); }
.farm-tier-actions select { width:100%; min-height:42px; padding:8px 10px; border:1px solid var(--line); border-radius:var(--radius); background:var(--panel); color:var(--text); font:13px var(--body); }
.farm-tier-actions button { min-height:42px; flex:2; }
.farm-tier-message:empty { display:none; }
.farm-tier-rejection { margin:10px 0 0; padding:9px 11px; border-left:2px solid var(--muted); background:var(--panel-2); color:var(--text); }
.farm-tier-countdown { margin:10px 0 0; color:var(--muted); font-variant-numeric:tabular-nums; }
.farm-tier-scope { margin:16px 0 0; padding-top:12px; border-top:1px solid var(--line); }
@media(max-width:900px) { .farm-cross-fields { grid-template-columns:repeat(2,minmax(0,1fr)); } .farm-cross-tiers { grid-template-columns:1fr; } }
@media(max-width:560px) { .farm-cross-fields,.farm-cross-readiness { grid-template-columns:1fr; } }
.farm-cross-economics { border-top:1px solid var(--line); padding-top:10px; margin-top:18px; }
.core-trade-stages { grid-template-columns:repeat(5,minmax(0,1fr)); }
.project-venue-values { display:grid; gap:12px; }
.project-venue-value { display:grid; grid-template-columns:32px minmax(0,1fr); align-items:start; gap:7px; }
.project-venue-value + .project-venue-value { border-top:1px solid var(--line); padding-top:10px; }
.project-venue-caption { color:var(--muted); font:11px/1.7 var(--mono); padding-top:2px; }
.project-venue-value > div { min-width:0; }
.project-venue-value > div > strong { display:block; }
.project-venue-value > div > small { display:block; color:var(--muted); font-size:11px; }
.project-venue-detail + .project-venue-detail { margin-top:28px; padding-top:18px; border-top:1px solid var(--line); }
.project-workspace-summary .project-venue-values { margin-top:8px; }
.project-summary-item > .project-venue-values,.project-summary-item > #project-balance-value,.project-summary-item > #project-account-count { grid-column:1 / -1; grid-row:2; min-width:0; }
.project-workspace-summary .project-venue-value strong { font-size:18px; line-height:1.4; }
.project-unified-table .project-venue-value > div > strong { display:flex; align-items:baseline; gap:4px; width:fit-content; max-width:100%; min-height:34px; margin:0; padding:6px 8px; border:1px solid var(--line); border-radius:6px; background:var(--panel-2); color:var(--text); font:650 16px/20px var(--body); font-variant-numeric:tabular-nums; white-space:nowrap; }
.project-unified-table .project-venue-value > div > strong > small { font:500 10px/20px var(--body); white-space:nowrap; }
.project-points-cell .project-venue-value > div > strong,.project-points-summary .project-venue-value strong { background:var(--points-pill-bg); color:var(--points-pill-text); border-color:var(--points-pill-border); }
.project-cost-cell .project-venue-value > div > strong,.project-cost-summary .project-venue-value strong { background:var(--cost-pill-bg); color:var(--cost-pill-text); border-color:var(--cost-pill-border); }
.core-trade-progress .farm-cycle-market span { overflow-wrap:anywhere; }
.core-trade-history { margin:20px 0; }
.core-trade-history h4 { margin:0 0 12px; }
.core-trade-history ol { list-style:none; margin:0; padding:0; }
.core-trade-history li { display:flex; justify-content:space-between; align-items:baseline; gap:16px; padding:10px 0; border-bottom:1px solid var(--line); font-size:13px; }
.core-trade-history li > div { display:grid; gap:4px; }
.core-trade-history span,.core-trade-history time { color:var(--muted); }
.core-trade-history time { font:12px/1.5 var(--mono); text-align:right; }
@media(max-width:560px) { .core-trade-stages { gap:5px; font-size:11px; } .core-trade-history li { flex-direction:column; gap:4px; } .core-trade-history time { text-align:left; } }

/* Core funding follows the existing compact funding surface. */
.core-funding-form { max-width: 1160px; }
.core-funding-inputs { grid-template-columns: minmax(0, 480px); }
.core-funding-compare-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.core-funding-compare-actions > button { min-height: 40px; padding: 8px 14px; }
.core-funding-form [data-core-funding-message]:empty,
.core-funding-form [data-core-funding-progress]:empty { display: none; }
.core-funding-form [data-core-funding-progress] { margin: 12px 0; font-variant-numeric: tabular-nums; }
.core-funding-routes th:first-child { width: 42%; }
.core-funding-routes th:nth-child(2) { width: 30%; }
.core-funding-routes td { vertical-align: top; }
.funding-comparison.has-route-actions table { min-width: 790px; }
.funding-comparison.has-route-actions th:first-child { width: 36%; }
.funding-comparison.has-route-actions th:nth-child(2) { width: 19%; }
.funding-comparison.has-route-actions th:nth-child(3) { width: 25%; }
.funding-comparison.has-route-actions th.funding-route-action-heading { width: 20%; }
.funding-route-action { vertical-align: middle !important; min-width: 150px; }
.funding-route-action > button { width: 100%; min-height: 42px; padding: 9px 12px; white-space: normal; }
.funding-route-action > small { display: block; margin-top: 8px; line-height: 1.45; overflow-wrap: anywhere; }
.funding-route-action > small:empty { display: none; }
.funding-route-action .funding-route-error { color: var(--danger); }
.standard-trading-form { max-width: 1160px; }
.standard-trading-form [hidden] { display: none !important; }
.standard-trading-form .farm-feedback:empty { display: none; }
.farm-protection-settings { margin-top: 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); font-size: 12px; }
.farm-protection-settings > summary { cursor: pointer; width: fit-content; color: var(--text); font-weight: 600; }
.farm-protection-settings > summary > span { margin-left: 9px; color: var(--muted); font-weight: 400; }
.farm-protection-settings > summary:focus-visible { outline: 2px solid var(--acid); outline-offset: 3px; }
.farm-protection-note { margin: 12px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.farm-protection-sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.farm-protection-side { min-inline-size: 0; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); }
.farm-protection-side > legend { padding: 0 5px; color: var(--acid); font-weight: 600; }
.farm-protection-side[data-protection-side="Short"] > legend { color: var(--orange); }
.farm-protection-side:only-of-type, .farm-protection-side:not([hidden]):has(+ [hidden]), .farm-protection-side[hidden] + .farm-protection-side { grid-column: 1 / -1; }
.farm-protection-rule + .farm-protection-rule { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.farm-protection-enable { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 550; }
.farm-protection-enable > input { flex: 0 0 15px; width: 15px; height: 15px; min-height: 15px; margin: 0; padding: 0; accent-color: var(--acid); }
.farm-protection-controls { display: grid; gap: 10px; margin-top: 10px; }
.farm-protection-controls .farm-paired-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.farm-protection-controls .field label { white-space: normal; }
.farm-protection-controls > small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.farm-protection-settings [hidden] { display: none !important; }
.farm-protection-summary { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; }
.farm-protection-summary > small { color: var(--muted); }
@media (max-width: 700px) { .farm-protection-sides { grid-template-columns: minmax(0, 1fr); } }
.core-funding-fields { grid-template-columns: minmax(230px, 340px); }
.core-funding-sources { margin: 14px 0; border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; }
.core-funding-sources > summary { cursor: pointer; font-weight: 600; font-size: 12px; }
.core-funding-source-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-top: 14px; }
.core-funding-source-grid label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 12px; }
.core-funding-wallets { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 12px; margin: 14px 0; }
.core-funding-wallets th, .core-funding-wallets td { text-align: left; vertical-align: top; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.core-funding-wallets th { background: var(--panel-2); font-weight: 600; }
.core-funding-wallets td small { display: block; margin-top: 5px; color: var(--muted); line-height: 1.45; }
.core-funding-wallets details { margin-top: 7px; }
.core-funding-wallets summary { cursor: pointer; color: var(--acid); }
.core-funding-plan-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.core-funding-plan-summary > div { border: 1px solid var(--line); border-radius: 6px; padding: 12px; display: flex; flex-direction: column; gap: 7px; }
.core-funding-plan-summary span { font-size: 12px; color: var(--muted); }
.core-funding-plan-summary strong { font-size: 14px; overflow-wrap: anywhere; }
@media (max-width: 900px) { .core-funding-plan-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .core-funding-plan-summary, .core-funding-fields, .core-funding-inputs { grid-template-columns: minmax(0, 1fr); } }

/* ETH trade-price chart follows the existing warm operations workspace. */
.lighter-chart-panel { min-width: 0; }
.lighter-chart-toolbar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; }
.lighter-chart-venues { display: flex; gap: 8px; margin: 0; padding: 0; border: 0; }
.lighter-chart-venues legend, .lighter-chart-resolution > label { margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.lighter-chart-venues label { display: flex; cursor: pointer; position: relative; }
.lighter-chart-venues input { position: absolute; top: 50%; left: 12px; width: 16px; height: 16px; margin: -8px 0 0; accent-color: var(--acid); }
.lighter-chart-venues label > span { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 10px 14px 10px 38px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--panel); font-weight: 700; }
.lighter-chart-venues small { font-size: 12px; font-weight: 500; color: var(--muted); }
.lighter-chart-venues input:checked + span { background: var(--acid-soft); border-color: var(--acid); color: var(--acid); }
.lighter-chart-venues input:focus-visible + span { outline: 2px solid var(--acid); outline-offset: 3px; }
.lighter-chart-resolution { width: 130px; margin: 0; }
.lighter-chart-fit { margin-left: auto; }
.lighter-chart-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.lighter-chart-heading h4 { margin: 0; font-size: 20px; }
.lighter-chart-heading p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.lighter-chart-status { display: flex; align-items: center; gap: 7px; flex: 0 1 auto; max-width: 50%; color: var(--muted); font-size: 13px; }
.lighter-chart-status::before { content: ""; display: block; flex: 0 0 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.lighter-chart-status[data-state="live"] { color: var(--acid); flex-shrink: 0; min-width: max-content; white-space: nowrap; }
.lighter-chart-status[data-state="live"]::before { background: var(--acid); }
.lighter-chart-status[data-state="stale"], .lighter-chart-status[data-state="reconnecting"] { color: var(--orange); }
.lighter-chart-status[data-state="stale"]::before, .lighter-chart-status[data-state="reconnecting"]::before { background: var(--orange); }
.lighter-chart-legend { min-height: 24px; margin-bottom: 8px; color: var(--muted); font: 12px/1.7 var(--mono); overflow-wrap: anywhere; }
.lighter-chart-stage { position: relative; min-height: 420px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.lighter-chart-canvas { width: 100%; height: 420px; }
.lighter-chart-placeholder { display: flex; align-items: center; justify-content: center; min-height: 420px; padding: 24px; margin: 0; color: var(--muted); text-align: center; }
.lighter-chart-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.lighter-chart-footer small { font-size: 11px; }
.lighter-chart-footer a { color: var(--acid); }
@media (max-width: 680px) {
  .lighter-chart-toolbar { gap: 12px; }
  .lighter-chart-venues { width: 100%; }
  .lighter-chart-venues label { flex: 1; }
  .lighter-chart-venues label > span { flex: 1; flex-wrap: wrap; gap: 2px 8px; }
  .lighter-chart-heading { align-items: flex-start; flex-direction: column; }
  .lighter-chart-status { max-width: 100%; }
  .lighter-chart-stage, .lighter-chart-placeholder { min-height: 320px; }
  .lighter-chart-canvas { height: 320px; }
}

/* Trade cards retain their canvas while the surrounding run status updates. */
.trading-charts-panel { margin-top: 18px; min-width: 0; container-type: inline-size; }
.trading-charts-toggle { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); text-align: left; font: inherit; font-weight: 650; cursor: pointer; }
.trading-charts-toggle [data-trading-charts-count] { color: var(--muted); font-size: 12px; font-weight: 500; }
.trading-charts-toggle [data-trading-charts-action] { margin-left: auto; color: var(--acid); font-size: 12px; }
.trading-charts-toggle:focus-visible, .trading-chart-legs button:focus-visible { outline: 2px solid var(--acid); outline-offset: 3px; }
.trading-charts-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.trading-charts-message { margin: 12px 0; color: var(--muted); font-size: 13px; }
.trading-chart-card { min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.trading-chart-card-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.trading-chart-card-heading h4 { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.trading-chart-card-heading > span { color: var(--muted); font-size: 11px; text-align: right; }
.trading-chart-state { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; padding: 5px 10px; border-radius: 5px; }
.trading-chart-state[data-state="hold"] { color: var(--acid); background: var(--acid-soft); }
.trading-chart-state[data-state="expired"] { color: var(--orange); background: var(--panel-2); }
.trading-chart-state > span { font-size: 12px; font-weight: 550; }
.trading-chart-state > strong { font: 650 21px/1.15 var(--mono); font-variant-numeric: tabular-nums; }
.trading-chart-legs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.trading-chart-legs button { padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); background: var(--panel); font: inherit; font-size: 11px; cursor: pointer; }
.trading-chart-legs button[aria-pressed="true"] { color: var(--acid); border-color: var(--acid); background: var(--acid-soft); }
.trading-chart-host { min-height: 295px; color: var(--muted); font-size: 13px; }
.trading-charts-panel .lighter-chart-toolbar { gap: 8px; margin-bottom: 10px; }
.trading-charts-panel .lighter-chart-resolution { width: 98px; }
.trading-charts-panel .lighter-chart-resolution label { display: grid; gap: 3px; color: var(--muted); font-size: 11px; }
.trading-charts-panel .lighter-chart-resolution select { min-height: 30px; padding: 5px 8px; }
.trading-charts-panel .lighter-chart-fit { padding: 6px 9px; min-height: 30px; font-size: 11px; }
.trading-charts-panel .lighter-chart-heading { flex-direction: column; align-items: flex-start; gap: 4px; margin-bottom: 6px; }
.trading-charts-panel .lighter-chart-heading h4 { font-size: 14px; }
.trading-charts-panel .lighter-chart-heading p { font-size: 11px; }
.trading-charts-panel .lighter-chart-status { max-width: 100%; font-size: 11px; }
.trading-charts-panel .lighter-chart-legend { min-height: 34px; margin-bottom: 5px; font-size: 10px; line-height: 1.5; }
.trading-charts-panel .lighter-chart-stage, .trading-charts-panel .lighter-chart-placeholder { min-height: 340px; }
.trading-charts-panel .lighter-chart-canvas { height: 340px; }
.trading-charts-panel .lighter-chart-footer { font-size: 10px; gap: 5px; }
.trading-charts-panel .lighter-chart-footer small { font-size: 9px; }
.trading-charts-panel [hidden] { display: none !important; }
.lighter-chart-compact-header { display: flex; align-items: center; gap: 6px; min-height: 32px; margin-bottom: 5px; color: var(--text); font-size: 13px; line-height: 1.4; }
.lighter-chart-compact-header > select { flex: 0 0 80px; width: 80px; min-width: 80px; min-height: 32px; margin: 0; padding: 5px 6px; font-size: 14px; }
.lighter-chart-compact-header > strong { flex: 0 0 auto; font-size: 14px; font-weight: 650; white-space: nowrap; }
.lighter-chart-position-captions { min-width: 0; flex: 1 1 auto; overflow-wrap: anywhere; }
.lighter-chart-compact .lighter-chart-status { flex: 0 0 7px; min-width: 7px; max-width: 7px; gap: 0; }
.lighter-chart-compact .lighter-chart-stage { display: grid; grid-template-columns: minmax(0, 1fr) 176px; min-height: 340px; }
.lighter-chart-compact .lighter-chart-canvas { height: 340px; min-width: 0; }
.lighter-chart-entry-rail { position: relative; height: 340px; border-left: 1px solid var(--line); background: var(--panel); }
.lighter-chart-entry-label { position: absolute; left: 3px; right: 3px; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; max-height: 60px; padding: 3px 4px; border-left: 2px solid var(--acid); color: var(--text); background: var(--panel); font-size: 11px; line-height: 1.3; overflow-wrap: anywhere; overflow-y: auto; }
.lighter-chart-entry-label[data-side="short"] { border-left-color: var(--orange); }
.lighter-chart-entry-label[data-side=""] { border-left-color: var(--muted); }
.lighter-chart-entry-caption { color: var(--muted); font-size: 11px; }
.lighter-chart-entry-label > strong { font: 650 12px/1.3 var(--mono); }
.lighter-chart-close-control > button { min-height: 23px; margin: 1px 0 0; padding: 2px 4px; border: 1px solid var(--line-strong); border-radius: 3px; color: var(--acid); background: var(--panel); font: inherit; font-size: 11px; cursor: pointer; }
.lighter-chart-close-control > button:disabled { color: var(--muted); cursor: default; }
.lighter-chart-close-control > button:focus-visible { outline: 2px solid var(--acid); outline-offset: 2px; }
.lighter-chart-close-control { position: absolute; left: 3px; right: 3px; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; max-height: 86px; padding: 2px 4px; background: var(--panel); overflow-y: auto; }
.lighter-chart-entry-message { color: var(--muted); font-size: 11px; line-height: 1.3; overflow-wrap: anywhere; }
.lighter-chart-pnl { position: absolute; left: 7px; right: 7px; max-height: 120px; overflow-y: auto; padding-top: 7px; border-top: 1px solid var(--line); color: var(--text); font-size: 11px; line-height: 1.3; }
.lighter-chart-pnl-heading { display: block; font-size: 12px; font-weight: 650; margin-bottom: 5px; }
.lighter-chart-pnl-row { display: flex; align-items: baseline; justify-content: space-between; gap: 5px; margin: 3px 0; }
.lighter-chart-pnl-label { flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; }
.lighter-chart-pnl-amount { font: 600 11px/1.3 var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lighter-chart-pnl-amount[data-sign="positive"] { color: var(--acid); }
.lighter-chart-pnl-amount[data-sign="negative"] { color: var(--danger); }
.lighter-chart-pnl-amount[data-sign="unavailable"], .lighter-chart-pnl-amount[data-status="stale"] { color: var(--muted); }
.lighter-chart-pnl-total { margin-top: 5px; font-weight: 650; }
.lighter-chart-pnl-hint, .lighter-chart-pnl-hold { display: block; margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.lighter-chart-pnl-economics { max-height: 314px; padding-top: 5px; }
.lighter-chart-pnl-economics .lighter-chart-pnl-heading { margin-bottom: 3px; }
.lighter-chart-pnl-economics .lighter-chart-pnl-row { flex-wrap: wrap; margin: 2px 0; gap: 1px 4px; }
.lighter-chart-economics-basis { flex-basis: 100%; color: var(--muted); font-size: 9px; }
.lighter-chart-pnl-economics .lighter-chart-trading-cost { margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--line); }
.lighter-chart-pnl-cost[data-sign="positive"] { color: var(--danger); }
.lighter-chart-pnl-cost[data-sign="negative"] { color: var(--acid); }
.lighter-chart-pnl-cost[data-sign="unavailable"], .lighter-chart-pnl-cost[data-status="stale"] { color: var(--muted); }
.lighter-chart-economics-details { margin-top: 4px; color: var(--muted); font-size: 10px; }
.lighter-chart-economics-details > summary { cursor: pointer; width: fit-content; }
.lighter-chart-economics-details > summary:focus-visible { outline: 2px solid var(--acid); outline-offset: 2px; }
.lighter-chart-economics-wallet { margin: 5px 0; padding-top: 4px; border-top: 1px solid var(--line); }
.lighter-chart-economics-wallet > strong { color: var(--text); font-weight: 650; }
.lighter-chart-economics-details .lighter-chart-pnl-amount { font-size: 10px; }
.lighter-chart-compact .lighter-chart-placeholder { grid-column: 1 / -1; min-height: 340px; }
.lighter-chart-compact .lighter-chart-footer { margin-top: 3px; justify-content: flex-end; }
.lighter-chart-compact .lighter-chart-footer small { font-size: 9px; }
.lighter-chart-compact [hidden] { display: none !important; }
.lighter-chart-compact .lighter-chart-stage:has(.lighter-chart-position-details) { grid-template-columns: minmax(0, 1fr) 260px; min-height: 420px; }
.lighter-chart-compact .lighter-chart-stage:has(.lighter-chart-position-details) > :is(.lighter-chart-canvas, .lighter-chart-placeholder) { grid-column: 1; grid-row: 1; }
.lighter-chart-compact .lighter-chart-stage > .lighter-chart-position-details { grid-column: 2; grid-row: 1; }
.trading-charts-panel .lighter-chart-canvas[data-position-details] { height: 420px; }
.lighter-chart-position-details { height: 420px; overflow-y: auto; padding: 5px; scrollbar-width: thin; }
.lighter-chart-position-details .lighter-chart-entry-label { position: static; max-height: none; margin-bottom: 8px; padding: 5px 7px; overflow: visible; }
.lighter-chart-position-details .lighter-chart-entry-caption { color: var(--text); font-size: 12px; font-weight: 650; }
.lighter-chart-position-details .lighter-chart-entry-label > strong { margin-top: 3px; font-size: 12px; }
.lighter-chart-position-metrics { width: 100%; display: grid; gap: 3px; margin: 6px 0 0; }
.lighter-chart-position-metrics > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.lighter-chart-position-metrics dt { color: var(--muted); font-size: 11px; }
.lighter-chart-position-metrics dd { margin: 0; font: 550 11px/1.4 var(--mono); font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
.lighter-chart-position-details .lighter-chart-entry-label[data-status="stale"] .lighter-chart-position-metrics dd,
.lighter-chart-position-details .lighter-chart-entry-label[data-status="unavailable"] .lighter-chart-position-metrics dd { color: var(--muted); }
.lighter-chart-position-observation { margin-top: 4px; color: var(--muted); font-size: 10px; }
.lighter-chart-position-details .lighter-chart-close-control { position: static; max-height: none; padding: 2px 7px 7px; overflow: visible; }
.lighter-chart-position-details .lighter-chart-close-control > button { width: 100%; min-height: 28px; }
.lighter-chart-position-details .lighter-chart-pnl { position: static; max-height: none; padding: 7px; overflow: visible; }
.lighter-chart-position-details .lighter-chart-pnl-amount { font-size: 12px; }
@container (max-width: 920px) { .trading-charts-grid { grid-template-columns: minmax(0, 1fr); } }
@container (max-width: 520px) {
  .lighter-chart-compact .lighter-chart-stage { grid-template-columns: minmax(0, 1fr) 144px; }
  .lighter-chart-compact-header { flex-wrap: wrap; }
  .lighter-chart-position-captions { order: 3; flex-basis: 100%; white-space: normal; overflow-wrap: anywhere; }
  .lighter-chart-compact .lighter-chart-status { margin-left: auto; }
  .lighter-chart-compact .lighter-chart-stage:has(.lighter-chart-position-details) { grid-template-columns: minmax(0, 1fr); }
  .lighter-chart-position-details { height: auto; max-height: 520px; border-left: 0; border-top: 1px solid var(--line); }
  .lighter-chart-compact .lighter-chart-stage > .lighter-chart-position-details { grid-column: 1; grid-row: 2; }
}
.trading-charts-workspace { padding: 0 26px; }
@media (max-width: 900px) { .trading-charts-workspace { padding: 0 20px; } }

/* Full-width saved history tables expand operations within each Moscow day. */
.project-unified-table > tbody > .project-wallet-details-row > td > .project-cost-journal { position: sticky; left: 0; width: 100cqw; max-width: 100%; }
.wallet-cost-history { min-width: 0; width: 100%; container-type: inline-size; }
.wallet-history-heading, .wallet-history-section-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.wallet-cost-history .wallet-history-heading { margin-bottom: 9px; }
.wallet-cost-history .wallet-history-heading h4 { margin: 0; color: var(--text); font: 650 14px/1.4 var(--body); }
.wallet-history-heading > span, .wallet-history-section-heading > span { color: var(--muted); font-size: 12px; }
.wallet-history-grid { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 16px; }
.wallet-history-section { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.wallet-history-section-heading { padding: 9px 10px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.wallet-history-section-heading h5 { margin: 0; font: 650 13px/1.4 var(--body); }
.wallet-history-scroll { max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
.wallet-history-scroll:focus-visible { outline: 2px solid var(--acid); outline-offset: -2px; }
.wallet-cost-history .wallet-history-table { width: 100%; min-width: 0; table-layout: auto; border-collapse: collapse; border-spacing: 0; }
.wallet-cost-history .wallet-history-trades .wallet-history-table { min-width: 1200px; }
.wallet-cost-history .wallet-history-transfers .wallet-history-table { min-width: 1120px; }
.wallet-cost-history .wallet-history-section .wallet-history-table :is(th, td) { position: static; width: auto; min-width: 0; padding: 7px 8px; color: var(--text); background: transparent; border-bottom: 1px solid var(--line); font: 400 12px/1.4 var(--body); letter-spacing: 0; text-transform: none; vertical-align: top; text-align: left; }
.wallet-cost-history .wallet-history-section .wallet-history-table th { font-weight: 600; color: var(--muted); white-space: nowrap; background: var(--panel); }
.wallet-cost-history .wallet-history-table tbody > tr:last-child > td { border-bottom: 0; }
.wallet-cost-history .wallet-history-table td small { display: block; margin-top: 2px; color: var(--muted); font: 400 12px/1.35 var(--body); }
.wallet-cost-history .wallet-history-table time { display: block; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wallet-cost-history .wallet-history-table td.wallet-history-number { text-align: right; }
.wallet-history-amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.wallet-cost-history .wallet-history-table .wallet-history-amount > small, .wallet-history-heading .wallet-history-amount > small, .wallet-history-section-heading .wallet-history-amount > small { display: inline; margin: 0; font-size: 12px; color: inherit; }
.wallet-history-cost[data-sign="positive"], .wallet-history-pnl[data-sign="negative"] { color: var(--danger); }
.wallet-history-cost[data-sign="negative"], .wallet-history-pnl[data-sign="positive"] { color: var(--acid); }
.wallet-history-amount[data-sign="unavailable"] { color: var(--muted); }
.wallet-history-prices { white-space: nowrap; }
.wallet-history-currency-line { display: block; }
.wallet-history-day { cursor: pointer; }
.wallet-cost-history .wallet-history-section .wallet-history-table .wallet-history-day > td { background: var(--panel-2); font-weight: 600; padding-block: 9px; }
.wallet-cost-history .wallet-history-section .wallet-history-table .wallet-history-day:hover > td { background: var(--panel-3); }
.wallet-history-day-toggle { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 0; border: 0; background: transparent; color: var(--text); font: 600 12px/1.4 var(--body); white-space: nowrap; cursor: pointer; }
.wallet-history-day-toggle:focus-visible { outline: 2px solid var(--acid); outline-offset: 3px; }
.wallet-history-day-chevron { display: inline-block; width: 8px; color: var(--acid); font-size: 17px; line-height: 1; }
.wallet-history-day-toggle[aria-expanded="true"] .wallet-history-day-chevron { transform: rotate(90deg); }
.wallet-cost-history .wallet-history-section .wallet-history-table .wallet-history-empty { padding: 14px 10px; color: var(--muted); font-size: 13px; text-align: left; }
.wallet-cost-history .wallet-history-loading { margin: 0 0 8px; color: var(--muted); font: 400 12px/1.5 var(--body); }
.wallet-cost-history .wallet-history-warning { margin: 0 0 8px; color: var(--orange); font: 400 12px/1.5 var(--body); }
.wallet-history-caption { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.farm-entry-policy { margin: 16px 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.farm-entry-policy > legend { padding: 0 6px; font-weight: 650; }
.farm-entry-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.farm-entry-fields .field { margin: 0; }
.farm-entry-fields input, .farm-entry-fields select { width: 100%; }
.farm-entry-policy [hidden], .farm-entry-fields [hidden] { display: none; }
.farm-entry-methods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.farm-entry-methods > section { padding: 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); }
.farm-entry-methods h3 { margin: 0 0 8px; font-size: 14px; }
.farm-entry-methods p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
#farm-entry-report-form { display: flex; align-items: end; gap: 12px; margin: 16px 0; }
#farm-entry-report-form .field { flex: 1; margin: 0; }
.farm-entry-report .preview-row { gap: 14px; }
.farm-entry-report .preview-row > span:last-child { text-align: right; overflow-wrap: anywhere; }
@media (max-width: 700px) { .farm-entry-methods { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) { .farm-entry-fields { grid-template-columns: minmax(0, 1fr); } #farm-entry-report-form { align-items: stretch; flex-direction: column; } }

.farm-entry-campaign { margin: 20px 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.farm-entry-campaign-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.farm-entry-campaign-heading h3 { margin: 0 0 8px; }
.farm-entry-campaign-table { margin-top: 14px; }
.farm-entry-campaign-table table { min-width: 620px; }
.farm-entry-campaign-method-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.farm-entry-campaign-method-results > section { padding: 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); }
.farm-entry-campaign-method-results h5 { margin: 0 0 8px; font-size: 13px; }
.farm-entry-campaign-method-results p { margin: 6px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.farm-entry-campaign-history { margin-top: 16px; }
@media (max-width: 700px) { .farm-entry-campaign-method-results { grid-template-columns: minmax(0, 1fr); } .farm-entry-campaign { padding: 12px; } }

/* Scenario controls share the project preset spacing and native dialog surface. */
.project-rh-scenarios { grid-column: 1 / -1; display:flex; flex-wrap:wrap; align-items:center; gap:6px; min-width:0; padding:2px 4px 2px 8px; }
.rh-scenario-add, .rh-scenario-chip { border:1px solid var(--line-strong); border-radius:7px; background:var(--panel); }
.rh-scenario-add { min-height:34px; padding:6px 10px; color:var(--acid); font:600 12px/1.4 var(--body); border-style:dashed; }
.rh-scenario-chip { display:inline-flex; align-items:stretch; min-width:0; max-width:320px; }
.rh-scenario-copy { flex-shrink:0; border:0; border-right:1px solid var(--line); border-radius:6px 0 0 6px; padding:6px 8px; background:transparent; color:var(--acid); font:600 11px/1.4 var(--body); }
.rh-scenario-label { position:relative; display:flex; min-width:0; }
.rh-scenario-name { min-width:0; padding:6px 28px 6px 10px; border:0; background:transparent; color:var(--text); text-align:left; font:600 12px/1.4 var(--body); overflow:hidden; text-overflow:ellipsis; }
.rh-scenario-delete:disabled { opacity:.4; cursor:default; }
.rh-scenario-name small { display:block; color:var(--muted); font:400 10px/1.4 var(--body); }
.rh-scenario-action { flex-shrink:0; border:0; border-left:1px solid var(--line); border-radius:0 6px 6px 0; padding:6px 10px; background:var(--acid-soft); color:var(--acid); font:600 11px/1.4 var(--body); }
.rh-scenario-action.is-stop, .rh-scenario-stop { color:var(--danger); }
.project-rh-scenarios button:focus-visible { outline:2px solid var(--acid); outline-offset:2px; }
.modal-backdrop:has(.rh-scenario-editor), .modal-backdrop:has(.rh-scenario-details) { place-items:stretch end; padding:0; }
.modal:has(.rh-scenario-editor), .modal:has(.rh-scenario-details) { width:min(660px,100%); max-height:100dvh; height:100%; border-radius:0; }
.rh-scenario-editor > .field-help:first-child { margin-top:0; }
.rh-scenario-editor .field { min-width:0; }
.rh-scenario-editor [aria-invalid="true"] { border-color:var(--danger); outline:1px solid var(--danger); outline-offset:1px; }
.rh-scenario-editor .rh-scenario-field-error { color:var(--danger); }
.rh-scenario-editor .form-grid > .full { grid-column:1 / -1; }
.rh-scenario-editor .farm-launch-toolbar { margin-bottom:12px; }
.rh-scenario-editor .farm-market-selected-section { margin-bottom:0; }
.rh-scenario-editor [data-scenario-market-summary] { display:block; margin-top:7px; color:var(--muted); font-size:11px; line-height:1.5; }
.rh-scenario-leverages { min-inline-size:0; margin:0; padding:0; border:0; }
.rh-scenario-leverages > legend, .rh-scenario-range > legend { padding:0; margin-bottom:8px; color:var(--text); font:600 13px/1.5 var(--body); }
.rh-scenario-custom-leverage { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:10px; }
.rh-scenario-custom-leverage > label { margin:0; }
.rh-scenario-custom-leverage > input { width:88px; min-width:0; }
.rh-scenario-range { min-inline-size:0; margin:0; padding:12px; border:1px solid var(--line); border-radius:var(--radius); background:var(--panel); }
.rh-scenario-range-heading { display:flex; justify-content:flex-end; align-items:center; min-height:24px; margin-bottom:8px; color:var(--muted); font-size:12px; }
.rh-scenario-range-heading:empty { display:none; }
.rh-scenario-range-heading > select { width:90px; min-height:32px; padding:4px 8px; border:1px solid var(--line); border-radius:5px; background:var(--panel); color:var(--text); font:12px/1.5 var(--body); }
.rh-scenario-range-heading > select:focus-visible { outline:2px solid var(--acid); outline-offset:2px; }
.rh-scenario-range-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.rh-scenario-range .field-help { display:block; margin-top:8px; font-size:12px; }
.rh-scenario-duration { display:grid; grid-template-columns:minmax(0,1fr) 105px; gap:8px; }
.rh-scenario-wallets, .rh-scenario-checks { display:flex; flex-wrap:wrap; gap:8px 14px; }
.rh-scenario-wallets { max-height:190px; overflow:auto; border:1px solid var(--line); padding:10px; border-radius:var(--radius); }
.rh-scenario-wallets label, .rh-scenario-checks label { display:flex; align-items:center; gap:7px; margin:0; color:var(--text); font:400 12px/1.5 var(--body); }
.rh-scenario-wallets input, .rh-scenario-checks input { width:16px; height:16px; min-height:0; margin:0; accent-color:var(--acid); }
.rh-scenario-pairs { display:grid; gap:4px; padding-top:8px; color:var(--acid); font-size:12px; }
.rh-scenario-advanced { margin:14px 0; border:1px solid var(--line); border-radius:var(--radius); padding:12px; }
.rh-scenario-advanced > summary { cursor:pointer; font-size:13px; font-weight:600; }
.rh-scenario-advanced > .form-grid { margin-top:14px; }
.rh-scenario-checks { margin-top:12px; }
.rh-scenario-note { border-left:3px solid var(--acid); padding:8px 12px; background:var(--panel-2); font-size:12px; line-height:1.6; }
.rh-scenario-summary { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin:18px 0; }
.rh-scenario-summary > .full { grid-column:1 / -1; }
.rh-scenario-summary dt { color:var(--muted); font-size:11px; }
.rh-scenario-summary dd { margin:5px 0 0; font-size:13px; overflow-wrap:anywhere; }
.rh-scenario-run-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.rh-scenario-run-heading h3 { margin:0; font-size:20px; }
.rh-scenario-log { display:grid; gap:10px; list-style:none; padding:0; font-size:12px; max-height:360px; overflow:auto; }
.rh-scenario-log li { display:grid; gap:4px; padding-bottom:10px; border-bottom:1px solid var(--line); overflow-wrap:anywhere; }
.rh-scenario-log time, .rh-scenario-log small { color:var(--muted); font-size:11px; }
.rh-scenario-overview-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.rh-scenario-overview-heading h3 { margin:0; font-size:20px; }
.rh-scenario-status { flex-shrink:0; padding:4px 9px; border:1px solid var(--line); border-radius:5px; color:var(--acid); background:var(--acid-soft); font-size:11px; }
.rh-scenario-settings-line { margin:8px 0 0; }
.rh-scenario-summary-compact { gap:10px 18px; margin:16px 0; }
.rh-scenario-summary-compact dd { margin-top:3px; font-size:12px; }
.rh-scenario-overview-actions { margin-top:14px; padding-top:14px; gap:8px; }
.rh-scenario-overview-actions button { min-height:36px; padding:8px 12px; font-size:12px; }
.rh-scenario-action-help { margin:8px 0 0; font-size:11px; }
.rh-scenario-statistics { margin-top:24px; padding-top:20px; border-top:1px solid var(--line-strong); }
.rh-scenario-statistics-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; }
.rh-scenario-statistics-heading h3 { margin:0; font-size:16px; }
.rh-scenario-statistics .project-period-controls { gap:8px 12px; }
.rh-scenario-statistics .project-compact-filter { min-width:0; flex:1 1 100%; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:12px; }
.rh-scenario-statistics .project-compact-filter select { min-width:0; width:100%; min-height:38px; padding-block:7px; font-size:13px; }
.rh-scenario-statistics .project-period-dates { flex-wrap:wrap; flex-basis:100%; }
.rh-scenario-statistics .project-period-dates input[type="date"] { width:145px; min-height:36px; padding:6px 8px; border:1px solid var(--line); border-radius:var(--radius); background:var(--panel); color:var(--text); font:12px var(--body); }
.rh-scenario-statistics :is(button,select,input):focus-visible { outline:2px solid var(--acid); outline-offset:2px; }
.rh-scenario-stats-scope { margin:12px 0; font-size:11px; }
.rh-scenario-stats-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:0; }
.rh-scenario-stat { min-width:0; padding:15px 12px 12px; border:1px solid var(--line); border-radius:var(--radius); background:var(--panel-2); }
.rh-scenario-stat dt { color:var(--muted); font-size:12px; }
.rh-scenario-stat dd { margin:12px 0 0; color:var(--text); font:600 23px/1.3 var(--body); font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.rh-scenario-stat dd small { display:block; margin-top:3px; color:var(--muted); font:400 10px/1.5 var(--body); }
.rh-scenario-stat-approx { font-size:16px; }
.rh-scenario-stat p { margin:10px 0 0; color:var(--muted); font-size:10px; line-height:1.5; }
.rh-scenario-cost-split { display:grid; gap:9px; margin-top:12px; padding-top:12px; border-top:1px solid var(--line); }
.rh-scenario-cost-split > div { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; font-size:10px; line-height:1.5; }
.rh-scenario-cost-split span { color:var(--muted); }
.rh-scenario-cost-split strong { color:var(--text); font-weight:600; text-align:right; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.rh-scenario-cost-split small { display:block; color:var(--muted); font-size:9px; font-weight:400; }
.rh-scenario-stats-context { margin-top:14px; }
.rh-scenario-stats-context p { margin:5px 0; color:var(--muted); font-size:11px; line-height:1.6; }
.rh-scenario-stats-context .rh-scenario-stats-updated { font-size:10px; }
.rh-scenario-statistics .is-incomplete { color:var(--danger); }
.rh-scenario-history { margin-top:22px; }
.rh-scenario-history .table-action { text-align:left; }
@media(max-width:480px) { .rh-scenario-stats-grid { grid-template-columns:1fr; } .rh-scenario-stat { display:grid; grid-template-columns:1fr 1fr; gap:8px; align-items:baseline; } .rh-scenario-stat dd { margin:0; text-align:right; } .rh-scenario-stat p { grid-column:1 / -1; margin:0; } .rh-scenario-summary-compact { grid-template-columns:repeat(2,minmax(0,1fr)) !important; } }
@media(max-width:600px) { .project-rh-scenarios { padding-left:0; } .rh-scenario-summary { grid-template-columns:1fr; } .rh-scenario-editor .form-grid { grid-template-columns:1fr; } }

/* Live scenarios use the existing warm operations palette and controls. */
.scenario-live { display: grid; gap: 14px; min-width: 0; }
.scenario-live-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.scenario-live-lead { margin: 0 0 7px; color: var(--muted); font-size: 13px; }
.scenario-live-toolbar > div > strong { font: 650 20px/1.4 var(--display); }
.scenario-live-filters { display: flex; flex-wrap: wrap; gap: 9px; }
.scenario-live-filters input { width: 270px; max-width: 100%; }
.scenario-live-filters select { min-width: 170px; }
.scenario-live-filters label { min-width: 0; }
.scenario-live-snapshot { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px 20px; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); font-size: 12px; color: var(--muted); }
.scenario-live-snapshot p { margin: 0; }
.scenario-live [data-stale="true"], .scenario-live [data-expired="true"] { color: var(--orange); }
.scenario-live [data-live-filter-count] { color: var(--muted); }
.scenario-live [data-live-filter-count]:empty { display: none; }
.scenario-live-list { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 32px; }
.scenario-live-run { min-width: 0; overflow: hidden; container: live-scenario / inline-size; border: 3px dashed var(--acid); }
.scenario-live-run[hidden] { display: none; }
.scenario-live-overview { display: flow-root; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.scenario-live-run-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 20px; }
.scenario-live-run-title { min-width: 0; }
.scenario-live-run-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; }
.scenario-live-level-label { color: var(--acid); font: 700 11px/1.4 var(--body); letter-spacing: .08em; text-transform: uppercase; }
.scenario-live-project { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.scenario-live-run-title h2 { margin: 8px 0 0; font: 700 28px/1.25 var(--display); overflow-wrap: anywhere; }
.scenario-live-run-state { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.scenario-live-run-state > .badge { padding: 10px 18px; font-size: 17px; font-weight: 700; line-height: 1.3; border-width: 2px; border-radius: 6px; background: transparent; }
.scenario-live-run-state > .badge.blue { border-color: var(--blue); color: var(--blue); }
.scenario-live-run-state > .badge.ok { border-color: var(--acid); color: var(--acid); }
.scenario-live-hold-timers { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 28px; margin: 0 20px 18px; padding: 13px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--panel); }
.scenario-live-hold-timers > div { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 16px; }
.scenario-live-hold-timers span { color: var(--muted); font-size: 13px; }
.scenario-live-hold-timers strong { color: var(--acid); font: 700 23px/1.3 var(--mono); font-variant-numeric: tabular-nums; }
.scenario-live-hold-timers strong[data-expired="true"] { color: var(--orange); font-size: 14px; }
.scenario-live-round-summary { display: grid; min-width: 0; gap: 4px; text-align: right; overflow-wrap: anywhere; }
.scenario-live-round-summary > span { color: var(--muted); font-size: 12px; }
.scenario-live-round { color: var(--text); font: 600 14px/1.4 var(--body); }
.scenario-live-timeline { margin: 0 20px 17px; }
.scenario-live-timeline-label, .scenario-live-timeline-dates { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.scenario-live-timeline-label strong { margin-left: 6px; color: var(--text); font: 600 13px/1.4 var(--mono); }
.scenario-live-timeline-dates { margin-top: 7px; font-size: 11px; }
.scenario-live-time-summary { margin-top: 13px; }
.scenario-live-progress-unknown { padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 12px; }
.scenario-live [data-awaiting-close="true"] { color: var(--orange); }
.scenario-live-progress-track { position: relative; margin: 10px 0 8px; min-height: 7px; }
.scenario-live-timeline progress { display: block; width: 100%; height: 7px; margin: 0; border: 0; border-radius: 4px; appearance: none; overflow: hidden; background: var(--panel-3); color: var(--acid); }
.scenario-live-round-scale { display: flex; position: relative; margin-top: -7px; }
.scenario-live-round-segment { position: relative; flex-basis: 0; min-width: 0; padding-top: 12px; text-align: center; color: var(--muted); font: 500 11px/1.5 var(--body); font-variant-numeric: tabular-nums; }
.scenario-live-round-segment + .scenario-live-round-segment::before { content: ""; position: absolute; top: -1px; left: -1px; width: 2px; height: 9px; background: var(--panel); box-shadow: 0 0 0 1px var(--line); }
.scenario-live-round-segment > span { display: inline-block; min-width: 20px; padding: 1px 3px; border-radius: 3px; }
.scenario-live-round-segment[data-completed="true"] { color: var(--acid); }
.scenario-live-round-segment[aria-current="step"] > span { color: var(--ink); background: var(--acid); font-weight: 700; }
.scenario-live-round-economics { display: flex; align-items: stretch; width: 100%; margin-top: 7px; }
.scenario-live-round-economic-cell { flex-basis: 0; min-width: 0; padding: 5px 0; text-align: center; color: var(--muted); font: 500 10px/1.6 var(--body); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.scenario-live-round-economic-cell + .scenario-live-round-economic-cell { box-shadow: inset 1px 0 var(--line); }
.scenario-live-round-economic-cell span { color: var(--text); }
.scenario-live-timeline progress::-webkit-progress-bar { background: var(--panel-3); }
.scenario-live-timeline progress::-webkit-progress-value { background: var(--acid); border-radius: 4px; }
.scenario-live-timeline progress::-moz-progress-bar { background: var(--acid); border-radius: 4px; }
.scenario-live-timeline progress[data-unknown="true"] { opacity: .45; }
.scenario-live-run-reason { margin: 0 20px 14px; padding: 9px 12px; background: var(--panel-2); color: var(--orange); font-size: 12px; overflow-wrap: anywhere; }
.scenario-live-pairs { display: grid; gap: 14px; padding: 16px 20px; }
.scenario-live-pair { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.scenario-live-pair-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.scenario-live-pair-head > div:first-child { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.scenario-live-pair-head h3 { margin: 0; font: 650 18px/1.35 var(--display); overflow-wrap: anywhere; }
.scenario-live-pair-number { padding-right: 10px; border-right: 1px solid var(--line-strong); color: var(--muted); font-size: 11px; }
.scenario-live-stage-timer { display: grid; gap: 3px; text-align: right; }
.scenario-live-stage-timer > span { color: var(--muted); font-size: 11px; }
.scenario-live-stage-timer > strong { color: var(--acid); font: 600 15px/1.4 var(--mono); }
.scenario-live-stage-timer > strong[data-live-countdown=""] { color: var(--muted); font: 400 12px/1.4 var(--body); }
.scenario-live-selection { margin: 10px 0 13px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.scenario-live-selection > span { font-size: 11px; }
.scenario-live-wallets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.scenario-live-wallet { padding: 12px 14px; border: 1px solid var(--line); border-left: 3px solid var(--acid); border-radius: 4px; background: var(--panel-2); min-width: 0; }
.scenario-live-wallet:nth-child(2) { border-left-color: var(--blue); }
.scenario-live-wallet header { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 12px; }
.scenario-live-wallet header strong { font-size: 13px; }
.scenario-live-wallet header strong span { font-weight: 500; }
.scenario-live-observation-label { color: var(--muted); font-size: 10px; }
.scenario-live-wallet[data-observation="stale"] .scenario-live-observation-label { color: var(--orange); }
.scenario-live-wallet[data-observation="unavailable"] { border-left-color: var(--line-strong); }
.scenario-live-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px 12px; margin: 0 0 9px; }
.scenario-live-metrics dt { color: var(--muted); font-size: 10px; margin-bottom: 4px; }
.scenario-live-metrics dd { margin: 0; font: 500 12px/1.45 var(--mono); overflow-wrap: anywhere; }
.scenario-live-metrics dd[data-tone="positive"] { color: var(--acid); }
.scenario-live-metrics dd[data-tone="negative"] { color: var(--danger); }
.scenario-live-wallet[data-observation="stale"] dd { color: var(--muted); }
.scenario-live-age { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.scenario-live-pair-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 5px 15px; margin-top: 11px; color: var(--muted); font-size: 11px; }
.scenario-live-diagnostic, .scenario-live-note { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.scenario-live-no-pair { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; padding: 15px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.scenario-live-details { padding: 0 20px; border-top: 1px solid var(--line); }
.scenario-live-details > summary { min-height: 44px; padding: 13px 0; color: var(--blue); font-size: 12px; cursor: pointer; }
.scenario-live-details > summary span { color: var(--muted); }
.scenario-live-details > .scenario-live-note { margin: 12px 0 16px; }
.scenario-live-details.scenario-live-pairs-details { padding-inline: 0; }
.scenario-live-pairs-details > summary { display: flex; align-items: center; justify-content: center; gap: 10px; width: 280px; max-width: calc(100% - 32px); min-height: 56px; box-sizing: border-box; margin: 14px auto; padding: 12px 20px; border: 2px solid var(--acid); border-radius: var(--radius); background: var(--acid); color: var(--ink); font: 700 20px/1.3 var(--body); text-align: center; list-style: none; }
.scenario-live-pairs-details > summary::-webkit-details-marker { display: none; }
.scenario-live-pairs-details > summary::before { content: '\25B6'; font-size: 13px; }
.scenario-live-pairs-details[open] > summary::before { transform: rotate(90deg); }
.scenario-live-pairs-details > summary span { color: inherit; }
.scenario-live-pairs-details > summary:hover { filter: brightness(1.08); }
.scenario-live-pairs-details > summary:focus-visible { outline: 2px solid var(--acid); outline-offset: 4px; }
.scenario-live-jobs { display: grid; gap: 9px; padding: 0; margin: 0; list-style: none; }
.scenario-live-jobs li { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.scenario-live-jobs li > span, .scenario-live-jobs small { color: var(--muted); }
.scenario-live-jobs small { overflow-wrap: anywhere; }
.scenario-live-events { padding: 0; margin: 15px 0 0; list-style: none; color: var(--muted); font-size: 11px; line-height: 1.7; }
.scenario-live-events li { overflow-wrap: anywhere; }
.scenario-live-events time { margin-right: 8px; }
.scenario-live-empty { padding: 36px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--muted); text-align: center; }
@media (min-width: 1100px) {
  .scenario-live-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .scenario-live-toolbar { display: grid; }
  .scenario-live-filters { display: grid; grid-template-columns: minmax(0, 1fr); }
  .scenario-live-filters input, .scenario-live-filters select { width: 100%; }
  .scenario-live-run-head { padding: 14px; }
  .scenario-live-pairs { padding: 12px; }
  .scenario-live-pair { padding: 12px; }
  .scenario-live-timeline { margin-inline: 14px; }
  .scenario-live-run-head { align-items: flex-start; flex-wrap: wrap; }
  .scenario-live-run-title h2 { font-size: 23px; }
  .scenario-live-run-state { gap: 7px; justify-content: flex-start; }
  .scenario-live-pair-head { align-items: flex-start; flex-wrap: wrap; }
  .scenario-live-stage-timer { text-align: left; }
  .scenario-live-details { padding-inline: 14px; }
  .scenario-live-timeline-label { gap: 6px; }
}
@container live-scenario (max-width: 760px) {
  .scenario-live-run-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .scenario-live-run-state { justify-content: flex-start; max-width: 100%; gap: 8px 12px; }
  .scenario-live-round-summary { text-align: left; }
  .scenario-live-run-state .scenario-live-run-pause { justify-content: flex-start; }
  .scenario-live-pair-head { flex-wrap: wrap; align-items: flex-start; }
  .scenario-live-pair-head > div:first-child { min-width: 0; }
  .scenario-live-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container live-scenario (max-width: 560px) {
  .scenario-live-wallets { grid-template-columns: minmax(0, 1fr); }
  .scenario-live-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@container live-scenario (max-width: 400px) {
  .scenario-live-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.scenario-live-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.scenario-live-filters input, .scenario-live-filters select { min-height: 42px; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text); font: 13px/1.5 var(--body); }

.scenario-live-current-jobs { display: flex; flex-wrap: wrap; gap: 7px 16px; padding: 10px 20px; border-top: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font-size: 11px; line-height: 1.6; }
.scenario-live-current-jobs strong { color: var(--text); font-weight: 500; }

.scenario-live-run-pause { flex: 1 1 100%; display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; color: var(--muted); font-size: 11px; }
.scenario-live-run-pause strong { color: var(--blue); font: 500 12px/1.5 var(--mono); }

.scenario-live-progress-caption { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 5px 12px; margin: 10px 0 0; color: var(--muted); font-size: 11px; }
.scenario-live-progress-caption strong { color: var(--acid); font-weight: 600; font-variant-numeric: tabular-nums; }
.scenario-live-truncated { margin: 0; padding: 10px 14px; border: 1px solid var(--line); border-left: 3px solid var(--orange); border-radius: var(--radius); background: var(--panel); color: var(--orange); font-size: 12px; line-height: 1.6; }
.scenario-live-truncated[hidden] { display: none; }

.connection-status[data-snapshot-only="true"] .pulse { background: var(--muted); box-shadow: none; }
.scenario-live-position-extras { margin-top: 14px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.scenario-live-position-extras p { margin: 0 0 8px; }
.scenario-live-position-extras dl { display: grid; gap: 8px; margin: 0; }
.scenario-live-position-extras dt { color: var(--text); font-weight: 500; }
.scenario-live-position-extras dd { margin: 2px 0 0; overflow-wrap: anywhere; }

.scenario-live-economics { margin: 0 20px 18px; padding: 15px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.scenario-live-economic-totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0; }
.scenario-live-economic-totals > div { min-width: 0; }
.scenario-live-economic-totals > .scenario-live-economic-cost { justify-self: end; width: fit-content; max-width: 100%; }
.scenario-live-economic-totals dt { color: var(--muted); font-size: 11px; line-height: 1.5; }
.scenario-live-economic-totals dd { margin: 6px 0 0; color: var(--text); font: 650 22px/1.35 var(--mono); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.scenario-live-economic-totals .scenario-live-volume-rounds { width: fit-content; max-width: min(320px, 100%); box-sizing: border-box; margin-top: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel-2); }
.scenario-live-volume-rounds table { width: 100%; border-collapse: collapse; }
.scenario-live-volume-rounds th, .scenario-live-volume-rounds td { padding: 2px 0; border: 0; background: none; text-transform: none; letter-spacing: normal; }
.scenario-live-volume-rounds th { text-align: left; color: var(--muted); font: 400 10px/1.5 var(--body); }
.scenario-live-volume-rounds td { padding-left: 18px; text-align: right; color: var(--text); font: 500 10px/1.5 var(--mono); }
.scenario-live-economic-totals .scenario-live-cost-breakdown { width: fit-content; max-width: min(320px, 100%); box-sizing: border-box; margin-top: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel-2); font: 400 10px/1.5 var(--body); }
.scenario-live-cost-group + .scenario-live-cost-group { border-top: 1px solid var(--line); margin-top: 7px; padding-top: 7px; }
.scenario-live-cost-group-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 12px; }
.scenario-live-cost-group-head b { color: var(--text); font: 700 11px/1.5 var(--body); }
.scenario-live-cost-breakdown ul { display: grid; gap: 5px; list-style: none; margin: 0; padding: 0; }
.scenario-live-cost-group ul { margin-top: 5px; }
.scenario-live-cost-breakdown li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 6px; }
.scenario-live-cost-breakdown li > span { color: var(--muted); min-width: 0; }
.scenario-live-cost-breakdown strong { font: 500 10px/1.5 var(--mono); text-align: right; }
.scenario-live-cost-breakdown small { font-size: 9px; color: var(--orange); }
.scenario-live [data-cost-tone="expense"] { color: var(--orange); }
.scenario-live [data-cost-tone="income"] { color: var(--acid); }
.scenario-live-economic-totals small, .scenario-live-economic-wallets small, .scenario-live-economic-round-metrics small { color: var(--orange); font-size: 10px; }
.scenario-live-economic-status { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.scenario-live-economic-help { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.scenario-live-economic-wallet-total { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); }
.scenario-live-economic-wallet-total > span { color: var(--muted); font-size: 10px; }
.scenario-live-economic-wallets { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 6px 0 0; padding: 0; list-style: none; }
.scenario-live-economic-wallets li { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; min-width: 0; font-size: 11px; }
.scenario-live-economic-wallets span { color: var(--muted); }
.scenario-live-economic-wallets strong { color: var(--text); font: 500 11px/1.5 var(--mono); overflow-wrap: anywhere; }
.scenario-live-economic-rounds { display: grid; gap: 10px; list-style: none; padding: 0; margin: 0; }
.scenario-live-economic-rounds > li { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel-2); }
.scenario-live-economic-rounds header { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 5px 12px; font-size: 12px; }
.scenario-live-economic-rounds time { color: var(--muted); font-size: 10px; }
.scenario-live-economic-round-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; margin: 12px 0 0; }
.scenario-live-economic-round-metrics > div { min-width: 0; }
.scenario-live-economic-round-metrics > div:last-child { border-top: 1px solid var(--line); padding-top: 9px; grid-column: 1 / -1; }
.scenario-live-economic-round-metrics dt { color: var(--muted); font-size: 10px; }
.scenario-live-economic-round-metrics dd { margin: 3px 0 0; font: 500 12px/1.5 var(--mono); overflow-wrap: anywhere; }
.scenario-live-economic-issues { margin: 12px 0 0; padding-left: 17px; color: var(--orange); font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
@media (max-width: 620px) {
  .scenario-live-economics { margin-inline: 14px; padding: 12px; }
}
@container live-scenario (max-width: 400px) {
  .scenario-live-economic-totals { gap: 12px; }
  .scenario-live-economic-totals dd { font-size: 18px; }
}

/* Standalone Live uses the existing palette, cards and responsive layout. */
body.live-viewer { display: block; min-width: 320px; min-height: 100vh; margin: 0; padding: 0; background: var(--ink); color: var(--text); font-family: var(--body); }
.live-viewer-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 0; padding: 28px var(--gutter) 22px; border-bottom: 1px solid var(--line); }
.live-viewer-heading h1 { margin: 4px 0 0; font-size: 28px; line-height: 1.1; }
.live-viewer-brand { color: var(--acid); font-size: 12px; font-weight: 700; letter-spacing: .06em; }
.live-viewer-heading time { color: var(--muted); font-family: var(--mono); font-size: 16px; font-variant-numeric: tabular-nums; }
.live-viewer-main { width: 100%; max-width: none; box-sizing: border-box; padding: 24px var(--gutter) 40px; }
.live-viewer-warning { padding: 12px 16px; border: 1px solid var(--line-strong); color: var(--orange); background: var(--panel); border-radius: var(--radius); }
.live-viewer-login { min-height: 100vh; display: grid; place-items: center; padding: 24px; box-sizing: border-box; }
.live-viewer-login form { width: min(100%, 360px); padding: 28px; box-sizing: border-box; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.live-viewer-login h1 { margin: 8px 0 24px; font-size: 24px; }
.live-viewer-login label { display: block; margin-bottom: 8px; font-size: 13px; }
.live-viewer-login input { width: 100%; box-sizing: border-box; margin-bottom: 16px; }
.live-viewer-login button { width: 100%; background: var(--acid); color: #fff; border-color: var(--acid); }
.live-viewer-login-error { color: var(--danger); font-size: 13px; }
@media (max-width: 600px) { .live-viewer-heading { padding-top: 20px; } .live-viewer-main { padding-top: 18px; } }
