:root {
  color-scheme: dark;
  --bg: #070B16;
  --surface: #111827;
  --surface-2: #0d1524;
  --primary: #2563EB;
  --accent: #06B6D4;
  --text: #F8FAFC;
  --muted: #94A3B8;
  --line: rgba(148, 163, 184, .16);
  --ok: #34D399;
  --warn: #FBBF24;
  --bad: #F87171;
  --radius: 18px;
  --shadow: 0 12px 32px rgba(2, 6, 23, .55);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  background: radial-gradient(900px 420px at 85% -8%, rgba(37, 99, 235, .28), transparent 60%),
              radial-gradient(700px 380px at 0% 0%, rgba(6, 182, 212, .16), transparent 55%),
              var(--bg);
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}
.glow {
  position: fixed; inset: -30% -10% auto -10%; height: 55vh; pointer-events: none; z-index: 0;
  background: radial-gradient(closest-side, rgba(37, 99, 235, .22), transparent 70%);
  filter: blur(40px);
}
main { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ------------------------------------------------------------------ topbar */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: rgba(7, 11, 22, .82); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand .mark {
  width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 800; background: linear-gradient(150deg, var(--primary), var(--accent));
  color: #fff; box-shadow: 0 6px 18px rgba(37, 99, 235, .38); flex: none;
}
.brand b { font-size: 15px; letter-spacing: .04em; }
.brand b span { color: var(--accent); }
.brand small { display: block; color: var(--muted); font-size: 10.5px; letter-spacing: .06em; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.chip {
  background: rgba(37, 99, 235, .16); border: 1px solid rgba(37, 99, 235, .45);
  color: #BFDBFE; border-radius: 999px; padding: 6px 12px; font-size: 12px; cursor: pointer;
}

/* ------------------------------------------------------------------- pills */
.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
  font-size: 10.5px; letter-spacing: .04em; border: 1px solid var(--line); color: var(--muted);
  white-space: nowrap;
}
.pill.ok { color: var(--ok); border-color: rgba(52, 211, 153, .4); background: rgba(52, 211, 153, .1); }
.pill.warn { color: var(--warn); border-color: rgba(251, 191, 36, .4); background: rgba(251, 191, 36, .1); }
.pill.bad { color: var(--bad); border-color: rgba(248, 113, 113, .4); background: rgba(248, 113, 113, .1); }
.pill.off { color: #64748B; }

/* -------------------------------------------------------------------- hero */
.view { animation: fade .32s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.hero {
  display: grid; gap: 16px; margin: 18px 0 22px; padding: 22px;
  border-radius: 24px; border: 1px solid var(--line);
  background: linear-gradient(140deg, rgba(37, 99, 235, .22), rgba(6, 182, 212, .10) 55%, rgba(17, 24, 39, .9));
  box-shadow: var(--shadow);
}
.eyebrow { font-size: 10.5px; letter-spacing: .18em; color: #93C5FD; text-transform: uppercase; }
.hero h1 { font-size: 27px; line-height: 1.15; margin: 8px 0 8px; letter-spacing: -.02em; }
.hero p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.6; max-width: 46ch; }
.hero-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.hero-card {
  display: grid; gap: 8px; padding: 14px 16px; border-radius: 16px;
  background: rgba(7, 11, 22, .62); border: 1px solid var(--line);
}
.hero-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; }
.hero-row span { color: var(--muted); }
.hero-row b { font-variant-numeric: tabular-nums; }
.hero-row b.warn { color: var(--warn); }

/* ------------------------------------------------------------------ layout */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 22px 0 12px; }
.section-head h2 { font-size: 16px; margin: 0; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11.5px; }
.cards { display: grid; gap: 12px; grid-template-columns: 1fr; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.small-stack { gap: 6px; }
.panel {
  margin-top: 16px; padding: 16px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(17, 24, 39, .96), rgba(13, 21, 36, .96));
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.panel h3 { margin: 0 0 10px; font-size: 13.5px; letter-spacing: .01em; }

/* ------------------------------------------------------------------- cards */
.card {
  padding: 16px; border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(17, 24, 39, .98), rgba(11, 18, 32, .98));
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px;
  transition: transform .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-2px); border-color: rgba(37, 99, 235, .5); }
.card-head { display: flex; align-items: center; justify-content: space-between; }
.card h3 { margin: 0; font-size: 17px; }
.card .tag {
  font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: #93C5FD;
  border: 1px solid rgba(37, 99, 235, .45); padding: 3px 8px; border-radius: 999px;
}
.price { font-size: 15px; color: #E0F2FE; font-variant-numeric: tabular-nums; }
.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 12.5px; color: var(--muted); }
.features li::before { content: "•"; color: var(--accent); margin-right: 8px; }

/* ----------------------------------------------------------------- buttons */
button { font-family: inherit; cursor: pointer; border: 0; }
.primary, .ghost {
  border-radius: 12px; padding: 11px 16px; font-size: 13.5px; font-weight: 600;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
}
.primary { background: linear-gradient(180deg, #3B82F6, var(--primary)); color: #fff; box-shadow: 0 10px 24px rgba(37, 99, 235, .35); }
.primary:hover { transform: translateY(-1px); }
.ghost { background: rgba(148, 163, 184, .08); color: var(--text); border: 1px solid var(--line); }
.ghost:hover { background: rgba(148, 163, 184, .16); }
.ghost.danger { color: #FCA5A5; border-color: rgba(248, 113, 113, .35); }
.tiny { padding: 7px 12px; font-size: 12px; border-radius: 10px; }
.block { width: 100%; }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------- price tables */
.pricing { display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: rgba(13, 21, 36, .9); }
.price-head, .price-row { display: grid; grid-template-columns: 1.5fr .9fr .9fr .5fr; gap: 8px; padding: 12px 14px; align-items: center; }
.price-head { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); background: rgba(37, 99, 235, .1); }
.price-row { border-top: 1px solid var(--line); font-size: 13px; }
.price-name { display: flex; flex-direction: column; gap: 2px; }
.price-name small { font-size: 10.5px; }
.compare { display: grid; gap: 8px; }
.compare-row { display: grid; grid-template-columns: 96px 1fr 62px; gap: 10px; align-items: center; font-size: 12px; }
.compare-row .track, .quota .track { background: rgba(148, 163, 184, .14); border-radius: 999px; height: 8px; overflow: hidden; }
.compare-row .fill, .quota .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.compare-row b { text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------- models */
.model-list { display: grid; gap: 8px; }
.model-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(148, 163, 184, .06); border: 1px solid var(--line); }
.model-row b { display: block; font-size: 13px; }
.model-row small { color: var(--muted); font-size: 10.5px; }

/* -------------------------------------------------------------- orders/keys */
.order-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.order p, .keycard p { margin: 0; }
.quota { display: flex; flex-direction: column; gap: 5px; }
.quota small { color: var(--muted); font-size: 11px; }
.pay-row, .usage-row {
  display: grid; grid-template-columns: 1.1fr .6fr .7fr .5fr; gap: 8px; align-items: center;
  padding: 8px 10px; border-radius: 10px; background: rgba(148, 163, 184, .05); font-size: 11.5px;
}
.usage-row { grid-template-columns: 1.4fr .7fr .6fr .8fr .9fr; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.stat { padding: 12px; border-radius: 12px; background: rgba(148, 163, 184, .06); border: 1px solid var(--line); }
.stat span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.stat b { display: block; font-size: 19px; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- reveal/secret */
.reveal { margin-top: 14px; padding: 16px; border-radius: 16px; border: 1px dashed rgba(6, 182, 212, .55); background: rgba(6, 182, 212, .08); }
.reveal p { margin: 0 0 8px; font-size: 12.5px; }
.reveal code { display: block; font-family: ui-monospace, Menlo, monospace; font-size: 12px; word-break: break-all; color: #A5F3FC; margin-bottom: 10px; }

/* ---------------------------------------------------------------- account */
.profile { display: flex; align-items: center; gap: 14px; }
.avatar { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-weight: 800; font-size: 20px; background: linear-gradient(150deg, var(--primary), var(--accent)); }
.profile b { font-size: 15px; }
.profile p { margin: 2px 0 0; }
.kv { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.kv-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.kv-row span { color: var(--muted); }
.kv-row b { text-align: right; font-weight: 600; }

/* -------------------------------------------------------------------- faq */
.faq { display: flex; flex-direction: column; gap: 8px; }
.faq-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: rgba(148, 163, 184, .05); }
.faq-item summary { cursor: pointer; font-size: 12.5px; }
.faq-item p { margin: 8px 0 0; }

/* ------------------------------------------------------------ forms/notice */
label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
select, textarea {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; font-size: 13px; font-family: inherit; resize: vertical;
}
select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .18); }
.banner {
  margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; font-size: 12.5px;
  background: rgba(251, 191, 36, .1); border: 1px solid rgba(251, 191, 36, .35); color: #FDE68A;
}
.banner.bad { background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .4); color: #FECACA; }
.toast {
  position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px);
  z-index: 40; padding: 11px 18px; border-radius: 999px; font-size: 12.5px; max-width: 88vw; text-align: center;
  background: rgba(15, 23, 42, .96); border: 1px solid var(--line); opacity: 0; transition: all .25s ease;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { border-color: rgba(52, 211, 153, .5); color: #A7F3D0; }
.toast.warn { border-color: rgba(251, 191, 36, .5); color: #FDE68A; }

/* -------------------------------------------------------------------- boot */
.boot { display: grid; place-items: center; gap: 10px; padding: 22vh 20px; text-align: center; }
.boot p { margin: 0; font-size: 13px; }
.boot-note { color: var(--muted); font-size: 12px; max-width: 34ch; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%; border: 2.5px solid rgba(148, 163, 184, .25);
  border-top-color: var(--accent); animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ tabbar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  background: rgba(7, 11, 22, .94); backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}
.tabbar button {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: transparent; color: #64748B; font-size: 9.5px; letter-spacing: .02em;
  padding: 6px 2px; border-radius: 12px; transition: color .18s ease, background .18s ease;
}
.tabbar button span { font-size: 15px; line-height: 1; }
.tabbar button.active { color: #E0F2FE; background: rgba(37, 99, 235, .18); }
.tabbar button.active span { color: var(--accent); }

/* --------------------------------------------------------------- responsive */
@media (min-width: 560px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1.35fr .9fr; align-items: center; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  main { padding: 0 24px; }
  .hero { padding: 34px; }
  .hero h1 { font-size: 38px; }
  .hero p { font-size: 14.5px; }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .section-head { margin: 30px 0 14px; }
  .section-head h2 { font-size: 19px; }
  .tabbar {
    left: 50%; right: auto; transform: translateX(-50%);
    width: min(880px, calc(100% - 32px)); bottom: 14px;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border: 1px solid var(--line); border-radius: 18px;
    background: rgba(17, 24, 39, .86); padding: 8px;
  }
  body { padding-bottom: 104px; }
  .tabbar button { flex-direction: row; gap: 8px; font-size: 12.5px; padding: 10px 8px; }
  .toast { bottom: 110px; }
}
@media (min-width: 1200px) {
  .cards { gap: 16px; }
  .panel { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
