/* ==========================================================================
   PDEX6900 Index — styles
   Layout: a fund factsheet on warm paper. Sticky two-tier header, sections
   ruled by hairlines with a title/lede head row, every figure set in mono.
   Identity: ink + ultramarine (NAV, target, the index itself), orange
   (market deviation), highlighter lime (demo labels, arbitrage band).
   ========================================================================== */

:root {
  /* Colour */
  --paper: #f2f0ea;
  --sheet: #fbfaf6;
  --sunk: #e9e6dd;
  --ink: #17160f;
  --ink-2: #4e4b42;
  --muted: #6c685d;
  --line: #dedacf;
  --line-strong: #c6c1b3;
  --accent: #3341e6;
  --accent-strong: #2531c4;
  --accent-soft: #e3e5fb;
  --orange: #e0702a;
  --orange-ink: #a64812;
  --orange-soft: #f9e4d4;
  --lime: #d2ef5a;
  --lime-soft: #edf7c6;
  --lime-ink: #2d3a00;
  --up: #0b7a4b;
  --up-soft: #dcf0e4;
  --down: #c0392f;
  --down-soft: #f8e0dd;
  --on-ink: #f7f5ef;
  --scrim: rgba(23, 22, 15, 0.42);

  /* Type */
  --font-display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Martian Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-2xs: 0.6875rem;
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-base: 0.9375rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.3125rem;
  --fs-xl: clamp(1.75rem, 1.25rem + 1.5vw, 2.5rem);
  --fs-hero: clamp(3.1rem, 1.4rem + 7vw, 6.75rem);

  /* Shape */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --header-h: 124px;
  --gutter: clamp(16px, 4vw, 40px);

  color-scheme: light;
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
p { margin: 0; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { max-width: 100%; }
ul, ol { margin: 0; padding: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 600;
}
.skip-link:focus { top: 12px; color: var(--on-ink); }

.wrap {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.mono, .num {
  font-family: var(--font-mono);
  font-stretch: 87.5%;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.icon {
  width: 18px; height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-sm { width: 15px; height: 15px; }

.up { color: var(--up); }
.down { color: var(--down); }

/* ---------- Badges & chips ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-stretch: 87.5%;
  font-size: var(--fs-2xs);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1.5;
}
.badge-demo { background: var(--lime); color: var(--lime-ink); }
.badge-sim { background: var(--lime-soft); color: var(--lime-ink); border: 1px solid var(--lime); }
.badge-placeholder { background: var(--sunk); color: var(--ink-2); }
.badge-proposed { background: var(--orange-soft); color: var(--orange-ink); }
.badge-out { background: var(--orange-soft); color: var(--orange-ink); }
.badge-ink { background: var(--ink); color: var(--on-ink); }
.badge-accent { background: var(--accent-soft); color: var(--accent-strong); }
.badge-up { background: var(--up-soft); color: var(--up); }
.badge-down { background: var(--down-soft); color: var(--down); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.delta-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-stretch: 87.5%;
  font-size: var(--fs-md);
  font-weight: 500;
}
.delta-pill.up { background: var(--up-soft); }
.delta-pill.down { background: var(--down-soft); }
.delta-pill small { font-size: var(--fs-xs); color: var(--ink-2); font-weight: 400; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  --btn-bd: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  font-size: var(--fs-base);
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.btn:hover { --btn-bg: var(--sheet); --btn-bd: var(--ink); color: var(--btn-fg); }
.btn:active { transform: translateY(1px); }
.btn-primary { --btn-bg: var(--accent); --btn-fg: #fff; --btn-bd: var(--accent); }
.btn-primary:hover { --btn-bg: var(--accent-strong); --btn-bd: var(--accent-strong); --btn-fg: #fff; }
.btn-ink { --btn-bg: var(--ink); --btn-fg: var(--on-ink); --btn-bd: var(--ink); }
.btn-ink:hover { --btn-bg: #000; --btn-fg: var(--on-ink); }
.btn-sm { min-height: 36px; padding: 7px 14px; font-size: var(--fs-sm); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
}
.icon-btn:hover { background: var(--sunk); color: var(--ink); }

.copy-btn {
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  flex: none;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--sheet);
  color: var(--ink-2);
}
.copy-btn:hover { border-color: var(--ink); color: var(--ink); }
.copy-btn.is-done { color: var(--up); border-color: var(--up); }

.link-btn {
  border: 0;
  padding: 0;
  background: none;
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.link-btn:hover { color: var(--accent-strong); }

/* Segmented control */
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 999px;
  background: var(--sunk);
}
.seg button {
  min-width: 52px;
  min-height: 34px;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-stretch: 87.5%;
  font-size: var(--fs-xs);
  font-weight: 500;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-checked="true"],
.seg button[aria-selected="true"] {
  background: var(--sheet);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(23, 22, 15, 0.12);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-2);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.chip-count { font-family: var(--font-mono); font-stretch: 87.5%; font-size: var(--fs-2xs); opacity: 0.75; }

/* ---------- Demo strip & header ---------- */
.demo-strip {
  background: var(--ink);
  color: var(--on-ink);
  font-size: var(--fs-sm);
}
.demo-strip .wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-block: 7px;
  flex-wrap: wrap;
}
.demo-strip a { color: var(--lime); }
.demo-strip a:hover { color: #fff; }
.demo-strip .badge { flex: none; }

.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .site-header { background: var(--paper); }
}

.header-row {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  flex: none;
}
.brand:hover { color: var(--ink); }
.brand-mark { width: 44px; height: 44px; display: block; flex: none; border-radius: 10px; }
.footer-brand .brand-mark { box-shadow: 0 0 0 1px rgba(247, 245, 239, 0.16); }
.brand-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.header-quote {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--sheet);
  font-family: var(--font-mono);
  font-stretch: 87.5%;
  font-size: var(--fs-xs);
  white-space: nowrap;
}
.header-quote .hq-ticker { font-weight: 600; }
.header-quote .hq-label { color: var(--muted); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.wallet-btn .sim-tag {
  font-family: var(--font-mono);
  font-stretch: 87.5%;
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--lime);
  color: var(--lime-ink);
  padding: 2px 6px;
  border-radius: 999px;
}
.wallet-btn.is-connected { --btn-bg: var(--sheet); --btn-bd: var(--line-strong); }
.wallet-btn .wallet-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--up); display: none; }
.wallet-btn.is-connected .wallet-dot { display: inline-block; }

.menu-btn { display: none; }

.site-nav { border-top: 1px solid var(--line); }
.nav-list {
  list-style: none;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-inline: -10px;
}
.nav-list::-webkit-scrollbar { display: none; }
.nav-list a {
  position: relative;
  display: block;
  padding: 13px 10px 12px;
  color: var(--ink-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.nav-list a:hover { color: var(--ink); }
.nav-list a[aria-current="true"] { color: var(--ink); }
.nav-list a[aria-current="true"]::after {
  content: "";
  position: absolute;
  left: 10px; right: 10px; bottom: -1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

@media (max-width: 960px) {
  :root { --header-h: 80px; }
  .menu-btn { display: inline-grid; }
  .header-quote { display: none; }
  .site-nav {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 100%;
    background: var(--paper);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px -18px rgba(23, 22, 15, 0.35);
    max-height: calc(100dvh - 120px);
    overflow-y: auto;
  }
  .site-nav.is-open { display: block; }
  .nav-list { flex-direction: column; margin-inline: 0; padding-block: 8px; }
  .nav-list a { padding: 13px 4px; font-size: var(--fs-md); border-bottom: 1px solid var(--line); }
  .nav-list li:last-child a { border-bottom: 0; }
  .nav-list a[aria-current="true"]::after { left: 0; right: auto; top: 12px; bottom: 12px; width: 3px; height: auto; }
  .nav-list a[aria-current="true"] { padding-left: 14px; }
}
@media (max-width: 520px) {
  .wallet-btn .wallet-label { display: none; }
  .wallet-btn { padding-inline: 12px; }
  .brand-name { font-size: 1.125rem; }
  .demo-strip .strip-extra { display: none; }
}

/* ---------- Sections ---------- */
.section {
  padding-block: clamp(56px, 7vw, 96px);
  border-top: 1px solid var(--line);
}
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 16px 48px;
  align-items: end;
  margin-bottom: clamp(28px, 4vw, 44px);
}
.section-head > * { min-width: 0; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-stretch: 87.5%;
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.section-head h2 { font-size: var(--fs-xl); }
.lede { color: var(--ink-2); font-size: var(--fs-md); max-width: 62ch; }
.section-sub { margin-top: clamp(40px, 5vw, 64px); }
.sub-title { font-size: var(--fs-lg); margin-bottom: 16px; }

@media (max-width: 860px) {
  .section-head { grid-template-columns: minmax(0, 1fr); align-items: start; }
}

.panel {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  min-width: 0;
}

.callout {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--sheet);
  color: var(--ink-2);
  font-size: var(--fs-sm);
}
.callout .icon { margin-top: 2px; color: var(--ink); }
.callout strong { color: var(--ink); }
.callout-lime { background: var(--lime-soft); border-color: var(--lime); color: var(--lime-ink); }
.callout-lime .icon, .callout-lime strong { color: var(--lime-ink); }
.callout-orange { background: var(--orange-soft); border-color: #f0c2a0; color: #5b2a0b; }
.callout-orange .icon, .callout-orange strong { color: #5b2a0b; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(36px, 5vw, 64px) clamp(48px, 6vw, 80px); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 6fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
}
.hero-main { min-width: 0; }
.hero-id { display: flex; align-items: center; gap: clamp(12px, 2vw, 20px); margin-bottom: 26px; }
.hero-coin {
  width: clamp(64px, 8vw, 96px);
  height: auto;
  aspect-ratio: 1;
  max-width: 100%;
  flex: none;
  border-radius: 22%;
  box-shadow: 0 0 0 3px var(--sheet), 0 14px 30px -12px rgba(23, 22, 15, 0.55);
}
.hero-title { font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.75rem); min-width: 0; }
.hero-title .muted { color: var(--muted); font-weight: 500; }
.level-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.level-row {
  display: flex;
  align-items: center;
  gap: 8px 20px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.level-value {
  font-family: var(--font-mono);
  font-stretch: 87.5%;
  font-size: var(--fs-hero);
  font-weight: 350;
  line-height: 1;
  letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.hero-lede { margin-top: 22px; color: var(--ink-2); font-size: var(--fs-md); max-width: 50ch; }

.spark {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  max-width: 520px;
}
.spark svg { flex: 1; min-width: 0; height: 52px; overflow: visible; }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 1.75; stroke-linejoin: round; }
.spark-area { stroke: none; }
.spark-end { fill: var(--accent); stroke: var(--paper); stroke-width: 2; }
.spark-meta { flex: none; text-align: right; font-family: var(--font-mono); font-stretch: 87.5%; font-size: var(--fs-xs); color: var(--muted); line-height: 1.4; }
.spark-meta b { display: block; font-weight: 500; font-size: var(--fs-sm); }

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--ink);
}
.metric {
  padding: 16px 14px 16px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.metric:not(:nth-child(3n + 1)) { padding-left: 14px; border-left: 1px solid var(--line); }
.metric dt { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; letter-spacing: 0.01em; }
.metric dd {
  margin: 6px 0 0;
  font-family: var(--font-mono);
  font-stretch: 87.5%;
  font-variant-numeric: tabular-nums;
  font-size: clamp(1rem, 0.85rem + 0.5vw, 1.25rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}
.metric dd a { color: var(--accent); }
.metric .metric-note { display: block; margin-top: 4px; font-size: var(--fs-xs); color: var(--muted); }

.addresses {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: clamp(28px, 4vw, 44px);
}
.addr {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--sheet);
  min-width: 0;
}
.addr-text { min-width: 0; flex: 1; }
.addr-label { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); }
.addr-value {
  display: block;
  margin-top: 3px;
  font-family: var(--font-mono);
  font-stretch: 75%;
  font-size: var(--fs-xs);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .addresses { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:not(:nth-child(3n + 1)) { padding-left: 0; border-left: 0; }
  .metric:nth-child(even) { padding-left: 14px; border-left: 1px solid var(--line); }
  .metric.metric-wide { grid-column: 1 / -1; }
}

/* ---------- Premium gauge ---------- */
.gauge-panel {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 0;
  overflow: hidden;
}
.gauge-visual {
  padding: 28px 28px 24px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.gauge-svg { width: 100%; max-width: 380px; height: auto; display: block; }
.g-track { fill: none; stroke: var(--sunk); stroke-width: 18; }
.g-zone-dis { fill: none; stroke: var(--accent-soft); stroke-width: 18; }
.g-zone-pre { fill: none; stroke: var(--orange-soft); stroke-width: 18; }
.g-band { fill: none; stroke: var(--lime); stroke-width: 18; }
.g-band-edge { stroke: var(--lime-ink); stroke-width: 1.5; }
.g-tick { stroke: var(--line-strong); stroke-width: 1.5; }
.g-tick-major { stroke: var(--ink-2); }
.g-label { fill: var(--muted); font-family: var(--font-mono); font-stretch: 87.5%; font-size: 11px; }
.g-label-zero { fill: var(--ink); font-weight: 600; }
.g-needle { transform-box: view-box; transition: transform 0.5s cubic-bezier(0.3, 1.4, 0.5, 1); }
.g-needle line { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.g-hub { fill: var(--ink); }
.g-hub-inner { fill: var(--sheet); }

.gauge-readout { text-align: center; margin-top: -6px; }
.gauge-value {
  font-family: var(--font-mono);
  font-stretch: 87.5%;
  font-size: clamp(1.9rem, 1.4rem + 1.5vw, 2.5rem);
  font-weight: 400;
  letter-spacing: -0.05em;
  line-height: 1.1;
}
.gauge-caption { color: var(--muted); font-size: var(--fs-sm); }
.gauge-ends {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 380px;
  margin-top: 6px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--muted);
}

.gauge-info { padding: 28px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.state-card { padding: 16px 18px; border-radius: var(--r-sm); border: 1px solid var(--line); }
.state-card h3 { font-size: var(--fs-md); display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.state-card p { color: var(--ink-2); font-size: var(--fs-sm); }
.state-card[data-tone="in"] { background: var(--lime-soft); border-color: var(--lime); }
.state-card[data-tone="pre"] { background: var(--orange-soft); border-color: #f0c2a0; }
.state-card[data-tone="dis"] { background: var(--accent-soft); border-color: #c4c9f7; }
.state-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.state-card[data-tone="in"] .state-dot { background: var(--lime-ink); }
.state-card[data-tone="pre"] .state-dot { background: var(--orange); }
.state-card[data-tone="dis"] .state-dot { background: var(--accent); }

.sim-control label { display: flex; justify-content: space-between; gap: 12px; font-size: var(--fs-sm); font-weight: 600; margin-bottom: 8px; }
.sim-control label output { font-family: var(--font-mono); font-stretch: 87.5%; font-weight: 500; }
.sim-row { display: flex; gap: 12px; align-items: center; }
.sim-row input[type="range"] { flex: 1; min-width: 0; }
input[type="range"] { accent-color: var(--accent); height: 28px; }

.kv-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
}
.kv-grid > div { padding: 12px 12px 0 0; min-width: 0; }
.kv-grid dt { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.kv-grid dd { margin: 4px 0 0; font-family: var(--font-mono); font-stretch: 87.5%; font-size: var(--fs-sm); font-weight: 500; font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .gauge-panel { grid-template-columns: minmax(0, 1fr); }
  .gauge-visual { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 520px) {
  .kv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gauge-info, .gauge-visual { padding: 20px 18px; }
}

/* ---------- Performance ---------- */
.perf-toolbar {
  display: flex;
  align-items: center;
  gap: 12px 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.perf-range { color: var(--muted); font-size: var(--fs-sm); }
.perf-toolbar .btn { margin-left: auto; }

.perf-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 18px;
  border-top: 1px solid var(--ink);
}
.perf-stats > div { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.perf-stats > div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.perf-stats dt { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.perf-stats dd { margin: 4px 0 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.perf-stats .big { font-family: var(--font-mono); font-stretch: 87.5%; font-size: var(--fs-lg); font-weight: 450; letter-spacing: -0.04em; }
.perf-stats .small { font-family: var(--font-mono); font-stretch: 87.5%; font-size: var(--fs-xs); }
@media (max-width: 760px) {
  .perf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .perf-stats > div + div { padding-left: 0; border-left: 0; }
  .perf-stats > div:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--line); }
}

.perf-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}
@media (max-width: 1060px) { .perf-grid { grid-template-columns: minmax(0, 1fr); } }

.chart-card { margin: 0; padding: 20px 20px 12px; }
.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.chart-head h3 { font-size: var(--fs-md); }
.chart-sub { color: var(--muted); font-size: var(--fs-xs); margin-top: 3px; }
.chart-now { font-family: var(--font-mono); font-stretch: 87.5%; font-size: var(--fs-md); font-weight: 500; text-align: right; }
.chart-now small { display: block; font-size: var(--fs-2xs); color: var(--muted); font-weight: 400; }
.chart-subhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  flex-wrap: wrap;
}
.chart-subhead h4 { font-size: var(--fs-sm); font-family: var(--font-body); font-weight: 600; letter-spacing: 0; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; font-size: var(--fs-xs); color: var(--ink-2); }
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.key-line { width: 16px; height: 0; border-top: 2.5px solid currentColor; border-radius: 2px; }
.key-swatch { width: 14px; height: 10px; border-radius: 2px; }
.key-tick { width: 2px; height: 12px; background: var(--ink); border-radius: 1px; }

.chart { position: relative; width: 100%; touch-action: pan-y; }
.chart:focus-visible { outline-offset: 4px; }
.chart svg { display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.chart .baseline { stroke: var(--line-strong); stroke-width: 1; shape-rendering: crispEdges; }
.chart .zero { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .tick { fill: var(--muted); font-family: var(--font-mono); font-stretch: 87.5%; font-size: 10.5px; }
.chart .band { fill: var(--lime-soft); }
.chart .band-edge { stroke: var(--lime); stroke-width: 1.5; }
.chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .end-dot { stroke: var(--sheet); stroke-width: 2; }
.chart .xhair { stroke: var(--ink); stroke-width: 1; shape-rendering: crispEdges; }
.chart .xhair-dot { stroke: var(--sheet); stroke-width: 2; }
.chart .hit { fill: transparent; cursor: crosshair; }

.chart-tip {
  position: absolute;
  top: 6px;
  z-index: 3;
  min-width: 168px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: var(--fs-xs);
  pointer-events: none;
  box-shadow: 0 10px 24px -10px rgba(23, 22, 15, 0.5);
}
.chart-tip .tip-time { color: #bdb8aa; font-family: var(--font-mono); font-stretch: 87.5%; font-size: var(--fs-2xs); margin-bottom: 6px; }
.chart-tip .tip-row { display: grid; grid-template-columns: 14px auto 1fr; align-items: center; gap: 8px; }
.chart-tip .tip-row + .tip-row { margin-top: 4px; }
.chart-tip .tip-key { width: 14px; border-top: 2.5px solid; border-radius: 2px; }
.chart-tip .tip-val { font-family: var(--font-mono); font-stretch: 87.5%; font-weight: 600; font-size: var(--fs-sm); }
.chart-tip .tip-lab { color: #bdb8aa; }

/* ---------- Holdings ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 240px;
  max-width: 340px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--sheet);
  color: var(--muted);
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; color: var(--ink); padding: 8px 0; }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.toolbar .legend { margin: 0 0 0 auto; }
@media (max-width: 900px) { .toolbar .legend { margin-left: 0; width: 100%; } }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--sheet);
  -webkit-overflow-scrolling: touch;
}
table { border-collapse: collapse; width: 100%; }
.data { font-size: var(--fs-sm); }
.data th, .data td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.data thead th {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--muted);
  background: var(--sheet);
  position: sticky;
  top: 0;
  z-index: 1;
}
.data tbody tr:last-child > * { border-bottom: 0; }
.data tbody tr:hover > * { background: #f5f3ec; }
.data .num { text-align: right; font-size: var(--fs-xs); }
.data th.num { font-family: var(--font-body); font-stretch: 100%; letter-spacing: 0; }
.data tfoot td, .data tfoot th { border-top: 1px solid var(--ink); border-bottom: 0; font-weight: 600; background: var(--sheet); }

.holdings { min-width: 980px; }
.holdings .col-token { position: sticky; left: 0; z-index: 2; background: var(--sheet); }
.holdings thead .col-token { z-index: 3; }
.holdings tbody th { font-weight: 400; }
.holdings tbody tr:hover > .col-token { background: #f5f3ec; }

.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  padding: 2px 0;
  background: none;
  color: inherit;
  font-weight: 600;
  font-size: inherit;
}
.sort-btn:hover { color: var(--ink); }
.sort-btn .sort-ind { width: 10px; text-align: center; font-size: 10px; opacity: 0.35; }
th[aria-sort] .sort-btn { color: var(--ink); }
th[aria-sort] .sort-ind { opacity: 1; }
th.num .sort-btn { flex-direction: row-reverse; }

.tok { display: flex; align-items: center; gap: 10px; }
.tok-av {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  flex: none;
  border-radius: 50%;
  background: hsl(var(--h) 62% 86%);
  color: hsl(var(--h) 52% 24%);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: -0.02em;
  box-shadow: inset 0 0 0 1px hsl(var(--h) 40% 72%);
}
.tok-av.sm { width: 24px; height: 24px; font-size: 0.625rem; }
.tok-av { position: relative; overflow: hidden; }
.tok-av img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  background: var(--sheet);
}
.tok-id { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.tok-name {
  display: block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--ink);
}
a.tok-name { text-decoration: none; }
a.tok-name:hover { color: var(--accent); text-decoration: underline; }
.tok-tick { font-family: var(--font-mono); font-stretch: 87.5%; font-size: var(--fs-2xs); color: var(--muted); }

.wcell { display: flex; align-items: center; gap: 12px; min-width: 210px; }
.wbar {
  position: relative;
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: var(--sunk);
}
.wbar-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  border-radius: 999px;
  background: var(--accent);
}
.is-out .wbar-fill { background: var(--orange); }
.wbar-target {
  position: absolute;
  top: -4px; bottom: -4px;
  width: 2px;
  margin-left: -1px;
  background: var(--ink);
  border-radius: 1px;
  box-shadow: 0 0 0 1.5px var(--sheet);
}
.wcell .num { width: 56px; text-align: right; font-size: var(--fs-xs); }
.drift-cell { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.drift-cell .badge { font-size: 0.625rem; padding: 2px 7px; }
.muted { color: var(--muted); }
.empty-row td { padding: 36px 16px; text-align: center; color: var(--muted); white-space: normal; }

.table-note { margin-top: 10px; color: var(--muted); font-size: var(--fs-xs); }

/* ---------- Portfolio ---------- */
.pf-empty {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  overflow: hidden;
}
.pf-empty-copy { padding: clamp(24px, 4vw, 40px); display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.pf-empty-copy h3 { font-size: var(--fs-lg); }
.pf-empty-copy p { color: var(--ink-2); max-width: 46ch; }
.pf-empty-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--sunk); color: var(--ink); }
.pf-empty-icon .icon { width: 24px; height: 24px; }
.pf-empty-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.pf-ghost {
  position: relative;
  border-left: 1px solid var(--line);
  background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(23, 22, 15, 0.025) 10px 11px), var(--paper);
  padding: 28px;
  display: grid;
  gap: 14px;
  align-content: center;
}
.ghost-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ghost-block { height: 64px; border-radius: 10px; background: var(--sheet); border: 1px solid var(--line); position: relative; overflow: hidden; }
.ghost-block::before, .ghost-block::after { content: ""; position: absolute; left: 12px; height: 8px; border-radius: 4px; background: var(--sunk); }
.ghost-block::before { top: 14px; width: 45%; }
.ghost-block::after { top: 34px; width: 70%; height: 14px; background: var(--line); }
.ghost-bars { height: 120px; border-radius: 10px; background: var(--sheet); border: 1px solid var(--line); padding: 16px; display: grid; gap: 10px; }
.ghost-bars span { height: 8px; border-radius: 4px; background: var(--sunk); }
.ghost-label {
  position: absolute;
  inset: auto 50% 50% auto;
  transform: translate(50%, 50%);
}
@media (max-width: 860px) {
  .pf-empty { grid-template-columns: minmax(0, 1fr); }
  .pf-ghost { border-left: 0; border-top: 1px solid var(--line); }
}

.pf-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.pf-wallet { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pf-avatar { width: 40px; height: 40px; border-radius: 12px; background: var(--ink); display: grid; place-items: center; color: var(--lime); flex: none; }
.pf-wallet-name { font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pf-wallet-addr { font-family: var(--font-mono); font-stretch: 75%; font-size: var(--fs-xs); color: var(--muted); overflow-wrap: anywhere; }
.pf-top-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.pf-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0 0 16px;
  border-top: 1px solid var(--ink);
}
.pf-stats > div { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.pf-stats > div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.pf-stats dt { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.pf-stats dd { margin: 4px 0 0; font-family: var(--font-mono); font-stretch: 87.5%; font-size: var(--fs-lg); font-weight: 450; letter-spacing: -0.04em; overflow-wrap: anywhere; }
.pf-stats dd small { display: block; font-size: var(--fs-2xs); letter-spacing: 0; color: var(--muted); font-weight: 400; margin-top: 2px; }
@media (max-width: 960px) {
  .pf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* first stat spans the row; the rest pair up, right column ruled */
  .pf-stats > div:first-child { grid-column: 1 / -1; }
  .pf-stats > div + div { padding-left: 0; border-left: 0; }
  .pf-stats > div:nth-child(odd):not(:first-child) { padding-left: 16px; border-left: 1px solid var(--line); }
}

.pf-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px; }
@media (max-width: 960px) { .pf-grid { grid-template-columns: minmax(0, 1fr); } }
.pf-card { padding: 20px; }
.pf-card h3 { font-size: var(--fs-md); }
.pf-card .card-sub { color: var(--muted); font-size: var(--fs-xs); margin: 3px 0 14px; }

.lt-list { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.lt-list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.lt-list .lt-name { flex: 1; min-width: 0; font-weight: 600; font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-list .lt-vals { text-align: right; font-family: var(--font-mono); font-stretch: 87.5%; font-size: var(--fs-2xs); line-height: 1.4; }
.lt-list .lt-vals b { display: block; font-size: var(--fs-xs); font-weight: 500; }
@media (max-width: 560px) { .lt-list { grid-template-columns: minmax(0, 1fr); } }

.activity { list-style: none; }
.activity li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.activity li:last-child { border-bottom: 0; }
.act-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--sunk); color: var(--ink); }
.act-main { min-width: 0; font-size: var(--fs-sm); }
.act-main b { font-weight: 600; }
.act-main span { display: block; color: var(--muted); font-size: var(--fs-xs); }
.act-amt { text-align: right; font-family: var(--font-mono); font-stretch: 87.5%; font-size: var(--fs-xs); }
.act-amt span { display: block; color: var(--muted); font-size: var(--fs-2xs); }

/* ---------- Buy ---------- */
.buy-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 16px; align-items: start; }
@media (max-width: 960px) { .buy-grid { grid-template-columns: minmax(0, 1fr); } }
.swap { padding: 20px; }
.swap-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.swap-head h3 { font-size: var(--fs-lg); }

.field-box {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.field-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-box > label, .field-box > .label { display: block; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.field-row { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.field-row input, .field-row output {
  flex: 1 1 auto;
  width: 0; /* drop the input's intrinsic width so narrow screens never overflow */
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 2px 0;
  outline: none;
  font-family: var(--font-mono);
  font-stretch: 87.5%;
  font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.field-row select {
  flex: none;
  min-height: 40px;
  padding: 6px 30px 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--sheet) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2317160f' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  -webkit-appearance: none;
  appearance: none;
  font-weight: 600;
  font-size: var(--fs-sm);
}
.unit-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 700;
  font-size: var(--fs-sm);
}
.unit-pill .brand-mark { width: 28px; height: 28px; }
.brand-mark.coin { border-radius: 7px; }
.field-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; font-size: var(--fs-xs); color: var(--muted); flex-wrap: wrap; }
.field-foot .mono { font-size: var(--fs-2xs); }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick button {
  border: 1px solid var(--line-strong);
  background: var(--sheet);
  border-radius: 999px;
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-stretch: 87.5%;
  font-size: var(--fs-2xs);
  color: var(--ink-2);
  min-height: 28px;
}
.quick button:hover { border-color: var(--ink); color: var(--ink); }
.swap-arrow {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  margin: -10px auto;
  position: relative;
  z-index: 1;
  border-radius: 10px;
  background: var(--sheet);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.slip-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 6px; flex-wrap: wrap; font-size: var(--fs-sm); font-weight: 600; }

.quote { margin: 8px 0 16px; }
.quote > div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: var(--fs-sm); }
.quote > div:last-child { border-bottom: 0; }
.quote dt { color: var(--ink-2); }
.quote dd { margin: 0; font-family: var(--font-mono); font-stretch: 87.5%; font-size: var(--fs-xs); font-weight: 500; text-align: right; }
.form-error { color: var(--down); font-size: var(--fs-sm); margin-bottom: 12px; font-weight: 600; }
.form-hint { color: var(--muted); font-size: var(--fs-xs); margin-top: 10px; text-align: center; }

.buy-side { display: grid; gap: 16px; min-width: 0; }
.compare { padding: 20px; }
.compare h3 { font-size: var(--fs-md); margin-bottom: 4px; }
.compare .card-sub { color: var(--muted); font-size: var(--fs-xs); margin-bottom: 14px; }
.route { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); align-items: center; }
.route + .route { margin-top: 8px; }
.route.is-best { border-color: var(--accent); background: var(--accent-soft); }
.route-name { font-weight: 700; font-size: var(--fs-sm); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.route-val { font-family: var(--font-mono); font-stretch: 87.5%; font-size: var(--fs-sm); font-weight: 500; text-align: right; }
.route-desc { grid-column: 1 / -1; color: var(--ink-2); font-size: var(--fs-xs); }
.compare-note { margin-top: 12px; font-size: var(--fs-xs); color: var(--ink-2); }

.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--ink); margin: 0; }
.mini-stats > div { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.mini-stats > div + div { padding-left: 12px; border-left: 1px solid var(--line); }
.mini-stats dt { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.mini-stats dd { margin: 4px 0 0; font-family: var(--font-mono); font-stretch: 87.5%; font-size: var(--fs-sm); font-weight: 500; }

.notes { list-style: none; display: grid; gap: 10px; font-size: var(--fs-sm); color: var(--ink-2); }
.notes li { display: flex; gap: 10px; }
.notes li .icon { color: var(--ink); margin-top: 2px; }

/* ---------- Buy: live Jupiter swaps ---------- */
/* Jupiter Plugin theme, as "R, G, B" triplets. The plugin is built for dark
   surfaces, so the swap card is a dark "terminal" panel in the PDEX green. */
:root {
  --jupiter-plugin-primary: 59, 227, 138;
  --jupiter-plugin-background: 10, 14, 16;
  --jupiter-plugin-primaryText: 236, 247, 241;
  --jupiter-plugin-warning: 251, 191, 36;
  --jupiter-plugin-interactive: 31, 41, 45;
  --jupiter-plugin-module: 18, 25, 28;
  --swap-bg: #0a0e10;
  --swap-line: rgba(59, 227, 138, 0.2);
  --swap-ink: #ecf7f1;
  --swap-muted: #93a89d;
}
.jup-panel {
  padding: 20px;
  background: var(--swap-bg);
  border-color: var(--swap-line);
  color: var(--swap-ink);
  background-image: radial-gradient(120% 70% at 100% 0%, rgba(34, 196, 110, 0.18), transparent 60%);
}
.jup-panel .swap-head h3 { color: var(--swap-ink); }
.jup-panel .badge-up { background: rgba(59, 227, 138, 0.16); color: #3be38a; }
.jup-panel .form-hint { color: var(--swap-muted); }
.jup-panel .badge-placeholder { background: rgba(236, 247, 241, 0.1); color: var(--swap-ink); }
.jup-pending {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 12px;
  min-height: 480px;
  padding: 32px 24px;
  border: 1px dashed var(--swap-line);
  border-radius: 12px;
  text-align: center;
}
.jup-pending img { width: 84px; height: 84px; border-radius: 22%; box-shadow: 0 0 0 1px var(--swap-line), 0 16px 40px -12px rgba(34, 196, 110, 0.45); }
.jup-pending h4 { font-size: var(--fs-lg); color: var(--swap-ink); }
.jup-pending p { max-width: 40ch; color: var(--swap-muted); font-size: var(--fs-sm); }
.ti-pending { margin-top: 6px; color: var(--muted); font-size: var(--fs-sm); }
.ti-head .tok-av { border-radius: 22%; }
.ti-head .tok-av img { border-radius: 22%; }
.sim-details { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 16px; }
.sim-details > summary {
  cursor: pointer;
  width: fit-content;
  color: var(--ink-2);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.sim-details > summary:hover { color: var(--ink); }
.sim-details[open] > summary { margin-bottom: 16px; }
.jup-target { min-height: 480px; }
.jup-status {
  display: grid;
  place-items: center;
  min-height: 480px;
  margin: 0;
  border: 1px dashed var(--swap-line);
  border-radius: 12px;
  color: var(--swap-muted);
  font-size: var(--fs-sm);
}
.jup-fallback {
  display: grid;
  gap: 14px;
  justify-items: start;
  padding: 24px;
  border: 1px dashed var(--swap-line);
  border-radius: 12px;
  color: var(--swap-muted);
}
.token-info { padding: 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.token-info > * { min-width: 0; }
.ti-head { display: flex; align-items: center; gap: 12px; }
.ti-head .tok-av { width: 44px; height: 44px; font-size: 0.875rem; }
.ti-id { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.ti-name { font-family: var(--font-display); font-size: var(--fs-md); font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ti-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin: 0; padding-top: 14px; border-top: 1px solid var(--line); }
.ti-grid dt { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.ti-grid dd { margin: 3px 0 0; font-family: var(--font-mono); font-stretch: 87.5%; font-size: var(--fs-md); font-weight: 500; }
.ti-grid dd small { display: block; font-size: var(--fs-2xs); color: var(--muted); font-weight: 400; }
.ti-label { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.token-info .cmd { margin-top: 6px; }
.ti-links { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: var(--fs-sm); font-weight: 600; }
.ti-links a { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; }
.ti-links a:hover { text-decoration: underline; }

/* ---------- Launch: hero, chart, wallet, token facts ---------- */
.metrics .metric-wide { grid-column: 1 / -1; }
.level-value.up { color: var(--up); }
.level-value.down { color: var(--down); }

.chart-embed { overflow: hidden; background: #0a0e10; border-color: var(--swap-line); }
.chart-embed iframe { display: block; width: 100%; height: min(560px, 70vh); min-height: 380px; border: 0; }

.wallet-list { display: grid; gap: 8px; }
.wallet-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--sheet);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  text-align: left;
}
.wallet-opt:hover { border-color: var(--ink); color: var(--ink); }
.wallet-opt > span:nth-of-type(1) { flex: 1; }
.wallet-opt-note { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); color: var(--muted); font-weight: 500; }

.pf-stats.pf-stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 960px) { .pf-stats.pf-stats-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.facts-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 960px) { .facts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .facts-grid { grid-template-columns: minmax(0, 1fr); } }
.fact { padding: 18px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; }
.fact-label { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.fact-value { font-family: var(--font-mono); font-stretch: 87.5%; font-size: var(--fs-lg); font-weight: 500; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.fact .badge { white-space: normal; text-align: left; }
.fact-ca { margin-top: 16px; padding: 20px; display: grid; gap: 10px; }
.fact-ca .cmd { margin-top: 0; }

/* ---------- Create & Redeem ---------- */
.cr-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 16px; align-items: start; }
@media (max-width: 960px) { .cr-grid { grid-template-columns: minmax(0, 1fr); } }
.cr-panel { padding: 20px; }
.cr-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.cr-input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
@media (max-width: 560px) { .cr-input-row { grid-template-columns: minmax(0, 1fr); } }
.basket-wrap { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; overflow: auto; max-height: 420px; }
.basket { min-width: 460px; }
.basket th, .basket td { padding: 9px 14px; }
.cr-totals { margin: 16px 0; }

.cr-side { display: grid; gap: 16px; min-width: 0; }
.steps-card { padding: 20px; }
.steps-card h3 { font-size: var(--fs-md); margin-bottom: 12px; }
.steps { list-style: none; counter-reset: step; display: grid; gap: 12px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 28px 1fr; gap: 10px; font-size: var(--fs-sm); color: var(--ink-2); }
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-stretch: 87.5%;
  font-size: var(--fs-2xs);
  color: var(--ink);
}
.steps li b { color: var(--ink); }

/* ---------- Auctions ---------- */
.auction-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 16px; }
.auction { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.auction-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.auction-head .tok-name { font-size: var(--fs-md); }
.auction-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin: 0; }
.auction-kv dt { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.auction-kv dd { margin: 3px 0 0; font-family: var(--font-mono); font-stretch: 87.5%; font-size: var(--fs-sm); font-weight: 500; overflow-wrap: anywhere; }
.auction-kv dd small { display: block; font-size: var(--fs-2xs); color: var(--muted); font-weight: 400; }
.curve {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-rows: 80px auto;
  font-family: var(--font-mono);
  font-stretch: 87.5%;
  font-size: 10px;
  color: var(--muted);
}
.curve-axis { position: relative; }
.curve-axis span { position: absolute; left: 0; transform: translateY(-50%); line-height: 1; white-space: nowrap; }
.curve-plot { position: relative; }
.curve-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.curve .c-grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.curve .c-oracle { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.curve .c-past { fill: none; stroke: var(--orange); stroke-width: 2; vector-effect: non-scaling-stroke; }
.curve .c-future { fill: none; stroke: var(--orange); stroke-width: 2; stroke-dasharray: 2 4; opacity: 0.6; vector-effect: non-scaling-stroke; }
.curve .c-dot {
  position: absolute;
  width: 12px; height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 2.5px var(--sheet);
}
.curve-time { grid-column: 2; display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; }
.progress { height: 8px; border-radius: 999px; background: var(--sunk); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--ink); border-radius: 999px; transition: width 0.4s ease; }
.progress-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; font-size: var(--fs-xs); color: var(--muted); }
.progress-meta .mono { font-size: var(--fs-2xs); color: var(--ink); }

.auction-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--ink); margin: 0 0 20px; }
.auction-summary > div { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.auction-summary > div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.auction-summary dt { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.auction-summary dd { margin: 4px 0 0; font-family: var(--font-mono); font-stretch: 87.5%; font-size: var(--fs-lg); font-weight: 450; letter-spacing: -0.04em; }
@media (max-width: 760px) {
  .auction-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auction-summary > div + div { padding-left: 0; border-left: 0; }
  .auction-summary > div:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--line); }
}
.empty-card { padding: 28px; text-align: center; color: var(--muted); }

/* ---------- Flywheel ---------- */
.fw-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 24px; align-items: stretch; }
@media (max-width: 860px) { .fw-top { grid-template-columns: minmax(0, 1fr); } }
.fw-control { padding: 18px 20px; }
.fw-split { display: flex; height: 12px; border-radius: 999px; overflow: hidden; margin-top: 10px; gap: 2px; background: var(--sheet); }
.fw-split span { display: block; height: 100%; transition: width 0.2s ease; }
.fw-split .s-liq { background: var(--ink); }
.fw-split .s-bas { background: var(--accent); }
.fw-split-legend { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: var(--fs-xs); color: var(--ink-2); }
.fw-split-legend .legend-item b { font-family: var(--font-mono); font-stretch: 87.5%; font-weight: 500; }

.flywheel {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 44px 48px;
  position: relative;
}
.fw-node {
  position: relative;
  padding: 18px;
  border-radius: var(--r-md);
  background: var(--sheet);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.fw-node:nth-child(5) { grid-column: 4; grid-row: 2; }
.fw-node:nth-child(6) { grid-column: 3; grid-row: 2; }
.fw-node:nth-child(7) { grid-column: 2; grid-row: 2; }
.fw-node:nth-child(8) { grid-column: 1; grid-row: 2; }
.fw-node-head { display: flex; align-items: center; gap: 10px; }
.fw-num {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  flex: none;
  border-radius: 50%;
  background: var(--ink);
  color: var(--on-ink);
  font-family: var(--font-mono);
  font-stretch: 87.5%;
  font-size: var(--fs-2xs);
  font-weight: 600;
}
.fw-node h3 { font-size: var(--fs-base); }
.fw-node p { font-size: var(--fs-xs); color: var(--ink-2); }
.fw-metric { margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--line); }
.fw-metric b { display: block; font-family: var(--font-mono); font-stretch: 87.5%; font-size: var(--fs-md); font-weight: 500; letter-spacing: -0.03em; }
.fw-metric span { font-size: var(--fs-2xs); color: var(--muted); }
.fw-node.is-in { border-color: var(--ink); }
.fw-node.is-out { background: var(--accent-soft); border-color: #c4c9f7; }
.fw-node.is-burn { background: var(--orange-soft); border-color: #f0c2a0; }

.fw-arrow {
  position: absolute;
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  z-index: 1;
}
.fw-arrow .icon { width: 18px; height: 18px; stroke-width: 2; }
/* top row → right */
.fw-node:nth-child(-n + 3) .fw-arrow { right: -39px; top: 50%; transform: translateY(-50%); }
/* 4 ↓ */
.fw-node:nth-child(4) .fw-arrow { left: 50%; bottom: -37px; transform: translateX(-50%) rotate(90deg); }
/* bottom row ← */
.fw-node:nth-child(5) .fw-arrow,
.fw-node:nth-child(6) .fw-arrow,
.fw-node:nth-child(7) .fw-arrow { left: -39px; top: 50%; transform: translateY(-50%) rotate(180deg); }
/* 8 ↑ back to 1 */
.fw-node:nth-child(8) .fw-arrow { left: 50%; top: -37px; transform: translateX(-50%) rotate(-90deg); }
.fw-loop-note { display: none; }

@media (max-width: 900px) {
  .flywheel { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .fw-node:nth-child(n) { grid-column: auto; grid-row: auto; }
  .fw-node:nth-child(n) .fw-arrow { left: 50%; right: auto; top: auto; bottom: -32px; transform: translateX(-50%) rotate(90deg); }
  .fw-node:nth-child(8) .fw-arrow { display: none; }
  .fw-loop-note { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: var(--fs-xs); color: var(--ink-2); font-weight: 600; }
}

.fw-foot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 28px; }
@media (max-width: 860px) { .fw-foot { grid-template-columns: minmax(0, 1fr); } }
.fw-foot .panel { padding: 20px; }
.fw-foot h3 { font-size: var(--fs-md); margin-bottom: 10px; }
.bullets { list-style: none; display: grid; gap: 8px; font-size: var(--fs-sm); color: var(--ink-2); }
.bullets li { padding-left: 16px; position: relative; }
.bullets li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }

/* ---------- Governance ---------- */
.gov-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 16px; align-items: start; }
@media (max-width: 960px) { .gov-grid { grid-template-columns: minmax(0, 1fr); } }
.params-card { padding: 20px; }
.params-card h3, .gov-col h3 { font-size: var(--fs-md); margin-bottom: 12px; }
.params { margin: 0; }
.params > div { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.params > div:last-child { border-bottom: 0; }
.params dt { color: var(--ink-2); }
.params dd { margin: 0; text-align: right; font-family: var(--font-mono); font-stretch: 87.5%; font-size: var(--fs-xs); font-weight: 500; }
.proposals { display: grid; gap: 12px; }
.proposal { padding: 18px 20px; }
.proposal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.proposal-id { font-family: var(--font-mono); font-stretch: 87.5%; font-size: var(--fs-xs); color: var(--muted); }
.proposal h4 { font-size: var(--fs-md); font-family: var(--font-display); }
.proposal p { color: var(--ink-2); font-size: var(--fs-sm); margin-top: 6px; }
.votebar { position: relative; display: flex; height: 10px; gap: 2px; border-radius: 999px; margin-top: 14px; background: var(--sunk); }
.votebar span { height: 100%; }
.v-for { background: var(--accent); border-radius: 999px 0 0 999px; }
.v-against { background: var(--orange); }
.v-abstain { background: var(--ink-2); opacity: 0.35; border-radius: 0 999px 999px 0; }
.v-quorum { position: absolute; top: -5px; bottom: -5px; width: 2px; background: var(--ink); border-radius: 1px; }
.vote-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: var(--fs-xs); color: var(--ink-2); }
.vote-legend b { font-family: var(--font-mono); font-stretch: 87.5%; font-weight: 500; color: var(--ink); }
.proposal-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; font-size: var(--fs-xs); color: var(--muted); }

/* ---------- Verify ---------- */
.verify-summary { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.verify-meter { display: flex; gap: 4px; }
.verify-meter span { width: 28px; height: 8px; border-radius: 4px; background: var(--sunk); border: 1px solid var(--line-strong); }
.verify-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 860px) { .verify-grid { grid-template-columns: minmax(0, 1fr); } }
.verify-card { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.verify-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.verify-head h3 { font-size: var(--fs-md); display: flex; align-items: center; gap: 10px; }
.verify-head h3 .icon { color: var(--ink-2); }
.verify-card p { color: var(--ink-2); font-size: var(--fs-sm); }
.verify-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; align-items: center; font-size: var(--fs-xs); }
.verify-row dt { color: var(--muted); font-weight: 600; }
.verify-row dd { margin: 0; display: flex; align-items: center; gap: 8px; min-width: 0; }
.verify-row .mono { font-size: var(--fs-2xs); font-stretch: 75%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.verify-card details { border-top: 1px dashed var(--line); padding-top: 10px; }
.verify-card summary { cursor: pointer; font-weight: 600; font-size: var(--fs-sm); color: var(--accent); }
.cmd {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 8px 8px 12px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--on-ink);
}
.cmd code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font-family: var(--font-mono); font-stretch: 75%; font-size: var(--fs-2xs); scrollbar-width: thin; }
.cmd .copy-btn { background: transparent; border-color: rgba(247, 245, 239, 0.25); color: var(--on-ink); }
.cmd .copy-btn:hover { border-color: var(--on-ink); }
.verify-card details p { margin-top: 10px; font-size: var(--fs-xs); }

/* ---------- Methodology ---------- */
.method-toc { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; }
.method-toc a { text-decoration: none; }
.method-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; }
@media (max-width: 860px) { .method-grid { grid-template-columns: minmax(0, 1fr); } }
.method-item { padding: 22px 0; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + 8px); min-width: 0; }
.method-item h3 { font-size: var(--fs-lg); margin-bottom: 10px; display: flex; align-items: baseline; gap: 12px; }
.method-item h3 .mono { font-size: var(--fs-xs); color: var(--muted); font-weight: 500; }
.method-item p, .method-item li { color: var(--ink-2); font-size: var(--fs-sm); }
.method-item p + p, .method-item p + ul, .method-item ul + p { margin-top: 10px; }
.method-item ul { list-style: none; display: grid; gap: 6px; }
.method-item ul li { padding-left: 16px; position: relative; }
.method-item ul li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.formula {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--sheet);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-stretch: 87.5%;
  font-size: var(--fs-xs);
  color: var(--ink);
  overflow-x: auto;
  white-space: nowrap;
}
.eq-bar { display: flex; gap: 2px; margin-top: 14px; height: 26px; }
.eq-bar span { flex: 1; border-radius: 3px; background: var(--accent); opacity: 0.88; }
.eq-bar span:nth-child(even) { opacity: 0.62; }
.eq-caption { display: flex; justify-content: space-between; margin-top: 6px; font-family: var(--font-mono); font-stretch: 87.5%; font-size: var(--fs-2xs); color: var(--muted); }

.arb-table { width: 100%; margin-top: 12px; font-size: var(--fs-xs); }
.arb-table th, .arb-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.arb-table th { color: var(--muted); font-weight: 600; }
.arb-table td:first-child { font-weight: 700; color: var(--ink); white-space: nowrap; }
.arb-table td { color: var(--ink-2); }

.example { margin-top: 28px; padding: 20px; }
.example h3 { font-size: var(--fs-md); margin-bottom: 10px; }
.example-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--ink); margin: 0; }
.example-grid > div { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.example-grid > div + div { padding-left: 12px; border-left: 1px solid var(--line); }
.example-grid dt { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.example-grid dd { margin: 4px 0 0; font-family: var(--font-mono); font-stretch: 87.5%; font-size: var(--fs-sm); font-weight: 500; }
.example p { margin-top: 12px; color: var(--ink-2); font-size: var(--fs-sm); }
@media (max-width: 640px) {
  .example-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .example-grid > div + div { padding-left: 0; border-left: 0; }
  .example-grid > div:nth-child(even) { padding-left: 12px; border-left: 1px solid var(--line); }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--on-ink); padding-block: clamp(48px, 6vw, 72px) 36px; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 4fr) repeat(4, minmax(0, 2fr)); gap: 32px; }
@media (max-width: 960px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer-brand { grid-column: 1 / -1; } }
.footer-brand p { color: #bdb8aa; font-size: var(--fs-sm); margin-top: 14px; max-width: 38ch; }
.footer-brand .brand { color: var(--on-ink); }
.footer-col h3 { font-family: var(--font-mono); font-stretch: 87.5%; font-size: var(--fs-2xs); font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: #9c9789; margin-bottom: 14px; }
.footer-col ul { list-style: none; display: grid; gap: 9px; }
.footer-col a, .footer-col .link-btn { color: var(--on-ink); font-size: var(--fs-sm); text-decoration: none; font-weight: 500; }
.footer-col a:hover, .footer-col .link-btn:hover { color: var(--lime); text-decoration: underline; }
.footer-col .tag { font-family: var(--font-mono); font-stretch: 87.5%; font-size: 0.625rem; color: #9c9789; margin-left: 6px; }
.disclosure { margin-top: 40px; padding-top: 24px; border-top: 1px solid rgba(247, 245, 239, 0.16); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 32px; align-items: end; }
.disclosure p { color: #bdb8aa; font-size: var(--fs-xs); max-width: 92ch; }
.disclosure p strong { color: var(--on-ink); }
.footer-meta { font-family: var(--font-mono); font-stretch: 87.5%; font-size: var(--fs-2xs); color: #9c9789; text-align: right; white-space: nowrap; }
@media (max-width: 760px) { .disclosure { grid-template-columns: minmax(0, 1fr); } .footer-meta { text-align: left; white-space: normal; } }

/* ---------- Dialog ---------- */
.dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--sheet);
  color: var(--ink);
  box-shadow: 0 30px 60px -20px rgba(23, 22, 15, 0.45);
}
.dialog::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.dialog[open] { animation: dlg-in 0.18s ease-out; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.dialog-inner { display: flex; flex-direction: column; max-height: calc(100dvh - 50px); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 20px 0; }
.dialog-head h2 { font-size: var(--fs-lg); }
.dialog-head .badge { margin-top: 8px; }
.dialog-body { padding: 14px 20px 4px; overflow-y: auto; font-size: var(--fs-sm); color: var(--ink-2); display: grid; gap: 14px; }
.dialog-body strong { color: var(--ink); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px 20px; flex-wrap: wrap; }
.dialog-actions .btn { flex: 0 1 auto; }
@media (max-width: 480px) { .dialog-actions .btn { flex: 1 1 100%; } }

.choice { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; }
.choice:hover { border-color: var(--ink); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { margin-top: 3px; accent-color: var(--accent); }
.choice b { display: block; color: var(--ink); }
.choice span { font-size: var(--fs-xs); color: var(--ink-2); }
.choices { display: grid; gap: 8px; }
.summary-list { margin: 0; border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px; }
.summary-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.summary-list > div:last-child { border-bottom: 0; }
.summary-list dt { color: var(--ink-2); }
.summary-list dd { margin: 0; font-family: var(--font-mono); font-stretch: 87.5%; font-size: var(--fs-xs); font-weight: 500; color: var(--ink); text-align: right; }
.csv-preview { margin: 0; padding: 12px; border-radius: 10px; background: var(--ink); color: var(--on-ink); font-family: var(--font-mono); font-stretch: 75%; font-size: 0.6875rem; line-height: 1.6; overflow-x: auto; white-space: pre; }
.success-mark { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--lime); color: var(--lime-ink); }
.success-mark .icon { width: 26px; height: 26px; stroke-width: 2.5; }
.field-label { display: block; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.text-input {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  font-family: var(--font-mono);
  font-stretch: 87.5%;
  font-size: var(--fs-base);
}
.text-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 100;
  display: grid;
  gap: 8px;
  justify-items: center;
  pointer-events: none;
  width: min(440px, calc(100vw - 32px));
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: var(--fs-sm);
  font-weight: 500;
  box-shadow: 0 12px 28px -12px rgba(23, 22, 15, 0.55);
  animation: toast-in 0.2s ease-out;
}
.toast .icon { color: var(--lime); }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity 0.2s ease, transform 0.2s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
