/* Map-first visual system. Scoped to the active map, not the journal, catching or saved progress. */
.field-sr{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
body:has(#explore-panel-map:not([hidden])){overflow:hidden;background:#e8ecd9}
body:has(#explore-panel-map:not([hidden])) #app>.sidebar,
body:has(#explore-panel-map:not([hidden])) #app>.workspace>header,
body:has(#explore-panel-map:not([hidden])) #app>.workspace>footer,
body:has(#explore-panel-map:not([hidden])) .explore-tabs{display:none!important}
body:has(#explore-panel-map:not([hidden])) #app>.workspace{margin:0!important;width:100%!important;min-height:100dvh}
body:has(#explore-panel-map:not([hidden])) #app>.workspace>main{padding:0!important;max-width:none!important;margin:0!important}
#app .explore-game #explore-panel-map:not([hidden]) .world-stage{position:fixed!important;inset:0!important;width:100%!important;height:100dvh!important;min-height:0!important;max-height:none!important;margin:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;background:#e8ecd9;isolation:isolate}
#app .world-stage #world-map{position:absolute;inset:0;width:100%;height:100%;background:#e8ecd9}
#app .world-stage .leaflet-tile-pane{filter:none!important}
#app .world-stage .leaflet-container{font-family:system-ui;background:#e8ecd9}
#app .world-stage .leaflet-control-attribution{font-size:9px!important;line-height:1.25;background:#f6f8e8cc!important;color:#547064;max-width:calc(100% - 20px);padding:3px 6px!important;border-radius:6px 0 0 0}
#app .world-stage .leaflet-bottom.leaflet-right{bottom:0!important}
#app .world-stage .leaflet-control-scale{position:static!important;margin:0 0 22px 14px!important;max-width:80px;opacity:.75}
#app .world-stage .leaflet-control-scale-line{font:9px system-ui;border-width:0 1px 1px;border-color:#557864;background:#f8faec9c;padding:2px 6px}
#app .world-stage .leaflet-top.leaflet-right{top:78px;right:14px}
#app .world-stage .leaflet-control-zoom{margin:0!important;border:1px solid #ffffffc9!important;border-radius:15px!important;box-shadow:0 5px 20px #2448341b!important;overflow:hidden}
#app .world-stage .leaflet-control-zoom a{width:44px!important;height:44px!important;line-height:44px!important;font:400 25px/44px system-ui!important;color:#264f43!important;background:#fffff5e8!important;backdrop-filter:blur(10px)}
#app .world-stage .leaflet-control-zoom a:first-child{border-bottom:1px solid #dce3d1!important}
#app .world-stage .map-location{top:auto!important;bottom:185px!important;left:16px!important;right:80px;max-width:300px!important;width:max-content;box-sizing:border-box;padding:6px 9px!important;border:0!important;border-radius:7px!important;font:600 10px/1.4 system-ui!important;color:#3e6455;background:#f7fae5dc!important;box-shadow:none!important;pointer-events:none}
#app .world-stage .map-view-controls{inset:auto 14px 182px auto;display:flex;flex-direction:column;gap:8px;width:44px}
#app .world-stage .map-view-controls>span{position:absolute;bottom:-20px;right:0;white-space:nowrap;margin:0;padding:0;background:none;box-shadow:none;font-size:9px;max-width:none;color:#426451}
#app .world-stage .map-view-controls .recenter-map{width:44px!important;height:44px!important;min-height:44px!important;border-radius:14px!important;padding:0!important;border:1px solid #fff9!important;background:#fffff4ed!important;color:#365c4b!important;font-size:0!important;box-shadow:0 5px 20px #2448341b!important;overflow:hidden}
#app .world-stage .recenter-map span{font:26px/1 system-ui}
#app .world-stage[data-follow=false] .recenter-map{background:#254c40!important;color:#fffdec!important}
#app .world-stage .map-tools{left:auto!important;right:14px!important;top:20px!important;max-width:calc(100% - 28px);z-index:750}
#app .world-stage .map-tools>summary{display:flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0!important;margin-left:auto;border-radius:14px!important;background:#fffff5eb!important;color:#2d5545!important;border:1px solid #ffffffd9!important;box-shadow:0 5px 20px #2448341b!important;list-style:none}
#app .world-stage .map-tools>summary:after{content:none}
#app .world-stage .map-tools-content{width:300px;max-width:calc(100vw - 28px);max-height:calc(100dvh - 190px);overflow:auto;display:flex;gap:9px;margin-top:8px;padding:18px!important;border-radius:20px!important;background:#fffef5f7!important;box-shadow:0 16px 50px #153f3230!important;border:1px solid #fff!important;backdrop-filter:blur(20px)}
#app .world-stage .map-tools-content>strong{width:100%;font:650 16px system-ui;margin-bottom:4px}
#app .world-stage #browse-map{width:100%;min-height:44px;padding:10px 12px;text-align:left;border:1px solid #dce4d2;border-radius:10px;background:#f0f5e7;color:#2b5742;font:600 12px system-ui;cursor:pointer}
#app .world-stage .map-key,#app .world-stage .map-appearance{position:static!important;width:100%!important;max-width:100%!important;margin:0!important;padding:0!important;box-shadow:none!important;background:none!important;border:0!important}
#app .world-stage .map-key>summary,#app .world-stage .map-appearance>summary{padding:12px 0!important;min-height:44px;box-sizing:border-box;border:0!important;border-radius:0!important;font:650 12px system-ui;background:none!important;box-shadow:none!important}
#app .world-stage .map-theme-options button{min-height:100px!important}
.field-journey{position:absolute;left:16px;top:20px;z-index:760;font-family:system-ui;color:#244e3c}
.field-journey>summary{list-style:none;display:flex;align-items:center;gap:8px;min-height:44px;padding:5px 12px 5px 5px;box-sizing:border-box;border:1px solid #fff;background:#fffff5e6;backdrop-filter:blur(14px);border-radius:16px;box-shadow:0 5px 20px #2448341b;cursor:pointer;font:650 11px system-ui}
.field-journey>summary::-webkit-details-marker{display:none}.field-journey>summary img{width:44px;height:44px;object-fit:contain}
.field-journey-panel{margin-top:10px;background:#fffef5f7;border:1px solid #fff;backdrop-filter:blur(20px);width:330px;max-width:calc(100vw - 32px);max-height:calc(100dvh - 180px);overflow:auto;box-sizing:border-box;padding:20px;border-radius:22px;box-shadow:0 16px 50px #153f3230}
.field-approved-logo{display:block;width:144px;height:144px;object-fit:contain;margin:0 auto 10px}
.field-journey-panel h2{font:650 19px system-ui;margin:6px 0 12px;text-align:center}
#app .field-journey-panel .game-player{min-height:0!important;padding:12px!important;border-radius:13px!important;margin:8px 0 12px!important;display:grid!important;grid-template-columns:32px 1fr!important;gap:8px!important}
#app .field-journey-panel .game-level{width:30px;height:34px;font-size:20px}
#app .field-journey-panel .game-player-title{font:650 15px system-ui}#app .field-journey-panel .game-player-title small{display:none}
#app .field-journey-panel .game-collection{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between}#app .field-journey-panel .game-collection strong{font-size:23px}#app .field-journey-panel .game-collection span{font-size:11px}
.field-journey-panel>a,.field-journey-panel>button,.field-save-host>a{display:flex;align-items:center;min-height:44px;width:100%;padding:10px 0;box-sizing:border-box;text-align:left;font:600 12px/1.4 system-ui;color:#355e48;border:0;border-bottom:1px solid #dfe5d6;background:none;text-decoration:none;cursor:pointer;white-space:normal}
.field-panel-close{display:block;min-height:44px;width:100%;border:0!important;border-radius:11px!important;background:#285746!important;color:#fffef1!important;font:650 12px system-ui!important;padding:12px!important;margin-top:14px!important;cursor:pointer;justify-content:center}
#app .field-save-host #journey-save-status{font:600 11px/1.5 system-ui!important;min-height:44px;padding:10px 0!important;white-space:normal;border:0!important;background:none!important;border-radius:0!important}
#app #explore-panel-map .map-topline{position:fixed;z-index:700;left:16px;right:16px;bottom:91px;display:flex!important;justify-content:space-between;align-items:center!important;margin:0!important;padding:16px 17px!important;border:1px solid #ffffffeb!important;border-radius:22px!important;background:#fffef3ed;box-shadow:0 8px 32px #244b3424;backdrop-filter:blur(16px);max-width:510px;gap:12px!important}
#app .map-topline>div:first-child{background:none!important;padding:0!important;min-width:0}
#app .map-topline .eyebrow{font:650 9px/1.4 system-ui!important;letter-spacing:1.2px;color:#758768!important}
#app .map-topline h1{font:600 21px/1.15 system-ui!important;letter-spacing:-.7px;color:#28513f!important;margin:5px 0 0!important}
#app .map-topline .map-locate-action{min-height:46px!important;padding:12px 16px!important;white-space:nowrap;background:#285746!important;color:#fffef0!important;border:0!important;border-radius:13px!important;font:650 12px system-ui!important;box-shadow:0 4px 10px #1b462320}
.field-notes{position:absolute;z-index:720;left:16px;right:80px;bottom:225px;max-width:510px;color:#315641;font-family:system-ui}
.field-notes>summary{list-style:none;display:inline-flex;align-items:center;gap:14px;min-height:44px;padding:10px 14px;box-sizing:border-box;border-radius:13px;border:1px solid #ffffffd9;background:#faffecd6;backdrop-filter:blur(12px);box-shadow:0 3px 14px #36533310;font:650 11px system-ui;cursor:pointer}
.field-notes>summary::-webkit-details-marker{display:none}
.field-notes[open]{left:16px;right:16px;bottom:91px;z-index:780;border-radius:22px;border:1px solid #fff;background:#fffef5f7;backdrop-filter:blur(20px);box-shadow:0 16px 50px #153f3230}
.field-notes[open]>summary{display:flex;justify-content:space-between;border:0;border-bottom:1px solid #e2e8d8;border-radius:0;background:none;box-shadow:none;padding:16px 18px;font-size:14px}
.field-notes-content{padding:0 16px 16px;max-height:calc(100dvh - 210px);overflow:auto;overscroll-behavior:contain}
#app .field-notes .map-nearby{margin:12px 0;background:none;border:0;padding:0}
#app .field-notes .nearby-strip-title{display:block}#app .field-notes .nearby-strip-title>small{display:block;margin-top:5px}
#app .field-notes .map-discovery-summary{display:block!important;margin:12px 0!important}#app .field-notes .map-bottom-note{display:block!important;padding:10px 0!important}#app .field-notes .map-bottom-note>*{max-width:100%!important;display:block;font-size:11px!important}
#app .world-stage .map-start{inset:auto 16px 92px!important;max-width:410px!important;max-height:calc(100dvh - 185px);overflow:auto;padding:20px!important;display:block!important;text-align:center!important;border-radius:26px!important;background:#fffef2ed!important;backdrop-filter:blur(18px);box-shadow:0 12px 42px #244b3426!important;border:1px solid #fff!important}
#app .world-stage .map-start[hidden]{display:none!important}
.map-start-wordmark{width:120px;height:120px;object-fit:contain;display:block;margin:0 auto 8px}
#app .world-stage .map-start>strong{display:block;font:600 27px/1.08 system-ui!important;letter-spacing:-1px;color:#28533f}
#app .world-stage .map-start>p{font:12px/1.6 system-ui!important;max-width:290px!important;margin:12px auto 16px!important;color:#667b62}
#app .world-stage .map-start .primary{width:100%!important;min-height:48px!important;font:650 14px system-ui!important;border-radius:13px!important}
#app .world-stage .map-start .map-practice-link{font-size:12px!important;min-height:44px!important;margin:4px 0!important}
#app .world-stage .map-start>small{font:10px/1.4 system-ui;color:#75866b}
#app #explore-panel-map:has(.world-stage[data-has-location=false]) .map-topline,#app .world-stage[data-has-location=false] .field-notes{display:none!important}
#app .world-stage .map-selection{bottom:92px!important;max-height:calc(100dvh - 220px);overflow:auto;width:380px!important;max-width:calc(100% - 32px)!important;border:1px solid #fff;border-radius:22px;background:#fffef4f5;backdrop-filter:blur(16px);padding:16px!important;box-shadow:0 12px 40px #22463233}
#app #explore-panel-map:has(.world-stage.has-selection) .map-topline,#app .world-stage.has-selection .field-notes{display:none!important}
#app .world-stage .map-network:not(:empty){left:16px;right:75px;top:77px;bottom:auto;max-width:340px;font:10px/1.45 system-ui;background:#fff6d7ef;color:#6b5e35;padding:9px 12px;border-radius:10px}
body:has(#explore-panel-map:not([hidden]))>.phone-dock{display:grid!important;position:fixed;z-index:8900;left:16px;right:16px;bottom:calc(18px + env(safe-area-inset-bottom));max-width:510px;grid-template-columns:repeat(4,1fr)!important;gap:3px;padding:7px!important;box-sizing:border-box;border:1px solid #fff!important;border-radius:22px!important;background:#fffef3f2!important;backdrop-filter:blur(18px);box-shadow:0 8px 32px #244b3426!important;min-height:62px}
body:has(#explore-panel-map:not([hidden]))>.phone-dock :is(button,a){min-height:46px!important;padding:3px 0!important;border:0;border-radius:14px!important;background:none;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;text-decoration:none;font:650 10px/1.2 system-ui!important;color:#365c48!important}
body>.phone-dock button[aria-current=page]{color:#244e3d!important;background:#e3ecd7!important}
body:has(#explore-panel-map:not([hidden]))>.phone-dock svg{width:21px;height:21px}
#app .world-stage.map-expanded{inset:0!important;border-radius:0!important}
body:has(.world-stage.map-expanded)>.phone-dock,body:has(.world-stage.map-expanded) .map-topline,#app .world-stage.map-expanded .field-journey,#app .world-stage.map-expanded .field-notes{display:none!important}
#app .world-stage.map-expanded .map-exit{right:auto;left:16px;top:20px;border-radius:14px;min-height:44px;background:#fffff2ed;color:#28533f;border:1px solid #fff}
#app .world-stage.map-expanded .map-selection{bottom:28px!important}
#app .world-stage.map-expanded .map-view-controls{bottom:40px}
#app .world-stage .map-tools-content button:focus-visible,.field-journey summary:focus-visible,.field-notes summary:focus-visible,.field-panel-close:focus-visible{outline:3px solid #b58c38;outline-offset:3px}
#app .mobile-brand .approved-wordmark{width:52px!important;height:52px!important;object-fit:contain}
@media(min-width:750px){#app #explore-panel-map .map-topline,#app .world-stage .map-start,.field-notes{left:28px}body:has(#explore-panel-map:not([hidden]))>.phone-dock{left:28px}#app .world-stage .map-selection{left:50%;bottom:28px!important}#app .world-stage .map-location{bottom:30px;left:570px!important}.field-journey{left:28px;top:25px}#app .world-stage .leaflet-top.leaflet-right,#app .world-stage .map-tools{right:28px!important}}
@media(max-width:360px){#app .map-topline h1{font-size:18px!important}#app .map-topline .map-locate-action{padding:11px 13px!important}#app .world-stage .map-start{padding:15px!important}.map-start-wordmark{width:94px;height:94px}#app .world-stage .map-start>strong{font-size:24px!important}#app .world-stage .map-start>p{font-size:11px!important;margin:8px auto 12px!important}}
@media(max-height:550px) and (orientation:landscape){body:has(#explore-panel-map:not([hidden]))>.phone-dock{left:12px;right:auto;bottom:12px;width:300px;min-height:55px}#app #explore-panel-map .map-topline{left:12px;right:auto;width:300px;bottom:76px;padding:10px!important}.field-notes{left:12px;bottom:150px}#app .world-stage .map-location{left:12px!important;bottom:198px!important}.field-notes[open]{left:12px;right:auto;width:320px;bottom:76px}.field-notes-content{max-height:calc(100dvh - 140px)}#app .world-stage .map-start{left:145px!important;right:75px!important;bottom:72px!important;max-height:calc(100dvh - 90px);padding:14px!important}.map-start-wordmark{width:64px;height:64px}#app .world-stage .map-start>strong{font-size:20px!important}#app .world-stage .map-start>p{font-size:11px!important}#app .world-stage .map-selection{left:auto;right:72px;transform:none;bottom:calc(80px + env(safe-area-inset-bottom))!important;width:310px!important;max-height:calc(100dvh - 104px - env(safe-area-inset-top) - env(safe-area-inset-bottom));overscroll-behavior:contain;scroll-padding:12px}#app .world-stage .map-view-controls{bottom:40px}.field-journey-panel{max-height:calc(100dvh - 105px)}#app .world-stage .map-tools-content{max-height:calc(100dvh - 100px)}}
@media(prefers-reduced-motion:reduce){.world-stage *{scroll-behavior:auto!important}}

#app .world-stage[data-has-location=false] .map-view-controls{display:none!important}

#app .map-topline .field-start-action{min-height:46px;padding:12px 18px;border:0;border-radius:13px;background:#285746;color:#fffef0;font:650 13px system-ui;cursor:pointer;white-space:nowrap}#app .map-topline .field-start-action[hidden]{display:none!important}#app .map-topline[data-tracking=false] .map-locate-action{display:none!important}
#app #explore-panel-map .map-topline{padding:13px 16px!important}#app .map-topline h1{font-size:20px!important;letter-spacing:-.4px}
@media(max-width:360px){#app .world-stage[data-has-location=false]:has(.map-network:not(:empty)) .map-start{max-height:calc(100dvh - 245px)!important}}

@media(max-height:550px) and (orientation:landscape){#app .world-stage[data-has-location=false] .map-network:not(:empty){top:16px!important;left:145px!important;right:75px!important;max-width:none!important}#app .world-stage[data-has-location=false]:has(.map-network:not(:empty)) .map-start{max-height:calc(100dvh - 170px)!important}}

@media(max-height:550px) and (orientation:landscape){.field-journey-panel{max-height:calc(100dvh - 160px)!important}}
/* On narrow onboarding screens, zoom is secondary to the welcome actions.
   display:none removes the obscured links from both hit-testing and tab order;
   the controls return automatically when location dismisses the welcome. */
@media(max-width:360px){#app .world-stage:has(.map-start:not([hidden])) .leaflet-control-zoom{display:none!important}}

/* Map notifications must clear the floating dock AND the lower primary actions.
   The layout-only navigation observer measures actual heights, including safe areas
   and enlarged text. CSS provides a dock-aware fallback before measurement. */
body:has(#explore-panel-map:not([hidden]))>#toast{
 --map-dock-height:62px;--map-toast-safe-top:env(safe-area-inset-top,0px);
 bottom:var(--map-toast-clearance,calc(18px + env(safe-area-inset-bottom,0px) + var(--map-dock-height) + 12px));
 left:16px;right:80px;width:auto;max-width:440px;box-sizing:border-box;
 transform:translateY(8px);z-index:8901;line-height:1.5;overflow-wrap:anywhere;pointer-events:none
}
body:has(#explore-panel-map:not([hidden]))>#toast.show{transform:none}
@media(min-width:750px){body:has(#explore-panel-map:not([hidden]))>#toast{left:28px}}

/* Keep walk controls above the real navigation height, including safe-area insets. */
#app #explore-panel-map .map-topline{bottom:calc(var(--field-dock-clearance,100px) + 12px)!important}
#app .world-stage .map-start,.field-notes[open]{bottom:calc(var(--field-dock-clearance,100px) + 12px)!important}
#app .map-topline .field-end-action{min-height:44px;padding:10px 12px;border:1px solid #a3b5a0;border-radius:12px;background:#fffef3;color:#284e3e;font:650 12px system-ui;cursor:pointer}
#app .field-journey-panel>.field-journey-close{position:sticky;top:-20px;z-index:2;margin:-10px 0 8px auto!important;width:auto;min-width:88px;justify-content:center;border:1px solid #bbcbb8!important;border-radius:12px!important;background:#fffef3!important;color:#285746!important;padding:10px!important;box-shadow:0 3px 8px #183c2314}
@media(max-width:700px){#explore-panel-missions{padding-bottom:calc(30px + env(safe-area-inset-bottom))}}

#app .world-stage .map-start .map-intro-close{position:absolute;right:10px;top:10px;width:44px;height:44px;border:1px solid #c4d1bc;border-radius:50%;background:#fffef3;color:#285746;font:28px system-ui;cursor:pointer}
#app .world-stage .map-start .map-browse-action{display:block;width:100%;min-height:44px;margin:10px 0;padding:12px;border-radius:12px;border:1px solid #a6b99a;background:#e9efdc;color:#285746;font:650 12px system-ui;cursor:pointer}
.map-start-eyebrow,.map-start-heading strong{display:block}.map-start-scope{display:flex;gap:12px;justify-content:center;flex-wrap:wrap;margin:12px 0}
#app #explore-panel-map:has(.world-stage[data-has-location=false] #map-start[hidden]) .map-topline{display:flex!important}
#app .world-stage[data-has-location=false]:has(#map-start[hidden]) .map-view-controls{display:flex!important}

/* Unframed animal illustrations use existing cached atlases. Edge fades soften the
   original painted backgrounds; they do not turn them into transparent cutout assets. */
#app .world-stage .animal-map-sprite{filter:none!important;background:none!important;border:0;outline:0;box-shadow:none;width:72px;height:72px}
#app .world-stage .animal-map-sprite .map-wildlife-sprite{display:block;position:relative;width:72px;height:72px;pointer-events:none}
#app .world-stage .animal-map-sprite .map-wildlife-animal,#app .world-stage .animal-map-sprite .map-wildlife-companion{display:block;position:absolute;width:64px;height:64px;left:4px;top:4px;background:none;border:0;outline:0;border-radius:0;box-shadow:none}
#app .world-stage .animal-map-sprite .map-wildlife-companion{width:44px;height:44px;top:0}
#app .world-stage .animal-map-sprite .companion-0{left:-10px}
#app .world-stage .animal-map-sprite .companion-1{left:38px}
#app .world-stage .animal-map-sprite .racer-art,#app .world-stage .animal-map-sprite .event-art{display:block;width:100%!important;height:100%!important;min-width:0;min-height:0;box-sizing:border-box;margin:0!important;border:0!important;border-radius:0!important;background-color:transparent!important;outline:0!important;box-shadow:none!important;filter:none!important;animation:none!important;mask-image:linear-gradient(90deg,transparent,#000 12%,#000 88%,transparent),linear-gradient(transparent,#000 10%,#000 88%,transparent);mask-composite:intersect;-webkit-mask-image:linear-gradient(90deg,transparent,#000 12%,#000 88%,transparent),linear-gradient(transparent,#000 10%,#000 88%,transparent);-webkit-mask-composite:source-in}
#app .world-stage .animal-map-sprite.is-selected .map-wildlife-animal{transform:translateY(-3px) scale(1.1)}
#app .world-stage .animal-map-sprite:focus-visible{outline:3px solid #b38a31;outline-offset:3px}
.nearby-animal-portrait{display:block;flex:0 0 47px;width:47px;height:47px;overflow:hidden;border-radius:50%}
.nearby-animal-portrait>.racer-art,.nearby-animal-portrait>.event-art{display:block;width:100%!important;height:100%!important;min-width:0;min-height:0;box-sizing:border-box;margin:0!important;border:0!important;box-shadow:none!important}
#app .world-stage[data-interacting=true],#app .world-stage[data-interacting=true] *,#app #explore-panel-map:has(.world-stage[data-interacting=true]) .map-topline,body:has(.world-stage[data-interacting=true])>.phone-dock{backdrop-filter:none!important;-webkit-backdrop-filter:none!important;filter:none!important}
#app .world-stage[data-interacting=true] .player-figure,#app .world-stage[data-interacting=true] .player-figure *{animation-play-state:paused!important}

/* Lower map controls follow measured dock/bar heights, including enlarged text.
   Keep encounter actions inside the remaining viewport instead of behind tabs. */
#app #explore-panel-map .map-topline{flex-wrap:wrap}
#app .map-topline>div:first-child{flex:1 1 125px}
#app .world-stage:not(.map-expanded) .map-selection{bottom:calc(var(--field-dock-clearance,100px) + 12px)!important;max-height:calc(100dvh - var(--field-dock-clearance,100px) - 110px - env(safe-area-inset-top,0px));overscroll-behavior:contain;scroll-padding:12px}
#app .world-stage:not(.map-expanded) .map-view-controls{bottom:calc(var(--field-action-clearance,192px) + 12px)}
#app .world-stage:not(.map-expanded) .map-location{bottom:calc(var(--field-action-clearance,192px) + 10px)!important}
#app .world-stage:not(.map-expanded) .field-notes:not([open]){bottom:calc(var(--field-location-clearance,222px) + 12px)}
#app .world-stage.has-selection .map-location{display:none}
#app .world-stage:not(.map-expanded) .map-start{max-height:calc(100dvh - var(--field-dock-clearance,100px) - 100px - env(safe-area-inset-top,0px))!important;overscroll-behavior:contain;scroll-padding:12px}
#app .field-notes-content{max-height:calc(100dvh - var(--field-dock-clearance,100px) - 150px - env(safe-area-inset-top,0px))}
#app .field-journey-panel{max-height:calc(100dvh - var(--field-dock-clearance,100px) - 100px - env(safe-area-inset-top,0px))!important;overscroll-behavior:contain}
#app .world-stage .map-selection .map-close-choice:focus-visible{outline-offset:-4px}
@media(max-width:360px){#app .map-topline .field-end-action{padding:10px 8px}}

/* A compact explorer stays readable over both park and street colours.
   The separate compass badge rotates, never the body or geographic anchor. */
#app .explorer-avatar .explorer-map-figure{overflow:visible}
#app .explorer-avatar .player-you{border:2px solid #fff9e6!important;background:#244f40!important;color:#fff9e6;box-sizing:border-box;box-shadow:0 1px 3px #173c3230;line-height:17px}
#app .explorer-avatar .player-figure[data-heading].is-walking::before{content:'';position:absolute;right:-4px;top:9px;width:23px;height:23px;border:1px solid #244f40;border-radius:50%;background:#fff9e6;pointer-events:none}
#app .explorer-avatar .player-figure[data-heading].is-walking::after{content:'';position:absolute;right:2px;top:13px;width:13px;height:17px;background:#244f40;clip-path:polygon(50% 0,100% 100%,50% 73%,0 100%);transform:rotate(var(--explorer-heading,0deg));transition:transform .18s ease-out;pointer-events:none}
@media(prefers-reduced-motion:reduce){#app .explorer-avatar .player-figure::after{transition:none!important}}
@media(forced-colors:active){#app .explorer-avatar .player-you,#app .explorer-avatar .player-figure::before,#app .explorer-avatar .player-figure::after{forced-color-adjust:none}}

#app .world-stage .leaflet-control-zoom{border:1px solid #d5ddc8!important;border-radius:18px!important;overflow:hidden;box-shadow:0 6px 18px #234b3517!important}
#app .world-stage .leaflet-control-zoom a{background:#fffdf2!important;color:#284d3d!important}
@media(forced-colors:active){#app .world-stage .animal-map-sprite:focus-visible{outline-color:CanvasText}}

/* Home-friendly visitors remain visible on the map, outside optional walk tools. */
#app .world-stage>.walk-hud:has(.nearby-friends){bottom:90px;max-height:40dvh;overflow:auto;padding:12px 14px;z-index:710;border-radius:18px;}
.nearby-friends h3{margin:4px 0;font-size:18px}.nearby-friends p{font-size:12px;margin:6px 0}.nearby-friends>small{display:block;font-size:10px;line-height:1.45}.nearby-friends .target-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.nearby-friends .friend-encounter{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:0;min-height:112px;padding:8px;border:1px solid #b9cbb2;border-radius:12px;background:#fffdf1;color:#244b3b;font:600 11px system-ui;cursor:pointer}.nearby-friends .friend-encounter>*:first-child{width:52px;height:52px;flex-shrink:0}.nearby-friends .friend-encounter span{min-width:0;text-align:center}.nearby-friends .friend-encounter small{display:block;margin-top:4px}.world-stage:has(.nearby-friends) .field-notes{bottom:calc(40dvh + 100px)}.world-stage.has-selection>.walk-hud:has(.nearby-friends){display:none!important}

#app .world-stage>.walk-hud:has(.nearby-friends){bottom:180px}#app .world-stage:has(.nearby-friends) .field-notes:not([open]){bottom:calc(40dvh + 190px)}

/* Keep idle play focused on the map; recording lives in Map options. */
#app #explore-panel-map .map-topline[data-tracking=false]{display:none!important}
#app .world-stage>.walk-hud:has(.nearby-friends){bottom:90px}
#app #explore-panel-map:has(.map-topline[data-tracking=true]) .world-stage>.walk-hud:has(.nearby-friends){bottom:180px}
#app .world-stage>.walk-hud:has(.nearby-friends[data-empty=true]){max-height:140px;padding:10px 14px}
#app .nearby-friends[data-empty=true] .friend-arrival{margin:5px 0;font-size:12px;line-height:1.45}
#app .world-stage:has(.nearby-friends[data-empty=true]) .field-notes:not([open]){bottom:250px}
#app #explore-panel-map:has(.map-topline[data-tracking=true]) .world-stage:has(.nearby-friends[data-empty=true]) .field-notes:not([open]){bottom:340px}

/* Visitors belong to Nearby; they must not cover welcome or map actions. */
#app #explore-panel-wildlife>.walk-hud{position:static;inset:auto;max-width:none;max-height:none;margin:0 0 24px;overflow:visible;box-sizing:border-box}
#app #explore-panel-wildlife .nearby-friends .target-options{grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:12px}
#app #explore-panel-wildlife .nearby-friends .friend-encounter{min-height:132px;font-size:14px;line-height:1.4}
#app #explore-panel-wildlife .nearby-friends>small{font-size:12px;line-height:1.5}
#app .world-stage .map-park-shortcut{position:absolute;top:20px;right:68px;z-index:650;width:130px;max-width:calc(100% - 202px);min-height:44px;padding:8px 10px;border:1px solid #d5ddc8;border-radius:14px;background:#fffdf2;color:#28533f;font:650 12px/1.3 system-ui;cursor:pointer}
#app .world-stage .map-park-shortcut:focus-visible{outline:3px solid #b58c38;outline-offset:3px}
#app .world-stage.map-expanded .map-park-shortcut{display:none}
/* Keep attribution readable above the actual dock and recording action bar. */
#app .world-stage:not(.map-expanded) .leaflet-bottom.leaflet-right{bottom:calc(max(var(--field-dock-clearance,80px),var(--field-action-clearance,92px),var(--field-location-clearance,122px)) + 64px)!important}
#app .world-stage.map-expanded .leaflet-bottom.leaflet-right{bottom:10px!important}
@media(max-height:700px) and (orientation:portrait){
 #app .world-stage .map-start .map-start-heading{display:flex;align-items:center;gap:10px;box-sizing:border-box;width:100%;padding-right:44px;text-align:left}
 #app .world-stage .map-start .map-start-heading>div{min-width:0;flex:1}
 #app .world-stage .map-start .map-start-wordmark{width:48px;height:48px;flex:none;margin:0!important}
 #app .world-stage .map-start .map-start-heading strong{font-size:18px;line-height:1.15}
 #app .world-stage .map-start .map-start-eyebrow{font-size:8px;letter-spacing:1px}
 #app .world-stage .map-start .map-start-scope{display:none}
 #app .world-stage .map-start>p{margin:6px 0 8px!important}
 #app .world-stage .map-start .map-browse-action{margin:7px 0}
}
@media(max-height:550px) and (orientation:landscape){
 #app .world-stage .map-start{display:grid!important;left:145px!important;right:75px!important;width:auto!important;max-width:none!important;transform:none!important;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr) 44px;grid-template-areas:'heading locate close' 'copy browse browse' 'note practice practice';gap:6px 10px;align-items:center;text-align:left}
 #app .world-stage .map-start .map-start-heading{grid-area:heading;padding:0;text-align:left}
 #app .world-stage .map-start .map-start-wordmark{display:none}
 #app .world-stage .map-start .map-start-heading strong{font-size:17px;line-height:1.15}
 #app .world-stage .map-start .map-start-eyebrow{font-size:8px;letter-spacing:.5px}
 #app .world-stage .map-start>p{grid-area:copy;margin:0!important}
 #app .world-stage .map-start .map-start-scope{display:none}
 #app .world-stage .map-start>.primary{grid-area:locate;margin:0!important;min-height:44px;padding:8px!important}
 #app .world-stage .map-start .map-intro-close{grid-area:close;position:static}
 #app .world-stage .map-start .map-browse-action{grid-area:browse;margin:0;padding:8px}
 #app .world-stage .map-start .map-practice-link{grid-area:practice;margin:0;min-height:44px;display:grid;place-items:center}
 #app .world-stage .map-start .map-practice-note{grid-area:note;margin:0;font-size:9px;line-height:1.4}
 #app .world-stage[data-has-location=false] .map-network:not(:empty){left:12px!important;right:auto!important;top:88px!important;width:120px;max-width:120px!important;box-sizing:border-box}
 #app .world-stage[data-has-location=true] .field-notes:not([open]){top:88px!important;bottom:auto!important;left:12px!important;max-width:290px}
 #app .world-stage[data-has-location=true] .map-network:not(:empty){left:330px!important;right:78px!important;top:78px!important;max-width:none!important}
 #app .world-stage:not(.map-expanded) .leaflet-bottom.leaflet-right{bottom:18px!important;right:74px!important}
}
@media(max-width:650px) and (max-height:550px) and (orientation:landscape){
 #app .world-stage .map-start{left:12px!important;right:72px!important;top:78px!important;bottom:auto!important;padding:4px 8px!important;gap:2px 8px;grid-template-rows:repeat(3,minmax(44px,auto));max-height:calc(100dvh - 156px)!important}
 #app .world-stage[data-has-location=false]:has(.map-network:not(:empty)) .map-start{max-height:calc(100dvh - 156px)!important}
 #app .world-stage .map-start .map-start-heading strong{font-size:15px;line-height:1.1}
 #app .world-stage .map-start .map-start-eyebrow{font-size:7px;line-height:1.2}
 #app .world-stage .map-start>p{font-size:10px!important;line-height:1.2}
 #app .world-stage .map-start .map-practice-note{font-size:9px;line-height:1.2}
 #app .world-stage[data-has-location=false] .map-network:not(:empty){left:134px!important;top:14px!important;width:230px;max-width:230px!important;font-size:9px;line-height:1.3}
 #app .world-stage:not(.map-expanded) .leaflet-bottom.leaflet-right{right:14px!important}
}

/* Portrait credits use the free left slot above location and action controls. */
@media(orientation:portrait){
 #app .world-stage:not(.map-expanded) .leaflet-bottom.leaflet-right{left:16px!important;right:auto!important;bottom:calc(max(var(--field-dock-clearance,80px),var(--field-action-clearance,92px),var(--field-location-clearance,122px)) + 8px)!important}
 #app .world-stage:not(.map-expanded) .field-notes:not([open]){bottom:calc(var(--field-location-clearance,122px) + 48px)!important}
}

/* Short landscape keeps location below zoom and clear of the map credits. */
@media(max-height:550px) and (orientation:landscape){
 #app .world-stage:not(.map-expanded) .map-view-controls{top:178px;bottom:auto}
}
@media(max-height:290px) and (orientation:landscape){
 #app .world-stage:not(.map-expanded) .map-view-controls>span{right:52px;bottom:2px}
}
@media(max-width:565px) and (max-height:550px) and (orientation:landscape){
 #app .world-stage:not(.map-expanded) .leaflet-bottom.leaflet-right{max-width:calc(100vw - 334px)}
 #app .world-stage:not(.map-expanded) .leaflet-control-attribution{box-sizing:border-box;max-width:100%}
}

/* Expanded maps keep the same dock clearance and short-landscape control rail. */
@media(orientation:portrait){
 #app .world-stage.map-expanded .map-view-controls{bottom:calc(var(--field-dock-clearance,80px) + 28px)}
 #app .world-stage.map-expanded .leaflet-bottom.leaflet-right{left:16px!important;right:auto!important;bottom:calc(max(var(--field-dock-clearance,80px),var(--field-location-clearance,122px)) + 8px)!important}
}
@media(max-height:550px) and (orientation:landscape){
 #app .world-stage.map-expanded .map-view-controls{top:178px;bottom:auto}
 #app .world-stage.map-expanded .map-view-controls>span{right:52px;bottom:2px}
 #app .world-stage.map-expanded .leaflet-bottom.leaflet-right{bottom:18px!important;right:14px!important;max-width:calc(100vw - 334px)}
 #app .world-stage.map-expanded .leaflet-control-attribution{box-sizing:border-box;max-width:100%}
}

/* Keep location recovery guidance beside the action that requested it. */
#app .location-feedback:not(:empty){margin:8px 0;padding:8px 10px;border-radius:8px;background:#f8edce;color:#594419;font:600 12px/1.4 system-ui;text-align:left}
#app .map-start .location-feedback:empty{position:absolute}
#app .map-start:has(.location-feedback:not(:empty))>p{display:none}
@media(max-height:550px) and (orientation:landscape){
 #app .map-start .location-feedback:not(:empty){grid-area:copy;margin:0;padding:4px 6px;font-size:10px;line-height:1.25}
}

@media(orientation:portrait){
 #app .map-start:has(.location-feedback:not(:empty))>.primary{margin-top:8px}
}

/* Expanded journey/field-note menus must stay above their map action bar.
   The map's isolated stacking context otherwise leaves that fixed bar in front
   of menu links. Keep the bottom navigation available; closing restores the bar. */
#app #explore-panel-map:has(.field-journey[open],.field-notes[open]) .map-topline,
#app #explore-panel-map:has(.world-stage[data-has-location=false] #map-start[hidden]):has(.field-journey[open],.field-notes[open]) .map-topline{display:none!important}
