:root {
  color-scheme: dark;
  --bg: #08110e;
  --panel: #0f1c17;
  --line: #263a31;
  --text: #eef7f1;
  --muted: #9bb0a3;
  --green: #6ee7a8;
  --amber: #f3c96b;
  --red: #ff8f86;
}

* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at 80% 0, #153225 0, var(--bg) 35%); color: var(--text); font: 16px/1.55 Inter, ui-sans-serif, system-ui, sans-serif; }
.shell { width: min(980px, calc(100% - 32px)); margin: 0 auto; padding: 44px 0 60px; }
.topbar, .section-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(2rem, 5vw, 3.6rem); letter-spacing: -.05em; }
h2 { margin-bottom: 0; }
.eyebrow { margin-bottom: 8px; color: var(--green); font-size: .73rem; font-weight: 800; letter-spacing: .18em; }
button { border: 1px solid var(--green); border-radius: 999px; background: var(--green); color: #07120d; padding: 11px 18px; font: inherit; font-weight: 800; cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.top-actions a { color: var(--green); font-weight: 800; text-decoration: none; }
.notice { margin: 34px 0 18px; border: 1px solid #6a5424; border-radius: 16px; background: #201b0f; padding: 18px 20px; }
.notice strong { color: var(--amber); }
.notice p { margin: 4px 0 0; color: #d8caa9; }
.balance-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(135deg, #13251c, var(--panel)); padding: clamp(24px, 5vw, 46px); }
.balance-card.stale strong { color: var(--muted); }
.label { display: block; margin-bottom: 8px; color: var(--muted); }
#balance { display: block; color: var(--green); font-size: clamp(2.2rem, 7vw, 4.8rem); letter-spacing: -.055em; }
.state { flex: 0 0 auto; border-radius: 999px; padding: 7px 11px; font-size: .8rem; font-weight: 800; }
.state.loading { background: #24352d; color: var(--muted); }
.state.ok { background: #153d29; color: var(--green); }
.state.bad { background: #47231f; color: var(--red); }
.truth { margin: 14px 2px 30px; color: var(--muted); }
.details, .products { border-top: 1px solid var(--line); padding-top: 28px; }
dl { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--line); }
dl div { min-width: 0; background: var(--panel); padding: 16px; }
dt { color: var(--muted); font-size: .8rem; }
dd { margin: 6px 0 0; overflow-wrap: anywhere; }
code { color: #c8e8d4; font: .82em ui-monospace, SFMono-Regular, Consolas, monospace; }
.products { margin-top: 38px; }
.section-head > span { color: var(--muted); font-size: .82rem; }
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 18px; }
.product-grid a { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--text); padding: 17px; text-decoration: none; }
.product-grid a:hover { border-color: var(--green); }
.product-grid small { align-self: flex-start; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--green); padding: 2px 8px; font-size: .7rem; font-weight: 800; }
.product-grid strong { margin-bottom: 3px; }
.product-grid span { color: var(--muted); font-size: .88rem; }
footer { margin-top: 38px; color: var(--muted); font-size: .84rem; }
.error { border-left: 3px solid var(--red); color: var(--red); padding-left: 12px; }

@media (max-width: 680px) {
  .topbar, .balance-card, .section-head { align-items: flex-start; flex-direction: column; }
  .top-actions { width: 100%; justify-content: space-between; }
  dl, .product-grid { grid-template-columns: 1fr; }
  #balance { font-size: 2.4rem; }
}
