.map { height: clamp(420px, 64vh, 640px); background: var(--surface-2); font-family: var(--font-body); isolation: isolate; }
.map.compact { height: 260px; border-radius: 10px; overflow: hidden; }
.map-card { overflow: hidden; }
.map-wrap { position: relative; isolation: isolate; }
.map-off { padding: 24px; color: var(--ink-3); }
.map-foot { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-2); }
.map-foot .lg { display: inline-flex; align-items: center; gap: 6px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 5px 11px; font-size: 13px; cursor: pointer; color: var(--ink-3); }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.af-line { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-dasharray: 1 6; stroke-linecap: round; stroke-opacity: .7; }
.map[data-base="satellite"] .af-line { stroke: #fff; stroke-opacity: .9; }
.pin { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.pin .halo { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.pin.small .halo { width: 20px; height: 20px; }
.pin b { font: 500 11px/1.5 var(--font-mono); color: var(--ink); background: color-mix(in oklab, var(--surface) 85%, transparent); padding: 0 4px; border-radius: 4px; white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.pin:focus { outline: none; }
.pin:focus-visible .halo { outline: 2.5px solid var(--flag); outline-offset: 2px; }
.leaflet-container .leaflet-control-attribution { font-size: 10px; }
.leaflet-control-scale-line { font-family: var(--font-mono); font-size: 10.5px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 10px 16px; color: var(--ink); text-decoration: none; }
.list a:hover { background: var(--surface-2); }
.list .sub { font-size: 12.5px; color: var(--ink-3); }
.pid { font-family: var(--font-mono); font-size: 12px; font-weight: 500; padding: 1px 7px; border-radius: 5px; background: var(--surface-2); color: var(--ink-2); }
.panel-head { padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.panel-head .row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.panel-head h1 { font-size: 26px; font-weight: 650; line-height: 1.15; }
.panel-body { padding: 16px 20px 20px; display: grid; gap: 18px; }
.panel-body h3 { font-size: 15px; font-weight: 650; margin-bottom: 8px; }
.photo { display: block; width: 100%; max-height: 320px; object-fit: cover; border-radius: 10px; }

/* filters */
button.chip { cursor: pointer; font: inherit; font-size: 13px; font-weight: 550; }
button.chip[aria-pressed="false"] { color: var(--ink-3); background: transparent; border-style: dashed; }
button.chip[aria-pressed="false"] svg { opacity: .35; }
.species-filter { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.species-filter .select { max-width: 220px; font-size: 13px; padding: 5px 8px; }
.map-foot .note { margin-left: auto; color: var(--ink-3); }

/* reports beside the map */
.reports-panel { position: sticky; top: 74px; max-height: calc(100vh - 92px); display: flex; flex-direction: column; }
.reports-panel .list.scroll { overflow-y: auto; min-height: 0; }
.reports-panel h2 .muted { font-family: var(--font-mono); font-size: 13px; font-weight: 500; }

/* hover / focus tooltip on markers */
.leaflet-tooltip.map-tip { background: var(--ink); color: var(--surface); border: 0; border-radius: 6px; padding: 5px 9px; font: 12.5px/1.4 var(--font-body); box-shadow: var(--shadow); }
.leaflet-tooltip-top.map-tip::before { border-top-color: var(--ink); }

@media (max-width: 1040px) {
  .reports-panel { position: static; max-height: 60vh; }
}

/* sighting photos on patch pages */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo-card { margin: 0; display: grid; gap: 4px; }
.photo-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--surface-2); }
.photos.single { grid-template-columns: 1fr; }
.photos.single img { aspect-ratio: auto; max-height: 360px; }
.photo-card figcaption { font-size: 12px; color: var(--ink-3); }
.photo-credit { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.edit-photo { max-width: 560px; margin-bottom: 14px; }
.edit-photo img { aspect-ratio: auto; max-height: 260px; }
