﻿/* Mobile shell (native phone) — bottom nav + connectivity banner */
:root {
    --mobile-bg: var(--metro-bg);
    --mobile-surface: var(--metro-surface);
    --mobile-text: var(--metro-text);
    --mobile-text-muted: var(--metro-text-muted);
    --mobile-border: var(--metro-border);
    --mobile-primary: var(--metro-primary);
    --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);
    --mobile-radius-card: 16px;
    --mobile-radius-control: 12px;
    --mobile-radius-pill: 999px;
    --mobile-elev-ios: 0 1px 2px rgba(15, 23, 42, 0.06), 0 6px 16px rgba(15, 23, 42, 0.07);
    --mobile-elev-android: 0 1px 2px rgba(15, 23, 42, 0.14), 0 3px 8px rgba(15, 23, 42, 0.08);
    --mobile-elev-dark: 0 8px 24px rgba(0, 0, 0, 0.35);
    --mobile-space-page: 1rem;
    --mobile-page-gutter: clamp(0.875rem, 4vw, 1.25rem);
    --mobile-section-gap: 1rem;
    --mobile-card-gap: 0.75rem;
    --mobile-type-title: 1.55rem;
    --mobile-type-body: 0.95rem;
    /* Soft neutral canvas so white content cards pop (field / My Day). */
    --mobile-page-bg: var(--metro-bg, #f3f4f6);
}

:root[data-theme="dark"] {
    --mobile-bg: var(--metro-bg);
    --mobile-surface: var(--metro-surface-raised);
    --mobile-text: var(--metro-text);
    --mobile-text-muted: var(--metro-text-muted);
    --mobile-border: var(--metro-border);
}

/*
 * Single scroll owner: when the mobile shell is mounted, the document must not
 * scroll. iOS WKWebView otherwise races the outer UIScrollView against
 * .mobile-shell__body--pull — touches feel dead, then the page jumps.
 */
html:has(.mobile-shell),
html:has(.mobile-shell) body,
html:has(.mobile-shell) #app {
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
}

/*
 * MAUI WKWebView: 100dvh can go stale after the keyboard, Face ID, or a background
 * resume — the shell sits in the top half and the native view paints black under it.
 * Size to the webview frame instead of dvh. Browser mobile keeps 100dvh above.
 */
html:has(.mobile-shell--maui),
html:has(.mobile-shell--maui) body,
html:has(.mobile-shell--maui) #app {
    height: 100%;
    max-height: none;
    min-height: 100%;
    min-height: -webkit-fill-available;
    overflow: hidden;
}

/*
 * Public/portal pages (LoginLayout -> .login-bg) opened in a plain mobile browser or an
 * in-app browser (SFSafariViewController, Android Custom Tabs, link previews from SMS/email):
 * the locked 100dvh shell plus an inner scroller can end up taller than the visible area once
 * the browser's own toolbars are counted, so the bottom of long pages (timeline, photos,
 * action buttons) is unreachable. Let the document scroll naturally there. The MAUI host keeps
 * the single-scroll-owner model above because its WKWebView needs it.
 */
html:has(.mobile-shell:not(.mobile-shell--maui) .login-bg),
html:has(.mobile-shell:not(.mobile-shell--maui) .login-bg) body,
html:has(.mobile-shell:not(.mobile-shell--maui) .login-bg) #app {
    height: auto;
    max-height: none;
    overflow: visible;
    overscroll-behavior: auto;
}

.mobile-shell:not(.mobile-shell--maui):has(.login-bg) {
    height: auto;
    max-height: none;
    min-height: 100dvh;
    overflow: visible;
}

.mobile-shell:not(.mobile-shell--maui):has(.login-bg) .mobile-shell__body--pull {
    overflow: visible;
    touch-action: auto;
}

.mobile-shell {
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--mobile-page-bg, var(--mobile-bg));
    background-image: none !important;
    color: var(--mobile-text);
    /* Bottom clearance lives on .page-body via --mobile-shell-content-pad (avoid double pad). */
    padding-bottom: 0;
}

.mobile-shell--maui {
    height: 100%;
    max-height: none;
    min-height: 100%;
    min-height: -webkit-fill-available;
}

/* login-bg's 100dvh is taller than the shell body and also goes stale on iOS. */
.mobile-shell--maui .login-bg {
    min-height: 100%;
}

/* Opaque notch / status-bar mask so scrolled content never shows through the safe area. */
.mobile-shell::before,
.tech-shell::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: max(var(--mobile-safe-top, 0px), var(--maui-safe-top, 0px), env(safe-area-inset-top, 0px));
    background: var(--metro-surface);
    z-index: 1250;
    pointer-events: none;
}

:root[data-theme="dark"] .mobile-shell::before,
:root[data-theme="dark"] .tech-shell::before {
    background: var(--metro-surface);
}

:root[data-contrast="outdoor"][data-theme="dark"] .mobile-shell::before,
:root[data-contrast="outdoor"][data-theme="dark"] .tech-shell::before {
    background: #000000;
}

/* Auth / sign-in surfaces: no tab bar, so drop reserved bottom chrome. */
.mobile-shell--no-bottom-nav,
.mobile-shell:not(:has(.mobile-bottom-nav)) {
    --mobile-bottom-h: 0px;
}

.mobile-shell__body {
    flex: 1;
    min-height: 0;
    /* Keep staff chrome below the notch/status bar. Native host also injects --mobile-safe-*. */
    padding-top: var(--mobile-safe-top);
    box-sizing: border-box;
}

/* Auth / sign-in already pads via .login-bg — avoid stacking another top inset. */
.mobile-shell--no-bottom-nav .mobile-shell__body {
    padding-top: 0;
}

.mobile-shell__content {
    min-height: 100%;
}

.mobile-shell__body--pull {
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

.mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 0;
    height: calc(var(--mobile-bottom-h) + var(--mobile-safe-bottom));
    padding: 0 2px var(--mobile-safe-bottom);
    background: color-mix(in srgb, var(--mobile-surface) 98%, transparent);
    border-top: 1px solid var(--mobile-border);
    border-radius: var(--mobile-radius-card) var(--mobile-radius-card) 0 0;
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
    isolation: isolate;
}

:root[data-theme="dark"] .mobile-bottom-nav {
    background: color-mix(in srgb, var(--mobile-surface) 94%, transparent);
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.45);
}

.mobile-bottom-nav__item {
    position: relative;
    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;
    transition: transform 200ms ease, color 200ms ease, opacity 200ms ease;
}

.mobile-bottom-nav__item:hover {
    color: var(--mobile-text);
}

.mobile-bottom-nav__item:active {
    transform: scale(0.97);
    opacity: 0.88;
}

.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__item.active::after {
    content: "";
    position: absolute;
    bottom: 5px;
    left: 50%;
    width: 16px;
    height: 3px;
    border-radius: 99px;
    background: var(--mobile-primary);
    transform: translateX(-50%);
}

/* Customize-tabs control lives in Menu — do not pin a pencil on the dock. */

.mobile-nav-editor-preview {
    margin-bottom: 1rem;
}

.mobile-nav-editor-preview-bar {
    display: flex;
    gap: 4px;
    padding: 8px;
    border-radius: 12px;
    background: var(--mobile-bg, var(--bs-light, #f8f9fa));
    border: 1px solid var(--mobile-border, 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(--mobile-text-muted, var(--bs-secondary, #6c757d));
    border-radius: 8px;
    background: var(--mobile-surface, #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: min(100dvh, 44rem);
    background: var(--mobile-surface, 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 {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    padding-bottom: calc(16px + var(--mobile-safe-bottom, 0px));
}

.mobile-connectivity-banner {
    position: sticky;
    top: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 0;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    border-radius: 0 0 16px 16px;
}

.mobile-connectivity-banner__text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-connectivity-banner__count {
    flex: 0 0 auto;
    white-space: nowrap;
}

.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 {
    position: sticky;
    top: 0;
    z-index: 5;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--mobile-text-muted);
    padding: 8px 0 10px;
    background: linear-gradient(to bottom, var(--mobile-bg, #f3f4f6) 70%, transparent);
    transition: color 0.16s ease, transform 0.16s ease;
}

.mobile-pull-hint--armed {
    color: var(--mobile-primary);
}

/* Dock "More" button */
.dock-more-btn {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: none;
    background: transparent;
    color: var(--mobile-text-muted);
    font-size: 10px;
    font-weight: 600;
    min-width: 0;
    min-height: 48px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    padding: 0 2px;
}

.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);
    max-height: calc(100dvh - var(--mobile-bottom-h) - var(--mobile-safe-bottom));
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.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: max(var(--mobile-safe-top), 0.5rem);
    max-height: calc(100dvh - var(--mobile-bottom-h) - var(--mobile-safe-bottom) - max(var(--mobile-safe-top), 0.5rem));
    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;
    gap: 8px;
}

.staff-mobile-menu__header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.staff-mobile-menu__edit {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.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;
}

.mobile-shell .admin-users-mobile-card-main {
    -webkit-tap-highlight-color: transparent;
}

.mobile-shell .admin-users-mobile-card-main:active {
    opacity: 0.85;
}

/* ── 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);
}

/* Extra room so Assist FAB (above bottom nav) does not cover page actions */
.mobile-shell:has(.metro-fab-stack) .page-body,
.mobile-shell:has(.metro-fab-stack) .portal-main,
.mobile-shell:has(.metro-fab-stack) .portal-body-container {
    padding-bottom: calc(var(--mobile-shell-content-pad) + var(--metro-fab-size) + var(--metro-fab-gap) + 0.5rem);
    scroll-padding-bottom: calc(var(--metro-fab-size) + var(--metro-fab-gap) + 0.5rem);
}

.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 .detail-back-to-top-fab {
    left: 0.85rem;
    bottom: calc(var(--mobile-bottom-h) + var(--mobile-safe-bottom) + 0.85rem);
}

/* Keep list/card content clear of the left back-to-top FAB and right assist stack. */
.mobile-shell:has(.detail-back-to-top-fab) .page-body,
.mobile-shell:has(.detail-back-to-top-fab) .page-content {
    padding-bottom: calc(var(--mobile-shell-content-pad, 1rem) + var(--metro-fab-size, 3.25rem) + var(--mobile-bottom-h, 3.5rem) + 1.25rem);
    scroll-padding-bottom: calc(var(--metro-fab-size, 3.25rem) + 1rem);
}

.mobile-shell .list-group.list-group-flush.border.rounded {
    overflow: hidden;
}

.mobile-shell .list-group-item .d-flex.justify-content-between.align-items-start {
    flex-wrap: wrap;
    row-gap: 0.5rem;
}

.mobile-shell .list-group-item .d-flex.justify-content-between.align-items-start > .btn {
    flex: 0 0 auto;
    align-self: flex-start;
}

/* Holder kind chips: wrap cleanly instead of Bootstrap btn-group edge collisions. */
.mobile-shell .municipal-holder-picker .btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    width: 100%;
}

.mobile-shell .municipal-holder-picker .btn-group > .btn {
    border-radius: 0.5rem !important;
    flex: 1 1 calc(50% - 0.35rem);
    min-width: 0;
}

.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;
}

/* Field chrome already has Chat + Menu — floating docks fight the tab bar on phones. */
.mobile-shell .metro-assist-fab,
.mobile-shell .metro-msg-dock-actions,
.tech-shell .metro-assist-fab,
.tech-shell .metro-msg-dock-actions {
    display: none !important;
}

.mobile-shell .metro-sys-notify-fab {
    width: 2.75rem;
    height: 2.75rem;
}

.mobile-shell .metro-ai-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 {
    /* Shell body already supplies the top safe-area inset — keep the bar itself compact. */
    height: auto;
    min-height: var(--topbar-height, 56px);
    padding-top: 0;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    z-index: 40;
    transition: background-color 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.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;
    background-color: var(--mobile-page-bg, var(--mobile-bg));
}

.mobile-shell .main-content {
    margin-left: 0 !important;
    width: 100%;
    /* Do not keep metro.css overflow:hidden — it clips page content under the shell scroller. */
    overflow: visible !important;
}

.mobile-shell .metro-layout {
    --sidebar-width: 0px;
}

.mobile-shell .portal-header-inner {
    padding-top: 0.5rem;
}

.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%;
}

/* Public branded pages: edge-to-edge on phone (app + mobile browser). */
@media (max-width: 768px) {
    .mobile-shell .login-bg:has(.public-branded-shell) {
        padding-left: env(safe-area-inset-left, 0px);
        padding-right: env(safe-area-inset-right, 0px);
        padding-top: env(safe-area-inset-top, 0px);
    }

    .mobile-shell .public-branded-shell,
    .mobile-shell .public-branded-shell > .login-card.card {
        max-width: 100% !important; /* beat inline CardStyle max-width */
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .mobile-shell .public-branded-shell > .login-card.card {
        padding-left: max(1rem, env(safe-area-inset-left, 0px));
        padding-right: max(1rem, env(safe-area-inset-right, 0px));
    }
}

html:has(.mobile-shell--maui),
html:has(.mobile-shell--maui) body {
    touch-action: manipulation;
}

html:has(.mobile-shell--maui) .leaflet-container,
html:has(.mobile-shell--maui) canvas,
html:has(.mobile-shell--maui) .metro-zoomable,
html:has(.mobile-shell--maui) [data-allow-pinch] {
    touch-action: auto;
}

.login-bg input.form-control,
.login-bg textarea.form-control,
.login-bg select.form-select,
.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-search-launch {
    display: flex !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;
    background: var(--metro-surface, #ffffff);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0 0 20px 20px;
    border-bottom: 1px solid var(--mobile-border, rgba(15, 23, 42, 0.08));
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04), 0 8px 20px rgba(15, 23, 42, 0.06);
}

.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(100dvh, 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 {
    width: 100%;
}

.topbar-account-sheet__section .accessibility-quick-toggles > .btn {
    width: 100%;
    min-height: var(--metro-touch-target-min, 48px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.topbar-account-sheet__section .accessibility-quick-toggles > .btn .d-none,
.topbar-account-sheet__section .accessibility-quick-toggles > .btn .d-md-inline {
    display: inline !important;
}

.topbar-account-sheet__section .accessibility-quick-toggles__menu {
    width: 100%;
    min-width: 100%;
}

.topbar-account-sheet__section .accessibility-quick-toggles__option {
    min-height: var(--metro-touch-target-min, 48px);
    display: flex;
    align-items: center;
}

.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(var(--bs-primary-rgb), 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 without creating a nested vertical scroller (clip ≠ hidden). */
/* Horizontal clip here used to break position:sticky for section shortcut bars
   (overflow-x other than visible makes this node a sticky containing block). */
.mobile-shell .page-body,
.mobile-shell .page-content {
    overflow: visible;
    max-width: 100%;
}

/* Page headers and toolbars stack on narrow viewports */
@media (max-width: 768px) {
    /* Field chrome overlays: full-width sheets that only inset for safe-area
       (status bar / home indicator / notch sides) — no arbitrary side gutters. */
    .mobile-shell .modal.show,
    .mobile-shell .modal.show.d-block,
    .tech-shell .modal.show,
    .tech-shell .modal.show.d-block,
    body:has(.mobile-shell) .modal.show,
    body:has(.mobile-shell) .modal.show.d-block,
    body:has(.tech-shell) .modal.show,
    body:has(.tech-shell) .modal.show.d-block {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        z-index: 1400;
        display: flex !important;
        /* Top-align with margin:auto on the dialog: short sheets stay centered, tall ones
           start at the top so the header / first labels and the footer (Save) stay reachable
           while the overlay scrolls. Center-align alone clipped both ends of tall forms. */
        align-items: flex-start !important;
        justify-content: center !important;
        overflow-x: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        /* Safe-area inset + a little breathing room under the status bar / title chrome. */
        padding-top: calc(max(var(--mobile-safe-top, 0px), var(--maui-safe-top, 0px), env(safe-area-inset-top, 0px)) + 0.75rem) !important;
        padding-right: max(0.75rem, var(--mobile-safe-right, 0px), env(safe-area-inset-right, 0px)) !important;
        padding-bottom: calc(max(var(--mobile-safe-bottom, 0px), var(--maui-safe-bottom, 0px), env(safe-area-inset-bottom, 0px)) + 0.75rem + var(--metro-keyboard-inset, 0px)) !important;
        padding-left: max(0.75rem, var(--mobile-safe-left, 0px), env(safe-area-inset-left, 0px)) !important;
        box-sizing: border-box;
    }

    /* Time-off wizard is a full-bleed sheet; chrome owns safe-area insets. */
    .mobile-shell .modal.show:has(.vacation-wizard-modal),
    .mobile-shell .modal.show.d-block:has(.vacation-wizard-modal),
    .tech-shell .modal.show:has(.vacation-wizard-modal),
    .tech-shell .modal.show.d-block:has(.vacation-wizard-modal),
    body:has(.mobile-shell) .modal.show:has(.vacation-wizard-modal),
    body:has(.mobile-shell) .modal.show.d-block:has(.vacation-wizard-modal),
    body:has(.tech-shell) .modal.show:has(.vacation-wizard-modal),
    body:has(.tech-shell) .modal.show.d-block:has(.vacation-wizard-modal) {
        padding: 0 !important;
    }

    .mobile-shell .modal-backdrop,
    .tech-shell .modal-backdrop,
    body:has(.mobile-shell) .modal-backdrop,
    body:has(.tech-shell) .modal-backdrop {
        z-index: 1390;
        position: fixed !important;
        inset: 0 !important;
    }

    .mobile-shell .page-body,
    .mobile-shell .page-content,
    .mobile-shell .portal-main,
    .mobile-shell .portal-body-container {
        padding-left: max(var(--mobile-page-gutter), env(safe-area-inset-left, 0px));
        padding-right: max(var(--mobile-page-gutter), env(safe-area-inset-right, 0px));
    }

    .mobile-shell .page-body > * + *,
    .mobile-shell .page-content > * + *,
    .mobile-shell .portal-main > * + * {
        margin-top: var(--mobile-section-gap);
    }

    .mobile-shell .row.g-3,
    .mobile-shell .row.g-4,
    .mobile-shell .metro-mobile-list,
    .mobile-shell .responsive-data-table__cards {
        --bs-gutter-y: var(--mobile-card-gap);
        row-gap: var(--mobile-card-gap);
    }

    .mobile-shell .dash-v2-card > .card-body > .dash-v2-card,
    .mobile-shell .card > .card-body > .card {
        border-left: 0;
        border-right: 0;
        border-radius: var(--mobile-radius-control);
        box-shadow: none !important;
    }

    .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: auto;
        height: auto;
        max-width: 2.75rem;
        max-height: 2.75rem;
        object-fit: contain;
    }

    .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,
    .tech-shell .modal-dialog,
    body:has(.mobile-shell) .modal-dialog,
    body:has(.tech-shell) .modal-dialog {
        margin: auto !important;
        max-width: 100% !important;
        width: 100% !important;
        /* Fit the content (never a forced full-height sheet) and never taller than the visible
           viewport minus the overlay padding. pinViewportModals replaces this max-height with
           the measured visual-viewport height so the keyboard never pushes the header off-screen. */
        height: auto !important;
        max-height: calc(100dvh - var(--mobile-safe-top, 0px) - var(--mobile-safe-bottom, 0px) - 1.5rem);
        flex: 0 1 auto;
        align-self: center;
        display: flex;
        flex-direction: column;
    }

    /* Scrollable dialogs must constrain .modal-content so the body scrolls and the footer
       (Create / Save) stays on-screen. Bootstrap's centered+scrollable combo clears max-height. */
    .mobile-shell .modal-dialog.modal-dialog-scrollable,
    .tech-shell .modal-dialog.modal-dialog-scrollable,
    body:has(.mobile-shell) .modal-dialog.modal-dialog-scrollable,
    body:has(.tech-shell) .modal-dialog.modal-dialog-scrollable {
        max-height: calc(100dvh - var(--mobile-safe-top, 0px) - var(--mobile-safe-bottom, 0px) - 1.5rem);
    }

    .mobile-shell .modal-dialog.modal-dialog-scrollable .modal-content,
    .tech-shell .modal-dialog.modal-dialog-scrollable .modal-content,
    body:has(.mobile-shell) .modal-dialog.modal-dialog-scrollable .modal-content,
    body:has(.tech-shell) .modal-dialog.modal-dialog-scrollable .modal-content {
        max-height: 100% !important;
        height: auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .mobile-shell .modal.show.metro-modal--center .modal-dialog,
    .tech-shell .modal.show.metro-modal--center .modal-dialog,
    body:has(.mobile-shell) .modal.show.metro-modal--center .modal-dialog,
    body:has(.tech-shell) .modal.show.metro-modal--center .modal-dialog {
        margin: auto !important;
        max-width: min(28rem, calc(100% - 1.5rem)) !important;
        width: 100% !important;
        align-self: center;
        max-height: min(88dvh, calc(100dvh - 2rem));
    }

    .mobile-shell .modal-content,
    .mobile-shell .offcanvas,
    .tech-shell .modal-content,
    body:has(.mobile-shell) .modal-content,
    body:has(.tech-shell) .modal-content {
        max-height: inherit;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        width: 100%;
        border-radius: var(--mobile-radius-card, 16px) !important;
        border: 1px solid var(--mobile-border, var(--metro-border, #e2e8f0)) !important;
        background: var(--mobile-surface, var(--metro-surface, #fff));
        box-shadow: 0 12px 40px rgba(15, 28, 46, 0.22);
    }

    /* Bootstrap's fullscreen-sm-down forces height:100% on the dialog + content; a centered
       dialog sizes to its content instead. */
    .mobile-shell .modal-fullscreen-sm-down,
    .tech-shell .modal-fullscreen-sm-down,
    body:has(.mobile-shell) .modal-fullscreen-sm-down,
    body:has(.tech-shell) .modal-fullscreen-sm-down,
    .mobile-shell .modal-fullscreen-sm-down .modal-content,
    .tech-shell .modal-fullscreen-sm-down .modal-content,
    body:has(.mobile-shell) .modal-fullscreen-sm-down .modal-content,
    body:has(.tech-shell) .modal-fullscreen-sm-down .modal-content {
        height: auto !important;
    }

    .mobile-shell .modal.show.metro-modal--center .modal-content,
    .tech-shell .modal.show.metro-modal--center .modal-content,
    body:has(.mobile-shell) .modal.show.metro-modal--center .modal-content,
    body:has(.tech-shell) .modal.show.metro-modal--center .modal-content {
        border-radius: 16px !important;
        border: 1px solid var(--mobile-border, #e2e8f0) !important;
        box-shadow: 0 12px 40px rgba(15, 28, 46, 0.22) !important;
    }

    /* Soften the dimmer so the rounded sheet reads against a calm backdrop. */
    .mobile-shell .modal.show.d-block::before,
    .tech-shell .modal.show.d-block::before,
    body:has(.mobile-shell) .modal.show.d-block::before,
    body:has(.tech-shell) .modal.show.d-block::before {
        background: rgba(20, 33, 61, 0.45);
        /* Follow the pinned container box, not the (possibly trapped) fixed viewport. */
        position: absolute;
        inset: 0;
    }

    /* Keep the notch / status-bar band solid white (or black in dark) above field sheets. */
    .mobile-shell .modal.show.d-block::after,
    .tech-shell .modal.show.d-block::after,
    body:has(.mobile-shell) .modal.show.d-block::after,
    body:has(.tech-shell) .modal.show.d-block::after {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: max(var(--mobile-safe-top, 0px), var(--maui-safe-top, 0px), env(safe-area-inset-top, 0px));
        background: var(--metro-surface);
        z-index: 1;
        pointer-events: none;
    }

    :root[data-theme="dark"] .mobile-shell .modal.show.d-block::after,
    :root[data-theme="dark"] .tech-shell .modal.show.d-block::after,
    :root[data-theme="dark"] body:has(.mobile-shell) .modal.show.d-block::after,
    :root[data-theme="dark"] body:has(.tech-shell) .modal.show.d-block::after {
        background: var(--metro-bg);
    }

    .mobile-shell:has(.mobile-bottom-nav) .modal.show,
    .mobile-shell:has(.mobile-bottom-nav) .modal.show.d-block,
    .tech-shell:has(.mobile-bottom-nav) .modal.show,
    .tech-shell:has(.mobile-bottom-nav) .modal.show.d-block,
    body:has(.mobile-shell .mobile-bottom-nav) .modal.show,
    body:has(.mobile-shell .mobile-bottom-nav) .modal.show.d-block,
    body:has(.tech-shell .mobile-bottom-nav) .modal.show,
    body:has(.tech-shell .mobile-bottom-nav) .modal.show.d-block {
        /* The dock sits under the dimmed overlay; keep the box symmetric so "center" means the
           center of the screen, not the center of the strip above the dock. */
        padding-bottom: calc(max(var(--mobile-safe-bottom, 0px), var(--maui-safe-bottom, 0px), env(safe-area-inset-bottom, 0px)) + 0.75rem + var(--metro-keyboard-inset, 0px)) !important;
    }

    .mobile-shell .modal-dialog-centered,
    .tech-shell .modal-dialog-centered,
    body:has(.mobile-shell) .modal-dialog-centered,
    body:has(.tech-shell) .modal-dialog-centered {
        min-height: 0 !important;
        display: flex !important;
        align-items: center !important;
        margin-top: auto !important;
        margin-bottom: auto !important;
    }

    /* Opt-in centered confirms override the bottom-sheet dialog rules above. */
    .mobile-shell .modal.show.metro-modal--center .modal-dialog-centered,
    .tech-shell .modal.show.metro-modal--center .modal-dialog-centered,
    body:has(.mobile-shell) .modal.show.metro-modal--center .modal-dialog-centered,
    body:has(.tech-shell) .modal.show.metro-modal--center .modal-dialog-centered {
        display: flex !important;
        align-items: center !important;
        margin: auto !important;
        min-height: 0 !important;
    }

    .mobile-shell .modal-content > .modal-header,
    .mobile-shell .modal-content > form > .modal-header,
    .tech-shell .modal-content > .modal-header,
    .tech-shell .modal-content > form > .modal-header,
    body:has(.mobile-shell) .modal-content > .modal-header,
    body:has(.mobile-shell) .modal-content > form > .modal-header,
    body:has(.tech-shell) .modal-content > .modal-header,
    body:has(.tech-shell) .modal-content > form > .modal-header {
        background: var(--mobile-surface, var(--metro-surface, #fff));
        border-bottom: 1px solid var(--mobile-border, var(--metro-border, #e2e8f0));
    }

    .mobile-shell .modal-content > .modal-footer,
    .mobile-shell .modal-content > form > .modal-footer,
    .tech-shell .modal-content > .modal-footer,
    .tech-shell .modal-content > form > .modal-footer,
    body:has(.mobile-shell) .modal-content > .modal-footer,
    body:has(.mobile-shell) .modal-content > form > .modal-footer,
    body:has(.tech-shell) .modal-content > .modal-footer,
    body:has(.tech-shell) .modal-content > form > .modal-footer {
        background: color-mix(in srgb, var(--mobile-surface, #fff) 96%, transparent);
        border-top: 1px solid var(--mobile-border, var(--metro-border, #e2e8f0));
        /* Dock/safe-area already cleared by the overlay padding. */
        padding-bottom: 0.85rem;
    }

    .mobile-shell .modal-body,
    .mobile-shell .offcanvas-body,
    .tech-shell .modal-body,
    body:has(.mobile-shell) .modal-body,
    body:has(.tech-shell) .modal-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-shell .modal-footer,
    .mobile-shell .offcanvas-footer,
    .mobile-shell .metro-sheet-footer,
    .tech-shell .modal-footer,
    body:has(.mobile-shell) .modal-footer,
    body:has(.tech-shell) .modal-footer {
        position: sticky;
        bottom: 0;
        z-index: 2;
        flex: 0 0 auto;
        background: var(--mobile-surface);
        border-top: 1px solid var(--mobile-border);
        /* Overlay already clears dock + home indicator. */
        padding-bottom: 0.85rem;
    }

    .mobile-shell .form-schema-submit-row,
    .tech-shell .form-schema-submit-row,
    body:has(.mobile-shell) .form-schema-submit-row,
    body:has(.tech-shell) .form-schema-submit-row {
        position: sticky;
        bottom: calc(var(--mobile-bottom-h, 0px) + var(--mobile-safe-bottom, 0px));
        z-index: 20;
        margin-left: calc(-1 * var(--mobile-page-gutter, 0px));
        margin-right: calc(-1 * var(--mobile-page-gutter, 0px));
        padding: 0.75rem var(--mobile-page-gutter, 1rem) max(0.75rem, env(safe-area-inset-bottom, 0px));
        background: var(--mobile-surface, var(--metro-surface, #fff));
        box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
        flex-direction: column;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 0.5rem !important;
    }

    .mobile-shell .form-schema-submit-row > .form-schema-submit-row__secondary,
    .mobile-shell .form-schema-submit-row > .form-schema-submit-row__primary,
    .tech-shell .form-schema-submit-row > .form-schema-submit-row__secondary,
    .tech-shell .form-schema-submit-row > .form-schema-submit-row__primary,
    body:has(.mobile-shell) .form-schema-submit-row > .form-schema-submit-row__secondary,
    body:has(.mobile-shell) .form-schema-submit-row > .form-schema-submit-row__primary,
    body:has(.tech-shell) .form-schema-submit-row > .form-schema-submit-row__secondary,
    body:has(.tech-shell) .form-schema-submit-row > .form-schema-submit-row__primary {
        width: 100%;
        margin-left: 0 !important;
        margin-right: 0 !important;
        flex-direction: column;
        align-items: stretch !important;
    }

    .mobile-shell .form-schema-submit-row .btn,
    .tech-shell .form-schema-submit-row .btn,
    body:has(.mobile-shell) .form-schema-submit-row .btn,
    body:has(.tech-shell) .form-schema-submit-row .btn {
        width: 100%;
        justify-content: center;
    }

    .mobile-shell .form-schema-submit-row .btn-primary,
    .tech-shell .form-schema-submit-row .btn-primary,
    body:has(.mobile-shell) .form-schema-submit-row .btn-primary,
    body:has(.tech-shell) .form-schema-submit-row .btn-primary {
        order: 2;
    }

    .mobile-shell .form-signature-canvas,
    .tech-shell .form-signature-canvas,
    body:has(.mobile-shell) .form-signature-canvas,
    body:has(.tech-shell) .form-signature-canvas {
        min-height: 180px;
        height: 180px !important;
    }

    .mobile-shell .form-schema-repeater-remove,
    .mobile-shell .form-schema-repeater-add,
    .tech-shell .form-schema-repeater-remove,
    .tech-shell .form-schema-repeater-add {
        min-height: var(--metro-touch-target-min, 48px);
        min-width: var(--metro-touch-target-min, 48px);
    }

    .mobile-shell .form-schema-fill-outer,
    .mobile-shell .wizard-runner,
    .mobile-shell .portal-intake-wizard,
    .tech-shell .form-schema-fill-outer,
    .tech-shell .wizard-runner {
        max-width: 100% !important;
        width: 100%;
    }

    .mobile-shell .form-schema-section-card.metro-card,
    .tech-shell .form-schema-section-card.metro-card {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    /* The sheet (.modal-dialog max-height) already bounds .modal-content (max-height: inherit,
       flex column) and the body is flex:1 / min-height:0 / overflow:auto, so a second 70dvh cap
       here only threw away a third of the screen on every form with a dropdown in it. */
    .mobile-shell .modal-dialog-scrollable .modal-body,
    .tech-shell .modal-dialog-scrollable .modal-body,
    body:has(.mobile-shell) .modal-dialog-scrollable .modal-body,
    body:has(.tech-shell) .modal-dialog-scrollable .modal-body {
        max-height: none;
    }

    .mobile-shell .modal-fullscreen-sm-down .modal-body,
    .tech-shell .modal-fullscreen-sm-down .modal-body,
    body:has(.mobile-shell) .modal-fullscreen-sm-down .modal-body,
    body:has(.tech-shell) .modal-fullscreen-sm-down .modal-body {
        max-height: none;
    }

    .mobile-shell .offcanvas-bottom {
        max-height: min(100dvh, 40rem);
        padding-bottom: var(--mobile-safe-bottom);
    }

    .mobile-shell .offcanvas-end.metro-sheet-capable,
    .mobile-shell .offcanvas-end.metro-filter-drawer {
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100% !important;
        height: auto;
        max-height: min(100dvh, 40rem);
        --bs-offcanvas-width: 100%;
        --bs-offcanvas-height: auto;
        border-left: 0;
        border-top: 1px solid var(--metro-border, #e5e7eb);
        border-radius: var(--mobile-radius-card, 16px) var(--mobile-radius-card, 16px) 0 0;
        transform: none;
        padding-bottom: var(--mobile-safe-bottom, 0px);
    }

    .mobile-shell .offcanvas-end.metro-sheet-capable::before,
    .mobile-shell .offcanvas-end.metro-filter-drawer::before {
        content: "";
        display: block;
        width: 2.5rem;
        height: 0.28rem;
        margin: 0.45rem auto 0;
        border-radius: 999px;
        background: var(--metro-border-strong, #cbd5e1);
    }

    .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,
.tech-shell .mobile-connectivity-banner {
    white-space: nowrap;
}

.mobile-shell .mobile-connectivity-banner__text,
.tech-shell .mobile-connectivity-banner__text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-shell .mobile-connectivity-banner__count,
.tech-shell .mobile-connectivity-banner__count {
    flex-shrink: 0;
    white-space: nowrap;
}

.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–1199px): field shell still active on MAUI tablets — use the width. */
@media (min-width: 769px) {
    .mobile-shell {
        --mobile-page-gutter: clamp(1.25rem, 3vw, 2rem);
        --mobile-space-page: 1.25rem;
        --mobile-section-gap: 1.25rem;
        --mobile-type-title: 1.7rem;
    }

    .mobile-shell .page-body,
    .mobile-shell .portal-main,
    .mobile-shell .portal-body-container {
        padding-left: var(--mobile-page-gutter);
        padding-right: var(--mobile-page-gutter);
        max-width: 1100px;
        margin-left: auto;
        margin-right: auto;
        width: 100%;
        box-sizing: border-box;
    }

    /* Two-up form / filter rows when space allows */
    .mobile-shell .row.g-3 > [class*="col-md-"],
    .mobile-shell .row.g-2 > [class*="col-md-"] {
        min-width: 0;
    }

    .mobile-shell .work-orders-index .work-orders-list-toolbar,
    .mobile-shell .page-header {
        flex-wrap: wrap;
        align-items: center;
    }

    .mobile-shell .page-header-actions {
        margin-left: auto;
    }

    /* Bottom dock: larger hit labels, more breathing room */
    .mobile-shell .mobile-bottom-nav__item {
        font-size: 13px;
        min-width: 4.5rem;
    }

    .mobile-shell .mobile-bottom-nav__item .bi {
        font-size: 1.35rem;
    }

    /* Cards / lists use horizontal space without stretching edge-to-edge on iPad */
    .mobile-shell .metro-card,
    .mobile-shell .card,
    .mobile-shell .list-group-item {
        max-width: 100%;
    }

    .mobile-shell .dash-v2-grid-shell .dashboard-grid,
    .mobile-shell .dash-v2-shortcuts {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

/* Tablet band: 2×2 glance until metro's ≥1100px side-by-side / 4-up kicks in. */
@media (min-width: 769px) and (max-width: 1099.98px) {
    .mobile-shell .wo-detail-glance {
        grid-template-columns: 1fr 1fr;
    }
}

/* Portrait tablets: never squeeze 4 glance tiles beside Quick assign. */
@media (min-width: 769px) and (max-width: 1099.98px) and (orientation: portrait) {
    .mobile-shell .wo-detail-overview {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "main"
            "rail"
            "cta";
    }

    .mobile-shell .wo-detail-overview__rail {
        position: static;
    }

    .mobile-shell .wo-detail-glance {
        grid-template-columns: 1fr 1fr;
    }
}

/* Landscape tablets / split-view mid widths */
@media (min-width: 769px) and (orientation: landscape) {
    .mobile-shell .page-body {
        padding-top: 0.75rem;
    }

    .mobile-shell .mobile-bottom-nav__item span:not(.bi) {
        display: inline;
    }
}

/* Explicit MAUI tablet idiom class (set from FormFactor.IsNativeTablet) */
.mobile-shell--tablet .page-body,
.mobile-shell--tablet .portal-main {
    padding-left: var(--mobile-page-gutter, 1.5rem);
    padding-right: var(--mobile-page-gutter, 1.5rem);
}

.mobile-shell--tablet .mobile-bottom-nav {
    height: calc(68px + var(--mobile-safe-bottom));
}

.mobile-shell--tablet {
    --mobile-bottom-h: 68px;
    --metro-touch-target-min: 48px;
}

/* City calendar day dialog + any leftover desktop window chrome: field hosts never
   use floating windows (MAUI tablet is ≥769px but still .mobile-shell). */
body:has(.mobile-shell) .metro-window-controls,
body:has(.mobile-shell) .metro-window-resizers,
body:has(.mobile-shell) .metro-window-titlebar,
body:has(.tech-shell) .metro-window-controls,
body:has(.tech-shell) .metro-window-resizers,
body:has(.tech-shell) .metro-window-titlebar,
.mobile-shell .metro-window-controls,
.mobile-shell .metro-window-resizers,
.mobile-shell .metro-window-titlebar,
.tech-shell .metro-window-controls,
.tech-shell .metro-window-resizers,
.tech-shell .metro-window-titlebar {
    display: none !important;
}

body:has(.mobile-shell) .city-cal-modal-backdrop,
body:has(.tech-shell) .city-cal-modal-backdrop,
.mobile-shell .city-cal-modal-backdrop,
.tech-shell .city-cal-modal-backdrop {
    align-items: flex-end !important;
    padding: 0 !important;
    padding-bottom: max(0.5rem, var(--mobile-safe-bottom, 0px), var(--maui-safe-bottom, 0px), env(safe-area-inset-bottom, 0px)) !important;
    background: rgba(20, 33, 61, 0.45) !important;
    pointer-events: auto !important;
    z-index: 1400 !important;
}

body:has(.mobile-shell) .city-cal-modal-backdrop[data-metro-floating],
body:has(.tech-shell) .city-cal-modal-backdrop[data-metro-floating],
.mobile-shell .city-cal-modal-backdrop[data-metro-floating],
.tech-shell .city-cal-modal-backdrop[data-metro-floating] {
    /* Undo desktop floating click-through if attributes linger after a shell switch. */
    pointer-events: auto !important;
    background: rgba(20, 33, 61, 0.45) !important;
}

body:has(.mobile-shell) .city-cal-modal,
body:has(.tech-shell) .city-cal-modal,
.mobile-shell .city-cal-modal,
.tech-shell .city-cal-modal {
    width: 100% !important;
    max-width: 100% !important;
    max-height: min(88dvh, calc(100dvh - var(--mobile-safe-top, 0px) - var(--mobile-bottom-h, 64px) - 1rem)) !important;
    border-radius: 18px 18px 0 0 !important;
    margin: 0 !important;
    left: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    position: relative !important;
    height: auto !important;
    transform: none !important;
}

body:has(.mobile-shell) .city-cal-modal-close,
body:has(.tech-shell) .city-cal-modal-close,
.mobile-shell .city-cal-modal-close,
.tech-shell .city-cal-modal-close {
    width: var(--metro-touch-target-min, 48px);
    height: var(--metro-touch-target-min, 48px);
    border-radius: 12px;
    font-size: 1rem;
}

/* 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.75rem;
        padding: 0.85rem 1rem 1rem !important;
        background: var(--mobile-surface, #fff) !important;
    }

    .work-orders-index .work-orders-record-count {
        font-size: 0.78rem;
        font-weight: 750;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: var(--mobile-text-muted, #6b7280);
    }

    .work-orders-index .dash-v2-chapter .work-orders-record-count {
        color: var(--mobile-text, #111827);
        font-size: 1.15rem;
        letter-spacing: -0.015em;
        line-height: 1.25;
        text-transform: none;
    }

    .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-orders-view-switch {
        background: var(--metro-surface-muted, #f1f5f9);
        border: 1px solid var(--mobile-border, #e5e7eb);
        border-radius: 14px;
        padding: 4px;
        overflow: hidden;
    }

    .work-orders-index .work-orders-view-switch .btn {
        border: 0 !important;
        border-radius: 10px !important;
        font-weight: 700;
        box-shadow: none !important;
    }

    .work-orders-index .work-orders-view-switch .btn-outline-primary {
        background: transparent;
        color: var(--mobile-text-muted, #6b7280);
    }

    .work-orders-index .work-orders-view-switch .btn-primary {
        background: var(--mobile-primary, #1a56db);
        color: #fff;
    }

    .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-orders-index .work-orders-filters .card-body {
        padding: 0.9rem 1rem;
    }

    .work-orders-index .work-orders-results {
        background: transparent;
        box-shadow: none !important;
    }

    .work-orders-index .work-orders-results > .card-header,
    .work-orders-index .work-orders-results > .card-footer {
        background: transparent !important;
        padding-left: 0;
        padding-right: 0;
    }

    .work-order-detail-page {
        --wo-visit-action-min: 56px;
        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.7rem 0.85rem 0.55rem !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.1rem;
    }

    .work-order-detail-page .work-order-detail-header-card .breadcrumb {
        font-size: 0.72rem;
        margin-bottom: 0 !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,
    .wo-detail-tabs,
    .property-detail-tabs,
    .citizen-detail-tabs,
    .business-entity-detail-tabs,
    .fleet-detail-tabs,
    .legislative-item-detail-tabs,
    .bid-project-detail-tabs {
        position: sticky;
        /* Shell body already applies --mobile-safe-top; stick below the sticky topbar. */
        top: var(--topbar-height, 56px);
        z-index: 20;
        background: var(--metro-surface);
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
        margin-bottom: 0.75rem !important;
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
        /* Layout picker + one-line section dropdown (not multi-row chips). */
        --detail-sticky-chrome: 5.25rem;
    }

    /* Never put sticky on .metro-tabs — overflow-x:auto makes it its own scrollport. */
    .wo-detail-tabs .metro-tabs {
        position: relative;
        top: auto;
    }

    /* Collapse detail-page chip grids to a single dropdown row on phones / narrow viewports. */
    .wo-detail-tabs .metro-tabs--chips,
    .property-detail-tabs .metro-tabs--chips,
    .citizen-detail-tabs .metro-tabs--chips,
    .business-entity-detail-tabs .metro-tabs--chips,
    .property-section-nav__track {
        display: none !important;
    }

    .wo-detail-tabs .metro-tabs__dropdown,
    .property-detail-tabs .metro-tabs__dropdown,
    .citizen-detail-tabs .metro-tabs__dropdown,
    .business-entity-detail-tabs .metro-tabs__dropdown,
    .property-section-nav__dropdown {
        display: block;
        position: relative;
        flex: 1 1 auto;
        min-width: 0;
        margin: 0;
    }

    .property-section-nav__chrome {
        margin-bottom: 0.65rem;
    }

    .property-section-nav__trailing {
        margin-left: 0;
    }

    .mobile-shell .wo-detail-overview > .wo-detail-overview__cta {
        padding-bottom: 0.5rem;
    }

    .mobile-shell .wo-detail-tabs,
    .mobile-shell .work-order-detail-tabs,
    .mobile-shell .property-detail-tabs,
    .mobile-shell .citizen-detail-tabs,
    .mobile-shell .business-entity-detail-tabs,
    .mobile-shell .fleet-detail-tabs,
    .mobile-shell .legislative-item-detail-tabs,
    .mobile-shell .bid-project-detail-tabs,
    .mobile-shell .property-section-nav {
        top: var(--topbar-height, 56px);
    }

    .work-order-detail-tabs .nav-link,
    .wo-detail-tabs .metro-tab {
        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;
    }
}

/* MAUI / field shell (phones + tablets): always use the one-line section dropdown. */
.mobile-shell,
.tech-shell {
    --detail-sticky-chrome: 5.25rem;
}

.mobile-shell .wo-detail-tabs .metro-tabs--chips,
.mobile-shell .property-detail-tabs .metro-tabs--chips,
.mobile-shell .citizen-detail-tabs .metro-tabs--chips,
.mobile-shell .business-entity-detail-tabs .metro-tabs--chips,
.mobile-shell .property-section-nav__track,
.tech-shell .wo-detail-tabs .metro-tabs--chips,
.tech-shell .property-detail-tabs .metro-tabs--chips,
.tech-shell .citizen-detail-tabs .metro-tabs--chips,
.tech-shell .business-entity-detail-tabs .metro-tabs--chips,
.tech-shell .property-section-nav__track {
    display: none !important;
}

.mobile-shell .wo-detail-tabs .metro-tabs__dropdown,
.mobile-shell .property-detail-tabs .metro-tabs__dropdown,
.mobile-shell .citizen-detail-tabs .metro-tabs__dropdown,
.mobile-shell .business-entity-detail-tabs .metro-tabs__dropdown,
.mobile-shell .property-section-nav__dropdown,
.tech-shell .wo-detail-tabs .metro-tabs__dropdown,
.tech-shell .property-detail-tabs .metro-tabs__dropdown,
.tech-shell .citizen-detail-tabs .metro-tabs__dropdown,
.tech-shell .business-entity-detail-tabs .metro-tabs__dropdown,
.tech-shell .property-section-nav__dropdown {
    display: block;
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
}

.mobile-shell .property-section-nav__chrome,
.tech-shell .property-section-nav__chrome {
    margin-bottom: 0.65rem;
}

.mobile-shell .property-section-nav__trailing,
.tech-shell .property-section-nav__trailing {
    margin-left: 0;
}

/*
 * Field quick actions (Map / Call / Text / Message / Notify / Edit).
 * Styles must live outside max-width:768 — MAUI tablets keep the strip visible
 * via .mobile-shell, and Android WebView otherwise paints raw <button> chrome.
 */
.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 {
    box-sizing: border-box;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: var(--metro-touch-target-min, 48px);
    margin: 0;
    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: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
}

.work-order-mobile-actions__btn i {
    font-size: 1rem;
    line-height: 1;
    color: var(--mobile-primary, #1a56db);
}

.work-order-mobile-actions__btn--primary {
    background: var(--mobile-primary, #1a56db);
    border-color: var(--mobile-primary, #1a56db);
    color: #fff;
}

.work-order-mobile-actions__btn--primary i {
    color: #fff;
}

.work-order-mobile-actions__btn:active {
    opacity: 0.88;
}

.work-order-mobile-actions__btn:focus-visible {
    outline: 2px solid var(--mobile-primary, #1a56db);
    outline-offset: 2px;
}

@media (min-width: 769px) {
    .work-order-detail-header-actions {
        min-width: 280px;
    }

    /* Desktop web: hide the phone action strip. MAUI field shell keeps it on tablets. */
    .work-order-mobile-actions {
        display: none;
    }

    .mobile-shell .work-order-mobile-actions {
        display: flex;
    }
}

/* 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);
    border-radius: var(--mobile-radius-control, 12px) !important;
}

.mobile-shell .btn-group > .btn {
    border-radius: 0 !important;
}

.mobile-shell .btn-group > .btn:first-child {
    border-top-left-radius: var(--mobile-radius-control, 12px) !important;
    border-bottom-left-radius: var(--mobile-radius-control, 12px) !important;
}

.mobile-shell .btn-group > .btn:last-child {
    border-top-right-radius: var(--mobile-radius-control, 12px) !important;
    border-bottom-right-radius: var(--mobile-radius-control, 12px) !important;
}

.mobile-shell .modal-footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.mobile-shell .modal-footer > .btn,
.mobile-shell .modal-footer > a.btn,
.mobile-shell .modal-footer .btn {
    width: 100%;
    margin: 0 !important;
    min-height: var(--metro-touch-target-min, 48px);
    border-radius: var(--mobile-radius-control, 12px) !important;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mobile-shell .modal-footer.flex-wrap,
.mobile-shell .modal-footer.justify-content-between {
    flex-direction: column;
    justify-content: flex-start !important;
}

/* Time-off request wizard: compact side-by-side actions (not stacked fat CTAs). */
.mobile-shell .vacation-wizard-footer.modal-footer,
.mobile-shell .modal-footer.vacation-wizard-footer {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.5rem;
}

.mobile-shell .vacation-wizard-footer .btn,
.mobile-shell .vacation-wizard-footer > .btn,
.mobile-shell .vacation-wizard-footer__actions .btn {
    width: auto !important;
    min-height: 2.25rem !important;
    padding-top: 0.35rem !important;
    padding-bottom: 0.35rem !important;
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
}

.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;
}

/* Notification preview rows are multi-line; keep them stacked instead of
   squeezing title/body/timestamp into a horizontal flex row. */
.mobile-shell .topbar-notification-menu {
    left: 0.75rem !important;
    right: 0.75rem !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
}

.mobile-shell .topbar-notification-menu .dropdown-item,
.mobile-shell .topbar-notification-menu .topbar-notification-item {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.2rem;
    white-space: normal;
    width: 100%;
    max-width: 100%;
}

.mobile-shell .topbar-notification-menu .dropdown-item > *,
.mobile-shell .topbar-notification-menu .topbar-notification-item > * {
    min-width: 0;
    max-width: 100%;
}

.mobile-shell .topbar-notification-menu .topbar-notification-item__body {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-shell .topbar-notification-menu .topbar-notification-item__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.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) ── */
.mobile-shell-error {
    margin: 1.5rem 1rem;
    padding: 1.5rem 1.25rem;
    border-radius: 16px;
    background: var(--mobile-surface, #fff);
    border: 1px solid var(--mobile-border, #e5e7eb);
    text-align: center;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.mobile-shell-error__icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 0.75rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, #dc2626 12%, transparent);
    color: #dc2626;
    font-size: 1.5rem;
}

.mobile-shell-error .btn {
    min-height: var(--metro-touch-target-min, 48px);
    min-width: 8rem;
}

@media (max-width: 768px) {
    .mobile-shell .login-page {
        /* Dead-centering a short card in a tall phone viewport (notch to home indicator)
           left a large empty band above it. Anchor right under the safe area instead.
           .login-bg (the outer wrapper) already supplies safe-area-aware padding and
           zeroes .login-page's own padding — re-adding padding here (mobile.css loads
           after metro.css, so it would win the cascade) doubled the top gap. */
        align-items: flex-start;
    }

    .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;
}

/* Overlays must clear the bottom nav (z-index 1200) and iOS/MAUI chrome.
   Pin to the visual viewport top so drawers open where the user is looking. */
.mobile-shell .metro-slide-panel {
    height: 100dvh;
    max-height: 100dvh;
    top: 0;
    padding-bottom: var(--mobile-safe-bottom);
}

.mobile-shell .metro-slide-panel-backdrop {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2000;
}

.mobile-shell .metro-slide-panel .card-footer {
    flex-shrink: 0;
    padding-bottom: max(0.75rem, var(--mobile-safe-bottom));
}

.mobile-shell .card.position-fixed.top-0,
.mobile-shell .card.position-fixed.end-0.h-100 {
    z-index: 1300;
    height: 100dvh !important;
    max-height: 100dvh;
    padding-bottom: var(--mobile-safe-bottom);
    overflow-y: auto;
}

.mobile-shell .metro-map-detail-sheet-backdrop {
    z-index: 1250;
}

.mobile-shell .metro-map-detail-sheet {
    z-index: 1300;
    max-height: min(50dvh, calc(100dvh - var(--mobile-bottom-h) - var(--mobile-safe-bottom) - 4rem));
    padding: 12px 16px calc(12px + var(--mobile-safe-bottom));
}

.mobile-shell .metro-map-canvas {
    height: min(360px, 40dvh) !important;
    min-height: 0 !important;
    max-height: 40dvh;
}

.mobile-shell .portal-preview-banner-inner {
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
}

.mobile-shell .portal-preview-banner-actions {
    margin-left: 0;
}

.mobile-shell .dashboard-experience,
.mobile-shell .fire-dashboard-experience {
    flex-wrap: wrap;
    justify-content: space-between;
}

.mobile-shell .dashboard-experience__button,
.mobile-shell .fire-dashboard-experience__button {
    min-height: var(--metro-touch-target-min, 48px);
}

.mobile-shell .dash-v2-refresh,
.mobile-shell .dash-v2-hero-cta,
.mobile-shell .fire-v2-refresh,
.mobile-shell .insp-v2-refresh,
.mobile-shell .cd-v2-refresh {
    min-height: var(--metro-touch-target-min, 48px);
    min-width: var(--metro-touch-target-min, 48px);
}

.mobile-shell .dashboard-grid:not(.dashboard-grid--edit) .dashboard-grid-item-inner > .dash-v2-hero .dash-v2-hero__topline,
.mobile-shell .dashboard-grid:not(.dashboard-grid--edit) .dashboard-grid-item-inner > article.dash-v2-hero .dash-v2-hero__topline {
    padding-right: 3.25rem;
}

.mobile-shell .dash-v2-hero__topline-actions .dash-v2-refresh {
    justify-content: center;
    padding-inline: 0.55rem;
}

/* ── Round 2: motion, chrome, empty/loading, type ─────────────────────────── */
/* animation-fill-mode must stay 'backwards', never 'both'/'forwards': a held end state keeps a
   transform (identity matrix) on .page-body, which makes it the containing block for every
   position:fixed modal inside the page, so dialogs open at the top of long pages. */
@keyframes mobile-page-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

@keyframes mobile-item-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

@keyframes mobile-success-in {
    from { opacity: 0; transform: translateY(4px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

.mobile-shell .page-body,
.mobile-shell .page-content,
.mobile-shell .login-page {
    animation: mobile-page-in 320ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)) backwards;
}

.mobile-shell .list-group-item,
.mobile-shell .responsive-data-table__cards .card,
.mobile-shell .tech-job-card {
    animation: mobile-item-in 280ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)) backwards;
}

.mobile-shell .list-group-item:nth-child(1),
.mobile-shell .responsive-data-table__cards .card:nth-child(1) { animation-delay: 30ms; }
.mobile-shell .list-group-item:nth-child(2),
.mobile-shell .responsive-data-table__cards .card:nth-child(2) { animation-delay: 60ms; }
.mobile-shell .list-group-item:nth-child(3),
.mobile-shell .responsive-data-table__cards .card:nth-child(3) { animation-delay: 90ms; }
.mobile-shell .list-group-item:nth-child(4),
.mobile-shell .responsive-data-table__cards .card:nth-child(4) { animation-delay: 120ms; }

.mobile-shell .alert-success {
    animation: mobile-success-in 280ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1));
}

.mobile-shell .btn:active:not(:disabled) {
    transform: scale(0.98);
}

.mobile-shell .btn:disabled,
.mobile-shell .btn.disabled {
    opacity: 0.45;
}

.mobile-shell .btn:focus-visible,
.mobile-shell .form-control:focus-visible,
.mobile-shell .form-select:focus-visible,
.mobile-shell .mobile-bottom-nav__item:focus-visible,
.mobile-shell .dock-more-btn:focus-visible {
    outline: 2px solid var(--mobile-primary);
    outline-offset: 2px;
}

.mobile-bottom-nav__item i {
    padding: 4px 11px;
    border-radius: 12px;
    transition: background-color var(--duration-ui, 200ms) var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1));
}

.mobile-bottom-nav__item.active i {
    background: color-mix(in srgb, var(--mobile-primary) 16%, transparent);
}

.mobile-pull-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mobile-pull-hint__spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--mobile-border);
    border-top-color: var(--mobile-primary);
    opacity: 0.35;
    transform: scale(calc(0.7 + (var(--pull-progress, 0) * 0.45)));
}

.mobile-pull-hint--armed .mobile-pull-hint__spinner,
.mobile-pull-hint--refreshing .mobile-pull-hint__spinner {
    opacity: 1;
}

.mobile-pull-hint--refreshing .mobile-pull-hint__spinner {
    animation: metro-spin 0.65s linear infinite;
}

.mobile-shell .metro-empty {
    padding: 2.75rem 1.25rem;
}

.mobile-shell .metro-empty .empty-icon,
.mobile-shell .metro-empty__icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
    border-radius: 20px;
    background: color-mix(in srgb, var(--mobile-primary) 12%, transparent);
    color: var(--mobile-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    opacity: 1;
}

.mobile-shell .metro-empty .empty-icon i,
.mobile-shell .metro-empty__icon i {
    font-size: 1.85rem;
    line-height: 1;
}

.mobile-shell .metro-empty__title,
.mobile-shell .metro-empty .fw-semibold {
    color: var(--mobile-text);
    font-size: 1.05rem;
}

.mobile-shell .metro-empty .btn,
.mobile-shell .metro-empty .btn-sm {
    min-height: var(--metro-touch-target-min, 48px);
    padding-left: 1.15rem;
    padding-right: 1.15rem;
}

.mobile-shell .metro-loading-spinner .spinner-border {
    width: 2.35rem;
    height: 2.35rem;
    border-width: 0.22rem;
}

.mobile-shell .metro-load-error {
    border-radius: 14px;
}

.mobile-shell .metro-skeleton-bar {
    border-radius: 8px;
}

.mobile-shell .metro-card-skeleton-card {
    border-radius: 16px;
}

.mobile-shell .dash-v2--refreshing,
.mobile-shell .fire-my-schedule--refreshing {
    opacity: 0.94;
}

.mobile-shell .card {
    border-radius: 14px;
}

.mobile-shell--ios .card:not([class*="border-"]) {
    border-color: transparent;
    box-shadow: var(--mobile-elev-ios);
}

.mobile-shell--android .card:not([class*="border-"]) {
    border-color: transparent;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.14), 0 3px 8px rgba(15, 23, 42, 0.08);
}

:root[data-theme="dark"] .mobile-shell--ios .card:not([class*="border-"]),
:root[data-theme="dark"] .mobile-shell--android .card:not([class*="border-"]) {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    background: var(--mobile-surface);
}

.mobile-shell .list-group-item {
    border-left: none;
    border-right: none;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
}

.mobile-shell .list-group-item:first-child {
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
}

.mobile-shell .list-group-item:last-child {
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
}

.mobile-nav-editor-sheet-header::before {
    content: "";
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 99px;
    background: var(--mobile-border);
    margin: 0 auto 8px;
}

.mobile-nav-editor-sheet-header::before {
    position: absolute;
    left: 50%;
    top: 8px;
    margin: 0;
    transform: translateX(-50%);
}

.mobile-nav-editor-sheet-header {
    position: relative;
    padding-top: 18px;
}

@media (max-width: 768px) {
    .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.55rem;
        font-weight: 750;
        letter-spacing: -0.03em;
        /* Do not set color here: many pages combine .page-header with .dash-v2-hero
           (dark gradient). Dark ink on that banner is unreadable. */
    }

    .mobile-shell .page-header:not(.dash-v2-hero) h1,
    .mobile-shell .page-header:not(.dash-v2-hero) h2,
    .mobile-shell .metro-page-header:not(.dash-v2-hero) h1,
    .mobile-shell .metro-page-header:not(.dash-v2-hero) h2 {
        color: var(--mobile-text);
    }

    .mobile-shell .dash-v2-hero h1,
    .mobile-shell .dash-v2-hero h2,
    .mobile-shell .dash-v2-hero h3,
    .mobile-shell .dash-v2-hero .h1,
    .mobile-shell .dash-v2-hero .h2,
    .mobile-shell .dash-v2-hero .h3 {
        color: #fff;
    }

    .mobile-shell .dash-v2-hero p,
    .mobile-shell .dash-v2-hero .text-muted,
    .mobile-shell .dash-v2-hero .text-secondary,
    .mobile-shell .dash-v2-hero .text-body,
    .mobile-shell .dash-v2-hero .text-body-secondary,
    .mobile-shell .dash-v2-hero .text-dark,
    .mobile-shell .dash-v2-hero small {
        color: #fff !important;
    }

    .mobile-shell .page-header p,
    .mobile-shell .page-header .text-muted,
    .mobile-shell .metro-page-header p {
        font-size: 0.92rem;
        line-height: 1.4;
    }

    .mobile-shell .login-card {
        padding: 28px 22px;
        box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
    }
}

@media (prefers-reduced-motion: reduce) {
    .mobile-shell .page-body,
    .mobile-shell .page-content,
    .mobile-shell .login-page,
    .mobile-shell .list-group-item,
    .mobile-shell .responsive-data-table__cards .card,
    .mobile-shell .tech-job-card,
    .mobile-shell .alert-success {
        animation: none;
    }

    .mobile-shell .btn:active:not(:disabled) {
        transform: none;
    }

    .mobile-shell .mobile-bottom-nav__item:active {
        transform: none;
        opacity: 1;
    }

    .mobile-shell .wo-mobile-row,
    .wo-mobile-row {
        animation: none;
    }

    .mobile-shell *,
    .mobile-shell *::before,
    .mobile-shell *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ── Mobile visual language: records list + dashboard (MAUI / phone shell) ── */
.wo-list-number {
    color: var(--metro-primary, #1a56db);
    background: none;
    font-family: inherit;
    font-weight: 750;
    font-size: 0.78rem;
    letter-spacing: 0.01em;
}

.mobile-shell .work-orders-index code {
    color: var(--metro-primary, #1a56db);
    background: none;
    font-family: inherit;
    font-weight: 750;
}

.mobile-shell .work-orders-index .table-danger > * {
    --bs-table-bg: transparent;
    --bs-table-accent-bg: transparent;
    background-color: transparent !important;
    box-shadow: none !important;
}

.work-orders-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding: 0.15rem 0 0.35rem;
}

.work-orders-mobile-list--cards {
    gap: 0.85rem;
}

.wo-mobile-list__select-all {
    display: flex;
    align-items: center;
    min-height: var(--metro-touch-target-min, 48px);
    padding: 0 0.15rem;
}

.wo-mobile-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.7rem;
    align-items: start;
    position: relative;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    background: var(--mobile-surface, #fff);
    border: 1px solid var(--mobile-border, #e5e7eb);
    color: var(--mobile-text, #111827);
    min-height: 72px;
    animation: mobile-item-in 280ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)) backwards;
}

.wo-mobile-row--card {
    grid-template-columns: 1fr;
    padding: 1.1rem 1.05rem 1.05rem;
}

.wo-mobile-row--overdue {
    border-color: color-mix(in srgb, #c81e1e 28%, var(--mobile-border, #e5e7eb));
    box-shadow: inset 3px 0 0 #c81e1e;
}

.wo-mobile-row--linked-family {
    background: var(--metro-surface-muted);
}

.wo-mobile-row--linked-family.wo-mobile-row--overdue {
    background: color-mix(in srgb, var(--metro-surface-muted) 70%, #fff5f5);
}

.wo-mobile-row--selected {
    border-color: color-mix(in srgb, var(--mobile-primary, #1a56db) 45%, var(--mobile-border, #e5e7eb));
    background: color-mix(in srgb, var(--mobile-primary, #1a56db) 6%, var(--mobile-surface, #fff));
}

.wo-mobile-row:active {
    transform: scale(0.992);
}

.wo-mobile-row__check {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 48px;
    min-height: 48px;
    margin: -0.25rem 0 0 -0.25rem;
    color: var(--mobile-text-muted, #6b7280);
    font-size: 0.82rem;
    font-weight: 650;
}

.wo-mobile-row__check--label {
    justify-content: flex-start;
    width: auto;
    margin: 0;
}

.wo-mobile-check {
    position: absolute;
    opacity: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.wo-mobile-check__box {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    border: 1.5px solid var(--mobile-border, #d1d5db);
    background: var(--mobile-surface, #fff);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
    flex-shrink: 0;
}

.wo-mobile-check:checked + .wo-mobile-check__box {
    background: var(--mobile-primary, #1a56db);
    border-color: var(--mobile-primary, #1a56db);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5l2.8 2.8 6.2-6.4'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 12px 12px;
}

.wo-mobile-check:focus-visible + .wo-mobile-check__box {
    outline: 2px solid var(--mobile-primary, #1a56db);
    outline-offset: 2px;
}

.wo-mobile-row__main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.wo-mobile-row__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
}

.wo-mobile-row__status {
    flex-shrink: 0;
}

.wo-mobile-row__title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
    color: var(--mobile-text, #111827);
}

.wo-mobile-row__address {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    color: var(--mobile-text-muted, #6b7280);
    font-size: 0.86rem;
    line-height: 1.35;
}

.wo-mobile-row__address i {
    margin-top: 0.12rem;
    color: var(--mobile-primary, #1a56db);
}

.wo-mobile-row__chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.2rem;
}

.wo-mobile-chip {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.wo-mobile-chip--overdue {
    background: #fef2f2;
    color: #991b1b;
}

.wo-mobile-row__footer {
    color: var(--mobile-text-muted, #6b7280);
    font-size: 0.8rem;
    margin-top: 0.15rem;
}

.wo-mobile-row__restore {
    position: relative;
    z-index: 2;
    min-width: 48px;
    min-height: 48px;
    border-radius: 12px;
    border: 1px solid var(--mobile-border, #e5e7eb);
    background: var(--mobile-surface, #fff);
    color: #057a55;
}

.mobile-shell--ios .wo-mobile-row {
    border-color: transparent;
    box-shadow: var(--mobile-elev-ios);
}

.mobile-shell--android .wo-mobile-row {
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.14), 0 3px 8px rgba(15, 23, 42, 0.08);
}

:root[data-theme="dark"] .wo-mobile-row {
    background: var(--mobile-surface, #141418);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

:root[data-theme="dark"] .wo-mobile-chip--overdue {
    background: #3f1d1d;
    color: #fecaca;
}

:root[data-theme="dark"] .wo-mobile-row--selected {
    background: color-mix(in srgb, var(--mobile-primary, #1a56db) 16%, var(--mobile-surface, #141418));
}

.work-order-list-card--overdue {
    box-shadow: inset 3px 0 0 #c81e1e, var(--metro-shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.06));
}

/* Dashboard: force stacked premium cards on the native phone shell. */
.mobile-shell .dash-v2-grid-shell .dashboard-grid {
    grid-template-columns: 1fr !important;
    gap: 0.9rem;
}

.mobile-shell .dash-v2-grid-shell .dashboard-grid-item {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
}

.mobile-shell .dash-v2-grid-shell .dashboard-grid-item-inner {
    container-type: normal;
    overflow: visible;
}

.mobile-shell .dash-v2-hero {
    border-radius: var(--mobile-radius-card, 16px);
    padding: 1.15rem 1.15rem 1.2rem;
    min-height: 0;
}

.mobile-shell .dash-v2-hero h1 {
    font-size: 1.7rem;
    line-height: 1.15;
}

.mobile-shell .dash-v2-hero__numbers {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}

.mobile-shell .dash-v2-hero__numbers > div {
    min-width: 0;
    min-height: 64px;
}

.mobile-shell .dash-v2-card {
    border-radius: var(--mobile-radius-card, 16px) !important;
    padding: 1.1rem 1.05rem;
    overflow: hidden;
}

.mobile-shell .dash-v2-shortcuts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}

.mobile-shell .dash-v2-shortcuts.dash-v2-shortcuts--all {
    grid-template-columns: repeat(auto-fill, minmax(6.25rem, 1fr));
}

.mobile-shell .dash-v2-shortcuts.dash-v2-shortcuts--compact {
    grid-template-columns: repeat(auto-fill, minmax(4.75rem, 1fr));
}

.mobile-shell .dash-v2-shortcuts.dash-v2-shortcuts--list {
    grid-template-columns: 1fr;
}

.mobile-shell .dash-v2-shortcuts > a,
.mobile-shell .dash-v2-shortcuts > button,
.mobile-shell .dash-v2-shortcut-tile > a,
.mobile-shell .dash-v2-shortcut-tile > button:not(.dash-v2-shortcut-remove),
.mobile-shell .fire-v2-shortcut-tile > a,
.mobile-shell .fire-v2-shortcut-tile > button:not(.fire-v2-shortcut-remove) {
    min-height: 56px;
    border-radius: 0.9rem;
    font-size: 0.78rem;
    padding: 0.45rem 0.35rem;
    gap: 0.35rem;
}

.mobile-shell .dash-v2-shortcuts span {
    display: block;
}

.mobile-shell .dash-v2-clear {
    min-height: 72px;
    border-radius: 0.9rem;
}

/* Mayor / executive: phone-first brief for on-the-move leadership. */
.mobile-shell .dash-v2--executive .dash-v2-hero__numbers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mobile-shell .dash-v2--executive .dash-v2-hero__numbers > div {
    min-height: 0;
    padding: 0.35rem 0.5rem;
}

/* Hero actions stay the phone primary. Story numbers are support, quieter than the CTA. */
.mobile-shell .dash-v2--executive .dash-v2-hero-cta-row {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: calc(var(--mobile-bottom-h, 64px) + var(--mobile-safe-bottom, 0px) + 0.5rem);
    z-index: 30;
    margin-top: 0;
}

.mobile-shell .dash-v2--executive .dash-v2-hero-cta {
    flex: 1 1 100%;
    justify-content: center;
    min-height: 48px;
    font-size: 1rem;
    font-weight: 700;
}

.mobile-shell .dash-v2--executive .dash-v2-briefing {
    flex: 1 1 100%;
}

.mobile-shell .dash-v2--executive .dash-v2-briefing .dash-v2-hero-cta {
    width: 100%;
}

.mobile-shell .dash-v2--executive .dash-v2-briefing__menu {
    top: auto;
    bottom: calc(100% + 0.4rem);
}

.mobile-shell .dash-v2--executive {
    padding-bottom: calc(3.25rem + var(--mobile-safe-bottom, 0px));
}

.mobile-shell .dash-v2--executive .dash-v2-hero__numbers strong,
.mobile-shell .dash-v2--executive .dash-v2-story-strip b {
    font-size: 0.95rem;
    font-weight: 650;
}

.mobile-shell .dash-v2--executive .dash-v2-story-strip.dash-v2-kpi-row > a,
.mobile-shell .dash-v2--executive .dash-v2-story-strip.dash-v2-kpi-row > div {
    min-height: 48px;
    padding: 0.35rem 0.55rem;
}

.mobile-shell .dash-v2 .badge,
.mobile-shell .wo-mobile-row__status,
.mobile-shell .wo-detail-glance .badge {
    font-size: 0.875rem;
    padding: 0.2rem 0.55rem;
}

.mobile-shell .dash-v2--executive .dash-v2-refresh--hero-secondary {
    display: none;
}

.mobile-shell .dash-v2--executive .dash-v2-quick-add-launch {
    min-height: var(--metro-touch-target-min, 48px);
    padding-inline: 0.85rem;
}

.mobile-shell .dash-v2--executive .dash-v2-action-list a {
    min-height: 64px;
    border-radius: 0.85rem;
}

.mobile-shell .dash-v2--executive .dash-v2-dept-row,
.mobile-shell .dash-v2--executive .dash-v2-rows > a {
    min-height: 60px;
}

.mobile-shell .dash-v2--executive .executive-positions-assign__field .form-select,
.mobile-shell .dash-v2--executive .executive-positions-assign__save {
    min-height: var(--metro-touch-target-min, 48px);
    font-size: 1rem;
}

.mobile-shell .dash-v2--executive .metro-map-canvas--embedded {
    height: min(40vh, 220px) !important;
}

.mobile-shell .dash-v2--executive .metro-map-filters-disclosure > summary {
    min-height: var(--metro-touch-target-min, 48px);
}

.mobile-shell .dash-v2--executive .dash-v2-chip-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
}

.mobile-shell .dash-v2--executive .dash-v2-chip-row > a,
.mobile-shell .dash-v2--executive .dash-v2-chip-row > button {
    min-height: var(--metro-touch-target-min, 48px);
    justify-content: center;
    width: 100%;
}

.mobile-shell .dash-v2--executive .dashboard-grid-toolbar .btn {
    min-height: var(--metro-touch-target-min, 48px);
}

.mobile-shell .dashboard-experience {
    background: var(--mobile-surface, #fff);
    border: 1px solid var(--mobile-border, #e5e7eb);
    border-radius: 14px;
    padding: 0.4rem 0.5rem;
    margin: 0 0 1rem;
}

.mobile-shell .dashboard-experience__options {
    background: var(--metro-surface-muted, #f1f5f9);
}

.mobile-shell .dashboard-experience__button.is-active {
    background: var(--mobile-primary, #1a56db);
    color: #fff;
    box-shadow: none;
}

:root[data-theme="dark"] .mobile-shell .dashboard-experience {
    background: var(--mobile-surface, #141418);
}

@media (max-width: 768px) {
    .mobile-shell .page-header,
    .mobile-shell .metro-page-header {
        margin-bottom: 1.1rem !important;
        gap: 0.75rem;
    }

    .mobile-shell .page-body > .card.border-0.shadow-sm.mb-3,
    .mobile-shell .work-orders-filters,
    .mobile-shell .dash-v2-card.work-orders-filters,
    .mobile-shell .metro-page-shell-filters > .card,
    .mobile-shell .metro-page-shell-filters > .dash-v2-card {
        border-radius: var(--mobile-radius-card, 16px) !important;
        overflow: hidden;
        box-shadow: var(--mobile-elev-ios);
    }
}

/* ── Shared mobile design system (all .mobile-shell destinations) ─────────── */
.mobile-shell {
    --bs-border-radius: var(--mobile-radius-control, 12px);
}

.mobile-shell .page-body {
    font-size: var(--mobile-type-body, 0.95rem);
}

.mobile-shell .metro-page-shell-header h1,
.mobile-shell .inspection-page-header h2,
.mobile-shell .fire-page-header h2,
.mobile-shell .page-body > h2 {
    font-size: var(--mobile-type-title, 1.55rem);
    font-weight: 750;
    letter-spacing: -0.03em;
}

.mobile-shell .metro-page-shell-filters > .card,
.mobile-shell .catalog-list-filter-bar,
.mobile-shell .page-body > .card.border-0.shadow-sm,
.mobile-shell .dash-v2-card.work-orders-filters,
.mobile-shell .work-orders-filters {
    border-radius: var(--mobile-radius-card, 16px) !important;
    overflow: hidden;
}

.mobile-shell .dash-v2-hero {
    border-radius: var(--mobile-radius-card, 16px) !important;
}

.mobile-shell .inspection-related-links,
.mobile-shell .fire-related-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.mobile-shell .inspection-related-link,
.mobile-shell .fire-related-link {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0.3rem 0.7rem;
    border-radius: var(--mobile-radius-pill, 999px);
    background: var(--metro-surface-muted, #f1f5f9);
    border: 1px solid var(--mobile-border, #e5e7eb);
    color: var(--mobile-text, #111827);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
}

.mobile-shell .inspection-filter-chips,
.mobile-shell .metro-segmented {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    border-radius: 14px;
    background: var(--metro-surface-muted, #f1f5f9);
    border: 1px solid var(--mobile-border, #e5e7eb);
}

.mobile-shell .inspection-filter-chips .btn {
    border: 0 !important;
    border-radius: 10px !important;
    font-weight: 700;
    box-shadow: none !important;
}

.mobile-shell .nav-tabs {
    gap: 0.35rem;
    border-bottom: 0;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
}

.mobile-shell .nav-tabs .nav-link {
    border: 1px solid var(--mobile-border, #e5e7eb);
    border-radius: var(--mobile-radius-pill, 999px);
    min-height: 44px;
    padding: 0.45rem 0.9rem;
    white-space: nowrap;
    color: var(--mobile-text-muted, #6b7280);
    font-weight: 700;
}

.mobile-shell .nav-tabs .nav-link.active {
    background: var(--mobile-primary, #1a56db);
    border-color: var(--mobile-primary, #1a56db);
    color: #fff;
}

.mobile-shell .form-check {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.mobile-shell .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0;
}

.mobile-shell .offcanvas,
.mobile-shell .modal-content,
.mobile-shell .metro-filter-drawer {
    border-radius: var(--mobile-radius-card, 16px) !important;
}

.mobile-shell .offcanvas-bottom,
.mobile-shell .offcanvas-end.metro-sheet-capable,
.mobile-shell .offcanvas-end.metro-filter-drawer,
.mobile-shell .metro-filter-drawer {
    border-radius: var(--mobile-radius-card, 16px) var(--mobile-radius-card, 16px) 0 0 !important;
}

.mobile-shell .kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

/* List-group → stacked cards (queue, meetings, open shifts, action center). */
.mobile-shell .list-group.list-group-flush {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    background: transparent;
}

.mobile-shell .list-group.list-group-flush .list-group-item {
    border: 1px solid var(--mobile-border, #e5e7eb);
    border-radius: var(--mobile-radius-card, 16px) !important;
    background: var(--mobile-surface, #fff);
    padding: 0.95rem 1rem !important;
}

.mobile-shell--ios .list-group.list-group-flush .list-group-item {
    border-color: transparent;
    box-shadow: var(--mobile-elev-ios);
}

.mobile-shell--android .list-group.list-group-flush .list-group-item {
    box-shadow: var(--mobile-elev-android);
}

.mobile-shell .card > .list-group.list-group-flush {
    padding: 0.65rem;
}

.mobile-shell .card:has(> .list-group.list-group-flush) {
    background: transparent;
    box-shadow: none !important;
}

.metro-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

/* Shared stacked row (records + legislative + generic lists). */
.metro-mobile-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    position: relative;
    width: 100%;
    padding: 0.95rem 1rem;
    border-radius: var(--mobile-radius-card, 16px);
    background: var(--mobile-surface, #fff);
    border: 1px solid var(--mobile-border, #e5e7eb);
    color: var(--mobile-text, #111827);
    min-height: 72px;
    cursor: pointer;
    text-align: left;
    appearance: none;
    font: inherit;
}

.metro-mobile-row__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
}

.metro-mobile-row__title {
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.metro-mobile-row__meta {
    color: var(--mobile-text-muted, #6b7280);
    font-size: 0.86rem;
}

.metro-mobile-row__chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.15rem;
}

.metro-mobile-row__chip {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0.15rem 0.55rem;
    border-radius: var(--mobile-radius-pill, 999px);
    background: var(--metro-surface-muted, #f1f5f9);
    color: var(--mobile-text, #111827);
    font-size: 0.72rem;
    font-weight: 700;
}

.metro-mobile-row__chip--warn {
    background: #fef3c7;
    color: #92400e;
}

.metro-mobile-row__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.5rem;
}

.metro-mobile-row:active {
    transform: scale(0.992);
}

.mobile-shell--ios .metro-mobile-row,
.mobile-shell--ios .wo-mobile-row {
    border-color: transparent;
    box-shadow: var(--mobile-elev-ios);
}

.mobile-shell--android .metro-mobile-row,
.mobile-shell--android .wo-mobile-row {
    box-shadow: var(--mobile-elev-android);
}

/* Phone: stack list tables into cards. Calendars / vote grids / schedulers excluded. */
@media (max-width: 768px) {
    .mobile-shell .table-responsive:not(.metro-keep-table):not(.metro-scheduler-scroll) > table.table:not(.metro-keep-table):not(.legislative-agenda-grid):not(:has(input[type="radio"])),
    .mobile-shell table.metro-stack-table {
        width: 100%;
    }

    .mobile-shell .table-responsive:not(.metro-keep-table):not(.metro-scheduler-scroll) > table.table:not(.metro-keep-table):not(.legislative-agenda-grid):not(:has(input[type="radio"])) thead,
    .mobile-shell table.metro-stack-table thead {
        display: none;
    }

    .mobile-shell .table-responsive:not(.metro-keep-table):not(.metro-scheduler-scroll) > table.table:not(.metro-keep-table):not(.legislative-agenda-grid):not(:has(input[type="radio"])),
    .mobile-shell .table-responsive:not(.metro-keep-table):not(.metro-scheduler-scroll) > table.table:not(.metro-keep-table):not(.legislative-agenda-grid):not(:has(input[type="radio"])) tbody,
    .mobile-shell table.metro-stack-table,
    .mobile-shell table.metro-stack-table tbody {
        display: block;
        width: 100%;
    }

    .mobile-shell .table-responsive:not(.metro-keep-table):not(.metro-scheduler-scroll) > table.table:not(.metro-keep-table):not(.legislative-agenda-grid):not(:has(input[type="radio"])) tbody tr,
    .mobile-shell table.metro-stack-table tbody tr {
        display: block;
        width: 100%;
        margin: 0 0 0.7rem;
        padding: 0.9rem 1rem;
        border: 1px solid var(--mobile-border, #e5e7eb);
        border-radius: var(--mobile-radius-card, 16px);
        background: var(--mobile-surface, #fff);
        box-shadow: var(--mobile-elev-ios);
    }

    .mobile-shell .table-responsive:not(.metro-keep-table):not(.metro-scheduler-scroll) > table.table:not(.metro-keep-table):not(.legislative-agenda-grid):not(:has(input[type="radio"])) tbody td,
    .mobile-shell table.metro-stack-table tbody td {
        display: block;
        width: 100%;
        border: 0;
        padding: 0.18rem 0;
        background: transparent !important;
        box-shadow: none !important;
    }

    .mobile-shell .table-responsive:not(.metro-keep-table):not(.metro-scheduler-scroll) > table.table:not(.metro-keep-table):not(.legislative-agenda-grid):not(:has(input[type="radio"])) tbody td:first-child,
    .mobile-shell table.metro-stack-table tbody td:first-child {
        font-weight: 750;
        color: var(--mobile-text, #111827);
    }

    .mobile-shell .work-orders-desktop-table {
        display: none !important;
    }
}

:root[data-theme="dark"] .mobile-shell .list-group.list-group-flush .list-group-item,
:root[data-theme="dark"] .metro-mobile-row,
:root[data-theme="dark"] .mobile-shell table.metro-stack-table tbody tr {
    background: var(--mobile-surface, #141418);
    box-shadow: var(--mobile-elev-dark);
}

:root[data-theme="dark"] .metro-mobile-row__chip {
    background: var(--metro-surface-muted, #1a1a1f);
    color: var(--mobile-text, #f3f4f6);
}

:root[data-theme="dark"] .metro-mobile-row__chip--warn {
    background: #3f2e12;
    color: #fde68a;
}

:root[data-theme="dark"] .mobile-shell .inspection-related-link,
:root[data-theme="dark"] .mobile-shell .fire-related-link,
:root[data-theme="dark"] .mobile-shell .inspection-filter-chips,
:root[data-theme="dark"] .mobile-shell .metro-segmented {
    background: var(--metro-surface-muted, #1a1a1f);
}

@media (max-width: 768px) {
    :root[data-theme="dark"] .mobile-shell .table-responsive:not(.metro-keep-table):not(.metro-scheduler-scroll) > table.table:not(.metro-keep-table) tbody tr {
        background: var(--mobile-surface, #141418);
        box-shadow: var(--mobile-elev-dark);
    }
}

/* Forms, alerts, badges, sheets, search — shared language for every destination. */
.mobile-shell .form-control,
.mobile-shell .form-select,
.mobile-shell .input-group-text {
    border-radius: var(--mobile-radius-control, 12px);
    border-color: var(--mobile-border, #e5e7eb);
}

.mobile-shell .alert {
    border-radius: var(--mobile-radius-card, 16px);
    border: 0;
}

.mobile-shell .badge {
    border-radius: var(--mobile-radius-pill, 999px);
    font-weight: 700;
}

.mobile-shell .card-header {
    border-radius: var(--mobile-radius-card, 16px) var(--mobile-radius-card, 16px) 0 0;
    background: var(--mobile-surface, #fff);
}

.mobile-shell .page-body > .d-flex.flex-wrap.justify-content-between > .h4,
.mobile-shell .page-body > .d-flex.align-items-center.justify-content-between h4,
.mobile-shell .page-body > .d-flex.flex-wrap.justify-content-between h2,
.mobile-shell .page-header h2,
.mobile-shell .page-header .h4 {
    font-size: var(--mobile-type-title, 1.55rem);
    font-weight: 750;
    letter-spacing: -0.03em;
}

.mobile-shell .metro-command-palette-panel,
.mobile-shell .metro-slide-panel,
.mobile-shell .topbar-account-sheet {
    border-radius: var(--mobile-radius-card, 16px);
}

.mobile-shell .metro-command-palette-row,
.mobile-shell .metro-command-palette-input {
    min-height: var(--metro-touch-target-min, 48px);
}

.mobile-shell .mobile-shell-error {
    padding: 2.5rem 1.25rem;
    text-align: center;
}

.mobile-shell .work-order-detail-header,
.mobile-shell .legislative-item-header {
    border-radius: var(--mobile-radius-card, 16px);
}

.mobile-shell .catalog-list-filter-bar input,
.mobile-shell input[type="search"] {
    border-radius: var(--mobile-radius-control, 12px);
}

:root[data-theme="dark"] .mobile-shell .card-header.bg-white,
:root[data-theme="dark"] .mobile-shell .card-footer.bg-white {
    background: var(--mobile-surface, #141418) !important;
}

/* Fire home + My Schedule — legislative-quality stacked chrome on the phone. */
.mobile-shell .fire-v2-stations,
.mobile-shell .fire-v2-name-list,
.mobile-shell .fire-v2-open-day__alerts {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.mobile-shell .fire-v2-station,
.mobile-shell .fire-v2-open-row,
.mobile-shell .fire-v2-person-chip {
    min-height: 52px;
}

.mobile-shell .fire-page-header-actions {
    width: 100%;
}

.mobile-shell .fire-my-schedule-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}

.mobile-shell .fire-my-schedule-actions--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mobile-shell .fire-page-header-actions > .btn,
.mobile-shell .fire-page-header-actions > a.btn,
.mobile-shell .fire-my-schedule-actions > .btn,
.mobile-shell .fire-my-schedule-actions > a.btn,
.mobile-shell .fire-my-schedule-more {
    width: 100%;
    min-width: 0;
}

.mobile-shell .fire-my-schedule-more > summary.btn {
    width: 100%;
}

.mobile-shell .fire-page-header-actions > .btn,
.mobile-shell .fire-my-schedule-actions > .btn,
.mobile-shell .fire-my-schedule-more > summary.btn {
    min-height: var(--metro-touch-target-min, 48px);
    border-radius: var(--mobile-radius-control, 12px);
    font-weight: 700;
}

.mobile-shell .fire-my-schedule-nav__controls {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.mobile-shell .fire-my-view-modes,
.mobile-shell .fire-my-period-nav,
.mobile-shell .metro-segmented.fire-my-view-modes,
.mobile-shell .metro-segmented.fire-my-period-nav {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-shell .fire-my-view-modes > .btn,
.mobile-shell .fire-my-view-modes > .fire-my-view-more > summary.btn,
.mobile-shell .fire-my-period-nav > .btn {
    flex: 1 0 auto;
    min-height: var(--metro-touch-target-min, 48px);
    padding-inline: 0.7rem;
}

.mobile-shell .fire-my-view-more {
    position: relative;
    flex: 1 0 auto;
}

.mobile-shell .fire-my-view-more > summary.btn {
    width: 100%;
}

.mobile-shell .fire-my-day-time {
    font-size: 1.02rem;
    font-weight: 750;
}

.mobile-shell .fire-my-day-where {
    font-size: 0.92rem;
}

/* View-as: one compact bar. The in-page hint duplicates the sticky banner. */
.mobile-shell .portal-preview-banner-inner {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
    gap: 0.4rem;
}

.mobile-shell .portal-preview-banner-text {
    font-size: 0.78rem;
    line-height: 1.3;
}

.mobile-shell .portal-preview-banner-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    margin-left: 0;
}

.mobile-shell .portal-preview-banner-actions .btn {
    min-height: 40px;
    width: 100%;
    font-weight: 700;
}

.mobile-shell .preview-readonly-shell > .alert {
    display: none;
}

@media (max-width: 768px) {
    .file-drop-zone,
    .mobile-shell .file-drop-zone {
        min-height: var(--metro-touch-target-min, 48px);
        padding: 0.9rem 0.8rem;
        border-radius: var(--mobile-radius-control, 12px);
    }

    .file-drop-zone-hint,
    .mobile-shell .file-drop-zone-hint {
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--mobile-text, var(--metro-text));
    }

    .file-drop-zone .form-control,
    .mobile-shell .file-drop-zone .form-control {
        min-height: var(--metro-touch-target-min, 48px);
    }

    .wo-public-status-facts {
        grid-template-columns: 1fr;
    }

    .wo-next-step {
        min-height: var(--metro-touch-target-min, 48px);
        padding-inline: 0.85rem;
        font-weight: 700;
    }

    .mobile-shell .fire-my-schedule-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Shared payment phone bar: fat Pay, dock + safe-area clearance, outdoor amounts.
   Specificity beats portal.css `.portal-main .btn { min-height: 44px }` (phone ≤640). */
.pay-fat,
.golf-pay-first .btn-primary,
.golf-pay-first .btn-success,
.golf-food-guest-payment .btn-success,
.public-pay-sheet .btn-primary,
.portal-main .golf-pay-first .btn,
.portal-body-container .golf-pay-first .btn,
.portal-main .golf-pay-first .btn.btn-sm,
.portal-body-container .golf-pay-first .btn.btn-sm,
.portal-main .golf-food-guest-payment .btn,
.portal-body-container .golf-food-guest-payment .btn {
    min-height: var(--metro-touch-target-min, 48px);
    font-weight: 700;
}

.pay-amount {
    color: #052e16;
    display: inline-block;
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

@media (max-width: 768px) {
    .pay-sticky-cta {
        position: sticky;
        z-index: 6;
        bottom: calc(var(--mobile-bottom-h, 0px) + env(safe-area-inset-bottom, 0px) + 0.5rem);
        padding-top: 0.65rem;
        background: linear-gradient(to top, var(--metro-surface, #fff) 72%, transparent);
    }

    .mobile-shell .pay-sticky-cta {
        bottom: calc(var(--mobile-bottom-h, 64px) + var(--mobile-safe-bottom, env(safe-area-inset-bottom, 0px)) + 0.5rem);
    }

    /* Payable Pay sits in a nested card + flex row, so it shrinks to the label.
       Phone: span the tee-time column the same way the guest token button does. */
    .golf-pay-first > .pay-sticky-cta .dash-v2-card {
        padding-left: 0;
        padding-right: 0;
    }

    .mobile-shell .golf-pay-first > .pay-sticky-cta .card-body,
    .golf-pay-first > .pay-sticky-cta .card-body {
        padding-left: 0;
        padding-right: 0;
    }

    .golf-pay-first > .pay-sticky-cta .btn,
    .portal-main .golf-pay-first .btn,
    .portal-body-container .golf-pay-first .btn,
    .portal-main .golf-pay-first .btn.btn-sm,
    .portal-body-container .golf-pay-first .btn.btn-sm {
        width: 100%;
    }

    /* Bootstrap .p-4 / .p-md-5 set padding !important, so a plain
       .pay-success padding-bottom never cleared the dock. */
    .card-body.pay-success {
        padding-bottom: calc(6.75rem + env(safe-area-inset-bottom, 0px)) !important;
    }

    .pay-success .portal-confirm-celebrate {
        padding-top: 1.5rem;
        padding-right: 1.1rem;
        padding-bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
        padding-left: 1.1rem;
    }

    .pay-success .portal-confirm-celebrate__title,
    .pay-success h1 {
        font-size: 1.5rem;
        line-height: 1.3;
        margin-bottom: 0.7rem;
    }

    .pay-success .portal-confirm-celebrate__lede,
    .pay-success .portal-confirm-celebrate__find,
    .pay-success p {
        font-size: 1.05rem;
        line-height: 1.45;
    }

    .pay-success .portal-sticky-primary > .btn,
    .pay-success .portal-confirm-celebrate__cta,
    .pay-success .pay-sticky-cta .btn,
    .pay-success .pay-sticky-cta .pay-fat {
        min-height: var(--metro-touch-target-min, 48px);
    }
}

.pay-pending {
    background: #fffbeb;
    border: 2px solid #d97706;
    color: #78350f;
}

.pay-pending h1 {
    color: #92400e;
}

@media (prefers-contrast: more) {
    .pay-amount {
        color: #052e16;
    }

    .pay-pending {
        background: #fffbeb;
        border-color: #92400e;
        color: #451a03;
    }
}

/* Payments phone ≤768 — fat full-width pay taps, fee lines that wrap,
   checkout sheets above the bottom nav. Specificity beats the 44px
   .portal-main .btn rule at the compact breakpoint. */
@media (max-width: 768px) {
    .mobile-shell.mobile-shell .online-pay-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .mobile-shell.mobile-shell .online-pay-actions > .btn,
    .mobile-shell.mobile-shell .btn.online-pay-actions {
        width: 100%;
        min-height: var(--metro-touch-target-min, 48px);
    }

    .mobile-shell.mobile-shell .portal-payable-row {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem;
    }

    .mobile-shell.mobile-shell .portal-payable-row > .text-end {
        text-align: initial;
        width: 100%;
    }

    .mobile-shell.mobile-shell .portal-cart-header {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .mobile-shell.mobile-shell .portal-cart-header > .d-flex {
        flex-wrap: wrap;
        width: 100%;
    }

    .mobile-shell.mobile-shell .portal-cart-checkout {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem;
    }

    .mobile-shell.mobile-shell .portal-cart-checkout .d-flex {
        flex-direction: column;
        align-items: stretch;
    }

    .mobile-shell.mobile-shell .portal-cart-checkout .btn {
        width: 100%;
        min-height: var(--metro-touch-target-min, 48px);
    }

    .mobile-shell.mobile-shell .public-pay-lines .d-flex {
        flex-wrap: wrap;
        gap: 0.15rem 0.75rem;
    }

    .mobile-shell.mobile-shell .public-pay-lines .d-flex > span:first-child {
        flex: 1 1 8rem;
        min-width: 0;
    }

    .mobile-shell.mobile-shell .payment-return-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .mobile-shell.mobile-shell .payment-return-actions > .btn,
    .mobile-shell.mobile-shell .payment-return-actions > a.btn {
        width: 100%;
        min-height: var(--metro-touch-target-min, 48px);
    }

    .mobile-shell.mobile-shell .receipt-printable .row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .mobile-shell.mobile-shell .golf-sticky-next .metro-sticky-footer__inner {
        flex-direction: column;
        align-items: stretch;
    }

    .mobile-shell.mobile-shell .golf-sticky-next .btn {
        width: 100%;
        margin-left: 0 !important;
        min-height: var(--metro-touch-target-min, 48px);
    }

    /* Bottom nav is z-index 1200. Keep the card sheet above it; the footer
       already pads for safe-area-inset-bottom. */
    .mobile-shell.mobile-shell .payment-sheet-modal {
        z-index: 1300;
    }

    .mobile-shell.mobile-shell .payment-sheet-modal .modal-dialog {
        max-height: calc(100dvh - var(--mobile-safe-bottom) - 1rem);
    }

    .mobile-shell.mobile-shell .payment-sheet-modal .modal-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .mobile-shell.mobile-shell .payment-sheet-modal .modal-footer .btn {
        width: 100%;
        min-height: var(--metro-touch-target-min, 48px);
    }

    /* Golf refund review is a receipt table, not a list. Phone stacking
       turned tbody into cards and left Tip / Refund total as a ~152px
       table fragment. metro-keep-table preserves the columns.
       Footer actions match the payment sheet: full-width, ≥48px. */
    .mobile-shell .refund-sheet .modal-dialog {
        /* Footer safe-area padding does not lift the sheet off the bottom dock. */
        max-height: calc(100dvh - var(--mobile-bottom-h, 64px) - env(safe-area-inset-bottom, 0px) - 1rem);
    }

    .mobile-shell .refund-sheet .modal-content {
        max-height: 100%;
    }

    .mobile-shell .refund-sheet .modal-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .mobile-shell .refund-sheet .modal-footer .btn {
        width: 100%;
        margin-left: 0 !important;
        min-height: var(--metro-touch-target-min, 48px);
    }

    .mobile-shell .refund-sheet .table tfoot td {
        color: var(--metro-text);
        font-size: 1rem;
    }

    .mobile-shell .refund-sheet .table tfoot .text-muted {
        color: #14532d !important;
        font-weight: 700;
    }

    .mobile-shell .row:has(#refund-amount) > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;
    }

    .mobile-shell .row:has(#refund-amount) > .d-flex {
        flex-direction: column;
        align-items: stretch;
    }

    .mobile-shell .row:has(#refund-amount) .btn {
        width: 100%;
        min-height: var(--metro-touch-target-min, 48px);
    }
}

/* ── Inspector field polish (queue / Pass-Fail / FABs) ───────────────────── */

/* Collapse inspection chrome on phone: hero + related tabs eat fold space. */
@media (max-width: 767.98px) {
    .mobile-shell .dash-v2--inspections .inspection-page-header.dash-v2-hero--compact {
        margin-bottom: 0.5rem !important;
        padding-block: 0.65rem;
    }

    .mobile-shell .dash-v2--inspections .inspection-page-header h1 {
        font-size: 1.25rem;
        margin-bottom: 0.15rem;
    }

    .mobile-shell .dash-v2--inspections .inspection-page-header p {
        font-size: 0.8125rem;
        line-height: 1.3;
        margin-bottom: 0;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .mobile-shell .dash-v2--inspections .inspection-related-links {
        display: none !important;
    }

    .mobile-shell .inspection-queue-toolbar--mobile {
        gap: 0.5rem;
    }

    .mobile-shell .inspection-queue-filter-summary {
        font-weight: 600;
    }

    .mobile-shell .inspection-queue-item__body {
        display: flex;
        flex-direction: column;
        gap: 0.65rem;
        width: 100%;
    }

    .mobile-shell .inspection-queue-actions {
        display: flex;
        flex-direction: column;
        gap: 0.4rem;
        width: 100%;
    }

    /* My Day — field tap targets + elevated cards inside the shell scroller */
    .mobile-shell .inspector-my-day-page__chrome {
        margin-bottom: 0.75rem;
        padding-bottom: 0.35rem;
    }

    .mobile-shell .inspector-my-day-page .inspection-page-header-actions {
        grid-template-columns: 1fr;
        gap: 0.45rem;
    }

    .mobile-shell .inspector-my-day-action {
        width: 100%;
        min-height: 48px;
        border-radius: var(--mobile-radius-control, 12px);
    }

    .mobile-shell .inspector-my-day-stats {
        gap: 0.5rem;
    }

    .mobile-shell .inspector-my-day-stat {
        border-radius: var(--mobile-radius-card, 16px);
        box-shadow: var(--mobile-elev-ios);
        padding: 0.7rem 0.5rem;
    }

    .mobile-shell .inspector-my-day-stat__value {
        font-size: 1.45rem;
    }

    .mobile-shell .inspector-my-day-next {
        border-radius: var(--mobile-radius-card, 16px);
        box-shadow: var(--mobile-elev-ios);
        padding: 1rem;
    }

    .mobile-shell .inspector-my-day-next__actions {
        flex-direction: column;
    }

    .mobile-shell .inspector-my-day-next__cta,
    .mobile-shell .inspector-my-day-next__view {
        width: 100%;
        min-height: 52px;
        border-radius: var(--mobile-radius-control, 12px);
        justify-content: center;
    }

    .mobile-shell .inspector-my-day {
        border-radius: var(--mobile-radius-card, 16px);
        box-shadow: var(--mobile-elev-ios);
        border: 1px solid var(--mobile-border);
    }

    .mobile-shell .inspector-my-day .card-header {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .mobile-shell .inspector-my-day__day-chrome {
        position: sticky;
        top: 0;
        z-index: 4;
        background: var(--mobile-surface, #fff) !important;
        box-shadow: 0 4px 12px -8px rgba(15, 23, 42, 0.4);
    }

    .mobile-shell .inspector-my-day__day-nav .btn {
        min-height: 48px;
        min-width: 48px;
        border-radius: var(--mobile-radius-control, 12px);
    }

    .mobile-shell .inspector-my-day__date-input {
        min-height: 48px;
        border-radius: var(--mobile-radius-control, 12px);
        width: 100%;
        max-width: 11rem;
    }

    .mobile-shell .inspector-my-day__calendar-link {
        width: 100%;
        min-height: 48px;
        justify-content: center;
        border-radius: var(--mobile-radius-control, 12px);
    }

    .mobile-shell .inspector-my-day .list-group-item {
        padding: 0.9rem;
        transition: background-color 200ms ease, transform 200ms ease;
    }

    .mobile-shell .inspector-my-day .list-group-item:active {
        background-color: color-mix(in srgb, var(--mobile-bg) 70%, var(--mobile-surface));
        transform: scale(0.995);
    }

    .mobile-shell .inspector-my-day .list-group-item .btn {
        min-height: 48px;
        border-radius: var(--mobile-radius-control, 12px);
        flex: 1 1 auto;
    }

    .mobile-shell .inspector-my-day__row-actions {
        width: 100%;
    }

    .mobile-shell .inspector-my-day .btn-group .btn {
        min-height: 48px;
    }

    .mobile-shell .inspection-queue-actions__primary .btn,
    .mobile-shell .inspection-queue-actions__primary a.btn,
    .mobile-shell .inspector-field-card-actions__primary {
        width: 100%;
        min-height: var(--metro-touch-target-min, 48px);
        padding-top: 0.45rem;
        padding-bottom: 0.45rem;
        font-size: 0.9375rem;
        justify-content: center;
    }

    .mobile-shell .inspection-queue-actions__secondary {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem;
        width: 100%;
    }

    .mobile-shell .inspection-queue-actions__secondary > .btn {
        flex: 1 1 auto;
        min-height: 44px;
        min-width: 0;
        padding-top: 0.4rem;
        padding-bottom: 0.4rem;
        font-size: 0.875rem;
    }

    .mobile-shell .inspection-queue-actions__more {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem;
        width: 100%;
    }

    .mobile-shell .inspection-queue-actions__more > .btn,
    .mobile-shell .inspection-queue-actions__more > a.btn {
        flex: 1 1 calc(50% - 0.2rem);
        min-height: 44px;
        font-size: 0.875rem;
        padding-top: 0.4rem;
        padding-bottom: 0.4rem;
    }

    /* Pass/Fail/N/A: full row, ≥48px tap. */
    .mobile-shell .field-checklist-segments {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.35rem;
        padding: 0;
    }

    .mobile-shell .field-checklist-segments .btn {
        min-height: var(--metro-touch-target-min, 48px);
        padding: 0.4rem 0.35rem;
        font-size: 0.875rem;
        font-weight: 700;
        line-height: 1.1;
    }

    .mobile-shell .building-inspection-photo-btn,
    .tech-shell .building-inspection-photo-btn {
        width: 100%;
        min-height: var(--metro-touch-target-min, 48px);
        justify-content: center;
    }

    .mobile-shell .building-inspection-address__text {
        font-size: 1.05rem;
        color: var(--metro-text, #14213d);
    }

    .mobile-shell .wo-visit-card,
    .mobile-shell .wo-visit-result {
        --wo-visit-action-min: 56px;
    }

    .mobile-shell .wo-visit-next {
        position: sticky;
        bottom: calc(var(--mobile-bottom-h, 64px) + var(--mobile-safe-bottom, env(safe-area-inset-bottom, 0px)));
        z-index: 6;
        padding-top: 0.5rem;
        padding-bottom: 0.65rem;
        background: var(--metro-surface, #fff);
    }

    .mobile-shell .wo-visit-next .wo-visit-action,
    .mobile-shell .wo-visit-next .inspection-cta,
    .mobile-shell .wo-visit-signoff .wo-visit-verdict__btn {
        width: 100%;
        min-height: var(--metro-touch-target-min, 48px);
    }

    .mobile-shell .wo-visit-signoff .wo-visit-verdict {
        grid-template-columns: 1fr;
        margin: 0;
    }

    .mobile-shell .wo-visit-prep,
    .mobile-shell .wo-visit-outcome {
        font-size: 1.05rem;
        font-weight: 700;
        line-height: 1.35;
        color: var(--metro-text, #14213d);
    }

    .mobile-shell .field-checklist-response {
        padding: 0.75rem !important;
    }

    .mobile-shell .checklist-question-card > .card-header {
        padding-top: 0.75rem !important;
        padding-bottom: 0.5rem !important;
    }

    .mobile-shell .building-inspection-tools {
        border: 1px solid var(--mobile-border, #e5e7eb);
        border-radius: var(--mobile-radius-card, 16px);
        background: var(--metro-surface, #fff);
    }

    .mobile-shell .building-inspection-tools__summary {
        cursor: pointer;
        font-weight: 700;
        list-style: none;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .mobile-shell .building-inspection-tools__summary::-webkit-details-marker {
        display: none;
    }

    .mobile-shell .building-inspection-tools__summary::after {
        content: "▾";
        margin-left: auto;
        opacity: 0.55;
    }

    .mobile-shell .building-inspection-tools[open] > .building-inspection-tools__summary::after {
        content: "▴";
    }

    .mobile-shell .building-inspection-tools .btn {
        min-height: 44px;
        flex: 1 1 auto;
    }

    .mobile-shell .cd-easy-cta.inspection-cta {
        min-height: var(--metro-touch-target-min, 48px);
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }
}

/* Hybrid shell (phone and tablet): primary inspector taps and visit actions.
   iOS/Android platform classes sit on the same shell, including tablets wider than 768px. */
.mobile-shell .inspector-field-card-actions__primary,
.mobile-shell .inspector-my-day-pending__more,
.mobile-shell--ios .inspector-my-day-pending__more,
.mobile-shell--android .inspector-my-day-pending__more,
.mobile-shell .building-inspection-photo-btn,
.tech-shell .building-inspection-photo-btn {
    width: 100%;
    min-height: var(--metro-touch-target-min, 48px);
    justify-content: center;
}

.mobile-shell .field-checklist-segments .btn {
    min-height: var(--metro-touch-target-min, 48px);
}

.mobile-shell .wo-visit-card,
.mobile-shell .wo-visit-result {
    --wo-visit-action-min: 56px;
}

.mobile-shell .wo-visit-next {
    position: sticky;
    bottom: calc(var(--mobile-bottom-h, 64px) + var(--mobile-safe-bottom, env(safe-area-inset-bottom, 0px)));
    z-index: 6;
    padding-top: 0.5rem;
    padding-bottom: 0.65rem;
    background: var(--metro-surface, #fff);
}

.mobile-shell .wo-visit-next .inspection-cta,
.mobile-shell .wo-visit-next .wo-visit-action,
.mobile-shell .wo-visit-signoff .wo-visit-verdict__btn {
    width: 100%;
    min-height: var(--metro-touch-target-min, 48px);
}

.mobile-shell .wo-visit-signoff .wo-visit-verdict {
    grid-template-columns: 1fr;
    margin: 0;
}

.wo-visit-prep,
.wo-visit-outcome {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
}

.inspection-schedule-day__input,
.inspection-schedule-sheet .form-control,
.inspection-schedule-sheet .form-select {
    min-height: var(--metro-touch-target-min, 48px);
    font-size: 1.05rem;
}

.mobile-shell .inspection-schedule-inspector-row .inspector-day-preview-toggle,
body:has(.mobile-shell) .inspection-schedule-inspector-row .inspector-day-preview-toggle {
    min-height: var(--metro-touch-target-min, 48px);
    min-width: var(--metro-touch-target-min, 48px);
    padding-inline: 0.75rem;
}

.mobile-shell .inspector-day-preview,
body:has(.mobile-shell) .inspector-day-preview {
    max-height: min(50dvh, 22rem);
    overflow: auto;
}

.mobile-shell .inspector-day-preview__grid,
body:has(.mobile-shell) .inspector-day-preview__grid {
    max-height: 12rem;
}

.inspection-schedule-time-choice {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.inspection-schedule-time-choice__btn {
    width: 100%;
    min-height: var(--metro-touch-target-min, 48px);
    padding: 0.75rem 1rem;
    border-radius: 14px;
    border: 2px solid var(--mobile-border, #e2e8f0);
    background: var(--mobile-surface, #fff);
    font-weight: 700;
    font-size: 1rem;
    text-align: left;
}

.inspection-schedule-time-choice__btn.is-active {
    border-color: var(--bs-primary, #0d6efd);
    background: color-mix(in srgb, var(--bs-primary, #0d6efd) 10%, var(--metro-surface));
}

.mobile-shell .inspection-schedule-sheet.offcanvas,
body:has(.mobile-shell) .inspection-schedule-sheet.offcanvas {
    bottom: calc(var(--mobile-bottom-h, 64px) + var(--mobile-safe-bottom, env(safe-area-inset-bottom, 0px)));
    max-height: calc(100dvh - var(--mobile-bottom-h, 64px) - var(--mobile-safe-bottom, env(safe-area-inset-bottom, 0px)) - 0.5rem);
}

.inspection-schedule-sheet .offcanvas-footer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: calc(0.75rem + var(--mobile-safe-bottom, env(safe-area-inset-bottom, 0px)));
}

.inspection-schedule-sheet .inspection-schedule-save {
    width: 100%;
    min-height: var(--metro-touch-target-min, 48px);
    order: -1;
}

.cv-quick-violation-dialog {
    display: flex;
    flex-direction: column;
    max-height: min(88dvh, calc(100dvh - 2rem)) !important;
}

.cv-quick-library-wrap {
    max-height: 10rem;
}

.cv-quick-create {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: var(--mobile-surface, #fff);
    /* Overlay already clears the dock / home indicator — extra bottom-nav padding
       clipped Create violation and Cancel below the card. */
    padding-bottom: 0.75rem;
}

.cv-quick-create__btn,
.cv-quick-photos__btn,
.cv-quick-address,
.cv-quick-code {
    min-height: var(--metro-touch-target-min, 48px);
}

.cv-quick-create__btn {
    width: 100%;
}

.cv-quick-code {
    display: flex;
    align-items: center;
}

.cv-quick-library__row {
    width: 100%;
    min-height: var(--metro-touch-target-min, 48px);
    justify-content: flex-start;
    gap: 0.65rem;
    text-align: start;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    padding: 0.65rem 0.85rem;
    font-weight: 600;
}

.cv-quick-library__row .bi {
    font-size: 1.25rem;
    flex: 0 0 auto;
}

.cv-quick-violation-body {
    padding-bottom: 0.5rem;
}

.mobile-shell--ios .inspector-my-day,
.mobile-shell--ios .inspector-my-day-stat,
.mobile-shell--ios .inspector-my-day-next {
    box-shadow: var(--mobile-elev-ios);
}

.mobile-shell--android .inspector-my-day,
.mobile-shell--android .inspector-my-day-stat,
.mobile-shell--android .inspector-my-day-next {
    box-shadow: var(--mobile-elev-android);
}

/* Tablet (≈768px): list + map side-by-side without a full redesign. */
@media (min-width: 768px) {
    .inspection-queue-board {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(280px, 38%);
        gap: 1rem;
        align-items: start;
    }

    .inspection-queue-board__side {
        position: sticky;
        top: calc(var(--topbar-height, 56px) + 0.75rem);
    }

    .inspection-queue-item__body {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .inspection-queue-actions {
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
        align-items: stretch;
        min-width: 11rem;
        max-width: 16rem;
    }

    .inspection-queue-actions__primary .btn,
    .inspection-queue-actions__primary a.btn {
        width: 100%;
    }

    .inspection-queue-actions__secondary {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .inspection-queue-actions__secondary > .btn {
        flex: 1 1 auto;
    }

    .inspection-queue-actions__more {
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
    }
}

/* Lift FABs a bit further above dock + home-indicator. */
.mobile-shell .metro-fab-stack {
    bottom: calc(var(--mobile-bottom-h) + var(--mobile-safe-bottom) + 1.25rem);
}

/* ── Centered field confirms (Pass/Fail, etc.) — middle of phone + tablet ─── */
.mobile-shell .modal.show.metro-modal--center,
.tech-shell .modal.show.metro-modal--center,
body:has(.mobile-shell) .modal.show.metro-modal--center,
body:has(.tech-shell) .modal.show.metro-modal--center,
.mobile-shell .modal.show.d-block.metro-modal--center,
.tech-shell .modal.show.d-block.metro-modal--center,
body:has(.mobile-shell) .modal.show.d-block.metro-modal--center,
body:has(.tech-shell) .modal.show.d-block.metro-modal--center {
    align-items: center !important;
    justify-content: center !important;
    padding: max(0.75rem, var(--mobile-safe-top, 0px), env(safe-area-inset-top, 0px))
             max(0.75rem, var(--mobile-safe-right, 0px), env(safe-area-inset-right, 0px))
             max(0.75rem, var(--mobile-safe-bottom, 0px), env(safe-area-inset-bottom, 0px))
             max(0.75rem, var(--mobile-safe-left, 0px), env(safe-area-inset-left, 0px)) !important;
}

.mobile-shell .modal.show.metro-modal--center .modal-dialog,
.tech-shell .modal.show.metro-modal--center .modal-dialog,
body:has(.mobile-shell) .modal.show.metro-modal--center .modal-dialog,
body:has(.tech-shell) .modal.show.metro-modal--center .modal-dialog {
    margin: auto !important;
    max-width: min(28rem, calc(100vw - 1.5rem)) !important;
    width: 100% !important;
    max-height: min(88dvh, calc(100dvh - 2rem)) !important;
    display: flex !important;
    align-items: center !important;
}

.mobile-shell .modal.show.metro-modal--center .modal-content,
.tech-shell .modal.show.metro-modal--center .modal-content,
body:has(.mobile-shell) .modal.show.metro-modal--center .modal-content,
body:has(.tech-shell) .modal.show.metro-modal--center .modal-content {
    border-radius: 16px !important;
    border: 1px solid var(--mobile-border, #e2e8f0) !important;
    box-shadow: 0 12px 40px rgba(15, 28, 46, 0.22) !important;
    max-height: inherit;
    width: 100%;
}

.inspection-passfail-modal__dialog {
    width: 100%;
}

.inspection-passfail-modal__body {
    padding-top: 0.35rem;
}

.inspection-passfail-modal__choice {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
}

/* Notify contacts / Don't notify stay stacked and full-width on every phone. */

.inspection-passfail-modal__choice-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    width: 100%;
    min-height: 72px;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    border: 2px solid var(--mobile-border, #e2e8f0);
    background: var(--mobile-surface, #fff);
    text-align: left;
    color: inherit;
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.inspection-passfail-modal__choice-btn i {
    font-size: 1.2rem;
    opacity: 0.85;
}

.inspection-passfail-modal__choice-label {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.25;
}

.inspection-passfail-modal__choice-hint {
    font-size: 0.8125rem;
    color: var(--metro-muted, #64748b);
    line-height: 1.3;
}

.inspection-passfail-modal__choice-btn.is-active.is-notify {
    border-color: var(--bs-primary, #0d6efd);
    background: color-mix(in srgb, var(--bs-primary, #0d6efd) 10%, var(--metro-surface));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--bs-primary, #0d6efd) 35%, transparent);
}

.inspection-passfail-modal__choice-btn.is-active.is-skip {
    border-color: #64748b;
    background: color-mix(in srgb, #64748b 8%, var(--metro-surface));
}

.inspection-passfail-modal__choice-btn:active {
    transform: scale(0.99);
}

.inspection-passfail-modal__recipient-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.inspection-passfail-modal__recipient {
    border: 1px solid var(--mobile-border, #e2e8f0);
    border-radius: 12px;
    padding: 0.85rem;
    background: color-mix(in srgb, var(--mobile-bg, #f8fafc) 70%, var(--metro-surface));
}

.inspection-passfail-modal__recipient.is-skipped {
    opacity: 0.55;
}

.inspection-passfail-modal__fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
}

@media (min-width: 520px) {
    .inspection-passfail-modal__fields {
        grid-template-columns: 1fr 1fr;
    }
}

.inspection-passfail-modal__fields .form-control {
    min-height: 48px;
    font-size: 1rem;
}

.inspection-passfail-modal__footer .inspection-passfail-modal__action {
    min-height: 48px;
    padding-left: 1.1rem;
    padding-right: 1.1rem;
    font-weight: 600;
}

.inspection-passfail-modal__footer .inspection-passfail-modal__action--primary {
    flex: 1 1 auto;
    min-width: 10rem;
}

@media (max-width: 479.98px) {
    .inspection-passfail-modal__footer .d-flex {
        flex-direction: column-reverse;
        align-items: stretch !important;
    }

    .inspection-passfail-modal__footer .inspection-passfail-modal__action {
        width: 100%;
    }
}


/* ── Field chrome modals (phone AND tablet): centered where the user is ────────
   metroAsapMobile.js pinViewportModals sizes the .modal box to the visual viewport and shifts
   it back on screen when an ancestor traps position:fixed. While a modal is open the shell
   scroller is locked (class below) so the page behind cannot drift under the dialog. */
.mobile-shell__body--pull.metro-overlay-scroll-lock {
    overflow-y: hidden !important;
}

.mobile-shell .modal.show,
.tech-shell .modal.show,
body:has(.mobile-shell) .modal.show,
body:has(.tech-shell) .modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Tablets: Bootstrap's .modal has no padding, so a tall dialog would touch the screen edges. */
    padding: max(1rem, var(--mobile-safe-top, 0px)) 1rem max(1rem, var(--mobile-safe-bottom, 0px));
}

.mobile-shell .modal.show .modal-dialog,
.tech-shell .modal.show .modal-dialog,
body:has(.mobile-shell) .modal.show .modal-dialog,
body:has(.tech-shell) .modal.show .modal-dialog {
    margin: auto;
    height: auto;
    min-height: 0;
    max-height: calc(100dvh - var(--mobile-safe-top, 0px) - var(--mobile-safe-bottom, 0px) - 2rem);
}

.mobile-shell .modal.show .modal-content,
.tech-shell .modal.show .modal-content,
body:has(.mobile-shell) .modal.show .modal-content,
body:has(.tech-shell) .modal.show .modal-content {
    max-height: inherit;
    height: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mobile-shell .modal.show .modal-body,
.tech-shell .modal.show .modal-body,
body:has(.mobile-shell) .modal.show .modal-body,
body:has(.tech-shell) .modal.show .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* iOS overlays the keyboard without shrinking 100dvh. Keep the View As search
   (and other dialogs) in the remaining visual area while typing. */
html.metro-keyboard-open .admin-view-as-modal.modal.show,
html.metro-keyboard-open .mobile-shell .admin-view-as-modal.modal.show,
html.metro-keyboard-open .tech-shell .admin-view-as-modal.modal.show,
html.metro-keyboard-open body:has(.mobile-shell) .admin-view-as-modal.modal.show {
    align-items: flex-start !important;
    justify-content: flex-start !important;
    padding-bottom: var(--metro-keyboard-inset, 0px) !important;
}

html.metro-keyboard-open .admin-view-as-modal .modal-dialog,
html.metro-keyboard-open .mobile-shell .admin-view-as-modal .modal-dialog,
html.metro-keyboard-open .tech-shell .admin-view-as-modal .modal-dialog,
html.metro-keyboard-open body:has(.mobile-shell) .admin-view-as-modal .modal-dialog {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    align-self: stretch !important;
    max-height: calc(100dvh - var(--metro-keyboard-inset, 0px) - 0.5rem) !important;
}

/* My inspection types — 48px switches, large type, shared by web and Hybrid. */
.my-inspection-types {
    max-width: 40rem;
    padding: 0.5rem 0 2rem;
}

.my-inspection-types__title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 0.75rem;
}

.my-inspection-types__lead,
.my-inspection-types__empty-body,
.my-inspection-types__alert {
    font-size: 1.25rem;
    line-height: 1.4;
}

.my-inspection-types__lead {
    margin: 0 0 1.25rem;
}

.my-inspection-types__empty {
    padding: 1.5rem 0;
}

.my-inspection-types__empty-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 0.5rem;
}

.my-inspection-types__empty-body {
    margin: 0;
}

.my-inspection-types__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    min-height: 4.5rem;
    margin: 0;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
    cursor: pointer;
}

.my-inspection-types__label {
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    cursor: pointer;
}

.my-inspection-types__switch.form-switch {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 48px;
    min-width: 48px;
    margin: 0;
    padding-left: 0;
}

.my-inspection-types__switch .form-check-input {
    width: 80px;
    height: 48px;
    min-width: 80px;
    min-height: 48px;
    margin: 0;
    float: none;
    cursor: pointer;
    border-radius: 48px;
    background-size: 40px 40px;
}

.my-inspection-types__switch .form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.35);
}

.my-inspection-types__state {
    font-size: 1.25rem;
    font-weight: 800;
    min-width: 2.5rem;
}

/* Named empty when My inspection types hid every unscheduled row. */
.my-inspection-types-filter-empty {
    max-width: 40rem;
    margin: 0 auto;
    padding: 1.75rem 1rem 2rem;
    text-align: center;
}

.my-inspection-types-filter-empty__title {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.25;
    margin: 0 0 0.75rem;
}

.my-inspection-types-filter-empty__body {
    font-size: 1.25rem;
    line-height: 1.45;
    margin: 0 0 1.25rem;
}

.my-inspection-types-filter-empty__action {
    min-height: 48px;
    min-width: 48px;
    padding: 0.75rem 1.25rem;
    font-size: 1.125rem;
    font-weight: 700;
}

/* External portal phone cards. Hybrid inherits .mobile-shell--ios / .mobile-shell--android. */
.mobile-shell--ios .portal-phone-card,
.mobile-shell--android .portal-phone-card,
.mobile-shell .portal-phone-card {
    width: 100%;
}

.mobile-shell--ios .portal-phone-actions,
.mobile-shell--android .portal-phone-actions,
.mobile-shell .portal-phone-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.75rem;
    scroll-margin-bottom: calc(var(--mobile-bottom-h, 64px) + var(--mobile-safe-bottom, 0px) + 1rem);
}

.mobile-shell--ios .portal-phone-actions .d-inline-flex,
.mobile-shell--android .portal-phone-actions .d-inline-flex,
.mobile-shell .portal-phone-actions .d-inline-flex {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.5rem;
}

.mobile-shell--ios .portal-phone-action,
.mobile-shell--android .portal-phone-action,
.mobile-shell--ios .portal-phone-actions .btn,
.mobile-shell--android .portal-phone-actions .btn,
.mobile-shell--ios .portal-phone-actions a.btn,
.mobile-shell--android .portal-phone-actions a.btn,
.mobile-shell .portal-phone-action,
.mobile-shell .portal-phone-actions .btn,
.mobile-shell .portal-phone-actions a.btn,
.mobile-shell .portal-main .portal-phone-action,
.mobile-shell .portal-body-container .portal-phone-action {
    width: 100%;
    min-height: var(--metro-touch-target-min, 48px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 650;
    padding: 0.65rem 1rem;
    white-space: normal;
}

.mobile-shell--ios .portal-phone-file,
.mobile-shell--android .portal-phone-file,
.mobile-shell .portal-phone-file {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    min-height: var(--metro-touch-target-min, 48px);
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--portal-line, #e4e7ec);
    border-radius: 0.85rem;
    background: var(--metro-surface, #fff);
    color: inherit;
    text-decoration: none;
}

.mobile-shell .portal-phone-photo,
.mobile-shell--ios .portal-phone-photo,
.mobile-shell--android .portal-phone-photo {
    width: 100%;
    max-width: 100%;
}

.mobile-shell .portal-phone-photo__link,
.mobile-shell--ios .portal-phone-photo__link,
.mobile-shell--android .portal-phone-photo__link {
    width: 100%;
    min-height: 48px;
    aspect-ratio: 16 / 9;
}

.mobile-shell .portal-expiration-notice,
.mobile-shell--ios .portal-expiration-notice,
.mobile-shell--android .portal-expiration-notice {
    font-size: 1.125rem;
}

.mobile-shell .portal-main .list-group.shadow-sm,
.mobile-shell .portal-body-container .list-group.shadow-sm {
    background: transparent;
    border: 0;
    box-shadow: none !important;
    gap: 0.75rem;
}

.mobile-shell .portal-main .list-group.shadow-sm > .list-group-item,
.mobile-shell .portal-body-container .list-group.shadow-sm > .list-group-item {
    border: 1px solid var(--portal-line, #e4e7ec);
    border-radius: 1rem;
    min-height: var(--metro-touch-target-min, 48px);
    padding: 0.9rem 1rem;
}

.mobile-shell .portal-phone-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.mobile-shell .portal-phone-table,
.mobile-shell .portal-phone-table tbody,
.mobile-shell .portal-phone-table tr,
.mobile-shell .portal-phone-table td {
    display: block;
    width: 100%;
}

.mobile-shell .portal-phone-table tr {
    background: var(--metro-surface, #fff);
    border: 1px solid var(--portal-line, #e4e7ec);
    border-radius: 1rem;
    margin: 0 0 0.75rem;
    padding: 0.85rem 1rem;
}

.mobile-shell .portal-phone-table td {
    border: 0;
    padding: 0.35rem 0;
    text-align: left !important;
}

.mobile-shell .portal-phone-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--portal-muted, #667085);
}

.mobile-shell .portal-phone-table td.portal-phone-actions::before {
    margin-bottom: 0.35rem;
}

.mobile-shell .personnel-timesheet-page {
    color: var(--mobile-text, #111827);
}

.mobile-shell .personnel-timesheet-day {
    background: var(--mobile-surface, #fff);
    border-color: var(--mobile-border, #e5e7eb);
    color: var(--mobile-text, #111827);
    box-shadow: var(--mobile-elev-ios);
}

.mobile-shell .personnel-timesheet-page .form-control,
.mobile-shell .personnel-timesheet-page .personnel-timesheet-time {
    background-color: var(--metro-field-bg);
    color: var(--metro-text);
    -webkit-text-fill-color: var(--metro-text);
    border-color: var(--metro-field-border, #d1d5db);
    color-scheme: light;
}

.mobile-shell .personnel-timesheet-page .form-control:disabled,
.mobile-shell .personnel-timesheet-page .personnel-timesheet-time:disabled {
    background-color: var(--metro-field-disabled-bg);
    color: var(--metro-text-secondary);
    -webkit-text-fill-color: var(--metro-text-secondary);
}

.mobile-shell .personnel-timesheet-page .personnel-timesheet-history .card-header,
.mobile-shell .personnel-timesheet-page .list-group-item:not(.active) {
    background: var(--mobile-surface, #fff);
    color: var(--mobile-text, #111827);
}

:root[data-theme="dark"] .mobile-shell .personnel-timesheet-day,
:root[data-theme="dark"] .mobile-shell .personnel-timesheet-page .personnel-timesheet-history .card-header,
:root[data-theme="dark"] .mobile-shell .personnel-timesheet-page .list-group-item:not(.active) {
    background: var(--mobile-surface, #141418);
    color: var(--mobile-text, #f3f4f6);
    border-color: var(--metro-border, #2e2e38);
}

:root[data-theme="dark"] .mobile-shell .personnel-timesheet-page .form-control,
:root[data-theme="dark"] .mobile-shell .personnel-timesheet-page .personnel-timesheet-time {
    background-color: var(--metro-field-bg);
    color: var(--metro-text);
    -webkit-text-fill-color: var(--metro-text);
    border-color: var(--metro-field-border, #3f3f4a);
    color-scheme: dark;
}

/* Fees & payments on the phone shell. Hybrid and MAUI inherit this through MobileLayoutRouter. */
.mobile-shell--ios .fees-payments-totals,
.mobile-shell--android .fees-payments-totals {
    grid-template-columns: 1fr;
}
.mobile-shell--ios .fees-payments-row__open,
.mobile-shell--android .fees-payments-row__open {
    align-items: flex-start;
    flex-direction: column;
    min-height: 48px;
}
.mobile-shell--ios .fees-payments-row__meta,
.mobile-shell--android .fees-payments-row__meta {
    justify-content: flex-start;
}
.mobile-shell--ios .fees-payments-link,
.mobile-shell--android .fees-payments-link,
.mobile-shell--ios .fees-payments-more,
.mobile-shell--android .fees-payments-more {
    min-height: 48px;
}
.mobile-shell--ios .fees-payments-totals b,
.mobile-shell--android .fees-payments-totals b,
.mobile-shell--ios .fees-pay-sentence,
.mobile-shell--android .fees-pay-sentence,
.mobile-shell--ios .fees-payments-row__label,
.mobile-shell--android .fees-payments-row__label,
.mobile-shell--ios .fees-payments-omitted,
.mobile-shell--android .fees-payments-omitted {
    font-size: 1.125rem;
}

/* Timesheet week: keep Save and Submit week above the phone dock and safe area. */
.mobile-shell .personnel-timesheet-page {
    padding-bottom: calc(var(--mobile-bottom-h, 64px) + var(--mobile-safe-bottom, 0px) + 6.5rem);
}
.mobile-shell .personnel-timesheet-submitbar {
    bottom: calc(var(--mobile-bottom-h, 64px) + var(--mobile-safe-bottom, 0px) + 0.35rem);
}
.mobile-shell .personnel-timesheet-sheet {
    bottom: calc(var(--mobile-bottom-h, 64px) + var(--mobile-safe-bottom, 0px));
    max-height: 100vh;
    max-height: 100dvh;
    max-height: calc(100dvh - var(--mobile-bottom-h, 64px) - var(--mobile-safe-bottom, 0px) - var(--metro-keyboard-inset, 0px));
}
.mobile-shell .personnel-timesheet-sheet__save {
    padding-bottom: calc(0.75rem + var(--metro-keyboard-inset, 0px));
}
.mobile-shell .personnel-timesheet-chart,
.mobile-shell .personnel-timesheet-bars,
.mobile-shell .personnel-timesheet-report-list {
    overflow-x: hidden;
    max-width: 100%;
}
