/* Comfortable reading width, a tidy documents table and an app-style phone layout.
   Loaded last on every workspace page. */

/* 1. Wide screens: content stays a comfortable width, centred, instead of stretching edge to edge. */
body.hw-theme.ml-workspace .hw-workspace-content>main{width:100%!important;max-width:1240px!important;margin-left:auto!important;margin-right:auto!important}

/* 2. Documents table: long locations wrap to two lines at most; the row menu is never clipped. */
body.hw-theme .hw-workspace-content .location-cell{max-width:220px;font-size:11px}
body.hw-theme .hw-workspace-content .location-cell .ml-loc{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
body.hw-theme .row-menu.ml-floating{position:fixed!important;right:auto!important;top:auto;z-index:1200!important}

/* Filters: the location list never grows to its longest address; the search icon has room. */
body.hw-theme .hw-workspace-content .filters #fLocation{width:200px;max-width:200px;text-overflow:ellipsis}
body.hw-theme .hw-workspace-content .filters .search-box input{padding-left:34px!important}
@media(max-width:760px){body.hw-theme .hw-workspace-content .filters #fLocation{width:auto;max-width:none}}

/* 3. Phones: an app-style tab bar at the bottom, and documents as cards. */
@media(max-width:760px){
 body.hw-theme.ml-workspace .hw-fixed-navigation{
  inset:auto 0 0 0!important;top:auto!important;width:100%!important;
  height:calc(62px + env(safe-area-inset-bottom))!important;
  padding:5px 4px calc(5px + env(safe-area-inset-bottom))!important;
  display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;grid-template-rows:52px!important;grid-auto-rows:0!important;align-content:start!important;align-items:stretch!important;gap:2px!important;
  overflow:hidden!important;border:0!important;border-top:1px solid #ece3d4!important;
  background:rgba(255,252,246,.97)!important;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
  box-shadow:0 -8px 22px rgba(30,24,16,.06)!important;z-index:600!important
 }
 body.hw-theme.ml-workspace .hw-fixed-navigation>a{
  flex-direction:column!important;justify-content:center!important;align-items:center!important;
  min-height:52px!important;height:52px;padding:3px 2px!important;margin:0!important;gap:3px!important;
  border-radius:12px!important;border:0!important;box-shadow:none!important;background:transparent!important;min-width:0
 }
 body.hw-theme.ml-workspace .hw-fixed-navigation>a.active,body.hw-theme.ml-workspace .hw-fixed-navigation>a[aria-current="page"]{background:#efe8ff!important;color:#5b2bb5!important}
 body.hw-theme.ml-workspace .hw-fixed-navigation .hw-nav-object{width:22px!important;height:22px!important;flex:0 0 22px!important}
 body.hw-theme.ml-workspace .hw-fixed-navigation>a>span{font-size:0!important;line-height:1!important;white-space:nowrap}
 body.hw-theme.ml-workspace .hw-fixed-navigation>a>span::after{font-size:10px;font-weight:600;letter-spacing:.01em}
 body.hw-theme.ml-workspace .hw-fixed-navigation>a[href="admin.html"]>span::after{content:"Home"}
 body.hw-theme.ml-workspace .hw-fixed-navigation>a[href="form.html"]>span::after{content:"Send"}
 body.hw-theme.ml-workspace .hw-fixed-navigation>a[href="analytics.html"]>span::after{content:"Reports"}
 body.hw-theme.ml-workspace .hw-fixed-navigation>a[href="toolbox.html"]>span::after{content:"AI tools"}
 body.hw-theme.ml-workspace .hw-fixed-navigation>a[href="recipients.html"]>span::after{content:"People"}
 body.hw-theme.ml-workspace .hw-fixed-navigation>a[href="feedback.html"]>span::after{content:"Feedback"}
 body.hw-theme.ml-workspace .hw-fixed-navigation :is(.hw-nav-art,.ml-side-legal,.hw-fixed-owner){display:none!important}
 body.hw-theme.ml-workspace .hw-workspace-content{padding-top:var(--hw-header-height)!important;padding-bottom:calc(76px + env(safe-area-inset-bottom))!important}
 body.hw-theme.ml-workspace .hw-workspace-frame{top:var(--hw-header-height)!important;height:calc(100dvh - var(--hw-header-height) - 62px - env(safe-area-inset-bottom))!important}
 html.hw-embedded body.hw-theme.ml-workspace .hw-workspace-content{padding-bottom:24px!important}
 body.hw-theme.ml-workspace .hw-uat-label{bottom:calc(70px + env(safe-area-inset-bottom))!important;font-size:10px!important;padding:5px 9px!important;opacity:.85}

 /* Calmer page banner and stat cards. */
 body.hw-theme.ml-workspace .hw-workspace-content :is(.ml-page-banner,.page-heading,.heading,.form-page-banner){min-height:0!important;padding:14px 112px 14px 16px!important}
 body.hw-theme.ml-workspace .hw-workspace-content :is(.ml-page-banner,.page-heading,.heading,.form-page-banner) h1{font-size:20px!important;line-height:1.15!important}
 body.hw-theme.ml-workspace .hw-workspace-content :is(.ml-page-banner,.page-heading,.heading,.form-page-banner) p{font-size:12px!important}
 body.hw-theme.ml-workspace .hw-workspace-content .kpi{min-height:0!important;padding:12px!important}
 body.hw-theme.ml-workspace .hw-workspace-content .kpi-value{font-size:22px!important}

 /* Documents table → one card per document. */
 body.hw-theme .hw-workspace-content .tbl-wrap{overflow:visible!important}
 body.hw-theme .hw-workspace-content .tbl-wrap table{min-width:0!important;display:block}
 body.hw-theme .hw-workspace-content .tbl-wrap thead{display:none}
 body.hw-theme .hw-workspace-content .tbl-wrap tbody{display:block}
 body.hw-theme .hw-workspace-content .tbl-wrap tbody tr{
  display:grid;grid-template-columns:26px minmax(0,1fr) auto;
  grid-template-areas:"chk doc status" ". rec rec" ". loc loc" ". dates act";
  gap:6px 8px;padding:14px 14px 12px;border-bottom:1px solid #f0ebe2
 }
 body.hw-theme .hw-workspace-content .tbl-wrap tbody td{padding:0!important;border:0!important;min-width:0}
 body.hw-theme .hw-workspace-content .tbl-wrap tbody td[colspan]{grid-column:1/-1}
 body.hw-theme .hw-workspace-content .tbl-wrap tbody td:nth-child(1){grid-area:chk;padding-top:6px!important}
 body.hw-theme .hw-workspace-content .tbl-wrap tbody td:nth-child(2){grid-area:doc}
 body.hw-theme .hw-workspace-content .tbl-wrap tbody td:nth-child(3){grid-area:rec;display:flex;gap:6px;align-items:baseline;flex-wrap:wrap}
 body.hw-theme .hw-workspace-content .tbl-wrap tbody td:nth-child(4){grid-area:loc;max-width:none}
 body.hw-theme .hw-workspace-content .tbl-wrap tbody td:nth-child(5){grid-area:status;text-align:right}
 body.hw-theme .hw-workspace-content .tbl-wrap tbody td:nth-child(6){grid-area:dates;align-self:center}
 body.hw-theme .hw-workspace-content .tbl-wrap tbody td:nth-child(6)::before{content:"Sent ";color:#98a2b3}
 body.hw-theme .hw-workspace-content .tbl-wrap tbody td:nth-child(7){display:none}
 body.hw-theme .hw-workspace-content .tbl-wrap tbody td:nth-child(8){grid-area:act}
 body.hw-theme .hw-workspace-content .tbl-wrap tbody td:nth-child(4):is(:empty){display:none}
 body.hw-theme .hw-workspace-content .tbl-wrap .doc-name{max-width:none;font-size:13px}
 body.hw-theme .hw-workspace-content .tbl-wrap .recipient-name{font-size:12px}
 body.hw-theme .hw-workspace-content .tbl-wrap .recipient-email{font-size:11px;margin:0}
 body.hw-theme .hw-workspace-content .tbl-wrap :is(.btn.sm,.action-kebab){min-height:38px!important;width:38px;padding:0!important;display:grid;place-items:center}
}
