/* RUNQUEST V36 | Mobile QA: legibility, reachable controls and safe-area support. */
@media (max-width:700px), (orientation:landscape) and (max-height:540px) and (pointer:coarse) {
 :root { --rq-v36-font:12px; --rq-v36-touch:42px }
 html { -webkit-text-size-adjust:100%; text-size-adjust:100% }
 body { -webkit-tap-highlight-color:transparent }
 .app { padding-left:clamp(9px,3vw,14px)!important; padding-right:clamp(9px,3vw,14px)!important }
 .sidebar:not(.hidden) { height:72px!important; --rq-nav:72px; padding:5px!important }
 .sidebar button { font-size:10px!important; font-weight:750; letter-spacing:-.15px; min-width:0; padding:5px 0!important }
 .sidebar button::before { font-size:21px!important; }
 .topbar { margin-bottom:5px!important }
 .mobileBrand { min-width:0; display:flex; align-items:center; overflow:hidden; }
 .mobileBrand img { display:block; max-width:100%; object-fit:contain; object-position:left center }
 .rq-wordmark { display:inline-flex; align-items:center; color:#f5faff; font-size:18px; font-weight:1000; letter-spacing:-.85px; line-height:1; }
 .rq-wordmark b { color:#4a9fff; font:inherit }
 .authPanelBrand .rq-wordmark { font-size:24px }
 .rq-mobile-tabs { height:40px; min-height:40px; gap:4px; }
 .rq-mobile-tabs button { font-size:12px; font-weight:800; min-height:32px; }
 .rq-pager { min-height:43px; height:43px; gap:16px }
 .rq-pager button { min-height:40px; height:40px; min-width:48px }
 .rq-pager .rq-count { font-size:12px }
 .rq-pager-empty { height:0;min-height:0 }
 .pageHead .eyebrow { font-size:10px; letter-spacing:1px }
 .pageHead h1 { font-size:clamp(21px,6vw,27px)!important }
 .pageHead > button { min-height:40px; font-size:11px; padding:7px 11px }
 .notice:not(.hidden) { font-size:12px; line-height:1.4; padding:11px 13px; max-height:min(140px,30dvh); overflow-y:auto }
 .rq-mobile-pane, .view > .panel, .view > .homeLayout > .panel { overscroll-behavior:contain }
 .rq-mobile-pane:not(.rq-page-off) { scrollbar-width:none }
 .rq-mobile-pane:not(.rq-page-off)::-webkit-scrollbar { display:none }
 #view-home .homeHero { grid-template-columns:minmax(0,1fr) 112px; min-height:97px; max-height:109px; height:clamp(97px,14dvh,109px) }
 #view-home .heroMain .eyebrow { font-size:10px; letter-spacing:.2px }
 #view-home .heroMain h1 { font-size:clamp(20px,6vw,28px)!important; margin:5px 0!important }
 #view-home .weekTop .eyebrow { font-size:10px }
 #view-home .weekCard .weekRingInner span { font-size:8px; max-width:44px; line-height:1.1 }
 #view-home .setupBanner strong { font-size:12px }
 #view-home .setupBanner button { font-size:11px; min-height:36px }
 #view-home .focusCopy span { font-size:10px; letter-spacing:.3px }
 #view-home .focusCopy strong { font-size:clamp(12px,3.5vw,16px) }
 #view-home .focusMetric span { font-size:9px }
 #view-home .quickGrid { min-height:57px; height:57px; gap:4px }
 #view-home .quick { padding:6px 3px }
 #view-home .quick span { font-size:9.5px; letter-spacing:-.15px }
 #view-home .quick b { font-size:19px }
 #view-home .panelTitle h2 { font-size:clamp(13px,3.8vw,16px); letter-spacing:-.3px }
 #view-home .panelTitle .eyebrow { font-size:9px }
 #view-home .panelTitle .pill { font-size:9px }
 #view-home .panelTitle button { min-height:36px; font-size:10px; padding:5px 8px }
 #view-home .featuredBottom h3 { font-size:clamp(17px,5vw,25px); line-height:1.12 }
 #view-home .featuredMeta { font-size:11px }
 #view-home .rewardStrip { margin-top:7px }
 #view-home .rewardStrip span { font-size:9px; padding:5px 4px }
 #view-home[data-rq-home="week"] .weekLifecycle>.lifecycleCard { padding:12px }
 #view-home[data-rq-home="week"] .lifecycleHead strong { font-size:14px }
 #view-home[data-rq-home="week"] .lifecycleHead .eyebrow { font-size:9px }
 #view-home[data-rq-home="week"] .weekMini span { font-size:10px }
 #view-segments .questFilters { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:4px; min-height:40px; height:40px }
 #view-segments .questFilters button { font-size:clamp(10px,2.85vw,12px); min-height:40px; line-height:1.1; font-weight:850; padding:4px 2px; letter-spacing:-.35px }
 #view-segments .nearbyControls { min-height:37px; max-height:37px }
 #view-segments #nearbyToggle { min-height:36px; max-height:36px; font-size:11px; padding:6px 10px }
 #view-segments .segmentMap { min-height:70px }
 #view-segments .segmentBody { padding:9px 10px!important; gap:5px; max-height:61%; overflow-y:auto; scrollbar-width:none }
 #view-segments .segmentBody::-webkit-scrollbar { display:none }
 #view-segments .segmentBody h3 { font-size:clamp(15px,4.4vw,19px) }
 #view-segments .segmentBody .meta { font-size:11px }
 #view-segments .segmentBody .routeAccuracy { font-size:10px; line-height:1.25 }
 #view-segments .segmentBody .questStatus { font-size:9px; padding:4px 7px }
 #view-segments .scorePill { font-size:11px }
 #view-segments .questRules { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:3px }
 #view-segments .questRules span { font-size:clamp(9px,2.65vw,10px); line-height:1.15; min-width:0; white-space:normal; padding:5px 1px; align-self:stretch; display:flex; justify-content:center; align-items:center; flex-wrap:wrap; column-gap:2px }
 #view-segments .segmentActions { gap:6px }
 #view-segments .segmentActions>* { height:43px!important; min-height:43px!important; font-size:11px; border-radius:12px; padding:5px 4px; line-height:1.15 }
 #view-segments .segmentActions .uploadQuest { font-size:11px!important; padding:5px 4px }
 #view-segments .segmentActions .uploadQuest span { font-size:10px!important; line-height:1.1 }
 #view-segments .segmentMap .mapTag, #view-segments .segmentMap .speedTag, #view-segments .segmentMap .standardTag { font-size:10px; letter-spacing:0 }
 #view-segments .nextWeekPanel { padding:10px }
 #view-segments .nextWeekPanel>.muted { font-size:11px }
 #view-ranking .scopeBtns { min-height:40px; max-height:40px; flex-basis:40px }
 #view-ranking .scopeBtns button { min-height:40px; font-size:clamp(9px,2.6vw,11px); padding:3px 0; letter-spacing:-.3px }
 #view-ranking .podiumCard strong { font-size:11px }
 #view-ranking .podiumCard small, #view-ranking .podiumCard em { font-size:9px }
 #view-ranking .podiumCard .podiumNumber { font-size:10px }
 #view-ranking .rankRow { min-height:52px; padding:7px; gap:6px }
 #view-ranking .rankWho strong { font-size:12px }
 #view-ranking .rankWho span { font-size:10px }
 #view-ranking .rankScore { font-size:15px }
 #view-friends>.panel, #view-friends .homeLayout>.panel, #view-rewards .homeLayout>.panel, #view-profile .homeLayout>.panel, #view-admin>.panel { overflow-y:auto; scrollbar-width:none; padding:12px; }
 #view-friends>.panel::-webkit-scrollbar, #view-friends .homeLayout>.panel::-webkit-scrollbar, #view-rewards .homeLayout>.panel::-webkit-scrollbar, #view-profile .homeLayout>.panel::-webkit-scrollbar { display:none }
 #view-friends .panelTitle h3, #view-rewards .panelTitle h3 { font-size:16px }
 #view-friends .item, #view-rewards .reward, #view-profile .item { font-size:12px; line-height:1.45 }
 #view-friends .form label, #view-rewards .item, #view-admin .form label { font-size:12px }
 #view-friends .form button, #view-rewards button, #view-profile #profileForm button { min-height:44px; font-size:12px }
 #view-rewards .reward p { font-size:12px }
 #view-profile .pageHead #profileProvince, #view-profile .pageHead #userEmail { font-size:10px }
 #view-profile .pageHead>.btns button { font-size:10px; min-height:40px }
 #view-profile .profileStats { min-height:62px; height:62px }
 #view-profile .profileStat span { font-size:9px; letter-spacing:-.15px }
 #view-profile .profileStat b { font-size:19px }
 #view-profile #profileForm { gap:8px }
 #view-profile #profileForm label { font-size:12px; line-height:1.35 }
 #view-profile #profileForm input { min-height:42px; padding:9px 10px; font-size:16px!important }
 #view-profile #profileForm label:has(input[type="checkbox"]) { min-height:42px }
 #questBackdrop .detailHeader { max-height:96px }
 #questBackdrop .detailHeader h2 { font-size:clamp(21px,5.7vw,28px) }
 #questBackdrop .detailHeader p { font-size:11px }
 #questBackdrop #detailRouteNotice { font-size:11px; line-height:1.32; max-height:70px; overflow-y:auto; scrollbar-width:none }
 #questBackdrop .routeTools button { min-height:44px; font-size:11px }
 #questBackdrop .detailMap { max-height:min(49dvh,440px); min-height:130px }
 #questBackdrop .detailStats { gap:6px }
 #questBackdrop .detailStat span { font-size:10px }
 #questBackdrop .detailRule { font-size:12px; line-height:1.3; padding:10px }
 #questBackdrop .detailRules { overflow-y:auto; scrollbar-width:none }
 #questBackdrop .detailUpload { overflow-y:auto; scrollbar-width:none; align-content:start; justify-content:center }
 #questBackdrop .detailUpload strong { font-size:16px }
 #questBackdrop .detailUpload input { width:100%; min-height:44px }
 .rq-map-controls .rq-map-zoom { width:42px!important; height:42px!important; min-width:42px!important; min-height:42px!important }
 .rq-map-status { font-size:10px!important; line-height:1.2!important }
 .rq-route-summary { order:6; display:flex; align-items:center; justify-content:space-between; flex:0 0 auto; min-height:39px; padding:7px 11px; gap:10px; background:rgba(54,133,238,.12); border:1px solid rgba(115,172,238,.18); border-radius:12px; color:#d8ecff; font-size:11px }
 .rq-route-summary b { color:#fff; font-size:13px }
 #questBackdrop .detailStats { order:7 }
 #questBackdrop .detailRules { order:8 }
 #questBackdrop .detailUpload { order:9 }
 #questBackdrop[data-rq-detail="points"] .rq-route-summary, #questBackdrop[data-rq-detail="upload"] .rq-route-summary { display:none!important }
 #uploadBackdrop .questSheet, #reviewBackdrop .questSheet { padding: max(13px,env(safe-area-inset-top)) 14px max(16px,env(safe-area-inset-bottom))!important; overflow-y:auto!important; -webkit-overflow-scrolling:touch }
 #uploadBackdrop .sheetTop, #reviewBackdrop .sheetTop { position:sticky; top:0; z-index:2; padding:8px 0; background:#10294b }
 #uploadBackdrop #uploadConfirm, #uploadBackdrop #uploadCancel { min-height:44px; font-size:12px }
 #uploadBackdrop .uploadRoutePreview { min-height:125px }
 .activityDrawer { max-height:100dvh; padding-bottom:max(20px,env(safe-area-inset-bottom))!important }
 body.rq-keyboard .app { height:var(--rq-visual-height,100dvh)!important; min-height:0!important }
 body.rq-keyboard .questBackdrop>.questSheet { height:var(--rq-visual-height,100dvh)!important; max-height:var(--rq-visual-height,100dvh)!important }
 body.rq-keyboard #view-profile .homeLayout>.panel, body.rq-keyboard #view-friends>.panel, body.rq-keyboard #view-friends .homeLayout>.panel { overflow-y:auto!important; }
 body.rq-keyboard #authCard .authPanel { justify-content:flex-start; overflow-y:auto; }
}
@media (max-width:700px) and (max-height:710px), (orientation:landscape) and (max-height:540px) and (pointer:coarse) {
 :root { --rq-nav:63px; --rq-header:42px }
 .sidebar:not(.hidden) { height:63px!important; }
 .sidebar button { font-size:10px!important; }
 .sidebar button::before { font-size:18px!important }
 .rq-mobile-tabs { height:35px; min-height:35px }
 .rq-mobile-tabs button { font-size:11px; min-height:28px }
 .rq-pager { height:35px; min-height:35px }
 .rq-pager button { height:34px; min-height:34px }
 .pageHead { min-height:37px; max-height:43px }
 #view-home .homeHero { height:85px; min-height:85px; max-height:85px }
 #view-home .quickGrid { height:46px; min-height:46px }
 #view-home .focusBar { min-height:43px }
 #view-home .homeLayout .panelTitle { margin-bottom:4px }
 #view-segments .questFilters { min-height:35px; height:35px }
 #view-segments .questFilters button { min-height:35px }
 #view-segments .nearbyControls { min-height:31px; max-height:31px }
 #view-segments #nearbyToggle { min-height:30px; max-height:30px }
 #view-segments .segmentMap { min-height:62px }
 #view-segments .segmentBody { max-height:66%; gap:3px; padding:6px 8px!important }
 #view-segments .segmentActions>* { height:39px!important; min-height:39px!important }
 #questBackdrop .detailMap { min-height:105px; max-height:43dvh }
 #questBackdrop #detailRouteNotice { padding:5px 8px; max-height:52px }
 #questBackdrop .routeTools button { min-height:38px }
 #questBackdrop .rq-route-summary { min-height:33px; padding:5px 8px }
 #questBackdrop .detailHeader { max-height:68px }
 #view-profile .profileStats { min-height:55px; height:55px }
 #view-profile .profileStat span { font-size:9px }
}
@media (orientation:landscape) and (max-height:540px) and (pointer:coarse) {
 .sidebar:not(.hidden) { height:49px!important; --rq-nav:49px; }
 .sidebar button { font-size:10px!important }
 #questBackdrop .detailMap { min-height:75px; max-height:33dvh }
 .rq-route-summary { display:none }
}
@media (prefers-reduced-motion:reduce) {
 .rq-mobile-tabs *, .sidebar button, .rq-pager button { transition:none!important; animation:none!important }
}

/* QA follow-up: small-screen controls and landscape reachability. */
@media (max-width:700px) and (max-height:710px), (orientation:landscape) and (max-height:540px) and (pointer:coarse){
 .rq-mobile-tabs{height:36px!important;min-height:36px!important}
 .rq-mobile-tabs button{height:31px!important;min-height:31px!important}
 #questBackdrop .rq-mobile-tabs button{height:31px!important;min-height:31px!important}
}
@media (max-width:700px), (orientation:landscape) and (max-height:540px) and (pointer:coarse){
 .segmentMap .rq-map-status{position:absolute;top:auto!important;bottom:2px!important;left:5px!important;max-width:65%!important;max-height:19px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:9px!important;line-height:1!important;padding:2px 4px!important}
 .featuredQuest .rq-map-status{display:none!important}
 .rq-map-status.rq-map-error{border-color:rgba(130,179,223,.35)}
}
@media (orientation:landscape) and (max-height:540px) and (pointer:coarse){
 .app{padding-bottom:calc(49px + env(safe-area-inset-bottom) + 14px)!important}
 .view:not(.hidden){overflow-y:auto!important;overscroll-behavior:contain;scrollbar-width:none;padding-bottom:8px}
 .view:not(.hidden)::-webkit-scrollbar{display:none}
 #view-home .homeLayout{flex:0 0 auto;min-height:162px}
 #view-home #homeSegments{min-height:130px}
 #view-segments #segmentsList{flex:0 0 auto;min-height:174px;overflow:visible}
 #view-segments #segmentsList>.segment{min-height:173px;max-height:none}
 #view-segments .segmentMap{min-height:76px}
 #view-segments .segmentBody{max-height:none;overflow:visible}
 #view-segments .rq-pager{margin-top:3px}
 #view-friends>.panel,#view-friends .homeLayout>.panel,#view-profile .homeLayout>.panel{flex:0 0 auto;min-height:220px;overflow:auto}
 #questBackdrop>.questSheet{overflow-y:auto!important;overscroll-behavior:contain;scrollbar-width:none}
 #questBackdrop .detailMap{flex:0 0 120px;min-height:120px;max-height:120px}
 #questBackdrop .detailRules{flex:0 0 auto;overflow:visible}
 #questBackdrop .detailUpload{flex:0 0 auto;min-height:170px}
 #questBackdrop .rq-mobile-tabs{flex:0 0 36px}
}
