@media (max-width: 1100px) {
  .top-panel {
    width: min(620px, calc(100vw - 32px));
  }

  .beaches-panel {
    top: 96px;
    width: min(360px, calc(100vw - 40px));
  }

  .beaches-panel.is-collapsed {
    top: auto;
    right: 20px;
    bottom: 20px;
    left: auto;
    width: min(260px, calc(100vw - 40px));
    height: auto;
    min-height: 52px;
    max-height: none;
    padding: 12px 14px 10px;
    display: flex;
    border-radius: 18px;
  }

  .detected-species-panel {
    top: 320px;
    width: min(360px, calc(100vw - 40px));
  }

  .status-panel {
    top: 108px;
    right: 20px;
  }
}

@media (max-width: 820px) {
  .top-panel,
  .status-panel,
  .detected-species-panel,
  .legend-panel,
  .beaches-panel {
    left: 12px;
    right: 12px;
    width: auto;
    transform: none;
  }

  .top-panel {
    top: 10vh;
    padding: 12px;
    border-radius: 22px;
  }

  .brand-logo {
    width: 58px;
    height: 58px;
    border-radius: 14px;
  }

  .brand-head {
    gap: 8px;
    margin-bottom: 6px;
  }

  .brand-copy {
    gap: 2px;
  }

  .status-panel {
    display: none;
    top: 92px;
  }

  .mobile-status-panel {
    display: grid;
    gap: 8px;
    top: 96px;
    right: 12px;
    left: auto;
    width: 154px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 520;
  }

  .mobile-status-panel .mini-card {
    padding: 9px 10px;
    border-radius: 14px;
  }

  .mobile-status-panel .mini-card strong {
    margin-bottom: 2px;
    font-size: 0.92rem;
    line-height: 1.18;
  }

  .mobile-status-panel .mini-card span {
    font-size: 0.74rem;
    line-height: 1.25;
  }

  .mobile-status-panel .mini-card-actions {
    gap: 6px;
  }

  .mobile-status-panel .mobile-map-style-switcher {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .mobile-status-panel .mobile-map-style-switcher .map-style-button {
    width: 100%;
    height: 38px;
    min-width: 0;
    border-radius: 12px;
    padding: 0;
  }

  .mobile-status-panel .animal-buttons-strip-mobile {
    display: none;
  }

  .beaches-panel {
    display: flex;
    position: fixed;
    left: 12px;
    right: 12px;
    top: 12px;
    bottom: 12px;
    width: auto;
    height: auto;
    max-height: none;
    border-radius: 18px;
    z-index: 630;
  }

  .beaches-panel.is-collapsed {
    display: none;
    top: auto;
    left: auto;
    right: 12px;
    bottom: 96px;
    width: min(240px, calc(100vw - 24px));
    height: auto;
    max-height: none;
    padding: 12px 14px 10px;
    border-radius: 18px;
    z-index: 630;
  }

  .detected-species-panel {
    display: flex;
  }

  .legend-panel {
    display: none;
  }

  .animals-lab-panel {
    display: none;
  }

  .animal-buttons-strip {
    display: none;
  }

  .search-shell {
    max-width: none;
  }

  .search-toolbar {
    top: 10px;
  }

  .leaflet-popup-content-wrapper {
    width: 58vw !important;
    max-width: 58vw !important;
    min-width: 58vw !important;
    border-radius: 14px;
  }

  .leaflet-popup-content {
    width: calc(58vw - 24px) !important;
    max-width: calc(58vw - 24px) !important;
    margin: 10px 12px;
  }
}

@media (max-width: 560px) {
  .status-panel {
    grid-template-columns: 1fr;
    top: 88px;
  }

  .top-panel {
    top: 10vh;
  }

  .brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 12px;
  }

  .brand-head {
    gap: 6px;
  }

  .app-tagline {
    font-size: 0.82rem;
  }

  .mobile-status-panel {
    bottom: 10vh;
    top: inherit;
    right: 10px;
    width: 58px;
  }

  .beaches-panel {
    position: fixed;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    height: auto;
    max-height: none;
    border-radius: 18px;
    z-index: 640;
  }

  .beaches-panel.is-collapsed {
    display: none;
    top: auto;
    left: auto;
    right: 10px;
    bottom: 92px;
    width: min(220px, calc(100vw - 20px));
    height: auto;
    max-height: none;
    z-index: 630;
  }

  .detected-species-panel {
    position: fixed;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    height: auto;
    max-height: none;
    border-radius: 18px;
    z-index: 640;
  }

  .leaflet-control-zoom {
    margin-top: 210px;
  }

  .leaflet-popup-content-wrapper {
    width: 64vw !important;
    max-width: 64vw !important;
    min-width: 64vw !important;
  }

  .leaflet-popup-content {
    width: calc(64vw - 20px) !important;
    max-width: calc(64vw - 20px) !important;
    margin: 8px 10px;
  }
}
