/* Gemeinsame Layoutquelle; nach Designsystem und Seitenstilen eingebunden.
   Fachlich breite Tabellen scrollen ausschließlich in .table-wrap. */
:root{--visible-height:100vh;--visible-top:0px}
@supports(height:100dvh){:root{--visible-height:100dvh}}
html{scroll-padding-block:16px}
body .content{max-width:none}
body :is(.card,.pagehead,.card-head,.toolbar,.form-field,.form-grid,fieldset,.ui-admin-grid)>*{min-width:0}
body :is(.pagehead,.card-head,.toolbar,.form-actions,.communication-header){flex-wrap:wrap}
body :is(button,.btn,.du-btn){white-space:normal;overflow-wrap:anywhere;height:auto}
body :is(h1,h2,h3,p,label,summary,.stat-top,.stat-foot,.aor-meta){overflow-wrap:anywhere}
body :is(input,select,textarea,fieldset){min-width:0}
body .sidebar{height:100vh;height:100dvh;overflow-y:auto;overscroll-behavior:contain;flex-shrink:0}
body .sidebar>*{flex-shrink:0}
body .theme-menu{position:static;width:100%;max-width:100%;margin-block:8px}
body .sidebar-bottom{width:100%}
body .topbar>div:first-child{min-width:0}
body .top-actions{min-width:0;max-width:100%}
body #notifications{flex:0 0 auto;min-width:76px;white-space:nowrap}
body #organizationSelect{min-width:0;width:clamp(120px,18vw,280px);max-width:100%}
body .table-wrap{min-width:0;width:100%;max-width:100%;overflow:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;position:relative}
.table-wrap:focus-visible{outline:2px solid var(--gold);outline-offset:2px}
.table-scroll-hint{display:block;font-size:12px;color:var(--muted);margin-block:4px}
body :is(dialog,.form-dialog){max-width:calc(100vw - 24px);max-height:calc(var(--visible-height) - 24px)!important;overflow:auto;overscroll-behavior:contain;scroll-padding:16px}
body dialog{margin:auto}
body .form-modal{top:var(--visible-top);bottom:auto;height:var(--visible-height);padding:12px;overflow:auto}
body .form-dialog{flex-shrink:0}
body .login-screen{top:var(--visible-top);bottom:auto;height:var(--visible-height);overflow:auto;align-items:safe center;padding:16px}
body .login-panel{margin-block:auto;flex-shrink:0}
body .ui-admin-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr))}
body .ui-workspace{grid-template-columns:170px minmax(180px,300px) minmax(0,1fr)}
body #globalUserDetails .gu-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr))}
body #view-ai-chat .arc-chat-shell{min-height:0;grid-template-columns:clamp(220px,18vw,320px) minmax(0,1fr)}
body #view-ai-chat .arc-chat-messages{min-height:180px;max-height:60vh;max-height:60dvh}
body #view-ai-chat .arc-chat-form{flex-wrap:wrap}
body #view-ai-chat .arc-chat-input{flex:1 1 180px}
body #view-ai-chat .arc-chat-bubble{max-width:90ch}
body #commMessages .message{max-width:min(88%,90ch)}
body #arcanumOfferReview{top:var(--visible-top);bottom:auto;height:var(--visible-height)}
body #arcanumOfferReview .aor-box{padding:max(10px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));overflow:auto}
body #arcanumOfferReview .aor-workspace{min-height:180px;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:minmax(0,1fr)}
body #arcanumOfferReview .aor-error{max-height:20vh;overflow:auto;overflow-wrap:anywhere}
.aor-mobile-tabs{display:none}
.sidebar-close,.nav-backdrop{display:none}
@media(min-width:1920px){body .dashboard-grid{grid-template-columns:minmax(0,1.7fr) minmax(320px,1fr)}body .content{padding-inline:clamp(32px,2vw,80px)}body .stats{gap:20px}}
@media(max-width:1100px){
 body.authenticated .app{display:block;grid-template-columns:minmax(0,1fr)}
 body .sidebar{position:fixed;z-index:80;inset:0 auto 0 0;width:min(320px,90vw);max-width:90vw;transform:translateX(-105%);transition:transform .2s;background:var(--panel);padding-left:max(14px,env(safe-area-inset-left));padding-top:max(12px,env(safe-area-inset-top));padding-bottom:max(16px,env(safe-area-inset-bottom))}
 body .sidebar.open{transform:translateX(0)}
 body .mobile-menu,body .sidebar-close{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px}
 .sidebar-close{align-self:flex-end}
 body .nav-backdrop.open{display:block;position:fixed;inset:0;z-index:79;background:#0007;border:0;border-radius:0;max-width:none;width:100%;height:100%;padding:0}
 body .topbar{height:auto;min-height:64px;flex-wrap:wrap}
 body :is(.content,.topbar){padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,env(safe-area-inset-right))}
 body .topbar .search{display:flex}
 body .ui-workspace{grid-template-columns:125px minmax(180px,240px) minmax(0,1fr)}
}
@media(max-width:760px){
 body .topbar{padding:10px max(12px,env(safe-area-inset-right)) 10px max(12px,env(safe-area-inset-left));gap:8px}
 body .topbar>div:first-child{flex:1 1 44px}
 body .topbar .crumb{display:none}
 body .top-actions{flex:1 1 220px;justify-content:flex-end;gap:8px}
 body .topbar .search{display:flex;order:1;flex:1 1 100%;min-width:0}
 body .topbar .search input{width:100%}
 body #organizationSelect{width:auto;flex:1 1 120px;max-width:220px}
 body .content{padding:16px max(12px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left))}
 body .pagehead{align-items:flex-start;gap:12px}
 body .pagehead>.btn{max-width:100%}
 body .dashboard-grid,body .lower-grid,body #view-settings .dashboard-grid{grid-template-columns:minmax(0,1fr)}
 body .ui-workspace{grid-template-columns:minmax(0,1fr);overflow:visible}
 body .ui-pane{max-height:none;border-right:0}
 body #view-ai-chat .arc-chat-shell{grid-template-columns:minmax(0,1fr)}
 body #view-ai-chat .arc-chat-history-list{max-height:160px}
 body #view-ai-chat .arc-chat-top{flex-wrap:wrap;gap:8px}
 body #view-ai-chat .arc-chat-messages{padding:12px}
 body :is(input:not([type=checkbox]):not([type=radio]),select,textarea),body #view-settings :is(input:not([type=checkbox]),select),body #view-ai-chat .arc-chat-input,body #arcanumOfferReview :is(input,select,textarea){font-size:16px}
 body :is(button,.btn,.btn.small,.icon-btn,.du-btn,summary){min-height:44px}
 body .icon-btn{min-width:44px;flex-basis:44px}
 body :is(.form-grid,#view-settings form.grid,#view-settings #tenantLimitsForm){grid-template-columns:minmax(0,1fr)!important}
 body .form-field.full{grid-column:1/-1}
 body :is(.form-actions,.aor-actions){gap:8px}
 body .form-actions>.btn{flex:1 1 120px}
 body :is(dialog,.form-dialog){padding:16px!important;width:calc(100vw - 24px);max-width:calc(100vw - 24px)}
 body dialog header{flex-wrap:wrap;gap:8px}
 body #arcanumOfferReview .aor-box{gap:6px}
 body #arcanumOfferReview .aor-header{gap:8px;flex-wrap:wrap}
 body #arcanumOfferReview .aor-header h2{font-size:18px}
 body #arcanumOfferReview .aor-workspace{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr);min-height:180px}
 body #arcanumOfferReview .aor-mobile-tabs{display:flex;gap:8px;flex-shrink:0}
 .aor-mobile-tabs button{flex:1;border:1px solid var(--line);border-radius:8px;background:var(--panel2);color:var(--text)}
 .aor-mobile-tabs [aria-selected=true]{border-color:var(--gold);box-shadow:inset 0 -3px var(--gold)}
 body #arcanumOfferReview[data-mobile-pane=data] .aor-pane:not(.aor-right),body #arcanumOfferReview[data-mobile-pane=pdf] .aor-right{display:none}
 body #arcanumOfferReview .aor-fields{grid-template-columns:minmax(0,1fr)}
 body #arcanumOfferReview .aor-position-header{grid-template-columns:minmax(0,1fr)}
 body #arcanumOfferReview .aor-actions>.btn{flex:1 1 130px}
 body #arcanumOfferReview .aor-meta{font-size:12px}
}
@media(pointer:coarse){body :is(button,.btn,.btn.small,.icon-btn,summary){min-height:44px}body .icon-btn{min-width:44px}body :is(input:not([type=checkbox]):not([type=radio]),select,textarea){font-size:16px}}
@media(max-width:380px){body .stats{grid-template-columns:minmax(0,1fr)}body .top-actions{flex-basis:100%}body .topbar>div:first-child{flex-basis:100%}}
@media(max-height:500px){body .login-screen{place-items:start center}body #arcanumOfferReview .aor-box{overflow:auto}body #arcanumOfferReview .aor-workspace{flex:1 0 220px}body .ui-pane{max-height:none}}
