/* Keep labels short, units together, and forms inside the visible keyboard viewport. */
html body #app:has(#sheet.show) .cw-language{display:none!important}
html body #app #sheet input.input,html body #app #sheet input[type=number],html body #app #sheet input[type=text],html body #app #sheet input[type=url],html body #app #sheet textarea{box-sizing:border-box!important;max-width:100%!important;min-width:0;font-size:16px!important;border-radius:12px;scroll-margin:20px}
html body #app #sheet .field{min-width:0;display:flex;flex-direction:column;gap:8px}
html body #app #sheet #cwTargetSeconds{display:block;width:100%;min-height:50px;padding:12px 14px;line-height:1.25;background:#242525;color:#f0ede2;border:1px solid #797868;font-variant-numeric:tabular-nums}
html body #app #sheet .cw-time-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:14px 0}
html body #app #sheet .cw-time-choices button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;min-width:0;min-height:66px;padding:10px 4px;white-space:nowrap;text-align:center}
.cw-time-choices small{font:11px/1.2 Arial;color:#c5c1b2;white-space:nowrap}.cw-time-choices b{font:600 15px/1.2 Arial;white-space:nowrap;font-variant-numeric:tabular-nums}
html body #app #sheet .cw-insights-read{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:12px 9px}
.cw-insights-read>span{display:flex;flex-direction:column;gap:6px;min-width:0}.cw-insights-read small{font:10px/1.3 Arial;color:#bbb7a4}.cw-insights-read b{font:500 14px/1.3 Arial;white-space:nowrap}
html body #app #sheet .cw-insights-actions:not(.cw-time-choices){display:flex;flex-wrap:wrap;gap:8px}.cw-insights-actions:not(.cw-time-choices) button{flex:1 1 180px;white-space:normal;text-wrap:balance}
html body #app #cwPrintedFacts small{font-size:10px!important}html body #app #cwPrintedFacts em{font-size:9px!important}
html body #app #segmentInfo,html body #app #bigStridesLabel,html body #app #cwCanterTempo{white-space:nowrap!important}
#cwMapZoom{position:absolute;z-index:27;left:12px;top:calc(var(--map-top,150px) + 8px);display:flex;gap:1px;padding:3px;border:1px solid #ffffff26;border-radius:14px;background:#292a2ae8;backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)}
#cwMapZoom button{width:40px;height:40px;min-height:40px;padding:0;background:none;border-radius:10px;color:#ddd4aa;font:22px Arial}#cwMapZoom button:disabled{opacity:.35}#cwMapZoom button:focus-visible{outline:2px solid #d2c895;outline-offset:-2px}
#app:has(#sheet.show) #cwMapZoom,#app:has(#welcome:not(.hide)) #cwMapZoom,#app.mvp-review #cwMapZoom{display:none}
@media(max-width:760px){
 html body #app #sheet.show{position:fixed!important;top:calc(var(--cw-visible-top,0px) + 8px)!important;bottom:auto!important;left:8px!important;right:8px!important;width:auto!important;max-height:calc(var(--cw-visible-height,100dvh) - 16px)!important;height:auto!important;min-height:0!important;padding:16px!important;overflow:auto!important;overscroll-behavior:contain;scroll-padding:16px;border-radius:18px!important}
 html body #app #sheet .sheet-head{position:sticky;top:-16px;z-index:4;background:#282929;padding:12px 0;margin-top:-4px;gap:8px}
 html body #app #sheet .sheet-head h2{max-width:calc(100% - 48px)!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:18px!important}
 html body #app #sheet #sheetBody{min-width:0;padding-bottom:16px!important}
 html body #app #cwPrintedFacts small{white-space:nowrap!important}
}

/* Landscape phones retain a useful map instead of a narrow strip between panels. */
@media (min-width:600px) and (max-height:500px) and (orientation:landscape){
 html.course-essentials.course-one-hand.rider-focused body #app.compact-app .map-layer{inset:48px 320px 8px 8px!important;min-height:0!important}
 html.course-essentials.course-one-hand.rider-focused body #app.compact-app .cw-course-header{position:absolute!important;left:auto!important;right:8px!important;top:48px!important;bottom:auto!important;width:300px!important;max-width:300px!important;transform:none!important}
 html.course-essentials.course-one-hand.rider-focused body #app.compact-app #cwPrintedFacts{position:relative!important;inset:auto!important;width:100%!important;height:83px!important;min-height:83px!important;transform:none!important}
 html.course-essentials.course-one-hand.rider-focused body #app.compact-app #cwPrintedFacts small{font-size:9px!important;white-space:nowrap!important}
 html.course-essentials.course-one-hand.rider-focused body #app.compact-app #cwPrintedFacts em{font-size:8px!important;white-space:nowrap!important}
 html.course-essentials.course-one-hand.rider-focused body #app.compact-app #cwPrintedFacts b{font-size:17px!important}
 html.course-essentials.course-one-hand.rider-focused body #app.compact-app #dock{position:absolute!important;left:auto!important;right:8px!important;bottom:8px!important;width:300px!important;max-width:300px!important;transform:none!important;max-height:calc(100dvh - 144px)!important}
 html.course-essentials.course-one-hand.rider-focused body #app.compact-app #cwMapZoom{top:54px!important;left:12px!important}
 html.course-essentials.course-one-hand.rider-focused body #app.compact-app #cwArenaActions{top:54px!important;right:328px!important;left:auto!important}
 html.course-essentials.course-one-hand.rider-focused body #app.compact-app #cwRouteExperiment{bottom:12px!important;left:12px!important;right:auto!important;transform:none!important}
 html.course-essentials.course-one-hand.rider-focused body #app.compact-app #sheet.show{top:8px!important;bottom:8px!important;max-height:calc(100dvh - 16px)!important;height:auto!important;overflow:auto!important}
}


/* Give the arena the space between compact top facts and the thumb controls. */
@media(max-width:600px) and (orientation:portrait){
 html.course-essentials.course-one-hand.rider-focused body #app.compact-app .cw-course-header{top:52px!important;left:8px!important;right:8px!important;width:auto!important;max-width:none!important;transform:none!important}
 html.course-essentials.course-one-hand.rider-focused body #app.compact-app #cwCurrentCourse{font-size:11px!important;line-height:14px!important;margin:0 0 4px!important}
 html.course-essentials.course-one-hand.rider-focused body #app.compact-app #cwPrintedFacts{min-height:64px!important;border-radius:12px!important}
 html.course-essentials.course-one-hand.rider-focused body #app.compact-app #cwPrintedFacts>div{padding:7px 6px!important}
 html.course-essentials.course-one-hand.rider-focused body #app.compact-app #dock{left:8px!important;right:8px!important;bottom:max(6px,env(safe-area-inset-bottom))!important;padding:8px 10px!important;border-radius:18px!important;width:auto!important;max-width:none!important;transform:none!important}
 html.course-essentials.course-one-hand.rider-focused body #app.compact-app .compact-summary{min-height:49px!important;padding:0!important}
 html.course-essentials.course-one-hand.rider-focused body #app.compact-app .compact-summary #walkLeg{min-height:44px!important}
 html.course-essentials.course-one-hand.rider-focused body #app.compact-app #dock .compact-counters #bigStrides{height:76px!important;min-height:76px!important;grid-template-rows:16px 36px 24px!important}
 html.course-essentials.course-one-hand.rider-focused body #app.compact-app #dock .compact-counters #walkCounter{height:76px!important;min-height:76px!important}
 html.course-essentials.course-one-hand.rider-focused body #app.compact-app .map-layer{top:var(--map-top,142px)!important;bottom:calc(var(--dock-height,150px) + 12px)!important;left:4px!important;right:4px!important;min-height:0!important}
 html.course-essentials.course-one-hand.rider-focused body #app.compact-app #cwRouteExperiment{bottom:calc(var(--dock-height,150px) + 18px)!important}
 html body #app #cwPrintedFacts b{font-size:18px!important}html body #app #cwPrintedFacts small{font-size:9px!important}
}
html body #app #cwTimeWarning{position:relative;padding-right:38px!important}
html body #app #cwTimeWarning.cw-success{background:#173c2b;color:#b7ebc5;border-color:#4b9c6a66}
#cwTimeWarning button,.cw-dismiss{float:right;min-width:32px;min-height:32px;margin:-5px -5px -5px 8px;padding:0;background:transparent;color:inherit;font:22px Arial;border:0;cursor:pointer}
.cw-check-warning{grid-column:1/-1;min-height:36px;padding:5px 10px;text-align:left;color:#edbf89;background:#edbf8910;border-radius:8px}

@media(max-width:600px) and (orientation:portrait){html.course-essentials.course-one-hand.rider-focused body #app.compact-app .cw-course-header{top:82px!important}html body #app .cw-round-switch{top:47px!important;left:10px!important;right:auto!important;transform:none!important;max-width:calc(100% - 20px)!important}html body #app .cw-round-switch button{min-height:29px!important;padding:5px 12px!important;font-size:11px!important}}

/* Notifications and preview actions reserve control space; they never cover the map. */
html body #app #dock #cwFeedbackSlot{display:flex;flex-direction:column;gap:5px;min-width:0}
html body #app #dock #cwFeedbackSlot:has(> :not([hidden])){margin-bottom:5px}
html body #app #dock #cwFeedbackSlot #toast,html body #app #dock #cwFeedbackSlot #cwTimeWarning,html body #app #dock #cwFeedbackSlot #cwTargetMapPreview,html body #app #dock #cwFeedbackSlot #cwRouteCompletionNotice{position:relative!important;inset:auto!important;transform:none!important;max-width:none!important;width:100%!important;box-sizing:border-box!important;margin:0!important;min-height:0!important;padding:7px 36px 7px 10px!important;font:12px/1.4 Arial!important;text-align:left!important;white-space:normal!important}
html body #app #dock #cwFeedbackSlot #toast{cursor:pointer;border-radius:9px;box-shadow:none!important}
html body #app #dock #cwFeedbackSlot #cwTargetMapPreview{padding:7px!important}
html body #app #dock #cwFeedbackSlot #cwTargetMapPreview button{min-height:36px!important;padding:6px 9px!important;font-size:12px!important}
html body #app #dock #cwFeedbackSlot #cwRouteCompletionNotice{border-radius:9px!important}
@media(max-width:600px) and (orientation:portrait){
 html body #app #cwMapZoom{top:calc(var(--map-top,150px) - 36px)!important;left:auto!important;right:12px!important;padding:0!important;border:0!important;background:transparent!important}
 html body #app #cwMapZoom button{width:30px!important;height:28px!important;min-height:28px!important;font-size:19px!important}
 html body #app #cwArenaActions{top:auto!important;bottom:calc(var(--dock-height,150px) + 17px)!important;right:12px!important}
 html body #app #cwRouteExperiment{left:10px!important;transform:none!important;max-width:calc(100% - 70px)!important;justify-content:flex-start!important}
 html body #app .map-layer{padding-bottom:56px!important;box-sizing:border-box!important}
}

@media(max-width:600px) and (orientation:portrait){html body #app .map-layer #arena{height:calc(100% - 56px)!important;bottom:56px!important}}

html body #app #dock #cwFeedbackSlot #cwRouteMessage{position:relative!important;inset:auto!important;transform:none!important;width:100%!important;max-width:none!important;box-sizing:border-box;display:grid;grid-template-columns:minmax(0,1fr) 36px;gap:4px;margin:0;padding:6px 8px;border-radius:10px;background:#302c24;color:#f1c7ac;font:12px/1.4 Arial}
html body #app #dock #cwFeedbackSlot #cwRouteMessage[hidden]{display:none!important}
html body #app #dock #cwFeedbackSlot #cwRouteDismiss{width:36px;min-height:36px;padding:0;border:0;background:transparent;color:inherit;font:24px Arial}

/* Reserve a separate row for zoom below the statistics. */
@media(max-width:600px) and (orientation:portrait){
 html.course-essentials.course-one-hand.rider-focused body #app.compact-app .map-layer{top:calc(var(--map-top,150px) + 36px)!important}
 html body #app #cwMapZoom{top:calc(var(--map-top,150px) + 2px)!important}
}

/* Rider review: pinch to zoom; map and statistics remain unobstructed. */
html body #app #cwMapZoom{display:none!important}
@media(max-width:600px) and (orientation:portrait){html.course-essentials.course-one-hand.rider-focused body #app.compact-app .map-layer{top:var(--map-top,150px)!important}}
html body #app #cwRouteOrigin,html body #app #cwReferenceAlert{display:none!important}
html body #app #sheetBody .cw-check-warning{display:none!important}
html body #app #sheetBody .cw-check-warning-icon{display:inline;margin-left:6px;font:14px Arial;color:#d8bd85}
html body #app #sheetBody .cw-check-warning-icon[hidden]{display:none!important}
html body #app #sheetBody .cw-distance-explanation{font:14px/1.6 Arial;color:#d8d4c5;margin:4px 0 20px}
html body #app #dock #cwFeedbackSlot{align-self:stretch;width:100%!important;box-sizing:border-box;flex-shrink:0}
html body #app #dock #cwFeedbackSlot>[hidden]{display:none!important}
html body #app #dock #cwFeedbackSlot #cwRouteMessage,html body #app #dock #cwFeedbackSlot #cwTimeWarning{position:relative!important;inset:auto!important;left:auto!important;right:auto!important;transform:none!important;width:100%!important;max-width:100%!important;min-width:0!important;margin:0!important;box-sizing:border-box!important;overflow-wrap:anywhere!important;font:12px/1.45 Arial!important;text-align:left!important}
html body #app #dock #cwFeedbackSlot #cwRouteMessage{display:grid;grid-template-columns:minmax(0,1fr) 36px!important;align-items:start;padding:7px 6px 7px 10px!important;gap:6px!important;pointer-events:auto!important}
html body #app #dock #cwFeedbackSlot #cwRouteMessageText{min-width:0!important;padding:3px 0!important;max-height:70px!important;white-space:normal!important;overflow:auto;font:inherit!important}
html body #app #dock #cwFeedbackSlot #cwRouteDismiss,html body #app #dock #cwFeedbackSlot #cwTimeWarning button{float:none!important;position:absolute;right:3px;top:3px;width:36px!important;height:36px!important;min-height:36px!important;padding:0!important;margin:0!important;background:transparent!important;border:0!important;font:22px Arial!important}
html body #app:has(#sheet.show) #cwFeedbackSlot{display:none!important}
html body #app #sheetBody .cw-insights-note.warn .cw-dismiss{display:none!important}
html body #app #sheetBody .compact-check-row{min-height:75px!important;gap:7px!important;grid-template-columns:32px minmax(0,1fr) 55px 55px!important}
html body #app #sheetBody .compact-check-row .check-leg{min-width:0!important;padding:4px 0!important}
html body #app #sheetBody .compact-check-row .check-leg b{font-size:14px!important;white-space:nowrap}
html body #app #sheetBody .compact-check-row [data-edit-strides],html body #app #sheetBody .compact-check-row [data-edit-steps]{min-width:0!important;padding:7px 2px!important}
html body #app #sheetBody .compact-check-row [data-edit-strides] b,html body #app #sheetBody .compact-check-row [data-edit-steps] b{font-size:21px!important}

html body #app #sheetBody .compact-check-row.cw-distance-review .check-leg b:after{content:none!important;display:none!important}

/* Compact thumb panel: preserve 44px controls, reduce vertical gaps and cards. */
@media(max-width:600px) and (orientation:portrait){
 html.course-essentials.course-one-hand.rider-focused body #app.compact-app #dock{padding:6px 10px!important}
 html.course-essentials.course-one-hand.rider-focused body #app.compact-app #dock .compact-summary{height:44px!important;min-height:44px!important;margin:0 0 2px!important}
 html.course-essentials.course-one-hand.rider-focused body #app.compact-app #dock .compact-counters{min-height:68px!important;padding:0!important;gap:0!important;margin:0!important}
 html.course-essentials.course-one-hand.rider-focused body #app.compact-app #dock .compact-counters #bigStrides{height:68px!important;min-height:68px!important;grid-template-rows:13px 31px 24px!important;margin:0!important;padding:0!important}
 html body #app #dock #bigStrides #bigStridesLabel{font:10px/13px Arial!important;pointer-events:none}
 html body #app #dock #bigStrides #strideCountEdit{grid-row:1/3!important;height:44px!important;min-height:44px!important;padding-top:13px!important;box-sizing:border-box!important}
 html body #app #dock #bigStrides #strideCountEdit b{font-size:25px!important;line-height:29px!important}
 html body #app #dock #bigStrides #cwCanterTempo{height:24px!important;min-height:24px!important;font:11px/24px Arial!important}
 html body #app #dock #bigStrides #strideFloatPlus,html body #app #dock #bigStrides #strideFloatMinus{grid-row:1/4!important;align-self:center!important;height:48px!important;min-height:48px!important;width:48px!important;padding:0!important}
}

html body #app #dock #cwFeedbackSlot[hidden]{display:none!important}

@media(max-width:600px) and (orientation:portrait){
 html.course-essentials.course-one-hand.rider-focused body #app.compact-app #cwRouteExperiment,
 html.course-essentials.course-one-hand.rider-focused body #app.compact-app #cwArenaActions{
  bottom:calc(var(--cw-controls-bottom,180px) + 8px)!important;
 }
}
#cwPoweredBy{margin:22px 0 12px;color:#c8c4b8;font-size:12px;text-align:center}
@media(display-mode:standalone){
 #welcome{padding-bottom:max(24px,env(safe-area-inset-bottom))!important}
}
