/* Clinical Quest v6.1 — mobile layout stability and compact interactive guidance.
   Overrides only screen widths <= 840px; no changes to game engine or desktop UI. */
.cq-step-short{display:none}
@media(max-width:840px){
 /* Restore natural mobile document flow: prevent flex children from shrinking over each other. */
 .content.route-dashboard{display:block!important;overflow-y:auto!important;overflow-x:hidden!important;scroll-behavior:smooth;padding:12px 11px calc(25px + env(safe-area-inset-bottom))!important}
 .content.route-dashboard .dashboard-layout.cq-dashboard{height:auto!important;min-height:0!important;max-height:none!important;display:flex!important;flex-direction:column!important;flex:0 0 auto!important;gap:12px!important;overflow:visible!important;width:100%!important}
 .cq-dashboard>*{flex:0 0 auto!important;min-height:0!important}
 .cq-dashboard .cq-hero{height:249px!important;flex:0 0 249px!important}
 .cq-dashboard .cq-hero-content{top:39%!important;width:93%!important;right:4%!important;gap:5px!important}
 .cq-dashboard .cq-hero h1{font-size:18px!important;line-height:1.55!important}
 .cq-dashboard .cq-hero p{font-size:10px!important;line-height:1.75!important;max-width:92%!important}
 .cq-dashboard .cq-hero-glass{width:145px!important;bottom:5%!important;padding:7px 9px!important}
 .cq-dashboard .cq-hero-glass .cq-hero-line svg{height:23px!important}
 .cq-dashboard .cq-stats{width:100%!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-auto-rows:74px!important;gap:8px!important;height:auto!important;min-height:0!important;align-content:initial!important}
 .cq-dashboard .cq-stat{height:74px!important;min-height:74px!important;padding:9px 10px!important;overflow:hidden!important}
 .cq-dashboard .cq-stat strong{font-size:18px!important}.cq-dashboard .cq-stat strong small{font-size:9px!important}
 .cq-dashboard .cq-stat-icon{width:33px!important;height:33px!important;flex:0 0 33px!important;border-radius:11px!important}
 .cq-dashboard .cq-middle,.cq-dashboard .cq-bottom{display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:none!important;gap:12px!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;flex:0 0 auto!important}
 .cq-dashboard .cq-middle>.card,.cq-dashboard .cq-bottom>.card{min-height:0!important;flex:0 0 auto!important;overflow:hidden!important;position:relative!important;padding:14px!important}
 .cq-dashboard .cq-journey{height:206px!important}
 .cq-dashboard .cq-achieve{height:181px!important}
 .cq-dashboard .cq-performance{height:140px!important}
 .cq-dashboard .cq-next{height:176px!important}
 .cq-dashboard .cq-section-head h2{font-size:14px!important}
 .cq-dashboard .cq-counter{font-size:9px!important;padding:5px 7px!important}
 .cq-dashboard .cq-journey .cq-mission-line{display:grid!important;grid-template-columns:repeat(8,79px)!important;grid-template-rows:115px!important;gap:4px!important;flex:0 0 115px!important;height:115px!important;min-height:115px!important;margin-top:7px!important;overflow-x:auto!important;overflow-y:hidden!important;overscroll-behavior-x:contain;scroll-snap-type:x proximity;scrollbar-width:thin;scrollbar-color:#2a7985 transparent;padding-bottom:5px!important}
 .cq-dashboard .cq-mission{height:107px!important;width:79px!important;min-width:79px!important;flex:0 0 79px!important;padding:4px 2px!important;gap:4px!important;scroll-snap-align:start}
 .cq-dashboard .cq-mission-hex{width:42px!important;height:42px!important}
 .cq-dashboard .cq-mission-hex svg{width:19px!important;height:19px!important}
 .cq-dashboard .cq-mission b{font-size:9px!important;min-height:23px!important}
 .cq-dashboard .cq-mission small{font-size:7px!important}
 .cq-dashboard .cq-medals{min-height:85px!important;align-items:center!important}
 .cq-dashboard .cq-medal-icon{height:39px!important;width:39px!important}
 .cq-dashboard .cq-next .cq-next-content{min-height:0!important}
 /* Stage tracker is fully contained ABOVE the patient scene. */
 .v4-game-heading{flex:0 0 68px!important;height:68px!important}
 .v4-stage-steps{flex:0 0 53px!important;height:53px!important;min-height:53px!important;display:flex!important;align-items:center!important;overflow:hidden!important;position:relative!important;z-index:8!important;padding:5px 10px!important;border-bottom:1px solid #2f879584!important;background:#061b2d!important}
 .game-v4 .steps{height:42px!important;min-height:42px!important;max-height:42px!important;margin:0!important;padding:0!important;display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:5px!important;width:100%!important}
 .game-v4 .step{height:42px!important;min-height:42px!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:3px!important;font-size:9px!important;padding:4px 2px!important;border-radius:10px!important}
 .game-v4 .step i{font-size:10px!important;line-height:13px!important;width:17px;height:17px;display:grid;place-items:center;border-radius:50%;background:#1d4560;color:#cfeefa}
 .game-v4 .step.current i{background:#3ff4da;color:#013b48;box-shadow:0 0 10px #31eadd81}
 .game-v4 .step span{display:none!important}
 .game-v4 .cq-step-short{display:block!important;font-size:8px!important;font-weight:700!important;line-height:1.15!important;white-space:nowrap!important;color:#91b8ca!important}
 .game-v4 .step.current .cq-step-short{color:#e4fffd!important}
 .game-v4 .step.done .cq-step-short{color:#67ead7!important}
 .v4-theatre{min-height:0!important;flex:1 1 auto!important}
 .v4-person-figure{height:81%!important;top:3%!important}
 .cq-mobile-console .cq-mobile-tool-panel{max-height:min(30dvh,250px)!important}
 .cq-mobile-console .cq-mobile-tool-content{max-height:calc(min(30dvh,250px) - 37px)!important}
 /* Guide doesn't scroll: switch between step, paginated goals, and patient facts. */
 .game-v4[data-mobile-tab="guide"] .cq-mobile-tool-panel{height:193px!important;min-height:193px!important;max-height:193px!important;overflow:hidden!important}
 .game-v4[data-mobile-tab="guide"] .cq-mobile-tool-content[data-tool-content="guide"]{height:155px!important;max-height:155px!important;overflow:hidden!important;padding:7px 10px!important}
 .cq-mobile-guide-simple{display:flex;flex-direction:column;gap:8px;height:100%;overflow:hidden}
 .cq-guide-switch{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;flex:0 0 29px}
 .cq-guide-switch button{border-radius:9px;border:1px solid #315d72;background:#0b2b44;color:#a4c4d3;font-size:10px;font-weight:800;padding:3px 5px}
 .cq-guide-switch button.selected{border-color:#49efdc;color:#eafffb;background:#10616b;box-shadow:inset 0 0 12px #36e9d52e}
 .cq-guide-current{min-height:0;flex:1;display:flex;flex-direction:column;gap:5px}
 .cq-guide-current-title{display:flex;align-items:center;justify-content:space-between;gap:8px}
 .cq-guide-current-title strong{font-size:12px;color:#f0fffd}.cq-guide-stage{font-size:9px;color:#6dffeb;background:#0a4456;border:1px solid #2c91a1;border-radius:8px;padding:3px 7px}
 .cq-guide-current p{margin:0!important;font-size:10px!important;line-height:1.55!important;color:#d1ebf3!important;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
 .cq-guide-progress{display:flex;align-items:center;justify-content:space-between;gap:9px;margin-top:auto;padding-bottom:2px;font-size:9px;color:#a7d2df}
 .cq-guide-track{height:6px;flex:1;overflow:hidden;background:#06273a;border-radius:20px}.cq-guide-track i{display:block;height:100%;border-radius:20px;background:linear-gradient(90deg,#2fb3e0,#3cf9e0)}
 .cq-guide-patient{display:grid;grid-template-columns:1fr 1fr;gap:6px}
 .cq-guide-patient>div{display:flex;flex-direction:column;justify-content:center;gap:2px;border-radius:8px;background:#0d3451;border:1px solid #21556e;padding:6px 9px;min-width:0}
 .cq-guide-patient small{font-size:8px;color:#94c1d4}.cq-guide-patient b{font-size:10px;color:#e4f9ff}
 .cq-guide-goals{display:flex;flex-direction:column;gap:4px;flex:1;min-height:0;overflow:hidden}
 .cq-guide-goal{display:flex;align-items:center;gap:8px;min-height:23px;padding:2px 5px;border:1px solid #225168;border-radius:7px;background:#0a2a40}
 .cq-guide-goal span{width:15px;height:15px;flex:0 0 15px;border:1px solid #438aa2;border-radius:5px;color:white;font-size:10px;display:grid;place-items:center}
 .cq-guide-goal span.done{background:#12a98f;border-color:#49f6d7}.cq-guide-goal b{font-size:9px;line-height:1.2;color:#e2f5fa;font-weight:600}
 .cq-guide-pages{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:0 0 23px;font-size:9px;color:#99d1df}
 .cq-guide-pages button{font-size:9px;color:#bdf3f3;background:#123f55;border:1px solid #34768b;padding:2px 12px;border-radius:7px}
 .cq-guide-pages button:disabled{opacity:.32;cursor:default}
}
@media(max-width:390px) and (max-height:700px){
 .cq-dashboard .cq-hero{height:224px!important;flex-basis:224px!important}
 .cq-dashboard .cq-hero-content{top:40%!important}
 .cq-dashboard .cq-hero-glass{width:136px!important}
 .v4-game-heading{height:60px!important;flex-basis:60px!important}
 .game-v4[data-mobile-tab="guide"] .cq-mobile-tool-panel{height:178px!important;min-height:178px!important;max-height:178px!important}
 .game-v4[data-mobile-tab="guide"] .cq-mobile-tool-content[data-tool-content="guide"]{height:140px!important;max-height:140px!important}
 .cq-guide-switch{flex-basis:27px}.cq-guide-current p{font-size:9px!important}
}
@media(min-width:841px){.cq-step-short{display:none!important}}
@media(max-width:840px){
 .cq-dashboard .cq-hero-glass{pointer-events:none!important;right:auto!important;left:12px!important;bottom:9px!important;width:116px!important;max-width:34%!important;padding:6px 8px!important;gap:2px!important}
 .cq-dashboard .cq-hero-glass .cq-hero-line svg{height:14px!important}
 .cq-dashboard .cq-hero-led{font-size:7px!important}
 .cq-dashboard .cq-hero-glass>div:last-child{font-size:8px!important}
 .cq-dashboard .cq-hero-cta{position:relative;z-index:4}
}
