:root{color-scheme:light;--forest:#143c31;--forest2:#1d5e47;--mint:#e1f1e7;--sage:#eff6ee;--ink:#192921;--muted:#63746a;--stroke:#dce5dc;--bg:#f7f9f6;--white:#fff;--gold:#e9b65b}*{box-sizing:border-box}html,body{height:100%;margin:0}body{font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;background:var(--bg);color:var(--ink);padding-bottom:calc(122px + env(safe-area-inset-bottom));-webkit-tap-highlight-color:transparent}.topbar{height:76px;display:flex;align-items:center;gap:12px;padding:12px 16px;background:var(--forest);color:#fff}.brandmark{height:46px;width:46px;border-radius:15px;display:grid;place-items:center;background:rgba(255,255,255,.13);font-size:25px}.brandtext{flex:1;min-width:0}.brandname{font-size:18px;letter-spacing:.8px;font-weight:850;line-height:1.1}.brandsub{font-size:11px;color:#baddc6;margin-top:4px}.version{font-size:11px;font-weight:800;padding:5px 9px;border:1px solid #6b9781;border-radius:20px}.locationbar{min-height:69px;background:white;box-shadow:0 2px 11px #1b392009;display:flex;align-items:center;justify-content:space-between;gap:7px;padding:12px 15px}.locleft{display:flex;align-items:center;gap:11px}.locleft b,.locleft span{display:block}.locleft b{font-size:13px}.locleft span:not(.locpin){font-size:11px;color:var(--muted);margin-top:2px}.locpin{color:#2d985f!important;font-size:18px!important}.localtag{font-size:10px;font-weight:700;padding:6px 8px;background:#fff1d7;color:#795613;border-radius:8px;max-width:120px;text-align:center}.view{display:none;max-width:1000px;margin:0 auto}.view.active{display:block}.toolrow{display:flex;gap:7px;padding:12px 12px 10px}.btn{font-family:inherit;font-size:14px;font-weight:750;border-radius:11px;border:0;padding:12px 15px;cursor:pointer;min-height:43px;display:inline-flex;align-items:center;justify-content:center;gap:6px;touch-action:manipulation}.btn:focus-visible,.navitem:focus-visible,.chip:focus-visible{outline:3px solid #e9b65b;outline-offset:2px}.btn.light{color:var(--forest);background:white;border:1px solid var(--stroke);box-shadow:0 2px 4px #00000008}.btn.primary{color:white;background:var(--forest2)}.btn.primary:active{background:#184d3a}.btn.danger{color:#ad3939;background:#fff3f1;border:1px solid #efceca}.btn.big{font-size:15px;padding:14px 20px}.btn.full{width:100%;margin-top:10px}.toolrow .btn{flex:1;padding:10px 5px;font-size:12px;white-space:nowrap}#map-wrap{height:min(53vh,550px);min-height:310px;position:relative;background:#deece5;border-top:1px solid #d4e0d5;border-bottom:1px solid #d4e0d5}#map{width:100%;height:100%}.map-footer{position:absolute;bottom:0;left:0;right:0;z-index:400;padding:5px 9px;background:rgba(255,255,255,.93);font-size:10px;color:#485d52;text-align:center;pointer-events:none}.leaflet-bottom.leaflet-right{bottom:25px}#map-error{position:absolute;z-index:900;top:50%;left:15px;right:15px;transform:translateY(-50%);padding:16px;border-radius:12px;background:#fffdf0;color:#624a21;box-shadow:0 7px 25px #0003;text-align:center;font-size:14px}.layerpanel{margin:11px 12px 0;background:#fff;border:1px solid var(--stroke);padding:12px;border-radius:13px}.layerhead{display:flex;justify-content:space-between;align-items:center;font-size:13px;margin-bottom:10px}.textbutton{border:0;background:none;font-size:12px;color:var(--forest2);font-weight:800;padding:2px 0}.chips{display:flex;gap:7px;flex-wrap:wrap}.chip{border:1px solid var(--stroke);background:#fff;border-radius:999px;font-size:12px;color:#455e4d;padding:9px 12px;font-weight:650;cursor:pointer}.chip.selected{background:var(--mint);color:#184f34;border-color:#95c9a8}.map-actions{padding:4px 12px 8px}.map-actions .btn{width:100%}.smallhint{text-align:center;color:var(--muted);padding:0 12px;margin:8px 0 3px;font-size:12px;line-height:1.45}.map-mode #map{cursor:crosshair!important}.map-mode .smallhint{font-weight:750;color:#946718}.section-heading{display:flex;align-items:center;justify-content:space-between;padding:22px 18px 12px}.section-heading h1{margin:0;font-size:22px;letter-spacing:-.5px}.section-heading p{margin:5px 0 0;color:var(--muted);font-size:13px}.countbadge{padding:6px 11px;background:var(--mint);color:var(--forest);font-weight:900;border-radius:15px}.filterbar{display:grid;grid-template-columns:minmax(0,1fr) 130px;gap:8px;padding:0 14px 10px}input,select,textarea{font:inherit;color:var(--ink);background:#fff;border:1px solid #d2dfd4;border-radius:10px;outline:0}input:focus,select:focus,textarea:focus{border-color:#438c63;box-shadow:0 0 0 3px #a8dec13a}.filterbar input,.filterbar select{height:43px;padding:8px 10px;font-size:13px}.list{padding:0 14px 22px;display:grid;gap:9px}.pointcard{border:1px solid var(--stroke);border-radius:15px;background:#fff;padding:13px;display:flex;align-items:center;gap:12px;box-shadow:0 2px 6px #182e1505}.pointicon{height:46px;width:46px;display:grid;place-items:center;background:var(--sage);font-size:22px;border-radius:13px;flex:none}.pointinfo{flex:1;min-width:0}.pointinfo b{display:block;font-size:14px;overflow-wrap:anywhere}.pointinfo p{margin:4px 0 0;font-size:12px;color:var(--muted);line-height:1.3}.pointactions{display:flex;flex-direction:column;gap:6px}.minibtn{border:1px solid #e0e8df;border-radius:9px;background:white;color:var(--forest2);font-size:12px;font-weight:750;padding:6px 8px}.status-dot{width:7px;height:7px;border-radius:50%;display:inline-block;margin-right:3px;background:#27874b}.status-dot.revisar{background:#c79633}.status-dot.cremat{background:#c85649}.status-dot.retirat{background:#999}.status-dot.traslladat{background:#477bc4}.empty{text-align:center;background:white;border:1px dashed #bacbbd;margin-top:11px;padding:35px 16px;border-radius:15px;color:var(--muted);line-height:1.5}.empty b{color:var(--ink)}.statsgrid{padding:0 14px 10px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.stat{border-radius:15px;background:white;padding:17px;border:1px solid var(--stroke)}.stat .number{font-size:30px;line-height:1;font-weight:900;color:var(--forest)}.stat .statlabel{font-size:12px;color:var(--muted);margin-top:9px}.panel{background:#fff;margin:11px 14px;border-radius:15px;border:1px solid var(--stroke);padding:18px}.panel h2{margin:0 0 9px;font-size:17px}.panel p{font-size:13px;color:#485a4e;line-height:1.6}.panel .warning-note{font-size:12px;color:#87621e;background:#fff8e9;padding:10px;border-radius:9px}.filebutton{cursor:pointer}.bottomnav{position:fixed;left:0;right:0;bottom:0;height:calc(65px + env(safe-area-inset-bottom));z-index:1100;background:#fff;border-top:1px solid #dce5dc;display:flex;align-items:flex-start;justify-content:space-evenly;box-shadow:0 -4px 15px #14291810;padding:5px 0 env(safe-area-inset-bottom)}.navitem{min-width:80px;flex:1;background:none;border:0;color:#687c6d;font-size:11px;font-weight:800;display:flex;align-items:center;flex-direction:column;padding:7px;gap:3px;cursor:pointer}.navitem span{font-size:21px;line-height:1.3}.navitem.active{color:var(--forest2);background:var(--sage);border-radius:12px;margin:0 7px}.modal-backdrop{position:fixed;inset:0;z-index:2000;background:#0f251dc4;display:flex;align-items:flex-end;justify-content:center}.modal-backdrop[hidden],#map-error[hidden],[hidden]{display:none!important}.modal{background:white;width:100%;max-width:560px;border-radius:22px 22px 0 0;max-height:94dvh;overflow-y:auto;padding:21px 20px calc(22px + env(safe-area-inset-bottom));box-shadow:0 -10px 45px #0002}.modal-top{display:flex;align-items:start;justify-content:space-between;margin-bottom:15px}.modal-top h2{margin:2px 0 0;font-size:22px}.eyebrow{font-weight:800;font-size:10px;letter-spacing:1px;color:#658f73}.closebtn{border:0;background:var(--sage);border-radius:50%;width:35px;height:35px;font-size:16px;cursor:pointer}.modal label:not(.filebutton){display:block;font-weight:750;font-size:12px;margin:13px 0 7px}.modal input,.modal select,.modal textarea{width:100%;padding:11px 12px;font-size:15px}.formgrid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.coords{font-size:11px;color:#66786e;margin-top:12px;background:#f1f5f1;border-radius:7px;padding:8px}.modal-buttons{display:grid;grid-template-columns:1fr 1.5fr;gap:8px;margin-top:15px}.edit-actions{display:flex;justify-content:space-between;gap:8px;margin-top:14px;border-top:1px solid var(--stroke);padding-top:12px}.edit-actions .btn{font-size:12px;padding:9px}.toast{position:fixed;left:16px;right:16px;bottom:calc(75px + env(safe-area-inset-bottom));margin:auto;max-width:480px;background:#233f31;color:white;z-index:3000;padding:12px 16px;border-radius:11px;font-size:13px;font-weight:650;opacity:0;transform:translateY(25px);pointer-events:none;transition:.2s;box-shadow:0 4px 20px #0003}.toast.show{opacity:1;transform:translateY(0)}.vc-icon{border-radius:50%;border:2px solid white;width:29px;height:29px;display:flex;justify-content:center;align-items:center;box-shadow:0 2px 9px #0007;font-size:16px;background:#1a7351}.vc-icon.aliment{background:#b38730}.vc-icon.millora{background:#417d3b}.vc-icon.parada{background:#a95c47}.vc-icon.altre{background:#626aaf}.vc-popup-title{font-weight:800;font-size:13px;margin-bottom:5px}.vc-popup-meta{font-size:12px;color:#526356}.vc-popup-btn{background:#236346;color:#fff;border:0;border-radius:8px;padding:8px 12px;font-size:12px;font-weight:800;margin-top:8px;cursor:pointer}@media(min-width:700px){.topbar,.locationbar{padding-left:max(calc((100vw - 970px)/2),22px);padding-right:max(calc((100vw - 970px)/2),22px)}#map-wrap{border:1px solid var(--stroke);border-radius:15px;overflow:hidden;margin:0 12px;height:min(60vh,610px)}.bottomnav{max-width:1000px;left:50%;transform:translateX(-50%);border:1px solid var(--stroke);border-radius:16px 16px 0 0}.modal{border-radius:18px;margin-bottom:18px}.modal-backdrop{align-items:center}}

/* V0.2 · El botó d'afegir punts queda sempre abans del mapa.
   Separem els controls del menú inferior i respectem la zona segura del mòbil. */
main{padding-bottom:calc(38px + env(safe-area-inset-bottom))}
.map-actions .btn{min-height:53px;font-size:16px;box-shadow:0 3px 10px #124a2b2b}
.map-instruction{position:absolute;z-index:550;top:12px;right:10px;max-width:205px;border-radius:9px;padding:9px 12px;font-size:12px;font-weight:800;line-height:1.35;background:#fff7d6;color:#765013;box-shadow:0 3px 12px #162c2433;pointer-events:none}
.map-mode .map-actions .btn{background:#a85520}
@media(max-width:540px){.bottomnav{height:calc(68px + env(safe-area-inset-bottom))}.navitem{min-height:55px}.map-actions{padding-top:3px}}


/* V0.3 · Versió compacta per a mòbil: menys alçada del botó i de la barra inferior */
body{padding-bottom:calc(98px + env(safe-area-inset-bottom))}
main{padding-bottom:calc(24px + env(safe-area-inset-bottom))}
.toolrow{padding:10px 12px 8px;gap:6px}
.toolrow .btn{padding:9px 4px;font-size:12px;min-height:40px}
.map-actions{padding:4px 12px 4px;text-align:center}
.map-actions .btn{width:auto;min-height:42px;font-size:14px;padding:10px 16px;border-radius:14px;box-shadow:0 2px 8px #124a2b22}
#btn-new{display:inline-flex;max-width:100%}
.smallhint{padding:0 12px;margin:6px 0 2px;font-size:11px;line-height:1.35}
#map-wrap{height:min(50vh,520px);min-height:290px}
.bottomnav{height:calc(58px + env(safe-area-inset-bottom));padding:3px 0 env(safe-area-inset-bottom)}
.navitem{font-size:10px;min-width:70px;padding:5px 4px;gap:1px}
.navitem span{font-size:18px;line-height:1.1}
.navitem.active{margin:0 5px;border-radius:10px}
.toast{bottom:calc(64px + env(safe-area-inset-bottom))}
@media(max-width:540px){.bottomnav{height:calc(58px + env(safe-area-inset-bottom))}.navitem{min-height:46px}.map-actions .btn{min-height:40px;font-size:14px;padding:9px 14px}}


/* V0.4: control compacte dins el mapa i barra inferior reduïda.
   Les regles van al final, perquè prevalguin sobre les versions anteriors. */
body{padding-bottom:calc(88px + env(safe-area-inset-bottom))}
main{padding-bottom:calc(30px + env(safe-area-inset-bottom))}
#map-wrap{height:min(65dvh,640px);min-height:340px}
#map-wrap .map-actions{position:absolute;right:9px;top:10px;z-index:950;display:flex;flex-direction:column;align-items:flex-end;gap:5px;padding:0;width:auto;max-width:calc(100% - 85px);pointer-events:none}
#map-wrap .map-actions .btn{pointer-events:auto;width:auto;display:inline-flex;min-height:40px;font-size:13px;font-weight:800;padding:9px 13px;border-radius:11px;box-shadow:0 2px 9px #1b39204a;white-space:nowrap}
#map-wrap .map-actions .smallhint{display:none;margin:0;max-width:200px;background:#fffdf3;color:#6a521d;box-shadow:0 2px 9px #1b392035;border-radius:9px;font-size:11px;padding:8px 9px;text-align:right;line-height:1.35}
.map-mode #map-wrap .map-actions .smallhint{display:block}
#map-wrap .map-instruction{display:none!important}
.bottomnav{height:calc(52px + env(safe-area-inset-bottom));padding:3px 0 env(safe-area-inset-bottom);align-items:center}
.navitem{min-height:44px;gap:1px;font-size:10px;padding:3px 4px}
.navitem span{font-size:17px;line-height:1.15}
.navitem.active{margin:0 4px}
.toast{bottom:calc(61px + env(safe-area-inset-bottom))}
@media(max-width:540px){.bottomnav{height:calc(52px + env(safe-area-inset-bottom))}.navitem{min-height:44px}#map-wrap .map-actions .btn{min-height:40px;font-size:13px;padding:9px 13px}}
