:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --good: #006300;
  --bad: #b42323;
  --s-value: #2a78d6;
  --s-usdc: #1baf7a;
  --s-yield: #eb6834;
  --s-sol: #4a3aa7;
  --wash: rgba(42, 120, 214, 0.10);
  --seg-bg: #efeee9;
  --seg-on: #fcfcfb;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --muted: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --good: #0ca30c;
    --bad: #e66767;
    --s-value: #3987e5;
    --s-usdc: #199e70;
    --s-yield: #d95926;
    --s-sol: #9085e9;
    --wash: rgba(57, 135, 229, 0.12);
    --seg-bg: #232322;
    --seg-on: #383835;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --ink: #ffffff;
  --ink-2: #c3c2b7;
  --muted: #898781;
  --grid: #2c2c2a;
  --axis: #383835;
  --border: rgba(255, 255, 255, 0.10);
  --good: #0ca30c;
  --bad: #e66767;
  --s-value: #3987e5;
  --s-usdc: #199e70;
  --s-yield: #d95926;
  --s-sol: #9085e9;
  --wash: rgba(57, 135, 229, 0.12);
  --seg-bg: #232322;
  --seg-on: #383835;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--page);
  color: var(--ink);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}
p, h1, h2 { margin: 0; }
.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
}
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h1 { font-size: 20px; font-weight: 600; }
h2 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.asof { color: var(--muted); font-size: 13px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  font-size: 20px; cursor: pointer;
}
.icon-btn:active { transform: scale(0.96); }
.head-btns { display: flex; gap: 8px; }
.icon-btn[aria-pressed="true"] { border-color: var(--s-value); }
.private-banner {
  margin: 10px 0 0; padding: 6px 10px; border-radius: 8px; font-size: 13px;
  background: var(--surface); border: 1px dashed var(--border); color: var(--ink-2); text-align: center;
}

.tabs {
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  margin: 14px 0 0; border-bottom: 1px solid var(--border);
}
.tabs button {
  border: 0; background: transparent; color: var(--ink-2); font: inherit; font-weight: 500;
  padding: 10px 4px; min-height: 40px; cursor: pointer; border-bottom: 2px solid transparent; font-size: 14px;
  margin-bottom: -1px; white-space: nowrap;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 1 0 auto; }
.tabs button[aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--s-value); }
.notes li { display: block; }

.seg {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px;
  margin: 16px 0; padding: 3px; border-radius: 10px; background: var(--seg-bg);
}
.seg button {
  min-height: 36px; border: 0; border-radius: 8px; background: transparent;
  color: var(--ink-2); font: inherit; font-weight: 500; cursor: pointer;
}
.seg button[aria-selected="true"] {
  background: var(--seg-on); color: var(--ink); font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.notice {
  padding: 16px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--border); color: var(--ink-2);
}

.label { color: var(--ink-2); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.hero { margin-bottom: 16px; }
.hero-value { font-size: 48px; font-weight: 600; line-height: 1.1; letter-spacing: -0.5px; }
.delta { font-size: 15px; font-weight: 500; }
.up { color: var(--good); }
.down { color: var(--bad); }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 12px; min-width: 0;
}
.tile-value { font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.key { width: 10px; height: 10px; border-radius: 2px; display: inline-block; flex: none; }
.key-usdc { background: var(--s-usdc); }
.key-yield { background: var(--s-yield); }


.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 12px 10px; margin-top: 12px;
}
.hint { color: var(--muted); font-size: 12px; margin: -4px 0 6px; }
.legend { display: flex; gap: 14px; color: var(--ink-2); font-size: 12px; margin-bottom: 4px; }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }

.lkey { width: 14px; height: 0; border-top: 2px solid; display: inline-block; }
.lkey-value { border-color: var(--s-value); }
.lkey-cost { border-color: var(--ink-2); border-top-width: 1.5px; }
.skey { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.lkey-yield { border-color: var(--s-yield); }
.lkey-sol { border-color: var(--s-sol); }
.best { color: var(--good); font-weight: 600; }
.proj-follow { margin: 8px 0 4px; align-items: center; }
.proj { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; margin-top: 8px; }
.proj { overflow-x: auto; }
.proj table { margin-top: 4px; font-size: 11px; }
.proj th, .proj td { padding: 3px 4px; white-space: normal; }
.proj td small { display: block; color: var(--muted); }
.slider-box { margin: 14px 0 4px; }
.slider-box input { width: 100%; accent-color: var(--s-value); }
.ticks { position: relative; height: 16px; }
.ticks span { position: absolute; transform: translateX(-50%); font-size: 10px; color: var(--muted); white-space: nowrap; }
.week-picker { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px; }
.week-picker button {
  flex: none; border: 1px solid var(--border); background: var(--surface); color: var(--ink-2);
  border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 13px; cursor: pointer;
}
.week-picker button[aria-pressed="true"] { color: var(--ink); border-color: var(--s-value); font-weight: 600; }
.hint:empty { display: none; }

.chart { position: relative; width: 100%; touch-action: pan-y; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart svg:focus { outline: none; }
.chart svg:focus-visible { outline: 2px solid var(--s-value); outline-offset: 2px; border-radius: 4px; }
.loading .chart, .loading .hero, .loading .tiles { opacity: 0.5; transition: opacity 0.2s; }
.axis-text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.grid-line { stroke: var(--grid); stroke-width: 1; }
.base-line { stroke: var(--axis); stroke-width: 1; }
.cross { stroke: var(--ink-2); stroke-width: 1; }
.marker-line { stroke: var(--muted); stroke-width: 1; }
.marker-line.mk-trade { stroke: var(--s-yield); stroke-width: 1.5; }
.marker-line.mk-you { stroke: var(--s-value); stroke-width: 1.5; }
.marker-line.mk-other { stroke-dasharray: 3 3; opacity: 0.7; }
.marker-line.mk-thor { stroke-dasharray: 1 3; opacity: 0.6; }
.marker-text { fill: var(--ink-2); font-size: 11px; }
.empty-text { fill: var(--muted); font-size: 13px; }

.tooltip {
  position: fixed; z-index: 10; pointer-events: none;
  background: var(--surface); color: var(--ink); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; font-size: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18); min-width: 150px;
}
.tt-time { color: var(--muted); margin-bottom: 4px; }
.tt-row { display: flex; align-items: center; gap: 8px; }
.tt-row strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.tt-row span:last-child { color: var(--ink-2); }
.tt-key { width: 12px; height: 0; border-top: 2px solid; }

.table-card summary { cursor: pointer; color: var(--ink-2); font-size: 14px; padding: 2px 0 4px; }
.table-wrap { max-height: 320px; overflow: auto; margin-top: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 4px 6px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--ink-2); font-weight: 600; position: sticky; top: 0; background: var(--surface); }

.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-top: 1px solid var(--grid); font-size: 14px;
}
.list li:first-child { border-top: 0; }
.list .when { color: var(--muted); font-size: 12px; }
.list .amt { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; flex: none; }
.list li > div:first-child { min-width: 0; }
.list .empty { color: var(--muted); }
.tag { font-weight: 600; }

.pool {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: baseline;
  padding: 10px 12px; border-radius: 10px; background: var(--page); margin-bottom: 6px;
}
.pool-total { font-size: 20px; font-weight: 600; }
.pool .sub { white-space: normal; }
.pool .mixbar {
  grid-column: 1 / -1; display: flex; gap: 2px; height: 8px; margin-top: 6px;
}
.pool .mixbar span { border-radius: 2px; min-width: 2px; }

.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.mini-seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--seg-bg); flex: none; }
.mini-seg button {
  border: 0; border-radius: 6px; background: transparent; color: var(--ink-2);
  font: inherit; font-size: 12px; padding: 4px 8px; min-height: 28px; cursor: pointer;
}
.mini-seg button[aria-pressed="true"] { background: var(--seg-on); color: var(--ink); font-weight: 600; }

.attr li .amt { font-weight: 600; }
.attr li.total { border-top: 1px solid var(--axis); }
.hc-group { margin-top: 10px; }
.hc-group h3 { margin-top: 6px; }
.hc { display: grid; grid-template-columns: 22px 1fr; gap: 2px 6px; padding: 6px 0; border-top: 1px solid var(--grid); }
.hc:first-of-type { border-top: 0; }
.hc .d { grid-column: 2; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.pbook { border-top: 1px solid var(--grid); padding: 8px 0; }
.pbook:first-child { border-top: 0; }
.pbook h3 { margin: 0 0 4px; color: var(--ink); font-size: 15px; }
.prow { display: grid; grid-template-columns: 64px 1fr 1fr; gap: 6px; font-size: 12px; padding: 2px 0; }
.prow .k { color: var(--muted); }
.prow.head { color: var(--muted); font-size: 11px; }

h3 { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 14px 0 2px; }
.thor-now { display: grid; gap: 8px; }
.call {
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
}
.call.hot { border-color: var(--s-value); box-shadow: inset 3px 0 0 var(--s-value); }
.call .state { font-size: 12px; color: var(--ink-2); text-align: right; }
.chip {
  display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 6px;
  border: 1px solid var(--border); color: var(--ink-2); margin-left: 4px;
}
.quiet { color: var(--muted); font-size: 14px; }

.foot { color: var(--muted); font-size: 12px; margin-top: 16px; text-align: center; }

@media (max-width: 380px) {
  .hero-value { font-size: 40px; }
  .tile-value { font-size: 16px; }
  .tiles { gap: 6px; }
  .tile { padding: 8px; }
}

/* --- all-in-one layout (2026-10-09): Home tiles, THOR signals, past calls --- */
.seg.sub { margin-top: -6px; }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.home-tile {
  text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px; color: var(--ink); font: inherit; cursor: pointer; min-width: 0;
}
.home-tile:active { background: var(--seg-bg); }
.home-tile .l { color: var(--muted); font-size: 12px; margin: 0 0 4px; }
.home-tile .v { font-size: 20px; font-weight: 600; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-tile .s { font-size: 12px; color: var(--ink-2); margin: 4px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list li.tap { cursor: pointer; align-items: center; }
.chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--seg-bg); color: var(--ink-2); white-space: nowrap; flex: none; }
.sig-group h3 { margin: 14px 0 2px; font-size: 14px; }
.sig-group:first-child h3 { margin-top: 4px; }
.list li.sig { display: block; padding: 0; }
.sig > button {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%;
  padding: 8px 0; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.sig > button > div { min-width: 0; }
.sig .detail { padding: 0 0 10px; }
.sigchart { width: 100%; min-height: 170px; }
.sigchart svg { display: block; overflow: visible; }
.facts { font-size: 12px; color: var(--ink-2); margin: 6px 0 0; }
.pc-row { display: grid; grid-template-columns: 96px 1fr; gap: 8px; align-items: center; padding: 3px 0; font-size: 12px; }
.pc-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.pc-track { position: relative; height: 10px; background: var(--seg-bg); border-radius: 3px; }
.pc-bar { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.pc-tick { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--axis); }
.pc-head { padding-bottom: 0; }
.pc-scale { position: relative; height: 14px; }
.pc-scale span { position: absolute; transform: translateX(-50%); font-size: 10px; color: var(--muted); white-space: nowrap; }
.list li.trade-detail { display: block; padding: 0 0 10px; border-top: 0; }
.rw-bars { margin: 6px 0 4px; }
.rw-row { display: flex; align-items: flex-end; gap: 4px; height: 46px; }
.rw-bar { flex: 1 1 0; max-width: 22px; background: var(--s-value); border-radius: 3px 3px 0 0; }
.quiet.small { font-size: 12px; margin: 4px 0 0; }
.sigchart { min-height: 210px; }

/* paper Results: "Show all closed trades" (2026-10-13) */
.linkish { display: block; width: 100%; margin-top: 8px; padding: 10px; border: 0; border-radius: 10px;
  background: var(--seg-bg); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }

/* Pool Party launchpad gallery (2026-10-14) */
.lp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 12px; margin-top: 8px; }
.lp-tile { min-width: 0; text-align: center; }
.lp-tile img, .lp-noimg { display: block; width: 100%; aspect-ratio: 1; border-radius: 10px; object-fit: cover;
  image-rendering: pixelated; background: var(--seg-bg); }
.lp-noimg { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; }
.lp-name { margin-top: 5px; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-sub { font-size: 11px; color: var(--muted); }
.lp-badge { display: inline-block; margin-top: 3px; padding: 1px 7px; border-radius: 8px; font-size: 10px;
  background: var(--seg-bg); color: var(--muted); }
.lp-badge.live { color: var(--ink); font-weight: 600; }
.lp-grid.lp-home { grid-template-columns: repeat(4, 1fr); gap: 8px; }
#home-lp { cursor: pointer; }
.tab-intro { margin: 14px 2px 4px; }

/* Launchpad: tappable tiles + collection sheet (2026-10-16, notifier/launchpad.py) */
.lp-open { background: none; border: 0; padding: 0; margin: 0; color: inherit; font: inherit; cursor: pointer; }
.lp-open:focus-visible { outline: 2px solid var(--s-value); outline-offset: 3px; border-radius: 12px; }
.sheet-back { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); display: flex; align-items: flex-end;
  justify-content: center; z-index: 50; }
.sheet { background: var(--surface); color: var(--ink); width: 100%; max-width: 640px; max-height: 88vh; overflow-y: auto;
  border-radius: 16px 16px 0 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom, 0px)); box-sizing: border-box; }
.sheet-head { display: flex; gap: 12px; align-items: center; }
.sheet-head img { width: 56px; height: 56px; border-radius: 10px; image-rendering: pixelated; object-fit: cover; flex: none; }
.sheet-titles { min-width: 0; flex: 1; }
.sheet-titles h2 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.sheet-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.sheet-close { background: var(--seg-bg); color: var(--ink); border: 0; border-radius: 999px; width: 34px; height: 34px;
  font-size: 15px; cursor: pointer; flex: none; }
.sheet-close:focus-visible { outline: 2px solid var(--s-value); outline-offset: 2px; }
.sheet-h { font-size: 14px; margin: 16px 0 4px; }
.lp-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; margin-top: 8px; }
.lp-item { min-width: 0; text-align: center; }
.lp-item img, .lp-item .lp-noimg { display: block; width: 100%; aspect-ratio: 1; border-radius: 8px; object-fit: cover;
  image-rendering: pixelated; background: var(--seg-bg); }
.lp-item.burned img { opacity: 0.35; filter: grayscale(1); }
.sheet a { color: var(--s-value); }
