:root {
  --bg: #0b1020;
  --bg-elevated: #121a31;
  --bg-card: #151f3a;
  --border: #243156;
  --text: #e8eeff;
  --text-muted: #93a0c2;
  --primary: #4f7cff;
  --primary-hover: #3b66f0;
  --primary-soft: rgba(79, 124, 255, 0.16);
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --shadow-btn: 0 4px 14px rgba(79, 124, 255, 0.35), 0 1px 0 rgba(255, 255, 255, 0.12) inset;
  --shadow-btn-hover: 0 8px 22px rgba(79, 124, 255, 0.45), 0 1px 0 rgba(255, 255, 255, 0.16) inset;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 20% -10%, #1a2a55 0%, var(--bg) 55%);
  color: var(--text);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0 1.5rem;
}

.nav-brand {
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 1.05rem;
  color: var(--text);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
}

/* Mobile hamburger (hidden on desktop) */
.nav-burger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
  -webkit-tap-highlight-color: transparent;
}

.nav-burger span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}

.nav-open .nav-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-burger span:nth-child(2) { opacity: 0; }
.nav-open .nav-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: rgba(79, 124, 255, 0.12);
  text-decoration: none;
}

/* Language switcher (flag) — always visible, even when burger menu is collapsed */
.lang-switcher {
  position: relative;
  flex-shrink: 0;
}
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  cursor: pointer;
}
.lang-btn:hover { border-color: var(--primary); }
.lang-caret { font-size: 0.7em; color: var(--text-muted); }
.lang-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 150px;
  background: var(--panel, #12172b);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  z-index: 60;
  padding: 0.3rem;
}
.lang-switcher:hover .lang-menu,
.lang-switcher:focus-within .lang-menu { display: flex; flex-direction: column; }
.lang-menu a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-decoration: none;
}
.lang-menu a:hover { background: rgba(79, 124, 255, 0.12); color: var(--text); }
.lang-menu a.lang-active { color: var(--text); background: rgba(79, 124, 255, 0.16); }

/* Level chip (top-right nav) */
.level-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.6rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(79, 124, 255, 0.1);
  color: var(--text);
  position: relative;
  text-decoration: none;
  margin-left: 0.35rem;
  max-width: 140px;
}

.level-chip:hover {
  background: rgba(79, 124, 255, 0.2);
  text-decoration: none;
}

.level-chip-badge {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.level-chip-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.08rem;
  line-height: 1.2;
  min-width: 0;
}

.level-chip-level {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  color: var(--text);
}

.level-chip-xp {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.level-chip-bonus {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--warning);
  white-space: nowrap;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.level-chip:not(.level-chip-has-bonus) .level-chip-bonus {
  color: var(--text-muted);
  font-weight: 600;
}

.level-chip-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 2px var(--bg);
}

/* Level page */
.level-page { display: flex; flex-direction: column; gap: 1rem; }

.level-hero {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
}

.level-hero-badge img {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

.level-hero-meta { flex: 1; min-width: 220px; }

.level-collect-hint {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--warning);
}

.xp-bar {
  height: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #7aa2ff);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.unclaimed-list { display: flex; flex-direction: column; gap: 0.65rem; }

.unclaimed-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.unclaimed-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.unclaimed-badge {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

/* Claimed reward codes (level page right column) */
.claimed-panel { min-width: 0; }

.claimed-hint {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.claimed-hint a { font-weight: 700; }

.claimed-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.claimed-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  flex-wrap: wrap;
}

.claimed-row-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.claimed-row-level {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.claimed-row code {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.88rem;
  font-weight: 700;
  color: #86efac;
  word-break: break-all;
}

.claimed-row-amount {
  font-weight: 700;
  white-space: nowrap;
}

.claimed-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.85rem;
  align-items: center;
}

.claimed-pagination .page-btn {
  min-width: 2rem;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s var(--ease);
}

.claimed-pagination .page-btn:hover:not(:disabled) {
  background: rgba(79, 124, 255, 0.14);
  border-color: rgba(79, 124, 255, 0.4);
  transform: translateY(-1px);
}

.claimed-pagination .page-btn.active {
  background: linear-gradient(180deg, #5b86ff, var(--primary));
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 124, 255, 0.35);
}

.claimed-pagination .page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.claimed-pagination .page-info {
  margin-left: 0.35rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.hero {
  text-align: center;
  padding: 4rem 1rem 3rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin: 0.35rem 0;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.feature-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 3rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.card h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.card p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.auth-wrap {
  max-width: 440px;
  margin: 4rem auto;
}

.auth-wrap h1,
.auth-wrap h2 {
  margin-top: 0;
  text-align: center;
}

.muted { color: var(--text-muted); }
.center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }

label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #0f1730 0%, #0d1428 100%);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
}

input::placeholder,
textarea::placeholder {
  color: rgba(147, 160, 194, 0.55);
}

input:hover:not(:disabled):not(:focus),
select:hover:not(:disabled):not(:focus),
textarea:hover:not(:disabled):not(:focus) {
  border-color: #32456f;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  background: #0f1730;
  box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.22), 0 0 18px rgba(79, 124, 255, 0.12);
}

input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.2rem;
}

/* Currency / unit prefix on amount inputs (Top Up, dashboard modal) */
.input-affix {
  position: relative;
  display: block;
}

.input-affix .affix-prefix {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 1.05rem;
  pointer-events: none;
  z-index: 1;
}

.input-affix input[type="number"],
.input-affix input[type="text"] {
  padding-left: 2rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.input-affix input:focus ~ .affix-prefix,
.input-affix:focus-within .affix-prefix {
  color: var(--primary);
}

/* Buttons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.8rem 1.25rem;
  font-size: 0.98rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(180deg, #5b86ff 0%, var(--primary) 55%, #3f6aef 100%);
  box-shadow: var(--shadow-btn);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
  user-select: none;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.18) 50%, transparent 80%);
  transform: translateX(-120%);
  transition: transform 0.55s var(--ease);
  pointer-events: none;
}

.btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #6b92ff 0%, var(--primary-hover) 55%, #3560e0 100%);
  box-shadow: var(--shadow-btn-hover);
  transform: translateY(-1px);
}

.btn:hover:not(:disabled)::after {
  transform: translateX(120%);
}

.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.985);
  box-shadow: 0 2px 8px rgba(79, 124, 255, 0.28);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-btn), 0 0 0 3px rgba(79, 124, 255, 0.45);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn:disabled::after,
.btn[disabled]::after {
  display: none;
}

.btn-secondary {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.btn-secondary:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(79, 124, 255, 0.16) 0%, rgba(79, 124, 255, 0.08) 100%);
  border-color: rgba(79, 124, 255, 0.45);
  box-shadow: 0 6px 18px rgba(79, 124, 255, 0.16);
}

.btn-danger {
  background: linear-gradient(180deg, #f87171 0%, var(--danger) 55%, #dc2626 100%);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35), 0 1px 0 rgba(255, 255, 255, 0.1) inset;
}

.btn-danger:hover:not(:disabled) {
  background: linear-gradient(180deg, #fb8a8a 0%, #ef4444 55%, #b91c1c 100%);
  box-shadow: 0 8px 22px rgba(239, 68, 68, 0.45), 0 1px 0 rgba(255, 255, 255, 0.14) inset;
}

/* Cancel locked during 4-minute hold: visible but transparent / not clickable */
.btn-danger.btn-locked,
.btn-danger.btn-locked:disabled,
.btn-danger.btn-locked:disabled:hover {
  opacity: 0.35;
  filter: grayscale(0.45);
  cursor: not-allowed;
  background: var(--danger);
  transform: none;
  box-shadow: none;
}

.btn-danger.btn-locked:disabled:hover {
  background: var(--danger);
}

.btn-success {
  background: linear-gradient(180deg, #34d399 0%, var(--success) 55%, #16a34a 100%);
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35), 0 1px 0 rgba(255, 255, 255, 0.1) inset;
}

.btn-success:hover:not(:disabled) {
  background: linear-gradient(180deg, #4ade9f 0%, #22c55e 55%, #15803d 100%);
  box-shadow: 0 8px 22px rgba(34, 197, 94, 0.45), 0 1px 0 rgba(255, 255, 255, 0.14) inset;
}

.btn-block { width: 100%; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.alert {
  border-radius: 10px;
  padding: 0.8rem 1rem;
  margin: 1rem 0;
  font-size: 0.95rem;
  display: none;
}

.alert.show { display: block; }
.alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fecaca;
}
.alert-success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #bbf7d0;
}
.alert-warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fde68a;
}

.account-number {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: clamp(1.4rem, 4vw, 2rem);
  letter-spacing: 0.12em;
  font-weight: 700;
  margin: 1rem 0;
  word-break: break-all;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 0.35rem;
  word-break: break-all;
}

.stat-value.small {
  font-size: 1.15rem;
  letter-spacing: 0.08em;
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  text-align: left;
  padding: 0.7rem 0.6rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-pending { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-sms { background: rgba(79, 124, 255, 0.15); color: #93b4ff; }
.badge-finished { background: rgba(34, 197, 94, 0.15); color: #86efac; }
.badge-cancelled,
.badge-banned,
.badge-expired { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }

/* GET NUMBER operator/price picker */
.offers-wrap { max-height: 240px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.offer-table th,
.offer-table td { padding: 0.55rem 0.55rem; }
.offer-table tr.offer-row { cursor: pointer; transition: background 0.12s ease; }
.offer-table tr.offer-row:hover { background: rgba(79, 124, 255, 0.08); }
.offer-table tr.offer-row.selected { background: rgba(79, 124, 255, 0.16); }
.offer-table tr.offer-row.selected td:first-child::before { content: "✓"; color: var(--primary); font-weight: 700; }
.offer-table .offer-check { width: 1.25rem; color: var(--primary); }
.offer-table .offer-op { display: flex; align-items: center; gap: 0.45rem; }
.offer-table td.offer-op { white-space: normal; overflow-wrap: anywhere; }

.service-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
  vertical-align: middle;
}

/* simple-icons logo assets — square SVG, keeps the tile proportions */
img.service-logo {
  object-fit: contain;
  background: #fff;
  padding: 0.16rem;
  box-sizing: border-box;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.35));
}

/* country flag from the bundled flag-icons library (1x1 square set) */
.liba-flag {
  display: inline-block;
  width: 1.5em;
  height: 1.5em;
  object-fit: contain;
  border-radius: 3px;
  vertical-align: middle;
  flex-shrink: 0;
}
.liba-flag.liba-flag-sm { width: 1.1em; height: 1.1em; }

/* letter fallback tile for missing flags */
.liba-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 700;
  color: #fff;
  vertical-align: middle;
}
.liba-letter-lg { width: 1.55rem; height: 1.55rem; font-size: 0.85rem; }

.service-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.95rem;
}

/* Result-card cells keep the stat-value size; service-brand only adds layout */
.stat-value.small.service-brand {
  font-size: 1.15rem;
  letter-spacing: 0.08em;
}

.service-brand-row { min-height: 0; }

/* GET NUMBER selected chips (country / service) */
.selected-chip-row { margin-top: 0.4rem; }
.selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  padding: 0.3rem 0.35rem 0.3rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(79, 124, 255, 0.45);
  background: rgba(79, 124, 255, 0.14);
  color: var(--text);
  font-size: 0.9rem;
}
.selected-chip-body {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.selected-chip-body strong { overflow: hidden; text-overflow: ellipsis; }
.selected-chip-x {
  flex-shrink: 0;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s var(--ease);
}

.selected-chip-x:hover {
  transform: scale(1.08);
}
.selected-chip-x:hover,
.search-clear:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

/* Get Number modal */
.modal-get-number { width: min(560px, 100%); max-height: min(92vh, 900px); overflow: auto; }
.offer-summary .muted { font-size: 0.92rem; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 20, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
}

.modal-backdrop.open { display: flex; }

.modal {
  width: min(480px, 100%);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.modal h2 { margin-top: 0; }

.form-row { margin-bottom: 1rem; }

.otp-box {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #86efac;
  min-height: 2.5rem;
}

.countdown {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fbbf24;
}

.cancel-panel {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 12px;
  padding: 1rem 1.15rem;
}

.cancel-panel .stat-label {
  color: #fbbf24;
}

.cancel-ready {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: 12px;
  padding: 0.85rem 1rem;
}

.cancel-ready .stat-label {
  color: #86efac;
}

#cancel-countdown {
  margin-top: 0.25rem;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 1rem;
}

/* Orders list: clickable rows + OTP / countdown cells */
.orders-table tr.order-row:hover,
.orders-table tr.order-row:focus {
  background: rgba(79, 124, 255, 0.08);
  outline: none;
}

.otp-inline {
  font-family: "Cascadia Code", Consolas, monospace;
  font-weight: 700;
  color: #86efac;
  letter-spacing: 0.08em;
}

.cancel-open {
  color: #86efac;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Support tickets */
.support-table tr.order-row:hover,
.support-table tr.order-row:focus {
  background: rgba(79, 124, 255, 0.08);
  outline: none;
}

.ticket-thread {
  max-height: 480px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.ticket-msg {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.95rem;
  background: var(--bg-card);
}

.ticket-msg.from-admin {
  border-color: rgba(79, 124, 255, 0.45);
  background: rgba(79, 124, 255, 0.1);
}

.ticket-msg.from-user {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.07);
}

.ticket-msg-meta {
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
}

.ticket-msg-meta strong {
  color: var(--text);
}

.ticket-msg-body {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
}

.footer {
  margin-top: 3rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.amount-pos { color: var(--success); }
.amount-neg { color: #fca5a5; }

.spin {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

/* Searchable select (country / service) */
.search-select {
  position: relative;
}

.search-select-input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #0f1730 0%, #0d1428 100%);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.search-select.has-clear .search-select-input { padding-right: 2.2rem; }

.search-clear {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  transform: translateY(-50%);
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 2;
  transition: background .12s, color .12s, border-color .12s;
}
.search-clear.show { display: inline-flex; }

.search-select-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.22), 0 0 18px rgba(79, 124, 255, 0.12);
}

.search-select-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.search-select-menu {
  display: none;
  position: absolute;
  z-index: 50;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.search-select-menu.open { display: block; }

.search-select-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(36, 49, 86, 0.5);
}

.search-select-item:last-child { border-bottom: none; }

.search-select-item:hover,
.search-select-item.active {
  background: rgba(79, 124, 255, 0.14);
}

.search-select-item-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.search-select-item-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.search-select-item-meta {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.search-select-empty {
  padding: 0.75rem 0.85rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---- Mobile layout ---- */
@media (max-width: 800px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  th, td { white-space: normal; }

  .container {
    width: min(1100px, calc(100% - 1.25rem));
    padding: 1rem 0 2rem;
  }

  /* Nav: brand + burger on one row, links collapse behind burger */
  .nav {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 0.85rem 0 1.1rem;
    position: relative;
  }

  .nav-burger {
    display: inline-flex;
    margin-left: auto;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border);
  }

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

  .nav-links a {
    padding: 0.75rem 0.85rem;          /* ≥44px tap target */
    font-size: 1rem;
    border-radius: 10px;
  }

  .nav-links .muted { padding: 0.5rem 0.85rem; }

  /* Level chip inside the collapsed menu: full-width friendly */
  .nav-links .level-chip {
    margin: 0.35rem 0.85rem;
    max-width: none;
    align-self: flex-start;
  }

  .panel { padding: 1.1rem; }
  .card { padding: 1rem; }
  .modal { padding: 1.15rem; }

  /* Forms: avoid iOS auto-zoom (inputs must be ≥16px) */
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="password"],
  select,
  textarea,
  .search-select-input {
    font-size: 16px;
    padding: 0.75rem 0.85rem;
  }

  .btn {
    min-height: 46px;                  /* comfortable tap target */
    padding: 0.75rem 1.1rem;
  }

  /* Full-width primary actions stacked vertically */
  .btn-row .btn { width: 100%; margin: 0; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }

  .stat-value { font-size: 1.35rem; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

  .account-number { font-size: 1.35rem; letter-spacing: 0.08em; }

  table { font-size: 0.88rem; }
  th, td { padding: 0.55rem 0.45rem; }

  .auth-wrap { margin: 1.5rem auto; }

  .otp-box { font-size: 1.6rem; letter-spacing: 0.14em; }
  .countdown { font-size: 1.2rem; }

  .footer { margin-top: 2rem; }

  /* Top-up / checkout header rows: stack cleanly */
  .admin-grid { grid-template-columns: minmax(0, 1fr); }

  /* Dashboard: GET NUMBER CTA jumps above the stat panels */
  .stat-cta { order: -1; }

  /* Modals become bottom sheets — full-width, slide from bottom, no top overflow */
  .modal-backdrop {
    align-items: flex-end;
    justify-content: center;
    padding: 0;
  }

  .modal,
  .modal-get-number {
    width: 100%;
    max-width: none;
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 18px 18px 0 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1.15rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
    animation: sheet-up 0.25s var(--ease);
  }

  @keyframes sheet-up {
    from { transform: translateY(24px); opacity: 0.6; }
    to { transform: translateY(0); opacity: 1; }
  }

  /* Sticky primary actions inside long sheets (GET NUMBER, confirm) */
  .modal .btn-row {
    position: sticky;
    bottom: 0;
    background: var(--bg-elevated);
    padding: 0.6rem 0 0.15rem;
    margin-top: 0.5rem;
    box-shadow: 0 -10px 18px -8px var(--bg-elevated);
  }

  .modal h2 { font-size: 1.2rem; }

  /* Search-select dropdown: taller on small screens */
  .search-select-menu { max-height: 45vh; }

  /* EPUSDT checkout: coin grid + address block */
  .ep-coin-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.45rem; }
  .ep-coin-btn { padding: 0.5rem 0.6rem; font-size: 0.92rem; }
}

/* Very small phones */
@media (max-width: 400px) {
  .container { width: min(1100px, calc(100% - 1rem)); }
  .panel { padding: 0.9rem; }
  .ep-coin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-value { font-size: 1.2rem; }
}

/* ---- Buy panel (dashboard sidebar + /buy page) ---- */
.bp-alert:empty { display: none; }
.bp-alert { margin-bottom: 0.75rem; }

.bp-head {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}
.bp-head-sub { font-weight: 400; font-size: 0.85rem; min-width: 0; overflow-wrap: anywhere; }
.bp-back {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0.28rem 0.55rem;
  flex-shrink: 0;
}
.bp-back:hover { border-color: var(--primary); background: var(--primary-soft); }
.bp-count { color: var(--text-muted); font-weight: 400; font-size: 0.85rem; }

.bp-search {
  width: 100%;
  margin-bottom: 0.65rem;
}

.bp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
}

.bp-card {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.7rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  color: var(--text);
  font: inherit;
  text-align: left;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.bp-card:hover { border-color: var(--primary); background: var(--primary-soft); }
.bp-card-icon { display: inline-flex; flex-shrink: 0; }
.bp-card-title { display: block; font-weight: 600; font-size: 0.92rem; }
.bp-card-meta { display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 0.1rem; }

.bp-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.bp-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  width: 100%;
  padding: 0.6rem 0.7rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  color: var(--text);
  font: inherit;
  text-align: left;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.bp-row:hover { border-color: var(--primary); background: var(--primary-soft); }
.bp-row-title { flex: 1; font-weight: 600; font-size: 0.92rem; }
.bp-row-meta { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }

.bp-more {
  margin-top: 0.6rem;
  width: 100%;
  background: none;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--primary);
  font: inherit;
  font-size: 0.88rem;
  padding: 0.55rem;
  cursor: pointer;
}
.bp-more:hover { background: var(--primary-soft); }

.bp-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem 0;
}

.bp-footer { margin-top: 0.85rem; }

/* Desktop: dashboard = buy sidebar + main */
.app-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.buy-sidebar { position: sticky; top: 1rem; }
.buy-panel-shell .offers-wrap { max-height: 260px; }

@media (max-width: 1040px) {
  .app-layout { grid-template-columns: minmax(0, 1fr); }
  .buy-sidebar { display: none; }
}

/* ---- Mobile app chrome ---- */
.mobile-topbar,
.mobile-tabbar { display: none; }

.mobile-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(18, 26, 49, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.mt-balance {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.mt-balance:hover { text-decoration: none; color: var(--primary); }
.mt-balance-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.mt-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.mt-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
}
.mt-icon:hover { color: var(--primary); border-color: var(--primary); text-decoration: none; }
.mt-icon svg { width: 20px; height: 20px; }

.mobile-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  justify-content: space-around;
  align-items: stretch;
  background: rgba(11, 16, 32, 0.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  padding: 0.3rem 0.2rem calc(0.3rem + env(safe-area-inset-bottom, 0px));
}

.mtab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0.3rem 0;
  min-height: 48px;
  color: var(--text-muted);
  font-size: 0.68rem;
  text-decoration: none;
}
.mtab:hover { text-decoration: none; color: var(--text); }
.mtab svg { width: 22px; height: 22px; }
.mtab.active { color: var(--primary); }

@media (max-width: 800px) {
  .app-body .mobile-topbar { display: flex; }
  .app-body .mobile-tabbar { display: flex; }
  .app-body .container { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)); }

  .bp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .buy-page-panel .offers-wrap { max-height: none; }
}

/* ---- Mobile menu page ---- */
.menu-links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.menu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0.9rem;
  min-height: 48px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.menu-link:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  text-decoration: none;
  color: var(--text);
}
.menu-link-chev { color: var(--text-muted); font-size: 1.2rem; line-height: 1; }
.menu-link-danger { color: var(--danger); }
