:root {
  --black: #030000;
  --ink: #0a0303;
  --panel: #140606;
  --panel-2: #1e0808;
  --red: #ff1f2d;
  --red-dark: #8d000b;
  --red-hot: #ff4b35;
  --green: #19d66b;
  --green-dark: #087d3d;
  --green-soft: rgba(25, 214, 107, 0.18);
  --white: #fff7f7;
  --muted: #c99a9a;
  --line: rgba(255, 255, 255, 0.16);
  --shadow: 0 28px 90px rgba(255, 31, 45, 0.25), 0 10px 34px rgba(0, 0, 0, 0.58);
  --shadow-cta: 0 14px 34px rgba(255, 31, 45, 0.28);
  --shadow-stbl: 0 22px 56px rgba(25, 214, 107, 0.35), 0 6px 16px rgba(25, 214, 107, 0.22);
  --surface-gradient: linear-gradient(180deg, rgba(30, 8, 8, 0.96), rgba(8, 2, 2, 0.98));
  --surface-hot: linear-gradient(180deg, rgba(70, 0, 8, 0.92), rgba(8, 2, 2, 0.98));
  --bg-glow:
    linear-gradient(180deg, rgba(255, 31, 45, 0.16), transparent 380px),
    linear-gradient(115deg, rgba(25, 214, 107, 0.09), transparent 38%),
    var(--black);
  --h1-shadow:
    0 0 22px rgba(255, 31, 45, 0.42),
    2px 2px 0 rgba(255, 31, 45, 0.65);
  --inset: rgba(255, 255, 255, 0.06);
  --inset-line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.26);
  --surface-deep: #050101;
  --chart-grid-red: rgba(255, 31, 45, 0.16);
  --chart-grid-ink: rgba(255, 255, 255, 0.08);
  --red-ink: var(--red);
  --green-ink: var(--green);
  --chart-grid:
    linear-gradient(90deg, var(--chart-grid-red) 1px, transparent 1px),
    linear-gradient(180deg, var(--chart-grid-ink) 1px, transparent 1px),
    var(--ink);
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, monospace;
}

/* Instability domain — same components, dark canvas pushed harder into red.
   The default theme is already red-on-black; the instability theme deepens
   the panel surfaces, increases the red glow, and dials green toward muted
   so the "chaos" side reads visually distinct from the neutral pmf.finance
   prototype. */
:root[data-domain="instability"],
[data-domain="instability"] {
  --black: #050000;
  --ink: #160404;
  --panel: #1c0606;
  --panel-2: #270808;
  --red: #ff2a39;
  --red-hot: #ff5a3c;
  --red-dark: #6a0008;
  --green: #0fa852;
  --green-dark: #045a2b;
  --green-soft: rgba(15, 168, 82, 0.12);
  --line: rgba(255, 80, 90, 0.22);
  --line-strong: rgba(255, 80, 90, 0.42);
  --shadow:
    0 30px 96px rgba(255, 31, 45, 0.4),
    0 12px 36px rgba(0, 0, 0, 0.7);
  --shadow-cta: 0 18px 38px rgba(255, 31, 45, 0.42);
  --h1-shadow:
    0 0 26px rgba(255, 31, 45, 0.6),
    3px 3px 0 rgba(255, 31, 45, 0.78);
  --bg-glow:
    radial-gradient(110% 78% at 50% -10%, rgba(255, 31, 45, 0.28), transparent 60%),
    linear-gradient(115deg, rgba(255, 80, 90, 0.1), transparent 38%),
    var(--black);
  --surface-gradient: linear-gradient(180deg, rgba(40, 8, 8, 0.96), rgba(10, 2, 2, 0.98));
  --surface-hot: linear-gradient(180deg, rgba(96, 0, 12, 0.94), rgba(10, 2, 2, 0.98));
  --chart-grid-red: rgba(255, 31, 45, 0.22);
}

/* Stability domain — same components, warm bone canvas, no glow / drop-shadows.
   Duality (red vs green) stays at full strength; accent-as-text deepens to
   --red-ink / --green-ink for legibility on paper. */
:root[data-domain="stability"],
[data-domain="stability"] {
  --black: #f3ecde;
  --ink: #e8dcc6;
  --panel: #fbf5ea;
  --panel-2: #fffaf1;
  --red-hot: #d63a1d;
  --green-dark: #0c8f47;
  --green-soft: rgba(15, 140, 70, 0.15);
  --red-ink: #cf0a18;
  --green-ink: #0b8f46;
  --white: #241410;
  --muted: #8a6f60;
  --line: rgba(54, 28, 18, 0.16);
  --shadow: none;
  --shadow-cta: none;
  --shadow-stbl: none;
  --h1-shadow: none;
  --bg-glow:
    radial-gradient(120% 78% at 80% -12%, rgba(255, 178, 120, 0.34), transparent 62%),
    var(--black);
  --surface-gradient: linear-gradient(180deg, #fffaf1, #f7efe1);
  --surface-hot: linear-gradient(180deg, #fdeeeb, #f9f1e7);
  --inset: rgba(54, 28, 18, 0.05);
  --inset-line: rgba(54, 28, 18, 0.12);
  --line-strong: rgba(54, 28, 18, 0.28);
  --surface-deep: #ece1ce;
  --chart-grid-red: rgba(207, 10, 24, 0.12);
  --chart-grid-ink: rgba(54, 28, 18, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--black);
  color: var(--white);
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-glow);
  color: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.sheet-open {
  overflow: hidden;
}

button,
input {
  border-radius: 8px;
  font: inherit;
}

button {
  min-height: 48px;
  cursor: pointer;
  transition: transform 120ms ease, filter 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
  -webkit-tap-highlight-color: transparent;
}

button:hover {
  filter: brightness(1.06);
}

button:active {
  transform: translateY(1px) scale(0.99);
}

button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.45);
  opacity: 0.48;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 2px;
}

h1,
h2,
p,
dl,
ol {
  margin: 0;
}

.app-shell {
  width: min(100%, 980px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 14px calc(104px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 31, 45, 0.42);
  background: var(--black);
  box-shadow: var(--shadow);
}

.topbar h1 {
  color: var(--white);
  font-size: clamp(1.15rem, 4vw, 1.55rem);
  font-weight: 950;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.eyebrow {
  display: block;
  color: var(--red-hot);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.mono-line {
  font-family: var(--mono);
}

.main-flow {
  display: grid;
  gap: 14px;
}

.main-flow > *,
.hero,
.hero > *,
.winner-board,
.wallet-panel {
  min-width: 0;
  max-width: 100%;
}

.wallet-panel,
.hero-product,
.metric,
.nav-panel,
.monitor,
.positions-panel,
.activity,
.action-sheet {
  border: 1px solid var(--line);
  background: var(--surface-gradient);
  box-shadow: var(--shadow);
}

.action-sheet {
  color: var(--white);
}

.wallet-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 112px;
  padding: 12px;
  border-color: rgba(255, 31, 45, 0.34);
}

.wallet-panel h2,
.nav-panel h2,
.monitor h2,
.positions-panel h2,
.activity h2,
.sheet-head h2 {
  color: var(--white);
  margin-top: 4px;
  font-size: clamp(1.25rem, 5vw, 1.72rem);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.wallet-actions {
  display: grid;
  gap: 8px;
  min-width: 128px;
}

.primary-button,
.secondary-button,
.icon-button,
.switch-button,
.segment {
  font-weight: 950;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.primary-button {
  border: 0;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #001f0d;
  box-shadow: var(--shadow-stbl);
  padding: 0 16px;
}

.secondary-button {
  border: 1px solid rgba(255, 31, 45, 0.46);
  background: rgba(255, 31, 45, 0.12);
  color: var(--white);
  padding: 0 16px;
}

.small-button {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.72rem;
}

.icon-button {
  width: 48px;
  min-width: 48px;
  padding: 0;
  border: 1px solid var(--inset-line);
  background: var(--inset);
  color: var(--white);
  font-size: 1rem;
}

.health-strip {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.metric,
.monitor-list div,
.quote-list div,
.timeline-list li {
  background: var(--inset);
  border: 1px solid var(--inset-line);
}

.health-strip div {
  min-height: 54px;
  padding: 0;
}

.health-strip dt,
.health-strip dd {
  margin: 0;
}

.health-strip dt,
.metric span,
.monitor-list dt,
.quote-list dt,
.positions-head,
.position-row > span,
.timeline-list span {
  color: var(--muted);
  display: block;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.health-strip dd {
  color: var(--white);
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 900;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.health-strip dd.is-error {
  color: var(--red);
}

.switcher,
.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.switch-button,
.segment {
  min-width: 0;
  border: 1px solid var(--inset-line);
  background: var(--inset);
  color: var(--muted);
  padding: 10px 12px;
  text-align: left;
}

.switch-button span {
  display: block;
  color: var(--white);
  font-family: var(--mono);
  font-size: clamp(1.15rem, 5vw, 1.55rem);
  font-weight: 950;
  line-height: 1;
}

.switch-button small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  margin-top: 5px;
  text-transform: uppercase;
}

.switch-button.is-active,
.segment.is-active {
  border-color: var(--red);
  background: rgba(255, 31, 45, 0.24);
  color: var(--white);
  box-shadow: 0 0 28px rgba(255, 31, 45, 0.18);
}

.switch-button.is-active:first-child {
  border-color: rgba(25, 214, 107, 0.56);
  background: rgba(25, 214, 107, 0.14);
}

.switch-button.is-unavailable:not(.is-active) {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.hero-product {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 14px;
  min-height: 238px;
  padding: 16px;
  border-color: rgba(255, 31, 45, 0.42);
  background: var(--chart-grid);
  background-size: 28px 100%, 100% 26px;
  overflow: hidden;
  position: relative;
}

.hero-product::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 31, 45, 0.22), transparent 72%);
  pointer-events: none;
}

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

.hero-copy {
  align-self: end;
  min-width: 0;
}

.hero-product h2 {
  margin-top: 8px;
  color: var(--white);
  font-family: var(--mono);
  font-size: clamp(4rem, 20vw, 7.5rem);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 0.82;
  text-shadow: var(--h1-shadow);
  text-transform: uppercase;
}

.hero-product p:not(.eyebrow) {
  max-width: 38ch;
  color: var(--muted);
  font-size: clamp(0.92rem, 3.7vw, 1.06rem);
  font-weight: 760;
  line-height: 1.45;
  margin-top: 10px;
}

.hero-art {
  align-self: center;
  aspect-ratio: 1;
  border: 1px solid var(--inset-line);
  background: var(--surface-deep);
  min-width: 0;
  overflow: hidden;
}

.hero-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.metric {
  min-height: 108px;
  padding: 10px;
  border-color: var(--inset-line);
}

.metric strong {
  color: var(--white);
  display: block;
  font-family: var(--mono);
  font-size: clamp(1.05rem, 5.8vw, 1.72rem);
  line-height: 1;
  margin-top: 14px;
  overflow-wrap: anywhere;
}

.monitor,
.nav-panel,
.positions-panel,
.activity {
  padding: 14px;
}

.section-head,
.sheet-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.nav-range {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  min-width: min(100%, 250px);
}

.nav-range button {
  min-height: 34px;
  border: 1px solid var(--inset-line);
  background: var(--inset);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.06em;
  padding: 0 8px;
}

.nav-range button.is-active {
  border-color: rgba(25, 214, 107, 0.56);
  background: rgba(25, 214, 107, 0.14);
  color: var(--green);
}

.nav-chart {
  display: grid;
  min-height: 238px;
  margin-top: 14px;
  border: 1px solid var(--inset-line);
  background: var(--surface-deep);
  overflow: hidden;
}

.nav-chart svg {
  display: block;
  width: 100%;
  height: 238px;
}

.dual-nav-grid,
.dual-holdings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.nav-card,
.holdings-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--inset-line);
  background: var(--inset);
}

.nav-card.is-stability,
.holdings-card.is-stability {
  border-color: rgba(25, 214, 107, 0.32);
}

.nav-card.is-chaos,
.holdings-card.is-chaos {
  border-color: rgba(255, 31, 45, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 31, 45, 0.08), transparent 42%),
    var(--inset);
}

.fund-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.fund-panel-head h3 {
  margin-top: 4px;
  color: var(--white);
  font-size: clamp(1.55rem, 7vw, 2.3rem);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 0.95;
  text-transform: uppercase;
}

.fund-panel-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.nav-card .nav-chart {
  min-height: 210px;
}

.nav-card .nav-chart svg {
  height: 210px;
}

.nav-line,
.nav-current,
.nav-anchor {
  stroke: var(--green);
}

.nav-area {
  fill: rgba(25, 214, 107, 0.16);
}

.nav-svg.is-chaos .nav-line,
.nav-svg.is-chaos .nav-current,
.nav-svg.is-chaos .nav-anchor {
  stroke: var(--red);
}

.nav-svg.is-chaos .nav-area {
  fill: rgba(255, 31, 45, 0.18);
}

.nav-line {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-baseline {
  stroke: var(--line-strong);
  stroke-width: 2;
}

.nav-current,
.nav-anchor {
  fill: var(--surface-deep);
  stroke-width: 3;
}

.nav-label {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 850;
}

.chart-empty {
  align-self: center;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  justify-self: center;
  padding: 18px;
  text-align: center;
}

.chart-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: space-between;
  margin-top: 10px;
}

.chart-meta span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.monitor-list,
.quote-list {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
}

.monitor-list {
  grid-template-columns: minmax(0, 1fr);
}

.monitor-list div,
.quote-list div {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 10px;
}

.monitor-list dd,
.quote-list dd {
  color: var(--white);
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 900;
  margin: 0;
  max-width: 62%;
  overflow-wrap: anywhere;
  text-align: right;
}

.positions-table {
  margin-top: 14px;
  overflow-x: auto;
}

.positions-head,
.position-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.9fr) minmax(78px, 0.6fr) minmax(82px, 0.6fr) minmax(104px, 0.75fr);
  min-width: 640px;
}

.positions-head {
  gap: 10px;
  padding: 0 10px 8px;
}

.position-row {
  align-items: center;
  gap: 10px;
  min-height: 72px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--inset-line);
  background: var(--inset);
}

.position-row.has-position {
  border-color: rgba(25, 214, 107, 0.36);
  background: rgba(25, 214, 107, 0.09);
}

.position-row.cash-position {
  border-color: var(--line-strong);
  background: var(--inset);
}

.position-market {
  min-width: 0;
}

.position-market strong {
  display: block;
  color: var(--white);
  font-size: 0.92rem;
  font-weight: 850;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.position-market small {
  color: var(--muted);
  display: block;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 760;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.position-row > span {
  color: var(--white);
  font-family: var(--mono);
  overflow-wrap: anywhere;
}

.position-empty {
  min-height: 64px;
  padding: 14px;
  border: 1px solid var(--inset-line);
  background: var(--inset);
  color: var(--muted);
  font-weight: 760;
}

.activity-log {
  background: var(--inset);
  border: 1px solid var(--inset-line);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 760;
  line-height: 1.45;
  margin-top: 12px;
  min-height: 54px;
  overflow-wrap: anywhere;
  padding: 10px;
}

.timeline-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin-top: 10px;
  padding: 0;
}

.timeline-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
}

.timeline-list strong {
  color: var(--white);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.timeline-list small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.76rem;
  overflow-wrap: anywhere;
  text-align: right;
}

.bottom-bar {
  align-items: center;
  background: color-mix(in srgb, var(--black) 90%, transparent);
  border-top: 1px solid rgba(255, 31, 45, 0.36);
  bottom: 0;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1.2fr;
  left: 50%;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  position: fixed;
  transform: translateX(-50%);
  width: min(100%, 980px);
  z-index: 20;
  backdrop-filter: blur(16px);
}

.sheet-backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
  inset: 0;
  position: fixed;
  z-index: 50;
}

.action-sheet {
  border-width: 1px 1px 0;
  border-color: rgba(255, 31, 45, 0.42);
  bottom: 0;
  display: grid;
  gap: 14px;
  left: 50%;
  max-height: min(92svh, 820px);
  overflow: auto;
  padding: 10px 14px calc(18px + env(safe-area-inset-bottom));
  position: fixed;
  transform: translateX(-50%);
  width: min(100%, 760px);
  z-index: 60;
}

.sheet-handle {
  background: var(--line-strong);
  height: 5px;
  justify-self: center;
  margin-bottom: 2px;
  width: 46px;
}

.ticket-form {
  display: grid;
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field input {
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--inset-line);
  background: var(--surface-deep);
  color: var(--white);
  font-family: var(--mono);
  font-size: 1.45rem;
  font-weight: 900;
  padding: 0 12px;
}

.quote-list {
  background: var(--surface-deep);
  border: 1px solid var(--inset-line);
  gap: 0;
  padding: 12px;
}

.quote-list div {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--inset-line);
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  padding: 9px 0;
}

.quote-list dd {
  max-width: 100%;
  text-align: right;
}

.quote-list div:last-child {
  border-bottom: 0;
}

.full {
  width: 100%;
}

.hidden {
  display: none !important;
}

@media (min-width: 760px) {
  .app-shell {
    padding-inline: 22px;
  }

  .hero-product {
    grid-template-columns: minmax(0, 1fr) 180px;
    align-items: stretch;
  }

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

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

  .monitor-list div {
    display: grid;
    align-content: space-between;
  }

  .monitor-list dd {
    margin-top: 8px;
    max-width: 100%;
    text-align: left;
  }
}

@media (max-width: 620px) {
  .wallet-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .wallet-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
  }

  .health-strip {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-product {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-art {
    display: none;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-range {
    min-width: 0;
  }

  .monitor-list dd,
  .quote-list dd {
    max-width: 100%;
  }

  .quote-list div {
    grid-template-columns: minmax(0, 1fr);
  }

  .quote-list dd {
    text-align: left;
  }

  .timeline-list li {
    grid-template-columns: minmax(0, 1fr);
  }

  .timeline-list small {
    text-align: left;
  }
}

/* ------------------------------------------------------------------
   Reality Trade UX refresh
   ------------------------------------------------------------------ */

h3 {
  margin: 0;
}

.debug-only {
  display: none !important;
}

body.debug-enabled .debug-only {
  display: revert !important;
}

body.debug-enabled .monitor.debug-only,
body.debug-enabled .activity.debug-only {
  display: block !important;
}

body.debug-enabled .health-strip.debug-only,
body.debug-enabled .chart-meta.debug-only {
  display: grid !important;
}

body.debug-enabled .chart-meta.debug-only {
  display: flex !important;
}

body.debug-enabled .metric.debug-only {
  display: block !important;
}

body.debug-enabled .quote-list div.debug-only {
  display: flex !important;
}

.utility-image {
  display: none;
}

.topbar {
  border-inline-color: transparent;
  background: var(--black);
}

.brand-lockup,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 31, 45, 0.56);
  background: var(--red);
  color: #000;
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 950;
}

.debug-toggle {
  min-height: 42px;
  border: 1px solid var(--inset-line);
  background: var(--inset);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  padding: 0 10px;
  text-transform: uppercase;
}

.debug-toggle.is-active {
  border-color: rgba(25, 214, 107, 0.56);
  background: rgba(25, 214, 107, 0.14);
  color: var(--green);
}

.hero {
  display: grid;
  gap: 18px;
  min-height: min(640px, 78svh);
  align-content: center;
  position: relative;
  padding: 16px 0 28px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 12% -22px auto;
  height: 52%;
  border: 1px solid rgba(255, 31, 45, 0.34);
  background:
    linear-gradient(90deg, var(--chart-grid-red) 1px, transparent 1px),
    linear-gradient(180deg, var(--chart-grid-ink) 1px, transparent 1px);
  background-size: 28px 100%, 100% 26px;
  box-shadow: 0 0 80px rgba(255, 31, 45, 0.16);
  mask-image: linear-gradient(180deg, transparent, black 12%, black 76%, transparent);
  pointer-events: none;
}

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

.hero .hero-copy {
  align-self: auto;
  padding: 22px 2px 4px;
}

.hero h2 {
  max-width: 10ch;
  margin-top: 8px;
  color: var(--white);
  font-size: clamp(3.05rem, 14vw, 4.9rem);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 0.82;
  text-shadow: var(--h1-shadow);
  text-transform: uppercase;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.hero-subcopy {
  max-width: 35ch;
  margin-top: 18px;
  color: var(--muted);
  font-size: clamp(0.98rem, 4.2vw, 1.06rem);
  font-weight: 720;
  line-height: 1.48;
}

.winner-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 74px;
  border: 1px solid rgba(25, 214, 107, 0.55);
  background:
    linear-gradient(90deg, rgba(25, 214, 107, 0.2), transparent 62%),
    #000;
  box-shadow: 0 18px 48px rgba(25, 214, 107, 0.22), 0 10px 34px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.winner-board.is-chaos {
  border-color: rgba(255, 31, 45, 0.62);
  background:
    linear-gradient(90deg, rgba(255, 31, 45, 0.24), transparent 62%),
    #000;
  box-shadow: 0 18px 48px rgba(255, 31, 45, 0.26), 0 10px 34px rgba(0, 0, 0, 0.55);
}

.winner-board div {
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #001f0d;
}

.winner-board.is-chaos div {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff7f7;
}

.winner-board span {
  color: currentColor;
  font-size: 0.62rem;
  font-weight: 950;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.winner-board strong {
  color: currentColor;
  font-family: var(--mono);
  font-size: 1.9rem;
  font-weight: 950;
  line-height: 0.9;
}

.winner-board p {
  align-self: center;
  min-width: 0;
  padding: 12px 14px;
  /* Hardcoded pinky-white — the winner-board is a vivid collectible artifact
     that keeps its dark background in both domains, so its text must stay
     light regardless of --white re-theming. */
  color: #fff7f7;
  font-size: clamp(0.82rem, 3.2vw, 0.96rem);
  font-weight: 850;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hero-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.stability-cta,
.stability-buy {
  border-color: rgba(120, 255, 170, 0.6);
  background: linear-gradient(135deg, #3dff8a 0%, var(--green) 40%, #066d34 100%);
  color: #001f0d;
  box-shadow:
    var(--shadow-stbl),
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    inset 0 -2px 0 rgba(0, 40, 16, 0.45);
}

.chaos-cta {
  border-color: rgba(255, 31, 45, 0.74);
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff7f7;
  box-shadow:
    var(--shadow-cta),
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -2px 0 rgba(80, 0, 8, 0.52);
}

.wallet-panel {
  position: relative;
  grid-template-columns: minmax(0, 1fr) auto;
  border-color: rgba(255, 31, 45, 0.36);
}

.debug-meta {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.swipe-zone {
  margin-top: 4px;
}

.index-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid rgba(255, 31, 45, 0.48);
  background: rgba(255, 31, 45, 0.12);
  color: var(--white);
  padding: 0 13px;
  font-size: 0.82rem;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.index-link:hover {
  border-color: rgba(255, 31, 45, 0.72);
  background: rgba(255, 31, 45, 0.2);
}

.index-link svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.fund-carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(300px, 88%);
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 2px 7vw 10px 0;
}

.fund-carousel::-webkit-scrollbar {
  display: none;
}

.fund-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto minmax(4.6rem, auto) auto auto 52px;
  gap: 14px;
  min-height: 620px;
  scroll-snap-align: center;
  padding: 12px;
  border: 2px solid rgba(255, 31, 45, 0.34);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 4px),
    var(--surface-gradient);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 24px 70px rgba(255, 31, 45, 0.24),
    0 12px 34px rgba(0, 0, 0, 0.52);
  overflow: hidden;
}

.fund-card.is-active {
  outline: 2px solid var(--white);
  outline-offset: -6px;
}

.fund-card.is-unavailable {
  filter: grayscale(0.38);
  opacity: 0.62;
}

.stbl-card {
  border-color: rgba(25, 214, 107, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 24px 70px rgba(25, 214, 107, 0.14),
    0 12px 34px rgba(0, 0, 0, 0.52);
}

.chao-card {
  border-color: rgba(255, 31, 45, 0.55);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 4px),
    var(--surface-hot);
}

.meme-frame {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border: 2px solid #000;
  background: #fff;
  overflow: hidden;
}

.meme-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.invert-frame {
  background: #000;
  border-color: rgba(255, 255, 255, 0.2);
}

.fund-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.fund-symbol {
  color: var(--red-ink);
  font-family: var(--mono);
  font-size: 2.05rem;
  font-weight: 950;
}

.fund-mood {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.fund-mood {
  max-width: 44%;
  overflow-wrap: anywhere;
  text-align: right;
}

.fund-card h3 {
  font-size: clamp(2.3rem, 11vw, 4.2rem);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 0.92;
  text-transform: uppercase;
}

.fund-thesis {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 720;
  line-height: 1.35;
}

.fund-nav-line {
  margin: 0;
  color: var(--white);
  font-family: var(--mono);
  font-size: clamp(1rem, 4.8vw, 1.28rem);
  font-weight: 900;
  line-height: 1;
  overflow-wrap: anywhere;
}

.card-buy {
  width: 100%;
  border: 0;
  color: var(--white);
  font-weight: 950;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.card-buy.danger {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  box-shadow: var(--shadow);
}

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

body.debug-enabled .metrics-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.basket-copy {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 760;
  line-height: 1.45;
}

.vault-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.vault-summary article {
  min-width: 0;
  min-height: 82px;
  padding: 10px;
  border: 1px solid var(--inset-line);
  background: var(--inset);
}

.vault-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.vault-summary strong {
  display: block;
  margin-top: 12px;
  color: var(--white);
  font-family: var(--mono);
  font-size: clamp(0.98rem, 3.8vw, 1.18rem);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.holdings-card .vault-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.holdings-card .position-empty {
  margin-top: 12px;
}

.holdings-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.holdings-controls .small-button {
  min-width: 132px;
}

.positions-head,
.position-row {
  grid-template-columns: minmax(240px, 1.8fr) minmax(78px, 0.55fr) minmax(82px, 0.55fr) minmax(112px, 0.75fr);
  min-width: 660px;
}

body.debug-enabled .positions-head,
body.debug-enabled .position-row {
  grid-template-columns: minmax(240px, 1.8fr) minmax(78px, 0.55fr) minmax(82px, 0.55fr) minmax(112px, 0.75fr) minmax(96px, 0.7fr) minmax(96px, 0.7fr);
  min-width: 880px;
}

.sheet-prereqs,
.amount-row {
  display: grid;
  gap: 8px;
}

.amount-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.amount-row button {
  min-height: 44px;
  border: 1px solid var(--inset-line);
  background: var(--inset);
  color: var(--white);
  font-weight: 950;
}

.amount-row button.is-active {
  border-color: rgba(25, 214, 107, 0.56);
  background: rgba(25, 214, 107, 0.14);
  color: var(--green);
}

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

.action-sheet.has-sell-action .segmented {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bottom-bar {
  grid-template-columns: 1fr;
}

.bottom-bar.has-sell-action {
  grid-template-columns: 1fr 1.2fr;
}

@media (min-width: 760px) {
  .hero {
    min-height: min(720px, 80svh);
  }

  .hero h2 {
    font-size: clamp(5rem, 8vw, 8.4rem);
    text-shadow: var(--h1-shadow);
  }

  .fund-carousel {
    grid-auto-columns: minmax(320px, 47%);
    padding-right: 0;
  }

  .winner-board {
    grid-template-columns: minmax(92px, auto) minmax(0, 1fr) auto;
  }

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

  .vault-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

  .holdings-card .vault-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .action-sheet {
    top: 50%;
    bottom: auto;
    width: min(calc(100% - 48px), 720px);
    max-height: min(88svh, 820px);
    border-width: 1px;
    padding: 14px 16px 18px;
    transform: translate(-50%, -50%);
  }
}

@media (max-width: 620px) {
  .topbar {
    align-items: stretch;
    gap: 8px;
    padding: 8px;
    overflow: hidden;
  }

  .brand-lockup {
    flex: 1 1 0;
    gap: 8px;
  }

  .brand-lockup > div {
    min-width: 0;
  }

  .brand-mark {
    width: 38px;
    min-width: 38px;
    height: 38px;
    font-size: 0.76rem;
  }

  .topbar h1 {
    max-width: 100%;
    overflow: hidden;
    font-size: clamp(0.96rem, 4.6vw, 1.12rem);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-actions {
    flex: 0 0 auto;
    gap: 6px;
  }

  .icon-button {
    width: 42px;
    min-width: 42px;
  }

  .debug-toggle {
    width: 64px;
    min-width: 64px;
    min-height: 42px;
    padding: 0;
    font-size: 0.66rem;
  }

  .holdings-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .holdings-controls .small-button {
    width: 100%;
  }

  .hero {
    min-height: auto;
  }

  .hero h2 {
    max-width: 8ch;
    font-size: clamp(2.7rem, 12.6vw, 4rem);
  }

  .wallet-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .metrics-grid,
  body.debug-enabled .metrics-grid {
    grid-template-columns: minmax(0, 1fr);
  }

}

/* ------------------------------------------------------------------ */
/* Phase C: wallet picker, toast tray, tx progress, link button       */
/* ------------------------------------------------------------------ */

.wallet-picker {
  max-height: 70vh;
  overflow-y: auto;
}

.wallet-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wallet-option {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--inset);
  color: inherit;
  border: 1px solid var(--inset-line);
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
}

.wallet-option:hover:not(:disabled) {
  background: var(--inset);
  border-color: var(--line-strong);
}

.wallet-option:disabled {
  opacity: 0.5;
  cursor: progress;
}

.wallet-option-label {
  font-weight: 600;
}

.wallet-option-id {
  font-size: 0.75rem;
  opacity: 0.6;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.wallet-empty {
  padding: 24px 16px;
  text-align: center;
  opacity: 0.6;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  opacity: 0.7;
}

.link-button:hover {
  opacity: 1;
}

.toast-tray {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom) + 88px);
  left: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: rgba(20, 20, 20, 0.95);
  color: #fff;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  animation: toast-in 200ms ease-out;
}

.toast p {
  margin: 0;
  flex: 1;
  font-size: 0.9rem;
}

.toast-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast-retry {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
}

.toast-retry:hover {
  background: rgba(255, 255, 255, 0.2);
}

.toast-dismiss {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px 8px;
  opacity: 0.7;
}

.toast-dismiss:hover {
  opacity: 1;
}

.toast-error {
  background: rgba(120, 20, 30, 0.95);
}

.toast-success {
  background: rgba(20, 80, 50, 0.95);
}

@keyframes toast-in {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.tx-progress {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 64px);
  left: 16px;
  right: 16px;
  background: rgba(20, 20, 20, 0.96);
  color: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 45;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.tx-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.tx-progress-head strong {
  font-weight: 600;
}

.tx-progress-head span {
  font-size: 0.85rem;
  opacity: 0.8;
}

.tx-progress-message {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.75;
}

.tx-progress-link {
  font-size: 0.8rem;
  color: #80b8ff;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.tx-progress-error {
  margin: 0;
  font-size: 0.85rem;
  color: #ff8e9a;
}

.tx-progress-dismiss {
  align-self: flex-end;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
}

.tx-progress-failed {
  border-color: rgba(255, 60, 90, 0.6);
}

.tx-progress-confirmed,
.tx-progress-finalized {
  border-color: rgba(60, 220, 130, 0.6);
}

/* ------------------------------------------------------------------ */
/* Phase D: USDC balances + 'Get pUSD' hint                           */
/* ------------------------------------------------------------------ */

.wallet-balances {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 12px;
  margin: 8px 0 4px;
  padding: 0;
}

.wallet-balances > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wallet-balances dt {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.55;
  margin: 0;
}

.wallet-balances dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.get-pusd-hint {
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 191, 0, 0.08);
  border: 1px solid rgba(255, 191, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.get-pusd-hint p {
  margin: 0;
  opacity: 0.85;
}

.get-pusd-hint .primary-button {
  align-self: flex-start;
}

/* ------------------------------------------------------------------ */
/* Phase E: pull-to-refresh                                           */
/* ------------------------------------------------------------------ */

.pull-refresh {
  position: fixed;
  top: env(safe-area-inset-top, 0);
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 30;
  transition: transform 220ms ease-out;
}

.pull-refresh-spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid var(--inset-line);
  border-top-color: var(--white);
  animation: pull-spin 0.9s linear infinite paused;
}

.pull-refresh.is-refreshing .pull-refresh-spinner {
  animation-play-state: running;
  opacity: 1 !important;
}

@keyframes pull-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------------------------------------------ */
/* Consumer trading redesign                                           */
/* ------------------------------------------------------------------ */

.app-shell {
  width: min(100%, 1120px);
  padding: max(14px, env(safe-area-inset-top)) 14px calc(100px + env(safe-area-inset-bottom));
}

.main-flow {
  gap: 18px;
}

.topbar,
.wallet-panel,
.hero-product,
.metric,
.nav-panel,
.monitor,
.positions-panel,
.activity,
.action-sheet,
.trade-ticket,
.landing-product,
.fund-card,
.get-pusd-hint {
  border-radius: 8px;
}

.topbar {
  min-height: 56px;
  margin-bottom: 16px;
  border-color: var(--line);
  box-shadow: none;
}

.brand-mark {
  border-radius: 8px;
  border-color: var(--line-strong);
  background: var(--white);
  color: var(--black);
}

.topbar h1 {
  letter-spacing: 0;
  text-transform: none;
}

.topbar .eyebrow,
.landing-copy .eyebrow,
.ticket-top .eyebrow {
  letter-spacing: 0.06em;
}

.icon-button svg,
.primary-button svg,
.secondary-button svg,
.ticket-wallet-row svg,
.wallet-option svg,
.tx-progress svg,
.tx-progress-link svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.icon-button,
.primary-button,
.secondary-button,
.ticket-primary,
.bottom-bar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.trade-landing {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: 18px;
  align-items: start;
  min-height: calc(100svh - 92px);
}

.landing-copy {
  grid-column: 1;
  display: grid;
  align-content: end;
  min-height: 186px;
  padding: 10px 2px 2px;
}

.landing-copy h2 {
  max-width: 11ch;
  margin-top: 8px;
  color: var(--white);
  font-size: clamp(3rem, 9vw, 6.8rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.9;
  text-transform: none;
  text-wrap: balance;
}

.hero-subcopy {
  max-width: 42ch;
  margin-top: 16px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.08rem);
  font-weight: 650;
  line-height: 1.48;
}

.landing-product {
  grid-column: 1;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 140px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--surface-gradient);
  box-shadow: var(--shadow);
}

.landing-token-art,
.product-switch-card img {
  display: block;
  aspect-ratio: 1;
  border: 1px solid var(--inset-line);
  border-radius: 8px;
  background: var(--surface-deep);
  object-fit: cover;
}

.landing-token-art {
  width: 86px;
  height: 86px;
}

.landing-product-copy {
  min-width: 0;
}

.landing-product-copy strong {
  display: block;
  color: var(--white);
  font-family: var(--mono);
  font-size: 1.72rem;
  font-weight: 900;
  line-height: 1;
}

.landing-product-copy p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.35;
}

.product-nav-line {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 900;
  text-transform: uppercase;
}

.trade-landing > .metrics-grid {
  grid-column: 1;
}

.trade-landing > .metrics-grid .metric {
  min-height: 94px;
}

.ticket-wallet-row,
.quote-list,
.amount-row button {
  border-radius: 8px;
}

.trade-landing > .trade-ticket {
  grid-column: 2;
  grid-row: 1 / span 3;
  position: sticky;
  top: calc(env(safe-area-inset-top) + 12px);
}

.trade-ticket {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface-gradient);
  box-shadow: var(--shadow);
}

.trade-ticket-sheet {
  border: 0;
  box-shadow: none;
  padding: 0;
  background: transparent;
}

.ticket-top,
.ticket-wallet-row,
.wallet-option-label,
.tx-progress-head strong,
.tx-progress-link {
  display: flex;
  align-items: center;
  min-width: 0;
}

.ticket-top {
  justify-content: space-between;
  gap: 14px;
}

.ticket-top h2 {
  margin-top: 3px;
  color: var(--white);
  font-size: clamp(1.35rem, 4vw, 1.72rem);
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.05;
  text-transform: none;
}

.tx-progress-submitted svg,
.tx-progress-awaiting_signature svg {
  animation: pull-spin 0.9s linear infinite;
}

.ticket-wallet-row {
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--inset-line);
  background: var(--inset);
}

.ticket-wallet-row span,
.ticket-wallet-row strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.ticket-wallet-row span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.ticket-wallet-row strong {
  color: var(--white);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 900;
  justify-content: flex-end;
  text-align: right;
}

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

.trade-segmented .segment {
  min-height: 46px;
  justify-content: center;
  text-align: center;
}

.trade-ticket.is-stability .trade-segmented .segment.is-active {
  border-color: rgba(25, 214, 107, 0.5);
  background: rgba(25, 214, 107, 0.14);
  color: var(--white);
  box-shadow: none;
}

.trade-ticket.is-chaos .trade-segmented .segment.is-active {
  border-color: rgba(255, 31, 45, 0.5);
  background: rgba(255, 31, 45, 0.14);
  color: var(--white);
  box-shadow: none;
}

.trade-segmented .segment:disabled {
  opacity: 0.52;
}

.sell-disabled-note {
  margin-top: -2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  text-align: center;
}

.field input {
  min-height: 64px;
  border-radius: 8px;
  font-size: 1.8rem;
  letter-spacing: 0;
}

.quote-status {
  min-height: 34px;
  margin-top: -4px;
  padding: 9px 11px;
  border: 1px solid var(--inset-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
  font-size: 0.82rem;
  font-weight: 760;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.quote-status-blocked,
.quote-status-waiting,
.quote-status-idle {
  color: var(--muted);
}

.quote-status-quoting {
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--white);
}

.quote-status-ready {
  border-color: rgba(25, 214, 107, 0.4);
  background: rgba(25, 214, 107, 0.1);
  color: var(--white);
}

.quote-status-error {
  border-color: rgba(255, 80, 90, 0.62);
  background: rgba(255, 31, 45, 0.14);
  color: #ffe4e4;
}

.amount-row button {
  border-radius: 8px;
}

.trade-ticket .amount-row {
  gap: 10px;
}

.quote-list {
  max-height: none;
}

.quote-list div {
  min-height: 44px;
}

.ticket-primary {
  min-height: 58px;
  font-size: 0.95rem;
}

.primary-button {
  border-radius: 8px;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  box-shadow: var(--shadow-cta);
  letter-spacing: 0;
  text-transform: none;
}

.secondary-button,
.segment,
.small-button,
.debug-toggle {
  border-radius: 8px;
  letter-spacing: 0;
  text-transform: none;
}

.product-switch-inline {
  grid-column: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.product-switch-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--inset-line);
  background: var(--inset);
  color: var(--white);
  text-align: left;
}

.product-switch-card img {
  width: 44px;
  height: 44px;
}

.product-switch-card span {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.2;
}

.product-switch-card strong {
  color: var(--white);
  font-family: var(--mono);
  font-size: 1rem;
}

.product-switch-card.is-active {
  border-color: rgba(25, 214, 107, 0.48);
  background: rgba(25, 214, 107, 0.1);
}

.product-switch-card.is-chaos.is-active {
  border-color: rgba(255, 31, 45, 0.5);
  background: rgba(255, 31, 45, 0.1);
}

.fund-carousel {
  grid-auto-columns: minmax(260px, 1fr);
}

.fund-card {
  display: grid;
  gap: 10px;
  width: 100%;
  min-height: 0;
  padding: 12px;
  color: var(--white);
  text-align: left;
}

.fund-card.is-active {
  border-color: rgba(25, 214, 107, 0.52);
}

.fund-card.chao-card.is-active {
  border-color: rgba(255, 31, 45, 0.56);
}

.meme-frame,
.wallet-option,
.toast,
.toast-retry,
.tx-progress,
.tx-progress-dismiss,
.get-pusd-hint {
  border-radius: 8px;
}

.wallet-picker-copy {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.4;
}

.wallet-option-label {
  gap: 8px;
}

.tx-progress {
  gap: 10px;
  border-color: var(--line);
  background: var(--surface-gradient);
  color: var(--white);
}

.tx-progress-head strong,
.tx-progress-link {
  gap: 8px;
}

.tx-progress-link {
  color: var(--green);
}

.bottom-bar {
  border-top-color: var(--line);
  background: color-mix(in srgb, var(--black) 92%, transparent);
}

@media (max-width: 760px) {
  .trade-landing {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    min-height: auto;
  }

  .landing-copy,
  .landing-product,
  .trade-landing > .metrics-grid,
  .trade-landing > .trade-ticket,
  .product-switch-inline {
    grid-column: 1;
  }

  .metrics-grid,
  body.debug-enabled .metrics-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .landing-copy {
    min-height: auto;
    padding-top: 12px;
  }

  .landing-copy h2 {
    max-width: 10ch;
    font-size: clamp(2.65rem, 13vw, 4.1rem);
  }

  .trade-landing > .trade-ticket {
    grid-row: auto;
    position: static;
  }
}

@media (max-width: 420px) {
  .app-shell {
    padding-inline: 12px;
  }

  .landing-product {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .landing-token-art {
    width: 72px;
    height: 72px;
  }

  .product-switch-inline {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .ticket-wallet-row {
    align-items: stretch;
    flex-direction: column;
  }

  .ticket-wallet-row strong {
    justify-content: flex-start;
    text-align: left;
  }
}
