:root {
  color-scheme: light;
  --forest: #112d22;
  --ink: #183428;
  --muted: #51665a;
  --lime: #ddf49d;
  --paper: #f5f7f2;
  --line: #dce5da;
  font-family: "Aptos", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button { font: inherit; }
button:focus-visible, a:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #558e65; outline-offset: 3px; }
button:disabled, select:disabled { opacity: .62; cursor: wait; }

.wrap { width: min(100% - 64px, 1344px); margin-inline: auto; }
.hero { background: var(--forest); color: #fff; padding: 24px 0 31px; }
.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.site-header a { min-height: 44px; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.site-link {
  display: inline-flex; align-items: center; padding-inline: 10px; border-radius: 8px;
  color: #edf8dc; font-size: .875rem; font-weight: 700; text-underline-offset: .2em;
}
.site-link:hover { background: #234437; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: #edf8dc; font-size: 21px; font-weight: 760; text-decoration: none; letter-spacing: -.04em;
}
.brand-mark {
  width: 29px; height: 29px; border-radius: 8px; display: grid; place-items: center;
  background: var(--lime);
}
.brand-mark::before {
  content: ""; width: 16px; height: 16px; background: var(--forest);
  clip-path: polygon(0 0, 37% 24%, 63% 24%, 100% 0, 92% 58%, 50% 100%, 8% 58%);
}
.hero-row { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-top: 18px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2.2rem, 4vw, 3.7rem); line-height: 1.03; letter-spacing: -.063em; font-weight: 760; }
.hero p { color: #c7dbce; margin-top: 11px; line-height: 1.5; }
.info-hero .hero-row, .info-card { max-width: 760px; margin-inline: auto; }
.info-layout { padding-block: clamp(14px, 3vw, 32px) 36px; }
.info-card {
  padding: clamp(16px, 4vw, 38px);
  background: #fff; border: 1px solid var(--line); border-radius: 13px;
  box-shadow: 0 2px 5px #15332608; overflow-wrap: anywhere;
}
.info-card section + section { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 22px; }
.info-card p { margin-top: 9px; color: var(--muted); line-height: 1.6; }
.info-card p a, .capture-note a { color: #1c6546; font-weight: 650; text-underline-offset: .18em; }
.info-card .button { margin-top: 16px; text-decoration: none; }
.button {
  display: inline-flex; gap: 9px; align-items: center; justify-content: center;
  width: fit-content; min-height: 44px; padding: 9px 14px; border: 1px solid transparent;
  border-radius: 8px; cursor: pointer; font-weight: 700; font-size: .875rem; line-height: 1.3;
}
.button-primary { background: var(--lime); color: var(--forest); }
.button-primary:hover:not(:disabled) { background: #e7f9b4; }
.hero .button { min-height: 47px; padding-inline: 16px; white-space: nowrap; }
.button-light { background: #fff; color: var(--ink); border-color: var(--line); }
.button-light:hover:enabled { background: #edf3e9; }
.camera-icon, .locate-icon { position: relative; flex: 0 0 auto; display: inline-block; }
.camera-icon { width: 16px; height: 12px; border: 1.6px solid currentColor; border-radius: 3px; margin-top: 2px; }
.camera-icon::before { content: ""; position: absolute; top: -3px; left: 4px; width: 6px; height: 2px; background: currentColor; border-radius: 2px 2px 0 0; }
.camera-icon::after { content: ""; position: absolute; inset: 2px auto auto 4px; width: 5px; height: 5px; border: 1.4px solid currentColor; border-radius: 50%; }
.locate-icon { width: 15px; height: 15px; border: 1.5px solid currentColor; border-radius: 50%; }
.locate-icon::after { content: ""; position: absolute; inset: 3px; background: currentColor; border-radius: 50%; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) clamp(265px, 25%, 325px); align-items: start; gap: 22px; padding-block: 25px 36px; }
.map-card, .side-card { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; box-shadow: 0 2px 5px #15332608; }
.map-bar, .side-heading {
  min-height: 65px; padding: 12px 16px; align-items: center; gap: 10px;
}
.side-heading { display: flex; justify-content: space-between; }
.map-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; }
.map-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.select-control { position: relative; min-width: 0; }
.select-control select { appearance: none; display: block; width: 100%; padding-inline-end: 32px; }
.select-control::after {
  content: ""; position: absolute; inset: 50% 13px auto auto; width: 7px; height: 7px;
  transform: translateY(-75%) rotate(45deg); border: solid var(--ink); border-width: 0 1.5px 1.5px 0;
  pointer-events: none;
}
h2 { font-size: 1.125rem; line-height: 1.25; font-weight: 750; letter-spacing: -.033em; }
#map { height: clamp(460px, 63vh, 760px); z-index: 0; border-block: 1px solid var(--line); background: #e3ebe3; }
.leaflet-container { font-family: inherit; }
.leaflet-control-zoom a { color: var(--ink); }
.leaflet-touch .leaflet-control-zoom a { width: 44px; height: 44px; line-height: 44px; }
.leaflet-popup-content { margin: 12px; }
.map-footer {
  min-height: 46px; padding: 1px 16px; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 8px 15px; color: var(--muted); font-size: .875rem;
}
.map-legend[open] { flex: 1 0 100%; }
.map-legend summary { width: fit-content; min-height: 44px; padding: 11px 4px; border-radius: 5px; cursor: pointer; color: var(--ink); font-weight: 700; }
.map-legend summary:focus-visible { outline-offset: -2px; }
.legend-list { display: flex; flex-wrap: wrap; gap: 8px 18px; list-style: none; margin: 0; padding: 0 4px 12px; }
.legend-list li { display: flex; align-items: center; gap: 7px; }
.legend-list .sighting-symbol { width: 28px; height: 28px; box-shadow: none; }
.legend-list .sighting-symbol img { width: 19px; height: 19px; }
#map-status { padding-block: 6px; }
#map-status:empty { display: none; }
.count { min-width: 29px; text-align: center; border-radius: 6px; padding: 4px 7px; background: #edf4e8; color: #305942; font-weight: 740; font-size: .875rem; }
.reports { border-top: 1px solid var(--line); padding: 10px 12px; }
.empty-message { padding: 16px 8px; color: var(--muted); line-height: 1.58; }
.report-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.report {
  width: 100%; display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 10px; align-items: center;
  padding: 7px; text-align: left; border: 0; border-radius: 9px; background: transparent; color: var(--ink); cursor: pointer;
}
.more-reports { margin: 10px 7px 3px; }
.report:hover { background: #edf4e8; }
.report img { width: 62px; height: 52px; object-fit: cover; border-radius: 6px; background: #edf4e8; }
.report strong, .report time { display: block; }
.report time, .popup-details { color: var(--muted); font-size: .8125rem; margin-top: 3px; }
.popup-animal { display: block; margin-bottom: 7px; font-size: .9375rem; }
.popup-photo { display: block; width: 224px; max-width: 100%; max-height: 180px; object-fit: cover; border-radius: 5px; background: #edf4e8; }
.popup-description { margin: 8px 0; font-size: .875rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.popup-details { display: block; }
.sighting-pin, .sighting-symbol { display: grid; place-items: center; border-radius: 50%; }
.sighting-symbol {
  width: 36px; height: 36px; background: var(--forest); color: #fff;
  border: 2px solid #fff; box-shadow: 0 1px 5px #102b24a6; forced-color-adjust: none;
}
.sighting-symbol img { display: block; width: 25px; height: 25px; }
.sighting-pin:focus-visible { outline: 3px solid #1c6546; outline-offset: 1px; }

dialog {
  width: min(100% - 28px, 510px); max-height: calc(100% - 28px); padding: 0;
  border: 1px solid var(--line); border-radius: 15px; background: #fff; color: var(--ink);
  box-shadow: 0 22px 75px #081c1473;
}
dialog::backdrop { background: #0c231bc2; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 17px; border-bottom: 1px solid var(--line); }
.close-button {
  border: 0; background: transparent; color: var(--ink); cursor: pointer; font-size: 1.6rem;
  width: 44px; height: 44px; line-height: 1; border-radius: 8px;
}
.close-button:hover { background: #edf4e8; }
.camera-view { background: var(--forest); }
.camera-view video, .camera-view img { display: block; width: 100%; max-height: 45vh; object-fit: contain; }
.capture-status, .capture-note { padding-inline: 17px; line-height: 1.5; }
.capture-status { margin: 13px 0 6px; font-weight: 670; }
.capture-note { color: var(--muted); font-size: .875rem; margin-bottom: 13px; }
.capture-fields { display: grid; gap: 6px; margin: 12px 17px; }
.capture-fields label { font-size: .875rem; font-weight: 700; }
.capture-fields .select-control { margin-bottom: 6px; }
.capture-fields select, .capture-fields textarea {
  min-height: 44px; width: 100%; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--paper); color: var(--ink); font: inherit;
}
.capture-fields select { padding-inline-end: 32px; }
.capture-fields textarea { resize: vertical; }
.capture-fields textarea:focus-visible { outline: 2px solid #558e65; outline-offset: 2px; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; padding: 0 17px 16px; }

@media (max-width: 960px) {
  .map-bar { grid-template-columns: minmax(0, 1fr) auto; }
  .map-filters { grid-column: 1 / -1; }
}
@media (max-width: 850px) {
  .wrap { width: calc(100% - 36px); }
  .layout { gap: 15px; }
}
@media (max-width: 680px) {
  .wrap { width: calc(100% - 28px); }
  .hero { padding-block: 17px 20px; }
  .site-header { column-gap: 8px; }
  .site-header .brand { font-size: 1.125rem; gap: 8px; }
  .site-link { padding-inline: 6px; }
  .hero-row { display: grid; gap: 16px; margin-top: 16px; }
  .hero p { margin-top: 8px; }
  .layout { grid-template-columns: minmax(0, 1fr); padding-block: 14px 24px; }
  .map-bar, .side-heading { padding-inline: 12px; min-height: 58px; }
  .map-filters select { padding-inline: 7px 18px; font-family: inherit; font-size: 1rem; font-weight: 600; }
  .map-filters .select-control::after { right: 9px; }
  .map-footer { padding-inline: 12px; }
  #map { height: clamp(340px, 54vh, 500px); }
  .camera-view img { max-height: 34vh; }
}
@media (max-width: 360px) {
  .map-bar { padding-inline: 8px; }
  .map-bar h2 { font-size: 1rem; }
  .map-bar button { padding-inline: 8px; gap: 5px; }
  .map-filters { gap: 6px; }
  .dialog-actions .button { padding-inline: 10px; }
}
