/* CipherNode mobile upgrade layer
   Desktop styles are untouched. These rules only improve phone/tablet layouts. */

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

img,
video,
iframe,
table {
  max-width: 100%;
}

/* Hide mobile-only UI on desktop */
.cn-mobile-menu-btn,
.cn-mobile-menu-panel,
.cn-mobile-actionbar {
  display: none;
}

@media (max-width: 767px) {
  :root {
    --cn-bg: #0a0a0a;
    --cn-deep: #050505;
    --cn-card: #111113;
    --cn-border: #27272a;
    --cn-border-soft: #3f3f46;
    --cn-accent: #22d3ee;
    --cn-accent-bright: #00e5ff;
    --cn-text: #e5e5e5;
    --cn-muted: #a1a1aa;
  }

  body {
    width: 100%;
    padding-bottom: calc(76px + env(safe-area-inset-bottom)) !important;
    background: var(--cn-bg) !important;
  }

  body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
      radial-gradient(circle at 15% 5%, rgba(34, 211, 238, 0.12), transparent 28%),
      radial-gradient(circle at 90% 20%, rgba(37, 150, 190, 0.08), transparent 26%);
  }

  /* Top information bar */
  body > div:first-of-type {
    position: relative !important;
    z-index: 60 !important;
    font-size: 11px !important;
  }

  body > div:first-of-type > div {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 10px 16px !important;
    text-align: center !important;
  }

  body > div:first-of-type > div > div {
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 8px 12px !important;
  }

  body > div:first-of-type a {
    word-break: break-word !important;
  }

  body > div:first-of-type span[class*="rounded-full"] {
    padding: 4px 10px !important;
  }

  /* Navbar */
  body > nav {
    top: 0 !important;
    z-index: 90 !important;
    backdrop-filter: blur(14px);
    background: rgba(10, 10, 10, 0.94) !important;
  }

  body > nav > div {
    min-height: 70px !important;
    padding: 14px 16px !important;
    gap: 12px !important;
  }

  body > nav > div > a:first-child {
    font-size: 24px !important;
    letter-spacing: -0.05em !important;
    line-height: 1 !important;
  }

  /* Keep normal desktop nav hidden on mobile */
  body > nav [class~="hidden"][class~="md:flex"] {
    display: none !important;
  }

  /* Hide desktop login buttons on mobile; they are moved into menu/bottom bar */
  body > nav > div > div:last-child {
    display: none !important;
  }

  .cn-mobile-menu-btn {
    display: inline-flex !important;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(63, 63, 70, 0.85);
    border-radius: 14px;
    background: #111113;
    color: #e5e5e5;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    margin-left: auto;
  }

  .cn-mobile-menu-btn span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: #22d3ee;
    transition: 0.2s ease;
  }

  body.cn-menu-open .cn-mobile-menu-btn span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  body.cn-menu-open .cn-mobile-menu-btn span:nth-child(2) {
    opacity: 0;
  }

  body.cn-menu-open .cn-mobile-menu-btn span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .cn-mobile-menu-panel {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(0, 0, 0, 0.64);
    padding: 92px 14px 96px;
    backdrop-filter: blur(8px);
  }

  .cn-mobile-menu-panel.open {
    display: block;
  }

  .cn-mobile-menu-card {
    background:
      radial-gradient(circle at top right, rgba(34, 211, 238, 0.12), transparent 40%),
      #111113;
    border: 1px solid #27272a;
    border-radius: 22px;
    padding: 16px;
    box-shadow: 0 24px 90px rgba(0,0,0,.45);
  }

  .cn-mobile-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #ffffff;
    font-weight: 800;
    margin-bottom: 10px;
    padding: 4px 4px 10px;
    border-bottom: 1px solid #27272a;
  }

  .cn-mobile-menu-close {
    width: 38px;
    height: 38px;
    border: 1px solid #27272a;
    border-radius: 12px;
    background: #0a0a0a;
    color: #e5e5e5;
    font-size: 24px;
    line-height: 1;
  }

  .cn-mobile-menu-card > a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #e5e5e5;
    text-decoration: none;
    padding: 14px 12px;
    border-radius: 14px;
    font-weight: 700;
    border: 1px solid transparent;
  }

  .cn-mobile-menu-card > a i {
    color: #22d3ee;
    width: 20px;
    text-align: center;
  }

  .cn-mobile-menu-card > a:hover,
  .cn-mobile-menu-card > a:focus {
    background: #18181b;
    border-color: #27272a;
  }

  .cn-mobile-menu-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 14px;
  }

  .cn-mobile-menu-actions a {
    text-align: center;
    text-decoration: none;
    border-radius: 999px;
    padding: 13px 16px;
    font-weight: 800;
  }

  .cn-mobile-menu-actions a:first-child {
    background: #22d3ee;
    color: #0a0a0a;
  }

  .cn-mobile-menu-actions a:last-child {
    background: #0a0a0a;
    color: #e5e5e5;
    border: 1px solid #27272a;
  }

  .cn-mobile-actionbar {
    display: grid !important;
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 95;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 8px;
    border-radius: 22px;
    border: 1px solid rgba(63, 63, 70, 0.85);
    background: rgba(17, 17, 19, 0.92);
    backdrop-filter: blur(16px);
    box-shadow: 0 12px 40px rgba(0,0,0,.45);
  }

  .cn-mobile-actionbar a {
    color: #e5e5e5;
    text-decoration: none;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    border-radius: 16px;
  }

  .cn-mobile-actionbar a:first-child {
    background: #22d3ee;
    color: #0a0a0a;
  }

  .cn-mobile-actionbar a:not(:first-child) {
    background: #0a0a0a;
    border: 1px solid #27272a;
  }

  .cn-mobile-actionbar i {
    font-size: 15px;
  }

  /* Global mobile spacing */
  main {
    width: 100% !important;
  }

  section,
  main[class~="px-6"],
  section[class~="px-6"],
  [class~="px-6"] {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  section[class~="py-32"] {
    padding-top: 64px !important;
    padding-bottom: 64px !important;
  }

  section[class~="py-24"] {
    padding-top: 56px !important;
    padding-bottom: 56px !important;
  }

  section[class~="py-20"],
  main[class~="py-20"] {
    padding-top: 48px !important;
    padding-bottom: 48px !important;
  }

  section[class~="py-8"] {
    padding-top: 22px !important;
    padding-bottom: 22px !important;
  }

  [class~="p-12"],
  [class~="p-10"] {
    padding: 24px !important;
  }

  [class~="p-8"] {
    padding: 22px !important;
  }

  [class~="p-6"] {
    padding: 18px !important;
  }

  /* Type scaling */
  h1,
  [class~="text-5xl"],
  [class~="text-6xl"],
  [class~="md:text-6xl"] {
    font-size: clamp(32px, 10vw, 42px) !important;
    line-height: 1.1 !important;
    letter-spacing: -0.05em !important;
  }

  h2,
  [class~="text-4xl"] {
    font-size: clamp(26px, 8vw, 34px) !important;
    line-height: 1.16 !important;
    letter-spacing: -0.04em !important;
  }

  [class~="text-3xl"] {
    font-size: 26px !important;
  }

  [class~="text-2xl"] {
    font-size: 22px !important;
  }

  [class~="text-xl"] {
    font-size: 18px !important;
  }

  p {
    font-size: 15px !important;
    line-height: 1.7 !important;
  }

  p,
  li,
  span,
  a,
  button,
  select,
  input,
  textarea {
    overflow-wrap: anywhere;
  }

  h1 br,
  h2 br {
    display: none !important;
  }

  /* Hero improvements */
  main section:first-child {
    text-align: center !important;
  }

  main section:first-child img[class~="w-72"] {
    width: 132px !important;
    height: 132px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  main section:first-child p {
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  main section:first-child .flex {
    justify-content: center !important;
  }

  main section:first-child button,
  main section:first-child a {
    max-width: 100% !important;
  }

  /* CTA buttons and action rows */
  main a[class*="rounded"],
  main button[class*="rounded"] {
    min-height: 44px;
  }

  main section:first-child a[class*="px-8"],
  main section:first-child button[class*="px-8"] {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Cards */
  [class~="rounded-3xl"] {
    border-radius: 20px !important;
  }

  [class~="rounded-2xl"] {
    border-radius: 16px !important;
  }

  .shadow-2xl {
    box-shadow: none !important;
  }

  main [class~="grid"] {
    gap: 20px !important;
  }

  main [class~="max-w-7xl"],
  main [class~="max-w-6xl"],
  main [class~="max-w-5xl"],
  main [class~="max-w-4xl"] {
    max-width: 100% !important;
  }

  /* Hardware/spec rows and similar detail rows */
  main [class~="justify-between"][class~="border-b"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
  }

  main [class~="justify-between"][class~="border-b"] span:last-child {
    text-align: left !important;
  }



  .cn-contact-methods {
    grid-template-columns: 1fr !important;
  }

  .cn-contact-card,
  .cn-contact-card a,
  .cn-contact-card p,
  .cn-footer-card,
  .cn-footer-card a,
  .cn-footer-card p {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  /* Pricing calculator */
  #calculator [class~="p-10"] {
    padding: 22px !important;
  }

  #calculator select {
    width: 100% !important;
    min-width: 0 !important;
  }

  #priceDisplay {
    font-size: 36px !important;
    line-height: 1.15 !important;
  }

  #ramDisplay {
    font-size: 18px !important;
  }

  #monthlyBtn,
  #annuallyBtn {
    flex: 1 1 130px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    font-size: 13px !important;
  }

  /* Panel preview tabs */
  .tab-btn {
    flex: 1 1 42% !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    font-size: 13px !important;
  }

  #panel-img {
    border-radius: 10px !important;
  }

  /* FAQ */
  button[onclick^="toggleFAQ"] {
    gap: 16px !important;
    align-items: flex-start !important;
  }

  /* Forms */
  form input,
  form textarea,
  form select,
  form button {
    width: 100% !important;
  }

  form [class~="grid"] {
    grid-template-columns: 1fr !important;
  }

  /* Legal pages */
  .legal-content,
  main section.bg-\[\#111113\] {
    overflow-wrap: anywhere !important;
  }

  /* Footer */
  footer {
    padding-top: 48px !important;
    padding-bottom: 96px !important;
  }

  footer [class~="grid"] {
    gap: 32px !important;
  }

  footer .flex.items-center.gap-3 {
    align-items: center !important;
  }

  footer img[class~="w-14"] {
    width: 48px !important;
    height: 48px !important;
  }

  footer a {
    padding-top: 4px;
    padding-bottom: 4px;
  }
}

@media (max-width: 480px) {
  .container {
    width: min(100% - 28px, 1180px);
  }

  [class~="p-12"],
  [class~="p-10"],
  [class~="p-8"] {
    padding: 20px !important;
  }

  [class~="gap-10"] {
    gap: 24px !important;
  }

  [class~="gap-8"] {
    gap: 20px !important;
  }

  [class~="mb-16"] {
    margin-bottom: 36px !important;
  }

  [class~="mb-12"] {
    margin-bottom: 30px !important;
  }

  [class~="mt-16"] {
    margin-top: 38px !important;
  }

  main section:first-child img[class~="w-72"] {
    width: 118px !important;
    height: 118px !important;
  }

  .cn-mobile-menu-panel {
    padding-left: 10px;
    padding-right: 10px;
  }
}


/* v5 fix: prevent the desktop/top nav from getting stuck after mobile sidebar use */
@media (max-width: 767px) {
  body > nav {
    position: relative !important;
    top: auto !important;
  }

  body.cn-menu-open {
    overflow: hidden !important;
  }

  body.cn-menu-open > nav {
    position: sticky !important;
    top: 0 !important;
  }

  .cn-mobile-menu-panel {
    z-index: 1000 !important;
  }

  .cn-mobile-actionbar {
    z-index: 1001 !important;
  }
}

@media (min-width: 768px) {
  body.cn-menu-open {
    overflow: auto !important;
  }

  .cn-mobile-menu-panel,
  .cn-mobile-menu-panel.open {
    display: none !important;
  }
}

/* v6: stronger phone/tablet browsing polish */
@media (max-width: 767px) {
  html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
  }

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

  body {
    min-width: 0 !important;
    touch-action: manipulation;
  }

  /* Make the contact / country bar stack instead of squeezing on phones. */
  body > div:nth-of-type(2) {
    font-size: 12px !important;
    position: relative !important;
    z-index: 55 !important;
  }

  body > div:nth-of-type(2) > div {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    padding: 10px 16px !important;
    text-align: center !important;
  }

  body > div:nth-of-type(2) > div > div {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px 12px !important;
  }

  body > div:nth-of-type(2) a {
    word-break: break-word !important;
  }

  /* Keep navigation reachable while scrolling. */
  body > nav {
    position: sticky !important;
    top: 0 !important;
    z-index: 950 !important;
  }

  body > nav > div {
    min-height: 64px !important;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
  }

  body > nav > div > a:first-child {
    font-size: clamp(22px, 7vw, 28px) !important;
    max-width: calc(100% - 58px) !important;
  }

  body.cn-menu-open {
    overflow: hidden !important;
  }

  .cn-mobile-menu-panel {
    inset: 0 !important;
    z-index: 1200 !important;
    padding: 86px 12px calc(92px + env(safe-area-inset-bottom)) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
  }

  .cn-mobile-menu-card {
    max-height: calc(100dvh - 112px) !important;
    overflow-y: auto !important;
  }

  .cn-mobile-menu-actions {
    position: sticky;
    bottom: 0;
    padding-top: 10px;
    background: linear-gradient(180deg, rgba(17,17,19,0), rgba(17,17,19,.98) 28%);
  }

  .cn-mobile-actionbar {
    z-index: 1150 !important;
    left: 8px !important;
    right: 8px !important;
    gap: 7px !important;
  }

  .cn-mobile-actionbar a {
    min-width: 0 !important;
  }

  [id] {
    scroll-margin-top: 88px;
  }

  main,
  section,
  .grid,
  .grid > *,
  .flex,
  .flex > * {
    min-width: 0 !important;
  }

  .cn-launch-hero {
    padding-top: 54px !important;
    padding-bottom: 60px !important;
  }

  #particles-js {
    display: none !important;
  }

  .cn-hero-kicker {
    font-size: 10.5px !important;
    padding: 8px 12px !important;
    max-width: 100% !important;
  }

  .cn-hero-chips {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
  }

  .cn-chip {
    justify-content: center !important;
    text-align: center !important;
    white-space: normal !important;
  }

  .cn-launcher-card {
    margin-top: 22px !important;
    border-radius: 22px !important;
  }

  .cn-launcher-top,
  .cn-launcher-body {
    padding: 18px !important;
  }

  .cn-launcher-top {
    align-items: flex-start !important;
  }

  .cn-window-dots {
    margin-top: 4px !important;
  }

  .cn-world-row {
    padding: 14px !important;
    gap: 12px !important;
  }

  .cn-console {
    font-size: 12px !important;
    line-height: 1.7 !important;
    max-height: 170px !important;
    overflow: auto !important;
  }

  .cn-world-card,
  .cn-mc-feature-card,
  .cn-stack-board,
  .cn-page-card,
  .cn-footer-card,
  .cn-games-theme [class*="bg-[#111113]"][class*="border"],
  .cn-games-theme [class*="bg-[#111]"][class*="border"] {
    padding: 20px !important;
  }

  .cn-stack-pills,
  .cn-footer-biomes,
  .cn-hero-chips {
    gap: 8px !important;
  }

  /* Calculator: make controls and purchase CTA thumb-friendly. */
  #calculator {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  #calculator .grid {
    grid-template-columns: 1fr !important;
  }

  #calculator label {
    display: block !important;
  }

  #calculator input[type="range"] {
    min-height: 34px !important;
    touch-action: pan-y !important;
  }

  #calculator select,
  #calculator button,
  #calculator a {
    min-height: 46px !important;
  }

  #purchaseBtn {
    width: 100% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
  }

  #purchaseSummary {
    display: block !important;
    line-height: 1.5 !important;
  }

  /* Network map: stack header, map, and cards cleanly. */
  #network {
    padding-top: 54px !important;
    padding-bottom: 54px !important;
  }

  #network .grid {
    grid-template-columns: 1fr !important;
  }

  #network .flex.items-center.justify-between {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  #network .flex.items-center.justify-between > div {
    width: 100% !important;
  }

  #refreshPingBtn {
    width: 100% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 46px !important;
  }

  #networkMap {
    height: 305px !important;
    min-height: 305px !important;
  }

  .cn-map-wrap {
    border-radius: 20px !important;
  }

  .cn-osm-credit {
    left: 8px !important;
    bottom: 8px !important;
    max-width: calc(100% - 86px) !important;
    padding: 5px 8px !important;
    font-size: 9.5px !important;
  }

  .leaflet-control-zoom a {
    width: 34px !important;
    height: 34px !important;
    line-height: 34px !important;
  }

  #networkCards {
    gap: 12px !important;
  }

  #networkCards .cn-ping-card {
    padding: 16px !important;
  }

  #networkCards .cn-ping-card > div {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    margin-bottom: 0 !important;
  }

  #networkCards .text-right {
    text-align: left !important;
  }

  #networkCards .text-2xl {
    font-size: 22px !important;
  }

  #bestLocationBanner {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  /* Gallery/modal keeps images one per row on phones. */
  #imageGallery.modal-active {
    align-items: flex-start !important;
    overflow-y: auto !important;
    padding: 18px !important;
  }

  #imageGallery .max-w-5xl {
    margin-top: 48px !important;
  }

  #imageGallery button {
    top: -42px !important;
    right: 4px !important;
  }

  #imageGallery .grid {
    grid-template-columns: 1fr !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
  }

  /* Footer is easier to scan on phones. */
  footer .footer-grid,
  footer [class~="grid"] {
    grid-template-columns: 1fr !important;
  }

  footer .cn-footer-bottom {
    gap: 10px !important;
  }

  footer .flex.flex-wrap.gap-4,
  footer .flex.flex-wrap {
    gap: 10px 16px !important;
  }
}

@media (max-width: 390px) {
  body {
    padding-bottom: calc(86px + env(safe-area-inset-bottom)) !important;
  }

  .cn-mobile-actionbar {
    left: 6px !important;
    right: 6px !important;
    padding: 7px !important;
  }

  .cn-mobile-actionbar a {
    font-size: 10px !important;
    min-height: 50px !important;
  }

  .cn-hero-chips {
    grid-template-columns: 1fr !important;
  }

  #networkMap {
    height: 285px !important;
    min-height: 285px !important;
  }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* v8: full mobile compatibility / organization pass
   Keeps the existing desktop design but makes every major section stack cleanly on phones. */
@media (max-width: 1023px) {
  html,
  body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

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

  body.cn-games-theme::before {
    opacity: .45;
  }

  body.cn-games-theme::after {
    opacity: .22;
    height: 110px;
  }

  main,
  header,
  section,
  footer,
  nav,
  .grid,
  .flex,
  [class*="max-w-"] {
    min-width: 0 !important;
  }

  main [class*="max-w-"],
  footer [class*="max-w-"] {
    width: 100% !important;
  }

  /* Tablet layouts should collapse before they become squeezed. */
  .cn-launch-hero .grid,
  .cn-stack-board .grid,
  #network .grid,
  .footer-grid,
  footer [class~="grid"] {
    grid-template-columns: 1fr !important;
  }

  .cn-launch-hero .grid,
  .cn-stack-board .grid,
  #network .grid {
    gap: 28px !important;
  }

  .cn-launcher-card,
  .cn-world-card,
  .cn-mc-feature-card,
  .cn-stack-board,
  .cn-page-card,
  .cn-footer-card,
  .cn-contact-card,
  .cn-mc-panel,
  .cn-ping-card,
  form {
    max-width: 100% !important;
  }

  img,
  svg,
  canvas,
  iframe,
  video {
    max-width: 100% !important;
    height: auto;
  }
}

@media (max-width: 767px) {
  :root {
    --cn-mobile-pad: 14px;
    --cn-mobile-radius: 18px;
  }

  html {
    scroll-padding-top: 76px;
  }

  body {
    line-height: 1.55 !important;
    padding-bottom: calc(86px + env(safe-area-inset-bottom)) !important;
  }

  /* Keep the sale bar useful, but make it compact. */
  body > div:first-of-type {
    border-bottom-color: rgba(34, 211, 238, .18) !important;
  }

  body > div:first-of-type > div {
    padding: 9px var(--cn-mobile-pad) !important;
    gap: 6px !important;
    font-size: 11.5px !important;
    line-height: 1.35 !important;
  }

  body > div:first-of-type span,
  body > div:first-of-type a {
    max-width: 100% !important;
  }

  body > div:first-of-type a {
    padding: 6px 12px !important;
    min-height: 34px !important;
  }

  /* The country/email strip made phones feel crowded. The bottom bar + menu keep the important links reachable. */
  body > div:nth-of-type(2) {
    display: none !important;
  }

  body > nav {
    position: sticky !important;
    top: 0 !important;
    z-index: 980 !important;
    border-bottom-color: rgba(63, 63, 70, .75) !important;
  }

  body > nav > div {
    min-height: 62px !important;
    padding: 10px var(--cn-mobile-pad) !important;
  }

  body > nav > div > a:first-child {
    font-size: clamp(22px, 7vw, 27px) !important;
    max-width: calc(100vw - 82px) !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
  }

  body > nav [class~="hidden"][class~="md:flex"],
  body > nav > div > div:last-child {
    display: none !important;
  }

  .cn-mobile-menu-btn {
    width: 44px !important;
    height: 44px !important;
    flex: 0 0 44px !important;
  }

  .cn-mobile-menu-panel {
    padding: 76px 10px calc(96px + env(safe-area-inset-bottom)) !important;
    background: rgba(0,0,0,.72) !important;
  }

  .cn-mobile-menu-card {
    width: min(100%, 420px) !important;
    margin: 0 auto !important;
    border-radius: 20px !important;
    padding: 14px !important;
  }

  .cn-mobile-menu-card > a {
    min-height: 46px !important;
    padding: 12px !important;
  }

  .cn-mobile-actionbar {
    left: 8px !important;
    right: 8px !important;
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    border-radius: 20px !important;
    padding: 7px !important;
    gap: 7px !important;
  }

  .cn-mobile-actionbar a {
    min-height: 50px !important;
    border-radius: 15px !important;
    font-size: 10.5px !important;
    line-height: 1.15 !important;
    overflow: hidden !important;
  }

  /* Universal phone spacing. */
  main {
    width: 100% !important;
    overflow-x: hidden !important;
  }

  main[class~="py-20"],
  main[class~="py-24"] {
    padding-top: 38px !important;
    padding-bottom: 44px !important;
  }

  main[class~="px-6"],
  section[class~="px-6"],
  section,
  footer > div,
  [class~="px-6"] {
    padding-left: var(--cn-mobile-pad) !important;
    padding-right: var(--cn-mobile-pad) !important;
  }

  section[class~="py-28"],
  section[class~="py-32"],
  section[class~="py-24"],
  section[class~="py-20"] {
    padding-top: 48px !important;
    padding-bottom: 48px !important;
  }

  .cn-launch-hero {
    padding-top: 42px !important;
    padding-bottom: 44px !important;
  }

  .cn-launch-hero > div,
  main > section > div,
  main > div,
  footer > div {
    max-width: 100% !important;
  }

  /* Typography: prevent giant headings and awkward line breaks. */
  h1,
  [class~="text-5xl"],
  [class~="text-6xl"],
  [class~="md:text-6xl"] {
    font-size: clamp(30px, 9vw, 39px) !important;
    line-height: 1.08 !important;
    letter-spacing: -0.045em !important;
  }

  h2,
  [class~="text-4xl"],
  [class~="md:text-5xl"] {
    font-size: clamp(24px, 7.3vw, 32px) !important;
    line-height: 1.13 !important;
    letter-spacing: -0.035em !important;
  }

  [class~="text-3xl"] {
    font-size: 23px !important;
    line-height: 1.18 !important;
  }

  [class~="text-2xl"] {
    font-size: 20px !important;
    line-height: 1.25 !important;
  }

  [class~="text-xl"] {
    font-size: 17px !important;
  }

  p,
  li,
  label,
  input,
  textarea,
  select,
  button,
  a,
  span,
  strong {
    overflow-wrap: anywhere !important;
  }

  p {
    font-size: 14.5px !important;
    line-height: 1.65 !important;
  }

  h1 br,
  h2 br,
  h3 br {
    display: none !important;
  }

  /* Grid/flex organization. */
  main .grid,
  form .grid,
  .footer-grid,
  .cn-contact-methods {
    grid-template-columns: 1fr !important;
  }

  main .flex:not(.cn-mobile-actionbar):not(.cn-mobile-menu-card):not(.cn-window-dots),
  footer .flex {
    min-width: 0 !important;
    flex-wrap: wrap !important;
  }

  main [class~="justify-between"] {
    gap: 12px !important;
  }

  .items-center.justify-between,
  .flex.items-center.justify-between {
    align-items: flex-start !important;
  }

  /* Cards are easier to scan as compact blocks on phones. */
  [class~="rounded-3xl"],
  .cn-launcher-card,
  .cn-world-card,
  .cn-stack-board,
  .cn-footer-card,
  .cn-contact-card,
  .cn-page-card,
  .cn-ping-card,
  form {
    border-radius: var(--cn-mobile-radius) !important;
  }

  [class~="p-12"],
  [class~="p-10"],
  [class~="p-8"],
  .cn-launcher-top,
  .cn-launcher-body,
  .cn-world-card,
  .cn-mc-feature-card,
  .cn-stack-board,
  .cn-footer-card,
  .cn-contact-card,
  .cn-page-card,
  .cn-ping-card,
  form {
    padding: 18px !important;
  }

  [class~="p-6"],
  [class~="p-5"] {
    padding: 16px !important;
  }

  [class~="gap-12"],
  [class~="gap-10"] {
    gap: 24px !important;
  }

  [class~="gap-8"],
  [class~="gap-7"],
  [class~="gap-6"] {
    gap: 16px !important;
  }

  [class~="mb-16"] { margin-bottom: 34px !important; }
  [class~="mb-12"] { margin-bottom: 28px !important; }
  [class~="mb-10"] { margin-bottom: 22px !important; }
  [class~="mt-16"] { margin-top: 32px !important; }
  [class~="mt-12"] { margin-top: 26px !important; }

  /* Home hero. */
  .cn-launch-hero .grid {
    grid-template-columns: 1fr !important;
    text-align: center !important;
  }

  .cn-hero-kicker {
    margin-left: auto !important;
    margin-right: auto !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: normal !important;
  }

  .cn-hero-chips {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .cn-chip {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 9px 8px !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
    text-align: center !important;
    min-height: 42px !important;
  }

  .cn-primary-btn,
  .cn-secondary-btn,
  main section:first-child a[class*="px-8"],
  main section:first-child button[class*="px-8"] {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 48px !important;
    justify-content: center !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .cn-launcher-card {
    margin-top: 8px !important;
  }

  .cn-launcher-top,
  .cn-world-row {
    text-align: left !important;
  }

  .cn-world-row {
    display: grid !important;
    grid-template-columns: auto 1fr !important;
    align-items: center !important;
    padding: 13px !important;
  }

  .cn-world-icon,
  .cn-cube-badge {
    width: 44px !important;
    height: 44px !important;
    flex: 0 0 44px !important;
  }

  .cn-console {
    display: none !important;
  }

  .cn-stack-board {
    text-align: center !important;
  }

  .cn-stack-pills {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  .cn-footer-biomes {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .cn-stack-pill,
  .cn-footer-pill {
    justify-content: center !important;
    width: 100% !important;
    white-space: normal !important;
    text-align: center !important;
    border-radius: 14px !important;
  }

  /* Calculator. */
  #calculator {
    padding-top: 42px !important;
    padding-bottom: 46px !important;
  }

  #calculator .cn-calc-panel {
    padding: 16px !important;
  }

  #calculator .grid,
  .cn-calc-main-grid {
    grid-template-columns: 1fr !important;
  }

  #calculator .flex.flex-wrap {
    align-items: stretch !important;
  }

  #calculator select,
  #calculator input,
  #calculator button,
  #calculator a,
  form input,
  form textarea,
  form select,
  form button {
    min-height: 46px !important;
    font-size: 16px !important;
    width: 100% !important;
  }

  #priceDisplay {
    font-size: clamp(32px, 11vw, 42px) !important;
  }

  #monthlyBtn,
  #annuallyBtn {
    flex: 1 1 calc(50% - 8px) !important;
  }

  .cn-spec-description {
    display: block !important;
    margin-bottom: 12px !important;
  }

  .cn-spec-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .cn-spec-pill {
    min-height: 58px !important;
    padding: 9px !important;
    border-radius: 13px !important;
  }

  .cn-spec-label {
    font-size: 9.5px !important;
  }

  .cn-spec-value {
    font-size: 11.5px !important;
    line-height: 1.25 !important;
  }

  #purchaseSummary {
    max-width: 100% !important;
  }

  #purchaseBtn {
    width: 100% !important;
    min-height: 50px !important;
  }

  /* Network map. */
  #network .flex.items-center.justify-between,
  #network .flex.flex-wrap.items-center.justify-between {
    flex-direction: column !important;
    align-items: stretch !important;
    text-align: left !important;
  }

  #refreshPingBtn {
    width: 100% !important;
    justify-content: center !important;
    min-height: 46px !important;
  }

  #networkMap {
    height: 300px !important;
    min-height: 300px !important;
  }

  #networkCards,
  #networkCards .grid {
    grid-template-columns: 1fr !important;
  }

  #networkCards .cn-ping-card > div,
  #bestLocationBanner > div {
    flex-direction: row !important;
    align-items: center !important;
  }

  #networkCards .text-right {
    text-align: left !important;
  }

  .cn-osm-credit {
    max-width: calc(100% - 78px) !important;
    white-space: normal !important;
    line-height: 1.25 !important;
  }

  /* Panel screenshots and tabs. */
  .tab-btn {
    flex: 1 1 calc(50% - 6px) !important;
    min-width: 0 !important;
    min-height: 42px !important;
    padding: 9px 10px !important;
    font-size: 12px !important;
  }

  #panel-img {
    border-radius: 12px !important;
  }

  /* FAQ/legal pages/forms. */
  button[onclick^="toggleFAQ"] {
    align-items: flex-start !important;
    gap: 12px !important;
    padding: 16px !important;
  }

  button[onclick^="toggleFAQ"] span {
    flex: 1 1 auto !important;
  }

  button[onclick^="toggleFAQ"] i {
    flex: 0 0 auto !important;
    margin-top: 3px !important;
  }

  .legal-content,
  article,
  main section.bg-\[\#111113\],
  main section[class*="bg-[#111113]"],
  main section[class*="bg-[#111]"] {
    overflow-wrap: anywhere !important;
  }

  table {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  form {
    space: initial;
  }

  form textarea {
    min-height: 150px !important;
  }

  .cn-contact-card {
    min-height: 0 !important;
  }

  .cn-contact-card a,
  .cn-contact-card p,
  .cn-footer-card a,
  .cn-footer-card p {
    display: block !important;
    max-width: 100% !important;
    white-space: normal !important;
  }

  /* Footer. */
  footer {
    padding-bottom: calc(112px + env(safe-area-inset-bottom)) !important;
  }

  footer .footer-grid {
    gap: 14px !important;
  }

  footer .cn-footer-card .flex.items-center.gap-4,
  footer .cn-footer-card .flex.items-center.gap-3 {
    flex-wrap: nowrap !important;
  }

  footer .w-20,
  footer [class~="w-20"] {
    width: 58px !important;
    height: 58px !important;
    flex: 0 0 58px !important;
  }

  footer img[class~="w-14"] {
    width: 42px !important;
    height: 42px !important;
  }

  .cn-footer-bottom {
    flex-direction: column !important;
    align-items: flex-start !important;
    text-align: left !important;
    gap: 12px !important;
  }
}

@media (max-width: 430px) {
  :root {
    --cn-mobile-pad: 12px;
  }

  body {
    padding-bottom: calc(84px + env(safe-area-inset-bottom)) !important;
  }

  body > div:first-of-type > div {
    font-size: 11px !important;
  }

  body > div:first-of-type span.text-zinc-200 {
    display: block !important;
    width: 100% !important;
  }

  .cn-hero-chips,
  .cn-stack-pills,
  .cn-spec-grid {
    grid-template-columns: 1fr !important;
  }

  .cn-launcher-card {
    display: block !important;
  }

  .cn-world-row {
    grid-template-columns: 38px 1fr !important;
  }

  .cn-world-icon,
  .cn-cube-badge {
    width: 38px !important;
    height: 38px !important;
    flex-basis: 38px !important;
  }

  #networkMap {
    height: 270px !important;
    min-height: 270px !important;
  }

  .tab-btn {
    flex-basis: 100% !important;
  }
}

@media (max-width: 360px) {
  h1,
  [class~="text-5xl"],
  [class~="text-6xl"],
  [class~="md:text-6xl"] {
    font-size: 28px !important;
  }

  h2,
  [class~="text-4xl"],
  [class~="md:text-5xl"] {
    font-size: 23px !important;
  }

  .cn-mobile-actionbar a span {
    font-size: 9.5px !important;
  }

  .cn-mobile-actionbar i {
    font-size: 14px !important;
  }

  .cn-discord-hero-btn,
  .cn-discord-footer-btn {
    width: 100%;
    min-height: 44px;
  }

  .cn-discord-world-row {
    grid-template-columns: auto 1fr auto !important;
    text-align: left !important;
  }

}
