/* MORTX responsive header contract v1.0.337
   Grid standard: desktop 12 / tablet 8 / mobile 4.
   The mobile navigation toggle is a real header grid item instead of a floating control. */

/* Tablet: standard 8-column shell, desktop-style composition, one clean line.
   Nothing wraps or overlaps: flexible status/search rails absorb compression while
   controls keep predictable dimensions. Mobile rules remain isolated below. */
@media (min-width:641px) and (max-width:1180px){
  :root{
    --mortx-grid-columns:8;
    --mortx-grid-gap:10px;
    --mortx-tablet-control:40px;
    --mortx-tablet-gap:6px;
  }

  body.mortx-ui-shell #appProjectBrandHeader.mortx-header{
    overflow:visible!important;
  }
  body.mortx-ui-shell #appProjectBrandHeader .top-row{
    display:grid!important;
    grid-template-columns:repeat(8,minmax(0,1fr))!important;
    grid-template-rows:var(--mortx-tablet-control)!important;
    gap:var(--mortx-grid-gap)!important;
    align-items:center!important;
    width:100%!important;
    min-width:0!important;
    overflow:visible!important;
  }

  /* Tablet header contract: every interactive header control is exactly 40x40.
     Only status and search are fluid rails; they share the same 40px height. */

body.mortx-ui-shell #appProjectBrandHeader .header-work-mode-status{
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:var(--mortx-tablet-control)!important;
    min-height:var(--mortx-tablet-control)!important;
    max-height:var(--mortx-tablet-control)!important;
    padding:0 9px!important;
    margin:0!important;
    overflow:hidden!important;
  }

body.mortx-ui-shell #appProjectBrandHeader .header-work-mode-duration{flex:0 0 auto!important}

body.mortx-ui-shell #appProjectBrandHeader #workModeControls .work-mode-action{
    box-sizing:border-box!important;
    width:var(--mortx-tablet-control)!important;min-width:var(--mortx-tablet-control)!important;max-width:var(--mortx-tablet-control)!important;
    height:var(--mortx-tablet-control)!important;min-height:var(--mortx-tablet-control)!important;max-height:var(--mortx-tablet-control)!important;
    padding:0!important;margin:0!important;display:grid!important;place-items:center!important;
  }

body.mortx-ui-shell #appProjectBrandHeader .top-actions{
    grid-column:5 / -1!important;grid-row:1!important;display:block!important;
    width:100%!important;min-width:0!important;max-width:100%!important;
    height:var(--mortx-tablet-control)!important;margin:0!important;padding:0!important;overflow:visible!important;
  }
  body.mortx-ui-shell #appProjectBrandHeader .top-widget-group{
    display:flex!important;
    
    
    gap:var(--mortx-tablet-gap)!important;align-items:center!important;
    width:100%!important;min-width:0!important;max-width:100%!important;
    height:var(--mortx-tablet-control)!important;margin:0!important;padding:0!important;overflow:visible!important;
  }
  body.mortx-ui-shell #appProjectBrandHeader .global-task-search,
  body.mortx-ui-shell #appProjectBrandHeader .global-task-search-input-wrap,
  body.mortx-ui-shell #appProjectBrandHeader .global-task-search-input-wrap input{
    box-sizing:border-box!important;width:100%!important;min-width:0!important;max-width:none!important;
    height:var(--mortx-tablet-control)!important;min-height:var(--mortx-tablet-control)!important;max-height:var(--mortx-tablet-control)!important;
    margin:0!important;
  }
  body.mortx-ui-shell #appProjectBrandHeader .tag-notification-widget,
  body.mortx-ui-shell #appProjectBrandHeader .online-users-widget,
  body.mortx-ui-shell #appProjectBrandHeader .recurring-widget:not(.tag-notification-widget),
  body.mortx-ui-shell #appProjectBrandHeader .tag-notification-widget .recurring-toggle,
  body.mortx-ui-shell #appProjectBrandHeader .online-users-toggle,
  body.mortx-ui-shell #appProjectBrandHeader .recurring-widget:not(.tag-notification-widget) .recurring-toggle{
    box-sizing:border-box!important;
    width:var(--mortx-tablet-control)!important;min-width:var(--mortx-tablet-control)!important;max-width:var(--mortx-tablet-control)!important;
    height:var(--mortx-tablet-control)!important;min-height:var(--mortx-tablet-control)!important;max-height:var(--mortx-tablet-control)!important;
    margin:0!important;padding:0!important;
  }
}

/* Wider tablets can give Work Mode less space and Search/actions more, while
   retaining the same single-row 8-column contract. */
@media (min-width:901px) and (max-width:1180px){

body.mortx-ui-shell #appProjectBrandHeader .top-actions{grid-column:4 / -1!important}
}

/* Mobile: strict alignment contract.
   The two rows share one action rail: the three work buttons are vertically
   aligned with the three quick-action buttons below. The left content rail
   absorbs all remaining width. */
@media (max-width:640px){
  :root{
    --mortx-grid-columns:4;
    --mortx-grid-gap:8px;
    --mortx-mobile-control:40px;
    --mortx-mobile-gap:8px;
  }

  body.mortx-ui-shell #appProjectBrandHeader.mortx-header{
    width:100%!important;max-width:100%!important;
    padding:10px!important;overflow:visible!important;
  }
  body.mortx-ui-shell #appProjectBrandHeader .top-row{
    display:grid!important;
    grid-template-columns:var(--mortx-mobile-control) minmax(0,1fr)!important;
    grid-template-rows:var(--mortx-mobile-control) var(--mortx-mobile-control)!important;
    column-gap:var(--mortx-mobile-gap)!important;
    row-gap:var(--mortx-mobile-gap)!important;
    align-items:stretch!important;width:100%!important;min-width:0!important;padding:0!important;
  }

  body.mortx-ui-shell #appProjectBrandHeader .mortx-mobile-nav-toggle{
    grid-column:1!important;grid-row:1!important;
    display:grid!important;position:static!important;inset:auto!important;
    box-sizing:border-box!important;width:var(--mortx-mobile-control)!important;
    min-width:var(--mortx-mobile-control)!important;max-width:var(--mortx-mobile-control)!important;
    height:var(--mortx-mobile-control)!important;min-height:var(--mortx-mobile-control)!important;
    margin:0!important;padding:0!important;place-items:center!important;align-self:stretch!important;justify-self:stretch!important;
    border:1px solid #dce3ec!important;border-radius:10px!important;background:#fff!important;color:#344054!important;
    box-shadow:none!important;cursor:pointer!important;
  }

body.mortx-ui-shell #appProjectBrandHeader .header-work-mode-status{
    grid-column:1!important;box-sizing:border-box!important;
    width:100%!important;min-width:0!important;max-width:none!important;
    height:var(--mortx-mobile-control)!important;min-height:var(--mortx-mobile-control)!important;
    margin:0!important;padding:0 9px!important;overflow:hidden!important;
  }

body.mortx-ui-shell #appProjectBrandHeader #workModeControls{
    grid-column:2 / 5!important;
    display:grid!important;grid-template-columns:repeat(3,var(--mortx-mobile-control))!important;
    grid-template-rows:var(--mortx-mobile-control)!important;gap:var(--mortx-mobile-gap)!important;
    width:auto!important;min-width:0!important;height:var(--mortx-mobile-control)!important;
    margin:0!important;padding:0!important;align-items:stretch!important;
  }

body.mortx-ui-shell #appProjectBrandHeader #workModeControls .work-mode-action span{display:none!important}

  body.mortx-ui-shell #appProjectBrandHeader .top-actions{
    grid-column:1 / 3!important;grid-row:2!important;
    width:100%!important;min-width:0!important;height:var(--mortx-mobile-control)!important;
    margin:0!important;padding:0!important;display:block!important;
  }
  body.mortx-ui-shell #appProjectBrandHeader .top-widget-group{
    display:flex!important;
    
    
    gap:var(--mortx-mobile-gap)!important;
    width:100%!important;min-width:0!important;height:var(--mortx-mobile-control)!important;
    margin:0!important;padding:0!important;align-items:stretch!important;justify-content:stretch!important;
  }
  body.mortx-ui-shell #appProjectBrandHeader .global-task-search,
  body.mortx-ui-shell #appProjectBrandHeader .global-task-search-input-wrap,
  body.mortx-ui-shell #appProjectBrandHeader .global-task-search-input-wrap input{
    box-sizing:border-box!important;width:100%!important;min-width:0!important;max-width:none!important;margin:0!important;
  }
  body.mortx-ui-shell #appProjectBrandHeader .global-task-search-input-wrap,
  body.mortx-ui-shell #appProjectBrandHeader .global-task-search-input-wrap input{
    height:var(--mortx-mobile-control)!important;min-height:var(--mortx-mobile-control)!important;
  }
  body.mortx-ui-shell #appProjectBrandHeader .tag-notification-widget,
  body.mortx-ui-shell #appProjectBrandHeader .online-users-widget,
  body.mortx-ui-shell #appProjectBrandHeader .recurring-widget:not(.tag-notification-widget){
    box-sizing:border-box!important;width:var(--mortx-mobile-control)!important;
    min-width:var(--mortx-mobile-control)!important;max-width:var(--mortx-mobile-control)!important;
    height:var(--mortx-mobile-control)!important;min-height:var(--mortx-mobile-control)!important;max-height:var(--mortx-mobile-control)!important;
    margin:0!important;padding:0!important;align-self:stretch!important;
  }
  body.mortx-ui-shell #appProjectBrandHeader .tag-notification-widget .recurring-toggle,
  body.mortx-ui-shell #appProjectBrandHeader .online-users-toggle,
  body.mortx-ui-shell #appProjectBrandHeader .recurring-widget:not(.tag-notification-widget) .recurring-toggle{
    box-sizing:border-box!important;width:var(--mortx-mobile-control)!important;
    min-width:var(--mortx-mobile-control)!important;max-width:var(--mortx-mobile-control)!important;
    height:var(--mortx-mobile-control)!important;min-height:var(--mortx-mobile-control)!important;max-height:var(--mortx-mobile-control)!important;
    margin:0!important;padding:0!important;display:grid!important;place-items:center!important;
  }

  body.mortx-ui-shell.sidebar-mobile-open #appProjectBrandHeader .mortx-mobile-nav-toggle{
    position:fixed!important;left:auto!important;
    right:calc(max(18vw,calc(100vw - 286px)) + 12px)!important;
    top:max(11px,env(safe-area-inset-top))!important;z-index:1450!important;
  }
}

@media (max-width:390px){
  :root{--mortx-mobile-gap:6px}

}

/* v1.0.340 — Desktop header restoration + height-only normalization.
   Preserve the approved desktop flex composition and original widths.
   Only the physical height/alignment is standardized. Tablet/mobile contracts above stay isolated. */
@media (min-width:1181px){
  :root{--mortx-header-control-height:40px;}
  body.mortx-ui-shell #appProjectBrandHeader .top-row{
    display:flex!important;align-items:center!important;justify-content:flex-start!important;
    gap:12px!important;width:100%!important;min-width:0!important;
  }

body.mortx-ui-shell #appProjectBrandHeader .header-work-mode-status{
    box-sizing:border-box!important;height:var(--mortx-header-control-height)!important;
    min-height:var(--mortx-header-control-height)!important;max-height:var(--mortx-header-control-height)!important;
    width:auto!important;margin:0!important;
  }

body.mortx-ui-shell #appProjectBrandHeader #workModeControls .work-mode-action{
    box-sizing:border-box!important;width:auto!important;min-width:58px!important;max-width:none!important;
    height:var(--mortx-header-control-height)!important;min-height:var(--mortx-header-control-height)!important;
    max-height:var(--mortx-header-control-height)!important;padding:0 12px!important;margin:0!important;
    display:inline-flex!important;align-items:center!important;justify-content:center!important;
  }

body.mortx-ui-shell #appProjectBrandHeader .top-actions{
    display:flex!important;align-items:center!important;gap:10px!important;
    width:auto!important;min-width:0!important;height:var(--mortx-header-control-height)!important;
    margin-left:auto!important;padding:0!important;
  }
  body.mortx-ui-shell #appProjectBrandHeader .top-widget-group{
    display:flex!important;align-items:center!important;gap:8px!important;
    width:auto!important;min-width:0!important;height:var(--mortx-header-control-height)!important;
  }
  body.mortx-ui-shell #appProjectBrandHeader .global-task-search{
    width:min(360px,34vw)!important;min-width:220px!important;max-width:none!important;
    height:var(--mortx-header-control-height)!important;margin:0!important;
  }
  body.mortx-ui-shell #appProjectBrandHeader .global-task-search-input-wrap,
  body.mortx-ui-shell #appProjectBrandHeader .global-task-search-input-wrap input{
    box-sizing:border-box!important;height:var(--mortx-header-control-height)!important;
    min-height:var(--mortx-header-control-height)!important;max-height:var(--mortx-header-control-height)!important;
    margin:0!important;
  }
  body.mortx-ui-shell #appProjectBrandHeader .tag-notification-widget,
  body.mortx-ui-shell #appProjectBrandHeader .online-users-widget,
  body.mortx-ui-shell #appProjectBrandHeader .recurring-widget:not(.tag-notification-widget),
  body.mortx-ui-shell #appProjectBrandHeader .tag-notification-widget .recurring-toggle,
  body.mortx-ui-shell #appProjectBrandHeader .online-users-toggle,
  body.mortx-ui-shell #appProjectBrandHeader .recurring-widget:not(.tag-notification-widget) .recurring-toggle{
    box-sizing:border-box!important;width:40px!important;min-width:40px!important;max-width:40px!important;
    height:var(--mortx-header-control-height)!important;min-height:var(--mortx-header-control-height)!important;
    max-height:var(--mortx-header-control-height)!important;margin:0!important;padding:0!important;
  }
}
