/* Sobat Transum: mobile-only Floating Glass Dock. Never style map internals. */
.mobile-glass-dock { display: none; }

@media (max-width: 820px) and (orientation: portrait) {
  .app {
    --st-dock-reserve: 84px;
    --st-dock-sheet-cap: calc(100dvh - 140px - var(--safe-bottom));
  }

  .mobile-glass-dock {
    position: fixed;
    z-index: 650;
    bottom: calc(10px + var(--safe-bottom));
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: stretch;
    gap: 3px;
    width: min(360px, calc(100vw - 24px));
    min-height: 70px;
    padding: 6px;
    border: 1px solid #ffffffee;
    border-radius: 23px;
    background: #fffffff0;
    -webkit-backdrop-filter: blur(18px) saturate(1.25);
    backdrop-filter: blur(18px) saturate(1.25);
    box-shadow: 0 10px 32px #10205226, 0 2px 10px #10205210;
    isolation: isolate;
  }

  .mobile-glass-dock-item {
    flex: 1 1 0;
    min-width: 0;
    min-height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 1px solid transparent;
    border-radius: 17px;
    background: transparent;
    color: #5f6e85;
    font-size: 10px;
    line-height: 1.1;
    font-weight: 750;
    letter-spacing: .01em;
    transition: background .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .mobile-glass-dock-item svg {
    width: 23px;
    height: 23px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.85;
    stroke-linejoin: round;
    stroke-linecap: round;
  }

  .mobile-glass-dock-item.is-active {
    background: linear-gradient(160deg, #e7f2ff, #f1f9ff);
    border-color: #d4e8fc;
    color: #145ba7;
    box-shadow: inset 0 1px 0 #fff, 0 3px 8px #1768c40d;
  }
  .mobile-glass-dock-item:active { transform: scale(.95); }
  .mobile-glass-dock-item:focus-visible {
    outline: 3px solid #148ff5 !important;
    outline-offset: 0 !important;
  }

  /* One navigation surface on phones; the existing tabs remain on desktop. */
  .sidebar .nav-tabs { display: none; }

  /* Reserve space for the dock without covering the existing draggable sheet. */
  .app .sidebar {
    bottom: calc(10px + var(--safe-bottom) + var(--st-dock-reserve));
    max-height: var(--st-dock-sheet-cap);
  }
  .app .sidebar.collapsed {
    transform: translateY(calc(100% + 20px + var(--st-dock-reserve)));
  }
  .app .mobile-panel-toggle,
  .app.stage3-sheet-expanded .mobile-panel-toggle {
    bottom: calc(min(var(--stage3-sheet-height, min(47dvh, 430px)), var(--st-dock-sheet-cap)) + 14px + var(--safe-bottom) + var(--st-dock-reserve));
  }
  .app.stage3-sheet-hidden .mobile-panel-toggle {
    bottom: calc(14px + var(--safe-bottom) + var(--st-dock-reserve));
  }
  .app .map-legend {
    bottom: calc(min(var(--stage3-sheet-height, min(47dvh, 430px)), var(--st-dock-sheet-cap)) + 18px + var(--safe-bottom) + var(--st-dock-reserve));
  }
  .app.stage3-sheet-hidden .map-legend {
    bottom: calc(70px + var(--safe-bottom) + var(--st-dock-reserve));
  }
  .app .map-shell > .map-credits {
    bottom: calc(10px + var(--safe-bottom) + var(--st-dock-reserve));
  }

  /* Keep forms usable when the virtual keyboard covers the bottom viewport. */
  .app.stage2-keyboard-open { --st-dock-reserve: 0px; }
  .app.stage2-keyboard-open .mobile-glass-dock {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
  .app.stage2-mobile-typing .sidebar:not(.collapsed) {
    bottom: calc(10px + var(--safe-bottom) + var(--stage2-keyboard-overlap, 0px) + var(--st-dock-reserve));
  }
  .app.stage2-mobile-typing .mobile-panel-toggle {
    bottom: calc(var(--stage2-expanded-height, 70dvh) + 14px + var(--safe-bottom) + var(--stage2-keyboard-overlap, 0px) + var(--st-dock-reserve));
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-glass-dock-item { transition: none; }
}

