/* =======================================================================
   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);
}

/* >>> 30-scenario-chart.css >>> */
/* Guardrails chart — crisp, composer-aligned styling */

.guardrails-chart {
  display: grid;
  gap: 0.6rem;
  --chart-mint: #22e07c;
  --chart-amber: #ff9a2e;
  --chart-rose: #ff3b4d;
  --chart-accent: #3da9ff;
  --guardrails-surface-start: #0a1428;
  --guardrails-surface-end: #0b1120;
  --guardrails-surface-glow: rgba(27, 88, 207, 0.14);
  --guardrails-surface-border: color-mix(in srgb, var(--line, #2a2f3a) 72%, transparent);
  --guardrails-surface-inset: rgba(255, 255, 255, 0.02);
  --guardrails-grid: rgba(255, 255, 255, 0.06);
  --guardrails-axis-text: rgba(230, 236, 245, 0.42);
  --guardrails-legend-text: rgba(230, 236, 245, 0.55);
  --guardrails-area-blue-top: rgba(27, 88, 207, 0.42);
  --guardrails-area-blue-bottom: rgba(27, 88, 207, 0.02);
  --guardrails-area-amber-top: rgba(255, 154, 46, 0.32);
  --guardrails-area-amber-bottom: rgba(255, 154, 46, 0.01);
  --guardrails-stress-fill: rgba(255, 80, 80, 0.06);
  --guardrails-stress-line-strong: rgba(255, 120, 100, 0.28);
  --guardrails-stress-line-soft: rgba(255, 120, 100, 0.18);
  --guardrails-stress-text: rgba(255, 150, 130, 0.7);
  --guardrails-stress-swatch: rgba(255, 80, 80, 0.25);
  --guardrails-pill-text: #0b1120;
}

html[data-theme="light"] .guardrails-chart {
  --chart-mint: #16a34a;
  --chart-amber: #d97706;
  --chart-rose: #dc2626;
  --chart-accent: #1b58cf;
  --guardrails-surface-start: #f6f9ff;
  --guardrails-surface-end: #edf2fb;
  --guardrails-surface-glow: rgba(27, 88, 207, 0.08);
  --guardrails-surface-border: rgba(15, 31, 55, 0.14);
  --guardrails-surface-inset: rgba(255, 255, 255, 0.6);
  --guardrails-grid: rgba(15, 31, 55, 0.08);
  --guardrails-axis-text: rgba(15, 31, 55, 0.55);
  --guardrails-legend-text: rgba(15, 31, 55, 0.62);
  --guardrails-area-blue-top: rgba(27, 88, 207, 0.22);
  --guardrails-area-blue-bottom: rgba(27, 88, 207, 0.02);
  --guardrails-area-amber-top: rgba(217, 119, 6, 0.22);
  --guardrails-area-amber-bottom: rgba(217, 119, 6, 0.01);
  --guardrails-stress-fill: rgba(220, 38, 38, 0.08);
  --guardrails-stress-line-strong: rgba(220, 38, 38, 0.42);
  --guardrails-stress-line-soft: rgba(220, 38, 38, 0.26);
  --guardrails-stress-text: rgba(185, 28, 28, 0.78);
  --guardrails-stress-swatch: rgba(220, 38, 38, 0.32);
  --guardrails-pill-text: #0b1120;
}
.guardrails-chart__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.guardrails-chart__chips {
  display: inline-flex;
  gap: 0;
  flex-wrap: nowrap;
  padding: 2px;
  border: 1px solid var(--line,#2a2f3a);
  border-radius: 10px;
  background: var(--bg-strong,#10141c);
}
.guardrails-chart__chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 0.32rem 0.7rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted,#7a8190);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
  line-height: 1.1;
  min-height: 2.1rem;
  transition: color 120ms ease, background-color 120ms ease;
}
.guardrails-chart__chip:hover { color: var(--text-strong,#e6ecf5); }
.guardrails-chart__chip.is-active {
  background: var(--surface,#0f131b);
  color: var(--text-strong,#e6ecf5);
  box-shadow: inset 0 0 0 1px var(--line,#2a2f3a);
}
.guardrails-chart__chip-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.guardrails-chart__chip-sub {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.62;
  font-variant-numeric: tabular-nums;
}
.guardrails-chart__chip.is-active .guardrails-chart__chip-sub { opacity: 0.82; }
.guardrails-chart__chips--period .guardrails-chart__chip {
  min-width: 2.8rem;
  font-variant-numeric: tabular-nums;
}

.guardrails-chart__svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--guardrails-surface-border);
  background:
    radial-gradient(140% 90% at 50% -10%, var(--guardrails-surface-glow), transparent 60%),
    linear-gradient(180deg, var(--guardrails-surface-start) 0%, var(--guardrails-surface-end) 100%);
  box-shadow: inset 0 1px 0 var(--guardrails-surface-inset);
}

.guardrails-chart__stress text {
  text-transform: uppercase;
  font-family: "Sora", "Manrope", sans-serif;
}

.guardrails-chart__zone { fill: rgba(120, 140, 180, 0.09); }
.guardrails-chart__zone--mint  { fill: color-mix(in srgb, var(--chart-mint, #22e07c) 14%, transparent); }
.guardrails-chart__zone--amber { fill: color-mix(in srgb, var(--chart-amber, #ff9a2e) 14%, transparent); }
.guardrails-chart__zone--rose  { fill: color-mix(in srgb, var(--chart-rose, #ff3b4d) 16%, transparent); }
html[data-theme="light"] .guardrails-chart__zone--mint  { fill: color-mix(in srgb, var(--chart-mint) 11%, transparent); }
html[data-theme="light"] .guardrails-chart__zone--amber { fill: color-mix(in srgb, var(--chart-amber) 11%, transparent); }
html[data-theme="light"] .guardrails-chart__zone--rose  { fill: color-mix(in srgb, var(--chart-rose) 12%, transparent); }

[data-guardrail-threshold] { cursor: ns-resize; pointer-events: all; touch-action: none; }
[data-guardrail-threshold] .guardrails-chart__handle {
  transition: filter 120ms ease;
}
[data-guardrail-threshold]:hover .guardrails-chart__handle { filter: brightness(1.12); }
.guardrails-chart__handle { pointer-events: all; }
.guardrails-chart__handle-text { pointer-events: none; }
.guardrails-chart__cross { pointer-events: none; }
[data-guardrail-threshold] text { pointer-events: none; }

/* LTV strip under chart */
.guardrails-chart__strip {
  --strip-row-h: 22px;
  --strip-rows: 1;
  position: relative;
  /* 6px track + 4px top gap + N rows of thumbs + 16px axis gutter */
  height: calc(6px + 4px + var(--strip-rows) * var(--strip-row-h) + 16px);
  padding-top: 16px;
  user-select: none;
  touch-action: none;
}
.guardrails-chart__strip-track {
  position: relative;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--bg-strong,#10141c);
  border: 1px solid var(--line,#2a2f3a);
}
.guardrails-chart__strip-zone { position: absolute; top: 0; bottom: 0; }
.guardrails-chart__strip-zone--mint { background: color-mix(in srgb, var(--chart-mint,#22e07c) 65%, transparent); }
.guardrails-chart__strip-zone--amber { background: color-mix(in srgb, var(--chart-amber,#ff9a2e) 65%, transparent); }
.guardrails-chart__strip-zone--rose { background: color-mix(in srgb, var(--chart-rose,#ff3b4d) 65%, transparent); }
.guardrails-chart__strip-now {
  position: absolute;
  top: 12px;
  bottom: 16px;
  width: 2px;
  margin-left: -1px;
  background: var(--chart-accent,#3da9ff);
  pointer-events: none;
}
.guardrails-chart__strip-thumb {
  --strip-row: 0;
  position: absolute;
  top: calc(4px + var(--strip-row) * var(--strip-row-h, 22px));
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border: 0;
  border-radius: 4px;
  background: currentColor;
  color: var(--chart-mint,#22e07c);
  font: inherit;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: ew-resize;
  white-space: nowrap;
  pointer-events: auto;
  touch-action: none;
  z-index: 5;
  user-select: none;
  -webkit-user-select: none;
  height: 20px;
  min-width: 44px;
  justify-content: center;
  transition: filter 120ms ease;
}
.guardrails-chart__strip-thumb:hover { filter: brightness(1.12); z-index: 1000; }
.guardrails-chart__strip-thumb:active { cursor: grabbing; filter: brightness(0.94); z-index: 1000; }
.guardrails-chart__strip-thumb--mint { color: var(--chart-mint,#22e07c); }
.guardrails-chart__strip-thumb--amber { color: var(--chart-amber,#ff9a2e); }
.guardrails-chart__strip-thumb--rose { color: var(--chart-rose,#ff3b4d); }
.guardrails-chart__strip-label,
.guardrails-chart__strip-pct {
  color: var(--guardrails-pill-text);
}
.guardrails-chart__strip-label { font-size: 8px; opacity: 0.78; }
.guardrails-chart__strip-pct { font-size: 10px; font-variant-numeric: tabular-nums; }
.guardrails-chart__strip-axis {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--muted,#7a8190);
  pointer-events: none;
}
.guardrails-chart__note {
  margin: 0;
  padding-top: 0.2rem;
  font-size: 0.72rem;
  color: var(--muted,#7a8190);
}
.guardrails-chart__stale {
  color: var(--warn,#f5b544);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Finetune grid */
.guardrails-finetune__grid {
  display: grid !important;
  gap: 0.85rem !important;
}
.guardrails-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 0.8rem !important;
}
.toggle-stack {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 0.8rem !important;
}
@media (max-width: 1180px) {
  .guardrails-grid,
  .toggle-stack {
    grid-template-columns: 1fr !important;
  }
}

/* >>> 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;
}
