/* Mobile shell (native phone) — bottom nav + connectivity banner */
:root {
    --mobile-bg: #f3f5f8;
    --mobile-surface: #ffffff;
    --mobile-text: #14213d;
    --mobile-text-muted: #5b6478;
    --mobile-border: #e5e9f0;
    --mobile-primary: #1a56db;
    --mobile-bottom-h: 64px;
    --mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
    --mobile-safe-top: env(safe-area-inset-top, 0px);
    /* Breakpoints — also documented in MetroBreakpoints.cs and metroAsap.js */
    --metro-breakpoint-narrow: 768px;
    --metro-breakpoint-portal-nav: 900px;
    --metro-breakpoint-tablet-max: 991px;
    --metro-breakpoint-compact: 640px;
    --metro-breakpoint-xs: 480px;
    --metro-touch-target-min: 48px;
    --mobile-shell-content-pad: calc(var(--mobile-bottom-h) + var(--mobile-safe-bottom) + 1rem);
}

:root[data-theme="dark"] {
    --mobile-bg: #000000;
    --mobile-surface: #0c0c0c;
    --mobile-text: #f5f5f5;
    --mobile-text-muted: #a3a3a3;
    --mobile-border: #232323;
}

.mobile-shell {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--mobile-bg);
    color: var(--mobile-text);
    /* Bottom clearance lives on .page-body via --mobile-shell-content-pad (avoid double pad). */
    padding-bottom: 0;
}

.mobile-shell__body {
    flex: 1;
    min-height: 0;
}

.mobile-shell__body--pull {
    overflow-y: auto;
    overscroll-behavior-y: contain;
}

.mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    height: calc(var(--mobile-bottom-h) + var(--mobile-safe-bottom));
    padding-bottom: var(--mobile-safe-bottom);
    background: var(--mobile-surface);
    border-top: 1px solid var(--mobile-border);
    box-shadow: 0 -4px 16px rgba(20, 33, 61, .06);
    isolation: isolate;
}

.mobile-bottom-nav__item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: var(--mobile-text-muted);
    font-size: 10px;
    font-weight: 600;
    min-width: 0;
    min-height: 48px;
    padding: 0 2px;
    -webkit-tap-highlight-color: transparent;
}

.mobile-bottom-nav__item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-bottom-nav__item i {
    font-size: 22px;
    line-height: 1;
}

.mobile-bottom-nav__item.active {
    color: var(--mobile-primary);
}

.mobile-bottom-nav-customize-btn {
    flex: 0 0 auto;
    align-self: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    margin: 0 8px 0 4px;
    border-radius: 10px;
    border: 1px solid var(--mobile-border);
    background: var(--mobile-bg);
    color: var(--mobile-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    z-index: auto;
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav-editor-preview {
    margin-bottom: 1rem;
}

.mobile-nav-editor-preview-bar {
    display: flex;
    gap: 4px;
    padding: 8px;
    border-radius: 12px;
    background: var(--bs-light, #f8f9fa);
    border: 1px solid var(--bs-border-color, #dee2e6);
}

.mobile-nav-editor-preview-slot {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 52px;
    font-size: 10px;
    font-weight: 600;
    color: var(--bs-secondary, #6c757d);
    border-radius: 8px;
    background: #fff;
}

.mobile-nav-editor-preview-slot i {
    font-size: 18px;
}

.mobile-nav-editor-preview-slot--empty {
    opacity: .45;
    border: 1px dashed var(--bs-border-color, #dee2e6);
    background: transparent;
}

.mobile-nav-editor-preview-slot--menu {
    color: var(--bs-primary, #0d6efd);
}

.mobile-nav-editor-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1300;
    background: rgba(15, 23, 42, .45);
}

.mobile-nav-editor-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1310;
    max-height: 85vh;
    background: var(--bs-body-bg, #fff);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 32px rgba(15, 23, 42, .2);
    display: flex;
    flex-direction: column;
}

.mobile-nav-editor-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
    flex-shrink: 0;
}

.mobile-nav-editor-sheet-body {
    overflow-y: auto;
    padding: 16px;
    padding-bottom: calc(16px + var(--mobile-safe-bottom, 0px));
}

.mobile-connectivity-banner {
    position: sticky;
    top: 0;
    z-index: 1100;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.mobile-connectivity-banner--offline {
    background: #fdecea;
    color: #7a0e0e;
    border-bottom: 1px solid #f5c2c0;
}

.mobile-connectivity-banner--online {
    background: #d1e7dd;
    color: #0f5132;
    border-bottom: 1px solid #badbcc;
}

:root[data-theme="dark"] .mobile-connectivity-banner--offline {
    background: rgba(122, 14, 14, 0.35);
    color: #fca5a5;
}

:root[data-theme="dark"] .mobile-connectivity-banner--online {
    background: rgba(15, 81, 50, 0.35);
    color: #86efac;
}

.mobile-pull-hint {
    text-align: center;
    font-size: 12px;
    color: var(--mobile-text-muted);
    padding: 4px 0 8px;
}

/* Dock "More" button */
.dock-more-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: none;
    background: transparent;
    color: var(--mobile-text-muted);
    font-size: 11px;
    font-weight: 600;
    min-height: 48px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
}

.dock-more-btn i {
    font-size: 22px;
    line-height: 1;
}

.dock-more-btn--open,
.dock-more-btn:active {
    color: var(--mobile-primary);
}

/* Dock "More" slide-up drawer */
.dock-more-drawer {
    position: fixed;
    inset: 0;
    z-index: 1300;
    pointer-events: none;
}

.dock-more-drawer--open {
    pointer-events: auto;
}

.dock-more-drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
}

.dock-more-drawer--open .dock-more-drawer__backdrop {
    background: rgba(0, 0, 0, 0.45);
}

.dock-more-drawer__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(var(--mobile-bottom-h) + var(--mobile-safe-bottom));
    background: var(--mobile-surface);
    border-top: 1px solid var(--mobile-border);
    border-radius: 16px 16px 0 0;
    padding: 8px 0 env(safe-area-inset-bottom, 0px);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 -8px 32px rgba(20, 33, 61, 0.12);
}

.dock-more-drawer--open .dock-more-drawer__panel {
    transform: translateY(0);
}

.dock-more-drawer__handle {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--mobile-border);
    margin: 0 auto 8px;
}

.dock-more-drawer__item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 56px;
    padding: 0 20px;
    border: none;
    background: transparent;
    color: var(--mobile-text);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}

.dock-more-drawer__item:active {
    background: var(--mobile-bg);
}

.dock-more-drawer__icon {
    font-size: 22px;
    color: var(--mobile-primary);
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

/* Staff mobile menu (all pages drawer) */
.staff-mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 1350;
    pointer-events: none;
}

.staff-mobile-menu--open {
    pointer-events: auto;
}

.staff-mobile-menu__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
}

.staff-mobile-menu--open .staff-mobile-menu__backdrop {
    background: rgba(0, 0, 0, 0.45);
}

.staff-mobile-menu__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(var(--mobile-bottom-h) + var(--mobile-safe-bottom));
    top: 12vh;
    background: var(--mobile-surface);
    border-top: 1px solid var(--mobile-border);
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 -8px 32px rgba(20, 33, 61, 0.12);
}

.staff-mobile-menu--open .staff-mobile-menu__panel {
    transform: translateY(0);
}

.staff-mobile-menu__handle {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--mobile-border);
    margin: 8px auto 0;
    flex-shrink: 0;
}

.staff-mobile-menu__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px 4px;
    flex-shrink: 0;
}

.staff-mobile-menu__title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.staff-mobile-menu__close {
    color: var(--mobile-text);
    text-decoration: none;
}

.staff-mobile-menu__search {
    display: flex;
    gap: 8px;
    padding: 0 16px 8px;
    flex-shrink: 0;
}

.staff-mobile-menu__entity-search {
    flex-shrink: 0;
}

.staff-mobile-menu__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    -webkit-overflow-scrolling: touch;
}

.staff-mobile-menu__section {
    padding: 4px 0 8px;
}

.staff-mobile-menu__section-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--mobile-muted, #6c757d);
    padding: 8px 20px 4px;
}

.staff-mobile-menu__item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 48px;
    padding: 0 20px;
    border: none;
    background: transparent;
    color: var(--mobile-text);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}

.staff-mobile-menu__item:active {
    background: var(--mobile-bg);
}

.staff-mobile-menu__item--group {
    justify-content: flex-start;
}

.staff-mobile-menu__item--group span {
    flex: 1;
}

.staff-mobile-menu__icon {
    font-size: 20px;
    color: var(--mobile-primary);
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.staff-mobile-menu__chevron {
    font-size: 14px;
    color: var(--mobile-muted, #6c757d);
    margin-left: auto;
}

.mobile-shell .admin-users-search {
    width: 100%;
}

.mobile-shell .admin-users-mobile-list {
    border-top: 1px solid var(--bs-border-color);
}

.mobile-shell .admin-users-mobile-card {
    display: block;
    width: 100%;
    padding: 14px 16px;
    border: none;
    border-bottom: 1px solid var(--bs-border-color);
    background: transparent;
    color: inherit;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}

.mobile-shell .admin-users-mobile-card:active {
    background: var(--bs-tertiary-bg);
}

/* ── Mobile shell active: bottom nav + layout chrome adjustments ── */
.mobile-shell .sidebar,
.mobile-shell .sidebar-backdrop {
    display: none !important;
}

.mobile-shell .page-body,
.mobile-shell .portal-main,
.mobile-shell .portal-body-container,
.mobile-shell .login-bg {
    padding-bottom: var(--mobile-shell-content-pad);
}

.mobile-shell .portal-footer,
.mobile-shell .metro-trust-footer {
    padding-bottom: calc(0.75rem + var(--mobile-bottom-h) + var(--mobile-safe-bottom));
}

.mobile-shell .portal-sidenav {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    margin: 0 -0.75rem 0.75rem;
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.mobile-shell .portal-sidenav::-webkit-scrollbar {
    display: none;
}

.mobile-shell .portal-sidenav .portal-sidenav-item {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 0.85rem;
    padding: 0.35rem 0.65rem;
}

.mobile-shell .metro-fab-stack {
    bottom: calc(var(--mobile-bottom-h) + var(--mobile-safe-bottom) + 0.85rem);
    right: 0.85rem;
    gap: 0.65rem;
}

.mobile-shell .metro-assist-dock {
    bottom: auto;
    position: relative;
}

.mobile-shell .metro-fab-stack__request {
    display: none !important;
}

/* Staff: request lives in assist sheet. Portal users keep a compact FAB. */
.mobile-shell .metro-fab-stack:has(.metro-assist-dock) .metro-sys-notify-fab {
    display: none !important;
}

.mobile-shell .metro-sys-notify-fab {
    width: 2.75rem;
    height: 2.75rem;
}

.mobile-shell .metro-assist-fab,
.mobile-shell .metro-ai-fab,
.mobile-shell .metro-msg-fab {
    width: 3.25rem;
    height: 3.25rem;
    min-width: 3.25rem;
    min-height: 3.25rem;
}

.mobile-shell .metro-assist-sheet {
    margin-bottom: 0.5rem;
    max-width: min(20rem, calc(100vw - 2rem));
    border-radius: 14px;
    overflow: hidden;
}

.mobile-shell .metro-assist-sheet .list-group-item {
    min-height: var(--metro-touch-target-min, 48px);
    display: flex;
    align-items: center;
}

.mobile-shell .topbar {
    /* Single top inset: expand bar instead of squeezing fixed 56px content. */
    height: auto;
    min-height: calc(var(--topbar-height, 56px) + var(--mobile-safe-top));
    padding-top: var(--mobile-safe-top);
    box-sizing: border-box;
}

.mobile-shell .topbar-icon-btn,
.mobile-shell .topbar-pin-btn {
    min-width: var(--metro-touch-target-min, 48px);
    min-height: var(--metro-touch-target-min, 48px);
    width: var(--metro-touch-target-min, 48px);
    height: var(--metro-touch-target-min, 48px);
}

.mobile-shell .topbar-menu-btn {
    display: none !important;
}

.mobile-shell .metro-toast-container {
    bottom: calc(var(--mobile-bottom-h) + var(--mobile-safe-bottom) + 0.75rem);
}

.mobile-shell .page-body {
    overflow-y: visible;
}

.mobile-shell .main-content {
    margin-left: 0 !important;
    width: 100%;
}

.mobile-shell .metro-layout {
    --sidebar-width: 0px;
}

.mobile-shell .portal-header-inner {
    padding-top: calc(0.5rem + var(--mobile-safe-top));
}

.mobile-shell .portal-header-inner .h5 {
    font-size: 1rem;
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-shell .login-bg {
    min-height: 100dvh;
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
}

.mobile-shell .login-bg .card,
.mobile-shell .public-branded-shell {
    max-width: 100%;
}

.mobile-shell input.form-control,
.mobile-shell input.form-select,
.mobile-shell select.form-select,
.mobile-shell textarea.form-control {
    font-size: max(16px, 1rem);
}

.mobile-shell .parks-portal-bottom-nav {
    display: none !important;
}

/* Compact staff top bar on mobile shell */
.mobile-shell .topbar-search {
    display: none !important;
}

.mobile-shell .topbar-desktop-chrome {
    display: none !important;
}

.mobile-shell .topbar-mobile-chrome {
    display: inline-flex !important;
}

.mobile-shell .topbar {
    flex-wrap: nowrap;
    gap: 0.35rem;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
}

.mobile-shell .topbar-actions {
    flex-wrap: nowrap !important;
    gap: 0.25rem !important;
    min-width: 0;
}

.mobile-shell .topbar-user-cluster .topbar-dept-scope-btn,
.mobile-shell .topbar-whats-new-btn,
.mobile-shell .topbar-pin-btn {
    display: none !important;
}

.mobile-shell .topbar-avatar-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--metro-touch-target-min, 48px);
    min-height: var(--metro-touch-target-min, 48px);
    padding: 0;
    border: 1px solid var(--mobile-border);
    border-radius: 14px;
    background: var(--mobile-surface);
    -webkit-tap-highlight-color: transparent;
}

.mobile-shell .topbar-avatar-trigger .topbar-avatar {
    width: 2rem;
    height: 2rem;
    font-size: 0.85rem;
}

/* Account sheet (mobile topbar overflow) */
.topbar-account-sheet {
    position: fixed;
    inset: 0;
    z-index: 1320;
    pointer-events: none;
}

.topbar-account-sheet--open {
    pointer-events: auto;
}

.topbar-account-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    opacity: 0;
    transition: opacity .2s ease;
}

.topbar-account-sheet--open .topbar-account-sheet__backdrop {
    opacity: 1;
}

.topbar-account-sheet__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: min(85vh, 640px);
    display: flex;
    flex-direction: column;
    background: var(--mobile-surface);
    color: var(--mobile-text);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 32px rgba(15, 23, 42, .2);
    padding-bottom: var(--mobile-safe-bottom);
    transform: translateY(100%);
    transition: transform .22s ease;
}

.topbar-account-sheet--open .topbar-account-sheet__panel {
    transform: translateY(0);
}

.topbar-account-sheet__handle {
    width: 36px;
    height: 4px;
    border-radius: 999px;
    background: var(--mobile-border);
    margin: 0.5rem auto 0;
    flex-shrink: 0;
}

.topbar-account-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem 0.5rem;
    border-bottom: 1px solid var(--mobile-border);
    flex-shrink: 0;
}

.topbar-account-sheet__identity {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.topbar-account-sheet__avatar {
    flex-shrink: 0;
}

.topbar-account-sheet__name {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.2;
}

.topbar-account-sheet__role {
    font-size: 0.8rem;
    color: var(--mobile-text-muted);
}

.topbar-account-sheet__close {
    min-width: var(--metro-touch-target-min, 48px);
    min-height: var(--metro-touch-target-min, 48px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--mobile-text-muted);
    text-decoration: none;
}

.topbar-account-sheet__body {
    overflow-y: auto;
    padding: 0.5rem 0 calc(0.75rem + var(--mobile-bottom-h, 64px));
    -webkit-overflow-scrolling: touch;
}

.topbar-account-sheet__section {
    padding: 0.5rem 1rem 0.75rem;
    border-bottom: 1px solid var(--mobile-border);
}

.topbar-account-sheet__section:last-child {
    border-bottom: none;
}

.topbar-account-sheet__section-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--mobile-text-muted);
    margin-bottom: 0.5rem;
}

.topbar-account-sheet__section .accessibility-quick-toggles {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
}

.topbar-account-sheet__section .accessibility-quick-toggles .btn {
    flex: 1 1 0;
    min-height: var(--metro-touch-target-min, 48px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem;
}

.topbar-account-sheet__section .accessibility-quick-toggles .btn .d-none,
.topbar-account-sheet__section .accessibility-quick-toggles .btn .d-md-inline {
    display: none !important;
}

.topbar-account-sheet__portal,
.topbar-account-sheet__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.topbar-account-sheet__item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-height: var(--metro-touch-target-min, 48px);
    padding: 0.65rem 0.25rem;
    border: none;
    background: transparent;
    color: var(--mobile-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}

.topbar-account-sheet__item i {
    font-size: 1.15rem;
    width: 1.35rem;
    text-align: center;
    color: var(--mobile-text-muted);
}

.topbar-account-sheet__item:active {
    background: rgba(26, 86, 219, 0.06);
}

.topbar-account-sheet__item--danger {
    color: #b42318;
}

.topbar-account-sheet__item--danger i {
    color: #b42318;
}

.topbar-account-sheet__item .topbar-whats-new-badge {
    margin-left: auto;
}

/* Prevent horizontal overflow on dense staff/portal pages */
.mobile-shell .main-content,
.mobile-shell .page-body,
.mobile-shell .page-content {
    overflow-x: hidden;
    max-width: 100%;
}

/* Page headers and toolbars stack on narrow viewports */
@media (max-width: 768px) {
    .mobile-shell .page-header,
    .mobile-shell .metro-page-header,
    .mobile-shell .metro-page-shell-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem;
        margin-bottom: 1rem !important;
    }

    .mobile-shell .page-header h1,
    .mobile-shell .page-header h2,
    .mobile-shell .metro-page-header h1,
    .mobile-shell .metro-page-header h2 {
        font-size: 1.35rem;
        line-height: 1.25;
    }

    .mobile-shell .page-header-city-logo {
        width: 2.25rem;
        height: 2.25rem;
    }

    .mobile-shell .page-header-actions,
    .mobile-shell .metro-page-header__actions,
    .mobile-shell .page-header > .d-flex.flex-wrap,
    .mobile-shell .page-header > .d-flex.align-items-center.gap-2 {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: flex-start !important;
        align-items: stretch !important;
    }

    .mobile-shell .page-header-actions > .btn,
    .mobile-shell .page-header-actions > a.btn,
    .mobile-shell .metro-page-header__actions > .btn,
    .mobile-shell .metro-page-header__actions > a.btn,
    .mobile-shell .page-header > .d-flex.flex-wrap > .btn,
    .mobile-shell .page-header > .d-flex.flex-wrap > a.btn,
    .mobile-shell .page-header > .d-flex.align-items-center.gap-2 > .btn,
    .mobile-shell .page-header > .d-flex.align-items-center.gap-2 > a.btn {
        flex: 1 1 calc(50% - 0.25rem);
        min-width: 0;
        min-height: var(--metro-touch-target-min, 48px);
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-shell .page-header-actions > .btn-group,
    .mobile-shell .page-header-actions > .dropdown,
    .mobile-shell .metro-page-header__actions > .btn-group,
    .mobile-shell .metro-page-header__actions > .dropdown,
    .mobile-shell .page-header > .d-flex.flex-wrap > .btn-group,
    .mobile-shell .page-header > .d-flex.flex-wrap > .dropdown,
    .mobile-shell .page-header > .d-flex.align-items-center.gap-2 > .btn-group,
    .mobile-shell .page-header > .d-flex.align-items-center.gap-2 > .dropdown {
        flex: 1 1 100%;
    }

    .mobile-shell .page-header-actions > .btn-group > .btn,
    .mobile-shell .page-header-actions > .dropdown > .btn,
    .mobile-shell .metro-page-header__actions > .btn-group > .btn,
    .mobile-shell .metro-page-header__actions > .dropdown > .btn {
        width: 100%;
        justify-content: center;
    }

    .mobile-shell .page-header > .d-flex.flex-wrap > .text-muted,
    .mobile-shell .page-header > .d-flex.align-items-center.gap-2 > .text-muted,
    .mobile-shell .page-header-actions > .text-muted {
        flex: 1 1 100%;
        margin-bottom: 0.15rem;
    }

    .mobile-shell .btn-toolbar,
    .mobile-shell .metro-toolbar {
        flex-wrap: wrap;
        gap: 0.5rem;
        max-width: 100%;
    }

    .mobile-shell .btn-toolbar .btn,
    .mobile-shell .metro-toolbar .btn {
        min-height: var(--metro-touch-target-min, 48px);
    }

    .mobile-shell .row.g-3 > [class*="col-md"],
    .mobile-shell .row.g-3 > [class*="col-lg"],
    .mobile-shell .row.g-2 > [class*="col-md"],
    .mobile-shell .row.g-2 > [class*="col-lg"],
    .mobile-shell .row.g-4 > [class*="col-md"],
    .mobile-shell .row.g-4 > [class*="col-lg"] {
        min-width: 0;
    }

    /* Awareness / alert banners */
    .mobile-shell .alert {
        padding: 0.85rem 0.95rem;
        border-radius: 12px;
    }

    .mobile-shell .alert .alert-heading {
        font-size: 1rem;
        line-height: 1.3;
    }

    .mobile-shell .action-center-awareness .alert,
    .mobile-shell .alert.shadow-sm {
        margin-bottom: 0.75rem !important;
    }

    .mobile-shell .alert > .d-flex.gap-3 {
        gap: 0.65rem !important;
    }

    .mobile-shell .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .mobile-shell .modal-dialog-centered {
        min-height: calc(100% - 1rem);
    }

    .mobile-shell .modal-dialog-scrollable .modal-body {
        max-height: min(70vh, 32rem);
    }

    .mobile-shell .offcanvas-bottom {
        max-height: min(90vh, 40rem);
        padding-bottom: var(--mobile-safe-bottom);
    }

    .mobile-shell .form-label {
        margin-bottom: 0.35rem;
    }

    .mobile-shell .card-body {
        padding: 0.9rem 1rem;
    }

    .mobile-shell .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0.15rem;
    }

    .mobile-shell .nav-tabs::-webkit-scrollbar {
        display: none;
    }

    .mobile-shell .nav-tabs .nav-link {
        white-space: nowrap;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

/* Sticky / fixed bottom CTAs clear the bottom nav */
.mobile-shell .mobile-shell-pad-bottom,
.mobile-shell .page-sticky-footer-actions,
.mobile-shell .metro-fixed-bottom-actions {
    padding-bottom: calc(0.75rem + var(--mobile-bottom-h) + var(--mobile-safe-bottom)) !important;
}

.mobile-shell .page-sticky-footer-actions,
.mobile-shell .metro-fixed-bottom-actions {
    position: sticky;
    bottom: 0;
    z-index: 50;
    background: linear-gradient(180deg, transparent, var(--mobile-bg) 28%);
    padding-top: 0.75rem;
}

.mobile-shell .table-responsive,
.mobile-shell .parks-admin-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.mobile-shell .mobile-connectivity-banner {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-shell .mobile-bottom-nav__item,
.mobile-shell .dock-more-btn {
    font-size: 12px;
}

/* Safety net: horizontal scroll for bare tables not wrapped in table-responsive */
.mobile-shell .page-body > table,
.mobile-shell .metro-card > table,
.mobile-shell .card > table,
.mobile-shell .card-body > table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-shell .page-body > table thead,
.mobile-shell .page-body > table tbody,
.mobile-shell .page-body > table tr,
.mobile-shell .metro-card > table thead,
.mobile-shell .metro-card > table tbody,
.mobile-shell .metro-card > table tr,
.mobile-shell .card > table thead,
.mobile-shell .card > table tbody,
.mobile-shell .card > table tr,
.mobile-shell .card-body > table thead,
.mobile-shell .card-body > table tbody,
.mobile-shell .card-body > table tr {
    display: table;
    width: 100%;
    table-layout: auto;
}

.mobile-shell .page-body > table,
.mobile-shell .metro-card > table,
.mobile-shell .card > table,
.mobile-shell .card-body > table {
    table-layout: auto;
}

/* Filter / offcanvas drawers on narrow viewports */
.offcanvas-end.metro-filter-drawer {
    --bs-offcanvas-width: min(480px, 95vw);
}

/* Tablet zone (769–991px): desktop shell — extra page padding */
@media (min-width: 769px) and (max-width: 991px) {
    .mobile-shell .page-body {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* Public city landing hero — collapse height and stack CTAs on narrow viewports */
@media (max-width: 768px) {
    .city-landing-hero {
        min-height: 42vh;
    }

    .city-landing-hero__overlay {
        padding: 40px 16px;
    }

    .city-landing-hero__title {
        font-size: 1.85rem;
    }

    .city-landing-hero__cta {
        flex-direction: column;
        align-items: stretch;
    }

    .city-landing-hero__cta .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .city-landing-hero {
        min-height: 36vh;
    }

    .city-landing-hero__title {
        font-size: 1.5rem;
    }
}

/* ── Work orders — list + detail on narrow viewports ── */
@media (max-width: 768px) {
    .work-orders-index .page-header {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem;
        margin-bottom: 1rem !important;
    }

    .work-orders-index .page-header h2 {
        font-size: 1.35rem;
    }

    .work-orders-index .page-header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .work-orders-index .page-header-actions .btn .btn-label {
        display: none;
    }

    .work-orders-index .work-orders-list-toolbar {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.5rem;
    }

    .work-orders-index .work-orders-list-toolbar .btn-group {
        width: 100%;
    }

    .work-orders-index .work-orders-list-toolbar .btn-group .btn {
        flex: 1 1 0;
        min-height: var(--metro-touch-target-min, 48px);
    }

    .work-orders-index .work-order-list-card {
        min-height: var(--metro-touch-target-min, 48px);
        transition: transform 0.12s ease, box-shadow 0.12s ease;
    }

    .work-orders-index .work-order-list-card:active {
        transform: scale(0.99);
    }

    .work-orders-index .work-order-list-card .card-body {
        padding: 1rem;
    }

    .work-order-detail-page {
        padding-top: 0.75rem !important;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px)) !important;
    }

    .mobile-shell .work-order-detail-page {
        padding-bottom: var(--mobile-shell-content-pad, 1rem) !important;
    }

    .work-order-detail-page .work-order-detail-header-card .wo-detail-hero__body,
    .work-order-detail-page .work-order-detail-header-card .card-body {
        padding: 0.875rem 1rem 0.75rem !important;
    }

    .work-order-detail-page .work-order-detail-header-card .wo-detail-hero__title,
    .work-order-detail-page .work-order-detail-header-card h1.h3 {
        font-size: 1.15rem;
    }

    .work-order-detail-page .work-order-detail-header-card .breadcrumb {
        font-size: 0.8rem;
        margin-bottom: 0.35rem !important;
    }

    .work-order-detail-page .work-order-detail-header-actions {
        min-width: 0 !important;
        width: 100%;
        flex-direction: row !important;
        flex-wrap: nowrap;
        align-items: stretch !important;
        gap: 0.5rem !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.15rem;
        scrollbar-width: none;
    }

    .work-order-detail-page .work-order-detail-header-actions::-webkit-scrollbar {
        display: none;
    }

    .work-order-detail-page .work-order-detail-header-actions > .d-flex {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        gap: 0.5rem !important;
        width: max-content;
        max-width: none;
    }

    .work-order-detail-page .work-order-detail-header-actions .btn,
    .work-order-detail-page .work-order-detail-header-actions a.btn {
        flex: 0 0 auto;
        min-height: var(--metro-touch-target-min, 48px);
        padding: 0.5rem 0.9rem;
        border-radius: 999px;
        white-space: nowrap;
        font-weight: 600;
        font-size: 0.875rem;
    }

    .work-order-detail-page .work-order-detail-reload-btn {
        display: none;
    }

    .work-order-detail-tabs {
        position: sticky;
        top: 0;
        z-index: 20;
        background: var(--bs-body-bg, #fff);
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
        margin-bottom: 0.75rem !important;
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    }

    .work-order-detail-tabs .nav-link {
        min-height: var(--metro-touch-target-min, 48px);
        display: inline-flex;
        align-items: center;
        white-space: nowrap;
        font-size: 0.9rem;
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .work-order-mobile-actions {
        display: flex;
        gap: 0.65rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0.15rem 0.1rem 0.35rem;
        scrollbar-width: none;
    }

    .work-order-mobile-actions::-webkit-scrollbar {
        display: none;
    }

    .work-order-mobile-actions__btn {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
        min-height: var(--metro-touch-target-min, 48px);
        padding: 0.5rem 0.85rem;
        border-radius: 999px;
        border: 1px solid var(--mobile-border, #e5e9f0);
        background: var(--mobile-surface, #fff);
        color: var(--mobile-text, #14213d);
        font-size: 0.875rem;
        font-weight: 600;
        text-decoration: none;
        white-space: nowrap;
        -webkit-tap-highlight-color: transparent;
    }

    .work-order-mobile-actions__btn--primary {
        background: var(--mobile-primary, #1a56db);
        border-color: var(--mobile-primary, #1a56db);
        color: #fff;
    }

    .work-order-mobile-actions__btn:active {
        opacity: 0.88;
    }
}

@media (min-width: 769px) {
    .work-order-detail-header-actions {
        min-width: 280px;
    }

    .work-order-mobile-actions {
        display: none;
    }
}

/* Fixed bottom action bars — pad above mobile shell bottom nav */
.mobile-shell-pad-bottom {
    padding-bottom: calc(var(--mobile-bottom-h) + var(--mobile-safe-bottom) + 12px);
}

/* Touch-first controls: keep tap targets ≥ 48px and relieve cramped clusters */
.mobile-shell .btn,
.mobile-shell .form-control,
.mobile-shell .form-select {
    min-height: var(--metro-touch-target-min, 48px);
}

.mobile-shell .btn-sm,
.mobile-shell .btn-xs,
.mobile-shell .btn-group-sm > .btn,
.mobile-shell .btn-group-sm > .btn-group > .btn {
    min-height: var(--metro-touch-target-min, 48px);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
    font-size: 0.9375rem;
    line-height: 1.25;
}

.mobile-shell .btn.py-0,
.mobile-shell .btn.px-1.py-0,
.mobile-shell .btn.btn-sm.py-0 {
    min-height: var(--metro-touch-target-min, 48px);
    min-width: var(--metro-touch-target-min, 48px);
    padding: 0.5rem 0.75rem !important;
}

.mobile-shell .btn-group,
.mobile-shell .btn-toolbar {
    gap: 0;
}

.mobile-shell .btn-toolbar {
    gap: 0.5rem;
}

.mobile-shell .btn-group-sm {
    gap: 0;
}

.mobile-shell .form-select-sm,
.mobile-shell .form-control-sm {
    min-height: var(--metro-touch-target-min, 48px);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    font-size: max(16px, 0.9375rem);
}

.mobile-shell .dropdown-item {
    min-height: var(--metro-touch-target-min, 48px);
    display: flex;
    align-items: center;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}

.mobile-shell .tech-btn.py-0,
.mobile-shell .tech-btn.btn-sm {
    min-height: var(--tech-tap, 56px);
    padding: 10px 16px !important;
}

.mobile-shell .d-grid.gap-1 {
    gap: 0.5rem !important;
}

.mobile-shell .d-flex.gap-1:has(> .btn),
.mobile-shell .d-flex.gap-1:has(> a.btn),
.mobile-shell .d-flex.flex-wrap.gap-1:has(> .btn) {
    gap: 0.5rem !important;
}

.mobile-shell .page-sticky-footer-actions,
.mobile-shell .metro-fixed-bottom-actions {
    position: sticky;
    bottom: calc(var(--mobile-bottom-h, 64px) + var(--mobile-safe-bottom, 0px));
    z-index: 100;
    padding: 0.75rem 0;
    padding-bottom: 0.75rem;
    margin-bottom: 0;
    background: linear-gradient(to top, var(--mobile-bg, #f3f5f8) 70%, transparent);
}

/* Messages full-page composer + mobile collect CTAs clear bottom nav */
.mobile-shell .metro-msg-panel--fullpage {
    min-height: calc(100dvh - var(--topbar-height, 56px) - var(--mobile-safe-top) - var(--mobile-shell-content-pad));
    padding-bottom: 0.5rem;
}

.mobile-shell .metro-msg-compose {
    position: sticky;
    bottom: calc(var(--mobile-bottom-h, 64px) + var(--mobile-safe-bottom, 0px));
    z-index: 90;
    background: var(--mobile-surface, #fff);
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
}

.mobile-shell .mobile-collect-page .d-grid.gap-2 > .btn {
    min-height: 48px;
}

.responsive-data-table__cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.responsive-data-table__cards .card {
    border-radius: 12px;
}

.responsive-data-table__cards .card-body {
    padding: 1rem;
}

/* ── Cross-batch shell polish (auth, admin, fire, parks, golf, LMS, GIS) ── */
@media (max-width: 768px) {
    .mobile-shell .login-page,
    .mobile-shell .login-bg .card {
        margin-left: 0;
        margin-right: 0;
        border-radius: 14px;
    }

    .mobile-shell .login-page .btn,
    .mobile-shell .login-bg .btn {
        min-height: var(--metro-touch-target-min, 48px);
    }

    .mobile-shell .admin-page .row > [class*="col-md-"],
    .mobile-shell .admin-page .row > [class*="col-lg-"],
    .mobile-shell [class*="admin-"] .row.g-3 > [class*="col-md"],
    .mobile-shell [class*="admin-"] .row.g-3 > [class*="col-lg"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .mobile-shell .fire-cal-week,
    .mobile-shell .fire-cal-week-mobile,
    .mobile-shell [class*="fire-schedule"] {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-shell .lms-course-layout,
    .mobile-shell .lms-lesson,
    .mobile-shell [class*="lms-"] .row {
        max-width: 100%;
    }

    .mobile-shell .lms-lesson .btn,
    .mobile-shell [class*="lms-"] .btn {
        min-height: 44px;
    }

    .mobile-shell .map-toolbar,
    .mobile-shell .gis-toolbar,
    .mobile-shell .leaflet-control-container .leaflet-bar a {
        min-width: 40px;
        min-height: 40px;
    }

    .mobile-shell .legislative-workspace,
    .mobile-shell .grants-dashboard {
        padding-left: 0;
        padding-right: 0;
    }

    .mobile-shell .grants-dashboard .card,
    .mobile-shell .legislative-workspace .card {
        border-radius: 12px;
    }

    .mobile-shell .golf-member-portal .page-header,
    .mobile-shell .golf-admin .page-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.65rem;
    }

    .mobile-shell .checkin-shell,
    .mobile-shell .golf-pos-shell,
    .mobile-shell .embed-root {
        overflow-x: hidden;
        max-width: 100%;
    }

    .mobile-shell .checkin-shell .btn,
    .mobile-shell .golf-pos-shell .btn {
        min-height: 48px;
    }
}

.mobile-shell .action-center-awareness {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.mobile-shell .action-center-awareness > .alert {
    margin-bottom: 0 !important;
}

.mobile-shell .messages-page .page-header p {
    max-width: 40rem;
}