/* Shared phone geometry. Colors and controls remain Marzha + FBS / unified. */
:root{--mobile-nav-height:0px}
.mobile-navigation,.mobile-menu-close,.mobile-more-label{display:none}
@media(max-width:1000px){
  .mobile-menu-close{display:inline-flex;min-width:48px;min-height:48px;margin-left:auto}
}
@media(max-width:760px){
  :root{--mobile-nav-height:calc(68px + env(safe-area-inset-bottom,0px))}
  html{scroll-padding-block:16px calc(var(--mobile-nav-height) + 20px)}
  #app[data-mobile-shell="true"]{padding-bottom:var(--mobile-nav-height)}
  #app[data-mobile-shell="true"]>.workspace{padding-inline:max(16px,env(safe-area-inset-left)) max(16px,env(safe-area-inset-right));font-size:16px}
  #app[data-mobile-shell="true"]>.shell-header{min-height:52px;padding-block:12px;padding-inline:max(16px,env(safe-area-inset-left)) max(16px,env(safe-area-inset-right));gap:12px}
  #app[data-mobile-shell="true"]>.shell-header>.action-bell-trigger{min-height:48px;min-width:48px}
  .shell-title{font-size:14px;line-height:1.35}
  .shell-timezone{font-size:12px}
  .mobile-navigation{position:fixed;inset:auto 0 0;z-index:20;display:flex;align-items:stretch;min-height:calc(68px + env(safe-area-inset-bottom,0px));padding:6px max(8px,env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom,0px)) max(8px,env(safe-area-inset-left));gap:4px;background:var(--ds-surface);border-top:1px solid var(--ds-border)}
  .mobile-navigation>.mobile-navigation-item{display:flex;flex:1 1 0;min-width:0;min-height:56px;align-items:center;justify-content:center;flex-direction:column;gap:4px;padding:5px 2px;border:0;border-radius:var(--ds-radius-control);font-size:12px;font-weight:500;line-height:1.2;text-decoration:none;text-align:center;background:transparent;color:var(--ds-text-muted);overflow-wrap:normal}
  .mobile-navigation-item .nav-icon{width:22px;height:22px}
  .mobile-navigation-item>span{max-width:100%;overflow-wrap:anywhere}
  .mobile-navigation>.mobile-navigation-item:is([aria-current="page"],[data-mobile-current="true"],[aria-expanded="true"]){color:var(--ds-accent);background:var(--ds-accent-soft);font-weight:700}
  .mobile-more-label{display:inline}
  #app[data-mobile-keyboard="true"]{padding-bottom:0}
  #app[data-mobile-keyboard="true"]>.mobile-navigation{display:none}
  #app[data-mobile-shell="true"]>.top{inset:auto 0 0;width:100%;height:auto;max-height:calc(100dvh - 24px - env(safe-area-inset-top));padding:16px max(16px,env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom,0px)) max(16px,env(safe-area-inset-left));gap:20px;border:0;border-top:1px solid var(--ds-border);border-radius:var(--ds-radius-dialog) var(--ds-radius-dialog) 0 0;overscroll-behavior:contain}
  .mobile-menu-close{display:inline-flex;min-width:48px;min-height:48px;margin-left:auto}
  #app[data-mobile-shell="true"] .top nav{gap:20px}
  #app[data-mobile-shell="true"] .top .nav-group{gap:4px}
  #app[data-mobile-shell="true"] .top nav a{font-size:16px;min-height:48px;gap:12px}
  #app[data-mobile-shell="true"] .top .account button{font-size:15px;min-height:48px}
  #app[data-mobile-shell="true"] .top .account{margin-top:0;gap:8px}
  #app[data-mobile-shell="true"] .top .account studio-appearance select{min-height:48px;font-size:16px}
  #message:not(:empty),.session-welcome{bottom:calc(var(--mobile-nav-height) + 12px);max-width:calc(100vw - 32px)}
  :is(#app[data-mobile-shell="true"] main,dialog.workspace-modal) :is(button,.ds-button,input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),select){min-height:48px}
  :is(#app[data-mobile-shell="true"] main,dialog.workspace-modal) :is(input,select,textarea){font-size:16px;scroll-margin-block:24px 96px}
  :is(main,dialog) :is(label:has(>input[type="checkbox"]),label:has(>input[type="radio"])){min-height:44px;gap:10px}
  :is(main,dialog) summary{min-height:44px;align-content:center}
  main :is(h1){font-size:26px;line-height:1.2}
  main :is(h2){font-size:20px;line-height:1.3}
  main :is(.actions,.tabs,.rws-tabs){gap:8px}
  main .rws-tabs{display:flex;flex-wrap:wrap}
  main .rws-tabs :is(a,button){flex:1 1 auto;min-height:44px;text-align:center;justify-content:center}
  main :is(.grid,.form-grid){min-width:0}
  main :is(form,fieldset,article,section,.panel,.scroll,.table-scroll){max-width:100%}
  main :is(.details,.record-facts){gap:8px 12px}
  main :is(.details) dd{overflow-wrap:anywhere}
  main :is(.actions)>.ds-button{flex:1 1 auto}
  main .table-scroll:has(>table[data-responsive="records"]),main .scroll:has(>table[data-responsive="records"]){overflow:visible}
  main :is(.ds-table-wrap,.cn-table-scroll):has(>table[data-responsive="records"]){overflow:visible}
  main :is(.norms-savebar,.cn-savebar,.request-submit,.staff-day-submit){inset-block-end:calc(var(--mobile-nav-height) + 8px)}
  #app[data-mobile-keyboard="true"] main :is(.norms-savebar,.cn-savebar,.request-submit,.staff-day-submit){inset-block-end:8px}
  table[data-responsive="records"]{min-width:0!important;width:100%;table-layout:auto}
  table[data-responsive="records"]>tbody>tr>:is(td,th){font-size:15px;width:auto!important;min-width:0!important;max-width:100%;overflow-wrap:anywhere}
  table[data-responsive="records"]>tbody>tr>:is(td,th)>:is(input,select,textarea){width:100%}
  table[data-responsive="records"]>tbody>tr>:is(td,th):has(button,a.ds-button){grid-template-columns:minmax(0,1fr)}
  table[data-responsive="records"]>tbody>tr>:is(td,th):has(button,a.ds-button)>*{grid-column:1}
  table[data-responsive="records"]>tbody>tr>:is(td,th):has(button,a.ds-button)::before{grid-column:1}
  table[data-responsive="records"]>tbody>tr>:is(td,th)[data-label=""]::before{display:none}
  :root dialog.workspace-modal[open]{max-height:calc(var(--mobile-visible-height,100dvh) - 12px);inset-block-end:var(--mobile-keyboard-inset,0px)}
  :root dialog.workspace-modal[data-mobile="fullscreen"][open]{height:var(--mobile-visible-height,100dvh);max-height:var(--mobile-visible-height,100dvh)}
  .workspace-modal .workspace-modal-header{gap:12px}
  .workspace-modal .workspace-modal-body{scroll-padding-bottom:80px}
  .workspace-modal .workspace-modal-footer{gap:8px}
  .workspace-modal .workspace-modal-footer>.ds-button--primary{flex-basis:100%}
  .home-dashboard .hd-header{gap:12px}
  .home-dashboard .hd-header-tools{gap:8px}
  .home-dashboard .hd-header-tools button{font-size:14px;min-height:44px;padding:8px 12px}
  .home-dashboard .hd-section{padding:16px}
  .home-dashboard .hd-action-card{padding:0}
  .home-dashboard .hd-action-card>.hd-item-facts{grid-template-columns:minmax(0,1fr)}
  .home-dashboard .hd-actions:empty{display:none}
}
@media(max-width:380px){
  .workspace-modal .workspace-modal-header{padding:12px;gap:8px}
  .workspace-modal .workspace-modal-close{padding-inline:10px}
  table[data-responsive="records"]>tbody>tr>:is(td,th){grid-template-columns:minmax(0,1fr);gap:4px}
  table[data-responsive="records"]>tbody>tr>:is(td,th)>*{grid-column:1}
  main .details{grid-template-columns:minmax(0,1fr)}
  main .details dd{margin-bottom:8px}
}
@media(prefers-reduced-motion:no-preference){
  .mobile-navigation-item{transition:background-color var(--ds-motion-fast),color var(--ds-motion-fast)}
}
@media print{
  .mobile-navigation{display:none!important}
  #app[data-mobile-shell="true"]{padding-bottom:0}
}
