.map-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin-bottom:12px}.map-toolbar label{margin:0;min-width:110px}.map-toolbar .check{align-self:center}.map-source-note{font-size:.8rem;color:var(--muted)}.hunting-map-layout{display:grid;grid-template-columns:280px minmax(0,1fr);gap:18px;align-items:start}.map-worklist{background:white;border:1px solid var(--line);border-radius:12px;padding:18px;max-height:720px;overflow:auto}.map-worklist h2{font-size:1rem;line-height:1.45}.map-worklist details{margin-top:20px}.map-worklist summary{cursor:pointer;font-weight:650}.map-stage{min-width:0}.hunting-map{height:620px;background:#e1e8df;border:1px solid var(--line);border-radius:12px;isolation:isolate;z-index:0}.settings-map{height:470px}.map-animal-card{display:grid;gap:4px;padding:12px 0;border-bottom:1px solid var(--line);font:14px/1.45 Inter,ui-sans-serif,system-ui,sans-serif}.map-animal-card img{width:100%;max-height:170px;object-fit:contain;background:#f0f3ef;border-radius:7px;margin-bottom:6px}.map-animal-card button{font-size:.8rem;margin-top:6px}.map-error{color:#9a2c2c;font-weight:600}.map-error:empty{display:none}.map-editor{border:2px solid #397cab;padding:12px;border-radius:8px;margin-bottom:20px}.map-editor p{font-size:.82rem}.map-editor input{max-width:100%}.map-legend{display:flex;flex-wrap:wrap;gap:15px;font-size:.8rem}.harvest-pin{border:2px solid white;border-radius:50%;box-shadow:0 1px 5px #0009;text-align:center;font-weight:800;line-height:26px;background:currentColor}.harvest-pin span{color:#fff}.pin-male{color:#805674}.pin-female{color:#426a39}.pin-young{color:#316e9f}.pin-calf{color:#936509}.pin-group{color:#263e36}.map-vertex{background:#fff;color:#8b3a13;border:2px solid #d96b25;border-radius:50%;font-weight:bold;text-align:center;line-height:20px}.map-vertex.selected{background:#d7ee83;outline:3px solid #173e36}.leaflet-container .leaflet-control-attribution{font-size:10px;max-width:100%}.leaflet-container button{color:#173e36}.leaflet-popup-content{max-width:260px}.leaflet-popup-content p{margin:.5rem 0}.map-stage>p{margin-top:12px;font-size:.85rem}@media(max-width:1000px){.hunting-map-layout{grid-template-columns:230px minmax(0,1fr)}}@media(max-width:700px){.hunting-map-layout{display:flex;flex-direction:column}.map-stage{order:0;width:100%}.map-worklist{order:1;width:100%;max-height:none}.hunting-map{height:450px}.map-toolbar{gap:8px}.map-toolbar>label{flex:1}.settings-map{height:380px}.map-worklist:has(.map-editor){order:-1}.map-worklist:has(.map-editor)>h2,.map-worklist:has(.map-editor)>[data-map-missing],.map-worklist:has(.map-editor)>[data-map-missing-label],.map-worklist:has(.map-editor)>details{display:none}}

@media(max-width:700px){.map-toolbar>label:has([data-map-base]){flex-basis:100%}}

.hunting-map{height:clamp(420px,65dvh,760px)}@media(max-width:700px){.hunting-map{height:clamp(360px,62dvh,580px)}.settings-map{height:420px}.map-toolbar button{min-height:44px}.map-toolbar>button{flex:1}.leaflet-touch .leaflet-bar a{width:40px;height:40px;line-height:40px}.map-worklist{padding:14px}}

.map-controls-row{display:flex;gap:12px;align-items:flex-start;margin-bottom:16px}.map-controls{flex:1;min-width:0}.map-controls>summary{cursor:pointer;font-weight:650;padding:10px 0}.map-controls-row>button{margin-top:25px;white-space:nowrap}@media(min-width:701px){.map-controls>summary{display:none}}@media(max-width:700px){.map-controls-row{flex-wrap:wrap;align-items:center;gap:8px}.map-controls{flex-basis:100%;border:1px solid var(--line);border-radius:8px;background:white;padding:0 12px}.map-controls-row>button{margin:0;width:100%}.map-controls .map-toolbar{padding-top:8px}.map-controls .map-source-note{margin-bottom:12px}}

[hidden]{display:none!important}.hunting-map-layout.map-only{grid-template-columns:minmax(0,1fr)}.map-view-actions{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}.map-view-actions button[aria-pressed=true]{background:var(--green);color:white}.harvest-pin{display:flex;align-items:center;justify-content:center;line-height:1;font-size:12px}.harvest-pin.pin-group{font-size:14px}.map-animal-card .map-photo-button{padding:0;border:0;background:transparent;margin:0;display:block}.map-photo-button img{margin:0;cursor:zoom-in}.map-photo-viewer{position:fixed;inset:0;width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;margin:0;padding:54px 12px 12px;border:0;border-radius:0;background:#101714;color:white;overflow:hidden}.map-photo-viewer[open]{display:flex;flex-direction:column;align-items:center;gap:10px}.map-photo-viewer img{width:100%;height:0;min-height:0;flex:1;object-fit:contain}.map-photo-viewer p{margin:0;text-align:center}.map-photo-viewer [data-photo-close]{position:absolute;right:12px;top:8px;width:44px;height:44px;padding:0;font-size:30px}.map-photo-viewer::backdrop{background:#000d}

/* Follow the device setting live; no saved override or image inversion. */
:root{color-scheme:light dark}body{background:#f3f6f5}
@media(prefers-color-scheme:dark){
 :root{color:#e4eee8;background:#111c19;--green:#b8ddcc;--line:#3c5147;--muted:#b0c3b8;--red:#ffaaa2;--gold:#edcb88;--map-mask:#202e28}
 body{background:#111c19;color:#e4eee8}
 .topbar,.panel,.metric,.class-card,.map-worklist,.map-controls,dialog{background:#1b2a23;color:#e4eee8}
 button,.button,input,select,textarea{background:#25382e;color:#e4eee8;border-color:#60796b}
 button:hover,.button:hover{background:#344d3e}a{color:#b8ddcc}
 button.primary,.button.primary,.metric.featured{background:#234f3e;color:#f0faf4;border-color:#507962}
 button.primary:hover{background:#32654f}.metric.featured .value{color:#d7ee83}
 .sidebar{background:#15372d}.sidebar nav button{color:#d6e5df}.sidebar nav button.active{background:#d7ee83;color:#213a20}
 .sidebar .brand strong{color:#eff8f2}.map-view-actions button[aria-pressed=true]{background:#d7ee83;color:#213a20}
 .empty strong{color:#d7e8dd}th{background:#25382e;color:#bdd0c3}td{border-color:#354b3f}
 .badge{background:#324c3d;color:#d6e8dc}.badge.green{background:#284d31;color:#c1e8b0}.badge.yellow{background:#57451e;color:#ffe1a0}.badge.red{background:#572c29;color:#ffc2bb}
 .callout{background:#293c24;color:#dcebcf}.callout.warn,.testbanner{background:#473a1d;color:#ffe0a2}
 .preview-banner{background:#21394b;color:#d3e8ff;border-color:#446078}
 .error-text,.map-error,#stats-period-error,.danger{color:#ffaaa2}.avatar{background:#304b3a;color:#d7ee83}
 .animal-unused,progress::-webkit-progress-bar{background:#48594e}.map-animal-card img{background:#101a15}
 .hunting-map{background:#202e28}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#1b2a23;color:#e4eee8}
 .leaflet-container .leaflet-control-attribution{background:#1b2a23eb;color:#c9ddd0}.leaflet-control-attribution a{color:#b8ddcc}
 .leaflet-bar a,.leaflet-bar a:hover{background:#25382e;color:#e4eee8;border-color:#60796b}.leaflet-bar a.leaflet-disabled{background:#1b2a23;color:#85998c}
 .leaflet-container a.leaflet-popup-close-button{color:#d9e9df}.leaflet-container button{color:#e4eee8}
 .map-photo-viewer{background:#101714;color:white}.skip:focus{background:#25382e;color:#e4eee8}
}
