:root {
  --bg: #070a15;
  --panel: #0e1326;
  --panel-2: #131a33;
  --line: rgba(255, 255, 255, 0.09);
  --text: #e8ecf8;
  --muted: #8d97b5;
  --brand: #6366f1;
  --brand-2: #818cf8;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #fb7185;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

/* Author styles such as .btn { display: ... } would otherwise beat the hidden attribute. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background-image: radial-gradient(50rem 24rem at 5% -10%, rgba(99, 102, 241, 0.18), transparent),
    radial-gradient(40rem 20rem at 100% 0%, rgba(16, 185, 129, 0.1), transparent);
  background-attachment: fixed;
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 16px 64px;
}

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(7, 10, 21, 0.85);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand img {
  border-radius: 9px;
}
.brand div {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.top-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}
.who {
  font: 12px ui-monospace, Menlo, Consolas, monospace;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
}
.card h2,
.card h3 {
  margin: 0 0 10px;
  font-size: 16px;
}
.login {
  max-width: 460px;
  margin: 60px auto;
  text-align: center;
}
.login h1 {
  margin: 0 0 8px;
  font-size: 22px;
}

.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.tab {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  font: inherit;
}
.tab:hover {
  color: var(--text);
}
.tab[aria-current="true"] {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--brand-2);
  color: var(--text);
}

.btn {
  font: inherit;
  border-radius: 10px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn:hover {
  filter: brightness(1.15);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn.primary {
  background: linear-gradient(90deg, var(--brand), #4f46e5);
  border-color: transparent;
  font-weight: 600;
}
.btn.ghost {
  background: transparent;
}

.select,
.input {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
}
.input {
  width: 100%;
}
.input:focus,
.select:focus {
  outline: 2px solid rgba(129, 140, 248, 0.5);
}

.grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin-bottom: 16px;
}
.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.stat .label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat .value {
  font-size: 24px;
  font-weight: 700;
  margin-top: 4px;
  word-break: break-all;
}
.stat .sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.stat.good .value {
  color: var(--good);
}

.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
th,
td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.mono {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px;
}
a {
  color: var(--brand-2);
}

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 12px;
  border: 1px solid var(--line);
}
.pill.mint {
  color: var(--good);
}
.pill.redeem {
  color: var(--warn);
}

.bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bar-row {
  display: grid;
  grid-template-columns: 92px 1fr 90px;
  gap: 10px;
  align-items: center;
  font-size: 12.5px;
}
.bar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  height: 12px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--brand), var(--good));
  border-radius: 6px;
}

.msg {
  min-height: 1.4em;
  margin: 12px 0 0;
  font-size: 14px;
}
.msg.error {
  color: var(--bad);
}
.msg.ok {
  color: var(--good);
}
.banner {
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
  color: #fde68a;
}
.banner.bad {
  border-color: rgba(251, 113, 133, 0.4);
  background: rgba(251, 113, 133, 0.08);
  color: #fecdd3;
}
.row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.field {
  margin-bottom: 12px;
}
.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 560px) {
  .bar-row {
    grid-template-columns: 74px 1fr 70px;
  }
  .stat .value {
    font-size: 20px;
  }
}
