.people-os {
  color: var(--pw-text, var(--text));
  display: grid;
  gap: 24px;
  min-width: 0;
}

.people-os .eyebrow {
  color: var(--pw-steel-600, var(--primary));
  display: block;
  font-size: .875rem;
  font-weight: 800;
  letter-spacing: .08em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.people-kpis {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.people-kpis > a {
  background: var(--pw-surface, var(--surface));
  border: 1px solid var(--pw-border, var(--border));
  border-radius: 16px;
  color: var(--pw-text, var(--text));
  display: flex;
  flex-direction: column;
  min-height: 122px;
  padding: 18px;
  text-decoration: none;
}
.people-kpis > a:hover { border-color: var(--pw-steel-600, var(--primary)); }
.people-kpis strong { font-size: clamp(1.6rem, 2.5vw, 2.1rem); font-variant-numeric: tabular-nums; line-height: 1; }
.people-kpis span { font-size: .95rem; font-weight: 750; margin-top: auto; padding-top: 14px; }
.people-kpis small { color: var(--pw-text-muted, var(--text-muted)); font-size: .875rem; margin-top: 4px; }

.people-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  min-height: 640px;
}

.people-master,
.people-detail-card,
.people-detail-empty {
  background: var(--pw-surface, var(--surface));
  border: 1px solid var(--pw-border, var(--border));
  border-radius: 18px;
}

.people-master { align-self: start; min-width: 0; overflow: hidden; }
.people-master__tools { background: color-mix(in srgb, var(--pw-surface-muted, var(--surface-2)) 64%, transparent); border-bottom: 1px solid var(--pw-border, var(--border)); display: grid; gap: 12px; padding: 16px; }
.people-master__tools > p { color: var(--pw-text-muted, var(--text-muted)); font-size: .875rem; margin: 0; }
.people-record-list { max-height: min(68vh, 820px); overflow: auto; overscroll-behavior: contain; }

.people-record {
  align-items: center;
  border-bottom: 1px solid var(--pw-border, var(--border));
  color: var(--pw-text, var(--text));
  display: grid;
  gap: 12px;
  grid-template-columns: 44px minmax(0, 1fr) auto 20px;
  min-height: 88px;
  padding: 12px 14px;
  text-decoration: none;
}
.people-record:last-child { border-bottom: 0; }
.people-record:hover,
.people-record.is-active { background: color-mix(in srgb, var(--pw-navy-800, var(--primary)) 8%, transparent); }
.people-record.is-active { box-shadow: inset 3px 0 0 var(--pw-navy-800, var(--primary)); }

.people-avatar {
  align-items: center;
  background: color-mix(in srgb, var(--pw-navy-800, var(--primary)) 12%, var(--pw-surface, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--pw-navy-800, var(--primary)) 18%, var(--pw-border, var(--border)));
  border-radius: 14px;
  color: var(--pw-navy-800, var(--primary));
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 1.05rem;
  font-weight: 800;
  height: 44px;
  justify-content: center;
  width: 44px;
}
.people-avatar--large { border-radius: 18px; font-size: 1.4rem; height: 58px; width: 58px; }

.people-record__copy { display: flex; flex-direction: column; min-width: 0; }
.people-record__copy strong { font-size: .98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people-record__copy small,
.people-record__copy em { color: var(--pw-text-muted, var(--text-muted)); font-size: .875rem; font-style: normal; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people-record__copy em { margin-top: 7px; }

.people-status { align-items: center; display: flex; font-size: .875rem; font-weight: 750; gap: 6px; }
.people-status > span { background: currentColor; border-radius: 99px; height: 8px; width: 8px; }
.people-status--complete { color: var(--pw-success, #157347); }
.people-status--missing,
.people-status--atm { color: var(--pw-warning, #9a5b00); }

.people-detail { min-width: 0; }
.people-detail-card { overflow: hidden; }
.people-detail-card__head { align-items: flex-start; border-bottom: 1px solid var(--pw-border, var(--border)); display: flex; gap: 14px; justify-content: space-between; padding: 22px 24px; }
.people-detail-card__head > div { flex: 1; min-width: 0; }
.people-detail-card__head > div > span { color: var(--pw-text-muted, var(--text-muted)); display: block; font-size: .875rem; font-weight: 750; margin-bottom: 4px; }
.people-detail-card__head h2 { font-size: clamp(1.35rem, 2vw, 1.8rem); margin: 0; }
.people-detail-card__head p { color: var(--pw-text-muted, var(--text-muted)); font-size: .9rem; margin: 6px 0 0; }
.people-mobile-back { display: none; }

.people-form { padding: 22px 24px 24px; }
.people-form fieldset { border: 0; margin: 0; padding: 0; }
.people-form legend,
.people-benefits h3 { font-size: 1.05rem; font-weight: 750; margin: 0 0 14px; }
.people-field-grid,
.people-benefit-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.people-field--wide { grid-column: 1 / -1; }
.people-field { display: grid; gap: 7px; }
.people-field { min-width: 0; }
.people-field > span { font-size: .9rem; font-weight: 750; }
.people-field input,
.people-field textarea,
.people-field select {
  background: var(--pw-surface, var(--surface));
  border: 1px solid var(--pw-border, var(--border));
  border-radius: 12px;
  color: var(--pw-text, var(--text));
  font: inherit;
  font-size: 1rem;
  min-height: 48px;
  min-width: 0;
  max-width: 100%;
  padding: 10px 12px;
  resize: vertical;
}
.people-field small { color: var(--pw-text-muted, var(--text-muted)); font-size: .875rem; line-height: 1.5; }
.field-state { align-items: center; display: inline-flex; gap: 6px; }
.field-state svg { height: 15px; width: 15px; }
.field-state.is-complete { color: var(--pw-success, #157347); }
.field-state.is-missing { color: var(--pw-warning, #9a5b00); }

.people-benefits { border-top: 1px solid var(--pw-border, var(--border)); margin-top: 24px; padding-top: 22px; }
.people-benefits > div:first-child { margin-bottom: 16px; }
.people-benefits > div:first-child > span { color: var(--pw-text-muted, var(--text-muted)); font-size: .875rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.people-benefits h3 { margin: 5px 0; }
.people-benefits p { color: var(--pw-text-muted, var(--text-muted)); font-size: .88rem; margin: 0; }

.people-form-actions { align-items: center; display: grid; gap: 10px; grid-template-columns: auto 1fr auto auto; margin-top: 22px; }
.btn--danger-ghost { background: transparent; border-color: color-mix(in srgb, var(--pw-danger, #b42318) 35%, var(--pw-border, var(--border))); color: var(--pw-danger, #b42318); }
.btn--danger { background: var(--pw-danger, #b42318); border-color: var(--pw-danger, #b42318); color: #fff; }

.inline-danger-confirm {
  align-items: center;
  background: color-mix(in srgb, var(--pw-danger, #b42318) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--pw-danger, #b42318) 28%, var(--pw-border, var(--border)));
  border-radius: 14px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  margin-top: 16px;
  padding: 14px;
}
.inline-danger-confirm[hidden] { display: none; }
.inline-danger-confirm strong { font-size: .95rem; }
.inline-danger-confirm p { color: var(--pw-text-muted, var(--text-muted)); font-size: .875rem; line-height: 1.5; margin: 3px 0 0; }
.people-os .segmented { display: flex; flex-wrap: wrap; }
.people-os .segmented > a { align-items: center; display: inline-flex; min-height: 44px; }
.people-os .inline-danger-confirm label { align-items: center; display: flex; gap: 10px; min-height: 48px; font-size: 1rem; }
.people-os .inline-danger-confirm input[type="checkbox"] { flex: 0 0 auto; height: 24px; width: 24px; }
.people-detail-card__head h2,
.people-form .inline-receipt { overflow-wrap: anywhere; word-break: break-word; }
.people-os a:focus-visible,
.people-os button:focus-visible,
.people-os input:focus-visible,
.people-os textarea:focus-visible,
.people-os select:focus-visible { outline: 3px solid var(--pw-steel-600, #2563eb); outline-offset: 2px; }
.people-detail-empty { align-items: center; display: flex; flex-direction: column; justify-content: center; min-height: 440px; padding: 40px; text-align: center; }

@media (max-width: 1023px) {
  .people-layout { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); }
  .people-kpis > a { min-height: 112px; padding: 15px; }
  .people-status { display: none; }
  .people-record { grid-template-columns: 44px minmax(0, 1fr) 20px; }
}

@media (min-width: 768px) and (max-width: 899px) {
  .people-layout { display: block; min-height: 0; }
  .people-os.has-selection .people-master { display: none; }
  .people-os:not(.has-selection) .people-detail { display: none; }
  .people-record-list { max-height: none; }
  .people-mobile-back { display: inline-flex; flex: 0 0 auto; }
}

@media (max-width: 767px) {
  .people-os { gap: 16px; }
  .people-os .page-header { align-items: flex-start; gap: 12px; }
  .people-os .page-header .btn { width: 100%; }
  .people-kpis { gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .people-kpis > a { border-radius: 14px; min-height: 104px; padding: 12px; }
  .people-kpis strong { font-size: 1.35rem; }
  .people-kpis span { font-size: .875rem; padding-top: 10px; }
  .people-kpis small { display: none; }
  .people-layout { display: block; min-height: 0; }
  .people-os.has-selection .people-master { display: none; }
  .people-os:not(.has-selection) .people-detail { display: none; }
  .people-master,
  .people-detail-card,
  .people-detail-empty { border-radius: 16px; }
  .people-record-list { max-height: none; }
  .people-record { min-height: 82px; padding: 10px 12px; }
  .people-record__copy strong { white-space: normal; }
  .people-detail-card__head { padding: 16px; }
  .people-detail-card__head > .status-pill { display: inline-flex; flex: 0 1 auto; align-self: flex-start; max-width: 100%; white-space: normal; overflow-wrap: anywhere; font-size: .875rem; line-height: 1.35; }
  .people-mobile-back { display: inline-flex; flex: 0 0 auto; }
  .people-avatar--large { height: 50px; width: 50px; }
  .people-form { padding: 16px; }
  .people-field-grid,
  .people-benefit-grid { grid-template-columns: 1fr; }
  .people-field--wide { grid-column: auto; }
  .people-form-actions { grid-template-columns: 1fr; }
  .people-form-actions > span:empty { display: none; }
  .people-form-actions .btn { width: 100%; }
  .inline-danger-confirm { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .people-record,
  .people-kpis > a { transition: none; }
}

/* Keep the person and the next editable field prominent on small screens. */
.people-os .people-detail-card__head { padding: 18px; gap: 12px; }
.people-os .people-detail-card__head h2 { font-size: 1.375rem; line-height: 1.25; }
.people-os .people-detail-card__head p { font-size: .875rem; line-height: 1.4; }
.people-os .people-form { padding: 18px; }
.people-os .people-field-grid, .people-os .people-benefit-grid { gap: 14px; }
.people-os .people-benefits { margin-top: 20px; padding-top: 18px; }
.people-os .people-form legend, .people-os .people-benefits h3 { font-size: 1rem; }
.people-os .people-detail-empty { min-height: 240px; }
@media (max-width: 767px) {
  .people-os.people-os { gap: 12px; }
  .people-os.has-selection > .page-header, .people-os.has-selection > .people-kpis { display: none; }
  .people-os .people-kpis { gap: 8px; }
  .people-os .people-kpis > a { min-height: 72px; padding: 10px 12px; flex-direction: row; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
  .people-os .people-kpis strong { font-size: 1.375rem; }
  .people-os .people-kpis span { font-size: .875rem; padding-top: 0; margin-top: 0; }
  .people-os .people-detail-card__head { display: flex; flex-wrap: wrap; align-items: center; padding: 10px 14px 14px; gap: 8px; }
  .people-os .people-mobile-back { display: inline-flex; align-items: center; gap: 6px; flex: 1 0 100%; width: auto; min-height: 44px; justify-content: flex-start; padding: 6px 0; font-size: .875rem; text-decoration: none; color: var(--pw-text-muted, var(--text-muted)); }
  .people-os .people-mobile-back svg { width: 18px; height: 18px; flex: 0 0 18px; }
  .people-os .people-avatar--large { display: none; }
  .people-os .people-detail-card__head > div { flex: 1 0 100%; }
  .people-os .people-detail-card__head > div > span { margin-bottom: 4px; }
  .people-os .people-form { padding: 16px 14px; }
  .people-os .people-field { gap: 5px; }
  .people-os .people-field small { line-height: 1.4; }
  .people-os .people-record { grid-template-columns: 34px minmax(0,1fr) 18px; gap: 10px; }
  .people-os .people-avatar { width: 34px; height: 34px; border-radius: 8px; font-size: .9375rem; }
  .people-os .people-form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .people-os .people-form-actions > .btn { flex: 1 1 120px; width: auto; justify-content: center; white-space: normal; }
  .people-os .people-form-actions > .btn--danger-ghost { order: 2; flex-basis: 100%; margin-top: 8px; }
}
@media (max-width:767px) { .people-os > .page-header .eyebrow { display: none; } }
