/* Reversible desktop chrome trial. Navigation type and button targets stay intact. */
@media screen and (min-width: 769px) {
  body.pc-ui-preview:not(.mobile-ui-active) {
    --desktop-sidebar-width: 176px;
    --desktop-topbar-height: 48px;
  }

  body.pc-ui-preview:not(.mobile-ui-active) .main-view {
    grid-template-columns: var(--desktop-sidebar-width) minmax(0, 1fr);
    grid-template-rows: var(--desktop-topbar-height) minmax(calc(100vh - var(--desktop-topbar-height)), auto);
  }

  body.pc-ui-preview:not(.mobile-ui-active) .main-view > .topbar {
    min-height: var(--desktop-topbar-height);
  }

  body.pc-ui-preview:not(.mobile-ui-active) .main-view > .tabs {
    width: var(--desktop-sidebar-width);
    padding-right: 8px;
    padding-left: 8px;
  }

  body.pc-ui-preview:not(.mobile-ui-active) .desktop-sidebar-brand {
    min-height: var(--desktop-topbar-height);
    margin-right: -8px;
    margin-left: -8px;
    padding-right: 12px;
    padding-left: 12px;
    gap: 8px;
  }

  body.pc-ui-preview:not(.mobile-ui-active) .tabs .desktop-nav-items { padding-left: 12px; }
  body.pc-ui-preview:not(.mobile-ui-active) .tabs .desktop-nav-group-toggle { padding-right: 8px; padding-left: 8px; }

  /* Keep each page's existing scrolling model, changing only its header track. */
  body.pc-ui-preview:not(.mobile-ui-active) .main-view:has(> .business-return-bar, > .task-source-return-bar) {
    grid-template-rows: var(--desktop-topbar-height) auto minmax(calc(100vh - var(--desktop-topbar-height) - 65px), auto);
  }

  body.pc-ui-preview:not(.mobile-ui-active) .main-view:has(> #content > :is(.dw-classic-page, .attendance-personal-page, .report-workspace), .task-detail-compact) {
    grid-template-rows: var(--desktop-topbar-height) minmax(0, 1fr);
  }

  body.pc-ui-preview:not(.mobile-ui-active) .main-view:has(.task-detail-compact):has(> .business-return-bar, > .task-source-return-bar) {
    grid-template-rows: var(--desktop-topbar-height) auto minmax(0, 1fr);
  }

  body.pc-ui-preview:not(.mobile-ui-active) :is(.business-return-bar, .task-source-return-bar, .project-detail-navigation),
  body.pc-ui-preview:not(.mobile-ui-active) .receivable-list-panel > .section-head,
  body.pc-ui-preview:not(.mobile-ui-active) .finance-a-receivables.receivable-workspace .receivable-ledger-table > thead > tr > th {
    top: var(--desktop-topbar-height);
  }

  body.pc-ui-preview:not(.mobile-ui-active) .mw-review-clarity { --mw-review-top: var(--desktop-topbar-height); }
  body.pc-ui-preview:not(.mobile-ui-active) .main-view:has(> .business-return-bar) .mw-review-clarity { --mw-review-top: calc(var(--desktop-topbar-height) + 65px); }
}
