/* Phone-only shell. No transform/gesture interception on the Qt drawing surface. */
#mobile-header-menu,#mobile-workspace-bar,.mobile-action-label,#mobile-section-title,#mobile-section-close{display:none}
#mobile-section-backdrop[hidden]{display:none!important}
@media(max-width:650px){
 body{height:100dvh}
 header{height:48px;gap:4px;padding:0 max(6px,env(safe-area-inset-right)) 0 max(6px,env(safe-area-inset-left))}
 header #project-menu.brand{width:44px;height:44px;justify-content:center}
 header #project,header #well{display:block;flex:1 1 0;width:0;min-width:0;max-width:none;height:44px;font-size:16px;padding:0 18px 0 7px;border:1px solid var(--line);border-radius:12px}
 header #choose-well{width:44px;height:44px;margin:0}
 header>.spacer{display:none}
 header #mobile-header-menu{display:block;position:static;flex:none}
 #mobile-header-menu>summary{display:flex;align-items:center;justify-content:center;list-style:none;width:44px;height:44px;border-radius:12px;font-size:17px;cursor:pointer}
 #mobile-header-menu>summary::-webkit-details-marker{display:none}
 #mobile-header-menu[open]>summary{background:#eaf2ff;color:var(--blue)}
 #mobile-header-actions{position:absolute;left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));top:calc(100% + 4px);max-height:calc(100dvh - 100px);overflow:auto;overscroll-behavior:contain;padding:8px;border:1px solid var(--line);border-radius:16px;background:#fff;box-shadow:0 8px 24px #21344c24}
 #mobile-header-menu:not([open])>#mobile-header-actions{display:none}
 header #mobile-header-actions>button{display:flex;width:100%;max-width:none;min-height:44px;height:auto;border-radius:10px;font-size:0;padding:10px 12px;justify-content:flex-start;background:transparent}
 #mobile-header-actions>button>span:not(.mobile-action-label){display:none}
 #mobile-header-actions>button .mobile-action-label{display:inline;font-size:15px}
 #mobile-header-actions #about{font-size:0}
 #mobile-header-actions #about .mobile-action-label{font-size:15px}
 header #mobile-header-actions #file-actions{position:static}
 header #mobile-header-actions #file-actions>summary{display:flex;width:100%;height:44px;gap:8px;padding:10px 12px;border-radius:10px;font-size:15px;justify-content:flex-start}
 #mobile-header-actions #file-actions>summary::after{content:'Данные и правки'}
 header #mobile-header-actions .file-popup{position:static;inset:auto;min-width:0;width:100%;max-height:none;overflow:visible;box-shadow:none;background:#f7f9fc}
 #mobile-header-actions .file-popup button{height:auto;min-height:44px;font-size:14px;white-space:normal;text-align:left}
 #views{height:44px;min-height:44px;overflow:visible}
 #workspace-tabs{display:none}
 #mobile-workspace-bar{display:flex;align-items:center;gap:8px;min-height:44px}
 #mobile-workspace-bar>label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 #mobile-workspace-select{flex:1;min-width:0;max-width:none;height:44px;font-size:16px;padding:0 28px 0 12px;background:#fff;border:1px solid var(--line);border-radius:12px}
 #mobile-section-toggle{height:44px;min-width:82px;border:1px solid var(--line);border-radius:12px;background:#fff;font-size:15px}
 #rms-native-controls{display:none!important}
 .mobile-section-open #rms-native-controls.has-plot:not([hidden]){display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;position:fixed;inset:auto max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))!important;width:auto;max-width:none!important;max-height:calc(100dvh - 80px);overflow-y:auto;overscroll-behavior:contain;padding:16px;border:1px solid var(--line);border-radius:20px;background:#fff;box-shadow:0 10px 40px #18335435;z-index:62}
 #mobile-section-title{display:flex;align-items:center;font-size:16px}
 #rms-native-controls #mobile-section-close{display:flex;justify-self:end;min-width:70px;color:var(--blue)}
 #rms-native-controls #rms-native-model,#rms-native-controls #rms-native-property{grid-column:1/-1;width:100%;max-width:none}
 .mobile-section-open #rms-native-controls select,.mobile-section-open #rms-native-controls button{min-height:44px;height:auto;max-width:none;font-size:16px;line-height:1.3;padding:10px;border:1px solid var(--line);border-radius:10px;white-space:normal;text-align:left;background:#f8fafc}
 #mobile-section-backdrop{position:fixed;inset:0;display:block;width:100%;height:100%;padding:0;border:0;border-radius:0;background:#182b443b;z-index:61}
 .well-chooser section:first-child{display:flex!important;min-height:100px}
 .well-chooser section{max-height:28dvh}
 .well-chooser{gap:10px}
 .chooser-list{max-height:20dvh}
 .chooser-item{min-height:44px;font-size:14px}
 dialog input:not([type=checkbox]):not([type=radio]),dialog select{font-size:16px!important;min-height:44px}
 dialog label:has(input[type=checkbox]),dialog label:has(input[type=radio]){min-height:44px}
 dialog button,.dialog-head button{min-height:44px;min-width:44px}
 .dialog-head{min-height:52px;height:auto}
 dialog{max-height:calc(100dvh - 24px)}
 footer{height:calc(44px + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom)}
 footer #md{font-size:16px;height:36px}
 footer #expand-sidebar{width:44px;height:44px}
 footer #save-status{max-width:95px;white-space:normal}
 .navigation-sidebar-open #sidebar,#properties{top:48px;bottom:calc(44px + env(safe-area-inset-bottom))}
 #sidebar .row{min-height:36px;height:auto}
 #sidebar .row .disclosure{min-width:30px;height:36px}
 #sidebar .row input[type=checkbox]{width:22px;height:22px}
 #sidebar .row input[type=checkbox]:checked::after{font-size:18px;line-height:20px}
 #sidebar .search{height:40px}
 #sidebar .search input{font-size:16px}
 #plot-toolbar.toolbar-widget.widget-collapsed{width:44px;height:44px;min-height:44px}
 #mobile-header-actions #plot-toolbar.toolbar-widget{position:static!important;inset:auto!important;transform:none!important;clip-path:none!important;display:flex!important;flex-wrap:wrap;gap:6px;width:100%!important;max-width:100%!important;height:auto;min-height:0;padding:8px 0;background:transparent;border:0;box-shadow:none;will-change:auto}
 #mobile-header-actions #plot-toolbar.toolbar-widget>button:not([hidden]):not(.toolbar-widget-toggle):not(.toolbar-widget-handle){display:inline-flex!important;min-height:44px;height:auto;width:auto;max-width:none;padding:10px;font-size:14px;background:#f7f9fc;border-radius:10px}
 #mobile-header-actions #plot-toolbar.toolbar-widget>.toolbar-widget-toggle,#mobile-header-actions #plot-toolbar.toolbar-widget>.toolbar-widget-handle,#mobile-header-actions #plot-toolbar #toolbar-context{display:none!important}
 #mobile-header-actions #plot-toolbar.toolbar-widget>#toolbar-more:not([hidden]){display:block!important;width:100%}
 #mobile-header-actions #toolbar-more>summary{min-height:44px;font-size:14px}
 #mobile-header-actions #plot-toolbar #toolbar-more-actions{position:static!important;inset:auto!important;max-height:none!important;width:100%!important;box-shadow:none}
 #mobile-header-actions #plot-toolbar #toolbar-more-actions>button:not([hidden]){display:flex!important;min-height:44px;font-size:14px}

 #mobile-header-actions #history-demo-controls{align-self:stretch;width:100%;margin:0;padding:0}
 #mobile-header-actions #history-demo-play{display:flex;gap:10px;width:100%;min-height:44px;font-size:14px;border:0;background:#f7f9fc;color:var(--blue);justify-content:flex-start;padding:10px}
 #mobile-header-actions #history-demo-play::after{content:'Воспроизведение демо'}
}


/* UA-classified phones keep the phone shell when rotated. */
html.phone-observer body{height:100dvh}
.phone-observer header{height:48px;gap:4px;padding:0 max(6px,env(safe-area-inset-right)) 0 max(6px,env(safe-area-inset-left))}
.phone-observer header #project-menu.brand{width:44px;height:44px;justify-content:center}
.phone-observer header #project,.phone-observer header #well{display:block;flex:1 1 0;width:0;min-width:0;max-width:none;height:44px;font-size:16px;padding:0 18px 0 7px;border:1px solid var(--line);border-radius:12px}
.phone-observer header #choose-well{width:44px;height:44px;margin:0}
.phone-observer header>.spacer{display:none}
.phone-observer header #mobile-header-menu{display:block;position:static;flex:none}
.phone-observer #mobile-header-menu>summary{display:flex;align-items:center;justify-content:center;list-style:none;width:44px;height:44px;border-radius:12px;font-size:17px;cursor:pointer}
.phone-observer #mobile-header-menu>summary::-webkit-details-marker{display:none}
.phone-observer #mobile-header-menu[open]>summary{background:#eaf2ff;color:var(--blue)}
.phone-observer #mobile-header-actions{position:absolute;left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));top:calc(100% + 4px);max-height:calc(100dvh - 100px);overflow:auto;overscroll-behavior:contain;padding:8px;border:1px solid var(--line);border-radius:16px;background:#fff;box-shadow:0 8px 24px #21344c24}
.phone-observer #mobile-header-menu:not([open])>#mobile-header-actions{display:none}
.phone-observer header #mobile-header-actions>button{display:flex;width:100%;max-width:none;min-height:44px;height:auto;border-radius:10px;font-size:0;padding:10px 12px;justify-content:flex-start;background:transparent}
.phone-observer #mobile-header-actions>button>span:not(.mobile-action-label){display:none}
.phone-observer #mobile-header-actions>button .mobile-action-label{display:inline;font-size:15px}
.phone-observer #mobile-header-actions #about{font-size:0}
.phone-observer #mobile-header-actions #about .mobile-action-label{font-size:15px}
.phone-observer header #mobile-header-actions #file-actions{position:static}
.phone-observer header #mobile-header-actions #file-actions>summary{display:flex;width:100%;height:44px;gap:8px;padding:10px 12px;border-radius:10px;font-size:15px;justify-content:flex-start}
.phone-observer #mobile-header-actions #file-actions>summary::after{content:'Данные и правки'}
.phone-observer header #mobile-header-actions .file-popup{position:static;inset:auto;min-width:0;width:100%;max-height:none;overflow:visible;box-shadow:none;background:#f7f9fc}
.phone-observer #mobile-header-actions .file-popup button{height:auto;min-height:44px;font-size:14px;white-space:normal;text-align:left}
.phone-observer #views{height:44px;min-height:44px;overflow:visible}
.phone-observer #workspace-tabs{display:none}
.phone-observer #mobile-workspace-bar{display:flex;align-items:center;gap:8px;min-height:44px}
.phone-observer #mobile-workspace-bar>label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.phone-observer #mobile-workspace-select{flex:1;min-width:0;max-width:none;height:44px;font-size:16px;padding:0 28px 0 12px;background:#fff;border:1px solid var(--line);border-radius:12px}
.phone-observer #mobile-section-toggle{height:44px;min-width:82px;border:1px solid var(--line);border-radius:12px;background:#fff;font-size:15px}
.phone-observer #rms-native-controls{display:none!important}
html.phone-observer.mobile-section-open #rms-native-controls.has-plot:not([hidden]){display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;position:fixed;inset:auto max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))!important;width:auto;max-width:none!important;max-height:calc(100dvh - 80px);overflow-y:auto;overscroll-behavior:contain;padding:16px;border:1px solid var(--line);border-radius:20px;background:#fff;box-shadow:0 10px 40px #18335435;z-index:62}
.phone-observer #mobile-section-title{display:flex;align-items:center;font-size:16px}
.phone-observer #rms-native-controls #mobile-section-close{display:flex;justify-self:end;min-width:70px;color:var(--blue)}
.phone-observer #rms-native-controls #rms-native-model,.phone-observer #rms-native-controls #rms-native-property{grid-column:1/-1;width:100%;max-width:none}
html.phone-observer.mobile-section-open #rms-native-controls select,html.phone-observer.mobile-section-open #rms-native-controls button{min-height:44px;height:auto;max-width:none;font-size:16px;line-height:1.3;padding:10px;border:1px solid var(--line);border-radius:10px;white-space:normal;text-align:left;background:#f8fafc}
.phone-observer #mobile-section-backdrop{position:fixed;inset:0;display:block;width:100%;height:100%;padding:0;border:0;border-radius:0;background:#182b443b;z-index:61}
.phone-observer .well-chooser section:first-child{display:flex!important;min-height:100px}
.phone-observer .well-chooser section{max-height:28dvh}
.phone-observer .well-chooser{gap:10px}
.phone-observer .chooser-list{max-height:20dvh}
.phone-observer .chooser-item{min-height:44px;font-size:14px}
.phone-observer dialog input:not([type=checkbox]):not([type=radio]),.phone-observer dialog select{font-size:16px!important;min-height:44px}
.phone-observer dialog label:has(input[type=checkbox]),.phone-observer dialog label:has(input[type=radio]){min-height:44px}
.phone-observer dialog button,.phone-observer .dialog-head button{min-height:44px;min-width:44px}
.phone-observer .dialog-head{min-height:52px;height:auto}
.phone-observer dialog{max-height:calc(100dvh - 24px)}
.phone-observer footer{height:calc(44px + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom)}
.phone-observer footer #md{font-size:16px;height:36px}
.phone-observer footer #expand-sidebar{width:44px;height:44px}
.phone-observer footer #save-status{max-width:95px;white-space:normal}
html.phone-observer.navigation-sidebar-open #sidebar,.phone-observer #properties{top:48px;bottom:calc(44px + env(safe-area-inset-bottom))}
.phone-observer #sidebar .row{min-height:36px;height:auto}
.phone-observer #sidebar .row .disclosure{min-width:30px;height:36px}
.phone-observer #sidebar .row input[type=checkbox]{width:22px;height:22px}
.phone-observer #sidebar .row input[type=checkbox]:checked::after{font-size:18px;line-height:20px}
.phone-observer #sidebar .search{height:40px}
.phone-observer #sidebar .search input{font-size:16px}
.phone-observer #plot-toolbar.toolbar-widget.widget-collapsed{width:44px;height:44px;min-height:44px}
.phone-observer #mobile-header-actions #plot-toolbar.toolbar-widget{position:static!important;inset:auto!important;transform:none!important;clip-path:none!important;display:flex!important;flex-wrap:wrap;gap:6px;width:100%!important;max-width:100%!important;height:auto;min-height:0;padding:8px 0;background:transparent;border:0;box-shadow:none;will-change:auto}
.phone-observer #mobile-header-actions #plot-toolbar.toolbar-widget>button:not([hidden]):not(.toolbar-widget-toggle):not(.toolbar-widget-handle){display:inline-flex!important;min-height:44px;height:auto;width:auto;max-width:none;padding:10px;font-size:14px;background:#f7f9fc;border-radius:10px}
.phone-observer #mobile-header-actions #plot-toolbar.toolbar-widget>.toolbar-widget-toggle,.phone-observer #mobile-header-actions #plot-toolbar.toolbar-widget>.toolbar-widget-handle,.phone-observer #mobile-header-actions #plot-toolbar #toolbar-context{display:none!important}
.phone-observer #mobile-header-actions #plot-toolbar.toolbar-widget>#toolbar-more:not([hidden]){display:block!important;width:100%}
.phone-observer #mobile-header-actions #toolbar-more>summary{min-height:44px;font-size:14px}
.phone-observer #mobile-header-actions #plot-toolbar #toolbar-more-actions{position:static!important;inset:auto!important;max-height:none!important;width:100%!important;box-shadow:none}
.phone-observer #mobile-header-actions #plot-toolbar #toolbar-more-actions>button:not([hidden]){display:flex!important;min-height:44px;font-size:14px}
.phone-observer #mobile-header-actions #history-demo-controls{align-self:stretch;width:100%;margin:0;padding:0}
.phone-observer #mobile-header-actions #history-demo-play{display:flex;gap:10px;width:100%;min-height:44px;font-size:14px;border:0;background:#f7f9fc;color:var(--blue);justify-content:flex-start;padding:10px}
.phone-observer #mobile-header-actions #history-demo-play::after{content:'Воспроизведение демо'}
