/* Desktop task navigation keeps the shared Roundcube shell in place and
   renders mail, contacts, and settings inside one reusable same-origin frame. */
body.hn-desktop.qq-partial-active #layout {
  min-width: 0;
}

body.hn-desktop.qq-partial-active #layout > #layout-sidebar {
  width: 218px !important;
  min-width: 218px !important;
  max-width: 218px !important;
  flex: 0 0 218px !important;
}

body.hn-desktop.qq-partial-active #layout > #layout-sidebar .qq-groups-col {
  display: none !important;
}

body.hn-desktop.qq-partial-active #layout > #layout-sidebar .qq-nav-col {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
}

body.hn-desktop.task-mail.action-compose.qq-partial-active #layout > #layout-sidebar {
  display: none !important;
}

body.hn-desktop.qq-partial-active #layout > #layout-list,
body.hn-desktop.qq-partial-active #layout > #layout-content {
  display: none !important;
}

#qq-partial-host {
  position: relative;
  display: none;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #f5f7fa;
}

body.hn-desktop.qq-partial-active #qq-partial-host {
  display: flex;
}

#qq-partial-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  border: 0;
  background: #f5f7fa;
}

#qq-partial-loading {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  color: #68798b;
  background: #f5f7fa;
  font-size: 14px;
}

#qq-partial-host.is-loading #qq-partial-loading {
  display: flex;
}

#qq-partial-loading::before {
  width: 18px;
  height: 18px;
  margin-right: 10px;
  border: 2px solid #c8d8e8;
  border-top-color: #287cff;
  border-radius: 50%;
  content: "";
  animation: qq-partial-spin .7s linear infinite;
}

@keyframes qq-partial-spin {
  to { transform: rotate(360deg); }
}

/* The embedded page uses the parent's top bar and global navigation. */
body.hn-desktop.hn-task-frame {
  min-width: 0 !important;
  height: 100%;
  padding-top: 0 !important;
  overflow: hidden;
}

body.hn-desktop.hn-task-frame #qq-topbar,
body.hn-desktop.hn-task-frame #qq-tabbar {
  display: none !important;
}

body.hn-desktop.hn-task-frame #layout {
  width: 100%;
  height: 100%;
  min-width: 0;
  padding-top: 0 !important;
}

body.hn-desktop.hn-task-frame.task-addressbook #layout-sidebar {
  width: 342px !important;
  min-width: 342px !important;
  max-width: 342px !important;
  flex: 0 0 342px !important;
}

body.hn-desktop.hn-task-frame.task-settings #layout-sidebar {
  width: 212px !important;
  min-width: 212px !important;
  max-width: 212px !important;
  flex: 0 0 212px !important;
}

body.hn-desktop.hn-task-frame.task-addressbook #layout-sidebar > .qq-nav-col,
body.hn-desktop.hn-task-frame.task-settings #layout-sidebar > .qq-nav-col {
  display: none !important;
}

body.hn-desktop.hn-task-frame.task-addressbook #layout-sidebar > .qq-groups-col,
body.hn-desktop.hn-task-frame.task-settings #layout-sidebar > .qq-groups-col {
  display: flex !important;
  flex: 1 1 auto;
  min-width: 0;
}

body.hn-desktop.hn-task-frame.task-mail #layout-sidebar:not(.sidebar-right),
body.hn-desktop.hn-task-frame.task-mail #qq-nav-rail {
  display: none !important;
}

/* Search bars were positioned relative to the old full-page left rail. */
body.hn-desktop.hn-task-frame.task-mail.action-none .qq-mail-searchbar,
body.hn-desktop.hn-task-frame.task-addressbook .qq-contact-searchbar {
  left: 20px !important;
  max-width: calc(100vw - 450px) !important;
}

html.dark-mode #qq-partial-host,
html.dark-mode #qq-partial-loading,
html.dark-mode #qq-partial-frame {
  background: #21292c;
}

html.dark-mode #qq-partial-loading {
  color: #c5d1d3;
}
