/*
 * Institutional interface refinements for Praias de Portugal.
 * The APA logo and all logo-related selectors are intentionally excluded.
 */

:root {
  --ui-primary: #006b7f;
  --ui-primary-dark: #004d5c;
  --ui-primary-soft: #e8f3f5;
  --ui-link: #075f9f;
  --ui-link-hover: #004a7c;
  --ui-text: #253238;
  --ui-text-muted: #5d6b72;
  --ui-border: #d6e0e3;
  --ui-surface: #ffffff;
  --ui-surface-soft: #f5f8f9;
  --ui-shadow: 0 6px 18px rgba(24, 45, 52, 0.14);
  --ui-shadow-small: 0 2px 8px rgba(24, 45, 52, 0.16);
  --ui-radius: 8px;
}

html,
body,
.leaflet-container {
  color: var(--ui-text);
  font-family: Arial, Helvetica, sans-serif;
}

#map {
  background: #e7edef;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
.leaflet-interactive:focus-visible {
  outline: 3px solid rgba(0, 107, 127, 0.38);
  outline-offset: 2px;
}

/* Map title */
.title,
.titleMobile {
  min-width: 172px;
  box-sizing: border-box;
  padding: 10px 14px;
  color: inherit;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow-small);
  appearance: none;
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.title:hover,
.titleMobile:hover {
  background: #f6fafb;
  border-color: #b8cdd2;
  box-shadow: 0 3px 10px rgba(24, 45, 52, 0.18);
}

.title:focus-visible,
.titleMobile:focus-visible {
  outline: 3px solid rgba(0, 107, 127, 0.3);
  outline-offset: 2px;
}

.title h4,
.titleMobile h4 {
  margin: 0;
  color: var(--ui-text);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* Legend */
.legend {
  min-width: 152px;
  box-sizing: border-box;
  padding: 11px 12px;
  color: var(--ui-text-muted);
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow-small);
  line-height: 1.65;
}

.legend a {
  color: var(--ui-primary-dark) !important;
  font-size: 12px !important;
  text-decoration: none;
}

.legend a:hover {
  text-decoration: underline;
}

.legend i.circle {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  opacity: 1;
}

/* Standard map controls, intentionally scoped away from custom branding. */
.leaflet-bar,
.leaflet-control-layers,
.leaflet-control-geocoder,
.leaflet-control-locate {
  overflow: hidden;
  background: var(--ui-surface);
  border: 1px solid var(--ui-border) !important;
  border-radius: 7px !important;
  box-shadow: var(--ui-shadow-small) !important;
}

.leaflet-bar a,
.leaflet-touch .leaflet-bar a {
  width: 34px;
  height: 34px;
  color: var(--ui-text);
  line-height: 34px;
  border-color: var(--ui-border);
}

.leaflet-bar a:hover,
.leaflet-bar a:focus {
  color: var(--ui-primary-dark);
  background: var(--ui-primary-soft);
}

.leaflet-control-layers-toggle {
  width: 38px;
  height: 38px;
}

.leaflet-control-geocoder-form input {
  width: 190px !important;
  height: 34px;
  box-sizing: border-box;
  padding: 6px 10px;
  color: var(--ui-text);
  border: 0;
  font-size: 14px;
}

.leaflet-control-attribution {
  color: var(--ui-text-muted) !important;
  background: rgba(255, 255, 255, 0.9) !important;
  border-radius: 4px 0 0 0;
}

.leaflet-control-attribution a {
  color: var(--ui-primary-dark);
}

/* Region selector */
.grow {
  width: 40px;
  height: 38px;
  box-sizing: border-box;
  padding: 8px 0;
  color: var(--ui-text-muted);
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: 7px;
  box-shadow: var(--ui-shadow-small);
  transition: width 180ms ease, height 180ms ease;
}

.grow:hover,
.grow:focus-within {
  width: 126px;
  height: 178px;
  padding: 9px;
}

.grow a {
  display: inline-block;
  color: var(--ui-primary-dark) !important;
  line-height: 1.35;
  text-decoration: none;
}

.grow a:hover {
  text-decoration: underline;
}

/* Sidebar */
.leaflet-sidebar {
  border: 1px solid var(--ui-border);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(20, 43, 50, 0.16), 0 2px 8px rgba(20, 43, 50, 0.08);
}

.leaflet-sidebar.collapsed {
  width: 50px;
}

.leaflet-sidebar-tabs,
.leaflet-sidebar-tabs > ul {
  width: 50px;
}

.leaflet-sidebar-tabs {
  background: #f4f8f9 !important;
  border-right: 1px solid var(--ui-border);
}

.leaflet-sidebar-tabs > li,
.leaflet-sidebar-tabs > ul > li {
  height: 50px;
  color: var(--ui-text-muted);
  font-size: 16px;
}

.leaflet-sidebar-tabs > li > a,
.leaflet-sidebar-tabs > ul > li > a {
  line-height: 50px;
}

.leaflet-sidebar-tabs > li:hover,
.leaflet-sidebar-tabs > ul > li:hover {
  color: var(--ui-primary-dark);
  background: var(--ui-primary-soft);
}

.leaflet-sidebar-tabs > li.active,
.leaflet-sidebar-tabs > ul > li.active {
  color: #ffffff;
  background: var(--ui-primary);
  box-shadow: inset 3px 0 0 #8dd2dc;
}

.leaflet-sidebar-left .leaflet-sidebar-content {
  left: 50px;
}

.leaflet-sidebar-content {
  color: var(--ui-text);
  background: #ffffff !important;
  scrollbar-color: #9aabb0 transparent;
  scrollbar-width: thin;
}

.leaflet-sidebar-content::-webkit-scrollbar {
  width: 8px;
}

.leaflet-sidebar-content::-webkit-scrollbar-thumb {
  background: #aebdc1;
  border: 2px solid #f7fafb;
  border-radius: 999px;
}

.leaflet-sidebar-pane {
  padding: 14px 24px 22px;
}

.leaflet-sidebar-header {
  position: relative;
  display: flex;
  min-height: 62px;
  height: auto;
  margin: -14px -24px 17px;
  box-sizing: border-box;
  align-items: center;
  padding: 11px 56px 11px 22px;
  color: #1d1d1f;
  background: #ffffff;
  border-bottom: 1px solid #e5e5e7;
  box-shadow: none;
  line-height: 1.25;
}

.leaflet-sidebar-title {
  display: -webkit-box;
  flex: 1 1 auto;
  min-width: 0;
  max-width: calc(100% - 4px);
  margin: 0;
  overflow: hidden;
  color: #1d1d1f !important;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.leaflet-sidebar-close {
  display: none !important;
}

.sidebar-global-close {
  position: absolute;
  top: 11px;
  right: 9px;
  z-index: 5000;
  display: flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #515154;
  background: #ffffff;
  border: 0;
  border-radius: 50%;
  appearance: none;
  font: 600 30px/1 Arial, Helvetica, sans-serif;
  cursor: pointer;
}

.leaflet-sidebar.collapsed > .sidebar-global-close {
  display: none;
}

.sidebar-global-close:hover {
  color: #1d1d1f;
  background: #f2f2f4;
}

.sidebar-global-close:focus-visible {
  outline: 2px solid rgba(0, 107, 127, 0.38);
  outline-offset: 1px;
}

#sidebar-content,
#sidebar-Mar,
#sidebar-camera {
  margin: 0;
  color: #424245;
  font-size: 14px;
  line-height: 1.45;
}

#sidebar-content a:not([href]),
#sidebar-Mar a:not([href]),
#sidebar-camera a:not([href]) {
  color: #40545b !important;
  cursor: default;
  text-decoration: none;
}

.sidebar-section-title {
  display: block;
  margin: 0 0 5px;
  padding: 0;
  color: #1d1d1f !important;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 17px !important;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.sidebar-data-row {
  display: block;
  margin: 1px 0;
  color: #515154 !important;
  font-size: 14px !important;
  line-height: 1.4;
}

.sidebar-data-row b,
.sidebar-data-value b {
  color: #203a42;
  font-weight: 700;
}

.sidebar-meta,
.sidebar-source {
  display: block;
  color: #6e6e73 !important;
  font-size: 12px !important;
  line-height: 1.35;
}

.sidebar-source {
  margin-top: 5px;
}

#sidebar-content a:not([href]) > b,
#sidebar-Mar a:not([href]) > b,
#sidebar-camera a:not([href]) > b {
  color: #173f49;
  font-weight: 700;
}

#sidebar-content a[href],
#sidebar-Mar a[href],
#sidebar-camera a[href] {
  display: flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  margin: 0 0 7px;
  padding: 1px 0;
  color: var(--ui-link) !important;
  font-size: 14px !important;
  font-weight: 600;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  text-decoration: none;
}

#sidebar-content a[href]:hover,
#sidebar-Mar a[href]:hover,
#sidebar-camera a[href]:hover {
  color: var(--ui-link-hover) !important;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
  transform: none;
}

#sidebar-content a[href]:focus-visible,
#sidebar-Mar a[href]:focus-visible,
#sidebar-camera a[href]:focus-visible {
  border-radius: 2px;
  text-decoration: underline;
}

#sidebar-content hr,
#sidebar-Mar hr {
  width: 100% !important;
  margin: 11px 0 !important;
  border: 0;
  border-top: 1px solid #e5e5e7;
}

#sidebar-camera video,
#sidebar-camera iframe,
#sidebar-content img {
  max-width: 100%;
  border-radius: 10px;
}

#sidebar-camera iframe,
#sidebar-camera video {
  width: 100%;
  min-height: 420px;
  border: 1px solid var(--ui-border);
  background: #eef3f4;
  box-shadow: var(--ui-shadow-small);
}

#sidebar-content .popup {
  display: block;
  margin: 0 0 7px;
  color: var(--ui-link);
  font-weight: 600;
}

#sidebar-content .popuptext {
  width: 180px;
  box-sizing: border-box;
  bottom: calc(100% + 8px);
  left: 0;
  margin-left: 0;
  padding: 8px 12px;
  color: #1d1d1f;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #d2d2d7;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
  text-align: left;
  font-weight: 400;
}

#sidebar-content .popuptext .sidebar-action {
  display: flex;
  width: 100%;
  margin: 0;
  padding: 7px 0;
}

.sidebar-directions__trigger {
  display: block;
  padding: 2px 0;
  color: var(--ui-link);
  background: transparent;
  border: 0;
  font: 600 14px/1.4 Arial, Helvetica, sans-serif;
  cursor: pointer;
}

.sidebar-directions__trigger:hover {
  color: var(--ui-link-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sidebar-directions__trigger:focus-visible {
  outline: 2px solid rgba(0, 107, 127, 0.38);
  outline-offset: 3px;
}

.sidebar-actions {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 7px !important;
  width: 100%;
  margin: 0;
  padding: 0;
}

.sidebar-actions .sidebar-action,
.sidebar-actions .sidebar-directions,
.sidebar-actions .sidebar-directions__trigger {
  width: max-content;
  max-width: 100%;
  margin: 0 !important;
}

.sidebar-actions .sidebar-action {
  display: flex !important;
}

.sidebar-actions .sidebar-action::after,
.sidebar-actions .sidebar-directions__trigger::after {
  content: none !important;
  display: none !important;
}

#sidebar-content,
#sidebar-Mar,
#sidebar-camera {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

/* Modern beach pins: one visible pin per beach, with classification colour. */
.beach-pin-container {
  overflow: visible !important;
  background: transparent !important;
  border: 0 !important;
}

.beach-pin {
  --pin-colour: #68757b;
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  color: var(--pin-colour);
  /* Keep visual scaling centred on the geographical tip of the pin. */
  transform: scale(var(--beach-pin-scale, 1));
  transform-origin: 50% 95.5%;
  transition: filter 140ms ease, transform 140ms ease;
}

.beach-pin--excellent {
  --pin-colour: #2c67cd;
}

.beach-pin--good {
  --pin-colour: #34a853;
}

.beach-pin--acceptable {
  --pin-colour: #f2a51a;
}

.beach-pin--poor {
  --pin-colour: #e5484d;
}

.beach-pin--unknown {
  --pin-colour: #7a8a91;
}

.beach-pin__svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.beach-pin__shell {
  fill: currentColor;
}

.beach-pin__surface-highlight,
.beach-pin__surface-shade {
  fill: none;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.beach-pin__surface-highlight {
  stroke: rgba(255, 255, 255, 0.28);
  stroke-width: 1.05;
}

.beach-pin__surface-shade {
  stroke: rgba(55, 58, 60, 0.16);
  stroke-width: 1.2;
}

.beach-pin__contact-shadow {
  fill: rgba(58, 61, 63, 0.18);
}

.beach-pin__hole-occlusion,
.beach-pin__hole-highlight,
.beach-pin__hole-shadow {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.beach-pin__hole-occlusion {
  stroke: rgba(65, 68, 70, 0.25);
  stroke-width: 1.25;
}

.beach-pin__hole-highlight {
  stroke: rgba(255, 255, 255, 0.58);
  stroke-width: 0.9;
  stroke-linecap: round;
}

.beach-pin__hole-shadow {
  stroke: rgba(55, 58, 60, 0.34);
  stroke-width: 1.05;
  stroke-linecap: round;
}

.beach-pin__selection {
  fill: none;
  stroke: transparent;
  stroke-width: 0.75;
  vector-effect: non-scaling-stroke;
}

.beach-pin-container:hover .beach-pin,
.beach-pin-container:focus .beach-pin {
  filter: brightness(1.04);
  transform: translateY(-1px) scale(var(--beach-pin-scale, 1));
}

.beach-pin--selected {
  z-index: 1;
}

.beach-pin--selected .beach-pin__svg {
  filter: drop-shadow(0 0 2px rgba(60, 64, 66, 0.2)) drop-shadow(0 4px 4px rgba(52, 56, 58, 0.26));
}

.beach-pin--selected .beach-pin__selection {
  stroke: #004d5c;
  stroke-width: 2.2;
}

.beach-pin-tooltip {
  padding: 6px 9px;
  color: var(--ui-text);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--ui-border);
  border-radius: 6px;
  box-shadow: var(--ui-shadow-small);
  font-size: 12px;
  font-weight: 600;
}

.beach-pin-tooltip::before {
  border-top-color: var(--ui-border) !important;
}

/* Lightweight image markers keep mobile pinch-zoom responsive. */
.beach-pin-image {
  background: transparent;
  border: 0;
  filter: none;
}

.beach-pin-image--selected {
  filter: drop-shadow(0 2px 2px rgba(0, 77, 92, 0.2));
}

/* Move all marker images as one composited pane during mobile pan/zoom. */
.leaflet-marker-pane {
  backface-visibility: hidden;
  will-change: transform;
}

/* Global beach search. Kept independent from institutional logo styling. */
.beach-search {
  position: fixed;
  top: 14px;
  left: 50%;
  z-index: 1200;
  width: min(560px, calc(100vw - 190px));
  transform: translateX(-50%);
  color: var(--ui-text);
}

.beach-search__field {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 50px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(16, 78, 91, 0.2);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(30, 48, 53, 0.16), 0 2px 6px rgba(30, 48, 53, 0.08);
  backdrop-filter: blur(10px);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.beach-search:focus-within .beach-search__field,
.beach-search--open .beach-search__field {
  border-color: rgba(0, 102, 119, 0.55);
  box-shadow: 0 10px 32px rgba(30, 48, 53, 0.19), 0 0 0 3px rgba(0, 102, 119, 0.1);
}

.beach-search__icon {
  flex: 0 0 auto;
  width: 21px;
  height: 21px;
  margin-left: 17px;
  fill: none;
  stroke: #006677;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.beach-search__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.beach-search__input {
  min-width: 0;
  flex: 1 1 auto;
  height: 48px;
  padding: 0 12px;
  color: #18363d;
  background: transparent;
  border: 0;
  outline: 0;
  font: 500 15px/1.3 Arial, sans-serif;
}

.beach-search__input:focus-visible {
  outline: 0;
}

.beach-search__input::placeholder {
  color: #667b80;
  opacity: 1;
}

.beach-search__input::-webkit-search-cancel-button {
  display: none;
}

.beach-search__shortcut {
  flex: 0 0 auto;
  margin-right: 12px;
  padding: 3px 6px;
  color: #60757a;
  background: #edf3f4;
  border: 1px solid #d6e1e3;
  border-radius: 5px;
  box-shadow: none;
  font: 600 10px/1.2 Arial, sans-serif;
}

.beach-search__clear {
  display: none;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  margin-right: 8px;
  padding: 8px;
  color: #526a70;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.beach-search--has-value .beach-search__clear {
  display: block;
}

.beach-search--has-value .beach-search__shortcut {
  display: none;
}

.beach-search__clear:hover,
.beach-search__clear:focus-visible {
  color: #004d5c;
  background: #edf4f5;
  outline: 0;
}

.beach-search__clear svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.beach-search__results {
  max-height: min(420px, calc(100vh - 92px));
  margin-top: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.985);
  border: 1px solid rgba(16, 78, 91, 0.16);
  border-radius: 14px;
  box-shadow: 0 16px 42px rgba(29, 47, 52, 0.2);
  overscroll-behavior: contain;
}

.beach-search__results[hidden] {
  display: none;
}

.beach-search__result {
  position: relative;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  column-gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 9px 14px;
  color: #17353c;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #e7edef;
  cursor: pointer;
}

.beach-search__result:last-child {
  border-bottom: 0;
}

.beach-search__result:hover,
.beach-search__result--active {
  background: #edf6f7;
}

.beach-search__result:focus-visible {
  outline: 2px solid #148296;
  outline-offset: -2px;
}

.beach-search__quality {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(104, 117, 123, 0.11);
}

.beach-search__quality--excellent { background: #2c67cd; }
.beach-search__quality--good { background: #34a853; }
.beach-search__quality--acceptable { background: #f2a51a; }
.beach-search__quality--poor { background: #e5484d; }
.beach-search__quality--unknown { background: #7a8a91; }

.beach-search__copy {
  min-width: 0;
}

.beach-search__name,
.beach-search__meta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.beach-search__name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.beach-search__meta {
  margin-top: 3px;
  color: #667a80;
  font-size: 12px;
  line-height: 1.25;
}

.beach-search__hint {
  align-self: center;
  color: #74878c;
  font-size: 11px;
  white-space: nowrap;
}

.beach-search__empty {
  padding: 22px 18px;
  color: #60747a;
  text-align: center;
  font-size: 13px;
  line-height: 1.45;
}

.beach-search__status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* National bathing-water dashboard */
.bathing-dashboard-modal[hidden] {
  display: none;
}

.bathing-dashboard-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  box-sizing: border-box;
  place-items: center;
  padding: 24px;
}

.bathing-dashboard-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 28, 35, 0.58);
  backdrop-filter: blur(7px);
}

.bathing-dashboard {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  color: #18363d;
  background: #f3f8f9;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(2, 30, 39, 0.34);
}

.bathing-dashboard__header {
  position: relative;
  padding: 24px 72px 22px 28px;
  color: #ffffff;
  background: linear-gradient(135deg, #056ea8 0%, #0089b7 100%);
}

.bathing-dashboard__header::after {
  position: absolute;
  right: -3%;
  bottom: -25px;
  width: 54%;
  height: 55px;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  content: "";
}

.bathing-dashboard__eyebrow {
  margin: 0 0 5px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bathing-dashboard__header h2 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(27px, 3vw, 38px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.bathing-dashboard__header p:last-child {
  max-width: 820px;
  margin: 9px 0 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  line-height: 1.45;
}

.bathing-dashboard__header a {
  color: #ffffff;
  font-weight: 700;
  text-underline-offset: 3px;
}

.bathing-dashboard__close {
  position: absolute;
  top: 18px;
  right: 20px;
  z-index: 2;
  display: flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  font: 400 31px/1 Arial, Helvetica, sans-serif;
  cursor: pointer;
}

.bathing-dashboard__close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.bathing-dashboard__content {
  max-height: calc(100vh - 190px);
  overflow: auto;
  padding: 20px;
}

.bathing-dashboard__grid {
  display: grid;
  grid-template-columns: 1.05fr 1.05fr 1fr;
  grid-template-areas:
    "alerts flags access"
    "alerts flags amphibious"
    "alerts watched support";
  gap: 14px;
}

.bathing-stat-card {
  min-width: 0;
  box-sizing: border-box;
  padding: 18px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #dbe8eb;
  border-radius: 17px;
  box-shadow: 0 5px 18px rgba(24, 61, 70, 0.07);
}

.bathing-stat-card--alerts { grid-area: alerts; }
.bathing-stat-card--flags { grid-area: flags; }
.bathing-stat-card--metric:nth-of-type(3) { grid-area: access; }
.bathing-stat-card--metric:nth-of-type(4) { grid-area: amphibious; }
.bathing-stat-card--metric:nth-of-type(5) { grid-area: watched; }
.bathing-stat-card--metric:nth-of-type(6) { grid-area: support; }

.bathing-stat-card__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.bathing-stat-card__label {
  margin: 0;
  color: #1e5b91;
  font-size: 14px;
  font-weight: 700;
}

.bathing-stat-card h3 {
  margin: 4px 0 0;
  color: #174f7f;
  font-size: 17px;
  line-height: 1.25;
}

.bathing-alert-count {
  flex: 0 0 auto;
  padding: 5px 9px;
  color: #a11d27;
  background: #fff0f1;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.bathing-alert-map {
  display: grid;
  height: 235px;
  margin: 7px 0;
  place-items: center;
}

.bathing-alert-map svg {
  height: 100%;
  overflow: visible;
  fill: rgba(218, 239, 241, 0.8);
  stroke: #255663;
  stroke-width: 1.4;
}

.bathing-alert-map circle {
  fill: #e3313f;
  stroke: #ffffff;
  stroke-width: 2;
}

.bathing-alert-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bathing-alert-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  background: #fff8f8;
  border-radius: 10px;
}

.bathing-alert-list li > span {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  background: #e3313f;
  border-radius: 50%;
}

.bathing-alert-list strong,
.bathing-alert-list small {
  display: block;
}

.bathing-alert-list strong {
  color: #174f7f;
  font-size: 13px;
}

.bathing-alert-list small {
  margin-top: 2px;
  color: #626f73;
  font-size: 11px;
}

.bathing-stat-card__note,
.bathing-dashboard__source {
  color: #68777c;
  font-size: 11px;
  line-height: 1.4;
}

.bathing-stat-card__note {
  margin: 10px 0 0;
}

.bathing-quality-total {
  margin: 24px 0 20px;
}

.bathing-quality-total strong {
  display: block;
  color: #075f9f;
  font-size: 56px;
  letter-spacing: -0.055em;
  line-height: 1;
}

.bathing-quality-total span {
  display: block;
  max-width: 210px;
  margin-top: 6px;
  color: #59696e;
  font-size: 12px;
  line-height: 1.35;
}

.bathing-quality-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bathing-quality-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  color: #46575c;
  font-size: 12px;
}

.bathing-quality-list strong {
  color: #273c42;
  font-size: 13px;
}

.bathing-quality-list i {
  grid-column: 1 / -1;
  display: block;
  height: 6px;
  overflow: hidden;
  background: #e4ecee;
  border-radius: 999px;
}

.bathing-quality-list b {
  display: block;
  width: 0;
  height: 100%;
  background: #778187;
  border-radius: inherit;
  transition: width 350ms ease;
}

.bathing-quality-list--excellent b { background: #2c67cd; }
.bathing-quality-list--good b { background: #2f8f46; }
.bathing-quality-list--acceptable b { background: #c58a2a; }
.bathing-quality-list--poor b { background: #d64545; }

.bathing-current-summary {
  display: grid;
  min-height: 330px;
  place-items: center;
  align-content: center;
  text-align: center;
}

.bathing-current-summary > strong {
  display: block;
  margin-top: 13px;
  color: #2c67cd;
  font-size: 64px;
  letter-spacing: -0.055em;
  line-height: 1;
}

.bathing-current-summary > span {
  max-width: 230px;
  margin-top: 8px;
  color: #56676c;
  font-size: 13px;
  line-height: 1.35;
}

.bathing-current-summary > small {
  margin-top: 11px;
  color: #6a797e;
  font-size: 11px;
}

.bathing-flag-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(125px, 0.75fr);
  gap: 20px;
  align-items: end;
  min-height: 335px;
}

.bathing-bar-chart {
  display: grid;
  height: 205px;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: end;
  padding-top: 25px;
}

.bathing-bar-chart > div {
  display: grid;
  height: 100%;
  grid-template-rows: auto 1fr auto;
  gap: 5px;
  align-items: end;
  text-align: center;
}

.bathing-bar-chart strong {
  color: #2c67cd;
  font-size: 14px;
}

.bathing-bar-chart i {
  display: block;
  width: 18px;
  height: var(--bar-height);
  justify-self: center;
  background: linear-gradient(#3979df, #2c67cd);
  border-radius: 8px 8px 3px 3px;
}

.bathing-bar-chart span {
  color: #5e6c70;
  font-size: 11px;
}

.bathing-flag-total {
  text-align: center;
}

.bathing-flag-total > strong {
  display: block;
  margin-top: 7px;
  color: #2c67cd;
  font-size: 54px;
  letter-spacing: -0.05em;
  line-height: 1;
}

.bathing-flag-total > span {
  display: block;
  margin-top: 5px;
  color: #56676c;
  font-size: 12px;
  line-height: 1.3;
}

.bathing-ring {
  --ring-colour: #2c67cd;
  --ring-value: 0%;
  display: grid;
  width: 88px;
  height: 88px;
  flex: 0 0 auto;
  place-items: center;
  background: conic-gradient(var(--ring-colour) 0 var(--ring-value), #dce8eb var(--ring-value) 100%);
  border-radius: 50%;
}

.bathing-ring::before {
  width: 66px;
  height: 66px;
  grid-area: 1 / 1;
  background: #ffffff;
  border-radius: 50%;
  content: "";
}

.bathing-ring svg {
  z-index: 1;
  width: 43px;
  height: 43px;
  grid-area: 1 / 1;
  fill: none;
  stroke: #294b53;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bathing-ring--green { --ring-colour: #31a36c; }
.bathing-ring--ocean { --ring-colour: #0083b6; }
.bathing-ring--teal { --ring-colour: #34b6b5; }
.bathing-ring--cyan { --ring-colour: #00a6c9; }

.bathing-stat-card--metric {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.bathing-stat-card--metric h3 {
  margin: 0;
  font-size: 16px;
}

.bathing-stat-card--metric strong {
  display: block;
  margin-top: 3px;
  color: var(--ring-colour, #087eaa);
  font-size: 45px;
  letter-spacing: -0.05em;
  line-height: 1;
}

.bathing-stat-card--metric:nth-of-type(3) strong { color: #31a36c; }
.bathing-stat-card--metric:nth-of-type(4) strong { color: #0083b6; }
.bathing-stat-card--metric:nth-of-type(5) strong { color: #34aead; }
.bathing-stat-card--metric:nth-of-type(6) strong { color: #00a0c3; }

.bathing-stat-card--metric p {
  margin: 5px 0 0;
  color: #59696e;
  font-size: 11px;
  line-height: 1.3;
}

.bathing-dashboard__source {
  margin: 12px 3px 0;
  text-align: right;
}

body.bathing-dashboard-open {
  overflow: hidden;
}

@media (max-width: 767px) {
  .beach-search {
    top: 10px;
    left: 58px;
    width: calc(100vw - 72px);
    transform: none;
  }

  .beach-search__field {
    min-height: 46px;
    border-radius: 12px;
  }

  .beach-search__input {
    height: 44px;
    font-size: 14px;
  }

  .beach-search__icon {
    margin-left: 14px;
  }

  .beach-search__shortcut {
    display: none;
  }

  .beach-search__results {
    max-height: min(390px, calc(100vh - 72px));
    border-radius: 12px;
  }

  .bathing-dashboard-modal {
    padding: 0;
  }

  .bathing-dashboard {
    width: 100%;
    max-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .bathing-dashboard__header {
    padding: 20px 64px 18px 20px;
  }

  .bathing-dashboard__content {
    max-height: calc(100vh - 145px);
    padding: 14px;
  }

  .bathing-dashboard__grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "alerts"
      "flags"
      "access"
      "amphibious"
      "watched"
      "support";
  }

  .bathing-alert-map {
    height: 190px;
  }

  .bathing-flag-layout {
    min-height: 280px;
  }

  .leaflet-sidebar {
    border: 0;
    border-radius: 0;
  }

  .leaflet-sidebar:not(.collapsed) {
    width: 100%;
  }

  .leaflet-sidebar-pane {
    padding: 12px 18px 22px;
  }

  .leaflet-sidebar-header {
    margin: -12px -18px 12px;
    padding-left: 18px;
  }

  .leaflet-sidebar-title {
    font-size: 18px;
  }

  .title,
  .titleMobile {
    min-width: 0;
    padding: 8px 10px;
  }

  .title h4,
  .titleMobile h4 {
    font-size: 15px;
  }

  .legend {
    min-width: 140px;
    padding: 8px 9px;
  }

  .leaflet-control-attribution {
    max-width: 68vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (min-width: 768px) and (max-width: 1050px) {
  .bathing-dashboard__grid {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "alerts flags"
      "alerts flags"
      "access amphibious"
      "watched support";
  }
}

@media (prefers-reduced-motion: reduce) {
  .leaflet-sidebar,
  .grow,
  .beach-pin {
    transition: none;
  }
}
