:root {
  color-scheme: dark;
  --page: #101419;
  --surface: #171d24;
  --raised: #1c2530;
  --stroke: #333e4b;
  --text: #eef3f8;
  --muted: #aebbc9;
  --accent: #7bd9b6;
  --accent-ink: #10261f;
  --danger: #ffb4ad;
  --radius: 16px;
  --number: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-width: 0;
  margin: 0;
  color: var(--text);
  background: var(--page);
  line-height: 1.5;
}

a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
button:focus-visible, input:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.topbar { border-bottom: 1px solid var(--stroke); }
.topbar-inner { display: flex; min-height: 70px; align-items: center; justify-content: space-between; gap: 16px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1.125rem;
  font-weight: 720;
  letter-spacing: -.03em;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid #41665d;
  border-radius: 9px;
  color: var(--accent);
  background: #1e3732;
}
.brand-mark::before {
  width: 15px;
  height: 16px;
  content: "";
  background: currentColor;
  clip-path: polygon(50% 0, 94% 20%, 94% 58%, 79% 82%, 50% 100%, 21% 82%, 6% 58%, 6% 20%, 50% 0, 50% 19%, 23% 32%, 23% 56%, 35% 72%, 50% 82%, 65% 72%, 77% 56%, 77% 32%, 50% 19%);
}

.topbar-action, .quiet-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  font-size: .875rem;
  font-weight: 660;
  text-decoration: none;
}
.topbar-action:hover, .quiet-button:hover { background: var(--raised); }

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 365px);
  align-items: center;
  gap: clamp(32px, 9vw, 112px);
  padding-block: clamp(44px, 8vw, 90px) clamp(38px, 6vw, 72px);
  border-bottom: 1px solid var(--stroke);
}

h1, h2, p { margin-top: 0; }
h1 {
  max-width: 13ch;
  margin-bottom: 16px;
  font-size: clamp(2.65rem, 6.3vw, 5rem);
  font-weight: 680;
  letter-spacing: -.06em;
  line-height: 1.02;
}
h2 { margin-bottom: 0; font-size: 1.23rem; font-weight: 690; letter-spacing: -.025em; }
.lead { max-width: 38ch; margin-bottom: 0; color: var(--muted); font-size: 1.0625rem; }

.access-card { padding: 25px; border: 1px solid var(--stroke); border-radius: var(--radius); background: var(--surface); }
.access-card h2 + p { margin: 7px 0 24px; color: var(--muted); font-size: .875rem; }
.access-card form { display: grid; gap: 8px; }
.access-card label { font-size: .875rem; font-weight: 650; }
.access-card input {
  width: 100%;
  min-height: 45px;
  padding: 8px 11px;
  border: 1px solid var(--stroke);
  border-radius: 7px;
  color: var(--text);
  background: var(--page);
  font-size: 1rem;
}
.access-card input + label { margin-top: 7px; }
.access-card button {
  min-height: 45px;
  margin-top: 8px;
  border: 0;
  border-radius: 8px;
  color: var(--accent-ink);
  background: var(--accent);
  font-weight: 730;
}
.access-card button:hover:enabled { background: #a0e7cd; }

.public-metrics { padding-block: 30px 52px; }
.section-heading, .admin-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-heading { margin-bottom: 16px; }
.notice { margin: 10px 0; color: var(--muted); font-size: .875rem; }
.notice.error { color: var(--danger); }
.notice:empty { display: none; }
.access-card .notice { margin-bottom: 0; }

.metric-grid { display: grid; grid-template-columns: minmax(175px, 1fr) minmax(0, 3fr); gap: 12px; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 12px; align-items: stretch; }
.metric-card {
  min-width: 0;
  min-height: 125px;
  padding: 18px;
  border: 1px solid var(--stroke);
  border-radius: 11px;
  background: var(--surface);
}
.merchant-card { border-color: #41665d; background: #192c29; }
.metric-card p { margin-bottom: 9px; color: var(--muted); font-size: .8125rem; }
.metric-card h3 { margin: 0 0 8px; font-size: 1rem; font-weight: 710; }
.metric-card strong {
  display: block;
  font-family: var(--number);
  font-size: clamp(1.1rem, 2.7vw, 1.55rem);
  font-weight: 610;
  letter-spacing: -.04em;
  overflow-wrap: anywhere;
}
.merchant-card strong { font-size: clamp(1.55rem, 4vw, 2.7rem); }

.admin-heading { padding-block: 46px 23px; }
.admin-heading h1 { max-width: none; margin: 0; font-size: clamp(2rem, 6vw, 3.2rem); }
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--stroke); }
.tabs button {
  min-height: 46px;
  padding: 10px 16px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: transparent;
  font-weight: 650;
}
.tabs button[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--text); }
.tabs button:hover { background: var(--surface); }
.panel { min-width: 0; margin-block: 0 48px; }

.table-scroll { overflow: auto; border: 1px solid var(--stroke); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; text-align: start; }
th, td { max-width: 225px; padding: 13px 16px; text-align: start; vertical-align: top; }
th { color: var(--muted); background: var(--raised); font-size: .8125rem; font-weight: 670; }
td { border-top: 1px solid var(--stroke); font-size: .875rem; overflow-wrap: anywhere; }
td strong { font-weight: 650; }
td small { display: block; color: var(--muted); margin-top: 2px; }
td code { color: var(--text); font: .8125rem/1.5 var(--number); overflow-wrap: anywhere; }
.number { font-family: var(--number); font-variant-numeric: tabular-nums; }
.state { display: inline-block; padding: 2px 8px; border: 1px solid var(--stroke); border-radius: 6px; background: var(--raised); }
.state-ok { color: var(--accent); }
.state-error { color: var(--danger); }
.empty-state { padding: 22px; margin: 0; border: 1px solid var(--stroke); border-radius: 11px; color: var(--muted); background: var(--surface); }

@media (max-width: 740px) {
  .wrap { width: calc(100% - 32px); }
  .intro { grid-template-columns: minmax(0, 1fr); gap: 26px; padding-block: 38px 28px; }
  .access-card { max-width: 480px; width: 100%; padding: 20px; }
  .metric-grid { grid-template-columns: minmax(0, 1fr); }
  .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card { min-height: 106px; padding: 14px; }
  .admin-heading { padding-block: 31px 20px; }
  .tabs button { flex: 1 1 0; min-width: 0; padding-inline: 4px; font-size: .875rem; }
  .table-scroll { overflow: visible; border: 0; background: transparent; }
  table, tbody, tr, td { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  tbody tr { padding: 6px 13px; border: 1px solid var(--stroke); border-radius: 11px; background: var(--surface); }
  tbody tr + tr { margin-top: 10px; }
  td {
    display: grid;
    grid-template-columns: minmax(75px, 1fr) minmax(0, 1.7fr);
    gap: 12px;
    max-width: unset;
    padding: 10px 0;
    border: 0;
  }
  td + td { border-top: 1px solid var(--stroke); }
  .cell-value { min-width: 0; }
  .mobile-label { display: block; color: var(--muted); font-size: .8125rem; }
}

@media (min-width: 741px) { .mobile-label { display: none; } }

@media (max-width: 340px) {
  .asset-grid { grid-template-columns: minmax(0, 1fr); }
  .wrap { width: calc(100% - 24px); }
}
