/* Shared desktop, tablet and touch layouts. Loaded after all feature styles. */
body{height:100vh;height:100dvh}button,a,input,select,textarea{touch-action:manipulation}
body > #toast{
 position:static;flex:0 0 auto;margin:0 8px 4px;padding:5px 10px;
 max-height:3.8em;overflow:auto;overflow-wrap:anywhere;box-shadow:none;
 font-size:12px;line-height:1.4;pointer-events:auto
}
@media(min-width:901px){
 #mainWorkspace{grid-template-columns:minmax(0,1fr) clamp(284px,22vw,354px)}
}
.mobile-workspace-nav{display:none}.workspace>aside{min-width:0}
@media(max-width:1100px){
 body>header{height:auto;min-height:70px;flex-basis:auto;flex-wrap:wrap;padding:8px 12px;gap:6px 10px}
 body>header .connection{max-width:230px;margin-left:auto!important}
 body>header .connection span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 button,.editor-toolbar button,.preview-tabs button,.task-cat-btn,.action-sub-btn,.res-download-btn,.gal-filter-btn{min-height:44px;font-size:13px}
 input:not([type=checkbox]):not([type=range]),select,textarea{font-size:16px!important}
 input[type=checkbox]{width:20px;height:20px}input[type=range]{min-height:32px}
 .editor-toolbar .brush-size input{width:100px}.result-thumb{height:110px}
 .lan-settings[open]{max-height:45dvh;overflow-y:auto}.lan-grid label{min-width:160px}
 .sticky-render-header{top:-12px}.result-gallery{grid-template-columns:repeat(auto-fill,minmax(135px,1fr))}
 #adminDialog{max-width:96vw;width:850px;max-height:92dvh}#adminDialog input{min-height:44px}
 #regionLayerDialog{height:96dvh;max-height:96dvh;width:98vw;max-width:98vw}
 #regionLayerDialog .rl-layout{grid-template-columns:minmax(0,1fr) 270px}
 #regionLayerDialog button{min-height:44px}#regionLayerDialog label{font-size:13px}
}
@media(max-width:900px), (max-height:520px) and (max-width:1100px){
 body>header{padding:6px 10px;padding-top:max(6px,env(safe-area-inset-top));min-height:66px;gap:4px 8px}
 body>header .brand{flex-basis:32px;width:32px;height:38px}body>header h1{font-size:16px}
 body>header .tier-container{order:3;margin-left:0!important;flex:1;min-width:140px}
 body>header .tier-container select{width:auto;max-width:155px;min-height:36px;padding:5px!important}
 body>header .connection{order:4;flex:1;font-size:10px;min-width:100px;max-width:190px;margin-left:0!important}
 .server-version-bar{padding:6px 10px;gap:4px 12px;font-size:11px}.server-version-bar strong{font-size:12px}
 .lan-settings{padding:6px 10px}.lan-settings summary{min-height:30px;display:list-item;padding:6px 0}
 .lan-settings[open]{max-height:45dvh}.lan-grid{gap:8px}.lan-grid label{min-width:135px}.lan-grid button{flex:1}
 body>main{padding:0;overflow:hidden}#mainWorkspace{display:flex;gap:0;min-height:0;overflow:hidden}
 #mainWorkspace>.visual-pane{flex:1;min-height:0}#mainWorkspace>.visual-pane>.editor{flex:1;min-height:0}
 #mainWorkspace>aside{display:none;flex:1;border:0;padding:10px;overflow:auto;overscroll-behavior:contain}
 body[data-mobile-pane=settings] #mainWorkspace>aside{display:grid}
 body[data-mobile-pane=settings] #mainWorkspace>.visual-pane{display:none}
 #mainWorkspace .bottom-dock{display:none}
 body[data-mobile-pane=results] #mainWorkspace .editor{display:none}
 body[data-mobile-pane=results] #mainWorkspace .bottom-dock{display:flex;flex:1;min-height:0;max-height:none;padding:0}
 .bottom-dock .results-workspace{min-height:0;flex:1}.results-heading{padding:8px}.results-filter-bar{width:100%;order:3}
 .result-gallery{grid-template-columns:repeat(2,minmax(0,1fr));padding:8px;gap:8px}.result-thumb{height:120px}
 .editor-toolbar{max-height:150px;overflow-y:auto;padding:6px;gap:5px;flex-shrink:0}
 .editor-toolbar button{padding:8px;font-size:12px;min-height:42px}.editor-toolbar .brush-size{margin:0}
 .preview-tabs{padding:4px;gap:3px}.preview-tabs button{flex:1;white-space:nowrap;font-size:11px;padding:6px 4px;min-height:40px}
 .preview-area,.canvas-wrap{min-height:0}.sticky-render-header{top:-10px;padding:8px 0;gap:8px}
 .task-category-bar{gap:4px}.task-cat-btn{font-size:12px;min-height:46px;padding:6px}
 .mobile-workspace-nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;flex:0 0 auto;padding:6px 8px;padding-bottom:max(6px,env(safe-area-inset-bottom));background:#182027;border-top:1px solid #38515b;z-index:40}
 .mobile-workspace-nav button{min-height:44px;padding:8px 5px;font-size:13px}
 .mobile-workspace-nav button[aria-pressed=true]{background:#244e60;border-color:#55b7ef;color:#fff}
 #mobileGenerate{grid-column:1/-1;background:#167fb7;border-color:#2695d0;color:white}
 #mobileProgress{grid-column:1/-1;font-size:11px;text-align:center;color:#bfd9e7;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-height:16px}
 body>.toast{bottom:160px;left:8px;right:8px;overflow-wrap:anywhere}
 #regionLayerDialog{inset:0;margin:auto;padding:10px;width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;border-radius:0;border:0;padding-top:max(10px,env(safe-area-inset-top));padding-bottom:max(10px,env(safe-area-inset-bottom));display:none}
 #regionLayerDialog[open]{display:flex;flex-direction:column}
 #regionLayerDialog header{flex:0 0 auto;padding-bottom:8px;gap:8px;align-items:flex-start}
 #regionLayerDialog header h2{font-size:16px}#regionLayerDialog header small{font-size:11px}#rlClose{flex-shrink:0}
 #regionLayerDialog .rl-layout{flex:1;min-height:0;height:auto;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(150px,43%) minmax(0,1fr);gap:10px}
 #regionLayerDialog .rl-view-tools{flex-wrap:nowrap;gap:6px;padding-top:6px}.rl-view-tools label{min-width:0;flex:1}
 #regionLayerDialog .rl-view-tools select{width:100%;padding:7px;font-size:14px!important}
 #regionLayerDialog .rl-controls{padding:8px 4px!important;border-top:1px solid #41545a;overscroll-behavior:contain}
 #regionLayerDialog .rl-help{font-size:11px}#regionLayerDialog .rl-controls>h3{display:none}
 #regionLayerDialog input[type=range]{min-height:32px}#rlStatus{min-height:0}
 #adminDialog{width:100vw;max-width:100vw;max-height:98dvh;padding:12px}
 .employee-form{grid-template-columns:repeat(2,minmax(0,1fr))}.admin-table-wrap{overflow:auto}
 .ref-viewer{padding:60px 8px 12px}#closeRefViewer{width:44px;height:44px}
}
@media(max-width:380px){.two-col{grid-template-columns:minmax(0,1fr)}.editor-toolbar button{font-size:11px}.result-gallery{grid-template-columns:minmax(0,1fr)}}
@media(max-height:520px) and (max-width:1100px){body>header .tier-container,body>header .connection{display:none!important}.mobile-workspace-nav{grid-template-columns:repeat(4,minmax(0,1fr))}#mobileGenerate{grid-column:auto}#mobileProgress{display:none}#regionLayerDialog .rl-layout{grid-template-columns:minmax(0,1fr) 260px;grid-template-rows:minmax(0,1fr)}}

@media(max-height:520px) and (min-width:901px) and (max-width:1100px){.bottom-dock{display:none}.editor-toolbar{max-height:96px;overflow-y:auto}.preview-tabs button{min-height:34px}.editor-toolbar button{min-height:36px}}

#regionLayerDialog header{height:auto;flex-basis:auto}
@media(max-height:520px) and (max-width:1100px){body>header{min-height:48px;padding:4px 10px}.editor-toolbar{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;max-height:48px}.editor-toolbar>*{flex-shrink:0}.preview-tabs button{min-height:34px}.mobile-workspace-nav{padding:4px}#regionLayerDialog header small{display:none}}
.final-prompt-label{display:none!important}
.source-view-tools{display:flex;flex:0 0 auto;align-items:center;justify-content:center;gap:6px;padding:5px;border-bottom:1px solid #30383c;background:#172027}
.source-view-tools[hidden]{display:none}.source-view-tools button{min-height:36px;padding:6px 10px}.source-view-tools output{min-width:44px;text-align:center;font-variant-numeric:tabular-nums}.source-view-tools button[aria-pressed=true]{background:#167fb7;color:white}
#sourceImage{transform-origin:center;pointer-events:none;user-select:none}
@media(max-width:900px){.source-view-tools button{min-height:40px}.source-view-tools{gap:4px}}
@media(max-height:520px) and (max-width:1100px){
 .editor{position:relative}.source-view-tools{position:absolute;top:48px;right:0;width:280px;height:42px;z-index:6;padding:3px}
 .editor .preview-tabs{padding-right:284px}.source-view-tools button{min-height:34px;padding:5px 8px}
}
@keyframes render-button-energy{from{transform:translateX(-120%)}to{transform:translateX(380%)}}
 .render-progress-button{position:relative;isolation:isolate;overflow:hidden;white-space:normal;line-height:1.4}
 .render-progress-button::before{content:'';position:absolute;inset:0;background:linear-gradient(90deg,#087d80,#12ad99);transform:scaleX(var(--render-progress,0));transform-origin:left;transition:transform .45s ease;z-index:-1;pointer-events:none}
 .render-progress-button.is-rendering::after{content:'';position:absolute;top:0;bottom:0;left:0;width:35%;background:linear-gradient(90deg,transparent,#c6fff077,transparent);animation:render-button-energy 1.8s linear infinite;z-index:-1;pointer-events:none}
 .render-progress-button.is-rendering:disabled{opacity:1;color:#fff;cursor:wait}
 .render-button-caption{position:relative;z-index:1;text-shadow:0 1px 2px #003438}
#rlProgress{color:#7ce5db;font-weight:700;padding:8px 0;font-variant-numeric:tabular-nums}#rlProgress[hidden]{display:none}
@media(prefers-reduced-motion:reduce){.render-progress-button::before{transition:none}.render-progress-button.is-rendering::after{animation:none;transform:translateX(100%)}}
#mobileTask,#mobileTools{display:none}
#mobileToolsDialog{box-sizing:border-box;width:min(440px,94vw);max-height:85dvh;overflow:auto;background:#17232a;color:#edf4f7;border:1px solid #416574;border-radius:12px;padding:14px}
#mobileToolsDialog::backdrop{background:#000a}.mobile-tools-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.mobile-tools-heading h2{font-size:16px}
#mobileToolsContent{display:grid;gap:16px;padding-top:12px}#mobileToolsContent .tier-container{margin-left:0!important;flex-wrap:wrap}#mobileToolsContent .connection{margin-left:0!important}#mobileToolsContent .web-session{padding:8px 0;border:0}#mobileToolsContent .section-actions{flex-wrap:wrap}
@media(max-width:900px), (max-height:520px) and (max-width:1100px){
 body>header{display:grid;grid-template-columns:minmax(0,1fr) 112px 44px;height:auto;min-height:52px;flex-basis:auto;gap:6px;padding:4px 8px;padding-top:max(4px,env(safe-area-inset-top))}
 body>header .brand,body>header p{display:none}body>header>div{min-width:0}body>header h1{font-size:13px;line-height:1.25;margin:0}
 #mobileTask,#mobileTools{display:block;min-height:44px;margin:0}#mobileTask{width:100%;padding:6px;font-size:14px!important}#mobileTools{position:relative;font-size:20px;padding:6px}
 #mobileTools[data-update=true]::after{content:'';position:absolute;right:6px;top:6px;width:7px;height:7px;border-radius:50%;background:#45d9c7}
 #mainWorkspace .sticky-render-header{display:none!important}
 #mainWorkspace>aside{padding:8px;gap:10px;align-content:start}
 #mobileProgress[hidden]{display:none}
 #mobileToolsDialog button{min-height:44px}#mobileToolsContent .connection{display:flex!important}
}
@media(max-width:900px), (max-height:520px) and (max-width:1100px){
 #mainWorkspace #renderMonitor,#mainWorkspace #status{display:none!important}
 #mobileProgress{white-space:normal;overflow:auto;max-height:64px;line-height:1.4;overflow-wrap:anywhere}
}

.result-download-note { display:block; flex-basis:100%; color:var(--muted,#a6b8bc); font-size:11px; line-height:1.4; }
