/* Match the compact desktop workspace while preserving native mobile sizing. */
@supports (zoom: .8) {
  @media (min-width: 1100px) {
    html[data-workspace-density="compact"] {
      zoom: .8;
      --workspace-viewport-height: calc(100dvh / .8);
    }

    /* Viewport units do not expand with root zoom. Keep scrollable rails and
       drawers fitted to the full screen instead of leaving a gap below them. */
    html[data-workspace-density="compact"] :is(.nb-radar .side, .nb-radar .rail, .ws-side, .ws-rail) {
      height: calc(var(--workspace-viewport-height) - 56px) !important;
    }
    html[data-workspace-density="compact"] .drawer {
      height: var(--workspace-viewport-height) !important;
    }
    html[data-workspace-density="compact"] :is(.nb-modal, .sg-modal, .sg-login-profile) {
      max-height: calc(var(--workspace-viewport-height) * .9);
    }
    html[data-workspace-density="compact"] .sg-qr-modal img {
      max-height: calc(var(--workspace-viewport-height) * .65);
    }
    html[data-workspace-density="compact"] :is(.ic-layout, .sb-layout) {
      min-height: calc(var(--workspace-viewport-height) - 56px);
    }
    html[data-workspace-density="compact"] :is(.ic-project-list, .ic-library .ic-project-list) {
      max-height: calc(var(--workspace-viewport-height) - 335px);
    }
    html[data-workspace-density="compact"] .sb-library {
      height: calc(var(--workspace-viewport-height) - 56px);
    }
    html[data-workspace-density="compact"] .sb-controls {
      max-height: calc(var(--workspace-viewport-height) - 96px);
    }
    html[data-workspace-density="compact"][data-workspace-page="chat"] body {
      height: var(--workspace-viewport-height);
    }
  }
}
