:root {
  color-scheme: dark;
  --bg: #07040f;
  --bg-2: #0e071b;
  --ink: #faf7ff;
  --muted: #a79ab8;
  --muted-2: #7f728f;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(168, 85, 247, 0.42);
  --soft: rgba(255, 255, 255, 0.07);
  --paper: rgba(20, 13, 33, 0.86);
  --paper-strong: rgba(28, 18, 45, 0.96);
  --paper-flat: #120b20;
  --field: rgba(255, 255, 255, 0.08);
  --purple: #a855f7;
  --purple-strong: #7c3aed;
  --purple-soft: rgba(168, 85, 247, 0.15);
  --cyan: #22d3ee;
  --green: #34d399;
  --amber: #facc15;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.2);
  --radius: 8px;
  --sidebar-bg: #090512;
  --sidebar-ink: #f7f2ff;
  --sidebar-muted: #9e91af;
  --sidebar-line: rgba(255, 255, 255, 0.12);
  --focus: 0 0 0 3px rgba(168, 85, 247, 0.24);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f1ff;
  --bg-2: #ffffff;
  --ink: #17121f;
  --muted: #63576f;
  --muted-2: #83758f;
  --line: rgba(42, 27, 63, 0.13);
  --line-strong: rgba(124, 58, 237, 0.3);
  --soft: rgba(124, 58, 237, 0.08);
  --paper: rgba(255, 255, 255, 0.88);
  --paper-strong: rgba(255, 255, 255, 0.98);
  --paper-flat: #ffffff;
  --field: rgba(255, 255, 255, 0.82);
  --purple: #7c3aed;
  --purple-strong: #5b21b6;
  --purple-soft: rgba(124, 58, 237, 0.1);
  --cyan: #0891b2;
  --green: #047857;
  --amber: #a16207;
  --shadow: 0 18px 42px rgba(55, 31, 88, 0.12);
  --shadow-soft: 0 10px 26px rgba(55, 31, 88, 0.1);
  --sidebar-bg: #0b0614;
  --sidebar-ink: #f7f2ff;
  --sidebar-muted: #a99bb8;
  --sidebar-line: rgba(255, 255, 255, 0.13);
  --focus: 0 0 0 3px rgba(124, 58, 237, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(168, 85, 247, 0.12) 0 1px, transparent 1px 96px),
    linear-gradient(180deg, rgba(34, 211, 238, 0.08) 0 1px, transparent 1px 96px),
    linear-gradient(135deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.mobile-nav,
.sidebar-backdrop {
  display: none;
}

.shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 18px 14px;
  color: var(--sidebar-ink);
  background:
    linear-gradient(180deg, rgba(168, 85, 247, 0.18), rgba(34, 211, 238, 0.04)),
    var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-line);
  box-shadow: 18px 0 55px rgba(0, 0, 0, 0.28);
}

.brand-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--sidebar-line);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--purple-strong), var(--purple) 58%, var(--cyan));
  border-radius: var(--radius);
  font-weight: 800;
  box-shadow: 0 10px 26px rgba(124, 58, 237, 0.36);
}

.brand strong {
  display: block;
  color: var(--sidebar-ink);
  font-size: 1rem;
  line-height: 1.2;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: var(--sidebar-muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.theme-toggle {
  display: grid;
  place-items: center;
  gap: 2px;
  width: 58px;
  min-height: 62px;
  color: var(--sidebar-ink);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  outline: none;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: rgba(168, 85, 247, 0.75);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.16);
}

.theme-toggle [data-theme-icon] {
  font-size: 1.05rem;
  line-height: 1;
}

.theme-toggle [data-theme-label] {
  font-size: 0.7rem;
  font-weight: 850;
}

.sidebar-close {
  display: none;
}

.sidebar-tools-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  margin: 16px 0 0;
  padding: 10px 12px;
  color: #ffffff;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.9), rgba(124, 58, 237, 0.84));
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  font-size: 0.86rem;
  font-weight: 850;
  box-shadow: 0 14px 32px rgba(20, 184, 166, 0.12);
}

.sidebar-tools-link::after {
  content: "→";
  font-size: 1rem;
  line-height: 1;
}

.sidebar-tools-link:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateX(2px);
}

.country-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 6px 10px;
  color: var(--sidebar-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.country-count {
  color: #ffffff;
  background: rgba(168, 85, 247, 0.72);
  border-radius: 999px;
  padding: 2px 7px;
  letter-spacing: 0;
}

.sidebar-search {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  color: var(--sidebar-muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.sidebar-search input {
  width: 100%;
  min-height: 40px;
  padding: 0 11px;
  color: var(--sidebar-ink);
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  outline: none;
}

.sidebar-search input::placeholder {
  color: rgba(247, 242, 255, 0.48);
}

.sidebar-search input:focus {
  border-color: rgba(168, 85, 247, 0.82);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.17);
}

.country-list {
  display: grid;
  gap: 7px;
}

.country-link {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 42px;
  color: rgba(247, 242, 255, 0.92);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 8px 10px;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.country-link:hover,
.country-link.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.95), rgba(168, 85, 247, 0.82));
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(2px);
}

.legal-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--sidebar-line);
}

.legal-nav a {
  display: grid;
  place-items: center;
  min-height: 34px;
  color: var(--sidebar-muted);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 800;
}

.legal-nav a:hover {
  color: #ffffff;
  background: rgba(168, 85, 247, 0.75);
  border-color: rgba(255, 255, 255, 0.16);
}

.country-code {
  font-size: 0.78rem;
  font-weight: 850;
}

.country-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 650;
}

.number-total {
  opacity: 0.72;
  font-size: 0.78rem;
}

.main {
  min-width: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 320px),
    transparent;
}

.locale-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 28px 0;
}

.locale-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 32px;
  padding: 0 10px;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 800;
}

.locale-link:hover,
.locale-link.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--purple-strong), var(--purple));
  border-color: rgba(255, 255, 255, 0.18);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 360px);
  gap: 18px;
  align-items: center;
  padding: 22px 28px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px);
}

.intro h1 {
  margin: 0;
  max-width: 900px;
  font-size: 2.18rem;
  line-height: 1.12;
  font-weight: 900;
}

.intro p {
  max-width: 820px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.eyebrow {
  margin: 0 0 8px !important;
  color: var(--cyan) !important;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-wrap {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.search-wrap input {
  min-height: 42px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  box-shadow: var(--shadow-soft);
}

.search-wrap input:focus {
  border-color: var(--purple);
  box-shadow: var(--focus);
}

.back-link {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 13px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--purple-strong), var(--purple));
  border-radius: var(--radius);
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(124, 58, 237, 0.28);
}

.content {
  display: grid;
  grid-template-columns: minmax(360px, 1.15fr) minmax(280px, 0.85fr);
  gap: 22px;
  padding: 24px 28px 32px;
}

.content.single {
  grid-template-columns: 1fr;
}

.panel {
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(18px);
}

.panel-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper-strong) 82%, transparent);
}

.panel-head h2,
.seo-panel h2 {
  margin: 0;
  font-size: 1.1rem;
}

.panel-head p,
.seo-panel p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.pill {
  flex: none;
  padding: 5px 9px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--purple-strong), var(--purple));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 750;
  white-space: nowrap;
}

.country-grid,
.number-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.country-card,
.number-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  color: var(--ink);
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.country-card:hover,
.number-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 14px 34px rgba(124, 58, 237, 0.22);
  transform: translateY(-2px);
}

.card-code {
  width: max-content;
  padding: 4px 7px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--purple-strong), var(--purple));
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 850;
}

.country-card strong,
.phone {
  overflow-wrap: anywhere;
  font-size: 1.02rem;
  font-weight: 850;
}

.country-card span,
.country-card em {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.country-card em {
  font-style: normal;
  color: var(--cyan);
  font-weight: 750;
}

.phone-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 0.8rem;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid var(--line);
}

.status.live {
  color: var(--green);
  background: color-mix(in srgb, var(--green) 14%, transparent);
  border-color: color-mix(in srgb, var(--green) 36%, transparent);
}

.open-label {
  color: var(--cyan);
  font-size: 0.84rem;
  font-weight: 850;
}

.selected-number {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background:
    linear-gradient(90deg, rgba(124, 58, 237, 0.24), rgba(34, 211, 238, 0.12)),
    var(--paper-strong);
  border-bottom: 1px solid var(--line);
}

.selected-number strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 1.1rem;
}

.selected-number span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.messages {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
}

.message {
  display: grid;
  gap: 7px;
  padding: 13px 14px;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.message-top {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.message-top > span {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.sender {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--cyan);
}

.message time {
  flex: none;
  color: var(--muted);
  font-size: 0.8rem;
}

.message p {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.seo-panel {
  padding: 20px;
}

.legal-page {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.legal-section {
  display: grid;
  gap: 8px;
  padding: 16px;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.legal-section h2,
.legal-section h3 {
  margin: 0;
}

.legal-section p,
.legal-section li {
  color: var(--muted);
  line-height: 1.58;
}

.legal-section ul {
  margin: 0;
  padding-left: 19px;
}

.contact-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  color: var(--ink);
  background: var(--purple-soft);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.contact-card a {
  color: var(--cyan);
  font-size: 1.08rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.seo-panel h3 {
  margin: 20px 0 8px;
  font-size: 0.98rem;
}

.inline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.inline-links a {
  padding: 7px 9px;
  color: var(--cyan);
  background: color-mix(in srgb, var(--cyan) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--cyan) 26%, transparent);
  border-radius: var(--radius);
  font-size: 0.86rem;
  font-weight: 750;
}

.keyword-pill {
  padding: 7px 9px;
  color: var(--ink);
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.84rem;
  font-weight: 750;
}

details {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

summary {
  cursor: pointer;
  font-weight: 850;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 1120px) {
  body.sidebar-open {
    overflow: hidden;
  }

  .shell {
    display: block;
  }

  .mobile-nav {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    color: var(--sidebar-ink);
    background:
      linear-gradient(135deg, rgba(124, 58, 237, 0.28), rgba(34, 211, 238, 0.08)),
      var(--sidebar-bg);
    border-bottom: 1px solid var(--sidebar-line);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(18px);
  }

  .mobile-brand {
    display: flex;
    min-width: 0;
    gap: 10px;
    align-items: center;
  }

  .mobile-brand .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 0.82rem;
  }

  .mobile-brand strong,
  .mobile-brand small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-brand strong {
    color: var(--sidebar-ink);
    font-size: 0.96rem;
    line-height: 1.15;
  }

  .mobile-brand small {
    margin-top: 2px;
    color: var(--sidebar-muted);
    font-size: 0.76rem;
  }

  .mobile-menu-button {
    display: inline-grid;
    grid-template-columns: auto auto auto;
    gap: 7px;
    align-items: center;
    min-height: 40px;
    padding: 0 10px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--purple-strong), var(--purple));
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius);
    box-shadow: 0 12px 28px rgba(124, 58, 237, 0.26);
    font-size: 0.86rem;
    font-weight: 850;
  }

  .mobile-menu-button span:first-child {
    font-size: 1.05rem;
    line-height: 1;
  }

  .mobile-menu-button strong {
    display: grid;
    place-items: center;
    min-width: 23px;
    height: 23px;
    padding: 0 6px;
    color: var(--purple-strong);
    background: #ffffff;
    border-radius: 999px;
    font-size: 0.74rem;
    line-height: 1;
  }

  .sidebar {
    position: fixed;
    z-index: 50;
    top: 0;
    left: 0;
    width: min(86vw, 360px);
    height: 100vh;
    height: 100dvh;
    max-height: none;
    overflow: auto;
    padding: 16px;
    border-right: 1px solid var(--sidebar-line);
    border-bottom: 0;
    box-shadow: 24px 0 54px rgba(0, 0, 0, 0.38);
    transform: translateX(-110%);
    transition: transform 220ms ease;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: block;
    opacity: 0;
    pointer-events: none;
    background: rgba(6, 3, 14, 0.68);
    border: 0;
    backdrop-filter: blur(7px);
    transition: opacity 180ms ease;
  }

  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .brand-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .sidebar-close {
    display: grid;
    place-items: center;
    width: 42px;
    min-height: 62px;
    color: var(--sidebar-ink);
    background: rgba(255, 255, 255, 0.075);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius);
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1;
  }

  .country-list {
    grid-template-columns: 1fr;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .topbar {
    position: static;
  }

  .content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .topbar {
    grid-template-columns: 1fr;
    padding: 18px 16px;
  }

  .intro h1 {
    font-size: 1.72rem;
  }

  .content {
    padding: 16px;
  }

  .country-grid,
  .number-grid {
    grid-template-columns: 1fr;
  }

  .country-list {
    grid-template-columns: 1fr;
  }

  .country-link {
    grid-template-columns: 30px minmax(0, 1fr);
    min-height: 40px;
  }

  .country-link .number-total {
    display: none;
  }

  .panel-head,
  .selected-number {
    display: grid;
  }

  .back-link {
    justify-self: start;
  }
}

@media (max-width: 480px) {
  .sidebar {
    width: min(92vw, 360px);
    height: 100vh;
    height: 100dvh;
    max-height: none;
    padding: 12px;
  }

  .mobile-nav {
    padding: 9px 10px;
  }

  .mobile-brand small {
    display: none;
  }

  .mobile-menu-button {
    grid-template-columns: auto auto;
    gap: 6px;
    padding: 0 9px;
  }

  .mobile-menu-button strong {
    display: none;
  }

  .brand-row {
    gap: 8px;
    padding-bottom: 12px;
  }

  .brand {
    gap: 10px;
    padding: 8px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand strong {
    font-size: 0.95rem;
  }

  .brand small {
    display: none;
  }

  .theme-toggle {
    width: 52px;
    min-height: 52px;
  }

  .sidebar-close {
    width: 42px;
    min-height: 52px;
  }

  .country-title {
    margin: 12px 4px 8px;
  }

  .sidebar-search {
    margin-bottom: 10px;
  }

  .country-list {
    max-height: none;
    gap: 6px;
  }

  .country-link {
    gap: 8px;
    padding: 7px 8px;
  }

  .country-name {
    font-size: 0.82rem;
  }

  .legal-nav {
    margin-top: 10px;
    padding-top: 10px;
  }

  .topbar {
    padding: 18px 12px;
  }

  .content {
    padding: 14px 12px 24px;
  }

  .country-grid,
  .number-grid,
  .messages {
    padding: 10px;
  }
}

/* ── Tools Center ── */

.tool-hero {
  padding: 28px 28px 0;
}

.tool-hero h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.15;
}

.tool-hero .sub {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 720px;
  line-height: 1.5;
}

/* Tool grid (tools homepage) */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 24px 28px;
}

.tool-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  color: var(--ink);
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
  text-decoration: none;
}

.tool-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 14px 34px rgba(124, 58, 237, 0.22);
  transform: translateY(-2px);
}

.tool-card .icon {
  font-size: 1.4rem;
  line-height: 1;
}

.tool-card strong {
  font-size: 1.02rem;
  font-weight: 850;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

/* Tool section headers */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px 8px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 850;
}

.section-head .count {
  color: var(--purple);
  font-size: 0.84rem;
  font-weight: 800;
}

/* ── Tool form components ── */

.tool-form {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.tool-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.tool-input {
  min-height: 48px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  font-size: 1rem;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", ui-monospace, monospace;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.tool-input:focus {
  border-color: var(--purple);
  box-shadow: var(--focus);
}

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

textarea.tool-input {
  min-height: 140px;
  padding: 12px 14px;
  resize: vertical;
  font-family: inherit;
}

.tool-select {
  min-height: 48px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  font-size: 1rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a79ab8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.tool-select:focus {
  border-color: var(--purple);
  box-shadow: var(--focus);
}

/* ── Buttons ── */

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--purple-strong), var(--purple));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  transition: opacity 120ms ease, transform 120ms ease;
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.22);
}

.btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--soft);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}

.btn-small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.8rem;
  font-weight: 750;
}

/* ── Results ── */

.result-panel {
  margin: 20px;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--purple-soft) 60%, transparent);
  border-bottom: 1px solid var(--line);
}

.result-head strong {
  font-size: 0.9rem;
}

.result-body {
  padding: 16px;
}

.result-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.result-row:last-child {
  border-bottom: 0;
}

.result-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.result-value {
  color: var(--ink);
  font-weight: 700;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", ui-monospace, monospace;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.result-value.valid {
  color: var(--green);
}

.result-value.invalid {
  color: #ef4444;
}

/* ── Code display ── */

.code-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: "SF Mono", "Fira Code", "Cascadia Code", ui-monospace, monospace;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

/* ── Toast ── */

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  padding: 12px 22px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--purple-strong), var(--purple));
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.86rem;
  box-shadow: 0 14px 40px rgba(124, 58, 237, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.toast.show {
  opacity: 1;
  pointer-events: auto;
}

/* ── Country rules table ── */

.rules-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.rules-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.rules-table td:first-child {
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
  width: 180px;
}

.rules-table td:last-child {
  font-weight: 650;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", ui-monospace, monospace;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

/* ── Country list grid ── */

.country-rules-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 20px;
}

.country-rule-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  color: var(--ink);
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease;
}

.country-rule-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.country-rule-card .flag {
  font-size: 1.4rem;
  line-height: 1;
}

.country-rule-card .info {
  min-width: 0;
}

.country-rule-card .info strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}

.country-rule-card .info span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 2px;
}

/* ── QR canvas ── */

.qr-wrap {
  display: grid;
  place-items: center;
  padding: 20px;
}

.qr-wrap canvas {
  border: 6px solid #ffffff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

/* ── Tab pills ── */

.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 20px 0;
}

.tab-pill {
  padding: 8px 14px;
  color: var(--muted);
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}

.tab-pill.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--purple-strong), var(--purple));
  border-color: rgba(255, 255, 255, 0.18);
}

/* ── Search for country rules ── */

.filter-wrap {
  padding: 0 20px 14px;
}

.filter-wrap input {
  width: 100%;
  min-height: 42px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  font-size: 0.92rem;
}

.filter-wrap input:focus {
  border-color: var(--purple);
  box-shadow: var(--focus);
}

/* ── Mobile responsive ── */

@media (max-width: 820px) {
  .tool-grid,
  .country-rules-grid {
    grid-template-columns: 1fr;
  }

  .tool-hero {
    padding: 18px 16px 0;
  }

  .tool-hero h1 {
    font-size: 1.6rem;
  }

  .tool-grid {
    padding: 16px;
  }

  .section-head {
    padding: 12px 16px 4px;
  }

  .tool-form,
  .result-panel,
  .filter-wrap {
    margin: 0;
    padding: 14px;
  }

  .result-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .result-label {
    font-size: 0.76rem;
  }
}

@media (max-width: 480px) {
  .tool-grid {
    padding: 12px;
    gap: 10px;
  }

  .btn-row {
    flex-direction: column;
  }

  .btn-row .btn {
    justify-content: center;
  }

  .rules-table td {
    display: block;
    width: 100%;
    padding: 6px 12px;
  }

  .rules-table td:first-child {
    border-bottom: 0;
    padding-bottom: 0;
  }
}
