/* Shared mobile fit and touch-target fixes for public, account, teacher and panel views. */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

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

main,
section,
article,
aside,
form,
.page,
.main,
.panel-main,
.account-content,
.surface,
.card {
  min-width: 0;
}

input,
select,
textarea,
button {
  max-width: 100%;
}

.table-wrap,
.table-scroller,
.table-responsive,
.admin-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 1024px) {
  .student-auth,
  .course-detail-wrap,
  .course-detail-layout,
  .course-layout,
  .two-col,
  .checkout-grid,
  .teacher-onboarding-grid,
  .teacher-payout-layout,
  .teacher-admin-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .sticky,
  .course-purchase,
  .checkout-summary {
    position: static;
    top: auto;
  }

  .course-purchase {
    width: 100%;
  }
}

@media (max-width: 768px) {
  body {
    min-width: 320px;
  }

  .shell {
    display: block;
    min-height: 0;
  }

  .main {
    width: 100%;
    padding: 16px 14px calc(92px + env(safe-area-inset-bottom, 0px));
  }

  .page,
  .catalog-main,
  .teacher-page,
  .checkout-main {
    width: 100%;
    max-width: 100%;
  }

  .page-head,
  .section-head,
  .surface-heading {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .page-head h1,
  .catalog-main h1,
  .teacher-page-hero h1,
  .checkout-heading h1 {
    overflow-wrap: anywhere;
  }

  .hero,
  .neo-hero,
  .course-detail-wrap,
  .course-detail-layout,
  .course-layout,
  .player-shell,
  .quiz-layout,
  .inbox,
  .blog-hero,
  .beeguide-page,
  .beeguide-super-page,
  .affiliation-detail-hero,
  .organization-detail-hero {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .hero {
    min-height: 0;
    padding: clamp(22px, 6vw, 38px);
  }

  .hero h1,
  .neo-hero h1 {
    font-size: clamp(32px, 9vw, 48px);
    line-height: 1.08;
    overflow-wrap: anywhere;
  }

  .hero-visual,
  .hive-orbit {
    max-width: 100%;
  }

  .course-grid,
  .catalog-grid,
  .category-grid,
  .achievement-grid,
  .teacher-admin-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid,
  .checkout-fields,
  .profile-section .mobile-profile-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-grid > .two,
  .checkout-fields .checkout-field-wide {
    grid-column: auto;
  }

  .site-header-inner,
  .topbar,
  .panel-topbar {
    min-width: 0;
  }

  .account-shell,
  .panel-main,
  .teacher-page,
  .catalog-main,
  .checkout-main {
    box-sizing: border-box;
  }

  .footer-main,
  .footer-cta-wrap {
    width: 100%;
    box-sizing: border-box;
  }

  .checkout-summary,
  .course-purchase,
  .teacher-payout-note {
    width: 100%;
  }

  .checkout-course {
    min-width: 0;
  }

  .account-content,
  .account-section,
  .learning-library,
  .teacher-form-card,
  .surface {
    overflow-wrap: anywhere;
  }

  .account-dropdown,
  .live-search-dropdown {
    max-width: calc(100vw - 20px);
  }

  input,
  select,
  textarea,
  .btn,
  .btn-main,
  .pill-link,
  .logout-btn,
  .site-icon-btn,
  .circle-btn {
    touch-action: manipulation;
  }

  .panel-form input:not([type="checkbox"]):not([type="radio"]),
  .panel-form select,
  .panel-form textarea,
  .auth-card input:not([type="checkbox"]):not([type="radio"]),
  .auth-card select,
  .auth-card textarea,
  .mobile-field-group input,
  .mobile-field-group textarea,
  .checkout-fields input,
  .checkout-fields select {
    font-size: 16px;
  }

  .panel-form button,
  .auth-card button,
  .mobile-save-btn,
  .checkout-pay,
  .checkout-coupon-entry button {
    min-height: 44px;
  }

  .panel-main {
    padding: 18px 14px calc(34px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 560px) {
  .course-grid,
  .catalog-grid,
  .achievement-grid,
  .teacher-admin-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-head h1,
  .panel-main h1,
  .catalog-main h1 {
    font-size: clamp(26px, 8vw, 36px);
    letter-spacing: -0.8px;
  }

  .hero,
  .neo-hero,
  .beeguide-page,
  .beeguide-super-intro {
    border-radius: 18px;
  }

  .card,
  .surface,
  .checkout-summary,
  .checkout-details .checkout-section,
  .teacher-form-card {
    border-radius: 15px;
  }

  .form-actions,
  .teacher-form-actions,
  .teacher-payout-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .form-actions > *,
  .teacher-form-actions > *,
  .teacher-payout-actions > * {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  .table-wrap table,
  .table-scroller table,
  .table-scroller,
  .table-responsive table,
  .admin-table-wrap table {
    min-width: 580px;
  }

  .mobile-app-bar {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

@media (max-width: 360px) {
  .course-grid,
  .catalog-grid,
  .category-grid,
  .stats-grid,
  .teacher-admin-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  .main,
  .panel-main,
  .teacher-page,
  .catalog-main,
  .checkout-main {
    padding-left: 10px;
    padding-right: 10px;
  }

  .course-thumb {
    height: auto;
    min-height: 150px;
  }
}

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