/* Manila Bay Portal (index.php) - UI refresh */
:root {
  --idx-bg: #0b1220;
  --idx-surface: rgba(255,255,255,0.92);
  --idx-surface-solid: #ffffff;
  --idx-border: rgba(15,23,42,0.08);
  --idx-shadow: 0 16px 40px rgba(2, 6, 23, 0.18);
  --idx-shadow-soft: 0 8px 24px rgba(2, 6, 23, 0.12);
  --idx-primary: #1d4ed8;
  --idx-primary-2: #0ea5e9;
  --idx-text: #0f172a;
  --idx-muted: #64748b;
  --idx-radius: 16px;
  --idx-transition: 220ms cubic-bezier(.2,.8,.2,1);
}

body, html {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--idx-text);
  background: #eaf2ff;
}

/* Map */
#map { background: #dbeafe; }
.mapboxgl-ctrl-group {
  border-radius: 12px !important;
  box-shadow: var(--idx-shadow-soft) !important;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.7);
}
.mapboxgl-ctrl-scale {
  background: rgba(255,255,255,.9) !important;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(15,23,42,.12) !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 12px rgba(15,23,42,.08);
  font-weight: 600;
  color: #334155;
}

/* Menu buttons */
.menu-open-btn {
  top: 16px;
  left: 16px;
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--idx-primary), var(--idx-primary-2));
  box-shadow: 0 10px 24px rgba(29,78,216,.35);
  font-size: 20px;
  line-height: 46px;
  transition: transform var(--idx-transition), box-shadow var(--idx-transition), filter var(--idx-transition);
}
.menu-open-btn:hover { transform: translateY(-2px); filter: brightness(1.03); box-shadow: 0 14px 28px rgba(29,78,216,.42); }
.menu-open-btn:active { transform: translateY(0); }
.menu-close-btn {
  top: 10px; right: 10px;
  width: 30px; height: 30px;
  border-radius: 8px;
  font-size: 16px;
  line-height: 30px;
  background: rgba(255,255,255,.12);
}
.menu-close-btn:hover { background: rgba(255,255,255,.22); }

/* Dashboard sidebar */
#dashboard {
  width: 340px;
  background: rgba(248, 250, 252, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid rgba(255,255,255,.6);
  box-shadow: 10px 0 40px rgba(15,23,42,.16);
  padding: 12px;
  gap: 10px;
  overflow-y: auto;
}
#dashboard.dashboard-hidden { transform: translateX(-115%); }
#panel-overlay {
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(2px);
}

/* Panels/cards */
.panel {
  background: var(--idx-surface);
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(15,23,42,.05);
  margin-bottom: 0;
  overflow: hidden;
}
.panel-header {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  padding: 13px 44px 13px 14px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .01em;
}
.divider-panel-header {
  background: linear-gradient(135deg, #334155, #475569);
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.panel-body {
  padding: 10px;
  max-height: 220px;
}

/* Layer items */
.layer-item {
  background: #fff;
  border: 1px solid #e8eef5;
  border-radius: 10px;
  padding: 9px 10px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  transition: transform var(--idx-transition), box-shadow var(--idx-transition), border-color var(--idx-transition), background var(--idx-transition);
}
.layer-item:hover {
  background: #f8fbff;
  border-color: rgba(37,99,235,.22);
  box-shadow: 0 6px 14px rgba(37,99,235,.08);
  transform: translateY(-1px);
}
.layer-item:last-child { margin-bottom: 0; }
.layer-controls button, #activeLayers button {
  width: 28px !important;
  height: 28px !important;
  line-height: 26px !important;
  border-radius: 8px !important;
  border: 1px solid #dbe4ee !important;
  background: #fff !important;
  color: #334155;
  font-size: 12px !important;
  transition: all var(--idx-transition);
}
.layer-controls button:hover, #activeLayers button:hover {
  background: #eff6ff !important;
  border-color: #93c5fd !important;
  color: #1d4ed8 !important;
}

/* Widget cards in sidebar */
.widget-header {
  padding: 12px 14px 0;
  font-size: 12px;
  color: var(--idx-muted);
  font-weight: 600;
}
.widget-content {
  margin: 8px 0 0;
  padding: 14px;
  background: var(--idx-surface);
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(15,23,42,.05);
}
.widget-content > b center, .widget-content b { color: #1e293b; }
.widget-date { color: var(--idx-muted); font-size: 12px; margin: 4px 0; }
.widget-section { margin-bottom: 12px; }
.weather-info p { margin: 6px 0; font-size: 13px; color: #334155; }
.tide-section { gap: 10px; }
.tide-high, .tide-low {
  background: #f8fafc;
  border: 1px solid #e8eef5;
  border-radius: 12px;
  padding: 10px 8px;
}
.tide-high h2, .tide-low h2 { font-size: 13px; font-weight: 700; color: #0f172a; margin: 4px 0; }
.tide-high span, .tide-low span { font-size: 12px; color: #475569; }
.icon-high { color: #0284c7; font-size: 18px; }
.icon-low { color: #ea580c; font-size: 18px; }

/* Visitor widget */
.visitor-mini-widget {
  position: static;
  width: auto;
  margin: 0;
  padding: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(239,246,255,.92));
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(15,23,42,.05);
  text-align: left;
  z-index: auto;
}
.visitor-mini-widget h3 { font-size: 14px; font-weight: 700; color: #0f172a; margin-bottom: 2px; }
.visitor-mini-widget h4 { font-size: 12px; color: var(--idx-muted); margin-bottom: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.visitor-numbers { gap: 8px; }
.visitor-numbers > div {
  flex: 1;
  background: #fff;
  border: 1px solid #e8eef5;
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
  transition: transform var(--idx-transition), box-shadow var(--idx-transition);
}
.visitor-numbers > div:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(15,23,42,.08); }
.visitor-numbers i { font-size: 18px; margin-bottom: 6px; display: block; }
.visitor-numbers h2 { font-size: 15px; font-weight: 800; color: #0f172a; line-height: 1.2; }
.visitor-numbers span { font-size: 11px; font-weight: 600; color: var(--idx-muted); text-transform: uppercase; letter-spacing: .03em; }

/* Login button */
.Btn {
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 10px 24px rgba(220,38,38,.32);
  z-index: 1200;
  text-decoration: none;
}
.Btn:hover { width: 128px; border-radius: 14px; box-shadow: 0 14px 28px rgba(220,38,38,.4); }
.Btn .text { font-size: 14px; font-weight: 700; }
.Btn:hover .sign { width: 34%; padding-left: 14px; }

/* Notice */
#notice {
  bottom: 16px;
  right: 16px;
  max-width: min(520px, calc(100vw - 32px));
  z-index: 1200;
}
#notice .alert {
  margin: 0;
  border: 1px solid rgba(147,197,253,.5);
  border-radius: 14px;
  background: rgba(239,246,255,.92);
  backdrop-filter: blur(10px);
  color: #1e40af;
  box-shadow: var(--idx-shadow-soft);
  font-size: 13px;
  padding: 12px 14px;
}

/* North arrow */
#map-ui { top: 72px !important; right: 16px !important; }
#north-arrow {
  width: 72px !important;
  padding: 8px;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  box-shadow: var(--idx-shadow-soft);
  border: 1px solid rgba(255,255,255,.7);
}

/* Map legends/popups */
.legend, .map-legend, #major-legend, #population-legend, #water-legend, #reclamation-legend, #legend-stp {
  font-family: inherit !important;
  border: 1px solid rgba(255,255,255,.7) !important;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,.9) !important;
  box-shadow: 0 10px 28px rgba(15,23,42,.14) !important;
  border-radius: 14px !important;
  color: #1e293b;
}
.legend h4, .map-legend h4 { font-weight: 700; color: #0f172a; }

/* Heat index legend — bottom right, clear of the weather widget, menu and notice */
#heat-legend {
  position: fixed !important;
  top: auto !important;
  bottom: 120px;
  right: 16px;
  left: auto;
  transform: none;
  z-index: 1300;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  white-space: normal;
  width: 272px;
  padding: 14px 16px 12px;
  background: linear-gradient(160deg, rgba(255,255,255,.97), rgba(248,250,252,.92)) !important;
  border: 1px solid rgba(255,255,255,.9) !important;
  border-radius: 18px !important;
  box-shadow: 0 18px 46px rgba(15,23,42,.18) !important;
  backdrop-filter: blur(16px);
  font-family: inherit;
}
#heat-legend span {
  width: auto; height: auto; margin-right: 0; border-radius: 0; display: inline;
}
#heat-legend .heat-legend__head {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 10px; border-bottom: 1px solid #e2e8f0;
}
#heat-legend .heat-legend__icon {
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: 12px;
  display: grid; place-items: center; color: #fff; font-size: 16px;
  background: linear-gradient(135deg, #fb923c, #dc2626);
  box-shadow: 0 8px 18px rgba(220,38,38,.28);
}
#heat-legend h4 {
  margin: 0; font-size: 14px; font-weight: 800; color: #0f172a; letter-spacing: -.01em;
}
#heat-legend .heat-legend__sub {
  display: block; margin-top: 1px; font-size: 11px; font-weight: 600; color: #64748b;
}
#heat-legend .heat-legend__rows { display: flex; flex-direction: column; gap: 7px; }
#heat-legend .heat-legend__row {
  display: flex; align-items: center; gap: 9px;
  font-size: 12px; color: #334155; transition: transform .18s ease;
}
#heat-legend .heat-legend__row:hover { transform: translateX(3px); }
#heat-legend .heat-legend__swatch {
  width: 24px; height: 12px; flex: 0 0 24px; border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.1);
}
#heat-legend .swatch-normal { background: linear-gradient(90deg, #4ade80, #2e7d32); }
#heat-legend .swatch-caution { background: linear-gradient(90deg, #fde047, #eab308); }
#heat-legend .swatch-extreme { background: linear-gradient(90deg, #fdba74, #ea580c); }
#heat-legend .swatch-danger { background: linear-gradient(90deg, #f87171, #dc2626); }
#heat-legend .swatch-severe { background: linear-gradient(90deg, #ef4444, #6b1010); }
#heat-legend .heat-legend__label { flex: 1; font-weight: 700; }
#heat-legend .heat-legend__range {
  font-size: 11px; font-weight: 700; color: #64748b;
  background: #f1f5f9; border-radius: 999px; padding: 2px 8px;
  font-variant-numeric: tabular-nums;
}
#heat-legend .heat-legend__foot {
  display: flex; align-items: center; gap: 7px;
  padding-top: 9px; border-top: 1px solid #e2e8f0;
  font-size: 11px; font-weight: 600; color: #64748b;
}
#heat-legend .heat-legend__foot::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.15);
}
@media (max-width: 900px) {
  #heat-legend { bottom: 110px; right: 12px; width: 232px; }
}

/* Heat index use case study */
.case-overlay {
  position: fixed; inset: 0; z-index: 1400;
  background: rgba(15,23,42,.42); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity var(--idx-transition);
}
.case-overlay.open { opacity: 1; pointer-events: auto; }
.heat-case {
  position: fixed; z-index: 1500;
  top: 50%; left: 50%; transform: translate(-50%, -47%) scale(.98);
  width: min(430px, calc(100vw - 32px)); max-height: min(82vh, 760px);
  display: flex; flex-direction: column;
  background: linear-gradient(160deg, rgba(255,255,255,.98), rgba(248,250,252,.96));
  border: 1px solid rgba(255,255,255,.9); border-radius: 20px;
  box-shadow: 0 30px 80px rgba(2,6,23,.3);
  opacity: 0; pointer-events: none;
  transition: opacity var(--idx-transition), transform var(--idx-transition);
}
.heat-case.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.heat-case__head {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 18px 20px 14px; border-bottom: 1px solid #e2e8f0;
}
.heat-case__eyebrow {
  display: block; font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .09em; color: #dc2626; margin-bottom: 4px;
}
.heat-case__head h2 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.02em; color: #0f172a; }
.heat-case__head p { margin: 4px 0 0; font-size: 12px; color: #64748b; }
.heat-case__close {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 10px;
  border: 1px solid #e2e8f0; background: #f8fafc; color: #475569;
  font-size: 20px; line-height: 1; cursor: pointer;
}
.heat-case__close:hover { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.heat-case__body { padding: 16px 20px 20px; overflow-y: auto; }
.heat-case__section { margin-bottom: 16px; }
.heat-case__section h3 {
  margin: 0 0 8px; font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .05em; color: #475569;
}
.heat-case__section p { margin: 0 0 8px; font-size: 13px; line-height: 1.55; color: #334155; }
.heat-case__how { background: #eff6ff; border: 1px solid #dbeafe; border-radius: 12px; padding: 10px 12px; }
.heat-case__stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.heat-case__stat { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px 12px; }
.heat-case__stat span { display: block; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #64748b; }
.heat-case__stat strong { display: block; font-size: 16px; font-weight: 800; color: #0f172a; margin-top: 2px; }
.heat-case__stat small { display: block; font-size: 11px; color: #64748b; margin-top: 1px; }
.heat-case__stations { display: flex; flex-direction: column; gap: 6px; }
.heat-case__station {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  border: 1px solid #e2e8f0; background: #fff; border-radius: 11px;
  padding: 8px 10px; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.heat-case__station:hover { transform: translateX(3px); box-shadow: 0 6px 16px rgba(15,23,42,.08); }
.heat-case__dot { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(15,23,42,.06); }
.heat-case__station-name { flex: 1; font-size: 12px; font-weight: 700; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.heat-case__station-hi { font-size: 12px; font-weight: 800; color: #0f172a; font-variant-numeric: tabular-nums; }
.heat-case__badge { font-size: 10px; font-weight: 800; color: #fff; border-radius: 999px; padding: 3px 7px; white-space: nowrap; }
.heat-case__empty { font-size: 12px; color: #64748b; }
.heat-case__guide { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.heat-case__guide li { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: #334155; }
.heat-case__guide b { min-width: 118px; color: #0f172a; }
.heat-case__guide span:last-child { flex: 1; }
.heat-case__swatch { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 3px; margin-top: 3px; }
.heat-case__note { margin: 0 !important; font-size: 11px !important; line-height: 1.5 !important; color: #64748b !important; border-top: 1px solid #e2e8f0; padding-top: 10px; }

#heat-legend .heat-legend__case {
  margin-left: auto; width: 26px; height: 26px; flex: 0 0 26px; border-radius: 9px;
  border: 1px solid #e2e8f0; background: #f8fafc; color: #dc2626;
  display: grid; place-items: center; cursor: pointer; font-size: 13px;
}
#heat-legend .heat-legend__case:hover { background: #fee2e2; border-color: #fecaca; }

@media (max-width: 520px) {
  .heat-case__stats { grid-template-columns: 1fr; }
  .heat-case__guide li { flex-wrap: wrap; }
}
.mapboxgl-popup-content {
  border-radius: 14px !important;
  box-shadow: 0 16px 36px rgba(15,23,42,.18) !important;
  padding: 14px 16px !important;
  border: 1px solid rgba(15,23,42,.06);
}
.mapboxgl-popup-close-button {
  font-size: 18px;
  width: 28px;
  height: 28px;
  color: #64748b;
  border-radius: 8px;
}
.mapboxgl-popup-close-button:hover { background: #f1f5f9; color: #0f172a; }

/* Animated PANaHON wind direction markers + bay-wide particles */
.wind-particle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 2;
}
.wind-marker {
  position: relative;
  width: 46px;
  height: 46px;
  pointer-events: none;
}
.wind-marker__halo {
  position: absolute;
  inset: 1px;
  border-radius: 50%;
  border: 1px solid rgba(14,165,233,.35);
  background: radial-gradient(circle, rgba(14,165,233,.22), rgba(14,165,233,0) 70%);
  animation: wind-halo 2.8s ease-in-out infinite;
}
.wind-marker__rotor {
  position: absolute;
  inset: 4px;
  transform: rotate(var(--wind-deg, 0deg));
  transform-origin: 50% 50%;
}
.wind-marker__particle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 13px solid #0284c7;
  filter: drop-shadow(0 1px 1px rgba(255,255,255,.95));
  animation: wind-fly 2.1s linear infinite;
}
.wind-marker__particle.p2 { animation-delay: .7s; }
.wind-marker__particle.p3 { animation-delay: 1.4s; }
.wind-marker__label {
  position: absolute;
  left: 50%;
  bottom: -7px;
  transform: translateX(-50%);
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(15,23,42,.88);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .02em;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(15,23,42,.18);
}
.wind-marker.is-calm .wind-marker__rotor { display: none; }
.wind-marker.is-calm .wind-marker__halo {
  border-color: rgba(100,116,139,.32);
  background: radial-gradient(circle, rgba(148,163,184,.25), rgba(148,163,184,0) 70%);
  animation: none;
}
@keyframes wind-fly {
  0%   { transform: translate(-50%, 11px) scale(.55); opacity: 0; }
  18%  { opacity: 1; }
  100% { transform: translate(-50%, -14px) scale(1); opacity: 0; }
}
@keyframes wind-halo {
  0%, 100% { transform: scale(.86); opacity: .45; }
  50%      { transform: scale(1.08); opacity: .95; }
}
@media (prefers-reduced-motion: reduce) {
  .wind-marker__particle { animation-duration: 6s; }
  .wind-marker__halo { animation: none; }
}

/* Loading/interactive niceties */
.layer-item, .Btn, .menu-open-btn, .menu-close-btn, .visitor-numbers > div { will-change: transform; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Responsive */
@media (max-width: 900px) {
  #dashboard { width: 320px; }
  #notice { left: 16px; right: 16px; max-width: none; }
}
@media (max-width: 640px) {
  #dashboard { width: min(86vw, 340px); padding: 10px; }
  .menu-open-btn { top: 12px; left: 12px; width: 44px; height: 44px; }
  .Btn { top: 12px; right: 12px; }
  #map-ui { top: 66px !important; right: 12px !important; }
  #notice { bottom: 12px; left: 12px; right: 12px; }
  .visitor-numbers h2 { font-size: 13px; }
}/* Top-center weather widget */
.weather-top {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  width: min(720px, calc(100vw - 420px));
  min-width: 340px;
}
.weather-top__main {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 18px;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 14px 36px rgba(15,23,42,.16);
  cursor: pointer;
  text-align: left;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.weather-top__main:hover { transform: translateY(-1px); box-shadow: 0 18px 42px rgba(15,23,42,.2); border-color: rgba(147,197,253,.7); }
.weather-top__main:focus-visible { outline: 3px solid rgba(59,130,246,.35); outline-offset: 2px; }
.weather-top__icon { width: 64px; height: 56px; position: relative; flex: 0 0 64px; }
.weather-top__info { flex: 1; min-width: 0; }
.weather-top__title { font-size: 11px; font-weight: 800; color: #64748b; text-transform: uppercase; letter-spacing: .06em; }
.weather-top__temp { font-size: 28px; font-weight: 800; line-height: 1.05; color: #0f172a; letter-spacing: -.03em; margin: 2px 0; }
.weather-top__range { font-size: 13px; font-weight: 600; color: #64748b; margin-left: 6px; letter-spacing: normal; }
.weather-top__desc { font-size: 13px; font-weight: 600; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.weather-top__meta { display: flex; gap: 8px; align-items: center; }
.weather-meta-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px;
  background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 999px;
  font-size: 12px; font-weight: 700; color: #334155; white-space: nowrap;
}
.weather-meta-chip i { color: #2563eb; font-size: 12px; }
.weather-top__chevron { color: #64748b; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; transition: transform .22s ease, background .22s ease; }
.weather-top.open .weather-top__chevron { transform: rotate(180deg); background: #eff6ff; color: #2563eb; }
.weather-top__details {
  max-height: 0; overflow: hidden; opacity: 0; transform: translateY(-6px);
  transition: max-height .28s ease, opacity .22s ease, transform .22s ease;
}
.weather-top.open .weather-top__details { max-height: 220px; opacity: 1; transform: translateY(0); }
.weather-detail-grid {
  margin-top: 8px; padding: 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  background: rgba(255,255,255,.9); backdrop-filter: blur(14px); border: 1px solid rgba(255,255,255,.72);
  border-radius: 16px; box-shadow: 0 12px 28px rgba(15,23,42,.12);
}
.weather-detail {
  display: flex; align-items: center; gap: 10px; padding: 10px 10px; background: #f8fafc;
  border: 1px solid #e8eef5; border-radius: 12px;
}
.weather-detail i { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: #eff6ff; color: #2563eb; font-size: 13px; }
.weather-detail small { display: block; font-size: 10px; color: #64748b; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.weather-detail strong { font-size: 13px; color: #0f172a; }

/* Animated weather icons */
.weather-anim span { position: absolute; display: block; }
.wa-sun {
  width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #fde68a, #f59e0b);
  left: 8px; top: 6px; box-shadow: 0 0 0 6px rgba(251,191,36,.18);
  animation: waSpin 10s linear infinite;
}
.wa-sun::after {
  content:''; position:absolute; inset:-6px; border-radius:50%;
  background: conic-gradient(from 0deg, rgba(251,191,36,.0) 0 10deg, rgba(251,191,36,.55) 10deg 20deg, rgba(251,191,36,0) 20deg 45deg, rgba(251,191,36,.55) 45deg 55deg, rgba(251,191,36,0) 55deg 90deg, rgba(251,191,36,.55) 90deg 100deg, rgba(251,191,36,0) 100deg 135deg, rgba(251,191,36,.55) 135deg 145deg, rgba(251,191,36,0) 145deg 180deg, rgba(251,191,36,.55) 180deg 190deg, rgba(251,191,36,0) 190deg 225deg, rgba(251,191,36,.55) 225deg 235deg, rgba(251,191,36,0) 235deg 270deg, rgba(251,191,36,.55) 270deg 280deg, rgba(251,191,36,0) 280deg 315deg, rgba(251,191,36,.55) 315deg 325deg, rgba(251,191,36,0) 325deg 360deg);
  -webkit-mask: radial-gradient(circle, transparent 58%, #000 60%);
  mask: radial-gradient(circle, transparent 58%, #000 60%);
}
.wa-moon { width: 24px; height: 24px; border-radius: 50%; background: transparent; box-shadow: inset -8px -2px 0 0 #cbd5e1; left: 10px; top: 8px; opacity: 0; }
.wa-cloud {
  width: 42px; height: 16px; background: linear-gradient(180deg,#fff,#dbeafe); border-radius: 20px; left: 14px; top: 28px;
  box-shadow: 0 4px 10px rgba(148,163,184,.25);
}
.wa-cloud::before, .wa-cloud::after { content:''; position:absolute; background: inherit; border-radius: 50%; }
.wa-cloud::before { width: 20px; height: 20px; left: 6px; top: -10px; }
.wa-cloud::after { width: 16px; height: 16px; left: 22px; top: -7px; }
.wa-cloud--back { transform: scale(.8); left: 6px; top: 24px; opacity: .7; filter: blur(.2px); }
.weather-anim--clear .wa-cloud, .weather-anim--clear .wa-cloud--back,
.weather-anim--clear .wa-rain, .weather-anim--clear .wa-bolt, .weather-anim--clear .wa-snow, .weather-anim--clear .wa-mist, .weather-anim--clear .wa-moon { opacity: 0; }
.weather-anim--clear .wa-sun { animation: waSpin 12s linear infinite, waPulse 2.8s ease-in-out infinite; }
.weather-anim--clear-night .wa-sun, .weather-anim--clear-night .wa-cloud, .weather-anim--clear-night .wa-cloud--back,
.weather-anim--clear-night .wa-rain, .weather-anim--clear-night .wa-bolt, .weather-anim--clear-night .wa-snow, .weather-anim--clear-night .wa-mist { opacity: 0; }
.weather-anim--clear-night .wa-moon { opacity: 1; animation: waFloat 4s ease-in-out infinite; box-shadow: inset -8px -2px 0 0 #e2e8f0, 0 0 14px rgba(226,232,240,.35); }
.weather-anim--partly-cloudy .wa-sun { left: 4px; top: 2px; transform: scale(.85); }
.weather-anim--partly-cloudy .wa-cloud { animation: waFloat 4s ease-in-out infinite; }
.weather-anim--partly-cloudy .wa-rain, .weather-anim--partly-cloudy .wa-bolt, .weather-anim--partly-cloudy .wa-snow, .weather-anim--partly-cloudy .wa-mist, .weather-anim--partly-cloudy .wa-moon { opacity: 0; }
.weather-anim--cloudy .wa-sun, .weather-anim--cloudy .wa-rain, .weather-anim--cloudy .wa-bolt, .weather-anim--cloudy .wa-snow, .weather-anim--cloudy .wa-mist, .weather-anim--cloudy .wa-moon { opacity: 0; }
.weather-anim--cloudy .wa-cloud { left: 16px; animation: waFloat 4.5s ease-in-out infinite; }
.weather-anim--cloudy .wa-cloud--back { left: 6px; animation: waFloat 4.5s ease-in-out infinite reverse; }
.wa-rain, .wa-snow { left: 24px; top: 42px; width: 30px; height: 18px; opacity: 0; }
.wa-rain i, .wa-snow i { position:absolute; width:2px; height:8px; background:#60a5fa; border-radius:2px; animation: waRain 1s linear infinite; }
.wa-rain i:nth-child(2), .wa-snow i:nth-child(2) { left: 9px; animation-delay: .2s; }
.wa-rain i:nth-child(3), .wa-snow i:nth-child(3) { left: 18px; animation-delay: .4s; }
.weather-anim--rain .wa-sun, .weather-anim--rain .wa-bolt, .weather-anim--rain .wa-snow, .weather-anim--rain .wa-mist, .weather-anim--rain .wa-moon { opacity: 0; }
.weather-anim--rain .wa-rain { opacity: 1; }
.weather-anim--rain .wa-cloud { animation: waFloat 3s ease-in-out infinite; }
.wa-bolt { left: 33px; top: 40px; width: 10px; height: 16px; background: #fbbf24; clip-path: polygon(40% 0,100% 0,60% 45%,100% 45%,20% 100%,45% 55%,0 55%); opacity: 0; }
.weather-anim--storm .wa-sun, .weather-anim--storm .wa-snow, .weather-anim--storm .wa-mist, .weather-anim--storm .wa-moon { opacity: 0; }
.weather-anim--storm .wa-rain { opacity: 1; }
.weather-anim--storm .wa-rain i { background: #93c5fd; }
.weather-anim--storm .wa-bolt { opacity: 1; animation: waFlash 1.8s ease-in-out infinite; }
.weather-anim--storm .wa-cloud { filter: saturate(.8) brightness(.95); animation: waFloat 2.5s ease-in-out infinite; }
.weather-anim--snow .wa-sun, .weather-anim--snow .wa-rain, .weather-anim--snow .wa-bolt, .weather-anim--snow .wa-mist, .weather-anim--snow .wa-moon { opacity: 0; }
.weather-anim--snow .wa-snow { opacity: 1; }
.weather-anim--snow .wa-snow i { width: 5px; height: 5px; border-radius: 50%; background: #bfdbfe; animation: waSnow 2.2s linear infinite; }
.wa-mist { left: 18px; top: 42px; width: 34px; height: 14px; opacity: 0; }
.wa-mist i { position:absolute; left:0; width: 34px; height: 2px; background: #94a3b8; border-radius: 2px; animation: waMist 2.4s ease-in-out infinite; }
.wa-mist i:nth-child(2) { top: 5px; width: 28px; left: 3px; animation-delay: .3s; }
.wa-mist i:nth-child(3) { top: 10px; width: 30px; left: 1px; animation-delay: .6s; }
.weather-anim--mist .wa-sun, .weather-anim--mist .wa-rain, .weather-anim--mist .wa-bolt, .weather-anim--mist .wa-snow, .weather-anim--mist .wa-moon { opacity: 0; }
.weather-anim--mist .wa-mist { opacity: 1; }
.weather-anim--mist .wa-cloud { opacity: .75; top: 24px; }

@keyframes waSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes waPulse { 0%,100% { box-shadow: 0 0 0 6px rgba(251,191,36,.18); } 50% { box-shadow: 0 0 0 10px rgba(251,191,36,.12); } }
@keyframes waFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes waRain { 0% { transform: translateY(-2px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(10px); opacity: 0; } }
@keyframes waSnow { 0% { transform: translateY(-2px) translateX(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(10px) translateX(3px); opacity: 0; } }
@keyframes waFlash { 0%,45%,55%,100% { opacity: 0; } 48%,52% { opacity: 1; } }
@keyframes waMist { 0%,100% { transform: translateX(0); opacity: .5; } 50% { transform: translateX(3px); opacity: 1; } }

@media (max-width: 1100px) {
  .weather-top { width: min(620px, calc(100vw - 360px)); }
  .weather-top__meta { display: none; }
}
@media (max-width: 900px) {
  .weather-top { width: calc(100vw - 32px); min-width: 0; top: 68px; }
  #map-ui { top: 136px !important; }
}
@media (max-width: 640px) {
  .weather-top { top: 64px; width: calc(100vw - 24px); }
  .weather-top__main { padding: 10px 12px; gap: 10px; border-radius: 16px; }
  .weather-top__icon { width: 56px; height: 52px; flex-basis: 56px; transform: scale(.92); transform-origin: left center; }
  .weather-top__temp { font-size: 24px; }
  .weather-top__range { display: block; margin-left: 0; font-size: 12px; }
  .weather-top__chevron { width: 24px; }
  .weather-detail-grid { grid-template-columns: repeat(2, 1fr); }
  #map-ui { top: 132px !important; right: 12px !important; }
}
/* Tide schedule widget */
.tide-widget__head { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:10px; }
.tide-widget__head b { font-size:14px; color:#0f172a; }
.tide-schedule-btn {
  border:1px solid #bfdbfe; background:#eff6ff; color:#1d4ed8; font-size:12px; font-weight:700;
  padding:7px 10px; border-radius:10px; cursor:pointer; white-space:nowrap; transition:all .2s ease;
}
.tide-schedule-btn:hover,.tide-schedule-btn[aria-expanded="true"] { background:#dbeafe; border-color:#93c5fd; }
.tide-col-title { font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.04em; color:#475569; margin-bottom:8px; }
.tide-col-title i { margin-right:4px; }
.tide-high .tide-col-title i { color:#0284c7; }
.tide-low .tide-col-title i { color:#ea580c; }
.tide-row { display:flex; flex-direction:column; gap:1px; padding:7px 0; border-top:1px dashed #e2e8f0; }
.tide-row:first-of-type { border-top:0; padding-top:0; }
.tide-row__time { font-size:13px; font-weight:800; color:#0f172a; }
.tide-row__height { font-size:12px; color:#475569; font-weight:600; }
.tide-row__height small { color:#64748b; font-weight:500; }
.tide-row--empty { font-size:12px; color:#94a3b8; border-top:0; }
.tide-schedule { max-height:0; overflow:hidden; opacity:0; transition:max-height .28s ease, opacity .22s ease; }
.tide-schedule.open { max-height:520px; opacity:1; margin-top:10px; overflow:auto; padding-right:2px; }
.tide-schedule__title { font-size:11px; font-weight:800; color:#64748b; text-transform:uppercase; letter-spacing:.05em; margin-bottom:8px; }
.tide-day { background:#f8fafc; border:1px solid #e8eef5; border-radius:12px; padding:10px; margin-bottom:8px; }
.tide-day__date { font-size:12px; font-weight:800; color:#1e293b; margin-bottom:8px; }
.tide-day__rows { display:flex; flex-direction:column; gap:6px; }
.tide-event { display:grid; grid-template-columns:62px 1fr auto; gap:8px; align-items:center; font-size:12px; padding:6px 8px; border-radius:8px; background:#fff; border:1px solid #edf2f7; }
.tide-event__type { font-weight:700; }
.tide-event--high .tide-event__type { color:#0284c7; }
.tide-event--low .tide-event__type { color:#ea580c; }
.tide-event__time { font-weight:700; color:#334155; }
.tide-event__height { color:#64748b; font-weight:600; }
.tide-source { font-size:11px; color:#64748b; text-align:right; margin-top:4px; }
.tide-day__empty { font-size:12px; color:#94a3b8; padding:8px 0; }
@media (max-width:640px){ .tide-event{ grid-template-columns:58px 1fr auto; font-size:11px; } }
