:root{font:15px/1.45 Helvetica,Arial,sans-serif;color:#202820;color-scheme:light;--panel:#fffdfa;--line:#dedfd5;--ink:#223227;--accent:#355443}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0}
main,#map{position:absolute;inset:0}
#map{background:#d7e2df;font-family:inherit}
button,input,select,textarea{font:inherit}
button{cursor:pointer;color:inherit}
button:focus-visible,summary:focus-visible{outline:2px solid #4b8663;outline-offset:3px}
.bar,.panel,.status,#coords,#at-center{position:absolute;z-index:500}
.bar{top:18px;left:18px;right:18px;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:14px;pointer-events:none}
.bar>*{pointer-events:auto}
.identity,.switch,.add,.panel,.status,#coords,#at-center{background:var(--panel);border:1px solid var(--line);border-radius:10px}
.identity{display:flex;gap:10px;align-items:center;padding:5px 15px 5px 6px;width:max-content}
.compass{background:#e8eee8;border:0;border-radius:7px;height:36px;width:36px;color:var(--accent);font-size:23px}
h1{font-size:17px;letter-spacing:-.025em;margin:0}
.switch{display:flex;align-items:center;padding:4px;gap:3px}
.switch button,.jumps button{background:none;border:0;border-radius:6px}
.switch button{padding:7px 16px;font-weight:600}
.switch button[aria-pressed=true]{background:#e0e9de;color:#203c2c}
.add,#save,#at-center{justify-self:end;background:var(--accent);color:white;border:1px solid #2b4638;padding:10px 15px;font-weight:600;border-radius:9px}
.add[aria-pressed=true]{background:#fffdfa;color:var(--accent)}
.panel{left:18px;top:78px;width:215px}
summary{font-weight:700;cursor:pointer;padding:13px 16px}
.layer-list{margin:0 14px;padding:6px 0 10px;border-top:1px solid var(--line)}
.layer-list label{display:flex;align-items:center;gap:9px;padding:5px 0;font-size:13px;cursor:pointer}
input[type=checkbox]{width:16px;height:16px;margin:0;accent-color:var(--accent)}
.jumps{display:flex;padding:8px;border-top:1px solid var(--line);gap:3px}
.jumps button{padding:6px 7px;font-size:12px;white-space:nowrap}
.jumps button:hover,.switch button:hover{background:#e9eee7}
.status,#at-center{bottom:65px;left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100% - 110px);text-align:center;padding:9px 13px;font-size:13px}
#at-center{bottom:20px}
#coords{bottom:29px;left:12px;padding:3px 7px;font-size:11px;font-variant-numeric:tabular-nums;pointer-events:none}
.leaflet-bottom.leaflet-right .leaflet-control-zoom{margin-bottom:30px;margin-right:18px}
.leaflet-control-scale{margin-left:12px}
.leaflet-control-attribution{max-width:100vw}
.leaflet-container.placing{cursor:crosshair}
.leaflet-container .carnet-marker{border:2px solid white;background:var(--accent);color:white;border-radius:50%;display:grid;place-items:center;font-weight:700;overflow:hidden}
.carnet-marker img{width:100%;height:100%;object-fit:cover}
.leaflet-popup-content{width:min(246px,68vw)!important;margin:14px}
.leaflet-popup-content h3{margin:4px 0;font-size:17px}
.leaflet-popup-content p{margin:8px 0;white-space:pre-wrap}
.leaflet-popup-content small{color:#4b5a50}
.photo-button{display:block;border:0;padding:0;background:none;width:100%;margin:8px 0}
.photo-button img{width:100%;height:135px;object-fit:cover;border-radius:7px}
.popup-edit{border:1px solid var(--line);border-radius:6px;padding:5px 10px;background:var(--panel);margin-top:5px}
dialog{width:min(92vw,430px);max-height:90dvh;border:1px solid var(--line);border-radius:14px;background:var(--panel);color:inherit;padding:20px;}
dialog::backdrop{background:#1e2f2a65;backdrop-filter:blur(4px)}
form{display:grid;gap:12px}
form header,form footer{display:flex;align-items:center;justify-content:space-between;gap:12px}
form h2{margin:0;font-size:21px}
form label{display:grid;gap:4px;font-size:13px}
form input:not([type=checkbox]),form select,form textarea{width:100%;padding:8px;border:1px solid var(--line);border-radius:6px;background:white;color:inherit}
form .remove{display:flex;align-items:center;gap:7px}
#thumbnail{max-width:100%;max-height:110px;border-radius:6px}
#close,#close-picture,#delete{border:0;background:none;padding:5px 8px}
#close,#close-picture{font-size:24px}
#delete,#error{color:#932b26}
#save{margin-left:auto}
#viewer{width:max-content;max-width:95vw;padding:8px;background:#222a25;color:white}
#viewer img{display:block;max-width:100%;max-height:82dvh;object-fit:contain}
#close-picture{position:absolute;right:10px;top:10px;color:white;background:#222a25;border-radius:8px}
@media(max-width:630px){.bar{left:9px;right:9px;top:9px;gap:6px}.identity{padding:4px 7px 4px 4px;gap:5px}.compass{height:28px;width:27px;font-size:18px}h1{font-size:13px}.switch button{padding:5px 6px;font-size:12px}.add{padding:7px 6px;font-size:12px}.panel{left:9px;top:59px;width:187px}.jumps{padding:5px}.jumps button{padding:5px}.leaflet-bottom.leaflet-right .leaflet-control-zoom{margin-right:9px;margin-bottom:42px}}
@media(max-width:360px){.bar{grid-template-columns:1fr auto;grid-template-areas:"title add" "mode mode";justify-items:start}.identity{grid-area:title}.switch{grid-area:mode}.add{grid-area:add}.panel{top:98px}}
.bar{display:flex;justify-content:space-between;align-items:flex-start}
.identity{padding:9px 12px;gap:10px;min-height:44px}
.identity img{width:48px;height:auto;filter:brightness(0);display:block}
.tools,.switch{display:flex;gap:4px;align-items:center}
.tools>.icon-button{background:var(--panel);border:1px solid var(--line);}
.icon-button,.switch button{position:relative;display:inline-grid;place-items:center;width:36px;height:36px;border:0;border-radius:7px;padding:0;text-decoration:none;color:var(--ink);background:#eef1e9;cursor:pointer}
.icon-button svg,.switch svg,.carnet-marker svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}
#import-button:focus-within{outline:2px solid #4b8663}
#import-button input{position:absolute;inset:0;opacity:0;width:100%;cursor:pointer}
.switch{gap:1px}.switch button{background:none}
.panel{max-height:70dvh;overflow:auto}
.layer-list:last-child{margin-bottom:0}
.leaflet-container,.leaflet-container.placing{cursor:crosshair}
.leaflet-container.leaflet-dragging,.leaflet-dragging .leaflet-container{cursor:grabbing}
.leaflet-interactive{cursor:pointer}
.leaflet-container .carnet-marker{cursor:pointer}
.carnet-marker svg{width:17px;height:17px}
.carnet-marker span{display:grid;width:100%;height:100%;place-items:center}
.leaflet-container .refuge-marker{background:#fff7e6;color:#244c36;border-color:#244c36}
.leaflet-container .trace-vertex{background:#fff;border:2px solid #355443;border-radius:50%;cursor:grab}
.leaflet-container .trace-midpoint{background:#fff8;border:1px solid #355443;border-radius:50%;cursor:grab}
.popup-actions{display:flex;gap:8px;margin-top:8px}
#viewer{background:transparent;padding:0;border:1px solid white;border-radius:3px}
.map-action{position:absolute;z-index:500;bottom:30px;left:50%;translate:-50% 0;background:#355443;color:white;border:0;border-radius:8px;padding:9px 12px}
#geometry,#confirm-action{border:1px solid var(--line);border-radius:7px;background:#e5ebe1;padding:8px 12px}
#confirm-title{margin:0;font-size:19px}
@media(max-width:640px){.identity img{width:34px}.identity{padding:7px 6px;gap:5px;min-height:36px}.tools{gap:2px}.icon-button,.switch button{width:29px;height:30px}.switch{padding:2px}.icon-button svg,.switch svg{width:17px;height:17px}}
@media(max-width:390px){.identity img{width:28px}.identity h1{font-size:11px}.tools>.icon-button,.switch button{width:25px}}
.carnet-marker:not(.refuge-marker){background:#375447}
.leaflet-container.leaflet-dragging,.leaflet-container.leaflet-dragging *{cursor:grabbing!important}
.bar{inset:0 0 auto;min-height:52px;background:rgba(255,255,255,.95);backdrop-filter:blur(12px);padding:4px 17px;border-bottom:1px solid #20282012;align-items:center;pointer-events:auto}
.identity,.switch,.tools>.icon-button{background:none;border:0;border-radius:0}
.identity{padding:4px 0}.identity a{display:block}
.switch button[aria-pressed=true]{background:#2028200e;color:#202820}
.panel{top:61px;background:transparent;border:0;}
.layer-list{border-color:#fff7}
.layer-list label{font-weight:500}
.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:rgba(255,255,255,.94);backdrop-filter:blur(7px)}
.leaflet-popup.oriented-photo .leaflet-popup-tip-container{display:none}
dialog{background:rgba(255,255,255,.96)}
#viewer{background:#ffffff0c}
.photo-arrow{position:absolute;display:block;width:25px;height:25px;pointer-events:none;color:#fff}
.photo-arrow svg{fill:none;stroke:currentColor;stroke-width:2.7;stroke-linecap:round;stroke-linejoin:round}
.leaflet-container.moving-pin,.leaflet-container.moving-pin *{cursor:grabbing!important}
.carnet-marker{touch-action:none}
@media(max-width:640px){.bar{min-height:44px;padding:3px 9px}.panel{top:48px}.identity{min-height:0}}
.leaflet-national-contours-pane{filter:brightness(0) invert(1)}
.leaflet-popup-content p{max-height:22vh;overflow:auto}

/* Shared portal header above the full-width map. */
.jules-section-name{font-size:inherit;margin:0}
.jules-tools .switch{border:0;background:transparent;padding:0}
.jules-tools .jules-action{padding:0;font-weight:400}
.jules-action svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}
#map{top:64px}
.panel{top:72px;width:max-content;max-width:calc(100vw - 24px);background:#fff;color:#171717;border:1px solid #2223;border-radius:8px}
.panel summary{padding:8px 12px}
.panel .layer-list{margin:0 12px;padding:4px 0;border-color:#2222}
.panel .layer-list label{padding:5px 0}
.panel input[type=checkbox]{accent-color:#222}
.photo-arrow{color:#222;background:#fff;border:1px solid #222;border-radius:50%;padding:3px}
.leaflet-container .leaflet-popup-content-wrapper,.leaflet-container .leaflet-popup-tip,.leaflet-container .leaflet-control-layers,.leaflet-container .leaflet-bar{box-shadow:none}
@media(max-width:520px){#map{top:56px}.panel{top:62px}}
@media(max-width:350px){.jules-section-name{font-size:12px}.jules-tools .jules-action{width:30px}}

.editing-photo-angle .photo-button{cursor:grab;touch-action:none;user-select:none}
.editing-photo-angle .photo-button:active{cursor:grabbing}
.popup-actions button[aria-pressed=true]{background:#dce5dc}

.panel:has(details:not([open])){border-color:transparent;background:transparent}
.panel summary{display:grid;place-items:center;list-style:none;width:36px;height:36px;padding:0;color:#171717;background:#fff;border-radius:7px}
.panel summary::-webkit-details-marker{display:none}
.panel summary svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.panel details[open] summary svg{transform:rotate(180deg)}
.panel .layer-list label{position:relative;padding:6px 8px;border-radius:5px;color:#737773}
.panel .layer-list label:hover{background:#f1f1f1}
.panel .layer-list label:has(input:checked){color:#454846;font-weight:600}
.panel .layer-list label:has(input:focus-visible){outline:2px solid #555;outline-offset:1px}
.panel .layer-list label:has(input:disabled){opacity:.45;cursor:default}
.panel .layer-list input{position:absolute;opacity:0;width:1px;height:1px}
@media(pointer:coarse){.panel .layer-list label{min-height:44px}}
.panel:has(#layers:not([open])){border-color:transparent;background:transparent}
.panel .ruler-toggle{display:grid;place-items:center;width:36px;height:36px;margin:5px 0 0;border:1px solid #2223;border-radius:7px;background:#fff;color:#454846}
.ruler-toggle svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round}
.panel .ruler-toggle[aria-pressed=true]{background:#454846;color:white}
#ruler-panel{width:min(220px,calc(100vw - 36px));margin-top:5px;background:#fff;color:#171717;border:1px solid #2223;border-radius:7px;padding:9px 11px;font-size:13px}
#ruler-panel p{margin:0 0 6px}
#ruler-panel p:last-child{margin-bottom:0}
#ruler-value{display:flex;align-items:center;gap:5px}
#ruler-km{width:75px;padding:3px 5px;border:1px solid #2224;border-radius:4px;color:inherit;background:#fff}
#ruler-reset{margin-top:6px;padding:4px 0;border:0;background:none;color:#454846;text-decoration:underline;text-underline-offset:3px}
.ruler-handle{border-radius:50%;background:white;border:2px solid #252525;cursor:grab}
@media(pointer:coarse){.panel .ruler-toggle{width:44px;height:44px}}
