.mobile-nav-label{display:none}body.phone-mode .mobile-nav-label{display:inline}
/* R115: phone-specific control layout, including landscape phones wider than 760px. */
body.phone-mode {--touch:48px;}
body.phone-mode .topbar {grid-template-columns:minmax(0,1fr) auto;grid-template-areas:'brand more' 'tools tools' 'actions actions';gap:8px;padding:8px max(10px,env(safe-area-inset-right)) 8px max(10px,env(safe-area-inset-left));position:relative;}
body.phone-mode .topbar .brand-anchor .ip-approved-logo{width:clamp(150px,44vw,210px)}
body.phone-mode .topbar .ip-more-controls{display:flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:0 12px;border-radius:9px;background:#183342;border-color:#497c87;color:#e7f7fa;font:650 13px system-ui;white-space:nowrap;}
body.phone-mode .ip-more-controls[aria-expanded=true]{background:#24515a;border-color:#71dce5}
body.phone-mode .ip-more-controls[aria-expanded=true] span{transform:rotate(180deg)}
body.phone-mode .topbar .header-tools{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-areas:'search search' 'scope random' 'live tv';gap:8px;justify-content:stretch;}
body.phone-mode .topbar .header-tools:has(.hg-local-preview){grid-template-areas:'search search' 'scope random' 'live tv' 'preview preview'}
body.phone-mode .topbar .ip-primary-controls{display:contents;position:static}
body.phone-mode .topbar #scopeModeBtn{grid-area:scope;min-width:0}
body.phone-mode .topbar .rand-group{grid-area:random;position:static;width:100%;min-width:0;display:flex}
body.phone-mode .topbar .randomizer-btn{flex:1;min-width:0;justify-content:center;padding-inline:4px}
body.phone-mode .topbar .rand-cfg-btn{min-width:44px;flex-shrink:0}
body.phone-mode .topbar #liveVideoOnlyBtn{grid-area:live;min-width:0;grid-column:auto}
body.phone-mode .topbar #launchSmartTvBtn{grid-area:tv;justify-self:stretch}
body.phone-mode .topbar :is(.cmd-btn,.scope-cycle-btn,.randomizer-btn,.rand-cfg-btn,#launchSmartTvBtn){min-height:var(--touch);height:auto;font-size:13px;padding-block:8px;line-height:1.2;white-space:normal;}
body.phone-mode .topbar .search-command{min-height:48px;height:auto;max-width:none;justify-self:stretch;}
body.phone-mode .search-command input{font-size:16px;min-width:0}
body.phone-mode .search-command :is(button,select){min-height:44px;font-size:12px}
body.phone-mode .topbar .deck-actions{display:none;grid-template-columns:minmax(0,1fr);padding:10px;background:#0c1b29;border:1px solid #365363;border-radius:12px;gap:12px;box-sizing:border-box;}
body.phone-mode .topbar.ip-controls-expanded .deck-actions{display:grid}
body.phone-mode .topbar .ip-control-group{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:0 0 10px;border:0;border-bottom:1px solid #2b4353;}
body.phone-mode .topbar .ip-control-group::before{content:attr(aria-label);grid-column:1/-1;color:#a7c4d0;font:650 12px system-ui;letter-spacing:.025em;}
body.phone-mode .topbar .ip-control-group:last-child{border-bottom:0;padding-bottom:0}
body.phone-mode .topbar .ip-control-group button{min-width:0!important;width:100%;}
body.phone-mode .topbar .wall-sizer{height:auto;min-height:48px;justify-content:center;}
body.phone-mode .topbar .grid-preset{min-height:44px;min-width:44px;font-size:14px;}
body.phone-mode .topbar .rand-popover{top:100%;left:8px;width:min(440px,calc(100% - 16px));max-height:60dvh;overflow:auto;z-index:50;}
body.phone-mode .rand-popover :is(button,label){min-height:44px;}
body.phone-mode .context-bar{padding:8px 10px;gap:8px;}
body.phone-mode .ctx-right{width:100%;display:flex;gap:6px;}
body.phone-mode .ctx-right :is(.slim-select,.sub-chip){min-height:44px;font-size:12px;max-width:100%;flex:1 1 120px;}
body.phone-mode .pager-box{order:-1;width:100%;height:auto;min-height:56px;display:grid;grid-template-columns:minmax(0,1fr) 48px auto minmax(0,1fr);gap:6px;padding:4px;background:#0c1a28;border-color:#355363;}
body.phone-mode .pg-btn{height:48px;min-width:48px;font:700 15px system-ui;border:1px solid #456775;border-radius:8px;background:#182e40;color:#e7f5fa;}
body.phone-mode #nextPgBtn{background:#8ce3e5;color:#082331;border-color:#8ce3e5;}
body.phone-mode .pg-in{width:100%;min-height:44px;font-size:16px;}
body.phone-mode .pg-tot{font-size:12px;color:#a9c1d1;}
body.phone-mode :is(.cat-btn,.subchips-bar .sub-chip,.mini-act-btn,.slow-btn,#mPrevBtn,#mNextBtn){min-height:44px;min-width:44px;font-size:13px;}
body.phone-mode .tv-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:8px;}
body.phone-mode .tv-controls .tv-btn{min-height:48px;font-size:13px;line-height:1.25;white-space:normal;justify-content:center;text-align:center;}
body.phone-mode .tv-controls #tvShuffleAllBtn{background:#8ce3e5;color:#082331;font-weight:750;}
body.phone-mode .tv-controls #tvOptionsBtn{background:#183342;border-color:#497c87;}
body.phone-mode .tv-controls :is(#returnDeckLink,#tvHubTopicSel,#tvPoolStatus,.tv-options){grid-column:1/-1;}
body.phone-mode .tv-options:not([hidden]){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:10px;background:#0c1b29;border:1px solid #365363;border-radius:12px;}
body.phone-mode:not(.idle-naked) .tv-hover-bar{pointer-events:auto;}
body.phone-mode .tv-open-single{display:inline-flex;align-items:center;min-height:44px;font-size:12px;}
body.phone-mode .tv-hud{padding-inline:max(8px,env(safe-area-inset-left)) max(8px,env(safe-area-inset-right));}
@media(orientation:landscape){
body.phone-mode .topbar .brand-anchor .ip-approved-logo{width:150px;}
body.phone-mode .topbar .header-tools{grid-template-columns:repeat(4,minmax(0,1fr));grid-template-areas:'scope random live tv' 'search search search search';}
body.phone-mode .topbar .header-tools:has(.hg-local-preview){grid-template-areas:'scope random live tv' 'search search search search' 'preview preview preview preview'}
body.phone-mode .topbar .deck-actions{grid-template-columns:repeat(2,minmax(0,1fr));}
body.phone-mode .ctx-right .pager-box{width:auto;flex:1 1 100%;}
body.phone-mode .tv-controls{grid-template-columns:repeat(4,minmax(0,1fr));}
body.phone-mode .tv-options:not([hidden]){grid-template-columns:repeat(3,minmax(0,1fr));}
body.phone-mode .tv-wall{max-height:calc(100dvh - 12px);}
body.phone-mode.hg-immersive .tv-wall{max-height:none;}
}

/* R116: focused phone TV toolbar; secondary controls are opt-in. */
.tv-secondary{display:contents}.tv-dev-control{display:none!important}
body.phone-mode .tv-hud{display:grid;gap:8px;max-height:none;overflow:visible;padding:10px max(10px,env(safe-area-inset-right)) 10px max(10px,env(safe-area-inset-left));background:#122332;border-bottom:1px solid #325363;}
body.phone-mode .tv-bug{width:100%;padding:0 2px;border:0;background:none;box-shadow:none;backdrop-filter:none;}
body.phone-mode .tv-bug .ip-approved-logo{width:clamp(160px,53vw,230px);height:auto;}
body.phone-mode #tvModeSub,body.phone-mode .ip-tv-brand>span{display:none!important}
body.phone-mode .tv-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;width:100%;padding:0;border:0;box-shadow:none;background:none;backdrop-filter:none;}
body.phone-mode .tv-controls>.tv-btn{width:100%;min-width:0;margin:0;border-radius:9px;min-height:48px;font-size:14px;}
body.phone-mode .tv-controls #returnDeckLink{grid-column:auto;order:2;}body.phone-mode .tv-controls #tvOptionsBtn{order:3;}body.phone-mode .tv-controls #tvShuffleAllBtn{order:0;background:#29c8cc;color:#09212a;}body.phone-mode .tv-controls #tvLiveHubBtn{order:1;}body.phone-mode #tvHubTopicSel{order:4;}
body.phone-mode .tv-secondary{display:none;}body.phone-mode .tv-expanded .tv-secondary{display:grid;grid-column:1/-1;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;order:5;padding:10px;background:#0c1b29;border:1px solid #365363;border-radius:10px;}body.phone-mode .tv-secondary [data-layout]{display:none!important;}
body.phone-mode .tv-options:not([hidden]){order:6;width:100%;margin:0;}body.phone-mode .tv-controls #tvPoolStatus{order:7;margin:0;padding:0 2px;color:#a9c2ce;font-size:12px;}
body.phone-mode .tv-wall{width:100%;padding:10px;max-height:none;aspect-ratio:auto;grid-template-rows:auto;}body.phone-mode .tv-tile:not(.tv-stage){aspect-ratio:16/9;min-height:0;}body.phone-mode:not(.hg-immersive) .tv-hover-bar{left:8px;right:8px;bottom:8px;padding:4px 6px;gap:6px;background:#081522e8;}body.phone-mode .tv-hover-txt{font-size:12px;white-space:normal;line-height:1.25;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;}body.phone-mode .tv-open-single{min-height:44px;padding:0 10px;}
body.phone-mode.hg-immersive .tv-wall{height:100dvh;max-height:none;}body.phone-mode.hg-immersive .tv-tile:not(.tv-stage){aspect-ratio:auto;}body.phone-mode.hg-immersive .tv-hud{max-height:calc(100dvh - 16px);overflow:auto;}
@media(orientation:landscape){body.phone-mode:not(.hg-immersive) .tv-hud{grid-template-columns:minmax(120px,180px) minmax(0,1fr);align-items:center;}body.phone-mode .tv-controls{grid-template-columns:repeat(4,minmax(0,1fr));}body.phone-mode .tv-expanded .tv-secondary,body.phone-mode .tv-options:not([hidden]){grid-template-columns:repeat(3,minmax(0,1fr));}body.phone-mode:not(.hg-immersive) .tv-wall{max-width:calc((100dvh - 96px)*1.7778 + 20px);min-width: min(360px,100%);margin:auto;}}

/* R117: tablet controls, minimum touch sizes and narrow-screen guards. */
@media (max-width:960px) and (min-width:601px){
body:not(.phone-mode) .topbar{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:'brand more' 'tools tools' 'actions actions';gap:8px;}
body:not(.phone-mode) .topbar .ip-more-controls{display:flex;align-items:center;min-height:44px;padding:0 12px;}
body:not(.phone-mode) .topbar .deck-actions{display:none;grid-template-columns:repeat(2,minmax(0,1fr));}
body:not(.phone-mode) .topbar.ip-controls-expanded .deck-actions{display:grid;}
body:not(.phone-mode) .topbar .ip-control-group{flex-wrap:wrap;min-width:0;}
}
@media (pointer:coarse){.tv-btn,.pg-btn,.mini-act-btn,.topbar .cmd-btn,.topbar .grid-preset,.topbar .scope-cycle-btn,.topbar .randomizer-btn,.topbar .rand-cfg-btn{min-height:44px;min-width:44px;}.tv-open-single{min-height:44px;display:inline-flex;align-items:center;}}
body.phone-mode .topbar .ip-more-controls{min-height:48px;}
body.phone-mode .tv-controls>.tv-btn:focus-visible,body.phone-mode .pg-btn:focus-visible{outline:2px solid #8ce3e5;outline-offset:2px;}
body.phone-mode .tv-secondary .tv-btn,body.phone-mode .tv-options .tv-btn{width:100%;min-width:0;min-height:48px;}
body.phone-mode .tv-hud .tv-controls select{font-size:16px;}
body.phone-mode .tv-hover-bar .tv-open-single{flex-shrink:0;}
body.phone-mode .tv-wall{min-width:0;}
@media(max-width:360px){body.phone-mode .topbar .brand-anchor .ip-approved-logo{width:145px;}body.phone-mode .topbar .ip-more-controls{font-size:12px;padding-inline:8px;}body.phone-mode .pager-box{grid-template-columns:minmax(0,1fr) 40px auto minmax(0,1fr);}body.phone-mode .pg-btn{font-size:13px;}}

/* R118: persistent camera navigation, outside the video and above the safe area. */
body.phone-mode:not(.frameless) .app{padding-bottom:calc(68px + env(safe-area-inset-bottom, 0px));box-sizing:border-box;}
body.phone-mode .ctx-right .pager-box{position:fixed;bottom:0;left:0;right:0;width:100%;max-width:none;z-index:75;box-sizing:border-box;border-radius:0;border-width:1px 0 0;grid-template-columns:minmax(0,1fr) minmax(40px,68px) auto minmax(0,1fr);gap:6px;padding:8px max(10px,env(safe-area-inset-right,0px)) calc(8px + env(safe-area-inset-bottom,0px)) max(10px,env(safe-area-inset-left,0px));box-shadow:0 -4px 16px #0005;}
body.phone-mode .pg-btn:disabled{opacity:.45;cursor:default;}
body.phone-mode:has(.modal-backdrop.open) .pager-box,body.phone-mode:has(.fullpage-map-overlay.open) .pager-box{visibility:hidden;}
@media(orientation:landscape){body.phone-mode .ctx-right .pager-box{grid-template-columns:minmax(0,1fr) 64px auto minmax(0,1fr);}}

/* R123: video-first phone deck; tablet and TV controls unchanged. */
body.phone-mode .topbar:not(.ip-controls-expanded){grid-template-areas:'brand more' 'tools tools';}
body.phone-mode .topbar:not(.ip-controls-expanded) .header-tools{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-areas:'random tv';}
body.phone-mode .topbar:not(.ip-controls-expanded) :is(#scopeModeBtn,#liveVideoOnlyBtn,.search-command,.rand-cfg-btn,.rand-popover,.hg-local-preview,.top-leaderboard-ad){display:none!important;}
body.phone-mode .topbar:not(.ip-controls-expanded) .randomizer-btn{border-radius:9px;}
body.phone-mode .topbar .ip-more-controls{min-height:44px;height:auto;border-radius:9px;gap:6px;}
body.phone-mode .topbar .header-tools :is(.randomizer-btn,#launchSmartTvBtn){min-height:44px;height:44px;font-size:13px;align-items:center;justify-content:center;}
body.phone-mode .topbar #launchSmartTvBtn{border-radius:9px;}
body.phone-mode .topbar .ip-control-group{grid-template-columns:repeat(2,minmax(0,1fr));justify-content:stretch;}
body.phone-mode .topbar .deck-actions{justify-content:stretch;align-items:start;}
body.phone-mode .topbar .ip-control-group .wall-sizer{display:none;}
body.phone-mode .topbar .ip-layout>[data-hg-full]{grid-column:1/-1;}
body.phone-mode:not(:has(.topbar.ip-controls-expanded)) :is(.left-rail,.subchips-bar){display:none!important;}
body.phone-mode:not(:has(.topbar.ip-controls-expanded)) .ctx-right>:not(.pager-box){display:none!important;}
body.phone-mode:not(:has(.topbar.ip-controls-expanded)) .ctx-left :is(#wxReadout,#smartNoteSlot){display:none!important;}
body.phone-mode .ctx-left{width:100%;justify-content:center;text-align:center;gap:4px 8px;}
body.phone-mode .ctx-title{flex-basis:100%;font-size:14px;line-height:1.3;}
body.phone-mode .ctx-stats{font:500 12px system-ui;background:none;border:0;padding:2px 0;color:#b6cbd6;text-align:center;}
body.phone-mode .ctx-right .pager-box{grid-template-columns:minmax(0,1fr) minmax(76px,auto) minmax(0,1fr);align-items:center;}
body.phone-mode .pager-position{display:flex;align-items:center;justify-content:center;gap:3px;min-width:0;}
body.phone-mode .pager-position .pg-in{width:clamp(36px,12vw,64px);padding:0;appearance:textfield;}
body.phone-mode .pager-position .pg-in::-webkit-inner-spin-button,body.phone-mode .pager-position .pg-in::-webkit-outer-spin-button{appearance:none;margin:0;}
body.phone-mode .pager-position .pg-tot{white-space:nowrap;}
body.phone-mode .pager-box .pg-btn{display:flex;align-items:center;justify-content:center;gap:5px;min-width:0;}
body:not(.phone-mode) .pager-position{display:contents;}
body.phone-mode .topbar .ip-more-controls:focus-visible{outline:2px solid #8ce3e5;outline-offset:2px;}
@media(orientation:landscape) and (min-width:650px){body.phone-mode .topbar:not(.ip-controls-expanded){grid-template-columns:auto minmax(0,1fr) auto;grid-template-areas:'brand tools more';}}

/* R124: keep phone camera controls out of the picture. Desktop overlay unchanged. */
.feed-card{position:relative;}
.phone-camera-tools{display:none;}
body.phone-mode:not(.frameless):not(.clean-tiles) .feed-card .card-top-actions{position:static;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:0 10px 10px;opacity:1;}
body.phone-mode:not(.frameless):not(.clean-tiles) .feed-card .phone-camera-tools{display:block;order:2;}
body.phone-mode:not(.frameless):not(.clean-tiles) .feed-card .camera-fullscreen{order:1;}
body.phone-mode:not(.frameless):not(.clean-tiles) .camera-fullscreen::after{content:" Fullscreen";}
body.phone-mode:not(.frameless):not(.clean-tiles) .feed-card .lock-btn,body.phone-mode:not(.frameless):not(.clean-tiles) .feed-card .pin-btn{display:none;order:3;}
body.phone-mode:not(.frameless):not(.clean-tiles) .feed-card.camera-tools-expanded :is(.lock-btn,.pin-btn){display:block;}
body.phone-mode:not(.frameless):not(.clean-tiles) .lock-btn::after{content:" Lock camera";}
body.phone-mode:not(.frameless):not(.clean-tiles) .pin-btn::after{content:" Favorite";}
body.phone-mode:not(.frameless):not(.clean-tiles) .feed-card .mini-act-btn{min-width:0;min-height:44px;height:auto;padding:8px;border-radius:8px;background:#182e40;border:1px solid #456775;font:600 13px/1.2 system-ui;color:#e7f5fa;}
body.phone-mode:not(.frameless):not(.clean-tiles) .feed-card .mini-act-btn[aria-pressed=true]{border-color:#e9b958;color:#f9d877;}
body.phone-mode:not(.frameless):not(.clean-tiles) .feed-bar{display:grid;grid-template-columns:28px minmax(0,1fr);gap:6px 8px;padding:10px;background:#0c1a28;}
body.phone-mode:not(.frameless):not(.clean-tiles) .feed-title{font-size:15px;white-space:normal;overflow-wrap:anywhere;line-height:1.3;}
body.phone-mode:not(.frameless):not(.clean-tiles) .feed-sub{font-size:12px;white-space:normal;overflow-wrap:anywhere;line-height:1.35;}
body.phone-mode:not(.frameless):not(.clean-tiles) .feed-badges{grid-column:1/-1;flex-wrap:wrap;justify-content:space-between;gap:6px;min-width:0;}
body.phone-mode:not(.frameless):not(.clean-tiles) .feed-badges .cadence-pill{font-size:10px;white-space:normal;max-width:100%;}
body.phone-mode:not(.frameless):not(.clean-tiles) .tile-audio-btn:not([hidden]){min-height:44px;height:auto;padding:6px 12px;font:600 13px system-ui;border-radius:8px;}
body.phone-mode .feed-card :focus-visible{outline:2px solid #8ce3e5;outline-offset:-3px;}

/* Phone dialogs: preserve reachable actions in short and narrow viewports. */
body.phone-mode .modal-backdrop{padding:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));box-sizing:border-box;}
body.phone-mode .modal-backdrop .spot-box{max-width:100%;max-height:calc(100dvh - max(8px,env(safe-area-inset-top)) - max(8px,env(safe-area-inset-bottom)));overflow-y:auto;}
body.phone-mode .spot-top,body.phone-mode .spot-bot{padding:8px;gap:8px;flex-shrink:0;}
body.phone-mode .spot-top>div,body.phone-mode .spot-bot>div{min-width:0;max-width:100%;flex-wrap:wrap;}
body.phone-mode .spot-top .cmd-btn,body.phone-mode .spot-bot .cmd-btn{min-height:44px;box-sizing:border-box;}
body.phone-mode #mTitle{overflow-wrap:anywhere;}
body.phone-mode #spotStage{flex-shrink:0;max-height:none;}
body.phone-mode #guideModalBg .guide-grid{min-height:0;}

/* Phone desktop override: full viewing options, still responsive to touch screens. */
.phone-desktop .video-grid{grid-template-columns:repeat(var(--grid-cols),minmax(0,1fr))}
.phone-desktop .feed-card{min-width:0}.phone-desktop .feed-iframe,.phone-desktop .tv-media iframe{pointer-events:auto;transform:none}
.phone-desktop .card-top-actions{opacity:1}.phone-desktop .tv-hover-bar{opacity:1}.phone-desktop .tv-open-single{display:inline-flex}
.phone-desktop .tv-hud{max-height:70dvh;overflow:auto}.phone-desktop .tv-controls{flex-wrap:wrap}.phone-desktop .tv-wall{height:100dvh}
.phone-desktop .topbar .grid-preset{min-width:44px;min-height:44px}.phone-desktop .topbar .wall-sizer{height:auto;min-height:44px;flex-wrap:wrap}
