.mobile-tabs,#mobile-chat-back,#mobile-timeline-toggle,#mobile-asset-bookings{display:none}
#mobile-menu #subnav{display:block!important;position:static;width:100%;height:auto;overflow:visible;padding:0;border:0;box-shadow:none;background:transparent;backdrop-filter:none}
#mobile-menu #subnav .module-title{display:none}
#mobile-menu #subnav nav{display:block}
#mobile-menu #subnav .inner-side{max-height:none;overflow:visible;padding:0;border:0;background:transparent;box-shadow:none}
#mobile-menu #subnav button{min-height:44px;white-space:normal;overflow-wrap:anywhere}
#mobile-menu #subnav [data-board]{display:block;width:100%;text-align:left;padding:10px 12px;border:0;background:transparent}
#mobile-menu #subnav [data-board].active{background:var(--soft);font-weight:600;border-radius:var(--ui-radius-control)}
#mobile-menu #subnav summary{min-height:44px;box-sizing:border-box;align-content:center}
#mobile-menu{width:560px;max-height:90dvh;overflow:auto;background:var(--panel);color:var(--text)}
#mobile-menu header{display:flex;justify-content:space-between;align-items:center;position:sticky;top:0;background:var(--panel);z-index:1}
#mobile-menu h2{margin:0;font-size:20px}#mobile-menu h3{margin:24px 0 12px;font-size:13px;color:var(--muted)}
.mobile-menu-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.mobile-menu-grid button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:64px;white-space:normal;overflow-wrap:anywhere;font-size:12px;padding:10px 6px}
.mobile-menu-grid svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.6}
@media(max-width:700px){
 :root{--mobile-top:calc(56px + env(safe-area-inset-top,0px));--mobile-bottom:calc(62px + env(safe-area-inset-bottom,0px))}
 .office-shell,.office-shell.collapsed,.office-shell.settings-mode{display:block!important;padding-top:var(--mobile-top)!important;padding-bottom:var(--mobile-bottom);min-height:100dvh}
 .office-shell>.app-rail,.office-shell>.module-side,.office-shell.collapsed>.module-side{display:none!important}
 .office-shell .main{width:100%;min-width:0}
 .office-shell .topbar,.office-shell.settings-mode>.topbar{height:var(--mobile-top);padding:env(safe-area-inset-top,0px) max(12px,env(safe-area-inset-right,0px)) 0 max(12px,env(safe-area-inset-left,0px));gap:8px}
 .topbar .brand img{width:36px;height:32px}.topbar .brand span{display:inline;font-size:14px;border:0;padding-left:0;color:var(--text);font-weight:650}
 .top-tools>button{min-width:44px;min-height:44px!important}
 .top-tools #appearance-toggle,.top-tools #theme-toggle,.top-tools #logout,.top-tools>[data-top-nav=settings],.top-tools>[data-top-nav=chat]{display:none}
 .top-tools .identity{width:36px;height:36px;font-size:11px;max-width:50px}
 .office-shell .content,.office-shell.settings-mode .content{padding:20px 16px;max-width:100%;overflow-wrap:anywhere}
 .office-shell .heading h1{font-size:22px;line-height:1.35;letter-spacing:-.6px}.office-shell .heading p{font-size:12px;line-height:1.6}.office-shell .heading .actions:empty{display:none}
 button{min-height:var(--ui-control-height)}input,select,textarea{font-size:var(--ui-input-font-size)!important;min-width:0;max-width:100%}input:not([type=checkbox]):not([type=radio]),select{min-height:44px}
 .card{border-radius:var(--ui-radius-surface)}.widget-grid{gap:12px}.widget{min-height:150px}.widget header button{min-width:40px}.metric-small{font-size:23px}
 .mobile-tabs{position:fixed;inset:auto 0 0;z-index:45;display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);height:var(--mobile-bottom);padding:5px max(8px,env(safe-area-inset-right,0px)) env(safe-area-inset-bottom,0px) max(8px,env(safe-area-inset-left,0px));border-top:1px solid var(--line);background:var(--glass);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px)}
 .mobile-tabs button{border:0;background:transparent;padding:4px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:11px;color:var(--muted);border-radius:var(--ui-radius-control);min-height:50px}
 .mobile-tabs svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
 .mobile-tabs [aria-current=page]{color:var(--text);background:var(--soft);font-weight:700}
 #mobile-menu{position:fixed;inset:0 0 var(--mobile-bottom);z-index:44;margin:0;width:100%;max-width:100%;height:calc(100dvh - var(--mobile-bottom));max-height:calc(100dvh - var(--mobile-bottom));border:0;border-radius:0;padding:env(safe-area-inset-top,0px) 0 0;box-sizing:border-box;overflow:hidden}
 #mobile-menu[open]{display:flex;flex-direction:column;animation:none}
 #mobile-menu[open].closing{animation:none}
 #mobile-menu>header{position:static;flex-shrink:0;padding:10px 12px;border-bottom:1px solid var(--line)}
 #mobile-menu>header h2{font-size:16px;flex:1}
 #mobile-menu>header svg{width:20px;height:20px;flex-shrink:0}
 #mobile-menu-body{display:grid;grid-template-columns:76px minmax(0,1fr);flex:1;min-height:0;overflow:hidden}
 #mobile-menu .mobile-drawer-apps{overflow-y:auto;overscroll-behavior:contain;border-right:1px solid var(--line);padding:6px 4px;background:var(--soft)}
 #mobile-menu .mobile-drawer-apps h3{font-size:10px;text-align:center;margin:8px 0}
 #mobile-menu .mobile-menu-grid{display:flex;flex-direction:column;gap:3px}
 #mobile-menu .mobile-menu-grid button{min-height:56px;font-size:11px;padding:6px 2px;border:0;background:transparent;color:var(--text)}
 #mobile-menu .mobile-menu-grid button.active{background:var(--panel);font-weight:600}
 #mobile-menu-content{overflow-y:auto;overscroll-behavior:contain;min-height:0;padding:14px 12px;box-sizing:border-box}
 #mobile-menu-content>button,#mobile-menu-content details>button{display:block;width:100%;text-align:left;border:0;background:transparent;min-height:44px;padding:10px 8px}
 #mobile-menu-content h3{margin:4px 0 12px}#mobile-menu-content p{font-size:13px;line-height:1.6}
 #mobile-menu #subnav{overflow:visible;min-height:0;height:auto;padding:0;box-sizing:border-box}
 .mobile-tab-editor>[data-tab-row]{display:flex;align-items:center;gap:6px;margin-block:6px}.mobile-tab-editor select{flex:1;min-width:0}
 .mobile-menu-open .mobile-tabs{display:grid!important;box-sizing:border-box}.mobile-menu-open .main{visibility:hidden}
 #mobile-menu #subnav .module-primary{margin-bottom:12px}
 #mobile-menu header button{min-width:44px}.mobile-menu-grid{gap:8px}.mobile-menu-grid button{font-size:12px;min-height:70px}.mobile-menu-grid button:disabled{opacity:.5}
 dialog:not(#mobile-menu){width:calc(100vw - 20px);max-width:calc(100vw - 20px);max-height:calc(100dvh - 24px);overflow:auto;padding:20px 16px;border-radius:var(--ui-radius-surface)}
 .row{align-items:flex-start;flex-wrap:wrap;gap:10px}.row>span{flex:1;min-width:160px}.row>.actions{flex-wrap:wrap}
 .table-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.attendance-table table{min-width:620px}.approval-list-table{min-width:620px}.document-table{min-width:580px}
 .clock-box{margin:0 0 18px;padding:18px;background:var(--panel);border:1px solid var(--line);border-radius:var(--ui-radius-surface)}.clock-box .actions{display:grid;grid-template-columns:1fr 1fr}.clock-box button{min-height:46px}
 .attendance-toolbar>.actions{display:grid;grid-template-columns:44px minmax(100px,1fr) 44px auto;width:100%;gap:4px}.attendance-toolbar input{width:100%;font-size:var(--ui-input-font-size)!important}.attendance-summary{grid-template-columns:1fr}.attendance-summary h2{font-size:25px}
 .calendar-grid{min-width:0}.calendar-grid>strong{font-size:11px;padding:10px 1px}.calendar-day{min-height:95px;padding:3px}.calendar-event{padding:5px 2px;font-size:10px;min-height:26px;white-space:normal;line-height:1.3;max-height:42px}
 .reservation-timeline{max-width:100%;overscroll-behavior-x:contain}.asset-time-table td>button[data-time],.asset-time-table td>button[data-detail]{min-height:44px}.asset-time-table th,.asset-time-table td{height:44px}.reservation-main .slot{min-height:48px;display:flex;align-items:center;gap:5px}.time-slots{max-height:40dvh}
 .reservation-main{display:flex;flex-direction:column}.reservation-toolbar{order:0}.reservation-compose{order:1;margin-top:0}.reservation-mine{order:2;margin-top:12px}#mobile-timeline-toggle{display:block;order:3;margin-bottom:12px}.reservation-timeline{order:4;display:none}.reservation-help{order:5;display:none}.mobile-timeline-expanded .reservation-timeline,.mobile-timeline-expanded .reservation-help{display:block}#mobile-asset-bookings{display:block;font-size:12px;margin-bottom:12px}#mobile-asset-bookings button{display:block;width:100%;text-align:left;margin:6px 0}#mobile-asset-bookings small{display:block}.reservation-mine table{min-width:0}.reservation-mine thead{display:none}.reservation-mine tr{display:block;border:1px solid var(--line);border-radius:var(--ui-radius-control);padding:12px;margin-bottom:8px}.reservation-mine td{display:block;border:0;padding:4px 0;white-space:normal}.reservation-mine td:first-child{font-weight:700}.reservation-mine td:nth-child(3){font-size:12px}.reservation-mine td button{width:100%}
 .office-shell .chat-layout{display:block;min-height:0;height:calc(100dvh - var(--mobile-top) - var(--mobile-bottom) - 128px)}
 .chat-layout .room-list{max-height:none;height:100%;overflow:auto;padding:8px;border-radius:var(--ui-radius-surface)}.room-list button{min-height:70px;padding:15px}.chat-layout .conversation{display:none}
 .chat-layout.mobile-room-open .room-list{display:none}.chat-layout.mobile-room-open .conversation{display:flex;height:100%;min-height:0;border-radius:0;border:0}
 .office-shell[data-page=chat]:has(.mobile-room-open) .content{padding:0}.office-shell[data-page=chat]:has(.mobile-room-open) .content>.heading{display:none}
 .office-shell[data-page=chat] .chat-layout.mobile-room-open{height:calc(100dvh - var(--mobile-top) - var(--mobile-bottom))}
 .mobile-room-open #mobile-chat-back{display:inline-flex;align-items:center;min-height:40px;font-size:13px;margin-bottom:6px}
 .conversation header{flex-shrink:0;padding:10px 14px}.conversation header .actions{gap:5px}.conversation header button{min-height:36px}.conversation header h2{font-size:17px;margin:3px 0;overflow-wrap:anywhere}
 .messages{flex:1;min-height:70px;overscroll-behavior:contain}.composer{padding:10px 12px;flex-shrink:0}.composer textarea{min-height:52px;max-height:100px}.composer input[type=file]{font-size:12px!important;min-height:32px}.composer .actions{justify-content:space-between}.composer .actions>small{font-size:10px}.message{max-width:92%}.bubble{overflow-wrap:anywhere}
 .draft-actions{bottom:var(--mobile-bottom)}#connection-banner{bottom:var(--mobile-bottom)}#notice{bottom:calc(var(--mobile-bottom) + 12px);max-width:calc(100vw - 24px);white-space:normal}
}
@media(max-width:700px) and (max-height:500px){.mobile-room-open .conversation header .actions,.mobile-room-open .composer label:has(input[type=file]),.mobile-room-open .composer>.actions>small{display:none}.mobile-room-open .composer textarea{min-height:40px}.mobile-room-open .conversation header{padding:4px 10px}}
@media(max-width:700px){.keyboard-open .mobile-tabs{display:none}.keyboard-open .office-shell[data-page=chat] .chat-layout.mobile-room-open{height:calc(var(--visual-height,100dvh) - var(--mobile-top))}.keyboard-open .office-shell[data-page=chat]{padding-bottom:0}}
@media print{.mobile-tabs,#mobile-menu,#mobile-chat-back{display:none!important}}
@keyframes mobile-drawer-in{from{transform:translateX(-100%)}to{transform:translateX(0)}}
@keyframes mobile-drawer-out{from{transform:translateX(0)}to{transform:translateX(-100%)}}
@media(prefers-reduced-motion:reduce){#mobile-menu[open],#mobile-menu[open].closing{animation:none}}

/* Shared messenger controls; compact presentation is restricted to touch phones. */
#chat-room-tools>summary{display:none}#chat-room-tools:not([open])>.actions{display:flex}
.chat-file-control{display:flex;align-items:center;gap:8px}.chat-file-control>label{display:none}
#chat-attachments{display:flex;gap:6px;flex-wrap:wrap;max-height:110px;overflow:auto}
.chat-file-chip{display:flex;align-items:center;gap:6px;max-width:100%;background:var(--soft);border:1px solid var(--line);border-radius:var(--ui-radius-control);padding:3px 6px;margin:4px 0}
.chat-file-chip>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.chat-file-chip button{padding:4px 8px;flex-shrink:0}
#chat-latest{align-self:center;flex-shrink:0;margin:4px 8px;border-radius:var(--ui-radius-overlay);background:var(--panel);color:var(--text);border:1px solid var(--line);font-size:12px}
#chat-latest[hidden]{display:none}
.composer textarea{resize:none}.composer label[for=message-text]{margin-top:0}
@media(max-width:700px){
 .office-shell[data-page=chat]:has(.mobile-room-open)>.topbar,.office-shell[data-page=chat]:has(.mobile-room-open) .mobile-tabs{display:none!important}
 .office-shell[data-page=chat] .chat-layout.mobile-room-open,.keyboard-open .office-shell[data-page=chat] .chat-layout.mobile-room-open{position:fixed;z-index:50;top:var(--visual-top,0px);left:0;width:100%;height:var(--visual-height,100dvh);background:var(--panel)}
 .mobile-room-open .conversation{background:var(--panel);overflow:hidden}
 .mobile-room-open .conversation>header{display:grid;grid-template-columns:44px minmax(0,1fr) auto;gap:2px 6px;padding:calc(8px + env(safe-area-inset-top,0px)) 10px 8px;border-bottom:1px solid var(--line);position:relative;z-index:2}
 .mobile-room-open #mobile-chat-back{grid-row:1/3;grid-column:1;font-size:0;width:44px;height:44px;min-height:44px;padding:0;margin:0;border:0;background:transparent;color:var(--text)}
 .mobile-room-open .conversation header h2{grid-column:2;grid-row:1;font-size:16px;line-height:1.4;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;align-self:end}
 .mobile-room-open #chat-status{grid-column:2;grid-row:2;font-size:11px;line-height:1.5;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 #chat-room-tools{grid-column:3;grid-row:1/3;align-self:center}
 #chat-room-tools>summary{display:flex;align-items:center;justify-content:center;font-size:12px;min-height:44px;padding:0 8px;cursor:pointer;list-style:none;border-radius:var(--ui-radius-control);color:var(--text)}
 #chat-room-tools>summary::-webkit-details-marker{display:none}
 #chat-room-tools:not([open])>.actions{display:none}
 #chat-room-tools[open]>.actions{display:grid;position:absolute;right:10px;top:100%;width:180px;padding:8px;background:var(--panel);border:1px solid var(--line);border-radius:var(--ui-radius-control);box-shadow:0 8px 24px #0003;gap:4px}
 #chat-room-tools .actions button{display:block;text-align:left;width:100%;min-height:44px;font-size:13px;border:0}
 .mobile-room-open .messages{padding:14px 12px;min-height:0;overflow-y:auto;overflow-x:hidden;overflow-anchor:none;background:var(--bg)}
 .mobile-room-open .composer{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:end;gap:6px;padding:8px 10px calc(8px + env(safe-area-inset-bottom,0px));border-top:1px solid var(--line);background:var(--panel)}
 .keyboard-open .mobile-room-open .composer{padding-bottom:8px}
 .mobile-room-open .composer>label[for=message-text],.mobile-room-open .composer>.actions>small{display:none}
 .mobile-room-open .composer textarea{grid-column:2;grid-row:3;min-height:44px;max-height:120px;height:44px;line-height:22px;padding:10px;border-radius:var(--ui-radius-control);margin:0}
 .mobile-room-open .chat-file-control{grid-column:1;grid-row:3;align-self:end}
 .mobile-room-open #chat-attach{min-width:44px;min-height:44px;padding:8px;font-size:0;border:0;background:var(--soft);color:var(--text);border-radius:50%}
 .mobile-room-open #chat-attach:before{content:'+';font-size:25px;font-weight:400}
 .mobile-room-open .composer>.actions{grid-column:3;grid-row:3;margin:0;display:flex}
 .mobile-room-open .composer>.actions>button{min-width:48px;min-height:44px;padding:9px;font-size:13px;border-radius:var(--ui-radius-control)}
 .mobile-room-open #chat-attachments{grid-column:1/-1;grid-row:2;max-height:88px}.mobile-room-open #chat-attachments:empty{display:none}
 .mobile-room-open #mention-picker,.mobile-room-open #selected-mentions{grid-column:1/-1;grid-row:1;max-height:90px;overflow:auto;margin:0;font-size:12px}
 .mobile-room-open #mention-picker:not(:empty)+#selected-mentions{display:none}.mobile-room-open #mention-picker button{min-height:40px}
 .mobile-room-open .chat-file-chip button{min-height:36px;min-width:36px}
 .mobile-room-open .bubble{font-size:14px;line-height:1.6;border-radius:var(--ui-radius-surface)}.mobile-room-open .message small{font-size:10px}
 .mobile-room-open .bubble a{display:block;max-width:100%;padding:8px 0;overflow-wrap:anywhere}
 .office-shell[data-page=chat]:has(.mobile-room-open)~#notice{z-index:100}
 dialog.organization-select{height:calc(var(--visual-height,100dvh) - 16px);max-height:calc(var(--visual-height,100dvh) - 16px);padding:0;overflow:hidden}
 dialog.organization-select[open]{display:flex;flex-direction:column}
 dialog.organization-select>header{padding:12px;flex-shrink:0;border-bottom:1px solid var(--line)}
 dialog.organization-select .organization-selection-body{display:flex;flex-direction:column;flex:1;min-height:0;overflow:auto}
 dialog.organization-select .org-popup-tree{flex:1 0 180px;max-height:none;min-height:140px;overflow:auto}
 dialog.organization-select .org-selected-panel{flex-shrink:0;padding:10px 12px}
 dialog.organization-select .org-selected-list{display:flex;gap:6px;flex-wrap:wrap;max-height:100px}
 dialog.organization-select .org-selected-person{background:var(--soft);border-radius:var(--ui-radius-control);padding:2px 4px 2px 7px;margin:0;max-width:100%}
 dialog.organization-select .org-selected-person .person-avatar{width:24px;height:24px}
 dialog.organization-select .org-selected-panel>label{margin:8px 0 0}.organization-select .org-selected-panel>p{margin:6px 0;font-size:12px}
 dialog.organization-select footer{flex-shrink:0;position:static;padding:10px 12px calc(10px + env(safe-area-inset-bottom,0px))}
 dialog.organization-select footer button{flex:1}
}

/* Action counts share the same server-scoped source on PC, phone and drawer. */
[data-nav],[data-mobile-nav],.mobile-menu-grid button{position:relative}
.nav-count{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;border-radius:var(--ui-radius-control);background:#c42332;color:#fff;font-size:11px;font-weight:600;line-height:18px;font-variant-numeric:tabular-nums;flex:none}
.nav-count[hidden]{display:none!important}
.app-rail .nav-count,.mobile-tabs .nav-count,.mobile-menu-grid .nav-count{position:absolute;top:2px;right:5px}
#subnav button .nav-count{margin-left:auto}
[data-theme="dark"] .nav-count{background:#e34b59;color:#fff}

@media(max-width:700px){.employee-management-table{min-width:660px}.employee-management-table th,.employee-management-table td{white-space:nowrap}}

/* Profile clones in the drawer must not inherit the source image's natural size. */
.mobile-menu-grid .mobile-profile img{width:32px;height:32px;max-width:32px;border-radius:50%;object-fit:cover;flex:none}
@media(max-width:700px){.office-shell.mobile-menu-open[data-page=chat]:has(.mobile-room-open) .mobile-tabs{display:grid!important}.mobile-tabs{box-sizing:border-box}}
.avatar-crop-stage{position:relative;width:256px;max-width:100%;aspect-ratio:1;overflow:hidden;border-radius:var(--ui-radius-control);background:#555;margin:16px 0}
.avatar-crop-stage canvas{display:block;width:100%;height:100%;touch-action:none;cursor:move}
.avatar-crop-guide{position:absolute;inset:0;border-radius:50%;border:2px solid white;box-shadow:0 0 0 80px #0006;pointer-events:none;box-sizing:border-box}
#avatar-crop label{max-width:256px}#avatar-crop input[type=range]{width:100%}

.mobile-page-heading{display:flex;align-items:center;gap:8px}.mobile-page-heading h1{margin-right:auto}.mobile-page-heading .mobile-icon-button{display:inline-flex;align-items:center;justify-content:center;margin:0;align-self:center}.mobile-page-heading .mobile-icon-button svg{width:22px;height:22px;display:block}.mobile-user-row #mobile-tabs-edit{margin-left:auto}.mobile-user-row #mobile-profile{margin-right:auto}
