/* Module-local Gmail-style navigation inside the persistent communications shell. */
@media (min-width: 901px) {
  html body.mail-body.mail-embedded.mail-embedded {
    width: 100% !important;
    height: 100dvh !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #f6f8fc !important;
  }

  html body.mail-body.mail-embedded.mail-embedded .mail-page {
    display: block !important;
    width: 100% !important;
    height: 100dvh !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  html body.mail-body.mail-embedded.mail-embedded .mail-pane-stack {
    display: block !important;
    width: 100% !important;
    height: 100dvh !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  html body.mail-body.mail-embedded.mail-embedded .mail-shell.mail-pane.is-active {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0 !important;
    width: 100% !important;
    height: 100dvh !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #f6f8fc !important;
  }

  html body.mail-body.mail-embedded.mail-embedded .mail-sidebar-panel {
    position: relative !important;
    grid-column: 1 !important;
    display: none !important;
    visibility: hidden !important;
  }

  html body.mail-body.mail-embedded.mail-embedded #mail-compose-btn.mail-compose-cta {
    display: flex !important;
    visibility: visible !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: auto !important;
    min-width: 138px !important;
    min-height: 52px !important;
    margin: 2px 0 14px !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, .18), 0 1px 3px rgba(60, 64, 67, .1) !important;
    pointer-events: auto !important;
  }

  html body.mail-body.mail-embedded.mail-embedded .mail-thread-panel {
    grid-column: 1 !important;
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 100dvh !important;
    min-height: 0 !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 16px 0 0 16px !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  html body.mail-body.mail-embedded.mail-embedded .mail-gmail-workspace {
    min-height: 0 !important;
    overflow: hidden !important;
  }

  html body.mail-body.mail-embedded.mail-embedded #mail-threads {
    min-height: 0 !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
  }

  /* The host owns global search, Compose, folder navigation and mailbox
     switching. Keep a single list toolbar inside the frame. */
  html body.mail-body.mail-embedded.mail-embedded .mail-workspace-toolbar,
  html body.mail-body.mail-embedded.mail-embedded .mail-thread-panel > .mail-panel-header {
    display: none !important;
    visibility: hidden !important;
  }

  html body.mail-body.mail-embedded.mail-embedded .mail-gmail-folder-strip {
    display: none !important;
  }

  html body.mail-body.mail-embedded.mail-embedded .mail-gmail-label-strip {
    display: none !important;
  }

  html body.mail-body.mail-embedded.mail-embedded #mail-threads > .mail-simple-consensus-toolbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    min-height: 48px !important;
    height: 48px !important;
    padding: 0 12px !important;
    border-bottom: 1px solid #e0e3e7 !important;
  }

  html body.mail-body.mail-embedded.mail-embedded #mail-threads > .mail-simple-consensus-toolbar :is(
    .mail-simple-advanced-search-btn,
    .mail-simple-compose-btn,
    .mail-simple-list-controls label,
    .mail-simple-list-controls [data-mail-simple-ai],
    .mail-simple-list-controls [data-mail-simple-settings]
  ) {
    display: none !important;
  }

  html body.mail-body.mail-embedded.mail-embedded #mail-threads > .mail-simple-consensus-toolbar .mail-simple-account-chip {
    display: flex !important;
    min-width: 0 !important;
    align-items: baseline !important;
    gap: 6px !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  html body.mail-body.mail-embedded.mail-embedded #mail-threads > .mail-simple-consensus-toolbar .mail-simple-account-chip small {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  html body.mail-body.mail-embedded.mail-embedded .mail-workspace-toolbar .mail-view-mode-toggle {
    display: none !important;
  }

  html body.mail-body.mail-embedded.mail-embedded #mail-threads > .mail-simple-consensus-toolbar .mail-visible-view-mode-toggle {
    display: inline-flex !important;
    justify-self: end !important;
    width: auto !important;
    min-width: 0 !important;
    height: 34px !important;
  }

  html body.mail-body.mail-embedded.mail-embedded :is(.mail-density-menu, .mail-reading-pane-menu) {
    display: none !important;
  }

  html body.mail-body.mail-embedded.mail-embedded[data-mail-view="gmail"] .mail-gmail-row-open {
    grid-template-columns: 34px minmax(132px, .76fr) minmax(220px, 3.7fr) minmax(72px, auto) minmax(88px, auto) !important;
    padding-right: 12px !important;
  }

  html body.mail-body.mail-embedded.mail-embedded[data-mail-view="gmail"] .mail-gmail-row-time {
    display: block !important;
    width: 88px !important;
    min-width: 84px !important;
    max-width: 88px !important;
    overflow: hidden !important;
    justify-self: end !important;
    text-align: right !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 900px) {
  html body.mail-body.mail-embedded.mail-embedded {
    width: 100% !important;
    height: 100dvh !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  html body.mail-body.mail-embedded.mail-embedded .mail-page,
  html body.mail-body.mail-embedded.mail-embedded .mail-pane-stack,
  html body.mail-body.mail-embedded.mail-embedded .mail-shell.mail-pane.is-active {
    width: 100% !important;
    height: 100dvh !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  html body.mail-body.mail-embedded.mail-embedded .mail-mobile-bottom-nav {
    display: none !important;
  }

  html body.mail-body.mail-embedded.mail-embedded :is(
    .mail-gmail-folder-strip,
    .mail-gmail-label-strip
  ) {
    display: none !important;
  }

  html body.mail-body.mail-embedded.mail-embedded .mail-workspace-toolbar,
  html body.mail-body.mail-embedded.mail-embedded .mail-thread-panel > .mail-panel-header {
    display: none !important;
    visibility: hidden !important;
  }

  html body.mail-body.mail-embedded.mail-embedded #mail-threads > .mail-simple-consensus-toolbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    width: 100% !important;
    min-height: 48px !important;
    height: 48px !important;
    padding: 0 8px !important;
    align-items: center !important;
    overflow: hidden !important;
    border-bottom: 1px solid #e0e3e7 !important;
  }

  html body.mail-body.mail-embedded.mail-embedded #mail-threads > .mail-simple-consensus-toolbar .mail-simple-account-chip {
    display: flex !important;
    min-width: 0 !important;
    overflow: hidden !important;
    align-items: baseline !important;
    gap: 5px !important;
  }

  html body.mail-body.mail-embedded.mail-embedded #mail-threads > .mail-simple-consensus-toolbar .mail-simple-account-chip small {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  html body.mail-body.mail-embedded.mail-embedded #mail-threads > .mail-simple-consensus-toolbar .mail-visible-view-mode-toggle,
  html body.mail-body.mail-embedded.mail-embedded #mail-threads > .mail-simple-consensus-toolbar :is(.mail-simple-advanced-search-btn,.mail-simple-compose-btn,.mail-simple-list-controls) {
    display: none !important;
  }
}
