*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #0a0a0f;
  --panel: #16161f;
  --panel-soft: #12121a;
  --panel-hover: #1d1d29;
  --text: #f1f1f4;
  --muted: #8f90a0;
  --muted-2: #696a78;
  --accent: #7c5cff;
  --accent-2: #a78bfa;
  --accent-soft: rgba(124, 92, 255, 0.12);
  --accent-border: rgba(124, 92, 255, 0.35);
  --green: #4ade80;
  --green-soft: rgba(74, 222, 128, 0.12);
  --green-border: rgba(74, 222, 128, 0.28);
  --danger: #fb7185;
  --danger-soft: rgba(251, 113, 133, 0.11);
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  --radius: 14px;
  --radius-sm: 10px;
}

html { color-scheme: dark; overflow-x: hidden; }
body { overflow-x: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 0%, rgba(124, 92, 255, 0.11), transparent 36rem),
    radial-gradient(circle at 90% 10%, rgba(68, 55, 130, 0.14), transparent 28rem),
    var(--bg);
  color: var(--text);
  font: 400 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }

/* ── Header ──────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 15, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 28px;
  height: 60px;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.logo-mark {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #6b4de6);
  box-shadow: 0 6px 18px rgba(124, 92, 255, 0.28);
  flex-shrink: 0;
}

.logo-mark svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
}

.nav-link {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: color 140ms, background 140ms;
}

.nav-link:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.nav-link.active { color: var(--text); }
.nav-link-help { color: var(--accent); }
.nav-link-help:hover { color: var(--accent); background: rgba(124,92,255,0.12); }

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.balance-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--panel-soft);
  font-size: 12px;
  font-weight: 700;
}

.balance-chip .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease, opacity 150ms;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #6b4de6);
  color: #fff;
  box-shadow: 0 8px 20px rgba(124, 92, 255, 0.24);
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(124, 92, 255, 0.34); }

.btn-secondary {
  border: 1px solid var(--border-strong);
  background: rgba(255,255,255,0.04);
  color: var(--text);
}

.btn-secondary:hover { background: rgba(255,255,255,0.07); }

.btn-accent-soft {
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  color: var(--text);
}

.btn-accent-soft:hover { background: rgba(124,92,255,0.18); }

.btn-lg {
  height: 46px;
  padding: 0 22px;
  font-size: 14px;
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }

/* ── Card ────────────────────────────────────────────────── */
.card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.018), transparent 80px), var(--panel);
  box-shadow: var(--shadow);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-border), transparent);
  pointer-events: none;
}

/* ── Container ───────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 28px; }
main { min-height: calc(100vh - 60px - 80px); }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 56px 28px 32px;
  max-width: 760px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 24px;
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 850;
  line-height: 1.1;
  letter-spacing: -0.03em;
  background: linear-gradient(160deg, #fff 40%, var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  margin: 0 auto 36px;
  max-width: 480px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.hero-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ── Hero stats ──────────────────────────────────────────── */
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: 600px;
  margin: 0 auto 28px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
}
.hero-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 10px;
  gap: 2px;
}
.hero-stat-num {
  font-size: 17px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
}
.hero-stat-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.hero-stat-sep {
  width: 1px;
  height: 36px;
  background: var(--border);
  flex-shrink: 0;
}

/* ── Buy button ──────────────────────────────────────────── */
.btn-buy {
  height: 30px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .15s, transform .1s;
}
.btn-buy:hover { opacity: .88; }
.btn-buy:active { transform: scale(.97); }
.btn-buy:disabled { opacity: .4; cursor: default; }

/* ── Prices widget ───────────────────────────────────────── */
.prices-widget {
  max-width: 900px;
  margin: 0 auto 80px;
  padding: 0 28px;
}

.widget-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

/* ── Redesigned filter rows ──────────────────────────────── */
.wf-search-row {
  position: relative;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.wf-row2 {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.wf-row2-item { display: flex; flex-direction: column; }
.wf-sort { min-width: 180px; }

.wf-big {
  height: 48px !important;
  font-size: 14px !important;
  padding-left: 44px !important;
}

.filter-select.wf-big {
  padding-left: 14px !important;
}

.wf-clear {
  font-size: 15px !important;
  right: 14px !important;
}

.wf-search-row .search-icon {
  width: 18px !important;
  height: 18px !important;
  left: 15px !important;
}

.filter-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.filter-select {
  width: 100%;
  height: 42px;
  padding: 0 36px 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: 0;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238f90a0' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 140ms, box-shadow 140ms;
}

.filter-select:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ── Price table ─────────────────────────────────────────── */
.price-table-wrap { min-height: 420px; }

.price-table {
  width: 100%;
  border-collapse: collapse;
}

.price-table th {
  padding: 10px 16px;
  text-align: left;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}

.price-table td {
  padding: 11px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.price-table tr:last-child td { border-bottom: 0; }
.price-table tbody tr:hover td { background: rgba(255,255,255,0.015); }

.badge-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge-count.available { background: var(--green-soft); color: var(--green); border: 1px solid var(--green-border); }
.badge-count.empty { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(251,113,133,0.2); }

.price-val { font-weight: 700; font-variant-numeric: tabular-nums; }
.price-val .cur { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 1px; }

.table-empty { text-align: center; padding: 56px 16px !important; color: var(--muted); }

.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 600ms linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Auth ────────────────────────────────────────────────── */
.auth-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
  padding: 32px 20px;
}

.auth-card { width: min(100%, 440px); }
.auth-card .card { padding: 36px 32px 32px; }

.auth-header { text-align: center; margin-bottom: 28px; }

.auth-icon {
  width: 48px; height: 48px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 28px rgba(124, 92, 255, 0.28);
  margin-bottom: 14px;
}

.auth-icon svg {
  width: 24px; height: 24px;
  fill: none; stroke: #fff;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.auth-header h1 { margin: 0 0 6px; font-size: 22px; font-weight: 850; }
.auth-header p { margin: 0; color: var(--muted); font-size: 13px; }

/* ── Form ────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }

.form-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  outline: 0;
  transition: border-color 140ms, box-shadow 140ms;
}

.form-input:focus {
  border-color: rgba(124, 92, 255, 0.7);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.form-input::placeholder { color: var(--muted-2); }

.alert {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}

.alert-error { background: var(--danger-soft); border: 1px solid rgba(251,113,133,0.24); color: var(--danger); }
.alert-success { background: var(--green-soft); border: 1px solid var(--green-border); color: var(--green); }

.form-footer { margin-top: 18px; text-align: center; color: var(--muted); font-size: 13px; }
.form-footer a { color: var(--accent-2); font-weight: 600; }
.form-footer a:hover { color: var(--accent); }

.btn-full { width: 100%; }

/* ── Profile ─────────────────────────────────────────────── */
.page-wrap { padding: 40px 28px 80px; max-width: 1000px; margin: 0 auto; }

.page-header { margin-bottom: 32px; }
.page-header h1 { margin: 0 0 4px; font-size: 26px; font-weight: 850; letter-spacing: -0.02em; }
.page-header p { margin: 0; color: var(--muted); font-size: 14px; }

.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }

.stat-card { padding: 20px 22px; }
.stat-label { color: var(--muted-2); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 850; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-value.accent { color: var(--accent-2); }
.stat-value.green { color: var(--green); }

.section-card { padding: 24px; margin-bottom: 14px; }
.section-title { font-size: 11px; font-weight: 800; margin: 0 0 14px; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.06em; }

.api-key-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
}

.api-key-val {
  flex: 1;
  font-family: "SF Mono", Consolas, "Cascadia Mono", monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-2);
  word-break: break-all;
  user-select: all;
}

/* ── Topup ───────────────────────────────────────────────── */
.topup-wrap { padding: 40px 28px 80px; max-width: 540px; margin: 0 auto; }

.payment-methods { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }

.pay-method {
  padding: 14px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  cursor: pointer;
  text-align: center;
  transition: border-color 140ms, background 140ms;
  min-width: 160px;
  width: fit-content;
}

.pay-method:hover { border-color: var(--border-strong); }
.pay-method.active { border-color: var(--accent-border); background: var(--accent-soft); }
.pay-method .name { font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.pay-method .hint { font-size: 11px; color: var(--muted); }

.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }

.preset {
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  transition: all 140ms;
}

.preset:hover { border-color: var(--accent-border); color: var(--text); }
.preset.active { border-color: var(--accent-border); background: var(--accent-soft); color: var(--text); }

/* ── Result ──────────────────────────────────────────────── */
.result-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
  padding: 32px 20px;
}

.result-card { width: min(100%, 420px); text-align: center; }
.result-card .card { padding: 40px 32px; }

.result-icon {
  width: 56px; height: 56px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  margin-bottom: 18px;
}

.result-icon.success { background: var(--green-soft); border: 1px solid var(--green-border); }
.result-icon.fail { background: var(--danger-soft); border: 1px solid rgba(251,113,133,0.24); }
.result-icon svg { width: 26px; height: 26px; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.result-icon.success svg { stroke: var(--green); }
.result-icon.fail svg { stroke: var(--danger); }
.result-card h2 { margin: 0 0 8px; font-size: 20px; font-weight: 850; }
.result-card p { margin: 0 0 24px; color: var(--muted); font-size: 14px; line-height: 1.6; }

/* ── Docs ────────────────────────────────────────────────── */
.docs-wrap { padding: 40px 28px 80px; max-width: 860px; margin: 0 auto; }
.docs-section { margin-bottom: 36px; }
.docs-section h2 { margin: 0 0 14px; font-size: 17px; font-weight: 850; display: flex; align-items: center; gap: 10px; }
.docs-section h2::before { content: ""; width: 3px; height: 18px; border-radius: 2px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: inline-block; flex-shrink: 0; }

.code-block {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  font-family: "SF Mono", Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--accent-2);
  overflow-x: auto;
  white-space: pre;
  margin: 0;
}

.param-table { width: 100%; border-collapse: collapse; }
.param-table th { padding: 9px 14px; text-align: left; color: var(--muted-2); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid var(--border); }
.param-table td { padding: 10px 14px; font-size: 13px; border-bottom: 1px solid var(--border); vertical-align: top; }
.param-table tr:last-child td { border-bottom: 0; }
.param-table code { padding: 2px 7px; border-radius: 5px; background: var(--accent-soft); color: var(--accent-2); font-family: monospace; font-size: 12px; }

/* ── FAQ ─────────────────────────────────────────────────── */
.faq-wrap { padding: 40px 28px 80px; max-width: 740px; margin: 0 auto; }
.faq-item { margin-bottom: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel); overflow: hidden; transition: border-color 140ms; }
.faq-item.open { border-color: var(--accent-border); }
.faq-q { width: 100%; padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: transparent; border: 0; color: var(--text); font-size: 14px; font-weight: 700; text-align: left; cursor: pointer; }
.faq-q:hover { background: rgba(255,255,255,0.025); }
.faq-q svg { flex-shrink: 0; width: 16px; height: 16px; stroke: var(--muted); transition: transform 200ms; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.faq-item.open .faq-q svg { transform: rotate(180deg); }
.faq-a { display: none; padding: 0 18px 16px; color: var(--muted); font-size: 13px; line-height: 1.65; border-top: 1px solid var(--border); padding-top: 14px; }
.faq-item.open .faq-a { display: block; }

/* ── Footer ──────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--border); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 28px; max-width: 1200px; margin: 0 auto; }
.footer-logo { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--muted); font-size: 12px; transition: color 140ms; }
.footer-links a:hover { color: var(--text); }
.footer-copy { color: var(--muted-2); font-size: 12px; }

/* ── Toast ───────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 80px);
  opacity: 0;
  z-index: 100;
  pointer-events: none;
  padding: 10px 18px;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  background: var(--panel-hover);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow);
  transition: transform 220ms ease, opacity 220ms ease;
  white-space: nowrap;
}

.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ── Search box ──────────────────────────────────────────── */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 13px;
  width: 15px; height: 15px;
  fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round;
  pointer-events: none;
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  height: 42px;
  padding: 0 36px 0 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  outline: 0;
  transition: border-color 140ms, box-shadow 140ms;
}

.search-input:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-input::placeholder { color: var(--muted-2); }

.search-clear {
  position: absolute;
  right: 11px;
  color: var(--muted-2);
  font-size: 12px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 140ms;
}

.search-clear:hover { color: var(--text); }

.search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  z-index: 200;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--panel);
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  max-height: 260px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.dd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 100ms;
  border-bottom: 1px solid var(--border);
}

.dd-item:last-child { border-bottom: 0; }
.dd-item:hover { background: rgba(124,92,255,0.08); }

.dd-item mark {
  background: transparent;
  color: var(--accent-2);
  font-weight: 800;
}

.dd-code {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted-2);
  font-family: monospace;
  background: var(--panel-soft);
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-left: 8px;
}

.dd-empty {
  padding: 16px 14px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* ── Price page wrap ─────────────────────────────────────── */
.price-page-wrap { padding: 40px 28px 80px; max-width: 1000px; margin: 0 auto; }

/* ── Mobile nav drawer ───────────────────────────────────── */
.burger-btn { display: none; }

.mobile-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  z-index: 49;
  background: rgba(10,10,15,0.97);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 8px 0 12px;
  flex-direction: column;
}

.mobile-nav.open { display: flex; }

.mobile-nav-link {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  transition: color 120ms, background 120ms;
}
.mobile-nav-link:hover,
.mobile-nav-link:active { color: var(--text); background: rgba(255,255,255,0.04); }
.mobile-nav-link-accent { color: var(--accent-2); }
.mobile-nav-link-accent:hover { color: var(--accent); }

.mobile-nav-divider { height: 1px; background: var(--border); margin: 6px 0; }

[data-theme="light"] .mobile-nav { background: rgba(244,244,248,0.97); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 700px) {
  /* Layout */
  .header-inner { padding: 0 14px; gap: 6px; }
  .container { padding: 0 16px; }
  .page-wrap, .docs-wrap, .faq-wrap { padding: 24px 16px 60px; }
  .topup-wrap { padding: 24px 16px 60px; max-width: 100%; }
  .price-page-wrap { padding: 24px 16px 60px; }

  /* Hero */
  .hero { padding: 36px 16px 24px; }
  .hero p { font-size: 14px; }
  .hero-stats { margin: 0 16px 24px; }

  /* Grid */
  .stats-row { grid-template-columns: 1fr 1fr; }
  .widget-filters { grid-template-columns: 1fr; }
  .wf-row2 { grid-template-columns: 1fr; }
  .wf-sort { min-width: unset; }
  .payment-methods { grid-template-columns: 1fr; }
  .presets { grid-template-columns: repeat(2, 1fr); }

  /* Footer */
  .footer-inner { flex-direction: column; gap: 10px; text-align: center; padding: 16px; }
  .footer-links { flex-wrap: wrap; justify-content: center; gap: 12px; }

  /* Header: hide desktop nav/buttons, show burger */
  .nav { display: none; }
  .nav-desktop { display: none !important; }
  .burger-btn { display: flex; }
  .header { position: sticky; }

  /* Profile tabs */
  .profile-tab { padding: 12px 10px; font-size: 12px; }
  .profile-table { min-width: 520px; }

  /* Price table scrollable */
  .price-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .price-table { min-width: 360px; }
  /* Hide service column on price page on mobile (filter already selects it) */
  .price-table th:first-child,
  .price-table td:first-child { display: none; }

  /* API key word break */
  .api-key-val { font-size: 11px; word-break: break-all; }
  .api-key-row { flex-wrap: wrap; gap: 8px; }
  .api-key-row .btn { width: 100%; }

  /* Code blocks */
  .code-block { font-size: 11px; }
}

@media (max-width: 480px) {
  /* Auth cards */
  .auth-card .card { padding: 24px 16px 20px; }
  .hero h1 { font-size: 28px; }
  .stats-row { grid-template-columns: 1fr 1fr; }

  /* Balance chip — shorter text */
  .balance-chip { padding: 4px 8px; font-size: 11px; }

  /* Activation actions: "На главную" full-width top, Ещё SMS + Отменить below */
  .activation-actions { flex-wrap: wrap; }
  .activation-actions > a { flex: 1 1 100% !important; }
  .activation-actions > button { flex: 1 1 calc(50% - 5px) !important; }

  /* Picker sort button wraps below search */
  .picker-search-row-wrap { flex-wrap: wrap; }
  .picker-sort-btn { width: 100%; margin-left: 0; justify-content: center; }

  /* Profile tabs topup button */
  .profile-tabs { flex-wrap: wrap; padding-bottom: 8px; }
  .profile-tabs .btn { margin: 4px 16px 0 auto !important; }

  /* Hero stats compact */
  .hero-stat-num { font-size: 14px; }
  .hero-stat-label { font-size: 10px; }
  .hero-stat { padding: 10px 6px; }
}

.filter-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.filter-toggle input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}
.filter-toggle:hover { color: var(--text); }

@media (max-width: 480px) {
  .auth-card .card { padding: 28px 20px 24px; }
  .hero h1 { font-size: 28px; }
  .stats-row { grid-template-columns: 1fr; }
}

/* ── Light theme ─────────────────────────────────────────── */
[data-theme="light"] {
  --bg: #f4f4f8;
  --panel: #ffffff;
  --panel-soft: #f0f0f6;
  --panel-hover: #e8e8f2;
  --text: #18182a;
  --muted: #5c5c78;
  --muted-2: #8888a4;
  --border: rgba(0,0,0,0.09);
  --border-strong: rgba(0,0,0,0.16);
  --shadow: 0 24px 70px rgba(0,0,0,0.12);
  color-scheme: light;
}

[data-theme="light"] body {
  background:
    radial-gradient(circle at 50% 0%, rgba(124,92,255,0.07), transparent 36rem),
    var(--bg);
}

[data-theme="light"] .header {
  background: rgba(244,244,248,0.88);
}

[data-theme="light"] .badge-count.available {
  background: rgba(74,222,128,0.18);
  color: #16a34a;
}

[data-theme="light"] .badge-count.empty {
  background: rgba(0,0,0,0.07);
  color: var(--muted);
}

[data-theme="light"] .price-table tr:hover td {
  background: rgba(124,92,255,0.05);
}

/* ── Theme toggle button ─────────────────────────────────── */
.theme-toggle {
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Profile tabs ────────────────────────────────────────── */
.profile-tabs {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 0 4px;
}

.profile-tab {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding: 14px 18px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 120ms, border-color 120ms;
}

.profile-tab.active {
  color: var(--accent-2);
  border-bottom-color: var(--accent);
}

.profile-tab:hover { color: var(--text); }

.tab-pane { min-height: 120px; }

/* ── Profile table ───────────────────────────────────────── */
.profile-table td { font-size: 13px; }
.profile-table th { white-space: nowrap; }

.code-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent-soft);
  color: var(--accent-2);
  font-weight: 800;
  font-size: 14px;
  font-family: monospace;
  padding: 3px 10px;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: .06em;
  transition: background 120ms;
}
.code-badge:hover { background: rgba(124,92,255,0.22); }
