:root{
  --bg: #0b1220;
  --card: rgba(255,255,255,0.06);
  --card2: rgba(255,255,255,0.08);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.62);
  --border: rgba(255,255,255,0.12);
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
  --primary: #60a5fa;
  --primary2: #3b82f6;
  --danger: #ef4444;
  --ok: #22c55e;
  --radius: 16px;
  --radius2: 22px;
  --pad: 14px;
  --pad2: 18px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

/* Light theme toggle (body.light) */
body.light{
  --bg: #f6f7fb;
  --card: rgba(0,0,0,0.03);
  --card2: rgba(0,0,0,0.05);
  --text: rgba(15,23,42,0.92);
  --muted: rgba(15,23,42,0.62);
  --border: rgba(15,23,42,0.10);
  --shadow: 0 10px 25px rgba(15,23,42,0.12);
}

/* Base */
*{ box-sizing: border-box; }
html, body { height: 100%; }
body{
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 500px at 15% 0%, rgba(96,165,250,0.18), transparent 60%),
    radial-gradient(900px 500px at 85% 10%, rgba(34,197,94,0.10), transparent 60%),
    radial-gradient(900px 500px at 50% 100%, rgba(59,130,246,0.08), transparent 60%),
    var(--bg);
}

/* Layout */
.wrap{
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 60px;
}

/* Topbar */
.topbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px;
  margin-bottom: 14px;

  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);

  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.brand{
  font-weight: 700;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card2);
  color: var(--text);
}

/* Cards grid */
.cards{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

/* Generic card */
.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--pad2);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.cardHead{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.cardTitle{
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.cardBig{
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  margin-top: 8px;
}

.cardSub{
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

/* Map card */
.mapCard{ padding: 12px; }
.map{
  width: 100%;
  height: 54vh;
  min-height: 340px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
}

/* Input grid */
.mb{ margin-bottom: 10px; }

.grid2{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field label{
  display:block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.field input,
.field select{
  width: 100%;
  height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card2);
  color: var(--text);
  outline: none;
}

.field input::placeholder{ color: rgba(255,255,255,0.40); }
body.light .field input::placeholder{ color: rgba(15,23,42,0.35); }

.field input:focus,
.field select:focus{
  border-color: rgba(96,165,250,0.55);
  box-shadow: 0 0 0 4px rgba(96,165,250,0.18);
}

/* Buttons */
.actions{
  display:flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
  flex-wrap: wrap;
}

.btn{
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card2);
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.18);
}

.btn:active{ transform: translateY(0px); }

.btn.primary{
  background: linear-gradient(135deg, rgba(96,165,250,0.95), rgba(59,130,246,0.95));
  border-color: rgba(59,130,246,0.55);
  color: #0b1220;
}

.btn.ghost{ background: transparent; }

/* Debug panel */
.dbgPanel.hidden{ display:none; }

.dbgPanel{
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.12);
}

body.light .dbgPanel{ background: rgba(15,23,42,0.04); }

.dbgGrid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.dbgBox{
  border: 1px solid var(--border);
  background: var(--card2);
  border-radius: 14px;
  padding: 12px;
  min-height: 86px;
}

.dbgTitle{
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 8px;
}

.dbgLog{
  margin-top: 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.18);
  overflow: auto;
  max-height: 300px;
}

body.light .dbgLog{ background: rgba(15,23,42,0.04); }

.dbgLog pre{
  margin: 0;
  padding: 12px;
  font-size: 12px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Leaflet tweaks */
.leaflet-control-attribution{ font-size: 11px !important; }
.leaflet-container{ background: rgba(0,0,0,0.12); }
.leaflet-marker-pane { z-index: 600; }
.leaflet-overlay-pane { z-index: 400; }

/* Utility spacing */
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }

/* Pigeon icon (0437.png) – drop shadow + blend */
.leaflet-marker-icon{
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35));
}

/* -----------------------
   Wayne: Fullscreen Map Modal
------------------------ */
body.modalOpen{
  overflow: hidden;
}

.mapModal.hidden{ display: none; }

.mapModal{
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.mapModalBackdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
}

.mapModalCard{
  position: absolute;
  inset: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mapModalTop{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.10);
}

body.light .mapModalTop{
  background: rgba(15,23,42,0.04);
}

.mapModalTitle{
  font-weight: 900;
  letter-spacing: 0.02em;
}

.mapModalClose{
  height: 38px;
  width: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card2);
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
}

.mapModalBody{
  padding: 12px;
  flex: 1;
  min-height: 0;
}

.mapModalMapSlot{
  height: 100%;
  width: 100%;
}

.mapModalMapSlot .map{
  height: 100% !important;
  min-height: 0 !important;
  border-radius: 16px;
}

.mapModalBottom{
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.10);
}

body.light .mapModalBottom{
  background: rgba(15,23,42,0.04);
}

.mapModalEtaRow{
  display:flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.mapModalEtaLabel{
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
}

.mapModalEtaValue{
  font-size: 26px;
  font-weight: 950;
  line-height: 1;
}

.mapModalEtaSub{
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

/* Mobile */
@media (max-width: 980px){
  .cards{ grid-template-columns: repeat(2, 1fr); }
  .dbgGrid{ grid-template-columns: 1fr; }
  .mapModalCard{ inset: 10px; }
}

@media (max-width: 620px){
  .cards{ grid-template-columns: 1fr; }
  .grid2{ grid-template-columns: 1fr; }
  .wrap{ padding: 12px; }
  .map{ height: 46vh; min-height: 300px; }
  .cardBig{ font-size: 26px; }
  .actions{ justify-content: stretch; }
  .btn{ flex: 1; }
  .mapModalCard{ inset: 8px; }
  .mapModalEtaValue{ font-size: 24px; }
}