/* Authenticated staff shell. Review/edit/activity contents retain their own styles. */
body.staff-workspace-ready {
  display: block;
  padding: 0;
  background: #f9fcfd;
}
body.staff-workspace-ready .panel.portal-footer-shell {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: linear-gradient(115deg, #fff, #f8fbfc);
}
.staff-workspace-ready #staff-auth-header {
  display: flex;
  min-height: 82px;
  margin: 0;
  padding: 12px 24px;
  border-bottom: 1px solid #dbe8ed;
  background: #fff;
}
.staff-workspace-ready #staff-auth-header h1 {
  font-size: 23px;
  line-height: 1.2;
  letter-spacing: 0.5px;
}
.staff-workspace-ready #staff-auth-header img {
  width: 44px;
  height: 44px;
}
.staff-workspace-ready #staff-auth-header .sub {
  font-size: 14px;
  margin: 3px 0 0;
}
.staff-shell-signout {
  display: none;
}
.staff-workspace-ready .staff-shell-signout {
  display: block;
  width: auto;
  margin: 0;
}
.staff-layout {
  min-width: 0;
}
.staff-sidebar {
  display: none;
}
.staff-workspace-ready .staff-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  flex: 1;
}
.staff-workspace-ready .staff-sidebar {
  display: grid;
  align-content: start;
  gap: 8px;
  position: sticky;
  top: 0;
  align-self: start;
  min-height: calc(100vh - 82px);
  border-right: 1px solid var(--color-border);
  padding: 16px 9px;
  background: #fcfefe;
}
.staff-sidebar button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  width: 100%;
  margin: 0;
  padding: 10px 14px;
  border-radius: 9px;
  background: transparent;
  color: var(--color-brand);
  font-size: 14px;
  text-align: left;
}
.staff-sidebar button[hidden] {
  display: none;
}
.staff-sidebar svg {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
}
.staff-sidebar button.is-active {
  background: #29505d;
  color: white;
  box-shadow: 0 2px 5px #294e5920;
}
.staff-workspace-ready #staff-workspace {
  min-width: 0;
  padding: 20px 28px 32px;
}
.staff-workspace-ready #staff-home > .staff-header,
.staff-workspace-ready #admin-settings > .staff-header,
.staff-workspace-ready .offers-account-heading {
  display: none;
}
.staff-workspace-ready #offer-details > .workspace-header {
  display: none;
}
.staff-workspace-ready .workspace-header:not(.workspace-header-details) {
  grid-template-columns: 1fr;
  row-gap: 0;
}
.staff-workspace-ready
  .workspace-header:not(.workspace-header-details)
  .workspace-heading
  h2 {
  grid-row: 1;
}
.staff-workspace-ready .workspace-header::after {
  display: none;
}
.staff-workspace-ready #offer-details .details-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 24px;
  position: relative;
  padding: 0 0 12px;
  border: 0;
  background: transparent;
}
.staff-offer-heading {
  min-width: 0;
}
.staff-offer-heading > p {
  margin: 0 0 8px;
}
.staff-workspace-ready #offer-details .details-toolbar .offer-workspace-title {
  margin: 0 0 8px;
  font-family: "Libre Baskerville", serif;
  color: var(--color-brand);
  font-size: 26px;
  line-height: 1.4;
  text-align: left;
  overflow-wrap: anywhere;
}
.staff-workspace-ready #offer-details .offer-admin-actions {
  align-self: start;
  margin-top: 3px;
}
.staff-workspace-ready .offer-last-edited {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.5;
}
.staff-workspace-ready #staff-account {
  max-width: 750px;
}
.staff-workspace-ready #staff-account h2 {
  font-family: "Libre Baskerville", serif;
  color: var(--color-brand);
}
.staff-account-card {
  padding: 20px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: #fff;
}
.staff-workspace-ready .portal-footer-shell > portal-footer {
  margin: 0;
  padding: 0 0 20px 190px;
}
.staff-workspace-ready .portal-footer-shell > #message {
  margin: 0 28px 12px 218px;
}

/* Pair each party with its representing agents, without changing the grid. */
#offer-details .review-buying-side {
  background: #edf5f8;
  border-color: #cddfe8;
}
#offer-details .review-buying-side .review-card {
  background: #f5fafc;
  border-color: #cddfe8;
}
#offer-details .review-listing-side {
  background: #eaf5ed;
  border-color: #c9dfcf;
}

/* Offer actions and their status share one compact header area. */
.staff-offer-actions {
  min-width: 0;
  width: 320px;
  max-width: 100%;
  align-self: start;
}
.staff-workspace-ready #offer-details .offer-admin-actions button {
  padding: 7px 11px;
  font-size: 13px;
  min-height: 0;
}
#offer-details #details-content > .review-group:first-child {
  border-top: 0;
  padding-top: 0;
}
.staff-workspace-ready #staff-auth-header {
  position: sticky;
  top: 0;
  height: 82px;
  z-index: 40;
}

/* PDF workspace uses the staff shell; floating palettes retain shared styles. */
.staff-workspace-ready #pdf-workspace > .workspace-header {
  display: block;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
}
.staff-workspace-ready #pdf-workspace-title {
  margin: 0 0 10px;
}
.pdf-offer-context {
  margin: 0;
  color: var(--color-brand);
  font-size: 16px;
  line-height: 1.4;
}
.staff-sidebar .pdf-sidebar-modes {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  margin: -2px 0 8px 22px;
  padding: 0;
  background: transparent;
}
.staff-sidebar .pdf-sidebar-modes[hidden],
#pdf-sidebar-context[hidden],
#pdf-sidebar-package[hidden] {
  display: none;
}
.staff-sidebar .pdf-sidebar-modes button {
  min-width: 0;
  min-height: 34px;
  padding: 7px 9px;
  font-size: 13px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--color-brand);
}
.staff-sidebar .pdf-sidebar-modes button[aria-selected="true"] {
  background: #e4efef;
  color: #195568;
  box-shadow: none;
}
#pdf-sidebar-context {
  min-width: 0;
}
#pdf-sidebar-tools,
#pdf-sidebar-package {
  border-top: 1px solid var(--color-border);
  margin-top: 12px;
  padding-top: 12px;
}
#pdf-sidebar-tools .pdf-tools-panel:not(.floating) {
  display: block;
  position: static;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  container-type: normal;
}
#pdf-sidebar-tools .pdf-tools-panel:not(.floating) .pdf-tools-handle {
  display: block;
  margin: 0 0 8px;
  padding: 0 9px;
  cursor: default;
}
#pdf-sidebar-tools .pdf-tools-panel:not(.floating) .pdf-tools-heading {
  display: block;
  width: auto;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
#pdf-sidebar-tools .pdf-tools-panel:not(.floating) .pdf-tools-handle > svg,
#pdf-sidebar-tools
  .pdf-tools-panel:not(.floating)
  :is(
    .pdf-tools-section,
    .pdf-tools-divider,
    #pdf-tools-expand,
    #pdf-tools-dock
  ) {
  display: none;
}
#pdf-sidebar-tools .pdf-tools-panel:not(.floating) .pdf-tools-actions {
  display: grid;
  gap: 2px;
  overflow: visible;
}
#pdf-sidebar-tools .pdf-tools-panel:not(.floating) .pdf-tool-button {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  margin: 0;
  padding: 7px 9px;
  gap: 9px;
  justify-content: start;
  border-radius: 7px;
  background: transparent;
  font-size: 13px;
}
#pdf-sidebar-tools .pdf-tools-panel:not(.floating) .pdf-tool-label {
  display: inline;
  white-space: normal;
  text-align: left;
}
#pdf-sidebar-tools
  .pdf-tools-panel:not(.floating)
  .pdf-tool-button
  :is(svg, .pdf-tool-icon) {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}
#pdf-sidebar-tools > button {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 12px;
  gap: 9px;
}
#pdf-sidebar-fields {
  border-top: 1px solid var(--color-border);
  border-radius: 0;
  margin-top: 8px;
  padding-top: 12px;
  align-items: flex-start;
}
.pdf-sidebar-fields-label {
  display: grid;
  gap: 3px;
}
#pdf-sidebar-field-count {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--color-muted);
}
#pdf-sidebar-package h3 {
  margin: 0 9px 9px;
  font:
    600 11px Arial,
    sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-brand);
}
#pdf-review-progress {
  display: block;
  font-size: 12px;
  margin: 0 9px 6px;
}
#pdf-package-progress {
  display: block;
  width: calc(100% - 18px);
  height: 8px;
  margin: 0 9px 12px;
  accent-color: #76ad9e;
}
#pdf-sidebar-package #pdf-tool-generate {
  min-height: 36px;
  padding: 8px;
  font-size: 12px;
  gap: 7px;
  background: #29505d;
  color: white;
}
#pdf-sidebar-package #pdf-tool-generate svg {
  width: 20px;
  height: 20px;
}
.staff-workspace-ready #pdf-workspace .pdf-file {
  margin: 0;
}
.staff-workspace-ready #pdf-workspace .pdf-file-body {
  padding: 0;
  border: 0;
  background: transparent;
}
#pdf-workspace-selection {
  position: relative;
  margin-bottom: 12px;
  padding: 6px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}
#pdf-workspace-selection > summary {
  width: fit-content;
  padding: 3px 6px;
  color: var(--color-brand);
  cursor: pointer;
  font-size: 12px;
  list-style: none;
}
#pdf-workspace-selection > summary::-webkit-details-marker {
  display: none;
}
#pdf-workspace-selection > summary::before {
  content: "▸";
  margin-right: 5px;
}
#pdf-workspace-selection[open] > summary {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 0;
  line-height: 1;
  text-align: center;
}
#pdf-workspace-selection[open] > summary::before {
  content: "▾";
  margin: 0;
  font-size: 13px;
  line-height: 1;
  pointer-events: none;
}
#pdf-workspace-selection .pdf-document-selectors > .pdf-toolbar label {
  padding-right: 30px;
}
.staff-workspace-ready #pdf-workspace-selection .pdf-document-selectors {
  margin: 0;
}
.staff-workspace-ready
  #pdf-workspace-selection
  .pdf-document-selectors
  :is(#pdf-fill-tools, .pdf-toolbar) {
  border: 0;
  background: transparent;
  padding: 4px 6px;
}
#pdf-sidebar-popout svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}
.staff-sidebar .pdf-tools-panel.floating #pdf-tools-expand svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.staff-workspace-ready #pdf-workspace .pdf-document-selectors {
  margin: 8px 0;
}
.staff-workspace-ready
  #pdf-workspace:is(.pdf-offer-bound, [data-folder-mode="build"])
  .pdf-document-selectors {
  grid-template-columns: minmax(0, 1fr);
}
.staff-workspace-ready #pdf-workspace .pdf-document-selectors .pdf-toolbar {
  position: relative;
  z-index: auto;
  margin: 0;
}
.staff-workspace-ready #pdf-workspace .pdf-document-selectors [hidden] {
  display: none;
}
.staff-workspace-ready #pdf-workspace #pdf-sticky-controls {
  top: var(--pdf-sticky-top, 82px);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 4px;
}
.staff-workspace-ready #pdf-review-strip {
  position: static;
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  background: white;
}
.staff-workspace-ready .pdf-document-tab {
  flex: 0 0 190px;
  max-width: 250px;
  border-radius: 8px 8px 0 0;
}
.staff-workspace-ready .pdf-document-tab .pdf-document-tab-label {
  font-size: 13px;
  padding: 9px 7px;
}
.staff-workspace-ready #pdf-workspace .pdf-document-navigation {
  margin: 0;
  padding: 6px 0;
  background: white;
  border: 0;
  border-radius: 0;
}
.staff-workspace-ready #pdf-workspace .pdf-navigation-controls {
  gap: 8px;
  flex-wrap: wrap;
}
.staff-workspace-ready #pdf-workspace .pdf-review-summary {
  margin-left: auto;
  gap: 6px;
}
.staff-workspace-ready #pdf-workspace .pdf-review-actions {
  gap: 6px;
  flex-wrap: wrap;
}
.staff-workspace-ready #pdf-workspace .pdf-review-actions > button {
  width: auto;
  margin: 0;
  padding: 7px 9px;
  font-size: 12px;
}
.staff-workspace-ready #pdf-workspace .pdf-workshop-properties:not(.floating) {
  margin: 3px 0 0;
  border-radius: 8px;
  box-shadow: none;
}
.staff-workspace-ready #pdf-workspace #pdf-builder-tools {
  margin: 0;
}
.staff-workspace-ready #pdf-workspace .pdf-fields-panel {
  border-color: var(--color-border);
  background: #f3f7f8;
  border-radius: 8px;
}
.staff-workspace-ready #pdf-workspace .pdf-viewer {
  margin-top: 8px;
  height: 72dvh;
  min-height: 320px;
  max-height: none;
}

.staff-workspace-ready #pdf-workspace .pdf-fields-panel-heading {
  grid-template-columns: auto minmax(120px, 1fr) auto;
}
.staff-workspace-ready #pdf-workspace .pdf-fields-panel-heading .pdf-field-nav {
  grid-column: 2;
  min-width: 0;
  width: auto;
}
.staff-workspace-ready #pdf-workspace #pdf-layout-status {
  grid-column: 3;
}

/* PDF uses the same full-page shell/header with smaller workspace gutters. */
.staff-workspace-ready #staff-workspace:has(#pdf-workspace:not(.hidden)) {
  padding-inline: 12px;
}
.staff-sidebar .pdf-tools-panel.floating .pdf-tool-button svg {
  flex: none;
}

/* Document Fields is launched from the sidebar; no duplicate workspace bar. */
.staff-workspace-ready #pdf-field-navigator > summary {
  display: none;
}
.staff-workspace-ready #pdf-field-navigator:not([open]),
.staff-workspace-ready #pdf-field-navigator:has(.floating-slot) {
  display: none;
}

/* Working-package notices belong to Fill / Preview, including late save results. */
.staff-workspace-ready
  #pdf-workspace[data-folder-mode="build"]
  :is(#pdf-package-status, #pdf-package-retry, #pdf-package-reload) {
  display: none;
}

#pdf-fill-tools {
  position: relative;
}
#pdf-open-offer-document {
  width: auto;
  margin: 0;
  padding: 3px 7px;
  border: 1px solid var(--color-border);
  border-radius: 5px;
  background: var(--color-surface-muted);
  font-size: 11px;
}
.pdf-offer-selector-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 5px 9px;
  margin-bottom: 4px;
  padding-right: 28px;
}
.pdf-offer-selector-heading label {
  margin: 0;
  font-size: 13px;
}
#pdf-offer-document-dialog {
  width: min(640px, calc(100vw - 32px));
  max-height: 80dvh;
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 16px;
}
#pdf-offer-document-dialog::backdrop {
  background: #29475a55;
}
.pdf-offer-document-choice {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 0;
  border-bottom: 1px solid var(--color-border);
}
.pdf-offer-document-choice span {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.pdf-offer-document-choice button {
  width: auto;
  min-height: 26px;
  margin: 0;
  padding: 4px 9px;
  font-size: 12px;
}
#pdf-offer-document-heading {
  margin: 0 30px 10px 0;
  font-size: 17px;
}
#pdf-offer-document-error:empty {
  display: none;
}
#pdf-offer-document-close {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 28px;
  height: 28px;
  min-height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-brand);
  font-size: 23px;
  line-height: 1;
}

.staff-workspace-ready
  #pdf-workspace
  #pdf-document-comments
  .document-comment-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-height: 28px;
  margin: 0;
  padding: 4px;
  vertical-align: middle;
}
.staff-workspace-ready
  #pdf-workspace
  #pdf-document-comments
  .document-comment-button
  svg {
  width: 18px;
  height: 18px;
}
