@media (max-width: 640px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    min-height: 0;
    padding: 8px 12px 10px;
  }

  .brand {
    min-width: 0;
    justify-self: center;
  }

  .brand img {
    width: 106px;
    height: 36px;
  }

  .top-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    width: 100%;
    min-width: 0;
    margin: 0;
    gap: 6px;
  }

  .top-nav .nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .top-nav > a.nav-link[href^="/#"] {
    display: none;
  }

  .top-nav .button,
  .top-nav .nav-link {
    min-width: 0;
    min-height: 38px;
    padding: 7px 6px;
    overflow: hidden;
    font-size: .72rem;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .page-shell {
    width: 100%;
    max-width: 100%;
    padding: 20px 16px 94px;
  }

  .hero {
    gap: 4px;
    padding: 10px 0 0;
  }

  .hero h1 {
    max-width: 350px;
    font-size: clamp(2.05rem, 10.5vw, 2.75rem);
    letter-spacing: -.025em;
  }

  .hero-copy > p:not(.eyebrow) {
    max-width: 340px;
    margin: 14px auto 18px;
    font-size: .92rem;
    line-height: 1.75;
  }

  .hero-actions {
    max-width: 360px;
    gap: 8px;
  }

  .hero-actions .button {
    min-height: 44px;
    padding-inline: 10px;
  }

  .orbit-stage {
    width: 100%;
    min-height: 315px;
    margin: 0;
    overflow: hidden;
    transform: none;
  }

  .orbit-one {
    width: 230px;
    height: 230px;
  }

  .orbit-two {
    width: 310px;
    height: 310px;
  }

  .pulse-core {
    width: 88px;
    height: 88px;
    border-radius: 23px;
  }

  .float-card {
    min-width: 132px;
    max-width: 150px;
    padding: 10px 11px;
    border-radius: 11px;
  }

  .float-card b {
    font-size: .78rem;
  }

  .float-card span,
  .float-card i {
    font-size: .65rem;
  }

  .order-card {
    top: 24px;
    right: 2px;
  }

  .message-card {
    left: 2px;
    bottom: 42px;
  }

  .metric-card {
    right: 15px;
    bottom: 5px;
  }

  .section {
    padding: 38px 0;
  }

  .section-head {
    margin-bottom: 18px;
  }

  .section-head h2,
  .analytics-showcase h2,
  .affiliate-section h2 {
    font-size: 1.65rem;
    line-height: 1.3;
  }

  .section-head p,
  .analytics-showcase p,
  .affiliate-section p {
    font-size: .86rem;
    line-height: 1.7;
  }

  .feature-grid {
    display: flex;
    width: calc(100% + 16px);
    margin-left: -16px;
    padding: 2px 0 12px 16px;
    gap: 10px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .feature-grid::-webkit-scrollbar,
  .plans-grid::-webkit-scrollbar {
    display: none;
  }

  .feature {
    flex: 0 0 min(82vw, 310px);
    min-height: 180px;
    padding: 19px;
    scroll-snap-align: start;
    box-shadow: 0 14px 35px rgba(17, 24, 39, .07);
  }

  .analytics-showcase,
  .affiliate-section {
    gap: 22px;
    margin: 34px 0;
    padding: 24px 18px;
  }

  .demo-chart {
    height: 180px;
    padding: 18px 12px;
  }

  .pricing-band {
    width: calc(100% + 16px);
    margin-right: 0;
    margin-left: -16px;
    padding: 38px 16px 28px;
    border-radius: 20px 0 0 20px;
  }

  .pricing-band .section-head {
    padding-inline: 4px;
  }

  .plans-grid {
    display: flex;
    align-items: stretch;
    width: calc(100% + 16px);
    padding: 5px 0 16px 16px;
    gap: 12px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .plan,
  .plan.featured {
    flex: 0 0 min(85vw, 325px);
    min-height: 485px;
    padding: 22px;
    transform: none;
    scroll-snap-align: start;
  }

  .plan > p {
    min-height: 0;
  }

  .plan ul {
    min-height: 0;
  }

  .site-footer {
    gap: 18px;
    margin-top: 38px;
    padding: 23px 18px;
  }

  .site-footer img {
    width: 115px;
  }

  .support-dock {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  .support-main {
    min-height: 42px;
    padding: 8px 12px;
    border-radius: 13px;
    font-size: .75rem;
  }

  .support-chat-overlay {
    place-items: end center;
    padding: 0;
  }

  .support-chat {
    width: 100%;
    max-height: min(86dvh, 760px);
    border-width: 1px 0 0;
    border-radius: 22px 22px 0 0;
  }

  .support-chat-head {
    padding: 14px 16px;
  }

  .support-chat-body {
    gap: 12px;
    padding: 15px 14px calc(18px + env(safe-area-inset-bottom));
  }

  .support-chat-body .form-grid.two {
    gap: 10px;
  }

  .support-chat-body textarea {
    min-height: 120px;
  }

  .support-attachment .row-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-toolbar {
    top: 96px;
    flex-wrap: nowrap;
    width: calc(100% + 8px);
    margin-inline: -4px;
    padding: 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .dashboard-toolbar::-webkit-scrollbar {
    display: none;
  }

  .dashboard-toolbar .button,
  .dashboard-toolbar .days-control,
  .dashboard-toolbar .store-control {
    flex: 0 0 auto;
    width: auto;
  }

  .dashboard-toolbar .button {
    min-width: max-content;
  }

  .subscription-bar {
    gap: 7px;
    padding: 12px;
  }

  .metrics {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .metric {
    flex: 0 0 138px;
    scroll-snap-align: start;
  }

  .auth-card {
    width: 100%;
    padding: 22px 17px;
  }

  .auth-card h1 {
    font-size: 1.9rem;
  }

  .table-wrap {
    max-width: 100%;
  }

  .order-selection-bar {
    position: sticky;
    z-index: 5;
    top: 152px;
    display: grid;
    gap: 8px;
    padding: 10px;
    box-shadow: 0 10px 28px rgba(17, 24, 39, .12);
  }

  .order-selection-bar .row-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    width: 100%;
  }

  .order-selection-bar .button {
    min-width: 0;
    white-space: normal;
  }

  .notification-item,
  .feature,
  .plan,
  .card {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 370px) {
  .page-shell {
    padding-inline: 12px;
  }

  .top-nav .button,
  .top-nav .nav-link {
    font-size: .67rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body.app-session .site-header {
    display: flex;
    min-height: 62px;
    padding: 8px 12px;
  }

  body.app-session .top-nav {
    display: block;
    width: auto;
    margin-right: auto;
  }

  body.app-session .page-shell {
    padding-top: 22px;
  }

  .impact-grid {
    scrollbar-width: none;
  }

  .impact-grid::-webkit-scrollbar {
    display: none;
  }
}
