/* MRInc console + sign-in — dark, monochrome with a cold accent. */
:root {
  --c-bg: #08080a;
  --c-panel: #0d0d10;
  --c-panel-2: #101014;
  --c-line: rgba(255, 255, 255, 0.09);
  --c-line-strong: rgba(255, 255, 255, 0.16);
  --c-text: #f2f2f3;
  --c-muted: #8a8a93;
  --c-dim: #5f5f68;
  --c-accent: #9db8ff;
  --c-accent-soft: rgba(157, 184, 255, 0.12);
  --c-green: #63d9a4;
  --c-red: #ff7a7a;
  --c-amber: #ffc46b;
  --c-radius: 16px;
  --c-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.console-body {
  background: var(--c-bg);
  color: var(--c-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.console-body a { color: inherit; text-decoration: none; }
.console-body ::selection { background: rgba(157, 184, 255, 0.3); }

/* ---------------------------------------------------------------- top bar */
.console-top {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--c-line);
  background: rgba(8, 8, 10, 0.82);
  backdrop-filter: blur(18px) saturate(140%);
}
.console-top__inner {
  max-width: 1440px;
  margin: 0 auto;
  height: 64px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.console-top .brand { font-size: 16px; letter-spacing: -0.01em; }
.console-top .brand svg { width: 26px; height: 26px; }
.console-top__nav {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: 8px;
  font-size: 13px;
  color: var(--c-muted);
}
.console-top__nav a { transition: color 0.2s; }
.console-top__nav a:hover, .console-top__nav a.is-active { color: var(--c-text); }
.console-top__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--c-muted);
}
.console-top__right .who {
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--c-mono);
  font-size: 11px;
}
.console-top__right .avatar-mini {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--c-line-strong);
  display: grid;
  place-items: center;
  font-size: 11px;
  color: var(--c-text);
  background: #16161b;
}

/* ---------------------------------------------------------------- shell */
.console-shell {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  align-items: start;
}
.console-side {
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  border-right: 1px solid var(--c-line);
  padding: 30px 18px 30px 32px;
}
.side-group { margin-bottom: 26px; }
.side-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-dim);
  margin: 0 0 10px 10px;
}
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--c-muted);
  transition: background 0.18s, color 0.18s;
}
.side-link:hover { background: rgba(255, 255, 255, 0.04); color: var(--c-text); }
.side-link.is-active { background: var(--c-accent-soft); color: var(--c-text); }
.side-link .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--c-accent);
  opacity: 0;
}
.side-link.is-active .dot { opacity: 1; }
.side-foot {
  margin-top: 34px;
  padding: 16px;
  border: 1px solid var(--c-line);
  border-radius: 12px;
  font-size: 11px;
  line-height: 1.55;
  color: var(--c-muted);
}
.side-foot b { display: block; color: var(--c-text); font-size: 12px; font-weight: 500; margin-bottom: 4px; }

.console-main {
  min-width: 0;
  padding: 38px 48px 90px;
  max-width: 1180px;
}
.console-crumb {
  font-family: var(--c-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-dim);
  margin-bottom: 14px;
}
.console-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}
.console-title {
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.035em;
  font-weight: 500;
  margin: 0;
}
.console-sub {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--c-muted);
}
.console-head__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- blocks */
.card {
  background: var(--c-panel);
  border: 1px solid var(--c-line);
  border-radius: var(--c-radius);
  padding: 22px;
}
.card--flush { padding: 0; overflow: hidden; }
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--c-line);
}
.card__title { font-size: 14px; font-weight: 500; margin: 0; letter-spacing: -0.01em; }
.card__hint { font-size: 11px; color: var(--c-dim); font-family: var(--c-mono); }

.stack-lg > * + * { margin-top: 18px; }

.profile {
  display: flex;
  align-items: center;
  gap: 18px;
}
.avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(145deg, #2a2f3d, #14161c);
  border: 1px solid var(--c-line-strong);
  display: grid;
  place-items: center;
  font-size: 19px;
  font-weight: 500;
  color: #dfe6fb;
  flex: none;
}
.profile__name { font-size: 18px; font-weight: 500; letter-spacing: -0.015em; }
.profile__mail { font-size: 12px; color: var(--c-muted); margin-top: 4px; }
.profile__meta {
  margin-left: auto;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.meta-k { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c-dim); margin-bottom: 5px; }
.meta-v { font-family: var(--c-mono); font-size: 11px; color: var(--c-muted); }
.meta-v--strong { color: var(--c-text); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat {
  border: 1px solid var(--c-line);
  border-radius: 12px;
  padding: 16px;
  background: var(--c-panel-2);
}
.stat__value { font-size: 25px; font-weight: 500; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat__value small { font-size: 11px; color: var(--c-muted); font-weight: 400; margin-left: 4px; letter-spacing: 0; }
.stat__label { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c-dim); margin-top: 6px; }

/* credits */
.credit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.credit-card {
  border: 1px solid var(--c-line);
  border-radius: 14px;
  background: var(--c-panel-2);
  padding: 18px;
}
.credit-card__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.credit-card__domain { font-size: 12px; letter-spacing: 0.04em; color: var(--c-muted); }
.credit-card__total { font-size: 28px; letter-spacing: -0.04em; font-weight: 500; font-variant-numeric: tabular-nums; }
.credit-card__total small { font-size: 10px; color: var(--c-dim); margin-left: 5px; letter-spacing: 0.08em; }
.credit-card__bar { height: 3px; background: rgba(255, 255, 255, 0.06); border-radius: 2px; margin: 12px 0 16px; overflow: hidden; }
.credit-card__bar i { display: block; height: 100%; background: linear-gradient(90deg, #6079b8, var(--c-accent)); border-radius: 2px; }
.op-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12px;
}
.op-row__name { color: var(--c-muted); }
.op-row__name b { font-weight: 400; color: var(--c-text); }
.op-row__right { display: flex; align-items: baseline; gap: 12px; }
.op-row__credits { font-family: var(--c-mono); font-size: 12px; color: var(--c-text); }
.op-row__price { font-family: var(--c-mono); font-size: 10px; color: var(--c-dim); }

/* segmented + select */
.controls { display: flex; align-items: center; gap: 10px; }
.segmented {
  display: inline-flex;
  border: 1px solid var(--c-line);
  border-radius: 9px;
  padding: 2px;
  background: #0a0a0c;
}
.seg {
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--c-muted);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.seg:hover { color: var(--c-text); }
.seg.is-active { background: #1c1c22; color: var(--c-text); }
.select {
  height: 34px;
  border: 1px solid var(--c-line);
  border-radius: 8px;
  background: #0a0a0c;
  color: var(--c-muted);
  font-family: inherit;
  font-size: 11px;
  padding: 0 10px;
  outline: none;
}
.select:focus { border-color: var(--c-line-strong); }

/* tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 560px; }
.table th {
  text-align: left;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-dim);
  font-weight: 400;
  padding: 10px 16px;
  border-bottom: 1px solid var(--c-line);
  white-space: nowrap;
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12px;
  color: var(--c-muted);
  white-space: nowrap;
}
.table tr:last-child td { border-bottom: 0; }
.table td.num { font-family: var(--c-mono); font-variant-numeric: tabular-nums; color: var(--c-text); }
.table tr.is-you td { background: var(--c-accent-soft); color: var(--c-text); }
.table tr.is-you td:first-child { box-shadow: inset 2px 0 0 var(--c-accent); }
.rank { font-family: var(--c-mono); color: var(--c-dim); }
.rank--top { color: var(--c-text); }
.who-name { color: var(--c-text); font-size: 12px; }
.who-you { font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-accent); margin-left: 7px; }
.badge-domain {
  font-family: var(--c-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-muted);
  border: 1px solid var(--c-line);
  border-radius: 4px;
  padding: 2px 5px;
}
.status { font-size: 10px; font-family: var(--c-mono); letter-spacing: 0.03em; }
.status--ok { color: var(--c-green); }
.status--refunded { color: var(--c-amber); }
.status--reserved { color: var(--c-dim); }

.keys { display: grid; gap: 10px; }
.key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--c-line);
  border-radius: 10px;
  background: #0a0a0c;
  font-size: 12px;
}
.key-prefix { font-family: var(--c-mono); font-size: 11px; color: var(--c-text); }
.key-meta { font-family: var(--c-mono); font-size: 10px; color: var(--c-dim); }
.key-note { font-size: 11px; color: var(--c-dim); margin-top: 12px; line-height: 1.55; }

.empty {
  padding: 34px 20px;
  text-align: center;
  font-size: 12px;
  color: var(--c-dim);
}
.error-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(255, 122, 122, 0.32);
  background: rgba(255, 122, 122, 0.07);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 12px;
  color: #ffc4c4;
  margin-bottom: 18px;
}
.error-banner.is-on { display: flex; }
.error-banner button { background: none; border: 0; color: #ffc4c4; text-decoration: underline; cursor: pointer; font: inherit; }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 9px;
  border: 1px solid var(--c-line-strong);
  background: transparent;
  color: var(--c-text);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.btn:hover { background: rgba(255, 255, 255, 0.06); }
.btn--primary { background: #f2f2f3; border-color: #f2f2f3; color: #08080a; font-weight: 500; }
.btn--primary:hover { background: #fff; }
.btn--ghost { border-color: transparent; color: var(--c-muted); }
.btn--ghost:hover { color: var(--c-text); background: rgba(255, 255, 255, 0.05); }
.btn--block { width: 100%; height: 44px; }
.btn:disabled { opacity: 0.55; cursor: default; }

/* ---------------------------------------------------------------- auth */
.auth-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px 24px 80px;
  display: grid;
  grid-template-columns: 1fr 0.92fr;
  gap: 22px;
  align-items: stretch;
}
.auth-card {
  background: var(--c-panel);
  border: 1px solid var(--c-line);
  border-radius: 22px;
  padding: 44px;
}
.auth-mark {
  width: 38px; height: 38px; border-radius: 11px;
  border: 1px solid var(--c-line-strong);
  display: grid; place-items: center; margin-bottom: 28px;
}
.auth-card h1 { font-size: 30px; letter-spacing: -0.035em; font-weight: 500; margin: 0 0 10px; }
.auth-lede { font-size: 13px; line-height: 1.65; color: var(--c-muted); margin: 0 0 28px; max-width: 380px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--c-dim); margin-bottom: 8px; }
.field input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--c-line);
  border-radius: 10px;
  background: #0a0a0c;
  color: var(--c-text);
  font-family: inherit;
  font-size: 13px;
  padding: 0 14px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.field input:focus { border-color: rgba(157, 184, 255, 0.55); box-shadow: 0 0 0 3px rgba(157, 184, 255, 0.1); }
.field input::placeholder { color: #4d4d56; }
.key-field { position: relative; }
.key-field input { padding-right: 74px; font-family: var(--c-mono); font-size: 12px; }
.key-toggle {
  position: absolute; right: 6px; top: 6px; height: 34px;
  border: 0; background: transparent; color: var(--c-muted);
  font-family: inherit; font-size: 11px; cursor: pointer; padding: 0 10px; border-radius: 7px;
}
.key-toggle:hover { color: var(--c-text); background: rgba(255, 255, 255, 0.05); }
.auth-error {
  display: none;
  border: 1px solid rgba(255, 122, 122, 0.3);
  background: rgba(255, 122, 122, 0.07);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 11px;
  line-height: 1.5;
  color: #ffc4c4;
  margin: 4px 0 14px;
}
.auth-error.is-on { display: block; }
.auth-note { font-size: 10px; line-height: 1.6; color: var(--c-dim); margin: 18px 0 0; }
.auth-meta { display: flex; justify-content: space-between; gap: 16px; margin-top: 22px; font-size: 11px; color: var(--c-dim); }
.auth-meta a { color: var(--c-muted); text-decoration: underline; text-underline-offset: 3px; }
.auth-meta a:hover { color: var(--c-text); }

.auth-aside {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--c-line);
  border-radius: 22px;
  padding: 40px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(157, 184, 255, 0.12), transparent 55%),
    radial-gradient(80% 70% at 0% 100%, rgba(99, 217, 164, 0.06), transparent 60%),
    #0b0b0e;
  display: flex;
  flex-direction: column;
}
.auth-aside h2 { font-size: 21px; line-height: 1.35; letter-spacing: -0.025em; font-weight: 400; margin: 0 0 26px; max-width: 340px; }
.auth-points { display: grid; gap: 20px; margin-top: auto; }
.auth-point { display: grid; grid-template-columns: 30px 1fr; gap: 12px; }
.auth-point .n {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--c-line-strong);
  display: grid; place-items: center;
  font-family: var(--c-mono); font-size: 10px; color: var(--c-accent);
}
.auth-point b { display: block; font-size: 12px; font-weight: 500; margin-bottom: 4px; }
.auth-point p { margin: 0; font-size: 11px; line-height: 1.55; color: var(--c-muted); }
.auth-conn {
  margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--c-line);
  display: flex; align-items: center; gap: 8px;
  font-family: var(--c-mono); font-size: 10px; color: var(--c-dim);
}
.auth-conn i { width: 6px; height: 6px; border-radius: 50%; background: var(--c-green); }

/* ---------------------------------------------------------------- mobile */
@media (max-width: 1000px) {
  .console-shell { grid-template-columns: 1fr; }
  .console-side { display: none; }
  .console-main { padding: 28px 22px 70px; }
  .console-top__inner { padding: 0 20px; gap: 14px; }
  .console-top__nav { display: none; }
  .credit-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .console-head { flex-direction: column; align-items: flex-start; }
  .profile { flex-wrap: wrap; }
  .profile__meta { margin-left: 0; width: 100%; }
  .auth-wrap { grid-template-columns: 1fr; padding: 28px 16px 60px; }
  .auth-card { padding: 30px 22px; border-radius: 18px; }
  .auth-aside { display: none; }
  .console-title { font-size: 28px; }
}
@media (max-width: 560px) {
  .console-top__right .who { display: none; }
  .stats { grid-template-columns: 1fr 1fr; }
  .credit-card__total { font-size: 24px; }
}

/* console extras */
.console-code {
  margin: 0;
  padding: 15px 16px;
  background: #0a0a0c;
  border: 1px solid var(--c-line);
  border-radius: 10px;
  font-family: var(--c-mono);
  font-size: 11px;
  line-height: 1.75;
  color: #c8c8d0;
  overflow-x: auto;
  white-space: pre;
}
.console-code .tok-str { color: var(--c-accent); }
.console-code--sm { font-size: 10px; line-height: 1.7; }
.lb-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--c-line);
  font-family: var(--c-mono);
  font-size: 10px;
  color: var(--c-dim);
}
.console-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 38px;
  padding-top: 18px;
  border-top: 1px solid var(--c-line);
  font-size: 10px;
  color: var(--c-dim);
}
.console-foot a { margin-left: 16px; color: var(--c-muted); }
.console-foot a:hover { color: var(--c-text); }

.topup-dialog {
  width: calc(100vw - 32px);
  max-width: 640px;
  border: 1px solid var(--c-line-strong);
  border-radius: 18px;
  background: var(--c-panel);
  color: var(--c-text);
  padding: 24px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}
.topup-dialog::backdrop { background: rgba(4, 4, 6, 0.74); backdrop-filter: blur(4px); }
.topup-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.topup-dialog h3 { font-size: 17px; font-weight: 500; letter-spacing: -0.02em; margin: 0; }
.topup-dialog p { font-size: 12px; line-height: 1.6; color: var(--c-muted); margin: 8px 0 16px; }
.topup-dialog .table { min-width: 460px; }
.topup-close {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--c-line); background: transparent; color: var(--c-muted);
  font-size: 18px; line-height: 1; cursor: pointer;
}
.topup-close:hover { color: var(--c-text); background: rgba(255, 255, 255, 0.06); }
.topup-dialog__foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.topup-dialog code { font-family: var(--c-mono); font-size: 10px; color: var(--c-text); }

/* auth aside wallet strip */
.auth-wallets {
  margin: 2px 0 26px;
  border-top: 1px solid var(--c-line);
  border-bottom: 1px solid var(--c-line);
}
.auth-wallet {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 11px;
}
.auth-wallet:first-child { border-top: 0; }
.auth-wallet span { color: var(--c-muted); }
.auth-wallet b { font-family: var(--c-mono); font-size: 10px; font-weight: 400; color: var(--c-text); letter-spacing: 0.02em; }
.auth-points { margin-top: 24px; }

.btn { white-space: nowrap; }

/* centered single-card sign-in */
.auth-wrap {
  min-height: calc(100vh - 64px);
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-card { width: min(480px, 100%); animation: auth-in 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) 0.08s both; }
.auth-conn--card { margin-top: 18px; padding-top: 16px; }
.page-veil--enter { opacity: 1; animation: veil-out 0.55s ease 0.04s forwards; }
.console-main { animation: console-in 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes veil-out { to { opacity: 0; visibility: hidden; } }
@keyframes auth-in {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@keyframes console-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 1000px) {
  .auth-wrap { min-height: calc(100vh - 64px); padding: 28px 16px 48px; }
  .auth-card { width: min(480px, 100%); }
}
@media (prefers-reduced-motion: reduce) {
  .page-veil--enter { animation-duration: 0.01s; }
  .auth-card, .console-main { animation: none; }
}

/* two-step email-code sign-in */
.auth-lang { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--c-dim); }
.auth-lang a { color: var(--c-muted); }
.auth-lang a.is-active { color: var(--c-text); }
.auth-lang i { width: 1px; height: 10px; background: var(--c-line-strong); }
.auth-card [hidden] { display: none !important; }
.auth-code-hint { font-size: 12px; line-height: 1.6; color: var(--c-muted); margin: 0 0 18px; }
.auth-code-hint b { color: var(--c-text); font-weight: 500; }
.auth-switch { display: flex; justify-content: space-between; gap: 16px; margin-top: 18px; font-size: 11px; }
.auth-switch button {
  padding: 0;
  color: var(--c-muted);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.auth-switch button:hover { color: var(--c-text); }
.auth-switch button:disabled { opacity: 0.45; text-decoration: none; cursor: default; }
.auth-dev {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--c-line);
  font-family: var(--c-mono);
  font-size: 10px;
  color: var(--c-dim);
  letter-spacing: 0.02em;
}
#code { font-family: var(--c-mono); font-size: 20px; letter-spacing: 0.28em; text-align: center; padding-left: 22px; }

.key-reveal {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--c-line);
  border-radius: 10px;
  background: #0a0a0c;
  padding: 10px 12px;
}
.key-reveal code {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  font-family: var(--c-mono);
  font-size: 11px;
  color: var(--c-text);
}
.key-reveal .btn { flex: none; height: 32px; }

/* self-service top-up form */
.topup-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}
.topup-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-dim);
}
.topup-form select,
.topup-form input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--c-line);
  border-radius: 8px;
  background: #0a0a0c;
  color: var(--c-text);
  font-family: inherit;
  font-size: 12px;
  padding: 0 10px;
  outline: none;
}
.topup-form select:focus,
.topup-form input:focus { border-color: var(--c-line-strong); }
.topup-result {
  border: 1px solid rgba(99, 217, 164, 0.3);
  background: rgba(99, 217, 164, 0.07);
  color: #a9f0cb;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 11px;
  line-height: 1.5;
  margin: 0 0 6px;
}
.topup-result[hidden] { display: none; }
@media (max-width: 600px) {
  .topup-form { grid-template-columns: 1fr; }
}

/* compact dashboard */
.dash {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 40px 70px;
  animation: console-in 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.dash-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}
.dash-head .console-title { font-size: 30px; }
.dash .stats { margin-top: 14px; }
.profile-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  margin-top: 18px;
}
.profile-strip .profile__meta { margin-left: auto; }
.dash > .card { margin-top: 18px; }
.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}
.dash-grid > .card { margin-top: 0; }
.credit-table { width: 100%; border-collapse: collapse; }
.credit-table th {
  padding: 9px 14px;
  border-bottom: 1px solid var(--c-line);
  text-align: left;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-dim);
  font-weight: 400;
}
.credit-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12px;
  color: var(--c-muted);
}
.credit-table td:first-child { color: var(--c-text); }
.credit-table td.num { font-family: var(--c-mono); color: var(--c-text); font-variant-numeric: tabular-nums; }
.credit-table tfoot td {
  border-top: 1px solid var(--c-line);
  border-bottom: 0;
  font-family: var(--c-mono);
  font-size: 11px;
  color: var(--c-muted);
  padding-top: 11px;
}
.credit-table tfoot td:first-child { font-family: var(--c-sans, inherit); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c-dim); }
.dash-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--c-line);
  font-size: 10px;
  color: var(--c-dim);
}
.dash-foot a { margin-left: 16px; color: var(--c-muted); }
.dash-foot a:hover { color: var(--c-text); }
@media (max-width: 1000px) {
  .dash { padding: 24px 20px 60px; }
  .dash-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .dash-grid { grid-template-columns: 1fr; }
  .profile-strip { flex-wrap: wrap; }
  .profile-strip .profile__meta { margin-left: 0; width: 100%; }
}
@media (max-width: 560px) {
  .credit-table th, .credit-table td { padding: 9px 8px; font-size: 11px; }
}

/* richer, centered sign-in */
.auth-wrap { position: relative; isolation: isolate; }
.auth-wrap::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(52% 44% at 50% 34%, rgba(157, 184, 255, 0.10), transparent 70%),
    radial-gradient(40% 30% at 82% 82%, rgba(99, 217, 164, 0.035), transparent 70%);
  pointer-events: none;
}
.auth-wrap::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(58% 48% at 50% 38%, #000 0, transparent 78%);
  mask-image: radial-gradient(58% 48% at 50% 38%, #000 0, transparent 78%);
  pointer-events: none;
}
.auth-card--rich {
  width: min(500px, 100%);
  min-height: 560px;
  display: flex;
  flex-direction: column;
  text-align: center;
  padding: 38px 42px 22px;
  background: linear-gradient(180deg, #0f0f13 0%, #0b0b0e 100%);
  position: relative;
  overflow: hidden;
}
.auth-card--rich::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16%;
  right: 16%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(157, 184, 255, 0.7), transparent);
}
.auth-card--rich .auth-mark {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  margin: 0 auto 14px;
  color: var(--c-text);
}
.auth-eyebrow {
  font-family: var(--c-mono);
  font-size: 8.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-dim);
}
.auth-card--rich h1 { font-size: 34px; letter-spacing: -0.045em; margin: 7px 0 9px; }
.auth-card--rich .auth-lede {
  margin: 0 auto;
  max-width: 350px;
  font-size: 12.5px;
  line-height: 1.65;
  text-align: center;
}
.auth-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 20px 0 22px;
  color: var(--c-dim);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.auth-step { display: inline-flex; align-items: center; gap: 6px; transition: color 0.2s; }
.auth-step i {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1px solid var(--c-line-strong);
  display: grid;
  place-items: center;
  font-family: var(--c-mono);
  font-size: 8px;
  font-style: normal;
  color: var(--c-dim);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.auth-step b { font-weight: 400; }
.auth-step__line { width: 34px; height: 1px; background: var(--c-line); }
.auth-step.is-active { color: var(--c-text); }
.auth-step.is-active i { border-color: var(--c-accent); color: var(--c-accent); }
.auth-step.is-done { color: var(--c-muted); }
.auth-step.is-done i { background: var(--c-accent); border-color: var(--c-accent); color: #08080a; }
.auth-card--rich form { width: 100%; text-align: left; }
.input-wrap { position: relative; }
.input-wrap svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--c-dim);
  pointer-events: none;
}
.input-wrap input { padding-left: 40px; }
.input-wrap--code input {
  font-family: var(--c-mono);
  font-size: 19px;
  letter-spacing: 0.26em;
  text-align: center;
  padding-left: 40px;
  padding-right: 14px;
}
.auth-card--rich .auth-switch { justify-content: center; gap: 10px; margin-top: 16px; color: var(--c-dim); }
.auth-card--rich .auth-switch button { color: var(--c-muted); }
.auth-card--rich .auth-error { text-align: center; }
.auth-card--rich .auth-dev { text-align: center; }
.auth-card--rich .auth-trust {
  margin-top: auto;
  padding-top: 17px;
  border-top: 1px solid var(--c-line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--c-dim);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.auth-trust span { display: inline-flex; align-items: center; gap: 6px; }
.auth-trust i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--c-green);
  box-shadow: 0 0 0 3px rgba(99, 217, 164, 0.08);
}
@media (max-width: 560px) {
  .auth-card--rich { min-height: 0; padding: 30px 22px 18px; }
  .auth-card--rich h1 { font-size: 29px; }
  .auth-trust { gap: 10px; font-size: 8px; }
}

/* centered page titles */
.dash-head { flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.dash-head .console-head__actions { justify-content: center; }
.dash-head .console-crumb, .dash-head .console-sub { text-align: center; }

.auth-card .btn svg { width: 13px; height: 13px; flex: none; }
.auth-card--rich .btn--block { display: flex; align-items: center; justify-content: center; gap: 8px; }
.auth-card--rich .auth-code-hint { text-align: center; }

/* center card titles, keep controls at the right on desktop */
.dash .card > .card__head {
  position: relative;
  justify-content: center;
  text-align: center;
}
.dash .card > .card__head .card__title,
.dash .card > .card__head .card__hint { text-align: center; }
.dash .card > .card__head .controls,
.dash .card > .card__head > .btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}
@media (max-width: 700px) {
  .dash .card > .card__head { flex-direction: column; align-items: center; }
  .dash .card > .card__head .controls,
  .dash .card > .card__head > .btn { position: static; transform: none; margin-top: 12px; }
}

/* stack card controls under centered titles to avoid overlap */
.dash .card > .card__head {
  position: relative;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}
.dash .card > .card__head .controls,
.dash .card > .card__head > .btn {
  position: static;
  transform: none;
  margin-top: 2px;
}

.dash .card > .card__head { gap: 12px; }

/* center stat values and labels */
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.stat__value, .stat__label { text-align: center; }

/* usage bar chart */
.chart { position: relative; padding: 4px 22px 0; }
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 180px;
  padding-top: 16px;
  border-bottom: 1px solid var(--c-line);
  background: repeating-linear-gradient(to top, transparent 0, transparent 43px, rgba(255, 255, 255, 0.04) 43px, rgba(255, 255, 255, 0.04) 44px);
}
.chart-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.chart-bar {
  width: 100%;
  max-width: 30px;
  min-height: 2px;
  max-height: calc(100% - 24px);
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--c-accent), rgba(122, 151, 230, 0.35));
  position: relative;
  transition: height 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.chart-bar span { position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%); font: 9px var(--c-mono); color: var(--c-muted); }
.chart-col:hover .chart-bar { filter: brightness(1.2); }
.chart-day { margin-top: 7px; height: 14px; font: 8px var(--c-mono); color: var(--c-dim); white-space: nowrap; letter-spacing: 0.03em; }
.chart[data-days="14"] .chart-bar span { display: none; }
.chart[data-days="14"] .chart-day { font-size: 7px; letter-spacing: -0.02em; }
.chart-empty { position: absolute; left: 22px; right: 22px; top: 20px; bottom: 38px; display: grid; place-items: center; color: var(--c-dim); font-size: 11px; pointer-events: none; }
.chart-foot { display: flex; justify-content: center; gap: 12px; padding: 12px 22px 16px; font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-dim); }
.chart-foot span:first-child { color: var(--c-muted); }

/* key reveal eye */
.key-eye {
  flex: none;
  width: 32px;
  height: 32px;
  border: 1px solid var(--c-line);
  border-radius: 8px;
  background: transparent;
  color: var(--c-dim);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.key-eye:hover { color: var(--c-text); border-color: var(--c-line-strong); }
.key-eye.is-on { color: var(--c-accent); border-color: rgba(157, 184, 255, 0.45); }
.key-eye svg { width: 16px; height: 16px; }

/* billing / top-up page */
.billing-hero { text-align: center; margin: 6px 0 24px; }
.billing-hero .console-title { font-size: 34px; }
.billing-hero .console-sub { margin: 6px auto 0; max-width: 460px; }
.billing-chips { display: flex; justify-content: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.billing-chips span {
  border: 1px solid var(--c-line);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-dim);
}
.billing-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.billing .card { margin-top: 0; }
.wallet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.wallet {
  text-align: left;
  border: 1px solid var(--c-line);
  border-radius: 10px;
  background: #0a0a0c;
  padding: 10px 11px;
  color: var(--c-muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color 0.2s, background 0.2s;
}
.wallet:hover { border-color: var(--c-line-strong); }
.wallet.is-active { border-color: rgba(157, 184, 255, 0.62); background: rgba(157, 184, 255, 0.06); }
.wallet__top { display: flex; justify-content: space-between; gap: 6px; font-size: 8px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-dim); }
.wallet__balance { font: 16px var(--c-mono); color: var(--c-text); }
.wallet__price { font: 8px var(--c-mono); color: var(--c-dim); }
.amount-presets { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
.amount-chip {
  border: 1px solid var(--c-line);
  background: transparent;
  color: var(--c-muted);
  border-radius: 999px;
  padding: 5px 10px;
  font: 9px var(--c-mono);
  cursor: pointer;
}
.amount-chip:hover, .amount-chip.is-active { border-color: var(--c-line-strong); color: var(--c-text); }
.billing-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  border-top: 1px solid var(--c-line);
  border-bottom: 1px solid var(--c-line);
  padding: 14px 0;
  margin: 2px 0 16px;
}
.billing-summary span { display: block; font-size: 8px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c-dim); margin-bottom: 4px; }
.billing-summary b { font: 16px var(--c-mono); color: var(--c-text); }
.billing-form { margin-top: 16px; }
.billing-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }
.billing-note-row { text-align: center; color: var(--c-dim); font-size: 10px; line-height: 1.65; max-width: 650px; margin: 24px auto 0; }
@media (max-width: 1000px) {
  .billing-layout { grid-template-columns: 1fr; }
  .wallet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .billing-summary { grid-template-columns: 1fr 1fr; }
  .billing-actions { flex-direction: column-reverse; }
  .billing-hero .console-title { font-size: 30px; }
}

/* leaderboard tabs and inline key reveal */
.tabs {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--c-line);
  border-radius: 9px;
  background: #0a0a0c;
  flex-wrap: wrap;
}
.tab {
  border: 0;
  background: transparent;
  color: var(--c-dim);
  border-radius: 6px;
  padding: 6px 12px;
  font: 9px var(--c-mono);
  letter-spacing: 0.06em;
  cursor: pointer;
}
.tab:hover { color: var(--c-muted); }
.tab.is-active { background: var(--c-panel-2); color: var(--c-text); }
.tab-panel[hidden] { display: none; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px 12px;
  border-bottom: 1px solid var(--c-line);
}
.panel-head .card__hint { margin: 0; }
.panel-head .controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#leaderboard-card .lb-foot { padding: 12px 22px 16px; }
#leaderboard-card .table-wrap { margin: 0; }
#leaderboard-card .keys { padding: 14px 22px 4px; }
#leaderboard-card .key-note { padding: 0 22px 16px; margin: 10px 0 0; }

.key-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.key-value {
  font-family: var(--c-mono);
  font-size: 11px;
  color: var(--c-text);
  overflow-wrap: anywhere;
  white-space: normal;
}
.key-value.is-revealed { color: var(--c-accent); }
.key-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.key-copy { height: 30px; font-size: 9px; padding: 0 10px; }
.key-row .key-eye { width: 30px; height: 30px; }
.key-row .key-eye svg { width: 15px; height: 15px; }
.key-row .key-eye[disabled] { opacity: 0.3; cursor: not-allowed; }
@media (max-width: 700px) {
  .panel-head { align-items: flex-start; flex-direction: column; }
  .key-row { align-items: flex-start; }
}

/* shared credit balance + price table */
.balance-hero { text-align: center; padding: 6px 0 18px; }
.balance-hero span { display: block; font-size: 8px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--c-dim); }
.balance-hero b { display: block; margin: 6px 0 8px; font: 42px var(--c-mono); font-weight: 400; letter-spacing: -0.04em; color: var(--c-text); }
.balance-hero small { display: block; max-width: 540px; margin: 0 auto; color: var(--c-dim); font-size: 10px; line-height: 1.55; }
.price-table td:first-child { color: var(--c-text); }

/* RMB packages */
.packages { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.package {
  text-align: left;
  border: 1px solid var(--c-line);
  border-radius: 11px;
  background: #0a0a0c;
  padding: 14px;
  color: var(--c-muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color 0.2s, background 0.2s;
}
.package:hover { border-color: var(--c-line-strong); }
.package.is-active { border-color: rgba(157, 184, 255, 0.62); background: rgba(157, 184, 255, 0.06); }
.package__price { font: 22px var(--c-mono); color: var(--c-text); letter-spacing: -0.03em; }
.package__credits { font: 12px var(--c-mono); color: var(--c-text); }
.package__credits small { color: var(--c-dim); font-size: 8px; letter-spacing: 0.08em; text-transform: uppercase; }
.package__bonus { font: 8px var(--c-mono); color: var(--c-dim); letter-spacing: 0.08em; text-transform: uppercase; }
.package.is-active .package__bonus { color: var(--c-accent); }
.billing-current {
  text-align: center;
  border-top: 1px solid var(--c-line);
  border-bottom: 1px solid var(--c-line);
  padding: 12px 0;
  color: var(--c-dim);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.billing-current b { color: var(--c-text); font: 16px var(--c-mono); margin: 0 3px; letter-spacing: 0; }

/* destructive key action */
.key-revoke { height: 30px; font-size: 9px; padding: 0 10px; color: #e6a3a3; border-color: rgba(230, 120, 120, 0.28); }
.key-revoke:hover { color: #ffc4c4; border-color: rgba(230, 120, 120, 0.5); }
@media (max-width: 560px) {
  .packages { grid-template-columns: 1fr; }
  .balance-hero b { font-size: 34px; }
}

/* in-console top-up dialog */
.topup-dialog--wide { max-width: 780px; max-height: calc(100vh - 40px); overflow-y: auto; }
.topup-dialog--wide .packages { margin: 6px 0 16px; }
.topup-dialog--wide .billing-current { margin: 4px 0 14px; }
.topup-dialog--wide .billing-summary { margin: 0 0 14px; padding: 12px 0; }
.topup-dialog--wide .topup-result { margin-top: 2px; }
.topup-dialog--wide .key-note { margin: 12px 0 0; }
.topup-dialog--wide .topup-dialog__foot { margin-top: 16px; }
@media (max-width: 560px) {
  .topup-dialog--wide { max-height: calc(100vh - 24px); padding: 18px; }
  .topup-dialog--wide .billing-summary { grid-template-columns: 1fr 1fr; }
}

/* center dialog headings, package cards, summaries and panel labels */
.topup-dialog__head { position: relative; justify-content: center; text-align: center; }
.topup-dialog__head h3 { text-align: center; }
.topup-dialog__head .topup-close { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
.topup-dialog > p,
.topup-dialog .key-note,
.topup-dialog .topup-result { text-align: center; }
.billing-summary span,
.billing-summary b { text-align: center; }
.package { text-align: center; align-items: center; }
.panel-head { flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.panel-head .controls { justify-content: center; }
.panel-head .card__hint { text-align: center; }
.lb-foot { text-align: center; }

.lb-foot { justify-content: center; }
.billing .key-note { text-align: center; }

.billing-summary > div { text-align: center; }

/* center the price table headers and every cell */
.credit-table th,
.credit-table td,
.credit-table td:first-child,
.credit-table td.num { text-align: center; }
