@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 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;
}
.source-pt,
.source-hl {
  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;
}
.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;
}
.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);
}
.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 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;
  }
  .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);
}

.wallet-list {
  overflow-x: auto;
}
.wallet-columns,
.wallet-row {
  min-width: 530px;
}
#capital-preview p {
  margin-bottom: 4px;
}
#capital-preview small {
  color: var(--text-tertiary);
}
#capital-preview {
  border-top: 1px solid var(--ui-border-subtle);
  padding-top: 16px;
}
.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;
}
.cohort-help {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.5;
}

/* 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);
}
.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 {
  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;
}
.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;
  }
  .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;
  }
  .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%;
  }
}
@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);
}
.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);
}

/* Run form: tighter controls. */
#new-dialog input:not([type="checkbox"]):not([type="range"]),
#new-dialog select {
  min-height: 38px;
  border-radius: 8px;
  padding: 8px 11px;
  background: var(--ui-panel);
  transition: border-color 0.12s;
}
#new-dialog input:hover:not(:disabled):not(:focus) {
  border-color: var(--ui-border-strong);
}
#new-dialog input:disabled {
  opacity: 0.45;
}
#new-dialog label {
  font-size: 12px;
}
#new-dialog .setup-section {
  padding: 20px 0;
}

/* Route editor: a card per Mog market, a switchable line per source. */
.route-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.route-card {
  border: 1px solid var(--ui-border-subtle);
  border-radius: 12px;
  background: var(--ui-panel);
  padding: 4px 0;
  transition: border-color 0.15s;
}
.route-card.on {
  border-color: color-mix(in srgb, var(--action-primary) 55%, var(--ui-border-subtle));
}
.route-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px 8px;
}
.route-card-head strong {
  font-size: 14px;
  letter-spacing: 0.2px;
}
.route-status {
  font-size: 11px;
  color: var(--text-tertiary);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.route-card.on .route-status {
  color: var(--text-secondary);
}
.route-source {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-top: 1px solid var(--ui-border-subtle);
}
.route-source:not(.on) .route-controls {
  opacity: 0.4;
}
.route-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  transition: opacity 0.15s;
}
.market-pick {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 32px;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--ui-background);
  font-weight: 550;
  text-align: left;
}
.market-pick span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.market-pick .placeholder {
  color: var(--text-tertiary);
  font-weight: 450;
}
.route-source.on .market-pick .placeholder {
  color: var(--risk);
}
.market-pick em {
  font-style: normal;
  color: var(--text-tertiary);
}
.market-pick:not(:disabled):hover {
  border-color: var(--ui-border-strong);
}
.multiplier {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.affix {
  position: relative;
  display: block;
}
.affix i {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  font-style: normal;
  color: var(--text-tertiary);
  pointer-events: none;
}
#new-dialog .route-controls .affix input {
  width: 68px;
  min-height: 32px;
  margin: 0;
  padding: 5px 8px 5px 20px;
  background: var(--ui-background);
  font-variant-numeric: tabular-nums;
}

/* An accessible switch: a real checkbox drawn as a track and thumb. */
.switch {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
  margin: 0;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.switch > span {
  flex: none;
  position: relative;
  width: 30px;
  height: 18px;
  border-radius: 9px;
  background: var(--ui-hover);
  border: 1px solid var(--ui-border-subtle);
  transition: background 0.15s;
}
.switch > span::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-tertiary);
  transition: transform 0.15s, background 0.15s;
}
.switch input:checked + span {
  background: var(--action-primary);
  border-color: var(--action-primary);
}
.switch input:checked + span::after {
  transform: translateX(12px);
  background: var(--on-action);
}
.switch input:focus-visible + span {
  outline: 2px solid var(--action-focus);
  outline-offset: 2px;
}
.switch b {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: var(--text-secondary);
}
.route-source.on .switch b {
  color: var(--text-primary);
}
.source-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}
.source-dot.source-pt {
  background: #c79bf2;
}
.source-dot.source-hl {
  background: #5fd3bc;
}

/* Market picker: a searchable list under the market button. */
.market-picker {
  position: absolute;
  z-index: 20;
  width: 320px;
  max-width: calc(100% - 32px);
  background: var(--ui-elevated);
  border: 1px solid var(--ui-border-strong);
  border-radius: 12px;
  box-shadow: 0 18px 50px #000a;
  padding: 8px;
}
#new-dialog .market-picker input {
  min-height: 34px;
  margin: 0 0 6px;
  background: var(--ui-background);
}
.picker-list {
  max-height: 280px;
  overflow-y: auto;
}
.picker-option {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 7px;
  cursor: pointer;
}
.picker-option span {
  font-weight: 550;
}
.picker-option small {
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--ui-hover);
}
.picker-option em {
  font-style: normal;
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.picker-option.active {
  background: var(--ui-hover);
}
.picker-option.current span::after {
  content: " ✓";
  color: var(--action-focus);
}
.picker-empty {
  padding: 10px;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* Wallet pools: a pool no route uses is shown idle. */
.pool-fields label > span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pool-fields label.idle input {
  opacity: 0.45;
}
.pool-note {
  color: var(--text-tertiary);
}

/* Summary: one line per route, source market to Mog market. */
.summary-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.flow-list {
  list-style: none;
  margin: 10px 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.flow-list li {
  display: grid;
  grid-template-columns: 10px minmax(90px, auto) 16px minmax(60px, auto) 1fr;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.flow-list strong {
  font-size: 12px;
  font-weight: 600;
  margin: 0;
}
.flow-list b {
  color: var(--text-tertiary);
  font-weight: 400;
}
.flow-list em {
  font-style: normal;
  color: var(--text-tertiary);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 760px) {
  .route-list {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 420px) {
  .route-source {
    grid-template-columns: 1fr;
  }
}

/* Live settings: a source the run has no wallets for stays off. */
.route-source.locked .switch {
  cursor: not-allowed;
  opacity: 0.5;
}
.change-list {
  margin: 10px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}
.change-history {
  margin-top: 22px;
}
.change-history h3 {
  font-size: 13px;
  margin-bottom: 10px;
}
.change-history > ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.change-history > ol > li {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--ui-border-subtle);
  border-radius: 10px;
  background: var(--ui-panel);
  font-size: 12px;
}
.change-history time {
  color: var(--text-tertiary);
}
.change-history ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 3px;
}
@media (max-width: 640px) {
  .change-history > ol > li {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
.setup-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------------------------------------
   Phone layer (below 768px). Last in the file, so it settles every earlier rule for phones.
   ------------------------------------------------------------------------------------------ */
.nav-short {
  display: none;
}
@media (max-width: 1179px) {
  /* Bottom navigation: icon over a short label, four equal targets. */
  .primary-nav {
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    gap: 4px;
  }
  .primary-nav a,
  .primary-nav a:hover,
  .primary-nav a[aria-current] {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 2px;
    min-height: 54px;
    border-radius: 12px;
    font-size: 11px;
    line-height: 1.1;
  }
  .primary-nav a[aria-current] {
    background: var(--ui-elevated);
  }
  .primary-nav a > span {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
  }
  .primary-nav a > .nav-count,
  .primary-nav a[data-page="venue"] > span:not(.nav-short) {
    display: none;
  }
  .primary-nav a[data-page="venue"] > .nav-short {
    display: inline;
  }
  .primary-nav svg {
    width: 22px;
    height: 22px;
  }
}
@media (max-width: 767px) {
  /* Inputs at 16px, so iOS does not zoom the page on focus. */
  input,
  select,
  textarea,
  #new-dialog input:not([type="checkbox"]):not([type="range"]) {
    font-size: 16px;
  }
  #details {
    padding: 16px 16px 24px;
  }
  footer {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  /* Page headings: title first, then the action across the width. */
  .page-heading {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    margin-bottom: 20px;
  }
  .page-heading > button {
    width: 100%;
    min-height: 48px;
    font-size: 14px;
  }
  .section-title a,
  .breadcrumbs a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
  }

  /* Run header: the main control and More share one row. */
  .run-heading h1 {
    font-size: 26px;
    line-height: 1.15;
  }
  .run-actions {
    width: 100%;
    flex-wrap: nowrap;
  }
  .run-actions > button {
    flex: 1;
    min-height: 48px;
    font-size: 14px;
  }
  .action-menu > summary {
    display: flex;
    align-items: center;
    min-height: 48px;
    font-size: 14px;
  }
  /* More opens as a sheet above the bottom navigation, never off the edge. */
  .action-menu > div {
    position: fixed;
    left: 8px;
    right: 8px;
    top: auto;
    bottom: calc(80px + env(safe-area-inset-bottom));
    width: auto;
    z-index: 40;
    padding: 8px;
    border-radius: 16px;
  }
  .action-menu button,
  .action-menu a {
    min-height: 48px;
    padding: 13px 14px;
    font-size: 15px;
    border-radius: 10px;
  }

  /* Run tabs: one sideways strip that stays under the header. */
  .tabs {
    position: sticky;
    top: 64px;
    z-index: 8;
    gap: 2px;
    margin: 0 -16px 16px;
    padding: 0 12px;
    background: var(--ui-background);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar {
    display: none;
  }
  .tabs button {
    flex: none;
    min-height: 46px;
    padding: 12px 10px;
    font-size: 14px;
  }

  /* Metrics: two to a row, numbers on one line. */
  .run-stats,
  .overview-stats {
    grid-template-columns: 1fr 1fr;
  }
  .run-stats .metric,
  .overview-stats .metric {
    padding: 12px 12px 12px 0;
    border-right: 1px solid var(--ui-border-subtle);
  }
  .run-stats .metric:nth-child(even),
  .overview-stats .metric:nth-child(even) {
    padding-left: 16px;
    border-right: 0;
  }
  .metric strong,
  .overview-stats .metric strong {
    font-size: 26px;
    white-space: nowrap;
  }
  .health-grid {
    grid-template-columns: 1fr;
  }

  /* Run lists: each run is a card, with its figures labelled. */
  .run-table thead {
    display: none;
  }
  .run-table table,
  .run-table tbody {
    display: block;
  }
  .run-table tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--ui-border-subtle);
  }
  .run-table td:first-child {
    grid-column: 1 / 3;
  }
  .run-table td,
  .run-table td:first-child {
    display: block;
    min-width: 0;
    height: auto;
    padding: 0;
    border: 0;
    text-align: left;
  }
  .run-table td:nth-child(2) {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }
  /* An earlier rule hides these columns on narrow screens; as labelled figures they fit. */
  .run-table td[data-label],
  .run-table td.numeric[data-label] {
    display: block;
    font-size: 12px;
    text-align: left;
  }
  .run-table td.run-date {
    grid-column: 1 / -1;
    color: var(--text-tertiary);
  }
  .run-table td[data-label]::before {
    content: attr(data-label) " ";
    color: var(--text-tertiary);
  }
  .run-table td:last-child:not([data-label]) {
    display: none;
  }
  .run-name {
    font-size: 15px;
  }

  /* Wallets: balance on the right, positions under it; filters and sorting scroll sideways. */
  .wallet-tools .segmented,
  .wallet-columns {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .wallet-tools .segmented button {
    flex: none;
    min-height: 40px;
  }
  .wallet-list {
    max-height: none;
    overflow: visible;
  }
  .wallet-columns {
    min-width: 0;
    padding: 10px;
  }
  .wallet-columns button,
  .wallet-columns button:not(:first-child) {
    flex: none;
    min-height: 36px;
    padding: 6px 12px;
    border: 1px solid var(--ui-border-subtle);
    border-radius: 999px;
    text-align: left;
  }
  .wallet-row {
    min-width: 0;
    min-height: 68px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 12px;
    padding: 12px;
  }
  .wallet-row > .wallet-identity {
    grid-row: 1 / span 2;
  }
  .wallet-row > span:nth-child(3) {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    font-size: 14px;
    font-weight: 600;
  }
  .wallet-row > span:nth-child(3)::after {
    content: " USDG";
    font-size: 11px;
    font-weight: 400;
    color: var(--text-tertiary);
  }
  .wallet-row > span:nth-child(2) {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    font-size: 11px;
    color: var(--text-tertiary);
  }
  .wallet-row > span:nth-child(2)::after {
    content: " open";
  }

  /* Stats: the section menu is one sticky strip; ledgers put each note under its line. */
  .stats-nav {
    top: 110px;
    flex-wrap: nowrap;
    margin: 0 -16px 8px;
    padding: 8px 16px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .stats-nav::-webkit-scrollbar {
    display: none;
  }
  .stats-nav button {
    flex: none;
    min-height: 36px;
    padding: 6px 12px;
  }
  .stats-section {
    scroll-margin-top: 170px;
  }
  .stats-table.ledger,
  .stats-table.ledger tbody {
    display: block;
    width: 100%;
  }
  .stats-table.ledger thead {
    display: none;
  }
  .stats-table.ledger tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--ui-border-subtle);
  }
  .stats-table.ledger tr.group {
    display: block;
    padding-top: 18px;
  }
  .stats-table.ledger td,
  .stats-table.ledger td:first-child {
    padding: 0;
    border: 0;
    min-width: 0;
  }
  .stats-table.ledger td.note {
    grid-column: 1 / -1;
    font-size: 11px;
    text-align: left;
  }
  .stats-table:not(.ledger) {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }

  /* Logs: one page scroll and a toolbar that fits. */
  #log-rows {
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .log-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .log-tools input {
    grid-column: 1 / -1;
  }
  .log-tools button {
    min-height: 44px;
  }
  .log time {
    font-size: 11px;
  }

  /* Dialogs: full-screen sheets with the actions pinned to the bottom. */
  dialog,
  #new-dialog,
  #control-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
    padding: 16px 16px 0;
  }
  /* A short prompt is a bottom sheet rather than an empty full screen. */
  #control-dialog {
    inset: auto 0 0 0;
    height: auto;
    max-height: 90dvh;
    margin: 0;
    border-radius: 20px 20px 0 0;
    padding: 20px 16px 0;
  }
  .breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .dialog-actions {
    bottom: 0;
    margin-top: 16px;
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  }
  .dialog-actions button {
    flex: 1;
    min-height: 48px;
    font-size: 15px;
  }
  fieldset {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

/* Run controls carry a short label for phones; the content landmark shows no focus ring. */
.label-short {
  display: none;
}
#details:focus {
  outline: none;
}
/* Funding after the wallets are funded: one line that opens on demand. */
.funding-done {
  margin: 20px 0 0;
  padding: 0 16px;
  border: 1px solid var(--ui-border-subtle);
  border-radius: 12px;
  background: var(--ui-panel);
}
.funding-done > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  list-style: none;
  cursor: pointer;
  font-size: 13px;
}
.funding-done > summary::-webkit-details-marker {
  display: none;
}
.funding-done > summary span::after {
  content: " ⌄";
  color: var(--text-tertiary);
}
.funding-done > summary strong {
  font-size: 13px;
  font-weight: 550;
  color: var(--text-secondary);
}
.funding-done[open] {
  padding-bottom: 16px;
}

/* Phone polish: tighter rhythm, tiles for figures, controls that fit on one line. */
@media (max-width: 767px) {
  #details {
    padding: 12px 16px 24px;
  }
  .page-heading {
    gap: 12px;
    margin-bottom: 16px;
  }
  .page-heading .eyebrow {
    display: none;
  }
  .page-heading h1 {
    font-size: 26px;
    line-height: 1.2;
  }
  .page-heading p:last-child {
    margin-top: 4px;
    font-size: 13px;
  }
  .page-heading > button {
    min-height: 46px;
  }

  /* Figures as tiles, two to a row. */
  .run-stats,
  .overview-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 12px 0 16px;
  }
  .run-stats .metric,
  .overview-stats .metric,
  .run-stats .metric:nth-child(even),
  .overview-stats .metric:nth-child(even) {
    padding: 12px;
    border: 1px solid var(--ui-border-subtle);
    border-radius: 12px;
    background: var(--ui-panel);
  }
  .metric strong,
  .overview-stats .metric strong {
    font-size: 22px;
    line-height: 1.2;
    margin: 4px 0 2px;
  }
  .metric small {
    line-height: 1.35;
  }

  /* Run header. */
  .breadcrumbs {
    margin-bottom: 4px;
    font-size: 13px;
  }
  .run-heading {
    gap: 12px;
    margin-bottom: 8px;
  }
  .run-heading .eyebrow {
    margin-bottom: 4px;
  }
  /* Markets on one line, then wallets and time: separators would dangle at a wrap. */
  .run-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 0;
    margin: 6px 0 0;
    font-size: 13px;
  }
  .run-meta .separator {
    display: none;
  }
  .run-meta > span:first-child {
    flex-basis: 100%;
  }
  .run-meta > span:last-child::before {
    content: "·";
    margin: 0 6px;
    color: var(--text-tertiary);
  }
  .label-long {
    display: none;
  }
  .label-short {
    display: inline;
  }
  .run-actions > button {
    min-height: 44px;
    padding: 10px 12px;
    white-space: nowrap;
  }
  .action-menu > summary {
    min-height: 44px;
    padding: 10px 14px;
    white-space: nowrap;
  }
  /* The tab strip fades into the page at its right edge, so it reads as scrollable. An overlay,
     not a mask: a mask would also clear the strip's background and let the page show through. */
  .tabs::after,
  .stats-nav::after {
    content: "";
    position: sticky;
    right: -12px;
    flex: none;
    width: 36px;
    margin-left: -36px;
    background: linear-gradient(to right, transparent, var(--ui-background) 75%);
    pointer-events: none;
  }
  .stats-kpis .kpi strong {
    font-size: 20px;
    line-height: 1.25;
    white-space: nowrap;
  }

  /* Banners, health and routes: compact. */
  .health-banner {
    padding: 10px 12px;
    margin-bottom: 12px;
    border-radius: 10px;
  }
  .health-banner p {
    font-size: 12px;
    margin: 2px 0 0;
  }
  .health-grid {
    gap: 8px;
    margin-bottom: 12px;
  }
  .health-grid > div {
    border-radius: 12px;
  }
  .run-context {
    margin: 0 0 12px;
  }
  .run-context > div {
    gap: 6px;
  }
  .run-context > div > span {
    padding: 5px 9px;
    border: 1px solid var(--ui-border-subtle);
    border-radius: 999px;
    background: var(--ui-panel);
    color: var(--text-secondary);
  }
  .progress-track {
    margin: 0 0 12px;
  }
}
/* Route chips: the dot carries the source's colour, as in the run form. */
.run-context i.source-pt {
  background: #c79bf2;
}
.run-context i.source-hl {
  background: #5fd3bc;
}
.run-context i {
  border-radius: 50%;
}
/* The inspector's way back to the list, only where it sits below the list. */
.inspector-back {
  display: none;
}
@media (max-width: 1179px) {
  .inspector-back {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-bottom: 8px;
    font-size: 14px;
  }
}
@media (max-width: 767px) {
  /* Wallet tools: less chrome above the list. */
  .wallet-tools {
    gap: 8px;
    margin-bottom: 10px;
  }
  .wallet-columns {
    padding: 8px 10px;
  }
  .wallet-columns button,
  .wallet-columns button:not(:first-child) {
    min-height: 32px;
    font-size: 12px;
  }
  .wallet-inspector {
    padding-top: 16px;
  }
  .position-card {
    border-radius: 12px;
  }
}
@media (max-width: 767px) {
  /* Source matrices: three narrow figure columns fit beside their labels. */
  .stats-table:not(.ledger) {
    font-size: 12px;
  }
  .stats-table:not(.ledger) th,
  .stats-table:not(.ledger) td {
    padding: 8px 6px;
  }
  .stats-table:not(.ledger) td:first-child {
    min-width: 0;
    white-space: normal;
  }
}
@media (max-width: 767px) {
  /* Section headers with actions: text first, actions across the width below it. */
  .settings-view > .section-title {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .setup-actions > button {
    flex: 1;
    min-height: 44px;
  }
  .facts > div {
    padding: 11px 0;
  }
}
.tabs.at-end::after,
.stats-nav.at-end::after {
  opacity: 0;
}
@media (max-width: 767px) {
  /* Each run is a card, and the whole card opens it. */
  .run-table tbody {
    display: grid;
    gap: 8px;
  }
  .run-table tr {
    position: relative;
    padding: 14px;
    border: 1px solid var(--ui-border-subtle);
    border-radius: 12px;
    background: var(--ui-panel);
  }
  .run-table .run-name::after {
    content: "";
    position: absolute;
    inset: 0;
  }
  .run-table tbody tr:hover {
    background: var(--ui-elevated);
  }
  .overview-runs,
  .overview-connections,
  .overview-legacy,
  .attention-section {
    margin-top: 24px;
  }
  .health-banner + .page-heading {
    margin-top: 16px;
  }
}

/* Hyperliquid filters in the run form: three switches with a line of help each. */
.hl-filters {
  display: grid;
  gap: 12px;
  margin: 0 0 14px;
  padding: 14px;
  border: 1px solid var(--ui-border-subtle);
  border-radius: 12px;
  background: var(--ui-panel);
}
.hl-filters .eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.filter-switch {
  align-items: flex-start;
}
.filter-switch > span {
  margin-top: 1px;
}
.filter-switch b {
  display: block;
  color: var(--text-primary);
}
.filter-switch small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--text-tertiary);
}

/* Header status: one line, the connections behind it on demand. */
.system-status {
  position: relative;
  display: inline-block;
}
.system-status > summary {
  list-style: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: 6px;
  max-width: 46vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.system-status > summary::-webkit-details-marker {
  display: none;
}
.system-status > summary:hover {
  background: var(--ui-hover);
}
#connection.ok::before {
  background: var(--semantic-gain);
}
#connection.down {
  color: var(--risk);
}
#connection.down::before {
  background: var(--risk);
}
#system-detail {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: min(420px, calc(100vw - 32px));
  padding: 14px 16px;
  background: var(--ui-elevated);
  border: 1px solid var(--ui-border-subtle);
  border-radius: 8px;
  z-index: 30;
}
#system-detail .facts {
  grid-template-columns: 1fr;
  gap: 0;
}
#system-detail small {
  display: block;
  color: var(--text-tertiary);
  font-size: 11px;
}
@media (max-width: 767px) {
  #connection {
    display: block;
    max-width: 34vw;
    min-width: 0;
  }
}

/* Stats: one section at a time. */
.stats-sections button {
  font-weight: 600;
}
.stats-section {
  margin-top: 8px;
}
.stats-subhead {
  font-size: 15px;
  margin: 28px 0 10px;
}
.stats-kpis .kpi small:empty {
  display: none;
}
.waterfall .stats-table tr:first-child td,
.waterfall .stats-table tr:last-child td {
  font-weight: 600;
}
td.crowded {
  color: var(--risk);
}
.waterfall td.note {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ===== The admin's component set. Three text sizes: 22 for a page title, 14 for content, 12 for
   labels and secondary text; numbers are tabular. Every list is a ui-rows panel, every headline
   number a ui-tile, every secondary section a ui-fold. ===== */
h1,
.run-heading h1,
.page-heading h1 {
  font-size: 22px;
  letter-spacing: -0.02em;
  margin: 0;
}
.page-heading {
  margin-bottom: 16px;
  align-items: center;
}
.run-heading h1 .status {
  vertical-align: middle;
  margin-left: 6px;
}
.run-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  margin: 4px 0 0;
}
.run-heading {
  margin-bottom: 16px;
  gap: 12px;
}
.ui-back {
  display: inline-block;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
  text-decoration: none;
}
.ui-h {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 28px 0 10px;
}
.ui-empty {
  font-size: 12px;
  color: var(--text-tertiary);
  margin: 8px 0 14px;
}
.ui-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}
.ui-tile {
  background: var(--ui-panel);
  border: 1px solid var(--ui-border-subtle);
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 0;
}
.ui-tile span {
  display: block;
  font-size: 12px;
  color: var(--text-tertiary);
}
.ui-tile strong {
  display: block;
  font-size: 20px;
  font-weight: 600;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ui-tile small {
  display: block;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ui-tile.bad strong {
  color: var(--semantic-loss);
}
.ui-tile.warn strong {
  color: var(--risk);
}
.ui-rows {
  background: var(--ui-panel);
  border: 1px solid var(--ui-border-subtle);
  border-radius: 10px;
  margin: 0 0 14px;
  overflow: hidden;
}
.ui-row,
.ui-row > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(var(--cols, 1), auto);
  align-items: center;
  column-gap: 14px;
  padding: 11px 14px;
  font-size: 14px;
  color: var(--text-primary);
  text-decoration: none;
}
.ui-rows.cols-2 { --cols: 2; }
.ui-rows.cols-3 { --cols: 3; }
.ui-rows.cols-4 { --cols: 4; }
details.ui-row {
  display: block;
  padding: 0;
}
.ui-row + .ui-row,
.ui-group + .ui-row {
  border-top: 1px solid var(--ui-border-subtle);
}
.ui-row > summary {
  list-style: none;
  cursor: pointer;
}
.ui-row > summary::-webkit-details-marker {
  display: none;
}
details.ui-row > summary .ui-label::after {
  content: "›";
  display: inline-block;
  margin-left: 6px;
  color: var(--text-tertiary);
  transition: transform 0.15s;
}
details.ui-row[open] > summary .ui-label::after {
  transform: rotate(90deg);
}
a.ui-row:active,
.ui-row > summary:active {
  background: var(--ui-hover);
}
.ui-label {
  min-width: 0;
  overflow-wrap: anywhere;
}
.ui-label small {
  display: block;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}
.ui-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--text-secondary);
}
.ui-value:nth-child(2) {
  color: var(--text-primary);
}
.ui-value.neg {
  color: var(--semantic-loss);
}
.ui-head {
  padding-top: 8px;
  padding-bottom: 8px;
}
.ui-head .ui-value {
  font-size: 12px;
  color: var(--text-tertiary);
}
.ui-group {
  padding: 14px 14px 6px;
  font-size: 12px;
  color: var(--text-tertiary);
}
.ui-detail {
  margin: 0;
  padding: 0 14px 12px;
  display: grid;
  gap: 6px;
}
.ui-detail div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
}
.ui-detail dt {
  color: var(--text-tertiary);
}
.ui-detail dd {
  margin: 0;
  color: var(--text-secondary);
  text-align: right;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.ui-fold {
  background: var(--ui-panel);
  border: 1px solid var(--ui-border-subtle);
  border-radius: 10px;
  margin: 14px 0;
}
.ui-fold > summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  font-size: 14px;
  cursor: pointer;
  list-style: none;
}
.ui-fold > summary::-webkit-details-marker {
  display: none;
}
.ui-fold > summary > span:first-child::after {
  content: "›";
  margin-left: 6px;
  color: var(--text-tertiary);
  display: inline-block;
  transition: transform 0.15s;
}
.ui-fold[open] > summary > span:first-child::after {
  transform: rotate(90deg);
}
.ui-fold-body {
  padding: 0 10px 10px;
}
.ui-fold-body .ui-rows {
  margin: 0;
}
.ui-pre {
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
  padding: 4px;
  color: var(--text-secondary);
}
.ui-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  background: var(--ui-panel);
  border: 1px solid var(--ui-border-subtle);
  border-radius: 10px;
}
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  vertical-align: -2px;
  border: 2px solid var(--ui-border-strong);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: ui-spin 0.8s linear infinite;
}
@keyframes ui-spin {
  to {
    transform: rotate(360deg);
  }
}
.segmented {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 0 12px;
}
.segmented::-webkit-scrollbar {
  display: none;
}
.segmented button {
  flex: 0 0 auto;
}
.stats-tools {
  display: block;
  margin-bottom: 12px;
}
.stats-tools > .segmented button {
  font-size: 14px;
  font-weight: 600;
}
.stats-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.stats-filters .segmented {
  margin: 0;
}
.stats-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-left: auto;
}
.stats-section {
  margin: 0;
}
.chart {
  background: var(--ui-panel);
  border-radius: 10px;
  padding: 12px 12px 8px;
}
.chart figcaption {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 600;
}
.chart > svg {
  touch-action: pan-y;
}
.health-banner {
  margin-bottom: 14px;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.setup-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}
.log-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.log-tools .segmented {
  margin: 0;
}
.log-tools .search {
  flex: 1;
  min-width: 140px;
}
.venue-findings .ui-value {
  font-size: 12px;
}
#system-detail .ui-rows {
  margin: 0;
}
.run-table .ui-label .status {
  margin-left: 6px;
}
/* Pull to refresh: a pill that follows the pull and spins while the page reloads its data. */
#pull {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 50;
  transform: translate(-50%, -48px);
  padding: 8px 14px;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--ui-elevated);
  border: 1px solid var(--ui-border-subtle);
  border-radius: 999px;
  pointer-events: none;
  transition: transform 0.15s;
}
#pull.dragging {
  transition: none;
}
@media (max-width: 767px) {
  h1,
  .run-heading h1,
  .page-heading h1 {
    font-size: 20px;
  }
  .ui-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ui-tile strong {
    font-size: 18px;
  }
  .run-heading {
    flex-direction: column;
    align-items: stretch;
  }
}
details.ui-row > summary {
  position: relative;
  padding-right: 32px;
}
details.ui-row > summary .ui-label::after {
  content: none;
}
details.ui-row > summary::after {
  content: "›";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  transition: transform 0.15s;
}
details.ui-row[open] > summary::after {
  transform: translateY(-50%) rotate(90deg);
}
@media (max-width: 767px) {
  .ui-tiles > .ui-tile:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
  .app-header .badge {
    display: none;
  }
}
.ui-row,
.ui-row > summary {
  grid-template-columns: minmax(8em, 1fr) repeat(var(--cols, 1), minmax(0, auto));
}
.ui-value {
  white-space: normal;
  overflow-wrap: anywhere;
}
