/* AS Surface OS 216B2 — Mobile UX Refinement
   Safe CSS-only mobile layer over 216A8 + 216B1.
   Desktop is intentionally untouched. No route, data, server or application logic changes. */

@media (max-width:800px){
  html.as216a8-native{
    --as216b2-top:64px;
    --as216b2-bottom:70px;
    --as216b2-gutter:11px;
    --as216b2-touch:44px;
    --as216b2-paper:#fffdf9;
    --as216b2-soft:#f7f1ea;
    --as216b2-line:#ded4ca;
    --as216b2-ink:#1b1e1d;
    --as216b2-muted:#746e68;
    --as216b2-gold:#c9955b;
    --as216b2-dark:#0c1417;
    overscroll-behavior-y:none;
  }

  html.as216a8-native,html.as216a8-native body,html.as216a8-native #app{
    width:100%!important;max-width:100%!important;overflow-x:hidden!important;
  }
  html.as216a8-native body{-webkit-text-size-adjust:100%;text-size-adjust:100%;}
  html.as216a8-native *{box-sizing:border-box;}

  /* ---------------------------------------------------------
     APP CHROME — fixed, edge-to-edge, thumb friendly
     --------------------------------------------------------- */
  html.as216a8-native #app .workspace94.as211v11a-shell .workspace91c-topbar,
  html.as216a8-native #app .workspace94.as211v11a-shell .workspace86-topbar{
    position:fixed!important;
    top:var(--as-visual-top,0px)!important;left:0!important;right:0!important;bottom:auto!important;
    width:100%!important;height:calc(var(--as216b2-top) + env(safe-area-inset-top,0px))!important;
    min-height:calc(var(--as216b2-top) + env(safe-area-inset-top,0px))!important;
    margin:0!important;padding:calc(7px + env(safe-area-inset-top,0px)) 9px 7px!important;
    border:0!important;border-bottom:1px solid #2a3539!important;border-radius:0!important;
    background:#0c1417!important;box-shadow:0 5px 18px rgba(0,0,0,.15)!important;
    transform:none!important;z-index:520!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell .workspace91c-top-left,
  html.as216a8-native #app .workspace94.as211v11a-shell .workspace86-left{
    display:flex!important;align-items:center!important;gap:6px!important;min-width:0!important;flex:1 1 auto!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell :is(.mobile-menu-toggle,.as195-mobile-page-back){
    width:var(--as216b2-touch)!important;height:var(--as216b2-touch)!important;min-width:var(--as216b2-touch)!important;
    padding:0!important;border-radius:11px!important;display:grid!important;place-items:center!important;
    background:#152126!important;border:1px solid #2b383d!important;color:#f3eee6!important;font-size:19px!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-brand{
    display:flex!important;align-items:center!important;gap:8px!important;min-width:0!important;flex:1 1 auto!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-brand-logo{
    width:30px!important;height:30px!important;max-width:30px!important;object-fit:contain!important;flex:0 0 30px!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-brand>span{
    display:grid!important;min-width:0!important;line-height:1.08!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-brand strong{
    color:#fffaf1!important;font-size:12.5px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-brand small{
    color:#a9b2b1!important;font-size:9px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
  }
  /* Remove desktop-only chrome from the phone header. Help + alerts remain. */
  html.as216a8-native #app .workspace94.as211v11a-shell :is(.workspace86-route,.as190-global-search,.workspace86-user .avatar,.workspace86-user .user-text,.workspace86-user .workspace86-logout,.workspace86-user .workspace-theme-toggle,.workspace86-user .live-sync-chip,.workspace86-user .install-app-btn){display:none!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .workspace86-user{
    display:flex!important;align-items:center!important;gap:5px!important;flex:0 0 auto!important;margin-left:4px!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell :is(.as195-help-button,.as190-notification-button,.workspace-load-warning){
    min-width:40px!important;height:40px!important;min-height:40px!important;border-radius:10px!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell .workspace-load-warning span{display:none!important;}

  /* Main content always clears fixed chrome. */
  html.as216a8-native #app .workspace94.as211v11a-shell .workspace91c-main,
  html.as216a8-native #app .workspace94.as211v11a-shell .workspace86-main{
    width:100%!important;min-width:0!important;margin:0!important;
    padding-top:calc(var(--as216b2-top) + env(safe-area-inset-top,0px))!important;
    background:linear-gradient(180deg,#f5f1eb,#eee8e0)!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell .workspace91c-main>.content,
  html.as216a8-native #app .workspace94.as211v11a-shell .workspace86-main>.content{
    width:100%!important;max-width:100%!important;min-width:0!important;margin:0!important;
    padding:12px var(--as216b2-gutter) calc(var(--as216b2-bottom) + 20px + env(safe-area-inset-bottom,0px))!important;
    overflow-x:hidden!important;
  }

  /* Bottom navigation becomes a permanent app bar, never a floating dock. */
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-tabbar{
    position:fixed!important;left:0!important;right:0!important;bottom:0!important;top:auto!important;
    display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:2px!important;
    width:100%!important;max-width:none!important;min-height:calc(var(--as216b2-bottom) + env(safe-area-inset-bottom,0px))!important;
    margin:0!important;padding:6px 5px calc(6px + env(safe-area-inset-bottom,0px))!important;
    border:0!important;border-top:1px solid #293539!important;border-radius:0!important;
    background:rgba(10,17,20,.985)!important;box-shadow:0 -8px 24px rgba(0,0,0,.18)!important;
    backdrop-filter:blur(14px)!important;transform:none!important;z-index:540!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-tab{
    min-width:0!important;min-height:56px!important;margin:0!important;padding:5px 2px!important;
    border:1px solid transparent!important;border-radius:10px!important;background:transparent!important;color:#9eaaa9!important;
    display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:3px!important;
    transform:none!important;translate:none!important;box-shadow:none!important;touch-action:manipulation!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-tab span{width:22px!important;height:22px!important;display:grid!important;place-items:center!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-tab svg{width:20px!important;height:20px!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-tab small{font-size:8.5px!important;font-weight:750!important;line-height:1!important;white-space:nowrap!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-tab.active{
    color:#f4d4aa!important;background:rgba(201,149,91,.13)!important;border-color:rgba(201,149,91,.22)!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-scan{
    background:linear-gradient(180deg,#dfb77f,#bd854b)!important;color:#18110b!important;border-color:#e7c493!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-scan.active{box-shadow:inset 0 0 0 2px rgba(255,255,255,.28)!important;}

  /* Drawer: full-height working menu with account controls at the top. */
  html.as216a8-native #app .workspace94.as211v11a-shell .workspace91c-sidebar,
  html.as216a8-native #app .workspace94.as211v11a-shell .sidebar{
    position:fixed!important;top:0!important;bottom:0!important;left:0!important;
    width:min(88vw,360px)!important;max-width:360px!important;height:100dvh!important;max-height:100dvh!important;
    padding:calc(12px + env(safe-area-inset-top,0px)) 10px calc(12px + env(safe-area-inset-bottom,0px))!important;
    border-radius:0 18px 18px 0!important;overflow:hidden!important;z-index:620!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell .workspace91c-sidebar-head{min-height:48px!important;gap:8px!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .mobile-sidebar-close{
    width:44px!important;height:44px!important;min-width:44px!important;border-radius:11px!important;font-size:24px!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-account{
    display:grid!important;gap:10px!important;margin:7px 0 10px!important;padding:11px!important;border-radius:13px!important;
    border:1px solid rgba(229,188,136,.16)!important;background:rgba(255,255,255,.035)!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-account-actions{display:grid!important;grid-template-columns:1fr 1fr!important;gap:7px!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-account-actions button{min-height:40px!important;border-radius:9px!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .workspace91c-menu{
    overflow-y:auto!important;overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch!important;padding-bottom:20px!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell .workspace91c-menu-item{
    min-height:44px!important;margin:2px 1px!important;border-radius:10px!important;padding-top:7px!important;padding-bottom:7px!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell .sidebar-backdrop{
    position:fixed!important;inset:0!important;width:100vw!important;height:100dvh!important;
    background:rgba(5,10,12,.62)!important;backdrop-filter:blur(2px)!important;z-index:610!important;
  }

  /* ---------------------------------------------------------
     PAGE STRUCTURE — compact, readable, no desktop leftovers
     --------------------------------------------------------- */
  html.as216a8-native #app .workspace94.as211v11a-shell .workspace91c-main .page-head:not(.command-page-head),
  html.as216a8-native #app .workspace94.as211v11a-shell .workspace86-main .page-head:not(.command-page-head){
    min-height:0!important;margin:0 0 11px!important;padding:14px!important;border-radius:14px!important;
    display:grid!important;grid-template-columns:1fr!important;gap:10px!important;overflow:hidden!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell .page-head h1{font-size:22px!important;line-height:1.08!important;margin:2px 0 4px!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .page-head p{font-size:10.5px!important;line-height:1.42!important;max-width:none!important;margin:0!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .page-head :is(.quick-actions,.page-actions,.clean-payroll-actions,.command-head-actions,.planner-head-actions){
    width:100%!important;display:flex!important;gap:7px!important;overflow-x:auto!important;overscroll-behavior-x:contain!important;padding-bottom:1px!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell .page-head :is(.quick-actions,.page-actions,.clean-payroll-actions,.command-head-actions,.planner-head-actions)>button{
    min-width:max-content!important;min-height:42px!important;
  }

  /* Mobile Command Center: show the purpose-built summary; remove duplicated desktop hero/KPI row. */
  html.as216a8-native #app .workspace94.as211v11a-shell .command-center .as94-mobile-home{display:grid!important;gap:10px!important;margin-bottom:11px!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .command-center :is(.as-command-hero,.as-quick-actions,.as-command-kpis){display:none!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-welcome{
    display:flex!important;align-items:flex-start!important;justify-content:space-between!important;gap:10px!important;
    padding:15px!important;border-radius:15px!important;background:linear-gradient(135deg,#111b1e,#192326)!important;
    border:1px solid #2b363a!important;color:#f7f2e9!important;box-shadow:0 7px 18px rgba(20,24,23,.10)!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-welcome small{font-size:8px!important;letter-spacing:.14em!important;color:#d7ad78!important;font-weight:850!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-welcome h2{margin:4px 0 3px!important;font-size:22px!important;color:#fff9ef!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-welcome p{margin:0!important;font-size:10px!important;color:#b9c0bf!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-welcome>span{padding:5px 7px!important;border-radius:999px!important;font-size:8px!important;font-weight:900!important;background:#202c30!important;color:#d9e0df!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-welcome>span.online{background:#e9f6f0!important;color:#247359!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-kpis{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-kpis>button{
    min-height:100px!important;padding:12px!important;text-align:left!important;border:1px solid var(--as216b2-line)!important;border-radius:13px!important;
    background:var(--as216b2-paper)!important;color:var(--as216b2-ink)!important;box-shadow:0 4px 12px rgba(57,43,31,.04)!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-kpis span{display:block!important;font-size:9px!important;color:var(--as216b2-muted)!important;text-transform:uppercase!important;letter-spacing:.06em!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-kpis strong{display:block!important;margin:5px 0 2px!important;font-size:23px!important;color:var(--as216b2-ink)!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-kpis strong.word{font-size:15px!important;margin-top:9px!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-kpis small{font-size:9px!important;color:var(--as216b2-muted)!important;line-height:1.25!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-actions{display:grid!important;grid-template-columns:1.25fr 1fr 1fr!important;gap:7px!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-actions button{min-height:46px!important;padding:8px!important;border-radius:11px!important;font-size:10px!important;}

  /* Universal cards / grids on phones. */
  html.as216a8-native #app .workspace94.as211v11a-shell :is(.stats,.as94-mobile-stats,.clean-payroll-kpis,.contractor-mini-stats,.contractor-totals,.pay-detail-hero,.pay-detail-grid,.command-detail-summary,.sync-stats,.as215-kpis,.as215-detail-kpis){
    grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell :is(.card,.card.section,.section,.planner-toolbar,.planner-backlog,.appearance-controls,.appearance-live,.brand-studio){
    border-radius:13px!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell :is(.card.section,.section){padding:13px!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .section-title{
    display:flex!important;align-items:flex-start!important;gap:8px!important;flex-wrap:wrap!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell .section-title>div{min-width:0!important;flex:1 1 180px!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .section-title h2{font-size:16px!important;line-height:1.18!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .section-title small{font-size:9px!important;line-height:1.35!important;}

  /* Tabs are swipeable rails rather than compressed button rows. */
  html.as216a8-native #app .workspace94.as211v11a-shell :is(.tabs,.workforce-clean-tabs,.attendance-view-switch,.payroll-scope-tabs,.planner-view-tabs,.planner-week-controls,.route-chip-strip){
    display:flex!important;width:100%!important;max-width:100%!important;overflow-x:auto!important;overflow-y:hidden!important;
    gap:5px!important;padding:4px!important;scroll-snap-type:x proximity!important;overscroll-behavior-x:contain!important;
    -webkit-overflow-scrolling:touch!important;scrollbar-width:none!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell :is(.tabs,.workforce-clean-tabs,.attendance-view-switch,.payroll-scope-tabs,.planner-view-tabs,.planner-week-controls,.route-chip-strip)::-webkit-scrollbar{display:none!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell :is(.tabs,.workforce-clean-tabs,.attendance-view-switch,.payroll-scope-tabs,.planner-view-tabs,.planner-week-controls,.route-chip-strip)>button{
    min-width:max-content!important;min-height:40px!important;padding:8px 12px!important;scroll-snap-align:start!important;touch-action:manipulation!important;
  }

  /* Tables become readable record cards. Existing JS supplies data-label attributes. */
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-card-table{
    display:block!important;width:100%!important;min-width:0!important;border:0!important;background:transparent!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-card-table thead{display:none!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-card-table tbody{display:grid!important;gap:9px!important;width:100%!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-card-table tbody tr{
    display:grid!important;width:100%!important;min-width:0!important;padding:7px 11px!important;
    border:1px solid var(--as216b2-line)!important;border-radius:13px!important;background:var(--as216b2-paper)!important;
    box-shadow:0 4px 12px rgba(57,43,31,.035)!important;overflow:hidden!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-card-table tbody td{
    display:grid!important;grid-template-columns:minmax(94px,34%) minmax(0,1fr)!important;align-items:start!important;gap:9px!important;
    width:100%!important;min-width:0!important;padding:8px 0!important;border:0!important;border-bottom:1px solid #eee5dc!important;
    background:transparent!important;color:var(--as216b2-ink)!important;white-space:normal!important;overflow-wrap:anywhere!important;text-align:left!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-card-table tbody td:last-child{border-bottom:0!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-card-table tbody td:not([colspan])::before{
    content:attr(data-label)!important;display:block!important;font-size:8px!important;line-height:1.25!important;font-weight:850!important;
    letter-spacing:.055em!important;text-transform:uppercase!important;color:#8d8176!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-card-table tbody td[colspan]{display:block!important;padding:12px 0!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-card-table .as94-actions-cell{
    grid-template-columns:1fr!important;gap:6px!important;padding-top:10px!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-card-table .as94-actions-cell::before{margin-bottom:2px!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-card-table .as94-actions-cell :is(button,a){min-height:40px!important;}

  /* Forms: no accidental iPhone zoom and no tiny tap targets. */
  html.as216a8-native #app .workspace94.as211v11a-shell :is(.form-grid,.appearance-form){grid-template-columns:1fr!important;gap:10px!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell :is(.form-grid,.appearance-form) .span-2{grid-column:auto!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea),
  html.as216a8-native .modal-card :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea),
  html.as216a8-native #as215-native-host :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea){
    width:100%!important;max-width:100%!important;min-height:44px!important;font-size:16px!important;padding:10px 11px!important;border-radius:10px!important;
  }
  html.as216a8-native textarea{min-height:96px!important;resize:vertical!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell button,
  html.as216a8-native .modal-card button,
  html.as216a8-native #as215-native-host button{touch-action:manipulation;}
  html.as216a8-native #app .workspace94.as211v11a-shell :is(.primary-btn,.secondary-btn,.camera-btn,.link-btn){min-height:42px!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .quick-actions{gap:7px!important;flex-wrap:wrap!important;}

  /* Workforce / payroll: retain information density without horizontal squeeze. */
  html.as216a8-native #app .workspace94.as211v11a-shell :is(.attendance-toolbar,.contractor-toolbar,.clean-payroll-actions){
    display:grid!important;grid-template-columns:1fr!important;align-items:stretch!important;gap:8px!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell .attendance-date-nav{width:100%!important;display:grid!important;grid-template-columns:44px minmax(0,1fr) 44px!important;gap:6px!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .contractor-policy{display:grid!important;gap:10px!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .contractor-policy-rules{min-width:0!important;grid-template-columns:1fr 1fr!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .pay-detail-columns{grid-template-columns:1fr!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .pay-detail-formula{grid-template-columns:1fr!important;gap:7px!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .pay-detail-formula>b{display:none!important;}

  /* Planner / production rails can scroll horizontally inside their own area, never the page. */
  html.as216a8-native #app .workspace94.as211v11a-shell :is(.as94-android-xscroll,.planner-week-board,.timeline-stage-track,.timeline-modal-track,.as-flow-track,.drilling-panel-wrap,.drilling-map-wrap,.part-route){
    max-width:100%!important;overflow-x:auto!important;overscroll-behavior-x:contain!important;-webkit-overflow-scrolling:touch!important;scrollbar-width:thin!important;
  }
  html.as216a8-native #app .workspace94.as211v11a-shell .planner-layout{grid-template-columns:1fr!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .planner-backlog{position:static!important;max-height:none!important;}

  /* Product / engineering visuals: fit the phone, technical content can still scroll internally. */
  html.as216a8-native #app .workspace94.as211v11a-shell :is(img,video,canvas,svg){max-width:100%;}
  html.as216a8-native #app .workspace94.as211v11a-shell :is(.bed-twin-webgl,[class*="webgl"],[class*="viewer"]){max-width:100%!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .bed-twin-webgl{height:min(58svh,500px)!important;min-height:360px!important;}

  /* Modals are true bottom sheets on mobile; actions remain reachable. */
  html.as216a8-native body>.modal-backdrop.workspace94.as-modal-root,
  html.as216a8-native .workspace94.as-modal-root{
    position:fixed!important;inset:0!important;width:100vw!important;height:var(--as-visual-height,100dvh)!important;
    margin:0!important;padding:0!important;place-items:end stretch!important;overflow:hidden!important;z-index:1000!important;
  }
  html.as216a8-native .workspace94.as-modal-root .modal-card,
  html.as216a8-native .as215-dialog{
    width:100%!important;max-width:100%!important;max-height:var(--as-visual-height,100dvh)!important;margin:0!important;
    padding:0 12px calc(12px + env(safe-area-inset-bottom,0px))!important;border-radius:18px 18px 0 0!important;
    overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch!important;
  }
  html.as216a8-native .modal-card>.modal-head,
  html.as216a8-native .as215-dialog>header{
    position:sticky!important;top:0!important;z-index:6!important;margin:0 -12px 10px!important;padding:13px 12px 10px!important;
    background:rgba(255,253,249,.97)!important;backdrop-filter:blur(10px)!important;border-bottom:1px solid var(--as216b2-line)!important;
  }
  html.as216a8-native .modal-card .form-actions{
    position:sticky!important;bottom:-1px!important;z-index:5!important;margin:12px -12px -12px!important;padding:10px 12px calc(10px + env(safe-area-inset-bottom,0px))!important;
    background:linear-gradient(180deg,rgba(255,253,249,.88),#fffdf9 28%)!important;border-top:1px solid var(--as216b2-line)!important;
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;
  }
  html.as216a8-native .modal-card .form-actions>*{min-width:0!important;min-height:44px!important;}

  /* Quotation editor: keep it native to the same phone rhythm. */
  html.as216a8-native #as215-native-host{width:100%!important;max-width:100%!important;overflow-x:hidden!important;}
  html.as216a8-native #as215-native-host :is(.as215-grid,.as215-form-grid,.as215-line-grid){grid-template-columns:1fr!important;}
  html.as216a8-native #as215-native-host :is(.as215-native-tabs,.as215-tabs){overflow-x:auto!important;white-space:nowrap!important;scrollbar-width:none!important;}
  html.as216a8-native #as215-native-host :is(.as215-native-tabs,.as215-tabs)::-webkit-scrollbar{display:none!important;}

  /* Toast and keyboard behavior. */
  html.as216a8-native body>.toast{
    position:fixed!important;left:10px!important;right:10px!important;width:auto!important;max-width:none!important;
    bottom:calc(var(--as216b2-bottom) + 10px + env(safe-area-inset-bottom,0px))!important;margin:0!important;z-index:1400!important;
  }
  html.as216a8-native[data-keyboard="open"] #app .workspace94.as211v11a-shell .as94-mobile-tabbar{display:none!important;}
  html.as216a8-native[data-keyboard="open"] #app .workspace94.as211v11a-shell .workspace91c-main>.content{padding-bottom:20px!important;}
  html.as216a8-native[data-keyboard="open"] body>.toast{bottom:10px!important;}
}

@media (max-width:480px){
  html.as216a8-native{--as216b2-gutter:9px;}
  html.as216a8-native #app .workspace94.as211v11a-shell .workspace91c-topbar,
  html.as216a8-native #app .workspace94.as211v11a-shell .workspace86-topbar{padding-left:7px!important;padding-right:7px!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell :is(.as195-help-button){display:none!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-kpis{grid-template-columns:1fr 1fr!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-actions{grid-template-columns:1fr 1fr!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-actions .primary-btn{grid-column:1/-1!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell :is(.stats,.as94-mobile-stats,.clean-payroll-kpis,.contractor-mini-stats,.contractor-totals,.pay-detail-hero,.pay-detail-grid,.command-detail-summary,.sync-stats,.as215-kpis,.as215-detail-kpis){grid-template-columns:1fr 1fr!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .contractor-policy-rules{grid-template-columns:1fr!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-card-table tbody td{grid-template-columns:minmax(82px,31%) minmax(0,1fr)!important;gap:7px!important;}
}

/* Short landscape phones: preserve working area and reduce chrome height. */
@media (max-width:800px) and (max-height:540px) and (orientation:landscape){
  html.as216a8-native{--as216b2-top:56px;--as216b2-bottom:60px;}
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-tab{min-height:48px!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .as94-mobile-tab small{font-size:8px!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .workspace91c-sidebar{width:min(68vw,360px)!important;}
  html.as216a8-native #app .workspace94.as211v11a-shell .bed-twin-webgl{height:72svh!important;min-height:300px!important;}
}

/* Tablet: retain two-column efficiency but keep touch sizing. */
@media (min-width:801px) and (max-width:1100px) and (pointer:coarse){
  html.as216a8-native #app .workspace94.as211v11a-shell :is(button,.primary-btn,.secondary-btn){min-height:40px;}
  html.as216a8-native #app .workspace94.as211v11a-shell :is(input,select,textarea){font-size:15px;}
}
