body:has(#pageContent:not([hidden]) .staff-workspace) > :is(.site-navigation,.site-footer,#consentPanel),
#pageContent:has(.staff-workspace) > .back-link { display: none; }

.marketplace #pageContent:has(.staff-workspace) {
  width: min(100%, 82rem) !important;
  margin-block: 0;
  padding: 0 !important;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.staff-workspace {
  width: min(100% - 2rem, 78rem);
  margin: 2rem auto 3rem;
  color: #243c30;
}

.staff-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .8rem 1.25rem;
}

.staff-heading h1, .staff-heading h2 { margin-block: .25rem; }
.marketplace #pageContent .staff-workspace h1 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
.marketplace #pageContent .staff-workspace h2 { font-size: clamp(1.2rem, 2.5vw, 1.55rem); }
.staff-identity { display: flex; align-items: center; gap: .65rem; }
.staff-identity img { flex: none; border-radius: .6rem; }
.staff-heading small { color: #41624e; font-weight: 650; }
.staff-heading label { min-width: 8rem; }
.staff-heading label span, .staff-form label span, .staff-filters label span { display: block; margin-block-end: .3rem; }
.staff-heading.surface { border-block-start: 4px solid #476a50; }
.staff-access { width: min(100%, 34rem); margin: 1rem auto; }
.staff-access h2 { margin-block-start: 0; }
.staff-form { display: grid; align-items: start; gap: .8rem; max-width: 36rem; }
.staff-form .btn { justify-self: start; }
.staff-form .check { align-items: start; }
.staff-form .check span { display: inline; margin: 0; }
.staff-form [hidden] { display: none; }
.staff-form textarea { width: 100%; }
.staff-desk-nav { margin-block: 1rem; }
.staff-desk-nav [data-staff-sign-out] { margin-inline-start: auto; }
.staff-desk-nav [aria-pressed="true"] { color: #fff; background: #294737; border-color: #294737; }
.staff-stats { grid-template-columns: repeat(5, minmax(0,1fr)); }
.staff-panel, .staff-admin { min-width: 0; }
.staff-panel h2, .staff-admin > h3 { margin-block-start: 0; }
.staff-admin [data-staff-history-panel] { margin-block-start: 2rem; scroll-margin-top: 5rem; }
.staff-filters { display: flex; flex-wrap: wrap; gap: .65rem; align-items: end; margin-block: 0 1rem; }
.staff-filters label { min-width: 9.5rem; flex: 1 1 10rem; }
.staff-filters .field { width: 100%; }
.staff-filters [type="date"] { min-width: 0; }
.staff-actions, .staff-pager { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.staff-pager { margin-block-start: .65rem; }
.staff-pager[hidden] { display: none; }
.staff-notice { padding: .65rem .9rem; margin-block: 0 .75rem; border-radius: .65rem; background: #eef4e9; color: #1e4933; }
.staff-notice.is-error { background: #fbeaec; color: #872c3e; }
.staff-empty { color: #46594b; }
.staff-table-scroll { max-width: 100%; overflow-x: auto; }
.staff-table { width: 100%; border-collapse: collapse; text-align: start; font-size: .91rem; }
.staff-table th, .staff-table td { text-align: start; border-block-end: 1px solid #dee6db; padding: .65rem .55rem; vertical-align: middle; }
.staff-table thead { background: #f2f5ee; }
.staff-table td small { display: block; color: #52645a; margin-block-start: .2rem; overflow-wrap: anywhere; }
.staff-table td a, .staff-details dd { overflow-wrap: anywhere; }
.staff-table td.staff-ad-name { min-width: 13rem; }
.staff-ad-name img { width: 4rem; height: 3rem; border-radius: .45rem; object-fit: cover; vertical-align: middle; margin-inline-end: .45rem; }
.staff-ad-name img + span { display: inline-block; max-width: 13rem; vertical-align: middle; }
.staff-status { display: inline-block; padding: .2rem .45rem; border-radius: .4rem; background: #edf0eb; color: #334a3b; white-space: nowrap; }
.staff-status:is([data-status="active"],[data-status="ai_approved"],[data-status="manually_approved"]) { background: #e2f1e2; color: #284f36; }
.staff-status:is([data-status="suspended"],[data-status="pending"],[data-status="ai_review_required"],[data-status="ai_error"]) { background: #fbf0d4; color: #664b1e; }
.staff-status:is([data-status="revoked"],[data-status="safety_hold"],[data-status="manually_rejected"],[data-status="removed"]) { background: #f9e7e8; color: #822c3f; }
.staff-review-dialog { width: min(100% - 1.5rem, 66rem); max-height: calc(100dvh - 1.5rem); overflow-y: auto; border: 1px solid #bfcbbd; border-radius: 1rem; padding: 1.2rem; background: #fffdf8; color: #243c30; }
.staff-review-dialog::backdrop { background: rgb(20 42 30 / .55); }
.staff-review-dialog .staff-heading { margin-block-end: 1rem; }
.staff-details { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,11rem),1fr)); gap: .8rem; margin: .5rem 0 1rem; }
.staff-details dt { font-weight: 650; }
.staff-details dd { margin: .2rem 0 0; }
.staff-previews h3 { margin-block: 0 .35rem; }
.staff-previews .ad-close { display: none; }
.staff-previews > :last-child { width: min(100%, 24rem); }

@media (max-width: 880px) {
  .staff-stats { grid-template-columns: repeat(auto-fit, minmax(8rem,1fr)); }
}

@media (max-width: 520px) {
  .staff-workspace { width: calc(100% - 1rem); margin-block: .5rem 1.5rem; }
  .staff-desk-nav [data-staff-sign-out] { margin-inline-start: 0; }
  .staff-filters button { width: 100%; }
  .staff-table { min-width: 38rem; }
}
