.erp-window-titlebar {
  display: none;
}

@media screen and (display-mode: window-controls-overlay) {
  :root {
    --erp-titlebar-height: calc(env(titlebar-area-y, 0px) + env(titlebar-area-height, 0px));
  }

  .erp-window-titlebar {
    position: fixed;
    z-index: 1000;
    top: env(titlebar-area-y, 0px);
    left: env(titlebar-area-x, 0px);
    display: flex;
    align-items: center;
    gap: 6px;
    box-sizing: border-box;
    width: env(titlebar-area-width, 0px);
    height: env(titlebar-area-height, 0px);
    overflow: hidden;
    padding-inline: min(12px, 3vw);
    background: #fff;
    color: #181b22;
    font: 650 10px system-ui, sans-serif;
    -webkit-app-region: drag;
    app-region: drag;
  }

  .erp-window-titlebar img {
    display: block;
    width: min(122px, calc(100% - 29px));
    height: auto;
    max-height: 75%;
    object-fit: contain;
  }

  body {
    padding-top: var(--erp-titlebar-height);
  }

  body .app-shell,
  body .login-page {
    min-height: calc(100dvh - var(--erp-titlebar-height));
  }

  body .sidebar,
  body .topbar {
    top: var(--erp-titlebar-height);
  }

  body .sidebar {
    height: calc(100dvh - var(--erp-titlebar-height));
  }

  body .modal-backdrop,
  body .print-modal,
  body .mobile-scrim {
    top: var(--erp-titlebar-height);
  }

  body .print-toolbar {
    top: calc(14px + var(--erp-titlebar-height));
  }
}
