:root{font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#fff;background:#0a1013}*{box-sizing:border-box}html,body,#app,#map{margin:0;width:100%;height:100%;overflow:hidden}button{font:inherit;color:inherit}#map{position:absolute;inset:0;background:#11191d}.topbar{position:absolute;z-index:4;top:max(14px,env(safe-area-inset-top));left:14px;right:14px;display:flex;gap:10px}.search{height:58px;flex:1;border:1px solid #ffffff26;background:#10181bd9;backdrop-filter:blur(18px);border-radius:18px;display:flex;align-items:center;text-align:left;padding:0 15px;box-shadow:0 10px 30px #0005}.search-icon{font-size:27px;margin-right:10px}.search b,.search small{display:block}.search b{font-size:15px}.search small{font-size:11px;color:#aeb8b8;margin-top:2px}.round,.tool{border:1px solid #ffffff26;background:#10181bd9;backdrop-filter:blur(16px);box-shadow:0 8px 24px #0005}.round{width:58px;height:58px;border-radius:18px;font-size:25px}.map-tools{position:absolute;z-index:4;right:14px;top:100px;display:flex;flex-direction:column;gap:8px}.tool{width:46px;height:46px;border-radius:15px;font-weight:800}.tool.active{background:#fff;color:#101719}.compass span{display:block;color:#f1f4f2;transform:rotate(-10deg)}.place-card{position:absolute;z-index:3;left:14px;right:14px;bottom:126px;padding:7px 18px 14px;border:1px solid #ffffff20;border-radius:21px;background:linear-gradient(135deg,#0b1115e8,#162126d9);backdrop-filter:blur(20px);box-shadow:0 18px 50px #0008}.eyebrow{font-size:10px;letter-spacing:.18em;color:#9eaaa8;font-weight:800}.place-card h1{font-size:21px;margin:5px 0 5px;letter-spacing:-.02em}.place-card p{font-size:12px;line-height:1.4;color:#b8c1c0;margin:0 0 12px;max-width:470px}.stats{display:flex;border-top:1px solid #ffffff16;padding-top:10px}.stats span{flex:1}.stats b,.stats small{display:block}.stats b{font-size:13px}.stats small{font-size:9px;color:#8f9b9a;margin-top:2px}.bottom-nav{position:absolute;z-index:5;left:0;right:0;bottom:0;height:78px;padding:7px 10px max(7px,env(safe-area-inset-bottom));display:flex;align-items:center;background:#091013f2;border-top:1px solid #ffffff14;backdrop-filter:blur(20px)}.bottom-nav button{flex:1;border:0;background:none;color:#71807e;display:flex;flex-direction:column;align-items:center;gap:3px;font-size:19px}.bottom-nav small{font-size:9px}.bottom-nav .selected{color:#fff}.bottom-nav .record span{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:#e8eeeb;color:#18211f;font-size:13px}.panel{position:absolute;z-index:10;left:0;right:0;bottom:0;padding:8px 18px calc(20px + env(safe-area-inset-bottom));border-radius:28px 28px 0 0;background:#101719f7;box-shadow:0 -20px 60px #000a;backdrop-filter:blur(22px)}.grabber{width:38px;height:4px;background:#66706f;border-radius:4px;margin:2px auto 15px}.panel-head{display:flex;justify-content:space-between;align-items:center}.panel-head small{font-size:9px;letter-spacing:.16em;color:#7e8b89}.panel-head h2{margin:2px 0 13px}.panel-head button{border:0;background:#ffffff12;border-radius:50%;width:36px;height:36px;font-size:24px}.layer-row{width:100%;display:flex;align-items:center;gap:12px;padding:10px 0;border:0;border-top:1px solid #ffffff12;background:none;text-align:left}.layer-row span:nth-child(2){flex:1}.layer-row b,.layer-row small{display:block}.layer-row small{color:#85918f;margin-top:2px}.layer-preview{width:52px;height:42px;border-radius:10px;background:#33413f}.layer-preview.terrain{background:linear-gradient(145deg,#6e7e72,#1b2927)}.layer-preview.satellite{background:linear-gradient(145deg,#3b4938,#152322)}.layer-preview.pistes{background:linear-gradient(145deg,#cfd6d2,#7f8e88)}.disabled{opacity:.45}.status{position:absolute;z-index:7;top:82px;left:50%;transform:translateX(-50%);padding:7px 12px;border-radius:12px;background:#0b1215d9;font-size:11px;transition:.35s;white-space:nowrap}.status.hide{opacity:0;pointer-events:none}.maplibregl-ctrl-attrib{font-size:9px!important;background:#0b1115aa!important;color:#aaa!important}.maplibregl-ctrl-attrib a{color:#ccc!important}@media(min-width:760px){.topbar{max-width:460px}.place-card{max-width:440px;left:20px;bottom:25px}.bottom-nav{width:410px;left:50%;right:auto;transform:translateX(-50%);bottom:20px;border:1px solid #ffffff1a;border-radius:22px;height:66px}.panel{width:420px;left:auto;right:20px;bottom:20px;border-radius:28px}}
.layer-preview.snow{background:linear-gradient(145deg,#f7fbff,#9db8c8)}

.slope-legend{position:absolute;right:14px;left:14px;top:auto;bottom:86px;z-index:7;display:none;gap:7px;align-items:center;padding:8px 10px;border:1px solid rgba(255,255,255,.16);border-radius:12px;background:rgba(17,24,28,.78);backdrop-filter:blur(12px);box-shadow:0 5px 20px rgba(0,0,0,.22);font-size:10px;color:rgba(255,255,255,.9)}
.slope-legend.show{display:flex}
.slope-legend .legend-title{font-size:9px;font-weight:800;letter-spacing:.12em;color:rgba(255,255,255,.62);margin-right:2px}
.slope-legend span{display:flex;align-items:center;gap:4px;white-space:nowrap}
.slope-legend i{width:13px;height:8px;border-radius:2px;display:inline-block}
.slope-legend .s25{background:rgb(255,226,92)}
.slope-legend .s30{background:rgb(255,193,55)}
.slope-legend .s35{background:rgb(255,139,39)}
.slope-legend .s40{background:rgb(239,75,45)}
.slope-legend .s45{background:rgb(196,38,38)}
@media(max-width:620px){.slope-legend{left:10px;right:10px;top:auto;bottom:86px;max-width:none;justify-content:center;gap:5px;padding:7px 8px}.slope-legend .legend-title{display:none}.slope-legend i{width:11px}}

.sun-panel{position:absolute;left:50%;transform:translateX(-50%);bottom:126px;z-index:8;width:min(420px,calc(100% - 28px));display:none;padding:10px 13px;border:1px solid rgba(255,255,255,.16);border-radius:14px;background:rgba(17,24,28,.82);backdrop-filter:blur(14px);box-shadow:0 6px 22px rgba(0,0,0,.24);color:#fff}
.sun-panel.show{display:block}
.sun-panel>div{display:flex;align-items:center;justify-content:space-between;margin-bottom:7px;font-size:11px}
.sun-panel>div span{color:rgba(255,255,255,.7);font-variant-numeric:tabular-nums}
.sun-panel input{width:100%;accent-color:#f2c15d}
.layer-preview.sun{background:linear-gradient(135deg,#f1c15c 0 48%,#26384c 52% 100%)}
@media(max-width:620px){.sun-panel{bottom:116px}}

.maplibregl-popup-content{background:rgba(18,25,29,.94);color:#fff;border:1px solid rgba(255,255,255,.14);border-radius:14px;padding:12px 14px;box-shadow:0 8px 28px rgba(0,0,0,.3);backdrop-filter:blur(12px)}
.maplibregl-popup-tip{border-top-color:rgba(18,25,29,.94)!important;border-bottom-color:rgba(18,25,29,.94)!important}
.maplibregl-popup-close-button{color:#fff;font-size:18px;padding:4px 7px}
.ski-popup{display:flex;flex-direction:column;gap:3px;padding-right:12px}.ski-popup small{font-size:9px;letter-spacing:.12em;color:rgba(255,255,255,.55)}.ski-popup b{font-size:14px}.ski-popup span{font-size:11px;color:rgba(255,255,255,.72)}

.search-wrap{position:relative;min-width:0;flex:1;max-width:440px}
.search-wrap .search{width:100%;cursor:text}
.search-wrap .search input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:inherit;font:inherit;font-size:14px;padding:0}
.search-wrap .search input::placeholder{color:rgba(255,255,255,.7)}
.search-results{position:absolute;top:calc(100% + 8px);left:0;right:0;background:rgba(15,22,26,.96);border:1px solid rgba(255,255,255,.13);border-radius:16px;padding:6px;box-shadow:0 14px 38px rgba(0,0,0,.32);backdrop-filter:blur(16px);overflow:hidden}
.search-result{display:flex;width:100%;min-height:48px;flex-direction:column;align-items:flex-start;justify-content:center;gap:2px;padding:8px 10px;border:0;border-radius:11px;background:transparent;color:#fff;text-align:left;cursor:pointer}
.search-result:hover,.search-result:focus-visible{background:rgba(255,255,255,.09);outline:none}
.search-result b{font-size:13px;font-weight:650}.search-result small{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;color:rgba(255,255,255,.6)}
.search-empty{padding:13px 10px;font-size:12px;color:rgba(255,255,255,.62)}
@media(max-width:600px){.search-wrap{max-width:none}.search-results{right:-48px}.search-wrap .search input{font-size:16px}}

.search-submit{flex:0 0 38px;width:38px;height:38px;margin-left:8px;padding:0;border:0;border-radius:12px;background:rgba(255,255,255,.08);color:rgba(255,255,255,.82);display:grid;place-items:center;cursor:pointer;transition:background .16s ease,color .16s ease}
.search-submit span{font-size:20px;line-height:1;transform:translateY(-1px)}
.search-submit:hover,.search-submit:focus-visible{background:rgba(255,255,255,.14);color:#fff;outline:none}
.search-submit:active{background:rgba(255,255,255,.19)}

.record-sheet{position:absolute;z-index:11;left:14px;right:14px;bottom:92px;padding:16px;border:1px solid #ffffff20;border-radius:22px;background:#0d1519f2;backdrop-filter:blur(22px);box-shadow:0 18px 55px #0009}.record-head{display:flex;justify-content:space-between;align-items:flex-start}.record-head small{font-size:9px;letter-spacing:.16em;color:#8d9997;font-weight:800}.record-head h2{font-size:20px;margin:3px 0 14px}.record-head button{width:34px;height:34px;border:0;border-radius:50%;background:#ffffff12;font-size:22px}.record-stats{display:grid;grid-template-columns:1fr 1fr;gap:1px;background:#ffffff12;border-radius:15px;overflow:hidden}.record-stats span{padding:12px;background:#111a1e}.record-stats b,.record-stats small{display:block}.record-stats b{font-size:19px;font-variant-numeric:tabular-nums}.record-stats small{font-size:9px;color:#85918f;margin-top:2px}.record-gps{display:flex;justify-content:space-between;padding:10px 2px 8px;font-size:10px;color:#98a5a2}.record-actions{display:flex;gap:8px}.record-actions button{flex:1;height:48px;border:1px solid #ffffff1c;border-radius:14px;background:#1b272b;font-weight:750}.record-actions .record-primary{background:#f2f5f3;color:#101719}.record-actions #finishRecord{background:#b63834;border-color:#c84b45}@media(min-width:760px){.record-sheet{width:390px;left:auto;right:20px;bottom:96px}}

.activities-sheet,.activity-detail,.explore-sheet{position:absolute;z-index:12;left:14px;right:14px;bottom:92px;max-height:70vh;overflow:auto;padding:16px;border:1px solid #ffffff20;border-radius:22px;background:#0d1519f4;backdrop-filter:blur(22px);box-shadow:0 18px 55px #0009}.activities-head,.activity-detail-head{display:flex;align-items:flex-start;justify-content:space-between}.activities-head small,.activity-detail-head small{font-size:9px;letter-spacing:.16em;color:#8d9997;font-weight:800}.activities-head h2,.activity-detail-head h2{margin:3px 0 14px;font-size:21px}.activities-head button,.activity-detail-head button{width:34px;height:34px;border:0;border-radius:50%;background:#ffffff12;font-size:22px}.activities-totals,.activity-detail-stats{display:grid;grid-template-columns:1fr 1fr;gap:1px;background:#ffffff12;border-radius:15px;overflow:hidden;margin-bottom:12px}.activities-totals span,.activity-detail-stats span{padding:11px;background:#111a1e}.activities-totals b,.activities-totals small,.activity-detail-stats b,.activity-detail-stats small{display:block}.activities-totals b,.activity-detail-stats b{font-size:15px;font-variant-numeric:tabular-nums}.activities-totals small,.activity-detail-stats small{font-size:9px;color:#85918f;margin-top:2px}.activities-list{display:flex;flex-direction:column;gap:6px}.activity-row{display:flex;align-items:center;width:100%;min-height:68px;padding:9px 10px;border:1px solid #ffffff10;border-radius:14px;background:#ffffff08;text-align:left}.activity-icon{display:grid;place-items:center;width:38px;height:38px;margin-right:10px;border-radius:12px;background:#ffffff10}.activity-copy{display:flex;flex:1;min-width:0;flex-direction:column}.activity-copy small{font-size:9px;color:#84908e}.activity-copy b{font-size:14px;margin:2px 0}.activity-copy em{font-style:normal;font-size:10px;color:#a2adaa}.activity-arrow{font-size:24px;color:#8d9997}.activities-empty{padding:24px 10px;text-align:center;color:#a2adaa}.activities-empty b,.activities-empty span{display:block}.activities-empty b{color:#fff;margin-bottom:4px}.activities-empty span{font-size:11px}.elevation-profile{height:130px;padding:8px;border:1px solid #ffffff10;border-radius:14px;background:#ffffff06}.elevation-profile canvas{display:block;width:100%;height:100%}@media(min-width:760px){.activities-sheet,.activity-detail,.explore-sheet{width:410px;left:auto;right:20px;bottom:96px}}

.activity-tabs{display:grid;grid-template-columns:1fr 1fr;gap:4px;margin:0 0 10px;padding:3px;border-radius:12px;background:#ffffff0b}.activity-tabs button{border:0;border-radius:9px;padding:8px;background:transparent;color:#8e9997;font-size:11px;font-weight:700}.activity-tabs button.active{background:#ffffff12;color:#fff}.activity-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:10px}.activity-actions button{min-height:42px;border:1px solid #ffffff18;border-radius:12px;background:#ffffff0b;color:#fff;font-size:11px;font-weight:750}.activity-actions button:first-child{background:#f4f6f5;color:#0b1115}

.activity-actions{grid-template-columns:1fr 1fr 1fr}.activity-actions #playActivity{background:#f4f6f5;color:#0b1115}.replay-controls{position:absolute;z-index:15;left:14px;right:14px;bottom:92px;display:grid;grid-template-columns:42px 1fr 44px;align-items:center;gap:8px;padding:11px 12px 27px;border:1px solid #ffffff20;border-radius:18px;background:#0d1519ed;backdrop-filter:blur(20px);box-shadow:0 15px 45px #0009}.replay-controls[hidden]{display:none}.replay-controls button{height:38px;border:0;border-radius:11px;background:#ffffff12;color:#fff;font-weight:800}.replay-controls input{width:100%;accent-color:#fff}.replay-controls span{position:absolute;left:62px;bottom:7px;font-size:9px;color:#9aa5a3;font-variant-numeric:tabular-nums}@media(min-width:760px){.replay-controls{left:auto;right:20px;width:410px}}

.route-tools{padding:10px 16px 4px}.route-tools[hidden]{display:none}.route-tools button{width:100%;height:42px;border:1px dashed #ffffff32;border-radius:13px;background:#ffffff0b;color:#f4f7f5;font:700 12px/1 system-ui;letter-spacing:.02em}.route-tools button:active{transform:scale(.99)}

.library-head-actions{display:flex;align-items:center;gap:7px}.activities-head .import-head{width:auto;height:34px;padding:0 11px;border-radius:11px;font-size:10px;font-weight:800;color:#eef5f2}.activities-head .import-head[hidden]{display:none}.activity-tabs{margin-top:2px;margin-bottom:12px}.activities-totals[hidden]{display:none}

.route-row{gap:0}.route-main{display:flex;flex:1;min-width:0;padding:0;border:0;background:transparent;color:inherit;text-align:left}.route-map-toggle{flex:0 0 auto;min-width:58px;height:34px;margin-left:8px;padding:0 10px;border:1px solid #ffffff20;border-radius:10px;background:#ffffff0b;color:#aab5b2;font-size:10px;font-weight:800}.route-map-toggle.active{background:#dff5ff;color:#102129;border-color:#dff5ff}.route-row .activity-icon{flex:0 0 38px}

.explore-sheet{z-index:12;left:14px;right:14px;bottom:92px;max-height:70vh;overflow:auto;padding:16px;border:1px solid #ffffff20;border-radius:22px;background:#0d1519f4;backdrop-filter:blur(22px);box-shadow:0 18px 55px #0009}.explore-intro{margin:-2px 0 14px;color:#98a4a1;font-size:11px;line-height:1.45}.explore-sheet .activities-list{margin-top:4px}@media(min-width:760px){.explore-sheet{width:410px;left:auto;right:20px;bottom:96px}}

.map-route-chip{position:absolute;z-index:10;left:50%;bottom:94px;display:flex;align-items:center;transform:translateX(-50%);border:1px solid #ffffff24;border-radius:14px;background:#0d1519e8;backdrop-filter:blur(18px);box-shadow:0 8px 28px #0007;overflow:hidden}.map-route-chip[hidden]{display:none}.map-route-chip button{height:40px;border:0;background:transparent;color:#f4f7f5}.map-route-chip #openMapRoutes{display:flex;align-items:center;gap:7px;padding:0 11px 0 12px}.map-route-chip #openMapRoutes span{color:#4fc3f7;font-size:17px}.map-route-chip #openMapRoutes b{font-size:10px;white-space:nowrap}.map-route-chip #clearMapRoutes{width:36px;border-left:1px solid #ffffff18;font-size:18px;color:#9ba7a4}

.explore-actions{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin:2px 0 16px}.explore-actions button{min-width:0;padding:11px 8px;border:1px solid #ffffff12;border-radius:14px;background:#ffffff08;color:#f4f7f5;text-align:left}.explore-actions span,.explore-actions b,.explore-actions small{display:block}.explore-actions span{height:22px;font-size:18px}.explore-actions b{font-size:11px;margin-bottom:3px}.explore-actions small{overflow:hidden;color:#8f9b98;font-size:8.5px;line-height:1.25;text-overflow:ellipsis}.explore-routes-head{display:flex;align-items:center;justify-content:space-between;margin:2px 0 9px;padding-top:13px;border-top:1px solid #ffffff10}.explore-routes-head small,.explore-routes-head b{display:block}.explore-routes-head small{font-size:8px;letter-spacing:.14em;color:#7f8c89;font-weight:800}.explore-routes-head b{margin-top:2px;font-size:13px}.explore-routes-head .import-head{height:32px;padding:0 10px;border:1px solid #ffffff18;border-radius:10px;background:#ffffff0b;color:#eef5f2;font-size:10px;font-weight:800}

.place-card{transition:transform .28s cubic-bezier(.2,.8,.2,1),padding .28s ease}.place-card-handle{display:block;width:100%;height:20px;margin:0 0 2px;border:0;background:transparent;touch-action:none;cursor:grab}.place-card-handle span{display:block;width:38px;height:4px;margin:auto;border-radius:4px;background:#7f8988}.place-card-content{overflow:hidden;max-height:180px;opacity:1;transition:max-height .28s cubic-bezier(.2,.8,.2,1),opacity .18s ease}.place-card.collapsed{padding-bottom:6px}.place-card.collapsed .place-card-content{max-height:0;opacity:0;pointer-events:none}.place-card.collapsed .place-card-handle{margin-bottom:0}.place-card.dragging{transition:none}.place-card.dragging .place-card-content{transition:none}

.ski-area-summary{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:2px 0 10px;padding:11px 12px;border:1px solid #ffffff12;border-radius:14px;background:#ffffff07}.ski-area-summary>div:first-child{min-width:0}.ski-area-summary>div:first-child small,.ski-area-summary>div:first-child b{display:block}.ski-area-summary>div:first-child small{font-size:7.5px;letter-spacing:.13em;color:#7f8c89;font-weight:800}.ski-area-summary>div:first-child b{margin-top:3px;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ski-area-counts{display:flex;flex:none;border-left:1px solid #ffffff12}.ski-area-counts span{min-width:48px;padding-left:10px}.ski-area-counts b,.ski-area-counts small{display:block}.ski-area-counts b{font-size:15px}.ski-area-counts small{font-size:7.5px;color:#8d9997}

.ski-area-summary>div:first-child em{display:block;margin-top:2px;color:#aab5b2;font-size:9px;font-style:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

@media(min-width:760px){.slope-legend{left:20px;right:auto;bottom:94px;transform:none}.place-card{bottom:134px}}

.aspect-legend{position:absolute;right:14px;left:14px;bottom:86px;z-index:7;display:none;gap:6px;align-items:center;justify-content:center;padding:8px 10px;border:1px solid rgba(255,255,255,.16);border-radius:12px;background:rgba(17,24,28,.78);backdrop-filter:blur(12px);box-shadow:0 5px 20px rgba(0,0,0,.22);font-size:9px;color:rgba(255,255,255,.9)}
.aspect-legend.show{display:flex}.aspect-legend .legend-title{font-size:9px;font-weight:800;letter-spacing:.12em;color:rgba(255,255,255,.62);margin-right:2px}.aspect-legend span{display:flex;align-items:center;gap:3px;white-space:nowrap}.aspect-legend i{width:10px;height:8px;border-radius:2px;display:inline-block}
.aspect-legend .aN{background:rgb(42,116,196)}.aspect-legend .aNE{background:rgb(46,170,196)}.aspect-legend .aE{background:rgb(64,190,120)}.aspect-legend .aSE{background:rgb(180,202,70)}.aspect-legend .aS{background:rgb(245,166,52)}.aspect-legend .aSW{background:rgb(232,92,62)}.aspect-legend .aW{background:rgb(186,74,166)}.aspect-legend .aNW{background:rgb(102,88,190)}
@media(max-width:620px){.aspect-legend{left:10px;right:10px;bottom:86px;gap:4px;padding:7px 6px}.aspect-legend .legend-title{display:none}.aspect-legend i{width:8px}}
@media(min-width:760px){.aspect-legend{left:20px;right:auto;bottom:94px}}

.route-head-actions{display:flex;gap:7px}
.route-planner{position:absolute;z-index:12;left:12px;right:12px;bottom:92px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border:1px solid rgba(255,255,255,.18);border-radius:16px;background:rgba(16,23,27,.9);backdrop-filter:blur(16px);box-shadow:0 8px 30px rgba(0,0,0,.28);color:#fff}
.route-planner[hidden]{display:none}.route-planner-copy{display:flex;flex-direction:column;gap:3px;min-width:0}.route-planner-copy small{font-size:9px;letter-spacing:.14em;color:rgba(255,255,255,.58)}.route-planner-copy b{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.route-planner-actions{display:flex;gap:7px}.route-planner-actions button{border:1px solid rgba(255,255,255,.16);border-radius:10px;background:rgba(255,255,255,.08);color:#fff;padding:8px 10px;font:inherit;font-size:11px;font-weight:700}.route-planner-actions button:disabled{opacity:.38}.route-planner-actions .route-save{background:#fff;color:#10171b;border-color:#fff}
@media(min-width:760px){.route-planner{left:50%;right:auto;bottom:102px;width:min(620px,calc(100vw - 40px));transform:translateX(-50%)}}
@media(max-width:520px){.route-planner{align-items:flex-start;flex-direction:column}.route-planner-actions{width:100%}.route-planner-actions button{flex:1}}

.route-replay{flex:0 0 34px;width:34px;height:34px;border:1px solid rgba(255,255,255,.14);border-radius:50%;background:rgba(255,255,255,.08);color:#fff;font:inherit;font-size:11px;display:grid;place-items:center;padding-left:3px}
.route-replay:hover{background:rgba(255,255,255,.14)}

.route-library-filters{display:flex;gap:6px;margin:2px 0 10px;overflow-x:auto;scrollbar-width:none}.route-library-filters::-webkit-scrollbar{display:none}.route-library-filters button{flex:0 0 auto;height:31px;padding:0 11px;border:1px solid #ffffff14;border-radius:999px;background:#ffffff07;color:#8f9b98;font-size:9px;font-weight:800}.route-library-filters button.active{background:#eef5f2;color:#102027;border-color:#eef5f2}.route-delete{flex:0 0 30px;width:30px;height:34px;margin-left:5px;border:0;background:transparent;color:#74807d;font-size:18px}.route-delete:active{color:#f4f7f5}.route-row .activity-copy small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.route-rename{flex:0 0 30px;width:30px;height:34px;margin-left:4px;border:0;border-radius:9px;background:transparent;color:#87938f;font-size:14px}.route-rename:active{background:#ffffff0b;color:#f4f7f5}

/* Route library: one primary row, one map action, secondary actions in overflow. */
.route-library-filters{position:sticky;top:-16px;z-index:4;margin:0 -16px 8px;padding:10px 16px 8px;background:linear-gradient(#0d1519 72%,#0d151900)}
.route-row{position:relative;align-items:center;min-height:62px;padding:5px 4px 5px 0}
.route-main{align-items:center;gap:10px;min-height:52px}
.route-kind{display:grid;place-items:center;flex:0 0 34px;width:34px;height:34px;border-radius:11px;background:#ffffff0a;color:#c8d3d0;font-size:16px}
.route-row .activity-copy{min-width:0}.route-row .activity-copy b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.route-row .activity-copy em{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.route-map-toggle{min-width:52px;margin-left:6px}
.route-more-wrap{position:relative;flex:0 0 34px;margin-left:3px}
.route-more{width:34px;height:34px;border:0;border-radius:10px;background:transparent;color:#87938f;font-size:14px;font-weight:900;letter-spacing:1px}
.route-more:active{background:#ffffff0b;color:#f4f7f5}
.route-menu{position:absolute;z-index:12;right:0;top:38px;width:132px;padding:5px;border:1px solid #ffffff1c;border-radius:12px;background:#121c20f7;box-shadow:0 12px 30px #0009;backdrop-filter:blur(18px)}
.route-menu[hidden]{display:none}.route-menu button{display:block;width:100%;height:36px;padding:0 10px;border:0;border-radius:8px;background:transparent;color:#e9efed;text-align:left;font-size:11px;font-weight:700}.route-menu button:active{background:#ffffff0c}.route-menu button.danger{color:#ff9c96}
.route-rename,.route-replay,.route-delete{display:none}

.route-detail{position:absolute;z-index:13;left:14px;right:14px;bottom:92px;max-height:72vh;overflow:auto;padding:16px;border:1px solid #ffffff20;border-radius:22px;background:#0d1519f4;backdrop-filter:blur(22px);box-shadow:0 18px 55px #0009}.route-detail-head{display:grid;grid-template-columns:34px 1fr 34px;align-items:start;gap:10px}.route-detail-head>div{min-width:0}.route-detail-head button{width:34px;height:34px;border:0;border-radius:50%;background:#ffffff12;color:#fff;font-size:22px}.route-detail-head small{display:block;font-size:8px;letter-spacing:.14em;color:#84908e;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.route-detail-head h2{margin:3px 0 14px;font-size:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.route-detail-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:1px;margin-bottom:13px;border-radius:14px;overflow:hidden;background:#ffffff12}.route-detail-stats span{padding:10px 8px;background:#111a1e}.route-detail-stats b,.route-detail-stats small{display:block}.route-detail-stats b{font-size:13px;font-variant-numeric:tabular-nums}.route-detail-stats small{margin-top:2px;color:#82908c;font-size:8px}.route-profile-head{display:flex;justify-content:space-between;align-items:center;margin:0 2px 6px}.route-profile-head span{font-size:10px;font-weight:800}.route-profile-head small{font-size:9px;color:#84908e}.route-elevation-profile{touch-action:none}.route-detail-actions{display:grid;grid-template-columns:1fr 92px 44px;gap:7px;margin-top:10px}.route-detail-actions button,.route-detail-menu button{min-height:42px;border:1px solid #ffffff18;border-radius:12px;background:#ffffff0b;color:#fff;font-size:10px;font-weight:800}.route-detail-actions .route-primary{background:#f1f5f3;color:#0d171b}.route-detail-menu{display:grid;grid-template-columns:1fr 1fr 1fr;gap:6px;margin-top:7px}.route-detail-menu[hidden]{display:none}.route-detail-menu button.danger{color:#ff9c96}.route-detail[hidden]{display:none}@media(min-width:760px){.route-detail{width:410px;left:auto;right:20px;bottom:96px}}

.route-planner-copy span{color:rgba(255,255,255,.48);font-size:9px;line-height:1.25}.route-planner-actions #deleteRoutePoint:not(:disabled){color:#ffb0aa}.route-planner-actions .route-save{min-width:66px}
@media(max-width:520px){.route-planner-actions{display:grid;grid-template-columns:1fr 1fr 1fr}.route-planner-actions .route-save{grid-column:3}.route-planner-actions #cancelRoute{grid-column:1}.route-planner-actions #deleteRoutePoint{grid-column:1 / span 2;grid-row:2}.route-planner-actions #undoRoutePoint{grid-column:3;grid-row:2}}

.ski-map-badge{display:flex;flex-direction:column;align-items:flex-end;justify-content:center;min-width:72px}.ski-map-badge span{display:inline-flex;align-items:center;justify-content:center;height:25px;padding:0 9px;border:1px solid #ffffff1c;border-radius:999px;background:#ffffff0b;color:#edf4f1;font-size:8px;font-weight:900;letter-spacing:.12em}.ski-map-badge small{margin-top:4px;color:#7f8d89;font-size:8px;white-space:nowrap}


/* Final UI pass: one consistent map chrome / sheet stack. */
:root{--ui-edge:14px;--nav-h:78px;--ui-above-nav:92px;--sheet-max:70vh;--ui-radius:22px}
button{touch-action:manipulation}
.activities-sheet,.activity-detail,.explore-sheet,.record-sheet,.route-detail{left:var(--ui-edge);right:var(--ui-edge);bottom:calc(var(--ui-above-nav) + env(safe-area-inset-bottom));border-radius:var(--ui-radius)}
.activities-sheet,.activity-detail,.explore-sheet,.route-detail{max-height:min(var(--sheet-max),calc(100dvh - 150px));overscroll-behavior:contain;scrollbar-width:none}
.activities-sheet::-webkit-scrollbar,.activity-detail::-webkit-scrollbar,.explore-sheet::-webkit-scrollbar,.route-detail::-webkit-scrollbar{display:none}
.route-planner,.replay-controls{bottom:calc(var(--ui-above-nav) + env(safe-area-inset-bottom))}
.slope-legend,.aspect-legend{bottom:calc(86px + env(safe-area-inset-bottom))}
.sun-panel{bottom:calc(116px + env(safe-area-inset-bottom))}
.place-card{bottom:calc(126px + env(safe-area-inset-bottom))}
.activities-head,.activity-detail-head,.route-detail-head{position:sticky;top:-16px;z-index:3;margin:-16px -16px 10px;padding:16px 16px 6px;background:linear-gradient(180deg,#0d1519 72%,rgba(13,21,25,0));}
.activities-head h2,.activity-detail-head h2,.route-detail-head h2{margin-bottom:8px}
.explore-actions button{min-height:72px}
.explore-actions button,.layer-row,.activity-row,.route-row,.route-detail-actions button,.activity-actions button,.record-actions button{cursor:pointer}
.layer-row{min-height:58px}
.route-library-filters{position:sticky;top:48px;z-index:2;margin-left:-4px;margin-right:-4px;padding:5px 4px 7px;background:linear-gradient(180deg,#0d1519 75%,rgba(13,21,25,0))}
.route-row{min-height:64px}
.route-more,.route-map-toggle{min-height:36px}
.route-detail-actions button,.activity-actions button,.record-actions button{min-height:44px}
.ski-area-summary{min-height:58px}
@media(max-width:520px){
  .topbar{left:10px;right:10px;gap:8px}.search{height:54px;padding:0 12px;border-radius:16px}.round{width:54px;height:54px;border-radius:16px}
  .map-tools{right:10px;top:92px}.tool{width:44px;height:44px}
  .place-card{left:10px;right:10px}
  .explore-actions{gap:6px}.explore-actions button{padding:10px 7px}.explore-actions button b{font-size:10px}.explore-actions button small{font-size:8px}
  .route-detail-stats span,.activities-totals span,.activity-detail-stats span{padding:9px 7px}
  .route-detail-menu{grid-template-columns:1fr}.route-detail-menu button{min-height:40px}
  .ski-map-badge small{display:none}
}
@media(min-width:760px){
  :root{--ui-edge:20px;--ui-above-nav:96px}
  .activities-sheet,.activity-detail,.explore-sheet,.route-detail{left:auto;right:20px;bottom:96px;width:410px;max-height:min(72vh,calc(100dvh - 125px))}
  .record-sheet{left:auto;right:20px;bottom:96px;width:390px}
  .route-planner{bottom:102px}
  .replay-controls{bottom:96px}
  .place-card{left:20px;right:auto;bottom:134px}
  .slope-legend,.aspect-legend{bottom:94px}
}


/* Map / Weather: two sibling modes sharing the selected mountain. */
.mode-switch{position:absolute;z-index:30;top:max(15px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);display:flex;padding:3px;border:1px solid #ffffff1c;border-radius:13px;background:#0b1215dc;backdrop-filter:blur(18px);box-shadow:0 8px 26px #0005}
.mode-switch button{height:32px;min-width:76px;padding:0 14px;border:0;border-radius:10px;background:transparent;color:#84918e;font-size:9px;font-weight:900;letter-spacing:.12em}
.mode-switch button.active{background:#eef4f1;color:#10191c}
.mode-hidden{display:none!important}.weather-hidden{visibility:hidden}
.weather-view{position:absolute;z-index:20;inset:0;overflow:auto;padding:max(74px,calc(62px + env(safe-area-inset-top))) 14px calc(28px + env(safe-area-inset-bottom));background:radial-gradient(circle at 85% -5%,#31424a 0,transparent 32%),linear-gradient(180deg,#10191d,#091014 55%,#070d10);color:#f4f7f6;overscroll-behavior:contain}
.weather-view[hidden]{display:none}.weather-view>*{max-width:920px;margin-left:auto;margin-right:auto}
.weather-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding-top:8px}.weather-head small,.weather-section-head small{font-size:9px;letter-spacing:.16em;color:#83918e;font-weight:900}.weather-head h1{margin:4px 0 3px;font-size:26px;letter-spacing:-.035em}.weather-head p{margin:0;color:#84918f;font-size:10px}.weather-head button{width:40px;height:40px;border:1px solid #ffffff18;border-radius:13px;background:#ffffff0b;color:#fff;font-size:20px}
.weather-summary{margin-top:20px!important;padding:15px 16px;border:1px solid #ffffff14;border-radius:17px;background:#ffffff08}.weather-summary b,.weather-summary span{display:block}.weather-summary b{font-size:16px}.weather-summary span{margin-top:4px;color:#a7b2af;font-size:10px}
.weather-levels{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:10px!important}.weather-levels article{min-width:0;padding:14px;border:1px solid #ffffff12;border-radius:17px;background:#111c20}.weather-levels article>small{display:block;color:#84928f;font-size:8px;font-weight:850;letter-spacing:.09em}.weather-levels article>b{display:block;margin:8px 0 10px;font-size:30px;letter-spacing:-.05em}.weather-levels article div{display:grid;gap:5px}.weather-levels article span{display:flex;justify-content:space-between;gap:8px;color:#82908d;font-size:9px}.weather-levels article strong{color:#dce4e1;font-weight:750;white-space:nowrap}
.weather-section{margin-top:22px!important}.weather-section-head{display:flex;align-items:end;justify-content:space-between;margin-bottom:9px}.weather-section-head h2{margin:3px 0 0;font-size:17px}.weather-section-head>span{padding:6px 9px;border-radius:9px;background:#ffffff0b;color:#b9c3c0;font-size:9px;font-weight:800}
.weather-hours{display:flex;gap:6px;overflow-x:auto;padding-bottom:5px;scrollbar-width:none}.weather-hours::-webkit-scrollbar{display:none}.weather-hours div{flex:0 0 68px;padding:10px 7px;border:1px solid #ffffff10;border-radius:14px;background:#ffffff07;text-align:center}.weather-hours small,.weather-hours b,.weather-hours span,.weather-hours em{display:block}.weather-hours small{color:#7f8e8b;font-size:8px}.weather-hours b{margin:7px 0;font-size:18px}.weather-hours span{font-size:9px}.weather-hours em{margin-top:4px;color:#899693;font-size:8px;font-style:normal}
.weather-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:20px!important}.weather-feature{min-height:92px;padding:14px;border:1px solid #ffffff12;border-radius:17px;background:#ffffff07;color:#fff;text-align:left}.weather-feature span,.weather-feature b,.weather-feature small{display:block}.weather-feature span{color:#83918e;font-size:8px;font-weight:900;letter-spacing:.14em}.weather-feature b{margin:7px 0 3px;font-size:13px}.weather-feature small{color:#7e8b88;font-size:9px}.weather-feature:disabled{opacity:.55}.weather-source{padding:22px 0 6px;color:#62706d;font-size:8px;text-align:center}
@media(max-width:760px){.mode-switch{top:max(12px,env(safe-area-inset-top))}.weather-view{padding-left:10px;padding-right:10px}.weather-head h1{font-size:22px}.weather-levels{gap:5px}.weather-levels article{padding:11px 9px}.weather-levels article>b{font-size:25px}.weather-levels article span{display:block}.weather-levels article strong{display:block;margin-top:1px}.weather-grid{grid-template-columns:1fr 1fr}}
@media(min-width:760px){.weather-view{padding-top:88px}.weather-head{padding-top:18px}.weather-levels article{padding:18px}}


.weather-tabs{position:sticky;top:0;z-index:25;display:flex;width:max-content;margin:-58px auto 18px!important;padding:3px;border:1px solid #ffffff16;border-radius:12px;background:#0c1417e8;backdrop-filter:blur(16px)}
.weather-tabs button{height:30px;min-width:82px;padding:0 13px;border:0;border-radius:9px;background:transparent;color:#7f8c89;font-size:9px;font-weight:850}
.weather-tabs button.active{background:#ffffff12;color:#fff}
.weather-forecast[hidden],.weather-map-view[hidden]{display:none}
#map.weather-map-active{visibility:visible;z-index:21}
.weather-view:has(.weather-map-view:not([hidden])){pointer-events:none;background:transparent;overflow:hidden}
.weather-view:has(.weather-map-view:not([hidden])) .weather-tabs,.weather-view:has(.weather-map-view:not([hidden])) .weather-map-view{pointer-events:auto}
.weather-map-view{position:fixed;z-index:24;inset:0;max-width:none!important;pointer-events:none}
.weather-map-head{position:absolute;top:max(74px,calc(62px + env(safe-area-inset-top)));left:14px;display:flex;align-items:center;gap:10px;padding:9px 11px;border:1px solid #ffffff15;border-radius:13px;background:#0c1417d9;backdrop-filter:blur(14px);pointer-events:auto}.weather-map-head small,.weather-map-head b{display:block}.weather-map-head small{color:#7f8d8a;font-size:7px;letter-spacing:.14em}.weather-map-head b{max-width:230px;margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}.weather-map-head>span{padding:5px 7px;border-radius:8px;background:#ffffff10;font-size:8px;font-weight:900}
.weather-map-layers{position:absolute;top:max(126px,calc(114px + env(safe-area-inset-top)));left:14px;display:flex;gap:5px;padding:4px;border:1px solid #ffffff14;border-radius:13px;background:#0c1417d9;backdrop-filter:blur(14px);pointer-events:auto}.weather-map-layers button{height:34px;padding:0 12px;border:0;border-radius:9px;background:transparent;color:#8b9895;font-size:9px;font-weight:850}.weather-map-layers button.active{background:#edf4f1;color:#10191c}
.weather-map-pending{position:absolute;left:14px;bottom:104px;padding:9px 11px;border:1px solid #ffffff12;border-radius:12px;background:#0b1316d9;backdrop-filter:blur(14px);pointer-events:auto}.weather-map-pending b,.weather-map-pending span{display:block}.weather-map-pending b{font-size:10px}.weather-map-pending span{margin-top:2px;color:#899693;font-size:8px}
.weather-timeline{position:absolute;left:14px;right:14px;bottom:max(18px,env(safe-area-inset-bottom));display:grid;grid-template-columns:72px 1fr;align-items:center;gap:12px;padding:11px 13px;border:1px solid #ffffff18;border-radius:16px;background:#0b1316e8;backdrop-filter:blur(18px);box-shadow:0 10px 30px #0006;pointer-events:auto}.weather-timeline b,.weather-timeline span{display:block}.weather-timeline b{font-size:11px}.weather-timeline span{margin-top:2px;color:#85928f;font-size:8px}.weather-timeline input{width:100%;accent-color:#fff}
@media(max-width:760px){.weather-tabs{margin:-57px auto 14px!important}.weather-map-head{left:10px}.weather-map-layers{left:10px;right:10px;overflow-x:auto}.weather-map-layers button{flex:1;padding:0 8px}.weather-map-pending{left:10px;bottom:102px}.weather-timeline{left:10px;right:10px}}
@media(min-width:760px){.weather-tabs{margin:-69px auto 25px!important}.weather-map-head{left:20px;top:90px}.weather-map-layers{left:20px;top:145px}.weather-map-pending{left:20px}.weather-timeline{left:50%;right:auto;width:620px;transform:translateX(-50%);bottom:20px}}


/* Final top-stack ownership: mode switch gets its own row; search never sits beneath it. */
:root{--mode-top:max(10px,env(safe-area-inset-top));--mode-h:38px;--map-topbar-top:calc(max(10px,env(safe-area-inset-top)) + 48px)}
.mode-switch{top:var(--mode-top);z-index:40}
.topbar{top:var(--map-topbar-top)}
.map-tools{top:calc(var(--map-topbar-top) + 76px)}

/* Weather navigation always owns the highest interactive weather layer. */
.weather-tabs{position:fixed;top:var(--mode-top);left:14px;z-index:60;margin:0!important;transform:none;pointer-events:auto}
.weather-view:has(.weather-map-view:not([hidden])) .weather-tabs{z-index:60;pointer-events:auto}
.weather-map-view{z-index:24}
.weather-map-head{top:calc(var(--mode-top) + 54px)}
.weather-map-layers{top:calc(var(--mode-top) + 106px)}
.weather-forecast{padding-top:12px}

@media(max-width:520px){
  .mode-switch button{min-width:68px;padding:0 10px}
  .topbar{left:10px;right:10px}
  .search{height:52px;border-radius:16px}
  .round{width:52px;height:52px;border-radius:16px}
  .map-tools{right:10px;top:calc(var(--map-topbar-top) + 68px)}
  .weather-tabs{left:10px}
}
@media(min-width:760px){
  :root{--map-topbar-top:calc(max(14px,env(safe-area-inset-top)) + 50px)}
  .weather-tabs{left:20px}
  .weather-map-head{left:20px;top:calc(var(--mode-top) + 58px)}
  .weather-map-layers{left:20px;top:calc(var(--mode-top) + 112px)}
}


/* Navigation layout authority — keep this block last. */
:root{
  --view-nav-top:max(10px,env(safe-area-inset-top));
  --view-nav-main-h:38px;
  --view-nav-gap:7px;
  --view-nav-weather-h:34px;
  --map-search-top:calc(var(--view-nav-top) + var(--view-nav-main-h) + 10px);
  --weather-content-top:calc(var(--view-nav-top) + var(--view-nav-main-h) + var(--view-nav-gap) + var(--view-nav-weather-h) + 14px)
}
.view-navigation{position:fixed;z-index:80;top:var(--view-nav-top);left:50%;transform:translateX(-50%);display:grid;justify-items:center;gap:var(--view-nav-gap);pointer-events:none}
.view-navigation .mode-switch,.view-navigation .weather-tabs{position:static!important;inset:auto!important;left:auto!important;top:auto!important;right:auto!important;bottom:auto!important;transform:none!important;margin:0!important;pointer-events:auto}
.view-navigation .mode-switch{z-index:auto}
.view-navigation .weather-tabs{z-index:auto}
.view-navigation .weather-tabs[hidden]{display:none!important}
.topbar{top:var(--map-search-top)!important}
.map-tools{top:calc(var(--map-search-top) + 72px)!important}
.weather-view{padding-top:var(--weather-content-top)!important}
.weather-map-head{top:var(--weather-content-top)!important}
.weather-map-layers{top:calc(var(--weather-content-top) + 54px)!important}
.weather-map-view{z-index:24!important}
.weather-timeline{z-index:26}
.weather-map-pending{z-index:26}
#map.weather-map-active{z-index:21}
@media(max-width:520px){
  :root{--map-search-top:calc(var(--view-nav-top) + var(--view-nav-main-h) + 9px)}
  .topbar{left:10px!important;right:10px!important}
  .map-tools{top:calc(var(--map-search-top) + 64px)!important}
  .weather-map-head{left:10px!important;right:10px;width:max-content;max-width:calc(100vw - 20px)}
  .weather-map-layers{left:10px!important;right:10px!important}
}
@media(min-width:760px){
  :root{--view-nav-top:max(14px,env(safe-area-inset-top));--map-search-top:calc(var(--view-nav-top) + var(--view-nav-main-h) + 12px)}
  .weather-map-head{left:20px!important}.weather-map-layers{left:20px!important}
}


/* Map place card docking — authoritative bottom positions. */
:root{--map-nav-clearance:86px;--terrain-legend-clearance:46px}
.place-card{bottom:var(--map-nav-clearance)!important}
.place-card.terrain-legend-active{bottom:calc(var(--map-nav-clearance) + var(--terrain-legend-clearance))!important}
@media(max-width:620px){
  :root{--map-nav-clearance:86px;--terrain-legend-clearance:44px}
  .place-card{left:10px;right:10px}
}
@media(min-width:760px){
  :root{--map-nav-clearance:20px;--terrain-legend-clearance:74px}
  .place-card{left:20px;right:auto}
  .place-card.terrain-legend-active{bottom:calc(var(--map-nav-clearance) + var(--terrain-legend-clearance))!important}
}


/* Terrain legends stack above the stable place curtain; never move the curtain. */
:root{--place-card-dock:86px;--collapsed-place-h:38px;--legend-gap:8px}
.place-card{bottom:var(--place-card-dock)!important}
.place-card.terrain-legend-active{bottom:var(--place-card-dock)!important}
.slope-legend,.aspect-legend{bottom:calc(var(--place-card-dock) + var(--collapsed-place-h) + var(--legend-gap))!important}
@media(max-width:620px){
  :root{--place-card-dock:86px;--collapsed-place-h:38px;--legend-gap:8px}
}
@media(min-width:760px){
  :root{--place-card-dock:20px;--collapsed-place-h:38px;--legend-gap:8px}
  .place-card,.place-card.terrain-legend-active{bottom:var(--place-card-dock)!important}
  .slope-legend,.aspect-legend{bottom:calc(var(--place-card-dock) + var(--collapsed-place-h) + var(--legend-gap))!important}
}


/* Live place-card clearance: legends follow the curtain's actual rendered height. */
:root{--place-card-current-h:38px}
.slope-legend,.aspect-legend{bottom:calc(var(--place-card-dock) + var(--place-card-current-h) + var(--legend-gap))!important}


/* Weather Map HUD authority — controls always render above the MapLibre canvas. */
.weather-map-view{position:fixed!important;inset:0!important;z-index:70!important;display:block;pointer-events:none!important;background:transparent!important}
.weather-map-view[hidden]{display:none!important}
.weather-map-head,.weather-map-layers,.weather-map-pending,.weather-timeline{position:fixed!important;z-index:90!important;pointer-events:auto!important}
.weather-map-head{top:var(--weather-content-top)!important;left:12px!important}
.weather-map-layers{top:calc(var(--weather-content-top) + 56px)!important;left:12px!important;right:12px!important;display:flex!important;gap:7px!important;overflow-x:auto!important;scrollbar-width:none}
.weather-map-layers::-webkit-scrollbar{display:none}
.weather-map-layers button{flex:0 0 auto}
.weather-map-pending{left:12px!important;bottom:calc(max(12px,env(safe-area-inset-bottom)) + 82px)!important}
.weather-timeline{left:12px!important;right:12px!important;bottom:max(12px,env(safe-area-inset-bottom))!important;width:auto!important;transform:none!important;display:grid!important;grid-template-columns:auto 1fr!important;align-items:center!important;gap:14px!important}
.weather-timeline input[type="range"]{display:block!important;width:100%!important;min-width:0!important}
#map.weather-map-active{z-index:21!important;visibility:visible!important}
@media(min-width:760px){
  .weather-map-head{left:20px!important}
  .weather-map-layers{left:20px!important;right:auto!important}
  .weather-map-pending{left:20px!important;bottom:108px!important}
  .weather-timeline{left:50%!important;right:auto!important;bottom:20px!important;width:min(620px,calc(100vw - 40px))!important;transform:translateX(-50%)!important}
}

/* Dedicated flat weather map, isolated from the main 3D ski map.
   In Weather Map mode the original terrain map must never sit underneath/above it. */
#map.weather-map-active{visibility:hidden!important;z-index:0!important;pointer-events:none!important}
#weatherMapCanvas{position:absolute;inset:0;z-index:21;background:#081015}
#weatherMapCanvas[hidden]{display:none!important}
.weather-map-view{z-index:70!important}


/* Layout authority v2 — one collision-free stack for map and weather chrome. */
:root{
  --app-edge:10px;
  --bottom-nav-clearance:86px;
  --place-card-dock:86px;
  --place-card-current-h:38px;
  --map-float-gap:8px;
  --weather-bottom:12px;
  --weather-timeline-h:62px;
}
.view-navigation{z-index:100}
.topbar{z-index:40}
.map-tools{z-index:40}
.bottom-nav{z-index:50}
.place-card{z-index:30;bottom:var(--place-card-dock)!important}
.slope-legend,.aspect-legend{
  z-index:31;
  bottom:calc(var(--place-card-dock) + var(--place-card-current-h) + var(--map-float-gap))!important;
}
.sun-panel{
  z-index:32;
  bottom:calc(var(--place-card-dock) + var(--place-card-current-h) + var(--map-float-gap))!important;
}
.map-route-chip{
  z-index:33;
  bottom:calc(var(--place-card-dock) + var(--place-card-current-h) + var(--map-float-gap))!important;
}
.panel{z-index:120}
.record-sheet,.activities-sheet,.activity-detail,.explore-sheet,.route-detail{z-index:110}
.route-planner,.replay-controls{z-index:115}

/* Weather map: top controls own separate rows, bottom status always clears timeline. */
#weatherMapCanvas{z-index:21}
.weather-map-view{z-index:70!important}
.weather-map-head,.weather-map-layers,.weather-map-pending,.weather-timeline{z-index:90!important}
.weather-map-pending{
  bottom:calc(var(--weather-bottom) + var(--weather-timeline-h) + 10px)!important;
  max-width:calc(100vw - 24px);
}
.weather-timeline{
  bottom:max(var(--weather-bottom),env(safe-area-inset-bottom))!important;
  min-height:var(--weather-timeline-h);
}
.weather-map-head{max-width:calc(100vw - 24px)}
.weather-map-layers{max-width:calc(100vw - 24px)}

/* Small phones: preserve usable map area and never let top controls collide. */
@media(max-width:520px){
  .view-navigation{max-width:calc(100vw - 20px)}
  .weather-map-head{top:var(--weather-content-top)!important}
  .weather-map-layers{top:calc(var(--weather-content-top) + 56px)!important}
  .weather-map-layers button{min-width:58px}
  .weather-map-pending{left:10px!important}
  .weather-timeline{left:10px!important;right:10px!important}
  .map-route-chip{max-width:calc(100vw - 20px)}
}

/* Desktop has room beside the bottom nav; keep cards low and float legends above them. */
@media(min-width:760px){
  :root{--app-edge:20px;--place-card-dock:20px;--weather-bottom:20px}
  .place-card{bottom:var(--place-card-dock)!important}
  .slope-legend,.aspect-legend,.sun-panel{
    bottom:calc(var(--place-card-dock) + var(--place-card-current-h) + var(--map-float-gap))!important;
  }
  .map-route-chip{bottom:96px!important}
  .weather-map-pending{bottom:calc(var(--weather-bottom) + var(--weather-timeline-h) + 12px)!important}
}

/* Forecast cleanup: altitude cards are the forecast selector. */
.weather-level-card{cursor:pointer;transition:border-color .16s ease,background .16s ease,transform .16s ease}
.weather-level-card.active{border-color:#ffffff38;background:#172328}
.weather-level-card:active{transform:scale(.985)}
.weather-level-card:focus-visible{outline:2px solid #ffffff80;outline-offset:2px}
.weather-levels article div span:first-child:last-child{margin:0}
.weather-source{padding-top:16px}

/* Seven-day mountain outlook: compact, readable and tied to selected altitude. */
.weather-days{display:grid;gap:7px}
.weather-days article{display:grid;grid-template-columns:minmax(70px,1.2fr) .9fr .8fr .8fr .55fr;align-items:center;gap:8px;padding:12px 14px;border:1px solid #ffffff12;border-radius:13px;background:#ffffff06}
.weather-days article>div{display:grid;gap:2px}.weather-days article>div b{font-size:14px}.weather-days article small{color:#91a0a4;font-size:11px}
.weather-days article>strong{font-size:16px}.weather-days article>strong span{color:#849397;font-weight:600}
.weather-days article>em{font-style:normal;color:#dce8eb;font-size:13px}.weather-days article>span{font-size:12px;color:#c3d0d3}
.weather-days article>small:last-child{text-align:right}
@media(max-width:520px){.weather-days article{grid-template-columns:minmax(64px,1.1fr) .85fr .75fr .75fr .5fr;padding:11px 10px;gap:5px}.weather-days article>strong{font-size:15px}}

/* Powder outlook: compact forecast signal, separate from snow depth. */
.powder-card{margin:12px 0 4px;padding:14px 16px;border:1px solid #ffffff14;border-radius:15px;background:#ffffff07}
.powder-card>div{display:grid;gap:4px}.powder-card small{font-size:10px;letter-spacing:.11em;color:#91a0a4}.powder-card b{font-size:16px}.powder-card span{font-size:12px;color:#b9c7ca;line-height:1.45}
.weather-level-card div{display:flex;flex-wrap:wrap;gap:5px 12px}

/* Weather refinement: label the compact seven-day metrics without adding card clutter. */
.weather-days-head{display:grid;grid-template-columns:minmax(70px,1.2fr) .9fr .8fr .8fr .55fr;gap:8px;padding:0 14px 6px;color:#77878b;font-size:9px;letter-spacing:.05em;text-transform:uppercase}
.weather-days-head span:last-child{text-align:right}
@media(max-width:520px){.weather-days-head{grid-template-columns:minmax(64px,1.1fr) .85fr .75fr .75fr .5fr;padding:0 10px 6px;gap:5px;font-size:8px}}

/* Keep snow-depth provenance visible without adding another UI row. */
.weather-source-tag{display:inline-block;margin-left:5px;font-style:normal;font-size:8px;line-height:1;letter-spacing:.08em;color:#7f9094;vertical-align:1px}


/* Release polish — final responsive and interaction authority. */
:root{--tap-min:44px}
button{cursor:pointer;-webkit-tap-highlight-color:transparent}
button:disabled{cursor:default}
button:focus-visible,input:focus-visible{outline:2px solid rgba(255,255,255,.78);outline-offset:2px}

/* Search: reserve real space for the query and never let long place names disappear under controls. */
.search-wrap,.search,.search input{min-width:0}
.search{gap:0;overflow:visible}
.search-icon{flex:0 0 auto}
.search-wrap .search input{flex:1 1 auto;width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.search-submit{flex:0 0 40px;width:40px;height:40px;margin-left:6px}
.search-result{min-width:0}
.search-result b,.search-result small{display:block;width:100%;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.search-results{max-height:min(48vh,360px);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:none}
.search-results::-webkit-scrollbar{display:none}

/* Consistent mobile hit areas without visually inflating the chrome. */
.tool,.weather-head button,.panel-head button,.record-head button,.activities-head button,.activity-detail-head button,
.route-detail-head button,.route-more,.route-map-toggle,.route-replay,.route-rename,.route-delete{min-width:var(--tap-min);min-height:var(--tap-min)}
.bottom-nav button{min-height:52px}
.weather-tabs button,.mode-switch button{min-height:32px}

/* Long selected place names must stay readable in map and weather headers. */
.place-card h1,.weather-head h1,.weather-map-head b,.activities-head h2{overflow-wrap:anywhere}
.weather-map-head{min-width:0}
.weather-map-head b{display:block;max-width:min(72vw,440px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* Sheets: safe on short phones and with larger text. */
.panel,.record-sheet,.activities-sheet,.activity-detail,.explore-sheet,.route-detail{max-height:calc(100dvh - max(110px,env(safe-area-inset-top) + 86px))}
.panel,.record-sheet{overflow-y:auto;overscroll-behavior:contain}
.layer-row{min-height:58px}
.layer-row>span:nth-child(2){min-width:0}
.layer-row b,.layer-row small{overflow-wrap:anywhere}

/* Weather forecast: preserve hierarchy, but allow data to breathe on narrow screens. */
.weather-head>div{min-width:0}
.weather-head h1{line-height:1.08}
.weather-level-card{min-width:0}
.weather-level-card span{min-width:0}
.weather-source-tag{white-space:nowrap}
.weather-hours{scroll-snap-type:x proximity}
.weather-hours>div{scroll-snap-align:start}
.weather-days-section{overflow:hidden}
.weather-days,.weather-days-head{min-width:0}

/* Bottom navigation labels and disabled state stay legible but quiet. */
.bottom-nav small{white-space:nowrap}
.bottom-nav button:disabled{opacity:.38}

/* Compact phones: search gets priority; forecast switches from cramped table to readable rows. */
@media(max-width:390px){
  .topbar{gap:6px!important}
  .round{flex:0 0 48px!important;width:48px!important;height:52px!important}
  .search{padding-left:10px!important;padding-right:6px!important}
  .search-icon{font-size:22px;margin-right:7px}
  .search-submit{flex-basis:38px;width:38px;height:38px;margin-left:4px}
  .search-wrap .search input{font-size:16px}
  .weather-levels{grid-template-columns:1fr;gap:7px}
  .weather-levels article{display:grid;grid-template-columns:minmax(76px,.75fr) 56px 1.7fr;align-items:center;gap:8px;padding:10px 12px}
  .weather-levels article>b{margin:0;font-size:24px}
  .weather-levels article div{margin:0}
  .weather-days-section{overflow:visible}
  .weather-days-head{display:none}
  .weather-days article{grid-template-columns:1.15fr .9fr .85fr;grid-template-areas:"day temp snow" "day wind precip";gap:4px 8px}
  .weather-days article>div{grid-area:day}
  .weather-days article>strong{grid-area:temp}
  .weather-days article>em{grid-area:snow}
  .weather-days article>span{grid-area:wind}
  .weather-days article>small:last-child{grid-area:precip;text-align:left}
  .weather-map-layers button{min-height:38px}
  .weather-timeline{grid-template-columns:72px 1fr!important;gap:10px!important}
  .bottom-nav{padding-left:4px;padding-right:4px}
  .bottom-nav button{font-size:18px}
  .bottom-nav small{font-size:8px}
}

/* Very short screens: sheets take priority over decorative map chrome. */
@media(max-height:650px) and (max-width:759px){
  .activities-sheet,.activity-detail,.explore-sheet,.record-sheet,.route-detail{max-height:calc(100dvh - 112px)}
  .panel{max-height:calc(100dvh - 18px)}
}


/* Map IA polish — Routes and Ski log have one job each. */
.routes-sheet .activities-head h2{max-width:calc(100% - 54px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.routes-intro{margin:-2px 0 14px;color:#8e9b98;font-size:11px;line-height:1.45}
.route-primary-actions{display:grid;grid-template-columns:1.45fr 1fr;gap:8px;margin-bottom:18px}
.route-primary-actions button{min-height:46px;border:1px solid #ffffff18;border-radius:13px;background:#ffffff09;color:#dce5e2;font-weight:800;font-size:11px}
.route-primary-actions .route-create-primary{background:#eef4f1;color:#10191c;border-color:#eef4f1}
.routes-sheet .explore-routes-head{margin-top:0;padding-top:13px;border-top:1px solid #ffffff12}
.routes-sheet .route-library-filters{margin-top:2px}
@media(max-width:360px){.route-primary-actions{grid-template-columns:1fr}.route-primary-actions button{min-height:44px}}


/* Active ski/tour navigation — recording never blocks the map. */
.active-session{position:fixed;left:12px;right:12px;bottom:calc(72px + env(safe-area-inset-bottom));z-index:16;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px;align-items:stretch;pointer-events:auto}
.active-session[hidden]{display:none!important}
.active-session-main,.active-map-controls{background:rgba(13,20,23,.92);border:1px solid rgba(255,255,255,.14);box-shadow:0 8px 26px rgba(0,0,0,.26);backdrop-filter:blur(14px)}
.active-session-main{min-width:0;border-radius:14px;padding:8px 11px;color:#eef4f1;text-align:left;display:grid;grid-template-columns:auto 1fr;grid-template-areas:"live time" "stats stats";gap:2px 8px;align-items:center}
.session-live{grid-area:live;color:#9be4bc;font-size:9px;font-weight:900;letter-spacing:.08em;white-space:nowrap}
.active-session-main strong{grid-area:time;text-align:right;font-size:12px}
.active-session-main small{grid-area:stats;color:#a8b4b1;font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.active-map-controls{border-radius:14px;padding:4px;display:flex;gap:2px}
.active-map-controls button{min-width:45px;min-height:44px;border:0;border-radius:10px;background:transparent;color:#8e9b98;font-size:15px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px}
.active-map-controls button span{font-size:7px;font-weight:800;letter-spacing:.03em}
.active-map-controls button.active{background:#ffffff12;color:#eef4f1}
.layer-section{padding:13px 4px 5px;color:#71807d;font-size:8px;font-weight:900;letter-spacing:.12em}
.layer-preview.track{background:linear-gradient(145deg,#182226,#182226);position:relative}
.layer-preview.track:after{content:"";position:absolute;left:7px;right:7px;top:15px;border-top:3px solid #fff;border-radius:8px;transform:rotate(-17deg)}
.layer-preview.route{background:linear-gradient(145deg,#182226,#182226);position:relative}
.layer-preview.route:after{content:"";position:absolute;left:7px;right:7px;top:15px;border-top:3px dashed #38bdf8;transform:rotate(-17deg)}
body:has(.active-session:not([hidden])) .place-card{bottom:calc(var(--map-place-base-bottom) + 62px)}
body:has(.active-session:not([hidden])) .map-route-chip{bottom:calc(var(--map-route-base-bottom) + 62px)}
@media(max-width:390px){
 .active-session{grid-template-columns:minmax(0,1fr) auto;left:8px;right:8px;bottom:calc(69px + env(safe-area-inset-bottom))}
 .active-map-controls button{min-width:41px}
 .active-session-main{padding-left:9px;padding-right:9px}
}
