/* Application shell only. Never loaded into standalone generated previews. */
:root { --reddi-ui-scale: 1; zoom: var(--reddi-ui-scale); }
/* Auto uses native readable scale; explicit choices remain available. */
:root[data-display-scale="80"] { --reddi-ui-scale: .8; }
:root[data-display-scale="90"] { --reddi-ui-scale: .9; }
:root[data-display-scale="100"] { --reddi-ui-scale: 1; }
:root[data-display-scale="110"] { --reddi-ui-scale: 1.1; }
:root[data-display-scale="125"] { --reddi-ui-scale: 1.25; }
.display-scale-label { display: inline-flex; align-items: center; gap: 5px; color: var(--text); font-size: 12px; white-space: nowrap; }
#displayScale { color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 5px; font: inherit; }
@media (max-width: 650px) { .display-scale-label { font-size: 0; } #displayScale { font-size: 12px; } }

/* ADMIN04 FIX1: viewport geometry for the shell and landing; allow overflow on small screens. */
:root { --reddi-viewport-height: calc(100dvh / var(--reddi-ui-scale, 1)); }
.shell { min-height: var(--reddi-viewport-height); }
.shell > .sidebar { height: var(--reddi-viewport-height); overflow-y:auto; }
.main > .topbar, .main > .footer { flex-shrink:0; }
.page.chat-home-page { min-height:0; flex:1; }
.chat-home-page #content { min-height:0; flex:1; }
.chat-home-page .chat-landing-information { padding-top:clamp(24px, 8vh, 155px); }
@media(min-width:1051px){ .shell:has(.instant-app-mode){min-height:0;} .shell:has(.instant-app-mode)>.sidebar{height:100%;} }

/* ADMIN05 UI FIX1 — responsive shell, independent of generated preview. */
#adaptiveMenu,#adaptiveBackdrop{display:none}
.main,#content,.page{min-width:0}
.topbar,.top-right,.reddi-navigation{min-width:0;flex-wrap:wrap}
.topbar{height:auto;min-height:56px;gap:8px;padding-block:8px}
.chat-home-page .chat-landing-information{padding-top:clamp(16px,5dvh,100px)}
@media(max-width:1439px){
 #adaptiveMenu{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:4px 10px}
 .shell>.sidebar{display:none;position:fixed;inset:0 auto 0 0;width:min(300px,86vw);height:var(--reddi-viewport-height);z-index:60;padding:16px;background:var(--panel);overflow:auto}
 .shell[data-nav-open="true"]>.sidebar{display:flex}
 .shell[data-nav-open="true"]>#adaptiveBackdrop{display:block;position:fixed;inset:0;z-index:59;background:#0008;border:0;width:100%;height:100%}
 .sidebar .logo>div:last-child,.sidebar .nav-label,.sidebar .history,.sidebar .side-bottom,.sidebar nav button span{display:revert}
 .sidebar nav button,.sidebar .new-chat{font-size:14px;min-height:44px}
 .sidebar nav button:first-letter,.sidebar .new-chat:first-letter{font-size:inherit}
 .instant-app-mode #content{min-width:0;grid-template-columns:minmax(0,30fr) minmax(0,70fr)}
 #instantWorkspace .instant-unified-grid,#instantWorkspace:not(.has-application-actions):not(.showing-candidate) .instant-unified-grid{grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto}
 #instantWorkspace .instant-unified-left,#instantWorkspace .instant-unified-right{height:auto;overflow:visible;min-height:0}
 #instantWorkspace .instant-unified-grid{overflow:auto;align-items:start}
 #instantWorkspace .instant-preview-section{height:auto;min-height:0}
 #instantWorkspace .instant-preview-section [data-candidate-slot] .instant-body,#instantWorkspace .instant-preview-section .instant-current-preview [data-current-frame]{min-height:360px}
}
@media(max-width:1050px){
 .instant-app-mode #content{display:flex;flex-direction:column;min-width:0}
 .instant-app-mode #content>.chat-panel{position:static;width:100%;height:auto;min-height:0;max-height:none}
 .instant-app-mode #content>.chat-panel .chatbox{min-height:120px;max-height:42dvh}
 .instant-app-mode #instantWorkspace,.instant-app-mode #instantWorkspace.has-retained-preview{width:100%;height:auto;max-height:none;overflow:visible}
 #instantWorkspace .instant-unified-grid{overflow:visible}
 .page{padding-inline:clamp(10px,2vw,24px)}
}
@media(max-width:600px){
 .topbar{padding:6px 10px;align-items:center;gap:6px}
 .top-right{gap:6px}.top-right .version,.top-right .local-badge,.reddi-navigation .separator{display:none}
 .top-right button,.top-right select,.nav-history{min-height:44px;min-width:44px}
 .page.chat-home-page{padding:12px!important}.chat-home-page>.head{margin-bottom:16px;padding-top:8px}
 .chat-home-page>.head h1{font-size:clamp(24px,7vw,34px)}
 .chat-home-page #composer{padding:10px;min-height:100px;display:flex!important;flex-direction:column;align-items:stretch}
 .chat-home-page #composer textarea{min-height:64px;font-size:16px}
 .composer-controls{flex-wrap:wrap!important;max-width:100%}
 .composer textarea,.instant-modify textarea{font-size:16px}
 .chat-workspace-page .chat-panel{height:auto;min-height:0;padding:10px}
 .chat-workspace-page .chatbox{min-height:100px;max-height:55dvh}
 .panel{padding:12px;min-width:0;overflow-wrap:anywhere}
 .row{flex-wrap:wrap}.grid,.two,.modelcards{grid-template-columns:minmax(0,1fr)}
 .table{display:block;max-width:100%;overflow-x:auto}
 .footer{padding:8px 12px;flex-wrap:wrap}
 #instantWorkspace .instant-tabs,#instantWorkspace .instant-actions{flex-wrap:wrap}
 #instantWorkspace .instant-preview-section [data-candidate-slot] .instant-body,#instantWorkspace .instant-preview-section .instant-current-preview [data-current-frame]{min-height:320px}
 .chat-home-page .chat-landing-information{padding-top:24px}
}
