/* Phase 1–7 mobile shell — section tabs + bottom nav + light header.
   Desktop (xl+) unchanged. */

:root {
  --mv-shell-green: #0c6b34;
  --mv-shell-green-soft: rgba(12, 107, 52, 0.12);
  --mv-shell-green-pale: rgba(12, 107, 52, 0.1);
  --mv-shell-bottom-h: 4.25rem;
  --mv-shell-header-h: 3.5rem;
  --mv-shell-gutter: 1rem;
  --mv-shell-radius-card: 0.875rem;
  --mv-shell-section-gap: 1rem;
  --mv-shell-icon: 1.25rem;
  --mv-shell-fg: #1f2a24;
  --mv-shell-muted: #5b6b62;
  --mv-shell-border: rgba(31, 42, 36, 0.12);
  --mv-shell-bg: #ffffff;
  --mv-shell-bg-soft: #f7f9f7;
  --mv-shell-shadow: 0 1px 0 rgba(31, 42, 36, 0.08);
  --mv-shell-shadow-soft: 0 4px 16px rgba(31, 42, 36, 0.08);
}

body.mv-mobile-shell-on {
  padding-bottom: calc(var(--mv-shell-bottom-h) + env(safe-area-inset-bottom, 0px));
}

/* The bottom bar also shows at desktop widths, so desktop keeps the same
   bottom padding and the last content is never hidden behind it. */

/* Compact sticky header stack on mobile when redesign is on */
@media (max-width: 1279px) {
  /* Phase 7: white/off-white app header (desktop keeps dark green) */
  body.mv-mobile-shell-on .mv-navbar {
    height: var(--mv-shell-header-h);
    min-height: var(--mv-shell-header-h);
    padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    background: var(--mv-shell-bg) !important;
    background-image: none !important;
    color: var(--mv-shell-fg) !important;
    border-bottom: 1px solid var(--mv-shell-border) !important;
    box-shadow: var(--mv-shell-shadow) !important;
    backdrop-filter: none;
    gap: 0.5rem;
    min-width: 0;
    overflow-x: clip;
  }

  /* Left brand cluster keeps natural width; right actions stay intact */
  body.mv-mobile-shell-on .mv-navbar > .flex.items-center:first-child {
    min-width: 0;
    flex: 0 1 auto;
  }

  body.mv-mobile-shell-on .mv-navbar > .flex.items-center:last-child {
    flex: 0 0 auto;
    min-width: 0;
    margin-left: auto;
  }

  body.mv-mobile-shell-on .mv-brand-link {
    min-width: 0;
    max-width: 100%;
    flex-shrink: 0;
  }

  body.mv-mobile-shell-on .mv-navbar-logo {
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
  }

  body.mv-mobile-shell-on .mv-navbar-logo--on-dark,
  body.mv-mobile-shell-on .mv-brand-wordmark-desktop {
    display: none !important;
  }

  body.mv-mobile-shell-on .mv-navbar-logo--on-light {
    display: block;
  }

  body.mv-mobile-shell-on .mv-mobile-brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex-shrink: 0;
    line-height: 1.05;
  }

  /*
   * WCAG: cream #f4eee2 from landing.css brand rules is for the dark green bar.
   * On the white mobile shell header it is nearly invisible — force brand green.
   * Specificity must beat: header.sticky .mv-navbar a.mv-brand-link span
   */
  body.mv-mobile-shell-on header.sticky .mv-navbar a.mv-brand-link,
  body.mv-mobile-shell-on header.sticky .mv-navbar a.mv-brand-link span {
    color: var(--mv-shell-green) !important;
  }

  body.mv-mobile-shell-on header.sticky .mv-navbar a.mv-brand-link:hover,
  body.mv-mobile-shell-on header.sticky .mv-navbar a.mv-brand-link:hover span {
    color: #084a26 !important;
  }

  body.mv-mobile-shell-on .mv-mobile-brand-text__name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--mv-shell-green) !important;
    letter-spacing: -0.02em;
    white-space: nowrap;
  }

  /* Protect brand + icons on phones: drop wordmark under 430px */
  @media (max-width: 429px) {
    body.mv-mobile-shell-on .mv-mobile-brand-text {
      display: none;
    }
  }

  /* Phase 5A: legacy burger / account chrome yield to app header + Smart Menu */
  body.mv-mobile-shell-on .mv-shell-hide-mobile,
  body.mv-mobile-shell-on .mv-nav-burger-btn {
    display: none !important;
  }

  body.mv-mobile-shell-on #mv-drawer-side,
  body.mv-mobile-shell-on .drawer-side {
    display: none !important;
  }

  /* Belt-and-suspenders with base.html Tailwind hidden xl:block */
  body.mv-mobile-shell-on footer.mv-site-footer[data-mv-site-footer="1"],
  body.mv-mobile-shell-on footer[data-mv-site-footer-mobile="hidden"] {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
  }

  body.mv-mobile-shell-on .mv-mobile-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    flex-shrink: 0;
  }

  body.mv-mobile-shell-on .mv-mobile-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    min-width: 2.5rem;
    min-height: 2.5rem;
    border-radius: 9999px;
    color: var(--mv-shell-green);
    background: transparent;
    border: 0;
    text-decoration: none;
    overflow: hidden;
    transition: background-color 0.15s ease, transform 0.12s ease;
  }

  body.mv-mobile-shell-on .mv-mobile-header-icon:hover,
  body.mv-mobile-shell-on .mv-mobile-header-icon:active {
    background: var(--mv-shell-green-pale);
  }

  body.mv-mobile-shell-on .mv-mobile-header-icon:active {
    transform: scale(0.96);
  }

  body.mv-mobile-shell-on .mv-mobile-header-icon:focus-visible {
    outline: 2px solid var(--mv-shell-green);
    outline-offset: 2px;
  }

  body.mv-mobile-shell-on .mv-mobile-header-icon svg {
    width: var(--mv-shell-icon);
    height: var(--mv-shell-icon);
  }

  /* Ask My-Village mic — navigation only (not Speak to Change / MC) */
  body.mv-mobile-shell-on .mv-mobile-header-stc {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
    border-radius: 9999px;
    text-decoration: none;
    color: var(--mv-shell-green);
    flex-shrink: 0;
  }

  body.mv-mobile-shell-on .mv-mobile-header-stc__circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 9999px;
    background: var(--mv-shell-green-pale);
    border: 1px solid rgba(12, 107, 52, 0.18);
    transition: background-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
  }

  body.mv-mobile-shell-on .mv-mobile-header-stc:hover .mv-mobile-header-stc__circle,
  body.mv-mobile-shell-on .mv-mobile-header-stc:focus-visible .mv-mobile-header-stc__circle {
    background: var(--mv-shell-green-soft);
    box-shadow: 0 0 0 2px rgba(12, 107, 52, 0.15);
  }

  body.mv-mobile-shell-on .mv-mobile-header-stc:active .mv-mobile-header-stc__circle {
    transform: scale(0.94);
    background: var(--mv-shell-green-soft);
  }

  body.mv-mobile-shell-on .mv-mobile-header-stc:focus-visible {
    outline: 2px solid var(--mv-shell-green);
    outline-offset: 2px;
  }

  body.mv-mobile-shell-on .mv-mobile-header-stc__mic {
    width: 1.15rem;
    height: 1.15rem;
  }

  body.mv-mobile-shell-on .mv-mobile-header-avatar {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 9999px;
    object-fit: cover;
  }

  body.mv-mobile-shell-on .mv-mobile-header-auth {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.25rem;
    padding: 0.35rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
  }

  body.mv-mobile-shell-on .mv-mobile-header-auth--login {
    color: var(--mv-shell-green);
    background: var(--mv-shell-bg);
    border: 1px solid var(--mv-shell-border);
  }

  body.mv-mobile-shell-on .mv-mobile-header-auth--signup {
    color: #fff;
    background: var(--mv-shell-green);
    border: 1px solid var(--mv-shell-green);
  }

  /* iPhone widths: keep brand + actions on one row without overflow */
  @media (max-width: 430px) {
    body.mv-mobile-shell-on .mv-mobile-header-actions {
      gap: 0.15rem;
    }

    body.mv-mobile-shell-on .mv-mobile-header-icon {
      width: 2.35rem;
      height: 2.35rem;
      min-width: 2.35rem;
      min-height: 2.35rem;
    }

    body.mv-mobile-shell-on .mv-mobile-header-stc {
      width: 2.5rem;
      height: 2.5rem;
      min-width: 2.5rem;
      min-height: 2.5rem;
    }

    body.mv-mobile-shell-on .mv-mobile-header-stc__circle {
      width: 2.15rem;
      height: 2.15rem;
    }
  }

  @media (max-width: 390px) {
    body.mv-mobile-shell-on .mv-navbar {
      padding-left: max(0.5rem, env(safe-area-inset-left, 0px));
      padding-right: max(0.5rem, env(safe-area-inset-right, 0px));
      gap: 0.35rem;
    }

    body.mv-mobile-shell-on .mv-mobile-brand-text__name {
      font-size: 0.875rem;
    }

    body.mv-mobile-shell-on .mv-mobile-header-auth {
      padding: 0.28rem 0.45rem;
      font-size: 0.68rem;
      min-height: 1.9rem;
    }

    body.mv-mobile-shell-on .mv-mobile-header-actions {
      gap: 0.08rem;
    }
  }

  @media (max-width: 360px) {
    body.mv-mobile-shell-on .mv-navbar-logo {
      width: 2rem;
      height: 2rem;
    }

    body.mv-mobile-shell-on .mv-mobile-header-actions {
      gap: 0.1rem;
    }

    body.mv-mobile-shell-on .mv-mobile-header-icon {
      width: 2.15rem;
      height: 2.15rem;
      min-width: 2.15rem;
      min-height: 2.15rem;
    }

    body.mv-mobile-shell-on .mv-mobile-header-stc {
      width: 2.25rem;
      height: 2.25rem;
      min-width: 2.25rem;
      min-height: 2.25rem;
    }

    body.mv-mobile-shell-on .mv-mobile-header-stc__circle {
      width: 2rem;
      height: 2rem;
    }

    body.mv-mobile-shell-on .mv-mobile-header-auth {
      padding: 0.25rem 0.4rem;
      font-size: 0.65rem;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    body.mv-mobile-shell-on .mv-mobile-header-icon,
    body.mv-mobile-shell-on .mv-mobile-header-stc__circle {
      transition: none;
    }

    body.mv-mobile-shell-on .mv-mobile-header-icon:active,
    body.mv-mobile-shell-on .mv-mobile-header-stc:active .mv-mobile-header-stc__circle {
      transform: none;
    }
  }
}

/* Colour mark hidden until shell + mobile applies (avoids flash on desktop) */
.mv-navbar-logo--on-light,
.mv-mobile-brand-text {
  display: none;
}

.mv-mobile-section-tabs {
  background: var(--mv-shell-bg);
  border-bottom: 1px solid var(--mv-shell-border);
  color: var(--mv-shell-fg);
}

.mv-mobile-section-tabs__scroller {
  display: flex;
  gap: 0.15rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0.35rem 0.75rem 0.15rem;
  scroll-snap-type: x proximity;
}

.mv-mobile-section-tabs__scroller::-webkit-scrollbar {
  display: none;
}

.mv-mobile-section-tabs__tab {
  flex: 1 1 0;
  scroll-snap-align: start;
  padding: 0.55rem 0.35rem;
  min-height: 2.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--mv-shell-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  text-align: center;
}

.mv-mobile-section-tabs__label-short {
  display: none;
}

.mv-mobile-section-tabs__tab.is-active {
  color: var(--mv-shell-green);
  border-bottom-color: var(--mv-shell-green);
}

.mv-mobile-section-tabs__tab:focus-visible {
  outline: 2px solid var(--mv-shell-green);
  outline-offset: 2px;
}

/* Keep all four tabs visible at narrow widths (Clubs clipping fix) */
@media (max-width: 360px) {
  .mv-mobile-section-tabs__scroller {
    padding-left: 0.35rem;
    padding-right: 0.35rem;
    gap: 0;
  }

  .mv-mobile-section-tabs__tab {
    padding: 0.5rem 0.2rem;
    font-size: 0.72rem;
  }

  .mv-mobile-section-tabs__label-full {
    display: none;
  }

  .mv-mobile-section-tabs__label-short {
    display: inline;
  }
}

.mv-mobile-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  gap: 0.15rem;
  min-height: var(--mv-shell-bottom-h);
  padding: 0.35rem 0.35rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
  background: var(--mv-shell-bg);
  border-top: 1px solid var(--mv-shell-border);
  box-shadow: 0 -4px 18px rgba(15, 30, 20, 0.06);
  /* Measured correction from js/mobile_viewport.js; 0 unless iOS leaves the
     layout viewport out of sync with the visible screen (e.g. after the
     share sheet). Never set a fixed pixel value here. */
  transform: translate3d(0, var(--mv-bottom-nav-shift, 0px), 0);
}

.mv-mobile-bottom-nav__item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-height: 2.75rem;
  padding: 0.2rem;
  border: 0;
  background: transparent;
  color: var(--mv-shell-muted);
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1.1;
  cursor: pointer;
  border-radius: 0.65rem;
  transition: color 0.12s ease, background-color 0.12s ease;
}

.mv-mobile-bottom-nav__item:active {
  background: var(--mv-shell-green-pale);
}

.mv-mobile-bottom-nav__item.is-active {
  color: var(--mv-shell-green);
}

.mv-mobile-bottom-nav__icon {
  width: 1.35rem;
  height: 1.35rem;
}

.mv-mobile-bottom-nav__icon-wrap {
  position: relative;
  display: inline-flex;
}

.mv-mobile-bottom-nav__badge {
  position: absolute;
  top: -0.35rem;
  right: -0.45rem;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.2rem;
  border-radius: 9999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.6rem;
  line-height: 1rem;
  text-align: center;
}

.mv-mobile-bottom-nav__create {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  width: 3.15rem;
  height: 3.15rem;
  margin-top: -0.85rem;
  border: 0;
  border-radius: 9999px;
  background: var(--mv-shell-green);
  color: #fff;
  box-shadow: 0 6px 16px rgba(12, 107, 52, 0.28);
  cursor: pointer;
}

.mv-mobile-bottom-nav__create:focus-visible,
.mv-mobile-bottom-nav__item:focus-visible {
  outline: 2px solid var(--mv-shell-green);
  outline-offset: 2px;
}

.mv-mobile-bottom-nav__create-glyph {
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1;
}

.mv-mobile-create-sheet {
  position: fixed;
  inset: 0;
  z-index: 120;
}

.mv-mobile-create-sheet[hidden] {
  display: none !important;
}

.mv-mobile-create-sheet.is-open {
  display: block;
}

.mv-mobile-create-sheet__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(10, 20, 14, 0.45);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.mv-mobile-create-sheet.is-open .mv-mobile-create-sheet__backdrop {
  opacity: 1;
}

.mv-mobile-create-sheet__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(70vh, 28rem);
  overflow: auto;
  padding: 0.75rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  border-radius: 1rem 1rem 0 0;
  background: var(--mv-shell-bg);
  color: var(--mv-shell-fg);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.12);
  transform: translateY(100%);
  transition: transform 0.22s ease;
}

.mv-mobile-create-sheet.is-open .mv-mobile-create-sheet__panel {
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .mv-mobile-create-sheet__backdrop,
  .mv-mobile-create-sheet__panel,
  .mv-mobile-bottom-nav__item {
    transition: none;
  }

  .mv-mobile-create-sheet__panel {
    transform: none;
  }
}

.mv-mobile-create-sheet__handle {
  width: 2.5rem;
  height: 0.28rem;
  margin: 0.15rem auto 0.85rem;
  border-radius: 9999px;
  background: rgba(31, 42, 36, 0.18);
}

.mv-mobile-create-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.mv-mobile-create-sheet__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.mv-mobile-create-sheet__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: var(--mv-shell-muted);
  cursor: pointer;
}

.mv-mobile-create-sheet__close svg {
  width: 1.25rem;
  height: 1.25rem;
}

.mv-mobile-create-sheet__lead {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  color: var(--mv-shell-muted);
}

.mv-mobile-create-sheet__context-label {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--mv-shell-muted);
}

.mv-mobile-create-sheet__contexts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.75rem;
}

.mv-mobile-create-sheet__context {
  min-height: 2.4rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--mv-shell-border);
  border-radius: 9999px;
  background: transparent;
  color: var(--mv-shell-fg);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.mv-mobile-create-sheet__context.is-active {
  border-color: var(--mv-shell-green);
  background: var(--mv-shell-green-soft);
  color: var(--mv-shell-green);
}

.mv-mobile-create-sheet__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.mv-mobile-create-sheet__action {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
  min-height: 2.75rem;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  background: var(--mv-shell-green-soft);
  color: var(--mv-shell-green);
  text-decoration: none;
  font-weight: 600;
}

.mv-mobile-create-sheet__action-label {
  line-height: 1.25;
}

.mv-mobile-create-sheet__action-desc {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--mv-shell-muted);
  line-height: 1.3;
}

.mv-mobile-create-sheet__action--upgrade {
  background: rgba(31, 42, 36, 0.05);
  color: var(--mv-shell-fg);
  border: 1px dashed var(--mv-shell-border);
}

.mv-mobile-create-sheet__cancel {
  display: block;
  width: 100%;
  margin-top: 0.85rem;
  min-height: 2.75rem;
  border: 1px solid var(--mv-shell-border);
  border-radius: 0.75rem;
  background: transparent;
  color: var(--mv-shell-muted);
  font-weight: 600;
  cursor: pointer;
}

/* Cookie banner sits above bottom nav when shell is active */
@media (max-width: 1279px) {
  body.mv-mobile-shell-on #cookie-banner.cookie-banner {
    bottom: calc(var(--mv-shell-bottom-h) + env(safe-area-inset-bottom, 0px));
    z-index: 110;
  }
}

/* PWA install banner sits directly above the bottom nav (same offset as the
   cookie banner) instead of underneath it. Its z-index stays below the nav so
   the off-screen state (translate-y-full) slides away behind the nav. */
@media (max-width: 1279px) {
  body.mv-mobile-shell-on #pwa-install-banner {
    bottom: calc(var(--mv-shell-bottom-h) + env(safe-area-inset-bottom, 0px));
    z-index: 85;
  }

  /* Hide the Smart Menu row until the installer reveals its button. */
  .mv-mobile-smart-menu__list > li:has(> [data-pwa-install-trigger][hidden]) {
    display: none;
  }
}

/* Phase 5A Smart Menu */
.mv-mobile-smart-menu {
  position: fixed;
  inset: 0;
  z-index: 125;
}

.mv-mobile-smart-menu[hidden] {
  display: none !important;
}

.mv-mobile-smart-menu.is-open {
  display: block;
}

.mv-mobile-smart-menu__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(10, 20, 14, 0.45);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.mv-mobile-smart-menu.is-open .mv-mobile-smart-menu__backdrop {
  opacity: 1;
}

.mv-mobile-smart-menu__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(22rem, 92vw);
  display: flex;
  flex-direction: column;
  background: var(--mv-shell-bg);
  color: var(--mv-shell-fg);
  box-shadow: -8px 0 28px rgba(0, 0, 0, 0.14);
  transform: translateX(100%);
  transition: transform 0.22s ease;
  padding-top: env(safe-area-inset-top, 0px);
}

.mv-mobile-smart-menu.is-open .mv-mobile-smart-menu__panel {
  transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
  .mv-mobile-smart-menu__backdrop,
  .mv-mobile-smart-menu__panel {
    transition: none;
  }

  .mv-mobile-smart-menu__panel {
    transform: none;
  }
}

.mv-mobile-smart-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid var(--mv-shell-border);
}

.mv-mobile-smart-menu__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.mv-mobile-smart-menu__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: var(--mv-shell-muted);
  cursor: pointer;
}

.mv-mobile-smart-menu__close svg {
  width: 1.25rem;
  height: 1.25rem;
}

.mv-mobile-smart-menu__body {
  flex: 1;
  overflow: auto;
  padding: 0.5rem 0 calc(1rem + env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
}

.mv-mobile-smart-menu__group {
  padding: 0.65rem 0.85rem 0.35rem;
}

.mv-mobile-smart-menu__group-title {
  margin: 0 0 0.35rem;
  padding: 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mv-shell-muted);
}

.mv-mobile-smart-menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mv-mobile-smart-menu__link {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.7rem 0.75rem;
  border-radius: 0.75rem;
  color: var(--mv-shell-fg);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.mv-mobile-smart-menu__link:hover,
.mv-mobile-smart-menu__link:focus-visible {
  background: var(--mv-shell-green-soft);
  color: var(--mv-shell-green);
  outline: none;
}

.mv-mobile-smart-menu__link--danger {
  color: #b91c1c;
}

.mv-mobile-smart-menu__logout-form {
  margin: 0;
}

.mv-mobile-smart-menu__lang {
  display: flex;
  gap: 0.5rem;
  padding: 0.35rem 0.35rem 0.65rem;
}

.mv-mobile-smart-menu__chip {
  min-height: 2.5rem;
  padding: 0.45rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid var(--mv-shell-border);
  background: transparent;
  color: var(--mv-shell-fg);
  font-weight: 600;
  cursor: pointer;
}

.mv-mobile-smart-menu__chip.is-active {
  border-color: var(--mv-shell-green);
  background: var(--mv-shell-green-soft);
  color: var(--mv-shell-green);
}

.mv-mobile-smart-menu__appearance {
  padding: 0.25rem 0.35rem 0.65rem;
}

/* Business plans page: use mobile light header at all breakpoints (match bottom-nav chrome). */
body.mv-join-business-page .mv-navbar {
  height: var(--mv-shell-header-h, 3.5rem);
  min-height: var(--mv-shell-header-h, 3.5rem);
  padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
  padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--mv-shell-bg, #ffffff) !important;
  background-image: none !important;
  color: var(--mv-shell-fg, #1f2a24) !important;
  border-bottom: 1px solid var(--mv-shell-border, rgba(31, 42, 36, 0.12)) !important;
  box-shadow: var(--mv-shell-shadow, 0 1px 0 rgba(31, 42, 36, 0.08)) !important;
  backdrop-filter: none;
}

body.mv-join-business-page .mv-navbar-logo--on-dark,
body.mv-join-business-page .mv-brand-wordmark-desktop {
  display: none !important;
}

body.mv-join-business-page .mv-navbar-logo--on-light {
  display: block !important;
  width: 2.25rem;
  height: 2.25rem;
}

body.mv-join-business-page .mv-mobile-brand-text {
  display: flex !important;
  flex-direction: column;
  line-height: 1.05;
}

body.mv-join-business-page header.sticky .mv-navbar a.mv-brand-link,
body.mv-join-business-page header.sticky .mv-navbar a.mv-brand-link span,
body.mv-join-business-page .mv-mobile-brand-text__name {
  color: var(--mv-shell-green, #0c6b34) !important;
}

/* Hide desktop green-bar chrome; keep mobile header actions + bottom nav pattern */
body.mv-join-business-page .mv-navbar > .hidden.xl\:flex {
  display: none !important;
}

body.mv-join-business-page .mv-shell-hide-mobile,
body.mv-join-business-page .mv-nav-burger-btn {
  display: none !important;
}

body.mv-join-business-page .mv-mobile-header-actions {
  display: inline-flex !important;
  align-items: center;
  gap: 0.2rem;
}

body.mv-join-business-page .mv-mobile-header-actions.xl\:hidden {
  display: inline-flex !important;
}

@media (max-width: 429px) {
  body.mv-join-business-page .mv-mobile-brand-text {
    display: none !important;
  }
}

/* Site footer links follow the theme text colour (light and dark), beating
   landing.css's generic `footer a:not(...)` green/white link rules. */
footer.mv-site-footer[data-mv-site-footer="1"] a:not(.btn):not(.mv-cta-on-green):not(.mv-cta-on-cream),
footer.mv-site-footer[data-mv-site-footer="1"] button {
  color: inherit;
  text-decoration: none;
}
footer.mv-site-footer[data-mv-site-footer="1"] a:not(.btn):not(.mv-cta-on-green):not(.mv-cta-on-cream):hover,
footer.mv-site-footer[data-mv-site-footer="1"] button:hover {
  color: inherit;
  text-decoration: underline;
}

/* Editing popups (.mv-popup): overlay + panel whose body scrolls while the
   header and footer (Done) stay visible. Sits above the fixed bottom bar
   (z-index 90) and its sheets (120/125), fits the visible viewport (dvh, not
   iOS Safari's toolbar-less vh) and keeps clear of iPhone safe areas. Panel
   look (background, radius, width, shadow) stays in the template classes. */
.mv-popup {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top, 0px)) 1rem
    max(1rem, env(safe-area-inset-bottom, 0px));
}

@media (min-width: 640px) {
  .mv-popup {
    align-items: center;
  }
}

.mv-popup__panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  max-height: calc(100vh - 2rem);
  max-height: calc(
    100dvh - 2rem - env(safe-area-inset-top, 0px) -
      env(safe-area-inset-bottom, 0px)
  );
}

.mv-popup__header,
.mv-popup__footer {
  flex: none;
}

.mv-popup__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* DaisyUI dialogs sit in the top layer (above the bottom bar) but cap the box
   at 100vh, which on iPhone is taller than the visible screen, so the actions
   at the end could fall under Safari's toolbar. Same height on desktop. */
.modal-box {
  max-height: calc(
    100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)
  );
}

.modal-bottom .modal-box {
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
}
