/* =========================
   MOBILE APPLICATION SHELL
   ========================= */

html:has(body.mobile-app),
body.mobile-app {
    width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

body.mobile-app {
    --mobile-header-height: 54px;
    --mobile-sheet-peek: 92px;
    --mobile-edge: 10px;

    display: block;
    position: fixed;
    inset: 0;
    background: var(--body-bg);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.mobile-app .mobile-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;

    height: calc(var(--mobile-header-height) + env(safe-area-inset-top));
    min-height: 0;
    padding:
        env(safe-area-inset-top)
        calc(10px + env(safe-area-inset-right))
        0
        calc(10px + env(safe-area-inset-left));

    display: flex;
    align-items: center;
    gap: 8px;

    border-bottom: 1px solid var(--border);
    background:
        color-mix(
            in srgb,
            var(--header-bg) 94%,
            transparent
        );
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.mobile-brand {
    min-width: 0;
    flex: 1 1 auto;

    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-brand-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 6px;
}

.mobile-brand-copy {
    min-width: 0;
}

.mobile-app .mobile-brand-copy h1 {
    margin: 0;
    font-size: 13px;
    line-height: 1.05;
    letter-spacing: .14em;
}

.mobile-brand-copy > span {
    display: block;
    margin-top: 2px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: var(--muted);
    font-size: 8px;
    line-height: 1.1;
    letter-spacing: .05em;
}

.mobile-header-controls {
    flex: 0 0 auto;
    margin: 0;
    gap: 6px;

    display: flex;
    align-items: center;
    height: 40px;
}

.mobile-app .theme-toggle {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;

    display: grid;
    place-items: center;
    flex: 0 0 40px;
}

.mobile-app #themeIcon {
    width: 24px;
    height: 24px;

    display: grid;
    place-items: center;

    font-size: 21px;
    line-height: 1;
    transform: translateY(-1px);
}

.mobile-app .language-picker {
    width: 44px;
    min-width: 44px;
    height: 40px;
    flex: 0 0 44px;
}

.mobile-app .language-picker-button {
    width: 44px;
    min-width: 44px;
    height: 40px;
    min-height: 40px;
    padding: 0;

    display: grid;
    grid-template-columns: 1fr;
    place-items: center;
    gap: 0;
}

.mobile-app .language-picker-button .language-flag {
    width: 22px;
    height: 15px;
    margin: 0;

    display: block;
    object-fit: cover;
}

.mobile-app .language-picker-current-name,
.mobile-app .language-picker-arrow {
    display: none;
}

.mobile-app .language-picker-menu {
    right: 0;
    left: auto;
    width: min(220px, calc(100vw - 20px));
    max-height: min(420px, 70vh);
}

/* =========================
   MAP-FIRST LAYOUT
   ========================= */

.mobile-app .mobile-main {
    position: fixed;
    top: calc(var(--mobile-header-height) + env(safe-area-inset-top));
    right: 0;
    bottom: 0;
    left: 0;

    display: block;
    min-height: 0;
    overflow: hidden;
}

.mobile-app .mobile-workspace {
    position: absolute;
    inset: 0;

    min-width: 0;
    min-height: 0;
    padding: 0;
}

.mobile-app .mobile-map {
    position: absolute;
    inset: 0;

    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.mobile-app canvas {
    width: 100%;
    height: 100%;

    cursor: default;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.mobile-app .cursor-coords {
    display: none !important;
}

/* =========================
   MAP HUD
   ========================= */

.mobile-status {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 9;

    padding: 5px 9px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    border: 1px solid var(--border-light);
    border-radius: 999px;

    background:
        color-mix(
            in srgb,
            var(--header-bg) 88%,
            transparent
        );
    color: var(--muted);

    font-size: 9px;
    line-height: 1.25;

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    pointer-events: none;
}

.mobile-solution-hud {
    position: absolute;
    top: 42px;
    left: 10px;
    z-index: 10;

    /* Leave a dedicated lane for the mobile Map Tools toggle. */
    width: min(292px, calc(100vw - 72px));
    padding: 5px;

    border: 1px solid var(--border-light);
    border-radius: 9px;

    background:
        color-mix(
            in srgb,
            var(--header-bg) 93%,
            transparent
        );

    box-shadow: 0 7px 22px rgba(0, 0, 0, .22);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    pointer-events: none;
}

.mobile-solution-grid {
    display: grid;
    grid-template-columns: .95fr 1.25fr .95fr;
    gap: 4px;
}

.mobile-solution-metric {
    min-width: 0;
    min-height: 44px;
    padding: 4px 3px 3px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    border: 1px solid
        color-mix(
            in srgb,
            var(--accent-border) 72%,
            var(--border)
        );
    border-radius: 7px;
    background:
        color-mix(
            in srgb,
            var(--active-bg) 62%,
            var(--header-bg)
        );
    box-shadow:
        inset 0 0 0 1px
        color-mix(
            in srgb,
            var(--accent) 5%,
            transparent
        );

    text-align: center;
}

/* All three firing-solution values are primary information. */
.mobile-solution-metric-highlight {
    border-color:
        color-mix(
            in srgb,
            var(--accent-border) 72%,
            var(--border)
        );
    background:
        color-mix(
            in srgb,
            var(--active-bg) 62%,
            var(--header-bg)
        );
}

.mobile-solution-metric > span {
    color: var(--muted);
    font-size: 6px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.mobile-solution-metric > b {
    max-width: 100%;
    margin-top: 2px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: var(--accent);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.02;
    letter-spacing: -.025em;
}

.mobile-solution-metric-highlight > b {
    color: var(--accent);
    font-size: 14px;
}

.mobile-solution-metric > small {
    min-height: 7px;
    max-width: 100%;
    margin-top: 1px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: var(--muted);
    font-size: 6px;
    line-height: 1.05;
}

.mobile-range-status {
    margin-top: 4px;
    padding: 4px 2px 0;

    border-top: 1px solid var(--border);

    font-size: 7px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .055em;
    text-transform: uppercase;
}

/* =========================
   MODE SWITCH
   ========================= */

.mobile-app .mobile-mode-switch {
    position: absolute;
    right: 10px;
    bottom: calc(var(--mobile-sheet-peek) + env(safe-area-inset-bottom) + 10px);
    left: 10px;
    z-index: 18;

    grid-template-columns: 1fr 1fr;
    gap: 5px;

    padding: 5px;
    border: 1px solid var(--border-light);
    border-radius: 10px;

    background:
        color-mix(
            in srgb,
            var(--header-bg) 92%,
            transparent
        );
    box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    transition: opacity .18s ease, transform .18s ease;
}

.mobile-app .mobile-mode-switch button {
    min-height: 38px;
    padding: 7px 10px;
    border-color: transparent;
    background: transparent;
    font-size: 12px;
    font-weight: 700;
}

.mobile-app .mobile-mode-switch button.active {
    border-color: var(--accent-border);
    background: var(--active-bg);
    color: var(--accent);
}

.mobile-app.mobile-sheet-open .mobile-mode-switch {
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
}





.mobile-app .mobile-mode-switch .point-map-locked::after {
    content: "  🔒";
    font-size: 10px;
}
/* =========================
   MAP TOOLS
   ========================= */

.mobile-app .map-tools {
    top: 42px;
    right: 10px;
    bottom: auto;

    z-index: 16;
    flex-direction: column;
    align-items: flex-end;
    gap: 7px;

    transition: opacity .18s ease, transform .18s ease;
}

.mobile-app .map-tools-bar {
    display: none;
    flex-direction: column;
    gap: 3px;
    padding: 4px;

    max-height: calc(100dvh - 150px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;

    border-radius: 10px;
}

.mobile-app .map-tools.mobile-map-tools-open .map-tools-bar {
    display: flex;
}

.mobile-app .mobile-map-tools-toggle {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;

    display: grid;
    place-items: center;

    border: 1px solid var(--border-light);
    border-radius: 10px;

    background:
        color-mix(
            in srgb,
            var(--header-bg) 94%,
            transparent
        );
    color: var(--text);

    box-shadow: 0 5px 18px rgba(0, 0, 0, .24);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    pointer-events: auto;
}

.mobile-app .mobile-map-tools-toggle.active {
    border-color: var(--accent-border);
    background: var(--active-bg);
    color: var(--accent);
}

.mobile-app .map-tool-button {
    width: 40px;
    height: 40px;
    min-height: 40px;
    border-radius: 7px;
}

.mobile-app .map-tool-popover {
    position: absolute;
    top: 0;
    right: 52px;

    max-width: calc(100vw - 72px);
    max-height: min(56dvh, 420px);
    overflow-y: auto;

    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.mobile-app .map-tool-layers {
    /*
     * Layers is taller than the other tool popovers. Keep it beside
     * the vertical toolbar instead of stacking it underneath, which
     * gives the list nearly the full usable phone height.
     */
    position: absolute;
    top: 0;
    right: 52px;

    max-height: calc(100dvh - 170px);
    overflow-y: auto;

    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;

    scrollbar-gutter: stable;
}

.mobile-app .map-tool-coordinate-search {
    width: min(250px, calc(100vw - 72px));
}

/*
 * iOS Safari automatically zooms focused form controls below 16px.
 * Keep the coordinate search at 16px instead of disabling page zoom,
 * preserving normal pinch/accessibility behavior elsewhere.
 */
.mobile-app .map-tool-coordinate-search input {
    font-size: 16px;
}

.mobile-app .map-tool-marker-picker {
    grid-template-columns: repeat(4, 44px);
}

.mobile-app .map-tool-marker-option {
    width: 44px;
    height: 44px;
}

.mobile-app.mobile-sheet-open .map-tools {
    opacity: .18;
    transform: translateX(8px);
    pointer-events: none;
}


.mobile-app .map-tool-color {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    aspect-ratio: 1 / 1;
    flex: 0 0 32px;
    padding: 4px;
}

.mobile-app .map-tool-palette {
    grid-template-columns: repeat(5, 32px);
}

.mobile-app .map-tool-history-actions button {
    min-height: 38px;
}

/* Touch users get explicit Undo / Redo buttons instead of keyboard hints. */
.mobile-app .map-tool-shortcuts-hint {
    display: none;
}

/* Fullscreen is intentionally desktop-only. */
.mobile-app .map-tool-fullscreen-button {
    display: none !important;
}

.mobile-app .map-tool-data-transfer {
    width: min(280px, calc(100vw - 72px));
}

.mobile-app .map-tool-data-transfer-actions button {
    min-height: 42px;
    font-size: 12px;
}
/* =========================
   BOTTOM SHEET
   ========================= */

.mobile-sheet {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 50;

    height: min(64vh, 590px);
    min-height: 330px;
    padding: 0 0 env(safe-area-inset-bottom);

    border: 0;
    border-top: 1px solid var(--border-light);
    border-radius: 16px 16px 0 0;

    background:
        color-mix(
            in srgb,
            var(--aside-bg) 98%,
            transparent
        );
    box-shadow: 0 -12px 34px rgba(0, 0, 0, .32);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);

    transform: translateY(calc(100% - var(--mobile-sheet-peek)));
    transition: transform .24s cubic-bezier(.22, .8, .24, 1);

    overflow: hidden;
    will-change: transform;
}

.mobile-sheet.open {
    transform: translateY(0);
}

.mobile-sheet.dragging {
    transition: none;
}

.mobile-sheet-handle {
    width: 100%;
    height: 28px;
    min-height: 28px;
    padding: 0;

    display: grid;
    place-items: center;

    border: 0;
    border-radius: 0;
    background: transparent;

    touch-action: none;
}

.mobile-sheet-grabber {
    width: 38px;
    height: 4px;
    border-radius: 999px;
    background: var(--border-light);
}

.mobile-tabs {
    height: 52px;
    padding: 0 8px 7px;

    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;

    border-bottom: 1px solid var(--border);
}

.mobile-tab {
    min-width: 0;
    min-height: 38px;
    padding: 6px 7px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    border-color: transparent;
    background: transparent;

    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .02em;
}

.mobile-tab.active {
    border-color: var(--accent-border);
    background: var(--active-bg);
    color: var(--accent);
}

.mobile-sheet-content {
    height: calc(100% - 80px - env(safe-area-inset-bottom));
    padding: 10px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .12s ease;
}

.mobile-sheet.open .mobile-sheet-content {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-panel {
    display: none;
    padding-bottom: 14px;
}

.mobile-panel.active {
    display: block;
}

.mobile-card {
    margin-bottom: 10px;
    padding: 12px;

    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel-bg);
}

.mobile-card:last-child {
    margin-bottom: 0;
}

.mobile-card h2 {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.mobile-app .mobile-card label {
    margin-top: 9px;
}

.mobile-app input,
.mobile-app select,
.mobile-app button {
    min-height: 42px;
    font-size: 14px;
}

.mobile-inline-row {
    min-height: 34px;
    margin-top: 8px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    color: var(--muted);
    font-size: 11px;
}

.mobile-inline-row b {
    color: var(--text);
    text-align: right;
}

.mobile-result-details .hint {
    margin: 10px 0 0;
}

.mobile-action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.mobile-zoom-grid {
    grid-template-columns: 52px minmax(0, 1fr) 52px;
}

.mobile-zoom-grid button:first-child,
.mobile-zoom-grid button:last-child {
    padding: 0;
    font-size: 23px;
    line-height: 1;
}

.mobile-app #customMapSizing .primary {
    margin-top: 9px;
}


.mobile-desktop-link {
    min-height: 42px;
    padding: 0 14px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--button-bg);
    color: var(--muted);

    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.mobile-desktop-link:active {
    border-color: var(--accent-border);
    background: var(--active-bg);
    color: var(--accent);
}


.mobile-partner-link {
    width: fit-content;

    margin: 8px auto 2px;

    display: block;

    color: var(--muted);

    font-size: 10px;
    line-height: 1.3;

    text-align: center;
    text-decoration: none;

    opacity: .72;

    transition:
        color .15s ease,
        opacity .15s ease;
}

.mobile-partner-link strong {
    color: var(--accent);

    font-weight: 600;
}

.mobile-partner-link:hover,
.mobile-partner-link:focus-visible {
    color: var(--text);

    opacity: 1;
}

/* =========================
   SAVED TARGETS IN SHEET
   ========================= */

.mobile-app .saved-targets {
    position: static;
    width: auto;
    max-width: none;
    padding: 12px;

    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel-bg);
    box-shadow: none;
    backdrop-filter: none;
}

.mobile-app .saved-targets-list {
    max-height: none;
    overflow: visible;
}

.mobile-app .saved-target {
    min-height: 60px;
}

.mobile-app .saved-target-item-actions button,
.mobile-app .saved-target-actions-inline button {
    min-height: 38px;
}

.mobile-app .save-artillery-option {
    min-height: 44px;
}


.mobile-app .saved-target-actions-inline {
    min-width: 118px;
}

.mobile-app .saved-target-transfer-actions button {
    min-height: 42px;
    font-size: 12px;
}

.mobile-app .saved-target-transfer-status {
    font-size: 11px;
}


.mobile-app .point-coordinate-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin: 6px 0 2px;
}

.mobile-app .point-coordinate-actions button {
    width: auto;
    min-height: 34px;
    padding: 5px 10px;
    color: var(--muted);
    font-size: 11px;
}
/* =========================
   DESKTOP LAYOUT OVERRIDES
   ========================= */

.mobile-app .sidebar-toggle,
.mobile-app footer,
.mobile-app .toolbar,
.mobile-app .legend {
    display: none !important;
}

.mobile-app .mobile-main.sidebar-collapsed,
.mobile-app .mobile-main.sidebar-collapsed > aside {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.mobile-app main:fullscreen,
.mobile-app main:-webkit-full-screen {
    top: 0;
    height: 100vh;
}

.mobile-app main:fullscreen .mobile-sheet,
.mobile-app main:-webkit-full-screen .mobile-sheet {
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-app .motd {
    top: calc(var(--mobile-header-height) + env(safe-area-inset-top) + 10px);
    right: 10px;
    bottom: auto;
    left: 10px;
    width: auto;
    z-index: 200;
}

/* =========================
   MOBILE RIGHT-SIDE MENU
   ========================= */

.mobile-app .mobile-side-menu-toggle {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;

    padding: 0;

    display: grid;
    place-items: center;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--button-bg);
    color: var(--muted);

    flex: 0 0 40px;
}

.mobile-app .mobile-side-menu-toggle:hover,
.mobile-app .mobile-side-menu-toggle:focus-visible,
.mobile-app .mobile-side-menu-toggle.active {
    border-color: var(--accent-border);
    background: var(--active-bg);
    color: var(--accent);
}

.mobile-side-menu-backdrop {
    position: fixed;

    top:
        calc(
            var(--mobile-header-height) +
            env(safe-area-inset-top)
        );

    right: 0;
    bottom: 0;
    left: 0;

    z-index: 139;

    margin: 0;
    padding: 0;

    border: 0;
    border-radius: 0;

    background: rgba(0, 0, 0, .46);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity .18s ease,
        visibility .18s ease;
}

.mobile-side-menu {
    position: fixed;

    top:
        calc(
            var(--mobile-header-height) +
            env(safe-area-inset-top)
        );

    right: 0;
    bottom: 0;

    z-index: 140;

    width: min(360px, 92vw);
    max-width: 100%;

    padding:
        14px
        calc(14px + env(safe-area-inset-right))
        calc(14px + env(safe-area-inset-bottom))
        14px;

    display: flex;
    flex-direction: column;
    gap: 12px;

    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;

    border-left: 1px solid var(--border-light);

    background:
        color-mix(
            in srgb,
            var(--aside-bg) 98%,
            transparent
        );

    box-shadow:
        -18px 0 42px
        rgba(0, 0, 0, .36);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    transform: translateX(100%);

    visibility: hidden;
    pointer-events: none;

    transition:
        transform .22s
            cubic-bezier(.22, .8, .24, 1),
        visibility .22s ease;
}

.mobile-app.mobile-side-menu-open
.mobile-side-menu {
    transform: translateX(0);

    visibility: visible;
    pointer-events: auto;
}

.mobile-app.mobile-side-menu-open
.mobile-side-menu-backdrop {
    opacity: 1;

    visibility: visible;
    pointer-events: auto;
}

.mobile-side-menu-header {
    min-height: 46px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    padding-bottom: 12px;

    border-bottom: 1px solid var(--border);
}

.mobile-side-menu-heading {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 3px;
}

.mobile-side-menu-title {
    color: var(--text);

    font-size: 15px;
    font-weight: 800;
    line-height: 1.1;

    letter-spacing: .04em;
    text-transform: uppercase;
}

.mobile-side-menu-subtitle {
    overflow: hidden;

    color: var(--muted);

    font-size: 9px;
    line-height: 1.25;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-app .mobile-side-menu-close {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;

    padding: 0;

    display: grid;
    place-items: center;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--button-bg);
    color: var(--muted);

    font-size: 22px;
    line-height: 1;
}

.mobile-app .mobile-side-menu-close:hover,
.mobile-app .mobile-side-menu-close:focus-visible {
    border-color: var(--accent-border);
    background: var(--active-bg);
    color: var(--accent);
}

.mobile-side-menu-section {
    padding: 11px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background:
        color-mix(
            in srgb,
            var(--header-bg) 76%,
            transparent
        );
}

.mobile-side-menu-section-label {
    margin-bottom: 8px;

    color: var(--muted);

    font-size: 8px;
    font-weight: 800;
    line-height: 1;

    letter-spacing: .11em;
    text-transform: uppercase;
}

.mobile-theme-choice {
    display: grid;

    grid-template-columns:
        1fr
        1fr;

    gap: 7px;
}

.mobile-app .mobile-theme-choice-button {
    min-width: 0;
    min-height: 48px;

    padding: 8px 10px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    border: 1px solid var(--border-light);
    border-radius: 8px;

    background: var(--button-bg);
    color: var(--muted);

    font: inherit;
    font-size: 11px;
    font-weight: 700;
}

.mobile-app .mobile-theme-choice-button:hover,
.mobile-app .mobile-theme-choice-button:focus-visible {
    border-color: var(--accent-border);
    color: var(--text);
}

.mobile-app .mobile-theme-choice-button.active {
    border-color: var(--accent-border);

    background:
        color-mix(
            in srgb,
            var(--active-bg) 86%,
            var(--button-bg)
        );

    color: var(--accent);

    box-shadow:
        inset 0 0 0 1px
        color-mix(
            in srgb,
            var(--accent) 8%,
            transparent
        );
}

.mobile-theme-choice-icon {
    width: 20px;
    height: 20px;

    display: grid;
    place-items: center;

    flex: 0 0 20px;
}

.mobile-theme-choice-label {
    min-width: 0;

    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-app .mobile-theme-toggle-legacy {
    display: none !important;
}

.mobile-side-menu-language-shell {
    min-width: 0;
}

.mobile-app .mobile-side-menu
.language-picker {
    width: 100%;
    min-width: 0;
    height: auto;
}

.mobile-app .mobile-side-menu
.language-picker-button {
    width: 100%;
    min-width: 0;
    height: 46px;
    min-height: 46px;

    padding: 7px 10px;

    display: grid;

    grid-template-columns:
        22px
        minmax(0, 1fr)
        auto;

    place-items: initial;
    align-items: center;

    gap: 9px;

    border-radius: 8px;

    text-align: left;
}

.mobile-app .mobile-side-menu
.language-picker-current-name,
.mobile-app .mobile-side-menu
.language-picker-arrow {
    display: block;
}

.mobile-app .mobile-side-menu
.language-picker-current-name {
    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-app .mobile-side-menu
.language-picker-menu {
    top: calc(100% + 7px);
    right: 0;
    left: auto;

    width: 100%;
    max-height: min(420px, 58vh);
}

.mobile-side-menu-links {
    display: grid;

    gap: 7px;
}

.mobile-app .mobile-side-menu
.mobile-desktop-link,
.mobile-app .mobile-side-menu
.mobile-partner-link {
    width: 100%;
    min-height: 48px;

    margin: 0;
    padding: 0 12px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--border-light);
    border-radius: 8px;

    background: var(--button-bg);
    color: var(--muted);

    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;

    text-align: center;
    text-decoration: none;

    opacity: 1;
}

.mobile-app .mobile-side-menu
.mobile-desktop-link:hover,
.mobile-app .mobile-side-menu
.mobile-desktop-link:focus-visible,
.mobile-app .mobile-side-menu
.mobile-partner-link:hover,
.mobile-app .mobile-side-menu
.mobile-partner-link:focus-visible {
    border-color: var(--accent-border);

    background: var(--active-bg);
    color: var(--accent);
}

.mobile-app .mobile-side-menu
.mobile-partner-link strong {
    margin-left: 4px;

    color: var(--accent);
}

.mobile-side-menu-footer {
    margin-top: auto;

    padding: 12px 11px 2px;

    border-top: 1px solid var(--border);
}

.mobile-side-menu-footer
.mobile-side-menu-section-label {
    margin-bottom: 6px;
}

.mobile-side-menu-credit-line {
    color: var(--muted);

    font-size: 10px;
    line-height: 1.45;
}

.mobile-side-menu-credit-line a {
    color: var(--accent);

    font-weight: 700;
    text-decoration: none;
}

.mobile-side-menu-credit-line a:hover,
.mobile-side-menu-credit-line a:focus-visible {
    text-decoration: underline;
}

.mobile-side-menu-version {
    margin-left: 6px;

    padding: 2px 5px;

    display: inline-flex;

    border: 1px solid var(--border-light);
    border-radius: 999px;

    background: var(--button-bg);
    color: var(--muted);

    font-size: 8px;
    line-height: 1;
}

.mobile-side-menu-legal-label {
    margin-top: 13px;
}

.mobile-side-menu-disclaimer {
    margin: 0;

    color: var(--muted);

    font-size: 9px;
    line-height: 1.45;

    opacity: .78;
}

/* =========================
   SMALL / SHORT SCREENS
   ========================= */

@media (max-width: 370px) {
    body.mobile-app {
        --mobile-sheet-peek: 88px;
    }

    .mobile-brand-copy > span {
        display: none;
    }

    .mobile-brand-icon {
        width: 28px;
        height: 28px;
        flex-basis: 28px;
    }

    .mobile-solution-hud {
        width: calc(100vw - 72px);
    }

    .mobile-solution-metric > b,
    .mobile-solution-metric-highlight > b {
        font-size: 13px;
    }

    .mobile-app .map-tool-button {
        width: 38px;
        height: 38px;
        min-height: 38px;
    }

    .mobile-side-menu {
        width: min(300px, 90vw);
    }
}

@media (max-height: 650px) {
    .mobile-sheet {
        height: 74vh;
    }

    .mobile-app .map-tools {
        top: 38px;
    }

    .mobile-app .map-tool-button {
        width: 36px;
        height: 36px;
        min-height: 36px;
    }
}

/* =========================
   MOBILE SPH-2 WARNING IN SOLUTION HUD
   ========================= */

.mobile-app .mobile-solution-hud
.sph-level-warning {
    margin: 4px 0 0;
    padding: 4px 2px 0;

    border: 0;
    border-top: 1px solid var(--border);
    border-left: 0;
    border-radius: 0;

    background: transparent;
    box-shadow: none;

    pointer-events: auto;
}

.mobile-app .mobile-solution-hud
.sph-level-warning-toggle {
    width: 100%;
    min-height: 24px;

    margin: 0;
    padding: 2px 1px;

    display: grid;

    grid-template-columns:
        auto
        minmax(0, 1fr)
        auto;

    align-items: center;
    gap: 5px;

    border: 0;
    border-radius: 4px;

    background: transparent;
    color: #f0b24a;

    font: inherit;
    text-align: left;

    cursor: pointer;

    pointer-events: auto;
}

.mobile-app .mobile-solution-hud
.sph-level-warning-toggle:hover,
.mobile-app .mobile-solution-hud
.sph-level-warning-toggle:focus-visible,
.mobile-app .mobile-solution-hud
.sph-level-warning-toggle:active {
    border: 0;

    background:
        color-mix(
            in srgb,
            #f0b24a 8%,
            transparent
        );

    color: #f0b24a;
}

.mobile-app .mobile-solution-hud
.sph-level-warning-icon {
    font-size: 11px;
}

.mobile-app .mobile-solution-hud
.sph-level-warning-title-text {
    min-width: 0;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: #f0b24a;

    font-size: 10px;
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.mobile-app .mobile-solution-hud
.sph-level-warning-chevron {
    display: block;

    color: #f0b24a;

    font-size: 10px;
    line-height: 1;

    transition:
        transform .16s ease;
}

.mobile-app .mobile-solution-hud
.sph-level-warning.expanded
.sph-level-warning-chevron {
    transform: rotate(180deg);
}

.mobile-app .mobile-solution-hud
.sph-level-warning-body {
    max-height: 118px;

    margin: 3px 1px 1px;
    padding: 4px 3px 2px;

    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;

    color: var(--text);

    font-size: 9px;
    line-height: 1.35;

    pointer-events: auto;
}

.mobile-app .mobile-solution-hud
.sph-level-warning-body[hidden] {
    display: none !important;
}

/* =========================
   MOBILE MOTD BELL
   ========================= */

.mobile-app .mobile-motd-button {
    position: relative;

    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;

    margin: 0;
    padding: 0;

    display: grid;
    place-items: center;

    flex: 0 0 40px;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--button-bg);
    color: var(--muted);
}

.mobile-app .mobile-motd-button[hidden] {
    display: none !important;
}

.mobile-app .mobile-motd-button:hover,
.mobile-app .mobile-motd-button:focus-visible,
.mobile-app .mobile-motd-button[aria-expanded="true"] {
    border-color: var(--accent-border);
    background: var(--active-bg);
    color: var(--accent);
}

.mobile-app .mobile-motd-button.has-unread {
    border-color: var(--accent-border);

    color: var(--accent);

    background:
        color-mix(
            in srgb,
            var(--active-bg) 82%,
            var(--button-bg)
        );

    box-shadow:
        0 0 0 2px
        color-mix(
            in srgb,
            var(--accent) 10%,
            transparent
        );
}

.mobile-app .mobile-motd-button.has-unread::after {
    content: "";

    position: absolute;

    top: 6px;
    right: 6px;

    width: 7px;
    height: 7px;

    border-radius: 999px;

    background: var(--accent);

    box-shadow:
        0 0 0 2px
        var(--header-bg);
}

/*
 * Mobile MOTD becomes an on-demand notification panel
 * below the header instead of appearing automatically.
 */
.mobile-app .motd {
    top:
        calc(
            var(--mobile-header-height) +
            env(safe-area-inset-top) +
            8px
        );

    right: 10px;
    bottom: auto;
    left: auto;

    width:
        min(
            360px,
            calc(100vw - 20px)
        );

    max-height:
        min(
            68dvh,
            calc(
                100dvh -
                var(--mobile-header-height) -
                env(safe-area-inset-top) -
                24px
            )
        );

    z-index: 200;
}

