:root {
  --bg: #f6f7f4;
  --panel: #ffffff;
  --ink: #15201b;
  --muted: #5d6b64;
  --line: #e2e6e1;
  --accent: #0f7b5f;
  --accent-soft: #e3f3ec;
  --warn: #b4530b;
  --warn-soft: #fbeee2;
  --bar-users: #0f7b5f;
  --bar-team: #c9a227;
  --bar-sold: #c2410c;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1412;
    --panel: #161d1a;
    --ink: #e8efeb;
    --muted: #9aa8a1;
    --line: #26302c;
    --accent: #3cc48f;
    --accent-soft: #143127;
    --warn: #f0a35e;
    --warn-soft: #3a2616;
    --bar-users: #3cc48f;
    --bar-team: #d9b440;
    --bar-sold: #f07a3c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1412; --panel: #161d1a; --ink: #e8efeb; --muted: #9aa8a1; --line: #26302c;
  --accent: #3cc48f; --accent-soft: #143127; --warn: #f0a35e; --warn-soft: #3a2616;
  --bar-users: #3cc48f; --bar-team: #d9b440; --bar-sold: #f07a3c; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); }
code { font-size: 0.9em; background: var(--accent-soft); padding: 0 4px; border-radius: 4px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.top { padding: 40px 0 24px; border-bottom: 1px solid var(--line); background: var(--panel); }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-weight: 600; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
h1 { margin: 0 0 10px; font-size: clamp(28px, 5vw, 44px); line-height: 1.1; letter-spacing: -0.02em; }
.lede { margin: 0 0 8px; max-width: 70ch; color: var(--muted); }
.meta { margin: 0; font-size: 13px; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 24px 0 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card .k { font-size: 13px; color: var(--muted); }
.card .v { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
.card .s { font-size: 13px; color: var(--muted); }

.how { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; }
.how summary { cursor: pointer; font-weight: 600; }
.how ul { padding-left: 20px; margin: 10px 0; }
.how li { margin: 6px 0; }
.fine { font-size: 13px; color: var(--muted); }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 8px 0 12px; }
.search input {
  width: min(320px, 100%); padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); font: inherit;
}
.toggle { font-size: 14px; color: var(--muted); display: flex; gap: 6px; align-items: center; }

.tablewrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 11px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th.l, td.l { text-align: left; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); cursor: pointer; user-select: none; position: sticky; top: 0; background: var(--panel); }
th[aria-sort]::after { content: " ↓"; }
th[aria-sort="ascending"]::after { content: " ↑"; }
tbody tr.row { cursor: pointer; }
tbody tr.row:hover { background: var(--accent-soft); }
td .sub { display: block; font-size: 12px; color: var(--muted); }
.tag { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); margin-left: 6px; vertical-align: 2px; }
.tag.off { background: var(--line); color: var(--muted); }
.pctbar { display: inline-block; width: 56px; height: 6px; border-radius: 3px; background: var(--line); margin-left: 8px; vertical-align: middle; overflow: hidden; }
.pctbar i { display: block; height: 100%; background: var(--bar-users); }
.sold-hi { color: var(--warn); font-weight: 600; }

tr.detail td { text-align: left; white-space: normal; background: var(--bg); }
.dgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; padding: 4px 0; }
.dbox h3 { margin: 0 0 8px; font-size: 14px; }
.flow { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--line); margin: 6px 0 10px; }
.flow i { display: block; height: 100%; }
dl.kv { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; text-align: right; }
.rounds { display: flex; align-items: flex-end; gap: 2px; height: 48px; }
.rounds i { flex: 1; background: var(--bar-users); opacity: .75; border-radius: 2px 2px 0 0; min-height: 1px; }
.addr { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
ol.recips { margin: 0; padding-left: 18px; font-size: 13px; }
ol.recips li { margin: 3px 0; }

.foot { padding: 32px 16px 48px; color: var(--muted); font-size: 14px; }

/* Phones: each app becomes a card instead of a sideways-scrolling table row. */
@media (max-width: 680px) {
  .tablewrap { overflow: visible; background: none; border: 0; }
  table, tbody, tr, td { display: block; min-width: 0; width: 100%; }
  thead { display: none; }
  tbody tr.row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px;
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px; margin-bottom: 10px;
  }
  tbody tr.row td { border: 0; padding: 0; text-align: left; white-space: normal; }
  tbody tr.row td.l { grid-column: 1 / -1; margin-bottom: 4px; }
  tbody tr.row td[data-label]::before {
    content: attr(data-label); display: block; font-size: 11px; text-transform: uppercase;
    letter-spacing: .04em; color: var(--muted);
  }
  tbody tr.row[aria-expanded="true"] { border-radius: var(--radius) var(--radius) 0 0; margin-bottom: 0; }
  tr.detail td {
    border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius);
    padding: 12px 14px; margin-bottom: 10px;
  }
  .sortbar { display: flex; }
}
.sortbar { display: none; }
.sortbar select { padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; }

.checks { margin: 1.5rem 0; padding: 1rem 1.25rem; border: 1px solid var(--line, #ccc4); border-radius: 10px; }
.checks h2 { font-size: 1rem; margin: 0 0 .25rem; }
.checks ul { margin: .5rem 0 0; padding-left: 0; list-style: none; font-size: .9rem; }
.checks li { margin: .25rem 0; }
.checks .sub { display: block; opacity: .7; font-size: .8rem; margin-left: 1.1rem; }
