/*
 * HexaVox Communications Shell
 * Protected by docs/COMMUNICATIONS_SHELL_UX_HARNESS.md.
 * This layer owns only global navigation, module framing, and continuity UI.
 * Mail's approved local information architecture remains owned by mail-*.css.
 */

:root {
  --communications-header-height: 64px;
  --communications-rail-width: 88px;
  --communications-mobile-nav-height: 68px;
  --communications-shell-bg: #f6f8fc;
  --communications-surface: #fff;
  --communications-text: #1f1f1f;
  --communications-muted: #5f6368;
  --communications-border: #e0e3e7;
  --communications-active: #d3e3fd;
  --communications-active-text: #041e49;
  --communications-focus: #0b57d0;
}

/* Final protected Mail desktop geometry. Keep at EOF so historical cascade
   layers cannot collapse the local Gmail-style sidebar back into the rail. */
@media (min-width: 801px) {
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-workspace-frame#app-workspace-frame#app-workspace-frame#app-workspace-frame#app-workspace-frame {
    grid-template-columns: calc(var(--communications-rail-width) + 220px) minmax(0, 1fr) !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-workspace-sidebar#app-workspace-sidebar#app-workspace-sidebar#app-workspace-sidebar#app-workspace-sidebar {
    width: calc(var(--communications-rail-width) + 220px) !important;
    min-width: calc(var(--communications-rail-width) + 220px) !important;
    max-width: calc(var(--communications-rail-width) + 220px) !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-workspace-sidebar .tenant-workspace-compose-panel {
    display: block !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-workspace-sidebar .tenant-sidebar-nav-label {
    display: none !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .folder-btn::before,
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .tenant-mail-attachments::before {
    display: inline-grid !important;
    place-items: center !important;
    width: 20px !important;
    min-width: 20px !important;
    height: 20px !important;
    margin-right: 12px !important;
    background: none !important;
    color: currentColor !important;
    font-size: 17px !important;
    line-height: 1 !important;
    mask-image: none !important;
    -webkit-mask-image: none !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .folder-btn[data-mail-folder="INBOX"]::before { content: "▣" !important; }
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .folder-btn[data-mail-folder="STARRED"]::before { content: "☆" !important; }
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .folder-btn[data-mail-folder="SNOOZED"]::before { content: "◷" !important; }
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .folder-btn[data-mail-folder="IMPORTANT"]::before { content: "➤" !important; font-size: 13px !important; }
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .folder-btn[data-mail-folder="SENT"]::before { content: "➤" !important; font-size: 13px !important; }
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .folder-btn[data-mail-folder="DRAFTS"]::before { content: "▤" !important; }
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .tenant-mail-attachments::before { content: "⌕" !important; }
}

/* Gmail-style Mail closeout: one compact content toolbar, visible account
   scope, synchronized labels, and protected row metadata. */
html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-workspace-surface#app-workspace-surface#app-workspace-surface#app-workspace-surface {
  grid-template-rows: minmax(0, 1fr) !important;
}

html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-workspace-stage-header#app-workspace-stage-header#app-workspace-stage-header#app-workspace-stage-header {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

/* Protected Mail search action target; last in the cascade by design. */
html body.tenant-app-body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-workspace-filter-btn#app-workspace-filter-btn {
  position: relative !important;
  z-index: 6 !important;
  display: inline-flex !important;
  visibility: visible !important;
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  align-items: center !important;
  justify-content: center !important;
  pointer-events: auto !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-mail-search-filter {
  position: fixed !important;
  top: 60px !important;
  left: 50% !important;
  z-index: 2000 !important;
  display: grid !important;
  width: min(720px, calc(100vw - 32px)) !important;
  max-height: calc(100dvh - 84px) !important;
  overflow: auto !important;
  border: 1px solid #dadce0 !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: 0 8px 28px rgba(60,64,67,.24) !important;
  transform: translateX(-50%) !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-mail-search-filter.hidden { display: none !important; }
body.tenant-app-body[data-app-surface="workspace"] .tenant-mail-search-filter-head,
body.tenant-app-body[data-app-surface="workspace"] .tenant-mail-search-filter-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 14px 18px !important;
}
body.tenant-app-body[data-app-surface="workspace"] .tenant-mail-search-filter-head { border-bottom: 1px solid #e0e3e7 !important; }
body.tenant-app-body[data-app-surface="workspace"] .tenant-mail-search-filter-head > div { display: grid !important; gap: 3px !important; }
body.tenant-app-body[data-app-surface="workspace"] .tenant-mail-search-filter-head strong { font-size: 16px !important; }
body.tenant-app-body[data-app-surface="workspace"] .tenant-mail-search-filter-head span,
body.tenant-app-body[data-app-surface="workspace"] .tenant-mail-search-filter-actions > span { color: #5f6368 !important; font-size: 12px !important; }
body.tenant-app-body[data-app-surface="workspace"] .tenant-mail-search-filter-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0,1fr)) !important;
  gap: 12px !important;
  padding: 16px 18px !important;
}
body.tenant-app-body[data-app-surface="workspace"] .tenant-mail-search-filter-grid label { display: grid !important; gap: 5px !important; color: #3c4043 !important; font-size: 12px !important; font-weight: 600 !important; }
body.tenant-app-body[data-app-surface="workspace"] .tenant-mail-search-filter-grid label.is-wide { grid-column: 1 / -1 !important; }
body.tenant-app-body[data-app-surface="workspace"] .tenant-mail-search-filter-grid :is(input,select) { min-height: 40px !important; border: 1px solid #bdc1c6 !important; border-radius: 4px !important; background: #fff !important; }
body.tenant-app-body[data-app-surface="workspace"] .tenant-mail-search-filter-grid .tenant-mail-search-check { display: flex !important; min-height: 40px !important; align-items: center !important; gap: 9px !important; }
body.tenant-app-body[data-app-surface="workspace"] .tenant-mail-search-filter-grid .tenant-mail-search-check input { width: 24px !important; min-height: 24px !important; }
body.tenant-app-body[data-app-surface="workspace"] .tenant-mail-search-filter-actions { position: sticky !important; bottom: 0 !important; border-top: 1px solid #e0e3e7 !important; background: #fff !important; }

html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] .tenant-workspace-compose-plus {
  width: 20px !important;
  min-width: 20px !important;
  height: 20px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.8 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

@media (min-width: 1101px) {
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] .tenant-workspace-toolbar {
    grid-template-columns: minmax(220px, 1fr) minmax(360px, 720px) minmax(136px, 1fr) !important;
  }
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] .tenant-workspace-toolbar-right {
    justify-content: flex-end !important;
  }
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-status-pill {
    display: inline-grid !important;
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    place-items: center !important;
    overflow: hidden !important;
    border-radius: 50% !important;
    font-size: 0 !important;
  }
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-status-pill::before {
    content: "✓" !important;
    font-size: 16px !important;
  }
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] .tenant-shell-identity-copy {
    display: none !important;
  }
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] .tenant-shell-identity-btn {
    width: 42px !important;
    min-width: 42px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: transparent !important;
  }
}

@media (min-width: 801px) {
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .tenant-mailbox-details {
    display: block !important;
    visibility: visible !important;
    margin: 0 8px 8px !important;
  }
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .tenant-mailbox-details > summary {
    display: flex !important;
    visibility: visible !important;
    min-height: 36px !important;
    padding: 0 12px !important;
    align-items: center !important;
    border-radius: 18px !important;
    background: #eaf1fb !important;
    color: #1f1f1f !important;
    cursor: pointer !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    list-style: none !important;
  }
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .tenant-mailbox-list {
    display: grid !important;
    max-height: 260px !important;
    margin-top: 5px !important;
    overflow-y: auto !important;
    border: 1px solid #dadce0 !important;
    border-radius: 8px !important;
    background: #fff !important;
  }
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .mailbox-chip { min-height: 48px !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .mailbox-chip.active { background: #d3e3fd !important; }
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail :is(.folder-btn,.tenant-mail-attachments) > svg {
    display: block !important;
    width: 20px !important;
    min-width: 20px !important;
    height: 20px !important;
    margin-right: 12px !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.6 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
  }
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .folder-btn::before,
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .tenant-mail-attachments::before { display: none !important; content: none !important; }
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail :is(.folder-btn,.tenant-mail-custom-label) > b { margin-left: auto !important; font-size: 12px !important; }
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] .tenant-mail-custom-labels { display: grid !important; gap: 1px !important; }
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] .tenant-mail-custom-label { display: flex !important; width: 100% !important; min-height: 32px !important; padding: 0 14px 0 20px !important; align-items: center !important; gap: 12px !important; border: 0 !important; border-radius: 0 16px 16px 0 !important; background: transparent !important; color: #3c4043 !important; box-shadow: none !important; text-align: left !important; }
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] .tenant-mail-custom-label.active { background: #d3e3fd !important; font-weight: 700 !important; }
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] .tenant-mail-label-dot { width: 10px !important; height: 10px !important; border-radius: 50% !important; background: var(--mail-label-color) !important; }
}

@media (max-width: 800px) {
  body.tenant-app-body[data-app-surface="workspace"] .tenant-mail-search-filter { top: 8px !important; right: 8px !important; left: 8px !important; width: auto !important; max-width: calc(100vw - 16px) !important; max-height: calc(100dvh - var(--communications-mobile-nav-height) - 16px) !important; transform: none !important; }
  body.tenant-app-body[data-app-surface="workspace"] .tenant-mail-search-filter-grid { grid-template-columns: minmax(0,1fr) !important; }
  body.tenant-app-body[data-app-surface="workspace"] .tenant-mail-search-filter-grid label.is-wide { grid-column: auto !important; }
}

html,
body.tenant-app-body[data-app-surface="workspace"] {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: var(--communications-shell-bg) !important;
  color: var(--communications-text) !important;
  font-family: Arial, Helvetica, sans-serif !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-app-shell {
  display: grid !important;
  grid-template-rows: var(--communications-header-height) minmax(0, 1fr) !important;
  width: 100vw !important;
  height: 100dvh !important;
  min-height: 0 !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
  background: var(--communications-shell-bg) !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-toolbar {
  position: relative !important;
  inset: auto !important;
  z-index: 80 !important;
  display: grid !important;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 720px) minmax(260px, 1fr) !important;
  align-items: center !important;
  width: 100% !important;
  height: var(--communications-header-height) !important;
  min-height: var(--communications-header-height) !important;
  padding: 8px 16px !important;
  border: 0 !important;
  background: var(--communications-shell-bg) !important;
  box-shadow: none !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-toolbar-left,
body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-toolbar-center,
body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-toolbar-right {
  min-width: 0 !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-brand-link {
  display: inline-flex !important;
  width: fit-content !important;
  min-width: 0 !important;
  color: inherit !important;
  text-decoration: none !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-app-brand-header {
  gap: 10px !important;
  min-width: 0 !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-app-brand-appname {
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 22px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-app-brand-tenant {
  max-width: 170px !important;
  overflow: hidden !important;
  color: var(--communications-muted) !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-toolbar-menu,
body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-toolbar button,
body.tenant-app-body[data-app-surface="workspace"] .tenant-session-trigger {
  min-width: 40px;
  min-height: 40px;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-search-input {
  min-height: 48px !important;
  border: 1px solid transparent !important;
  border-radius: 24px !important;
  background: #eaf1fb !important;
  box-shadow: none !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-search-input:focus-within {
  border-color: #a8c7fa !important;
  background: #fff !important;
  box-shadow: 0 1px 2px rgba(60, 64, 67, .18), 0 1px 3px 1px rgba(60, 64, 67, .12) !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-frame {
  display: grid !important;
  grid-template-columns: var(--communications-rail-width) minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  gap: 0 !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  padding: 0 8px 8px 0 !important;
  overflow: hidden !important;
  background: var(--communications-shell-bg) !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-sidebar {
  position: relative !important;
  inset: auto !important;
  z-index: 20 !important;
  display: flex !important;
  flex-direction: column !important;
  width: var(--communications-rail-width) !important;
  min-width: var(--communications-rail-width) !important;
  max-width: var(--communications-rail-width) !important;
  height: 100% !important;
  min-height: 0 !important;
  padding: 8px 6px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-compose-panel,
body.tenant-app-body[data-app-surface="workspace"] #app-mail-rail,
body.tenant-app-body[data-app-surface="workspace"] #app-mail-rail-divider,
body.tenant-app-body[data-app-surface="workspace"] .tenant-sidebar-nav-label,
body.tenant-app-body[data-app-surface="workspace"] #app-workspace-nav-label,
body.tenant-app-body[data-app-surface="workspace"] #app-admin-nav-label,
body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-tabs,
body.tenant-app-body[data-app-surface="workspace"] #app-mobile-context-strip,
body.tenant-app-body[data-app-surface="workspace"] #app-mobile-section-menu,
body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-sidecar {
  display: none !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-sidebar .tenant-nav {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 5px !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-sidebar .tenant-nav-divider {
  display: block !important;
  height: 1px !important;
  min-height: 1px !important;
  margin: 5px 8px !important;
  background: var(--communications-border) !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-sidebar .tenant-nav-btn {
  position: relative !important;
  display: flex !important;
  flex: 0 0 auto !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  width: 76px !important;
  min-width: 76px !important;
  min-height: 58px !important;
  padding: 7px 4px !important;
  border: 0 !important;
  border-radius: 14px !important;
  background: transparent !important;
  color: #3c4043 !important;
  box-shadow: none !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  line-height: 1.1 !important;
  text-align: center !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-sidebar .tenant-nav-btn:hover {
  background: #e9eef6 !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-sidebar .tenant-nav-btn.is-active,
body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-sidebar .tenant-nav-btn.active {
  background: var(--communications-active) !important;
  color: var(--communications-active-text) !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-sidebar .tenant-nav-icon {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  margin: 0 !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-sidebar .tenant-nav-label-row {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  overflow: visible !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-sidebar .tenant-nav-label-row > span:first-child {
  display: block !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-sidebar .tenant-nav-badge {
  position: absolute !important;
  top: 5px !important;
  right: 8px !important;
}

body.tenant-app-body[data-app-surface="workspace"] #app-tab-settings {
  margin-top: auto !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-app-main {
  grid-column: 2 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  overflow: hidden !important;
  border: 1px solid var(--communications-border) !important;
  border-radius: 16px !important;
  background: var(--communications-surface) !important;
  box-shadow: 0 1px 2px rgba(60, 64, 67, .08) !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-surface {
  display: grid !important;
  grid-template-rows: 42px minmax(0, 1fr) !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-app-header-bar {
  display: flex !important;
  align-items: center !important;
  min-height: 42px !important;
  height: 42px !important;
  padding: 0 16px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--communications-border) !important;
  background: #fff !important;
  box-shadow: none !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-app-header-main {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  min-width: 0 !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-app-stage-copy {
  display: flex !important;
  align-items: baseline !important;
  gap: 10px !important;
  min-width: 0 !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-app-title {
  margin: 0 !important;
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-app-subtitle {
  max-width: 54vw !important;
  margin: 0 !important;
  overflow: hidden !important;
  color: var(--communications-muted) !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-app-header-utility {
  display: none !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-stage-grid,
body.tenant-app-body[data-app-surface="workspace"] .tenant-stage-panel {
  width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

body.tenant-app-body[data-app-surface="workspace"] .tenant-stage-panel.hidden,
body.tenant-app-body[data-app-surface="workspace"] .tenant-stage-panel[hidden] {
  display: none !important;
}

body.tenant-app-body[data-app-surface="workspace"] #app-mail-shell {
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

body.tenant-app-body[data-app-surface="workspace"] #app-mail-frame {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  border: 0 !important;
  background: #fff !important;
}

body.tenant-app-body[data-app-surface="workspace"] #app-inbox-health-strip {
  display: none !important;
}

body.tenant-app-body[data-app-surface="workspace"] #app-stage-calls,
body.tenant-app-body[data-app-surface="workspace"] #app-stage-calendar,
body.tenant-app-body[data-app-surface="workspace"] #app-stage-numbers,
body.tenant-app-body[data-app-surface="workspace"] #app-stage-guide,
body.tenant-app-body[data-app-surface="workspace"] #app-stage-reports,
body.tenant-app-body[data-app-surface="workspace"] #app-stage-settings {
  overflow: auto !important;
  overscroll-behavior: contain !important;
  scrollbar-gutter: stable !important;
}

body.tenant-app-body[data-app-surface="workspace"] .communications-mobile-nav {
  display: none !important;
}

body.tenant-app-body[data-app-surface="workspace"] .communications-live-call {
  position: fixed !important;
  z-index: 120 !important;
  right: 20px !important;
  bottom: 18px !important;
  left: auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  width: min(720px, calc(100vw - 128px)) !important;
  min-height: 58px !important;
  padding: 8px 10px 8px 14px !important;
  border: 1px solid #c4d2e7 !important;
  border-radius: 16px !important;
  background: #fff !important;
  box-shadow: 0 8px 28px rgba(60, 64, 67, .22) !important;
}

body.tenant-app-body[data-app-surface="workspace"] .communications-live-call.hidden {
  display: none !important;
}

.communications-live-call-return {
  display: flex !important;
  flex: 1 1 auto !important;
  align-items: center !important;
  gap: 10px !important;
  min-width: 0 !important;
  min-height: 42px !important;
  padding: 4px 8px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: transparent !important;
  color: var(--communications-text) !important;
  text-align: left !important;
}

.communications-live-call-return > span:last-child {
  display: grid !important;
  min-width: 0 !important;
}

.communications-live-call-return strong,
.communications-live-call-return small {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.communications-live-call-return small {
  color: var(--communications-muted) !important;
}

.communications-live-call-dot {
  width: 12px !important;
  height: 12px !important;
  border: 3px solid #d7f8df !important;
  border-radius: 50% !important;
  background: #188038 !important;
  box-shadow: 0 0 0 2px #188038 !important;
}

.communications-live-call-actions {
  display: flex !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  gap: 6px !important;
}

.communications-live-call-actions button {
  min-width: 64px !important;
  min-height: 40px !important;
  padding: 0 12px !important;
  border-radius: 20px !important;
}

body.tenant-app-body[data-app-surface="workspace"] :is(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--communications-focus) !important;
  outline-offset: 2px !important;
}

@media (max-width: 1100px) {
  body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-toolbar {
    grid-template-columns: minmax(220px, .8fr) minmax(280px, 1.3fr) minmax(180px, .7fr) !important;
  }

  body.tenant-app-body[data-app-surface="workspace"] .tenant-app-brand-copy,
  body.tenant-app-body[data-app-surface="workspace"] .tenant-app-subtitle {
    display: none !important;
  }
}

@media (max-width: 800px) {
  html body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-toolbar-center,
  html body.tenant-app-body[data-app-surface="workspace"] #app-mobile-context-strip#app-mobile-context-strip#app-mobile-context-strip#app-mobile-context-strip,
  html body.tenant-app-body[data-app-surface="workspace"] #app-mobile-section-menu#app-mobile-section-menu#app-mobile-section-menu#app-mobile-section-menu {
    display: none !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-toolbar {
    grid-template-columns: minmax(0, 1fr) auto !important;
  }

  :root {
    --communications-header-height: 56px;
  }

  body.tenant-app-body[data-app-surface="workspace"] .tenant-app-shell {
    grid-template-rows: var(--communications-header-height) minmax(0, 1fr) !important;
  }

  body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-toolbar {
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    gap: 8px !important;
    height: var(--communications-header-height) !important;
    min-height: var(--communications-header-height) !important;
    padding: 6px 8px !important;
  }

  body.tenant-app-body[data-app-surface="workspace"] .tenant-toolbar-menu,
  body.tenant-app-body[data-app-surface="workspace"] .tenant-app-brand-copy,
  body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-toolbar-right .tenant-desktop-only,
  body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-search-shortcut,
  body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-search-label,
  body.tenant-app-body[data-app-surface="workspace"] #app-workspace-filter-btn {
    display: none !important;
  }

  body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-toolbar-left {
    width: 38px !important;
  }

  body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-brand-link,
  body.tenant-app-body[data-app-surface="workspace"] .tenant-app-brand-header,
  body.tenant-app-body[data-app-surface="workspace"] .tenant-app-brand-media,
  body.tenant-app-body[data-app-surface="workspace"] .tenant-app-brand-mark {
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
  }

  body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-search,
  body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-search-input {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 42px !important;
    height: 42px !important;
  }

  body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-frame {
    display: block !important;
    height: calc(100dvh - var(--communications-header-height) - var(--communications-mobile-nav-height)) !important;
    padding: 0 !important;
  }

  body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-sidebar {
    display: none !important;
  }

  body.tenant-app-body[data-app-surface="workspace"] .tenant-app-main {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
    border-radius: 0 !important;
  }

  body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-surface {
    grid-template-rows: 36px minmax(0, 1fr) !important;
  }

  body.tenant-app-body[data-app-surface="workspace"] .tenant-app-header-bar {
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 12px !important;
  }

  body.tenant-app-body[data-app-surface="workspace"] .tenant-app-title {
    font-size: 14px !important;
  }

  body.tenant-app-body[data-app-surface="workspace"] .communications-mobile-nav {
    position: fixed !important;
    z-index: 100 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    width: 100% !important;
    height: calc(var(--communications-mobile-nav-height) + env(safe-area-inset-bottom)) !important;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom)) !important;
    border-top: 1px solid var(--communications-border) !important;
    background: rgba(255, 255, 255, .98) !important;
    box-shadow: 0 -2px 10px rgba(60, 64, 67, .1) !important;
  }

  body.tenant-app-body[data-app-surface="workspace"] .communications-mobile-nav button {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    min-width: 44px !important;
    min-height: 56px !important;
    padding: 4px !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: transparent !important;
    color: #3c4043 !important;
    box-shadow: none !important;
    font-size: 10px !important;
    font-weight: 600 !important;
  }

  body.tenant-app-body[data-app-surface="workspace"] .communications-mobile-nav button.is-active,
  body.tenant-app-body[data-app-surface="workspace"] .communications-mobile-nav button.active {
    background: var(--communications-active) !important;
    color: var(--communications-active-text) !important;
  }

  body.tenant-app-body[data-app-surface="workspace"] .communications-mobile-nav .tenant-nav-icon {
    width: 21px !important;
    height: 21px !important;
    min-width: 21px !important;
  }

  body.tenant-app-body[data-app-surface="workspace"] .communications-mobile-nav .tenant-nav-badge {
    position: absolute !important;
    top: 3px !important;
    left: calc(50% + 8px) !important;
  }

  body.tenant-app-body[data-app-surface="workspace"] .communications-live-call {
    right: 8px !important;
    bottom: calc(var(--communications-mobile-nav-height) + env(safe-area-inset-bottom) + 8px) !important;
    left: 8px !important;
    width: auto !important;
    min-height: 56px !important;
    gap: 6px !important;
    padding: 7px 8px !important;
  }

  .communications-live-call-actions button {
    min-width: 44px !important;
    width: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    overflow: hidden !important;
    color: transparent !important;
    font-size: 0 !important;
  }

  .communications-live-call-actions button::before {
    color: #3c4043 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
  }

  #app-live-bar-mute-btn::before { content: "Mute"; }
  #app-live-bar-hold-btn::before { content: "Hold"; }
  #app-live-bar-transfer-btn,
  #app-live-bar-sms-btn { display: none !important; }
  #app-live-bar-end-btn::before { content: "End"; color: #b3261e !important; }

  body.tenant-app-body[data-app-surface="workspace"] #app-mobile-mail-compose-fab {
    bottom: calc(var(--communications-mobile-nav-height) + env(safe-area-inset-bottom) + 12px) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.tenant-app-body[data-app-surface="workspace"] *,
  body.tenant-app-body[data-app-surface="workspace"] *::before,
  body.tenant-app-body[data-app-surface="workspace"] *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Mail-active desktop projection: preserve the narrow global module rail and
   add Gmail's familiar local Compose/folder rail beside it. This rule lives in
   the shell layer so older Mail-specific cascade files cannot hide a protected
   navigation baseline. */
@media (min-width: 801px) {
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] {
    --communications-mail-local-width: 220px;
  }

  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-workspace-frame#app-workspace-frame#app-workspace-frame#app-workspace-frame#app-workspace-frame {
    grid-template-columns: calc(var(--communications-rail-width) + var(--communications-mail-local-width)) minmax(0, 1fr) !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-workspace-sidebar#app-workspace-sidebar#app-workspace-sidebar#app-workspace-sidebar#app-workspace-sidebar {
    display: block !important;
    width: calc(var(--communications-rail-width) + var(--communications-mail-local-width)) !important;
    min-width: calc(var(--communications-rail-width) + var(--communications-mail-local-width)) !important;
    max-width: calc(var(--communications-rail-width) + var(--communications-mail-local-width)) !important;
    padding: 8px 0 8px 6px !important;
    overflow: hidden !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-workspace-sidebar .tenant-workspace-compose-panel {
    position: absolute !important;
    top: 8px !important;
    left: var(--communications-rail-width) !important;
    z-index: 3 !important;
    display: block !important;
    width: var(--communications-mail-local-width) !important;
    margin: 0 !important;
    padding: 0 10px !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-compose-btn.tenant-workspace-compose-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    width: 144px !important;
    min-height: 56px !important;
    padding: 0 20px !important;
    border: 0 !important;
    border-radius: 16px !important;
    background: #c2e7ff !important;
    color: #001d35 !important;
    box-shadow: 0 1px 2px rgba(60, 64, 67, .2) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-compose-btn .tenant-workspace-compose-plus {
    display: inline-grid !important;
    place-items: center !important;
    font-size: 26px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-workspace-sidebar .tenant-mail-nav {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    width: var(--communications-rail-width) !important;
    height: 100% !important;
    overflow: visible !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-workspace-sidebar #app-mail-rail {
    position: absolute !important;
    top: 68px !important;
    bottom: 0 !important;
    left: var(--communications-rail-width) !important;
    z-index: 2 !important;
    display: flex !important;
    visibility: visible !important;
    flex-direction: column !important;
    width: var(--communications-mail-local-width) !important;
    min-width: var(--communications-mail-local-width) !important;
    max-width: var(--communications-mail-local-width) !important;
    padding: 0 10px 10px 0 !important;
    overflow: hidden auto !important;
    border: 0 !important;
    background: transparent !important;
    scrollbar-width: thin !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .tenant-mailbox-details,
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .tenant-mail-rail-footer,
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .tenant-mail-folder-details summary {
    display: none !important;
    visibility: hidden !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .tenant-mail-folder-details,
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .tenant-mail-folder-stack {
    display: grid !important;
    visibility: visible !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    gap: 1px !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .folder-btn,
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .tenant-mail-attachments {
    display: flex !important;
    visibility: visible !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    min-height: 32px !important;
    padding: 0 14px 0 20px !important;
    border: 0 !important;
    border-radius: 0 16px 16px 0 !important;
    background: transparent !important;
    color: #3c4043 !important;
    box-shadow: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-align: left !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .folder-btn.active {
    background: #d3e3fd !important;
    color: #001d35 !important;
    font-weight: 700 !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .tenant-mail-more {
    display: block !important;
    visibility: visible !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .tenant-mail-more > summary {
    display: flex !important;
    align-items: center !important;
    min-height: 32px !important;
    padding: 0 14px 0 20px !important;
    color: #3c4043 !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    list-style: none !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .tenant-mail-more > summary::before {
    content: "⌄" !important;
    width: 20px !important;
    margin-right: 12px !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .tenant-mail-more-folders {
    display: grid !important;
    gap: 1px !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] .tenant-mail-labels {
    display: grid !important;
    gap: 5px !important;
    margin-top: 14px !important;
    padding-top: 12px !important;
    border-top: 1px solid var(--communications-border) !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] .tenant-mail-labels-head {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 12px 4px 20px !important;
    color: #3c4043 !important;
    font-size: 12px !important;
    letter-spacing: .04em !important;
    text-transform: uppercase !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] .tenant-mail-labels-head button {
    min-width: 32px !important;
    min-height: 32px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: #3c4043 !important;
    box-shadow: none !important;
    font-size: 20px !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] .tenant-mail-labels > small {
    padding-left: 20px !important;
    color: #6f7378 !important;
    font-size: 11px !important;
  }
}

/* Critical shell geometry lock. The legacy workspace carries high-specificity
   historic rules; these stable IDs ensure the protected shell remains the sole
   layout authority without changing approved module internals. */
html body.tenant-app-body[data-app-surface="workspace"] #app-workspace-frame#app-workspace-frame#app-workspace-frame#app-workspace-frame#app-workspace-frame {
  position: relative !important;
  inset: auto !important;
  display: grid !important;
  grid-template-columns: var(--communications-rail-width) minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  gap: 0 !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  margin: 0 !important;
  padding: 0 8px 8px 0 !important;
  overflow: hidden !important;
}

html body.tenant-app-body[data-app-surface="workspace"] #app-workspace-sidebar#app-workspace-sidebar#app-workspace-sidebar#app-workspace-sidebar#app-workspace-sidebar {
  position: relative !important;
  inset: auto !important;
  grid-column: 1 !important;
  grid-row: 1 !important;
  display: flex !important;
  width: var(--communications-rail-width) !important;
  min-width: var(--communications-rail-width) !important;
  max-width: var(--communications-rail-width) !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 8px 6px !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

html body.tenant-app-body[data-app-surface="workspace"] #app-workspace-main#app-workspace-main#app-workspace-main#app-workspace-main#app-workspace-main {
  position: relative !important;
  inset: auto !important;
  grid-column: 2 !important;
  grid-row: 1 !important;
  display: block !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

html body.tenant-app-body[data-app-surface="workspace"] #app-workspace-surface#app-workspace-surface#app-workspace-surface#app-workspace-surface,
html body.tenant-app-body[data-app-surface="workspace"] #app-workspace-stage-grid#app-workspace-stage-grid#app-workspace-stage-grid#app-workspace-stage-grid {
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 0 !important;
  max-height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

html body.tenant-app-body[data-app-surface="workspace"] #app-workspace-surface#app-workspace-surface#app-workspace-surface#app-workspace-surface {
  display: grid !important;
  grid-template-rows: 42px minmax(0, 1fr) !important;
  height: 100% !important;
}

html body.tenant-app-body[data-app-surface="workspace"] #app-workspace-stage-grid#app-workspace-stage-grid#app-workspace-stage-grid#app-workspace-stage-grid {
  display: block !important;
  height: 100% !important;
}

html body.tenant-app-body[data-app-surface="workspace"] #app-workspace-stage-header#app-workspace-stage-header#app-workspace-stage-header#app-workspace-stage-header {
  position: relative !important;
  inset: auto !important;
  display: flex !important;
  width: 100% !important;
  min-height: 42px !important;
  height: 42px !important;
  margin: 0 !important;
  padding: 0 16px !important;
  overflow: hidden !important;
}

html body.tenant-app-body[data-app-surface="workspace"] #app-workspace-sidebar .tenant-workspace-compose-panel {
  display: none !important;
}

@media (max-width: 800px) {
  html body.tenant-app-body.tenant-app-body.tenant-app-body.tenant-app-body.tenant-app-body[data-app-surface="workspace"] .tenant-app-shell {
    position: relative !important;
    inset: auto !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: var(--communications-header-height) minmax(0, 1fr) !important;
    gap: 0 !important;
    width: 100vw !important;
    min-width: 0 !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    min-height: 0 !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  html body.tenant-app-body.tenant-app-body.tenant-app-body.tenant-app-body.tenant-app-body[data-app-surface="workspace"],
  html body.tenant-app-body.tenant-app-body.tenant-app-body.tenant-app-body.tenant-app-body[data-app-surface="workspace"] > main,
  html body.tenant-app-body.tenant-app-body.tenant-app-body.tenant-app-body.tenant-app-body[data-app-surface="workspace"] > .tenant-app-shell {
    width: 100vw !important;
    min-width: 0 !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    min-height: 0 !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  html body.tenant-app-body.tenant-app-body.tenant-app-body.tenant-app-body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-toolbar {
    position: relative !important;
    inset: auto !important;
    grid-row: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: var(--communications-header-height) !important;
    min-height: var(--communications-header-height) !important;
    max-height: var(--communications-header-height) !important;
    margin: 0 !important;
    padding: 6px 8px !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"] #app-workspace-frame#app-workspace-frame#app-workspace-frame#app-workspace-frame#app-workspace-frame {
    grid-row: 2 !important;
    display: block !important;
    width: 100% !important;
    height: calc(100dvh - var(--communications-header-height) - var(--communications-mobile-nav-height)) !important;
    padding: 0 !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"] #app-workspace-sidebar#app-workspace-sidebar#app-workspace-sidebar#app-workspace-sidebar#app-workspace-sidebar {
    display: none !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"] #app-workspace-main#app-workspace-main#app-workspace-main#app-workspace-main#app-workspace-main {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
    border-radius: 0 !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"] #app-workspace-surface#app-workspace-surface#app-workspace-surface#app-workspace-surface {
    grid-template-rows: minmax(0, 1fr) !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"] #app-workspace-stage-header#app-workspace-stage-header#app-workspace-stage-header#app-workspace-stage-header {
    display: none !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"] #app-mobile-nav#app-mobile-nav#app-mobile-nav#app-mobile-nav#app-mobile-nav#app-mobile-nav.communications-mobile-nav {
    z-index: 10000 !important;
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"] #app-mobile-nav#app-mobile-nav#app-mobile-nav#app-mobile-nav#app-mobile-nav#app-mobile-nav.communications-mobile-nav > button.tenant-mobile-nav-btn[data-app-tab] {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}

/* The communications rail is intentionally task-first. Administrative tools
   remain available through Settings/More instead of competing with the four
   daily communication destinations. */
html body.tenant-app-body[data-app-surface="workspace"] #app-workspace-sidebar :is(
  #app-tab-numbers,
  #app-tab-guide,
  #app-tab-reports
) {
  display: none !important;
}

@media (max-width: 800px) {
  /* Keep a readable product identity in the compact header. */
  html body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-toolbar-left {
    display: flex !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"] .tenant-workspace-brand-link,
  html body.tenant-app-body[data-app-surface="workspace"] .tenant-app-brand-header {
    display: inline-flex !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"] .tenant-app-brand-copy {
    display: block !important;
    min-width: 0 !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"] .tenant-app-brand-appname {
    display: block !important;
    max-width: 116px !important;
    overflow: hidden !important;
    font-size: 18px !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"] :is(
    .tenant-app-brand-mark,
    .tenant-app-brand-media,
    .tenant-app-brand-tenant
  ) {
    display: none !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"] #app-mobile-nav .tenant-nav-badge {
    display: none !important;
  }

  /* Voice is a single predictable reading stream on mobile. These repeated
     stage IDs deliberately outrank the historical desktop scorecard rules. */
  html body.tenant-app-body[data-app-surface="workspace"] #app-stage-calls#app-stage-calls#app-stage-calls#app-stage-calls#app-stage-calls .tenant-call-launch-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-auto-flow: row !important;
    align-content: start !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 100% !important;
    padding: 10px !important;
    overflow-x: hidden !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"] #app-stage-calls#app-stage-calls#app-stage-calls#app-stage-calls#app-stage-calls :is(
    .tenant-call-launch-hero,
    .tenant-call-launch-readiness,
    .tenant-call-launch-metrics
  ) {
    grid-column: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 14px 16px !important;
    border-right: 0 !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"] #app-stage-calls#app-stage-calls#app-stage-calls#app-stage-calls#app-stage-calls .tenant-call-launch-hero {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  html body.tenant-app-body.tenant-app-body.tenant-app-body.tenant-app-body.tenant-app-body[data-app-surface="workspace"][data-active-tab="calls"] #app-stage-calls#app-stage-calls#app-stage-calls .tenant-call-launch-copy {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  html body.tenant-app-body.tenant-app-body.tenant-app-body.tenant-app-body.tenant-app-body[data-app-surface="workspace"][data-active-tab="calls"] #app-stage-calls#app-stage-calls#app-stage-calls .tenant-call-launch-copy > :is(.card-title, #app-calls-summary, .tenant-call-readiness-strip, .tenant-call-readiness-progress) {
    grid-area: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  html body.tenant-app-body.tenant-app-body.tenant-app-body.tenant-app-body.tenant-app-body[data-app-surface="workspace"][data-active-tab="calls"] #app-stage-calls#app-stage-calls#app-stage-calls .tenant-call-readiness-progress {
    display: block !important;
  }

  html body.tenant-app-body.tenant-app-body.tenant-app-body.tenant-app-body.tenant-app-body[data-app-surface="workspace"][data-active-tab="calls"] #app-stage-calls#app-stage-calls#app-stage-calls .tenant-call-readiness-progress > * {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 2px 0 !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"] #app-stage-calls#app-stage-calls#app-stage-calls#app-stage-calls#app-stage-calls .tenant-call-readiness-strip {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"] #app-stage-calls#app-stage-calls#app-stage-calls#app-stage-calls#app-stage-calls :is(
    .tenant-call-readiness-list,
    .tenant-call-stage-metrics,
    .tenant-ring-groups
  ) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* Gmail's narrow layout prioritizes the actionable agenda. The full month
     grid remains available at tablet/desktop sizes without forcing two-axis
     scrolling onto a phone. */
  html body.tenant-app-body[data-app-surface="workspace"] #app-stage-calendar#app-stage-calendar#app-stage-calendar#app-stage-calendar#app-stage-calendar :is(
    .tenant-stage-stack,
    .tenant-calendar-surface,
    .tenant-calendar-lower,
    .tenant-calendar-agenda-surface,
    .tenant-calendar-form-surface
  ) {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"] #app-stage-calendar#app-stage-calendar#app-stage-calendar#app-stage-calendar#app-stage-calendar .tenant-calendar-head {
    display: block !important;
    padding: 14px 16px 8px !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"] #app-stage-calendar#app-stage-calendar#app-stage-calendar#app-stage-calendar#app-stage-calendar :is(
    .tenant-calendar-mode-tabs,
    .tenant-calendar-legend-primary,
    .tenant-calendar-month-shell,
    #app-calendar-summary-cards
  ) {
    display: none !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"] #app-stage-calendar#app-stage-calendar#app-stage-calendar#app-stage-calendar#app-stage-calendar .tenant-calendar-toolbar {
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 8px 16px 12px !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"] #app-stage-calendar#app-stage-calendar#app-stage-calendar#app-stage-calendar#app-stage-calendar .tenant-calendar-toolbar-main {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"] #app-stage-calendar#app-stage-calendar#app-stage-calendar#app-stage-calendar#app-stage-calendar .tenant-calendar-lower {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    padding: 0 10px 10px !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"] #app-stage-calendar#app-stage-calendar#app-stage-calendar#app-stage-calendar#app-stage-calendar .tenant-calendar-form-layout,
  html body.tenant-app-body[data-app-surface="workspace"] #app-stage-calendar#app-stage-calendar#app-stage-calendar#app-stage-calendar#app-stage-calendar .tenant-calendar-form-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  html body.tenant-app-body.tenant-app-body.tenant-app-body.tenant-app-body.tenant-app-body[data-app-surface="workspace"][data-active-tab="calendar"] #app-stage-calendar#app-stage-calendar#app-stage-calendar .tenant-calendar-ops-row.is-head {
    display: none !important;
  }

  html body.tenant-app-body.tenant-app-body.tenant-app-body.tenant-app-body.tenant-app-body[data-app-surface="workspace"][data-active-tab="calendar"] #app-stage-calendar#app-stage-calendar#app-stage-calendar #app-calendar-day-list {
    width: 100% !important;
    min-width: 0 !important;
    padding: 0 0 12px !important;
  }

  html body.tenant-app-body.tenant-app-body.tenant-app-body.tenant-app-body.tenant-app-body[data-app-surface="workspace"][data-active-tab="calendar"] #app-stage-calendar#app-stage-calendar#app-stage-calendar .tenant-calendar-ops-row:not(.is-head) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 5px 10px !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 10px 12px !important;
  }

  html body.tenant-app-body.tenant-app-body.tenant-app-body.tenant-app-body.tenant-app-body[data-app-surface="workspace"][data-active-tab="calendar"] #app-stage-calendar#app-stage-calendar#app-stage-calendar .tenant-calendar-ops-row:not(.is-head) > strong,
  html body.tenant-app-body.tenant-app-body.tenant-app-body.tenant-app-body.tenant-app-body[data-app-surface="workspace"][data-active-tab="calendar"] #app-stage-calendar#app-stage-calendar#app-stage-calendar .tenant-calendar-ops-row:not(.is-head) > .tenant-calendar-context-cell {
    grid-column: 1 !important;
    min-width: 0 !important;
  }

  html body.tenant-app-body.tenant-app-body.tenant-app-body.tenant-app-body.tenant-app-body[data-app-surface="workspace"][data-active-tab="calendar"] #app-stage-calendar#app-stage-calendar#app-stage-calendar .tenant-calendar-ops-row:not(.is-head) > button {
    grid-column: 2 !important;
    grid-row: 1 / span 2 !important;
    align-self: center !important;
    min-width: 76px !important;
    min-height: 44px !important;
  }

  html body.tenant-app-body.tenant-app-body.tenant-app-body.tenant-app-body.tenant-app-body[data-app-surface="workspace"][data-active-tab="calendar"] #app-stage-calendar#app-stage-calendar#app-stage-calendar .tenant-calendar-empty-state-actionable {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* Final protected Mail desktop geometry. Keep at EOF so historical cascade
   layers cannot collapse the local Gmail-style sidebar back into the rail. */
@media (min-width: 801px) {
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-workspace-frame#app-workspace-frame#app-workspace-frame#app-workspace-frame#app-workspace-frame {
    grid-template-columns: calc(var(--communications-rail-width) + 220px) minmax(0, 1fr) !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-workspace-sidebar#app-workspace-sidebar#app-workspace-sidebar#app-workspace-sidebar#app-workspace-sidebar {
    width: calc(var(--communications-rail-width) + 220px) !important;
    min-width: calc(var(--communications-rail-width) + 220px) !important;
    max-width: calc(var(--communications-rail-width) + 220px) !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-workspace-sidebar .tenant-workspace-compose-panel {
    display: block !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .tenant-mail-more,
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .tenant-mail-more > summary {
    display: block !important;
    visibility: visible !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .tenant-mailbox-details {
    display: block !important;
    visibility: visible !important;
    margin: 0 8px 8px !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .tenant-mailbox-details > summary {
    display: flex !important;
    visibility: visible !important;
    min-height: 36px !important;
    padding: 0 12px !important;
    align-items: center !important;
    border-radius: 18px !important;
    background: #eaf1fb !important;
    cursor: pointer !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .tenant-mailbox-list {
    display: grid !important;
    max-height: 260px !important;
    margin-top: 5px !important;
    overflow-y: auto !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .folder-btn::before,
  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail .tenant-mail-attachments::before {
    display: none !important;
    content: none !important;
  }

  html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-mail-rail :is(.folder-btn,.tenant-mail-attachments) > svg {
    display: block !important;
    width: 20px !important;
    min-width: 20px !important;
    height: 20px !important;
    margin-right: 12px !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.6 !important;
  }
}

html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-workspace-surface#app-workspace-surface#app-workspace-surface#app-workspace-surface {
  grid-template-rows: minmax(0, 1fr) !important;
}

html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-workspace-stage-header#app-workspace-stage-header#app-workspace-stage-header#app-workspace-stage-header {
  display: none !important;
  visibility: hidden !important;
}

html body.tenant-app-body[data-app-surface="workspace"][data-active-tab="inbox"] #app-workspace-filter-btn {
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
}
