/* ══════════════════════════════════════════════════════════════════
   OPENHYGURU NATIVE MOBILE OVERHAUL (max-width: 820px)
   Engineered for iOS Safari, Android Chrome, and touch-first devices.
   Desktop layout is preserved 100% untouched.
   ══════════════════════════════════════════════════════════════════ */

@media (max-width: 820px) {

  /* ── 1. Page Shell & Global Mobile Ergonomics ─────────────────── */
  html, body {
    -webkit-tap-highlight-color: transparent;
  }

  .openhyguru-page {
    overflow-x: clip;
    padding-inline: clamp(1rem, 4vw, 1.25rem) !important;
    max-width: 100vw !important;
  }

  /* Universal Touch Target & Input Safety */
  button,
  a,
  summary,
  [role="button"],
  [role="tab"] {
    touch-action: manipulation;
  }

  /* ── 2. Hero Section ─────────────────────────────────────────── */
  .openhyguru-hero {
    padding-top: clamp(1.75rem, 5vw, 2.5rem) !important;
    padding-bottom: 1.75rem !important;
    text-align: center;
  }

  .openhyguru-eyebrow {
    font-size: 0.76rem !important;
    letter-spacing: 0.08em !important;
    margin-bottom: 0.5rem !important;
  }

  #openhyguru-hero-title {
    font-size: clamp(1.65rem, 6.8vw, 2.1rem) !important;
    line-height: 1.18 !important;
    letter-spacing: -0.025em !important;
    max-width: 100% !important;
    margin: 0 auto 0.85rem !important;
    word-break: break-word;
  }

  .openhyguru-hero-subhead {
    font-size: 0.95rem !important;
    line-height: 1.55 !important;
    max-width: 100% !important;
    margin: 0 auto 1.35rem !important;
    color: var(--text-secondary);
  }

  .openhyguru-step-toggle {
    width: 100% !important;
    max-width: 320px !important;
    margin: 0 auto 1.35rem !important;
    display: flex !important;
  }

  .openhyguru-step-toggle__btn {
    flex: 1 !important;
    min-height: 44px !important;
    font-size: 0.92rem !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Bundle Ribbon hidden on mobile per user request */
  .openhyguru-bundle-ribbon {
    display: none !important;
  }

  /* ── 3. Interactive Lead-in Flashcard Demo ───────────────────── */
  .openhyguru-demo-section {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  .openhyguru-section-header {
    margin-bottom: 1.75rem !important;
    text-align: center !important;
  }

  .openhyguru-section-header h2 {
    font-size: clamp(1.35rem, 5.2vw, 1.7rem) !important;
    line-height: 1.25 !important;
    letter-spacing: -0.02em !important;
  }

  .openhyguru-section-header p {
    font-size: 0.92rem !important;
    line-height: 1.5 !important;
  }

  .fc-demo-wrapper {
    padding: 0 !important;
    width: 100% !important;
  }

  .fc-demo-session-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
  }

  .fc-demo-session-container .card.card-study {
    padding: 1.15rem 1rem !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06) !important;
  }

  .show-answer-btn {
    width: 100% !important;
    min-height: 48px !important;
    font-size: 0.98rem !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .show-answer-btn .shortcut-kbd {
    display: none !important;
  }

  .rating-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .rating-btn {
    min-height: 46px !important;
    font-size: 0.86rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .vignette-content,
  .question-text,
  .answer-text {
    font-size: 0.94rem !important;
    line-height: 1.55 !important;
  }

  /* ── 4. The 3 Explanatory Step Pillars (Identify / Practice / Review) ── */
  /* Fixes Warped / Squished Text & Squeezed 2-Column Mockups */
  .openhyguru-pillar-section {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  .openhyguru-pillar-grid,
  .openhyguru-pillar-grid--reversed {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
    width: 100% !important;
    align-items: stretch !important;
    margin: 0 auto !important;
  }

  /* Force copy to always come first, visual second */
  .openhyguru-pillar-copy,
  .openhyguru-pillar-grid--reversed .openhyguru-pillar-copy {
    order: 1 !important;
    width: 100% !important;
    gap: 0.85rem !important;
    text-align: left !important;
  }

  .openhyguru-pillar-visual,
  .openhyguru-pillar-grid--reversed .openhyguru-pillar-visual {
    order: 2 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 0.25rem !important;
  }

  .pillar-step-badge {
    font-size: 0.72rem !important;
    padding: 0.3rem 0.75rem !important;
    margin-bottom: 0.2rem !important;
  }

  .openhyguru-pillar-title {
    font-size: clamp(1.4rem, 5.8vw, 1.85rem) !important;
    line-height: 1.2 !important;
    letter-spacing: -0.025em !important;
    margin: 0 !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }

  .openhyguru-pillar-lead {
    font-size: 0.95rem !important;
    line-height: 1.55 !important;
    margin: 0 !important;
    color: var(--text-secondary) !important;
  }

  .openhyguru-pillar-features {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
    padding: 0 !important;
    margin: 0.25rem 0 0 0 !important;
    list-style: none !important;
  }

  .openhyguru-pillar-features li {
    display: flex !important;
    gap: 0.75rem !important;
    align-items: flex-start !important;
    font-size: 0.88rem !important;
    line-height: 1.45 !important;
  }

  .feature-check-icon {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    border-radius: 5px !important;
    margin-top: 2px !important;
  }

  /* Mac window mockups: natural mobile frame */
  .mac-window-frame {
    width: 100% !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08) !important;
  }

  .mac-window-bar {
    display: none !important;
  }

  .mac-window-title {
    font-size: 0.72rem !important;
    max-width: calc(100% - 60px) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .window-floating-bar {
    padding: 6px 8px !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
  }

  .window-floating-bar .kbd-hint {
    font-size: 0.72rem !important;
  }

  .window-floating-bar .kbd-hint kbd {
    display: none !important;
  }

  /* Step 2 Video Wrap */
  .openhyguru-ext-video-wrap {
    width: 100% !important;
    aspect-ratio: 16 / 10;
  }

  /* Step 3 Demo Standalone Illness Script Card */
  .demo-library-card {
    max-width: 100% !important;
    width: 100% !important;
    padding: 1.25rem 1rem !important;
    border-radius: 14px !important;
  }

  .hyguru-bento-card__topic-body {
    font-size: 1.25rem !important;
    margin-bottom: 1rem !important;
  }

  .demo-card-click-hint {
    font-size: 0.74rem !important;
    padding: 3px 8px !important;
  }

  /* ── 5. Question Modal Dialogs on Mobile ──────────────────────── */
  .hyguru-question-modal .notion-style-modal {
    width: 95% !important;
    max-width: 95% !important;
    max-height: 88vh !important;
    padding: 1.25rem 1rem 2rem !important;
    border-radius: 16px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .hyguru-modal-topic-title {
    font-size: 1.35rem !important;
  }

  .leadin-vignette-box {
    padding: 0.95rem !important;
    border-radius: 10px !important;
  }

  .leadin-vignette-text {
    font-size: 0.88rem !important;
    line-height: 1.5 !important;
  }

  .leadin-card {
    padding: 0.85rem !important;
  }

  .leadin-question-text {
    font-size: 0.88rem !important;
  }

  .leadin-answer-summary {
    min-height: 36px !important;
    display: flex !important;
    align-items: center !important;
  }

  /* ── 6. The Flag-to-Fix Loop Cards ────────────────────────────── */
  .openhyguru-companion-section {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  .openhyguru-workflow-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.15rem !important;
    width: 100% !important;
  }

  .openhyguru-workflow-card {
    padding: 1.25rem 1.15rem !important;
    border-radius: 1rem !important;
  }

  /* ── 7. Overwhelming Elements Hidden on Mobile ────────────────── */
  /* Remove AnKing comparison widget on mobile as requested */
  #openhyguru-anki-comparison {
    display: none !important;
  }

  /* Remove Downloads column in footer on mobile per user request */
  .footer-links-col--downloads {
    display: none !important;
  }

  /* ── 8. Choose Your Plan (Pricing Section) ────────────────────── */
  #openhyguru-plans {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  .openhyguru-plans-grid:not(.openhyguru-plans-grid--focused) {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.25rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  @media (max-width: 680px) {
    .openhyguru-plans-grid.openhyguru-plans-grid--focused {
      display: flex !important;
      flex-direction: column !important;
      gap: 1.25rem !important;
      width: 100% !important;
      max-width: 100% !important;
    }
  }

  .openhyguru-plan-card {
    width: 100% !important;
    padding: 1.35rem 1.15rem !important;
    border-radius: 16px !important;
  }

  .openhyguru-plan-card .tier-card__header {
    margin-bottom: 0.75rem !important;
  }

  .openhyguru-plan-card .tier-card__price {
    font-size: 1.85rem !important;
  }

  .openhyguru-plan-card .btn {
    min-height: 48px !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* ── 9. FAQ Section ──────────────────────────────────────────── */
  #openhyguru-faq {
    padding-top: 1.75rem !important;
    padding-bottom: 2.25rem !important;
  }

  #openhyguru-faq details {
    padding: 0.95rem 1.1rem !important;
    border-radius: 10px !important;
  }

  #openhyguru-faq summary {
    font-size: 0.94rem !important;
    line-height: 1.4 !important;
    min-height: 34px !important;
    display: flex !important;
    align-items: center !important;
  }

  #openhyguru-faq p {
    font-size: 0.88rem !important;
    line-height: 1.55 !important;
  }

  /* ── 10. Sticky Hover Elimination for Mobile Devices ─────────── */
  @media (hover: none) {
    .openhyguru-workflow-card:hover,
    .demo-library-card:hover,
    .openhyguru-plan-card:hover {
      transform: none !important;
    }
  }
}
