:root {
  --ink: #15251d;
  --muted: #5e6d64;
  --surface: #ffffff;
  --canvas: #f5f7f2;
  --brand: #226044;
  --brand-dark: #174532;
  --line: #dce4dc;
  --danger: #ae3b2f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100dvh; max-width: 760px; margin: 0 auto; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.app-header { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
h1, h2, p { margin: 0; }
h1 { font-size: 1.6rem; letter-spacing: -.04em; }
h2 { font-size: 1.35rem; letter-spacing: -.03em; }
.eyebrow { margin-bottom: 3px; color: var(--brand); font-size: .73rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.location { color: var(--muted); font-size: .86rem; white-space: nowrap; }

.map-section { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #dfeae2; box-shadow: 0 6px 20px rgba(21, 37, 29, .08); }
#map { height: clamp(390px, 64dvh, 600px); width: 100%; }
.notice { position: absolute; z-index: 500; right: 10px; bottom: 10px; left: 10px; padding: 9px 11px; border-radius: 10px; background: rgba(255,255,255,.94); color: #314138; font-size: .75rem; line-height: 1.35; box-shadow: 0 2px 12px rgba(21, 37, 29, .14); }
.picker-bar { position: absolute; z-index: 600; right: 10px; bottom: 10px; left: 10px; padding: 11px; border-radius: 12px; background: rgba(255,255,255,.97); box-shadow: 0 4px 16px rgba(21, 37, 29, .22); }
.picker-bar p { margin: 0 0 9px; color: #314138; font-size: .82rem; line-height: 1.35; }
.picker-actions { display: flex; gap: 8px; }
.picker-actions .primary-button, .picker-actions .secondary-button { min-height: 42px; }
.picker-actions .primary-button:disabled { opacity: .5; cursor: not-allowed; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 12px; color: #405047; font-size: .76rem; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 10px; height: 10px; border: 2px solid white; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.18); }
.bait { background: #d94841; }.glass { background: #e38b26; }.caterpillar { background: #8256bf; }.grass { background: #3b8d56; }.dog { background: #2379b8; }

.primary-button, .secondary-button { min-height: 48px; border-radius: 12px; font-weight: 750; }
.primary-button { width: 100%; border: 1px solid var(--brand); background: var(--brand); color: white; box-shadow: 0 4px 12px rgba(34,96,68,.2); }
.primary-button:hover, .primary-button:focus-visible { background: var(--brand-dark); }
.secondary-button { flex: 1; padding: 9px; border: 1px solid #afc3b5; background: white; color: var(--brand-dark); font-size: .88rem; }
.secondary-button:hover, .secondary-button:focus-visible { background: #edf5ef; }

dialog { width: min(100% - 24px, 520px); max-height: min(760px, 92dvh); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.28); }
dialog::backdrop { background: rgba(15, 30, 22, .53); }
dialog form { padding: 20px; overflow-y: auto; }
.dialog-heading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.icon-button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #edf2ed; color: var(--ink); font-size: 1.7rem; line-height: 1; }
label, legend { display: block; margin: 16px 0 7px; font-weight: 750; font-size: .92rem; }
label span { color: var(--muted); font-weight: 500; }
select, textarea, input[type="email"], input[type="password"] { width: 100%; border: 1px solid #afc3b5; border-radius: 10px; padding: 11px; color: var(--ink); background: white; }
select:focus, textarea:focus, input:focus, button:focus-visible { outline: 3px solid #a8d4b7; outline-offset: 2px; }
textarea { resize: vertical; }
.counter { margin-top: 5px; color: var(--muted); text-align: right; font-size: .75rem; }
.location-fieldset { margin: 16px 0; padding: 0; border: 0; }
.location-fieldset legend { margin-bottom: 7px; }
.location-status { min-height: 20px; color: var(--muted); font-size: .87rem; }
.location-actions { display: flex; gap: 8px; margin-top: 9px; }
.form-error { margin: 10px 0; color: var(--danger); font-size: .88rem; font-weight: 650; }
.prototype-note { margin-top: 10px; color: var(--muted); text-align: center; font-size: .74rem; }

.map-marker { width: 31px; height: 31px; display: grid; place-items: center; border: 3px solid white; border-radius: 50% 50% 50% 0; color: white; font-size: 15px; font-weight: 800; transform: rotate(-45deg); box-shadow: 0 2px 7px rgba(0,0,0,.28); }
.map-marker span { transform: rotate(45deg); }
.map-marker.bait { background: #d94841; }.map-marker.glass { background: #e38b26; }.map-marker.caterpillar { background: #8256bf; }.map-marker.grass { background: #3b8d56; }.map-marker.dog { background: #2379b8; }
.leaflet-popup-content { min-width: 205px; margin: 13px 15px; }
.popup-category { margin-bottom: 5px; font-weight: 800; }.popup-description { margin-bottom: 9px; color: #405047; line-height: 1.35; }.popup-meta { margin-bottom: 3px; color: #627168; font-size: .78rem; }.popup-status { margin-top: 9px; color: var(--brand); font-size: .78rem; font-weight: 800; }
.popup-actions { display: flex; gap: 6px; margin-top: 11px; }.popup-actions button { flex: 1; padding: 7px 5px; border: 1px solid #b9c9bc; border-radius: 7px; background: white; color: #28503a; font-size: .71rem; font-weight: 700; }.popup-actions button:last-child { color: #8e352e; }
.toast { position: fixed; z-index: 1000; right: 16px; bottom: 18px; left: 16px; max-width: 500px; margin: auto; padding: 12px 14px; border-radius: 10px; background: #173c2b; color: white; box-shadow: 0 5px 18px rgba(0,0,0,.2); font-weight: 650; font-size: .9rem; }

@media (min-width: 700px) { .app-shell { padding-top: 24px; } #map { height: min(65dvh, 620px); } .notice { left: auto; max-width: 390px; } }
