:root{--m-green:#174f3b;--m-green2:#2f7250;--m-ink:#071221;--m-muted:#667078;--m-cream:#fbf8f0;--m-line:#e7e4dc;--m-card:#fff;--m-blue:#e6f1f5;--m-sand:#f4ead9;--m-sage:#e8f0df}
.mobile-shell,.mobile-map-bar{font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text","Segoe UI",Roboto,sans-serif;color:var(--m-ink)}
.mobile-shell{position:fixed;inset:0;z-index:70;background:linear-gradient(180deg,#fffdf7 0%,#fff 42%,#faf9f5 100%);overflow:hidden;padding-top:env(safe-area-inset-top);padding-bottom:calc(79px + env(safe-area-inset-bottom))}
.mobile-shell.hidden,.mobile-map-bar.hidden{display:none!important}.mobile-shell::before{content:"";position:absolute;inset:0 0 auto;height:315px;opacity:.16;pointer-events:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='130' viewBox='0 0 220 130'%3E%3Cg fill='none' stroke='%237d8b77' stroke-width='.75'%3E%3Cpath d='M-10 21C25 2 53 4 88 19s72 11 142-15'/%3E%3Cpath d='M-12 38C28 19 57 19 91 34s74 12 139-10'/%3E%3Cpath d='M-10 57c37-18 67-19 103-4s77 14 137-4'/%3E%3Cpath d='M-10 77c39-16 69-19 105-5s78 16 135 1'/%3E%3Cpath d='M-8 97c42-14 73-17 108-3s76 16 130 4'/%3E%3C/g%3E%3C/svg%3E");background-size:270px 160px}
.m-topbar{position:relative;z-index:3;height:118px;display:flex;align-items:center;justify-content:space-between;padding:18px 22px 6px}.m-brand{display:flex;align-items:center;min-width:0}.m-brand>img{width:89px;height:65px;object-fit:contain}.m-brand>div{min-width:0}.m-brand strong{display:block;font-size:35px;line-height:.9;letter-spacing:-1.5px;color:#003f36;white-space:nowrap}.m-brand strong span{color:#568765}.m-brand small{display:block;margin-top:8px;font-size:8.4px;letter-spacing:2.2px;color:#5e6261;white-space:nowrap}.m-top-actions{display:flex;align-items:center;gap:9px}.m-gps-chip{height:52px;border:0;border-radius:28px;background:rgba(255,255,255,.92);box-shadow:0 5px 16px rgba(25,38,30,.10);display:flex;align-items:center;gap:8px;padding:0 14px;color:#14352f}.m-gps-chip b{display:block;font-size:12px}.m-gps-chip small{display:block;font-size:10px;color:#7b8182}.m-gps-chip i{width:8px;height:8px;border-radius:50%;background:#70a63e}.m-nav-arrow{font-size:16px;color:#0d5a4f;transform:rotate(-20deg)}.m-circle-btn{width:51px;height:51px;border:0;border-radius:50%;background:#fff;box-shadow:0 5px 18px rgba(25,38,30,.11);display:grid;place-items:center}.m-circle-btn img{width:26px;height:26px}.m-mountain{position:absolute;z-index:1;right:-52px;top:108px;width:330px;height:158px;background:url('mobile-mountain.png') right bottom/contain no-repeat;opacity:.34;filter:sepia(.18) saturate(.75)}
.m-content{position:relative;z-index:2;height:calc(100% - 112px);overflow-y:auto;-webkit-overflow-scrolling:touch;padding:10px 18px 34px}.m-eyebrow{font-size:13px;letter-spacing:4px;font-weight:700;color:#5d666b;margin:6px 6px 8px}.m-title{font-size:31px;line-height:1.08;letter-spacing:-1.1px;margin:0 6px 6px}.m-subtitle{font-size:17px;line-height:1.32;color:var(--m-muted);margin:0 6px 19px}.m-grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}.m-card{border:1px solid rgba(62,73,65,.08);border-radius:20px;background:rgba(255,255,255,.94);box-shadow:0 6px 18px rgba(38,47,40,.055);overflow:hidden}.m-feature-card{position:relative;min-height:166px;padding:22px;background:linear-gradient(135deg,#f1f5ec,#fffdf7)}.m-feature-card.sand{background:linear-gradient(135deg,#fbf4e6,#fff)}.m-feature-card.blue{background:linear-gradient(135deg,#eef6f3,#e6f1f5)}.m-feature-card h3{margin:0 0 7px 58px;font-size:21px}.m-feature-card p{margin:0 0 0 58px;color:#5f696e;font-size:15px;line-height:1.25}.m-feature-card .m-ico{position:absolute;left:18px;top:18px;width:48px;height:48px;border-radius:50%;background:#dcebcf;display:grid;place-items:center}.m-feature-card.sand .m-ico{background:#efd9b7}.m-feature-card.blue .m-ico{background:#cfe5ee}.m-ico img{width:27px;height:27px}.m-card-chevron{position:absolute;right:17px;top:23px;font-size:30px;font-weight:300}.m-hills{position:absolute;left:0;right:0;bottom:0;height:57px;opacity:.58;background:linear-gradient(164deg,transparent 0 38%,#89a383 39% 55%,#6f9273 56% 100%);clip-path:polygon(0 62%,12% 42%,28% 66%,48% 24%,63% 52%,81% 16%,100% 43%,100% 100%,0 100%)}
.m-hero{height:285px;margin-top:12px;border-radius:21px;padding:26px;color:#fff;position:relative;overflow:hidden;background:linear-gradient(115deg,rgba(0,0,0,.74),rgba(0,0,0,.08)),linear-gradient(135deg,#30483d,#96a477)}.m-hero::after{content:"";position:absolute;inset:0;background:radial-gradient(circle at 78% 45%,rgba(212,239,226,.42),transparent 35%)}.m-badge{position:relative;z-index:2;display:inline-flex;gap:9px;align-items:center;background:#397231;border-radius:22px;padding:9px 15px;font-size:11px;letter-spacing:2px;font-weight:800}.m-hero h2{position:relative;z-index:2;font-size:27px;margin:20px 0 12px}.m-hero p{position:relative;z-index:2;width:54%;font-size:17px;line-height:1.32}.m-polaroid{position:absolute;z-index:2;width:145px;height:164px;right:35px;bottom:-6px;background:#f2eee4;padding:9px;transform:rotate(-7deg);box-shadow:0 8px 20px rgba(0,0,0,.3)}.m-polaroid::before{content:"";display:block;height:119px;background:linear-gradient(150deg,#777,#b9b9b3 50%,#5c6e60)}
.m-section-row{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:12px}.m-panel{padding:16px}.m-panel-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.m-panel-head h3{font-size:17px;margin:0}.m-panel-head a{font-size:12px;color:#376f50}.m-activity{display:grid;grid-template-columns:62px 1fr;gap:10px;padding:8px 0;border-top:1px solid var(--m-line)}.m-activity:first-of-type{border-top:0}.m-thumb{width:62px;height:48px;border-radius:8px;background:linear-gradient(135deg,#a6b39c,#5b715d);display:grid;place-items:center;color:#fff}.m-activity b{font-size:13px}.m-activity small{display:block;color:#777;font-size:10px;margin-top:2px}.m-near-photo{height:76px;border-radius:11px;background:linear-gradient(140deg,#677c65,#d6c69a 65%,#718e74)}.m-open-btn{width:100%;height:43px;border:0;border-radius:14px;background:#e5efd8;color:#194d39;font-weight:800;margin-top:10px}
.m-search{display:flex;align-items:center;gap:11px;height:58px;border-radius:31px;background:#fff;border:1px solid #ddd;padding:0 20px;margin:5px 0 14px;color:#9aa0a4;font-size:17px}.m-search::before{content:'⌕';font-size:31px;color:#495157}.m-filter-row{display:flex;gap:9px;overflow-x:auto;margin-bottom:16px}.m-filter{white-space:nowrap;border:1px solid #e1e0dc;background:#fff;border-radius:17px;padding:12px 17px;font-size:14px}.m-filter.active{background:#dfead8;color:#174d38;font-weight:800}.m-list{display:grid;gap:11px}.m-history-item,.m-project-item{position:relative;display:grid;grid-template-columns:38% 1fr;gap:14px;padding:12px;border-radius:17px;border:1px solid #e2e1dc;background:rgba(255,255,255,.94)}.m-history-item:first-child{border-color:#4b8e60;background:linear-gradient(90deg,#f8fbf3,#fff)}.m-list-photo{min-height:148px;border-radius:13px;background:linear-gradient(145deg,#506b54,#d6c18e 58%,#779574);position:relative}.m-list-photo.bw{filter:grayscale(1)}.m-photo-count{position:absolute;bottom:8px;left:8px;background:#263d31;color:white;border-radius:15px;padding:5px 10px;font-size:11px}.m-item-copy h3{font-size:19px;margin:4px 22px 7px 0}.m-item-copy p{font-size:13px;line-height:1.28;color:#687076;margin:7px 0}.m-meta{display:flex;gap:12px;flex-wrap:wrap;font-size:12px;color:#626a6d}.m-meta strong{color:#1c5942}.m-item-arrow{position:absolute;right:14px;top:16px;font-size:26px}.m-add-history{position:sticky;bottom:8px;width:68%;margin:18px auto 0;height:47px;border:0;border-radius:26px;background:linear-gradient(90deg,#286a49,#1e754a);color:#fff;font-size:16px;font-weight:800;box-shadow:0 8px 20px rgba(27,97,65,.23)}
.m-project-toolbar{display:flex;gap:10px;justify-content:flex-end;margin:-57px 0 42px}.m-pill-btn{height:45px;border:0;border-radius:23px;padding:0 18px;background:#fff;box-shadow:0 4px 15px rgba(0,0,0,.08);font-weight:700}.m-pill-btn.primary{background:#205e43;color:#fff}.m-project-tabs{display:flex;gap:8px;margin-bottom:16px}.m-project-tabs button{flex:1;border:0;border-radius:23px;padding:12px 8px;background:#f4f2ec;font-size:14px}.m-project-tabs .active{background:#205e43;color:#fff}.m-project-item{grid-template-columns:35% 1fr}.m-project-item .m-list-photo{min-height:165px}.m-project-stats{display:grid;grid-template-columns:repeat(3,1fr);background:#faf8f1;border-radius:13px;margin-top:10px}.m-project-stats span{padding:10px 7px;text-align:center;border-left:1px solid #eee;font-size:10px}.m-project-stats span:first-child{border:0}.m-project-stats b{display:block;font-size:13px;color:#153f31}
.m-campaign-title{display:flex;gap:15px;align-items:center;margin:4px 0 13px}.m-campaign-icon{width:55px;height:55px;border-radius:50%;background:#d7ebf4;display:grid;place-items:center}.m-campaign-icon img{width:31px}.m-campaign-title h2{font-size:28px;margin:0}.m-campaign-title p{margin:2px 0;color:#65717b}.m-stack{display:grid;gap:10px}.m-layer-row{display:grid;grid-template-columns:150px 1fr 48px;gap:12px;align-items:center;padding:12px;border:1px solid #e5e2dc;border-radius:15px;background:#fff}.m-layer-preview{height:82px;border-radius:11px;background:linear-gradient(135deg,#6e8164,#c8b58f)}.m-layer-copy h3{margin:0 0 5px;font-size:19px}.m-layer-copy p{margin:0;color:#687078;font-size:14px}.m-layer-controls small{display:block;color:#687078}.m-switch{width:45px;height:26px;border-radius:15px;background:#357351;position:relative}.m-switch::after{content:"";position:absolute;right:3px;top:3px;width:20px;height:20px;border-radius:50%;background:#fff}.m-range{height:5px;border-radius:4px;background:linear-gradient(90deg,#377652 70%,#ddd 70%);margin-top:9px}.m-section-sep{height:1px;background:#e7e2d8;margin:18px -18px}
.m-profile-card{padding:24px;text-align:center}.m-profile-avatar{width:82px;height:82px;margin:0 auto 12px;border-radius:50%;background:#e9f0e5;display:grid;place-items:center}.m-profile-avatar img{width:42px}.m-profile-card h2{margin:0}.m-profile-card p{color:#687078}.m-profile-actions{display:grid;gap:10px;margin-top:18px}.m-profile-actions button{height:50px;border:1px solid #deddd7;border-radius:15px;background:#fff;font-weight:700}.m-profile-actions .primary{background:#205e43;color:#fff;border:0}
.m-bottom-nav{position:absolute;z-index:6;left:0;right:0;bottom:0;height:calc(78px + env(safe-area-inset-bottom));padding:7px 15px env(safe-area-inset-bottom);display:grid;grid-template-columns:repeat(5,1fr);align-items:start;background:rgba(255,255,255,.96);border-top:1px solid #edeae3;backdrop-filter:blur(18px)}.m-bottom-nav button,.mobile-map-bar button{border:0;background:transparent;color:#5f686d;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:11px}.m-bottom-nav img,.mobile-map-bar img{width:27px;height:27px;object-fit:contain}.m-bottom-nav button.active,.mobile-map-bar button.active{color:#004c43;font-weight:800}.m-nav-add>span,.m-map-add{width:54px;height:54px!important;border-radius:50%!important;background:#34784d!important;color:#fff!important;font-size:38px!important;line-height:50px;margin-top:-22px;box-shadow:0 4px 10px rgba(22,76,50,.15)}.m-nav-add small{font-size:10px;white-space:nowrap;margin-top:2px}
.mobile-map-bar{position:fixed;z-index:75;left:0;right:0;bottom:0;height:calc(77px + env(safe-area-inset-bottom));padding:7px 15px env(safe-area-inset-bottom);display:grid;grid-template-columns:repeat(5,1fr);background:rgba(255,255,255,.97);border-radius:24px 24px 0 0;box-shadow:0 -6px 26px rgba(0,0,0,.10)}
body.mobile-map-lite #mapScreen{inset:0!important}body.mobile-map-lite #mapScreen #searchBtn,body.mobile-map-lite #mapScreen #legendBtn,body.mobile-map-lite #mapScreen #campaignBtn,body.mobile-map-lite #mapScreen .bottom-bar,body.mobile-map-lite #mapScreen #notebookBtn,body.mobile-map-lite #mapScreen #profileSheetFab{display:none!important}body.mobile-map-lite #mapScreen .top-right{top:120px;right:16px;display:flex;flex-direction:column;gap:12px}body.mobile-map-lite #mapScreen #layersBtn{display:flex!important;width:55px;height:55px;border-radius:50%;background:#fff;box-shadow:0 5px 14px rgba(0,0,0,.14)}body.mobile-map-lite #mapScreen #projectBtn{left:20px;top:calc(env(safe-area-inset-top) + 25px);height:52px;max-width:72vw;border-radius:28px;background:rgba(255,255,255,.94);box-shadow:0 4px 14px rgba(0,0,0,.16)}body.mobile-map-lite #mapScreen .north-block{left:26px;top:145px}body.mobile-map-lite #mapScreen #gnssBadge{top:92px;left:20px}body.mobile-map-lite #mapScreen .map-quick-actions{display:block!important;position:absolute!important;right:16px!important;top:194px!important;left:auto!important;bottom:auto!important}body.mobile-map-lite #mapScreen .map-quick-actions>button{display:none!important}body.mobile-map-lite #mapScreen .map-quick-actions>#locateQuickBtn{display:flex!important;width:55px!important;height:55px!important;border-radius:50%!important;background:#fff!important;box-shadow:0 5px 14px rgba(0,0,0,.14)!important}
@media(min-width:821px){.mobile-shell,.mobile-map-bar{display:none!important}body.mobile-map-lite{overflow:auto}body.mobile-map-lite #mapScreen .map-quick-actions,body.mobile-map-lite #mapScreen #searchBtn,body.mobile-map-lite #mapScreen #legendBtn,body.mobile-map-lite #mapScreen #campaignBtn,body.mobile-map-lite #mapScreen .bottom-bar,body.mobile-map-lite #mapScreen #notebookBtn,body.mobile-map-lite #mapScreen #profileSheetFab{display:initial}}
@media(max-width:430px){.m-topbar{padding-left:14px;padding-right:14px}.m-brand>img{width:68px}.m-brand strong{font-size:29px}.m-brand small{font-size:6.8px;letter-spacing:1.7px}.m-gps-chip{padding:0 10px}.m-title{font-size:27px}.m-grid2,.m-section-row{gap:8px}.m-feature-card{padding:16px;min-height:150px}.m-feature-card h3,.m-feature-card p{margin-left:52px}.m-feature-card h3{font-size:18px}.m-feature-card p{font-size:13px}.m-hero{height:245px}.m-hero p{font-size:14px}.m-polaroid{width:123px;height:145px;right:20px}.m-history-item,.m-project-item{grid-template-columns:36% 1fr;gap:10px}.m-item-copy h3{font-size:17px}.m-layer-row{grid-template-columns:105px 1fr 42px}.m-content{padding-left:12px;padding-right:12px}}
/* Mobile PWA R2: overflow-safe, icon-first controls, project selection and map viewport fixes */
.mobile-shell,.mobile-shell *,.mobile-map-bar,.mobile-map-bar *,.m-observation-sheet,.m-observation-sheet *{box-sizing:border-box}
.mobile-shell{width:100dvw;max-width:100dvw;overflow:hidden}
.m-topbar,.m-content,.m-bottom-nav{width:100%;max-width:100%}
.m-content{overflow-x:hidden;overscroll-behavior-x:none;padding-bottom:42px}
.m-content>*{max-width:100%;min-width:0}
.m-topbar{height:96px;padding:10px 14px 4px;gap:8px}
.m-brand{flex:1;min-width:0;overflow:hidden}.m-brand>img{width:60px;height:52px;flex:0 0 auto}.m-brand strong{font-size:clamp(23px,7vw,31px);letter-spacing:-1px;overflow:hidden;text-overflow:ellipsis}.m-brand small{font-size:6.2px;letter-spacing:1.25px;overflow:hidden;text-overflow:ellipsis}
.m-top-actions{flex:0 0 auto;gap:7px}.m-gps-chip{width:46px;height:46px;padding:0;border-radius:50%;justify-content:center}.m-gps-chip>span:nth-child(2),.m-gps-chip>i{display:none}.m-nav-arrow{display:grid;place-items:center;transform:none;width:24px;height:24px;font-size:0}.m-nav-arrow::before{content:"";width:24px;height:24px;background:url('icons/mi_posicion.png') center/contain no-repeat}.m-circle-btn{width:46px;height:46px}.m-circle-btn img{width:23px;height:23px}.m-mountain{top:82px;right:-72px;width:270px;height:135px}
.m-content{height:calc(100% - 90px);padding-left:clamp(10px,4vw,18px);padding-right:clamp(10px,4vw,18px)}
.m-eyebrow{font-size:11px;letter-spacing:2.6px;margin-left:2px}.m-title{font-size:clamp(25px,7.6vw,31px);margin-left:2px;margin-right:2px;overflow-wrap:anywhere}.m-subtitle{font-size:clamp(14px,4.3vw,17px);margin-left:2px;margin-right:2px}
.m-grid2,.m-section-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.m-grid-secondary{margin-top:12px}.m-feature-card{width:100%;min-width:0;min-height:150px;padding:18px 14px}.m-feature-card h3,.m-feature-card p{margin-left:48px;overflow-wrap:anywhere}.m-feature-card h3{font-size:clamp(17px,5vw,21px);padding-right:18px}.m-feature-card p{font-size:clamp(12px,3.7vw,15px)}.m-feature-card .m-ico{left:13px;top:15px;width:42px;height:42px}.m-ico img{width:23px;height:23px}.m-card-chevron{right:10px;top:16px}
.m-hero{width:100%;height:auto;min-height:230px;padding:22px 18px}.m-hero h2{font-size:clamp(22px,6.5vw,27px);padding-right:118px}.m-hero p{width:min(62%,330px);font-size:clamp(13px,4vw,16px)}.m-polaroid{width:118px;height:140px;right:14px}.m-polaroid::before{height:98px}
.m-panel,.m-profile-card{min-width:0}.m-panel-head{gap:8px}.m-panel-head h3{min-width:0;overflow-wrap:anywhere}.m-project-name,.m-small-copy{overflow-wrap:anywhere}.m-small-copy{font-size:12px;color:#697177}.m-activity{grid-template-columns:48px minmax(0,1fr)}.m-thumb{width:48px;height:42px}.m-activity div{min-width:0}.m-activity b,.m-activity small{overflow-wrap:anywhere}
.m-list{width:100%;min-width:0}.m-history-item,.m-project-item{width:100%;min-width:0;grid-template-columns:minmax(92px,32%) minmax(0,1fr);gap:12px;text-align:left;overflow:hidden}.m-item-copy{min-width:0}.m-item-copy h3,.m-item-copy p,.m-meta{overflow-wrap:anywhere;word-break:break-word}.m-item-copy h3{padding-right:36px}.m-list-photo{width:100%;min-width:0;min-height:118px}.m-project-item .m-list-photo{min-height:130px}.m-project-item.is-active{border-color:#2f7250;background:linear-gradient(90deg,#f3f8f1,#fff)}.m-project-check{position:absolute;right:12px;top:12px;width:29px;height:29px;border-radius:50%;display:grid;place-items:center;background:#2f7250;color:#fff;font-weight:900;font-size:18px;box-shadow:0 3px 9px rgba(23,79,59,.18)}.m-project-check:empty{display:none}.m-project-stats{grid-template-columns:repeat(3,minmax(0,1fr));overflow:hidden}.m-project-stats span{min-width:0;padding:8px 3px;overflow:hidden;text-overflow:ellipsis}.m-item-arrow{right:10px}
.m-project-toolbar{margin:-52px 0 34px;display:flex;gap:8px;justify-content:flex-end}.m-icon-action{width:44px;height:44px;border:0;border-radius:50%;display:grid;place-items:center;background:#fff;box-shadow:0 4px 15px rgba(0,0,0,.09)}.m-icon-action.primary{background:#205e43}.m-icon-action img{width:22px;height:22px;object-fit:contain}.m-icon-action.primary img{filter:brightness(0) invert(1)}
.m-layer-row{grid-template-columns:82px minmax(0,1fr) 42px;gap:10px;width:100%;min-width:0}.m-layer-preview{height:68px}.m-layer-copy{min-width:0}.m-layer-copy h3,.m-layer-copy p{overflow-wrap:anywhere}.m-layer-copy h3{font-size:16px}.m-campaign-title{min-width:0}.m-campaign-title>div{min-width:0}.m-campaign-title h2{font-size:clamp(22px,6vw,28px);overflow-wrap:anywhere}.m-campaign-title p{font-size:13px;overflow-wrap:anywhere}.m-muted-copy{color:#687078}
.m-add-history{width:min(86%,420px)}
.m-bottom-nav,.mobile-map-bar{grid-template-columns:repeat(5,minmax(0,1fr));padding-left:8px;padding-right:8px}.m-bottom-nav button,.mobile-map-bar button{min-width:0;overflow:hidden}.m-bottom-nav button>span:not(.m-nav-add>span),.m-bottom-nav button>small,.mobile-map-bar button>span{display:none}.m-bottom-nav img,.mobile-map-bar img{width:28px;height:28px}.m-bottom-nav button,.mobile-map-bar button{height:54px}.m-nav-add>span,.m-map-add{margin-top:-15px!important;width:50px!important;height:50px!important;line-height:46px!important;font-size:32px!important}.m-bottom-nav button.active,.mobile-map-bar button.active{position:relative}.m-bottom-nav button.active::after,.mobile-map-bar button.active::after{content:"";position:absolute;bottom:3px;width:5px;height:5px;border-radius:50%;background:#174f3b}
body.mobile-map-lite{overflow:hidden!important}body.mobile-map-lite #mapScreen{left:0!important;right:0!important;top:0!important;bottom:calc(70px + env(safe-area-inset-bottom))!important;width:auto!important;height:auto!important;overflow:hidden!important}body.mobile-map-lite #mapScreen #projectBtn{left:12px;top:calc(env(safe-area-inset-top) + 12px);height:46px;max-width:calc(100vw - 92px);padding-left:12px;padding-right:12px;overflow:hidden}body.mobile-map-lite #mapScreen #projectBtn span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}body.mobile-map-lite #mapScreen #gnssBadge{display:none!important}body.mobile-map-lite #mapScreen .north-block{left:16px;top:78px;transform:scale(.88);transform-origin:top left}body.mobile-map-lite #mapScreen .top-right{top:calc(env(safe-area-inset-top) + 70px);right:12px;gap:10px}body.mobile-map-lite #mapScreen #layersBtn,body.mobile-map-lite #mapScreen .map-quick-actions>#locateQuickBtn{width:48px!important;height:48px!important;min-width:48px!important;padding:0!important}body.mobile-map-lite #mapScreen #layersBtn span,body.mobile-map-lite #mapScreen #locateQuickBtn span{display:none!important}body.mobile-map-lite #mapScreen .map-quick-actions{right:12px!important;top:calc(env(safe-area-inset-top) + 128px)!important}
.m-busy{position:fixed;inset:0;z-index:120;background:rgba(250,249,245,.58);backdrop-filter:blur(5px);display:grid;place-items:center;padding:20px}.m-busy.hidden{display:none!important}.m-busy-card{display:flex;align-items:center;gap:12px;padding:15px 18px;border-radius:16px;background:#fff;box-shadow:0 12px 36px rgba(0,0,0,.14);font-size:14px}.m-spinner{width:22px;height:22px;border:3px solid #dce7df;border-top-color:#2f7250;border-radius:50%;animation:mspin .75s linear infinite}@keyframes mspin{to{transform:rotate(360deg)}}
.m-observation-sheet{position:fixed;inset:0;z-index:130;display:flex;align-items:flex-end;justify-content:center}.m-observation-sheet.hidden{display:none!important}.m-sheet-backdrop{position:absolute;inset:0;border:0;background:rgba(9,20,16,.34);backdrop-filter:blur(2px)}.m-sheet-card{position:relative;width:min(100%,640px);max-height:min(78dvh,660px);overflow:auto;background:#fffdf9;border-radius:24px 24px 0 0;padding:10px 16px calc(20px + env(safe-area-inset-bottom));box-shadow:0 -12px 36px rgba(0,0,0,.18)}.m-sheet-handle{width:42px;height:5px;border-radius:4px;background:#d9d7d1;margin:0 auto 14px}.m-sheet-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.m-sheet-head small{letter-spacing:2px;color:#667078;font-weight:800}.m-sheet-head h2{font-size:24px;margin:4px 0 16px}.m-sheet-close{width:38px;height:38px;border:0;border-radius:50%;background:#f0eee8;font-size:25px}.m-observation-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.m-observation-grid button{min-width:0;min-height:104px;border:1px solid #e5e2dc;border-radius:17px;background:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;padding:10px;color:#153f31;font-weight:800}.m-observation-grid img{width:32px;height:32px;object-fit:contain}.m-observation-grid span{font-size:12px;text-align:center;overflow-wrap:anywhere}
@media(max-width:560px){.m-grid2,.m-section-row{grid-template-columns:1fr}.m-feature-card{min-height:118px}.m-hills{height:43px}.m-hero p{width:60%}.m-project-toolbar{margin:-8px 0 16px}.m-history-item,.m-project-item{grid-template-columns:100px minmax(0,1fr)}.m-layer-row{grid-template-columns:68px minmax(0,1fr) 38px}.m-layer-preview{height:58px}.m-campaign-icon{width:46px;height:46px;flex:0 0 auto}.m-campaign-icon img{width:26px}}
@media(max-width:390px){.m-brand>img{width:48px}.m-brand strong{font-size:23px}.m-brand small{display:none}.m-topbar{height:82px}.m-content{height:calc(100% - 78px)}.m-title{font-size:24px}.m-subtitle{font-size:14px}.m-hero{min-height:210px}.m-hero h2{padding-right:0}.m-hero p{width:100%;padding-right:98px}.m-polaroid{width:88px;height:108px;right:10px}.m-polaroid::before{height:72px}.m-history-item,.m-project-item{grid-template-columns:82px minmax(0,1fr);gap:9px;padding:9px}.m-list-photo,.m-project-item .m-list-photo{min-height:100px}.m-item-copy h3{font-size:15px}.m-item-copy p,.m-meta{font-size:11px}.m-project-stats span{font-size:9px}.m-observation-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:340px){.m-brand>img{display:none}.m-top-actions{gap:5px}.m-gps-chip,.m-circle-btn{width:42px;height:42px}.m-hero p{padding-right:0}.m-polaroid{display:none}.m-history-item,.m-project-item{grid-template-columns:1fr}.m-list-photo,.m-project-item .m-list-photo{min-height:90px}.m-project-check{top:8px;right:8px}}


/* Mobile map layout R16. Scoped to narrow viewports: desktop is unchanged. */
@media (max-width:820px) {
  html,body,#app { height:100dvh; }
  .mobile-map-bar {
    height:calc(76px + env(safe-area-inset-bottom, 0px));
    padding:8px max(10px,env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(10px,env(safe-area-inset-left, 0px));
    align-items:center;
    box-sizing:border-box;
  }
  .mobile-map-bar button {
    min-height:48px;
    height:52px;
    min-width:0;
    justify-self:center;
    position:relative;
  }
  .mobile-map-bar .m-map-add {
    width:60px!important;
    height:60px!important;
    min-height:60px;
    margin-top:-20px!important;
    line-height:1!important;
    padding:0!important;
    display:grid;
    place-items:center;
    flex:0 0 60px;
  }
  body.mobile-map-lite #mapScreen {
    top:0!important;
    bottom:calc(76px + env(safe-area-inset-bottom, 0px))!important;
    left:0!important;
    right:0!important;
    width:auto!important;
    height:auto!important;
    overflow:hidden;
  }
  /* Desktop project button is centered with translateX(-50%). Undo that here. */
  body.mobile-map-lite #mapScreen #projectBtn {
    left:calc(12px + env(safe-area-inset-left, 0px))!important;
    top:calc(14px + env(safe-area-inset-top, 0px))!important;
    right:auto!important;
    transform:none!important;
    max-width:min(61vw, calc(100vw - 98px))!important;
    min-width:0;
    height:46px;
    display:flex;
    gap:7px;
    align-items:center;
    justify-content:flex-start;
    box-sizing:border-box;
    white-space:nowrap;
    overflow:hidden;
  }
  body.mobile-map-lite #mapScreen #projectBtn img { width:20px;height:20px;flex:0 0 20px; }
  body.mobile-map-lite #mapScreen #projectBtn span { min-width:0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden; }
  body.mobile-map-lite #mapScreen .north-block {
    left:calc(15px + env(safe-area-inset-left, 0px))!important;
    top:calc(91px + env(safe-area-inset-top, 0px))!important;
    transform:none;
    width:max-content;
    max-width:calc(100vw - 120px);
  }
  body.mobile-map-lite #mapScreen .north-block .scale-bar span { width:clamp(75px, 22vw, 115px); }
  body.mobile-map-lite #mapScreen .top-right {
    right:calc(12px + env(safe-area-inset-right, 0px))!important;
    top:calc(91px + env(safe-area-inset-top, 0px))!important;
    left:auto!important;
    max-width:64px;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:10px;
  }
  body.mobile-map-lite #mapScreen #layersBtn {
    display:flex!important;
    align-items:center;
    justify-content:center;
    width:52px!important;
    height:52px!important;
    min-width:52px!important;
    flex:0 0 52px;
    border-radius:50%;
    background:white;
  }
  body.mobile-map-lite #mapScreen .map-quick-actions {
    display:flex!important;
    flex-direction:column;
    gap:10px;
    align-items:center;
    left:auto!important;
    right:calc(12px + env(safe-area-inset-right, 0px))!important;
    top:calc(153px + env(safe-area-inset-top, 0px))!important;
    bottom:auto!important;
    width:52px;
  }
  /* Always provide a one-tap way back to the full project extent. */
  body.mobile-map-lite #mapScreen .map-quick-actions>#fitAllBtn,
  body.mobile-map-lite #mapScreen .map-quick-actions>#locateQuickBtn {
    display:flex!important;
    align-items:center;
    justify-content:center;
    width:52px!important;
    height:52px!important;
    min-width:52px!important;
    flex:0 0 52px;
    border-radius:50%!important;
    padding:0!important;
    background:#fff!important;
    box-shadow:0 5px 14px rgba(0,0,0,.14);
  }
  body.mobile-map-lite #mapScreen .map-quick-actions>button:not(#fitAllBtn):not(#locateQuickBtn) { display:none!important; }
}

/* FITXA I del cauce seleccionado: visible también en mapa móvil ligero.
   Otros estados del FAB mantienen las reglas de visibilidad originales. */
body.mobile-map-lite #mapScreen #profileSheetFab.reach-selected:not(.hidden){
  display:flex!important;
  align-items:center;
  right:calc(12px + env(safe-area-inset-right, 0px));
  bottom:calc(92px + env(safe-area-inset-bottom, 0px));
}

/* R37: reliable mobile touch targets, map navigation and responsive panels */
/* Restore native scrolling in panels; the map canvas alone owns custom gestures. */
@media(max-width:820px){html,body,#app{touch-action:auto!important}}
@media(max-width:820px){
 .mobile-shell button,.mobile-map-bar button,.m-observation-sheet button{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
 .m-open-detail{border:1px solid #cadbd0;background:#e8f1ea;color:#24543d;border-radius:12px;padding:10px 12px;min-width:60px;min-height:44px;font-weight:700;cursor:pointer}
 .m-map-touch-hint{position:absolute;left:50%;bottom:14px;transform:translateX(-50%);max-width:calc(100vw - 30px);padding:10px 14px;border-radius:12px;background:rgba(24,51,38,.93);color:white;font:600 12px/1.4 system-ui,sans-serif;text-align:center;z-index:7;pointer-events:none;box-shadow:0 5px 20px #0003}
 .m-map-touch-hint.hidden{display:none!important}
 body.mobile-map-lite #inkCanvas{touch-action:none!important}
 body.mobile-map-lite .side-panel{max-width:min(94vw,420px);max-height:calc(100dvh - 90px);overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y}
 body.mobile-map-lite .feature-card-universal{max-width:calc(100vw - 20px);max-height:calc(100dvh - 112px);overflow:auto;overscroll-behavior:contain;touch-action:pan-y}
 body.mobile-map-lite .feature-secondary-actions button{min-height:58px}
}

/* R37 campaign and layer action buttons replace 38px inert switches. */
@media(max-width:820px){.m-layer-row{grid-template-columns:68px minmax(0,1fr) minmax(64px,auto)!important;gap:8px}.m-layer-row .m-open-detail{min-width:0;width:100%;font-size:12px;padding:10px 6px}}
@media(max-width:360px){.m-layer-row{grid-template-columns:52px minmax(0,1fr) 64px!important}.m-layer-copy h3{font-size:14px}}
