:root {
  --ink: #163828;
  --muted: #5c7568;
  --paper: #f3faf5;
  --card: #ffffff;
  --line: #d7eadf;
  --accent: #2f9e5a;
  --accent-dark: #1b7a42;
  --sky: #e7f6ec;
  --frame: #1b7a42;
}

* { box-sizing: border-box; }

html { font-size: 18px; }

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font: 1rem/1.4 "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

.site, main {
  width: 100%;
  background: var(--paper);
}
.site {
  position: sticky;
  top: 0;
  z-index: 900;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  min-height: 0;
  padding: 12px 24px;
  border-bottom: 0;
  background:
    linear-gradient(to bottom, rgba(255,255,255,.25) 0%, rgba(255,255,255,.78) 46%, #ffffff 78%),
    url("/nav-scenery.jpg") center 30% / cover no-repeat;
}
main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
  background: none;
  border: 0;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--accent-dark);
  font-size: 1.3rem;
  cursor: pointer;
  justify-self: start;
  text-shadow: none;
}
.brand-copy { display: grid; line-height: 1.15; text-align: left; min-width: 0; max-width: 100%; }
.brand-name { font-size: 2rem; }
.brand-place {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.3;
  color: var(--ink);
}
.logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  display: block;
  background: white;
  border-radius: 50%;
  padding: 2px;
}
.site-nav { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 4px; }
.site-nav button {
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #1c2b24;
  text-shadow: none;
  padding: 10px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.site-nav button.active:not(.nav-cta) {
  color: var(--accent-dark);
  box-shadow: inset 0 -3px 0 var(--accent-dark);
  border-radius: 0;
}
.site-nav .nav-cta,
.site-nav .nav-cta.active {
  position: static;
  transform: none;
  background: var(--accent-dark);
  color: white;
  text-shadow: none;
  margin-left: 8px;
  padding: 12px 18px;
  font-size: 1rem;
}

.screen { display: none; }
.screen.active { display: block; flex: 1; min-height: 0; }
.screen.page.active { overflow: auto; }
.page { max-width: none; margin: 0; padding: 32px 40px 72px; }
#report.page, #chat.page { max-width: 760px; margin: 0 auto; }
.map-screen.active { display: block; padding: 0; height: auto; min-height: 0; position: relative; }
.screen.active.front {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  grid-template-rows: minmax(0, 1fr);
  height: 100%;
  overflow: hidden;
  background: var(--paper);
}
.front-side {
  overflow: auto;
  min-height: 0;
  padding: 20px 16px 28px;
  border-right: 1px solid var(--line);
  display: grid;
  align-content: start;
  gap: 10px;
  background: white;
}
.front-side h1 { font-size: 1.4rem; line-height: 1.15; letter-spacing: -0.02em; }
.front-side h2 { font-size: 1.05rem; margin-top: 8px; }
.front-side .tag { color: #6b7280; font-size: 1rem; }
.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 0 14px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: white;
}
.search-icon { width: 18px; height: 18px; color: #9ca3af; flex: none; }
.place-result { margin: 0; color: #166534; font-weight: 700; }
.search-field input[type="text"] {
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding: 12px 0;
  background: transparent;
  outline: none;
  box-shadow: none;
  font-size: 0.95rem;
}
.filter-label { color: #111827; letter-spacing: 0; text-transform: none; font-size: 1rem; margin-top: 8px; }
.front-side .filter-pills .chip {
  background: #f3f4f6;
  color: #1f2937;
  box-shadow: none;
  border-radius: 14px;
  padding: 8px 14px;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 650;
}
.front-side .filter-pills .chip .dot { margin-right: 6px; }
.front-side .filter-pills .chip.on,
.front-side .filter-pills .chip.on.reports,
.front-side .filter-pills .chip.on.hotspots,
.front-side .filter-pills .chip.on.bins {
  background: #22c55e;
  color: white;
}
.front-side .filter-pills .chip.on .dot { background: white; }
.add-cta {
  display: grid;
  justify-items: center;
  gap: 2px;
  width: 100%;
  margin-top: 6px;
  padding: 14px 16px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(#34d399, #16a34a);
  color: white;
  box-shadow: 0 8px 18px rgba(22, 163, 74, 0.28);
  cursor: pointer;
  font: inherit;
}
.add-cta-title { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; font-weight: 800; }
.add-plus {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,.22);
  font-size: 1.1rem;
  line-height: 1;
}
.add-cta-sub { font-size: 0.95rem; font-weight: 600; opacity: 0.95; }
.count-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
  padding: 16px;
  border: 1px solid #eef2f1;
  border-radius: 18px;
  background: white;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.count-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: #ecfdf3;
  color: #16a34a;
}
.count-icon svg { width: 26px; height: 26px; }
.count-card strong { display: block; font-size: 1.6rem; line-height: 1; }
.count-card span { color: #6b7280; }
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stat-grid > div {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #eef2f1;
  border-radius: 16px;
  background: white;
}
.stat-grid strong { display: block; font-size: 1.15rem; line-height: 1.1; }
.stat-grid span { color: #6b7280; font-size: 0.95rem; }
.stat-ico {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  flex: none;
}
.stat-ico svg { width: 18px; height: 18px; }
.stat-ico.note { background: #dcfce7; color: #16a34a; }
.stat-ico.today { background: #d1fae5; color: #059669; }
.stat-ico.clean { background: #dbeafe; color: #2563eb; }
.stat-ico.hot { background: #fee2e2; color: #ef4444; }
.side-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.side-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f3faf5;
  border-radius: 12px;
  cursor: pointer;
}
.side-list img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 12px;
  background: white;
  flex: none;
}
.side-list strong { flex: 1; font-size: 0.95rem; line-height: 1.3; }
.side-list .distance { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }
.nearest-bin {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 12px;
  background: #f3faf5;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.nearest-bin img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 12px;
  background: white;
}
.nearest-bin strong { display: block; font-size: 1rem; }
.nearest-bin #nearest-bin-text { display: block; color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
.nearest-bin .distance { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }
.front-side .tag { font-size: 1rem; }
.filter-label { font-weight: 700; }
.filter-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.front-side .stats { margin-top: 4px; }
.front-side .sheet {
  position: static;
  display: grid;
  max-height: none;
  padding: 0;
  box-shadow: none;
  background: transparent;
}
.front-map { position: relative; min-height: 0; height: 100%; }
.tour-card {
  position: absolute;
  z-index: 500;
  left: 16px;
  top: 64px;
  max-width: 340px;
  padding: 14px 16px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}
.tour-card strong {
  display: block;
  color: #146c3a;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tour-card p { margin: 6px 0 0; }
.route-stop {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e10600;
  color: white;
  font-weight: 700;
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.map-views {
  position: absolute;
  z-index: 500;
  top: 16px;
  right: 68px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: white;
  border-radius: 16px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.map-views button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  border-radius: 12px;
  padding: 8px 12px;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  color: #6b7280;
}
.map-views button svg { width: 16px; height: 16px; }
.map-views button.on { background: #f0fdf4; color: #16a34a; }
.legend {
  position: absolute;
  z-index: 500;
  right: 16px;
  bottom: 28px;
  background: white;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  display: grid;
  gap: 8px;
  font-size: 1rem;
  min-width: 150px;
}
.legend strong { font-size: 1rem; }
.dot.bin { background: #7c3aed; }
.legend p { display: flex; align-items: center; gap: 6px; }
.sheet strong { font-size: 1rem; }
.front .locate { top: 168px; right: 16px; left: auto; width: 40px; height: 40px; border: 0; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12); }

.hero {
  position: relative;
  min-height: calc(100vh - 64px);
  overflow: hidden;
  color: var(--ink);
  background: linear-gradient(#f4f7d4 0%, #e7f3c8 55%, #f7f0c4 100%);
}
.hills {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 58%;
  z-index: 2;
  pointer-events: none;
}
.mill {
  position: absolute;
  left: 5%;
  bottom: 16%;
  width: 150px;
  height: 300px;
  z-index: 3;
  overflow: visible;
}
.sky-clouds, .falling { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.sky-clouds { z-index: 1; }
.falling { z-index: 5; }
.cloud {
  position: absolute;
  left: 0;
  height: 32px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 40px;
  animation: drift linear infinite;
}
.cloud::before, .cloud::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
}
.cloud::before { width: 32px; height: 32px; top: -16px; left: 14px; }
.cloud::after { width: 44px; height: 44px; top: -22px; left: 36px; }
.c1 { width: 120px; top: 8%; animation-duration: 42s; animation-delay: -8s; }
.c2 { width: 84px; top: 16%; animation-duration: 56s; animation-delay: -24s; }
.c3 { width: 140px; top: 4%; animation-duration: 64s; animation-delay: -40s; }
.c4 { width: 70px; top: 22%; animation-duration: 48s; animation-delay: -16s; }
@keyframes drift {
  from { transform: translateX(-20vw); }
  to { transform: translateX(110vw); }
}
.leaf-fall {
  position: absolute;
  top: -8%;
  width: 16px;
  height: 11px;
  background: #e07a12;
  border-radius: 0 80% 0 80%;
  animation: fall linear infinite;
}
.f1 { left: 8%; animation-duration: 9s; }
.f2 { left: 24%; background: #f6c14a; animation-duration: 12s; animation-delay: -3s; }
.f3 { left: 42%; background: #c45c22; animation-duration: 10s; animation-delay: -6s; }
.f4 { left: 58%; animation-duration: 13s; animation-delay: -2s; }
.f5 { left: 74%; background: #f0a030; animation-duration: 11s; animation-delay: -8s; }
.f6 { left: 88%; background: #f6c14a; animation-duration: 9.5s; animation-delay: -4s; }
.spin {
  transform-box: fill-box;
  transform-origin: center;
  animation: spin 5.5s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translateY(92vh) rotate(240deg); opacity: 0; }
}
.hero-copy {
  position: absolute;
  z-index: 8;
  top: 12%;
  left: 46%;
  right: 5vw;
  width: auto;
  text-align: left;
}
.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(2.8rem, 4.4vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  color: #7a3e12;
}
.hero .lead {
  color: #c45c22;
  font-weight: 700;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  margin: 0 0 10px;
}
.hero p:last-of-type { color: #6b4528; font-size: 1.2rem; line-height: 1.45; max-width: 34ch; }
.hero-actions { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; justify-content: flex-start; }
.hero-actions button {
  border: 0;
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  padding: 14px 22px;
  background: #c45c22;
  color: white;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 1rem;
  text-transform: uppercase;
}
.hero-actions .ghost { background: transparent; color: #c45c22; border: 2px solid #c45c22; }

.split { display: grid; grid-template-columns: 280px 1fr; gap: 16px; margin-top: 16px; align-items: start; }

.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
h1, h2, p { margin: 0; }
h1 { font-size: 1.45rem; line-height: 1.2; }
h2 { font-size: 1.15rem; }
.page { background: var(--paper); }
.tag, .status { color: var(--muted); font-size: 1rem; }
.eyebrow { letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.72rem; color: #e8fff3; }

.card, .row-link, .rows li, form, .empty {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.action, .row-link {
  width: 100%;
  margin-top: 12px;
  text-align: left;
  padding: 14px 16px;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.action-title { display: block; color: var(--accent-dark); font-weight: 700; }

.card { margin-top: 12px; padding: 14px; }
.card-head, .filters { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.filters { margin: 12px 0; justify-content: flex-start; }
.filters .chip {
  background: #f3f4f6;
  color: #1f2937;
  box-shadow: none;
  border-radius: 14px;
  letter-spacing: 0;
  text-transform: none;
}
.filters .chip.active { background: #22c55e; color: white; }

.text-btn, .chip, .icon-btn, button[type="submit"], .empty button, .dock button {
  border: 0;
  font: inherit;
  cursor: pointer;
}
.text-btn, .icon-btn { background: transparent; color: var(--accent); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.stats div {
  background: #e7f6ec;
  border-radius: 14px;
  padding: 10px 8px;
  text-align: center;
}
.stats strong { display: block; font-size: 1.6rem; line-height: 1.1; }
.stats span { color: var(--muted); font-size: 0.95rem; letter-spacing: 0.04em; text-transform: uppercase; }

.rows {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.rows li {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 10px;
  cursor: pointer;
}
.rows img { width: 100%; height: 160px; object-fit: cover; border-radius: 14px; cursor: zoom-in; }
.rows strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.95rem;
  line-height: 1.3;
}
.rows p { color: var(--muted); font-size: 0.95rem; margin-top: 2px; }

form { margin-top: 12px; padding: 14px; display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-size: 1rem; }
input[type="text"] {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font: inherit;
}
.photo {
  min-height: 190px;
  border-radius: 16px;
  border: 1px dashed #b7dcc6;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background: var(--paper);
  cursor: pointer;
}
.photo input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
#preview { width: 100%; height: 220px; object-fit: cover; }
button[type="submit"], .empty button {
  background: var(--accent-dark);
  color: white;
  border-radius: 999px;
  padding: 12px 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 1rem;
}
button:disabled { opacity: 0.6; }
.message.error { color: #b42318; }

#leaflet { height: 100%; }
.map-tools {
  position: absolute;
  z-index: 500;
  top: 12px;
  left: 12px;
  right: 64px;
  display: flex;
  gap: 8px;
}
.chip {
  background: white;
  border-radius: 999px;
  padding: 8px 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.chip { font-size: 0.95rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.chip.on.reports { background: #1b7a42; color: white; }
.chip.on.hotspots { background: #f0c014; color: #1a1a1a; }
.chip.on.bins { background: #1a1a1a; color: white; }
.map-tools { flex-wrap: wrap; }
.chip.picked { outline: 2px solid var(--accent-dark); }
.locate {
  position: absolute;
  z-index: 500;
  top: 64px;
  right: 12px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: white;
  font-size: 1.3rem;
}
.sheet-toggle, .sheet {
  position: absolute;
  z-index: 500;
  left: 12px;
  right: 12px;
}
.sheet-toggle {
  bottom: 12px;
  display: flex;
  justify-content: space-between;
  background: white;
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.sheet {
  display: none;
  bottom: 64px;
  max-height: 38%;
  overflow: auto;
  background: white;
  border-radius: 16px;
  padding: 8px;
}
.sheet.open { display: grid; }
.sheet li.status { display: block; color: var(--muted); }
.sheet li {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  cursor: pointer;
}
.sheet img { width: 56px; height: 56px; object-fit: cover; border-radius: 12px; cursor: zoom-in; }
.img-zoom {
  position: fixed;
  z-index: 5000;
  width: min(340px, 42vw);
  height: min(340px, 42vw);
  object-fit: contain;
  background: white;
  border: 3px solid white;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(20, 40, 30, .35);
  pointer-events: none;
}
.img-zoom[hidden] { display: none !important; }
.sheet p { color: var(--muted); font-size: 0.8rem; margin-top: 2px; }
.sheet .distance { font-size: 0.82rem; color: var(--muted); }
.badge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}
.badge.critical { background: #ffe4e1; color: #b42318; }
.badge.high { background: #e7f6ec; color: var(--accent-dark); }
.badge.normal { background: #e7f6ee; color: var(--accent-dark); }
.clean-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.clean-toggle input {
  appearance: none;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: #d5ddd8;
  position: relative;
  cursor: pointer;
  margin: 0;
  flex: none;
}
.clean-toggle input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
}
.clean-toggle input:checked { background: #1b7a42; }
.clean-toggle input:checked::after { transform: translateX(18px); }
.clean-toggle:has(input:checked) { color: #146c3a; }
.layers-btn {
  position: absolute;
  z-index: 500;
  top: 12px;
  right: 12px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: white;
  font-size: 1.1rem;
}
.layers {
  position: absolute;
  inset: 0;
  z-index: 700;
  background: rgba(20, 48, 40, 0.35);
  display: grid;
  align-items: end;
}
.layers[hidden] { display: none; }
.layers-card {
  background: white;
  border-radius: 22px 22px 0 0;
  padding: 18px 16px 20px;
}
.layers-card h2 { text-align: center; margin-bottom: 8px; }
.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
}
.dot.report { background: #1b7a42; }
.dot.hot { background: #f0c014; }
.dot.bin { background: #7c3aed; }
.leaflet-top.leaflet-right { margin-top: 16px; margin-right: 8px; }
.leaflet-bar {
  border: 0 !important;
  border-radius: 14px !important;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12) !important;
}
.leaflet-bar a {
  width: 40px !important;
  height: 40px !important;
  line-height: 40px !important;
  border-bottom: 1px solid #f3f4f6 !important;
  color: #374151 !important;
}
.leaflet-marker-icon:has(.pin) { z-index: 800 !important; overflow: visible !important; }
.pin.report,
.pin.hot,
.pin.bin {
  display: block;
  position: relative;
  width: 36px;
  height: 36px;
  background: transparent;
  overflow: visible;
}
.pin img {
  position: absolute;
  left: 34px;
  top: -6px;
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0,0,0,.28);
  background: white;
  cursor: zoom-in;
  opacity: 0;
  pointer-events: none;
}
.leaflet-marker-icon:hover .pin img {
  opacity: 1;
  pointer-events: auto;
}
.pin.report.cleaned img { filter: grayscale(0.35); }
.bin-pin {
  display: block;
  position: relative;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: #7c3aed;
  border: 3px solid white;
  box-shadow: 0 2px 6px rgba(0,0,0,.28);
}
.bin-pin svg {
  position: absolute;
  width: 16px;
  height: 16px;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%) rotate(45deg);
  color: white;
}
.report .bin-pin { background: #22c55e; }
.hot .bin-pin { background: #eab308; }
.bin .bin-pin { background: #7c3aed; }
.pin.report.cleaned .bin-pin { background: #8aa898; }
.legend-pin {
  display: inline-block;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  vertical-align: middle;
}
.legend-pin .bin-pin {
  width: 20px;
  height: 20px;
  border-width: 2px;
}
.legend-pin .bin-pin svg {
  width: 10px;
  height: 10px;
}
.legend p { text-transform: none; letter-spacing: 0; font-weight: 600; }
.leaflet-marker-icon:hover { z-index: 3000 !important; }
.switch-row input {
  appearance: none;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: #d5ddd8;
  position: relative;
  cursor: pointer;
}
.switch-row input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
}
.switch-row input:checked { background: var(--accent); }
.switch-row input:checked::after { transform: translateX(18px); }
#layers-close {
  width: 100%;
  margin-top: 8px;
  background: var(--accent-dark);
  color: white;
  border-radius: 999px;
  padding: 12px 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 1rem;
}
.pin-wrap { background: none; border: none; }
.cleaned-mark {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #16a34a;
  color: white;
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.pin.report { position: relative; }
.map-screen .leaflet-top.leaflet-right { margin-top: 72px; }

#thread { min-height: 0; flex: 1; overflow: auto; display: grid; gap: 12px; align-content: start; padding: 20px 18px 12px; }
#thread:has(.chat-empty:not([hidden])) { align-content: center; }
.chat-empty { margin: 0 auto; max-width: 320px; text-align: center; color: var(--muted); }
.chat-empty strong, #chat .tag strong { color: var(--ink); }
.guide-popup {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 33, 23, 0.55);
}
.guide-popup[hidden] { display: none; }
.guide-card {
  width: min(820px, 100%);
  display: grid;
  justify-items: center;
  gap: 16px;
}
.guide-card video {
  display: block;
  width: 100%;
  max-height: calc(100vh - 160px);
  background: #102117;
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(16, 33, 23, 0.28);
}
.guide-gotit {
  background: var(--accent-dark);
  color: white;
  border: 0;
  border-radius: 999px;
  padding: 12px 28px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.chat-empty[hidden] { display: none; }
.bubble { max-width: 78%; padding: 12px 14px; border-radius: 18px; white-space: pre-wrap; line-height: 1.45; }
.bubble img { display: block; width: 180px; max-width: 100%; height: auto; border-radius: 12px; margin-bottom: 8px; }
.bubble.user { justify-self: end; background: var(--accent-dark); color: white; border-bottom-right-radius: 6px; }
.bubble.assistant { justify-self: start; background: #f3faf5; border: 1px solid var(--line); border-bottom-left-radius: 6px; }
#chat.screen.active { display: flex; flex-direction: column; height: auto; max-width: 820px; width: 100%; padding: 16px 24px 12px; overflow: hidden; }
#chat .top { margin-bottom: 12px; flex: none; }
#chat .tag { margin: 4px 0 0; color: var(--muted); }
.chat-shell { flex: 1; min-height: 0; display: flex; flex-direction: column; background: white; border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 12px 32px rgba(22, 56, 40, 0.06); overflow: hidden; }
.chat-dock { flex: none; border-top: 1px solid var(--line); background: #f7fbf8; padding: 12px; }
.chat-preview { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.chat-preview[hidden] { display: none; }
.chat-preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; border: 2px solid white; box-shadow: 0 2px 8px rgba(22, 56, 40, 0.12); }
#chat-photo-clear {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: white;
  border: 1px solid var(--line);
  font-size: 1.2rem;
  padding: 0;
}
#chat-form { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; margin: 0; align-items: center; background: white; border: 1px solid var(--line); border-radius: 999px; padding: 6px 6px 6px 8px; }
#chat-input { border: 0; background: transparent; font: inherit; color: inherit; padding: 8px 6px; min-width: 0; width: 100%; }
#chat-input:focus { outline: none; }
#chat-form button[type="submit"] { padding: 12px 18px; }
#chat-photo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #16a34a;
  color: white;
  font-size: 1.8rem;
  line-height: 1;
  padding: 0;
}

.empty { margin-top: 24px; padding: 22px; text-align: center; }
.empty p { color: var(--muted); margin: 8px 0 14px; }

@media (min-width: 900px) {
  .front-side .sheet {
    position: static;
    width: auto;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
  }
}
.front .leaflet-top.leaflet-right { margin-top: 72px; }
@media (max-width: 800px) {
  .site { grid-template-columns: 1fr; justify-items: center; padding: 10px 12px; }
  .site-nav .nav-cta, .site-nav .nav-cta.active { position: static; }
  .site-nav button { padding: 8px 10px; font-size: 0.85rem; }
  .page { padding: 24px 16px 56px; }
  .split { grid-template-columns: 1fr; }
  .hero { min-height: calc(100vh - 108px); }
  .hero-copy { top: 16px; left: 16px; right: 16px; width: auto; }
  .hero h1 { font-size: 2.6rem; }
  .screen.active.front { grid-template-columns: 1fr; height: auto; overflow: visible; }
  .front-map { height: 70vh; }
  .map-screen.active { height: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .spin, .cloud, .leaf-fall { animation: none; }
}
