/* Compact controls keep the map usable on narrow screens. Desktop keeps its existing layout. */
.mobile-map-actions,
.search-button-icon,
.map-style-icon,
#map-info,
#map-prompt-close { display: none; }

@media (max-width: 760px) {
  .header-account { min-height: 44px; }
  .mobile-intro { display: none; }
  .workspace { height: auto; min-height: 0; overflow: visible; }
  .map-pane { position: relative; inset: auto; width: 100%; height: clamp(360px, 60svh, 560px); min-height: 0; margin-bottom: 54px; overflow: visible; flex: none; }
  .map-pane.show-map-help { margin-bottom: 76px; }
  .site-footer { display: none; }
  .feed-section { padding-top: 24px; }
  .map-overlay { top: 10px; left: 10px; right: 10px; }

  .search-form { height: 46px; padding: 0 2px 0 12px; gap: 8px; border-radius: 9px; }
  .search-form > span { font-size: 23px; }
  .search-form input { font-size: 16px; }
  .search-form input::placeholder { color: #77716b; }
  .search-form button { width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 7px; }
  .search-button-label { display: none; }
  .search-button-icon { display: block; font-size: 28px; line-height: 1; }

  .mobile-map-actions { display: flex; gap: 7px; width: max-content; max-width: 100%; padding-top: 7px; pointer-events: auto; }
  .mobile-map-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; background: #fcfaf6f2; box-shadow: 0 3px 12px #1717141e; color: var(--ink); font-size: 12px; font-weight: 700; }
  .mobile-map-actions button[aria-expanded="true"], .mobile-map-actions button.has-active { border-color: var(--blue); color: var(--blue); }
  #filter-active-mark { color: var(--orange); font-size: 9px; }
  #filter-active-mark:empty { display: none; }

  .quick-filters,
  .memory-filters { display: none; position: absolute; top: 101px; left: 0; z-index: 6; width: min(300px, 100%); max-width: 100%; max-height: min(54svh, 420px); overflow: auto; margin: 0; padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); box-shadow: 0 10px 28px #17171438; pointer-events: auto; }
  .quick-filters.is-open,
  .memory-filters.is-open { display: grid; grid-template-columns: 1fr; gap: 3px; }
  .quick-filters button,
  .memory-filters button { width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 6px; box-shadow: none; text-align: left; font-size: 13px; }
  .quick-filters button[aria-pressed="true"],
  .memory-filters button[aria-pressed="true"] { background: #e5eef0; color: var(--blue); }
  .filter-hint { display: none; }
  .search-results { width: 100%; max-width: none; max-height: min(55svh, 460px); margin-top: 7px; border-radius: 9px; pointer-events: auto; }

  .map-tools { right: 10px; bottom: calc(40px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: flex-end; gap: 7px; z-index: 3; }
  .map-tools button,
  .map-tools .map-style-toggle { display: grid; place-items: center; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 8px; background: #fcfaf6f2; color: var(--blue); font-size: 23px; line-height: 1; }
  #map-info { position: absolute; top: calc(100% + 5px); left: 10px; z-index: 3; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--blue); font-size: 13px; font-weight: 700; }
  .map-pane.show-map-help #map-info { display: none; }
  .map-style-text { display: none; }
  .map-style-icon { display: block; width: 23px; height: 23px; }

  .map-prompt { top: calc(100% + 5px); bottom: auto; left: 10px; z-index: 3; transform: none; width: calc(100% - 20px); max-width: none; min-height: 64px; padding: 6px 0 6px 10px; gap: 8px; border-radius: 9px; text-align: left; white-space: normal; pointer-events: auto; }
  .map-prompt:not([data-help-ready]) { display: none; }
  .map-prompt strong { font-size: 11px; }
  .map-prompt small { font-size: 9px; }
  .pin-gesture-mark { width: 25px; height: 25px; font-size: 17px; }
  #map-prompt-close { display: grid; place-items: center; width: 44px; min-width: 44px; height: 44px; margin-left: auto; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 22px; }

  .side-pane,
  .side-pane[data-sheet=peek],
  .side-pane[data-sheet=collapsed],
  .side-pane[data-sheet=expanded] { position: relative; left: auto; right: auto; bottom: auto; width: 100%; height: auto; max-height: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; padding-bottom: 0; transition: none; scroll-margin-top: 8px; }
  .side-pane .sheet-top { height: 48px; }
  .side-pane .sheet-grip,
  #sheet-toggle { display: none; }
  .side-pane .sheet-scroll { overflow: visible; overscroll-behavior: auto; flex: auto; padding-bottom: 28px; }
  .side-pane .icon-button { min-width: 44px; min-height: 44px; }
  .story-rail { display: block; width: 100%; min-height: 0; padding: 16px 17px 22px; border: 0; border-top: 1px solid var(--line); background: var(--paper); }
  .story-rail-intro, .story-rail-foot { display: none; }
  .story-rail-latest { padding: 0; overflow: visible; }
  .story-preview { margin-top: 10px; }
  .story-preview img { max-height: 180px; border-radius: 6px; }
}
