:root {
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #706e6a;
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --border: #0b0b0b1a;
  --accent: #f5c518;
  --accent-ink: #0b0b0b;
  --band-idle: #e1e0d9;
  --good: #0ca30c;
  color-scheme: light;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0d0d0d;
    --surface: #1a1a19;
    --ink: #fff;
    --ink-2: #c3c2b7;
    --muted: #898781;
    --grid: #2c2c2a;
    --baseline: #383835;
    --border: #ffffff1a;
    --band-idle: #2c2c2a;
    --good: #3dba3d;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.45;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.wrap {
  width: min(920px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.35rem 0 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.compare-wrap { width: min(760px, calc(100% - 2rem)); }

.header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  justify-self: start;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand svg { display: block; }
.nav {
  display: flex;
  gap: 1.6rem;
  justify-content: center;
}
.nav a {
  position: relative;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 0.95rem;
}
.nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 650;
}
.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 7px;
  height: 3px;
  border-radius: 99px;
  background: var(--accent);
}
.domain {
  justify-self: end;
  text-decoration: none;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.domain:hover { color: var(--ink); }

.universe {
  display: flex;
  justify-content: center;
}
.universe-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--grid);
}
.universe-switch button {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  min-height: 36px;
}
.universe-switch button[aria-checked="true"] {
  background: var(--ink);
  color: var(--page);
  font-weight: 650;
}

.token-row {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  justify-content: center;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.token-row::-webkit-scrollbar { display: none; }
.token-row button, .chip, .picker button {
  border-radius: 999px;
  border: 1px solid var(--grid);
  background: var(--surface);
  color: var(--ink-2);
  padding: 0.45rem 0.9rem;
  min-height: 44px;
  flex: 0 0 auto;
}
.token-row button[aria-pressed="true"], .picker button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 750;
}
.token-row button:hover, .picker button:hover { border-color: var(--baseline); }

.today {
  text-align: center;
  color: var(--ink-2);
  font-size: 0.92rem;
}
.today strong { color: var(--ink); }

.eyebrow {
  text-align: center;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.moods {
  display: flex;
  justify-content: center;
  gap: 0.15rem;
  flex-wrap: wrap;
}
.moods button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  padding: 0;
}
.moods button[aria-checked="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}
.moods button:hover { color: var(--ink-2); }
.moods button[aria-checked="true"]:hover { color: var(--accent-ink); }
.mood-label {
  text-align: center;
  font-weight: 750;
  margin-top: -0.15rem;
}

.price {
  text-align: center;
  font-size: clamp(4.2rem, 12vw, 7.2rem);
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}
.phase {
  text-align: center;
  color: var(--ink-2);
  font-size: 0.82rem;
}
.phase button {
  background: none;
  border: 0;
  padding: 0;
  font-weight: 700;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.timeline { display: flex; flex-direction: column; gap: 0.15rem; user-select: none; }
.track {
  position: relative;
  height: 36px;
  display: flex;
  align-items: center;
}
.peak-band, .halving-tick {
  position: absolute;
  pointer-events: none;
}
.peak-band {
  top: 50%;
  height: 10px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
}
.halving-tick {
  top: 4px;
  bottom: 4px;
  width: 1px;
  background: var(--baseline);
}
input[type="range"].cycle-range {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: 5px;
  outline-offset: 6px;
  cursor: pointer;
  margin: 0;
}
input[type="range"].cycle-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--accent-ink);
  cursor: grab;
  box-shadow: 0 1px 4px #00000040;
}
input[type="range"].cycle-range::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.08); }
input[type="range"].cycle-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--accent-ink);
  cursor: grab;
}
.quarter-readout {
  position: relative;
  height: 1.3rem;
}
.quarter-readout span {
  position: absolute;
  transform: translateX(-50%);
  font-weight: 750;
  font-size: 0.92rem;
  white-space: nowrap;
}
.markers {
  position: relative;
  height: 1.4rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.markers button {
  position: absolute;
  background: none;
  border: 0;
  color: inherit;
  padding: 0.2rem 0;
}
.markers button:hover { color: var(--ink-2); }
.markers .left { left: 0; }
.markers .mid { transform: translateX(-50%); }
.markers .right { right: 0; text-align: right; }

.invest {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.45rem;
  flex-wrap: wrap;
  font-size: 0.98rem;
}
.amount {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.amount span {
  position: absolute;
  left: 0;
  font-weight: 750;
}
.amount input {
  width: 5.2rem;
  background: transparent;
  border: 0;
  border-bottom: 1px dashed var(--baseline);
  border-radius: 0;
  padding: 0.1rem 0.2rem 0.1rem 0.85rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.amount input:focus { outline: none; border-bottom-color: var(--accent); }
.outcome {
  font-weight: 750;
  font-size: 1.25rem;
  border-bottom: 3px solid var(--accent);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.fine {
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  margin: -0.35rem 0 0;
}
.actions, .center { display: flex; justify-content: center; }
.ghost {
  background: transparent;
  border: 1px solid var(--grid);
  color: var(--ink-2);
  border-radius: 999px;
  min-height: 36px;
  padding: 0.35rem 0.95rem;
  font-size: 0.78rem;
}
.ghost:hover { border-color: var(--baseline); color: var(--ink); }
.linkish {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.9rem;
}
.linkish:hover { color: var(--ink); }
.linkish strong {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  font-weight: 650;
}

.panels { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 0.4rem; }
details.panel {
  background: var(--surface);
  border: 1px solid var(--grid);
  border-radius: 14px;
  padding: 0.15rem 0.95rem;
}
details.panel > summary {
  list-style: none;
  cursor: pointer;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
}
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary .chev {
  color: var(--muted);
  font-size: 0.72rem;
  transition: transform 0.15s;
}
details.panel[open] > summary .chev { transform: rotate(90deg); }
.panel-body { padding: 0 0 0.9rem 1.15rem; color: var(--ink-2); font-size: 0.92rem; }
.rows { display: flex; flex-direction: column; }
.row {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 0.8rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--grid);
}
.row b { color: var(--ink); font-weight: 650; }
.prose { display: flex; flex-direction: column; gap: 0.7rem; }
.prose p { margin: 0; }
.prose .ink, .panel-body .ink { color: var(--ink); font-weight: 650; }
.warn { color: var(--ink); font-weight: 650; margin: 0.7rem 0 0; }
.nested { margin-top: 0.3rem; }
.nested summary {
  list-style: none;
  cursor: pointer;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-2);
  font-weight: 600;
}
.nested summary::-webkit-details-marker { display: none; }
.nested[open] summary .flip { transform: rotate(180deg); }
.flip { transition: transform 0.15s; font-size: 0.7rem; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem 0.8rem;
}
.stat span { display: block; color: var(--muted); font-size: 0.75rem; }
.stat strong { display: block; font-size: 1.15rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat em { display: block; font-style: normal; color: var(--muted); font-size: 0.75rem; }
.notes { border-top: 1px solid var(--grid); margin-top: 1rem; padding-top: 0.8rem; display: flex; flex-direction: column; gap: 0.65rem; }
.notes p { margin: 0; }

.bands { display: flex; flex-direction: column; gap: 0.2rem; }
.band {
  display: grid;
  grid-template-columns: minmax(7.4rem, max-content) 1fr auto;
  gap: 0.7rem;
  align-items: center;
  background: none;
  border: 0;
  padding: 0.15rem 0;
  text-align: left;
  width: 100%;
}
.band .name { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.band.selected .name { color: var(--ink); font-weight: 750; }
.rail { position: relative; height: 16px; display: block; }
.rail i {
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: var(--grid);
}
.rail b {
  position: absolute;
  top: 50%;
  height: 8px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: var(--band-idle);
}
.band.selected .rail b { background: var(--accent); }
.rail s, .rail u {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  text-decoration: none;
}
.rail s {
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: var(--muted);
}
.band.selected .rail s { background: var(--accent-ink); }
.rail u {
  width: 1px;
  height: 14px;
  background: var(--ink-2);
}
.range-label {
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.band.selected .range-label { color: var(--ink); font-weight: 600; }
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1rem;
  color: var(--muted);
  font-size: 0.75rem;
  margin: 0.45rem 0 0 8.1rem;
}
.legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.legend .tick { width: 1px; height: 12px; background: var(--ink-2); display: inline-block; }
.legend .mid { width: 3px; height: 12px; border-radius: 2px; background: var(--muted); display: inline-block; }

.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; justify-content: center; position: relative; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--surface);
}
.chip button {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-height: 0;
  padding: 0;
  font-size: 0.9rem;
}
.picker-pop {
  position: absolute;
  z-index: 5;
  top: calc(100% + 0.5rem);
  width: min(26rem, calc(100vw - 2rem));
  background: var(--surface);
  border: 1px solid var(--grid);
  border-radius: 16px;
  padding: 0.9rem;
  box-shadow: 0 10px 30px -12px #0006;
}
.picker-head, .picker-group { display: flex; justify-content: space-between; align-items: baseline; }
.picker-group { display: block; margin-top: 0.8rem; }
.picker-group p {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.picker { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.backdrop { display: none; }

.rank-list { display: flex; flex-direction: column; gap: 0.85rem; }
.rank {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
}
.rank-no { color: var(--muted); font-variant-numeric: tabular-nums; width: 1.4rem; }
.rank-name strong { display: block; }
.rank-name span { color: var(--muted); font-size: 0.82rem; }
.rank-val { text-align: right; }
.rank-val strong { display: block; font-variant-numeric: tabular-nums; }
.rank-val span { color: var(--ink-2); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.meter {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 99px;
  background: var(--band-idle);
  overflow: hidden;
  margin-top: -0.35rem;
}
.meter i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
}
.why {
  grid-column: 1 / -1;
  margin-top: -0.2rem;
}
.why summary {
  list-style: none;
  cursor: pointer;
  color: var(--ink-2);
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.why summary::-webkit-details-marker { display: none; }
.why p { margin: 0 0 0.6rem; color: var(--ink-2); font-size: 0.86rem; }

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-top: 0.6rem;
}
.footer a { color: inherit; }

.loading { text-align: center; color: var(--muted); padding: 4rem 0; }

@media (max-width: 720px) {
  .header { grid-template-columns: 1fr; justify-items: center; }
  .brand, .domain { justify-self: center; }
  .domain { display: none; }
  .token-row { justify-content: flex-start; }
  .stats { grid-template-columns: 1fr 1fr; }
  .row { grid-template-columns: 1fr; gap: 0.15rem; }
  .legend { margin-left: 0; }
  .markers .short { display: inline; }
  .markers .long { display: none; }
  .backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: #0006;
    z-index: 4;
    border: 0;
  }
  .picker-pop {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: auto;
    border-radius: 18px 18px 0 0;
    max-height: 70vh;
    overflow: auto;
    z-index: 6;
  }
}
@media (min-width: 721px) {
  .markers .short { display: none; }
  .markers .long { display: inline; }
}
