/* ==========================================================================
   CANONICAL COPY (2026-07-21) — /css/vc-mobile.css is a shim that imports this
   file. See vc-sidebar.css in this directory for why the two paths diverged.
   The only thing the old root fork had that this file lacked was
   `@import url('/css/mobile-android.css')`, which is deliberately NOT merged —
   see the header of vc-sidebar.css in this directory. Otherwise identical.

   VitalCoach Mobile Polish (loaded last, overrides per-page styles)
   Applies to all VitalCoach pages: marketing + coach app + client portal.
   Designed for 390px (iPhone 12) primary target.
   ========================================================================== */

/* Universal: no horizontal overflow, smooth scrolling, decent rendering */
@media (max-width: 900px) {
  html, body {
    overflow-x: hidden !important;
    -webkit-text-size-adjust: 100% !important;
  }
  body {
    /* Allow content to scroll past fixed bottom-nav (70px tall in app shell) */
    min-height: 100dvh;
  }
  img, video, canvas, iframe { max-width: 100%; height: auto; }
}

/* ── Coach app: kill desktop sidebar offset on mobile ───────────────────── */
@media (max-width: 900px) {
  /* Force any hardcoded margin-left:232px (sidebar offset) to zero */
  body > main.main,
  body > .main,
  main.main,
  .main {
    margin-left: 0 !important;
    padding-left: 0 !important;
  }
}

/* ── Coach app: collapse side-by-side workspaces (form panel + output) ──── */
@media (max-width: 720px) {
  .workspace,
  .layout-wrap > .workspace,
  body > .workspace {
    grid-template-columns: 1fr !important;
    display: block !important;
  }
  .form-panel,
  .output-panel {
    width: 100% !important;
    min-height: auto !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 18px 16px !important;
  }
  .output-panel { border-bottom: none; }
}

/* ── Marketing: collapse multi-column hero / feature grids on phone ──────── */
@media (max-width: 720px) {
  .vc-stat-strip,
  .vc-pain-grid,
  .vc-feature-grid,
  .vc-pricing,
  .pricing-grid,
  .features-grid,
  .stats-grid,
  .quick-actions,
  .two-col,
  .compare-table,
  .clients-grid,
  .grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
}

/* Tighten 5-col stats grids step down at 480px to single column */
@media (max-width: 480px) {
  .stats-grid,
  .quick-actions,
  .vc-stat-strip {
    grid-template-columns: 1fr !important;
  }
}

/* ── Auth cards: signup, login, pricing tier cards ──────────────────────── */
@media (max-width: 480px) {
  .vc-auth-wrap,
  .auth-wrap {
    padding: 16px !important;
  }
  .vc-auth-card,
  .auth-card,
  .plan,
  .pricing-card,
  .vc-pricing-card {
    max-width: 100% !important;
    width: 100% !important;
    padding: 22px 18px !important;
    margin: 0 auto !important;
  }
}

/* ── Marketing nav: collapse top nav on small screens ───────────────────── */
@media (max-width: 720px) {
  .vc-nav-inner,
  .nav-inner {
    padding: 10px 14px !important;
  }
  .vc-nav-cta a:not(.vc-btn-primary),
  .nav-links {
    /* let mobile-nav.js drawer handle these */
  }
  .vc-nav-logo svg { width: 28px !important; height: 16px !important; }
  .vc-nav-logo span { font-size: 15px !important; }
}

/* ── Tap targets: ensure ≥44px on phone ─────────────────────────────────── */
@media (max-width: 720px) {
  a.btn, a.vc-btn, a.btn-sm, button, button.btn, .vc-btn-primary, .btn-primary, .btn-green,
  input[type="button"], input[type="submit"] {
    min-height: 44px;
  }
  .btn-sm, button.btn-sm, .vc-btn-sm { min-height: 40px; }
  /* Inputs: comfortable size, prevent iOS zoom (font-size >= 16px) */
  input[type="text"], input[type="email"], input[type="password"],
  input[type="tel"], input[type="number"], input[type="search"],
  input[type="date"], input[type="time"],
  textarea, select {
    font-size: 16px !important;
    min-height: 44px;
  }
  textarea { min-height: 80px; }
}

/* ── Tables that are too wide: enable graceful horizontal scroll ────────── */
@media (max-width: 720px) {
  .table-wrap, .table-scroll, .scroll-x {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table { min-width: unset !important; }
  /* Pricing comparison tables: collapse to stacked cards */
  .compare-table {
    display: block !important;
  }
  .compare-table thead { display: none; }
  .compare-table tbody, .compare-table tr, .compare-table td {
    display: block !important;
    width: 100% !important;
  }
  .compare-table tr {
    border-bottom: 1px solid rgba(15,23,42,0.08);
    padding: 10px 0;
  }
  .compare-table td:first-child {
    font-weight: 700;
    color: var(--vc-ink, #0F172A);
    padding-bottom: 4px !important;
  }
  .compare-table td { padding: 4px 0 !important; text-align: left !important; }
  .compare-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: rgba(15,23,42,0.6);
    margin-right: 8px;
  }
}

/* ── Hero sections: prevent blob/graphic overflow ───────────────────────── */
@media (max-width: 720px) {
  .vc-hero, .hero, section.hero {
    overflow: hidden !important;
    padding: 32px 18px !important;
  }
  .vc-hero h1, .hero h1, h1 {
    font-size: clamp(28px, 8vw, 38px) !important;
    line-height: 1.15 !important;
    letter-spacing: -0.02em !important;
  }
  .vc-hero h2, .hero h2, h2 {
    font-size: clamp(22px, 6vw, 30px) !important;
    line-height: 1.2 !important;
  }
  .vc-hero-sub, .hero-sub, .sub {
    font-size: 15px !important;
    line-height: 1.55 !important;
  }
  .hero-blob, .vc-hero-blob, .blob {
    transform: scale(0.7) !important;
    opacity: 0.5 !important;
  }
}

/* ── Section padding: tighten on phones ──────────────────────────────────── */
@media (max-width: 720px) {
  section, .section, .vc-section {
    padding: 36px 16px !important;
  }
  .container, .vc-container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}

/* ── Modals: never exceed viewport ───────────────────────────────────────── */
@media (max-width: 480px) {
  .modal, .vc-modal, .modal-content, [role="dialog"] > div {
    max-width: calc(100vw - 24px) !important;
    max-height: calc(100dvh - 32px) !important;
    overflow-y: auto;
  }
  .modal-overlay { padding: 12px !important; }
}

/* ── Footer: stack on mobile ─────────────────────────────────────────────── */
@media (max-width: 720px) {
  .vc-footer-inner, .footer-inner {
    flex-direction: column !important;
    gap: 14px !important;
    align-items: flex-start !important;
    padding: 24px 16px !important;
  }
}

/* ── Coach client cards: full-width single column on phone ──────────────── */
@media (max-width: 480px) {
  .clients-grid {
    grid-template-columns: 1fr !important;
  }
  .client-actions {
    gap: 6px !important;
  }
  .client-actions .btn {
    flex: 1 1 auto;
    min-width: calc(50% - 3px);
    justify-content: center;
  }
}

/* ── Messages page: messages take full width minus a bit ────────────────── */
@media (max-width: 720px) {
  .msg, .from-coach, .from-client {
    max-width: 85% !important;
  }
}

/* ── Dashboard panels stack ─────────────────────────────────────────────── */
@media (max-width: 720px) {
  .panel { padding: 14px !important; }
  .panel-header { padding: 12px 14px !important; }
  .list-item { padding: 10px 14px !important; gap: 10px !important; }
  .stat-card { padding: 14px !important; }
  .stat-val { font-size: 24px !important; }
}

/* ── Hide oversized decorative SVGs on mobile (keep brand intact) ───────── */
@media (max-width: 480px) {
  .decoration, .vc-decoration, [aria-hidden="true"].large-svg {
    display: none !important;
  }
}

/* ── Forms: better mobile layout ────────────────────────────────────────── */
@media (max-width: 480px) {
  .field-row, .form-row {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  label { font-size: 13px !important; }
  .field { margin-bottom: 14px !important; }
}

/* ── Sticky topbar on app pages: keep visible on mobile, but compact ────── */
@media (max-width: 480px) {
  .topbar {
    padding: 12px 16px !important;
  }
  .topbar-title { font-size: 14px !important; }
  .topbar-actions .btn { padding: 8px 12px !important; font-size: 12px !important; }
}
