/* Empire Desk — consolidated Android phone + tablet layout.
   Desktop is intentionally untouched. */

/* Shared touch behavior */
@media (pointer:coarse), (max-width:700px){
  .view-floor .floor-scroll{
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior:contain!important;
    touch-action:pan-x pan-y!important;
  }
  .character,.desk,button{touch-action:manipulation}
  body:has(#office-message-center) #office-guide-fab{display:none!important}
}

/* =========================
   TABLET 701–1400
   ========================= */
@media (pointer:coarse) and (min-width:701px) and (max-width:1400px){
  html,body,#app{height:100dvh!important;max-height:100dvh!important;overflow:hidden!important}
  .shell{
    height:100dvh!important;
    min-height:0!important;
    grid-template-columns:58px minmax(0,1fr)!important;
    transition:grid-template-columns .2s ease!important;
  }

  /* Collapsible left rail */
  .sidebar{
    width:58px!important;
    padding:7px 5px!important;
    overflow-x:hidden!important;
    transition:width .2s ease!important;
  }
  .sidebar .logo .v2-brand-copy,.sidebar .v2-nav-label,.sidebar .v2-nav-section,.sidebar .footer{display:none!important}
  .sidebar button{
    position:relative!important;
    min-height:42px!important;
    height:42px!important;
    padding:5px!important;
    justify-content:center!important;
    gap:0!important;
    border-radius:9px!important;
  }
  .sidebar .v2-nav-icon{width:28px!important;min-width:28px!important;font-size:17px!important;margin:0!important}
  #tablet-sidebar-toggle{
    display:flex!important;
    width:100%!important;
    min-height:42px!important;
    margin:0 0 5px!important;
    align-items:center!important;
    justify-content:center!important;
    background:rgba(255,255,255,.08)!important;
    border:1px solid rgba(255,255,255,.12)!important;
    color:#fff!important;
  }
  #tablet-sidebar-toggle .tablet-nav-toggle-label{display:none!important}

  body.tablet-sidebar-expanded .shell{grid-template-columns:205px minmax(0,1fr)!important}
  body.tablet-sidebar-expanded .sidebar{width:205px!important;padding:8px!important;overflow-y:auto!important}
  body.tablet-sidebar-expanded .sidebar button{justify-content:flex-start!important;gap:8px!important;padding:6px 9px!important}
  body.tablet-sidebar-expanded .sidebar .v2-nav-label{
    display:block!important;
    min-width:0!important;
    font-size:11px!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  body.tablet-sidebar-expanded .sidebar .v2-nav-section{
    display:block!important;
    margin:8px 7px 3px!important;
    font-size:8px!important;
    white-space:nowrap!important;
  }
  body.tablet-sidebar-expanded #tablet-sidebar-toggle{justify-content:flex-start!important;padding:6px 9px!important}
  body.tablet-sidebar-expanded #tablet-sidebar-toggle .tablet-nav-toggle-label{display:block!important;font-size:11px!important}

  .sidebar .dm-count,.sidebar .wl-count,.sidebar .aid-count{
    position:absolute!important;
    top:2px!important;
    right:2px!important;
    margin:0!important;
    min-width:14px!important;
    width:auto!important;
    height:14px!important;
    padding:0 3px!important;
    font-size:7px!important;
    line-height:14px!important;
    border-radius:8px!important;
  }
  body.tablet-sidebar-expanded .sidebar .dm-count,
  body.tablet-sidebar-expanded .sidebar .wl-count,
  body.tablet-sidebar-expanded .sidebar .aid-count{
    position:static!important;
    margin-left:auto!important;
  }

  /* Compact HUD + Auto */
  header.topbar{
    min-height:48px!important;
    height:48px!important;
    padding:4px 7px!important;
    gap:5px!important;
    overflow:hidden!important;
  }
  header.topbar>div:first-child,header.topbar .ol-player-greeting{display:none!important}
  header.topbar .toolbar{
    width:100%!important;
    margin:0!important;
    display:flex!important;
    align-items:center!important;
    gap:4px!important;
    flex-wrap:nowrap!important;
    overflow:hidden!important;
  }
  header.topbar .toolbar>select,header.topbar .toolbar>.badge{display:none!important}
  header.topbar .v2-hud-stat{
    height:38px!important;
    min-width:82px!important;
    padding:4px 6px!important;
    border-radius:9px!important;
  }
  header.topbar .v2-hud-stat .v2-hud-icon{width:25px!important;height:25px!important;font-size:13px!important}
  header.topbar .v2-hud-stat strong{font-size:12px!important}
  header.topbar .v2-hud-stat small{font-size:7px!important}
  header.topbar .game-calendar{
    margin-left:auto!important;
    height:36px!important;
    min-width:160px!important;
    max-width:195px!important;
    font-size:9px!important;
  }
  header.topbar .game-time-tab{height:36px!important;min-height:36px!important;width:82px!important;min-width:82px!important;font-size:10px!important}
  header.topbar .v2-hud-actions{gap:4px!important}
  header.topbar .v2-hud-actions button{height:36px!important;min-width:36px!important;padding:0 7px!important;font-size:11px!important}
  header.topbar .v2-hud-actions [data-enh-auto]{
    display:inline-flex!important;
    min-width:58px!important;
    width:auto!important;
    font-size:9px!important;
    white-space:nowrap!important;
  }

  /* Generic tablet pages */
  .content{padding:8px!important;min-height:0!important}
  .content:not(.view-floor){overflow:auto!important;-webkit-overflow-scrolling:touch!important}

  /* Floor occupies the screen */
  .content.view-floor{
    position:relative!important;
    padding:5px!important;
    gap:0!important;
    overflow:hidden!important;
  }
  .content.view-floor>.heading,.content.view-floor>.life-bar,.content.view-floor .v2-bottom-info{display:none!important}
  .view-floor .floor-layout,.view-floor .floor-layout.v2-selected,.view-floor .floor-layout.has-employee{
    position:relative!important;
    display:block!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  .view-floor .floor-layout>div:first-child{
    position:absolute!important;
    inset:0!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
  }
  .view-floor .floor-scroll{
    position:absolute!important;
    inset:0!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    overflow:auto!important;
    padding:3px!important;
    border-radius:11px!important;
  }
  .view-floor aside.profile{
    position:absolute!important;
    top:6px!important;right:6px!important;bottom:6px!important;
    width:min(360px,42vw)!important;
    height:auto!important;
    z-index:2200!important;
    border-radius:15px!important;
    box-shadow:0 14px 38px rgba(10,35,27,.30)!important;
  }

  /* Message workspace — conversation gets most of the screen */
  #office-message-center.dm-center{inset:4px!important;border-radius:12px!important;box-shadow:0 16px 44px rgba(9,31,24,.28)!important}
  #office-message-center .dm-shell>header{
    min-height:46px!important;
    padding:5px 7px!important;
    display:grid!important;
    grid-template-columns:116px minmax(200px,1fr) 36px!important;
    align-items:center!important;
    gap:5px!important;
  }
  #office-message-center .dm-shell>header>div:first-child small{display:none!important}
  #office-message-center .dm-shell>header h2{font-size:16px!important;margin:0!important}
  #office-message-center .ol-message-tools{
    width:100%!important;min-width:0!important;margin:0!important;
    display:grid!important;grid-template-columns:minmax(100px,1fr) 108px!important;gap:5px!important;
  }
  #office-message-center .ol-message-search{min-width:0!important;height:32px!important;padding:0 7px!important}
  #office-message-center .ol-message-search input{font-size:11px!important;padding:5px 0!important}
  #office-message-center .ol-message-tools select{width:108px!important;min-width:108px!important;height:32px!important;font-size:9px!important;padding:4px 20px 4px 7px!important}
  #office-message-center #dm-close{width:36px!important;height:36px!important;min-width:36px!important;padding:0!important}
  #office-message-center .dm-bulkbar,#office-message-center .dm-thread-select{display:none!important}
  #office-message-center .dm-layout{grid-template-columns:210px minmax(0,1fr)!important;min-height:0!important}
  #office-message-center .dm-list{max-height:none!important}
  #office-message-center .dm-thread,#office-message-center .dm-thread.dm-bulk-ready{
    grid-template-columns:40px minmax(0,1fr) auto!important;
    min-height:58px!important;padding:5px 6px!important;gap:6px!important;
  }
  #office-message-center .dm-avatar{width:40px!important;height:40px!important;border-radius:9px!important}
  #office-message-center .dm-copy b{font-size:10px!important}
  #office-message-center .dm-copy small,#office-message-center .dm-thread-demo{font-size:7px!important}
  #office-message-center .dm-copy>span{font-size:8px!important}
  #office-message-center .dm-person{
    min-height:58px!important;max-height:66px!important;
    padding:5px 8px!important;gap:7px!important;overflow:hidden!important;
    display:grid!important;grid-template-columns:46px minmax(0,1fr) auto!important;align-items:center!important;
  }
  #office-message-center .dm-profile{width:44px!important;height:44px!important;border-radius:9px!important}
  #office-message-center .dm-person>div:nth-child(2){min-width:0!important}
  #office-message-center .dm-person h3{font-size:15px!important;line-height:1.05!important;margin:0 0 2px!important}
  #office-message-center .dm-person p{font-size:8px!important;margin:0!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  #office-message-center .dm-person small,#office-message-center .dm-person .employee-demo,#office-message-center .ol-person-stats{display:none!important}
  #office-message-center .delete-thread{margin:0!important;min-height:28px!important;padding:4px 6px!important;font-size:7px!important}
  #office-message-center .dm-log{flex:1 1 auto!important;min-height:0!important;padding:8px 10px!important;overflow:auto!important}
  #office-message-center .dm-msg{max-width:90%!important;padding:7px 9px!important;margin-bottom:6px!important}
  #office-message-center .dm-msg p{font-size:11px!important;line-height:1.4!important}
  #office-message-center .dm-reply{flex:0 0 50px!important;min-height:50px!important;padding:5px 7px!important;gap:6px!important}
  #office-message-center .dm-reply textarea{min-height:38px!important;height:38px!important;padding:7px!important;font-size:12px!important}
  #office-message-center .dm-reply button{min-width:62px!important;height:38px!important;min-height:38px!important}
}

/* Tablet landscape: floating floor control rail in unused right-side space */
@media (pointer:coarse) and (min-width:701px) and (max-width:1400px) and (orientation:landscape){
  .content.view-floor .v2-map-toolbar{
    position:absolute!important;
    top:10px!important;
    right:10px!important;
    z-index:1600!important;
    width:128px!important;
    min-height:0!important;
    margin:0!important;
    padding:6px!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    gap:5px!important;
    border-radius:11px!important;
    background:rgba(244,247,239,.96)!important;
    border:1px solid #aebfad!important;
    box-shadow:0 8px 22px rgba(18,48,38,.18)!important;
    backdrop-filter:blur(5px)!important;
    overflow:visible!important;
  }
  .content.view-floor .v2-map-left{
    width:100%!important;
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:4px!important;
  }
  .content.view-floor .v2-map-left label{display:grid!important;gap:2px!important;min-width:0!important;font-size:7px!important;color:#64766c!important}
  .content.view-floor .v2-map-left select{width:100%!important;min-width:0!important;height:28px!important;padding:2px 14px 2px 4px!important;font-size:8px!important;border-radius:6px!important}
  .content.view-floor .v2-campus-pill,.content.view-floor .v2-build,.content.view-floor .ol-story-status{display:none!important}
  .content.view-floor .v2-map-right{
    width:100%!important;
    display:grid!important;
    grid-template-columns:30px 30px 1fr!important;
    gap:4px!important;
  }
  .content.view-floor .v2-map-right button{
    width:30px!important;min-width:30px!important;height:29px!important;min-height:29px!important;
    padding:0!important;font-size:12px!important;border-radius:6px!important;
  }
  .content.view-floor .v2-zoom-label{
    grid-column:3!important;grid-row:1!important;
    min-width:0!important;height:29px!important;
    display:flex!important;align-items:center!important;justify-content:center!important;
    font-size:8px!important;border:1px solid #c5d1c2!important;background:#fffef8!important;border-radius:6px!important;
  }
  .content.view-floor [data-v2-zoom="out"]{grid-column:1!important;grid-row:1!important}
  .content.view-floor [data-v2-zoom="in"]{grid-column:2!important;grid-row:1!important}
  .content.view-floor .v2-fit{grid-column:1 / span 2!important;grid-row:2!important;width:auto!important;min-width:0!important;font-size:8px!important}
  .content.view-floor [data-v2-fullscreen]{display:flex!important;grid-column:3!important;grid-row:2!important}
  .content.view-floor .ol-move-staff{
    display:flex!important;grid-column:1 / -1!important;grid-row:3!important;width:100%!important;min-width:0!important;
    height:29px!important;font-size:8px!important;justify-content:center!important;
  }
  .content.view-floor .ol-move-hint{top:10px!important;right:144px!important;left:auto!important;max-width:270px!important;font-size:8px!important;padding:6px 8px!important}
}

/* Tablet portrait Messages: inbox -> thread */
@media (pointer:coarse) and (min-width:701px) and (max-width:1000px) and (orientation:portrait){
  #office-message-center .dm-layout{display:block!important;overflow:hidden!important}
  #office-message-center .dm-list{width:100%!important;height:100%!important;border:0!important}
  #office-message-center .dm-conversation{display:none!important;height:100%!important}
  #office-message-center.dm-mobile-thread-open .dm-list{display:none!important}
  #office-message-center.dm-mobile-thread-open .dm-conversation{display:flex!important}
}

/* =========================
   PHONE <= 700
   ========================= */
@media (max-width:700px){
  html,body,#app{width:100%!important;height:100dvh!important;min-height:100dvh!important;max-height:100dvh!important;overflow:hidden!important}
  body{overscroll-behavior:none!important}
  .shell{display:flex!important;flex-direction:column!important;height:100dvh!important;min-height:0!important;overflow:hidden!important}
  .shell>main{order:1!important;flex:1 1 auto!important;height:auto!important;min-height:0!important;overflow:hidden!important}

  /* Bottom navigation */
  .sidebar{
    order:2!important;
    position:static!important;
    width:100%!important;
    height:calc(58px + env(safe-area-inset-bottom,0px))!important;
    min-height:calc(58px + env(safe-area-inset-bottom,0px))!important;
    display:grid!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    gap:3px!important;
    padding:4px 5px max(4px,env(safe-area-inset-bottom,0px))!important;
    overflow:visible!important;
    box-shadow:0 -4px 18px rgba(10,39,30,.22)!important;
    z-index:3500!important;
  }
  .sidebar .logo,.sidebar .v2-nav-section,.sidebar .footer,.sidebar>button{display:none!important}
  .sidebar>button[data-view="floor"],.sidebar>button[data-view="projects"],.sidebar>button[data-view="people"],.sidebar>#dm-nav,.sidebar>#mobile-more-nav{
    display:flex!important;
    width:100%!important;min-width:0!important;height:50px!important;min-height:50px!important;
    flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:1px!important;
    padding:3px 2px!important;border-radius:9px!important;
  }
  .sidebar .v2-nav-icon{display:block!important;width:auto!important;font-size:18px!important;line-height:18px!important}
  .sidebar .v2-nav-label{display:block!important;width:100%!important;font-size:8px!important;line-height:10px!important;text-align:center!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  .sidebar #dm-nav .dm-count{position:absolute!important;top:1px!important;right:12%!important;margin:0!important}
  #mobile-more-nav{position:relative!important}
  body.mobile-keyboard-open .sidebar{display:none!important}

  /* Phone HUD */
  header.topbar{min-height:43px!important;height:43px!important;padding:3px 5px!important;gap:3px!important;overflow:hidden!important}
  header.topbar>div:first-child,header.topbar .ol-player-greeting{display:none!important}
  header.topbar .toolbar{width:100%!important;margin:0!important;display:flex!important;align-items:center!important;gap:3px!important;flex-wrap:nowrap!important;overflow:hidden!important}
  header.topbar .toolbar>select,header.topbar .toolbar>.badge,header.topbar .v2-hud-stat{display:none!important}
  header.topbar .v2-hud-stat.v2-cash{
    display:grid!important;width:84px!important;min-width:84px!important;height:36px!important;padding:3px 5px!important;
    grid-template-columns:22px 1fr!important;column-gap:4px!important;border-radius:8px!important;
  }
  header.topbar .v2-cash .v2-hud-icon{width:22px!important;height:22px!important;font-size:12px!important}
  header.topbar .v2-cash strong{font-size:10px!important}
  header.topbar .v2-cash small{font-size:6px!important}
  header.topbar .game-calendar{display:none!important}
  header.topbar .game-time-tab{flex:0 0 60px!important;width:60px!important;min-width:60px!important;height:36px!important;min-height:36px!important;font-size:9px!important}
  header.topbar .v2-hud-actions{margin-left:auto!important;gap:3px!important;padding:0!important}
  header.topbar .v2-hud-actions button{width:34px!important;min-width:34px!important;height:34px!important;min-height:34px!important;padding:0!important;font-size:10px!important}
  header.topbar .v2-hud-actions .v2-next-day{display:none!important}
  header.topbar .v2-hud-actions [data-enh-auto]{display:inline-flex!important;width:46px!important;min-width:46px!important;font-size:0!important}
  header.topbar .v2-hud-actions [data-enh-auto]::after{content:"Auto";font-size:8px!important}

  /* General phone pages */
  .content{min-height:0!important;padding:8px!important;overflow:auto!important;-webkit-overflow-scrolling:touch!important}
  .content:not(.view-floor) .heading{align-items:flex-start!important;gap:7px!important;margin-bottom:9px!important}
  .content:not(.view-floor) .heading h2{font-size:18px!important}
  .panel{border-radius:10px!important;padding:10px!important}
  #people-grid,.people-grid,.grid,.financial,.setup-grid{grid-template-columns:1fr!important}

  /* Phone floor */
  .content.view-floor{position:relative!important;flex:1!important;min-height:0!important;overflow:hidden!important;padding:4px!important;gap:4px!important}
  .content.view-floor>.heading,.content.view-floor>.life-bar,.content.view-floor .v2-bottom-info{display:none!important}
  .content.view-floor .v2-map-toolbar{
    flex:0 0 auto!important;
    width:100%!important;
    min-height:40px!important;
    padding:3px 4px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:4px!important;
    border-radius:9px!important;
    overflow:hidden!important;
  }
  .content.view-floor .v2-map-left{display:flex!important;align-items:center!important;gap:3px!important;min-width:0!important;flex:0 0 auto!important}
  .content.view-floor .v2-map-left label{font-size:0!important;min-width:0!important}
  .content.view-floor .v2-map-left label:nth-child(2),.content.view-floor .v2-campus-pill,.content.view-floor .v2-build,.content.view-floor .ol-story-status{display:none!important}
  .content.view-floor .v2-map-left select{width:58px!important;min-width:58px!important;height:32px!important;padding:3px 14px 3px 5px!important;font-size:9px!important;border-radius:6px!important}
  .content.view-floor .v2-map-right{display:flex!important;align-items:center!important;gap:3px!important;min-width:0!important}
  .content.view-floor .v2-map-right button{
    width:31px!important;min-width:31px!important;height:31px!important;min-height:31px!important;
    padding:0!important;font-size:11px!important;border-radius:6px!important;
  }
  .content.view-floor .v2-zoom-label{min-width:32px!important;font-size:8px!important}
  .content.view-floor .v2-fit{width:34px!important;min-width:34px!important;font-size:8px!important}
  .content.view-floor [data-v2-fullscreen]{display:none!important}
  .content.view-floor .ol-move-staff{
    display:flex!important;width:31px!important;min-width:31px!important;font-size:0!important;justify-content:center!important;
  }
  .content.view-floor .ol-move-staff::before{content:"✋";font-size:12px!important}
  .view-floor .floor-layout,.view-floor .floor-layout.v2-selected,.view-floor .floor-layout.has-employee{
    position:relative!important;display:block!important;flex:1 1 auto!important;min-height:0!important;height:auto!important;overflow:hidden!important;
  }
  .view-floor .floor-layout>div:first-child{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;min-height:0!important}
  .view-floor .floor-scroll{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;min-height:0!important;max-height:none!important;overflow:auto!important;padding:2px!important;border-radius:9px!important}
  .view-floor aside.profile,.view-floor .floor-layout.has-employee>aside.profile,.view-floor .floor-layout.v2-selected>aside.profile{
    position:absolute!important;left:4px!important;right:4px!important;bottom:4px!important;top:auto!important;
    width:auto!important;height:min(70%,540px)!important;max-height:calc(100% - 8px)!important;
    z-index:2200!important;overflow:auto!important;padding:10px!important;border-radius:16px 16px 8px 8px!important;
    box-shadow:0 -10px 28px rgba(15,39,31,.30)!important;
  }
  .view-floor .floor-layout:not(.v2-selected):not(.has-employee)>aside.profile{display:none!important}
  .view-floor .profile-header{position:sticky!important;top:-10px!important;z-index:8!important;background:inherit!important;padding:8px 36px 7px 0!important;margin-top:-8px!important}
  .view-floor .close-profile{top:8px!important;right:0!important;width:34px!important;height:34px!important;min-width:34px!important;font-size:20px!important}
  .view-floor .profile .chat-log{min-height:170px!important;font-size:12px!important}
  .view-floor .chat-form{position:sticky!important;bottom:-10px!important;z-index:7!important;padding:7px 0 max(7px,env(safe-area-inset-bottom,0px))!important}
  .view-floor .chat-form textarea{min-height:48px!important;font-size:16px!important}

  /* Phone Messages */
  #office-message-center.dm-center{inset:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;height:100dvh!important;max-height:100dvh!important}
  #office-message-center .dm-shell>header{
    min-height:82px!important;padding:6px 7px!important;
    display:grid!important;grid-template-columns:minmax(0,1fr) 36px!important;grid-template-rows:34px 38px!important;gap:4px!important;
  }
  #office-message-center .dm-shell>header>div:first-child{grid-column:1!important;grid-row:1!important}
  #office-message-center .dm-shell>header small{display:none!important}
  #office-message-center .dm-shell>header h2{font-size:17px!important;margin:0!important}
  #office-message-center #dm-close{grid-column:2!important;grid-row:1!important;width:36px!important;height:36px!important;min-width:36px!important}
  #office-message-center .ol-message-tools{
    grid-column:1 / -1!important;grid-row:2!important;
    display:grid!important;grid-template-columns:minmax(0,1fr) 96px!important;gap:5px!important;width:100%!important;margin:0!important;
  }
  #office-message-center .ol-message-search{min-width:0!important;height:34px!important;padding:0 7px!important}
  #office-message-center .ol-message-search input{font-size:16px!important}
  #office-message-center .ol-message-tools select{width:96px!important;min-width:96px!important;height:34px!important;font-size:10px!important}
  #office-message-center .dm-bulkbar,#office-message-center .dm-thread-select{display:none!important}
  #office-message-center .dm-layout{display:block!important;min-height:0!important;overflow:hidden!important}
  #office-message-center .dm-list{width:100%!important;height:100%!important;max-height:none!important;overflow:auto!important;border:0!important}
  #office-message-center .dm-conversation{display:none!important;height:100%!important;min-height:0!important}
  #office-message-center.dm-mobile-thread-open .dm-list{display:none!important}
  #office-message-center.dm-mobile-thread-open .dm-conversation{display:flex!important}
  #office-message-center .dm-thread,#office-message-center .dm-thread.dm-bulk-ready{grid-template-columns:48px minmax(0,1fr) auto!important;min-height:66px!important;padding:7px 8px!important}
  #office-message-center .dm-avatar{width:46px!important;height:46px!important}
  #office-message-center .dm-mobile-back{
    flex:0 0 38px!important;display:flex!important;align-items:center!important;gap:5px!important;
    min-height:38px!important;padding:5px 8px!important;border:0!important;border-bottom:1px solid #d6dfd2!important;
    border-radius:0!important;background:#f2f6ee!important;color:#315548!important;box-shadow:none!important;font-size:12px!important;font-weight:750!important;
  }
  #office-message-center .dm-person{min-height:58px!important;max-height:64px!important;padding:5px 8px!important;gap:7px!important}
  #office-message-center .dm-profile{width:46px!important;height:46px!important}
  #office-message-center .dm-person h3{font-size:15px!important;margin:0!important}
  #office-message-center .dm-person p{font-size:8px!important;margin:0!important}
  #office-message-center .dm-person small,#office-message-center .employee-demo,#office-message-center .ol-person-stats{display:none!important}
  #office-message-center .delete-thread{margin-left:auto!important;padding:4px 6px!important;font-size:7px!important}
  #office-message-center .dm-log{padding:8px!important;min-height:0!important}
  #office-message-center .dm-msg{max-width:90%!important;padding:7px 8px!important;margin-bottom:6px!important}
  #office-message-center .dm-msg p{font-size:12px!important;line-height:1.4!important}
  #office-message-center .dm-reply{grid-template-columns:minmax(0,1fr) auto!important;gap:5px!important;padding:6px 7px max(6px,env(safe-area-inset-bottom,0px))!important}
  #office-message-center .dm-reply textarea{font-size:16px!important;min-height:42px!important;height:42px!important}
  #office-message-center .dm-reply button{min-width:58px!important;height:42px!important;min-height:42px!important}

  /* More sheet */
  #mobile-more-sheet{
    position:fixed;inset:0;z-index:7000;display:none;align-items:flex-end;
    background:rgba(7,25,19,.46);padding:10px 7px calc(68px + env(safe-area-inset-bottom,0px));
  }
  #mobile-more-sheet.open{display:flex}
  .mobile-more-panel{width:100%;max-height:min(72dvh,600px);overflow:auto;background:#fffef8;border:1px solid #ced8cd;border-radius:18px;box-shadow:0 18px 55px rgba(9,34,26,.32);padding:9px}
  .mobile-more-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:3px 3px 8px}
  .mobile-more-head small{display:block;color:#74857c;font-size:9px}.mobile-more-head strong{display:block;color:#173d31;font-size:15px}
  .mobile-more-head button{width:38px!important;height:38px!important;min-width:38px!important;padding:0!important;border-radius:50%!important;font-size:20px!important}
  .mobile-more-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  .mobile-more-grid button{min-height:50px!important;display:flex!important;align-items:center!important;gap:8px!important;padding:7px 9px!important;border-radius:10px!important;text-align:left!important}
  .mobile-more-grid .v2-nav-icon{font-size:16px!important}.mobile-more-grid .v2-nav-label{display:block!important;font-size:11px!important;white-space:normal!important}
}

/* Narrow phones */
@media (max-width:390px){
  header.topbar .v2-hud-stat.v2-cash{width:76px!important;min-width:76px!important}
  header.topbar .game-time-tab{width:54px!important;min-width:54px!important}
  header.topbar .v2-hud-actions [data-enh-auto]{width:42px!important;min-width:42px!important}
  .content.view-floor .v2-map-left select{width:52px!important;min-width:52px!important}
  .content.view-floor .v2-map-right button{width:29px!important;min-width:29px!important}
  .content.view-floor .v2-zoom-label{min-width:29px!important}
}

@media (pointer:coarse) and (min-width:701px) and (max-width:1000px) and (orientation:portrait){
  #office-message-center .dm-mobile-back{
    flex:0 0 38px!important;
    display:flex!important;
    align-items:center!important;
    gap:5px!important;
    min-height:38px!important;
    padding:5px 8px!important;
    border:0!important;
    border-bottom:1px solid #d6dfd2!important;
    border-radius:0!important;
    background:#f2f6ee!important;
    color:#315548!important;
    box-shadow:none!important;
    font-size:11px!important;
    font-weight:750!important;
  }
}


/* Screenshot refinement v8 — tablet control rail, metadata strip, mobile swipe nav. */

/* ---------- TABLET ---------- */
@media (pointer:coarse) and (min-width:701px) and (max-width:1400px){
  /* Give the date and Auto controls fixed breathing room. */
  body.office-v2 header.topbar .v2-hud-stat{
    min-width:76px!important;
    max-width:96px!important;
  }
  body.office-v2 header.topbar .game-calendar{
    flex:0 0 176px!important;
    width:176px!important;
    min-width:176px!important;
    max-width:176px!important;
    padding:5px 8px!important;
    text-align:center!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }
  body.office-v2 header.topbar .game-time-tab{
    flex:0 0 80px!important;
    width:80px!important;
    min-width:80px!important;
  }
  body.office-v2 header.topbar .v2-hud-actions [data-enh-auto]{
    display:inline-flex!important;
    flex:0 0 58px!important;
    width:58px!important;
    min-width:58px!important;
    max-width:58px!important;
    height:36px!important;
    padding:0 6px!important;
    align-items:center!important;
    justify-content:center!important;
    font-size:8px!important;
    line-height:1!important;
    white-space:nowrap!important;
    overflow:hidden!important;
  }

  /* Message employee header: keep ALL useful info horizontally instead of hiding it. */
  body.office-v2 #office-message-center .dm-person{
    min-height:62px!important;
    max-height:74px!important;
    padding:6px 8px!important;
    display:grid!important;
    grid-template-columns:46px minmax(0,1fr) auto!important;
    align-items:center!important;
    gap:8px!important;
    overflow:hidden!important;
  }
  body.office-v2 #office-message-center .dm-profile{
    width:44px!important;
    height:44px!important;
    border-radius:9px!important;
  }
  body.office-v2 #office-message-center .dm-person-info{
    min-width:0!important;
    display:flex!important;
    align-items:center!important;
    gap:5px!important;
    flex-wrap:wrap!important;
    align-content:center!important;
  }
  body.office-v2 #office-message-center .dm-person-title{
    display:flex!important;
    align-items:center!important;
    gap:5px!important;
    min-width:0!important;
    white-space:nowrap!important;
  }
  body.office-v2 #office-message-center .dm-person h3{
    margin:0!important;
    font-size:15px!important;
    line-height:1!important;
    white-space:nowrap!important;
  }
  body.office-v2 #office-message-center .dm-person .employee-demo{
    display:inline-flex!important;
    align-items:center!important;
    margin:0!important;
    padding:2px 5px!important;
    border:1px solid #d8dfd6!important;
    border-radius:999px!important;
    background:#f1f6ed!important;
    color:#66766d!important;
    font-size:7px!important;
    line-height:1.1!important;
    white-space:nowrap!important;
  }
  body.office-v2 #office-message-center .dm-person-meta{
    display:flex!important;
    align-items:center!important;
    gap:4px!important;
    min-width:0!important;
  }
  body.office-v2 #office-message-center .dm-person-meta p{
    margin:0!important;
    max-width:210px!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    font-size:8px!important;
  }
  body.office-v2 #office-message-center .dm-person-date{
    display:inline-flex!important;
    align-items:center!important;
    margin:0!important;
    padding:2px 5px!important;
    border-radius:999px!important;
    background:#edf3e9!important;
    color:#6c7b72!important;
    font-size:7px!important;
    line-height:1.1!important;
    white-space:nowrap!important;
  }
  body.office-v2 #office-message-center .dm-person-info>.ol-person-stats{
    display:flex!important;
    align-items:center!important;
    gap:3px!important;
    margin:0!important;
    flex:0 1 auto!important;
    min-width:0!important;
    flex-wrap:nowrap!important;
  }
  body.office-v2 #office-message-center .dm-person-info>.ol-person-stats span{
    display:inline-flex!important;
    align-items:center!important;
    margin:0!important;
    padding:2px 4px!important;
    border-radius:999px!important;
    font-size:6.5px!important;
    line-height:1.1!important;
    white-space:nowrap!important;
  }
  body.office-v2 #office-message-center .delete-thread{
    margin:0!important;
    align-self:center!important;
    min-height:28px!important;
    max-width:96px!important;
    padding:4px 6px!important;
    font-size:7px!important;
    line-height:1.1!important;
  }
}

@media (pointer:coarse) and (min-width:701px) and (max-width:1400px) and (orientation:landscape){
  /* Rebuild the floating right-side office rail into predictable rows. */
  body.office-v2 .content.view-floor .v2-map-toolbar{
    width:148px!important;
    box-sizing:border-box!important;
    padding:7px!important;
    gap:6px!important;
  }
  body.office-v2 .content.view-floor .v2-map-left{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:5px!important;
    width:100%!important;
  }
  body.office-v2 .content.view-floor .v2-map-left label{
    display:grid!important;
    gap:2px!important;
    min-width:0!important;
    font-size:7px!important;
    overflow:hidden!important;
  }
  body.office-v2 .content.view-floor .v2-map-left select{
    width:100%!important;
    min-width:0!important;
    height:29px!important;
    padding:2px 15px 2px 5px!important;
    font-size:8px!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  body.office-v2 .content.view-floor .v2-map-right{
    width:100%!important;
    display:grid!important;
    grid-template-columns:32px minmax(0,1fr) 32px!important;
    grid-auto-rows:30px!important;
    gap:5px!important;
    align-items:stretch!important;
    overflow:visible!important;
  }
  body.office-v2 .content.view-floor .v2-map-right button{
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
    height:30px!important;
    min-height:30px!important;
    padding:0!important;
    font-size:11px!important;
    line-height:30px!important;
    overflow:hidden!important;
  }
  body.office-v2 .content.view-floor .v2-map-right [data-v2-zoom="out"]{
    grid-column:1!important;grid-row:1!important;
  }
  body.office-v2 .content.view-floor .v2-map-right .v2-zoom-label{
    grid-column:2!important;grid-row:1!important;
    width:100%!important;
    min-width:0!important;
    height:30px!important;
    box-sizing:border-box!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    font-size:8px!important;
  }
  body.office-v2 .content.view-floor .v2-map-right [data-v2-zoom="in"]{
    grid-column:3!important;grid-row:1!important;
  }
  body.office-v2 .content.view-floor .v2-map-right .v2-fit{
    grid-column:1 / span 2!important;
    grid-row:2!important;
    font-size:8px!important;
  }
  body.office-v2 .content.view-floor .v2-map-right [data-v2-fullscreen]{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    grid-column:3!important;
    grid-row:2!important;
  }
  body.office-v2 .content.view-floor .v2-map-right #ol-move-staff-btn{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    grid-column:1 / -1!important;
    grid-row:3!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:30px!important;
    padding:0 5px!important;
    font-size:8px!important;
    line-height:1!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
}

/* ---------- PHONE ---------- */
@media (max-width:700px){
  /* Make the bottom app bar a real horizontal swipe rail. */
  body.office-v2 .sidebar{
    order:2!important;
    position:static!important;
    display:flex!important;
    flex-direction:row!important;
    align-items:stretch!important;
    justify-content:flex-start!important;
    gap:3px!important;
    width:100%!important;
    height:calc(58px + env(safe-area-inset-bottom,0px))!important;
    min-height:calc(58px + env(safe-area-inset-bottom,0px))!important;
    padding:4px 5px max(4px,env(safe-area-inset-bottom,0px))!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior-x:contain!important;
    touch-action:pan-x!important;
    scroll-snap-type:x proximity!important;
    scrollbar-width:none!important;
  }
  body.office-v2 .sidebar::-webkit-scrollbar{display:none!important}
  body.office-v2 .sidebar .logo,
  body.office-v2 .sidebar .v2-nav-section,
  body.office-v2 .sidebar .footer,
  body.office-v2 #tablet-sidebar-toggle{display:none!important}

  body.office-v2 .sidebar>button,
  body.office-v2 .sidebar>button[data-view],
  body.office-v2 .sidebar>#dm-nav,
  body.office-v2 .sidebar>#wl-approvals-nav,
  body.office-v2 .sidebar>#mobile-more-nav{
    display:flex!important;
    flex:0 0 74px!important;
    width:74px!important;
    min-width:74px!important;
    max-width:74px!important;
    height:50px!important;
    min-height:50px!important;
    padding:3px 4px!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    gap:1px!important;
    scroll-snap-align:start!important;
    overflow:hidden!important;
  }
  body.office-v2 .sidebar .v2-nav-icon{
    flex:0 0 auto!important;
    width:auto!important;
    min-width:0!important;
    font-size:17px!important;
    line-height:18px!important;
  }
  body.office-v2 .sidebar .v2-nav-label,
  body.office-v2 .sidebar .tablet-nav-toggle-label{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    font-size:8px!important;
    line-height:10px!important;
    text-align:center!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  body.office-v2 #mobile-more-nav{display:none!important}
  body.office-v2 #office-guide-fab{display:none!important}

  /* Auto button: remove the floating pseudo-label look. */
  body.office-v2 header.topbar .v2-hud-actions [data-enh-auto]{
    display:inline-flex!important;
    width:50px!important;
    min-width:50px!important;
    height:34px!important;
    padding:0 4px!important;
    font-size:8px!important;
    line-height:1!important;
    align-items:center!important;
    justify-content:center!important;
    white-space:nowrap!important;
    overflow:hidden!important;
  }
  body.office-v2 header.topbar .v2-hud-actions [data-enh-auto]::after{content:none!important}

  /* Phone floor toolbar: remove the hidden desktop controls that were bleeding over it. */
  body.office-v2 .content.view-floor .v2-map-toolbar{
    box-sizing:border-box!important;
    width:100%!important;
    max-width:100%!important;
    min-height:40px!important;
    overflow:hidden!important;
  }
  body.office-v2 .content.view-floor .v2-map-left{
    flex:0 0 54px!important;
    width:54px!important;
    min-width:54px!important;
    overflow:hidden!important;
  }
  body.office-v2 .content.view-floor .v2-map-left label:nth-child(2),
  body.office-v2 .content.view-floor .v2-campus-pill,
  body.office-v2 .content.view-floor .v2-build,
  body.office-v2 .content.view-floor .ol-story-status{
    display:none!important;
  }
  body.office-v2 .content.view-floor .v2-map-left label:first-child,
  body.office-v2 .content.view-floor .v2-map-left label:first-child select{
    display:block!important;
    width:54px!important;
    min-width:54px!important;
    max-width:54px!important;
  }
  body.office-v2 .content.view-floor .v2-map-right{
    flex:1 1 auto!important;
    min-width:0!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
    gap:3px!important;
    overflow:hidden!important;
  }
  body.office-v2 .content.view-floor .v2-map-right button{
    flex:0 0 29px!important;
    width:29px!important;
    min-width:29px!important;
    max-width:29px!important;
    height:30px!important;
    min-height:30px!important;
    padding:0!important;
    font-size:10px!important;
    overflow:hidden!important;
  }
  body.office-v2 .content.view-floor .v2-map-right .v2-zoom-label{
    flex:0 0 30px!important;
    width:30px!important;
    min-width:30px!important;
    font-size:8px!important;
  }
  body.office-v2 .content.view-floor .v2-map-right .v2-fit{
    flex-basis:33px!important;
    width:33px!important;
    min-width:33px!important;
    max-width:33px!important;
    font-size:8px!important;
  }
  body.office-v2 .content.view-floor .v2-map-right [data-v2-fullscreen]{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
  }
  body.office-v2 .content.view-floor .v2-map-right #ol-move-staff-btn{
    display:flex!important;
    flex:0 0 31px!important;
    width:31px!important;
    min-width:31px!important;
    max-width:31px!important;
    height:30px!important;
    padding:0!important;
    font-size:0!important;
    align-items:center!important;
    justify-content:center!important;
    overflow:hidden!important;
  }
  body.office-v2 .content.view-floor .v2-map-right #ol-move-staff-btn::first-letter{font-size:0!important}
  body.office-v2 .content.view-floor .v2-map-right #ol-move-staff-btn::after{
    content:"✋";
    font-size:12px!important;
    line-height:1!important;
  }

  /* Compact employee bottom sheet so chat gets more vertical room. */
  body.office-v2 .view-floor aside.profile,
  body.office-v2 .view-floor .floor-layout.has-employee>aside.profile,
  body.office-v2 .view-floor .floor-layout.v2-selected>aside.profile{
    height:min(64%,500px)!important;
    padding:9px!important;
  }
  body.office-v2 .view-floor .profile-header{
    display:grid!important;
    grid-template-columns:72px minmax(0,1fr)!important;
    gap:10px!important;
    align-items:start!important;
    padding:7px 38px 7px 0!important;
  }
  body.office-v2 .view-floor .profile-header .portrait{
    width:72px!important;
    height:78px!important;
    margin:0!important;
  }
  body.office-v2 .view-floor .profile-header h3{
    font-size:18px!important;
    margin:0 0 2px!important;
  }
  body.office-v2 .view-floor .profile-header .employee-demo{
    margin:0 0 2px!important;
    font-size:9px!important;
  }
  body.office-v2 .view-floor .profile-header .ol-person-stats{
    gap:3px!important;
    margin-top:4px!important;
    flex-wrap:wrap!important;
  }
  body.office-v2 .view-floor .profile-header .ol-person-stats span{
    font-size:7px!important;
    padding:2px 4px!important;
  }
}

/* Very narrow phones: shave a little more width from floor controls. */
@media (max-width:390px){
  body.office-v2 .sidebar>button,
  body.office-v2 .sidebar>button[data-view],
  body.office-v2 .sidebar>#dm-nav,
  body.office-v2 .sidebar>#wl-approvals-nav{
    flex-basis:70px!important;
    width:70px!important;
    min-width:70px!important;
    max-width:70px!important;
  }
  body.office-v2 .content.view-floor .v2-map-left,
  body.office-v2 .content.view-floor .v2-map-left label:first-child,
  body.office-v2 .content.view-floor .v2-map-left label:first-child select{
    width:50px!important;
    min-width:50px!important;
    max-width:50px!important;
  }
  body.office-v2 .content.view-floor .v2-map-right button{
    flex-basis:27px!important;
    width:27px!important;
    min-width:27px!important;
    max-width:27px!important;
  }
  body.office-v2 .content.view-floor .v2-map-right .v2-zoom-label{
    flex-basis:27px!important;
    width:27px!important;
    min-width:27px!important;
  }
}

@media (pointer:coarse){
  /* Touch navigation already exposes Help; floating Guide only covers useful UI. */
  body.office-v2 #office-guide-fab{display:none!important}
}

@media (max-width:700px){
  /* Leave breathing room at the end of scrollable pages above the swipe nav. */
  body.office-v2 .content:not(.view-floor){
    padding-bottom:18px!important;
  }

  /* Make the swipe rail visually obvious at its edges. */
  body.office-v2 .sidebar{
    background:
      linear-gradient(90deg,#0f4a3a 0,#0f4a3a 96%,rgba(15,74,58,.15) 100%)!important;
  }

  /* Keep the employee chat sheet compact enough to see the floor behind it. */
  body.office-v2 .view-floor aside.profile .help{
    font-size:8px!important;
    margin:4px 0!important;
  }
  body.office-v2 .view-floor aside.profile .chat-log{
    min-height:140px!important;
    padding:7px!important;
  }
  body.office-v2 .view-floor aside.profile .chat-log p{
    padding:7px!important;
    margin:0 0 6px!important;
    font-size:11px!important;
    line-height:1.35!important;
  }
  body.office-v2 .view-floor aside.profile .chat-form{
    grid-template-columns:minmax(0,1fr) 58px!important;
    gap:5px!important;
  }
  body.office-v2 .view-floor aside.profile .chat-form textarea{
    min-height:42px!important;
    height:42px!important;
    padding:7px!important;
    font-size:15px!important;
  }
  body.office-v2 .view-floor aside.profile .chat-form button{
    min-width:58px!important;
    height:42px!important;
    padding:0 5px!important;
    font-size:11px!important;
  }
}

@media(max-width:700px){
  /* Employee floor chat: identity is a compact strip, conversation gets the room. */
  body.office-v2 .view-floor aside.profile,
  body.office-v2 .view-floor .floor-layout.has-employee>aside.profile,
  body.office-v2 .view-floor .floor-layout.v2-selected>aside.profile{
    height:min(72%,560px)!important;
    max-height:calc(100% - 8px)!important;
    display:flex!important;
    flex-direction:column!important;
    overflow:hidden!important;
    padding:8px!important;
  }
  body.office-v2 .view-floor aside.profile .profile-header{
    position:relative!important;
    top:auto!important;
    flex:0 0 auto!important;
    display:grid!important;
    grid-template-columns:48px minmax(0,1fr)!important;
    gap:7px!important;
    align-items:center!important;
    min-height:54px!important;
    padding:3px 36px 6px 1px!important;
    margin:0!important;
    border-bottom:1px solid #d8dfd4!important;
  }
  body.office-v2 .view-floor aside.profile .profile-header .portrait{
    width:46px!important;
    height:50px!important;
    min-width:46px!important;
    margin:0!important;
    border-radius:9px!important;
  }
  body.office-v2 .view-floor aside.profile .profile-header h3{
    margin:0 0 2px!important;
    font-size:15px!important;
    line-height:1.05!important;
  }
  body.office-v2 .view-floor aside.profile .profile-header small{
    display:block!important;
    margin:0!important;
    font-size:8px!important;
    line-height:1.25!important;
  }
  body.office-v2 .view-floor aside.profile .profile-header .ol-person-stats{
    display:flex!important;
    gap:3px!important;
    margin:3px 0 0!important;
    padding:0 0 2px!important;
    flex-wrap:nowrap!important;
    overflow-x:auto!important;
    scrollbar-width:none!important;
  }
  body.office-v2 .view-floor aside.profile .profile-header .ol-person-stats::-webkit-scrollbar{display:none!important}
  body.office-v2 .view-floor aside.profile .profile-header .ol-person-stats span{
    flex:0 0 auto!important;
    padding:2px 4px!important;
    font-size:6.5px!important;
    line-height:1.1!important;
    white-space:nowrap!important;
  }
  body.office-v2 .view-floor aside.profile .close-profile{
    top:5px!important;
    right:3px!important;
    width:31px!important;
    height:31px!important;
    min-width:31px!important;
    font-size:19px!important;
  }

  body.office-v2 .view-floor aside.profile .employee-details{
    flex:0 0 auto!important;
    margin:5px 0!important;
  }
  body.office-v2 .view-floor aside.profile .employee-details>summary{
    padding:5px 7px!important;
    font-size:8px!important;
  }
  body.office-v2 .view-floor aside.profile .ceo-directive-box,
  body.office-v2 .view-floor aside.profile .conduct-pressure-card{
    flex:0 0 auto!important;
    margin:4px 0!important;
    padding:6px!important;
  }
  body.office-v2 .view-floor aside.profile .ceo-directive-head{margin-bottom:4px!important}
  body.office-v2 .view-floor aside.profile .ceo-directive-head strong{font-size:10px!important}
  body.office-v2 .view-floor aside.profile .ceo-directive-head>span{font-size:7px!important;padding:2px 4px!important}
  body.office-v2 .view-floor aside.profile .ceo-directive-active{margin:3px 0!important;gap:3px!important}
  body.office-v2 .view-floor aside.profile .ceo-directive-active span{font-size:7px!important;padding:2px 4px!important}
  body.office-v2 .view-floor aside.profile .ceo-directive-actions,
  body.office-v2 .view-floor aside.profile .ceo-project-assign{
    gap:4px!important;
  }
  body.office-v2 .view-floor aside.profile .ceo-directive-actions button,
  body.office-v2 .view-floor aside.profile .ceo-project-assign button,
  body.office-v2 .view-floor aside.profile .ceo-cancel-directives{
    min-height:26px!important;
    padding:3px 5px!important;
    font-size:7px!important;
  }
  body.office-v2 .view-floor aside.profile>.help{
    flex:0 0 auto!important;
    margin:2px 0 4px!important;
    font-size:7px!important;
    line-height:1.2!important;
  }

  body.office-v2 .view-floor aside.profile .chat-log{
    flex:1 1 220px!important;
    min-height:180px!important;
    max-height:none!important;
    overflow:auto!important;
    padding:7px!important;
    margin:0!important;
    border-radius:9px!important;
  }
  body.office-v2 .view-floor aside.profile .chat-log p{
    max-width:94%!important;
    padding:8px 9px!important;
    margin:0 0 7px!important;
    font-size:12px!important;
    line-height:1.42!important;
    border-radius:10px!important;
  }
  body.office-v2 .view-floor aside.profile .chat-log p b{
    font-size:9px!important;
  }
  body.office-v2 .view-floor aside.profile .chat-form{
    position:static!important;
    flex:0 0 48px!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 58px!important;
    gap:5px!important;
    padding:5px 0 0!important;
    margin:0!important;
    background:inherit!important;
  }
  body.office-v2 .view-floor aside.profile .chat-form textarea{
    min-height:43px!important;
    height:43px!important;
    max-height:43px!important;
    padding:7px 8px!important;
    font-size:14px!important;
    line-height:1.25!important;
  }
  body.office-v2 .view-floor aside.profile .chat-form button{
    min-width:58px!important;
    height:43px!important;
    min-height:43px!important;
    padding:0 5px!important;
    font-size:10px!important;
  }
}


/* Mobile regression fix v12 — reachable floor chat + visible Messages portraits. */
@media (max-width:700px){
  /* Direct refined SVG portraits must explicitly fill their boxes on Android Chrome. */
  body.office-v2 #office-message-center .dm-profile>svg,
  body.office-v2 #office-message-center .dm-avatar>svg,
  body.office-v2 #office-message-center .dm-profile .dm-vector,
  body.office-v2 #office-message-center .dm-avatar .dm-vector,
  body.office-v2 #office-message-center .dm-profile .dm-vector>svg,
  body.office-v2 #office-message-center .dm-avatar .dm-vector>svg{
    display:block!important;
    width:100%!important;
    height:100%!important;
    min-width:100%!important;
    min-height:100%!important;
    max-width:100%!important;
    max-height:100%!important;
  }
  body.office-v2 #office-message-center .dm-profile,
  body.office-v2 #office-message-center .dm-avatar{
    overflow:hidden!important;
  }

  /* The entire employee panel scrolls; fixed management sections can no longer trap chat below the fold. */
  body.office-v2 .view-floor aside.profile,
  body.office-v2 .view-floor .floor-layout.has-employee>aside.profile,
  body.office-v2 .view-floor .floor-layout.v2-selected>aside.profile{
    display:block!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior:contain!important;
    touch-action:pan-y!important;
    scroll-padding-bottom:72px!important;
    padding:8px 8px calc(12px + env(safe-area-inset-bottom,0px))!important;
  }

  body.office-v2 .view-floor aside.profile .profile-header{
    position:relative!important;
    top:auto!important;
    z-index:2!important;
    margin:0!important;
  }

  /* Let conversation history grow naturally inside the sheet instead of creating a second trapped scroller. */
  body.office-v2 .view-floor aside.profile .chat-log{
    display:block!important;
    min-height:180px!important;
    max-height:none!important;
    height:auto!important;
    overflow:visible!important;
    margin-bottom:6px!important;
  }

  /* Keep Send reachable while the profile itself scrolls. */
  body.office-v2 .view-floor aside.profile .chat-form{
    position:sticky!important;
    left:0!important;
    right:0!important;
    bottom:-8px!important;
    z-index:20!important;
    margin:0!important;
    padding:6px 0 max(6px,env(safe-area-inset-bottom,0px))!important;
    background:#fffef8!important;
    box-shadow:0 -6px 14px rgba(24,52,41,.08)!important;
  }
  html[data-office-theme="dark"] body.office-v2 .view-floor aside.profile .chat-form{
    background:#17241f!important;
  }
}


/* Touch inbox bulk controls — restore selection + delegation without crowding conversations. */
@media (pointer:coarse) and (min-width:701px) and (max-width:1400px){
  body.office-v2 #office-message-center .dm-bulkbar{
    display:flex!important;
    flex:0 0 38px!important;
    min-height:38px!important;
    max-height:38px!important;
    align-items:center!important;
    flex-wrap:nowrap!important;
    gap:5px!important;
    padding:4px 7px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    scrollbar-width:none!important;
    background:#f3f6ee!important;
  }
  body.office-v2 #office-message-center .dm-bulkbar::-webkit-scrollbar{display:none!important}
  body.office-v2 #office-message-center .dm-bulkbar .dm-bulk-spacer{display:none!important}
  body.office-v2 #office-message-center .dm-bulkbar button{
    flex:0 0 auto!important;
    min-height:28px!important;
    height:28px!important;
    padding:4px 7px!important;
    margin:0!important;
    font-size:8px!important;
    white-space:nowrap!important;
  }
  body.office-v2 #office-message-center .dm-bulkbar strong{
    flex:0 0 auto!important;
    font-size:8px!important;
    white-space:nowrap!important;
  }
  body.office-v2 #office-message-center .dm-thread-select{
    display:grid!important;
    width:16px!important;
    height:16px!important;
    min-width:16px!important;
  }
  body.office-v2 #office-message-center .dm-thread.dm-bulk-ready{
    grid-template-columns:16px 40px minmax(0,1fr) auto!important;
    gap:5px!important;
  }
}

@media (max-width:700px){
  body.office-v2 #office-message-center:not(.dm-mobile-thread-open) .dm-bulkbar{
    display:flex!important;
    flex:0 0 38px!important;
    min-height:38px!important;
    max-height:38px!important;
    align-items:center!important;
    flex-wrap:nowrap!important;
    gap:5px!important;
    padding:4px 6px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior-x:contain!important;
    scrollbar-width:none!important;
    background:#f3f6ee!important;
  }
  body.office-v2 #office-message-center:not(.dm-mobile-thread-open) .dm-bulkbar::-webkit-scrollbar{display:none!important}
  body.office-v2 #office-message-center.dm-mobile-thread-open .dm-bulkbar{display:none!important}
  body.office-v2 #office-message-center .dm-bulkbar .dm-bulk-spacer{display:none!important}
  body.office-v2 #office-message-center .dm-bulkbar button{
    flex:0 0 auto!important;
    min-height:28px!important;
    height:28px!important;
    padding:4px 7px!important;
    margin:0!important;
    font-size:8px!important;
    white-space:nowrap!important;
  }
  body.office-v2 #office-message-center .dm-bulkbar strong{
    flex:0 0 auto!important;
    font-size:8px!important;
    white-space:nowrap!important;
  }
  body.office-v2 #office-message-center .dm-thread-select{
    display:grid!important;
    width:16px!important;
    height:16px!important;
    min-width:16px!important;
  }
  body.office-v2 #office-message-center .dm-thread.dm-bulk-ready{
    grid-template-columns:16px 44px minmax(0,1fr) auto!important;
    gap:5px!important;
  }
}
/* Five visible destinations; secondary sections remain reachable through More. */
@media(max-width:700px){
  html body.office-v2 .sidebar{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;overflow:hidden!important;gap:3px!important}
  html body.office-v2 .sidebar>button[data-view],
  html body.office-v2 .sidebar>#ai-director-nav,
  html body.office-v2 .sidebar>#wl-approvals-nav{display:none!important}
  html body.office-v2 .sidebar>button[data-view="floor"],
  html body.office-v2 .sidebar>button[data-view="projects"],
  html body.office-v2 .sidebar>button[data-view="people"],
  html body.office-v2 .sidebar>#dm-nav,
  html body.office-v2 .sidebar>#mobile-more-nav{display:flex!important;width:100%!important;min-width:0!important;max-width:none!important;min-height:44px!important}
  html body.office-v2 .sidebar .v2-nav-label{font-size:10px!important;line-height:12px!important}
  html body.office-v2 .view-floor .floor-scroll{justify-content:flex-start!important;align-items:flex-start!important}
}
/* Keep the floor and conversation beside each other at narrow desktop/tablet widths. */
@media(min-width:701px) and (max-width:1100px){
  html body.office-v2 .view-floor .floor-layout.v2-selected{grid-template-columns:minmax(0,1fr) minmax(280px,42%)!important;grid-template-rows:minmax(0,1fr)!important;min-height:0!important}
  html body.office-v2 .view-floor .floor-layout.v2-selected>div:first-child{height:100%!important;min-height:0!important}
  html body.office-v2 .view-floor .floor-layout.v2-selected>aside.profile{width:100%!important;max-width:none!important;height:100%!important;min-height:0!important}
}


/* Mobile People + chat keyboard stability v13. Desktop remains unchanged. */
@media(max-width:700px){
  body.office-v2 .view-people>.heading{margin-bottom:8px!important}
  body.office-v2 .view-people>.heading .muted{display:none!important}
  body.office-v2 .view-people .hiring-tools{
    position:static!important;display:grid!important;
    grid-template-columns:minmax(0,1fr) 112px!important;
    gap:8px!important;margin-bottom:10px!important;padding:10px!important;
    max-height:none!important;overflow:visible!important;
  }
  body.office-v2 .view-people .hiring-tools .ol-people-filter{
    grid-column:1/-1!important;display:grid!important;grid-template-columns:1fr!important;
    gap:5px!important;margin:0!important;padding:0 0 8px!important;
  }
  body.office-v2 .view-people .ol-people-filter-label{display:none!important}
  body.office-v2 .view-people .ol-people-filter-options{
    display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:5px!important;width:100%!important;
  }
  body.office-v2 .view-people .ol-people-filter-options button{
    min-width:0!important;min-height:42px!important;padding:5px 3px!important;
    font-size:11px!important;line-height:1.1!important;white-space:nowrap!important;
  }
  body.office-v2 .view-people .ol-people-filter-options button b{
    min-width:17px!important;height:17px!important;margin-left:2px!important;
    padding:0 3px!important;font-size:9px!important;
  }
  body.office-v2 .view-people .ol-floor-filter-label{
    width:100%!important;display:grid!important;
    grid-template-columns:auto minmax(0,1fr)!important;gap:7px!important;
  }
  body.office-v2 .view-people .ol-floor-filter-label select{max-width:none!important;width:100%!important}
  body.office-v2 .view-people .hiring-tools>button[data-action="refresh-candidates"]{
    grid-column:1/-1!important;width:100%!important;min-height:40px!important;
  }
  body.office-v2 .view-people .hiring-tools>label{min-width:0!important;width:100%!important}
  body.office-v2 .view-people .hiring-tools>label:has(#people-search){grid-column:1/-1!important}
  body.office-v2 .view-people .hiring-tools input,
  body.office-v2 .view-people .hiring-tools select{width:100%!important;min-width:0!important}
  body.office-v2 .view-people .hiring-tools>small{grid-column:1/-1!important;font-size:10px!important;line-height:1.3!important}
  body.mobile-keyboard-open #office-message-center .dm-person{display:none!important}
  body.mobile-keyboard-open #office-message-center .dm-reply{padding-bottom:max(6px,env(safe-area-inset-bottom,0px))!important}
}
