:root {
  --bg: #0f172a;
  --surface: #ffffff;
  --surface-dim: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #dc2626;
  --accent-dark: #b91c1c;
  --ok: #15803d;
  --warn: #b45309;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--surface-dim);
  color: var(--text);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  color: #fff;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { color: #fff; font-weight: 800; font-size: 18px; }
.brand:hover { text-decoration: none; }
.spacer { flex: 1; }
.me { font-size: 13px; opacity: 0.85; }

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
}
.badge-demo { background: #f59e0b; color: #451a03; }
.badge-live { background: #16a34a; color: #fff; }

.view { max-width: 960px; margin: 0 auto; padding: 20px 16px 48px; }

.footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px 32px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}

.card h2 { margin: 0 0 6px; font-size: 18px; }
.card h3 { margin: 0 0 8px; font-size: 16px; }
.muted { color: var(--muted); font-size: 13px; }
.big { font-size: 28px; font-weight: 800; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.pkg { display: flex; flex-direction: column; }
.pkg .price { font-weight: 800; font-size: 17px; margin: 8px 0 4px; }
.pkg .code { font-family: ui-monospace, monospace; font-size: 12px; color: var(--muted); word-break: break-all; }
.pkg .grow { flex: 1; }

.btn {
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
}
.btn:hover { background: var(--accent-dark); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost { background: transparent; border: 1px solid rgba(255,255,255,0.4); color: #fff; padding: 7px 12px; }
.btn-ghost:hover { background: rgba(255,255,255,0.1); }
.btn-secondary { background: #e2e8f0; color: var(--text); }
.btn-secondary:hover { background: #cbd5e1; }
.btn-block { width: 100%; margin-top: 10px; }

input, select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
}
label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 6px; }

.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input { flex: 2; min-width: 180px; }
.toolbar select { flex: 1; min-width: 140px; }

.alert {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 14px;
}
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-ok { background: #dcfce7; color: #166534; }
.alert-info { background: #dbeafe; color: #1e40af; }

.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-dim);
  color: var(--muted);
  margin-right: 6px;
}
.tag-success { background: #dcfce7; color: var(--ok); }
.tag-failed { background: #fee2e2; color: #991b1b; }
.tag-pending { background: #fef3c7; color: var(--warn); }

.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }

.pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 16px; }
.center { text-align: center; }
