:root {
  --bg: #f1f7f4;
  --panel: #ffffff;
  --panel-2: #e7f2ed;
  --line: #d3e6dd;
  --text: #062420;
  --muted: #557268;
  --accent: #0e9a62;
  --accent-ink: #ffffff;
  --accent-soft: #d5f4e5;
  --good: #0b8a56;
  --good-soft: #d5f4e5;
  --bad: #c2410c;
  --bad-soft: #ffedd5;
  --neutral-soft: #e9f1ed;
  --exit: #d97706;
  --logo-bg: #062420;
  --head: #062420;
  --head-text: #e8fff5;
  --shadow: 0 1px 2px rgb(6 36 32 / .06), 0 4px 16px rgb(6 36 32 / .05);
  --radius: 14px;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --brand: 'Unbounded', Inter, system-ui, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #04110f; --panel: #0a1d1a; --panel-2: #0f2824; --line: #173a33;
  --text: #e8fff5; --muted: #86a99d; --accent: #4ade9e; --accent-ink: #03231a; --accent-soft: #0c3628;
  --good: #4ade9e; --good-soft: #0c3628; --bad: #ff8f5e; --bad-soft: #35190d;
  --neutral-soft: #0f2522; --exit: #fbbf24; --logo-bg: #062420; --head: #020b0a; --head-text: #e8fff5;
  --shadow: none; color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #04110f; --panel: #0a1d1a; --panel-2: #0f2824; --line: #173a33;
    --text: #e8fff5; --muted: #86a99d; --accent: #4ade9e; --accent-ink: #03231a; --accent-soft: #0c3628;
    --good: #4ade9e; --good-soft: #0c3628; --bad: #ff8f5e; --bad-soft: #35190d;
    --neutral-soft: #0f2522; --exit: #fbbf24; --logo-bg: #062420; --head: #020b0a; --head-text: #e8fff5;
    --shadow: none; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Header */
.top { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top-row { display: flex; align-items: center; gap: 16px; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; text-decoration: none; letter-spacing: -.01em; }
.tabs { display: flex; gap: 4px; margin-left: 8px; }
.tabs button { background: none; border: 0; padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; }
.tabs button[aria-selected="true"] { background: var(--panel-2); color: var(--text); }
.top-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.tagline { margin: 0; padding-bottom: 10px; color: var(--muted); font-size: 13px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.live.on i { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.live.off i { background: var(--bad); }
.live b { font-weight: 600; color: var(--text); }
select, .icon-btn { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; height: 34px; padding: 0 10px; }
.icon-btn { min-width: 34px; display: inline-grid; place-items: center; padding: 0; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.small { height: 28px; min-width: 28px; padding: 0; border: 0; background: none; color: var(--muted); }

/* Referral strip */
.ref-wrap { margin-top: 14px; }
.ref { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; background: var(--accent-soft); border-radius: var(--radius); font-size: 14px; }
.ref-code-box { display: inline-flex; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; vertical-align: middle; }
.ref-code { font-family: var(--mono); font-weight: 600; padding: 3px 10px; text-decoration: none; color: var(--accent); }
.ref-code:hover { text-decoration: underline; }
.copy-btn { border: 0; border-left: 1px solid var(--line); background: none; padding: 0 8px; height: 28px; color: var(--muted); display: inline-grid; place-items: center; }
.copy-btn svg { width: 15px; height: 15px; }
.copy-btn:hover { color: var(--text); }
.copy-btn.done { color: var(--accent); }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.socials { display: inline-flex; gap: 6px; }
.social { color: var(--muted); text-decoration: none; }
.social:hover { color: var(--text); }
.ref .icon-btn { margin-left: auto; }

main.wrap { padding-top: 16px; padding-bottom: 24px; }

/* Summary cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card small { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.card strong { font-size: 22px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card span { font-size: 13px; }
.card.clickable { cursor: pointer; }

/* Controls */
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg button { border: 0; background: none; padding: 7px 12px; border-radius: 9px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.seg.small button { padding: 6px 10px; font-size: 13px; }
.boost { font-style: normal; font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 1px 6px; border-radius: 6px; margin-left: 4px; }
.amount { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.amount-box { display: inline-flex; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; height: 36px; color: var(--text); font-family: var(--mono); }
.amount-box input { border: 0; background: none; width: 80px; outline: none; font-family: var(--mono); padding-left: 2px; }
.presets { display: inline-flex; gap: 4px; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 500; white-space: nowrap; text-decoration: none; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--panel); border-color: var(--text); }
.chip.ghost { background: transparent; }
.chip.sort-main { border-color: var(--accent); color: var(--accent); }
.chip.sort-main[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.sorts, .filters { display: flex; flex-wrap: wrap; gap: 6px; }
.search { margin-left: auto; height: 36px; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 0 12px; min-width: 160px; outline: none; }
.search:focus, .amount-box:focus-within, .addr input:focus { border-color: var(--accent); }

/* Market list */
.list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.head, .row { display: grid; grid-template-columns: 28px minmax(110px, 1.2fr) 110px minmax(150px, 1.6fr) 150px 84px 24px; align-items: center; gap: 12px; padding: 0 16px; }
.head { height: 38px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: .04em; }
.row { min-height: 60px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s; }
.row:hover { background: var(--panel-2); }
.item:last-child .row:not(.open) { border-bottom: 0; }
.rank { color: var(--muted); font-size: 12px; font-family: var(--mono); text-align: right; }
.sym { display: flex; flex-direction: column; min-width: 0; }
.sym b { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.sym small { color: var(--muted); font-size: 12px; }
.tag { font-size: 10px; font-weight: 600; text-transform: uppercase; color: var(--muted); background: var(--neutral-soft); padding: 1px 5px; border-radius: 4px; letter-spacing: .03em; }
.star { background: none; border: 0; padding: 0; color: var(--muted); font-size: 16px; line-height: 1; }
.star.on { color: #eab308; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; width: fit-content; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.go { color: var(--good); background: var(--good-soft); }
.pill.ok { color: var(--muted); background: var(--neutral-soft); }
.pill.wait { color: var(--bad); background: var(--bad-soft); }
.pill.none { color: var(--muted); background: transparent; }
.pill.none::before { display: none; }
.edge { display: flex; flex-direction: column; }
.edge b { font-family: var(--mono); font-weight: 600; font-size: 15px; }
.edge b.pos { color: var(--good); }
.edge b.neg { color: var(--bad); }
.edge { min-width: 0; }
.edge small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spark { width: 150px; height: 36px; display: block; }
.chev { color: var(--muted); transition: transform .15s; }
.row.open .chev { transform: rotate(90deg); }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.skeleton .row { cursor: default; }
.skeleton .bar { height: 12px; border-radius: 6px; background: var(--panel-2); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }

/* Expanded detail */
.detail { padding: 16px; background: var(--panel-2); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.chart-box { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; min-width: 0; }
.chart { width: 100%; height: 190px; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.stats { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 10px; font-size: 13px; }
.stats div { display: flex; flex-direction: column; }
.stats small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.calc { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.calc h4 { margin: 0; font-size: 14px; }
.calc table { width: 100%; border-collapse: collapse; font-size: 13px; }
.calc td { padding: 5px 0; border-bottom: 1px dashed var(--line); }
.calc td:last-child { text-align: right; font-family: var(--mono); }
.verdict { padding: 10px 12px; border-radius: 10px; font-size: 13px; font-weight: 500; }
.verdict.go { background: var(--good-soft); color: var(--good); }
.verdict.ok { background: var(--neutral-soft); }
.verdict.wait { background: var(--bad-soft); color: var(--bad); }
.big { font-size: 26px; font-weight: 700; font-family: var(--mono); letter-spacing: -.02em; }
.big.pos { color: var(--good); }
.big.neg { color: var(--bad); }
.links { display: flex; flex-wrap: wrap; gap: 6px; }

/* Pairs */
.addr { display: flex; gap: 8px; }
.addr input { flex: 1; height: 42px; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 0 14px; font-family: var(--mono); outline: none; min-width: 0; }
.btn { height: 42px; border: 0; border-radius: 12px; padding: 0 18px; background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.addr-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.addr-chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 12px; }
.addr-chip .x { border: 0; background: none; color: var(--muted); padding: 0 0 0 4px; }
.err { color: var(--bad); font-size: 14px; }
.accounts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.pair { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; display: grid; grid-template-columns: 1fr 1.2fr; gap: 16px; }
.pair h3 { margin: 0 0 4px; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.legs { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.legs th { text-align: left; color: var(--muted); font-weight: 500; font-size: 11px; text-transform: uppercase; padding: 4px 0; }
.legs td { padding: 4px 0; font-family: var(--mono); }
.legs td:first-child { font-family: inherit; }
.target { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.target input { width: 90px; height: 32px; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 0 8px; font-family: var(--mono); }
.progress { height: 8px; background: var(--panel-2); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.warn { font-size: 13px; color: var(--bad); background: var(--bad-soft); padding: 6px 10px; border-radius: 8px; margin-top: 8px; }
.ok-msg { font-size: 13px; color: var(--good); background: var(--good-soft); padding: 6px 10px; border-radius: 8px; margin-top: 8px; }
.notify-row { margin-top: 8px; }

/* Guide */
.guide { max-width: 720px; }
.guide h2 { margin-top: 8px; }
.steps { padding-left: 20px; }
.steps li, .terms li { margin-bottom: 10px; }
.terms { padding-left: 20px; color: var(--muted); }
.foot { padding-bottom: 32px; }

/* Responsive */
@media (max-width: 820px) {
  .top-row { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 6px; gap: 8px; }
  .tabs { order: 3; width: 100%; margin: 0; overflow-x: auto; }
  .live small { display: none; }
  .cards { grid-template-columns: 1fr 1fr; }
  .cards .card:last-child { grid-column: span 2; }
  .head { display: none; }
  .row { grid-template-columns: 22px 1fr auto 18px; grid-template-areas: "star sym pill chev" "star edge spark chev" "star edge prem chev"; padding: 10px 12px; row-gap: 6px; }
  .row > .rank { grid-area: star; }
  .row > .sym { grid-area: sym; }
  .row > .pill { grid-area: pill; justify-self: end; }
  .row > .edge { grid-area: edge; }
  .row > .spark { grid-area: spark; width: 110px; justify-self: end; }
  .row > .chev { grid-area: chev; }
  .detail, .pair { grid-template-columns: 1fr; }
  .accounts { grid-template-columns: 1fr; }
  .search { margin-left: 0; width: 100%; }
  #dir { width: 100%; }
  #dir button { flex: 1; white-space: normal; line-height: 1.2; }
}
@media (max-width: 420px) {
  .amount-box input { width: 64px; }
  .seg button { padding: 6px 8px; font-size: 13px; }
  .card strong { font-size: 18px; }
}
.pos-text { color: var(--good); }
.neg-text { color: var(--bad); }

/* ---------- Money Club Monitor ---------- */
.top { background: var(--head); color: var(--head-text); border-bottom: 0; }
.top select, .top .icon-btn { background: rgb(255 255 255 / .06); border-color: rgb(255 255 255 / .12); color: var(--head-text); }
.top select option { color: #062420; }
.top .live, .top .live b { color: #b9d8cc; }
.top .live.on i { background: #4ade9e; box-shadow: 0 0 0 3px rgb(74 222 158 / .2); }
.logo { color: var(--head-text); }
.logo svg rect { stroke: #4ade9e; }
.logo svg path { stroke: #4ade9e; }
.logo svg circle { fill: #4ade9e; }
.wordmark { display: flex; flex-direction: column; line-height: 1; }
.wordmark b { font-family: var(--brand); font-weight: 800; font-size: 17px; letter-spacing: .01em; text-transform: uppercase; color: #4ade9e; }
.wordmark i { font-style: normal; font-family: var(--brand); font-weight: 700; font-size: 10px; letter-spacing: .38em; text-transform: uppercase; color: #b9d8cc; margin-top: 4px; }

/* Browser-like tabs: the selected one merges into the page below. */
.pairtabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-top: 4px; }
.pairtabs::-webkit-scrollbar { display: none; }
.ptab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; border: 0; padding: 10px 16px 11px; border-radius: 12px 12px 0 0;
  background: rgb(255 255 255 / .05); color: #a9c9bd; font-weight: 600; font-size: 14px; white-space: nowrap; position: relative; }
.ptab:hover { background: rgb(255 255 255 / .09); color: #e8fff5; }
.ptab[aria-selected="true"] { background: var(--bg); color: var(--text); }
.ptab[aria-selected="true"]::before { content: ''; position: absolute; left: 12px; right: 12px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.ptab-x { color: var(--accent); font-weight: 700; }
.ptab:not([aria-selected="true"]) .ptab-x { color: #4ade9e; opacity: .7; }

.sheet-top { padding-top: 16px; }
.sheet-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.sheet-head h1 { margin: 0; font-family: var(--brand); font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.sheet-head .tabs { margin: 0; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.sheet-head .tabs button { padding: 6px 12px; border-radius: 9px; }
.sheet-head .tabs button[aria-selected="true"] { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.sheet-top .tagline { padding: 6px 0 0; }
.ref-codes { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.ref-item { display: inline-flex; align-items: center; gap: 6px; }
.ref-venue { font-size: 13px; color: var(--muted); }
.note-box { margin-top: 12px; padding: 10px 14px; border: 1px solid var(--line); border-left: 3px solid var(--exit); background: var(--panel); border-radius: 10px; font-size: 13px; color: var(--muted); }
main.wrap { padding-top: 12px; }
.pair.one { grid-template-columns: 1fr; }
.foot-brand { display: flex; align-items: center; gap: 8px; font-family: var(--brand); font-weight: 700; font-size: 13px; padding: 4px 0 10px; }
.foot-refs { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
@media (max-width: 820px) {
  .wordmark b { font-size: 15px; }
  .top .live small { display: none; }
  .ptab { padding: 9px 12px 10px; font-size: 13px; }
  .sheet-head h1 { font-size: 15px; }
}
@media (max-width: 420px) {
  .top .live { display: none; }
}

/* Premium / Plus share */
.prem-wrap { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 16px; }
.prem-wrap > .prem { flex: 1 1 300px; min-width: 0; }
.prem { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.prem h4 { margin: 0 0 10px; font-size: 14px; }
.prem-share { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin-bottom: 10px; }
.prem-share > span { grid-column: 1 / -1; }
.prem-share div { display: flex; flex-direction: column; }
.prem-share small { color: var(--muted); font-size: 12px; }
.prem-share b { font-family: var(--mono); font-size: 18px; }
.prem-book { width: 100%; border-collapse: collapse; font-size: 13px; }
.prem-book th { text-align: right; font-weight: 500; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; padding: 0 6px 6px; }
.prem-book th:first-child, .prem-book td:first-child { text-align: left; }
.prem-book td { text-align: right; padding: 3px 6px; }
.prem-book tr.ask td:first-child { color: var(--bad); }
.prem-book tr.bid td:first-child { color: var(--good); }
.prem-book tr.mid td { border-top: 1px dashed var(--line); padding: 0; height: 6px; }
.prem-book .pp { position: relative; min-width: 72px; }
.prem-book .pbar { position: absolute; right: 6px; top: 3px; bottom: 3px; width: calc(var(--w) * .6); background: color-mix(in srgb, var(--exit) 28%, transparent); border-radius: 4px; }
.prem-book .pp b { position: relative; font-family: var(--mono); font-weight: 600; }
.prem-book .pp b.hi { color: var(--exit); }
.prem-book .pp b.lo { color: var(--muted); }
.prem-book .pp b.unk { color: var(--muted); font-weight: 400; }
.prem-note { flex-basis: 100%; margin: 0; }

/* Premium RH column */
.prem-col { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.prem-col b { font-family: var(--mono); font-size: 15px; }
.prem-col b.hi { color: var(--good); }
.prem-col b.mid { color: var(--exit); }
.prem-col b.lo { color: var(--bad); }
.prem-col b.unk { color: var(--muted); font-weight: 400; }
.prem-col small { color: var(--muted); font-family: var(--mono); font-size: 11px; }
.head .prem-head { text-align: right; }
@media (max-width: 820px) {
  .row > .prem-col { grid-area: prem; flex-direction: row; gap: 6px; align-items: baseline; justify-self: end; }
  .row > .prem-col:empty { display: none; }
}

/* beta badge and language buttons */
.beta { align-self: flex-start; margin-left: 2px; font: 700 10px/1 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .08em; color: #06231a; background: #4ade9e; border-radius: 6px; padding: 4px 6px; }
.langs { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; height: 34px; }
.langs button { border: 0; background: transparent; border-radius: 7px; padding: 0 9px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted, inherit); }
.langs button[aria-pressed="true"] { background: #4ade9e; color: #06231a; }
@media (max-width: 520px) { .langs button { padding: 0 7px; font-size: 12px; } .beta { font-size: 9px; padding: 3px 5px; } }
