:root {
  --ink: #0a0a0b;
  --panel: #151516;
  --panel-deep: #101011;
  --panel-hover: #1a1a1c;
  --line: #2b2c2e;
  --line-strong: #3a3b3e;
  --text: #f2f2f0;
  --muted: #909195;
  --muted-strong: #c0c1c3;
  --signal: #18d391;
  --signal-wash: rgba(24, 211, 145, 0.075);
  --buy: #14c77a;
  --sell: #ff4f59;
  --sell-wash: rgba(255, 79, 89, 0.075);
  --warning: #d9b860;
  color: var(--text);
  background: var(--ink);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--ink); }
body { min-width: 320px; min-height: 100dvh; margin: 0; background: var(--ink); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

.flush-shell {
  min-height: 100dvh;
  padding: 0 24px 18px;
}

.flush-topbar {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 30px;
  min-width: 0;
}

.brand-name {
  color: var(--text);
  font: 720 16px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: -.045em;
}

.workspace-nav {
  display: flex;
  min-height: 78px;
  align-items: stretch;
  gap: 24px;
}

.workspace-nav a {
  position: relative;
  display: flex;
  align-items: center;
  color: #77787c;
  font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .06em;
}

.workspace-nav a:hover { color: var(--text); }
.workspace-nav a.is-active { color: var(--text); }
.workspace-nav a.is-active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--signal);
}

.member-chip {
  display: flex;
  min-width: 220px;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel);
  padding: 0 12px;
  transition: border-color .16s ease, background .16s ease;
}

.member-chip:hover { border-color: #545558; background: var(--panel-hover); }
.member-mark {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border: 1px solid #4a4b4e;
  border-radius: 50%;
  color: #d7d8d8;
  font: 750 10px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.member-chip > span:nth-child(2) { min-width: 0; }
.member-chip b, .member-chip small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.member-chip b {
  max-width: 140px;
  color: #e8e8e6;
  font: 680 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.member-chip small {
  max-width: 148px;
  margin-top: 4px;
  color: #85868a;
  font: 600 8px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.member-chip > i {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  margin-left: auto;
  border-radius: 50%;
  background: #5f6063;
}
.member-chip.is-live {
  border-color: rgba(24, 211, 145, .34);
}
.member-chip.is-live .member-mark {
  border-color: rgba(24, 211, 145, .42);
  color: var(--signal);
}
.member-chip.is-live > i { background: var(--signal); }

.page-heading {
  display: flex;
  min-height: 150px;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 25px 4px;
}

.surface-label {
  color: var(--signal);
  font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .12em;
}

.page-heading h1 {
  margin: 10px 0 7px;
  color: var(--text);
  font-size: clamp(29px, 3vw, 44px);
  font-weight: 690;
  line-height: 1;
  letter-spacing: -.045em;
}

.page-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.capability-state {
  display: grid;
  min-width: 294px;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 18px;
  border-left: 1px solid var(--line-strong);
  padding: 6px 0 6px 20px;
}
.capability-state > span {
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--muted);
  font: 650 9px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.capability-state strong {
  color: var(--warning);
  font: 680 11px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.capability-state small {
  color: #77787c;
  font-size: 9px;
  line-height: 1.35;
}
.capability-state.is-ready strong { color: var(--signal); }

.flush-workspace {
  display: grid;
  min-height: calc(100dvh - 300px);
  grid-template-columns: minmax(340px, .9fr) minmax(430px, 1.1fr);
  border: 1px solid var(--line);
  background: var(--panel);
}

.plan-editor, .execution-panel, .plan-queue {
  min-width: 0;
}
.plan-editor, .execution-panel {
  border-right: 1px solid var(--line);
}
.execution-panel { border-right: 0; }

.hedge-field-group { display: contents; }
.hedge-flow-spine { padding-top: 18px; }
.hedge-flow-spine .flow-node { min-height: 78px; }
.hedge-flow-spine .flow-node small { max-width: 50ch; }

.plan-queue {
  margin-top: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.panel-heading {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 17px 20px;
}
.panel-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 690;
  letter-spacing: -.02em;
}
.panel-heading p {
  max-width: 46ch;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}
.panel-heading > span {
  flex: 0 0 auto;
  color: var(--muted);
  font: 680 8px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .08em;
}
.panel-heading > span.is-live { color: var(--signal); }
.queue-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
}
.queue-actions button {
  width: 33px;
  height: 33px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--muted-strong);
  font: 700 15px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.queue-actions button:hover { border-color: #56575a; background: var(--panel-hover); }
.queue-actions button:disabled {
  border-color: var(--line);
  color: var(--muted);
  cursor: not-allowed;
  opacity: .55;
}
.queue-actions .api-settings-button {
  display: inline-flex;
  width: auto;
  height: 33px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: transparent;
  padding: 0 10px;
  color: var(--text);
  font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.queue-actions .api-settings-button:hover { border-color: rgba(24, 211, 145, .42); background: var(--signal-wash); color: #bdf1dd; }

#planForm { padding: 20px; }
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px 13px;
}
.field-block {
  display: block;
  min-width: 0;
}
.field-block > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 650;
}
.field-block > small {
  display: block;
  min-height: 13px;
  margin-top: 6px;
  color: #747579;
  font-size: 8px;
  line-height: 1.4;
}
.field-block > small.is-ready { color: #9ed9c2; }
.field-block > small.is-blocked { color: #d4bd7d; }

.field-block select, .field-block > input[type="search"], .number-control, .readonly-control {
  width: 100%;
  height: 43px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #111112;
  color: var(--text);
}
.readonly-control {
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: var(--text);
  font: 650 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.field-block > input[type="search"] {
  min-width: 0;
  padding: 0 12px;
  font: 650 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
}
.field-block > input[type="search"]::placeholder {
  color: #77787b;
  text-transform: none;
}
.field-block > input[type="search"][aria-invalid="true"] {
  border-color: rgba(255, 79, 89, .72);
}
.field-block select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #8d8e91 50%),
    linear-gradient(135deg, #8d8e91 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 18px,
    calc(100% - 11px) 18px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  padding: 0 31px 0 12px;
  font: 650 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.field-block select:disabled, .field-block > input[type="search"]:disabled {
  color: #77787b;
  opacity: 1;
}
.number-control {
  display: flex;
  align-items: center;
  overflow: hidden;
}
.number-control b {
  color: #7f8084;
  padding-left: 12px;
  font: 650 10px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.number-control input {
  width: 100%;
  min-width: 0;
  height: 41px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 0 11px 0 7px;
  font: 680 12px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.number-control.suffix input { padding-left: 12px; }
.number-control.suffix b {
  padding: 0 11px 0 4px;
  font-size: 8px;
}
.number-control:focus-within, .field-block select:focus, .field-block > input[type="search"]:focus {
  border-color: #5f6064;
}
input:disabled { color: #77787b; }

.fee-preset {
  grid-column: 1 / -1;
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px 1px;
}
.fee-preset > span { min-width: 0; }
.fee-preset strong, .fee-preset small { display: block; }
.fee-preset strong {
  color: var(--signal);
  font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.fee-preset small {
  margin-top: 5px;
  color: var(--muted);
  font: 600 8px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.fee-preset a {
  flex: 0 0 auto;
  color: var(--text);
  border-bottom: 1px solid var(--signal);
  padding: 4px 0;
  font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.fee-preset a:hover { color: var(--signal); }

.plan-calculation {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 19px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--line);
}
.plan-calculation div {
  min-width: 0;
  min-height: 67px;
  background: var(--panel-deep);
  padding: 13px 11px;
}
.plan-calculation span, .plan-calculation strong, .plan-calculation small { display: block; }
.plan-calculation span {
  color: #747579;
  font-size: 8px;
}
.plan-calculation strong {
  margin-top: 8px;
  color: var(--text);
  font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plan-calculation small {
  overflow: hidden;
  margin-top: 5px;
  color: #67686c;
  font: 600 7px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plan-calculation .is-negative { color: var(--sell); }
.plan-calculation .is-positive { color: var(--signal); }
.plan-calculation .quote-metric.is-unavailable strong,
.plan-calculation .quote-metric.is-unavailable small { color: #b59c61; }
.plan-calculation .quote-metric.is-stale small { color: var(--warning); }
.plan-calculation .total-cost { background: #191315; }
.plan-calculation .total-cost strong {
  font-size: 13px;
  font-weight: 780;
}

.access-gate {
  margin-top: 17px;
  border-left: 2px solid var(--warning);
  background: rgba(217, 184, 96, .065);
  padding: 13px 14px;
}
.access-gate strong, .access-gate span { display: block; }
.access-gate strong {
  color: #e3cf98;
  font-size: 11px;
}
.access-gate span {
  margin-top: 5px;
  color: #9a9179;
  font-size: 9px;
  line-height: 1.5;
}
.access-gate a {
  display: inline-block;
  margin-top: 9px;
  color: var(--text);
  font: 680 9px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.access-gate a:hover { color: var(--signal); }

.save-button {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  border: 1px solid var(--signal);
  border-radius: 9px;
  background: var(--signal);
  color: #07130e;
  padding: 0 15px;
  text-align: left;
  transition: transform .12s ease, background .16s ease;
}
.save-button:hover { background: #3bddaa; }
.save-button:active { transform: translateY(1px); }
.save-button:disabled {
  border-color: #353638;
  background: #242526;
  color: #77787b;
}
.save-button span {
  font: 760 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.save-button small { font-size: 8px; }

.execution-flow {
  padding: 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-deep);
}

.flow-intro {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.flow-intro > span {
  color: var(--muted);
  font: 700 8px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .08em;
}
.flow-intro strong, .flow-intro small { display: block; }
.flow-intro strong {
  color: var(--text);
  font-size: 11px;
}
.flow-intro small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.4;
}

.flow-branch {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding-bottom: 40px;
}
.flow-branch::before {
  content: "";
  position: absolute;
  right: 25%;
  bottom: 18px;
  left: 25%;
  border-top: 1px solid var(--line-strong);
}
.flow-branch::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  height: 18px;
  border-left: 1px solid var(--line-strong);
}

.flow-order {
  position: relative;
  display: flex;
  min-height: 92px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  text-align: center;
}
.flow-order::after {
  content: "";
  position: absolute;
  bottom: -23px;
  left: 50%;
  height: 22px;
  border-left: 1px solid var(--line-strong);
}
.flow-order span {
  color: var(--muted);
  font: 650 8px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.flow-order strong {
  margin: 9px 0 7px;
  font: 780 18px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.flow-order small {
  font: 650 8px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.flow-order-buy { background: var(--signal-wash); }
.flow-order-buy strong, .flow-order-buy small { color: var(--buy); }
.flow-order-sell { background: var(--sell-wash); }
.flow-order-sell strong, .flow-order-sell small { color: var(--sell); }

.flow-spine {
  width: min(100%, 480px);
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.flow-node {
  position: relative;
  display: grid;
  min-height: 86px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  padding: 13px 15px;
}
.flow-node + .flow-node { margin-top: 38px; }
.flow-node + .flow-node::before {
  content: "";
  position: absolute;
  top: -38px;
  left: 50%;
  height: 37px;
  border-left: 1px solid var(--line-strong);
}
.flow-node + .flow-node::after {
  content: "";
  position: absolute;
  top: -8px;
  left: calc(50% - 4px);
  width: 7px;
  height: 7px;
  border-right: 1px solid var(--muted);
  border-bottom: 1px solid var(--muted);
  transform: rotate(45deg);
}
.flow-step {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--muted-strong);
  font: 720 9px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.flow-node b, .flow-node strong, .flow-node small { display: block; }
.flow-node b {
  color: var(--muted);
  font: 680 8px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .06em;
}
.flow-node strong {
  margin-top: 6px;
  color: var(--text);
  font-size: 11px;
}
.flow-node small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.45;
}
.flow-node-event {
  border-color: rgba(217, 184, 96, .42);
  background: rgba(217, 184, 96, .055);
}
.flow-node-event b { color: var(--warning); }
.flow-node-flat {
  border-color: rgba(24, 211, 145, .34);
  background: var(--signal-wash);
}
.flow-node-flat b, .flow-node-flat .flow-gate { color: var(--signal); }
.flow-gate {
  border: 1px solid var(--line-strong);
  color: var(--warning);
  padding: 5px 7px;
  font: normal 680 8px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
}

.safety-ledger {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 19px 20px 21px;
  border: 1px solid rgba(24, 211, 145, .2);
  background: var(--signal-wash);
}
.safety-ledger div {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-right: 1px solid rgba(24, 211, 145, .15);
  border-bottom: 1px solid rgba(24, 211, 145, .15);
  padding: 0 12px;
}
.safety-ledger div:nth-child(even) { border-right: 0; }
.safety-ledger div:nth-last-child(-n+2) { border-bottom: 0; }
.safety-ledger span {
  color: #86a79a;
  font-size: 8px;
}
.safety-ledger strong {
  color: #caeddf;
  font: 680 8px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: right;
}

.plan-list {
  min-height: 380px;
  overflow: hidden;
}

.api-dialog {
  width: min(760px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  border: 1px solid var(--line-strong);
  padding: 0;
  background: var(--panel);
  color: var(--text);
}
.api-dialog::backdrop { background: rgba(0, 0, 0, .72); }
.api-dialog[open] { animation: api-dialog-enter .18s cubic-bezier(.16, 1, .3, 1); }
@keyframes api-dialog-enter {
  from { opacity: .75; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.api-dialog-shell { min-width: 0; }
.api-dialog-header {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 18px 20px;
}
.api-dialog-header > div { min-width: 0; }
.api-dialog-header span {
  color: var(--signal);
  font: 700 8px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .08em;
}
.api-dialog-header h2 {
  margin: 7px 0 0;
  font-size: 16px;
  letter-spacing: -.02em;
}
.api-dialog-header p {
  max-width: 58ch;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}
.api-dialog-header button {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--muted-strong);
  font-size: 20px;
  line-height: 1;
}
.api-dialog-header button:hover { background: var(--panel-hover); color: var(--text); }

.api-dialog-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  overflow: auto;
  max-height: calc(100dvh - 210px);
  padding: 18px 20px 20px;
}
.api-security-note {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(217, 184, 96, .28);
  background: rgba(217, 184, 96, .055);
  padding: 12px 13px;
}
.api-security-note strong {
  flex: 0 0 auto;
  color: var(--warning);
  font-size: 10px;
}
.api-security-note span {
  color: var(--muted-strong);
  font-size: 9px;
  line-height: 1.45;
  text-align: right;
}

.api-venue-panel {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--panel-deep);
}
.api-venue-panel > header {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
}
.api-venue-panel > header > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}
.api-venue-code {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: #d6ff2e;
  color: var(--ink);
  font: 800 12px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.api-venue-code.ondo-code {
  border: 1px solid var(--muted-strong);
  background: transparent;
  color: var(--text);
}
.api-venue-panel h3 {
  margin: 0;
  font-size: 12px;
}
.api-venue-panel header p {
  margin: 4px 0 0;
  color: var(--muted);
  font: 620 8px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.api-config-status {
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  padding: 5px 7px;
  font: 680 8px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.api-config-status.is-ready {
  border-color: rgba(24, 211, 145, .32);
  background: var(--signal-wash);
  color: var(--signal);
}
.api-config-status.is-error {
  border-color: rgba(255, 79, 89, .32);
  background: var(--sell-wash);
  color: var(--sell);
}
.api-config-status.is-testing {
  border-color: rgba(255, 206, 69, .34);
  background: rgba(255, 206, 69, .07);
  color: var(--warning);
}

.api-credential-form {
  display: grid;
  gap: 14px;
  padding: 14px 12px 13px;
}
.api-field {
  display: block;
  min-width: 0;
}
.api-field > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 650;
}
.api-field input, .api-field select {
  width: 100%;
  height: 41px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: 0;
  background: var(--panel);
  color: var(--text);
  padding: 0 11px;
  font: 650 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.api-field input:focus, .api-field select:focus { border-color: var(--muted); }
.api-field input::placeholder { color: var(--muted); }
.api-field small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.4;
}
.api-field input:disabled, .api-field select:disabled { color: var(--muted); }

.api-form-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}
.api-form-actions button {
  min-height: 38px;
  border-radius: 8px;
  padding: 0 12px;
  font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.api-save-button {
  border: 1px solid var(--signal);
  background: var(--signal-wash);
  color: var(--signal);
}
.api-save-button:hover { background: rgba(24, 211, 145, .12); }
.api-view-button {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
}
.api-view-button:hover:not(:disabled) {
  border-color: var(--muted);
  background: var(--panel-hover);
}
.api-view-button[aria-pressed="true"] {
  border-color: rgba(24, 211, 145, .32);
  color: var(--signal);
}
.api-delete-button {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted-strong);
}
.api-delete-button:hover:not(:disabled) {
  border-color: rgba(255, 79, 89, .45);
  color: var(--sell);
}
.api-form-actions button:disabled {
  border-color: var(--line);
  color: var(--muted);
  cursor: not-allowed;
  opacity: .5;
}
.api-form-status {
  min-width: 0;
  margin: -2px 0 0;
  color: var(--muted-strong);
  font-size: 9px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.api-form-status[hidden] { display: none; }
.api-form-status.is-testing { color: var(--warning); }
.api-form-status.is-ready { color: var(--signal); }
.api-form-status.is-error { color: var(--sell); }

.api-dialog-footer {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 10px 20px;
}
.api-dialog-footer span {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}
.api-dialog-footer button {
  min-height: 35px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 0 15px;
  font-size: 10px;
  font-weight: 700;
}
.api-dialog-footer button:hover { background: var(--panel-hover); }
.queue-empty {
  display: flex;
  min-height: 380px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}
.queue-empty strong {
  color: var(--muted-strong);
  font-size: 11px;
}
.queue-empty span {
  max-width: 30ch;
  margin-top: 8px;
  color: #737478;
  font-size: 9px;
  line-height: 1.5;
}

.plan-item {
  display: grid;
  min-height: 360px;
  grid-template-columns: minmax(280px, .65fr) minmax(440px, 1.35fr);
  column-gap: 24px;
  border-bottom: 1px solid var(--line);
  padding: 20px;
}
.plan-item:hover { background: #171718; }
.plan-item-head {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}
.plan-identity strong, .plan-identity small { display: block; }
.plan-identity strong {
  color: var(--text);
  font: 720 13px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.plan-identity small {
  margin-top: 5px;
  color: #7d7e82;
  font: 620 8px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
}
.plan-status {
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: #a6a7aa;
  padding: 5px 7px;
  font: 680 8px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.plan-status.running, .plan-status.completed {
  border-color: rgba(24, 211, 145, .32);
  color: var(--signal);
  background: var(--signal-wash);
}
.plan-status.recovering {
  border-color: rgba(217, 184, 96, .42);
  color: var(--warning);
  background: rgba(217, 184, 96, .08);
}
.plan-status.error {
  border-color: rgba(255, 79, 89, .35);
  color: #ff9198;
}

.plan-metrics {
  grid-column: 1;
  grid-row: 2 / span 3;
  align-self: start;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.plan-metrics > div {
  min-height: 49px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
}
.plan-metrics span, .plan-metrics strong { display: block; }
.plan-metrics span { color: #707176; font-size: 8px; }
.plan-metrics strong {
  margin-top: 7px;
  color: #dededb;
  font: 680 9px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.hedge-cost-panel {
  grid-column: 1 / -1;
  margin-top: 12px;
  border: 1px solid rgba(255, 92, 100, .34);
  border-radius: 8px;
  background: #1d1517;
  padding: 12px;
}
.hedge-cost-panel.is-complete { border-color: rgba(255, 92, 100, .5); }
.hedge-cost-panel.is-incomplete {
  border-color: rgba(217, 184, 96, .42);
  background: #1d1a16;
}
.hedge-cost-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.hedge-cost-heading strong, .hedge-cost-heading small { display: block; }
.hedge-cost-heading strong {
  color: #ffd3d5;
  font: 720 9px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .02em;
}
.hedge-cost-heading small {
  max-width: 34ch;
  margin-top: 5px;
  color: #bf9fa1;
  font: 600 8px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.hedge-cost-state {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 92, 100, .34);
  border-radius: 4px;
  color: #ffadb1;
  padding: 5px 6px;
  font: 680 8px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: right;
}
.hedge-cost-panel.is-incomplete .hedge-cost-state {
  border-color: rgba(217, 184, 96, .36);
  color: #dfc37d;
}
.hedge-cost-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 11px;
  border: 1px solid rgba(255, 92, 100, .24);
  background: rgba(255, 92, 100, .18);
}
.hedge-cost-metric {
  min-width: 0;
  padding: 9px 10px;
  background: #211719;
}
.hedge-cost-metric span, .hedge-cost-metric strong, .hedge-cost-metric small { display: block; }
.hedge-cost-metric span {
  color: #c69b9e;
  font: 620 8px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.hedge-cost-metric strong {
  margin-top: 6px;
  font: 760 15px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: -.02em;
}
.hedge-cost-metric small {
  margin-top: 6px;
  color: #b68f92;
  font: 580 7px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.hedge-cost-metric.is-cost strong { color: #ff7e85; }
.hedge-cost-metric.is-benefit strong { color: var(--signal); }
.hedge-cost-metric.is-neutral strong { color: #e2c4c6; }
.hedge-cost-metric.is-pending strong { color: #dfc37d; }
.hedge-cost-legs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}
.hedge-cost-leg {
  min-width: 0;
  border-bottom: 1px solid rgba(255, 92, 100, .22);
  padding: 0 0 7px;
}
.hedge-cost-leg strong, .hedge-cost-leg span, .hedge-cost-leg small { display: block; }
.hedge-cost-leg strong {
  color: #e9c4c6;
  font: 700 8px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.hedge-cost-leg span {
  margin-top: 5px;
  color: #ad898c;
  font: 570 7px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}
.hedge-cost-leg small {
  margin-top: 5px;
  color: #ff989e;
  font: 680 8px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.hedge-cost-leg.is-missing { border-bottom-color: rgba(217, 184, 96, .3); }
.hedge-cost-leg.is-missing strong, .hedge-cost-leg.is-missing small { color: #dfc37d; }
.hedge-cost-pending, .hedge-cost-source {
  color: #b88f92;
  font: 570 8px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.hedge-cost-source {
  margin: 9px 0 0;
  overflow-wrap: anywhere;
}
.hedge-cost-panel.is-incomplete .hedge-cost-source { color: #c3a66d; }
.plan-progress {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  margin-top: 0;
}
.plan-progress-heading, .plan-log-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}
.plan-progress-heading span, .plan-log-heading span {
  color: #a8a9ac;
  font: 680 8px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.plan-progress-heading strong {
  color: var(--signal);
  font: 720 9px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.plan-progress-track {
  display: block;
  width: 100%;
  height: 7px;
  overflow: hidden;
  appearance: none;
  border: 0;
  border-radius: 2px;
  background: #292a2c;
}
.plan-progress-track::-webkit-progress-bar {
  border-radius: 2px;
  background: #292a2c;
}
.plan-progress-track::-webkit-progress-value {
  border-radius: 2px;
  background: var(--signal);
}
.plan-progress-track::-moz-progress-bar {
  border-radius: 2px;
  background: var(--signal);
}
.plan-progress small {
  display: block;
  margin-top: 7px;
  color: #7d7e82;
  font: 600 8px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.plan-log {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  margin-top: 13px;
}
.plan-log-heading small {
  color: #77787c;
  font: 600 8px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.plan-log-output {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 180px;
  max-height: 280px;
  overflow-y: scroll;
  resize: vertical;
  scrollbar-gutter: stable;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  outline: 0;
  background: #101011;
  color: #a8a9ac;
  padding: 10px 11px;
  font: 590 8px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.plan-log-output:focus-visible {
  border-color: rgba(24, 211, 145, .6);
  box-shadow: 0 0 0 2px rgba(24, 211, 145, .12);
}
.plan-log-output::-webkit-scrollbar { width: 9px; }
.plan-log-output::-webkit-scrollbar-track { background: #141415; }
.plan-log-output::-webkit-scrollbar-thumb {
  border: 2px solid #141415;
  border-radius: 8px;
  background: #3c3d40;
}
.plan-actions {
  grid-column: 2;
  grid-row: 3;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 12px;
}
.plan-actions button {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: transparent;
  color: #c4c5c7;
  padding: 0 11px;
  font: 680 9px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.plan-actions button:hover { border-color: #56575a; background: var(--panel-hover); }
.plan-actions .start-plan {
  border-color: rgba(24, 211, 145, .36);
  color: #a3e4cb;
  background: var(--signal-wash);
}
.plan-actions .stop-plan {
  border-color: rgba(255, 79, 89, .4);
  color: #ff9da2;
  background: var(--sell-wash);
}
.plan-actions button:disabled {
  border-color: #303134;
  background: #1b1b1c;
  color: #646569;
}

.volume-analytics {
  margin-top: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.volume-analytics-heading {
  min-height: 88px;
}

.volume-range {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
}

.volume-range button {
  min-width: 48px;
  min-height: 34px;
  border: 0;
  border-right: 1px solid var(--line-strong);
  background: transparent;
  color: #7e7f83;
  font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.volume-range button:last-child { border-right: 0; }
.volume-range button:hover { background: var(--panel-hover); color: var(--text); }
.volume-range button.is-active {
  background: var(--signal-wash);
  color: var(--signal);
}

.volume-summary {
  border-bottom: 1px solid var(--line);
}

.volume-summary-head,
.volume-summary-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.12fr) repeat(2, minmax(0, 1fr));
}

.volume-summary-head {
  min-height: 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .012);
}

.volume-summary-head > span {
  display: flex;
  align-items: center;
  padding: 0 20px;
  color: #77787c;
  font: 650 9px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.volume-summary-row + .volume-summary-row { border-top: 1px solid var(--line); }

.volume-summary-empty {
  min-height: 82px;
  display: flex;
  align-items: center;
  padding: 14px 20px;
  color: #77787c;
  font-size: 10px;
}

.volume-summary-row > div {
  min-height: 82px;
  border-right: 1px solid var(--line);
  padding: 14px 20px;
}

.volume-summary-head > span:last-child,
.volume-summary-row > div:last-child { border-right: 0; }
.volume-summary-row span, .volume-summary-row strong, .volume-summary-row small { display: block; }
.volume-summary-row span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
}

.volume-summary-row strong {
  margin-top: 8px;
  color: var(--text);
  font: 720 20px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: -.025em;
}

.volume-summary-row small {
  margin-top: 7px;
  color: #77787c;
  font-size: 8px;
  line-height: 1.4;
}

.volume-summary-venue {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.volume-summary-venue strong {
  margin-top: 0;
  font-size: 16px;
  letter-spacing: -.015em;
}

.volume-summary-marker,
.venue-volume-marker {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--venue-color, #aeb1b8);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--venue-color, #aeb1b8) 15%, transparent);
  vertical-align: 1px;
}

.volume-summary-row .volume-summary-venue strong { color: var(--venue-color, var(--text)); }

.volume-coverage {
  display: flex;
  min-height: 43px;
  align-items: center;
  gap: 10px;
  margin: 16px 20px 0;
  border: 1px solid rgba(24, 211, 145, .28);
  background: var(--signal-wash);
  padding: 0 13px;
}

.volume-coverage strong {
  flex: 0 0 auto;
  color: var(--signal);
  font-size: 9px;
}

.volume-coverage span {
  color: #9eb9ae;
  font-size: 9px;
  line-height: 1.45;
}

.volume-coverage.is-partial {
  border-color: rgba(217, 184, 96, .32);
  background: rgba(217, 184, 96, .055);
}

.volume-coverage.is-partial strong { color: var(--warning); }
.volume-coverage.is-partial span { color: #b9aa82; }
.volume-coverage.is-error {
  border-color: rgba(255, 79, 89, .3);
  background: var(--sell-wash);
}
.volume-coverage.is-error strong { color: var(--sell); }
.volume-coverage.is-error span { color: #c89497; }

.volume-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .45fr);
  margin: 16px 20px 20px;
  border: 1px solid var(--line);
  background: var(--panel-deep);
}

.volume-chart-panel, .volume-breakdown { min-width: 0; }
.volume-chart-panel { border-right: 1px solid var(--line); }
.volume-chart-panel > header, .volume-breakdown > header {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 13px 15px;
}

.volume-chart-panel h3, .volume-breakdown h3 {
  margin: 0;
  color: var(--text);
  font-size: 11px;
  font-weight: 690;
  letter-spacing: -.02em;
}

.volume-chart-panel header p, .volume-breakdown header p {
  margin: 5px 0 0;
  color: #77787c;
  font-size: 8px;
}

.volume-chart-panel header > span, .volume-breakdown header > span {
  flex: 0 0 auto;
  color: #8c8d90;
  font: 640 8px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: right;
}

.volume-chart-scroll {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-color: #3c3d40 #141415;
  scrollbar-width: thin;
}

.volume-chart-scroll::-webkit-scrollbar { height: 8px; }
.volume-chart-scroll::-webkit-scrollbar-track { background: #141415; }
.volume-chart-scroll::-webkit-scrollbar-thumb {
  border: 2px solid #141415;
  border-radius: 8px;
  background: #3c3d40;
}

.volume-chart {
  position: relative;
  display: flex;
  min-width: 560px;
  min-height: 284px;
  align-items: stretch;
  gap: 8px;
  padding: 28px 18px 17px;
}

.volume-chart::before,
.volume-chart::after {
  content: "";
  position: absolute;
  right: 18px;
  left: 18px;
  border-top: 1px dashed #33383b;
  pointer-events: none;
}

.volume-chart::before { top: 35%; }
.volume-chart::after { top: 66%; }

.volume-chart-empty {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  place-items: center;
  color: #6f7074;
  font-size: 9px;
}

.volume-bar-column {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 12px;
  flex: 1 1 0;
  grid-template-rows: 1fr auto;
  gap: 9px;
}

.volume-bar-track {
  position: relative;
  display: flex;
  min-height: 214px;
  align-items: end;
  justify-content: center;
  border-bottom: 1px solid #3a3e41;
}

.volume-bar-stack {
  width: min(30px, 72%);
  height: var(--bar-height);
  min-height: 0;
  display: flex;
  flex-direction: column-reverse;
  overflow: hidden;
  border: 1px solid rgba(191, 197, 207, .32);
  border-bottom: 0;
}

.volume-bar-column.has-volume .volume-bar-stack { min-height: 3px; }
.volume-bar-segment {
  display: block;
  min-height: 0;
  height: var(--segment-share);
  background: color-mix(in srgb, var(--venue-color, #7d8c91) 58%, #111214);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .13);
  transition: background .12s ease;
}
.volume-bar-column:hover .volume-bar-segment,
.volume-bar-column:focus-within .volume-bar-segment {
  background: var(--venue-color, #aeb1b8);
}

.volume-bar-label {
  color: #737478;
  font: 600 7px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: center;
  white-space: nowrap;
}

.volume-bar-tooltip {
  position: absolute;
  z-index: 2;
  bottom: calc(var(--bar-height) + 8px);
  left: 50%;
  width: max-content;
  min-width: 174px;
  max-width: 240px;
  transform: translateX(-50%);
  border: 1px solid var(--line-strong);
  background: #0d0d0e;
  color: var(--text);
  opacity: 0;
  padding: 8px 9px;
  pointer-events: none;
  font: 620 8px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  transition: opacity .12s ease;
}

.volume-bar-tooltip strong,
.volume-bar-tooltip b,
.volume-bar-tooltip span { display: block; }
.volume-bar-tooltip strong { color: #f0f0ee; margin-bottom: 4px; }
.volume-bar-tooltip span { display: flex; align-items: center; gap: 6px; color: #bdc1c8; }
.volume-bar-tooltip span i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--venue-color, #aeb1b8);
}
.volume-bar-tooltip em { color: inherit; font-style: normal; }
.volume-bar-tooltip b { margin-top: 5px; color: #f0f0ee; font-weight: 700; }

.volume-bar-column:hover .volume-bar-tooltip,
.volume-bar-column:focus-within .volume-bar-tooltip { opacity: 1; }
.volume-bar-column.is-first .volume-bar-tooltip { left: 0; transform: none; }
.volume-bar-column.is-last .volume-bar-tooltip { right: 0; left: auto; transform: none; }

.venue-volume-list { padding: 5px 14px 14px; }
.venue-volume-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.venue-volume-row:last-child { border-bottom: 0; }
.venue-volume-row > div { min-width: 0; }
.venue-volume-row strong, .venue-volume-row span { display: block; }
.venue-volume-row strong {
  color: var(--muted-strong);
  font-size: 10px;
}
.venue-volume-row strong { display: flex; align-items: center; }
.venue-volume-marker { margin-right: 7px; }
.venue-volume-row > i span { background: var(--venue-color, var(--signal)); }
.venue-volume-empty {
  margin: 0;
  padding: 16px 0;
  color: #77787c;
  font-size: 9px;
}
.venue-volume-row span {
  margin-top: 5px;
  overflow: hidden;
  color: #747579;
  font: 600 8px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.venue-volume-row b {
  color: var(--text);
  font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.venue-volume-row > i {
  grid-column: 1 / -1;
  height: 4px;
  overflow: hidden;
  background: #292a2c;
}
.venue-volume-row > i > span {
  display: block;
  width: var(--venue-share);
  height: 100%;
  margin: 0;
  background: var(--signal);
}

.flush-footer {
  display: flex;
  min-height: 49px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #707176;
  padding: 0 4px;
  font-size: 9px;
  line-height: 1.45;
}
.flush-footer span:last-child { color: #9d8d62; text-align: right; }

.toast {
  position: fixed;
  z-index: 20;
  right: 24px;
  bottom: 24px;
  max-width: 380px;
  transform: translateY(9px);
  border: 1px solid #3a3b3e;
  border-radius: 9px;
  background: #1c1d1f;
  color: #e4e4e1;
  opacity: 0;
  padding: 12px 14px;
  pointer-events: none;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .38);
  font: 600 11px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 1260px) {
  .plan-item {
    grid-template-columns: minmax(250px, .75fr) minmax(380px, 1.25fr);
    column-gap: 18px;
  }
}

@media (max-width: 980px) {
  .plan-item { display: block; }
  .plan-progress, .plan-log, .plan-actions { margin-top: 13px; }
  .volume-detail-grid { grid-template-columns: 1fr; }
  .volume-chart-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 820px) {
  .flush-shell { padding: 0 12px 12px; }
  .flush-topbar { min-height: 70px; }
  .brand-lockup { gap: 18px; }
  .workspace-nav { min-height: 70px; gap: 14px; }
  .member-chip { min-width: 48px; width: 48px; padding: 0 9px; }
  .member-chip > span:nth-child(2), .member-chip > i { display: none; }
  .page-heading { display: block; min-height: 0; padding: 28px 4px 24px; }
  .page-heading p { max-width: 56ch; }
  .capability-state { min-width: 0; margin-top: 23px; }
  .flush-workspace { grid-template-columns: 1fr; }
  .plan-editor, .execution-panel { border-right: 0; }
  .execution-panel { border-top: 1px solid var(--line); }
  .plan-queue { margin-top: 12px; }
  .volume-analytics { margin-top: 12px; }
  .volume-summary-row strong { font-size: 18px; }
  .flush-footer { display: block; padding: 13px 4px 0; }
  .flush-footer span { display: block; }
  .flush-footer span + span { margin-top: 5px; text-align: left; }
}

@media (max-width: 520px) {
  .brand-name { display: none; }
  .workspace-nav { gap: 13px; overflow-x: auto; scrollbar-width: none; }
  .workspace-nav::-webkit-scrollbar { display: none; }
  .workspace-nav a { font-size: 8px; letter-spacing: .02em; white-space: nowrap; }

  .hedge-cost-heading { display: block; }
  .hedge-cost-state { display: inline-block; margin-top: 8px; text-align: left; }
  .hedge-cost-metrics, .hedge-cost-legs { grid-template-columns: 1fr; }
  .page-heading h1 { font-size: 34px; }
  .panel-heading { min-height: 74px; padding: 15px; }
  #planForm { padding: 16px 15px 18px; }
  .field-grid { grid-template-columns: 1fr; }
  .plan-calculation { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-calculation div { min-height: 62px; }
  .execution-flow { padding: 16px 15px; }
  .flow-intro { grid-template-columns: 45px minmax(0, 1fr); }
  .flow-branch { gap: 8px; }
  .flow-order { min-height: 86px; padding: 10px 8px; }
  .flow-order span { font-size: 7px; }
  .flow-node {
    grid-template-columns: 30px minmax(0, 1fr);
    padding: 13px 12px;
  }
  .flow-step { width: 28px; height: 28px; }
  .flow-gate {
    grid-column: 2;
    justify-self: start;
    margin-top: -2px;
  }
  .queue-actions { gap: 5px; }
  .queue-actions .api-settings-button { padding: 0 8px; }
  .api-dialog {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
  }
  .api-dialog-header { min-height: 86px; padding: 16px; }
  .api-dialog-header p { max-width: 38ch; }
  .api-dialog-body {
    grid-template-columns: 1fr;
    max-height: calc(100dvh - 198px);
    padding: 14px;
  }
  .api-security-note {
    display: block;
    padding: 11px 12px;
  }
  .api-security-note span {
    display: block;
    margin-top: 6px;
    text-align: left;
  }
  .api-dialog-footer { padding: 10px 14px; }
  .volume-analytics-heading {
    display: block;
    padding-bottom: 14px;
  }
  .volume-range {
    width: 100%;
    margin-top: 12px;
  }
  .volume-range button { flex: 1 1 0; }
  .volume-summary-head,
  .volume-summary-row { grid-template-columns: minmax(92px, .8fr) repeat(2, minmax(0, 1fr)); }
  .volume-summary-head > span { padding: 0 12px; font-size: 8px; }
  .volume-summary-row > div { min-height: 76px; padding: 12px; }
  .volume-summary-row strong { font-size: 15px; }
  .volume-summary-venue strong { font-size: 13px; }
  .volume-coverage {
    display: block;
    margin: 14px 15px 0;
    padding: 11px 12px;
  }
  .volume-coverage span { display: block; margin-top: 5px; }
  .volume-detail-grid { margin: 14px 15px 17px; }
  .volume-chart-panel > header, .volume-breakdown > header { padding: 12px; }
  .volume-chart {
    min-width: 100%;
    min-height: 260px;
    gap: 3px;
    padding-right: 10px;
    padding-left: 10px;
  }
  .volume-bar-column { min-width: 4px; }
  .volume-bar-label { font-size: 6px; }
  .safety-ledger { grid-template-columns: 1fr; margin: 16px 15px 18px; }
  .safety-ledger div { border-right: 0; }
  .safety-ledger div:nth-last-child(-n+2) { border-bottom: 1px solid rgba(24, 211, 145, .15); }
  .safety-ledger div:last-child { border-bottom: 0; }
  .toast { right: 12px; bottom: 12px; left: 12px; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
