/**
 * RageLand — Responsive layout
 * Breakpoints: 1100 / 960 / 768 / 480
 * Mobile-first overrides for shop, profile, admin, rules, legal.
 */

/* ── Base: never overflow the viewport ── */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  overflow-x: clip;
}

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

/* iOS: prevent zoom on focus */
@media (max-width: 767px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="url"],
  input[type="search"],
  input[type="tel"],
  select,
  textarea,
  .form-input-clean,
  .form-textarea-clean {
    font-size: 16px !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   ≤ 1100px — tablet landscape / small desktop
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .profile-page-grid {
    grid-template-columns: 1fr;
  }

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

/* ═══════════════════════════════════════════════════════════════
   ≤ 960px — tablet
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 960px) {
  .hero-copy {
    width: 100%;
    padding: 48px 20px;
  }

  .hero-copy h1 {
    font-size: clamp(1.75rem, 5vw, 2.4rem);
    line-height: 1.15;
  }

  .hero-visual {
    display: none;
  }

  .hero-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .catalog-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Categories → horizontal chips */
  .category-panel {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding: 10px;
    border-radius: 18px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .category-panel::-webkit-scrollbar {
    display: none;
  }

  .category-panel > div:first-child,
  .aside-help {
    display: none !important;
  }

  .category-button {
    flex: 0 0 auto;
    margin-bottom: 0;
    min-width: max-content;
    grid-template-columns: 28px auto auto;
    padding: 10px 14px;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .product-art {
    height: 160px;
  }

  /* Admin: sidebar → chips */
  .admin-layout {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  .admin-sidebar {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    gap: 8px;
    padding: 10px !important;
    border-radius: 18px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .admin-sidebar::-webkit-scrollbar {
    display: none;
  }

  .admin-sidebar > div:first-child {
    display: none !important;
  }

  .admin-sidebar .category-button {
    flex: 0 0 auto;
    margin-bottom: 0 !important;
    white-space: nowrap;
  }

  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .admin-content-panel {
    padding: 20px 16px !important;
    border-radius: 20px !important;
  }

  .admin-main {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  /* Rules page */
  .rp-layout {
    grid-template-columns: 1fr !important;
  }

  .rp-aside {
    position: static !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   ≤ 768px — phones (portrait + large phones)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* ── Header ── */
  .header-container {
    padding: 8px 10px 0;
  }

  .header-inner {
    height: 56px;
    padding: 0 10px 0 12px;
    border-radius: 18px;
    gap: 8px;
  }

  .logo-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    transform: none;
    animation: none;
  }

  .logo-mark span {
    font-size: 16px;
    transform: none;
  }

  .logo-mark::after {
    display: none;
  }

  .logo-text-brand {
    font-size: 14px;
  }

  .logo-text-sub,
  .nav-links-wrap,
  .ip-chip,
  .icon-circle {
    display: none !important;
  }

  .theme-switch {
    width: 64px;
    height: 36px;
  }

  .theme-switch::before {
    width: 28px;
    height: 28px;
  }

  [data-theme="dark"] .theme-switch::before {
    transform: translateX(28px);
  }

  .profile-trigger-btn {
    height: 36px;
    padding: 0 10px;
    font-size: 12px;
    border-radius: 12px;
  }

  .cart-trigger-btn {
    height: 36px;
    padding: 0 10px;
    font-size: 12px;
    border-radius: 12px;
    gap: 6px;
  }

  .cart-trigger-btn span:not(.cart-badge) {
    display: none;
  }

  .currency-dropdown-toggle {
    height: 36px;
    padding: 0 10px;
    font-size: 12px;
    border-radius: 12px;
  }

  .currency-dropdown-menu {
    right: 0;
    left: auto;
    min-width: 180px;
  }

  .header-right {
    gap: 6px;
  }

  /* Mobile nav strip (politone) */
  .mobile-nav {
    display: flex !important;
    gap: 6px;
    overflow-x: auto;
    padding: 10px 10px 0;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-nav::-webkit-scrollbar {
    display: none;
  }

  .mobile-nav a {
    flex: none;
    padding: 10px 14px;
    min-height: 40px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
  }

  .mobile-nav a.active {
    color: #fff;
    background: var(--pt-grad, linear-gradient(135deg, #1a9bb8, #54daf4));
    border-color: transparent;
  }

  /* ── Main / shop ── */
  .shop-main,
  main.shop-main {
    padding: 12px 12px 64px !important;
  }

  .hero-shell {
    border-radius: 22px;
    margin-bottom: 16px;
  }

  .hero-copy {
    padding: 28px 16px 24px;
  }

  .hero-copy h1 {
    font-size: clamp(1.5rem, 7.5vw, 1.9rem);
    margin-bottom: 12px;
  }

  .hero-copy > p {
    font-size: 0.92rem;
    line-height: 1.5;
  }

  .hero-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .hero-actions .primary-button,
  .hero-actions .secondary-button {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }

  .hero-stats {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .hero-stats div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
  }

  /* Products: single column on phone */
  .product-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .product-card {
    border-radius: 18px;
  }

  .product-card:hover {
    transform: none;
  }

  .product-art {
    height: 180px;
  }

  .product-card .buy-button,
  .primary-button,
  .secondary-button,
  .buy-button {
    min-height: 48px;
  }

  /* Cart — full screen sheet */
  .cart-drawer {
    max-width: 100% !important;
    width: 100% !important;
    border-left: none !important;
    border-radius: 0 !important;
  }

  .cart-header {
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top));
  }

  .cart-body {
    padding: 12px 16px;
  }

  .cart-footer {
    padding: 16px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  /* Modals — bottom sheet on phone */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
    place-items: end center;
  }

  .modal-card {
    width: 100%;
    max-width: 100%;
    max-height: min(92dvh, 100%);
    margin: 0;
    border-radius: 20px 20px 0 0;
    overflow-y: auto;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  .modal-close-btn {
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
  }

  /* Payment celebration */
  .payment-celebration-overlay {
    padding: 12px;
    align-items: flex-end;
  }

  .payment-celebration-card {
    width: 100%;
    max-width: 100%;
    border-radius: 20px;
    padding: 24px 18px;
  }

  .payment-actions-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .payment-actions-row .primary-button,
  .payment-actions-row .secondary-button {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }

  /* Checkout grids */
  .rage-summary-actions {
    grid-template-columns: 1fr;
  }

  /* Contact / help */
  .contact-grid {
    margin: 32px 0 12px;
    gap: 12px;
  }

  .help-block,
  .community-block {
    padding: 20px 16px;
    border-radius: 20px;
  }

  .community-cards {
    grid-template-columns: 1fr !important;
  }

  /* Footer */
  .site-footer {
    margin: 28px 8px 8px;
    padding: 28px 18px 20px;
    border-radius: 22px;
  }

  .sf-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* ── Profile ── */
  .profile-page-main {
    padding: 12px 12px 48px;
  }

  .profile-page-card {
    padding: 18px 14px;
    border-radius: 18px;
  }

  .profile-login-card {
    margin: 12px auto 0;
    max-width: 100%;
  }

  .profile-page-header-card {
    flex-direction: column;
    text-align: center;
    padding: 20px 16px;
    gap: 14px;
    border-radius: 20px;
  }

  .profile-skin-img,
  .profile-body-img {
    height: 120px;
  }

  .profile-header-top {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .profile-name-row {
    justify-content: center;
  }

  .profile-name-row h1 {
    font-size: 1.35rem;
  }

  .profile-logout-btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  .profile-stats-bar {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .profile-stat-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    padding: 14px 16px;
    border-radius: 14px;
  }

  .profile-stat-box strong {
    margin-bottom: 0;
    font-size: 1.1rem;
  }

  .profile-order-row {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
  }

  .profile-order-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .apply-role-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .apply-role-tab {
    min-width: 0;
  }

  .form-row-2 {
    grid-template-columns: 1fr;
  }

  /* ── Admin ── */
  .admin-body .header-container {
    margin-bottom: 14px;
    padding: 8px 8px 0;
  }

  .admin-body .header-inner {
    height: 52px;
    padding: 0 8px 0 10px;
    border-radius: 16px;
  }

  .admin-body .logo-text-sub {
    display: none;
  }

  .admin-body .profile-trigger-btn span,
  .admin-body .buy-button span {
    /* keep text if space, hide only if needed */
  }

  .admin-body .buy-button {
    padding: 8px 10px;
    font-size: 12px;
    min-height: 36px;
  }

  .admin-stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
  }

  .admin-stats > div {
    padding: 14px 12px;
    border-radius: 16px;
  }

  .admin-stats > div strong {
    font-size: 1.2rem !important;
  }

  .admin-content-panel {
    padding: 16px 12px !important;
    border-radius: 16px !important;
  }

  .admin-content-panel h2.section-title {
    font-size: 1.2rem !important;
  }

  /* Tables → card rows on phone */
  .admin-content-panel .table-scroll,
  .admin-content-panel div[style*="overflow"] {
    overflow: visible;
  }

  .admin-content-panel table {
    display: block;
    width: 100%;
  }

  .admin-content-panel thead {
    display: none;
  }

  .admin-content-panel tbody {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .admin-content-panel tr {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 12px;
    background: var(--bg-surface, var(--bg-page));
    border: 1px solid var(--bg-card-border);
    border-radius: 14px;
  }

  .admin-content-panel td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 4px 0 !important;
    border: none !important;
    font-size: 13px;
  }

  .admin-content-panel td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    flex-shrink: 0;
  }

  .admin-content-panel td:has(> form),
  .admin-content-panel td:has(> a.buy-button),
  .admin-content-panel td:has(> button) {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
  }

  /* Settings cards */
  .settings-section-card {
    padding: 16px 12px !important;
  }

  .settings-section-card [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  /* Rules / join / legal */
  .rp-wrap,
  .legal-wrap,
  .join-wrap {
    padding: 12px;
  }

  .rp-card,
  .legal-card {
    padding: 16px 14px;
    border-radius: 18px;
  }

  .rp-sec-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .rp-sec-meta {
    margin-left: 0;
    width: 100%;
    flex-wrap: wrap;
  }

  .rp-nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .rp-nav a {
    flex: none;
    white-space: nowrap;
    padding: 10px 12px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   ≤ 480px — small phones
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .header-inner {
    height: 52px;
    border-radius: 16px;
  }

  .logo-text-brand {
    font-size: 13px;
  }

  .profile-trigger-btn span {
    display: none;
  }

  .profile-trigger-btn {
    width: 36px;
    padding: 0;
    justify-content: center;
  }

  .hero-copy {
    padding: 22px 14px 20px;
  }

  .hero-copy h1 {
    font-size: 1.4rem;
  }

  .product-art {
    height: 150px;
  }

  .admin-stats {
    grid-template-columns: 1fr;
  }

  .admin-body .header-right {
    gap: 4px;
  }

  .admin-body .profile-trigger-btn span {
    display: none;
  }

  .mobile-nav a {
    padding: 8px 12px;
    font-size: 12.5px;
  }

  .apply-role-tabs {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════════
   Touch devices — kill hover lifts
   ═══════════════════════════════════════════════════════════════ */
@media (hover: none) and (pointer: coarse) {
  .product-card:hover,
  .ip-chip:hover,
  .icon-circle:hover,
  .community-card:hover,
  .help-block:hover,
  .logo-box:hover .logo-mark {
    transform: none !important;
  }

  .product-card:hover .product-custom-img {
    transform: none !important;
  }
}

/* Landscape phone: keep cart usable */
@media (max-width: 900px) and (orientation: landscape) {
  .cart-drawer {
    max-width: min(400px, 100%);
  }

  .modal-card {
    max-height: 88dvh;
    border-radius: 16px;
  }

  .modal-overlay {
    padding: 12px;
    align-items: center;
    place-items: center;
  }
}

/* Safe area for notched phones */
@supports (padding: env(safe-area-inset-bottom)) {
  @media (max-width: 768px) {
    body {
      padding-left: env(safe-area-inset-left);
      padding-right: env(safe-area-inset-right);
    }

    .cart-footer,
    .modal-card {
      padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
  }
}


/* ═══════════════════════════════════════════════════════════════
   HEADER + MOBILE NAV (final, overrides conflicts)
   ═══════════════════════════════════════════════════════════════ */
.hdr-desktop-only { }

@media (max-width: 768px) {
  .hdr-desktop-only {
    display: none !important;
  }

  .header-container {
    padding: 8px 10px 0;
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .header-inner {
    height: 54px;
    padding: 0 10px 0 12px;
    border-radius: 16px;
    gap: 8px;
  }

  .logo-mark {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    transform: none !important;
    animation: none !important;
  }

  .logo-mark span {
    font-size: 15px;
    transform: none !important;
  }

  .logo-mark::after {
    display: none !important;
  }

  .logo-text-brand {
    font-size: 13px;
  }

  .logo-text-sub {
    display: none !important;
  }

  .nav-links-wrap {
    display: none !important;
  }

  .header-right {
    gap: 6px;
    margin-left: auto;
  }

  .theme-switch {
    width: 58px;
    height: 34px;
    flex-shrink: 0;
  }

  .theme-switch::before {
    width: 26px;
    height: 26px;
  }

  [data-theme="dark"] .theme-switch::before {
    transform: translateX(24px);
  }

  .cart-trigger-btn {
    height: 34px;
    width: 34px;
    padding: 0;
    justify-content: center;
    border-radius: 11px;
  }

  .cart-trigger-label {
    display: none !important;
  }

  .cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
  }

  /* Mobile nav strip under header */
  .mobile-nav {
    display: flex !important;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    padding: 10px 2px 0;
    margin: 0;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-nav::-webkit-scrollbar {
    display: none;
  }

  .mobile-nav > a,
  .mobile-nav > button {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    border: 1px solid var(--bg-card-border);
    background: var(--bg-card);
    color: var(--text-muted);
    box-shadow: none;
  }

  .mobile-nav > a.active,
  .mobile-nav > a.mobile-nav-profile.active {
    color: #fff;
    background: var(--pt-grad, linear-gradient(135deg, #1a9bb8, #54daf4));
    border-color: transparent;
  }

  .mobile-nav-profile svg {
    flex-shrink: 0;
  }

  .mobile-currency-sheet {
    display: flex;
    gap: 6px;
    padding: 8px 2px 0;
    overflow-x: auto;
  }

  .mobile-currency-sheet[hidden] {
    display: none !important;
  }

  .mobile-currency-sheet .currency-dropdown-item {
    flex: 0 0 auto;
    min-height: 36px;
    border-radius: 999px;
    border: 1px solid var(--bg-card-border);
    background: var(--bg-card);
    width: auto;
  }
}

@media (min-width: 769px) {
  .mobile-nav,
  .mobile-currency-sheet {
    display: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   RULES PAGE (/rules) — full mobile layout
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 960px) {
  .rp-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
  }

  .rp-aside {
    position: static !important;
    width: 100% !important;
    max-width: none !important;
  }

  .rp-aside .rp-card {
    padding: 14px !important;
    border-radius: 18px !important;
  }

  .rp-search-side {
    display: none !important; /* big search in hero is enough on mobile */
  }

  .rp-nav-title {
    display: none !important;
  }

  .rp-nav {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 6px !important;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .rp-nav::-webkit-scrollbar {
    display: none;
  }

  .rp-nav a {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    padding: 10px 12px !important;
    border-radius: 14px !important;
    font-size: 13px !important;
  }

  .rp-nav a em {
    font-size: 12px !important;
  }

  .rp-help {
    display: none !important; /* contacts block exists below */
  }
}

@media (max-width: 768px) {
  .pt-wrap {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    box-sizing: border-box;
  }

  .rp-hero {
    padding: 20px 12px 8px !important;
  }

  .rp-ghost {
    font-size: clamp(28px, 12vw, 48px) !important;
    letter-spacing: -0.04em;
    opacity: 0.12;
  }

  .rp-title-wrap h1 {
    font-size: clamp(1.6rem, 7vw, 2rem) !important;
  }

  .rp-lead {
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
  }

  .rp-search {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 48px;
    padding: 10px 12px !important;
    border-radius: 16px !important;
  }

  .rp-kbd {
    display: none !important;
  }

  .rp-stats {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .rp-stat {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 12px 14px !important;
    border-radius: 14px !important;
  }

  .rp-row {
    grid-template-columns: 44px minmax(0, 1fr) !important;
    gap: 12px !important;
    padding: 16px 14px !important;
  }

  .rp-pills {
    grid-column: 1 / -1;
    align-items: flex-start !important;
    max-width: none !important;
    width: 100%;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    padding-top: 4px !important;
  }

  .rp-text {
    font-size: 15.5px !important;
    line-height: 1.45 !important;
  }

  .rp-note,
  .rp-callout,
  ul.rp-list {
    font-size: 14px !important;
    max-width: none !important;
  }

  .rp-sec-head {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    padding: 16px 14px 8px !important;
  }

  .rp-sec-head h2 {
    font-size: 1.35rem !important;
  }

  .rp-big {
    font-size: 48px !important;
    -webkit-text-stroke-width: 1.5px !important;
  }

  .rp-sec-meta {
    margin-left: 0 !important;
    width: 100%;
    justify-content: space-between;
  }

  .rp-panel {
    border-radius: 18px !important;
  }

  .rp-num {
    height: 34px !important;
    border-radius: 10px !important;
    font-size: 13px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   JOIN PAGE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .jn-hero {
    padding: 20px 12px 12px !important;
  }

  .jn-ghost {
    font-size: clamp(24px, 10vw, 40px) !important;
  }

  .jn-title h1 {
    font-size: clamp(1.5rem, 7vw, 1.9rem) !important;
  }

  .jn-tabs {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  .jn-tab {
    width: 100% !important;
    min-height: 52px;
  }

  .jn-steps,
  .jn-grid {
    grid-template-columns: 1fr !important;
  }

  .jn-field {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .jn-field .jn-copy {
    width: 100%;
    justify-content: center;
  }
}

/* ═══════════════════════════════════════════════════════════════
   LEGAL / OFFER / TERMS (inline-styled pages)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  body.doc-page main,
  .doc-page main {
    padding: 0 12px 48px !important;
  }

  body.doc-page main > div,
  .doc-page main > div {
    padding: 20px 14px !important;
    border-radius: 18px !important;
  }

  body.doc-page h1,
  .doc-page h1 {
    font-size: 1.35rem !important;
    line-height: 1.25 !important;
  }

  body.doc-page h2,
  .doc-page h2 {
    font-size: 1.1rem !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   HAMBURGER MENU
   ═══════════════════════════════════════════════════════════════ */
.mobile-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 1px solid var(--bg-card-border);
  border-radius: 12px;
  background: var(--bg-card);
  cursor: pointer;
  flex-shrink: 0;
}

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

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

.mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 10040;
  background: rgba(4, 15, 20, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.mobile-drawer-overlay[hidden] {
  display: none !important;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 10050;
  width: min(320px, 88vw);
  background: var(--bg-card);
  border-left: 1px solid var(--bg-card-border);
  box-shadow: -16px 0 40px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  padding: 0 0 env(safe-area-inset-bottom);
  transform: translateX(0);
  animation: mobileDrawerIn 0.22s ease;
}

.mobile-drawer[hidden] {
  display: none !important;
}

@keyframes mobileDrawerIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.mobile-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--bg-card-border);
  padding-top: max(16px, env(safe-area-inset-top));
}

.mobile-drawer-head strong {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

.mobile-drawer-close {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: var(--bg-surface, var(--bg-page));
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
}

.mobile-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  overflow-y: auto;
  flex: 1;
}

.mobile-drawer-nav > a,
.mobile-drawer-action {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  border: 1px solid transparent;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.mobile-drawer-nav > a:active,
.mobile-drawer-action:active {
  background: var(--bg-surface, var(--bg-page));
}

.mobile-drawer-nav > a.active {
  background: rgba(84, 218, 244, 0.12);
  border-color: rgba(84, 218, 244, 0.35);
  color: var(--cyan-dark, #0c8ba2);
}

.mobile-drawer-section {
  margin: 12px 4px 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.mobile-drawer-currency {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-drawer-currency .currency-dropdown-item {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
}

/* Hide old horizontal mobile-nav if any leftover */
.mobile-nav {
  display: none !important;
}

@media (max-width: 768px) {
  .mobile-burger {
    display: inline-flex;
  }
}

@media (min-width: 769px) {
  .mobile-burger,
  .mobile-drawer,
  .mobile-drawer-overlay {
    display: none !important;
  }
}

/* Admin: settings hints & stats tab cards */
.settings-hint {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-muted);
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-surface, var(--bg-page));
  border: 1px dashed var(--bg-card-border);
}

.settings-section-card {
  margin-bottom: 18px;
  padding: 18px 16px;
  border-radius: 18px;
  border: 1px solid var(--bg-card-border);
  background: var(--bg-surface, var(--bg-page));
}

.settings-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 15px;
  color: var(--text-main);
  margin-bottom: 4px;
}

.settings-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.settings-subnav a {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text-muted);
  border: 1px solid var(--bg-card-border);
  background: var(--bg-card);
}

.settings-subnav a:hover {
  border-color: rgba(84, 218, 244, 0.5);
  color: var(--text-main);
}

.admin-hint {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(84, 218, 244, 0.08);
  border: 1px solid rgba(84, 218, 244, 0.2);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.stats-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 16px;
  padding: 16px 14px;
}

.stats-card span {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stats-card strong {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.stats-table th,
.stats-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--bg-card-border);
}

.stats-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
