/* =============================================
   MOBILE RESPONSIVE — Terms of Service Page
   ============================================= */

/* ── Tablet: 900px–1024px ── */
@media (max-width: 1024px) {
  .tos-layout {
    grid-template-columns: 180px 1fr;
    gap: 2.5rem;
  }

  .page-title {
    font-size: 1.75rem;
  }

  .footer-container {
    width: 90%;
    gap: 2.5rem;
  }

  .footer-links {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Tablet: up to 900px ── */
@media (max-width: 900px) {
  .page-wrapper {
    padding: 2rem 1.5rem 4rem;
  }

  /* Header */
  .terms-header {
    gap: 14px;
    padding-bottom: 22px;
    margin-bottom: 28px;
  }

  .page-title {
    font-size: 1.6rem;
    margin-top: 10px;
  }

  /* TOC sidebar becomes a scrollable horizontal strip */
  .sidebar {
    position: static;
    margin-bottom: 2rem;
    padding: 1rem 1.2rem;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
  }

  .toc {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
  }

  .toc-link {
    font-size: 0.82rem;
    padding: 0.28rem 0;
  }

  .contents-label {
    margin-bottom: 12px;
  }

  /* Two-column layout collapses */
  .tos-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* Disclaimer box */
  .content-align {
    margin-left: 0;
  }

  .disclaimer-box {
    padding: 18px 18px;
  }

  .disclaimer-title {
    font-size: 16px;
  }

  /* Footer */
  .footer-container {
    grid-template-columns: 1fr;
    gap: 2rem;
    width: 90%;
    padding: 2.5rem 0 2rem;
  }

  .footer-links {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .footer-pill {
    flex-direction: column;
    gap: 1rem;
    border-radius: 16px;
    text-align: center;
    width: 90%;
  }
}

/* ── Mobile: up to 768px ── */
@media (max-width: 768px) {
  :root {
    font-size: 13px;
  }

  .page-wrapper {
    width: 92%;
    padding: 1.6rem 0 3.5rem;
  }

  /* Header */
  .terms-header {
    gap: 10px;
    padding-bottom: 18px;
    margin-bottom: 22px;
  }

  .page-title {
    font-size: 1.45rem;
    margin-top: 6px;
  }

  .page-date {
    font-size: 0.72rem;
  }

  /* Back button */
  .back-btn img {
    width: 22px;
    height: 22px;
  }

  /* Content */
  .welcome-heading {
    font-size: 1.3rem;
  }

  .intro-text {
    font-size: 0.85rem;
    margin-bottom: 2rem;
  }

  section {
    margin-bottom: 2.2rem;
    scroll-margin-top: 70px;
  }

  .section-heading {
    font-size: 0.98rem;
  }

  section p {
    font-size: 0.84rem;
  }

  /* Privacy list */
  .privacy-list {
    padding-left: 16px;
  }

  .privacy-list li {
    font-size: 0.84rem;
    margin-bottom: 10px;
  }

  /* Disclaimer box */
  .disclaimer-box {
    padding: 16px;
    border-radius: 10px;
  }

  .disclaimer-title {
    font-size: 15px;
  }

  .disclaimer-icon {
    width: 24px;
    height: 24px;
  }

  /* Check list */
  .check-list li {
    font-size: 0.82rem;
  }

  /* Footer */
  .footer-container {
    width: 92%;
    padding: 2rem 0 1.8rem;
  }

  .footer-pill {
    width: 92%;
    padding: 1rem 1.4rem;
  }

  .footer-pill p {
    font-size: 0.72rem;
  }

  .store-svg {
    width: 105px;
    height: 34px;
  }
}

/* ── Small Mobile: up to 520px ── */
@media (max-width: 520px) {
  .page-wrapper {
    width: 94%;
    padding: 1.2rem 0 3rem;
  }

  /* Header stacks vertically */
  .terms-header {
    flex-direction: column;
    gap: 6px;
    padding-bottom: 16px;
    margin-bottom: 18px;
  }

  .page-title-block {
    margin-top: 0;
  }

  .page-title {
    font-size: 1.25rem;
    margin-top: 0;
  }

  /* TOC links tighten */
  .toc {
    gap: 0.3rem 0.7rem;
  }

  .toc-link {
    font-size: 0.78rem;
  }

  /* Sections */
  .welcome-heading {
    font-size: 1.15rem;
  }

  .section-heading {
    font-size: 0.92rem;
    padding-bottom: 0.55rem;
  }

  /* Alert badge */
  .alert-badge {
    width: 18px;
    height: 18px;
  }

  /* Disclaimer */
  .disclaimer-box {
    padding: 14px;
  }

  .disclaimer-header {
    margin-bottom: 10px;
  }

  .disclaimer-title {
    font-size: 14px;
  }

  /* Contact email */
  .contact-email {
    font-size: 0.82rem;
    word-break: break-all;
  }

  /* Footer links single col on very small screens */
  .footer-links {
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
  }

  .footer-column h4 {
    font-size: 0.76rem;
  }

  .footer-column a {
    font-size: 0.74rem;
    margin-bottom: 0.5rem;
  }

  .footer-pill {
    width: 94%;
    border-radius: 12px;
    padding: 0.9rem 1rem;
  }

  .store-svg {
    width: 96px;
    height: 30px;
  }

  .footer-socials {
    gap: 0.5rem;
  }
}

/* ── Extra Small: up to 380px ── */
@media (max-width: 380px) {
  .page-title {
    font-size: 1.1rem;
  }

  .toc-link {
    font-size: 0.74rem;
  }

  .footer-links {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .disclaimer-title {
    font-size: 13px;
  }
}