:root {
  --bg: #0f1115;
  --surface: #1a1d24;
  --surface-2: #22262f;
  --text: #f2f4f8;
  --muted: #9aa3b2;
  --accent: #2f81f7;
  --accent-text: #ffffff;
  --ok: #2ea043;
  --warn: #d29922;
  --bad: #f85149;
  --border: #2c313c;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 76px;
}
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; font-size: 18px; letter-spacing: .2px; }
.chip {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600;
}
main { padding: 14px 14px 8px; max-width: 640px; margin: 0 auto; }
.search-row input {
  width: 100%; padding: 11px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 15px; outline: none;
}
.state { color: var(--muted); font-size: 14px; padding: 14px 2px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.card {
  text-align: left; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); border-radius: 14px; padding: 12px; cursor: pointer;
}
.card h3 { margin: 0 0 6px; font-size: 14px; line-height: 1.35; }
.card p { margin: 0 0 8px; font-size: 12px; color: var(--muted); line-height: 1.4; }
.card .price { font-weight: 700; font-size: 14px; }
.card .meta { font-size: 11px; color: var(--muted); margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.badge { border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.badge.ok { color: var(--ok); }
.badge.out { color: var(--bad); }
.badge.warn { color: var(--warn); }
.badge.flash { color: var(--warn); }
.more, .cta {
  display: block; width: 100%; margin: 14px 0 4px; padding: 12px;
  border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-text);
  font-size: 15px; font-weight: 600; text-align: center; text-decoration: none; cursor: pointer;
}
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.filters button {
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer;
}
.filters button.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.item {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 14px; padding: 12px; text-align: left; width: 100%; cursor: pointer;
}
.item .row { display: flex; justify-content: space-between; gap: 10px; }
.item h4 { margin: 0; font-size: 14px; line-height: 1.35; }
.item .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.item .target {
  margin-top: 10px; background: var(--surface-2); border-radius: 10px; padding: 10px;
  font-size: 12px; white-space: pre-wrap; word-break: break-all;
}
.status-SUCCESS { color: var(--ok); }
.status-PENDING { color: var(--warn); }
.status-FAILED { color: var(--bad); }
.profile-card, .balance-card, .variation {
  border: 1px solid var(--border); background: var(--surface); border-radius: 14px; padding: 14px; margin-bottom: 10px;
}
.balance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.balance-card.active { border-color: var(--accent); }
.balance-card .amount { font-size: 18px; font-weight: 700; margin-top: 4px; }
.muted { color: var(--muted); font-size: 13px; }
.note { font-size: 13px; color: var(--muted); line-height: 1.5; }
.back {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 10px; width: 38px; height: 34px; font-size: 16px; cursor: pointer; margin-bottom: 10px;
}
.detail h2 { margin: 2px 0 8px; font-size: 20px; line-height: 1.3; }
.detail .desc { color: var(--muted); font-size: 14px; line-height: 1.55; white-space: pre-wrap; }
.variation .vrow { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.variation h4 { margin: 0; font-size: 14px; }
.variation .vprice { font-weight: 700; white-space: nowrap; }
.variation .strike { text-decoration: line-through; color: var(--muted); font-size: 12px; margin-right: 6px; }
details { margin-top: 8px; font-size: 13px; color: var(--muted); }
details summary { cursor: pointer; color: var(--text); }
details div { white-space: pre-wrap; margin-top: 6px; line-height: 1.5; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  background: var(--bg); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  border: 0; background: transparent; color: var(--muted);
  padding: 12px 4px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.tabbar button.active { color: var(--accent); }
.empty { text-align: center; padding: 40px 10px; color: var(--muted); }
