.mobile-map-dock {
  display: none;
}
#map-mobile-sheet {
  padding: 0;
  border: 0;
  color: inherit;
}
@media (max-width: 760px) {
  body.mobile-map {
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .mobile-map .masthead {
    height: auto;
    min-height: 56px;
    padding: max(6px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right)) 6px
      max(12px, env(safe-area-inset-left));
    flex-shrink: 0;
  }
  .mobile-map .brand {
    font-size: 14px;
  }
  .mobile-map .brand-mark {
    font-size: 20px;
  }
  .mobile-map .brand-sub {
    font-size: 11px;
  }
  .mobile-map .header-search {
    font-size: 12px;
    min-height: 44px;
    align-items: center;
    padding: 0;
  }
  .mobile-map .workspace {
    display: flex;
    flex: 1;
    min-height: 0;
  }
  .mobile-map .map-area {
    flex: 1;
    min-height: 0;
    padding: 8px max(10px, env(safe-area-inset-right)) 4px
      max(10px, env(safe-area-inset-left));
  }
  .mobile-map .map-toolbar {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 0;
    margin-bottom: 8px;
  }
  .mobile-map .map-toolbar > div {
    display: none;
  }
  .mobile-map #floors {
    width: 100%;
    padding: 3px;
  }
  .mobile-map #floors button {
    flex: 1;
    min-height: 44px;
    padding: 8px;
  }
  .mobile-map .map-viewport,
  .mobile-map.has-route .map-viewport {
    flex: 1;
    height: auto;
    min-height: 80px;
    --floor-strip-height: 3rem;
  }
  .mobile-map .map-floor-indicator {
    height: 3rem;
    padding: 6px 12px;
  }
  .mobile-map #map-floor-number {
    font-size: 28px;
  }
  .mobile-map .map-floor-indicator::after {
    content: "2本指で拡大・縮小";
    margin-left: auto;
    font-size: 11px;
    color: var(--muted);
  }
  .mobile-map .map-footer {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
    margin-top: 6px;
  }
  .mobile-map .legend {
    gap: 3px;
    font-size: 10px;
    flex-direction: column;
  }
  .mobile-map .zoom-controls {
    gap: 3px;
  }
  .mobile-map .zoom-controls button {
    min-width: 44px;
    height: 44px;
  }
  .mobile-map .route-banner {
    padding: 9px 12px;
    gap: 8px;
    margin-bottom: 8px;
  }
  .mobile-map #current-instruction {
    font-size: 14px;
    margin: 3px 0;
  }
  .mobile-map #floor-route-status,
  .mobile-map #step-progress {
    font-size: 11px;
  }
  .mobile-map #route-step-controls {
    flex-shrink: 0;
    gap: 4px;
  }
  .mobile-map #route-step-controls button {
    min-height: 44px;
    padding: 7px;
    font-size: 13px;
  }
  .mobile-map-dock {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    flex-shrink: 0;
    padding: 8px max(10px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    background: white;
    border-top: 1px solid var(--line);
  }
  .mobile-map-dock button,
  .mobile-map-dock a {
    min-height: 48px;
    padding: 10px 5px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #eef5f1;
    color: var(--green);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
  }
  .mobile-map-dock button:first-child {
    background: var(--green);
    color: white;
  }
  #map-mobile-sheet {
    position: fixed;
    inset: auto 0 0;
    margin: 0 auto;
    width: 100%;
    max-width: 760px;
    max-height: 88dvh;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 36px #17352f33;
  }
  #map-mobile-sheet[open] {
    display: flex;
    flex-direction: column;
  }
  #map-mobile-sheet::backdrop {
    background: #17352f66;
  }
  .mobile-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
  }
  .mobile-sheet-header h2 {
    margin: 0;
    font-size: 17px;
  }
  .mobile-sheet-header button {
    min-height: 44px;
    padding: 8px 12px;
    border: 0;
    border-radius: 8px;
    color: var(--green);
    background: #edf4f0;
    font-size: 14px;
  }
  #map-mobile-sheet .sidebar {
    display: block;
    position: relative;
    min-height: 0;
    max-height: none;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 18px max(18px, env(safe-area-inset-right))
      max(20px, env(safe-area-inset-bottom))
      max(18px, env(safe-area-inset-left));
    border: 0;
  }
  #map-mobile-sheet[data-panel="search"] .sidebar > :not(.map-inline-form) {
    display: none;
  }
  #map-mobile-sheet:not([data-panel="search"]) .map-inline-form {
    display: none;
  }
  #map-mobile-sheet .map-inline-form {
    padding-bottom: 0;
    margin-bottom: 0;
  }
  #map-mobile-sheet .map-inline-form > .eyebrow,
  #map-mobile-sheet #map-search-title {
    display: none;
  }
  #map-mobile-sheet select {
    font-size: 16px;
    min-width: 0;
    width: 100%;
  }
  #map-mobile-sheet .room-list {
    max-height: none;
    overflow: visible;
  }
  #map-mobile-sheet .detail {
    min-height: 0;
  }
}
@media (max-width: 760px) and (max-height: 500px) {
  .mobile-map .masthead {
    display: none;
  }
  .mobile-map .map-footer .legend {
    display: none;
  }
  .mobile-map .map-footer {
    position: absolute;
    right: max(20px, env(safe-area-inset-right));
    bottom: calc(76px + env(safe-area-inset-bottom));
    z-index: 2;
  }
  .mobile-map .route-banner {
    margin-bottom: 4px;
  }
}
@media (max-width: 760px) {
  .mobile-map .masthead { display: none; }
  .mobile-map .workspace { position: fixed; inset: 0; }
  .mobile-map .map-area { padding: 0; position: relative; }
  .mobile-map .map-viewport,
  .mobile-map.has-route .map-viewport {
    position: absolute; inset: 0; height: 100%; border: 0; border-radius: 0;
  }
  .mobile-map #floor-map { top: 0; height: 100%; }
  .mobile-map .map-toolbar {
    position: absolute; top: max(12px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right)); z-index: 2;
  }
  .mobile-map .map-floor-indicator {
    top: calc(68px + env(safe-area-inset-top));
    width: fit-content; border: 0; border-radius: 0 12px 12px 0;
    background: #ffffffdf;
  }
  .mobile-map .map-floor-indicator::after { display: none; }
  .mobile-map .map-footer {
    position: absolute; right: max(12px, env(safe-area-inset-right));
    bottom: calc(82px + env(safe-area-inset-bottom)); z-index: 2;
    padding: 4px; background: #fffffff0; border-radius: 10px;
  }
  .mobile-map .legend { display: none; }
  .mobile-map-dock {
    position: fixed; inset: auto 0 0; z-index: 3;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    background: transparent; border: 0;
  }
  .mobile-map-dock button { box-shadow: 0 2px 12px #17352f26; }
  .mobile-map-dock.has-results { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #map-mobile-sheet[data-panel="results"] .sidebar > :not(#route-panel),
  #map-mobile-sheet:not([data-panel="results"]) #route-panel { display: none; }
  #mobile-no-results { padding: 16px 20px; line-height: 1.8; }
  #map-mobile-sheet .sidebar { flex: 1 1 auto; }
}

@media (max-width: 760px) {
  .mobile-map.map-guidance .map-step-bar {
    position: fixed;
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    bottom: calc(72px + env(safe-area-inset-bottom));
    z-index: 3;
    margin: 0;
    gap: 10px;
    grid-template-columns: 52px minmax(0, 1fr) 52px;
  }
  .mobile-map.map-guidance .map-viewport {
    bottom: calc(84px + env(safe-area-inset-bottom) + var(--map-step-height, 130px));
    height: auto;
    min-height: 0;
  }
  .mobile-map.map-guidance .map-footer {
    bottom: calc(94px + env(safe-area-inset-bottom) + var(--map-step-height, 130px));
  }
}
