@font-face {
  font-family: Geist;
  src: url("/fonts/geist-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
/* Product tokens from mog/design.md and documentation/UI_Color_System.md. */
:root {
  color-scheme: dark;
  --ui-background: #0b0c0f;
  --ui-panel: #121418;
  --ui-elevated: #1c1f26;
  --ui-hover: #252932;
  --ui-border-subtle: #2d323c;
  --ui-border-strong: #667080;
  --text-primary: #f4f5f7;
  --text-secondary: #b4bac5;
  --text-tertiary: #929baa;
  --text-disabled: #626b7a;
  --action-primary: #3863ef;
  --action-hover: color-mix(
    in srgb,
    var(--action-primary) 96%,
    var(--ui-background)
  );
  --action-pressed: color-mix(
    in srgb,
    var(--action-primary) 88%,
    var(--ui-background)
  );
  --on-action: #f4f5f7;
  --action-focus: #7fade3;
  --data-chart-primary: #7fade3;
  --semantic-gain: #2ed69b;
  --semantic-loss: #ff6075;
  --semantic-risk: #f3c766;
  --risk: var(--semantic-risk);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--ui-background);
  color: var(--text-primary);
  font:
    13px/1.45 Geist,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button {
  border: 1px solid var(--ui-border-subtle);
  border-radius: 7px;
  background: var(--ui-elevated);
  color: inherit;
  padding: 9px 13px;
  cursor: pointer;
  min-height: 38px;
  transition:
    background 140ms cubic-bezier(0.2, 0.8, 0.3, 1),
    color 140ms cubic-bezier(0.2, 0.8, 0.3, 1);
}
button:hover {
  background: var(--ui-hover);
}
button:disabled {
  opacity: 0.35;
  cursor: default;
}
.primary {
  background: var(--action-primary);
  color: var(--on-action);
  border-color: var(--action-primary);
  font-weight: 650;
}
.primary:hover {
  background: var(--action-hover);
}
:focus-visible {
  outline: 2px solid var(--action-focus);
  outline-offset: 2px;
}
.venue-link { padding: 10px 0; }
.venue-status, .venue-context, .venue-meta, .venue-not-covered, .venue-intro {
  color: var(--text-secondary);
}
.venue-status { margin-bottom: 16px; }
.venue-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 12px; }
.venue-context { margin: 8px 0 24px; max-width: 85ch; }
.venue-summary { display: flex; gap: 32px; padding: 0 0 24px; }
.venue-count { display: grid; gap: 4px; }
.venue-count span { color: var(--text-secondary); font-size: 12px; }
.venue-count strong { font-size: 28px; font-weight: 550; }
.venue-red .venue-severity, .venue-red.venue-count strong { color: var(--semantic-risk); }
.venue-warning .venue-severity, .venue-warning.venue-count strong { color: var(--semantic-risk); }
.venue-green .venue-severity { color: var(--text-secondary); }
.venue-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.venue-filters button { background: transparent; }
.venue-filters button[aria-pressed=true] { background: var(--ui-elevated); border-color: var(--ui-border-strong); }
.venue-findings { list-style: none; padding: 0; margin: 0 0 24px; }
.venue-finding { padding: 16px 0; border-top: 1px solid var(--ui-border-subtle); }
.venue-finding-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; }
.venue-finding-heading > span { font-size: 12px; }
.venue-finding-heading h3 { font-size: 14px; font-weight: 550; }
.venue-severity { min-width: 64px; }
.venue-red .venue-severity { font-weight: 650; }
.venue-finding p { margin-top: 6px; color: var(--text-secondary); overflow-wrap: anywhere; }
.venue-finding .venue-numbers { color: var(--text-primary); }
.venue-action strong { color: var(--text-primary); font-weight: 550; }
.venue-raw { border-top: 1px solid var(--ui-border-subtle); padding: 16px 0; }
.venue-raw summary { cursor: pointer; }
.venue-table-scroll { overflow-x: auto; margin-top: 16px; }
.venue-raw table { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 600px; }
.venue-raw th, .venue-raw td { text-align: left; vertical-align: top; padding: 12px 8px; border-bottom: 1px solid var(--ui-border-subtle); overflow-wrap: anywhere; }
.venue-raw th:first-child { width: 18%; }
.venue-raw th:nth-child(2) { width: 28%; }
.venue-raw th { color: var(--text-secondary); font-weight: 450; }
.venue-raw pre { margin: 0; white-space: pre-wrap; font: inherit; overflow-wrap: anywhere; }
.venue-raw small { display: block; color: var(--text-tertiary); }
.venue-not-covered { border-top: 1px solid var(--ui-border-subtle); padding: 24px 0; }
.venue-not-covered h2, .venue-intro h2 { color: var(--text-primary); margin-bottom: 8px; }
.venue-not-covered ul { padding-left: 20px; }
.venue-not-covered li { margin: 8px 0; }
.venue-intro { padding: 24px 0 32px; max-width: 72ch; }
.venue-error { border-left: 2px solid var(--semantic-risk); padding: 12px 16px; margin-bottom: 24px; }
.venue-error p { margin-top: 8px; overflow-wrap: anywhere; }
.venue-empty { padding: 24px 0; color: var(--text-secondary); }
@media (max-width: 767px) {
  .venue-finding-heading h3 { flex-basis: 100%; }
  .venue-summary { gap: 24px; }
  .venue-filters button { min-height: 44px; padding: 8px 10px; }
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.9px;
}
h2 {
  font-size: 18px;
  font-weight: 600;
}
h3 {
  font-size: 14px;
  font-weight: 600;
}
p {
  color: var(--text-tertiary);
  margin: 6px 0;
  line-height: 1.6;
}
small {
  color: var(--text-tertiary);
}
.num {
  font-variant-numeric: tabular-nums;
}
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.13em;
}
.error {
  color: var(--risk);
}
.positive {
  color: var(--semantic-gain);
}
[hidden] {
  display: none !important;
}
header {
  height: 64px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--ui-border-subtle);
  background: var(--ui-background);
}
.brand {
  font-size: 28px;
  font-weight: 750;
  letter-spacing: -1px;
  text-decoration: none;
}
.brand span {
  font-size: 13px;
  letter-spacing: 0;
  font-weight: 400;
  color: var(--text-secondary);
  margin-left: 12px;
}
header > div {
  display: flex;
  gap: 16px;
  align-items: center;
}
.badge {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-primary);
  border: 1px solid var(--ui-border-subtle);
  border-radius: 4px;
  padding: 4px 7px;
}
#connection {
  font-size: 11px;
  color: var(--text-tertiary);
}
main {
  padding: 0;
  max-width: 1800px;
  margin: auto;
}
.workspace {
  display: grid;
  grid-template-columns: 226px minmax(0, 1fr);
  min-height: calc(100vh - 64px);
}
.history {
  border-right: 1px solid var(--ui-border-subtle);
  padding: 25px 14px;
  background: var(--ui-background);
}
.history .section-title {
  padding: 0 10px;
  margin-bottom: 18px;
}
.history h2 {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
#run-count {
  font-size: 11px;
  color: var(--text-tertiary);
}
#new-run {
  width: 100%;
  margin-bottom: 20px;
}
#run-list {
  max-height: 55vh;
  overflow: auto;
}
.run {
  display: block;
  text-align: left;
  width: 100%;
  padding: 14px 12px;
  border: 1px solid transparent;
  background: transparent;
  margin-bottom: 6px;
}
.run.selected {
  background: var(--ui-elevated);
  border-color: var(--ui-border-subtle);
}
.run strong {
  display: block;
  font-size: 13px;
  overflow-wrap: anywhere;
  margin-bottom: 8px;
}
.run small {
  display: block;
  font-size: 11px;
  margin-top: 7px;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 4px;
  background: var(--ui-elevated);
  color: var(--text-secondary);
  padding: 3px 7px;
  text-transform: capitalize;
}
.status-running,
.status-completed {
  color: var(--text-primary);
  background: var(--ui-elevated);
}
.status-draining,
.status-error {
  color: var(--risk);
  background: var(--ui-elevated);
}
.status-paused,
.status-stopped {
  color: var(--text-secondary);
}
.feed {
  border-top: 1px solid var(--ui-border-subtle);
  margin-top: 28px;
  padding: 18px 10px;
}
.feed h3 {
  font-size: 12px;
  margin-bottom: 8px;
}
.feed p,
.feed dl {
  font-size: 11px;
}
.feed summary {
  font-size: 11px;
  color: var(--text-tertiary);
}
.feed dd {
  margin: 0 0 8px;
}
.feed dt {
  color: var(--text-tertiary);
}
#details {
  min-width: 0;
  padding: 30px 32px 60px;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.run-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}
.run-heading .eyebrow {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}
.run-heading p:not(.eyebrow) {
  font-size: 12px;
}
.separator {
  color: var(--ui-border-strong);
  margin: 0 8px;
}
.run-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.run-actions button {
  font-size: 12px;
}
.action-menu {
  position: relative;
}
.action-menu > summary {
  list-style: none;
  padding: 9px 12px;
  border: 1px solid var(--ui-border-subtle);
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
}
.action-menu > summary span {
  margin-left: 12px;
}
.action-menu > div {
  position: absolute;
  right: 0;
  top: 45px;
  z-index: 9;
  width: 230px;
  background: var(--ui-elevated);
  padding: 6px;
  box-shadow: 0 16px 50px #0009;
  border: 1px solid var(--ui-border-subtle);
  border-radius: 9px;
}
.action-menu button,
.action-menu a {
  display: block;
  text-align: left;
  width: 100%;
  background: none;
  border: 0;
  padding: 10px;
  text-decoration: none;
  font-size: 12px;
}
.action-menu button:hover,
.action-menu a:hover {
  background: var(--ui-hover);
}
.progress-track {
  height: 3px;
  background: var(--ui-border-subtle);
  margin: 23px 0 20px;
  border-radius: 4px;
  overflow: hidden;
}
.progress-track > span {
  display: block;
  height: 100%;
  background: var(--data-chart-primary);
}
.health-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--ui-border-subtle);
  background: var(--ui-panel);
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
}
.health-banner strong {
  font-size: 12px;
  font-weight: 600;
}
.health-banner p {
  font-size: 11px;
  margin: 3px 0 0;
  max-width: 800px;
}
.health-banner > div {
  flex: 1;
}
.health-banner button {
  font-size: 11px;
  background: transparent;
  white-space: nowrap;
}
.health-dot {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  background: var(--semantic-gain);
  border-radius: 50%;
}
.health-banner.warning {
  border-color: var(--ui-border-subtle);
  background: var(--ui-panel);
}
.warning .health-dot {
  background: var(--risk);
}
.warning strong {
  color: var(--risk);
}
.run-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}
.metric {
  background: var(--ui-panel);
  border: 1px solid var(--ui-border-subtle);
  border-radius: 8px;
  padding: 15px 18px;
}
.metric > span {
  font-size: 11px;
  color: var(--text-secondary);
}
.metric strong {
  display: block;
  font-size: 27px;
  font-weight: 550;
  letter-spacing: -0.7px;
  margin: 6px 0;
}
.metric small {
  font-size: 11px;
}
.metric .unit {
  font-size: 13px;
  color: var(--text-tertiary);
  letter-spacing: 0;
}
.tabs {
  display: flex;
  gap: 27px;
  border-bottom: 1px solid var(--ui-border-subtle);
  margin-bottom: 20px;
}
.tabs button {
  padding: 11px 0;
  background: none;
  border: 0;
  border-radius: 0;
  font-size: 12px;
  color: var(--text-tertiary);
}
.tabs button.selected {
  border-bottom: 2px solid var(--action-primary);
  color: var(--text-primary);
}
.tab-count {
  background: var(--ui-hover);
  padding: 2px 6px;
  font-size: 11px;
  margin-left: 8px;
  border-radius: 4px;
}
.wallet-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 16px;
}
.segmented {
  display: flex;
  padding: 3px;
  background: var(--ui-elevated);
  border: 1px solid var(--ui-border-subtle);
  border-radius: 7px;
  gap: 2px;
}
.segmented button {
  min-height: 29px;
  border: 0;
  background: transparent;
  font-size: 11px;
  padding: 5px 10px;
  color: var(--text-tertiary);
}
.segmented button.selected {
  background: var(--ui-hover);
  color: var(--text-primary);
}
.wallet-tools input {
  max-width: 260px;
  font-size: 12px;
}
.wallet-workspace {
  display: grid;
  grid-template-columns: minmax(540px, 1.5fr) minmax(280px, 1fr);
  gap: 20px;
  align-items: start;
}
.wallet-list {
  border: 1px solid var(--ui-border-subtle);
  border-radius: 8px;
  overflow: hidden;
}
.wallet-columns,
.wallet-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 55px 90px 115px;
  gap: 12px;
  align-items: center;
  padding: 13px 16px;
}
.wallet-columns {
  background: var(--ui-panel);
  color: var(--text-tertiary);
  font-size: 11px;
}
.wallet-columns > span:not(:first-child),
.wallet-row > span:not(:first-child) {
  text-align: right;
}
.wallet-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--ui-border-subtle);
  border-radius: 0;
  background: transparent;
  text-align: left;
  min-height: 76px;
  font-size: 12px;
}
.wallet-row.selected {
  background: var(--ui-elevated);
  box-shadow: inset 3px 0 var(--action-primary);
}
.wallet-row:hover {
  background: var(--ui-hover);
}
.wallet-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.wallet-identity strong {
  display: block;
  font-size: 12px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.wallet-identity strong small {
  font-size: 11px;
  margin-left: 3px;
}
.wallet-identity > span > small {
  display: block;
  font-size: 11px;
  margin-top: 4px;
}
.avatar {
  width: 30px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  flex-shrink: 0;
  font-weight: 650;
}
.persona-farmer {
  background: var(--ui-elevated);
  color: var(--text-secondary);
}
.persona-organic {
  background: var(--ui-elevated);
  color: var(--text-secondary);
}
.persona-topBlaster {
  background: var(--ui-elevated);
  color: var(--text-secondary);
}
.persona-doubleDown {
  background: var(--ui-elevated);
  color: var(--text-secondary);
}
.persona-indecisive {
  background: var(--ui-elevated);
  color: var(--text-secondary);
}
.persona-random {
  background: var(--ui-elevated);
  color: var(--text-secondary);
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px;
  font-size: 11px;
  color: var(--text-tertiary);
}
.pagination > span:first-child {
  margin-right: auto;
}
.pagination button {
  padding: 3px 9px;
  min-height: 28px;
  font-size: 12px;
}
.wallet-inspector {
  border: 1px solid var(--ui-border-subtle);
  border-radius: 8px;
  background: var(--ui-panel);
  padding: 20px;
  position: sticky;
  top: 16px;
}
.inspector-heading h2 {
  font-size: 18px;
  margin: 5px 0;
}
.inspector-heading > p:last-child {
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.text-button {
  border: 0;
  background: none !important;
  font-size: 11px;
  padding: 4px;
  min-height: 24px;
  color: var(--text-secondary);
}
.balance-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--ui-border-subtle);
}
.balance-pair span {
  display: block;
  font-size: 11px;
  color: var(--text-tertiary);
}
.balance-pair strong {
  display: block;
  font-size: 22px;
  font-weight: 550;
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
}
.wallet-warning {
  background: var(--ui-panel);
  border: 1px solid var(--ui-border-subtle);
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 14px;
}
.wallet-warning strong {
  color: var(--risk);
  font-size: 11px;
}
.wallet-warning p {
  font-size: 11px;
}
.strategy-note {
  font-size: 11px;
  margin: 14px 0;
}
.inspector-section {
  display: flex;
  justify-content: space-between;
  margin: 22px 0 12px;
  font-size: 12px;
}
.inspector-section > span {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 400;
}
.position-card {
  background: var(--ui-elevated);
  padding: 12px;
  border: 1px solid var(--ui-border-subtle);
  border-radius: 7px;
  margin-bottom: 10px;
}
.position-card > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.direction {
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 2px 5px;
  border-radius: 3px;
}
.long {
  background: color-mix(in srgb, var(--semantic-gain) 12%, transparent);
  color: var(--semantic-gain);
}
.short {
  background: color-mix(in srgb, var(--semantic-loss) 12%, transparent);
  color: var(--semantic-loss);
}
.leverage {
  margin-left: auto;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.position-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 12px 0;
  gap: 12px;
}
.position-facts span {
  font-size: 11px;
  color: var(--text-tertiary);
}
.position-facts strong {
  display: block;
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 500;
  margin-top: 3px;
}
.position-card > small {
  font-size: 11px;
  display: block;
  overflow-wrap: anywhere;
}
.empty-inline {
  font-size: 11px;
  background: var(--ui-elevated);
  border-radius: 6px;
  padding: 15px;
}
.action-timeline > div {
  display: flex;
  align-items: start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--ui-border-subtle);
}
.action-timeline > div > div {
  flex: 1;
  min-width: 0;
}
.action-timeline strong {
  font-size: 11px;
  text-transform: capitalize;
  font-weight: 500;
}
.action-timeline small {
  display: block;
  font-size: 11px;
}
.action-timeline > div > span:last-child {
  font-size: 11px;
  color: var(--text-tertiary);
}
.action-dot {
  width: 6px;
  height: 6px;
  background: var(--text-secondary);
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.action-dot.confirmed {
  background: var(--semantic-gain);
}
.action-dot.failed {
  background: var(--semantic-risk);
}
.action-timeline details {
  font-size: 11px;
}
.footnote {
  font-size: 11px;
  margin-top: 15px;
  color: var(--text-tertiary);
}
.log-tools {
  display: flex;
  gap: 8px;
  align-items: center;
}
.log-tools input {
  flex: 1;
}
.log-tools button {
  font-size: 11px;
  white-space: nowrap;
}
.live-pill {
  color: var(--text-primary);
  border-color: var(--ui-border-subtle);
}
.log-caption {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin: 14px 0;
}
.log-caption span {
  color: var(--text-tertiary);
}
#log-rows {
  height: 57vh;
  overflow-y: auto;
  overflow-anchor: none;
  border: 1px solid var(--ui-border-subtle);
  background: var(--ui-background);
  border-radius: 8px;
  padding: 0 14px;
  margin-bottom: 12px;
}
.log {
  padding: 12px 0;
  border-bottom: 1px solid var(--ui-border-subtle);
  font:
    11px/1.7 ui-monospace,
    monospace;
  overflow-wrap: anywhere;
}
.log time {
  color: var(--text-tertiary);
  margin-right: 10px;
  font-size: 11px;
}
.log b {
  font-size: 11px;
  text-transform: uppercase;
  display: inline-block;
  min-width: 40px;
  color: var(--text-secondary);
}
.log.warn b,
.log.error b {
  color: var(--risk);
}
.log.warn,
.log.error {
  color: var(--semantic-risk);
}
.log small {
  margin: 0 8px;
}
.settings-view {
  max-width: 850px;
  padding: 8px 0;
}
.settings-view h3 {
  font-size: 16px;
}
.settings-view p {
  font-size: 12px;
}
.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 30px;
  margin: 22px 0;
}
.facts > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--ui-border-subtle);
  font-size: 12px;
}
.facts span {
  color: var(--text-tertiary);
}
.facts strong {
  font-weight: 500;
  text-align: right;
}
.mix-bar {
  display: flex;
  height: 8px;
  gap: 3px;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 22px;
}
.mix-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 11px;
  margin: 14px 0;
}
.mix-legend i,
.persona-title i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  margin-right: 7px;
}
.mix-legend strong {
  margin-left: 7px;
}
.download-panel {
  margin: 28px 0;
  padding: 20px;
  background: var(--ui-panel);
  border: 1px solid var(--ui-border-subtle);
  border-radius: 8px;
}
.toolbar {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 14px;
  font-size: 12px;
}
.technical {
  border-bottom: 1px solid var(--ui-border-subtle);
  padding: 14px 0;
  font-size: 12px;
  color: var(--text-secondary);
}
summary {
  cursor: pointer;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font:
    11px/1.7 ui-monospace,
    monospace;
  color: var(--text-secondary);
}
.empty {
  text-align: center;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.empty > span {
  font-size: 42px;
  color: var(--text-primary);
}
.empty.compact {
  min-height: 170px;
}
.empty p {
  font-size: 12px;
}
#notice {
  padding: 12px 24px;
  background: var(--ui-panel);
  border-bottom: 1px solid var(--ui-border-subtle);
  color: var(--risk);
  font-size: 12px;
}
footer {
  font-size: 11px;
  color: var(--text-tertiary);
  text-align: center;
  padding: 14px;
  border-top: 1px solid var(--ui-border-subtle);
}
input,
select {
  min-height: 40px;
  background: var(--ui-panel);
  color: var(--text-primary);
  border: 1px solid var(--ui-border-subtle);
  border-radius: 6px;
  padding: 9px 11px;
  min-width: 0;
  width: 100%;
}
input:focus,
select:focus {
  border-color: var(--ui-border-strong);
}
label {
  font-size: 12px;
  color: var(--text-secondary);
}
label > input,
label > select {
  display: block;
  margin-top: 7px;
}
label > small {
  display: block;
  font-size: 11px;
  margin-top: 7px;
  line-height: 1.5;
}
.wide {
  grid-column: 1/-1;
}
dialog {
  color: var(--text-primary);
  background: var(--ui-panel);
  border: 1px solid var(--ui-border-subtle);
  border-radius: 14px;
  width: min(940px, calc(100vw - 32px));
  max-height: 92vh;
  padding: 28px 32px;
  box-shadow: 0 25px 100px #0009;
}
dialog::backdrop {
  background: rgb(0 0 0 / 70%);
}
dialog .section-title {
  margin-bottom: 8px;
}
dialog h2 {
  font-size: 24px;
  letter-spacing: -0.5px;
}
.dialog-intro {
  font-size: 12px;
  margin-bottom: 26px;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 16px 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
legend {
  font-size: 12px;
  font-weight: 600;
}
.setup-section {
  padding: 22px 0;
  border-top: 1px solid var(--ui-border-subtle);
}
.step-title {
  display: flex;
  gap: 12px;
  align-items: start;
  margin-bottom: 20px;
}
.step-title > span {
  font:
    11px ui-monospace,
    monospace;
  color: var(--text-primary);
  background: var(--ui-elevated);
  border: 1px solid var(--ui-border-subtle);
  border-radius: 5px;
  padding: 6px;
}
.step-title h3 {
  font-size: 15px;
}
.step-title p {
  font-size: 11px;
  margin: 3px 0;
}
.market-options {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.market-options label {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 9px 16px;
  background: var(--ui-elevated);
  border: 1px solid var(--ui-border-subtle);
  border-radius: 6px;
  color: var(--text-primary);
}
.market-options input {
  width: 14px;
  height: 14px;
  min-height: 0;
  margin: 0;
  accent-color: var(--text-primary);
}
.market-options label:has(input:checked) {
  border-color: var(--ui-border-strong);
  background: var(--ui-elevated);
}
.persona-presets {
  display: flex;
  gap: 8px;
  margin: 15px 0 22px;
}
.persona-presets button {
  flex: 1;
  font-size: 11px;
  background: transparent;
  font-weight: 400;
}
.persona-presets button[aria-pressed="true"] {
  background: var(--ui-elevated);
  border-color: var(--ui-border-strong);
  color: var(--text-primary);
}
.mix-heading {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}
.persona-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.persona-input {
  display: grid;
  grid-template-columns: 1fr 82px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--ui-border-subtle);
  border-radius: 8px;
  padding: 14px;
  background: var(--ui-panel);
}
.persona-input.chosen {
  border-color: var(--ui-border-subtle);
  background: var(--ui-panel);
}
.persona-title {
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 500;
}
.percentage {
  display: flex;
  align-items: center;
  gap: 5px;
}
.percentage input {
  margin: 0;
  text-align: right;
  padding: 7px;
  font-variant-numeric: tabular-nums;
}
.percentage > span {
  font-size: 11px;
  color: var(--text-tertiary);
}
.persona-input > small {
  grid-column: 1/-1;
  font-size: 11px;
  margin: 0;
}
.setting-note {
  font-size: 11px;
  background: var(--ui-elevated);
  border-left: 2px solid var(--ui-border-strong);
  padding: 12px;
}
.summary {
  padding: 18px;
  background: var(--ui-elevated);
  border: 1px solid var(--ui-border-subtle);
  border-radius: 8px;
  margin: 20px 0;
}
.summary strong {
  display: block;
  font-size: 16px;
  margin-top: 8px;
}
.summary p,
.summary small {
  font-size: 11px;
}
.summary .eyebrow {
  font-size: 11px;
  color: var(--text-primary);
}
.summary .footnote {
  font-size: 11px;
  margin-top: 12px;
}
.dialog-actions {
  position: sticky;
  bottom: -28px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 18px 0 5px;
  background: var(--ui-panel);
  border-top: 1px solid var(--ui-border-subtle);
  margin-top: 20px;
}
#preflight-result {
  font-size: 12px;
  color: var(--risk);
  padding: 10px 0;
}
.login-page {
  max-width: 440px;
  margin: 100px auto;
  padding: 32px;
  background: var(--ui-panel);
  border: 1px solid var(--ui-border-subtle);
  border-radius: 12px;
}
.login-page form {
  display: grid;
  gap: 20px;
  margin-top: 28px;
}
.login-page h1 {
  font-size: 25px;
}
#login-error {
  color: var(--risk);
}
@media (min-width: 1500px) {
  #details {
    padding: 36px 45px;
  }
  .wallet-workspace {
    grid-template-columns: minmax(540px, 1.5fr) minmax(350px, 1fr);
  }
}
@media (max-width: 1150px) {
  .workspace {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  #details {
    padding: 24px 20px;
  }
  .wallet-workspace {
    grid-template-columns: 1fr;
  }
  .wallet-inspector {
    position: static;
  }
  .run-heading {
    align-items: start;
    flex-direction: column;
    gap: 12px;
  }
  .run-stats {
    gap: 8px;
  }
  .metric {
    padding: 12px;
  }
  .metric strong {
    font-size: 23px;
  }
  .wallet-list {
    max-height: 400px;
    overflow: auto;
  }
  .wallet-inspector .position-card {
    display: inline-block;
    width: calc(50% - 6px);
    vertical-align: top;
    margin-right: 6px;
  }
  .health-banner {
    align-items: start;
  }
  .health-banner button {
    align-self: center;
  }
}
@media (max-width: 700px) {
  header {
    padding: 0 16px;
  }
  .brand span {
    margin-left: 4px;
  }
  #connection {
    display: none;
  }
  .workspace {
    display: block;
  }
  .history {
    border-right: 0;
    border-bottom: 1px solid var(--ui-border-subtle);
    padding: 15px;
  }
  .history .section-title,
  .feed {
    display: none;
  }
  #new-run {
    width: auto;
    margin-bottom: 10px;
  }
  #run-list {
    display: flex;
    gap: 8px;
    max-height: 140px;
  }
  .run {
    min-width: 180px;
    width: 180px;
    border: 1px solid var(--ui-border-subtle);
    flex-shrink: 0;
  }
  .run small:last-child {
    display: none;
  }
  #details {
    padding: 22px 15px;
  }
  .run-stats {
    grid-template-columns: 1fr 1fr;
  }
  .metric strong {
    font-size: 25px;
  }
  .wallet-tools {
    flex-direction: column;
    align-items: stretch;
  }
  .wallet-tools input {
    max-width: none;
  }
  .segmented button {
    flex: 1;
  }
  .tabs {
    gap: 23px;
  }
  .health-banner {
    flex-wrap: wrap;
  }
  .health-banner button {
    margin-left: 19px;
  }
  .wallet-columns,
  .wallet-row {
    grid-template-columns: minmax(135px, 1fr) 48px 90px 110px;
    gap: 8px;
    padding: 12px;
  }
  .wallet-inspector .position-card {
    display: block;
    width: 100%;
    margin-right: 0;
  }
  .facts {
    grid-template-columns: 1fr;
  }
  .log-tools {
    flex-wrap: wrap;
  }
  .log-tools input {
    flex-basis: 100%;
  }
  .log-caption span {
    display: none;
  }
  dialog {
    padding: 20px;
  }
  .persona-grid {
    grid-template-columns: 1fr;
  }
  .persona-presets {
    gap: 5px;
  }
  .persona-presets button {
    padding: 8px 5px;
    font-size: 11px;
  }
  .dialog-actions {
    bottom: -20px;
  }
  fieldset {
    gap: 14px;
  }
  .run-heading h1 {
    font-size: 26px;
  }
  .login-page {
    margin: 40px 20px;
  }
  .wallet-identity {
    gap: 7px;
  }
  .avatar {
    width: 24px;
    height: 29px;
  }
}
.run-context {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-tertiary);
  margin: -8px 0 18px;
}
.run-context > div {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.run-context i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  margin-right: 6px;
}
.run-context strong {
  color: var(--text-secondary);
  font-weight: 500;
}

.wallet-columns button {
  min-height: 28px;
  padding: 0;
  background: none;
  border: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 5px;
}
.wallet-columns button:not(:first-child) {
  justify-content: flex-end;
}
.wallet-columns button:hover,
.wallet-columns button.sorted {
  color: var(--text-primary);
}
.wallet-columns button span {
  font-size: 11px;
  color: var(--text-tertiary);
}
.wallet-columns button.sorted span {
  color: var(--text-primary);
}

.farmer-supply-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  background: var(--ui-panel);
  border: 1px solid var(--ui-border-subtle);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 16px;
}
.farmer-supply-card span {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
}
.farmer-supply-card strong {
  display: block;
  font-size: 30px;
  color: var(--text-primary);
  font-weight: 550;
  margin-top: 4px;
}
.farmer-supply-card p {
  font-size: 12px;
}
.farmer-supply-card small {
  font-size: 11px;
}
@media (max-width: 700px) {
  .farmer-supply-card {
    align-items: start;
    flex-direction: column;
    gap: 5px;
  }
}

.wallet-list {
  overflow-x: auto;
}
.wallet-columns,
.wallet-row {
  min-width: 530px;
}
.mog-holding small {
  display: block;
  color: var(--text-tertiary);
  font-size: 11px;
  margin-top: 5px;
}
.holdings-status {
  font-size: 11px;
}

.capital-scale {
  display: flex;
  justify-content: space-between;
  color: var(--text-tertiary);
  font-size: 11px;
}
#capital-preview p {
  margin-bottom: 4px;
}
#capital-preview small {
  color: var(--text-tertiary);
}

.capital-money {
  display: flex;
  align-items: center;
  margin-top: 7px;
  border: 1px solid var(--ui-border-subtle);
  border-radius: 8px;
  background: var(--ui-background);
  overflow: hidden;
}
.capital-money:focus-within {
  border-color: var(--data-chart-primary);
  box-shadow: 0 0 0 2px transparent;
}
.capital-money input {
  border: 0;
  background: transparent;
  min-height: 48px;
  font-size: 20px;
  font-weight: 600;
  outline: none;
}
.capital-money > span {
  padding-right: 14px;
  font-size: 11px;
  color: var(--text-tertiary);
}
.capital-distribution-heading,
.capital-preview-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.capital-distribution-heading output {
  color: var(--data-chart-primary);
  font-size: 11px;
  padding: 5px 9px;
  border-radius: 5px;
  background: var(--ui-elevated);
}
.capital-slider-label input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  min-height: 0;
  height: 6px;
  padding: 0;
  margin: 22px 0 15px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  background: linear-gradient(
    to right,
    var(--data-chart-primary) var(--slider-progress, 50%),
    var(--ui-border-subtle) var(--slider-progress, 50%)
  );
}
.capital-slider-label input::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  height: 19px;
  width: 19px;
  background: var(--data-chart-primary);
  border: 3px solid var(--ui-elevated);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--data-chart-primary);
}
.capital-slider-label input::-moz-range-thumb {
  height: 14px;
  width: 14px;
  background: var(--data-chart-primary);
  border: 3px solid var(--ui-elevated);
  border-radius: 50%;
}
.capital-slider-label input:focus-visible {
  outline: 2px solid var(--data-chart-primary);
  outline-offset: 6px;
}
.capital-split {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin: 20px 0 14px;
}
.capital-split > div:last-child {
  text-align: right;
}
.capital-split strong {
  display: block;
  font-size: 22px;
  color: var(--text-primary);
}
.capital-split span {
  font-size: 11px;
  color: var(--text-tertiary);
}
.capital-presets {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.capital-presets button {
  flex: 1;
  padding: 7px 10px;
  font-size: 11px;
}
.capital-presets button[aria-pressed="true"] {
  border-color: var(--data-chart-primary);
  color: var(--data-chart-primary);
  background: var(--ui-elevated);
}
#capital-preview {
  border-top: 1px solid var(--ui-border-subtle);
  padding-top: 16px;
}
.capital-preview-heading {
  color: var(--text-tertiary);
  font-size: 11px;
}
.capital-preview-heading strong {
  color: var(--text-primary);
}
.capital-bars {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 12px;
}
.capital-band {
  text-align: center;
  font-size: 12px;
}
.capital-band > strong {
  font-variant-numeric: tabular-nums;
}
.capital-bar-track {
  display: flex;
  align-items: end;
  height: 45px;
  margin: 8px 0;
}
.capital-bar-track i {
  display: block;
  width: 100%;
  background: var(--data-chart-primary);
  border-radius: 3px 3px 0 0;
  opacity: 0.8;
}
.capital-band > span,
.capital-band > small {
  display: block;
  font-size: 11px;
  color: var(--text-tertiary);
}
.capital-preview-note {
  font-size: 11px;
  color: var(--text-tertiary);
}
@media (max-width: 550px) {
  .capital-bars {
    gap: 5px;
  }
  .capital-split strong {
    font-size: 19px;
  }
  .capital-distribution-heading {
    align-items: start;
  }
}
.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;
}

.scenario-toggle {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
}
.scenario-toggle input {
  width: 17px;
  min-height: 17px;
  margin: 0;
  accent-color: var(--data-chart-primary);
}
.scenario-summary {
  padding: 12px 16px;
  background: var(--ui-panel);
  border: 1px solid var(--ui-border-subtle);
  border-radius: 8px;
  font-size: 12px;
}
.scenario-summary strong {
  color: var(--data-chart-primary);
  margin-right: 8px;
}
.scenario-summary small {
  color: var(--text-tertiary);
}
.scenario-schedule {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}
.scenario-schedule label {
  flex: 1;
}
.participation {
  display: grid;
  gap: 14px;
  border: 1px solid var(--ui-border-subtle);
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
}
.participation-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.participation-intro .eyebrow {
  color: var(--text-tertiary);
}
.participation-intro p {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
  max-width: 64ch;
}
.participation-intro small {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
}
.participation-groups {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.participation-group {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--ui-border-subtle);
  border-radius: 6px;
}
.participation-group > span,
.participation-group small {
  font-size: 11px;
  color: var(--text-tertiary);
}
.participation-group strong {
  font-size: 22px;
  line-height: 1.1;
}
.participation-group strong em {
  font-style: normal;
  font-size: 13px;
  color: var(--text-secondary);
}
.participation-meter {
  height: 6px;
  border-radius: 3px;
  background: var(--ui-border-subtle);
  overflow: hidden;
}
.participation-meter span {
  display: block;
  height: 100%;
  background: var(--data-chart-primary);
}
.participation-group p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
}
@media (max-width: 650px) {
  .participation-groups {
    grid-template-columns: 1fr;
  }
  .participation-intro {
    flex-direction: column;
  }
  .participation-intro small {
    white-space: normal;
  }
  .scenario-schedule {
    flex-direction: column;
    align-items: stretch;
  }
}
.cohort-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--ui-border-subtle);
  padding-bottom: 12px;
}
.cohort-tabs button {
  flex: 1;
  padding: 12px;
}
.cohort-tabs button[aria-selected="true"] {
  background: var(--ui-elevated);
  border-color: var(--data-chart-primary);
  color: var(--data-chart-primary);
}
.cohort-tabs span {
  margin-left: 8px;
  font-size: 11px;
  background: var(--ui-elevated);
  border-radius: 4px;
  padding: 2px 6px;
}
.cohort-panel h4 {
  margin: 24px 0 12px;
  font-size: 14px;
}
.cohort-description,
.cohort-help {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.5;
}
.cohort-count-field {
  max-width: 220px;
}
.cohort-money input {
  font-size: 19px;
  font-weight: 600;
}
.cohort-capital-preview {
  margin-top: 15px;
  color: var(--text-secondary);
  font-size: 12px;
}
.cohort-curve-preview {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--ui-border-subtle);
  background: var(--ui-panel);
  border-radius: 8px;
}
.cohort-curve-points {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.cohort-curve-points span,
.cohort-curve-points small {
  display: block;
  color: var(--text-tertiary);
  font-size: 11px;
}
.cohort-curve-points strong {
  display: block;
  color: var(--data-chart-primary);
  font-size: 20px;
  margin: 5px 0;
}
.cohort-curve-preview p {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 0;
}
.cohort-saved-settings section {
  border: 1px solid var(--ui-border-subtle);
  border-radius: 8px;
  padding: 16px;
  margin: 14px 0;
}
.cohort-saved-settings p {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Admin shell: one continuous workspace, with selection on controls only. */
body {
  min-width: 320px;
}
button:not(:disabled):active {
  background: var(--ui-elevated);
}
button.primary:not(:disabled):active {
  background: var(--action-pressed);
}
button:disabled {
  color: var(--text-disabled);
  opacity: 0.65;
}
h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}
h2 {
  font-size: 16px;
  font-weight: 550;
}
p {
  color: var(--text-secondary);
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.02em;
  font-weight: 450;
  color: var(--text-tertiary);
}
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
}
header {
  height: 64px;
  padding: 0 24px;
  background: var(--ui-background);
}
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand img {
  width: 64px;
  height: 32px;
  object-fit: contain;
}
.brand span {
  margin: 0;
  padding-left: 16px;
  border-left: 1px solid var(--ui-border-subtle);
  font-size: 13px;
}
.badge {
  border: 0;
  background: var(--ui-panel);
  color: var(--text-secondary);
  font-size: 11px;
  letter-spacing: 0;
}
#connection {
  font-variant-numeric: tabular-nums;
  min-width: 135px;
}
#connection::before,
.connection-dot {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-tertiary);
  margin-right: 8px;
}
#connection.disconnected {
  color: var(--risk);
}
#connection.disconnected::before {
  background: var(--risk);
}
main {
  max-width: none;
}
.workspace {
  grid-template-columns: 216px minmax(0, 1fr);
  min-height: calc(100vh - 104px);
}
.history {
  position: sticky;
  top: 64px;
  height: calc(100dvh - 64px);
  padding: 24px 12px;
  background: var(--ui-background);
  display: flex;
  flex-direction: column;
}
.primary-nav {
  display: grid;
  gap: 4px;
  margin-bottom: 24px;
}
.primary-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 12px;
  text-decoration: none;
  border-radius: 8px;
  color: var(--text-secondary);
}
.primary-nav a:hover {
  background: var(--ui-panel);
}
.primary-nav a[aria-current] {
  background: var(--ui-elevated);
  color: var(--text-primary);
  font-weight: 550;
}
.primary-nav svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}
.nav-count {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
#new-run {
  margin: 0 0 32px;
}
.history h2 {
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
  color: var(--text-tertiary);
}
.history .section-title {
  padding: 0 12px;
  margin-bottom: 12px;
}
.recent-runs {
  min-height: 0;
  overflow: auto;
}
#run-list {
  max-height: none;
}
a.run {
  display: block;
  width: 100%;
  text-decoration: none;
  min-width: 0;
  border-radius: 8px;
}
.run {
  padding: 12px;
}
.run strong {
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 4px;
}
.run small {
  margin-top: 4px;
}
.run.selected {
  background: var(--ui-panel);
  border-color: transparent;
  box-shadow: inset 2px 0 var(--action-primary);
}
.run:hover {
  background: var(--ui-panel);
}
.sidebar-note {
  padding: 24px 12px 0;
  margin-top: auto;
  font-size: 11px;
  color: var(--text-secondary);
}
.sidebar-note small {
  display: block;
  padding-left: 14px;
  margin-top: 4px;
}
.sidebar-empty {
  padding: 12px;
  font-size: 12px;
}
#details {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}
#details:focus {
  outline: none;
}
#details:focus-visible {
  outline: 2px solid var(--action-focus);
  outline-offset: -4px;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}
.page-heading .eyebrow {
  margin: 0 0 8px;
}
.page-heading p:last-child {
  margin: 8px 0 0;
}
.page-heading > button {
  white-space: nowrap;
}
.section-title {
  margin-bottom: 16px;
}
.section-title a {
  font-size: 12px;
  color: var(--text-secondary);
}
.run-stats {
  gap: 0;
  margin: 24px 0;
}
.metric {
  border: 0;
  border-right: 1px solid var(--ui-border-subtle);
  border-radius: 0;
  padding: 8px 24px;
  background: transparent;
}
.metric:first-child {
  padding-left: 0;
}
.metric:last-child {
  border-right: 0;
}
.metric strong {
  font-size: 32px;
  margin: 8px 0;
}
.overview-stats {
  margin: 0 0 40px;
}
.overview-stats .metric strong {
  font-size: 40px;
  letter-spacing: -0.03em;
}
.overview-runs,
.overview-connections,
.overview-legacy,
.attention-section {
  margin-top: 32px;
}
.legacy-note {
  margin: 0 0 16px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-tertiary);
  max-width: 720px;
}
.table-wrap {
  overflow-x: auto;
}
.run-table table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.run-table th {
  background: var(--ui-panel);
  height: 46px;
  font-size: 11px;
  font-weight: 450;
  color: var(--text-tertiary);
  white-space: nowrap;
}
.run-table th,
.run-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--ui-border-subtle);
}
.run-table td {
  height: 76px;
  font-size: 13px;
}
.run-table tbody tr:hover {
  background: var(--ui-panel);
}
.run-table .numeric {
  text-align: right;
}
.run-name {
  display: block;
  font-weight: 500;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.run-name:hover {
  text-decoration: underline;
}
.run-table td > small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
}
.run-date {
  font-size: 11px !important;
  color: var(--text-tertiary);
}
.run-table td:last-child a {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  text-decoration: none;
}
.status {
  color: var(--text-secondary);
  background: var(--ui-elevated);
  font-size: 11px;
}
.status::before {
  content: "";
  width: 5px;
  height: 5px;
  background: currentColor;
  border-radius: 50%;
}
.status-running::before,
.status-completed::before {
  background: var(--semantic-gain);
}
.status-error::before,
.status-draining::before {
  background: var(--risk);
}
.status-error,
.status-draining {
  color: var(--risk);
}
.connection-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--ui-border-subtle);
}
.connection-summary > div {
  padding: 20px 24px;
  border-right: 1px solid var(--ui-border-subtle);
}
.connection-summary > div:first-child {
  padding-left: 0;
}
.connection-summary > div:last-child {
  border-right: 0;
}
.connection-summary span {
  display: block;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}
.connection-summary strong {
  font-size: 13px;
  font-weight: 500;
  text-transform: capitalize;
}
.connection-summary small {
  font-weight: 400;
  display: block;
  margin-top: 4px;
}
.attention-section {
  border-left: 2px solid var(--risk);
  padding: 0 16px;
}
.attention-section .section-title > span {
  color: var(--text-tertiary);
  font-size: 11px;
}
.attention-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  text-decoration: none;
  border-top: 1px solid var(--ui-border-subtle);
}
.attention-row > div {
  flex: 1;
  min-width: 0;
}
.attention-row p {
  margin: 4px 0 0;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.attention-row strong {
  font-weight: 500;
}
.directory-tools {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.directory-tools input {
  max-width: 300px;
}
.segmented {
  border: 0;
  padding: 0;
  background: transparent;
  gap: 4px;
}
.segmented button {
  min-height: 36px;
  font-size: 12px;
  border-radius: 6px;
}
.segmented button.selected {
  background: var(--ui-elevated);
  color: var(--text-primary);
}
.breadcrumbs {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  font-size: 12px;
  color: var(--text-tertiary);
}
.breadcrumbs span:last-child {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.run-heading {
  align-items: start;
}
.run-heading .eyebrow {
  margin: 0 0 8px;
}
.run-heading {
  margin-bottom: 24px;
}
.tabs {
  gap: 24px;
  overflow-x: auto;
  margin-bottom: 24px;
}
.tabs button {
  min-height: 46px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tabs button.selected {
  border-bottom-color: var(--action-primary);
}
.progress-track {
  margin: 0 0 16px;
  height: 2px;
}
.progress-track > span {
  background: var(--data-chart-primary);
}
.health-banner {
  border: 0;
  border-left: 2px solid var(--ui-border-strong);
  border-radius: 0;
  background: var(--ui-panel);
  padding: 12px 16px;
  margin-bottom: 24px;
}
.health-banner.warning {
  border-color: var(--risk);
  background: var(--ui-panel);
}
.health-dot {
  background: var(--text-tertiary);
}
.farmer-supply-card {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ui-border-subtle);
  border-radius: 0;
  padding: 24px 0;
}
.farmer-supply-card strong {
  font-size: 40px;
  color: var(--text-primary);
}
.farmer-supply-card small {
  font-size: 11px;
}
.participation {
  border: 0;
  border-top: 1px solid var(--ui-border-subtle);
  border-radius: 0;
  padding: 24px 0;
}
.participation-intro {
  flex-wrap: wrap;
}
.participation-intro p {
  font-size: 12px;
}
.participation-group {
  border: 0;
  border-radius: 0;
  padding: 16px 0;
}
.participation-group + .participation-group {
  border-left: 1px solid var(--ui-border-subtle);
  padding-left: 24px;
}
.wallet-workspace {
  grid-template-columns: minmax(530px, 1.5fr) minmax(280px, 1fr);
  gap: 24px;
}
.wallet-list {
  border: 0;
  border-radius: 0;
}
.wallet-columns {
  background: var(--ui-panel);
  min-height: 46px;
}
.wallet-row.selected {
  background: var(--ui-panel);
  box-shadow: inset 2px 0 var(--action-primary);
}
.wallet-inspector {
  background: transparent;
  border: 0;
  border-left: 1px solid var(--ui-border-subtle);
  border-radius: 0;
  padding: 0 0 0 24px;
  top: 88px;
}
.avatar {
  color: var(--text-secondary);
  background: var(--ui-elevated);
}
.wallet-identity strong,
.wallet-identity > span > small {
  line-height: 1.4;
}
.balance-pair strong {
  overflow-wrap: anywhere;
  font-size: 22px;
}
.position-card {
  background: var(--ui-panel);
  border: 0;
}
.wallet-warning {
  border: 0;
  border-left: 2px solid var(--risk);
  border-radius: 0;
}
.live-pill {
  color: var(--text-primary);
}
#log-rows {
  background: var(--ui-background);
  border: 0;
  border-top: 1px solid var(--ui-border-subtle);
  border-radius: 0;
}
.log {
  font-family: Geist, sans-serif;
  font-size: 12px;
}
.connection-section {
  max-width: 1000px;
  margin-top: 32px;
}
.connection-section .section-title {
  border-bottom: 1px solid var(--ui-border-subtle);
  padding-bottom: 16px;
}
.connection-section .facts {
  margin: 0;
}
.connection-section > p {
  font-size: 12px;
}
.observer-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 100px 180px 16px;
  gap: 16px;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--ui-border-subtle);
  text-decoration: none;
}
.observer-row strong {
  font-size: 13px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.observer-row > span {
  font-size: 12px;
  color: var(--text-secondary);
}
.download-panel,
.cohort-saved-settings section {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--ui-border-subtle);
  border-radius: 0;
  padding: 24px 0;
}
input,
select {
  background: var(--ui-panel);
  border-color: var(--ui-border-subtle);
  min-height: 44px;
  border-radius: 10px;
}
input::placeholder {
  color: var(--text-tertiary);
}
input:focus,
select:focus {
  border-color: var(--ui-border-strong);
  outline: 1px solid var(--ui-border-strong);
  outline-offset: 0;
}
dialog {
  border-radius: 18px;
  background: var(--ui-background);
  max-height: calc(100dvh - 48px);
  padding: 24px 32px;
}
dialog h2 {
  font-size: 21px;
  font-weight: 550;
}
.dialog-actions {
  background: var(--ui-background);
  bottom: -24px;
  padding: 16px 0;
}
.dialog-actions button {
  min-height: 46px;
}
.step-title > span {
  border: 0;
  background: transparent;
  font-family: inherit;
  color: var(--text-tertiary);
  padding: 2px 0;
}
.capital-distribution-heading output {
  color: var(--text-secondary);
  background: var(--ui-panel);
}
.capital-money:focus-within {
  border-color: var(--ui-border-strong);
  box-shadow: none;
}
.capital-money input:focus {
  outline: 0;
}
.cohort-tabs button[aria-selected="true"] {
  color: var(--text-primary);
  background: var(--ui-elevated);
  border-color: var(--action-primary);
}
.cohort-curve-preview {
  border: 0;
  border-top: 1px solid var(--ui-border-subtle);
  border-radius: 0;
  padding: 16px 0;
  background: transparent;
}
.cohort-curve-points strong {
  color: var(--text-primary);
}
.summary {
  border: 0;
  border-top: 1px solid var(--ui-border-subtle);
  border-radius: 0;
  background: transparent;
  padding: 24px 0;
}
.login-page {
  background: transparent;
  border: 0;
  text-align: center;
}
.login-emblem {
  width: 48px;
  height: 48px;
  margin-bottom: 24px;
}
.login-page form {
  text-align: left;
}
.login-page button {
  min-height: 46px;
}
.login-page :is(button, a):focus-visible {
  outline: 1px solid var(--text-secondary);
}
footer {
  font-size: 11px;
  color: var(--text-tertiary);
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 12px;
  background: var(--ui-elevated);
}
.skip-link:focus {
  top: 8px;
}
@media (max-width: 1400px) and (min-width: 1180px) {
  .wallet-workspace {
    grid-template-columns: 1fr;
  }
  .wallet-inspector {
    position: static;
    border-left: 0;
    border-top: 1px solid var(--ui-border-subtle);
    padding: 24px 0;
  }
}
@media (max-width: 1179px) {
  .workspace {
    display: block;
  }
  .history {
    position: static;
    height: auto;
    padding: 0;
    border: 0;
  }
  .history > :not(.primary-nav) {
    display: none;
  }
  .primary-nav {
    position: fixed;
    z-index: 30;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    margin: 0;
    padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
    background: var(--ui-panel);
    border-top: 1px solid var(--ui-border-subtle);
  }
  .primary-nav a,
  .primary-nav a:hover,
  .primary-nav a[aria-current] {
    background: transparent;
    padding: 12px 24px;
    min-height: 48px;
    color: var(--text-tertiary);
  }
  .primary-nav a[aria-current] {
    color: var(--text-primary);
  }
  .primary-nav svg {
    width: 24px;
    height: 24px;
  }
  .primary-nav a > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  #details {
    padding: 32px 24px 48px;
  }
  footer {
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }
  .wallet-workspace {
    grid-template-columns: 1fr;
  }
  .wallet-inspector {
    position: static;
    border-left: 0;
    border-top: 1px solid var(--ui-border-subtle);
    padding: 24px 0;
    scroll-margin-top: 80px;
  }
  .wallet-list {
    max-height: none;
  }
  .run-heading {
    flex-direction: column;
  }
  .run-table td:first-child {
    min-width: 180px;
  }
  .login-page {
    margin: 64px auto;
  }
}
@media (max-width: 767px) {
  header {
    padding: 0 16px;
  }
  header > div {
    gap: 8px;
  }
  header .text-button {
    min-height: 44px;
    padding: 8px;
  }
  #connection {
    display: none;
  }
  .brand {
    gap: 12px;
  }
  .brand span {
    padding-left: 12px;
  }
  #details {
    padding: 24px 16px 32px;
  }
  .page-heading {
    gap: 12px;
    align-items: start;
    margin-bottom: 24px;
  }
  .page-heading > button {
    padding: 10px 12px;
    min-height: 48px;
  }
  .page-heading p:last-child {
    font-size: 12px;
  }
  .run-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 24px;
  }
  .metric {
    padding: 0 16px;
  }
  .metric:nth-child(odd) {
    padding-left: 0;
  }
  .metric:nth-child(even) {
    border: 0;
  }
  .metric strong,
  .overview-stats .metric strong {
    font-size: 32px;
  }
  .connection-summary {
    grid-template-columns: 1fr;
  }
  .connection-summary > div {
    padding: 16px 0;
    border-right: 0;
    border-bottom: 1px solid var(--ui-border-subtle);
  }
  .connection-summary small {
    display: inline;
  }
  .connection-summary span {
    margin-bottom: 4px;
  }
  .run-table th:nth-child(3),
  .run-table td:nth-child(3),
  .run-table th:nth-child(5),
  .run-table td:nth-child(5),
  .run-table th:nth-child(6),
  .run-table td:nth-child(6),
  .run-table th:last-child,
  .run-table td:last-child {
    display: none;
  }
  .run-table td:first-child {
    min-width: 0;
  }
  .run-table td,
  .run-table th {
    padding: 12px 8px;
  }
  .run-table th:first-child,
  .run-table td:first-child {
    padding-left: 12px;
  }
  .run-table td {
    font-size: 12px;
  }
  .run-name {
    min-height: 28px;
    display: flex;
    align-items: center;
  }
  .run-table .status {
    white-space: nowrap;
  }
  .directory-tools {
    flex-direction: column-reverse;
  }
  .directory-tools input {
    max-width: none;
  }
  .segmented {
    overflow-x: auto;
  }
  .segmented button {
    min-height: 44px;
    white-space: nowrap;
    padding: 8px;
  }
  .wallet-tools {
    flex-direction: column;
    align-items: stretch;
  }
  .wallet-tools input {
    max-width: none;
  }
  .run-actions button,
  .action-menu > summary {
    min-height: 44px;
  }
  .tabs {
    gap: 20px;
  }
  .participation-groups {
    grid-template-columns: 1fr;
  }
  .participation-group + .participation-group {
    border-left: 0;
    border-top: 1px solid var(--ui-border-subtle);
    padding: 16px 0;
  }
  .farmer-supply-card {
    flex-direction: column;
    align-items: start;
  }
  .facts {
    grid-template-columns: 1fr;
  }
  .observer-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }
  .observer-row > span:last-child {
    display: none;
  }
  .attention-row {
    gap: 12px;
  }
  .attention-row .status {
    display: none;
  }
  .log-tools {
    flex-wrap: wrap;
  }
  .log-tools input {
    flex-basis: 100%;
  }
  .log-tools button {
    min-height: 44px;
  }
  dialog {
    margin: auto 0 0;
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 24px);
    padding: 24px 16px;
    border-radius: 18px 18px 0 0;
  }
  .dialog-actions {
    bottom: -24px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
  fieldset {
    gap: 12px;
  }
  .cohort-tabs button {
    min-height: 48px;
  }
  .login-page {
    margin: 40px auto;
    padding: 24px;
  }
  .text-button {
    min-height: 44px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
#control-dialog {
  width: min(440px, calc(100vw - 32px));
}
#control-help {
  margin: 12px 0 24px;
  font-size: 13px;
}
#control-value {
  font-size: 24px;
  font-weight: 550;
  min-height: 64px;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 767px) {
  #control-dialog {
    width: 100%;
  }
}
.capital-slider-label input[type="range"] {
  height: 44px;
  background: transparent;
  margin: 8px 0;
}
.capital-slider-label input::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(
    to right,
    var(--data-chart-primary) var(--slider-progress, 50%),
    var(--ui-border-subtle) var(--slider-progress, 50%)
  );
}
.capital-slider-label input::-webkit-slider-thumb {
  margin-top: -7px;
  width: 20px;
  height: 20px;
}
.capital-slider-label input::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: var(--ui-border-subtle);
}
.capital-slider-label input::-moz-range-progress {
  height: 6px;
  background: var(--data-chart-primary);
}
@media (max-width: 767px) {
  input,
  select {
    font-size: 16px;
  }
  dialog button {
    min-height: 44px;
  }
}

.run-funding {
  padding: 20px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--ui-border-subtle);
}
.run-funding > p {
  color: var(--text-secondary);
}
.funding-address {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
}
.funding-address > span {
  flex-basis: 100%;
  color: var(--text-secondary);
}
.funding-address code {
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  min-width: 0;
}
.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 0 0 20px;
}
.health-grid > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--ui-elevated);
  border: 1px solid var(--ui-border-subtle);
  border-radius: 8px;
  min-width: 0;
}
.health-grid span {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.health-grid strong {
  font-size: 15px;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}
.health-grid strong em {
  font-style: normal;
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 12px;
}
.health-grid strong.error {
  color: var(--semantic-error, #d9534f);
}
.health-grid small {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-secondary);
}
.stats-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.stats-meta {
  font-size: 12px;
  color: var(--text-tertiary);
}
.stats-export {
  margin-left: auto;
  display: flex;
  gap: 14px;
  font-size: 12px;
}
.stats-loading {
  color: var(--text-tertiary);
}
.stats-section {
  margin: 28px 0 8px;
}
.stats-section h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.stats-tiles {
  margin-bottom: 12px;
}
.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.chart {
  margin: 0 0 14px;
  padding: 16px 16px 10px;
  background: var(--ui-elevated);
  border: 1px solid var(--ui-border-subtle);
  border-radius: 8px;
  min-width: 0;
}
.chart figcaption {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.chart > svg {
  width: 100%;
  height: auto;
  display: block;
  font-family: inherit;
}
.chart .grid {
  stroke: var(--ui-border-subtle);
  stroke-width: 1;
}
.chart .zero {
  stroke: var(--text-tertiary);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}
.chart .marker {
  stroke: var(--data-chart-primary);
  stroke-width: 1;
  stroke-dasharray: 5 4;
  opacity: 0.8;
}
.chart .tick {
  font-size: 12.5px;
  fill: var(--text-tertiary);
}
.chart .marker-label {
  fill: var(--data-chart-primary);
}
.chart-empty {
  padding: 34px 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}
.chart-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: -1px;
}
#chart-tip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  min-width: 160px;
  padding: 8px 10px;
  background: var(--ui-elevated);
  border: 1px solid var(--ui-border-subtle);
  border-radius: 6px;
  font-size: 11.5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
#chart-tip time {
  display: block;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}
#chart-tip div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}
.stats-table td:first-child {
  color: var(--text-secondary);
}
.stats-card {
  margin: 0 0 14px;
  padding: 6px 16px 10px;
  background: var(--ui-elevated);
  border: 1px solid var(--ui-border-subtle);
  border-radius: 8px;
  overflow-x: auto;
}
.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.stats-table th {
  padding: 12px 14px 10px;
  text-align: right;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--ui-border-subtle);
}
.stats-table th:first-child {
  text-align: left;
}
.stats-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--ui-border-subtle);
  white-space: nowrap;
}
.stats-table td.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.stats-table td.numeric.negative {
  color: var(--semantic-error, #e0666a);
}
.stats-table td:first-child {
  color: var(--text-secondary);
  width: 34%;
}
.stats-table tbody tr:not(.group):hover td {
  background: var(--ui-hover);
}
.stats-table tr.group td {
  padding: 18px 14px 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  border-bottom: 0;
  background: transparent;
}
.stats-table tbody tr:last-child td {
  border-bottom: 0;
}
.chart-legend .swatch {
  vertical-align: -1px;
  margin-right: 5px;
}

/* Stats tab: section navigation, explainers, KPI tiles, ledgers and categorical bars. */
.stats-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 0;
  margin: 0 0 8px;
  background: var(--ui-background);
  border-bottom: 1px solid var(--ui-border-subtle);
}
.stats-nav button {
  font: inherit;
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--ui-border-subtle);
  background: var(--ui-panel);
  color: var(--text-secondary);
  cursor: pointer;
}
.stats-nav button:hover {
  background: var(--ui-hover);
  color: var(--text-primary);
}
.stats-section {
  scroll-margin-top: 60px;
  margin: 36px 0 8px;
}
.stats-section .section-title h3 {
  font-size: 18px;
}
.stats-explainer {
  margin: -2px 0 16px;
  max-width: 940px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-tertiary);
}
.stats-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 14px;
}
@media (max-width: 1100px) {
  .stats-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.kpi {
  min-width: 0;
  padding: 14px 16px 12px;
  background: var(--ui-elevated);
  border: 1px solid var(--ui-border-subtle);
  border-radius: 8px;
}
.kpi span {
  display: block;
  font-size: 12px;
  color: var(--text-tertiary);
}
.kpi strong {
  display: block;
  margin: 6px 0 4px;
  font-size: 26px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}
.kpi small {
  display: block;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
}
.stats-table.ledger td:first-child {
  width: 30%;
  color: var(--text-primary);
}
.stats-table.ledger td.note {
  width: 42%;
  color: var(--text-tertiary);
  font-size: 12.5px;
  white-space: normal;
}
.stats-table.ledger tr.sub td:first-child {
  padding-left: 34px;
  color: var(--text-secondary);
}
.stats-table.ledger tr.sub td.numeric {
  color: var(--text-secondary);
}
.chart.bars .value {
  fill: var(--text-secondary);
}
.chart figcaption small {
  margin-left: 8px;
  color: var(--text-tertiary);
}
.chart-legend .swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
}
.progress-track > svg {
  display: block;
  width: 100%;
  height: 100%;
}
.progress-track rect {
  fill: var(--data-chart-primary);
}

/* Venue analytics: numeric charts, grouped bins, paired tables, the wiring table. */
.chart .vmarker {
  stroke: var(--text-tertiary);
  stroke-width: 1;
  stroke-dasharray: 2 4;
}
.chart .axis-label {
  fill: var(--text-secondary);
}
.chart.bins .value,
.chart .sub {
  fill: var(--text-tertiary);
  font-size: 11.5px;
}
.chart figcaption small {
  display: block;
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-tertiary);
}
.stats-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 14px;
}
@media (max-width: 1100px) {
  .stats-pair {
    grid-template-columns: 1fr;
  }
}
.stats-pair h4 {
  margin: 4px 0 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.stats-section .table-wrap {
  margin: 0 0 14px;
}
.stats-section .table-wrap td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.wiring-reads span {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.status-flag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.status-flag.ok {
  color: var(--semantic-gain);
  background: color-mix(in srgb, var(--semantic-gain) 14%, transparent);
}
.status-flag.check {
  color: var(--semantic-risk);
  background: color-mix(in srgb, var(--semantic-risk) 14%, transparent);
}
.stats-note {
  margin: 0 0 14px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-tertiary);
}
