/* Adaptive app surface. Desktop review and PNG export keep their original frame. */
html.phone-app{height:100%;width:100%;background:var(--bg);overscroll-behavior:none;-webkit-text-size-adjust:100%}
html.phone-app body{height:100%;width:100%;margin:0;overflow:hidden;overscroll-behavior:none;background:var(--bg);touch-action:manipulation}
html.phone-app .viewer{position:fixed;inset:0;display:block!important;width:100%;max-width:none;height:var(--app-height,100dvh);min-height:0;margin:0;padding:0!important;gap:0}
html.phone-app .side,html.phone-app .notes,html.phone-app .stage-label,html.phone-app .stage-footer{display:none!important}
html.phone-app .stage{display:block;width:100%;height:100%;margin:0;padding:0;gap:0}
html.phone-app .phone{width:100%;height:100%;max-width:none;margin:0;border:0;border-radius:0;box-shadow:none;padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) 0 env(safe-area-inset-left,0px);background:var(--bg)}
html.phone-app .screen{width:100%;height:100%;overflow:hidden}
html.phone-app .status{display:none!important}
html.phone-app .safe-area{height:max(12px,env(safe-area-inset-bottom,0px));flex:0 0 max(12px,env(safe-area-inset-bottom,0px))}
html.phone-app .content,html.phone-app .v5-gallery-body{overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch}
html.phone-app button{-webkit-user-select:none;user-select:none;touch-action:manipulation}
html.phone-app input,html.phone-app select,html.phone-app textarea{font-size:16px!important}
html.phone-app .v5-context-fields input{height:34px;padding:5px 8px}
html.phone-app .v5-context-fields>button{height:44px;width:44px}
html.phone-app .v4-host-input input{width:140px}
html.phone-app .menu-backdrop{inset:0}
html.phone-app .home-menu{top:91px;max-width:calc(100% - 40px)}
html.phone-app .type-label{min-height:44px}
html.phone-app .type-switch button{min-height:36px;padding:7px 10px}
html.phone-app .home-card-top{height:44px}
html.phone-app .nav-back,html.phone-app .nav-right button,html.phone-app .v4-device-more{min-width:44px;min-height:44px}
html.phone-app .v4-device-more{width:38px;right:0}
html.phone-app .v4-device-status{margin-right:23px}
html.phone-app .v5-measure-key{min-height:54px}
html.phone-app .v5-file-footer{padding-bottom:8px}
html.phone-app .sheet{padding-bottom:max(24px,env(safe-area-inset-bottom,0px))}
html.phone-app .toast{bottom:calc(16px + env(safe-area-inset-bottom,0px))}
html.phone-app .phone:has(.v5-photo-viewer){background:#0B0B0D}
html.phone-app .v5-photo-toolbar{height:56px}
html.phone-app .v5-photo-stage{inset:56px 0 calc(68px + env(safe-area-inset-bottom,0px))}
html.phone-app .v5-full-photo{width:auto;height:auto;max-width:calc(100% - 24px);max-height:100%;object-fit:contain}
html.phone-app .v5-photo-controls{padding-bottom:calc(12px + env(safe-area-inset-bottom,0px))}
html.phone-app .v5-photo-viewer.controls-hidden .v5-photo-stage{inset:0}
html.phone-app .v5-photo-viewer.controls-hidden .v5-full-photo{max-height:calc(100% - 24px)}
@media(max-width:350px){
 html.phone-app .pad{padding-left:14px;padding-right:14px}
 html.phone-app .home-card{padding-left:12px;padding-right:12px}
 html.phone-app .home-plots{gap:8px}
 html.phone-app .v5-measure-title h1{font-size:18px}
 html.phone-app .v5-measure-title>span{right:12px}
 html.phone-app .v5-context-fields{grid-template-columns:1fr 44px;gap:5px}
 html.phone-app .v5-context-fields label{gap:5px}
 html.phone-app .v5-plot-panel{padding-left:4px;padding-right:4px}
 html.phone-app .v5-plot-panel header h2{font-size:12px}
 html.phone-app .v5-plot-panel header b{font-size:11px}
 html.phone-app .v5-plot-panel header small{font-size:8px}
 html.phone-app .v4-device-row{padding-left:12px;padding-right:12px;gap:7px}
 html.phone-app .v4-device-status{margin-right:22px;font-size:10px}
 html.phone-app .tree-children{margin-left:6px;padding-left:8px}
 html.phone-app .tree-point-body>div{gap:3px}
}
@media(orientation:landscape) and (min-width:600px){
 html.phone-app .home-heading{margin:8px 0 12px}
 html.phone-app .home-heading h1{font-size:28px}
 html.phone-app .home-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
 html.phone-app .home-card{padding:10px 12px}
 html.phone-app .home-plots{gap:10px;margin-top:5px}
 html.phone-app .home-plots svg{height:70px}
 html.phone-app .v5-instrument-header{height:34px;flex-basis:34px}
 html.phone-app .v5-measure-title{height:34px;flex-basis:34px}
 html.phone-app .v5-measure-content>.pad{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);grid-template-areas:'plots info' 'plots keys';gap:10px 14px;align-items:start;padding-top:4px}
 html.phone-app .v5-dual-plots{grid-area:plots}
 html.phone-app .v5-plot-panel{height:274px}
 html.phone-app .v5-measure-info{grid-area:info;margin-top:0;padding:9px 10px}
 html.phone-app .v5-measure-info dl{display:grid;grid-template-columns:1fr 1fr;gap:3px 5px}
 html.phone-app .v5-measure-info dl>div:last-child{grid-column:1/-1}
 html.phone-app .v5-measure-info dt{min-width:50px}
 html.phone-app .v5-measure-info dl>div{font-size:11px}
 html.phone-app .v5-key-matrix{grid-area:keys;margin-top:0;gap:6px}
 html.phone-app .v5-measure-key{height:52px;min-height:52px}
 html.phone-app .v5-folder-content{padding-top:4px}
 html.phone-app .v5-file-heading{margin:4px 0 14px;font-size:20px}
 html.phone-app .v5-folders{grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
 html.phone-app .v5-folders button{min-height:174px;padding:4px}
 html.phone-app .v5-folder-art{width:104px;height:104px}
 html.phone-app .v5-album-grid{grid-template-columns:repeat(6,minmax(0,1fr))}
 html.phone-app .v5-gallery-date{margin:0 2px 12px}
 html.phone-app .v5-file-footer{padding-top:8px}
 html.phone-app .v5-upload-caption{margin-bottom:6px}
 html.phone-app .v4-connect-hero{padding:14px 0 18px}
 html.phone-app .v4-connect-orbit{width:100px;height:100px;margin-bottom:16px}
 html.phone-app .v4-connect-orbit>span{width:70px;height:70px;border-radius:20px}
 html.phone-app .v4-connect-orbit svg{width:34px;height:34px}
}
