:root {
  --bg: #f4f5f7; --card: #fff; --text: #16181d; --muted: #6b7280; --line: #e5e7eb;
  --accent: #2563eb; --accent-text: #fff; --ok: #16a34a; --warn: #d97706; --bad: #dc2626;
  --code: #f3f4f6; --radius: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1013; --card: #171a1f; --text: #e8eaed; --muted: #9aa1ac; --line: #2a2f37;
    --accent: #3b82f6; --code: #20242b;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: 24px 16px;
}
[hidden] { display: none !important; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; max-width: 460px; margin: 0 auto;
}
.wide { max-width: 980px; }
.head { border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 18px; }
.price { font-size: 26px; font-weight: 700; margin-top: 8px; }
section > * + * { margin-top: 12px; }

button, .btn {
  font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--card);
  color: var(--text); padding: 9px 14px; border-radius: 10px; text-decoration: none; display: inline-block;
}
button:hover, .btn:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.link { border: 0; background: none; color: var(--accent); padding: 0; }
button.danger { color: var(--bad); }
button:disabled { opacity: .5; cursor: default; }

.nets { display: grid; gap: 10px; }
.net {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 12px 16px; text-align: left;
}
.net b { font-size: 16px; }
.net-text { display: flex; flex-direction: column; line-height: 1.3; }
.coin { position: relative; width: 36px; height: 36px; flex: none; }
.coin img { width: 36px; height: 36px; border-radius: 50%; display: block; }
.coin img.coin-badge {
  position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px;
  border: 2px solid var(--card); background: var(--card);
}
.pay-coin { display: flex; align-items: center; }
.chip-icon { width: 18px; height: 18px; border-radius: 50%; }

.timer { font-size: 28px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.timer.low { color: var(--bad); }
.qr { display: flex; justify-content: center; }
.qr img { width: 200px; height: 200px; background: #fff; border-radius: 10px; padding: 6px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.copy { display: flex; gap: 8px; align-items: stretch; }
.copy code {
  flex: 1; background: var(--code); padding: 10px 12px; border-radius: 10px; word-break: break-all;
  font: 15px/1.4 ui-monospace, Consolas, monospace;
}
.copy code.big { font-size: 20px; font-weight: 700; }
.hint { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.status { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.spinner {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line);
  border-top-color: var(--accent); animation: spin .9s linear infinite; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.big-icon { font-size: 44px; text-align: center; line-height: 1; }
.ok-icon { color: var(--ok); }
.center { text-align: center; }
pre.goods {
  background: var(--code); padding: 12px; border-radius: 10px; white-space: pre-wrap; word-break: break-word;
  font: 14px/1.5 ui-monospace, Consolas, monospace; margin: 0;
}
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.conn { text-align: center; color: var(--warn); font-size: 13px; min-height: 1em; margin: 10px 0 0; }
.error { color: var(--bad); }

/* admin */
.grid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.grid .full { grid-column: 1 / -1; }
input, textarea, select {
  font: inherit; width: 100%; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text);
}
textarea { min-height: 70px; resize: vertical; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: flex; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; color: var(--text); font-size: 14px; margin: 0; }
.chip input { width: auto; margin: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; max-width: 980px; margin: 0 auto 16px; }
.list { display: grid; gap: 10px; margin-top: 16px; }
.inv { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; }
.inv .top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.badge { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--code); white-space: nowrap; }
.b-paid { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.b-waiting, .b-confirming { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.b-expired, .b-cancelled { color: var(--muted); }
.created { border: 1px dashed var(--accent); border-radius: 12px; padding: 12px; }
a { color: var(--accent); }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } .card { padding: 16px; } }
.mt { margin-top: 16px; }

.quick { display: flex; gap: 8px; }
.quick input { font-size: 20px; font-weight: 600; flex: 1; min-width: 0; }
.quick button { font-size: 16px; white-space: nowrap; }
details summary { cursor: pointer; color: var(--accent); }
