:root {
  color-scheme: dark;
  --bg: #030503;
  --surface: #080c08;
  --surface-2: #0d120d;
  --surface-3: #121812;
  --line: #30431d;
  --line-soft: #172411;
  --text: #edf2ed;
  --muted: #9ba49e;
  --dim: #68716b;
  --accent: #b9ff32;
  --accent-dark: #172506;
  --green: #79d89b;
  --amber: #e4b765;
  --red: #e77e87;
  --rail: 190px;
  --inspector: 470px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; color: var(--text); background: var(--bg); }
body::after { content: ""; position: fixed; z-index: 80; inset: 0; pointer-events: none; opacity: .12; background: repeating-linear-gradient(180deg,transparent 0,transparent 3px,rgba(185,255,50,.035) 4px); mix-blend-mode: screen; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.app-shell { min-height: 100vh; }
.topbar {
  position: fixed; z-index: 30; inset: 0 0 auto 0; height: 68px;
  display: grid; grid-template-columns: var(--rail) minmax(0,1fr) auto; align-items: center;
  border-bottom: 1px solid var(--line); background: rgba(9,11,10,.94); backdrop-filter: blur(18px);
}
.brand { height: 68px; padding: 0 15px; display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; border-right: 1px solid var(--line); }
.brand strong { display: block; font: 720 12px/1 ui-monospace, monospace; letter-spacing: .12em; }
.brand small { display: block; margin-top: 5px; color: var(--dim); font-size: 8px; white-space: nowrap; }
.brand-mark { width: 22px; height: 20px; display: flex; align-items: end; gap: 2px; transform: skew(-9deg); }
.brand-mark i { display: block; width: 4px; background: var(--accent); animation: rise .7s both cubic-bezier(.2,.8,.2,1); }
.brand-mark i:nth-child(1) { height: 7px; opacity: .42; }
.brand-mark i:nth-child(2) { height: 13px; animation-delay: .06s; opacity: .62; }
.brand-mark i:nth-child(3) { height: 10px; animation-delay: .12s; opacity: .78; }
.brand-mark i:nth-child(4) { height: 20px; animation-delay: .18s; }
.runtime { min-width: 0; display: flex; align-items: center; gap: 17px; padding-left: 22px; }
.mode { padding: 5px 7px; border: 1px solid #4b5d18; background: var(--accent-dark); color: var(--accent); font: 650 8px/1 ui-monospace, monospace; letter-spacing: .12em; }
.source-state { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.source-state i { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px rgba(228,183,101,.07); }
.source-state.live i { background: var(--green); box-shadow: 0 0 0 4px rgba(121,216,155,.07); animation: pulse 2.2s infinite; }
.source-state.error i { background: var(--red); }
.runtime time { color: var(--dim); font: 9px/1 ui-monospace, monospace; white-space: nowrap; }
.button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 2px; padding: 9px 12px; cursor: pointer; font-size: 10px; font-weight: 650; transition: .16s ease; }
.button:hover { border-color: #465049; transform: translateY(-1px); }
.button:disabled { opacity: .38; cursor: not-allowed; transform: none; }
.button.primary { color: #071000; background: var(--accent); border-color: var(--accent); box-shadow: 0 0 18px rgba(185,255,50,.08); }
.refresh { margin-right: 16px; min-width: 88px; }
.refresh.loading span { display: inline-block; animation: spin .8s linear infinite; }

.rail { position: fixed; z-index: 20; top: 68px; bottom: 0; left: 0; width: var(--rail); padding: 18px 10px 14px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--bg); }
.rail-label { margin: 0 9px 12px; color: var(--accent); font: 10px/1 ui-monospace, monospace; letter-spacing: .08em; }
.rail-item { width: 100%; display: flex; gap: 10px; align-items: center; padding: 10px 9px; border: 0; border-radius: 2px; color: var(--muted); background: transparent; cursor: pointer; text-align: left; }
.rail-item span { width: 15px; color: var(--dim); font: 8px/1 ui-monospace, monospace; }
.rail-item strong { font-size: 10px; font-weight: 560; }
.rail-item:hover, .rail-item.active { color: var(--text); background: var(--surface-2); }
.rail-item.active { border: 1px solid #537c1c; box-shadow: inset 3px 0 0 var(--accent); }
.rail-item.active span { color: var(--accent); }
.account-link { padding-top: 14px; margin-top: 10px; border-top: 1px solid var(--line); }
.rail-spacer { flex: 1; }
.rail-boundary { display: flex; align-items: center; gap: 9px; padding: 9px; color: var(--dim); font: 8px/1.45 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .05em; }
.rail-boundary i { width: 6px; height: 6px; background: var(--green); border-radius: 50%; }

.workspace { margin-left: var(--rail); padding: 98px 30px 72px; max-width: 1740px; transition: padding-right .24s ease; }
body.inspector-open .workspace { padding-right: calc(var(--inspector) + 34px); }
.workspace-head { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 30px; }
.workspace-head h1, .workspace-head p, .section-head h2, .section-head p { margin-top: 0; }
.workspace-head h1 { margin-bottom: 8px; font-size: clamp(28px, 3.5vw, 44px); line-height: .98; letter-spacing: -.048em; font-weight: 620; }
.workspace-head > div:first-child > p:last-child { max-width: 720px; margin-bottom: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.eyebrow { margin: 0 0 9px; color: var(--dim); font: 650 8px/1 ui-monospace, monospace; letter-spacing: .13em; }
.operator { min-width: 170px; padding-left: 16px; border-left: 1px solid var(--line); }
.operator span, .operator small { display: block; color: var(--dim); font: 8px/1 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .09em; }
.operator strong { display: block; margin: 8px 0 6px; font-size: 13px; font-weight: 610; }

.metric-strip { display: grid; grid-template-columns: repeat(6,minmax(110px,1fr)); border: 1px solid var(--line); }
.metric { min-height: 90px; padding: 16px; border-right: 1px solid var(--line); background: linear-gradient(180deg,rgba(255,255,255,.014),transparent); }
.metric:last-child { border-right: 0; }
.metric label { display: block; margin-bottom: 14px; color: var(--dim); font: 8px/1 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .08em; }
.metric strong { display: block; font: 540 20px/1 ui-monospace, monospace; letter-spacing: -.045em; }
.metric small { display: block; margin-top: 8px; color: var(--muted); font-size: 9px; }
.metric:first-child { background: rgba(199,243,74,.025); box-shadow: inset 0 2px 0 rgba(199,243,74,.55); }
.metric:first-child strong { font-size: 24px; }
.threshold-strip { display: flex; align-items: center; gap: 11px; min-height: 39px; padding: 9px 13px; border: 1px solid var(--line); border-top: 0; color: var(--dim); font: 8px/1.4 ui-monospace, monospace; }
.threshold-strip > strong { color: var(--accent); letter-spacing: .08em; }
.threshold-strip i { width: 1px; height: 13px; background: var(--line); }
.screen-method { border: 1px solid var(--line); border-top: 0; color: var(--muted); }
.screen-method summary { padding: 10px 13px; color: var(--muted); cursor: pointer; font: 650 8px/1.4 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .06em; list-style-position: inside; }
.screen-method summary:hover { color: var(--text); }
.screen-method[open] summary { color: var(--accent); border-bottom: 1px solid var(--line-soft); }
.screen-method p { max-width: 930px; margin: 0; padding: 12px 27px 14px; color: var(--muted); font-size: 9px; line-height: 1.65; }
.screen-method p strong { color: var(--text); font-weight: 620; }

.page-panel { animation: pageIn .22s ease both; }
.page-head { margin-bottom: 26px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.page-head > p { margin: 0 0 12px; color: var(--accent); font-size: 11px; letter-spacing: .08em; }
.page-head h1 { margin: 0; font-size: clamp(27px,3.2vw,42px); line-height: 1; letter-spacing: -.04em; font-weight: 620; text-shadow: 0 0 18px rgba(185,255,50,.08); }
.page-head small { display: block; margin-top: 11px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.terminal-cursor { display: inline-block; width: .48em; height: .92em; margin-left: 9px; vertical-align: -.08em; background: var(--accent); box-shadow: 0 0 12px rgba(185,255,50,.36); animation: blink 1.05s steps(1,end) infinite; }

.start-console { border: 1px solid var(--line); background: linear-gradient(180deg,rgba(185,255,50,.012),transparent 35%); }
.setup-step { position: relative; display: grid; grid-template-columns: 72px minmax(250px,.85fr) minmax(340px,1.15fr); min-height: 176px; border-bottom: 1px solid var(--line); }
.setup-step:last-child { border-bottom: 0; }
.setup-step::before { content: ""; position: absolute; left: 35px; top: 56px; bottom: -1px; border-left: 1px dashed #39591b; }
.setup-step:last-child::before { display: none; }
.setup-step.current { box-shadow: inset 3px 0 0 var(--accent); }
.setup-step.done .step-index { color: #071000; background: var(--accent); border-color: var(--accent); }
.setup-step.locked:not(.current) { opacity: .76; }
.step-index { align-self: start; justify-self: center; min-width: 42px; margin-top: 22px; padding: 10px 6px; border: 1px solid #61713f; color: var(--muted); text-align: center; font-size: 11px; }
.current .step-index { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 12px rgba(185,255,50,.08); }
.step-copy { padding: 24px 24px 24px 8px; }
.step-copy h2 { margin: 0; font-size: 17px; font-weight: 620; letter-spacing: -.02em; }
.step-copy h2::before { content: "> "; color: var(--accent); }
.step-copy > p { max-width: 560px; margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.step-copy > strong { display: block; margin-top: 18px; color: var(--accent); font-size: 11px; font-weight: 560; }
.step-action, .automation-controls, .step-wallet-grid { margin: 20px; align-self: center; }
.step-action { display: grid; gap: 10px; }
.strategy-setup { margin: 20px 0; padding: 20px; border: 1px solid var(--line); }
.strategy-setup > .automation-controls { margin: 20px 0 0; max-width: 720px; }
.step-action small, .automation-controls > small { color: var(--dim); font-size: 9px; line-height: 1.5; }
.identity-actions { display: grid; gap: 7px; }
.identity-row { display: grid; grid-template-columns: minmax(145px,1fr) auto 38px; gap: 7px; }
.identity-row + small { margin-bottom: 5px; padding-left: 2px; font: 8px/1.3 ui-monospace, monospace; }
.identity-row .button { min-height: 46px; }
.identity-row .optional { color: var(--accent); }
.start-action { width: 100%; min-height: 58px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.start-action::before { content: "> "; }
.button.wallet-disconnect { border-color: #725c1c; color: var(--amber); background: rgba(242,191,82,.035); }
.button.wallet-disconnect:hover { border-color: var(--amber); color: var(--text); }
.balance-lines { margin-top: 20px; border: 1px solid var(--line); }
.balance-lines span { display: flex; justify-content: space-between; gap: 18px; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); color: var(--muted); font-size: 10px; }
.balance-lines span:last-child { border-bottom: 0; }
.balance-lines i { color: var(--accent); font-style: normal; }
.balance-lines strong { margin-left: auto; color: var(--text); font-weight: 560; }
.terminal-notice { margin-top: 12px; padding: 11px 12px; border: 1px solid var(--line); color: var(--muted); font-size: 9px; line-height: 1.45; }
.terminal-notice.amber, .status-line.amber { border-color: #705218; color: var(--amber); }
.deposit-box { display: grid; gap: 11px; padding: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.008); }
.deposit-box label { color: var(--accent); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.wallet-portfolio-link { display: block; color: inherit; text-decoration: none; }
.wallet-portfolio-link[aria-disabled="true"] { pointer-events: none; }
.deposit-box code { min-height: 64px; display: grid; place-items: center; padding: 12px; border: 1px dashed #486125; color: var(--dim); font: 11px/1.4 ui-monospace, monospace; overflow-wrap: anywhere; }
.wallet-portfolio-link[href]:hover code, .wallet-portfolio-link[href]:focus-visible code { border-color: var(--accent); color: var(--accent); background: rgba(185,255,50,.025); }
.wallet-portfolio-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.copy-address { min-height: 42px; color: var(--accent); }
.deposit-box.large { margin: 0; align-self: stretch; }
.deposit-box.large code { min-height: 150px; }
.deposit-box > small { color: var(--dim); font-size: 9px; line-height: 1.45; }
.step-wallet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.deposit-box.compact { margin: 0; min-width: 0; }
.deposit-box.compact code { min-height: 52px; font-size: 9px; }
.automation-controls { display: grid; gap: 9px; }
.automation-controls > label { display: grid; gap: 7px; color: var(--accent); font-size: 9px; text-transform: uppercase; }
.deployment-network { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 0; padding: 0; border: 0; }
.deployment-network legend { grid-column: 1/-1; margin-bottom: 1px; color: var(--accent); font-size: 9px; text-transform: uppercase; }
.network-choice { min-width: 0; padding: 11px 12px; border: 1px solid var(--line); background: rgba(255,255,255,.008); color: var(--muted); cursor: pointer; text-align: left; }
.network-choice span, .network-choice small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.network-choice span { color: var(--text); font: 620 10px/1 ui-monospace, monospace; }
.network-choice small { margin-top: 7px; color: var(--dim); font: 8px/1 ui-monospace, monospace; }
.network-choice:hover, .network-choice.active { border-color: var(--accent); background: rgba(185,255,50,.035); box-shadow: inset 3px 0 0 var(--accent); }
.network-choice.active span, .network-choice.active small { color: var(--accent); }
.automation-controls > p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.automation-actions { display: grid; grid-template-columns: .7fr 1.3fr; gap: 8px; margin-top: 5px; }
.automation-actions .button { min-height: 44px; }
.locked-reason { text-align: right; }
.button.danger { border-color: #65363b; color: var(--red); background: rgba(231,126,135,.035); }
.button.danger:not(:disabled):hover { border-color: var(--red); color: var(--text); }
.live-actions { margin-top: 0; }

.fund-network-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.fund-network-card, .account-grid > section, .empty-console { padding: 24px; border: 1px solid var(--line); background: rgba(185,255,50,.008); }
.status-line { display: inline-block; margin-bottom: 18px; color: var(--accent); font-size: 10px; }
.fund-network-card h2, .account-grid h2, .empty-console h2 { margin: 0 0 10px; font-size: 17px; }
.fund-network-card p, .account-grid p, .empty-console p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.fund-network-card dl { margin: 24px 0; border: 1px solid var(--line-soft); }
.fund-network-card dl > div { display: flex; justify-content: space-between; gap: 24px; padding: 12px; border-bottom: 1px solid var(--line-soft); }
.fund-network-card dl > div:last-child { border-bottom: 0; }
.fund-network-card dt { color: var(--dim); font-size: 9px; text-transform: uppercase; }
.fund-network-card dd { margin: 0; color: var(--text); font-size: 10px; }
.fund-network-card .combined-wallet-value { background: rgba(185,255,50,.025); }
.fund-network-card .combined-wallet-value dt, .fund-network-card .combined-wallet-value dd { color: var(--accent); font-weight: 650; }
.withdraw-box { display: grid; gap: 14px; margin-top: 18px; padding: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.012); }
.withdraw-box > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.withdraw-box > header div { display: flex; align-items: center; gap: 9px; }
.withdraw-box > header span { color: var(--amber); font-size: 8px; }
.withdraw-box > header strong { font-size: 11px; }
.withdraw-box > header small, .withdraw-help { color: var(--dim); font-size: 8px; line-height: 1.5; }
.withdraw-fields { display: grid; grid-template-columns: minmax(90px,.45fr) minmax(120px,.55fr); gap: 10px; }
.withdraw-fields label { display: grid; gap: 7px; }
.withdraw-fields label.wide { grid-column: 1/-1; }
.withdraw-fields label > span { color: var(--dim); font-size: 8px; text-transform: uppercase; }
.withdraw-fields input, .withdraw-fields select { width: 100%; min-height: 39px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 0; color: var(--text); background: var(--bg); font: 9px/1.3 ui-monospace, monospace; }
.withdraw-fields input:focus, .withdraw-fields select:focus { outline: 1px solid var(--accent); outline-offset: 1px; }
.withdraw-action { width: 100%; }
.withdraw-box.native-blocked .withdraw-help { color: var(--amber); }

.strategy-switcher { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.strategy-choice { display: grid; gap: 8px; min-height: 90px; padding: 18px; border: 1px solid var(--line); color: var(--muted); background: transparent; cursor: pointer; text-align: left; }
.strategy-choice strong { color: var(--text); font-size: 13px; }
.strategy-choice small { color: var(--dim); font-size: 10px; line-height: 1.45; }
.strategy-choice:hover, .strategy-choice.active { border-color: var(--accent); background: rgba(185,255,50,.025); box-shadow: inset 3px 0 0 var(--accent); }
.strategy-choice.spicy.active { border-color: var(--red); box-shadow: inset 3px 0 0 var(--red); }

.page-boundary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin-bottom: 28px; border: 1px solid var(--line); background: repeating-linear-gradient(135deg,rgba(185,255,50,.018) 0,rgba(185,255,50,.018) 7px,transparent 7px,transparent 14px); }
.page-boundary > div { min-height: 88px; padding: 16px 18px; border-right: 1px solid var(--line); background: rgba(9,11,10,.88); }
.page-boundary > div:last-child { border-right: 0; }
.page-boundary span, .page-boundary small { display: block; color: var(--dim); font-size: 8px; line-height: 1.45; }
.page-boundary span { color: var(--accent); letter-spacing: .08em; }
.page-boundary strong { display: block; margin: 9px 0 7px; font-size: 12px; }
.strategy-operations, .strategy-history { margin-bottom: 30px; }
.strategy-operations .section-head, .strategy-history .section-head, .playbook-head { margin-bottom: 12px; }
.playbook-head { margin-top: 36px; }
.mandate-console { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 0; padding: 0; border: 0; background: transparent; }
.mandate-empty { grid-column: 1/-1; display: grid; grid-template-columns: auto minmax(130px,1fr) minmax(220px,2fr); gap: 14px; align-items: center; padding: 15px; border: 1px solid var(--line); background: rgba(185,255,50,.018); }
.mandate-empty > span { color: var(--accent); font-size: 9px; }
.mandate-empty > strong { font-size: 10px; }
.mandate-empty > small { color: var(--dim); font-size: 8px; line-height: 1.45; text-align: right; }
.mandate-card { position: relative; overflow: hidden; border: 1px solid var(--line); background: rgba(255,255,255,.009); }
.mandate-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--accent); }
.mandate-card.paused::before { background: var(--amber); }
.mandate-card.stopping::before, .mandate-card.faulted::before { background: var(--red); }
.mandate-card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 16px 13px 19px; border-bottom: 1px solid var(--line-soft); }
.mandate-card-head > div { min-width: 0; }
.mandate-card-head span, .mandate-card-head small { display: block; color: var(--dim); font-size: 8px; }
.mandate-card-head span { margin-bottom: 8px; color: var(--accent); letter-spacing: .08em; }
.mandate-card.paused .mandate-card-head span { color: var(--amber); }
.mandate-card.stopping .mandate-card-head span { color: var(--red); }
.mandate-card-head strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.mandate-pulse { flex: 0 0 auto; width: 9px; height: 9px; border: 1px solid var(--accent); border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgba(185,255,50,.07); animation: pulse 2.2s infinite; }
.paused .mandate-pulse { border-color: var(--amber); background: transparent; box-shadow: none; animation: none; }
.stopping .mandate-pulse { border-color: var(--red); background: var(--red); box-shadow: 0 0 0 5px rgba(231,126,135,.06); }
.mandate-metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.mandate-metrics > div { min-width: 0; padding: 12px 16px 13px 19px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.mandate-metrics > div:nth-child(2n) { border-right: 0; }
.mandate-metrics span, .mandate-metrics small { display: block; color: var(--dim); font-size: 8px; line-height: 1.45; }
.mandate-metrics strong { display: block; margin: 7px 0 4px; overflow: hidden; color: var(--text); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.profit-taking { border-bottom: 1px solid var(--line-soft); background: linear-gradient(135deg,rgba(185,255,50,.025),transparent 62%); }
.profit-taking > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px 14px 19px; cursor: pointer; list-style: none; }
.profit-taking > summary::-webkit-details-marker { display: none; }
.profit-taking > summary > span { min-width: 0; }
.profit-taking > summary b, .profit-taking > summary strong, .profit-taking > summary small { display: block; }
.profit-taking > summary b { margin-bottom: 6px; color: var(--dim); font-size: 8px; letter-spacing: .08em; }
.profit-taking.enabled > summary b, .profit-taking.ready > summary b { color: var(--accent); }
.profit-taking > summary strong { color: var(--text); font-size: 10px; }
.profit-taking > summary small { margin-top: 4px; color: var(--dim); font-size: 8px; line-height: 1.4; }
.profit-taking > summary > i { flex: 0 0 auto; color: var(--accent); font: 18px/1 ui-monospace,monospace; transition: transform .2s ease; }
.profit-taking[open] > summary > i { transform: rotate(45deg); }
.profit-taking-form { border-top: 1px solid var(--line-soft); }
.profit-taking-hero { display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); border-bottom: 1px solid var(--line-soft); }
.profit-toggle, .profit-recommendation { position: relative; min-width: 0; padding: 16px 18px 16px 19px; }
.profit-toggle { display: grid; grid-template-columns: 34px minmax(0,1fr); grid-template-rows: auto auto; column-gap: 11px; align-content: center; border-right: 1px solid var(--line-soft); cursor: pointer; }
.profit-toggle input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.profit-toggle > span { position: relative; grid-row: 1/3; align-self: center; width: 34px; height: 18px; border: 1px solid #4d574b; border-radius: 999px; background: #111512; transition: .2s ease; }
.profit-toggle > span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--dim); transition: .2s ease; }
.profit-toggle input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }
.profit-toggle input:checked + span { border-color: var(--accent); background: rgba(185,255,50,.15); box-shadow: 0 0 18px rgba(185,255,50,.08); }
.profit-toggle input:checked + span::after { left: 19px; background: var(--accent); }
.profit-toggle b, .profit-toggle small { min-width: 0; }
.profit-toggle b { align-self: end; color: var(--text); font-size: 10px; }
.profit-toggle small { margin-top: 5px; color: var(--dim); font-size: 8px; line-height: 1.4; }
.profit-recommendation { background: rgba(185,255,50,.035); }
.profit-recommendation span, .profit-recommendation strong, .profit-recommendation small { display: block; }
.profit-recommendation span { color: var(--accent); font-size: 8px; letter-spacing: .07em; }
.profit-recommendation strong { margin-top: 7px; color: var(--text); font-size: 13px; }
.profit-recommendation small { margin-top: 5px; color: var(--muted); font-size: 8px; line-height: 1.45; }
.profit-recommendation .text-button { margin-top: 10px; padding: 0; border: 0; color: var(--accent); background: transparent; font: 700 8px/1.2 ui-monospace,monospace; cursor: pointer; }
.profit-recommendation .text-button:hover { color: var(--text); }
.profit-progress { padding: 13px 18px 14px 19px; border-bottom: 1px solid var(--line-soft); }
.profit-paused { margin: 0; padding: 11px 18px 12px 19px; border-bottom: 1px solid var(--line-soft); color: var(--warn); background: rgba(255,198,76,.035); font-size: 8px; line-height: 1.5; }
.profit-progress header { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.profit-progress header span { color: var(--dim); font-size: 8px; }
.profit-progress header strong { color: var(--text); font-size: 9px; text-align: right; }
.profit-progress > div { height: 4px; margin-top: 10px; overflow: hidden; background: #1b211b; }
.profit-progress > div i { display: block; height: 100%; background: var(--amber); box-shadow: 0 0 12px rgba(239,187,80,.2); transition: width .25s ease; }
.profit-progress.ready > div i { background: var(--accent); box-shadow: 0 0 12px rgba(185,255,50,.22); }
.profit-progress > small { display: block; margin-top: 8px; color: var(--dim); font-size: 8px; line-height: 1.45; }
.profit-fields { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border-bottom: 1px solid var(--line-soft); }
.profit-fields label { min-width: 0; padding: 13px 14px 14px 19px; border-right: 1px solid var(--line-soft); }
.profit-fields label:last-child { border-right: 0; }
.profit-fields span, .profit-fields strong, .profit-fields small { display: block; }
.profit-fields span { color: var(--dim); font-size: 7px; letter-spacing: .05em; }
.profit-fields strong { margin-top: 6px; color: var(--text); font-size: 9px; }
.profit-fields input { width: 100%; margin-top: 10px; padding: 9px 8px; border: 1px solid #3d4935; border-radius: 0; color: var(--text); background: #090c09; font: 700 11px/1 ui-monospace,monospace; }
.profit-fields input:focus { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 2px rgba(185,255,50,.08); }
.profit-fields small { margin-top: 6px; color: var(--dim); font-size: 7px; line-height: 1.35; }
.profit-evidence { padding: 11px 18px 12px 19px; border-bottom: 1px solid var(--line-soft); }
.profit-evidence span { color: var(--dim); font-size: 7px; letter-spacing: .06em; }
.profit-evidence p { margin: 6px 0 0; color: var(--muted); font-size: 8px; line-height: 1.45; }
.profit-taking-form > footer { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 18px; align-items: center; padding: 14px 16px 16px 19px; }
.profit-taking-form > footer p { margin: 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.profit-taking-form > footer p b { color: var(--text); }
.profit-taking-form > footer .button { min-width: 160px; min-height: 42px; }
.strategy-pools { border-bottom: 1px solid var(--line-soft); }
.strategy-pools > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 16px 10px 19px; color: var(--dim); font-size: 8px; letter-spacing: .05em; }
.strategy-pools > header small { font-size: 8px; }
.strategy-pools > p { margin: 0; padding: 14px 19px; border-top: 1px solid var(--line-soft); color: var(--dim); font-size: 9px; }
.strategy-pool { display: grid; grid-template-columns: minmax(150px,.85fr) minmax(130px,.6fr) minmax(260px,1.4fr); border-top: 1px solid var(--line-soft); background: rgba(255,255,255,.006); }
.strategy-pool > div { min-width: 0; padding: 12px 14px 13px 19px; border-right: 1px solid var(--line-soft); }
.strategy-pool > div:last-child { border-right: 0; }
.strategy-pool span, .strategy-pool small { display: block; color: var(--dim); font-size: 8px; line-height: 1.45; }
.strategy-pool-head > span { color: var(--accent); }
.strategy-pool.warning .strategy-pool-head > span, .strategy-pool.waiting .strategy-pool-head > span { color: var(--amber); }
.strategy-pool.error .strategy-pool-head > span { color: var(--red); }
.strategy-pool strong { display: block; margin: 7px 0 4px; color: var(--text); font-size: 10px; }
.strategy-pool-id code { display: block; margin: 7px 0 6px; overflow: hidden; color: var(--muted); font: 8px/1.35 ui-monospace, monospace; overflow-wrap: anywhere; text-overflow: ellipsis; }
.pool-links { display: flex; flex-wrap: wrap; gap: 8px 13px; }
.pool-links a, .pool-links button { padding: 0; border: 0; color: var(--accent); background: transparent; font: 700 8px/1.2 ui-monospace, monospace; text-decoration: none; cursor: pointer; }
.pool-links a:hover, .pool-links button:hover { color: var(--text); }
.mandate-error { margin: 12px 16px 0 19px; padding: 10px 11px; border: 1px solid #65363b; color: var(--red); font-size: 8px; line-height: 1.5; }
.decision-console { margin: 14px 16px 0 19px; border: 1px solid #4a5228; background: linear-gradient(90deg,rgba(199,243,74,.045),rgba(199,243,74,.008)); }
.decision-console.waiting { border-color: #665523; background: linear-gradient(90deg,rgba(239,187,80,.07),rgba(239,187,80,.008)); }
.decision-console.warning, .decision-console.error { border-color: #65363b; background: linear-gradient(90deg,rgba(238,102,113,.07),rgba(238,102,113,.008)); }
.decision-console.paused { border-color: var(--line); background: rgba(255,255,255,.012); }
.decision-console > header, .decision-console > footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 11px; }
.decision-console > header { border-bottom: 1px solid var(--line-soft); }
.decision-console > header span, .decision-console > footer span { color: var(--accent); font: 650 8px/1 ui-monospace,monospace; letter-spacing: .07em; }
.decision-console.waiting > header span, .decision-console.waiting > footer span { color: var(--amber); }
.decision-console.warning > header span, .decision-console.warning > footer span, .decision-console.error > header span, .decision-console.error > footer span { color: var(--red); }
.decision-console > header small { color: var(--dim); font-size: 8px; }
.decision-copy { padding: 13px 11px 12px; }
.decision-copy strong { display: block; color: var(--text); font-size: 12px; line-height: 1.35; }
.decision-copy p, .decision-console > footer p { margin: 6px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.decision-console dl { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin: 0; border-top: 1px solid var(--line-soft); }
.decision-console dl > div { min-width: 0; padding: 10px 11px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.decision-console dl > div:nth-child(2n) { border-right: 0; }
.decision-console dt { color: var(--dim); font: 7px/1.2 ui-monospace,monospace; letter-spacing: .05em; }
.decision-console dd { margin: 6px 0 0; color: var(--text); font-size: 9px; line-height: 1.35; overflow-wrap: anywhere; }
.decision-console > footer { align-items: flex-start; }
.decision-console > footer p { flex: 1; margin: 0; }
.mandate-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 7px; padding: 13px 16px 16px 19px; }
.mandate-actions .button { min-height: 40px; font-size: 9px; }
.strategy-history-list { border: 1px solid var(--line); }
.strategy-history-list > p { margin: 0; padding: 18px; color: var(--dim); font-size: 9px; }
.strategy-history-row { display: grid; grid-template-columns: minmax(150px,1.2fr) minmax(110px,.8fr) minmax(120px,.8fr) minmax(140px,1fr); gap: 16px; align-items: center; padding: 13px 15px; border-bottom: 1px solid var(--line-soft); }
.strategy-history-row:last-child { border-bottom: 0; }
.strategy-history-row span, .strategy-history-row small { display: block; color: var(--dim); font-size: 8px; line-height: 1.4; }
.strategy-history-row strong { display: block; margin: 6px 0 4px; font-size: 9px; }
.strategy-history-row .history-fault { color: var(--red); }
.strategy-history-row .history-stopped { color: var(--muted); }

.empty-console { max-width: 720px; }
.empty-console > span { display: block; margin-bottom: 18px; color: var(--accent); }
.empty-console .button { margin-top: 22px; }
.portfolio-grid { display: grid; gap: 14px; }
.portfolio-overview { border: 1px solid var(--line); border-top: 2px solid var(--accent); background: rgba(185,255,50,.018); }
.portfolio-overview > header { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.portfolio-overview > header span { color: var(--accent); font-size: 8px; letter-spacing: .07em; }
.portfolio-overview > header h2 { margin: 7px 0 5px; font-size: 20px; }
.portfolio-overview > header p { max-width: 850px; margin: 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.portfolio-overview-networks { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.portfolio-overview-network { min-width: 0; border-right: 1px solid var(--line); }
.portfolio-overview-network:last-child { border-right: 0; }
.portfolio-overview-network > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 15px; border-bottom: 1px solid var(--line-soft); }
.portfolio-overview-network > header span, .portfolio-overview-network > header small { display: block; color: var(--dim); font-size: 8px; }
.portfolio-overview-network > header span { margin-bottom: 5px; color: var(--accent); }
.portfolio-overview-network > header strong { display: block; font-size: 11px; }
.portfolio-overview-network > header small { max-width: 220px; text-align: right; }
.portfolio-overview-network dl { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin: 0; }
.portfolio-overview-network dl > div { min-width: 0; padding: 13px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.portfolio-overview-network dl > div:nth-child(3n) { border-right: 0; }
.portfolio-overview-network dt { color: var(--muted); font-size: 9px; text-transform: uppercase; line-height: 1.5; }
.portfolio-overview-network dd { margin: 8px 0 6px; color: var(--text); font-size: 16px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.portfolio-overview-network dl small { display: block; color: var(--muted); font-size: 9px; line-height: 1.55; }
.portfolio-overview-network .portfolio-total { background: rgba(185,255,50,.025); }
.portfolio-overview-network .portfolio-retained { grid-column: 1 / -1; border-right: 0; background: rgba(83,214,255,.025); }
.portfolio-overview-network .pnl-positive { color: var(--accent); }
.portfolio-overview-network .pnl-negative { color: var(--red); }
.portfolio-overview-network .pnl-unavailable { color: var(--amber); }
.portfolio-overview-network > footer { display: flex; align-items: center; gap: 9px; padding: 10px 13px; color: var(--dim); font-size: 8px; }
.portfolio-overview-network > footer strong { color: var(--text); }
.portfolio-overview-network > footer a { margin-left: auto; color: var(--accent); text-decoration: none; }
.money-group-label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 12px; padding: 10px 13px; color: var(--text); font-size: 10px; border-bottom: 1px solid var(--line-soft); background: rgba(185,255,50,.035); }
.money-group-label small { font-size: 9px; color: var(--muted); }
.run-status-strip { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 18px; padding: 18px 20px; border: 1px solid var(--line); border-left: 3px solid var(--accent); background: rgba(185,255,50,.025); margin-bottom: 20px; }
.portfolio-grid > .run-status-strip { margin-bottom: 0; }
.run-status-strip > div > span, .run-status-strip small { display: block; color: var(--muted); font-size: 10px; line-height: 1.6; }
.run-status-strip > div > span { color: var(--accent); }
.run-status-strip strong { display: block; margin: 5px 0; font-size: 18px; }
.run-status-chains { display: flex; flex-wrap: wrap; gap: 10px; }
.run-status-chains span { padding: 9px 14px; border: 1px solid var(--line); min-width: 120px; }
.run-status-chains b { display: block; color: var(--text); font-size: 11px; font-weight: 500; }
.accounting-attention { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 16px 20px; border: 1px solid var(--amber); background: rgba(255,185,60,.035); }
.accounting-attention > span { font-size: 10px; color: var(--amber); }
.accounting-attention > div { flex: 1; min-width: 180px; }
.accounting-attention strong { font-size: 12px; }
.accounting-attention p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; max-width: 80ch; }
.retained-attention { border-color: #53d6ff; background: rgba(83,214,255,.035); }
.retained-attention > span { color: #53d6ff; }
.disclosure-panel { border: 1px solid var(--line); }
.disclosure-panel > summary { cursor: pointer; padding: 17px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.disclosure-panel > summary::after { content: '+'; margin-left: auto; color: var(--accent); }
.disclosure-panel[open] > summary::after { content: '−'; }
.disclosure-panel > summary span { color: var(--accent); font-size: 9px; }
.disclosure-panel > summary strong { font-size: 13px; }
.disclosure-panel > summary small { color: var(--muted); font-size: 10px; }
.disclosure-panel > p { margin: 14px 20px; max-width: 100ch; color: var(--muted); font-size: 11px; line-height: 1.7; }
.strategy-history.disclosure-panel .strategy-history-list { border: 0; border-top: 1px solid var(--line); }
.discovery-boundary, .launch-watchlist { margin: 24px 0; padding: 20px; border: 1px solid var(--line); min-width: 0; }
.discovery-boundary > span, .discovery-tag { color: var(--amber) !important; font-size: 9px; }
.discovery-boundary > strong { display: block; margin-top: 8px; font-size: 14px; }
.discovery-boundary p, .discovery-note { max-width: 100ch; color: var(--muted); font-size: 11px; line-height: 1.7; }
.launch-row { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1.3fr) minmax(0,1fr) auto; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.launch-row > div { min-width: 0; overflow-wrap: anywhere; }
.launch-row strong { display: block; font-size: 12px; }
.launch-row span, .launch-row small { display: block; font-size: 10px; line-height: 1.6; color: var(--muted); }
.launch-row small { margin-top: 5px; }
.launch-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.launch-actions a { color: var(--accent); font-size: 11px; }
.launch-more summary { padding: 15px 0; cursor: pointer; color: var(--accent); font-size: 11px; }
@media (max-width: 1350px) {
  .portfolio-overview-networks { grid-template-columns: 1fr; }
  .portfolio-overview-network { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 800px) {
  .launch-row { grid-template-columns: 1fr 1fr; }
  .run-status-strip { padding: 14px; }
  .run-status-chains { width: 100%; }
  .run-status-chains span { flex: 1; }
}
.portfolio-live { border: 1px solid var(--line); border-top-color: var(--accent); background: rgba(185,255,50,.012); }
.portfolio-live > header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.portfolio-live > header span { display: block; color: var(--accent); font-size: 8px; letter-spacing: .06em; }
.portfolio-live > header h2 { margin: 7px 0 5px; font-size: 18px; }
.portfolio-live > header p { margin: 0; color: var(--muted); font-size: 9px; }
.portfolio-live-count { min-width: 150px; text-align: right; }
.portfolio-live-count strong { display: inline-block; margin-right: 7px; color: var(--accent); font-size: 25px; line-height: 1; }
.portfolio-live-count span { display: inline-block !important; }
.portfolio-live-count small { display: block; margin-top: 7px; color: var(--dim); font-size: 8px; }
.portfolio-position-list { display: grid; }
.portfolio-position-list > p { margin: 0; padding: 18px 20px; color: var(--dim); font-size: 9px; }
.portfolio-position { display: grid; grid-template-columns: minmax(210px,1.3fr) repeat(6,minmax(105px,.65fr)); gap: 14px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line-soft); }
.portfolio-position:last-child { border-bottom: 0; }
.portfolio-position > div { min-width: 0; }
.portfolio-position span, .portfolio-position small { display: block; color: var(--dim); font-size: 8px; line-height: 1.4; }
.portfolio-position strong { display: block; margin: 6px 0 4px; color: var(--text); font-size: 10px; overflow-wrap: anywhere; }
.portfolio-position-name > strong { font-size: 13px; }
.portfolio-position-state strong { color: var(--accent); }
.portfolio-position.entering .portfolio-position-state strong { color: var(--amber); }
.portfolio-position.exiting .portfolio-position-state strong, .portfolio-position.reconcile_required .portfolio-position-state strong { color: var(--red); }
.portfolio-position.historical { grid-template-columns: minmax(230px,1.45fr) minmax(150px,.85fr) minmax(150px,.85fr) minmax(130px,.7fr); background: rgba(255,255,255,.006); }
.portfolio-position.historical .portfolio-position-state strong { color: var(--muted); }
.portfolio-position-mark .pnl-positive { color: var(--accent); }
.portfolio-position-mark .pnl-negative { color: var(--red); }
.portfolio-position-mark .pnl-unavailable, .performance-network-head .pnl-unavailable { color: var(--amber); }
.portfolio-position .pool-links { margin-top: 8px; }
.portfolio-position .cycle-proof { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 14px; overflow-wrap: anywhere; }
.portfolio-position .cycle-proof strong { color: var(--accent); }
.portfolio-position .reconciliation-proof strong { color: var(--amber); }
.portfolio-position .retained-proof strong { color: #53d6ff; }
.performance-console { border: 1px solid var(--line); background: rgba(255,255,255,.008); }
.performance-console > header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px; border-bottom: 1px solid var(--line); }
.performance-console > header span, .performance-console > header small { display: block; color: var(--dim); font-size: 8px; }
.performance-console > header > div:first-child > span { margin-bottom: 7px; color: var(--accent); }
.performance-console > header strong { display: block; color: var(--text); font-size: 11px; }
.pnl-status { text-align: right; }
.pnl-status strong { margin-top: 7px; color: var(--amber) !important; font-size: 9px !important; }
.performance-boundary { margin: 0; padding: 11px 15px; border-bottom: 1px solid var(--line-soft); color: var(--muted); font-size: 8px; line-height: 1.55; }
.performance-networks { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.performance-network { min-width: 0; padding: 15px; border-right: 1px solid var(--line); }
.performance-network:last-child { border-right: 0; }
.performance-network-head span, .performance-network-head small { display: block; color: var(--dim); font-size: 8px; }
.performance-network-head strong { display: block; margin: 8px 0 5px; color: var(--text); font-size: 13px; }
.performance-network dl { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin: 13px 0 0; border: 1px solid var(--line-soft); }
.performance-network dl > div { padding: 9px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.performance-network dl > div:last-child { border-right: 0; }
.performance-network dl > div { border-bottom: 0; }
.performance-network dt { color: var(--dim); font-size: 7px; }
.performance-network dd { margin: 6px 0 0; color: var(--text); font-size: 9px; }
.performance-chart { height: 78px; margin-top: 12px; border: 1px solid var(--line-soft); }
.performance-chart svg { display: block; width: 100%; height: 100%; }
.performance-chart line { stroke: #293020; stroke-width: 1; }
.performance-chart polyline { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.performance-chart polyline.negative { stroke: var(--red); }
.performance-network-head .pnl-positive { color: var(--accent); }
.performance-network-head .pnl-negative { color: var(--red); }
.performance-empty { display: grid; height: 100%; place-items: center; padding: 0 12px; color: var(--dim); font-size: 8px; text-align: center; }
.performance-pending { display: grid; grid-template-columns: minmax(250px,.75fr) minmax(480px,1.25fr); }
.performance-pending-copy { display: grid; align-content: center; min-width: 0; padding: 18px; border-right: 1px solid var(--line); }
.performance-pending-copy > span { color: var(--accent); font-size: 8px; }
.performance-pending-copy > strong { margin-top: 8px; font-size: 14px; }
.performance-pending-copy > p { max-width: 560px; margin: 8px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.performance-pending-networks { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.performance-pending-networks > article { min-width: 0; padding: 16px; border-right: 1px solid var(--line-soft); }
.performance-pending-networks > article:last-child { border-right: 0; }
.performance-pending-networks span, .performance-pending-networks small { display: block; color: var(--dim); font-size: 8px; }
.performance-pending-networks > article > strong { display: block; margin: 8px 0 5px; color: var(--muted); font-size: 15px; }
.performance-pending-networks dl { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin: 13px 0 0; border: 1px solid var(--line-soft); }
.performance-pending-networks dl > div { min-width: 0; padding: 9px; border-right: 1px solid var(--line-soft); }
.performance-pending-networks dl > div:last-child { border-right: 0; }
.performance-pending-networks dt { color: var(--dim); font-size: 7px; }
.performance-pending-networks dd { margin: 6px 0 0; color: var(--text); font-size: 9px; overflow-wrap: anywhere; }
.performance-events { margin-top: 9px; border-top: 1px solid var(--line-soft); }
.performance-events summary { display: flex; justify-content: space-between; padding: 9px 2px 2px; color: var(--muted); font-size: 8px; cursor: pointer; list-style: none; }
.performance-events summary::-webkit-details-marker { display: none; }
.performance-events summary::before { content: "[+]"; margin-right: 7px; color: var(--accent); }
.performance-events[open] summary::before { content: "[−]"; }
.performance-events summary span { margin-left: auto; color: var(--dim); }
.performance-events > div { margin-top: 7px; border: 1px solid var(--line-soft); }
.performance-events > div > div { display: grid; grid-template-columns: minmax(110px,.8fr) minmax(100px,1fr) auto; gap: 8px; padding: 7px 9px; border-bottom: 1px solid var(--line-soft); font-size: 8px; }
.performance-events > div > div:last-child { border-bottom: 0; }
.performance-events time, .performance-events span { overflow: hidden; color: var(--dim); text-overflow: ellipsis; white-space: nowrap; }
.performance-events strong { color: var(--text); }
.performance-events p { margin: 0; padding: 10px; color: var(--dim); font-size: 8px; }
.accounting-proof { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); border: 1px solid var(--line); }
.accounting-proof > div { padding: 14px; border-right: 1px solid var(--line); }
.accounting-proof > div:last-child { border-right: 0; }
.accounting-proof span, .accounting-proof small { display: block; color: var(--dim); font-size: 8px; }
.accounting-proof strong { display: block; margin: 8px 0 5px; color: var(--text); font-size: 11px; }
.portfolio-empty { max-width: none; }
.portfolio-history { border: 1px solid var(--line); }
.portfolio-history > summary { display: grid; grid-template-columns: auto minmax(160px,1fr) auto; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; list-style: none; }
.portfolio-history > summary::-webkit-details-marker { display: none; }
.portfolio-history > summary > span { color: var(--accent); font-size: 8px; }
.portfolio-history > summary > strong { font-size: 11px; }
.portfolio-history > summary > small { color: var(--dim); font-size: 8px; text-align: right; }
.portfolio-history[open] > summary { border-bottom: 1px solid var(--line); }
.portfolio-history-empty { display: grid; grid-template-columns: auto minmax(170px,.45fr) minmax(300px,1fr); align-items: center; gap: 14px; padding: 13px 16px; border: 1px solid var(--line); }
.portfolio-history-empty > span { color: var(--accent); font-size: 8px; }
.portfolio-history-empty > strong { font-size: 10px; }
.portfolio-history-empty > small { color: var(--dim); font-size: 8px; line-height: 1.45; text-align: right; }
.accounting-caveat { margin: 0; padding: 11px 13px; border: 1px solid var(--line); color: var(--dim); font-size: 8px; line-height: 1.55; }
.account-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.account-grid > section { display: grid; align-content: start; gap: 12px; }
.account-grid strong { min-height: 42px; display: flex; align-items: center; padding: 10px 12px; border: 1px dashed var(--line); color: var(--accent); font-size: 10px; overflow-wrap: anywhere; }
.account-grid > section > small { color: var(--dim); font-size: 9px; line-height: 1.5; }
.account-identity-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.account-identity-actions .wallet-disconnect { grid-column: 1/-1; }
.linked-wallets { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.linked-wallets > span { display: block; margin-bottom: 9px; color: var(--dim); font: 8px/1 ui-monospace, monospace; letter-spacing: .06em; }
.linked-wallets > div { display: grid; gap: 6px; }
.linked-wallets > div > div { min-width: 0; display: grid; grid-template-columns: 34px minmax(0,1fr); align-items: center; gap: 8px; padding: 8px 9px; border: 1px solid var(--line-soft); background: #0a0d0b; }
.linked-wallets i { color: var(--accent); font: 650 8px/1 ui-monospace, monospace; font-style: normal; }
.linked-wallets code { overflow: hidden; color: var(--muted); font: 8px/1.3 ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; }
.linked-wallets small { color: var(--dim); font-size: 9px; }
.button.optional { border-color: #3d5125; color: var(--muted); }
.button.optional:not(:disabled):hover { border-color: var(--accent); color: var(--text); }

.market-tools { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; align-items: end; margin-top: 30px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.venue-tabs { display: flex; flex-wrap: wrap; gap: 3px; }
.market-scope { display: grid; gap: 10px; margin: 20px 0; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.market-scope-row { display: flex; align-items: center; gap: 14px; }
.market-scope-label { flex: 0 0 70px; color: var(--accent); font: 9px/1.4 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .06em; }
.market-scope-row .venue-tabs { flex: 1; min-width: 0; width: auto; }
.market-scope [hidden] { display: none; }
.venue-tab { padding: 8px 10px; border: 0; border-radius: 2px; background: transparent; color: var(--muted); cursor: pointer; font-size: 9px; }
.venue-tab span { display: inline-grid; place-items: center; width: 17px; height: 17px; margin-right: 6px; border: 1px solid var(--line); color: var(--text); font: 650 8px/1 ui-monospace, monospace; }
.venue-tab:hover, .venue-tab.active { color: var(--text); background: var(--surface-2); }
.venue-tab.active span { border-color: #637821; color: var(--accent); }
.filter-fields { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; }
.filter-fields label { display: grid; gap: 6px; color: var(--dim); font: 8px/1 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .06em; }
input, select { min-height: 34px; color: var(--text); background: #0d100e; border: 1px solid var(--line); border-radius: 2px; padding: 8px 9px; outline: none; font-size: 10px; }
input:focus, select:focus { border-color: #5b665f; box-shadow: 0 0 0 2px rgba(199,243,74,.04); }
.search input { width: 240px; }

.allocator-board, .market-section, .sources { margin-top: 25px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 12px; }
.section-head h2 { margin-bottom: 0; font-size: 14px; font-weight: 620; letter-spacing: -.018em; }
.section-head > p { margin-bottom: 0; color: var(--dim); font-size: 9px; }
.table-wrap { overflow-x: auto; width: 100%; }
table { width: 100%; min-width: 1320px; border-collapse: collapse; font-size: 10px; }
th { padding: 10px 11px; color: var(--dim); border-bottom: 1px solid var(--line); font: 550 8px/1 ui-monospace, monospace; letter-spacing: .07em; text-transform: uppercase; text-align: left; white-space: nowrap; }
td { padding: 13px 11px; color: #bbc3bd; border-bottom: 1px solid var(--line-soft); vertical-align: middle; font-variant-numeric: tabular-nums; }
tbody tr { cursor: pointer; transition: background .14s, box-shadow .14s, opacity .25s, transform .25s; animation: rowIn .35s both; }
tbody tr:hover { background: rgba(255,255,255,.018); }
tbody tr.selected { background: rgba(199,243,74,.035); box-shadow: inset 2px 0 0 var(--accent); }
td strong { display: block; color: var(--text); font-size: 10px; font-weight: 610; white-space: nowrap; }
td small { display: block; margin-top: 4px; color: var(--dim); font-size: 8px; white-space: nowrap; }
.pool-name { display: flex; align-items: center; gap: 9px; min-width: 150px; }
.venue-glyph { width: 24px; height: 24px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--line); color: var(--accent); font: 650 9px/1 ui-monospace, monospace; transform: rotate(45deg); }
.venue-glyph i { transform: rotate(-45deg); font-style: normal; }
.numeric { font-family: ui-monospace, monospace; white-space: nowrap; }
.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }
.metric-kind { color: var(--dim); font: 7px/1 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .05em; }
.score { display: inline-grid; place-items: center; width: 29px; height: 22px; border: 1px solid var(--line); color: var(--text); font: 620 9px/1 ui-monospace, monospace; }
.score.good { border-color: #53651d; color: var(--accent); }
.score.risk { border-color: #65363b; color: var(--red); }
.track-state { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font: 610 8px/1 ui-monospace, monospace; text-transform: uppercase; }
.track-state::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--dim); }
.track-state.tracked { color: var(--green); }
.track-state.tracked::before { background: var(--green); }
.track-state.degraded { color: var(--amber); }
.track-state.degraded::before { background: var(--amber); }
.allocator-head { align-items: start; }
.allocator-controls { width: min(640px, 66vw); display: grid; grid-template-columns: minmax(210px,.8fr) minmax(300px,1.2fr); gap: 10px; align-items: stretch; }
.allocator-controls > label { display: grid; align-content: start; gap: 6px; color: var(--dim); font: 8px/1 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .06em; }
.wallet-control { padding: 10px 12px; border: 1px solid var(--line); background: var(--surface); }
.wallet-line, .allocation-control { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wallet-line span, .allocation-control span { min-width: 0; }
.wallet-line small, .allocation-control small { display: block; color: var(--dim); font: 7px/1 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .06em; }
.wallet-line strong { display: block; max-width: 190px; margin-top: 6px; overflow: hidden; color: var(--text); font: 620 10px/1 ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; }
.wallet-line .button { flex: 0 0 auto; padding: 7px 9px; font-size: 8px; }
.wallet-actions { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; gap: 6px; }
.wallet-actions .optional { border-color: #344138; color: var(--muted); }
.wallet-actions .optional:not(:disabled):hover { border-color: var(--green); color: var(--text); }
.wallet-actions .optional:disabled { cursor: not-allowed; opacity: .38; }
.allocation-control { margin-top: 12px; color: var(--muted); font: 600 9px/1 ui-monospace, monospace; }
.allocation-control strong { display: block; margin-top: 5px; color: var(--accent); font-size: 11px; }
.allocation-control > span:last-child { color: var(--text); }
#pool-count-amount.thin-sleeve { color: var(--amber); }
#allocation-slider, #pool-count-slider { width: 100%; min-height: 18px; margin: 8px 0 0; padding: 0; border: 0; accent-color: var(--accent); cursor: pointer; }
#allocation-slider:disabled, #pool-count-slider:disabled { cursor: not-allowed; opacity: .35; }
#execution-readiness { margin: 7px 0 0; color: var(--dim); font-size: 7px; line-height: 1.4; }
.allocator-summary { display: grid; grid-template-columns: repeat(5,minmax(120px,1fr)); border: 1px solid var(--line); }
.allocator-summary > div { min-height: 76px; padding: 13px; border-right: 1px solid var(--line); background: rgba(255,255,255,.01); }
.allocator-summary > div:last-child { border-right: 0; }
.allocator-summary span, .allocator-summary small { display: block; color: var(--dim); font: 7px/1.3 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .05em; }
.allocator-summary strong { display: block; margin: 10px 0 7px; color: var(--text); font: 610 13px/1 ui-monospace, monospace; }
.allocator-candidates { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border: 1px solid var(--line); border-top: 0; }
.allocator-candidates > p { grid-column: 1/-1; margin: 0; padding: 18px; color: var(--dim); font-size: 9px; }
.allocator-wait { grid-column: 1/-1; padding: 17px 18px; border-left: 2px solid var(--amber); background: linear-gradient(90deg,rgba(239,187,80,.06),transparent 72%); }
.allocator-wait > span, .allocator-wait > strong, .allocator-wait > small { display: block; }
.allocator-wait > span { color: var(--amber); font: 650 8px/1 ui-monospace,monospace; letter-spacing: .07em; }
.allocator-wait > strong { margin-top: 10px; color: var(--text); font-size: 11px; }
.allocator-wait > p { margin: 7px 0 10px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.allocator-wait > small { color: var(--dim); font-size: 8px; }
.allocator-candidate { min-width: 0; display: grid; grid-template-columns: 36px minmax(110px,1.2fr) minmax(110px,1fr) 54px; align-items: center; gap: 10px; padding: 12px; border: 0; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); background: transparent; color: var(--text); cursor: pointer; text-align: left; }
.allocator-candidate:nth-child(2n) { border-right: 0; }
.allocator-candidate:hover { background: rgba(255,255,255,.018); }
.allocator-candidate.recommended { box-shadow: inset 2px 0 0 var(--accent); }
.allocator-candidate.extreme.recommended { box-shadow: inset 2px 0 0 var(--red); }
.allocator-candidate strong, .allocator-candidate small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.allocator-candidate strong { font-size: 9px; }
.allocator-candidate small { margin-top: 5px; color: var(--dim); font-size: 7px; }
.candidate-rank { color: var(--accent); font: 650 10px/1 ui-monospace, monospace; }
.extreme .candidate-rank { color: var(--red); }
.candidate-target { text-align: right; }
.allocator-stage { display: inline-block; color: var(--muted); font: 650 8px/1 ui-monospace, monospace; text-transform: uppercase; white-space: nowrap; }
.allocator-stage.active { color: var(--accent); }
.allocator-stage.extreme.active { color: var(--red); }
.empty { padding: 34px; color: var(--dim); text-align: center; cursor: default; }

.sources { padding-top: 22px; border-top: 1px solid var(--line); }
.sources dl { margin: 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0 28px; }
.sources dl > div { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.sources dt { display: flex; justify-content: space-between; gap: 10px; color: var(--text); font-size: 10px; }
.sources dt span { color: var(--green); font: 650 8px/1 ui-monospace, monospace; text-transform: uppercase; }
.sources dt span.stale { color: var(--amber); }
.sources dt span.unavailable { color: var(--red); }
.sources dd { margin: 7px 0 0; color: var(--dim); font-size: 8px; line-height: 1.5; }

.inspector { position: fixed; z-index: 50; top: 68px; right: 0; bottom: 0; width: var(--inspector); display: grid; grid-template-rows: auto 1fr auto; background: #0c0f0d; border-left: 1px solid var(--line); transform: translateX(100%); transition: transform .24s cubic-bezier(.2,.75,.2,1); }
.inspector.open { transform: translateX(0); }
.inspector-head { min-height: 92px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px; border-bottom: 1px solid var(--line); background: rgba(12,15,13,.96); }
.inspector-head h2 { margin: 0; font-size: 20px; line-height: 1; letter-spacing: -.035em; }
.inspector-head > div > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 9px; }
.close { border: 0; background: transparent; color: var(--dim); font-size: 21px; cursor: pointer; }
.close:hover { color: var(--text); }
.inspector-scroll { min-height: 0; overflow-y: auto; padding: 0 20px 28px; }
.pool-summary { display: grid; grid-template-columns: repeat(3,1fr); margin: 0 -20px; border-bottom: 1px solid var(--line); }
.summary-metric { min-height: 72px; padding: 14px; border-right: 1px solid var(--line); }
.summary-metric:nth-child(3n) { border-right: 0; }
.summary-metric span { display: block; color: var(--dim); font: 7px/1 ui-monospace, monospace; text-transform: uppercase; }
.summary-metric strong { display: block; margin-top: 12px; font: 560 13px/1 ui-monospace, monospace; }
.pool-tags { grid-column: 1/-1; display: flex; flex-wrap: wrap; gap: 5px; padding: 10px 14px; border-top: 1px solid var(--line-soft); }
.exit-policy { grid-column: 1/-1; padding: 12px 14px; border-top: 1px solid var(--line-soft); background: rgba(199,243,74,.025); }
.exit-policy strong, .exit-policy span { display: block; }
.exit-policy strong { color: var(--accent); font: 650 7px/1 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .08em; }
.exit-policy span { margin-top: 7px; color: var(--muted); font-size: 8px; line-height: 1.45; }
.tag { padding: 5px 6px; border: 1px solid var(--line); color: var(--muted); font: 7px/1 ui-monospace, monospace; text-transform: uppercase; }
.tag.risk { border-color: #4b2e32; color: var(--red); }
.tag.track { border-color: #405016; color: var(--accent); }
.subhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.subhead h3 { margin: 0; font-size: 11px; font-weight: 610; }
.subhead > span { color: var(--dim); font: 650 7px/1 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .08em; }
.history-section, .planner-section, .plan-output, .execution-review { padding: 20px 0; border-bottom: 1px solid var(--line); }
.sparkline { min-height: 92px; display: grid; place-items: center; border: 1px solid var(--line-soft); background: #0a0c0b; color: var(--dim); font-size: 8px; overflow: hidden; }
.sparkline svg { display: block; width: 100%; height: 92px; }
.history-legend { display: flex; gap: 16px; padding-top: 8px; color: var(--dim); font: 8px/1 ui-monospace, monospace; }
.history-legend strong { color: var(--text); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 10px; }
.form-grid .wide { grid-column: 1/-1; }
.form-grid label { display: grid; gap: 7px; color: var(--muted); font-size: 8px; }
.managed-capital > small { color: var(--dim); font-size: 7px; line-height: 1.45; }
.money-input { position: relative; }
.money-input i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--dim); font-style: normal; font-size: 10px; }
.money-input input { width: 100%; padding-left: 22px; }
.range-profile { min-width: 0; margin: 0; padding: 0; border: 0; }
.range-profile legend { width: 100%; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 9px; color: var(--muted); font-size: 8px; }
.range-profile legend small { color: var(--accent); font: 650 7px/1.2 ui-monospace,monospace; text-transform: uppercase; letter-spacing: .04em; }
.range-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.range-option { position: relative; min-width: 0; cursor: pointer; }
.range-option input { position: absolute; opacity: 0; pointer-events: none; }
.range-option > span { min-height: 64px; display: grid; align-content: start; gap: 8px; padding: 10px; border: 1px solid var(--line); background: #0a0d0b; transition: border-color .15s,background .15s; }
.range-option strong { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; color: var(--text); font-size: 9px; }
.range-option em { padding: 3px 4px; border: 1px solid #405016; color: var(--accent); font: 650 6px/1 ui-monospace,monospace; text-transform: uppercase; font-style: normal; }
.range-option small { color: var(--dim); font-size: 7px; line-height: 1.45; }
.range-option input:checked + span { border-color: var(--accent); background: rgba(199,243,74,.07); box-shadow: inset 0 -2px 0 var(--accent); }
.range-option input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }
.managed-policy { margin: 0; padding: 11px 12px; border-left: 2px solid var(--accent); background: rgba(199,243,74,.03); color: var(--muted); font-size: 8px; line-height: 1.55; }
.managed-policy strong { color: var(--accent); }
.plan-button { width: 100%; min-height: 42px; margin-top: 16px; display: flex; justify-content: space-between; align-items: center; }
.plan-output { animation: planIn .28s both; }
.plan-title { margin-bottom: 4px; font-size: 16px; letter-spacing: -.025em; }
.plan-copy { margin: 0 0 17px; color: var(--muted); font-size: 9px; line-height: 1.55; }
.range-map { position: relative; height: 84px; margin: 15px 0; border: 1px solid var(--line); background: linear-gradient(90deg,#101311,#171c18,#101311); overflow: hidden; }
.range-map::before { content: ""; position: absolute; top: 0; bottom: 0; left: var(--spot,50%); width: 1px; background: rgba(237,242,237,.5); }
.range-band { position: absolute; top: 26px; height: 30px; left: var(--left); width: var(--width); min-width: 3px; background: rgba(199,243,74,.22); border: 1px solid var(--accent); transition: .35s cubic-bezier(.2,.8,.2,1); }
.range-label { position: absolute; bottom: 8px; color: var(--dim); font: 7px/1 ui-monospace, monospace; }
.range-label.low { left: 8px; }
.range-label.spot { left: var(--spot,50%); transform: translateX(-50%); color: var(--text); }
.range-label.high { right: 8px; }
.plan-grid { display: grid; grid-template-columns: repeat(2,1fr); border: 1px solid var(--line); }
.plan-grid div { padding: 12px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.plan-grid div:nth-child(2n) { border-right: 0; }
.plan-grid div:nth-last-child(-n+2) { border-bottom: 0; }
.plan-grid span { display: block; color: var(--dim); font: 7px/1 ui-monospace, monospace; text-transform: uppercase; }
.plan-grid strong { display: block; margin-top: 8px; font-size: 10px; font-weight: 590; }
.warning-list { margin: 16px 0 0; padding: 0; list-style: none; }
.warning-list li { position: relative; padding: 8px 0 8px 14px; border-bottom: 1px solid var(--line-soft); color: var(--muted); font-size: 8px; line-height: 1.45; }
.warning-list li::before { content: "!"; position: absolute; left: 0; color: var(--amber); font: 650 8px/1 ui-monospace, monospace; }
.start-note { margin: 14px 0 0; padding: 11px 12px; border: 1px solid #405016; background: rgba(199,243,74,.035); color: var(--muted); font-size: 8px; line-height: 1.5; }
.start-note strong { color: var(--accent); }
.execution-card { border: 1px solid var(--line); background: #0a0d0b; }
.execution-card > div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); font-size: 8px; }
.execution-card > div:last-child { border-bottom: 0; }
.execution-card span { color: var(--dim); font: 7px/1.3 ui-monospace, monospace; text-transform: uppercase; }
.execution-card strong { overflow-wrap: anywhere; color: var(--text); font-weight: 580; }
.execution-note { margin: 12px 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.execution-actions { display: flex; gap: 8px; align-items: center; }
.execution-actions .button { flex: 1; }
.execution-actions a { color: var(--accent); font-size: 8px; }
.execution-boundary { min-height: 68px; display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 13px 18px; border-top: 1px solid var(--line); background: #0b0e0c; }
.execution-boundary > div { display: flex; align-items: center; gap: 10px; }
.execution-boundary i { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.execution-boundary i.ready { background: var(--green); }
.execution-boundary i.blocked { background: var(--red); }
.execution-boundary strong, .execution-boundary small { display: block; }
.execution-boundary strong { font-size: 9px; }
.execution-boundary small { margin-top: 4px; color: var(--dim); font-size: 7px; }
.execution-boundary button { padding: 8px 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 8px; cursor: pointer; }
.execution-boundary button:disabled { color: var(--dim); cursor: not-allowed; opacity: .5; }
.scrim { display: none; position: fixed; z-index: 40; inset: 68px 0 0; background: rgba(0,0,0,.58); }
.danger-dialog { width: min(680px,calc(100vw - 32px)); max-height: min(820px,calc(100vh - 32px)); margin: auto; padding: 0; overflow: visible; border: 1px solid #8f424a; border-radius: 2px; background: #090b0a; color: var(--text); box-shadow: 0 0 0 1px rgba(231,126,135,.14), 0 26px 90px rgba(0,0,0,.76); }
.danger-dialog::backdrop { background: rgba(2,4,3,.84); backdrop-filter: blur(3px); }
.danger-dialog[open] { animation: dangerIn .18s ease-out both; }
.danger-console { position: relative; max-height: min(820px,calc(100vh - 32px)); overflow-y: auto; background: repeating-linear-gradient(135deg,rgba(231,126,135,.022) 0,rgba(231,126,135,.022) 8px,transparent 8px,transparent 16px); }
.danger-console::before { content: ""; display: block; height: 7px; background: repeating-linear-gradient(135deg,var(--red) 0,var(--red) 10px,#251315 10px,#251315 20px); }
.danger-dialog-head { min-height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid #51292d; background: rgba(18,8,10,.94); }
.danger-dialog-head > span { color: var(--red); font: 720 9px/1 ui-monospace,monospace; letter-spacing: .13em; }
.danger-dialog-close { width: 44px; height: 44px; border: 0; background: transparent; color: var(--dim); cursor: pointer; font-size: 24px; }
.danger-dialog-close:hover { color: var(--text); }
.danger-dialog-intro { display: grid; grid-template-columns: 54px 1fr; gap: 17px; align-items: start; padding: 24px 22px 20px; background: rgba(9,11,10,.9); }
.danger-sigil { width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid var(--red); color: var(--red); font: 760 28px/1 ui-monospace,monospace; box-shadow: inset 0 0 18px rgba(231,126,135,.06),0 0 18px rgba(231,126,135,.06); }
.danger-dialog-intro h2 { margin: 0; font-size: clamp(21px,4vw,30px); line-height: 1; letter-spacing: -.04em; }
.danger-dialog-intro p { max-width: 520px; margin: 11px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.danger-facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin: 0 22px; border: 1px solid #51292d; background: rgba(9,11,10,.92); }
.danger-facts > div { min-width: 0; padding: 13px 14px; border-right: 1px solid #331c1f; border-bottom: 1px solid #331c1f; }
.danger-facts > div:nth-child(2n) { border-right: 0; }
.danger-facts > div:nth-last-child(-n+2) { border-bottom: 0; }
.danger-facts dt { color: var(--dim); font: 650 8px/1 ui-monospace,monospace; letter-spacing: .08em; text-transform: uppercase; }
.danger-facts dd { margin: 8px 0 0; overflow-wrap: anywhere; color: var(--text); font-size: 11px; line-height: 1.35; }
.danger-warning { margin: 16px 22px 0; padding: 12px 14px; border-left: 3px solid var(--red); background: rgba(231,126,135,.055); }
.danger-warning strong { display: block; color: var(--red); font: 720 8px/1 ui-monospace,monospace; letter-spacing: .09em; }
.danger-warning p { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.danger-phrase { display: grid; gap: 8px; margin: 18px 22px 0; color: var(--text); font-size: 10px; }
.danger-phrase span { color: var(--muted); }
.danger-phrase span strong { color: var(--red); }
.danger-phrase input { width: 100%; min-height: 48px; padding: 0 13px; border: 1px solid #66343a; border-radius: 0; outline: 0; background: #0c090a; color: var(--text); font: 680 13px/1 ui-monospace,monospace; letter-spacing: .08em; text-transform: uppercase; }
.danger-phrase input:focus { border-color: var(--red); box-shadow: 0 0 0 2px rgba(231,126,135,.12); }
.danger-phrase input.confirmed { border-color: var(--green); color: var(--green); box-shadow: 0 0 0 2px rgba(121,216,155,.08); }
.danger-dialog-actions { display: grid; grid-template-columns: .75fr 1.25fr; gap: 9px; padding: 18px 22px 22px; }
.danger-dialog-actions .button { min-height: 48px; }
.danger-dialog-action:not(:disabled) { border-color: var(--red); background: var(--red); color: #170507; box-shadow: 0 0 22px rgba(231,126,135,.12); }
.danger-dialog-action:not(:disabled):hover { color: #170507; }
.toast { position: fixed; z-index: 70; left: 50%; bottom: 24px; padding: 10px 13px; border: 1px solid #394039; border-radius: 2px; background: var(--surface-3); color: var(--text); font-size: 9px; opacity: 0; transform: translate(-50%,18px); transition: .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

@keyframes rise { from { height: 0; opacity: 0; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(121,216,155,0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rowIn { from { opacity: 0; transform: translateY(5px); } }
@keyframes planIn { from { opacity: 0; transform: translateY(6px); } }
@keyframes pageIn { from { opacity: 0; transform: translateY(4px); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes dangerIn { from { opacity: 0; transform: translateY(12px) scale(.985); } }

@media (max-width: 1180px) {
  body.inspector-open .workspace { padding-right: 34px; }
  .inspector { width: min(var(--inspector), 92vw); }
  .scrim.open { display: block; }
  .metric-strip { grid-template-columns: repeat(3,1fr); }
  .allocator-summary { grid-template-columns: repeat(3,1fr); }
  .allocator-summary > div:nth-child(3) { border-right: 0; }
  .allocator-summary > div:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .metric:nth-child(3) { border-right: 0; }
  .metric:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .sources dl { grid-template-columns: 1fr; }
  .allocator-controls { width: min(560px, 65vw); grid-template-columns: minmax(180px,.7fr) minmax(280px,1.3fr); }
  .setup-step { grid-template-columns: 60px minmax(0,1fr); }
  .setup-step::before { left: 29px; }
  .step-action, .automation-controls, .step-wallet-grid { grid-column: 2; margin: 0 20px 22px 8px; }
  .fund-network-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  :root { --rail: 0px; }
  .topbar { grid-template-columns: auto 1fr auto; }
  .brand { border-right: 0; }
  .brand small, .runtime time, .mode { display: none; }
  .runtime { padding-left: 4px; }
  .rail { top: auto; right: 0; width: 100%; height: 52px; flex-direction: row; overflow-x: auto; border-right: 0; border-top: 1px solid var(--line); padding: 5px; }
  .rail-item { flex: 0 0 auto; justify-content: center; min-width: 74px; }
  .rail-item span, .rail-label, .rail-spacer, .rail-boundary { display: none; }
  .account-link { padding-top: 10px; margin-top: 0; border-top: 0; }
  .workspace { margin-left: 0; padding: 96px 18px 78px; }
  .market-tools { align-items: stretch; flex-direction: column; }
  .allocator-candidates { grid-template-columns: 1fr; }
  .allocator-head { align-items: stretch; flex-direction: column; }
  .allocator-controls { width: 100%; grid-template-columns: minmax(180px,.7fr) minmax(280px,1.3fr); }
  .allocator-candidate { border-right: 0; }
  .filter-fields { width: 100%; flex-wrap: wrap; }
  .filter-fields label { flex: 1; }
  .search { flex-basis: 100% !important; }
  .search input { width: 100%; }
  .account-grid { grid-template-columns: 1fr; }
  .portfolio-overview-networks { grid-template-columns: 1fr; }
  .portfolio-overview-network { border-right: 0; border-bottom: 1px solid var(--line); }
  .portfolio-overview-network:last-child { border-bottom: 0; }
  .accounting-proof { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .performance-networks { grid-template-columns: 1fr; }
  .performance-pending { grid-template-columns: 1fr; }
  .performance-pending-copy { border-right: 0; border-bottom: 1px solid var(--line); }
  .performance-network { border-right: 0; border-bottom: 1px solid var(--line); }
  .performance-network:last-child { border-bottom: 0; }
  .accounting-proof > div:nth-child(2n) { border-right: 1px solid var(--line); }
  .accounting-proof > div:last-child { border-right: 0; }
  .portfolio-position, .portfolio-position.historical { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .mandate-console { grid-template-columns: 1fr; }
  .strategy-history-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .strategy-pool { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .strategy-pool-id { grid-column: 1/-1; border-top: 1px solid var(--line-soft); }
  .profit-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .profit-fields label:nth-child(2) { border-right: 0; }
  .profit-fields label:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
}

@media (max-width: 560px) {
  .rail { height: 84px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 3px; overflow: hidden; padding: 5px; }
  .rail-item { width: 100%; min-width: 0; padding: 6px 3px; }
  .rail-item strong { font-size: 9px; }
  .account-link { padding-top: 6px; }
  .brand { padding: 0 9px; }
  .refresh { min-width: 42px; margin-right: 8px; font-size: 0; }
  .refresh span { font-size: 14px; }
  .source-state > span { display: none; }
  .workspace { padding-left: 12px; padding-right: 12px; padding-bottom: 108px; }
  .workspace-head { align-items: start; }
  .operator { display: none; }
  .metric-strip { grid-template-columns: repeat(2,1fr); }
  .metric:nth-child(2), .metric:nth-child(4) { border-right: 0; }
  .metric:nth-child(3) { border-right: 1px solid var(--line); }
  .metric:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
  .threshold-strip { align-items: flex-start; flex-wrap: wrap; }
  .allocator-controls { grid-template-columns: 1fr; }
  .wallet-line { align-items: flex-start; }
  .wallet-actions { max-width: 160px; flex-wrap: wrap; }
  .wallet-actions .button { width: 100%; }
  .allocator-summary { grid-template-columns: repeat(2,1fr); }
  .allocator-summary > div { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .allocator-summary > div:nth-child(2n) { border-right: 0; }
  .allocator-summary > div:last-child { border-bottom: 0; }
  .allocator-candidate { grid-template-columns: 32px minmax(90px,1fr) minmax(90px,1fr) 48px; gap: 7px; }
  .screen-method p { padding-left: 13px; }
  .venue-tabs { width: 100%; overflow-x: auto; }
  .venue-tab { white-space: nowrap; }
  .inspector { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: 1; }
  .range-options { grid-template-columns: 1fr; }
  .range-option > span { min-height: 0; }
  .range-profile legend { align-items: flex-start; flex-direction: column; gap: 5px; }
  .setup-step { grid-template-columns: 46px minmax(0,1fr); }
  .setup-step::before { left: 22px; }
  .step-index { min-width: 34px; padding: 8px 4px; font-size: 9px; }
  .step-copy { padding-right: 12px; }
  .step-copy h2 { font-size: 14px; }
  .step-action, .automation-controls, .step-wallet-grid { margin-right: 12px; }
  .step-wallet-grid { grid-template-columns: 1fr; }
  .automation-actions, .strategy-switcher, .deployment-network { grid-template-columns: 1fr; }
  .identity-row { grid-template-columns: minmax(0,1fr) 36px; }
  .identity-row .optional { grid-column: 1/-1; grid-row: 2; }
  .identity-row .wallet-disconnect { grid-column: 2; grid-row: 1; }
  .account-identity-actions { grid-template-columns: 1fr; }
  .account-identity-actions .wallet-disconnect { grid-column: 1; }
  .page-head h1 { font-size: 26px; }
  .accounting-proof, .portfolio-position, .portfolio-position.historical { grid-template-columns: 1fr; }
  .portfolio-overview-network > header { align-items: flex-start; flex-direction: column; }
  .portfolio-overview-network > header small { max-width: none; text-align: left; }
  .portfolio-overview-network dl { grid-template-columns: 1fr; }
  .portfolio-overview-network dl > div { border-right: 0; }
  .portfolio-overview-network > footer { align-items: flex-start; flex-wrap: wrap; }
  .portfolio-live > header { align-items: flex-start; flex-direction: column; }
  .portfolio-live-count { min-width: 0; text-align: left; }
  .performance-console > header { align-items: flex-start; flex-direction: column; }
  .performance-pending-networks { grid-template-columns: 1fr; }
  .performance-pending-networks > article { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .performance-pending-networks > article:last-child { border-bottom: 0; }
  .performance-network dl { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .performance-network dl > div { border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
  .performance-network dl > div:nth-child(2n) { border-right: 0; }
  .performance-network dl > div:nth-last-child(-n+2) { border-bottom: 0; }
  .pnl-status { text-align: left; }
  .performance-events > div > div { grid-template-columns: 1fr; gap: 4px; }
  .accounting-proof > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .accounting-proof > div:last-child { border-bottom: 0; }
  .portfolio-history > summary { grid-template-columns: 1fr; }
  .portfolio-history > summary > small { text-align: left; }
  .portfolio-history-empty { grid-template-columns: 1fr; }
  .portfolio-history-empty > small { text-align: left; }
  .page-boundary, .danger-facts { grid-template-columns: 1fr; }
  .page-boundary > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .page-boundary > div:last-child { border-bottom: 0; }
  .mandate-empty { grid-template-columns: 1fr; }
  .mandate-empty > small { text-align: left; }
  .mandate-actions { grid-template-columns: 1fr; }
  .decision-console dl { grid-template-columns: 1fr; }
  .decision-console dl > div { border-right: 0; }
  .decision-console > header { align-items: flex-start; flex-direction: column; gap: 6px; }
  .strategy-pool { grid-template-columns: 1fr; }
  .strategy-pool > div { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .strategy-pool > div:last-child { border-bottom: 0; }
  .strategy-pool-id { grid-column: 1; }
  .strategy-history-row { grid-template-columns: 1fr; gap: 8px; }
  .profit-taking-hero { grid-template-columns: 1fr; }
  .profit-toggle { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .profit-fields { grid-template-columns: 1fr; }
  .profit-fields label { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .profit-fields label:last-child { border-bottom: 0; }
  .profit-progress header { align-items: flex-start; flex-direction: column; gap: 5px; }
  .profit-progress header strong { text-align: left; }
  .profit-taking-form > footer { grid-template-columns: 1fr; }
  .profit-taking-form > footer .button { width: 100%; }
  .danger-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .danger-console { max-height: calc(100vh - 16px); }
  .danger-dialog-intro { grid-template-columns: 42px 1fr; gap: 12px; padding: 20px 14px 16px; }
  .danger-sigil { width: 42px; height: 42px; font-size: 22px; }
  .danger-facts, .danger-warning, .danger-phrase { margin-left: 14px; margin-right: 14px; }
  .danger-facts > div { border-right: 0; }
  .danger-facts > div:nth-last-child(-n+2) { border-bottom: 1px solid #331c1f; }
  .danger-facts > div:last-child { border-bottom: 0; }
  .danger-dialog-actions { grid-template-columns: 1fr; padding: 15px 14px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
/* Keep provider activity separate from LP fee / accounting evidence. */
.enrichment-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.enrichment-metrics span, .enrichment-metrics strong { display: block; }
.enrichment-metrics span { color: var(--muted); font-size: 10px; margin-bottom: 6px; }
.enrichment-metrics strong { font-size: 13px; overflow-wrap: anywhere; }
.enrichment-table { min-width: 360px; width: 100%; font-size: 11px; }
.enrichment-table th, .enrichment-table td { padding: 10px 7px; }
#pool-market-enrichment .text-link { color: var(--accent); font-size: 12px; }
