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

  .beaches-panel {
    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: 20px;
    right: 20px;
  }
}

@media (max-width: 970px) {
  .beach-tab-count {
    display: none;
  }

  .detected-species-profile {
    border-radius: 18px;
    padding: 10px;
  }

  .detected-species-item {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
  }

  .detected-species-item img {
    width: 100%;
    height: 180px;
  }

  .animal-buttons-strip {
    left: 10px;
    right: auto;
    bottom: 10px;
    top: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    max-width: 58px;
    max-height: min(46vh, calc(100vh - 180px));
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px;
  }

  body:not(.legend-panel-hidden) #animal-buttons-strip {
    display: none !important;
  }

  body.legend-panel-hidden #animal-buttons-strip {
    left: 10px;
    max-width: 58px;
	bottom: 10vh
  }

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

  .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;
  }

  .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: 840;
  }

  .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: 840;
	transform: inherit
  }

  .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;
  }
}

@media (max-width: 500px) {
    body.legend-panel-hidden #animal-buttons-strip {
        left: 3px;
        transform:scale(0.8);
		bottom: calc(10vh - 30px)
    }
	p#app-brand {
	    font-size: 0.95rem
	}
	
	.legend-panel {
		bottom: 10vh !important
	}
}
