/* ============================================================
   OctoSMM — Mobile-first, Light / Dark (AAA palette)
   ============================================================ */

:root {
  /* Light */
  --bg: #FAFAFA;
  --bg-elevated: #FFFFFF;
  --bg-soft: #F5F5F5;
  --border: #E5E5E5;
  --text: #0A0A0A;
  --text-secondary: #525252;
  --text-muted: #737373;
  --accent: #171717;
  --accent-fg: #FAFAFA;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-full: 9999px;
  --shadow: 0 4px 24px rgba(0,0,0,.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.1);
  --nav-bg: #0A0A0A;
  --nav-pill: #FFFFFF;
  --nav-icon: #A3A3A3;
  --nav-icon-active: #0A0A0A;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: 'Nunito', system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', var(--font);
}

[data-theme="dark"] {
  --bg: #0A0A0A;
  --bg-elevated: #171717;
  --bg-soft: #262626;
  --border: #262626;
  --text: #FAFAFA;
  --text-secondary: #A3A3A3;
  --text-muted: #737373;
  --accent: #FAFAFA;
  --accent-fg: #0A0A0A;
  --nav-bg: #171717;
  --nav-pill: #FAFAFA;
  --nav-icon: #737373;
  --nav-icon-active: #0A0A0A;
  --shadow: 0 4px 24px rgba(0,0,0,.4);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.5);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100dvh;
  padding-bottom: calc(72px + var(--safe-bottom));
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

.container {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Header ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.logo img { width: 32px; height: 32px; border-radius: 8px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--bg-soft);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .2s;
}
.icon-btn:hover { background: var(--border); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- Glass theme switch (Dark / Light) ---------- */
.theme-switch {
  --ts-w: 108px;
  --ts-h: 40px;
  --ts-pad: 4px;
  --ts-thumb: 32px;
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.theme-switch-sm {
  --ts-w: 88px;
  --ts-h: 34px;
  --ts-pad: 3px;
  --ts-thumb: 28px;
}
.theme-switch-track {
  position: relative;
  width: var(--ts-w);
  height: var(--ts-h);
  border-radius: 999px;
  display: block;
  overflow: hidden;
  /* glass base */
  background: linear-gradient(145deg, rgba(40,40,45,.92), rgba(18,18,22,.95));
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.12),
    inset 0 -1px 2px rgba(0,0,0,.45),
    0 8px 24px rgba(0,0,0,.28),
    0 2px 6px rgba(0,0,0,.2);
  transition: background .45s cubic-bezier(.34,1.56,.64,1), box-shadow .35s ease;
}
html[data-theme="light"] .theme-switch .theme-switch-track {
  background: linear-gradient(145deg, rgba(235,235,240,.95), rgba(200,200,210,.9));
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.7),
    inset 0 -1px 2px rgba(0,0,0,.08),
    0 8px 24px rgba(0,0,0,.12),
    0 2px 6px rgba(0,0,0,.08);
}
.theme-switch-text {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  pointer-events: none;
  transition: opacity .3s ease, color .3s ease;
  font-family: var(--font-display);
}
.theme-switch-sm .theme-switch-text { font-size: .65rem; }
.theme-switch-text-dark {
  left: 12px;
  color: rgba(255,255,255,.88);
}
.theme-switch-text-light {
  right: 12px;
  color: rgba(30,30,35,.55);
}
html[data-theme="dark"] .theme-switch .theme-switch-text-dark { opacity: 1; }
html[data-theme="dark"] .theme-switch .theme-switch-text-light { opacity: 0; }
html[data-theme="light"] .theme-switch .theme-switch-text-dark { opacity: 0; }
html[data-theme="light"] .theme-switch .theme-switch-text-light {
  opacity: 1;
  color: rgba(40,40,50,.75);
}
.theme-switch-sm .theme-switch-text-dark { left: 9px; }
.theme-switch-sm .theme-switch-text-light { right: 9px; }

/* Theme texts: controlled only by data-theme (no FOUC) */
.theme-switch-text-dark,
.theme-switch-text-light { opacity: 0; }
html[data-theme="dark"] .theme-switch .theme-switch-text-dark { opacity: 1; }
html[data-theme="light"] .theme-switch .theme-switch-text-light { opacity: 1; color: rgba(40,40,50,.75); }
html[data-theme="dark"] .theme-switch .theme-switch-text-light { opacity: 0; }
html[data-theme="light"] .theme-switch .theme-switch-text-dark { opacity: 0; }
/* Default thumb position for light */
.theme-switch-thumb { transform: translateX(0); }
html[data-theme="dark"] .theme-switch .theme-switch-thumb {
  transform: translateX(calc(var(--ts-w) - var(--ts-thumb) - var(--ts-pad) * 2));
}


/* sliding glass thumb */
.theme-switch-thumb {
  position: absolute;
  top: var(--ts-pad);
  left: var(--ts-pad);
  width: var(--ts-thumb);
  height: var(--ts-thumb);
  border-radius: 50%;
  display: grid;
  place-items: center;
  /* glass bubble */
  background: linear-gradient(145deg, rgba(255,255,255,.18), rgba(255,255,255,.04));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.35),
    inset 0 -1px 2px rgba(0,0,0,.25),
    0 4px 14px rgba(0,0,0,.35),
    0 0 0 1px rgba(255,255,255,.08);
  transition:
    transform .45s cubic-bezier(.34,1.56,.64,1),
    background .35s ease,
    box-shadow .35s ease,
    color .3s ease;
  color: #f5f5f5;
  z-index: 2;
}
html[data-theme="dark"] .theme-switch .theme-switch-thumb {
  transform: translateX(calc(var(--ts-w) - var(--ts-thumb) - var(--ts-pad) * 2));
  background: linear-gradient(145deg, rgba(60,60,70,.85), rgba(25,25,30,.9));
  color: #fafafa;
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.2),
    inset 0 -1px 2px rgba(0,0,0,.4),
    0 4px 16px rgba(0,0,0,.4),
    0 0 20px rgba(255,255,255,.06);
}
html[data-theme="light"] .theme-switch .theme-switch-thumb {
  transform: translateX(0);
  background: linear-gradient(145deg, rgba(255,255,255,.95), rgba(230,230,235,.9));
  color: #1a1a1f;
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.9),
    inset 0 -1px 2px rgba(0,0,0,.06),
    0 4px 14px rgba(0,0,0,.12),
    0 0 0 1px rgba(255,255,255,.5);
}
.theme-ico {
  position: absolute;
  transition: opacity .28s ease, transform .35s cubic-bezier(.34,1.56,.64,1);
}
html[data-theme="dark"] .theme-switch .theme-ico-moon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}
html[data-theme="dark"] .theme-switch .theme-ico-sun {
  opacity: 0;
  transform: scale(.6) rotate(-40deg);
}
html[data-theme="light"] .theme-switch .theme-ico-moon {
  opacity: 0;
  transform: scale(.6) rotate(40deg);
}
html[data-theme="light"] .theme-switch .theme-ico-sun {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}
html[data-theme="dark"] .theme-switch:active .theme-switch-thumb {
  transform: translateX(calc(var(--ts-w) - var(--ts-thumb) - var(--ts-pad) * 2)) scale(.94);
}
html[data-theme="light"] .theme-switch:active .theme-switch-thumb {
  transform: translateX(0) scale(.94);
}
.theme-switch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 999px;
}

/* ---------- Bottom Nav (reference design) ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  padding: 10px 16px calc(10px + var(--safe-bottom));
  pointer-events: none;
}
.bottom-nav-inner {
  pointer-events: auto;
  max-width: 420px;
  margin: 0 auto;
  background: var(--nav-bg);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px;
  box-shadow: var(--shadow-lg);
}
.nav-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  border-radius: var(--radius-full);
  color: var(--nav-icon);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}
.nav-item svg { width: 22px; height: 22px; flex-shrink: 0; }
.nav-item span { display: none; max-width: 0; opacity: 0; transition: all .25s; }
.nav-item.active {
  background: var(--nav-pill);
  color: var(--nav-icon-active);
  flex: 1.6;
  padding: 0 14px;
}
.nav-item.active span {
  display: inline;
  max-width: 80px;
  opacity: 1;
}

/* ---------- Cards & surfaces ---------- */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 12px; }

.section-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.section-sub {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  border-radius: var(--radius-full);
  border: none;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform .15s, opacity .15s, background .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
}
.btn-primary:hover { opacity: .9; }
.btn-ghost {
  background: var(--bg-soft);
  color: var(--text);
}
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Hero / Home ---------- */
.hero {
  padding: 28px 0 12px;
  text-align: center;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin-bottom: 10px;
}
.hero p {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 360px;
  margin: 0 auto 24px;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.feature-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 12px;
  text-align: center;
}
.feature-item .fi {
  font-size: 1.6rem;
  margin-bottom: 6px;
}
.feature-item strong {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 2px;
}
.feature-item span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---------- Country list ---------- */
.country-list { display: flex; flex-direction: column; gap: 8px; }
.country-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.country-item:hover, .country-item:active {
  border-color: var(--accent);
  background: var(--bg-soft);
}
.country-item .flag { font-size: 1.5rem; width: 32px; text-align: center; }
.country-item .info { flex: 1; min-width: 0; }
.country-item .info strong { display: block; font-size: 0.95rem; }
.country-item .info span { font-size: 0.8rem; color: var(--text-muted); }
.country-item .price {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
}

/* ---------- Search ---------- */
.search-box {
  position: relative;
  margin-bottom: 16px;
}
.search-box input {
  width: 100%;
  height: 48px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 0 18px 0 46px;
  outline: none;
  transition: border-color .2s;
}
.search-box input:focus { border-color: var(--accent); }
.search-box svg {
  position: absolute;
  left: 16px; top: 50%;
  transform: translateY(-50%);
  width: 20px; height: 20px;
  color: var(--text-muted);
  pointer-events: none;
}

/* ---------- Cookie consent ---------- */
.cookie-banner {
  position: fixed;
  bottom: calc(80px + var(--safe-bottom, 0px));
  left: 12px; right: 12px;
  z-index: 200;
  max-width: 440px;
  margin: 0 auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-lg);
  display: none;
}
.cookie-banner.show { display: block; animation: slideUp .35s ease; }
@media (min-width: 768px) {
  .cookie-banner {
    left: 24px; right: auto; bottom: 24px;
    max-width: 400px;
  }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.cookie-banner h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 8px;
  display: flex; align-items: center; gap: 8px;
  line-height: 1.3;
}
.cookie-banner p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 0 0 14px;
  line-height: 1.55;
}
.cookie-banner a { text-decoration: underline; color: inherit; font-weight: 600; }
.cookie-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cookie-actions .btn { height: 44px; font-size: 0.88rem; border-radius: 12px; }

/* ---------- Push prompt ---------- */
.push-prompt {
  position: fixed;
  top: 16px; left: 12px; right: 12px;
  z-index: 190;
  max-width: 400px;
  margin: 0 auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-lg);
  display: none;
}
@media (min-width: 768px) {
  .push-prompt { left: auto; right: 24px; margin: 0; }
}
.push-prompt.show { display: block; animation: slideUp .35s ease; }
.push-prompt h3 {
  font-size: 0.95rem; font-weight: 700; margin: 0 0 6px;
  display: flex; align-items: center; gap: 8px;
}
.push-prompt p { font-size: 0.8rem; color: var(--text-secondary); margin: 0 0 12px; line-height: 1.45; }
.push-actions { display: flex; gap: 8px; }
.push-actions .btn { flex: 1; height: 40px; font-size: 0.85rem; border-radius: 10px; }

/* ---------- Profile ---------- */
.profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--bg-soft);
  object-fit: cover;
  border: 2px solid var(--border);
}
.balance-card {
  background: linear-gradient(135deg, #171717, #404040);
  color: #FAFAFA;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
[data-theme="dark"] .balance-card {
  background: linear-gradient(135deg, #FAFAFA, #D4D4D4);
  color: #0A0A0A;
}
.balance-card .label { font-size: 0.8rem; opacity: .7; }
.balance-card .amount {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 4px 0 12px;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 300;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--bg-elevated);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  padding: 24px 20px calc(24px + var(--safe-bottom));
  animation: slideUp .3s ease;
}
.modal h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; }
.modal p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 16px; }
.modal .number-display {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  padding: 16px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}
.modal .code-display {
  font-size: 2rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.2em;
  color: var(--success);
  margin: 12px 0;
}

/* ---------- Security / About ---------- */
.security-list { display: flex; flex-direction: column; gap: 12px; }
.security-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.security-item .icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--bg-soft);
  display: grid; place-items: center;
  flex-shrink: 0;
  font-size: 1.2rem;
}
.security-item strong { display: block; font-size: 0.95rem; margin-bottom: 2px; }
.security-item span { font-size: 0.8rem; color: var(--text-muted); }

/* ---------- Utilities ---------- */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.hidden { display: none !important; }
.skeleton {
  background: linear-gradient(90deg, var(--bg-soft) 25%, var(--border) 50%, var(--bg-soft) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 8px;
  height: 16px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* (old desktop tweaks removed — replaced by full 4-breakpoint system below) */

/* ============================================================
   FULL RESPONSIVE — 4 Breakpoints
   Mobile: 0–575.98px | Tablet: 576–991.98px
   Desktop: 992–1199.98px | XL: 1200px+
   ============================================================ */

/* Base improvements for overflow safety */
html, body { overflow-x: clip; }
img, video, canvas, svg { max-width: 100%; height: auto; }
.container { min-width: 0; }
table { max-width: 100%; }

/* Desktop nav (hidden by default — mobile first) */
.desktop-nav {
  display: none;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
  min-width: 0;
}
.desktop-nav-link {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: background .2s, color .2s;
  white-space: nowrap;
}
.desktop-nav-link:hover {
  background: var(--bg-soft);
  color: var(--text);
}
.desktop-nav-link.active {
  background: var(--bg-soft);
  color: var(--text);
  font-weight: 700;
}
.topbar-login-btn {
  height: 36px;
  padding: 0 14px;
  font-size: 0.85rem;
}

/* ---------- MOBILE (0–575.98px) — already default ---------- */
@media (max-width: 575.98px) {
  .container {
    padding: 0 14px;
  }
  .hero {
    padding: 20px 0 10px;
  }
  .hero h1 {
    font-size: 1.5rem;
  }
  .hero p {
    font-size: 0.95rem;
    max-width: 100%;
  }
  .feature-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .feature-item {
    padding: 12px 8px;
  }
  .feature-item .fi { font-size: 1.4rem; }
  .feature-item strong { font-size: 0.8rem; }
  .feature-item span { font-size: 0.7rem; }
  .card { padding: 16px; }
  .section-title { font-size: 1.2rem; }
  .btn { height: 46px; font-size: 0.92rem; }
  .topbar { padding: 10px 0; }
  .logo { font-size: 1.05rem; }
  .logo img { width: 28px; height: 28px; }
  .theme-switch-sm {
    --ts-w: 80px;
    --ts-h: 32px;
    --ts-pad: 3px;
    --ts-thumb: 26px;
  }
  .modal {
    max-height: 90dvh;
    overflow-y: auto;
  }
  .country-item {
    padding: 10px 12px;
  }
  .balance-card .amount { font-size: 1.5rem; }
}

/* ---------- TABLET (576–991.98px) ---------- */
@media (min-width: 576px) and (max-width: 991.98px) {
  body { padding-bottom: calc(72px + var(--safe-bottom)); }
  .bottom-nav { display: block; }
  .desktop-nav { display: none; }
  .container {
    max-width: 720px;
    padding: 0 20px;
  }
  .hero h1 { font-size: 1.9rem; }
  .hero p { max-width: 420px; }
  .feature-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }
  .card { padding: 20px; }
  .modal-overlay { align-items: center; }
  .modal {
    border-radius: var(--radius);
    max-width: 440px;
  }
  .cookie-banner {
    left: 16px; right: 16px;
    max-width: 480px;
  }
}

/* Sub-range: larger tablets 768–991 */
@media (min-width: 768px) and (max-width: 991.98px) {
  .container { max-width: 800px; padding: 0 24px; }
  .feature-grid { gap: 14px; }
}

/* ---------- DESKTOP (992–1199.98px) ---------- */
@media (min-width: 992px) and (max-width: 1199.98px) {
  body { padding-bottom: 0; }
  .bottom-nav { display: none !important; }
  .desktop-nav { display: flex; }
  .container {
    max-width: 960px;
    padding: 0 28px;
  }
  .topbar { padding: 14px 0; }
  .topbar-inner { gap: 20px; }
  .hero {
    padding: 40px 0 20px;
  }
  .hero h1 { font-size: 2.4rem; }
  .hero p {
    font-size: 1.05rem;
    max-width: 480px;
  }
  .feature-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }
  .feature-item { padding: 20px 16px; }
  .card { padding: 24px; }
  .section-title { font-size: 1.45rem; }
  .modal-overlay { align-items: center; }
  .modal {
    border-radius: var(--radius);
    max-width: 480px;
  }
  .country-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .cookie-banner {
    left: 24px; right: auto; bottom: 24px;
    max-width: 400px;
  }
  .push-prompt { left: auto; right: 24px; margin: 0; }
}

/* ---------- EXTRA LARGE (1200px+) ---------- */
@media (min-width: 1200px) {
  body { padding-bottom: 0; }
  .bottom-nav { display: none !important; }
  .desktop-nav { display: flex; }
  .container {
    max-width: 1100px;
    padding: 0 32px;
  }
  .topbar { padding: 16px 0; }
  .topbar-inner { gap: 28px; }
  .desktop-nav { gap: 6px; }
  .desktop-nav-link {
    padding: 8px 18px;
    font-size: 0.95rem;
  }
  .hero {
    padding: 48px 0 24px;
  }
  .hero h1 {
    font-size: 2.75rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
  }
  .hero p {
    font-size: 1.1rem;
    max-width: 520px;
  }
  .feature-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
  }
  .feature-item { padding: 22px 18px; }
  .card { padding: 28px; }
  .section-title { font-size: 1.55rem; }
  .modal-overlay { align-items: center; }
  .modal {
    border-radius: var(--radius);
    max-width: 500px;
  }
  .country-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .cookie-banner {
    left: 32px; right: auto; bottom: 32px;
    max-width: 400px;
  }
  .push-prompt { left: auto; right: 32px; margin: 0; }
  .security-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

/* Override old single media query remnants for consistency */
@media (min-width: 992px) {
  body { padding-bottom: 0; }
  .bottom-nav { display: none !important; }
}

/* Form & input safety on all sizes */
input, select, textarea, button {
  max-width: 100%;
}
.form-group input,
.form-group select,
.auth-form input {
  width: 100%;
  box-sizing: border-box;
}

/* Prevent text overflow */
.country-item .info strong,
.section-title,
.hero h1 {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Tables responsive helper */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-wrap table {
  min-width: 480px;
}

/* ========== Professional country flags (SVG) ========== */
.flag-wrap {
  flex-shrink: 0;
  width: 48px;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(0,0,0,.08),
    0 4px 12px rgba(0,0,0,.06),
    inset 0 0 0 1px rgba(0,0,0,.06);
  background: var(--bg-soft);
  position: relative;
}
.flag-wrap .country-flag,
img.country-flag {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: inherit;
}
[data-theme="dark"] .flag-wrap {
  box-shadow:
    0 1px 2px rgba(0,0,0,.3),
    0 4px 14px rgba(0,0,0,.25),
    inset 0 0 0 1px rgba(255,255,255,.08);
}
.country-item {
  gap: 14px;
}
