:root {
  --bg: #0b0d10;
  --panel: #12151a;
  --panel-2: #181c22;
  --line: #232830;
  --text: #e8ecf1;
  --muted: #9aa3b0;
  --accent: #7ef0c4;
  --long: #2ecc8f;
  --short: #f0606a;
  --warn: #f5b041;
  --alert-bg: #2a1518;
  --alert-line: #5a2228;
  --alert-text: #ff9aa2;
}

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

[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  color-scheme: dark;
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  grid-template-rows: 64px minmax(0, 1fr) 40px;
  grid-template-areas: "top top" "side main" "bottom bottom";
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

a { color: inherit; }
button, input { font: inherit; }

.muted { color: var(--muted); }

.topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 0 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.icon-btn, .user-btn, .balance-chip, .quick button, .btn, .pill {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 10px;
}

.icon-btn {
  display: none;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  cursor: pointer;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  text-decoration: none;
}

.wordmark { font-weight: 700; font-size: 17px; letter-spacing: 0.02em; }

.search {
  flex: 1;
  min-width: 0;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
}

.search:focus-within { border-color: var(--accent); }

.search input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  color: var(--text);
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.balance-chip, .user-btn {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 14px;
  text-decoration: none;
  white-space: nowrap;
  font-weight: 600;
}

.balance-chip { color: var(--accent); }

.sidebar {
  grid-area: side;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 8px;
  background: var(--panel);
  border-right: 1px solid var(--line);
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.nav-item:hover, .nav-item.active { background: var(--panel-2); color: var(--text); }

.nav-sub {
  margin: 4px 0 10px 14px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.coin-link {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}

.coin-link:hover, .coin-link.active { background: var(--panel-2); color: var(--text); }

.scrim { display: none; }

.main {
  grid-area: main;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 24px;
}

.bottombar {
  grid-area: bottom;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 0 16px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.status { display: flex; align-items: center; gap: 8px; min-width: 0; }

.dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--long);
}

.bottom-links { display: flex; gap: 16px; flex: none; }

.card {
  min-width: 0;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.pill {
  padding: 4px 10px;
  font-size: 12px;
  color: var(--muted);
  border-radius: 999px;
}

/* Row 1: identity, price, change chips, then trophies, countdown, star and the live pill at the right. */
.card > .coin-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}

.coin-title { flex: none; font-size: 18px; font-weight: 700; line-height: 28px; white-space: nowrap; }
.coin-title .muted { font-weight: 400; font-size: 14px; margin-left: 6px; }
.coin-price { flex: none; font-size: 26px; font-weight: 700; line-height: 32px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Chips and trophies fill the slack between price and actions; what does not fit wraps into a clipped
   second line, so whole items vanish instead of the row breaking. */
.coin-head .price-header {
  flex: 100 1 0;
  min-width: 90px;
  max-width: max-content;
  flex-flow: row-reverse wrap;
  justify-content: flex-end;
  align-content: flex-start;
  align-self: center;
  max-height: 24px;
  overflow: hidden;
}

/* Reverse row + ascending order keeps 1m 5m 1h 24h on screen and drops 1m first. */
.coin-head .price-change[data-window="24h"] { order: 1; }
.coin-head .price-change[data-window="1h"] { order: 2; }
.coin-head .price-change[data-window="5m"] { order: 3; }
.coin-head .price-change[data-window="1m"] { order: 4; }

.coin-head .cd-chip { order: 1; align-self: center; }
.coin-head .trophy-strip {
  order: 2;
  flex: 1 1 0;
  min-width: 20px;
  max-width: max-content;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-content: flex-start;
  align-self: center;
  max-height: 20px;
  overflow: hidden;
}
.coin-head .coin-heat { order: 3; align-self: center; display: none; }
.card > .coin-head > .coin-head-actions { order: 4; flex: none; flex-wrap: nowrap; gap: 8px; margin-left: auto; align-self: center; }

.coin-head .watch-button { min-width: 28px; min-height: 28px; padding: 2px 7px; }
.coin-head .watch-button [data-watch-star] { font-size: 17px; }
.coin-head .watch-button [data-watch-label] { display: none; }

.chart-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.chart-live[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
/* The synced text stays in the DOM for assistive tech; it is shown once the card is wide enough. */
.chart-live .chart-status { gap: 0; font-size: 0; }
.chart-live[aria-pressed="false"] .chart-live-label { text-decoration: underline; text-underline-offset: 2px; }

.chart { margin-top: 8px; min-width: 0; }

/* Row 2: one toolbar; the voice line takes the remaining width. */
.chart-bar {
  display: flex;
  align-items: center;
  gap: 6px 12px;
  min-height: 32px;
  margin-bottom: 6px;
  font-size: 13px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.switch[aria-checked="true"] { color: var(--text); }

.switch-track {
  position: relative;
  width: 32px;
  height: 18px;
  border-radius: 999px;
  background: var(--line);
  transition: background 0.15s ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}

.switch[aria-checked="true"] .switch-track { background: var(--accent); }
.switch[aria-checked="true"] .switch-track::after { transform: translateX(14px); }

.voice-controls {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
}

.voice-source {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  font-size: 12px;
}

.voice-source button {
  padding: 2px 9px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.voice-source button[aria-checked="true"] { background: var(--panel-2); color: var(--text); }
.voice-source button:disabled { opacity: 0.5; cursor: not-allowed; }

.voice-line {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  min-height: 1.4em;
  white-space: nowrap;
}

.voice-signal {
  flex: none;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.voice-signal[data-tone="long"] { color: var(--long); border-color: var(--long); }
.voice-signal[data-tone="short"] { color: var(--short); border-color: var(--short); }

.voice-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-status { flex: none; font-size: 12px; }
.chart-bar .voice-playback { flex: none; }

.chart-canvas {
  --chart-tag-bg: #3a414b;
  --chart-tag-text: var(--text);
  display: block;
  width: 100%;
  height: min(56vh, 460px);
  min-height: 260px;
  border-radius: 10px;
  background: var(--panel-2);
  touch-action: none;
  user-select: none;
  cursor: crosshair;
}

/* Position mode: multiplier and P&L pill sit top-centre of the plot; the chart box is their offset parent. */
.chart:has(> .position-hud) { position: relative; }

.position-hud {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  will-change: transform;
}

.position-hud[hidden] { display: none; }

.position-mult {
  white-space: nowrap;
  font-size: 56px;
  font-style: italic;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -3px;
  font-variant-numeric: tabular-nums;
  color: var(--long);
  text-shadow: 0 2px 14px rgba(11, 13, 16, 0.75);
}

.position-mult[data-tone="down"] { color: var(--short); }

.position-pnl {
  padding: 6px 14px;
  border-radius: 10px;
  background: var(--long);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
  box-shadow: 0 4px 14px rgba(11, 13, 16, 0.55);
}

.position-pnl[data-tone="down"] { background: var(--short); }

.futures {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  min-width: 0;
}

.trade-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.trade-head strong { color: var(--text); font-variant-numeric: tabular-nums; }

.amount-box {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 26px;
  font-weight: 600;
}

.amount-box:focus-within { border-color: var(--accent); }

.amount-box input {
  width: 100%;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  color: inherit;
}

.quick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.quick button { padding: 8px 0; cursor: pointer; }

.alert {
  padding: 10px 12px;
  margin: 10px 0;
  background: var(--alert-bg);
  border: 1px solid var(--alert-line);
  border-radius: 10px;
  color: var(--alert-text);
}

.lev-head {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.lev-head strong { color: var(--text); font-variant-numeric: tabular-nums; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  margin: 14px 0 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--long), var(--warn), var(--short));
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

input[type="range"]:disabled { opacity: 0.45; cursor: not-allowed; }

.lev-scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.stats { display: grid; gap: 10px; margin: 14px 0; }
.stats div { display: flex; justify-content: space-between; gap: 12px; }
.stats dt { color: var(--muted); }
.stats dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn {
  padding: 14px;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  color: #0b0d10;
  border: 0;
}

.btn.long { --btn-bg: var(--long); background: var(--btn-bg); }
.btn.short { --btn-bg: var(--short); background: var(--btn-bg); }
.btn.primary { grid-column: 1 / -1; background: var(--accent); }

button:disabled { opacity: 0.45; cursor: not-allowed; }

input:disabled { cursor: not-allowed; opacity: 0.6; }

.note { min-height: 1.4em; margin: 12px 0 0; color: var(--muted); font-size: 12px; }

.btn.close {
  --btn-bg: var(--panel-2);
  --btn-ring: inset 0 0 0 1px var(--line);
  --btn-text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
  grid-column: 1 / -1;
  background: var(--btn-bg);
  color: var(--text);
  box-shadow: var(--btn-ring);
  font-variant-numeric: tabular-nums;
}

.btn.close.up,
.btn.close.down {
  --btn-ring: 0 0 0 0 transparent;
  --btn-text-shadow: 0 1px 0 rgba(255, 255, 255, 0.14);
  color: #0b0d10;
}

.btn.close.up { --btn-bg: var(--long); }
.btn.close.down { --btn-bg: var(--short); }

/* The hard lip in the button's own hue is the volume; the ambient shadow only settles it onto the panel. */
.actions .btn.long,
.actions .btn.short,
.actions .btn.close {
  --btn-lip: color-mix(in srgb, var(--btn-bg) 55%, #000);
  background-color: var(--btn-bg);
  background-image: linear-gradient(color-mix(in srgb, var(--btn-bg), #fff 8%), color-mix(in srgb, var(--btn-bg), #000 6%));
  box-shadow:
    var(--btn-ring, 0 0 0 0 transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22),
    0 2px 0 var(--btn-lip),
    0 6px 14px rgba(0, 0, 0, 0.35);
  text-shadow: var(--btn-text-shadow, 0 1px 0 rgba(255, 255, 255, 0.14));
}

/* Lip grows by the 1px the motion rule lifts, so the bottom edge stays put; gated the same way as that lift. */
@media (prefers-reduced-motion: no-preference) {
  html:not(.motion-off) .actions .btn.long:hover:not(:disabled):not(:active),
  html:not(.motion-off) .actions .btn.short:hover:not(:disabled):not(:active),
  html:not(.motion-off) .actions .btn.close:hover:not(:disabled):not(:active) {
    box-shadow:
      var(--btn-ring, 0 0 0 0 transparent),
      inset 0 1px 0 rgba(255, 255, 255, 0.22),
      inset 0 -1px 0 rgba(0, 0, 0, 0.22),
      0 3px 0 var(--btn-lip),
      0 8px 18px rgba(0, 0, 0, 0.4);
  }
}

/* Sinks onto its lip: a state, not motion, so it holds under motion-off too. */
.actions .btn.long:active:not(:disabled),
.actions .btn.short:active:not(:disabled),
.actions .btn.close:active:not(:disabled) {
  transform: translateY(1px);
  background-image: linear-gradient(color-mix(in srgb, var(--btn-bg), #000 8%), color-mix(in srgb, var(--btn-bg), #000 2%));
  box-shadow:
    var(--btn-ring, 0 0 0 0 transparent),
    inset 0 1px 0 rgba(0, 0, 0, 0.2),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08),
    0 1px 0 var(--btn-lip),
    0 1px 3px rgba(0, 0, 0, 0.3);
}

.actions .btn.long:disabled,
.actions .btn.short:disabled,
.actions .btn.close:disabled {
  background-image: none;
  box-shadow: var(--btn-ring, 0 0 0 0 transparent);
  text-shadow: none;
}

.trades { max-width: 960px; margin-top: 16px; }

.tabs { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.tabs h2 { margin: 0 auto 0 0; font-size: 16px; }

.tabs [role="tab"] {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
}

.tabs [role="tab"][aria-selected="true"] { color: var(--accent); border-color: var(--accent); }

.table-wrap { overflow-x: auto; }

.trade-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.trade-table th, .trade-table td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--line); }
.trade-table th:first-child, .trade-table td:first-child { text-align: left; }
.trade-table th { color: var(--muted); font-weight: 600; font-size: 12px; }
.trade-table tr:last-child td { border-bottom: 0; }
.trade-table a { color: var(--accent); text-decoration: none; }
.trade-table .long { color: var(--long); }
.trade-table .short { color: var(--short); }
.trade-table .text { text-align: left; }

.trades-panel { grid-column: 1 / -1; min-width: 0; }

.trade-tabs { display: flex; gap: 20px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }

.trade-tabs [role="tab"] {
  padding: 8px 2px 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}

.trade-tabs [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }

.trades-empty {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 44px 16px;
  text-align: center;
}

.trades-empty strong { font-size: 15px; }

.btn-mini {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.btn-mini:hover { border-color: var(--accent); }

.hero { margin-bottom: 20px; }
.hero h1 { margin: 0 0 8px; font-size: clamp(26px, 4vw, 40px); line-height: 1.15; }
.hero p { margin: 0; color: var(--muted); max-width: 60ch; }

.coin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.tile { display: block; text-decoration: none; }
.tile strong { display: block; font-size: 16px; }
.tile:hover { border-color: var(--accent); }

.account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.account-row:last-child { border-bottom: 0; }
.account-row strong { font-variant-numeric: tabular-nums; }

.launch-btn {
  height: 38px;
  padding: 0 16px;
  font-size: 14px;
  background: var(--accent);
}

.nav-note {
  display: block;
  margin: 0;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 13px;
}

a.nav-note:hover { color: var(--text); }

.token-icon {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel-2);
  vertical-align: middle;
}

.coin-icon { margin-right: 8px; }
.coin-link .token-icon { width: 18px; height: 18px; margin-right: 6px; }
.coin-link .coin-label { display: inline-flex; align-items: center; min-width: 0; }
.trade-table .token-icon { width: 18px; height: 18px; margin-right: 6px; }

.coin-ends {
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--warn);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.coin-ends.ended, .token-ends.ended { color: var(--muted); }

.launch {
  width: min(520px, calc(100vw - 32px));
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  color: var(--text);
}

.launch::backdrop { background: rgba(0, 0, 0, 0.6); }

.launch-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.launch-head h2 { margin: 0; font-size: 18px; }
.launch-close { display: inline-grid; font-size: 20px; line-height: 1; }

.launch-guest { display: grid; gap: 12px; justify-items: start; }
.launch-guest p { margin: 0; }

.launch-form { display: grid; gap: 14px; }

.field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field > span, .field legend { color: var(--muted); font-size: 13px; padding: 0; }
.field > span .muted, .field legend .muted { font-size: 12px; margin-left: 4px; }

.field input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  outline: none;
}

.field input[type="text"]:focus { border-color: var(--accent); }
.field input[name="ticker"] { text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }

.icon-drop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: var(--panel-2);
  border: 1px dashed var(--line);
  border-radius: 12px;
  cursor: pointer;
}

.icon-drop input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.icon-drop.over, .icon-drop:has(input:focus-visible) { border-color: var(--accent); }
.icon-drop.ready { border-style: solid; }
.icon-preview { width: 64px; height: 64px; }
.icon-drop-text { display: grid; gap: 2px; font-size: 13px; }
.icon-drop-text strong { font-size: 14px; }

.chip-picker { display: flex; flex-wrap: wrap; gap: 6px; }

.chip-choice { position: relative; display: block; cursor: pointer; }
.chip-choice input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }

.chip-choice span {
  display: block;
  padding: 6px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
}

.chip-choice input:checked + span { border-color: var(--accent); color: var(--text); }
.chip-choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.launch-fee { margin: 0; display: flex; justify-content: space-between; gap: 12px; }
.launch-form .alert { margin: 0; }
.launch-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.launch-actions .btn.primary { grid-column: auto; }
.btn.ghost { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }

.discover { max-width: 1100px; }
.discover h1 { margin: 0 auto 0 0; font-size: 20px; }

.sorts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }

.sorts [role="radio"] {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
}

.sorts [role="radio"][aria-checked="true"] { color: var(--accent); border-color: var(--accent); }

.token-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.token { display: grid; gap: 10px; text-decoration: none; }
.token:hover { border-color: var(--accent); }
.token.ended { opacity: 0.8; }

.token-head { display: flex; align-items: center; gap: 10px; }
.token-head .token-icon { width: 40px; height: 40px; }
.token-id { display: grid; min-width: 0; flex: 1; }
.token-id strong { font-size: 16px; }
.token-id .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }

.token-ends {
  flex: none;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--warn);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.token-price { display: flex; align-items: baseline; gap: 10px; font-variant-numeric: tabular-nums; }
.token-price strong { font-size: 22px; }
.token-price .up { color: var(--long); }
.token-price .down { color: var(--short); }

.token-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.token-stats div { display: grid; min-width: 0; }
.token-stats dt { color: var(--muted); font-size: 12px; }
.token-stats dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.launched td[data-ends-at] { color: var(--warn); }
.launched .trade-table .muted { font-size: 12px; }

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

@media (max-width: 859px) {
  /* Pseudo-element is a flex item: a full-width break puts price and chips on their own line. */
  .card > .coin-head::after { content: ""; order: 5; flex-basis: 100%; height: 0; }
  .coin-price, .coin-head .cd-chip { order: 6; }
  .coin-head .price-header { order: 6; flex: 1 1 auto; max-height: none; flex-flow: row wrap; justify-content: flex-start; }
  .coin-head .price-change[data-window] { order: 0; }

  body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "top" "main" "bottom";
  }

  .icon-btn { display: inline-grid; }

  .sidebar {
    position: fixed;
    top: 64px;
    bottom: 40px;
    left: 0;
    z-index: 20;
    width: min(280px, 85vw);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }

  body.nav-open .sidebar { transform: none; }

  body.nav-open .scrim {
    display: block;
    position: fixed;
    top: 64px;
    right: 0;
    bottom: 40px;
    left: 0;
    z-index: 15;
    background: rgba(0, 0, 0, 0.55);
  }
}

@media (max-width: 1439px) {
  .coin-head .trophy-strip { display: none; }
}

@media (min-width: 1440px) {
  .chart-live .chart-status { gap: 6px; font-size: 12px; }
  .chart-live-label { display: none; }
}

@media (min-width: 1760px) {
  .coin-head .coin-heat { display: flex; }
}

@media (max-width: 559px) {
  .chart-bar { flex-wrap: wrap; }
  .position-mult { font-size: 36px; letter-spacing: -2px; }
  .position-pnl { padding: 4px 10px; font-size: 16px; }
  .voice-line { flex-basis: 100%; min-height: 0; }
  .topbar { gap: 8px; padding: 0 12px; }
  .search { display: none; }
  .wordmark { display: none; }
  .main { padding: 16px; }
  .bottom-links { display: none; }
  .balance-chip, .user-btn { padding: 0 10px; }
  .amount-box { font-size: 22px; }
}

.deposit { max-width: 960px; margin-top: 16px; }
.deposit h2 { margin: 0 0 12px; font-size: 16px; }
.deposit-body { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; margin-bottom: 12px; }
.deposit-qr svg { display: block; width: 184px; height: 184px; border-radius: 8px; }
.deposit-info { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.deposit-info p { margin: 0; }
.deposit-warning {
  padding: 8px 10px;
  color: var(--alert-text);
  background: var(--alert-bg);
  border: 1px solid var(--alert-line);
  border-radius: 8px;
  font-weight: 600;
}
.deposit-address { display: flex; gap: 8px; align-items: center; }
.deposit-address code {
  min-width: 0;
  padding: 6px 8px;
  overflow-wrap: anywhere;
  font: 600 14px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* Loading placeholders */
.skeleton,
.main:empty::before,
.main:empty::after {
  display: block;
  background: linear-gradient(90deg, var(--panel-2) 25%, color-mix(in srgb, var(--panel-2), #fff 6%) 50%, var(--panel-2) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.6s linear infinite;
}

.skeleton { border-radius: 6px; }

/* The outlet stays empty until the router runs; these cover that first paint. */
.main:empty::before,
.main:empty::after { content: ""; border-radius: 14px; }
.main:empty::before { height: 132px; margin-bottom: 20px; }
.main:empty::after {
  height: 72px;
  border-radius: 0;
  mask: linear-gradient(#000, #000) 0 0 / 160px 100% space;
}

@keyframes skeleton-shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton, .main:empty::before, .main:empty::after { animation: none; }
}

/* Micro-interactions */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (prefers-reduced-motion: no-preference) {
  html:not(.motion-off) .btn,
  html:not(.motion-off) .btn-mini {
    transition: transform 120ms ease-out, filter 120ms ease-out, border-color 120ms ease-out, box-shadow 120ms ease-out, opacity 120ms ease-out;
  }

  html:not(.motion-off) .btn:hover:not(:disabled),
  html:not(.motion-off) .btn-mini:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); }

  /* After hover on purpose: equal specificity, so a pressed button is pressed, not lifted. */
  html:not(.motion-off) .btn:active:not(:disabled),
  html:not(.motion-off) .btn-mini:active:not(:disabled),
  html:not(.motion-off) a.card:active,
  html:not(.motion-off) button.card:active,
  html:not(.motion-off) .card[role="button"]:active {
    transform: translateY(0) scale(0.98);
    filter: none;
    transition-duration: 60ms;
  }
}
