* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #0f1419;
}
#map { position: absolute; inset: 0; background: #0f1419; }
[hidden] { display: none !important; }
/* Same as the CR app: GoogleMutant moves Google's credits into the attribution box
   and its logo into the bottom-left corner, and both stay hidden */
.leaflet-control-attribution,
.leaflet-bottom.leaflet-left { display: none; }

/* ===== Toolbar: report button + zoom (hazard-report-control.php, zoom-control.php) ===== */
.left-stack {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.map-pill {
  display: flex;
  align-items: center;
  padding: 4px 6px;
  background: #1d232a;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
}
.map-pill button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background: none;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}
.map-pill button:hover { background: rgba(255, 255, 255, 0.1); }
.report-hazard-control {
  position: absolute;
  top: 12px; left: 50%;
  z-index: 1000;
  transform: translateX(-50%);
}
#cr-hazard-report { gap: 8px; padding: 6px 12px; color: #fff; font: inherit; font-size: 15px; font-weight: 600; }
#cr-hazard-report svg { width: 22px; height: 22px; fill: none; stroke: #f97316; }
.zoom-control { justify-content: space-between; width: 80px; }
.zoom-control svg { width: 16px; height: 16px; fill: #fff; }

/* ===== Hazard markers + popups (crboatapp src/index.css) ===== */
.cr-hazard-icon { background: none; border: 0; }
.lightning-icon { background: none; border: 0; filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.8)); }
.leaflet-popup .leaflet-popup-content-wrapper {
  padding: 12px 14px;
  color: #fff;
  background-color: #151515;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
}
.leaflet-popup .leaflet-popup-content { margin: 0; color: #fff; }
.leaflet-popup .leaflet-popup-tip { background-color: #151515; }
.leaflet-container a.leaflet-popup-close-button { top: 4px; right: 4px; color: rgba(255, 255, 255, 0.7); }
.leaflet-container a.leaflet-popup-close-button:hover { color: #fff; }
.dark-background-popup { min-width: 175px; }
.dark-background-popup hr { margin: 6px 0; border: none; border-top: 1px solid rgba(255, 255, 255, 0.15); }
.dark-background-popup strong { display: block; padding-top: 4px; }
.dark-background-popup__label {
  margin: 4px 0;
  font-size: 0.85em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.6;
}
.popup-row { margin-top: 2px; white-space: nowrap; }
.dark-background-popup__coords { margin-bottom: 6px; font-size: 0.9em; color: rgba(255, 255, 255, 0.55); }
.popup-description { margin-top: 4px; }

/* ===== Report Hazard dialog (hazard-report-button.ts Tailwind classes) ===== */
.report-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
}
.report-panel {
  width: 320px;
  max-width: 90vw;
  padding: 16px;
  background: #1e293b;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
.report-stack > * + * { margin-top: 8px; }
.report-title { margin: 0; color: #fff; font-size: 14px; font-weight: 700; }
.report-field {
  display: block;
  width: 100%;
  padding: 4px 8px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  font: inherit;
  font-size: 14px;
  outline: none;
}
.report-field:focus { border-color: rgba(255, 255, 255, 0.5); }
.report-select { background: #334155; cursor: pointer; }
.report-notes { background: rgba(255, 255, 255, 0.1); resize: none; }
.report-notes::placeholder { color: rgba(255, 255, 255, 0.4); }
.report-location { color: rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.1); cursor: not-allowed; }
.report-caption { margin-bottom: 2px; font-size: 10px; color: rgba(255, 255, 255, 0.5); }
.report-error { margin-top: 4px; font-size: 12px; color: #fca5a5; }
.report-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.report-btn {
  padding: 4px 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 0;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}
.report-btn:hover { background: rgba(255, 255, 255, 0.2); }
.report-btn-primary { background: rgba(255, 255, 255, 0.2); font-weight: 600; }
.report-btn-primary:hover { background: rgba(255, 255, 255, 0.3); }

/* ===== Toast (crboatapp src/index.css) ===== */
.cr-toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  z-index: 1102;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}
.cr-toast {
  position: relative;
  min-width: 250px;
  max-width: calc(100vw - 32px);
  padding: 8px 26px 8px 8px;
  color: #fff;
  background-color: rgba(29, 35, 42, 0.95);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.2;
  text-align: center;
  pointer-events: auto;
}
.cr-toast-dismiss {
  position: absolute;
  top: 4px; right: 6px;
  padding: 2px 4px;
  color: rgba(255, 255, 255, 0.6);
  background: transparent;
  border: none;
  font-size: 18px;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
}
.cr-toast-dismiss:hover { color: #fff; }

/* The app hides its zoom pill below md too; pinch to zoom instead */
@media (max-width: 700px) {
  .zoom-control { display: none; }
  .cr-toast-container { bottom: 16px; }
}

/* ===== Demo boat (crboatapp src/index.css boat icon + boats-ui popup) ===== */
.cr-boat-icon {
  width: 22px !important;
  height: 65px !important;
  margin-left: -11px !important;
  margin-top: -25px !important;
  overflow: visible !important;
  background: none !important;
}
.popup-header { display: flex; align-items: center; }
.popup-header-bar { display: inline-block; flex-shrink: 0; width: 4px; height: 20px; margin-right: 8px; border-radius: 2px; }
.popup-header-name { font-size: 14px; font-weight: 700; white-space: nowrap; }
.popup-time { color: rgba(255, 255, 255, 0.6); font-size: 11px; }
.popup-bold { font-weight: 700; }
.leaflet-popup.cr-boat-popup .leaflet-popup-content { min-width: 200px; }
