:root {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
  font-size: 16px;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-size: 16px;
  line-height: 1.5;
}

/* ========= Base (shared) ========= */

#status {
  font-size: 14px;
  color: #555;
}

.hidden,
.filters-panel.hidden {
  display: none !important;
}

/* ---------- Toast (inline guidance) ---------- */
.toast {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
  max-width: min(620px, 100%);
  margin-left: 10px;
}

.toast-msg {
  color: #222;
  font-size: 14px;
  line-height: 1.2;
}

.toast-action {
  border: none;
  background: #111;
  color: #fff;
  border-radius: 999px;
  padding: 8px 10px;
  font-weight: 700;
  cursor: pointer;
}

.toast-close {
  border: none;
  background: transparent;
  color: #666;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

/* Small “x” icon button used in modals */
.icon-btn {
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  color: #444;
}

/* Manual location coordinate row */
.coord-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
}

.coord-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 150px;
}

.coord-field span {
  font-size: 14px;
  color: #666;
}

.coord-field input {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  font-size: 14px;
}

.error {
  font-size: 14px;
  color: #b00020;
}

.section-title {
  margin: 14px 0 8px;
  font-size: 16px;
}

/* Form controls */
select,
textarea,
input[type="text"],
input[list] {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #ccc;
  font-size: 16px;
  line-height: 1.35;
}

textarea {
  resize: vertical;
  min-height: 44px;
}

.form-row {
  display: grid;
  gap: 6px;
}

.form-row > span {
  font-size: 14px;
  color: #555;
}

.fieldset {
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.fieldset legend {
  font-size: 14px;
  color: #555;
  padding: 0 6px;
}

.fieldset-title {
  font-size: 14px;
  color: #555;
  font-weight: 600;
}

.fieldset.field legend {
  padding: 0 6px;
  font-weight: 700;
}

.check,
.radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
  z-index: 2000;
  padding: 16px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  padding: 0;
  border-radius: 18px;
  width: min(100%, 420px);
  max-width: 420px;
  max-height: calc(100dvh - 24px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  box-sizing: border-box;
}

@supports not (height: 100dvh) {
  .modal-content {
    max-height: calc(100vh - 24px);
  }
}

.modal-content h3 {
  margin: 0;
  font-size: 16px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-actions button {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d0d0d0;
  background: white;
  cursor: pointer;
  min-height: 44px;
}

/* ========= MOBILE-FIRST LAYOUT ========= */
/* Your current mobile HTML uses: <main class="layout layout--mobile"> */

.layout--mobile {
  position: relative;
  height: 100dvh;
  min-height: 100dvh;
  width: 100%;
  overflow: hidden;
}

/* Fallback for older browsers */
@supports not (height: 100dvh) {
  .layout--mobile {
    height: 100vh;
    min-height: 100vh;
  }
}

/* Map occupies full screen on mobile */
.layout--mobile #map {
  height: 100%;
  width: 100%;
  min-height: 100%;
}

/* On mobile, hide the top header (FABs take over) */
header {
  display: none;
}


.map-app-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  min-height: 64px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1550;
  background: #ffffff;
  color: #111;
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  border-radius: 0;
  pointer-events: none;
}

.map-app-banner__action {
  margin-left: auto;
  pointer-events: auto;
  flex: 0 0 auto;
}

.map-app-banner__logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.map-app-banner__title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.1;
}

/* Floating Action Buttons */
.fab-stack {
  position: fixed;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1500;
}


.fab-stack--top {
  right: calc(12px + env(safe-area-inset-right));
  top: calc(80px + env(safe-area-inset-top));
  align-items: flex-end;
  gap: 10px;
}


.fab-stack--bottom {
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom));
  width: calc(100vw - 24px);
  max-width: 520px;
  align-items: stretch;
  gap: 12px;
}

/* Bottom buttons: larger and full-width */
.fab-stack--bottom .fab {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 14px;
}

/* Top recenter button: clearer, not full-width */
#btnLocateFab,
#btnPredatorSafetyTips,
#btnEnableAlertsFab {
  min-width: 190px;
}

.fab-stack--top .fab {
  border-radius: 16px;
}

/* Base FAB style */
.fab {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 650;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  background: #fff;
  cursor: pointer;
}

.fab:active {
  transform: translateY(1px);
}

.fab--secondary {
  opacity: 0.95;
}

/* Alerts bell FAB */
.fab--alert {
  min-height: 0;
  padding: 10px 14px;
  border-radius: 999px;
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #ffffff;
}

.fab--alert svg {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
}

.fab--alert .fab__label {
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.fab--alert-off {
  background: #6b7280;
}

.fab--alert-off:hover {
  background: #4b5563;
}

.fab--alert-on {
  background: #c62828;
}

.fab--alert-on:hover {
  background: #b71c1c;
}

.fab--alert:active {
  transform: translateY(1px);
}

/* Bottom sheet */
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1400;
  background: #fff;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.18);
  height: 44vh;
  max-height: 78vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}

.sheet-handle {
  width: 46px;
  height: 5px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  margin: 10px auto 6px;
  flex: 0 0 auto;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  flex: 0 0 auto;
}

.sheet-title {
  font-size: 16px;
  margin: 0;
}

.sheet-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  font-weight: 700;
  padding: 6px 10px;
  cursor: pointer;
}

/* Your HTML does not wrap content in .sheet-content, so let the main body scroll */
.sheet > *:not(.sheet-handle):not(.sheet-header) {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.sheet-content {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Filters section */
.filters-wrap,
.sheet-section,
.filters-panel {
  padding: 10px 14px;
}

.filters-wrap > summary {
  cursor: pointer;
  font-weight: 700;
  margin-bottom: 10px;
}

.filters,
.filters-panel {
  display: grid;
  gap: 10px;
  margin: 0;
}

.filter-group {
  display: grid;
  gap: 6px;
}

.filter-group-title {
  font-size: 12px;
  font-weight: 700;
  color: #555;
}

.filter {
  display: grid;
  gap: 6px;
}

.filter span {
  font-size: 14px;
  color: #555;
}

.filters select,
.filters-panel select {
  width: 100%;
  height: 44px;
  border-radius: 12px;
  border: 1px solid #d0d0d0;
  background: white;
  font-size: 16px;
}

#btnResetFilters {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #d0d0d0;
  background: white;
  cursor: pointer;
  font-size: 14px;
}

#btnApplyFilters {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--color-action, #2e7d32);
  background: var(--color-action, #2e7d32);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}

.filter-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* Lists */
.tag-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.tag-item {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}

#tagPhotoPreview {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

#btnClearPhoto {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #d0d0d0;
  background: white;
  cursor: pointer;
  font-size: 14px;
}

.tag-title {
  font-size: 16px;
  font-weight: 650;
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.tag-title__category {
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
}

.tag-meta {
  font-size: 14px;
  color: #555;
}

.tag-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.tag-actions button {
  height: 38px;
  padding: 0 12px;
  border: 1px solid #d0d0d0;
  background: white;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
}

.tag-actions button:active {
  transform: translateY(1px);
}

/* Wildlife panel overlay */
.panel {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 3000;
  display: grid;
  place-items: end center;
  padding: 10px;
}

.panel.hidden {
  display: none;
}

.panel-card {
  width: min(100%, 520px);
  max-width: 520px;
  max-height: min(88dvh, 900px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  box-sizing: border-box;
}

@supports not (height: 100dvh) {
  .panel-card {
    max-height: 88vh;
  }
}

.panel-title {
  margin: 0;
  font-size: 16px;
}

.panel-close {
  appearance: none;
  border: 0;
  background: transparent;
  font-weight: 800;
  padding: 6px 10px;
  cursor: pointer;
}

.panel-content {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 14px 18px;
}

.panel-section {
  margin-top: 12px;
}

/* Notification settings UI */
.panel-body {
  padding: 12px 4px 4px;
}

.field {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.field > span,
.muted {
  font-size: 14px;
  opacity: 0.85;
}

.toggle-row,
.check-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 8px 0;
}

.toggle-row input,
.check-row input {
  transform: scale(1.1);
}

fieldset.field {
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  padding: 10px;
}

/* Notification on/off button */
.notif-toggle-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 12px;
  font-weight: 800;
  cursor: pointer;
  min-width: 170px;
}

.notif-toggle-btn.is-off {
  background: #b42318;
  color: #fff;
}

.notif-toggle-btn.is-on {
  background: #0e8a3a;
  color: #fff;
}

.notif-toggle-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.notif-help-text {
  display: block;
  margin-top: 8px;
  font-size: 0.9rem;
  opacity: 0.85;
  max-width: 320px;
}

.form-label-strong {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

.inline-field {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.inline-field .form-label-strong {
  margin-bottom: 0;
}

.inline-field select {
  width: auto;
  min-width: 120px;
}

.toggle-row select {
  margin-top: 0;
}

/* Leaflet zoom controls: positioned under recenter+bell */
@media (max-width: 899px) {
  .leaflet-top.leaflet-right {
    right: calc(12px + env(safe-area-inset-right));
    top: calc(12px + env(safe-area-inset-top) + 120px);
    margin-right: 0;
  }
}

.mini-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mini-title {
  font-weight: 800;
  font-size: 16px;
  line-height: 1.2;
}

.mini-close {
  border: 0;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
}

.mini-meta {
  margin-top: 6px;
  opacity: 0.75;
  font-size: 14px;
}

.mini-desc {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.mini-img {
  width: 100%;
  max-width: 340px;
  margin-top: 10px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.leaflet-popup-content {
  margin: 12px 14px;
  font-size: 15px;
  line-height: 1.45;
}

.leaflet-popup-close-button {
  font-size: 18px;
  padding: 6px 10px 0 0;
  color: rgba(0, 0, 0, 0.65);
}

.leaflet-popup-close-button:hover {
  color: rgba(0, 0, 0, 0.9);
}

#btnCancelTag {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #d0d0d0;
  background: #fff;
  color: #333;
  cursor: pointer;
  font-size: 14px;
}

#btnCancelTag:hover {
  background: #f5f5f5;
}

.panel-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: #111;
  font-size: 24px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 10px;
}

.panel-close:hover {
  background: rgba(0, 0, 0, 0.06);
}

/* In-app banner shown when a push alert arrives while the site is open */
.in-app-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  top: 12px;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(25, 25, 28, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  color: #fff;
}

.in-app-banner.hidden {
  display: none;
}

.in-app-banner__content {
  min-width: 0;
}

.in-app-banner__title {
  font-weight: 800;
  font-size: 14px;
  line-height: 1.2;
  color: inherit;
}

.in-app-banner__body {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.25;
  opacity: 0.9;
  color: inherit;
}

.in-app-banner__close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
}

/* Notification flow buttons */
#btnEnableAlerts {
  padding: 8px 10px;
  border: 1px solid #c62828;
  background: #c62828;
  color: #ffffff;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

#btnEnableAlerts:hover {
  filter: brightness(0.95);
}

#btnEnableAlerts:active {
  transform: translateY(1px);
}

#btnTestNotif,
.filter-actions #btnTestNotif {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #d0d0d0;
  background: white;
  cursor: pointer;
  font-size: 14px;
}

#btnSaveNotif,
.filter-actions #btnSaveNotif {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--color-action, #2e7d32);
  background: var(--color-action, #2e7d32);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}

#btnTestNotif:active,
#btnSaveNotif:active {
  transform: translateY(1px);
}

/* Wildlife info UI should never be covered by Leaflet zoom controls */
.leaflet-popup-pane {
  z-index: 3000 !important;
}

.leaflet-control-container,
.leaflet-control {
  z-index: 2000 !important;
}

#tagInfoOverlay {
  position: fixed;
  z-index: 4000;
  top: calc(86px + env(safe-area-inset-top));
  right: calc(12px + env(safe-area-inset-right) + 62px);
  max-width: min(360px, calc(100vw - 24px - 62px));
}

#tagInfoOverlay .mini-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 12px;
}

.leaflet-popup {
  z-index: 3001 !important;
}

/* Map quick stats */
.map-quick-stats {
  text-align: left;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15);
  padding: 10px 12px;
  cursor: pointer;
}

.fab-stack--bottom .map-quick-stats {
  width: 100%;
}

.map-quick-stats__top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: start;
}

.map-quick-stats__label {
  font-size: 12px;
  opacity: 0.75;
  line-height: 1.1;
}

.map-quick-stats__value {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  margin-top: 2px;
}


.map-quick-stats__cta {
  margin-top: 10px;
  display:flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  font-weight:700;
}


.map-quick-stats__badge {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.map-quick-stats__badge--new {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.32);
}

.map-quick-stats__badge--ok {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.28);
}

.map-quick-stats__ctaText {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.map-quick-stats__sub {
  margin-top: 3px;
  font-size: 11px;
  font-weight: 600;
  opacity: 0.88;
}

/* Sort chips */
/* sort-chips layout moved to bottom of file (Medium/Low UX improvements) */

.chip {
  width: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  line-height: 1.2;
}



.chip.is-selected {
  background: #c62828;
  border-color: #c62828;
  color: #fff;
}

.chip.is-selected:hover {
  background: #b71c1c;
  border-color: #b71c1c;
}

.chip.is-selected:focus-visible {
  outline: 2px solid rgba(198, 40, 40, 0.45);
}

.chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ===== Predator Safety Tips ===== */

.predator-safety-modal {
  max-width: 520px;
  display: grid;
  gap: 14px;
}


.predator-safety-intro {
  margin: 0;
  font-size: 14px;
  color: #333;
  line-height: 1.45;
}

.predator-safety-updated {
  font-size: 12px;
  color: #555;
}

.predator-safety-card {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  display: grid;
  gap: 10px;
}

.predator-safety-card__header {
  display: grid;
  gap: 6px;
}

.predator-safety-card__header h4 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.predator-safety-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.predator-safety-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
}

.predator-safety-list li {
  color: #111;
  line-height: 1.45;
}

.predator-safety-list--immediate li {
  font-weight: 700;
}

.predator-safety-sources {
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.predator-safety-sources strong {
  display: block;
  margin-bottom: 2px;
}

.predator-safety-sources a {
  color: #0b57d0;
  text-decoration: none;
}

.predator-safety-sources a:hover {
  text-decoration: underline;
}

/* Global sizing */
*,
*::before,
*::after {
  box-sizing: border-box;
}

input[type="text"],
input[list],
input[type="number"],
input[type="email"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="file"],
select,
textarea {
  width: 100%;
  max-width: 100%;
}

button {
  max-width: 100%;
}

/* ========= DESKTOP OVERRIDE ========= */
@media (min-width: 900px) {
  html,
  body {
    height: 100%;
    margin: 0;
    overflow: hidden;
  }

  body {
    display: grid;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
  }

  header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 20px;
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 1600;
  }

  header .controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }

  .layout,
  .layout--mobile {
    width: 100vw;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    position: relative;
  }

  #map,
  .layout--mobile #map {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
  }

  /* Desktop now uses the in-map banner instead of the older header bar. */
  header {
    display: none;
  }

  body {
    display: block;
    min-height: 100vh;
  }

  .layout,
  .layout--mobile {
    height: 100vh;
  }

  .map-app-banner {
    display: flex;
  }

  .fab-stack--top {
    top: calc(84px + env(safe-area-inset-top));
  }

  .fab-stack--bottom {
    left: auto;
    right: 20px;
    transform: none;
    width: 360px;
    max-width: none;
    bottom: 20px;
  }

  .panel {
    place-items: center end;
    padding: 20px;
  }

  .panel-card {
    width: min(720px, calc(100vw - 40px));
    max-width: 720px;
    max-height: calc(100vh - 40px);
    border-radius: 20px;
  }

  #tagInfoOverlay {
    top: 20px;
    right: 20px;
    max-width: 380px;
  }
}

.check input,
.radio input,
.toggle-row input,
.check-row input {
  width: auto;
  max-width: none;
  margin: 0;
  flex: 0 0 auto;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

input[type="text"],
input[list],
input[type="number"],
input[type="email"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="file"],
select,
textarea {
  width: 100%;
  max-width: 100%;
}

.check input,
.radio input,
.toggle-row input,
.check-row input {
  width: auto;
  max-width: none;
  margin: 0;
  flex: 0 0 auto;
}

button {
  max-width: 100%;
}

textarea {
  resize: vertical;
  min-height: 44px;
}

.chip--filters {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.filter-summary {
  padding: 0 14px 10px;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.chip.has-active-filters {
  background: #c62828;
  border-color: #c62828;
  color: #fff;
}

.chip.has-active-filters:hover {
  background: #b71c1c;
  border-color: #b71c1c;
}

.photo-upload-row {
  gap: 10px;
}

.photo-upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.photo-upload-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(247,249,252,1) 100%);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.06),
    0 8px 24px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.photo-upload-trigger:active {
  transform: scale(0.985);
}

.photo-upload-trigger:hover {
  border-color: rgba(0, 0, 0, 0.14);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.08),
    0 12px 28px rgba(0, 0, 0, 0.08);
}

.photo-upload-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  font-size: 20px;
  background: linear-gradient(135deg, #eef4ff 0%, #f5f8ff 100%);
  border: 1px solid rgba(65, 105, 225, 0.14);
}

.photo-upload-copy {
  display: grid;
  gap: 2px;
}

.photo-upload-copy strong {
  font-size: 16px;
  line-height: 1.2;
  color: #111;
}

.photo-upload-copy small {
  font-size: 13px;
  line-height: 1.3;
  color: #667085;
}

#tagPhotoPreview {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

#btnClearPhoto {
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
}

#btnClearPhoto:active {
  transform: scale(0.985);
}

@media (max-width: 640px) {
  .photo-upload-trigger {
    min-height: 60px;
    padding: 15px 16px;
    border-radius: 20px;
  }

  .photo-upload-copy strong {
    font-size: 17px;
  }

  .photo-upload-copy small {
    font-size: 14px;
  }

  #btnClearPhoto {
    min-height: 50px;
    font-size: 16px;
  }
}

/* Modal title banners */

.modal-title-banner h2,
.modal-title-banner h3 {
  margin: 0;
  color: white;
}

.modal-title-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  margin: 0;
  padding: 12px 16px;

  background: #c62828;
  color: #fff;

  border-radius: 14px 14px 0 0;
}

.modal-title-banner h2,
.modal-title-banner h3 {
  margin: 0;
  color: #fff;
  font-size: 16px;
  line-height: 1.2;
}

.modal-title-banner .icon-btn,
.modal-title-banner .panel-close {
  color: #fff;
  background: transparent;
}

.modal-title-banner .icon-btn:hover,
.modal-title-banner .panel-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.modal-content h3 {
  margin: 0;
  font-size: 16px;
}

.warning-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 18px;
  height: 18px;

  margin-right: 6px;

  background: #c62828;
  color: #fff;

  font-size: 13px;
  font-weight: 900;

  border-radius: 50%;
}

.modal-body {
  padding: 12px 16px 16px;
}

/* ========= Medium + Low Priority UX Improvements ========= */

/* --- Chip group labels (Sort / Filter) --- */
.sort-chips {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.chip-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 120px;
}

.chip-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  padding-left: 4px;
}

.chip-group-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip-group-row .chip {
  flex: 1;
  min-width: 0;
}

/* --- Inline location hint below disabled Closest chip --- */
.chip-location-hint {
  display: block;
  font-size: 11px;
  color: #888;
  text-align: center;
  margin-top: 2px;
  padding-left: 4px;
}

/* --- Required field note at top of form --- */
.form-required-note {
  margin: 0 0 10px;
  font-size: 12px;
  color: #888;
}

/* --- Predator Safety Tips amber accent --- */
.fab--safety {
  background: #fff8e1;
  border: 1px solid #f9a825;
  color: #5d4037;
}

.fab--safety:hover {
  background: #fff3cd;
  border-color: #f57f17;
}

/* --- Desktop: preserve 5-across chip layout override --- */
@media (min-width: 768px) {
  .sort-chips {
    flex-wrap: nowrap;
  }
  .chip-group {
    flex: 0 0 auto;
  }
}


/* ═══════════════════════════════════════════════════
   COLOR SYSTEM — design tokens + semantic roles
   ═══════════════════════════════════════════════════ */
:root {
  /* Core palette */
  --color-alert:        #c62828;   /* red   — danger, alerts, new sightings */
  --color-alert-hover:  #b71c1c;
  --color-action:       #2e7d32;   /* forest green — save / confirm / create */
  --color-action-hover: #1b5e20;

  /* Category card accents */
  --cat-predator-bg:    #fff5f5;
  --cat-predator-border:#c62828;
  --cat-smelly-bg:      #fffde7;
  --cat-smelly-border:  #f9a825;
  --cat-hooved-bg:      #f1f8e9;
  --cat-hooved-border:  #7cb342;
  --cat-domestic-bg:    #e3f2fd;
  --cat-domestic-border:#1e88e5;
  --cat-livestock-bg:   #fbe9e7;
  --cat-livestock-border:#bf360c;
  --cat-other-bg:       #fafafa;
  --cat-other-border:   #9e9e9e;
}

/* ── Primary action buttons (Save, Confirm) ── */
/* Save tag */
#btnSaveTag {
  background: var(--color-action);
  border: 1px solid var(--color-action);
  color: #fff;
}
#btnSaveTag:hover {
  background: var(--color-action-hover);
  border-color: var(--color-action-hover);
}
#btnSaveTag:active {
  transform: translateY(1px);
}

/* Save notifications */
#btnSaveNotif,
.filter-actions #btnSaveNotif {
  background: var(--color-action);
  border-color: var(--color-action);
  color: #fff;
}
#btnSaveNotif:hover,
.filter-actions #btnSaveNotif:hover {
  background: var(--color-action-hover);
  border-color: var(--color-action-hover);
}

/* ── New Sighting FAB — red, alert-level urgency ── */
.fab--new-sighting {
  background: var(--color-alert) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 999px !important;
  padding: 14px 18px !important;
  font-weight: 700 !important;
  font-size: 16px !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25) !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.fab--new-sighting:hover {
  background: var(--color-alert-hover) !important;
}
.fab--new-sighting:active {
  transform: translateY(1px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}

/* ── Sighting card category tints ──
   Left border accent immediately signals category.
   Subtle background keeps text readable on white.    */
.tag-item.cat--predator {
  background: var(--cat-predator-bg);
  border-left: 4px solid var(--cat-predator-border);
  border-top: 1px solid rgba(198, 40, 40, 0.15);
  border-right: 1px solid rgba(198, 40, 40, 0.10);
  border-bottom: 1px solid rgba(198, 40, 40, 0.15);
}

.tag-item.cat--smelly {
  background: var(--cat-smelly-bg);
  border-left: 4px solid var(--cat-smelly-border);
  border-top: 1px solid rgba(249, 168, 37, 0.18);
  border-right: 1px solid rgba(249, 168, 37, 0.12);
  border-bottom: 1px solid rgba(249, 168, 37, 0.18);
}

.tag-item.cat--hooved {
  background: var(--cat-hooved-bg);
  border-left: 4px solid var(--cat-hooved-border);
  border-top: 1px solid rgba(124, 179, 66, 0.18);
  border-right: 1px solid rgba(124, 179, 66, 0.12);
  border-bottom: 1px solid rgba(124, 179, 66, 0.18);
}

.tag-item.cat--domestic {
  background: var(--cat-domestic-bg);
  border-left: 4px solid var(--cat-domestic-border);
  border-top: 1px solid rgba(30, 136, 229, 0.18);
  border-right: 1px solid rgba(30, 136, 229, 0.12);
  border-bottom: 1px solid rgba(30, 136, 229, 0.18);
}

.tag-item.cat--livestock {
  background: var(--cat-livestock-bg);
  border-left: 4px solid var(--cat-livestock-border);
  border-top: 1px solid rgba(191, 54, 12, 0.15);
  border-right: 1px solid rgba(191, 54, 12, 0.10);
  border-bottom: 1px solid rgba(191, 54, 12, 0.15);
}

.tag-item.cat--other {
  background: var(--cat-other-bg);
  border-left: 4px solid var(--cat-other-border);
}

/* Tag title always black — background box carries the category colour */
.tag-item.cat--predator  .tag-title,
.tag-item.cat--smelly    .tag-title,
.tag-item.cat--hooved    .tag-title,
.tag-item.cat--domestic  .tag-title,
.tag-item.cat--livestock .tag-title,
.tag-item.cat--other     .tag-title { color: #111; }

/* Ensure meta text stays readable on all tinted backgrounds */
.tag-item.cat--predator  .tag-meta,
.tag-item.cat--smelly    .tag-meta,
.tag-item.cat--hooved    .tag-meta,
.tag-item.cat--domestic  .tag-meta,
.tag-item.cat--livestock .tag-meta,
.tag-item.cat--other     .tag-meta {
  color: #555;
}

@media (min-width: 768px) {
  header {
    display: none;
  }

  body {
    display: block;
    min-height: 100vh;
  }

  .layout,
  .layout--mobile {
    height: 100vh;
  }

  .map-app-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    min-height: 64px;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1550;
    background: #ffffff;
    color: #111;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    border-radius: 0;
    pointer-events: none;
  }

  .fab-stack--top {
    right: calc(12px + env(safe-area-inset-right));
    top: calc(84px + env(safe-area-inset-top));
    align-items: flex-end;
    gap: 10px;
  }
}

.cta-pill{
  background: linear-gradient(135deg, var(--color-alert), var(--color-alert-hover));
  color:#fff;
  padding:6px 10px;
  border-radius:10px;
  box-shadow:0 2px 6px rgba(0,0,0,0.18);
}
