/**
 * VMHS native mobile shell — public portal + staff
 * Active when bottom tab bar is shown (≤1199px) or phone staff layout.
 * Transforms marketing website patterns into grouped-list app UI.
 */

/* ─── Public: native app shell (tab bar visible) ─────────────────── */
@media (max-width: 1199.98px) {
  .vmhs-public.vmhs-app-shell {
    --app-header-h: 2.75rem;
    --app-bottom-nav-h: 3.5rem;
    --app-mobile-gutter: 1rem;
    --app-native-bg: #f2f2f7;
    --app-native-group: #ffffff;
    --app-native-separator: rgba(60, 60, 67, 0.12);
    background: var(--app-native-bg) !important;
    background-image: none !important;
    -webkit-tap-highlight-color: transparent;
  }

  .vmhs-public .main {
    min-height: 0;
    padding-bottom: 0;
    background: var(--app-native-bg);
  }

  .vmhs-public .landing-container,
  .vmhs-public .app-container {
    padding-left: max(var(--app-mobile-gutter), env(safe-area-inset-left));
    padding-right: max(var(--app-mobile-gutter), env(safe-area-inset-right));
  }

  /* Native top bar */
  .vmhs-public .public-header {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    border-bottom: 0.5px solid var(--app-native-separator) !important;
    padding-top: env(safe-area-inset-top, 0px);
  }

  .vmhs-public .public-header .header-inner {
    display: grid !important;
    grid-template-columns: auto 1fr auto !important;
    grid-template-areas: "menu brand actions" !important;
    align-items: center !important;
    gap: 0.35rem !important;
    min-height: var(--app-header-h);
    padding: 0.35rem var(--app-mobile-gutter) !important;
    max-width: none !important;
  }

  .vmhs-public .public-header .header-menu-btn {
    grid-area: menu;
    justify-self: start;
  }

  .vmhs-public .public-header .brand-link {
    grid-area: brand;
    justify-self: center;
    flex: none;
    min-width: 0;
    gap: 0.4rem !important;
  }

  .vmhs-public .public-header .header-actions {
    grid-area: actions;
    justify-self: end;
    flex: none;
    gap: 0.1rem !important;
  }

  .vmhs-public .public-header .brand-link img {
    width: 2.25rem !important;
    height: 2.25rem !important;
    max-width: none !important;
    object-fit: contain !important;
    object-position: center !important;
    border-radius: 0.45rem;
    image-rendering: auto;
    flex-shrink: 0;
  }

  .vmhs-public .public-header .brand-text-app {
    display: flex !important;
    flex-direction: row !important;
    align-items: baseline;
    gap: 0.35rem;
  }

  .vmhs-public .public-header .brand-text-app strong {
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.02em;
  }

  .vmhs-public .public-header .brand-text-app > span {
    display: none;
  }

  .vmhs-public .public-header .nav-links {
    display: none !important;
  }

  /* Hide website chrome in header — tabs + menu cover navigation */
  .vmhs-public .public-header-toolbar a[href*="search"],
  .vmhs-public .public-header-toolbar a[href*="staff_login"],
  .vmhs-public .public-header-cta {
    display: none !important;
  }

  .vmhs-public .public-header-toolbar {
    background: transparent;
    border: none;
    padding: 0;
    gap: 0.1rem;
  }

  .vmhs-public .public-header-icon-btn,
  .vmhs-public .public-header-notifications__toggle,
  .vmhs-public .mobile-nav-toggle {
    width: 2.125rem;
    height: 2.125rem;
    border-radius: 0.5rem !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--app-primary) !important;
  }

  /* Bottom tab bar — iOS-style */
  .vmhs-public .app-bottom-nav {
    height: calc(var(--app-bottom-nav-h) + env(safe-area-inset-bottom, 0px));
    padding: 0.15rem 0.25rem env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 0.5px solid var(--app-native-separator);
    box-shadow: none;
  }

  .vmhs-public .app-bottom-nav a {
    gap: 0.1rem;
    min-height: 44px;
    padding: 0.15rem 0.1rem;
    font-size: 0.625rem;
    font-weight: 500;
    color: #8e8e93;
    border-radius: 0;
    background: transparent !important;
  }

  .vmhs-public .app-bottom-nav a i {
    font-size: 1.375rem;
  }

  .vmhs-public .app-bottom-nav a.is-active {
    color: var(--app-primary);
    font-weight: 600;
  }

  .vmhs-public .app-bottom-nav a.is-active i {
    color: var(--app-primary);
  }

  /* Compact app footer above tab bar */
  .vmhs-public .app-footer.app-footer--minimal {
    display: block !important;
  }

  /* Hide marketing float on small screens */
  .vmhs-public .vmhs-bonga-widget-float {
    display: none !important;
  }

  .vmhs-public .vmhs-live-chat-widget {
    display: block !important;
    visibility: visible !important;
    bottom: calc(var(--app-bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 0.5rem) !important;
    right: max(0.75rem, env(safe-area-inset-right)) !important;
    left: auto !important;
    z-index: 1100 !important;
  }

  .vmhs-public .vmhs-scroll-top {
    bottom: calc(
      var(--app-bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 0.5rem + 4.15rem
    ) !important;
    right: max(0.75rem, env(safe-area-inset-right)) !important;
  }

  /* ─── Home hero — native app card (full PC content) ────────────── */
  .vmhs-public .app-hero {
    padding: 0.65rem 0 0.85rem !important;
    background: transparent !important;
  }

  .vmhs-public .app-hero > .landing-container {
    padding-top: 0;
    padding-bottom: 0;
  }

  .vmhs-public .app-hero-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0 !important;
    margin: 0;
    padding: 0 !important;
    background: var(--app-native-group, #fff) !important;
    border: 0.5px solid rgba(60, 60, 67, 0.1) !important;
    border-radius: 0.85rem !important;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06) !important;
  }

  .vmhs-public .app-hero-card::before,
  .vmhs-public .app-hero-card::after {
    display: none !important;
  }

  .vmhs-public .app-hero-card__pattern {
    display: block !important;
    position: absolute;
    inset: 0 0 auto 0;
    height: 5.5rem;
    opacity: 0.45;
    pointer-events: none;
    mask-image: linear-gradient(180deg, #000 0%, transparent 100%);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 100%);
  }

  .vmhs-public .app-hero-card__inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 0;
    padding: 0 0 0.75rem;
  }

  .vmhs-public .app-hero-card__intro {
    padding: 1rem 1rem 0.85rem;
    background: linear-gradient(
      165deg,
      rgba(207, 244, 252, 0.55) 0%,
      rgba(255, 243, 205, 0.35) 48%,
      rgba(255, 255, 255, 0) 100%
    );
    border-bottom: 0.5px solid rgba(60, 60, 67, 0.08);
  }

  .vmhs-public .app-badge {
    display: inline-flex !important;
    margin-bottom: 0.5rem;
    padding: 0.28rem 0.65rem;
    font-size: 0.625rem;
    background: rgba(255, 255, 255, 0.88);
    border: 0.5px solid rgba(183, 103, 15, 0.18);
    box-shadow: none;
  }

  .vmhs-public .app-hero-card h1 {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin: 0 0 0.4rem;
    color: var(--app-text, #0f172a);
  }

  .vmhs-public .app-hero-lead {
    display: block;
    font-size: 0.875rem;
    line-height: 1.45;
    color: #636366;
    margin: 0;
  }

  .vmhs-public .app-hero .app-action-row {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0 0.75rem;
    padding: 0;
    background: var(--app-native-group, #fff);
    border-radius: 0.65rem;
    overflow: hidden;
    border: 0.5px solid rgba(60, 60, 67, 0.1);
    box-shadow: none;
  }

  .vmhs-public .app-hero .app-action-btn {
    flex: none;
    align-items: center;
    min-height: 3.35rem !important;
    padding: 0.7rem 0.85rem !important;
    margin: 0 !important;
    gap: 0.65rem !important;
    border-radius: 0 !important;
    border: none !important;
    border-bottom: 0.5px solid var(--app-native-separator) !important;
    background: var(--app-native-group, #fff) !important;
    color: var(--app-text) !important;
    box-shadow: none !important;
    transform: none !important;
  }

  .vmhs-public .app-hero .app-action-btn:last-child {
    border-bottom: none !important;
  }

  .vmhs-public .app-hero .app-action-btn--primary,
  .vmhs-public .app-hero .app-action-btn--ghost {
    background: var(--app-native-group, #fff) !important;
    backdrop-filter: none !important;
    color: var(--app-text) !important;
  }

  .vmhs-public .app-hero .app-action-btn:active {
    background: rgba(0, 0, 0, 0.04) !important;
  }

  .vmhs-public .app-hero .app-action-btn__icon {
    width: 2rem !important;
    height: 2rem !important;
    font-size: 1.05rem !important;
    border-radius: 0.45rem !important;
    background: var(--app-primary-muted) !important;
    color: var(--app-primary) !important;
  }

  .vmhs-public .app-hero .app-action-btn--primary .app-action-btn__icon {
    background: rgba(183, 103, 15, 0.14) !important;
    color: var(--app-primary) !important;
  }

  .vmhs-public .app-hero .app-action-btn__desc {
    display: block !important;
    font-size: 0.75rem !important;
    font-weight: 400 !important;
    line-height: 1.35 !important;
    color: #8e8e93 !important;
    margin-top: 0.1rem;
  }

  .vmhs-public .app-hero .app-action-btn__title {
    font-size: 0.9375rem !important;
    font-weight: 500 !important;
    line-height: 1.25;
  }

  .vmhs-public .app-hero .app-action-btn__arrow {
    color: #c7c7cc !important;
    font-size: 1rem !important;
    opacity: 1 !important;
    flex-shrink: 0;
  }

  .vmhs-public .app-hero .app-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin: 0 0.75rem;
    padding: 0.55rem 0.25rem;
    background: var(--app-native-group, #fff);
    border-radius: 0.65rem;
    border: 0.5px solid rgba(60, 60, 67, 0.1);
  }

  .vmhs-public .app-hero .app-stat {
    text-align: center;
    padding: 0.2rem 0.25rem;
    border-right: 0.5px solid var(--app-native-separator);
  }

  .vmhs-public .app-hero .app-stat:last-child {
    border-right: none;
  }

  .vmhs-public .app-hero .app-stat__icon {
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.15rem;
    font-size: 0.85rem;
    color: var(--app-primary);
    opacity: 0.9;
  }

  .vmhs-public .app-hero .app-stat__value {
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--app-text, #0f172a);
  }

  .vmhs-public .app-hero .app-stat__label {
    font-size: 0.5625rem;
    font-weight: 500;
    color: #8e8e93;
    line-height: 1.2;
  }

  /* Explore / secondary sections */
  .vmhs-public .app-section {
    padding: 0.75rem 0 1rem;
    background: transparent;
  }

  .vmhs-public .app-section--alt {
    background: transparent;
    border: none;
  }

  .vmhs-public .app-steps {
    display: flex !important;
    flex-direction: column;
    gap: 0;
    margin-bottom: 0.75rem;
    background: var(--app-native-group);
    border-radius: 0.625rem;
    overflow: hidden;
  }

  .vmhs-public .app-step {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 0.15rem 0.65rem;
    padding: 0.75rem 0.85rem;
    border-bottom: 0.5px solid var(--app-native-separator);
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    text-align: left;
  }

  .vmhs-public .app-step:last-child {
    border-bottom: none;
  }

  .vmhs-public .app-step__num {
    grid-row: 1 / span 2;
    align-self: center;
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.6875rem;
    line-height: 1.5rem;
    border-radius: 999px;
    background: var(--app-primary-muted);
    color: var(--app-primary);
  }

  .vmhs-public .app-step__icon {
    display: none;
  }

  .vmhs-public .app-step h3 {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.25;
  }

  .vmhs-public .app-step p {
    margin: 0;
    grid-column: 2;
    font-size: 0.75rem;
    line-height: 1.4;
    color: #8e8e93;
  }

  .vmhs-public .app-section__head {
    margin-bottom: 0.5rem;
    text-align: left !important;
    padding: 0 0.15rem;
  }

  .vmhs-public .app-section__head h2,
  .vmhs-public .app-section__head h3 {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #8e8e93;
    margin: 0 0 0.25rem;
  }

  .vmhs-public .app-section__head p {
    display: block;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: #8e8e93;
    margin: 0;
  }

  .vmhs-public .app-section__head--sub {
    display: block;
    margin-top: 0.75rem;
  }

  .vmhs-public .app-tile-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--app-native-group);
    border-radius: 0.625rem;
    overflow: hidden;
  }

  .vmhs-public .app-tile {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 0.65rem;
    row-gap: 0.1rem;
    height: auto;
    min-height: 3.25rem;
    padding: 0.7rem 0.85rem;
    border-radius: 0;
    border: none;
    border-bottom: 0.5px solid var(--app-native-separator);
    box-shadow: none;
    transform: none !important;
  }

  .vmhs-public .app-tile__icon {
    grid-row: 1 / span 2;
    width: 1.75rem;
    height: 1.75rem;
    font-size: 1rem;
    flex-shrink: 0;
    border-radius: 0.375rem;
    align-self: center;
  }

  .vmhs-public .app-tile__title {
    font-size: 0.9375rem;
    font-weight: 500;
    grid-column: 2;
    grid-row: 1;
    align-self: end;
  }

  .vmhs-public .app-tile__desc {
    display: block;
    grid-column: 2;
    grid-row: 2;
    font-size: 0.75rem;
    line-height: 1.35;
    color: #8e8e93;
    align-self: start;
  }

  .vmhs-public .app-tile::after {
    content: "›";
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
    font-size: 1.15rem;
    font-weight: 400;
    line-height: 1;
    color: #c7c7cc;
  }

  .vmhs-public .app-tile:last-child {
    border-bottom: none;
  }

  .vmhs-public .app-tile:active {
    background: rgba(0, 0, 0, 0.04);
  }

  .vmhs-public .vmhs-staff-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    margin-top: 0.75rem;
    padding: 0.75rem 0.85rem;
    border-radius: 0.625rem;
    background: var(--app-native-group);
    border: none;
    box-shadow: none;
  }

  .vmhs-public .vmhs-staff-strip .btn {
    flex-shrink: 0;
  }

  /* ─── Inner pages ─────────────────────────────────────────────── */
  .vmhs-public .vmhs-public-page-head {
    padding: 0.5rem 0 0.35rem;
    background: var(--app-native-bg) !important;
  }

  .vmhs-public .vmhs-public-page-head__inner {
    padding: 0.9rem 1rem 0.95rem 1.1rem;
    border-radius: 0.85rem;
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow: none;
  }

  .vmhs-public .vmhs-public-page-head__inner::before {
    top: 0.75rem;
    bottom: 0.75rem;
  }

  .vmhs-public .vmhs-public-page-head__title {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
  }

  .vmhs-public .vmhs-public-page-head__lead {
    font-size: 0.8125rem;
    color: #8e8e93;
  }

  .vmhs-public .app-page--after-hero > .landing-container {
    padding-top: 0.65rem;
    padding-bottom: 1rem;
  }

  .vmhs-public .app-card,
  .vmhs-public .app-list-panel,
  .vmhs-public .app-detail-panel {
    border: none;
    border-radius: 0.625rem;
    box-shadow: none;
    background: var(--app-native-group);
  }

  .vmhs-public a.app-card:hover,
  .vmhs-public .app-card--interactive:hover {
    transform: none !important;
    box-shadow: none !important;
  }

  .vmhs-public .app-card__body {
    padding: 0.85rem 1rem;
  }

  .vmhs-public .app-search-bar {
    border: none;
    border-radius: 0.625rem;
    box-shadow: none;
    padding: 0.85rem;
    margin-bottom: 0.75rem;
  }

  .vmhs-public .app-list-panel__item {
    border-bottom: 0.5px solid var(--app-native-separator);
    padding: 0.75rem 1rem;
  }

  .vmhs-public .app-list-panel__item:last-child {
    border-bottom: none;
  }

  /* Guest hub */
  .vmhs-public .guest-dash-layout {
    gap: 0.65rem;
  }

  .vmhs-public .guest-hub-nav {
    background: var(--app-native-group);
    border-radius: 0.625rem;
    padding: 0.35rem;
    margin-bottom: 0.35rem;
  }

  .vmhs-public .guest-dash-stat,
  .vmhs-public .guest-dash-sidebar .app-card {
    border: none;
    box-shadow: none;
    border-radius: 0.625rem;
  }

  .vmhs-public .app-auth-card,
  .vmhs-public .vmhs-auth-card {
    border: none;
    border-radius: 0.625rem;
    box-shadow: none;
  }

  .vmhs-public .vmhs-notices-banner,
  .vmhs-public .alert {
    border-radius: 0.625rem;
    margin-bottom: 0.5rem;
  }
}

@media (max-width: 575.98px) {
  .vmhs-public .app-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vmhs-public .app-stat:nth-child(2) {
    border-right: none;
  }

  .vmhs-public .app-stat:nth-child(-n + 2) {
    border-bottom: 0.5px solid var(--app-native-separator);
    padding-bottom: 0.5rem;
    margin-bottom: 0.15rem;
  }
}

/* ─── Staff: native mobile workspace ───────────────────────────── */
@media (max-width: 1024.98px) {
  .vmhs-app.vmhs-desktop-shell,
  body[data-vmhs-theme].vmhs-desktop-shell {
    --vmhs-native-bg: #f2f2f7;
    --vmhs-native-group: #ffffff;
    --vmhs-native-separator: rgba(60, 60, 67, 0.12);
    background: var(--vmhs-native-bg);
  }

  .vmhs-app .pc-content,
  body[data-vmhs-theme] .pc-content {
    background: var(--vmhs-native-bg) !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .vmhs-app .card,
  body[data-vmhs-theme] .card,
  .vmhs-app .metric-card,
  body[data-vmhs-theme] .metric-card {
    border: none !important;
    border-radius: 0.625rem !important;
    box-shadow: none !important;
  }

  .vmhs-app .card:hover,
  body[data-vmhs-theme] .card:hover,
  .vmhs-app .metric-card:hover,
  body[data-vmhs-theme] .metric-card:hover {
    transform: none !important;
    box-shadow: none !important;
  }

  .vmhs-app .pc-header.vmhs-toolbar,
  body[data-vmhs-theme] .pc-header.vmhs-toolbar {
    background: rgba(255, 255, 255, 0.98) !important;
    border-bottom: 0.5px solid var(--vmhs-native-separator) !important;
    box-shadow: none !important;
    padding-top: env(safe-area-inset-top, 0px);
    min-height: 2.75rem;
  }

  .vmhs-app .pc-footer.vmhs-footer,
  body[data-vmhs-theme] .pc-footer.vmhs-footer {
    display: block !important;
  }

  .vmhs-app .vmhs-page-header,
  body[data-vmhs-theme] .vmhs-page-header {
    background: transparent;
    border: none;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
  }

  .vmhs-app .vmhs-page-header__title,
  body[data-vmhs-theme] .vmhs-page-header__title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
  }

  .vmhs-app .table-responsive,
  body[data-vmhs-theme] .table-responsive {
    border-radius: 0.625rem;
    background: var(--vmhs-native-group);
    border: none;
  }

  .vmhs-app .table,
  body[data-vmhs-theme] .table {
    margin-bottom: 0;
  }
}

@media (max-width: 767.98px) {
  .vmhs-app .pc-content,
  body[data-vmhs-theme] .pc-content {
    padding: 0.5rem max(0.75rem, env(safe-area-inset-left)) 0.75rem max(0.75rem, env(safe-area-inset-right)) !important;
  }

  .vmhs-app .card .card-body,
  body[data-vmhs-theme] .card .card-body,
  .vmhs-app .metric-card .card-body,
  body[data-vmhs-theme] .metric-card .card-body {
    padding: 0.75rem !important;
  }

  .vmhs-app .vmhs-status-strip,
  body[data-vmhs-theme] .vmhs-status-strip {
    background: var(--vmhs-native-group);
    border-radius: 0.625rem;
    padding: 0.35rem 0.5rem;
    border: none;
  }
}

@media (min-width: 1200px) {
  .vmhs-public .public-header .header-menu-btn {
    display: none !important;
  }
}
