/* One top navigation across desktop, tablet and phone. */
.topbar{height:auto;min-height:76px;gap:20px;padding:12px 24px}
.topbar .brand{flex:none}.topbar .workspace-nav{min-width:0}.topbar-actions{flex:none;margin-left:auto}
.topbar .workspace-nav a,.topbar .topbar-actions button{min-height:44px}
.topbar .account-button{position:relative;width:44px;height:44px;min-width:44px;padding:3px;overflow:visible}
.topbar .account-button .avatar{width:34px;height:34px}.account-button .avatar>.ui-icon{width:23px;height:23px}
.account-photo-edit{position:absolute;right:-3px;bottom:-3px;display:grid;place-items:center;width:18px;height:18px;border-radius:50%;background:var(--blue);border:2px solid var(--navy);color:white;pointer-events:none}
.account-photo-edit .ui-icon{width:11px;height:11px}
.layout{display:block}.main{min-width:0}.grid2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid3{grid-template-columns:repeat(3,minmax(0,1fr))}
.head>div,.person-card>div,.profile-photo-controls,.event-file-item .grow{min-width:0}.head h1,.modal-head h2,.meta strong{overflow-wrap:anywhere}
dialog{max-height:calc(100dvh - 32px)}.modal-head>button{flex:none}.modal-head h2{min-width:0}.table-wrap,.calendar,.board-scroll{max-width:100%;overscroll-behavior-x:contain}
.profile-photo-help{overflow-wrap:anywhere}.file-row .grow{min-width:120px}.file-row,.event-file-item{flex-wrap:wrap}
@media(max-width:1100px){
 .topbar{display:flex;flex-wrap:wrap;gap:10px;padding:12px 20px}
 .topbar .workspace-nav{order:3;flex:1 0 100%;display:flex;justify-content:space-between;width:100%;overflow:visible}
 .topbar .workspace-nav a{flex:1;justify-content:center;padding:9px 12px}.topbar .brand small{display:block;font-size:9px}
 .topbar .topbar-actions{gap:10px}.grid3{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:760px){
 .topbar{padding:10px 12px;gap:10px}.topbar .workspace-nav{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:3px}
 .topbar .workspace-nav a{flex-direction:column;gap:4px;padding:7px 2px;min-width:0;min-height:58px;white-space:normal;font-size:11px;line-height:1.3}
 .topbar .workspace-nav a span{overflow-wrap:anywhere;text-align:center}.topbar .workspace-nav a .ui-icon{width:19px;height:19px}
 html[lang=km] .topbar .workspace-nav a{font-size:11px;line-height:1.65}.topbar .topbar-actions{gap:7px}
 .topbar .topbar-submit{padding:7px 10px}.topbar .notification-bell,.topbar .language-button{width:44px;min-width:44px;height:44px}
 .topbar .brand small{display:none}.topbar .brand{font-size:13px}
 .main{padding:22px 14px 40px}.grid2,.grid3{grid-template-columns:minmax(0,1fr)}
 .modal-head,.modal-body{padding:16px}.modal-head h2{font-size:18px}html[lang=km] .modal-head h2{font-size:20px}
 input,select,textarea{font-size:16px}button,.button{min-height:44px}.modal-foot{gap:8px}
 #toast{left:12px;right:12px;bottom:12px;max-width:none}.profile-photo-panel{grid-template-columns:70px minmax(0,1fr);gap:12px}.profile-photo-preview{width:70px;height:70px}
}
@media(max-width:359px){.topbar .topbar-submit{font-size:0;padding:9px}.topbar .topbar-submit .ui-icon{width:19px;height:19px}.topbar .topbar-actions{gap:5px}.topbar .brand{gap:5px}.topbar .brand img{width:25px;height:25px}}

/* Authenticated PDF and image viewer: one bounded scroll surface. */
dialog.media-viewer{width:1280px!important;height:92dvh;max-height:calc(100dvh - 24px);max-width:calc(100vw - 24px);overflow:hidden}
.media-viewer[open]{display:flex;flex-direction:column}.media-viewer .modal-head{flex:none;padding:14px 20px;position:static;gap:12px}.media-viewer .modal-head h2{font-size:18px}
.media-viewer .modal-body{padding:0;flex:1;min-height:0;display:flex;flex-direction:column}
.viewer-toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;padding:10px 16px;border-bottom:1px solid var(--line);flex:none}
.viewer-toolbar>div{display:flex;align-items:center;gap:6px;min-width:0}.viewer-toolbar button{min-width:40px;min-height:40px;padding:7px 9px;font-size:12px}.viewer-toolbar button:disabled{cursor:default}
.viewer-toolbar button[aria-pressed=true]{background:#e6edff;color:var(--blue);border-color:#9eb8ef}
.viewer-page-tools label{margin:0;font-size:12px}.viewer-page-tools input{width:64px;min-height:40px;padding:6px;text-align:center}.viewer-page-tools span{white-space:nowrap;font-size:12px}
#viewer-zoom-level{min-width:40px;text-align:center;font-size:12px}
.viewer-zoom-tools{flex-wrap:wrap;max-width:100%}
.viewer-stage{position:relative;flex:1;min-height:100px;overflow:auto;overscroll-behavior:contain;background:#e7ecf3;padding:16px;text-align:center;outline-offset:-3px}
.viewer-canvas{position:relative;margin:0 auto;background:white;box-shadow:0 3px 15px #18284424;flex:none}
#viewer-image{position:absolute;left:50%;top:50%;max-width:none;transform-origin:center;user-select:none}
.viewer-message{padding:32px 12px;max-width:52ch;margin:auto;line-height:1.7;color:var(--muted)}#viewer-retry{margin:0 auto 24px}
.viewer-footer{flex:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px;border-top:1px solid var(--line);background:var(--surface)}
.media-viewer.viewer-expanded{max-width:100vw;width:100vw!important;max-height:100dvh;height:100dvh;border:0;border-radius:0;margin:0}
@media(max-width:760px){
 dialog.media-viewer{max-width:100vw;width:100vw!important;height:100dvh;max-height:100dvh;margin:0;border-radius:0;border:0}
 .media-viewer .modal-head{padding:12px 14px;padding-top:max(12px,env(safe-area-inset-top));gap:10px}.media-viewer .modal-head h2{font-size:16px}
 .viewer-toolbar{padding:8px 10px;gap:6px}.viewer-toolbar button{min-height:44px;min-width:40px;padding:6px;font-size:11px}
 .viewer-zoom-tools{order:3;flex-basis:100%;justify-content:space-between}.viewer-page-tools input{font-size:16px;width:58px}
 .viewer-footer{padding:8px 12px;padding-bottom:max(8px,env(safe-area-inset-bottom));gap:8px}.viewer-footer small{font-size:11px}.viewer-footer button{font-size:12px}
}
@media(max-height:500px){.media-viewer .modal-head{padding:5px 12px}.viewer-toolbar{padding:4px 10px}.viewer-zoom-tools{order:0;flex-basis:auto}.viewer-footer{padding:4px 12px}.viewer-stage{min-height:70px}}
