/* ═══════════════════════════════════════════════════════════
   MUTUAL AID COLLECTIVE — Stronger Communities Network
   Palette: Fieldteam burgundy · magenta · gold
   Font: Inter (geometric sans)
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── TOKENS ─────────────────────────────────────────────── */
:root {
  /* The burgundy and magenta are fieldteam's, so the map sits in the same
     family as every other public map. The gold stays: it is the Stronger
     Communities / Mutual Aid logo's own colour, not a leftover. The two
     token names that say "navy" are the secondary dark surface and its
     hover -- they were navy blue, which belonged to nothing. */
  --maroon:       #3d1730;   /* brand burgundy -- dominant dark */
  --maroon-dark:  #1a0a13;   /* near-black burgundy for deep panels */
  --maroon-mid:   #55213f;   /* mid burgundy */
  --maroon-light: #8d3c66;   /* lifted burgundy for accents */
  --maroon-pale:  #f8e9f1;   /* very light warm tint */
  --navy:         #35142b;   /* secondary dark surface (panels, popups) */
  --navy-mid:     #6e2b4f;   /* its hover */
  --gold:         #f2c33f;   /* brand gold */
  --gold-dark:    #d9a428;   /* darker gold for hover */
  --pink:         #d6349f;   /* brand magenta */
  --pink-mid:     #e263b8;   /* lighter magenta */
  --mauve:        #b54a9c;   /* mid magenta */
  --white:        #ffffff;
  --off-white:    #f5f5f2;
  --text-light:   #fdf6fa;   /* warm light text */
  --text-muted:   #cd93af;   /* warm muted text */
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.18);
  --shadow-md:    0 4px 20px rgba(0,0,0,0.28);
  --shadow-lg:    0 8px 40px rgba(0,0,0,0.38);
  --radius-sm:    6px;
  --radius-md:    10px;
  --radius-lg:    16px;
  --radius-pill:  999px;
  --font:         'Inter', 'Segoe UI', Arial, sans-serif;
  --transition:   0.18s ease;
}

/* ── RESET ──────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--white);
  background: var(--maroon);
  -webkit-font-smoothing: antialiased;
}

/* ── MAP ────────────────────────────────────────────────── */
#map {
  position: fixed;
  top: 0;
  left: 8px;
  right: 8px;
  bottom: 8px;
  width: auto;
  height: auto;
  z-index: 1;
}

/* ═══════════════════════════════════════════════════════════
   TOP BAR
   ═══════════════════════════════════════════════════════════ */
#top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 24px;
  height: 60px;
  background: var(--maroon);
  border-bottom: 2px solid var(--maroon-light);
  box-shadow: var(--shadow-md);
  backdrop-filter: none;
  overflow: hidden;
}

/* Top bar ambient glow orbs */
.tb-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(38px);
}
.tb-orb-1 {
  width: 260px; height: 110px;
  background: rgba(178,78,151,0.38);
  top: -40px; left: 6%;
  animation: tg1 14s ease-in-out infinite;
}
.tb-orb-2 {
  width: 200px; height: 90px;
  background: rgba(232,182,64,0.22);
  top: -30px; left: 45%;
  animation: tg2 19s ease-in-out infinite;
}
.tb-orb-3 {
  width: 220px; height: 100px;
  background: rgba(192,106,172,0.28);
  top: -35px; right: 12%;
  animation: tg3 16s ease-in-out infinite;
}
@keyframes tg1 { 0%,100%{transform:translateX(0)} 50%{transform:translateX(120px)} }
@keyframes tg2 { 0%,100%{transform:translateX(0)} 40%{transform:translateX(-100px)} 80%{transform:translateX(80px)} }
@keyframes tg3 { 0%,100%{transform:translateX(0)} 50%{transform:translateX(-130px)} }

/* Site branding — left */
#site-title {
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding-right: 24px;
  border-right: 1px solid rgba(255,255,255,0.15);
  margin-right: 24px;
}

.site-logo {
  position: relative;
  isolation: isolate;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.site-logo svg {
  position: absolute;
  top: 0; left: 0;
  mix-blend-mode: screen;
}
@media (prefers-reduced-motion: no-preference) {
  .site-logo svg:nth-child(1) { animation: blob1 5s   ease-in-out infinite; }
  .site-logo svg:nth-child(2) { animation: blob2 6.5s ease-in-out infinite; }
  .site-logo svg:nth-child(3) { animation: blob3 4.8s ease-in-out infinite; }
}
@keyframes blob1 {
  0%,100% { transform: translate(0,0)    rotate(0deg)   scale(1);    }
  33%     { transform: translate(-4px,-5px) rotate(-10deg) scale(1.10); }
  66%     { transform: translate(3px,4px)   rotate(7deg)   scale(0.91); }
}
@keyframes blob2 {
  0%,100% { transform: translate(0,0)    rotate(0deg)   scale(1);    }
  40%     { transform: translate(5px,-4px)  rotate(12deg)  scale(1.08); }
  75%     { transform: translate(-4px,3px)  rotate(-7deg)  scale(0.93); }
}
@keyframes blob3 {
  0%,100% { transform: translate(0,0)    rotate(0deg)   scale(1);    }
  30%     { transform: translate(2px,6px)   rotate(-9deg)  scale(1.12); }
  70%     { transform: translate(4px,-4px)  rotate(9deg)   scale(0.90); }
}

#site-name-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#site-name {
  font-family: var(--font);
  font-size: 17px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.2px;
  line-height: 1.2;
  white-space: nowrap;
}

#site-sub {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.2px;
  margin-top: 1px;
}

#tm-link {
  color: var(--gold);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}
#tm-link:hover { color: var(--white); }

/* Search — centre, grows to fill space */
#search-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--radius-pill);
  padding: 0 16px;
  height: 38px;
  max-width: 480px;
  margin: 0 auto;
  transition: background var(--transition), border-color var(--transition);
}
#search-wrap:focus-within {
  background: rgba(255,255,255,0.16);
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(232,182,64,0.20);
}

#search-icon {
  color: var(--text-muted);
  font-size: 18px;
  margin-right: 8px;
  flex-shrink: 0;
  line-height: 1;
}

#search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 400;
  color: var(--white);
  caret-color: var(--gold);
}
#search-input::placeholder { color: rgba(255,255,255,0.45); }

#search-hint {
  display: none;
}

/* Actions — right */
#top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 24px;
  flex-shrink: 0;
}

#resources-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--navy);
  border: 1px solid var(--navy-mid);
  border-radius: var(--radius-pill);
  color: var(--white);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
#resources-btn:hover {
  background: var(--navy-mid);
  border-color: var(--gold);
  color: var(--gold);
}

#filter-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: var(--navy);
  border: 1px solid var(--navy-mid);
  border-radius: var(--radius-pill);
  color: var(--white);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
#filter-toggle-btn:hover {
  background: var(--navy-mid);
  border-color: var(--gold);
  color: var(--gold);
}

#add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--gold);
  border: 2px solid var(--gold);
  border-radius: var(--radius-pill);
  color: var(--maroon);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  letter-spacing: 0.1px;
}
#add-btn:hover {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
  color: var(--maroon);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(232,182,64,0.35);
}

/* ═══════════════════════════════════════════════════════════
   FILTER PANEL
   ═══════════════════════════════════════════════════════════ */
#filter-panel {
  position: fixed;
  top: 72px;
  left: 12px;
  right: auto;
  width: 280px;
  max-height: calc(100vh - 84px);
  overflow-y: auto;
  z-index: 900;
  background: var(--maroon-dark);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 20px;
  transition: transform 0.22s ease;
}
#filter-panel.hidden {
  display: none;
}

.filter-section {
  margin-bottom: 16px;
}

/* Collapsible section header */
.filter-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 3px 0 6px;
  user-select: none;
}
.filter-section-header:hover .fs-arrow { color: var(--gold); }
.filter-section-header .group-master { flex: 1; }

/* Section title */
.fs-title {
  flex: 1;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--gold);
}

/* Collapse toggle arrow */
.fs-arrow {
  font-size: 8px;
  color: var(--text-muted);
  width: 10px;
  flex-shrink: 0;
  transition: color 0.15s;
  line-height: 1;
}

/* Count badge */
.fs-count {
  margin-left: auto;
  background: var(--gold);
  color: var(--navy);
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  flex-shrink: 0;
}

/* Collapsible body */
.filter-section-body {
  overflow: hidden;
  max-height: 600px;
  opacity: 1;
  transition: max-height 0.25s ease, opacity 0.2s ease;
}
.filter-section-body.collapsed {
  max-height: 0 !important;
  opacity: 0;
}

/* Community sort dropdown trigger */
.community-sort-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-light);
  transition: border-color 0.15s;
}
.community-sort-trigger:hover { border-color: var(--gold); }
.cs-chevron { font-size: 8px; color: var(--text-muted); }

/* Community sort dropdown menu */
.community-sort-menu {
  background: var(--navy);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  margin-top: 4px;
  padding: 4px 2px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.community-sort-menu .filter-check {
  padding: 5px 10px;
  border-radius: 4px;
}
.community-sort-menu .filter-check:hover { background: rgba(255,255,255,0.05); }

/* Form type group collapsibles */
.type-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 0 4px;
  user-select: none;
}
.type-group-header .type-group-heading { flex: 1; margin: 0; }
.type-group-header:hover .fs-arrow { color: var(--gold); }

.type-group-body {
  overflow: hidden;
  max-height: 600px;
  opacity: 1;
  transition: max-height 0.25s ease, opacity 0.2s ease;
}
.type-group-body.collapsed {
  max-height: 0 !important;
  opacity: 0;
}

/* Volunteer greyed-out option */
.volunteer-disabled {
  opacity: 0.38;
  cursor: not-allowed !important;
}
.volunteer-disabled input { pointer-events: none; }
.volunteer-msg {
  font-size: 12px;
  color: var(--gold);
  line-height: 1.4;
  padding: 6px 10px;
  margin: 2px 0 6px;
  background: rgba(232,182,64,0.08);
  border: 1px solid rgba(232,182,64,0.2);
  border-radius: 5px;
}
.volunteer-msg a { color: var(--gold); }

.filter-heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--gold);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.filter-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-light);
  cursor: pointer;
  transition: color var(--transition);
}
.filter-check:hover { color: var(--gold); }
.filter-check input[type="checkbox"] {
  accent-color: var(--gold);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 4px;
}
.reset-btn:hover {
  border-color: var(--pink);
  color: var(--pink);
}

/* Radius */
.radius-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
#f-radius-slider {
  flex: 1;
  accent-color: var(--gold);
}
#f-radius {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-family: var(--font);
  font-size: 13px;
  padding: 4px 6px;
  width: 54px;
  text-align: center;
}
.radius-unit { font-size: 12px; color: var(--text-muted); }
.radius-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* Coverage area toggle */
#area-type-toggle {
  display: flex;
  gap: 8px;
  margin: 10px 0 14px;
}
.area-toggle-btn {
  flex: 1;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid var(--maroon-light);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
}
.area-toggle-btn:hover { border-color: var(--maroon); color: var(--text-light); }
.area-toggle-btn.active { background: var(--maroon); border-color: var(--maroon); color: var(--white); font-weight: 600; }
.area-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 10px;
  line-height: 1.4;
}
.radius-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.radius-row input[type="range"] { flex: 1; }
#radius-km-display {
  font-size: 14px;
  font-weight: 600;
  color: var(--gold);
  min-width: 46px;
  text-align: right;
}

/* Draw */
#draw-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: transparent;
  border: 1px solid var(--maroon-light);
  border-radius: var(--radius-pill);
  color: var(--maroon-pale);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
#draw-btn:hover { background: var(--maroon-mid); color: var(--white); }
#draw-btn.active { background: var(--maroon-light); color: var(--white); }

/* ═══════════════════════════════════════════════════════════
   FORM PANEL (Add / Edit Group)
   ═══════════════════════════════════════════════════════════ */
#form-panel {
  position: fixed;
  top: 60px;
  right: 0;
  width: 360px;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  z-index: 950;
  background: var(--navy);
  border-left: 2px solid var(--pink);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  font-family: var(--font);
  transition: transform 0.22s ease;
}
#form-panel.hidden { display: none; }

#form-panel h2, #form-panel h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 16px;
  letter-spacing: -0.2px;
}

#form-panel label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 5px;
  margin-top: 14px;
}
#form-panel label:first-of-type { margin-top: 0; }

#form-panel input[type="text"],
#form-panel input[type="email"],
#form-panel input[type="tel"],
#form-panel input[type="url"],
#form-panel input[type="number"],
#form-panel textarea,
#form-panel select {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-family: var(--font);
  font-size: 13.5px;
  padding: 9px 12px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
#form-panel input:focus,
#form-panel textarea:focus,
#form-panel select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(232,182,64,0.18);
}
#form-panel select option { background: var(--navy); }

.checkbox-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text-light);
}
.checkbox-group input[type="checkbox"] { accent-color: var(--gold); }

/* Checkbox labels inside form */
#form-panel .checkbox-group label,
#form-panel .type-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-light);
  margin-top: 0;
  padding: 4px 0;
  cursor: pointer;
}
#form-panel .checkbox-group label input[type="checkbox"],
#form-panel .type-group label input[type="checkbox"] {
  width: auto;
  flex-shrink: 0;
}

/* Type group category heading */
.type-group-heading {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--gold);
  margin-bottom: 4px;
  margin-top: 2px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.pin-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  font-style: italic;
}

#submit-btn {
  width: 100%;
  margin-top: 20px;
  padding: 12px;
  background: var(--gold);
  border: none;
  border-radius: var(--radius-md);
  color: var(--maroon);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.1px;
}
#submit-btn:hover {
  background: var(--gold-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(232,182,64,0.30);
}

#form-msg {
  margin-top: 10px;
  font-size: 13px;
  color: var(--maroon-pale);
  min-height: 18px;
}

.close-btn {
  position: absolute;
  top: 16px; right: 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  transition: color var(--transition);
}
.close-btn:hover { color: var(--white); }

.spec-desc-wrap {
  margin-top: 4px;
}

/* Mini bar */
#form-mini-bar {
  display: none;
  align-items: center;
  gap: 10px;
  background: var(--maroon);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  cursor: pointer;
  margin-bottom: 12px;
  border: 1px solid var(--maroon-light);
}
#form-panel.form-mini #form-mini-bar {
  display: flex;
}
#form-mini-text { font-size: 13px; font-weight: 500; color: var(--text-light); }
#form-mini-icon { font-size: 18px; color: var(--gold); }

/* Panel contact */
.panel-contact {
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.6;
}
.panel-contact a {
  color: var(--gold);
  text-decoration: none;
  font-weight: 500;
}
.panel-contact a:hover { text-decoration: underline; }
.panel-contact em {
  font-size: 12px;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════
   INFO PANEL (Group details popup panel)
   ═══════════════════════════════════════════════════════════ */
#info-panel {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 320px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  z-index: 910;
  background: var(--navy);
  border: 1px solid var(--pink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-family: var(--font);
  transition: transform 0.22s ease, opacity 0.22s ease;
}
#info-panel.hidden { display: none; }

.info-header {
  background: var(--maroon);
  padding: 18px 20px 14px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  position: relative;
}

.info-type-tag {
  display: inline-block;
  padding: 3px 10px;
  background: var(--gold);
  color: var(--maroon);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: var(--radius-pill);
  margin-bottom: 8px;
}

.info-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.3;
  letter-spacing: -0.1px;
  margin-bottom: 8px;
}

.info-close {
  position: absolute;
  top: 12px; right: 14px;
  z-index: 1;
  background: rgba(255,255,255,0.12);
  border: none;
  border-radius: 50%;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  color: var(--white);
  font-size: 16px;
  cursor: pointer;
  transition: background var(--transition);
}
.info-close:hover { background: rgba(255,255,255,0.22); }

#info-body, .info-body {
  padding: 0;
}

.info-body-content {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.55;
  padding: 0 20px;
}

.info-section {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 13px;
  color: var(--text-light);
}
.info-section:last-child { border-bottom: none; }

.info-stale {
  font-size: 11px;
  color: var(--mauve);
  font-style: italic;
  padding: 6px 0 0;
}

.info-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 20px 20px;
}

.info-action {
  flex: 1;
  min-width: 90px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-pill);
  color: var(--text-light);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
}
.info-action:hover {
  border-color: var(--pink);
  color: var(--maroon-pale);
  background: rgba(178,78,151,0.18);
}
.info-action.primary {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--maroon);
  font-weight: 700;
}
.info-action.primary:hover {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════
   MAP FLOATING BUTTONS
   ═══════════════════════════════════════════════════════════ */
.map-action-btn {
  background: var(--maroon);
  border: 1px solid var(--maroon-light);
  border-radius: var(--radius-md);
  color: var(--white);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.map-action-btn:hover {
  background: var(--maroon-light);
  box-shadow: var(--shadow-md);
}

/* ── LEAFLET POPUP OVERRIDES ───────────────────────────── */
.leaflet-popup-content-wrapper {
  background: var(--navy) !important;
  color: var(--text-light) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-md) !important;
  border: 1px solid var(--maroon-light) !important;
  font-family: var(--font) !important;
}
.leaflet-popup-tip { background: var(--navy) !important; }
.leaflet-popup-content { font-family: var(--font) !important; font-size: 13px !important; }

/* ── COMMUNITY COMMENTS ─────────────────────────────────── */
.info-comments-section {
  border-top: 1px solid rgba(255,255,255,0.10);
  padding: 0 20px 20px;
}
.info-comment-loading {
  font-size: 12px;
  color: var(--text-muted);
  padding: 12px 0;
}
.info-comments-heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--gold);
  padding: 14px 0 10px;
}
.info-comment {
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.info-comment-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.info-comment-meta strong {
  color: var(--text-light);
  font-weight: 600;
}
.info-comment-text {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.5;
  white-space: pre-wrap;
}
.info-comment-none {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 12px;
}
.info-comment-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.info-comment-form-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 4px;
}
.info-comment-note {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.5;
}
.info-comment-form input,
.info-comment-form textarea {
  display: block;
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-family: var(--font);
  font-size: 13px;
  padding: 8px 10px;
  margin-bottom: 8px;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition);
}
.info-comment-form input:focus,
.info-comment-form textarea:focus {
  border-color: var(--gold);
}
.info-comment-form input::placeholder,
.info-comment-form textarea::placeholder {
  color: rgba(255,255,255,0.35);
}
.info-comment-form button {
  width: 100%;
  padding: 9px;
  background: var(--gold);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--maroon);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition);
}
.info-comment-form button:hover { background: var(--gold-dark); }
#c-msg { font-size: 12px; margin-bottom: 8px; color: var(--text-muted); }
.c-msg-err { color: #ff8fb0 !important; }

/* ── MAP LOAD PROGRESS ──────────────────────────────────── */
#map-load-progress {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(24, 10, 20, 0.85);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(6px);
  pointer-events: none;
  z-index: 500;
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* ── UTILITY ────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── SCROLLBAR ──────────────────────────────────────────── */
#filter-panel::-webkit-scrollbar,
#form-panel::-webkit-scrollbar,
#info-panel::-webkit-scrollbar { width: 4px; }
#filter-panel::-webkit-scrollbar-track,
#form-panel::-webkit-scrollbar-track,
#info-panel::-webkit-scrollbar-track { background: transparent; }
#filter-panel::-webkit-scrollbar-thumb,
#form-panel::-webkit-scrollbar-thumb,
#info-panel::-webkit-scrollbar-thumb {
  background: var(--mauve);
  border-radius: 4px;
}

/* ── RESPONSIVE ─────────────────────────────────────────── */

/* ── TABLET (≤900px) ──────────────────────────────────── */
@media (max-width: 900px) {
  #top-bar {
    padding: 0 16px;
    gap: 0;
    height: 56px;
  }
  #site-name { font-size: 15px; }
  #site-title {
    padding-right: 16px;
    margin-right: 16px;
  }
  #search-wrap { max-width: 220px; }
  .btn-label { display: none; }
  #resources-btn, #filter-toggle-btn {
    padding: 7px 11px;
  }
  #filter-panel { width: 260px; top: 68px; left: 10px; max-height: calc(100vh - 80px); }
  #form-panel   { width: 320px; top: 56px; max-height: calc(100vh - 56px); }
  #info-panel   { width: 290px; bottom: 16px; left: 16px; }
  #map { top: 0; }
}

/* ── MOBILE (≤600px) ──────────────────────────────────── */
@media (max-width: 600px) {
  #top-bar {
    padding: 0 12px;
    height: auto;
    min-height: 56px;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  #site-title {
    flex: 0 0 auto;
    padding-right: 12px;
    margin-right: 0;
    border-right: none;
  }
  #site-name { font-size: 14px; letter-spacing: 0; }
  #site-sub  { display: block; font-size: 10px; margin-top: 2px; }
  #search-wrap {
    order: 10;
    flex: 0 0 100%;
    max-width: 100%;
    margin: 0;
  }
  #top-actions {
    order: 5;
    flex: 0 0 100%;
    margin-left: 0;
    gap: 6px;
  }
  #top-actions > * { flex: 1; text-align: center; justify-content: center; }
  .btn-label { display: inline; }
  #resources-btn, #filter-toggle-btn {
    padding: 8px 6px;
    font-size: 12px;
  }
  #add-btn {
    padding: 8px 6px;
    font-size: 12px;
  }

  /* Filter panel: slide up from bottom, full width */
  #filter-panel {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 70vh;
    border-radius: 16px 16px 0 0;
    border: none;
    border-top: 2px solid var(--pink);
    overflow-y: auto;
    z-index: 500;
  }

  /* Form panel: full width */
  #form-panel {
    position: fixed;
    top: var(--topbar-h, 150px);
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: calc(100dvh - var(--topbar-h, 150px));
    border-radius: 0;
    border-left: none;
    z-index: 600;
    padding-bottom: env(safe-area-inset-bottom, 16px);
  }

  /* Info panel: full width strip at bottom */
  #info-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 55vh;
    border-radius: 16px 16px 0 0;
    border-top: 2px solid var(--pink);
    box-shadow: 0 -4px 24px rgba(0,0,0,0.25);
    padding-bottom: env(safe-area-inset-bottom, 16px);
  }

  #map { top: 0; }

  .p-field input,
  .p-field select,
  .p-field textarea {
    font-size: 16px;
    padding: 10px 12px;
  }
  .panel-close {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
  .leaflet-popup-content-wrapper {
    max-width: calc(100vw - 40px) !important;
    border-radius: 12px !important;
  }
  .leaflet-popup-content {
    margin: 12px 14px !important;
    font-size: 13px !important;
  }
  #f-radius-slider { width: 100%; }
  #form-mini-bar { padding: 12px 16px; }

  /* Pin placement overlay */
  #pin-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 700;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: var(--navy);
    border-top: 2px solid var(--pink);
    padding: 16px 20px;
    padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
  }
  #pin-overlay-msg {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    text-align: center;
    line-height: 1.4;
  }
  #pin-overlay-done {
    width: 100%;
    padding: 13px;
    background: var(--maroon);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.01em;
  }

  /* Boundary drawing overlay */
  #draw-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 700;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: var(--navy);
    border-top: 2px solid var(--pink);
    padding: 16px 20px;
    padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
  }
  #draw-overlay-msg {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    text-align: center;
    line-height: 1.4;
  }
  #draw-overlay-cancel {
    padding: 11px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--maroon-light);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
  }
  #draw-overlay-finish {
    padding: 11px;
    background: var(--maroon);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
  }
}

/* ── TINY PHONES (≤380px) ─────────────────────────────── */
@media (max-width: 380px) {
  #site-name { font-size: 13px; }
  #resources-btn { display: none; }
  #add-btn { padding: 7px 10px; }
}

/* ── TOUCH DEVICE ENHANCEMENTS ────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  #resources-btn,
  #filter-toggle-btn,
  #add-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  #resources-btn:hover,
  #filter-toggle-btn:hover,
  #add-btn:hover {
    transform: none;
  }
  .filter-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }
}

/* ── LANDSCAPE PHONE ──────────────────────────────────── */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  #top-bar {
    height: 48px;
    padding: 0 12px;
    flex-wrap: nowrap;
  }
  #search-wrap {
    order: 0;
    flex: 1;
    max-width: none;
    margin: 0 10px;
  }
  #filter-panel {
    top: 60px;
    max-height: calc(100vh - 72px);
    width: 260px;
    bottom: auto;
    left: 10px;
    right: auto;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,0.18);
  }
  #form-panel {
    top: 48px;
    max-height: calc(100vh - 48px);
  }
  #info-panel {
    max-height: 45vh;
    width: 280px;
    bottom: 12px;
    left: 12px;
    border-radius: var(--radius-lg);
    border-top: none;
  }
}

/* ── THE FIELDTEAM BUBBLE ────────────────────────────── */
/* The same pill the other public maps wear: burgundy, rounded, two targets.
   The name is a link home on its own, so nobody reaching for the home page
   opens a list of maps by accident. */
#ft-bubble { position: relative; display: flex; align-items: stretch; flex-shrink: 0; }
#ft-home, #ft-toggle {
  display: flex; align-items: center; justify-content: center;
  min-height: 34px; border: 1px solid var(--navy-mid);
  background: rgba(26, 10, 19, 0.95); color: var(--text-light);
  font-size: 13px; font-weight: 600; font-family: inherit;
  text-decoration: none; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
#ft-home { border-radius: 999px 0 0 999px; border-right: none; padding: 0 8px 0 14px; }
#ft-toggle { border-radius: 0 999px 999px 0; width: 28px; padding: 0; font-size: 10px; }
#ft-home:hover, #ft-toggle:hover { background: var(--maroon); }
#ft-mark { display: none; }
#ft-toggle[aria-expanded="true"] { background: var(--maroon); }

/* FIXED, NOT ABSOLUTE. #top-bar is overflow:hidden so the decorative orbs
   stay inside it, and that was clipping this menu off at the bottom edge of
   the bar -- it opened, and none of it was visible. A fixed element is not
   clipped by an ancestor's overflow, so the menu escapes the bar while the
   orbs stay put. toggleFieldteamMenu() places it under the bubble. */
#ft-menu {
  position: fixed; z-index: 1200;
  min-width: 232px; padding: 5px 0;
  border: 1px solid var(--navy-mid); border-radius: 12px;
  background: rgba(26, 10, 19, 0.97);
  box-shadow: 0 10px 28px rgba(0,0,0,0.4);
}
#ft-menu.hidden { display: none; }
#ft-menu a {
  display: block; padding: 8px 14px;
  color: var(--text-muted); font-size: 13px; text-decoration: none; white-space: nowrap;
}
#ft-menu a:first-child { color: var(--text-light); font-weight: 600; }
#ft-menu a:hover { background: var(--maroon); color: var(--white); }
#ft-menu a.ft-current { color: var(--gold); font-weight: 600; }
#ft-menu .ft-sep { height: 1px; margin: 5px 0; background: rgba(110, 43, 79, 0.7); }

/* On a phone the word is about seventy pixels, which is the difference
   between the actions fitting on one row and wrapping over the map. */
@media (max-width: 640px) {
  #ft-word { display: none; }
  #ft-mark { display: block; }
  #ft-home { padding: 0 6px 0 10px; }
}

/* The stock hCaptcha box is 303px wide and the info panel is narrower than
   that on a phone, so it is scaled rather than allowed to push a scrollbar. */
.c-captcha { margin: 8px 0; transform: scale(0.86); transform-origin: left top; height: 68px; }
