/* =======================================================================
   Generated by shadow-mode/build-styles.mjs
   Source of truth: shadow-mode/styles-src/*.css
   Do not edit generated CSS in shadow-mode/*.css directly.
   ======================================================================= */
/* >>> 00-foundation-shell.css >>> */
@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Sora:wght@600;700&display=swap");

@view-transition {
  navigation: auto;
}

:root {
  --bg: #f4f7fb;
  --bg-strong: #ecf0f7;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --surface-soft: #f0f3f9;
  --surface-tint: #e8eef7;
  --surface-emphasis: #dfe8f5;
  --text: #0d1a30;
  --text-strong: #081528;
  --muted: #5c6e84;
  --muted-strong: #3e5168;
  --line: rgba(10, 24, 48, 0.07);
  --line-strong: rgba(10, 24, 48, 0.12);
  --accent: #2d5ee0;
  --accent-strong: #2050cc;
  --accent-soft: rgba(45, 94, 224, 0.08);
  --mint: #14b8b4;
  --mint-soft: rgba(20, 184, 180, 0.08);
  --amber: #c88c10;
  --amber-soft: rgba(200, 140, 16, 0.08);
  --rose: #d44058;
  --rose-soft: rgba(212, 64, 88, 0.08);
  --violet: #4c5ee8;
  --violet-soft: rgba(76, 94, 232, 0.08);
  --cyan: #28b8c0;
  --cyan-soft: rgba(40, 184, 192, 0.07);
  --sidebar-bg: #edf1f8;
  --sidebar-line: rgba(10, 24, 48, 0.08);
  --sidebar-text: #5c6e84;
  --sidebar-heading: #0d1a30;
  --sidebar-sub: #5c6e84;
  --sidebar-hover: rgba(10, 24, 48, 0.05);
  --sidebar-active-bg: rgba(45, 94, 224, 0.08);
  --sidebar-active-text: #0d1a30;
  --shadow-sm: 0 4px 16px rgba(10, 24, 48, 0.04);
  --shadow-md: 0 12px 32px rgba(10, 24, 48, 0.06);
  --shadow-lg: 0 24px 56px rgba(10, 24, 48, 0.08);
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --radius-pill: 4px;
  --fs-2xs: 0.6rem;
  --fs-xs: 0.68rem;
  --fs-sm: 0.76rem;
  --fs-base: 0.84rem;
  --fs-md: 0.92rem;
  --fs-lg: 1.04rem;
  --fs-xl: 1.3rem;
  --accent-dim: #1b58cf;
  --mint-bright: #22ddd9;
  --cyan-bright: #1cc4d0;
  --amber-bright: #e6a112;
  --warning: #ffbf47;
  --tooltip-bg: #0a1730;
  --tooltip-text: #f8fbff;
  --range-track: #d8e0ee;
  --content-grid-ratio: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --row-h: 40px;
  --row-h-dense: 32px;
  --strip-h: 56px;
  --elev-0: none;
  --elev-1: 0 1px 0 var(--line);
  --border-soft: 1px solid var(--line);
  --border-strong: 1px solid var(--line-strong);
  --ring: 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent);
  --num-font: "Manrope", system-ui, -apple-system, Segoe UI, sans-serif;
}

.metric strong, [data-tabular] {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

html[data-theme="dark"] {
  --bg: #0c0c14;
  --bg-strong: #101018;
  --surface: #16161e;
  --surface-strong: #1c1c26;
  --surface-soft: #121218;
  --surface-tint: #1a1a24;
  --surface-emphasis: #1e1e2c;
  --text: #d0d4e0;
  --text-strong: #f0f2f8;
  --muted: #8890a0;
  --muted-strong: #a0a8b8;
  --line: #1a1e2a;
  --line-strong: #252a38;
  --accent: #3b70ff;
  --accent-strong: #2f5fe0;
  --accent-soft: #121d38;
  --mint: #5eecc0;
  --mint-soft: #0c2420;
  --amber: #f7c86c;
  --amber-soft: #28200e;
  --rose: #ff8a98;
  --rose-soft: #281018;
  --violet: #a78bfa;
  --violet-soft: #1a1430;
  --cyan: #39D7DB;
  --cyan-soft: #0c2830;
  --sidebar-bg: #0c0c14;
  --sidebar-line: rgba(255, 255, 255, 0.06);
  --sidebar-text: rgba(255, 255, 255, 0.6);
  --sidebar-heading: rgba(255, 255, 255, 0.85);
  --sidebar-sub: rgba(255, 255, 255, 0.55);
  --sidebar-hover: rgba(255, 255, 255, 0.05);
  --sidebar-active-bg: rgba(59, 112, 255, 0.08);
  --sidebar-active-text: #fff;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --accent-dim: #3b70ff;
  --range-track: #1e2538;
  --tooltip-bg: #1a2a48;
  --tooltip-text: #f0f4ff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: #0c0c14;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

::view-transition-old(root), ::view-transition-new(root) {
  animation-duration: 180ms;
  animation-timing-function: ease;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
}

.sidebar-wallet {
  display: none !important;
}

.eyebrow, .section-label, .micro-label, .metric-card span, .note-card span, .hero-chip, .saved-card-meta span, .scenario-band-head span, .state-badge, .token-chip span:first-of-type, .route-score, .sidebar-position-row span {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wallet-connect-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius-xs);
  background: var(--accent);
  color: #fff;
  font: 600 var(--fs-xs) / 1.3 var(--ff);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.wallet-connect-btn:hover {
  background: var(--accent-strong);
}

.wallet-connect-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.wallet-icon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  flex-shrink: 0;
}

.wallet-address {
  font: 500 var(--fs-xs) / 1.2 var(--ff-mono, var(--ff));
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wallet-disconnect {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--sidebar-sub);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}

.wallet-disconnect:hover {
  color: var(--warning, #f87171);
  background: rgba(248, 113, 113, 0.1);
}

.wallet-disconnect svg {
  width: 16px;
  height: 16px;
}

.field-collateral {
  position: relative;
  z-index: 2;
  gap: 0.36rem;
  min-width: 0;
  overflow: visible;
  grid-column: span 2;
  align-content: start;
}

.collateral-picker {
  position: relative;
  min-width: 0;
  width: 100%;
  z-index: 200;
}

.collateral-picker[open] {
  z-index: 2147483000;
}

.collateral-picker > summary {
  list-style: none;
}

.collateral-picker > summary::-webkit-details-marker {
  display: none;
}

.collateral-asset-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  width: 100%;
  min-width: 0;
  min-height: 2.78rem;
  padding: 0 0.88rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-strong);
  color: var(--text);
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    color 150ms ease;
}

.collateral-asset-trigger-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.collateral-picker[open] .collateral-asset-trigger, .collateral-asset-trigger:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.collateral-picker.is-disabled .collateral-asset-trigger {
  opacity: 0.7;
  pointer-events: none;
  cursor: default;
}

.collateral-asset-symbol {
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.collateral-asset-balance {
  color: var(--muted);
  font-size: var(--fs-2xs);
  font-weight: 600;
  line-height: 1.1;
}

.collateral-asset-trigger svg {
  width: 0.9rem;
  height: 0.9rem;
  flex: 0 0 auto;
  color: var(--muted);
}

.collateral-asset-menu {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2147483000;
  box-sizing: border-box;
  min-width: 0;
  display: grid;
  gap: 0;
  max-height: min(26rem, 70vh);
  overflow-y: auto;
  padding: 0;
  border: 1px solid var(--line, #2a2f3a);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: var(--surface-soft, #181d27);
  box-shadow: 0 18px 32px -22px rgba(8, 21, 40, 0.6);
  isolation: isolate;
  overflow-x: hidden;
}

.collateral-asset-menu[data-placement="top"] {
  border-top: 1px solid var(--line, #2a2f3a);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -18px 32px -22px rgba(8, 21, 40, 0.6);
}

.collateral-asset-option {
  display: grid;
  grid-template-columns: 1.875rem minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 0.25rem 0.58rem;
  width: 100%;
  min-height: 0;
  padding: 0.6rem 1.5rem 0.6rem 2.08rem;
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--line, #2a2f3a) 55%, transparent);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.collateral-asset-option:hover {
  background: color-mix(in srgb, var(--accent, #5bc7ff) 8%, transparent);
}

.collateral-asset-option-leading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.collateral-asset-option-leading .collateral-asset-mark {
  width: 1.55rem;
  height: 1.55rem;
}

.collateral-asset-option-leading .collateral-asset-mark-image {
  width: 1.15rem;
  height: 1.15rem;
}

.collateral-asset-option-copy {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
  text-align: left;
}

.collateral-asset-option-symbol-row {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  min-width: 0;
  flex-wrap: wrap;
}

.collateral-asset-option-symbol {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.05;
}

.collateral-asset-option-type {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.85;
}

.collateral-asset-option-trailing {
  display: grid;
  justify-items: end;
  gap: 0.1rem;
  min-width: 2.4rem;
  text-align: right;
}

.collateral-asset-option-value {
  color: var(--text-strong);
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.collateral-asset-option-value.is-manual {
  color: var(--muted-strong);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.collateral-asset-option-value.is-zero {
  color: var(--muted-strong);
}

.collateral-asset-option-value-usd {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  line-height: 1.15;
}

.collateral-asset-option-meta-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.collateral-asset-option-rate {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.collateral-asset-option-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  max-width: 100%;
  padding: 0.12rem 0.42rem;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-soft) 65%, transparent);
  color: var(--muted);
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.collateral-asset-option-copy-btn,
.collateral-asset-option-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface-soft) 55%, transparent);
  color: var(--muted);
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
  text-decoration: none;
}

.collateral-asset-option-copy-btn:hover,
.collateral-asset-option-view-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.collateral-asset-option-copy-btn.is-copied {
  color: var(--mint, #4bd29a);
  border-color: color-mix(in srgb, var(--mint, #4bd29a) 45%, transparent);
}

.collateral-asset-mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(121, 132, 165, 0.18);

}

.collateral-asset-mark-image {
  width: 1.9rem;
  height: 1.9rem;
  object-fit: contain;
}

.collateral-balance-copy {
  flex: 1 1 auto;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.35;
  min-width: 0;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.collateral-balance-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  max-width: 9rem;
  padding: 0 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  color: var(--muted-strong);
  font: 700 0.68rem / 1 var(--ff);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
}

.collateral-use-max {
  flex: 0 0 auto;
  min-height: 1.5rem;
  padding: 0 0.55rem;
  border: 1px solid rgba(82, 194, 255, 0.24);
  border-radius: var(--radius-pill);
  background: rgba(33, 107, 255, 0.12);
  color: var(--accent);
  font: 700 0.68rem / 1 var(--ff);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background-color 150ms ease;
}

.collateral-use-max:hover:not(:disabled) {
  border-color: rgba(82, 194, 255, 0.38);
  background: rgba(33, 107, 255, 0.18);
}

.collateral-use-max:disabled {
  opacity: 0.65;
  cursor: default;
}

.wm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.wm-overlay.wm-visible {
  opacity: 1;
}

.wm-modal {
  width: 90vw;
  max-width: 480px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(12px) scale(0.97);
  transition: transform 0.18s ease;
}

.wm-visible .wm-modal {
  transform: translateY(0) scale(1);
}

.wm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.3rem 0.8rem;
}

.wm-title {
  margin: 0;
  font: 600 1.05rem / 1.3 var(--ff);
  color: var(--text-strong);
}

.wm-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.wm-close:hover {
  background: var(--surface-emphasis);
  color: var(--text-strong);
}

.wm-close svg {
  width: 16px;
  height: 16px;
}

.wm-body {
  padding: 0.4rem 1.3rem 1.3rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.wm-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.wm-wallet-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 0.4rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.wm-wallet-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.wm-wallet-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
}

.wm-wallet-name {
  font: 500 var(--fs-2xs) / 1.3 var(--ff);
  text-align: center;
  word-break: break-word;
}

.wm-install-tag {
  font: 600 0.55rem / 1 var(--ff);
  color: var(--accent);
  opacity: 0.7;
}

.wm-divider {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 1rem 0 0.6rem;
}

.wm-divider::before, .wm-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.wm-divider span {
  font: 500 var(--fs-2xs) / 1 var(--ff);
  color: var(--muted);
  white-space: nowrap;
}

.wm-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: var(--fs-sm);
}

@media (max-width: 480px) {
.wm-grid { grid-template-columns: repeat(2, 1fr); }

.wm-modal { max-width: 95vw; }

}

.micro-label {
  color: var(--sidebar-sub);
  font-size: var(--fs-xs);
  font-weight: 800;
}

.theme-toggle {
  display: flex;
  gap: 0.3rem;
  padding: 0.1rem;
  border-radius: var(--radius-xs);
  background: var(--sidebar-hover);
}

.theme-toggle button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--sidebar-text);
  padding: 0;
  transition:
    background-color 180ms ease,
    color 180ms ease;
}

.theme-toggle button:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-heading);
}

.theme-toggle button.is-active {
  background: var(--sidebar-active-bg);

  color: var(--sidebar-active-text);
}

.theme-icon {
  width: 1.05rem;
  height: 1.05rem;
}

.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;
}

.sidebar-scenario-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.sidebar-scenario-head > div, .page-tools, .section-head > div, .saved-card-head > div, .route-card-head > :first-child, .scenario-band-head > div {
  min-width: 0;
}

.sidebar-scenario-head h2, .sidebar-btc-price {
  margin: 0;
  color: var(--sidebar-active-text);
  font-size: 1rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.sidebar-scenario-head p {
  margin: 0.15rem 0 0;
  color: var(--sidebar-sub);
  font-size: 0.68rem;
  line-height: 1.45;
}

.sidebar-position {
  display: grid;
  gap: 0;
}

.sidebar-position-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--sidebar-line);
}

.sidebar-position-row:last-child {
  border-bottom: 0;
}

.sidebar-position-row span {
  color: var(--sidebar-sub);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-position-row strong {
  color: var(--sidebar-heading);
  font-size: 0.92rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.app-main {
  padding: 0.75rem 1.2rem 1.4rem;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding-bottom: 0;
  border-bottom: 0;
}

.page-tools {
  display: grid;
  justify-items: end;
  gap: var(--space-2);
  align-self: center;
}

.page-heading {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
  flex: 1;
}

.eyebrow, .section-label, .micro-label, .metric-card span, .note-card span, .scenario-band-head span, .saved-card-meta span, .route-score {
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 800;
}

h1, h2, h3, strong {
  color: var(--text-strong);
}

h1, h2 {
  margin: 0;
  font-family: "Sora", "Manrope", sans-serif;
}

h1 {
  max-width: none;
  font-size: clamp(1rem, 1.15vw, 1.2rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(0.92rem, 1.05vw, 1.12rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.page-copy, .surface-copy, .note-card p, .metric-card p, .saved-card p, .status-line, .empty-copy, .empty-panel p, .route-card p, .log-card p {
  color: var(--muted);
  line-height: 1.65;
}

.page-copy {
  max-width: 62ch;
  margin: 0.2rem 0 0;
  font-size: var(--fs-base);
  line-height: 1.4;
}

.status-line {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.5;
  max-width: 50ch;
}

.status-line.is-error {
  color: var(--rose);
}

.trust-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.trust-labels[hidden] { display: none; }

.trust-labels.trust-strip {
  margin: 0;
  padding: 0.45rem 1.1rem;
  justify-content: flex-start;
  align-items: center;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.35);
}

html[data-theme="light"] .trust-labels.trust-strip {
  border-top-color: rgba(15, 23, 42, 0.08);
  border-bottom-color: rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.55);
}

.trust-label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  color: var(--tide-text-soft, rgba(255, 255, 255, 0.72));
}

.trust-label--shadow {
  border-color: rgba(148, 163, 184, 0.32);
  color: rgba(226, 232, 240, 0.92);
}

.trust-label--testnet {
  border-color: rgba(125, 211, 252, 0.35);
  color: rgba(186, 230, 253, 0.95);
  background: rgba(56, 189, 248, 0.08);
}

.trust-label--safe {
  border-color: rgba(134, 239, 172, 0.32);
  color: rgba(187, 247, 208, 0.95);
  background: rgba(74, 222, 128, 0.08);
}

.trust-label--readonly {
  border-color: rgba(252, 165, 165, 0.32);
  color: rgba(254, 202, 202, 0.95);
  background: rgba(248, 113, 113, 0.08);
}

.proof-timeline .proof-steps {
  list-style: none;
  margin: 0.6rem 0 0.5rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.proof-step {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.22);
}

.proof-step.is-done {
  border-color: rgba(134, 239, 172, 0.28);
  background: rgba(74, 222, 128, 0.06);
}

.proof-step.is-pending {
  opacity: 0.55;
}

.proof-step-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(226, 232, 240, 0.85);
  background: rgba(30, 41, 59, 0.4);
}

.proof-step.is-done .proof-step-n {
  border-color: rgba(134, 239, 172, 0.55);
  color: rgba(187, 247, 208, 0.95);
  background: rgba(74, 222, 128, 0.14);
}

.proof-step-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.proof-step-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--tide-text-soft, rgba(255, 255, 255, 0.72));
  text-transform: uppercase;
}

.proof-step-value {
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  word-break: break-all;
  color: rgba(226, 232, 240, 0.92);
  background: transparent;
  padding: 0;
}

.proof-step-links {
  font-size: 0.72rem;
  opacity: 0.85;
}

.proof-step-links a {
  color: var(--tide-link, rgba(125, 211, 252, 0.95));
}

.proof-digests {
  font-family: var(--font-mono, monospace);
  font-size: 0.76rem;
  word-break: break-all;
  opacity: 0.75;
  margin-top: 0.3rem;
}

.proof-digests code {
  background: transparent;
  padding: 0;
}

.pre-sign-dialog {
  max-width: 32rem;
  width: calc(100vw - 2rem);
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 0.8rem;
  background: rgba(15, 23, 42, 0.98);
  color: var(--tide-text, rgba(226, 232, 240, 0.95));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.pre-sign-dialog::backdrop {
  background: rgba(2, 6, 23, 0.7);
  backdrop-filter: blur(4px);
}

.pre-sign-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.2rem 1.2rem 1rem;
}

.pre-sign-head h3 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.pre-sign-head .pre-sign-subtitle {
  margin: 0;
  font-size: 0.78rem;
  color: var(--tide-text-soft, rgba(255, 255, 255, 0.7));
}

.pre-sign-section-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tide-text-soft, rgba(255, 255, 255, 0.6));
  margin-bottom: 0.3rem;
}

.pre-sign-calls {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.pre-sign-calls li {
  padding: 0.35rem 0.55rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(125, 211, 252, 0.25);
  background: rgba(56, 189, 248, 0.08);
}

.pre-sign-calls code {
  font-family: var(--font-mono, monospace);
  font-size: 0.76rem;
  word-break: break-all;
  background: transparent;
  padding: 0;
}

.pre-sign-fields {
  display: grid;
  grid-template-columns: minmax(9rem, auto) 1fr;
  gap: 0.3rem 0.8rem;
  margin: 0;
  font-size: 0.82rem;
}

.pre-sign-fields dt {
  color: var(--tide-text-soft, rgba(255, 255, 255, 0.65));
  font-weight: 500;
}

.pre-sign-fields dd {
  margin: 0;
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  word-break: break-all;
  color: rgba(226, 232, 240, 0.95);
}

.pre-sign-warning {
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(217, 119, 6, 0.12);
  color: rgba(253, 224, 71, 0.95);
  font-size: 0.78rem;
}

.pre-sign-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.3rem;
}

.action-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  min-width: 0;
}

.workspace-actions {
  margin-top: 0.8rem;
}

.action-cluster-compact .button {
  min-width: 5.5rem;
  min-height: 2.2rem;
  padding-inline: 0.85rem;
  font-size: var(--fs-sm);
  white-space: normal;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 2.15rem;
  padding: 0 1rem;
  border: 0;
  border-radius: 10px;
  font-size: var(--fs-base);
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    color 150ms ease,
    transform 100ms ease;
}

.button:active {
  transform: scale(0.97);
}

.button-primary {
  background: var(--accent);
  color: #fff;
  border: 0;
}

.button-primary:hover {
  background: var(--accent-strong);

}

.button-secondary {
  background: var(--surface-strong);
  color: var(--text-strong);
  border: 1px solid var(--line);
}

.button-secondary:hover {
  background: var(--surface-tint);
  border-color: var(--line-strong);
}

.button-ghost {
  background: transparent;
  color: var(--muted-strong);
}

.button-ghost:hover {
  background: var(--surface-soft);
}

.button-ghost.is-danger {
  color: var(--rose);
}

body[data-page="workspace"] .surface:not(.surface-hero), body[data-page="overview"] .surface:not(.surface-hero), body[data-page="live"] .surface:not(.surface-hero), body[data-page="results"] .surface:not(.surface-hero), body[data-page="library"] .surface:not(.surface-hero) {
  padding: 0.4rem 1.1rem;
  border: none;
  background: transparent;
  border-radius: 0;

}

.page-stack {
  display: grid;
  gap: 0.9rem;
}

.content-grid {
  display: grid;
  gap: 1rem;
  align-items: start;
}

.content-grid-main {
  grid-template-columns: var(--content-grid-ratio);
}

body[data-page="results"] .content-grid-main {
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.98fr);
}

.surface {
  position: relative;
  z-index: 1;
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);

  transition: border-color 200ms ease, box-shadow 200ms ease;
}

body[data-page="results"] .page-stack {
  gap: 0.55rem;
}

body[data-page="results"] .surface-hero {
  padding: 0.65rem 1.15rem 0.55rem;
}

.surface-hero {
  position: relative;
  padding: 0.85rem 1.25rem 0.75rem 1.15rem;
  background: var(--surface);

  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--text);
  overflow: visible;
}

.surface-hero::before {
  content: none;
}

.surface-hero h2, .surface-hero strong {
  color: var(--text-strong);
}

.surface-hero .section-label, .surface-hero .surface-copy, .surface-hero .hero-copy-block .surface-copy, .surface-hero .metric-card span, .surface-hero .metric-card p {
  color: var(--muted);
}

.surface-hero .metric-card, .surface-hero .note-card {
  border-color: var(--line);
  background: transparent;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.leaderboard-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--surface-muted, rgba(255, 255, 255, 0.02));
}

.leaderboard-row strong { font-size: 14px; }

.leaderboard-meta { font-size: 12px; color: var(--text-muted, #8a94a8); }

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0;
  border-bottom: none;
}

body[data-page="results"] .section-head {
  margin-bottom: 0.75rem;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.92fr);
  gap: 1.4rem;
  align-items: center;
}

.hero-copy-block h2 {
  font-size: clamp(1.1rem, 1.4vw, 1.55rem);
}

.hero-copy-block .surface-copy {
  margin-top: 0.9rem;
}

.hero-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.6rem;
}

.live-hero-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  align-self: start;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 1.3rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: var(--fs-2xs);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.metric-card, .note-card, .route-card, .empty-panel, .saved-card, .log-card {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
  padding: 0.6rem 0.5rem;
  border-radius: 0;
  border: none;
  background: transparent;

  overflow: hidden;
  transition: background-color 200ms ease;
}

.metric-card span {
  display: block;
}

.metric-card strong, .note-card strong, .route-card strong, .saved-card strong, .log-card strong, .scenario-band strong {
  display: block;
  margin-top: 0.35rem;
  font-weight: 800;
  min-width: 0;
  overflow-wrap: anywhere;
}

.metric-card strong {
  font-size: clamp(1.3rem, 2vw, 1.75rem);
  line-height: 1.05;
  margin-top: 0.15rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.metric-card p, .note-card p, .route-card p, .log-card p {
  margin: 0.3rem 0 0;
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}

.rail-pack-status {
  display: grid;
  gap: 0.38rem;
  padding: 0.9rem 0 0.15rem;
}

.rail-pack-status strong {
  font-size: 1rem;
}

.rail-pack-status p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.rail-pack-actions {
  margin-top: 0.75rem;
}

.token-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.route-card .route-card-head {
  align-items: flex-start;
}

.route-card .token-row {
  margin-top: 0.9rem;
}

.form-grid {
  display: grid;
  gap: 0.6rem;
}

.create-scope-hint {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-2xs);
  font-weight: 600;
  line-height: 1.45;
}

.create-scope-hint[data-tone="good"] {
  color: var(--mint);
}

.create-scope-hint[data-tone="warn"] {
  color: var(--amber);
}

.position-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  align-items: start;
  overflow: visible;
}

.field-compact {
  gap: 0.2rem;
}

.field-compact span {
  font-size: var(--fs-xs);
}

.field-compact input {
  min-height: 2rem;
  font-variant-numeric: tabular-nums;
}

.guardrails-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem 0.65rem;
  margin-top: 0.85rem;
}

@media (max-width: 760px) {
.guardrails-grid {
    grid-template-columns: repeat(2, 1fr);
  }

.collateral-balance-copy {
    white-space: normal;
  }

}

.field-dollar-hint {
  display: block;
  margin-top: -0.1rem;
  color: var(--cyan);
  font-size: var(--fs-2xs);
  font-weight: 600;
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}

.form-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 0.35rem;
  position: relative;
}

.field span {
  color: var(--muted-strong);
  font-size: var(--fs-sm);
  font-weight: 700;
}

.field small {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  padding: 0.45rem 0.6rem;
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.45;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  transition-delay: 0s;
}

.field:hover small, .field:focus-within small {
  opacity: 1;
  pointer-events: auto;
  transition-delay: 1.5s;
}

.field input, .field select, .text-area {
  width: 100%;
  min-height: 2.4rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-strong);
  color: var(--text);
  font-size: var(--fs-base);
  font-weight: 500;
  transition:
    border-color 150ms ease,
    background-color 150ms ease;
}

.field input:hover, .field select:hover, .text-area:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.field input:focus, .field select:focus, .text-area:focus {
  outline: none;
  border-color: var(--accent);

  background: var(--surface-soft);
}

.field input[type="number"] {
  -moz-appearance: textfield;
}

.field input[type="number"]::-webkit-inner-spin-button, .field input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

.field input[type="number"]:hover {
  -moz-appearance: auto;
}

.field input[type="number"]:hover::-webkit-inner-spin-button, .field input[type="number"]:hover::-webkit-outer-spin-button {
  -webkit-appearance: inner-spin-button;
  appearance: auto;
  opacity: 0.6;
  height: 1.6rem;
  cursor: pointer;
}

.field input[type="number"]:hover::-webkit-inner-spin-button:hover, .field input[type="number"]:hover::-webkit-outer-spin-button:hover {
  opacity: 1;
}

.range-combo {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.6rem;
}

.range-combo input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--line-strong);
  outline: none;
  cursor: pointer;
  border: none;
  min-height: unset;
  padding: 0;
}

html[data-theme="dark"] .range-combo input[type="range"] {
  background: var(--range-track);
}

.range-combo input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);

  cursor: grab;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.range-combo input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);

}

.range-combo input[type="range"]::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.05);
}

.range-combo input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);

  cursor: grab;
}

.range-combo .range-value {
  min-width: 3.2rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-xs);
  background: var(--surface-tint);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}

.range-combo .range-value-input {
  width: 3.8rem;
  min-height: 1.7rem;
  padding: 0.15rem 0.35rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line);
  background: var(--surface-tint);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  transition: border-color 150ms ease, background 150ms ease;
}

.range-combo .range-value-input:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.range-combo .range-value-input:focus {
  outline: none;
  border-color: var(--accent);

  background: var(--surface-soft);
}

.range-value-input::-webkit-inner-spin-button, .range-value-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.range-value-input { -moz-appearance: textfield; }

.text-area {
  min-height: 6rem;
  padding: 0.82rem 0.88rem;
  resize: vertical;
}

.inline-title-shell {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.2rem;
  padding: 0 0.1rem 0 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.inline-title-icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.inline-title-shell input {
  width: 100%;
  min-width: 0;
  min-height: 1.8rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-strong);
  font-size: 1.04rem;
  font-weight: 700;
  line-height: 1.1;
}

.inline-title-shell input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.inline-title-shell:focus-within {
  color: var(--accent);
  border-bottom-color: var(--accent-soft);
}

.inline-title-shell input:focus {
  outline: none;

}

.disclosure {
  overflow: hidden;
}

.disclosure-head {
  display: flex;
  justify-content: space-between;
  list-style: none;
  cursor: pointer;
  transition: opacity 200ms ease;
}

.disclosure-head:hover {
  opacity: 0.8;
}

.disclosure-head::-webkit-details-marker {
  display: none;
}

.disclosure-head::after {
  content: "+";
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  flex: 0 0 auto;
  border-radius: var(--radius-xs);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  transition: transform 200ms ease, background-color 200ms ease;
}

.disclosure[open] .disclosure-head::after {
  content: "-";
  transform: none;
  background: var(--accent-soft);
  color: var(--accent);
}

.disclosure[open] .disclosure-head {
  margin-bottom: 1rem;
}

.visual-mark {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  overflow: hidden;
  border-radius: 50%;
  border: 0;
  background: var(--surface-soft);
  width: 24px;
  height: 24px;
}

.visual-mark-sm { width: 18px; height: 18px; flex: 0 0 18px; }
.visual-mark-md { width: 28px; height: 28px; flex: 0 0 28px; }
.visual-mark-lg { width: 40px; height: 40px; flex: 0 0 40px; }

.visual-mark.is-fallback {
  border-radius: 999px;
  background: var(--surface-emphasis);
}

.visual-mark-image {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  object-position: center;
  display: block;
}

.entity-inline {
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  width: 100%;
}

.entity-copy {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.entity-copy strong, .entity-copy span {
  display: block;
}

.entity-copy strong, .entity-copy span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-copy span {
  color: var(--muted);
  font-size: 0.88rem;
}

.token-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-width: 0;
  gap: 0.36rem;
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-strong);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
}

.token-chip .visual-mark {
  background: transparent;
  border-radius: 50%;
}

.token-chip-label {
  min-width: 0;
  line-height: 1.08;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-grid {
  display: grid;
  gap: 0.85rem;
}

.route-card {
  position: relative;
  padding: 0.2rem 0 0.2rem 0.85rem;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.route-grid .route-card + .route-card {
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

.route-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.1rem;
  bottom: 0.1rem;
  width: 2px;
  border-radius: 999px;
  background: var(--line-strong);
}

.route-card-title {
  display: grid;
  gap: 0.52rem;
  min-width: 0;
}

.route-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.route-role {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 1.15rem;
  padding: 0 0.38rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.route-card-head, .scenario-band-head, .saved-card-head, .log-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.route-score, .state-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  min-height: 1.3rem;
  padding: 0.1rem 0.45rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-strong);
  font-size: var(--fs-2xs);
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.saved-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.6rem;
  margin-top: 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.route-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}

.route-metrics > div, .scenario-band-grid > div {
  min-width: 0;
}

.route-metrics strong, .scenario-band-grid strong {
  margin-top: 0.25rem;
}

.route-card-copy {
  margin: 0.86rem 0 0;
  padding-top: 0.86rem;
  border-top: 1px solid var(--line);
}

.scenario-band-stack {
  display: grid;
  gap: 0;
}

.saved-card-meta span {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  max-width: 100%;
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  line-height: 1.25;
  text-align: center;
  overflow-wrap: anywhere;
}

.scenario-band {
  padding: 0.75rem 0.5rem;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  transition: background-color 200ms ease;
}

.scenario-band:hover {
  background: var(--surface-soft);
}

.scenario-band-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0.6rem;
}

.scenario-band-grid span {
  display: block;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.scenario-band-grid strong {
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.empty-panel {
  display: grid;
  gap: 0.8rem;
  min-height: 180px;
  align-content: center;
  background: var(--surface-soft);
}

.log-card, .note-card {
  background: transparent;
  padding: 0.5rem 0 0.5rem 0.65rem;
  border-left: 2px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.log-card[data-state="Observe"] { border-left-color: var(--cyan); }

.log-card[data-state="Maintain"] { border-left-color: var(--mint); }

.log-card[data-state="BuildBuffer"] { border-left-color: var(--amber); }

.log-card[data-state="DeRisk"] { border-left-color: var(--violet); }

.log-card[data-state="StressLockdown"] { border-left-color: var(--rose); }

#saved-scenarios {
  gap: 0;
}

.saved-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.3rem 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  align-items: center;
}

.saved-card-head {
  grid-column: 1;
}

.saved-card-meta {
  grid-column: 1;
}

.saved-card .action-cluster {
  grid-column: 2;
  grid-row: 1 / -1;
}

.saved-card:last-child {
  border-bottom: 0;
}

.saved-card p, .saved-card-head p {
  margin: 0.2rem 0 0;
  overflow-wrap: anywhere;
}

.delta {
  display: inline-flex;
  align-items: center;
  margin-top: 0.45rem;
  min-height: 1.5rem;
  padding: 0 0.55rem;
  border-radius: 999px;
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 800;
}

.delta.positive {
  background: var(--mint-soft);
  color: var(--mint);
}

.delta.negative {
  background: var(--rose-soft);
  color: var(--rose);
}

.delta.neutral {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.review-hero {
  display: grid;
  gap: 0.55rem;
  padding: 0.7rem 0.8rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-strong);
}

.review-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.review-hero-top strong {
  font-size: 1.3rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.review-progress {
  overflow: hidden;
  width: 100%;
  height: 0.38rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.review-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: currentColor;
  opacity: 0.85;
  transition: width 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

.review-badge, .review-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.55rem;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.review-badge {
  border: 0;
  gap: 0.32rem;
}

.badge-icon {
  width: 0.9rem;
  height: 0.9rem;
  flex: 0 0 auto;
}

.review-flag {
  background: transparent;
  color: var(--amber);
  flex: 0 0 auto;
}

.operator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(280px, 0.86fr);
  gap: 1.2rem;
  align-items: start;
  margin-top: 0.8rem;
}

.operator-stack {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}

.operator-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem 1rem;
  margin-top: 0;
  padding-top: 0.15rem;
  border-top: 0;
}

.operator-fact {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
  padding: 0.05rem 0 0.55rem;
  border-bottom: 1px solid var(--line);
}

.operator-fact span {
  color: var(--muted);
  font-size: var(--fs-2xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.operator-fact strong {
  margin: 0.05rem 0 0;
  font-size: 1rem;
  line-height: 1.1;
}

.operator-fact p {
  margin: 0.18rem 0 0;
  color: var(--muted);
  line-height: 1.35;
}

.review-list-shell {
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.review-list {
  display: grid;
  gap: 0;
}

.review-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.7rem;
  min-width: 0;
  padding: 0.65rem 0;
  border-top: 1px solid var(--line);
  background: transparent;
}

.review-item.is-first {
  border-top: 0;
  padding-top: 0;
}

.review-item input {
  position: static;
  opacity: 1;
  pointer-events: auto;
}

.review-check {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  margin-top: 0.1rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.02);

  flex: 0 0 auto;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.review-check:focus-visible {
  outline: none;

    0 0 0 3px rgba(107, 151, 255, 0.14);
}

.review-check:checked, .review-item.is-done .review-check {
  border-color: transparent;
  background:
    center / 0.7rem 0.7rem no-repeat
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.2 8.4 6.4 11.4 12.6 4.8' fill='none' stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.2'/%3E%3C/svg%3E"),
    var(--accent);

}

.review-copy {
  display: grid;
  gap: 0.24rem;
  min-width: 0;
}

.review-copy strong, .review-copy small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.review-copy small {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.review-item.is-done {
  background: transparent;
}

.review-item.is-done .review-copy small {
  color: var(--muted-strong);
}

.operator-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

.operator-form-shell {
  padding-top: 0.4rem;
  border-top: 1px solid var(--line);
}

.operator-actions {
  padding-top: 0.45rem;
}

.review-flag {
  width: 1.25rem;
  height: 1.25rem;
  min-height: auto;
  padding: 0;
  border-radius: 0;
  font-size: 0;
  position: relative;
  background: transparent;
  color: var(--warning);
  cursor: help;
  align-self: start;
  margin-top: 0.18rem;
  filter: none;
}

.review-flag svg {
  width: 1.25rem;
  height: 1.25rem;
}

.review-flag::after {
  content: attr(data-tooltip);
  position: absolute;
  right: -0.25rem;
  bottom: calc(100% + 0.45rem);
  min-width: max-content;
  max-width: 18rem;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  background: var(--tooltip-bg);
  color: var(--tooltip-text);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
  white-space: normal;

  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition:
    opacity 150ms ease,
    transform 150ms ease;
  z-index: 10;
}

.review-flag:hover::after, .review-flag:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.state-panel {
  display: grid;
  gap: 0.45rem;
  padding: 0 0 0.6rem;
  border-bottom: 1px solid var(--line);
}

.state-panel-prominent {
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.3rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--bg-strong);
}

.state-panel-prominent p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

body[data-page="results"] #results-route {
  padding-top: 0.05rem;
}

.state-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.state-panel-head span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.state-panel-head strong {
  display: block;
  margin-top: 0.1rem;
  font-size: clamp(0.95rem, 1.1vw, 1.15rem);
  line-height: 1.1;
}

.section-footnote {
  margin: 0.55rem 0 0;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.section-footnote strong {
  color: var(--text-strong);
}

.live-monitor-stack {
  display: grid;
  gap: 0.75rem;
}

.live-feed-list {
  display: grid;
  gap: 0;
}

.live-feed-row {
  display: grid;
  gap: 0.55rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}

.live-feed-list .live-feed-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.live-feed-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.live-feed-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.live-feed-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.8rem;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.live-feed-stats span {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
}

.live-feed-stats strong {
  color: var(--text-strong);
  font-size: 0.82rem;
}

.live-feed-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.live-feed-disclosure {
  margin-top: 0.6rem;
  border-top: 1px solid var(--line);
  padding-top: 0.6rem;
}

.live-feed-disclosure summary {
  cursor: pointer;
  color: var(--text-strong);
  font-size: 0.78rem;
  font-weight: 700;
  list-style: none;
}

.live-feed-disclosure summary::-webkit-details-marker {
  display: none;
}

.live-feed-disclosure summary::after {
  content: " +";
  color: var(--muted);
}

.live-feed-disclosure[open] summary::after {
  content: " -";
}

.live-feed-disclosure .live-feed-list {
  margin-top: 0.55rem;
}

.fact-list {
  display: grid;
  gap: 0;
}

.fact-list-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.4rem;
  margin-top: 0.6rem;
}

.fact-row-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 2rem;
}

.fact-row-grid .fact-row {
  padding: 0.5rem 0;
  border-top: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  background: transparent;
}

.fact-row {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
  padding: 0.55rem 0.5rem 0.6rem;
  border-top: 1px solid var(--line);
}

.fact-list .fact-row:first-child, .fact-list-compact .fact-row:nth-child(-n + 2) {
  padding-top: 0;
  border-top: 0;
}

.fact-row span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.compare-header {
  margin-bottom: 0.3rem;
}

.fact-row strong {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.fact-row p {
  margin: 0.08rem 0 0;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.35;
}

[data-state="Observe"] {
  border-bottom-color: rgba(71, 215, 232, 0.18);
}

[data-state="Maintain"] {
  border-bottom-color: rgba(39, 212, 160, 0.16);
}

[data-state="BuildBuffer"] {
  border-bottom-color: rgba(243, 162, 39, 0.18);
}

[data-state="DeRisk"] {
  border-bottom-color: rgba(129, 102, 255, 0.20);
}

[data-state="StressLockdown"] {
  border-bottom-color: rgba(236, 93, 119, 0.20);
}

[data-state="Observe"] .state-badge {
  background: var(--cyan-soft);
  color: var(--cyan);
  border-color: var(--cyan-soft);
}

[data-state="Maintain"] .state-badge {
  background: var(--mint-soft);
  color: var(--mint);
  border-color: var(--mint-soft);
}

[data-state="BuildBuffer"] .state-badge {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: var(--amber-soft);
}

[data-state="DeRisk"] .state-badge {
  background: var(--violet-soft);
  color: var(--violet);
  border-color: var(--violet-soft);
}

[data-state="StressLockdown"] .state-badge {
  background: var(--rose-soft);
  color: var(--rose);
  border-color: var(--rose-soft);
}

.setup-toolbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.setup-footer-bar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-3);
  border-top: var(--border-soft);
  background: var(--surface);
}

.setup-footer-bar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
  flex: 0 0 auto;
  position: relative;
}

.setup-footer-bar__primary {
  min-width: 11rem;
}

[data-open-live-after-run][hidden] {
  display: inline-flex;
  visibility: hidden;
  pointer-events: none;
}

.setup-draft-chip {
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  color: var(--color-amber, #d9a443);
  border: 1px solid color-mix(in srgb, var(--color-amber, #d9a443) 45%, transparent);
  background: color-mix(in srgb, var(--color-amber, #d9a443) 10%, transparent);
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.setup-draft-chip[hidden] {
  display: inline-block;
  visibility: hidden;
  pointer-events: none;
}

.setup-footer-overflow {
  position: relative;
}

.setup-footer-overflow > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  border: var(--border-soft);
  background: var(--surface-soft);
  color: var(--muted-strong);
  cursor: pointer;
}

.setup-footer-overflow > summary::-webkit-details-marker { display: none; }

.setup-footer-overflow > summary svg { width: 14px; height: 14px; }

.setup-footer-overflow__menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 4px);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  border: var(--border-soft);
  background: var(--surface);
  min-width: 9rem;
  z-index: 20;
}

.setup-footer-overflow__menu .button {
  justify-content: flex-start;
  min-height: 1.85rem;
  font-size: 0.78rem;
}

.setup-footer-bar.setup-footer-summary, .setup-footer-summary {
  --preview-tone: var(--accent);
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, auto) minmax(18rem, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  padding: 0.75rem var(--space-4);
  min-height: 76px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);

  overflow: visible;
}

.setup-footer-summary[data-tone="stable"] { --preview-tone: var(--mint); }

.setup-footer-summary[data-tone="warn"], .setup-footer-summary[data-tone="blocked"] { --preview-tone: var(--amber); }

.setup-footer-summary[data-tone="danger"], .setup-footer-summary[data-tone="critical"] { --preview-tone: var(--rose); }

.setup-footer-summary__left {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: auto;
  min-width: 0;
}

.setup-footer-summary__left .create-preview-ring {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
}

.setup-footer-summary__left .create-preview-ring::before {
  inset: 5px;
}

.setup-footer-summary__left .create-preview-ring strong {
  font-size: 0.82rem;
}

.setup-footer-summary__left .create-preview-ring span {
  font-size: 0.5rem;
  margin-top: 0.05rem;
  letter-spacing: 0.1em;
}

.setup-footer-summary__meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.setup-footer-summary__meta .create-preview-title {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 11rem;
}

.setup-footer-summary__pills {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.3rem;
}

.setup-footer-summary__pills .create-preview-asset {
  min-width: 10rem;
}

.setup-footer-summary__pills .create-preview-pill[data-create-preview-scope] {
  min-width: 7.5rem;
  justify-content: center;
  display: inline-flex;
  align-items: center;
}

.setup-footer-summary__pills .create-preview-asset, .setup-footer-summary__pills .create-preview-pill {
  min-height: 1.3rem;
  padding: 0 0.55rem;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
}

.setup-footer-summary__mid {
  display: grid !important;
  grid-auto-flow: column !important;
  grid-auto-columns: minmax(0, 1fr) !important;
  grid-template-columns: unset !important;
  align-items: center;
  gap: 0 !important;
  padding: 0 0.2rem;
  border: 0;
  min-width: 0;
  overflow: visible !important;
  flex-wrap: nowrap !important;
}

.setup-footer-summary__mid .create-preview-metric {
  display: grid !important;
  grid-template-columns: none !important;
  gap: 0.08rem;
  min-width: 0;
  padding: 0 0.55rem;
  border-left: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  overflow: visible !important;
}

.setup-footer-summary__mid .create-preview-metric:first-child {
  padding-left: 0.15rem;
  border-left: 0;
}

.setup-footer-summary__mid .create-preview-metric span {
  font-family: "Manrope", "Sora", sans-serif;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted-strong);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: visible !important;
  text-overflow: clip !important;
}

.setup-footer-summary__mid .create-preview-metric strong {
  font-family: "Sora", "Manrope", sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: visible !important;
  text-overflow: clip !important;
}

.setup-footer-summary__right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  justify-self: end;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 1100px) {
.setup-footer-summary {
    grid-template-columns: 1fr;
    min-height: 0;
  }

.setup-footer-summary__left {
    width: auto;
  }

.setup-footer-summary__mid {
    overflow: visible;
  }

.setup-footer-summary__right {
    justify-self: start;
    justify-content: flex-start;
  }

}


.btc-price-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.2rem;
  font-size: var(--fs-xs);
  color: var(--muted);
}

.btc-price-meta__reset {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: inherit;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}

.btc-price-meta__reset[hidden] { display: none; }

.field-amount-error {
  margin-top: 0.25rem;
  font-size: var(--fs-xs);
  color: var(--rose, #ff6b88);
}

.field-amount-error[hidden] { display: none; }

.scenario-compare {
  display: grid;
  gap: var(--space-3);
}

.scenario-workbench-host, .scenario-workbench {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
}

 .scenario-compare-impact-bar[data-direction="down"] > span {
  background: var(--surface);
}

 .scenario-compare-impact-bar[data-direction="up"] > span {
  background: var(--surface);
}

 .scenario-compare-impact-bar[data-direction="flat"] > span {
  background: color-mix(in srgb, var(--line) 82%, var(--accent));
}

a.button, button.button, a[data-nav], .saved-card [data-action], [data-review-check], [data-theme-value] {
  cursor: pointer;
}

.saved-card [data-action]:hover {
  transform: translateY(-1px);
}

.page-header-compact {
  padding-bottom: 0.1rem;
  margin-bottom: 0.15rem;
}

.page-header-compact .inline-title-shell {
  border-bottom: 1px dashed transparent;
  transition: border-color 0.2s ease;
}

.page-header-compact .inline-title-shell:hover {
  border-bottom-color: var(--line-strong);
}

.page-header-compact .inline-title-shell:focus-within {
  border-bottom-color: var(--accent);
  border-bottom-style: solid;
}

.page-header-compact .inline-title-shell input {
  font-size: 0.98rem;
  font-weight: 700;
  font-family: "Sora", "Manrope", sans-serif;
  letter-spacing: -0.03em;
}

/* >>> 10-results-workspace.css >>> */
.results-glance-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.results-glance-title {
  flex: 1 1 auto;
  min-width: 0;
}

.results-glance-title h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
}

.results-glance-title .surface-copy {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.3;
}

.results-glance-chips {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.results-glance-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.8fr 0.8fr 0.7fr 0.8fr;
  align-items: center;
  gap: 0.6rem;
  padding-top: 0.45rem;
  margin-top: 0.4rem;
  border-top: 1px solid var(--line);
}

.results-hero-verdict {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.5rem 0 0;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text, #c8d1e0);
  background: color-mix(in srgb, currentColor 10%, var(--bg-strong, #10141c));
  border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
}
.results-hero-verdict__dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 25%, transparent);
}
.results-hero-verdict--mint { color: var(--chart-mint, #22e07c); }
.results-hero-verdict--amber { color: var(--chart-amber, #ff9a2e); }
.results-hero-verdict--rose { color: var(--chart-rose, #ff3b4d); }
.results-hero-verdict__text { color: var(--text, #c8d1e0); }

.rg-cell {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.rg-label {
  color: var(--muted);
  font-size: var(--fs-2xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.rg-cell strong {
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.rg-sub {
  color: var(--muted);
  font-size: var(--fs-2xs);
}

.recommendation-list {
  display: grid;
  gap: 0.35rem;
}

.recommendation-list-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.recommendation-list-inline .recommendation-item {
  flex: 1 1 auto;
  min-width: 0;
}

.recommendation-item {
  margin: 0;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-xs);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.5;
  border-left: 3px solid var(--muted);
  background: var(--surface-soft);
}

.results-verdict-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-4);
  align-items: center;
  margin-bottom: var(--space-4);
}

.results-verdict-copy {
  display: grid;
  gap: 0.35rem;
}

.results-verdict-copy h2 {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
}

@media (max-width: 760px) {
.results-verdict-card {
    grid-template-columns: 1fr;
    align-items: start;
  }

}

.ltv-gauge {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem 0;
  margin-bottom: 0.4rem;
}

.ltv-gauge svg {
  flex: 0 0 auto;
}

.ltv-gauge-labels {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.ltv-gauge-labels strong {
  font-size: 1.35rem;
  font-weight: 800;
  font-family: "Sora", "Manrope", sans-serif;
  line-height: 1;
  letter-spacing: -0.03em;
}

.ltv-gauge-labels span {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ltv-gauge-labels p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.state-flow {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0.6rem 0;
  overflow-x: auto;
}

.state-flow-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  border: none;
  background: transparent;
  min-width: 72px;
  text-align: center;
  transition: background 200ms, box-shadow 200ms;
  position: relative;
  z-index: 1;
}

.state-flow-node strong {
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.state-flow-node span {
  font-size: var(--fs-2xs);
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.state-flow-node.is-active {
  background: color-mix(in srgb, var(--flow-color, var(--accent)) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--flow-color, var(--accent)) 25%, transparent);
}

.state-flow-node[data-flow-state="Observe"] { --flow-color: var(--cyan); }

.state-flow-node[data-flow-state="Maintain"] { --flow-color: var(--mint); }

.state-flow-node[data-flow-state="BuildBuffer"] { --flow-color: var(--amber); }

.state-flow-node[data-flow-state="DeRisk"] { --flow-color: var(--violet); }

.state-flow-node[data-flow-state="StressLockdown"] { --flow-color: var(--rose); }

.state-flow-node .flow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--flow-color, var(--muted));
  opacity: 0.5;
}

.state-flow-node.is-active .flow-dot {
  opacity: 1;

}

.state-flow-arrow {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0 0.25rem;
  color: var(--muted);
  opacity: 0.3;
}

.state-flow-arrow svg {
  width: 18px;
  height: 18px;
}

.stress-spark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 48px;
  padding: 0.6rem 0.5rem;
}

.stress-spark-bar {
  flex: 1;
  min-width: 0;
  border-radius: var(--radius-pill) var(--radius-pill) 0 0;
  background: var(--accent);
  opacity: 0.85;
  transition: opacity 200ms, background 200ms;
  position: relative;
}

.stress-spark-bar:hover {
  opacity: 1;
}

.stress-spark-bar[data-spark-state="Observe"] { background: var(--cyan); }

.stress-spark-bar[data-spark-state="Maintain"] { background: var(--mint); }

.stress-spark-bar[data-spark-state="BuildBuffer"] { background: var(--amber); }

.stress-spark-bar[data-spark-state="DeRisk"] { background: var(--violet); }

.stress-spark-bar[data-spark-state="StressLockdown"] { background: var(--rose); }

.stress-spark-bar.is-selected {
  opacity: 1;

  border-radius: var(--radius-pill) var(--radius-pill) 0 0;
}

.spark-detail-popup {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  border: 1px solid var(--line-strong);

  animation: fadeSlideIn 0.15s ease;
}

.spark-detail-popup[hidden] { display: none; }

.spark-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.spark-detail-head strong {
  font-size: var(--fs-base);
}

.spark-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.3rem 0.6rem;
}

.spark-detail-grid div {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.spark-detail-grid span {
  font-size: var(--fs-2xs);
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.spark-detail-grid strong {
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}

.spark-detail-explain {
  margin: 0.4rem 0 0;
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.5;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.scenario-mini-ring {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
}

.payout-range-bar {
  position: relative;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  overflow: hidden;
  margin: 0.4rem 0;
}

.payout-range-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--surface);
  transition: width 0.6s ease;
}

.scenario-band-enhanced {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 0.8rem;
  align-items: center;
}

.scenario-band-enhanced .scenario-band-content {
  min-width: 0;
}

@media (max-width: 1180px) {
.sidebar-position {
    gap: 0;
  }

}

@media (max-width: 1080px) {
.page-header, .page-tools, .section-head, .route-card-head, .live-feed-head, .saved-card-head, .log-card-head, .scenario-band-head {
    flex-direction: column;
    align-items: stretch;
  }

.content-grid-main, .hero-layout, .live-hero-metrics, .fact-list-compact, .operator-grid, .operator-facts {
    grid-template-columns: 1fr;
  }

.page-tools {
    justify-items: start;
  }

.scenario-band-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

.route-metrics {
    grid-template-columns: 1fr;
  }

.form-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

.review-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

.review-item .review-flag {
    grid-column: 2;
    justify-self: start;
  }

}

@media (max-width: 1024px) {
body[data-page="results"] .content-grid-main {
    grid-template-columns: 1fr;
  }

.operator-grid {
    grid-template-columns: 1fr;
  }

}

.app-shell--topbar {
  display: block;
  min-height: 100vh;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 72;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.2rem;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 52%, transparent);
}

.app-topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.app-topbar__brand img {
  width: 2rem;
  height: 2rem;
  flex: 0 0 2rem;
}

.app-topbar__brand span {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-strong);
}

.app-topbar__actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  min-width: 0;
}

.app-main--topbar {
  width: min(100%, 1680px);
  margin: 0 auto;
  padding: 1rem 1.25rem 5rem;
}

.app-main--topbar .page-stack {
  min-width: 0;
}

@media (max-width: 760px) {
.app-topbar {
    padding: 0.75rem 0.9rem;
    flex-wrap: wrap;
  }

.app-topbar__actions {
    width: 100%;
    justify-content: space-between;
  }

.app-main--topbar {
    padding: 0.8rem 0.85rem 4.5rem;
  }

.app-main {
    padding: 0.75rem;
  }

h1 {
    font-size: 1.35rem;
    max-width: none;
  }

.form-grid-2, .form-grid-3, .scenario-band-grid, .operator-form-grid {
    grid-template-columns: 1fr;
  }

.action-cluster, .hero-chip-row {
    width: 100%;
  }

.review-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

.review-item .review-flag {
    grid-column: 2;
    justify-self: start;
  }

.button {
    width: 100%;
  }

.results-glance-head {
    flex-direction: column;
    align-items: flex-start;
  }

.results-glance-grid {
    grid-template-columns: repeat(2, 1fr);
  }

}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseGlow {
}

.surface {
  animation: fadeSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.page-stack > *:nth-child(1) { animation-delay: 0s; }

.page-stack > *:nth-child(2) { animation-delay: 0.06s; }

.page-stack > *:nth-child(3) { animation-delay: 0.12s; }

.page-stack > *:nth-child(4) { animation-delay: 0.18s; }

.page-stack > *:nth-child(5) { animation-delay: 0.24s; }

.content-grid > *:nth-child(1) { animation-delay: 0.08s; }

.content-grid > *:nth-child(2) { animation-delay: 0.14s; }

.metric-card {
  transition: transform 0.15s ease;
}

.button-primary:active {
  transform: scale(0.97);
}

.button-secondary:active {
  transform: scale(0.97);
}

.button[disabled] {
  opacity: 0.6;
  pointer-events: none;
}

.scenario-band {
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.scenario-band:hover {
  background: var(--surface-soft);
}

.saved-card {
  transition: background-color 0.2s ease;
}

.field.field-error input, .field.field-error select {
  border-color: var(--rose);

}

.field.field-error small {
  color: var(--rose);
}

.field.field-warn input, .field.field-warn select {
  border-color: var(--amber);

}

.status-line[data-status="running"] {
  animation: pulseGlow 1.5s ease-in-out infinite;
}

.btn-spinner {
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
  vertical-align: middle;
}

.button.is-running {
  pointer-events: none;
}

@keyframes btnSpin {
  to { transform: rotate(360deg); }
}

.ws-step-list-compact {
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.ws-step-list-compact .ws-step p {
  font-size: var(--fs-2xs);
  margin: 0;
}

.ws-step-list-compact .ws-step strong {
  font-size: var(--fs-sm);
}

.ws-dash-label {
  display: block;
  color: var(--muted);
  font-size: var(--fs-2xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
}

.ws-dash-sub {
  color: var(--muted);
  font-size: var(--fs-xs);
}

.ws-step-list {
  display: grid;
  gap: 0;
}

.ws-step {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  gap: 0.6rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.ws-step:last-child {
  border-bottom: none;
}

.ws-step-num {
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--cyan);
  color: #0c0c14;
  font-size: var(--fs-xs);
  font-weight: 800;
  flex-shrink: 0;
}

.ws-step strong {
  display: block;
  font-size: 0.8rem;
}

.ws-step p {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.ws-summary {
  display: grid;
  gap: 1rem;
}

.ws-summary-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.ws-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
}

.ws-summary-cell {
  display: grid;
  gap: 0.25rem;
}

.ws-summary-cell strong {
  font-size: var(--fs-lg);
  letter-spacing: -0.03em;
}

.ws-summary-counts {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding-top: 0.15rem;
}

.ws-count-badge {
  font-size: var(--fs-2xs);
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ws-count-draft {
  background: var(--surface-emphasis);
  color: var(--muted-strong);
}

.ws-count-current {
  background: var(--accent-soft);
  color: var(--accent);
}

.ws-count-saved {
  background: var(--mint-soft);
  color: var(--mint);
}

.ws-filter-bar {
  padding: 0;
  background: none;

}

.ws-filter-row {
  display: flex;
  gap: 0.3rem;
}

.ws-filter-btn {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ws-filter-btn:hover {
  background: var(--surface-tint);
  color: var(--text);
}

.ws-filter-btn.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.ws-filter-count {
  font-size: var(--fs-2xs);
  opacity: 0.7;
}

.ws-position-card {
  display: grid;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
}

.ws-position-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.ws-position-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.ws-position-title strong {
  font-size: var(--fs-base);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-position-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ws-position-date {
  font-size: var(--fs-2xs);
  color: var(--muted);
}

.ws-type-badge {
  font-size: var(--fs-2xs);
  font-weight: 800;
  padding: 0.12rem 0.45rem;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.ws-badge-draft {
  background: var(--surface-emphasis);
  color: var(--muted-strong);
}

.ws-badge-current {
  background: var(--accent-soft);
  color: var(--accent);
}

.ws-badge-saved {
  background: var(--mint-soft);
  color: var(--mint);
}

.ws-position-metrics {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.6rem 1rem;
  align-items: start;
}

.ws-position-metrics > div {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
  overflow: hidden;
}

.ws-position-metrics .entity-inline {
  width: auto;
  max-width: 100%;
  min-width: 0;
}
.ws-position-metrics .visual-mark {
  width: 18px !important;
  height: 18px !important;
  flex: 0 0 18px !important;
}

.ws-position-metrics strong {
  font-size: var(--fs-sm);
  letter-spacing: -0.02em;
}

.ws-dash-empty {
  color: var(--muted);
  opacity: 0.4;
}

.ws-position-actions {
  display: flex;
  gap: 0.35rem;
  padding-top: 0.2rem;
  border-top: 1px solid var(--line);
}

@media (max-width: 1080px) {
.ws-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

}

@media (max-width: 760px) {
.ws-summary-grid {
    grid-template-columns: 1fr;
  }

.ws-summary-head {
    flex-direction: column;
  }

.ws-filter-row {
    flex-wrap: wrap;
  }

.ws-position-metrics {
    grid-template-columns: repeat(3, 1fr);
  }

}

.scenario-band {
  position: relative;
  overflow: hidden;
}

.scenario-band::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: var(--radius-pill);
  background: var(--line-strong);
}

[data-state="Observe"] .scenario-band::before, .scenario-band[data-state="Observe"]::before {
  background: rgba(71, 215, 232, 0.72);
}

.scenario-band[data-state="Maintain"]::before {
  background: rgba(27, 184, 154, 0.72);
}

.scenario-band[data-state="BuildBuffer"]::before {
  background: rgba(230, 161, 18, 0.72);
}

.scenario-band[data-state="DeRisk"]::before {
  background: rgba(129, 102, 255, 0.72);
}

.scenario-band[data-state="StressLockdown"]::before {
  background: rgba(240, 91, 114, 0.72);
}

.log-card {
  position: relative;
  overflow: hidden;
  padding-left: 1.3rem;
}

.log-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: var(--radius-pill);
  background: var(--line-strong);
}

.log-card[data-state="Observe"]::before { background: rgba(71, 215, 232, 0.72); }

.log-card[data-state="Maintain"]::before { background: rgba(27, 184, 154, 0.72); }

.log-card[data-state="BuildBuffer"]::before { background: rgba(230, 161, 18, 0.72); }

.log-card[data-state="DeRisk"]::before { background: rgba(129, 102, 255, 0.72); }

.log-card[data-state="StressLockdown"]::before { background: rgba(240, 91, 114, 0.72); }

.state-panel-prominent::after {
  content: none;
}

.note-card {
  position: relative;
  padding-left: 1.1rem;
  border-left: 3px solid var(--line);
}

.disclosure {
  transition: box-shadow 0.2s ease;
}

.disclosure-head {
  cursor: pointer;
  list-style: none;
  user-select: none;
  position: relative;
  padding-right: 2rem;
}

.disclosure-head::-webkit-details-marker {
  display: none;
}

.disclosure-head::after {
  content: "";
  position: absolute;
  right: 0.5rem;
  top: 50%;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-65%) rotate(45deg);
  transition: transform 0.2s ease;
}

.disclosure[open] > .disclosure-head::after {
  transform: translateY(-35%) rotate(-135deg);
}

.empty-panel {
  text-align: center;
  padding: 1.5rem 1rem;
}

.empty-panel h3 {
  font-size: 0.95rem;
  margin: 0 0 0.3rem;
}

.empty-panel p {
  max-width: 38ch;
  margin: 0 auto;
  font-size: 0.8rem;
}

.empty-results-hero {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  padding: 1.5rem 1rem;
  text-align: center;
}

.empty-results-hero h2 {
  font-size: 1.1rem;
}

.empty-results-hero .surface-copy {
  max-width: 40ch;
  margin: 0;
  font-size: 0.8rem;
}

.empty-results-icon {
  opacity: 0.5;
  margin-bottom: 0.15rem;
}

.form-grid-1 {
  grid-template-columns: 1fr;
}

.segmented-control {
  display: grid;
  gap: 0;
  background: var(--bg-strong);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  position: relative;
}

.toggle-stack {
  display: grid;
  gap: 0.35rem;
  margin-top: 1rem;
}

@media (max-width: 960px) {
.position-row {
    grid-template-columns: repeat(2, 1fr);
  }

}

@media (max-width: 760px) {
.state-flow {
    flex-wrap: wrap;
    gap: 0.3rem;
  }

.state-flow-arrow { display: none; }

.state-flow-node { min-width: 60px; padding: 0.4rem 0.5rem; }

.ltv-gauge { flex-direction: column; align-items: flex-start; }

.scenario-band-enhanced { grid-template-columns: 36px 1fr; gap: 0.5rem; }

}

@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

}

html[data-theme="dark"] {
  scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

html[data-theme="dark"] ::-webkit-scrollbar { width: 6px; height: 6px; }

html[data-theme="dark"] ::-webkit-scrollbar-track { background: transparent; }

html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: var(--radius-pill); }

html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.18); }

html[data-theme="dark"] .review-check:checked, html[data-theme="dark"] .review-item.is-done .review-check {
  background:
    center / 0.7rem 0.7rem no-repeat
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.2 8.4 6.4 11.4 12.6 4.8' fill='none' stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.2'/%3E%3C/svg%3E"),
    var(--accent);
}

/* >>> 20-live.css >>> */
#live-execute {
  overflow: visible;
}

.exec-header-actions {
  display: flex;
  gap: 0.5rem;
}

.exec-portfolio {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface-soft);
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  align-items: center;
}

.exec-portfolio-row {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 140px;
}

.exec-portfolio-row span {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.exec-portfolio-row strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-strong);
}

.exec-portfolio-ts {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--muted);
}

.exec-action-card {
  border: 1px solid var(--line);
  border-radius: 0.625rem;
  padding: 1.25rem;
  background: var(--surface);
}

.exec-action-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.exec-action-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.exec-action-amount {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-strong);
  font-family: "Sora", sans-serif;
}

.exec-action-reason {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0.5rem 0;
}

.exec-action-route {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
}

.exec-action-route span {
  color: var(--muted);
}

.exec-action-route strong {
  color: var(--text-strong);
}

.exec-action-error {
  color: var(--rose);
  font-size: 0.82rem;
  padding: 0.5rem 0.75rem;
  background: var(--rose-soft);
  border-radius: 0.375rem;
  margin: 0.5rem 0;
}

.exec-action-skip {
  color: var(--muted);
  font-size: 0.82rem;
  font-style: italic;
  margin: 0.5rem 0;
}

.exec-action-note {
  color: var(--muted);
  font-size: 0.82rem;
  padding: 0.5rem 0;
}

.exec-action-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--muted);
}

.exec-action-cta {
  padding-top: 0.75rem;
}

.exec-sign-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  font-size: 0.88rem;
  font-weight: 700;
}

.exec-confirm-panel {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.8rem;
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--amber) 9%, var(--surface-soft));
}

.exec-confirm-panel strong {
  color: var(--text-strong);
}

.exec-confirm-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.exec-risk-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  margin-top: 0.75rem;
}

.exec-check {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
}

.exec-check::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.exec-check-ok {
  color: var(--mint);
  background: var(--mint-soft);
}

.exec-check-ok::before {
  background: var(--mint);
}

.exec-check-warn {
  color: var(--amber);
  background: var(--amber-soft);
}

.exec-check-warn::before {
  background: var(--amber);
}

.exec-tx-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.exec-tx-row {
  display: grid;
  grid-template-columns: 20px 1fr auto auto auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
}

.exec-tx-row:last-child {
  border-bottom: none;
}

.exec-tx-status {
  display: flex;
  align-items: center;
  justify-content: center;
}

.exec-tx-action {
  font-weight: 600;
  color: var(--text-strong);
}

.exec-tx-protocol {
  color: var(--muted);
  font-size: 0.75rem;
}

.exec-tx-link {
  color: var(--accent);
  text-decoration: none;
  font-family: monospace;
  font-size: 0.75rem;
}

.exec-tx-link:hover {
  text-decoration: underline;
}

.exec-tx-na {
  color: var(--muted);
  font-size: 0.75rem;
}

.exec-tx-time {
  color: var(--muted);
  font-size: 0.72rem;
  text-align: right;
}

html[data-theme="dark"] .exec-portfolio {
  background: rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .exec-action-card {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .exec-tx-row {
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

.hero-chip-market {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-strong));
  color: var(--accent);
}

.hero-chip-warn {
  border-color: color-mix(in srgb, var(--warning, #d08a2a) 55%, var(--line));
  background: color-mix(in srgb, var(--warning, #d08a2a) 12%, var(--surface-strong));
  color: var(--warning, #d08a2a);
}

.market-band-surface {
  margin-top: 0.9rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.market-band-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.market-band-head h3 {
  margin: 0;
  font-size: var(--fs-sm);
  letter-spacing: 0.01em;
}

.market-band-meta {
  font-size: var(--fs-2xs);
  color: var(--text-muted);
  text-transform: lowercase;
}

.market-band-copy {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.market-band-rows {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.market-band-row {
  display: grid;
  grid-template-columns: 2.2rem 6.5rem 1fr 5rem 5.5rem;
  align-items: center;
  gap: 0.55rem;
  font-size: var(--fs-xs);
}

.market-band-q {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--accent);
}

.market-band-price {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.market-band-track {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-strong));
  overflow: hidden;
}

.market-band-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--surface);
  border-radius: inherit;
}

.market-band-payout {
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--text);
}

.market-band-state {
  font-size: var(--fs-2xs);
  color: var(--text-muted);
  text-align: right;
}

.market-band-warnings {
  margin: 0.15rem 0 0;
  padding-left: 1.1rem;
  font-size: var(--fs-2xs);
  color: var(--text-muted);
}

@media (max-width: 640px) {
.market-band-row {
    grid-template-columns: 2rem 1fr 5rem;
    row-gap: 0.15rem;
  }

.market-band-price, .market-band-state {
    grid-column: 2 / -1;
    text-align: left;
  }

.market-band-track {
    grid-column: 1 / -1;
  }

}

:root {
  --tide-radius-panel: 22px;
  --tide-radius-row: 16px;
  --tide-radius-control: 14px;
  --tide-panel-bg: linear-gradient(
    180deg,
    color-mix(in srgb, var(--surface-strong) 90%, transparent),
    color-mix(in srgb, var(--surface-soft) 78%, transparent)
  );
  --tide-row-bg: color-mix(in srgb, var(--surface-soft) 78%, transparent);
  --tide-panel-border: color-mix(in srgb, var(--line-strong) 62%, transparent);
  --tide-row-border: color-mix(in srgb, var(--line) 72%, transparent);
  --tide-soft-glow: 0 18px 42px rgba(2, 6, 18, 0.18);
  --tide-grid-line: rgba(255, 255, 255, 0.032);
  --tide-accent-wash: color-mix(in srgb, var(--accent) 16%, transparent);
  --tide-cyan-wash: color-mix(in srgb, var(--cyan) 12%, transparent);
  --tide-label-size: 0.72rem;
  --tide-meta-size: 0.88rem;
  --tide-body-size: 0.98rem;
  --tide-title-size: clamp(1.2rem, 1.4vw, 1.55rem);
  --tide-hero-number: clamp(2rem, 3.6vw, 3.65rem);
}

html[data-theme="light"] {
  --tide-panel-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(246, 249, 255, 0.9));
  --tide-row-bg: rgba(245, 248, 254, 0.82);
  --tide-panel-border: rgba(124, 140, 172, 0.28);
  --tide-row-border: rgba(124, 140, 172, 0.22);
  --tide-grid-line: rgba(15, 31, 55, 0.04);
  --tide-soft-glow: 0 18px 42px rgba(18, 38, 72, 0.08);
}

body {
  position: relative;
  background: var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: var(--surface);
  background-size: 96px 96px;
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.82), transparent 88%);
  opacity: 0.58;
  z-index: 0;
}

.app-shell, .app-main{
  position: relative;
}

.app-shell {
  isolation: isolate;
  z-index: 1;
}

.surface {
  animation: none;
}

.sidebar-wallet {
  margin-top: 0.05rem;
}

.theme-toggle {
  padding: 0.18rem;
  border: 1px solid var(--sidebar-line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-soft) 58%, transparent);
}

.theme-toggle button {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
}

.app-main {
  padding: clamp(0.95rem, 1.4vw, 1.55rem) clamp(1rem, 2vw, 1.9rem) 2rem;
}

.page-header {
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.page-heading h1 {
  font-size: clamp(1.35rem, 2vw, 2.1rem);
  letter-spacing: -0.04em;
}

.page-copy {
  max-width: 72ch;
  font-size: var(--tide-body-size);
  color: var(--muted);
  line-height: 1.55;
}

.page-stack, .content-grid, .content-grid-main {
  gap: clamp(1rem, 1.25vw, 1.35rem);
}

.page-tools .action-cluster, .ws-position-actions, .saved-card .action-cluster {
  gap: 0.55rem;
}

.surface, body[data-page="workspace"] .surface:not(.surface-hero), body[data-page="overview"] .surface:not(.surface-hero), body[data-page="live"] .surface:not(.surface-hero), body[data-page="results"] .surface:not(.surface-hero), body[data-page="library"] .surface:not(.surface-hero) {
  padding: clamp(1rem, 1.35vw, 1.35rem);
  border: 1px solid var(--tide-panel-border);
  border-radius: var(--tide-radius-panel);
  background: var(--tide-panel-bg);

}

.surface-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(1.1rem, 1.75vw, 1.75rem);
  border-color: color-mix(in srgb, var(--accent) 38%, var(--tide-panel-border));
  background: var(--tide-panel-bg);

}

.surface-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--surface);
  opacity: 0.8;
}

.surface-hero > * {
  position: relative;
  z-index: 1;
}

.surface h2, .surface h3, .ws-position-card strong, .saved-card strong, .route-card-title, .state-panel strong {
  letter-spacing: -0.04em;
}

.metric-card, .fact-row, .ws-summary-cell, .rg-cell {
  padding: 0.95rem;
}

.ws-position-card, .saved-card, .route-card, .scenario-band, .log-card, .note-card, .state-panel, #live-execute, #live-tx-history, #live-allocator, #live-monitor, #live-route, #live-surfaces, #results-recommendation, #results-review, #results-scenarios, #action-log, #health-notes {
  padding: clamp(0.95rem, 1.15vw, 1.2rem);
}

.metric-card strong, .fact-row strong, .rg-cell strong, .ws-summary-cell strong {
  display: block;
  font-size: clamp(1.2rem, 1.45vw, 1.7rem);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.button {
  min-height: 2.6rem;
  padding: 0 1rem;
  border-radius: 14px;
}

.button-primary {
  background: var(--surface);

}

.button-secondary {
  border-color: var(--tide-row-border);
  background: color-mix(in srgb, var(--surface-strong) 78%, transparent);
}

.button-ghost {
  border-color: transparent;
}

input, select, textarea {
  border-radius: var(--tide-radius-control);
}

.visual-mark-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
}

.visual-mark {
  background: transparent;
  border: 1px solid var(--line);
}

.visual-mark.is-fallback {
  background: var(--surface-soft);
}

.live-feed-row .token-chip .visual-mark {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.live-feed-row .entity-inline .visual-mark {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
}

.ws-summary {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;

}

.ws-summary-head, .section-head {
  margin-bottom: 0.8rem;
}

.ws-summary-grid, .results-glance-grid, .fact-row-grid {
  gap: 0.75rem;
}

.ws-summary-counts {
  gap: 0.45rem;
  flex-wrap: wrap;
}

.ws-filter-bar {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;

}

.ws-filter-row {
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ws-filter-btn {
  min-height: 2.55rem;
  padding: 0 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--tide-row-border);
  background: var(--tide-row-bg);
}

.ws-filter-btn.is-active {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 54%, transparent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.ws-position-card {
  overflow: hidden;
}

.ws-position-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.75rem;
}

.hero-layout, .route-grid {
  gap: 0.8rem;
}

.route-grid {
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
}

.leaderboard-row {
  gap: 1rem;
  align-items: center;
}

.empty-panel {
  padding: 1.1rem;
}

.empty-panel strong {
  display: block;
  margin-bottom: 0.32rem;
  font-size: 1rem;
}

@media (max-width: 920px) {
.ws-summary-grid, .results-glance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 760px) {
.app-main {
    padding-inline: 0.9rem;
  }

.page-header {
    display: grid;
  }

.page-tools {
    justify-items: start;
  }

.ws-summary-grid, .results-glance-grid, .fact-row-grid {
    grid-template-columns: 1fr;
  }

}

:root {
  --tide-radius-xl: 1.5rem;
  --tide-radius-lg: 1.15rem;
  --tide-radius-md: 0.95rem;
  --tide-system-panel-border: rgba(13, 26, 48, 0.08);
  --tide-system-panel-shadow: 0 18px 40px rgba(13, 26, 48, 0.08);
  --tide-system-panel-bg:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 247, 252, 0.94));
  --tide-system-panel-raised:
    linear-gradient(180deg, rgba(255, 255, 255, 0.985), rgba(246, 249, 253, 0.97));
  --tide-system-grid-line: rgba(45, 94, 224, 0.05);
  --tide-system-header-glow: rgba(45, 94, 224, 0.08);
  --tide-system-mint-glow: rgba(20, 184, 180, 0.1);
  --tide-system-card-fill: rgba(255, 255, 255, 0.72);
}

html[data-theme="dark"] {
  --tide-system-panel-border: rgba(125, 148, 195, 0.12);
  --tide-system-panel-shadow: 0 26px 54px rgba(0, 0, 0, 0.26);
  --tide-system-panel-bg:
    linear-gradient(180deg, rgba(20, 22, 31, 0.94), rgba(15, 18, 27, 0.96));
  --tide-system-panel-raised:
    linear-gradient(180deg, rgba(27, 29, 40, 0.96), rgba(20, 22, 32, 0.98));
  --tide-system-grid-line: rgba(59, 112, 255, 0.07);
  --tide-system-header-glow: rgba(59, 112, 255, 0.12);
  --tide-system-mint-glow: rgba(94, 236, 192, 0.09);
  --tide-system-card-fill: rgba(255, 255, 255, 0.025);
}

body {
  background: var(--bg);
}

html[data-theme="dark"] body {
  background: var(--bg);
}

.app-shell {
  grid-template-columns: 14.6rem minmax(0, 1fr);
}

.theme-toggle {
  gap: 0.25rem;
  padding: 0.22rem;
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

html[data-theme="light"] .theme-toggle {
  background: rgba(13, 26, 48, 0.04);
  border-color: rgba(13, 26, 48, 0.06);
}

.theme-toggle button {
  min-width: 2.35rem;
  min-height: 2.2rem;
  border-radius: 0.8rem;
}

.app-main {
  padding: var(--space-4) var(--space-5) var(--space-6);
}

.page-header h1 {
  font-size: clamp(1.7rem, 1.7vw, 2.15rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.page-copy {
  max-width: 46rem;
  color: var(--text-soft);
  font-size: 0.98rem;
  line-height: 1.55;
}

.surface {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--tide-system-panel-border);
  border-radius: var(--tide-radius-lg);
  background: var(--tide-system-panel-bg);

}

.surface::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  pointer-events: none;
  background: var(--surface);
}

.surface > * {
  position: relative;
  z-index: 1;
}

.surface-hero {
  border-color: rgba(59, 112, 255, 0.18);
  background: var(--tide-system-panel-raised);
}

.surface-hero::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 0.2rem;
  background: var(--surface);
  opacity: 0.95;
}

body[data-page="workspace"] .surface:not(.surface-hero), body[data-page="live"] .surface:not(.surface-hero), body[data-page="results"] .surface:not(.surface-hero), body[data-page="library"] .surface:not(.surface-hero) {
  padding: var(--space-4);
  border-color: rgba(125, 148, 195, 0.09);
  background: var(--surface);

}

html[data-theme="light"] body[data-page="workspace"] .surface:not(.surface-hero), html[data-theme="light"] body[data-page="live"] .surface:not(.surface-hero), html[data-theme="light"] body[data-page="results"] .surface:not(.surface-hero), html[data-theme="light"] body[data-page="library"] .surface:not(.surface-hero) {
  background: var(--surface);

}

.metric-card, .route-card, .state-panel-prominent, .saved-card, .log-card, .note-card, .empty-panel, .ws-position-card {
  border: 1px solid rgba(125, 148, 195, 0.1);
  border-radius: var(--tide-radius-md);
  background: var(--tide-system-card-fill);

}

html[data-theme="light"] .metric-card, html[data-theme="light"] .route-card, html[data-theme="light"] .state-panel-prominent, html[data-theme="light"] .saved-card, html[data-theme="light"] .log-card, html[data-theme="light"] .note-card, html[data-theme="light"] .empty-panel, html[data-theme="light"] .ws-position-card {
  background: rgba(255, 255, 255, 0.74);
}

.hero-layout, .results-glance-grid, .ws-summary-grid {
  gap: 0.9rem;
}

.results-glance-grid .metric-card {
  min-height: 7.25rem;
  padding: var(--space-4);
}

.ws-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.ws-filter-btn, .view-pill, .badge {
  border-radius: 999px;
  border: 1px solid rgba(125, 148, 195, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

html[data-theme="light"] .ws-filter-btn, html[data-theme="light"] .view-pill, html[data-theme="light"] .badge {
  background: rgba(13, 26, 48, 0.03);
}

.route-card {
  padding: var(--space-4);
}

.leaderboard-row, .scenario-compare-row, .position-row {
  border-bottom: 1px solid rgba(125, 148, 195, 0.08);
}

.token-chip {
  gap: 0.45rem;
  min-height: 2rem;
  padding: 0.22rem 0.55rem 0.22rem 0.25rem;
  border-radius: 999px;
  border: 1px solid rgba(125, 148, 195, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

html[data-theme="light"] .token-chip {
  background: rgba(13, 26, 48, 0.03);
}

.empty-panel {
  min-height: 9.5rem;
  display: grid;
  place-items: center;
  text-align: center;
}

@media (max-width: 1180px) {
.app-shell {
    grid-template-columns: 13.5rem minmax(0, 1fr);
  }

.page-header h1 {
    font-size: clamp(1.5rem, 1.5vw, 1.9rem);
  }

}

@media (max-width: 980px) {
.app-main {
    padding: 0.85rem 0.95rem 1.25rem;
  }

.surface, .surface-hero {
    border-radius: 1.15rem;
  }

}

#rail-data-panel .route-grid {
  grid-template-columns: 1fr;
}

.route-card {
  padding: 0.22rem 0 0.28rem 0.72rem;
  border: 0;
  border-radius: 0;
  background: transparent;

}

.route-grid .route-card + .route-card {
  margin-top: 0.75rem;
  padding-top: 0.82rem;
  border-top: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
}

.route-card::before {
  top: 0.08rem;
  bottom: 0.08rem;
  width: 2px;
}

.route-card .entity-inline {
  gap: 0.58rem;
}

.route-card .token-row {
  gap: 0.42rem 0.7rem;
  margin-top: 0.55rem;
}

.route-card .token-chip {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  gap: 0.28rem;
}

.route-card .token-chip-label {
  font-size: 0.76rem;
  font-weight: 700;
}

.route-card-head {
  align-items: start;
  gap: 0.75rem;
}

.route-card-head-main {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}

.route-card-why {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-strong);
}

.route-card .route-card-title .entity-copy span {
  font-size: 0.7rem;
}

.route-card .route-role {
  min-height: 1.02rem;
  padding: 0 0.3rem;
  font-size: 0.56rem;
}

.route-card .route-score {
  min-height: 0;
  padding: 0;
  font-size: 0.66rem;
}

.route-card .route-metrics {
  gap: 0.45rem;
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  font-size: 0.73rem;
}

.route-card .route-card-copy {
  margin-top: 0.58rem;
  padding-top: 0.55rem;
  font-size: 0.79rem;
  line-height: 1.5;
  color: var(--muted);
}

body[data-page="workspace"] table, body[data-page="results"] table, body[data-page="live"] table {
  border-collapse: collapse;
  width: 100%;
}

body[data-page="workspace"] table th, body[data-page="workspace"] table td, body[data-page="results"] table th, body[data-page="results"] table td, body[data-page="live"] table th, body[data-page="live"] table td {
  border-left: 0;
  border-right: 0;
  background: transparent;
}

body[data-page="workspace"] table tr, body[data-page="live"] table tr {
  background: transparent;
}

body[data-page="workspace"] table tbody tr, body[data-page="live"] table tbody tr {
  border-top: var(--border-soft);
}

body[data-page="workspace"] table tbody tr:hover, body[data-page="live"] table tbody tr:hover {
  background: var(--surface-soft);
}

body[data-page="workspace"] table th, body[data-page="live"] table th {
  position: sticky;
  top: 0;
  background: var(--surface);
  border-bottom: var(--border-soft);
  z-index: 1;
}

.metric strong, .value, td.value, th.value, [data-num], .figure {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

[data-tooltip] {
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent);
  text-underline-offset: 3px;
  cursor: help;
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  max-width: 220px;
  padding: 6px 10px;
  background: var(--tooltip-bg);
  color: var(--tooltip-text);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1.35;
  border-radius: var(--radius-xs);
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
  z-index: 100;
}

[data-tooltip]:hover::after, [data-tooltip]:focus-visible::after {
  opacity: 1;
}

body[data-page="workspace"] table td, body[data-page="live"] table td, body[data-page="workspace"] table th, body[data-page="live"] table th {
  height: var(--row-h);
  padding: 0 var(--space-4);
}

.guardrails-finetune {
  margin-top: var(--space-3);
  border-top: 1px solid var(--line);
  padding-top: var(--space-2);
}

.guardrails-finetune > summary { cursor: pointer; }

.guardrails-finetune .advanced-drawer__section { border-top: 0; padding-top: var(--space-2); }

.guardrails-substress { display: block; margin-top: var(--space-3); }

@keyframes createSkeletonShimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

@keyframes scenario-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.strategy-preset__modified {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.05rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  opacity: 0.8;
}

.scenario-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sora, inherit);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-xs, 0.72rem);
}

.scenario-compare-table caption {
  caption-side: top;
  text-align: left;
  color: var(--muted);
  font-size: 0.68rem;
  padding: 0 0 var(--space-2);
}

.scenario-compare-table thead th {
  text-align: left;
  font-weight: 600;
  color: var(--muted-strong);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.scenario-compare-table tbody th, .scenario-compare-table tbody td {
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  color: var(--text);
  vertical-align: top;
}

.scenario-compare-table tbody tr:last-child th, .scenario-compare-table tbody tr:last-child td {
  border-bottom: 0;
}

.scenario-compare-table tbody th {
  font-weight: 500;
  text-align: left;
}

.scenario-compare-table tbody th strong {
  display: block;
  font-weight: 600;
  color: var(--text-strong);
  font-size: 0.74rem;
}

.scenario-compare-table tbody th small {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 400;
}

.scenario-compare-table td.is-muted {
  color: var(--muted);
}

.scenario-compare-tag {
  display: inline-block;
  padding: 0.08rem 0.45rem;
  border-radius: var(--radius-xs, 4px);
  font-size: 0.66rem;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
}

.scenario-compare-row.is-skeleton td, .scenario-compare-row.is-skeleton th {
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

.scenario-compare-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.scenario-compare-summary article {
  display: grid;
  gap: 0.18rem;
  padding: 0.72rem 0.8rem;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-soft) 72%, transparent);
}

.scenario-compare-summary span {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.scenario-compare-summary strong {
  font-family: "Sora", sans-serif;
  font-size: 0.92rem;
  color: var(--text-strong);
}

.scenario-compare-footnote {
  margin: 0 0 var(--space-3);
  font-size: 0.74rem;
  color: var(--muted);
}

.scenario-compare-empty {
  display: grid;
  gap: 0.35rem;
  padding: 0.9rem 0;
}

.scenario-compare-empty strong {
  color: var(--text-strong);
}

.scenario-compare-empty p {
  margin: 0;
  color: var(--muted);
}

.scenario-compare-impact {
  display: grid;
  gap: 0.3rem;
}

.scenario-compare-impact strong {
  font-family: "Sora", sans-serif;
  font-size: 0.74rem;
}

.scenario-compare-impact small {
  display: block;
  font-size: 0.64rem;
  color: var(--muted);
  line-height: 1.45;
}

.scenario-compare-impact-bar {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 74%, transparent);
  overflow: hidden;
}

.scenario-compare-impact-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--surface);
}

.scenario-compare-apply {
  margin-top: 0.45rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
}

.scenario-compare-apply:hover {
  color: var(--text-strong);
}

.skeleton-bar {
  display: inline-block;
  height: 0.7rem;
  width: 100%;
  border-radius: var(--radius-xs, 4px);
  background: var(--surface);
  background-size: 200% 100%;
  animation: createSkeletonShimmer 1.8s linear infinite;
}

@media (max-width: 1100px) {
.scenario-compare-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 720px) {
.scenario-compare-summary {
    grid-template-columns: 1fr;
  }

}

.app-shell {
  display: block;
  min-height: 100vh;
}

.sidebar-wallet {
  order: 3;
  flex: 0 1 17rem;
  min-width: 12.5rem;
  margin-left: auto;
  padding: 0;
}

.app-main {
  padding-top: var(--space-5);
}

@media (max-width: 1120px) {

.sidebar-wallet {
    flex: 1 1 auto;
    min-width: 12rem;
    margin-left: 0;
  }

}

@media (max-width: 720px) {

.sidebar-wallet{
    width: auto;
  }

}

.sidebar-wallet {
  order: 4;
  flex: 0 0 auto;
  min-width: 0;
  margin-left: 0;
  padding: 0;
}

.wallet-icon {
  width: 1.95rem;
  height: 1.95rem;
  padding: 0.18rem;
  border-radius: 0.7rem;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

.wallet-address {
  max-width: 12ch;
  font: 600 0.96rem/1.1 var(--ff-display, var(--ff));
  letter-spacing: 0;
}

.wallet-disconnect {
  width: 2rem;
  height: 2rem;
  border: 1px solid transparent;
  color: var(--muted-strong);
}

.wallet-disconnect:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--line-strong) 76%, transparent);
  background: color-mix(in srgb, var(--surface-soft) 70%, transparent);
}

.app-main {
  padding-top: var(--space-4);
}

@media (max-width: 720px) {

.wallet-icon {
    width: 1.75rem;
    height: 1.75rem;
  }

.wallet-address {
    max-width: 8.5ch;
    font-size: 0.88rem;
  }

}

.route-card .token-chip {
  gap: 0.2rem;
}

.button { border-radius: 12px; }

.swap-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  background: color-mix(in srgb, var(--surface-soft) 40%, var(--surface));
}

.swap-stat {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.swap-stat__label {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.swap-stat__inline {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 50%, transparent);
  background: var(--surface);
}

.swap-stat__inline input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: "Sora", ui-sans-serif, system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-strong);
}

.swap-stat__unit {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted-strong);
}

.swap-stat__meta {
  margin: 0;
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.3;
}

@media (max-width: 720px) {
.swap-stats { grid-template-columns: 1fr; }

}

/* >>> 90-runtime-polish.css >>> */
/* =======================================================================
   Runtime polish
   Keeps only shared runtime affordances that should survive across pages.
   Chart and setup-specific surfaces live in their own source files.
   ======================================================================= */

:where(
  a.button,
  button,
  input,
  select,
  textarea,
  summary,
  .strategy-preset
):focus-visible {
  outline: none !important;
  box-shadow: var(--ring) !important;
}

.wallet-pill {
  position: relative;
}

.wallet-pill__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 3.1rem;
  padding: 0.42rem 0.78rem;
  border: 1px solid color-mix(in srgb, var(--line-strong) 82%, transparent);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  color: var(--text-strong);
}

.wallet-pill__main {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.wallet-pill__icon,
.wallet-pill__icon--fallback {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  flex: 0 0 1.7rem;
}

.wallet-pill__icon--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--accent-soft) 84%, transparent);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
}

.wallet-pill__chevron {
  width: 0.92rem;
  height: 0.92rem;
  flex: 0 0 0.92rem;
}

.wallet-popover {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  min-width: 13rem;
  padding: 0.35rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--line-strong) 82%, transparent);
  background: color-mix(in srgb, var(--surface-strong) 96%, transparent);
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 0.18rem;
  z-index: 80;
}

.wallet-popover[hidden] {
  display: none;
}

.wallet-popover__action {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 2.4rem;
  padding: 0.5rem 0.72rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-strong);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.wallet-popover__action:hover {
  background: color-mix(in srgb, var(--accent-soft) 76%, transparent);
}

.wallet-popover__action--danger:hover {
  background: color-mix(in srgb, var(--rose-soft) 80%, transparent);
  color: var(--rose);
}

.surface-placeholder {
  display: grid;
  gap: 0.45rem;
  min-height: 10rem;
  align-content: center;
  padding: 1rem;
  border-radius: 18px;
  border: 1px dashed color-mix(in srgb, var(--line-strong) 78%, transparent);
  background: color-mix(in srgb, var(--surface-soft) 74%, transparent);
}

.surface-placeholder__eyebrow {
  font-size: var(--fs-2xs);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-strong);
}

.surface-placeholder strong {
  font-size: 1rem;
  color: var(--text-strong);
}

.surface-placeholder p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.scenario-workbench-host:empty,
#results-market-forecast:empty,
#library-leaderboard:empty {
  position: relative;
  min-height: 11rem;
}

.scenario-workbench-host:empty::before,
#results-market-forecast:empty::before,
#library-leaderboard:empty::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background:
    linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--line) 28%, transparent) 12%, transparent 24%) 0 0 / 220% 100%,
    linear-gradient(var(--surface-soft), var(--surface-soft)) 1rem 1rem / 32% 0.8rem no-repeat,
    linear-gradient(var(--surface-soft), var(--surface-soft)) 1rem 2.6rem / 68% 0.7rem no-repeat,
    linear-gradient(var(--surface-soft), var(--surface-soft)) 1rem 4.1rem / calc(100% - 2rem) 7rem no-repeat;
  animation: createSkeletonShimmer 1.8s linear infinite;
}
