/* Shared touch-first layout for every Groomed Hair screen. */
@media (max-width: 680px) {
  html body .app-shell {
    min-width: 0;
    width: 100%;
    margin: 0;
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
  }
  html body main,
  html body #main {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 18px 14px 30px;
  }
  html body #main > * { min-width: 0; max-width: 100%; }
  html body #main :is(h1, h2, h3, p, a, button, label, small) {
    overflow-wrap: anywhere;
  }
  html body #main h1 {
    font-size: clamp(29px, 8vw, 38px) !important;
    line-height: 1.08;
    letter-spacing: -.035em;
  }
  html body #main h2 {
    font-size: clamp(20px, 5.8vw, 26px);
    line-height: 1.2;
  }
  html body #main :is(.section-heading, .section-title-row, .feature-heading, .page-heading) {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }
  html body #main :is(.feature-actions, .completion-actions, .style-detail-actions, .event-actions) {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  html body #main :is(.feature-actions, .completion-actions) > :is(a, button) {
    flex: 1 1 100%;
    min-width: 0;
    min-height: 46px;
    justify-content: center;
    text-align: center;
  }
  html body #main :is(.primary-button, .secondary-button, .light-button, .community-submit) {
    min-height: 46px;
    max-width: 100%;
    padding: 11px 15px;
    border-radius: 14px !important;
    line-height: 1.3;
    white-space: normal;
    touch-action: manipulation;
  }
  html body #main :is(form, .feature-form, .account-form-panel) > :is(.primary-button, .secondary-button, button[type="submit"]) {
    width: 100%;
    justify-content: center;
    margin-inline: 0;
  }
  html body #main :is(input:not([type="checkbox"]):not([type="radio"]), textarea, select) {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    box-sizing: border-box;
    font-size: 16px !important;
  }
  html body #main textarea { min-height: 110px; }
  html body #main :is(
    .quick-grid, .feature-grid, .ritual-grid, .learning-card-grid,
    .journal-history, .rewards-coupons, .reward-milestones,
    .rewards-perks, .profile-grid, .family-grid, .product-grid,
    .routine-grid, .content-grid, .people-grid
  ) {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px;
  }
  html body #main :is(.quick-card, .ritual-card, .product-card, .content-card, .feature-card, .family-card, .journal-memory) {
    min-width: 0;
    border-radius: 18px !important;
  }
  html body #main :is(.library-hero, .care-feature-hero, .profile-editorial, .agenda-heading, .rewards-hero, .protective-guide, .protective-routine, .protective-community) {
    max-width: 100%;
    box-sizing: border-box;
    border-radius: 20px !important;
  }
  html body #main :is(.hero, .library-hero, .care-feature-hero, .profile-editorial) {
    grid-template-columns: minmax(0, 1fr);
  }
  html body #main :is(.hero, .library-hero) {
    min-height: 0;
    padding: 22px 18px;
  }
  html body #main :is(.hero-orbit, .hero-image) { max-width: 100%; }
  html body #main :is(.hero-chips, .style-tags, .community-topics, .result-tags) {
    max-width: 100%;
    flex-wrap: wrap;
  }
  html body #main :is(.calendar-grid, .calendar-weekdays) { min-width: 0; }
  html body #main .calendar-grid > button { min-width: 0; }
  html body #main .agenda-event { min-width: 0; }
  html body #main .agenda-event .event-actions > * { min-height: 42px; }
  html body #main .protective-filters,
  html body #main .community-filters,
  html body #main .news-filters {
    max-width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }
  html body #main :is(.protective-filters, .community-filters, .news-filters) > button {
    flex: 0 0 auto;
    min-height: 42px;
  }
  html body #main :is(.month-card, .day-card, .rewards-section, .journal-entry-form, .community-chat, .community-post) {
    padding: 16px;
  }
  html body .mobile-nav {
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: 0 !important;
    width: 100%;
    height: calc(70px + env(safe-area-inset-bottom, 0px));
    padding: 5px 9px calc(5px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    z-index: 45;
    gap: 3px;
    border: 1px solid var(--gh-border) !important;
    border-radius: 18px 18px 0 0;
    background: var(--gh-paper) !important;
    box-shadow: 0 7px 24px #30283220;
  }
  html body .mobile-nav :is(a, button) {
    min-width: 0;
    min-height: 58px;
    gap: 3px;
    padding: 3px 1px;
    border-radius: 15px;
    color: var(--gh-muted) !important;
    font-size: 10px;
    font-weight: 700;
  }
  html body .mobile-nav .mobile-nav-icon { width: 36px; height: 27px; }
  html body .mobile-nav .mobile-nav-icon svg { width: 21px; height: 21px; }
  html body .mobile-nav [data-nav-label] { font-size: 10px; }
  html body .mobile-nav :is(a, button).active {
    background: var(--gh-plum) !important;
    color: #fff !important;
    box-shadow: none !important;
  }
  html body .mobile-nav :is(a, button).active .mobile-nav-icon {
    background: #ffffff20 !important;
    color: #fff !important;
  }
  html body .mobile-nav .mobile-community-link:not(.active) {
    background: var(--gh-lilac) !important;
    color: var(--gh-plum) !important;
    box-shadow: inset 0 0 0 1px var(--gh-lilac-strong) !important;
  }
  html body #toast { bottom: calc(94px + env(safe-area-inset-bottom, 0px)); }
  html body .assistant-launcher { bottom: calc(92px + env(safe-area-inset-bottom, 0px)) !important; }
}
@media (max-width: 380px) {
  html body #main { padding-inline: 11px; }
  html body .mobile-nav { padding-inline: 6px; }
  html body .mobile-nav [data-nav-label] { font-size: 9px; }
  html body #main :is(.month-card, .day-card, .rewards-section, .journal-entry-form) { padding: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  html body #main *, html body .mobile-nav * { scroll-behavior: auto !important; }
}

/* Mobile navigation: consistent destinations, clear selection and touch targets. */
@media (max-width: 640px) {
  html body nav.mobile-nav.mobile-nav {
    height: calc(76px + env(safe-area-inset-bottom, 0px));
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom, 0px));
    gap: 4px;
    border: 0 !important;
    border-top: 1px solid var(--gh-border) !important;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -6px 28px #49243f0d;
    isolation: isolate;
  }
  html body nav.mobile-nav.mobile-nav :is(a, button),
  html body nav.mobile-nav.mobile-nav .mobile-community-link:not(.active) {
    position: relative;
    min-height: 60px;
    padding: 4px 1px;
    gap: 4px;
    border-radius: 16px;
    background: transparent !important;
    color: var(--gh-muted) !important;
    box-shadow: none !important;
    font-weight: 600;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: color .18s ease, background .18s ease;
  }
  html body nav.mobile-nav.mobile-nav .mobile-nav-icon,
  html body nav.mobile-nav.mobile-nav .mobile-community-link .mobile-nav-icon {
    width: 44px;
    height: 30px;
    border-radius: 12px;
    background: transparent !important;
    color: inherit !important;
    transition: background .18s ease, transform .18s ease;
  }
  html body nav.mobile-nav.mobile-nav .mobile-nav-icon svg {
    width: 23px;
    height: 23px;
    stroke-width: 1.8;
  }
  html body nav.mobile-nav.mobile-nav [data-nav-label] {
    font-size: 10px;
    line-height: 1.3;
    letter-spacing: .01em;
  }
  html body nav.mobile-nav.mobile-nav :is(a, button).active {
    background: var(--gh-lilac) !important;
    color: var(--gh-plum) !important;
    box-shadow: none !important;
    font-weight: 800;
  }
  html body nav.mobile-nav.mobile-nav :is(a, button).active .mobile-nav-icon {
    background: var(--gh-plum) !important;
    color: var(--gh-paper) !important;
  }
  html body nav.mobile-nav.mobile-nav :is(a, button).active .mobile-nav-icon svg { stroke-width: 2; }
  html body nav.mobile-nav.mobile-nav :is(a, button):focus-visible {
    outline: 2px solid var(--gh-plum);
    outline-offset: -2px;
  }
  html body nav.mobile-nav.mobile-nav :is(a, button):active { transform: none; }
  html body nav.mobile-nav.mobile-nav :is(a, button):active .mobile-nav-icon { transform: scale(.92); }
}
@media (max-width: 350px) {
  html body nav.mobile-nav.mobile-nav { padding-inline: 4px; gap: 2px; }
  html body nav.mobile-nav.mobile-nav [data-nav-label] { font-size: 9px; letter-spacing: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html body nav.mobile-nav.mobile-nav :is(a, button), html body nav.mobile-nav.mobile-nav .mobile-nav-icon { transition: none; }
  html body nav.mobile-nav.mobile-nav :is(a, button):active .mobile-nav-icon { transform: none; }
}
@media (max-width: 640px) {
  html[data-theme="dark"] body nav.mobile-nav.mobile-nav :is(a, button).active {
    color: #fff !important;
  }
}

/* Community is highlighted without using the current-page treatment. */
@media (max-width: 640px) {
  html body nav.mobile-nav.mobile-nav .mobile-community-link:not(.active) {
    background: transparent !important;
    color: var(--gh-plum) !important;
    font-weight: 800;
  }
  html body nav.mobile-nav.mobile-nav .mobile-community-link:not(.active) .mobile-nav-icon {
    background: #fff0e4 !important;
    color: #924a28 !important;
    box-shadow: inset 0 0 0 1px #edc9af;
  }
  html body nav.mobile-nav.mobile-nav .mobile-community-link:not(.active) .mobile-nav-icon svg {
    stroke-width: 2;
  }
  html[data-theme="dark"] body nav.mobile-nav.mobile-nav .mobile-community-link:not(.active) .mobile-nav-icon {
    background: #453029 !important;
    color: #ffccaa !important;
    box-shadow: inset 0 0 0 1px #805840;
  }
}
