/* Settle Markets — visual system carried from Pearl Exchange's research-paper
   aesthetic (warm neutrals, serif italics for moments of voice, mono for
   numbers) with Settle's own identity: probability-first color language —
   YES green / NO red — and a split-disc brand mark instead of the orb.
   Custom property NAMES are kept identical to pearl so components
   transplant cleanly; only hue accents are tuned. */

:root {
  /* Palette matched to the settle.market landing page (cool green-tinted
     neutrals, Spotify-green accent). Variable NAMES kept identical so
     components transplant unchanged; only the values are retuned. */
  --bg: #f5f7f1;
  --bg-tint: #e8f0e6;
  --card: #ffffff;
  --card-2: #f2f7f0;
  --ink: #102219;
  --ink-2: #33443b;
  --ink-3: #68776e;       /* = landing --muted */
  --ink-4: #93a399;
  --line: #d8dfd7;        /* = landing --line */
  --line-2: #e4eae2;
  --green: #1ed760;       /* landing signature accent (Spotify green) */
  --pos: #116b38;         /* readable green for YES/up text (landing --green-dark) */
  --neg: #c95d50;         /* landing --red */
  --warn: oklch(0.74 0.13 70);
  /* Iridescent sheen — retinted to the landing's green family. */
  --sheen-a: #dff2e0;
  --sheen-b: #e8f0e6;
  --sheen-c: #f6dcd8;
  --sheen-d: #eaf6cf;
  /* Brand-mark halves: --pos/--neg dropped to low chroma so the disc reads
     as an object, not a warning light. */
  --mark-pos: oklch(0.84 0.07 145);
  --mark-neg: oklch(0.84 0.08 28);
  --shadow-card: 0 1px 0 rgba(16, 34, 25, 0.04), 0 8px 24px -16px rgba(16, 34, 25, 0.18);
  --shadow-pop: 0 8px 28px -8px rgba(16, 34, 25, 0.2);
  --radius: 14px;
  --radius-sm: 9px;

  /* Aliases so any inline styles using --surface-1 / --ink-0 share the same
     dark/light pipe (pearl convention). */
  --surface-1: var(--card);
  --surface-2: var(--card-2);
  --ink-0: var(--ink);
}

/* ── Dark theme. Activated by <html data-theme="dark"> from theme.js. ──
   We keep the warm cast of the light palette (the paper stays warm), but
   flip the ink/bg relationship. Comments only on values that aren't "the
   obvious dark equivalent". */
[data-theme="dark"] {
  --bg:       #07110c;   /* landing --bg (deep green-black) */
  --bg-tint:  #0b1712;
  --card:     #0c1911;   /* landing --surface */
  --card-2:   #122117;
  --ink:      #e8faee;   /* landing --ink */
  --ink-2:    #c0d3c7;
  --ink-3:    #8ba094;   /* landing --muted */
  --ink-4:    #5c6f64;
  --line:     #233b2e;   /* landing --line */
  --line-2:   #18271f;
  --green:    #1ed760;
  --pos:      #43f784;   /* landing --green-dark (dark) — bright, high-contrast */
  --neg:      #e07469;
  --warn:     oklch(0.80 0.16 70);
  --mark-pos: oklch(0.48 0.08 145);
  --mark-neg: oklch(0.48 0.09 28);
  --shadow-card: 0 1px 0 rgba(0, 0, 0, 0.40), 0 12px 28px -16px rgba(0, 0, 0, 0.55);
  --shadow-pop:  0 12px 32px -8px rgba(0, 0, 0, 0.60);

  --surface-1: var(--card);
  --surface-2: var(--card-2);
  --ink-0:     var(--ink);
}

/* Tell the UA so form controls, scrollbars, and ::selection get a dark cast. */
:root             { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }

/* Native <select> popups don't inherit CSS vars — Chrome picks its own
   (often dim) colors for options. Pin them to the theme so every entry in
   dropdowns is full-contrast in both light and dark. */
select option {
  background: var(--card);
  color: var(--ink);
}
select option:disabled { color: var(--ink-4); }

* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Manrope", ui-sans-serif, system-ui, sans-serif;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.serif { font-family: "Manrope", ui-sans-serif, system-ui, sans-serif; font-style: normal; font-weight: 700; letter-spacing: -0.02em; }
.mono { font-family: "DM Mono", ui-monospace, "SF Mono", monospace; font-feature-settings: "ss01", "zero"; }
.tnum { font-variant-numeric: tabular-nums; }

button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font: inherit; color: inherit; background: none; border: none; outline: none; }
input::placeholder { color: var(--ink-4); }

/* ===== Settle mark =====
   A disc split by a hairline into the YES / NO halves — the product IS the
   two-sided question. Same craft level as pearl's orb (soft sheen, inset
   specular highlight), distinct identity. Size variants s16/s22/s28/s44;
   the SettleMark component can also set width/height inline. */
.settle-mark {
  width: 22px; height: 22px; border-radius: 999px; display: inline-block;
  background:
    /* specular highlight, top-left — same lighting model as the orb */
    radial-gradient(circle at 32% 28%, rgba(255,255,255,0.92) 0%, rgba(255,255,255,0.28) 26%, rgba(255,255,255,0) 52%),
    /* soft iridescent sheen laid over the halves at low alpha */
    linear-gradient(120deg,
      color-mix(in oklab, var(--sheen-a) 45%, transparent),
      color-mix(in oklab, var(--sheen-b) 45%, transparent),
      color-mix(in oklab, var(--sheen-c) 45%, transparent),
      color-mix(in oklab, var(--sheen-d) 45%, transparent)),
    /* the split: YES (left) / NO (right) at low chroma */
    conic-gradient(from 0deg at 50% 50%,
      var(--mark-neg) 0deg 180deg,
      var(--mark-pos) 180deg 360deg);
  box-shadow:
    inset -2px -3px 6px rgba(100, 80, 70, 0.22),
    inset 2px 2px 4px rgba(255, 255, 255, 0.85),
    0 1px 2px rgba(0, 0, 0, 0.08);
  position: relative;
  flex-shrink: 0;
}
/* Hairline between the halves — paper-colored so it reads as a cut, not a
   stroke. Stops shy of the edges so the disc stays round. */
.settle-mark::before {
  content: "";
  position: absolute;
  left: calc(50% - 0.5px); width: 1px;
  top: 9%; bottom: 9%;
  background: var(--card);
  opacity: 0.9;
}
.settle-mark::after {
  content: "";
  position: absolute;
  inset: 18% 50% 50% 18%;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255,255,255,0.8), rgba(255,255,255,0) 70%);
}
.settle-mark.s16 { width: 16px; height: 16px; }
.settle-mark.s22 { width: 22px; height: 22px; }
.settle-mark.s28 { width: 28px; height: 28px; }
.settle-mark.s44 { width: 44px; height: 44px; }

/* ===== App shell ===== */
.app {
  min-height: 100%;
  display: flex; flex-direction: column;
}
/* Editorial top bar — thin, translucent, blur-backed (mirrors the landing
   nav-wrap). Brand wordmark + mono-uppercase nav links; no filled pills. */
.topbar {
  display: flex; align-items: center; gap: 20px;
  height: 72px; padding: 0 clamp(20px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  position: sticky; top: 0; z-index: 20;
}
.brand {
  display: flex; align-items: center; gap: 9px;
  font-family: "Manrope", ui-sans-serif, system-ui, sans-serif;
  font-style: normal;
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.045em;
}
.brand .sub { font-family: "DM Mono", monospace; font-style: normal; font-size: 9px; color: var(--ink-3); letter-spacing: 0.14em; text-transform: uppercase; margin-left: 5px; align-self: flex-start; margin-top: 2px; }

/* Mono-uppercase nav links with a green underline accent on the active view. */
.nav {
  display: flex; gap: clamp(18px, 2.4vw, 32px);
  margin-left: 14px;
}
.nav button {
  position: relative;
  padding: 8px 0;
  font-family: "DM Mono", monospace;
  font-size: 10.5px; font-weight: 400;
  letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--ink-3);
  transition: color 0.15s;
}
.nav button:hover:not(.active) { color: var(--ink); }
.nav button.active { color: var(--ink); }
.nav button.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--green); border-radius: 2px;
}
.nav a.nav-link {
  padding: 8px 0;
  font-family: "DM Mono", monospace;
  font-size: 10.5px; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--ink-3);
  text-decoration: none;
  display: inline-flex; align-items: center;
  transition: color 0.15s;
}
.nav a.nav-link:hover { color: var(--ink); }

.topbar .spacer { flex: 1; }

.net-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  background: var(--card);
}
.net-pill .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--pos); box-shadow: 0 0 0 3px oklch(0.62 0.14 145 / 0.18); }
.net-pill .dot.bad { background: var(--neg); box-shadow: 0 0 0 3px oklch(0.58 0.18 28 / 0.18); }

/* Secondary header controls (community, language, theme, network). Inline
   when there's room; collapse into the gear SettingsMenu when the bar gets
   tight so nothing warps. The two never show at once (media query below). */
.header-controls { display: flex; align-items: center; gap: 12px; }
.settings-menu { display: none; position: relative; }
.settings-menu .settings-pop {
  position: absolute; right: 0; top: 100%;
  padding-top: 8px;          /* transparent bridge: keeps hover alive over the gap */
  z-index: 40;
}
.settings-menu .settings-card {
  display: flex; flex-direction: column; gap: 12px;
  min-width: 248px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
}

/* Collapse generously: a packed bar (brand + nav tabs + community + lang +
   theme + network + balance + wallet) needs ~1500px to sit on one line,
   which is wider than a MacBook's built-in display — so fold into the gear
   at/below 1536px and only keep it inline on larger external monitors. */
@media (max-width: 1536px) {
  .header-controls { display: none; }
  .settings-menu { display: inline-block; }
}

.wallet-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 6px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 13px;
}
.wallet-pill .bal { font-family: "DM Mono", monospace; font-size: 12px; color: var(--ink-2); }
.wallet-pill .addr { background: var(--bg-tint); padding: 4px 10px; border-radius: 999px; font-family: "DM Mono", monospace; font-size: 11.5px; }
.wallet-pill.connect { background: var(--ink); color: var(--bg); border-color: var(--ink); padding: 10px 18px; font-family: "DM Mono", monospace; font-size: 10.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; transition: transform 0.18s, background 0.18s; }
.wallet-pill.connect:hover { transform: translateY(-2px); }

/* Funding chip in top bar */
.fund-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 12px;
}
.fund-pill .label { color: var(--ink-3); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; }
.fund-pill .val { font-family: "DM Mono", monospace; }
.fund-pill button { font-size: 11px; color: var(--ink-2); padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-tint); }
.fund-pill button:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ===== Layout containers ===== */
/* Editorial column: landing-parity 1180px max, generous gutters + vertical
   rhythm so prices and choices sit in calm space (theme guide §Layout). */
.page { padding: clamp(28px, 4vw, 52px) clamp(20px, 4vw, 48px) 96px; max-width: 1180px; margin: 0 auto; width: 100%; }

/* Editorial view header: micro category label → large tight headline → one
   supporting sentence (theme guide §Copy pattern). Reused across views. */
.view-head { margin-bottom: clamp(24px, 3vw, 40px); }
.view-head .eyebrow { display: block; margin-bottom: 14px; }
.view-title {
  font-family: "Manrope", ui-sans-serif, system-ui, sans-serif;
  font-weight: 500;
  font-size: clamp(32px, 4.6vw, 52px);
  line-height: 1.0;
  letter-spacing: -0.055em;
  color: var(--ink);
  margin: 0;
}
.view-sub {
  margin-top: 16px;
  font-size: 15px; line-height: 1.65;
  color: var(--ink-3);
  max-width: 60ch;
}
/* Header row that carries the editorial title on the left, controls (tabs,
   pickers) aligned to the baseline on the right. */
.view-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.card-pad { padding: 18px 20px; }
.card-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); font-weight: 500; }

/* Micro-label eyebrow (pearl voice) */
.eyebrow { font-family: "DM Mono", monospace; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }

/* Small chips */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 999px; font-size: 10.5px; background: var(--bg-tint); border: 1px solid var(--line); color: var(--ink-2); font-family: "DM Mono", monospace; text-transform: uppercase; letter-spacing: 0.08em; }

/* Tooltip helpers */
.hint { font-size: 11px; color: var(--ink-3); margin-top: 8px; line-height: 1.5; }

.pos { color: var(--pos); }
.neg { color: var(--neg); }

/* ===== Probability vocabulary (Settle-specific) ===== */

/* Outcome glyph — the YES/NO letter chip used where pearl used token logos. */
.og {
  width: 22px; height: 22px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 8.5px; font-weight: 700; color: white; flex-shrink: 0;
  font-family: "DM Mono", monospace; letter-spacing: 0;
}
.og.yes { background: linear-gradient(135deg, oklch(0.66 0.14 145), oklch(0.52 0.14 150)); }
.og.no  { background: linear-gradient(135deg, oklch(0.64 0.18 28),  oklch(0.5 0.18 25)); }

/* Paired YES/NO price pills — the markets-grid + entry-card price language.
   ¢ ≡ %: 62¢ IS 62% implied probability. */
.prob-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-family: "DM Mono", monospace; font-size: 11.5px; font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.prob-chip.yes { background: oklch(0.62 0.14 145 / 0.12); color: var(--pos); }
.prob-chip.no  { background: oklch(0.58 0.18 28 / 0.12);  color: var(--neg); }

/* Thin two-tone probability bar: green YES share from the left, red NO
   remainder. Width driven by --p (e.g. style={{ "--p": "62%" }}). */
.prob-bar {
  position: relative; height: 4px; border-radius: 999px;
  background: oklch(0.58 0.18 28 / 0.28);
  overflow: hidden;
}
.prob-bar .fill {
  position: absolute; top: 0; bottom: 0; left: 0;
  width: var(--p, 50%);
  background: var(--pos);
  border-radius: 999px 0 0 999px;
  transition: width 0.3s ease;
}

/* Live countdown chip — mono, calm by default, amber inside the last hour,
   red pulse inside the last five minutes (CountdownChip sets the classes). */
.countdown-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--card);
  font-family: "DM Mono", monospace; font-size: 11px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.countdown-chip svg { flex-shrink: 0; }
.countdown-chip.warn {
  color: oklch(0.5 0.13 70);
  border-color: oklch(0.74 0.13 70 / 0.55);
  background: oklch(0.74 0.13 70 / 0.1);
}
[data-theme="dark"] .countdown-chip.warn { color: var(--warn); }
.countdown-chip.urgent {
  color: var(--neg);
  border-color: oklch(0.58 0.18 28 / 0.5);
  background: oklch(0.58 0.18 28 / 0.1);
  animation: cd-pulse 1.1s ease-in-out infinite;
}
@keyframes cd-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

/* Lifecycle / generic status pills (extends pearl's act-table pill). */
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 11px; }
.status-pill.ok       { background: oklch(0.62 0.14 145 / 0.1);  color: var(--pos); }
.status-pill.pend     { background: oklch(0.74 0.13 70 / 0.13);  color: oklch(0.5 0.13 70); }
[data-theme="dark"] .status-pill.pend { color: var(--warn); }
.status-pill.bad      { background: oklch(0.58 0.18 28 / 0.1);   color: var(--neg); }
.status-pill.muted    { background: var(--bg-tint);              color: var(--ink-3); }
/* Lifecycle aliases (design §2): open→ok, expired/proposed→pend,
   resolved YES→ok / NO→bad, voided/claimed→muted. Views use these names. */
.status-pill.live     { background: oklch(0.62 0.14 145 / 0.1);  color: var(--pos); }
.status-pill.expired  { background: oklch(0.74 0.13 70 / 0.13);  color: oklch(0.5 0.13 70); }
[data-theme="dark"] .status-pill.expired { color: var(--warn); }
.status-pill.proposed { background: oklch(0.74 0.13 70 / 0.13);  color: oklch(0.5 0.13 70); }
[data-theme="dark"] .status-pill.proposed { color: var(--warn); }
.status-pill.resolved { background: var(--bg-tint);              color: var(--ink-2); }
.status-pill.voided   { background: var(--bg-tint);              color: var(--ink-3); }

/* ===== Markets grid (browse view) ===== */
/* Mono-uppercase category filters with the same green underline accent as the
   main nav — no filled pills (theme guide §Buttons / calm surfaces). */
.cat-tabs {
  display: inline-flex; gap: clamp(16px, 2vw, 26px);
  padding-bottom: 2px;
}
.cat-tabs button {
  position: relative; padding: 6px 0;
  font-family: "DM Mono", monospace; font-size: 10.5px; font-weight: 400;
  letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--ink-3); transition: color 0.15s;
}
.cat-tabs button.active { color: var(--ink); }
.cat-tabs button.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px;
  height: 2px; background: var(--green); border-radius: 2px;
}
.cat-tabs button:hover:not(.active) { color: var(--ink); }

.markets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.market-card {
  padding: 20px;
  display: flex; flex-direction: column; gap: 13px;
  border-radius: 16px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  cursor: pointer;
}
.market-card:hover { border-color: var(--ink-4); box-shadow: var(--shadow-pop); transform: translateY(-2px); }
.market-card .question { font-size: 16px; font-weight: 600; line-height: 1.32; letter-spacing: -0.02em; }
.market-card .mc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }

/* YES/NO best-executable-ask buttons. Disabled-dashed when that side of the
   book is empty (design §5) — an honest "no liquidity", not a dead button. */
.mc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mc-actions button {
  padding: 10px 8px; border-radius: 9px;
  font-family: "DM Mono", monospace; font-size: 13px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: background 0.15s, color 0.15s;
  min-height: 40px;
}
.mc-actions .yes { background: oklch(0.62 0.14 145 / 0.1); color: var(--pos); border: 1px solid oklch(0.62 0.14 145 / 0.28); }
.mc-actions .yes:hover { background: var(--pos); color: #fff; }
.mc-actions .no  { background: oklch(0.58 0.18 28 / 0.1);  color: var(--neg); border: 1px solid oklch(0.58 0.18 28 / 0.28); }
.mc-actions .no:hover  { background: var(--neg); color: #fff; }
.mc-actions button.empty {
  border: 1px dashed var(--line); background: var(--card-2);
  color: var(--ink-4); cursor: not-allowed; font-weight: 400; font-size: 11px;
}
.mc-actions button.empty:hover { background: var(--card-2); color: var(--ink-4); }

.mc-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-family: "DM Mono", monospace; font-size: 11px; color: var(--ink-3); }

/* ===== Trade layout ===== */
.trade-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 16px;
  align-items: start;
}
.market-strip {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(0, 1fr)) auto;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  margin-bottom: 16px;
}
.market-strip .pair { display: flex; align-items: center; gap: 12px; min-width: 0; }
.market-strip .pair > div { min-width: 0; flex: 1; }
.market-strip .pair-name { font-family: "Manrope", ui-sans-serif, system-ui, sans-serif; font-size: 17px; font-weight: 600; letter-spacing: 0; min-width: 0; line-height: 1.3; }
.market-strip .pair-meta { font-size: 11px; color: var(--ink-3); font-family: "DM Mono", monospace; text-transform: uppercase; }
.metric-label { font-size: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.1em; }
.metric-val { font-family: "DM Mono", monospace; font-size: 14px; margin-top: 2px; }
.metric-val.big { font-size: 14px; }   /* pearl owner call 2026-07-10: uniform metric sizing */

/* Custom market dropdown (MarketPicker) */
.pair-picker {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 4px 8px 4px 4px; border-radius: 10px; min-width: 0;
}
.pair-picker:hover { background: var(--bg-tint); }
.pair-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 80;
  min-width: 280px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-pop, 0 12px 32px -8px rgba(0,0,0,0.3));
  display: flex; flex-direction: column; gap: 2px;
  max-height: 60vh; overflow-y: auto;
}
.pair-menu button {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; font-size: 14px;
  color: var(--ink); text-align: left; width: 100%;
}
.pair-menu button:hover { background: var(--bg-tint); }
.pair-menu button.active { background: var(--bg-tint); font-weight: 600; }
.pair-menu button .tick { margin-left: auto; color: var(--ink-3); font-size: 12px; font-family: "DM Mono", monospace; }

/* Chart card */
.chart-card { padding: 16px 18px 12px; }
.chart-tabs { display: flex; gap: 0; margin-bottom: 12px; align-items: center; justify-content: space-between; }
.tf-group { display: flex; gap: 2px; padding: 3px; background: var(--bg-tint); border-radius: 8px; }
.tf-group button { padding: 5px 10px; font-size: 11px; font-family: "DM Mono", monospace; color: var(--ink-3); border-radius: 6px; }
.tf-group button.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.06); }

.chart-stats { display: flex; gap: 24px; margin-top: 6px; padding-top: 12px; border-top: 1px dashed var(--line); font-family: "DM Mono", monospace; font-size: 11px; color: var(--ink-3); }
.chart-stats b { color: var(--ink); font-weight: 500; }

/* Pre-first-trade chart state: dashed card + the live BBO line rendered as
   a positioned rule (EmptyChartState positions .bbo-line at the mid tick). */
.chart-empty {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 1px dashed var(--line); border-radius: 12px;
  background: var(--card-2);
  color: var(--ink-3); font-size: 13px;
  overflow: hidden;
}
.chart-empty h4 { margin: 0; font-family: "Manrope", ui-sans-serif, system-ui, sans-serif; font-weight: 600; font-size: 16px; color: var(--ink-2); }
.chart-empty .bbo-line {
  position: absolute; left: 0; right: 0; height: 0;
  border-top: 1px dashed var(--ink-4);
  pointer-events: none;
}
.chart-empty .bbo-tag {
  position: absolute; right: 12px; transform: translateY(-50%);
  font-family: "DM Mono", monospace; font-size: 10.5px;
  background: var(--card); border: 1px solid var(--line); border-radius: 5px;
  padding: 2px 7px; color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   CLOB — book + entry
   ============================================================ */
.clob-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px 360px;
  gap: 12px;
  align-items: stretch;
}

/* Order book */
.book-card { display: flex; flex-direction: column; height: 100%; min-height: 540px; }
.book-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.book-header .title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); font-weight: 500; }
.book-header .ag { display: flex; gap: 2px; background: var(--bg-tint); padding: 2px; border-radius: 6px; font-family: "DM Mono", monospace; font-size: 10px; }
.book-header .ag button { padding: 3px 7px; border-radius: 4px; color: var(--ink-3); }
.book-header .ag button.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 1px rgba(0,0,0,0.06); }

.book-cols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0; padding: 6px 12px 4px; font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-4); font-family: "DM Mono", monospace; }
.book-cols .r { text-align: right; }

.book-list { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.book-side { flex: 1; display: flex; flex-direction: column; justify-content: safe flex-end; }
/* `safe` keyword: when content overflows, fall back to flex-start so the
 * overflow ends up BELOW the scrollable area (positive scrollTop) instead of
 * above it (unreachable). Without this asks become unscrollable when the book
 * gets deep. */
.book-side.asks { justify-content: safe flex-end; }
.book-side.bids { justify-content: flex-start; }

.book-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  padding: 2px 12px;
  font-family: "DM Mono", monospace;
  font-size: 11.5px;
  position: relative;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.book-row:hover { background: var(--bg-tint); }
.book-row .px { z-index: 1; }
.book-row .sz, .book-row .tot { text-align: right; z-index: 1; color: var(--ink-2); }
.book-row.ask .px { color: var(--neg); }
.book-row.bid .px { color: var(--pos); }
.book-row .bar {
  position: absolute; top: 0; bottom: 0; right: 0;
  background: oklch(0.58 0.18 28 / 0.08);
  pointer-events: none;
}
.book-row.bid .bar { background: oklch(0.62 0.14 145 / 0.08); }

.book-spread {
  padding: 8px 12px;
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
  background: var(--card-2);
  display: flex; align-items: center; justify-content: space-between;
  font-family: "DM Mono", monospace;
  font-size: 12px;
}
.book-spread .last { display: flex; align-items: center; gap: 6px; font-size: 16px; }
.book-spread .last.up { color: var(--pos); }
.book-spread .last.down { color: var(--neg); }
.book-spread .spread { font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; }

/* Recent trades sidebar */
.recent-card { padding: 14px 18px 16px; }
.recent-card h3 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); font-weight: 500; margin: 0 0 10px; }
.trades-table { width: 100%; border-collapse: collapse; font-family: "DM Mono", monospace; font-size: 11.5px; }
.trades-table th { text-align: left; font-weight: 400; font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); padding: 6px 0; border-bottom: 1px solid var(--line); }
.trades-table th.r, .trades-table td.r { text-align: right; }
.trades-table td { padding: 4px 0; color: var(--ink-2); }
.trades-table tr:hover td { color: var(--ink); }

/* Order entry */
.entry-card { display: flex; flex-direction: column; }
.entry-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.entry-tabs button { padding: 14px 0; font-size: 13px; font-weight: 500; color: var(--ink-3); border-bottom: 2px solid transparent; border-radius: 0; }
.entry-tabs button.buy.active  { color: var(--pos); border-bottom-color: var(--pos); background: oklch(0.62 0.14 145 / 0.05); }
.entry-tabs button.sell.active { color: var(--neg); border-bottom-color: var(--neg); background: oklch(0.58 0.18 28 / 0.05); }

.entry-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; }

/* Segmented control (limit/market, YES/NO, timeframes reuse this shape). */
.type-row { display: flex; gap: 2px; padding: 3px; background: var(--bg-tint); border-radius: 8px; }
.type-row button { flex: 1; padding: 6px 8px; font-size: 12px; color: var(--ink-3); border-radius: 6px; }
.type-row button.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
/* YES/NO segmented — the outcome picker gets the brand colors. */
.type-row button.yes.active { color: var(--pos); }
.type-row button.no.active  { color: var(--neg); }

.field { display: flex; flex-direction: column; gap: 4px; }
.field .lbl { display: flex; justify-content: space-between; align-items: center; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); }
.field .lbl .bal { text-transform: none; letter-spacing: 0; font-family: "DM Mono", monospace; }
.field .input-wrap {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
}
.field .input-wrap:focus-within { border-color: var(--ink); }
.field .input-wrap input { flex: 1; font-family: "DM Mono", monospace; font-size: 16px; font-variant-numeric: tabular-nums; padding: 0; min-width: 0; }
.field .input-wrap .suf { font-size: 12px; color: var(--ink-3); font-family: "DM Mono", monospace; }
.field.disabled .input-wrap { background: var(--bg-tint); color: var(--ink-3); }
.field.disabled .input-wrap input { color: var(--ink-3); }

/* Best/Last one-tap price chips inside the price field row. */
.px-chips { display: flex; gap: 4px; }
.px-chips button {
  padding: 3px 8px; font-size: 10.5px;
  font-family: "DM Mono", monospace;
  border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink-3); background: var(--card-2);
}
.px-chips button:hover { color: var(--ink); border-color: var(--ink-4); }

.pct-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.pct-row button {
  padding: 6px 0; font-size: 11px;
  font-family: "DM Mono", monospace;
  border: 1px solid var(--line); border-radius: 6px;
  color: var(--ink-3);
}
.pct-row button:hover { color: var(--ink); border-color: var(--ink-4); }

.flags { display: flex; gap: 12px; font-size: 11.5px; color: var(--ink-3); }
.flags label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.flags input { accent-color: var(--ink); }

.entry-summary { display: flex; flex-direction: column; gap: 4px; padding-top: 4px; border-top: 1px dashed var(--line); font-size: 11.5px; }
.entry-summary .ln { display: flex; justify-content: space-between; color: var(--ink-3); }
.entry-summary .ln b { color: var(--ink); font-family: "DM Mono", monospace; font-weight: 500; }

.submit-btn {
  padding: 13px;
  border-radius: 10px;
  font-size: 14px; font-weight: 500;
  color: white;
  transition: opacity 0.15s;
}
.submit-btn.buy { background: var(--pos); }
.submit-btn.sell { background: var(--neg); }
.submit-btn:hover { opacity: 0.9; }
.submit-btn.disabled { background: var(--bg-tint); color: var(--ink-4); cursor: not-allowed; }
.submit-btn.disabled:hover { opacity: 1; }
/* Neutral ladder rungs (Connect / Switch chain / Approve / Get gas) render
   in ink, not side colors — they're not a trade yet. */
.submit-btn.neutral { background: var(--ink); color: var(--bg); }

.entry-fund {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: var(--card-2);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink-3);
}
.entry-fund button { color: var(--ink); font-weight: 500; }
.entry-fund button:hover { text-decoration: underline; }

/* Generic block CTA (fund view, modals) — mono-uppercase, 9px radius, subtle
   lift on hover (theme guide §Buttons). */
.cta {
  display: flex; align-items: center; justify-content: center; width: 100%;
  min-height: 50px; padding: 0 20px;
  background: var(--ink); color: var(--bg);
  font-family: "DM Mono", monospace; font-size: 11px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  border-radius: 9px;
  transition: transform 0.18s, background 0.18s, opacity 0.15s;
}
.cta:not(.disabled):hover { transform: translateY(-2px); }
.cta.disabled { background: var(--bg-tint); color: var(--ink-4); cursor: not-allowed; }
.cta.disabled:hover { opacity: 1; }

/* Landing parity (settle.market): in dark mode the primary CTAs flip to the
   signature Spotify-green with dark ink text — exactly like the landing's
   .btn. Light mode keeps the ink button (also matches the landing). */
[data-theme="dark"] .cta,
[data-theme="dark"] .wallet-pill.connect {
  background: var(--green); color: #07110c; border-color: var(--green);
}
[data-theme="dark"] .cta:not(.disabled):hover,
[data-theme="dark"] .wallet-pill.connect:hover { opacity: 1; filter: brightness(1.06); }

/* Bottom panel */
.bottom-panel { margin-top: 12px; }
.bp-tabs { display: flex; gap: 0; padding: 0 16px; border-bottom: 1px solid var(--line); }
.bp-tabs button { padding: 12px 0; margin-right: 22px; font-size: 13px; color: var(--ink-3); border-bottom: 2px solid transparent; border-radius: 0; }
.bp-tabs button.active { color: var(--ink); border-bottom-color: var(--ink); }
.bp-tabs button .ct { display: inline-block; margin-left: 6px; padding: 1px 6px; background: var(--bg-tint); border-radius: 8px; font-size: 10.5px; color: var(--ink-3); font-family: "DM Mono", monospace; }

.bp-content { padding: 0; }
.ord-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ord-table thead th { text-align: left; padding: 10px 16px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); font-weight: 500; border-bottom: 1px solid var(--line); }
.ord-table thead th.r { text-align: right; }
.ord-table tbody td { padding: 11px 16px; border-bottom: 1px solid var(--line-2); font-family: "DM Mono", monospace; font-size: 12px; font-variant-numeric: tabular-nums; }
.ord-table tbody td.r { text-align: right; }
.ord-table tbody tr:hover { background: var(--card-2); }
.ord-table .side-buy { color: var(--pos); }
.ord-table .side-sell { color: var(--neg); }
.ord-table .cancel { color: var(--neg); font-size: 11px; cursor: pointer; padding: 3px 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--card); }
.ord-table .cancel:hover { background: oklch(0.58 0.18 28 / 0.08); border-color: var(--neg); }
.ord-table .claim-btn { color: var(--pos); font-size: 11px; cursor: pointer; padding: 3px 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--card); }
.ord-table .claim-btn:hover { background: oklch(0.62 0.14 145 / 0.08); border-color: var(--pos); }
.empty-state { padding: 56px 0; text-align: center; color: var(--ink-4); font-size: 13px; }

/* Dashed hero-style empty state (pearl's otc-idle vocabulary). */
.idle-card {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 36px 24px;
  text-align: center;
  background: var(--card-2);
}
.idle-card h3 { margin: 0 0 6px; font-family: "Manrope", ui-sans-serif, system-ui, sans-serif; font-weight: 600; font-size: 19px; }
.idle-card p { margin: 0 auto; font-size: 13px; color: var(--ink-3); max-width: 48ch; line-height: 1.55; }

.spinner {
  width: 16px; height: 16px; border-radius: 999px;
  border: 2px solid var(--line); border-top-color: var(--ink);
  animation: spin 0.9s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Callouts — fund view guidance + zero-gas / zero-USDG states. */
.callout {
  padding: 14px 16px;
  border: 1px dashed var(--line); border-radius: 12px;
  background: var(--card-2);
  font-size: 13px; line-height: 1.55; color: var(--ink-2);
}
.callout.warn { border-color: oklch(0.74 0.13 70 / 0.6); background: oklch(0.74 0.13 70 / 0.07); }
.callout.bad  { border-color: oklch(0.58 0.18 28 / 0.5); background: oklch(0.58 0.18 28 / 0.06); }
.callout h4 { margin: 0 0 4px; font-size: 13.5px; font-weight: 600; color: var(--ink); }

/* ===== Fund view ===== */
.fund-wrap { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.fund-hero {
  padding: 22px 22px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 100% at 100% 0%, color-mix(in oklab, var(--sheen-b) 45%, transparent), transparent 60%),
    radial-gradient(120% 100% at 0% 100%, color-mix(in oklab, var(--sheen-c) 45%, transparent), transparent 60%),
    var(--card);
}
.fund-hero h2 { font-family: "Manrope", ui-sans-serif, system-ui, sans-serif; font-size: 28px; letter-spacing: -0.01em; margin: 6px 0 4px; font-weight: 600; }
.fund-hero p { margin: 0; color: var(--ink-3); font-size: 13.5px; max-width: 44ch; line-height: 1.5; }

.fund-links { display: flex; flex-direction: column; gap: 6px; }
.fund-links a {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--card); font-size: 13px; color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.fund-links a:hover { border-color: var(--ink-4); background: var(--bg-tint); }
.fund-links a .sub { margin-left: auto; font-size: 11px; color: var(--ink-3); font-family: "DM Mono", monospace; }

/* Copyable address row (pearl's modal-addr). */
.modal-addr {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--card-2); display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-family: "DM Mono", monospace; font-size: 12px;
}
.modal-addr .a { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-addr button { font-size: 11px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink-2); }
.modal-addr button:hover { border-color: var(--ink); color: var(--ink); }

.modal-note { font-size: 11.5px; color: var(--ink-3); line-height: 1.5; padding: 10px 12px; background: var(--card-2); border-radius: 9px; border: 1px dashed var(--line); }

/* deBridge widget container — the widget injects an iframe; give it a bound. */
.debridge-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); min-height: 420px; }

/* ===== Activity ===== */
.activity-tabs { display: flex; gap: 16px; margin-bottom: 14px; }
.activity-tabs button { padding: 6px 0; font-size: 13px; color: var(--ink-3); border-bottom: 2px solid transparent; border-radius: 0; }
.activity-tabs button.active { color: var(--ink); border-bottom-color: var(--ink); }

.act-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.act-table thead th { text-align: left; padding: 10px 14px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); font-weight: 500; border-bottom: 1px solid var(--line); background: var(--card-2); }
.act-table tbody td { padding: 14px; border-bottom: 1px solid var(--line-2); font-family: "DM Mono", monospace; font-size: 12.5px; }
.act-table tbody tr:hover { background: var(--card-2); }
.act-table .dir { display: inline-flex; align-items: center; gap: 6px; }

/* Footer note */
.footnote { text-align: center; font-size: 11px; color: var(--ink-4); margin-top: 32px; font-family: "DM Mono", monospace; }
.footnote a { color: var(--ink-3); text-decoration: none; border-bottom: 1px dotted var(--ink-4); }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 10px;
  font-size: 13px; box-shadow: var(--shadow-pop); z-index: 70;
  display: flex; align-items: center; gap: 10px;
  animation: toastIn 0.2s ease;
  max-width: min(92vw, 560px);
}
.toast a { color: var(--bg); text-decoration: underline; }
.toast .spin {
  width: 14px; height: 14px; border-radius: 999px; flex-shrink: 0;
  border: 2px solid color-mix(in oklab, var(--bg) 35%, transparent);
  border-top-color: var(--bg);
  animation: spin 0.7s linear infinite;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Slippage settings dropdown */
.popover {
  position: absolute; top: 100%; right: 0; margin-top: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; min-width: 240px; box-shadow: var(--shadow-pop); z-index: 30;
}
.popover-row { display: flex; gap: 6px; margin-top: 8px; }
.popover-row button { flex: 1; padding: 7px 0; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; font-family: "DM Mono", monospace; }
.popover-row button.active { border-color: var(--ink); background: var(--bg-tint); }

/* iridescence on selected */
.iridescent {
  background: linear-gradient(120deg, var(--sheen-a), var(--sheen-b), var(--sheen-c), var(--sheen-d));
  background-size: 300% 300%;
  animation: shimmer 6s ease-in-out infinite;
}
@keyframes shimmer { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* ===== Modal system ===== */
.modal-back { position: fixed; inset: 0; background: rgba(23,19,16,0.32); z-index: 40; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal { background: var(--card); border-radius: 14px; box-shadow: var(--shadow-pop); width: 460px; max-width: 100%; overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-family: "Manrope", ui-sans-serif, system-ui, sans-serif; font-size: 19px; font-weight: 600; letter-spacing: 0; }
.modal-head .close { color: var(--ink-3); width: 28px; height: 28px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; }
.modal-head .close:hover { background: var(--bg-tint); color: var(--ink); }

.modal-toggle { display: grid; grid-template-columns: 1fr 1fr; margin: 0; }
.modal-toggle button { padding: 12px; font-size: 13px; color: var(--ink-3); border-bottom: 2px solid transparent; border-radius: 0; }
.modal-toggle button.active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500; }

.modal-body { padding: 16px 20px 18px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 0 20px 18px; }

/* ===== Horizontal-scroll shield for wide tables (all viewports; the
   mobile layer relies on it — design §5 mobile spec). ===== */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll > table { min-width: 640px; }

/* ============================================================
   Responsive
   ============================================================ */

/* Desktop reflow (pearl's 1180px): entry card drops below chart + book. */
@media (max-width: 1180px) {
  .clob-grid { grid-template-columns: minmax(0, 1fr) 280px; }
  .entry-card { grid-column: 1 / -1; }
}

/* ============================================================
   Mobile ≤768px — NOT inherited from pearl (its posture was desktop-only);
   this is design §5's explicit spec: single-column stack, entry card as a
   bottom sheet behind a persistent Buy YES / Buy NO bar, 44px touch
   targets, tables in .table-scroll containers.
   ============================================================ */

/* trade.jsx renders the sheet + CTA bar unconditionally; they are
   mobile-only chrome. Without this base rule a desktop viewport shows a
   duplicate in-flow entry card and stray unstyled Buy buttons. */
.entry-sheet, .sheet-backdrop, .mobile-cta-bar { display: none; }

@media (max-width: 768px) {
  .page { padding: 16px 14px 108px; }  /* bottom padding clears .mobile-cta-bar */
  .topbar { padding: 10px 14px; gap: 12px; overflow-x: auto; scrollbar-width: none; }
  .topbar::-webkit-scrollbar { display: none; }
  .brand { font-size: 19px; }
  .nav { margin-left: 0; }
  .nav button { padding: 10px 13px; }

  /* Single-column stack: market strip → chart → book → bottom panel. */
  .trade-grid { grid-template-columns: minmax(0, 1fr); }
  .clob-grid { grid-template-columns: minmax(0, 1fr); }
  .market-strip { grid-template-columns: 1fr 1fr; row-gap: 12px; padding: 14px 16px; }
  .market-strip .pair { grid-column: 1 / -1; }
  .markets-grid { grid-template-columns: minmax(0, 1fr); }
  .book-card { min-height: 380px; }

  /* The in-grid entry card hides; trade.jsx renders the SAME EntryCard
     inside .entry-sheet instead (opened by the CTA bar below). */
  .clob-grid > .entry-card { display: none; }

  /* Bottom sheet — slide-up over a backdrop, drag-handle on top. */
  .entry-sheet {
    display: block;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--card);
    border: 1px solid var(--line); border-bottom: none;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.22);
    transform: translateY(105%);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0.33, 1);
    max-height: 88dvh;
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .entry-sheet.open { transform: translateY(0); }
  .sheet-handle {
    width: 36px; height: 4px; border-radius: 999px;
    background: var(--ink-4); opacity: 0.5;
    margin: 8px auto 2px;
  }
  .sheet-backdrop {
    display: block;
    position: fixed; inset: 0; z-index: 55;
    background: rgba(23, 19, 16, 0.4);
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .sheet-backdrop.open { opacity: 1; pointer-events: auto; }

  /* Persistent CTA bar: the trade view's mobile entry point. */
  .mobile-cta-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    display: flex; gap: 10px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: var(--bg);
    border-top: 1px solid var(--line);
  }
  .mobile-cta-bar button {
    flex: 1; min-height: 48px;
    border-radius: 12px;
    font-size: 15px; font-weight: 600; color: #fff;
    font-variant-numeric: tabular-nums;
  }
  .mobile-cta-bar .yes { background: var(--pos); }
  .mobile-cta-bar .no  { background: var(--neg); }
  /* Ended-market state: one honest status bar instead of Buy buttons. */
  .mobile-cta-bar .ended { background: var(--ink-4); cursor: default; }

  /* 44px touch targets on primary controls (Apple HIG floor). Book rows
     stay denser (40px) — they're a ladder, and tap-to-fill forgives a
     near-miss by filling the adjacent level's price. */
  .entry-body button,
  .entry-tabs button,
  .type-row button,
  .pct-row button,
  .px-chips button,
  .bp-tabs button,
  .activity-tabs button,
  .cat-tabs button,
  .mc-actions button,
  .modal-toggle button,
  .submit-btn,
  .cta { min-height: 44px; }
  .book-row { padding: 6px 12px; min-height: 40px; align-items: center; }
  .ord-table .cancel, .ord-table .claim-btn { padding: 8px 12px; }

  /* Modals go near-full-width; sheet-like corners. */
  .modal-back { padding: 12px; align-items: flex-end; }
  .modal { width: 100%; border-radius: 16px 16px 0 0; }

  .fund-wrap { max-width: 100%; }
  .toast { bottom: calc(78px + env(safe-area-inset-bottom)); } /* above the CTA bar */
}

/* ===== Reduced motion — kill every decorative animation; state changes
   still happen, they just don't animate. ===== */
@media (prefers-reduced-motion: reduce) {
  .countdown-chip.urgent,
  .iridescent,
  .toast,
  .net-pill .dot { animation: none; }
  .entry-sheet, .sheet-backdrop, .prob-bar .fill { transition: none; }
  .spinner, .toast .spin { animation-duration: 1.6s; } /* keep spinners telling the truth, just calmer */
}
