:root {
  --bg: #060a12;
  --card: rgba(16, 22, 36, 0.94);
  --line: rgba(255, 255, 255, 0.08);
  --text: #eaf0ff;
  --muted: #8f9bb3;
  --accent: #6ea8ff;
  --accent2: #3ddc97;
  --bad: #ff6b7a;
  --warn: #ffc857;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}
.bg {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(1000px 520px at 8% -12%, rgba(78, 126, 255, 0.28), transparent 60%),
    radial-gradient(800px 420px at 100% 0%, rgba(61, 220, 151, 0.12), transparent 55%),
    radial-gradient(600px 300px at 50% 100%, rgba(255, 200, 87, 0.06), transparent 50%),
    var(--bg);
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 22px 16px 56px; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.brand { display: flex; gap: 12px; align-items: center; }
.logo {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; font-weight: 800;
  background: linear-gradient(135deg, #4d86ff, #3cc7a6); color: #041018;
  box-shadow: var(--shadow);
}
.admin-logo { background: linear-gradient(135deg, #ffc857, #ff8f6b); }
.admin-logo-img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: block;
  object-fit: contain;
  box-shadow: var(--shadow);
}
.brand-name { font-weight: 700; font-size: 16px; }
.brand-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.pill {
  border: 1px solid var(--line); background: rgba(255,255,255,0.03);
  border-radius: 999px; padding: 8px 12px; font-size: 12px; color: var(--muted);
}
.pill.link { text-decoration: none; color: var(--accent); }

.hero-card {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 22px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.hero-card h1 { margin: 0 0 8px; font-size: 28px; letter-spacing: -0.02em; }
.lead { margin: 0; color: var(--muted); line-height: 1.6; }
.steps {
  display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap;
}
.steps div {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px;
  color: var(--muted); font-size: 13px;
}
.steps b {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px;
  background: rgba(110,168,255,0.18); color: var(--accent);
}
.hero-stats { display: grid; gap: 10px; }
.stat {
  border: 1px solid var(--line); border-radius: 14px; padding: 12px;
  background: rgba(0,0,0,0.18);
}
.stat span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.stat code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; word-break: break-all; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 18px; box-shadow: var(--shadow);
}
.card.wide { grid-column: 1 / -1; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.card h2 { margin: 0; font-size: 17px; }
.badge {
  font-size: 11px; border-radius: 999px; padding: 4px 8px;
  background: rgba(110,168,255,0.14); color: var(--accent); border: 1px solid rgba(110,168,255,0.22);
}
.badge.alt { background: rgba(61,220,151,0.12); color: var(--accent2); border-color: rgba(61,220,151,0.22); }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 12px; line-height: 1.5; }
label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 6px; }
input {
  width: 100%; border-radius: 11px; border: 1px solid var(--line);
  background: rgba(0,0,0,0.28); color: var(--text); padding: 11px 12px; outline: none;
}
input:focus { border-color: rgba(110,168,255,0.55); }
button, .ghost-btn {
  margin-top: 12px; border: 0; border-radius: 11px; padding: 11px 14px;
  background: #243149; color: var(--text); cursor: pointer; font-weight: 650;
}
button.primary {
  background: linear-gradient(135deg, #4d86ff, #3cc7a6); color: #041018;
}
.ghost-btn, button.ghost-btn {
  background: transparent; border: 1px solid var(--line);
}
button.mini, .mini {
  margin-top: 0; padding: 6px 10px; font-size: 12px;
  background: transparent; border: 1px solid var(--line); border-radius: 8px; color: var(--text); cursor: pointer;
}
button:hover, .ghost-btn:hover, .mini:hover { filter: brightness(1.08); }
.msg { min-height: 18px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.msg.ok { color: var(--accent2); }
.msg.err { color: var(--bad); }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.userbox { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.hidden { display: none !important; }
.wallet { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.grow { flex: 1; min-width: 220px; }
.muted { color: var(--muted); font-size: 12px; }
.big { font-size: 30px; font-weight: 750; letter-spacing: -0.03em; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.copyline { display: flex; gap: 8px; align-items: center; word-break: break-all; }
.empty { color: var(--muted); padding: 10px 0; }
.key-item {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 10px 0;
  background: rgba(255,255,255,0.02);
}
.key-item .title { font-weight: 700; margin-bottom: 6px; }
.howto { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.howto h3 { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
pre, .codes {
  background: #0a1020; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; overflow: auto; font-size: 12px; line-height: 1.55; margin: 0;
}
.codes { max-height: 260px; margin-top: 10px; }
footer { margin-top: 22px; color: var(--muted); font-size: 12px; text-align: center; }

/* admin */
.login-card { max-width: 420px; margin: 40px auto; }
.stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px;
}
.stat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px;
}
.stat-card span { color: var(--muted); font-size: 12px; }
.stat-card b { display: block; margin-top: 6px; font-size: 22px; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.admin-grid .span2 { grid-column: 1 / -1; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.gap { gap: 8px; }
.table-wrap { overflow: auto; margin-top: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td {
  border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; vertical-align: top;
}
th { color: var(--muted); font-weight: 600; }
td.mono { font-family: ui-monospace, Consolas, monospace; word-break: break-all; }
th.col-check, td.col-check { width: 36px; text-align: center; vertical-align: middle; }
th.col-check input, td.col-check input { width: auto; margin: 0; accent-color: #6ea8ff; cursor: pointer; }
button.mini.danger, .mini.danger {
  border-color: rgba(255, 107, 122, 0.35);
  color: #ff8a96;
}
button.mini.danger:hover, .mini.danger:hover {
  background: rgba(255, 107, 122, 0.12);
  filter: none;
}
.admin-textarea {
  width: 100%; border-radius: 11px; border: 1px solid var(--line);
  background: rgba(0,0,0,0.28); color: var(--text); padding: 11px 12px;
  outline: none; font-family: ui-monospace, Consolas, monospace; font-size: 12px;
  resize: vertical; min-height: 88px; line-height: 1.5;
}
.admin-textarea:focus { border-color: rgba(110,168,255,0.55); }

/* admin risk tags / table accents */
.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 650;
  border-radius: 999px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.tag-bad {
  color: #ff8a96;
  background: rgba(255, 107, 122, 0.12);
  border-color: rgba(255, 107, 122, 0.28);
}
.tag-warn {
  color: #ffd27a;
  background: rgba(255, 200, 87, 0.12);
  border-color: rgba(255, 200, 87, 0.28);
}
.tag-ok {
  color: #5ce0b4;
  background: rgba(61, 220, 151, 0.10);
  border-color: rgba(61, 220, 151, 0.22);
}
.tag-muted {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}
tr.row-risk td { background: rgba(255, 107, 122, 0.04); }
tr.row-warn td { background: rgba(255, 200, 87, 0.04); }

@media (max-width: 900px) {
  .hero-card, .grid, .stats-row, .admin-grid { grid-template-columns: 1fr; }
}

/* ===== simple user UI ===== */
.wrap.simple { max-width: 480px; padding-top: 48px; }
.simple-head { text-align: center; margin-bottom: 20px; }
.simple-head h1 { margin: 0 0 8px; font-size: 26px; }
.simple-head p { margin: 0; color: var(--muted); font-size: 14px; }
.simple-card { padding: 20px; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab {
  flex: 1; margin: 0; padding: 10px; border-radius: 10px;
  background: transparent; border: 1px solid var(--line); color: var(--muted); font-weight: 600;
}
.tab.active {
  background: rgba(110,168,255,0.14); border-color: rgba(110,168,255,0.35); color: var(--text);
}
.panel.hidden { display: none !important; }
button.full, .ghost-btn.full { width: 100%; }
.tiny { color: var(--muted); font-size: 12px; margin: 16px 0 8px; }
.balance-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px;
}
.balance-row .primary { margin-top: 0; }
.field { margin-top: 14px; }
.field .muted { display: block; margin-bottom: 6px; }
.keys-title { margin: 18px 0 8px; font-size: 14px; color: var(--muted); font-weight: 600; }
.simple-foot {
  margin-top: 24px; text-align: center; color: var(--muted); font-size: 12px; line-height: 1.5;
}

/* packages */
.pkg-title { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.pkg-list { display: grid; gap: 8px; }
.pkg-item {
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  background: rgba(0,0,0,0.15); font-size: 13px;
}
.pkg-item b { color: var(--accent); }
.pkg-item span { color: var(--muted); }
.admin-pkgs { margin-top: 12px; }
select {
  width: 100%; border-radius: 11px; border: 1px solid var(--line);
  background: rgba(0,0,0,0.28); color: var(--text); padding: 11px 12px;
}
.stats-row { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .stats-row { grid-template-columns: 1fr 1fr; } }

/* ========== User portal v3 - premium redesign ========== */
*, *::before, *::after { box-sizing: border-box; }

/* variables */
:root {
  --glow-blue: rgba(70, 134, 255, .15);
  --glow-teal: rgba(53, 208, 161, .12);
  --card-bg: rgba(12, 18, 32, .85);
  --card-border: rgba(255, 255, 255, .06);
  --card-border-active: rgba(110, 168, 255, .25);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
}

/* user portal page shell — full viewport, no left-stuck panels */
body.user-portal {
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
}
.user-bg {
  background:
    radial-gradient(1100px 560px at 50% -18%, rgba(78, 126, 255, 0.22), transparent 58%),
    radial-gradient(700px 380px at 12% 88%, rgba(61, 220, 151, 0.10), transparent 55%),
    radial-gradient(640px 320px at 92% 70%, rgba(255, 200, 87, 0.06), transparent 50%),
    var(--bg);
}

/* noise overlay */
.noise {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: .025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

/* particles */
#particles {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}

/* splash — always dead-center on screen */
.splash {
  position: relative; z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(24px, 5vh, 48px) 20px;
}
.splash-inner {
  width: min(720px, 100%);
  text-align: center;
  margin: 0 auto;
}
.splash-desc-sub {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
  opacity: .75;
}
.splash-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(110,168,255,.08);
  border: 1px solid rgba(110,168,255,.12);
  border-radius: 999px;
  padding: 6px 16px; font-size: 13px;
  color: var(--accent); margin-bottom: 20px;
}
.badge-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent2);
  animation: pulse-dot 2s ease-in-out infinite;
}
.splash-title {
  font-size: clamp(42px, 8vw, 64px);
  font-weight: 800; letter-spacing: -.04em;
  margin: 0 0 12px; line-height: 1.05;
  background: linear-gradient(135deg, #8cb4ff 0%, #5ce0b4 50%, #ffd966 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.splash-desc {
  color: var(--muted); font-size: 15px; margin: 0 0 32px; line-height: 1.6;
}

/* packages */
.pkg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 32px;
}
.pkg-card {
  background: rgba(8, 14, 26, .7);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 18px 14px;
  text-align: center;
  transition: border-color .15s, background .15s;
  cursor: default;
  position: relative;
  overflow: hidden;
  box-shadow: none;
}
.pkg-card::before,
.pkg-card::after {
  content: none !important;
  display: none !important;
}
.pkg-card:hover {
  border-color: var(--card-border-active);
  box-shadow: none;
}
.pkg-card.featured {
  border-color: rgba(110,168,255,.35);
  background: rgba(110,168,255,.05);
  box-shadow: none;
}
.pkg-card-tokens {
  font-size: 15px; font-weight: 750;
  letter-spacing: -.02em; margin-bottom: 4px;
  line-height: 1.25;
  word-break: break-word;
}
.pkg-card-price {
  color: var(--accent); font-size: 14px; font-weight: 600;
  margin-bottom: 6px;
}
.pkg-card-note {
  color: var(--muted); font-size: 11px; line-height: 1.4;
}

/* splash actions */
.splash-actions {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 28px;
}
.btn-glow {
  border: 0; border-radius: 14px; padding: 15px 36px;
  font-weight: 700; font-size: 15px; cursor: pointer;
  background: linear-gradient(135deg, #4d86ff, #35d0a1);
  color: #041018;
  box-shadow: 0 4px 24px rgba(61,220,151,.2), 0 0 60px rgba(61,220,151,.08);
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .25s;
}
.btn-glow:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 40px rgba(61,220,151,.3), 0 0 80px rgba(61,220,151,.12);
}
.btn-outline {
  border: 1px solid var(--card-border); border-radius: 14px;
  padding: 15px 36px; font-weight: 600; font-size: 15px;
  cursor: pointer; background: rgba(255,255,255,.03);
  color: var(--text);
  transition: background .2s, border-color .2s, transform .2s;
}
.btn-outline:hover {
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.12);
  transform: translateY(-2px);
}

/* pool */
.splash-pool {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 13px;
}
.splash-pool.is-down, .app-pool.is-down { color: var(--warn); }
.splash-pool.is-down .pool-dot, .app-pool.is-down::before {
  background: var(--warn);
  animation: none;
  box-shadow: none;
  opacity: .9;
}
.pool-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent2);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--accent2); }
  50% { opacity: .4; box-shadow: 0 0 18px var(--accent2); }
}

/* app shell */
.app {
  position: relative; z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
  display: flex;
  justify-content: center;
}
.app.mode-auth {
  align-items: center;
  padding: clamp(24px, 5vh, 48px) 0;
}
.app.mode-dash {
  align-items: stretch;
  display: block;
  padding: 0 0 48px;
}
.app-wrap {
  width: min(520px, calc(100% - 32px));
  margin: 0 auto;
}
/* 登录仍居中卡片；控制台拉满宽屏 */
.app.mode-auth .app-wrap {
  width: min(460px, calc(100% - 32px));
}
.app.mode-dash .app-wrap {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding-top: 0;
}
.app-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 22px;
}
/* 控制台顶栏：全宽感 */
.app.mode-dash .app-head {
  position: sticky; top: 0; z-index: 20;
  margin: 0 0 22px;
  padding: 16px 0;
  background: linear-gradient(180deg, rgba(6,10,18,.92) 40%, rgba(6,10,18,.72) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.app.mode-auth .app-head {
  justify-content: center;
  margin-bottom: 18px;
}
.app.mode-auth .app-head-right { display: none; }
.app-brand { display: flex; gap: 14px; align-items: center; }
.app.mode-auth .app-brand {
  flex-direction: column;
  text-align: center;
  gap: 10px;
}
.app.mode-auth .app-name { font-size: 18px; }
.app.mode-auth .app-tagline { margin-top: 2px; }
.app-logo {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center; font-weight: 800; font-size: 20px;
  background: linear-gradient(135deg, #5b8cff, #35d0a1); color: #041018;
  box-shadow: 0 8px 28px rgba(70,130,255,.2);
}
.app-logo-btn {
  border: 0; cursor: pointer; padding: 0; font: inherit;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s;
}
.app-logo-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 10px 32px rgba(70,130,255,.28);
}
.app.mode-auth .app-logo {
  width: 52px; height: 52px; border-radius: 16px; font-size: 22px;
}
.app-name { font-weight: 700; font-size: 17px; }
.app-tagline { color: var(--muted); font-size: 12px; margin-top: 3px; }
.app-head-right {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end;
}
.app-pool {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted);
  max-width: min(520px, 48vw);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-pool::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent2); flex-shrink: 0;
}
.app-logout {
  border: 0; background: transparent;
  color: var(--muted); cursor: pointer;
  font-size: 15px; padding: 6px 10px; line-height: 1;
  border-radius: 8px; transition: background .15s, color .15s;
}
.app-logout:hover { background: rgba(255,107,122,.1); color: var(--bad); }

/* auth card — SaaS login style, centered column */
.auth-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 28px 26px 24px;
  box-shadow: 0 24px 64px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.03) inset;
  margin-bottom: 14px;
  animation: fade-up .4s cubic-bezier(.16,1,.3,1);
}
.auth-intro {
  text-align: center;
  margin-bottom: 18px;
}
.auth-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -.02em;
}
.auth-sub {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  margin-bottom: 20px;
  background: rgba(255,255,255,.03);
  border-radius: 12px; padding: 4px;
}
.auth-tab {
  margin: 0; border: 0; border-radius: 10px; padding: 10px;
  background: transparent; color: var(--muted);
  font-weight: 650; cursor: pointer; font-size: 14px;
  transition: background .2s, color .2s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.auth-tab .tab-icon { font-size: 12px; opacity: .5; }
.auth-tab.active { background: rgba(110,168,255,.14); color: var(--text); }
.auth-tab.active .tab-icon { opacity: 1; }
.auth-panel.hidden, .hidden { display: none !important; }
.auth-field {
  position: relative; margin-bottom: 14px;
}
.field-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); opacity: .5; pointer-events: none;
}
.auth-field .field-icon + .auth-input { padding-left: 42px; }
.auth-input {
  width: 100%; border-radius: 12px;
  border: 1px solid var(--card-border);
  background: rgba(0,0,0,.35); color: var(--text);
  padding: 14px 16px; outline: none; font-size: 14px;
  transition: border-color .2s, background .2s;
}
.auth-input:focus {
  border-color: rgba(110,168,255,.4);
  background: rgba(0,0,0,.45);
}
.auth-input::placeholder { color: rgba(143,155,179,.4); }
.auth-msg {
  min-height: 20px; margin-top: 10px;
  font-size: 13px; color: var(--muted); line-height: 1.4;
}
.auth-msg.ok { color: var(--accent2); }
.auth-msg.err { color: var(--bad); }
.auth-recover {
  margin-top: 16px; color: var(--muted); font-size: 12px;
}
.auth-recover summary {
  cursor: pointer; margin-bottom: 10px;
  padding: 4px 0; transition: color .15s;
}
.auth-recover summary:hover { color: var(--accent); }

/* buttons */
.btn-primary {
  width: 100%; border: 0; border-radius: 12px;
  padding: 14px; font-weight: 700; font-size: 15px; cursor: pointer;
  background: linear-gradient(135deg, #4d86ff, #35d0a1);
  color: #041018;
  transition: transform .15s cubic-bezier(.34,1.56,.64,1), box-shadow .2s;
  position: relative; overflow: hidden;
}
.btn-primary::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.15), transparent 60%);
  opacity: 0; transition: opacity .2s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(61,220,151,.2); }
.btn-primary:hover::after { opacity: 1; }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn-primary:disabled::after { opacity: 0; }
.btn-sm { padding: 11px 16px; font-size: 13px; border-radius: 11px; }
.btn-mini {
  border: 1px solid var(--card-border);
  background: rgba(255,255,255,.04); color: var(--text);
  border-radius: 9px; padding: 7px 12px; font-size: 12px;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.btn-mini:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.12); }

/* dashboard hero — wide metrics strip */
.dash-hero {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr;
  gap: 20px 28px;
  align-items: center;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  padding: 28px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  margin-bottom: 18px;
  animation: fade-up .4s cubic-bezier(.16,1,.3,1);
  position: relative;
  overflow: hidden;
}
.dash-hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(500px 180px at 8% 0%, rgba(90,140,255,.12), transparent 60%),
    radial-gradient(420px 160px at 100% 100%, rgba(53,208,161,.08), transparent 55%);
  pointer-events: none;
}
.dash-hero-main, .dash-hero-side { position: relative; z-index: 1; }
.dash-hero-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.dash-hero-label { color: var(--muted); font-size: 14px; font-weight: 500; }
.dash-hero-badge {
  font-size: 12px; padding: 5px 12px; border-radius: 999px;
  background: rgba(61,220,151,.12); color: var(--accent2);
  border: 1px solid rgba(61,220,151,.15);
}
.dash-hero-value {
  font-size: clamp(28px, 3.6vw, 42px); font-weight: 800;
  letter-spacing: -.03em; line-height: 1.15;
  background: linear-gradient(135deg, #8cb4ff, #5ce0b4);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  word-break: break-word;
}
.key-card-remain {
  font-size: 18px !important;
  word-break: break-word;
}
.dash-bar {
  height: 8px; border-radius: 99px;
  background: rgba(255,255,255,.06); overflow: hidden;
  margin: 18px 0 14px;
  max-width: 520px;
}
.dash-bar-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #4d86ff, #35d0a1);
  transition: width .6s cubic-bezier(.16,1,.3,1);
}
.dash-hero-meta {
  display: flex; gap: 10px; align-items: center;
  color: var(--muted); font-size: 13px; flex-wrap: wrap;
}
.dash-hero-meta strong { color: var(--text); font-weight: 650; }
.meta-pill {
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.18);
  border-radius: 999px;
  padding: 6px 12px;
}
.meta-dot { opacity: .3; }
.dash-hero-side {
  display: flex; flex-direction: column; justify-content: center;
  gap: 10px;
  border-left: 1px solid rgba(255,255,255,.06);
  padding-left: 24px;
  min-height: 120px;
}
.dash-hero-actions {
  display: grid; grid-template-columns: 1fr 1.35fr; gap: 10px;
  margin-top: 0;
}
.dash-hero-actions .btn-outline,
.dash-hero-actions .btn-primary {
  margin-top: 0; width: 100%;
  min-height: 44px;
}

/* dash layout grid */
.dash-grid {
  display: grid;
  grid-template-columns: 1.55fr 0.95fr;
  gap: 16px;
  align-items: start;
}
.dash-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.dash-side .dash-section { margin-bottom: 0; }
.dash-main { min-height: 280px; }

/* dash sections */
.dash-section {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 22px 24px;
  margin-bottom: 12px;
  animation: fade-up .4s cubic-bezier(.16,1,.3,1);
  box-shadow: 0 12px 40px rgba(0,0,0,.22);
}
.dash-section-compact { padding: 18px 20px; }
.dash-section-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.dash-section-head h2 { margin: 0; font-size: 16px; font-weight: 650; }
.chip {
  font-size: 11px; color: var(--accent);
  border: 1px solid rgba(110,168,255,.18);
  background: rgba(110,168,255,.08);
  border-radius: 999px; padding: 3px 10px;
}
.chip-soft { color: var(--muted); border-color: var(--card-border); background: transparent; }
.dash-empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--muted); font-size: 14px; padding: 48px 16px;
  text-align: center; border: 1px dashed rgba(255,255,255,.08); border-radius: 14px;
  min-height: 180px; justify-content: center;
}
.dash-empty p { margin: 0; }
.dash-msg {
  min-height: 18px; margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.4;
}
.dash-msg.ok { color: var(--accent2); }
.dash-msg.err { color: var(--bad); }
.dash-tip { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

/* key cards */
.key-card {
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 16px;
  background: rgba(0,0,0,.15);
  margin-bottom: 10px;
  transition: border-color .25s, background .2s;
}
.key-card:last-child { margin-bottom: 0; }
.key-card.is-dead { border-color: rgba(255,107,122,.2); background: rgba(255,107,122,.04); }
.key-card.is-low { border-color: rgba(255,200,87,.2); background: rgba(255,200,87,.03); }
.key-card-top {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
}
.key-card-left { min-width: 0; flex: 1; }
.key-card-remain {
  font-size: 22px; font-weight: 750; letter-spacing: -.02em;
}
.key-card-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.key-card-status {
  margin-top: 5px; font-size: 12px; color: var(--muted);
  display: inline-flex; align-items: center; gap: 4px;
}
.key-card.is-dead .key-card-status { color: var(--bad); }
.key-card.is-low .key-card-status { color: var(--warn); }
.key-card-bar {
  height: 4px; border-radius: 99px;
  background: rgba(255,255,255,.05); overflow: hidden;
  margin: 12px 0;
}
.key-card-bar-fill {
  height: 100%; border-radius: 99px;
  transition: width .5s cubic-bezier(.16,1,.3,1);
}
.key-card-bar-fill.good { background: linear-gradient(90deg, #4d86ff, #35d0a1); }
.key-card-bar-fill.warn { background: linear-gradient(90deg, #ffc857, #ff8f6b); }
.key-card-bar-fill.bad { background: var(--bad); }
.key-card-secret {
  display: block; font-family: ui-monospace, Consolas, monospace;
  font-size: 11px; color: #b8c8f0; word-break: break-all;
  background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.04);
  border-radius: 8px; padding: 9px 11px; line-height: 1.5;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.key-card-secret:hover { background: rgba(0,0,0,.35); border-color: rgba(255,255,255,.08); }

/* copy row */
.copy-row {
  display: flex; gap: 8px; align-items: center;
  background: rgba(0,0,0,.2); border: 1px solid var(--card-border);
  border-radius: 12px; padding: 11px 14px;
}
.copy-row code {
  flex: 1; font-family: ui-monospace, Consolas, monospace;
  font-size: 12px; word-break: break-all; color: #c8d8ff;
  user-select: all;
}

/* footer */
.app-foot {
  margin-top: 16px; text-align: center;
  color: var(--muted); font-size: 12px; line-height: 1.6;
}

/* page transitions */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.splash, .app { animation: fade-in .45s ease; }

/* responsive */
@media (max-width: 960px) {
  .dash-hero { grid-template-columns: 1fr; padding: 22px; }
  .dash-hero-side {
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid rgba(255,255,255,.06);
    padding-top: 16px;
    min-height: 0;
  }
  .dash-grid { grid-template-columns: 1fr; }
  .app.mode-dash .app-wrap { width: calc(100% - 32px); }
  .app-pool { max-width: 100%; white-space: normal; }
}
@media (max-width: 560px) {
  .dash-hero-value { font-size: 40px; }
  .dash-hero-actions { grid-template-columns: 1fr; }
  .app-wrap,
  .app.mode-auth .app-wrap,
  .app.mode-dash .app-wrap { width: calc(100% - 20px); }
  .pkg-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .splash-actions { flex-direction: column; align-items: stretch; }
  .app-head { flex-wrap: wrap; }
  .app.mode-auth .app-head { flex-wrap: nowrap; }
  .auth-card { padding: 22px 18px 20px; }
  .auth-title { font-size: 20px; }
  .dash-section { padding: 18px; }
}
@media (max-width: 400px) {
  .pkg-grid { grid-template-columns: 1fr; }
  .splash-title { font-size: 32px; }
}

/* selection / focus polish (user portal) */
body.user-portal ::selection {
  background: rgba(110, 168, 255, 0.35);
  color: #fff;
}
body.user-portal .auth-input:focus-visible,
body.user-portal .btn-primary:focus-visible,
body.user-portal .btn-outline:focus-visible,
body.user-portal .btn-glow:focus-visible {
  outline: 2px solid rgba(110, 168, 255, 0.45);
  outline-offset: 2px;
}

/* docs / metering */
.splash-metering {
  max-width: 560px; margin: 10px auto 0;
  color: var(--muted); font-size: 12px; line-height: 1.55; text-align: center;
}
.docs-box {
  margin-top: 22px; max-width: 720px; width: 100%;
  text-align: left;
  background: rgba(0,0,0,.28); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px 16px;
}
.docs-box.hidden { display: none; }
.docs-title { font-weight: 600; font-size: 13px; margin-bottom: 8px; color: var(--accent); }
.docs-line { font-size: 12px; color: var(--muted); margin-bottom: 8px; word-break: break-all; }
.docs-pre {
  margin: 0 0 8px; padding: 10px 12px;
  background: rgba(0,0,0,.35); border-radius: 10px;
  font-size: 11px; line-height: 1.45; overflow-x: auto;
  color: #c8d8ff; white-space: pre-wrap; word-break: break-word;
}
.auth-recover-hint {
  margin: 8px 0 0; font-size: 12px; color: var(--muted); line-height: 1.45;
}
.issue-quota-label {
  display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px;
}
.issue-quota {
  width: 100%; margin-bottom: 10px;
  background: rgba(0,0,0,.28); border: 1px solid var(--line);
  color: var(--text); border-radius: 10px; padding: 8px 10px; font-size: 13px;
}
.key-card-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.btn-mini-warn { color: var(--warn) !important; border-color: rgba(255,200,87,.25) !important; }
.btn-mini-danger { color: var(--bad) !important; border-color: rgba(255,107,122,.25) !important; }
.terms-note { margin-top: 6px; opacity: .85; font-size: 11px; }
.no-key-guide {
  margin: 0 0 12px; padding: 12px 14px;
  border: 1px dashed rgba(255,200,87,.35);
  background: rgba(255,200,87,.08);
  border-radius: 12px; font-size: 13px; line-height: 1.5;
  color: #f0e0b0;
}
.no-key-guide.hidden { display: none !important; }
.no-key-guide b { color: var(--warn); }
