.staff-heading {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem;
}
.staff-heading h1 { margin: 0; overflow-wrap: anywhere; }
.staff-register { min-width: 0; overflow: hidden; }
.staff-directory-tools { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: .65rem 1rem; padding: .75rem clamp(1rem, 2vw, 1.6rem); border-bottom: 1px solid var(--line); }
.staff-inline { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.staff-inline select, .staff-inline input:not([type=hidden]) { width: auto; min-width: 8rem; max-width: 100%; }
.staff-import-department { padding: 0 clamp(1rem, 2vw, 1.6rem) 1rem; max-width: 23rem; }
.staff-directory-tools .staff-action { margin: 0; }
.staff-directory-tools .staff-action[open] form { margin-top: .5rem; }
.staff-section-heading {
  display: flex; align-items: baseline; gap: .8rem;
  padding: 1.2rem clamp(1rem, 2vw, 1.6rem); border-bottom: 1px solid var(--line);
}
.staff-card h2, .staff-section-heading h2 { margin: 0; font-size: 1.1rem; line-height: 1.5; }
.staff-muted, .staff-section-heading > span, .staff-instructions, .access-intro { color: var(--muted); }
.staff-section-heading > span { font-size: .875rem; }
.staff-table { width: 100%; border-collapse: collapse; text-align: left; font-size: .9375rem; }
.staff-table th, .staff-table td {
  padding: .85rem clamp(.7rem, 1.8vw, 1.6rem); border-bottom: 1px solid var(--line);
  vertical-align: middle; overflow-wrap: anywhere;
}
.staff-table th { background: #f2f5fa; color: var(--muted); font-size: .875rem; font-weight: 600; }
.staff-table tbody tr:last-child td { border-bottom: 0; }
.staff-name { color: var(--accent); font-weight: 650; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.staff-status {
  display: inline-flex; align-items: center; gap: .42rem; padding: .18rem .62rem;
  border-radius: 9rem; white-space: nowrap; font-size: .8125rem; font-weight: 600;
}
.staff-status::before { content: ''; width: .37rem; height: .37rem; border-radius: 50%; background: currentColor; }
.staff-active { background: #edf5ef; color: #275d3d; }
.staff-pending { background: #faf1e5; color: #7b5423; }
.staff-inactive { background: #eeeff2; color: #555660; }
.staff-empty { padding: clamp(2rem, 6vw, 4rem) 1rem; text-align: center; }
.staff-empty p { margin: 0; }
.staff-empty p + p { margin-top: .35rem; color: var(--muted); font-size: .9rem; }
.staff-identity { margin-bottom: 1.1rem; }
.staff-identity dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(8rem, 100%), 1fr)); gap: 1rem; margin: 0; }
.staff-identity dt { margin: 0 0 .42rem; color: var(--muted); font-size: .875rem; }
.staff-identity dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.staff-detail-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(21rem, 100%), 1fr));
  gap: 1.1rem; align-items: start;
}
.staff-card { min-width: 0; }
.staff-card > h2 { margin-bottom: 1.15rem; }
.staff-card > p, .staff-field p { margin: 0 0 1rem; color: var(--muted); }
.staff-action summary { padding: .65rem 0; min-height: 2.75rem; color: var(--accent); font-weight: 600; cursor: pointer; }
.staff-action form { margin-top: .5rem; }
.staff-action p { color: var(--muted); margin: 0; }
.staff-action .staff-danger { background: #8f3040; }
.staff-card .stack, .access-panel .stack { display: grid; gap: 1rem; }
.staff-permissions { border-block: 1px solid var(--line); }
.staff-check {
  display: flex; align-items: flex-start; gap: .7rem; min-height: 2.75rem;
  padding: .65rem .1rem; font-weight: 500; line-height: 1.55; cursor: pointer;
}
.staff-check input[type=radio], .staff-check input[type=checkbox] {
  flex: 0 0 auto; width: 1.1rem; height: 1.1rem;
  margin: .18rem 0 0; padding: 0; accent-color: var(--accent);
}
.staff-permissions .staff-check + .staff-check { border-top: 1px solid var(--line); }
.staff-methods { min-width: 0; margin: 0; padding: .5rem .9rem; border: 1px solid var(--line); border-radius: .7rem; }
.staff-methods legend { padding: 0 .35rem; font-size: .875rem; font-weight: 650; }
.staff-confirmations { display: grid; }
.staff-field { display: grid; gap: .48rem; }
.staff-field p, .staff-field #hint { margin: 0; color: var(--muted); font-size: .9375rem; font-weight: 400; }
.staff-field input:not([type=hidden]), .staff-preview input, .staff-field textarea {
  min-width: 0; min-height: 2.75rem; width: 100%; margin: 0; font: inherit; font-size: 1rem;
}
.staff-field textarea { min-height: 10rem; resize: vertical; line-height: 1.65; }
.staff-import { max-width: 46rem; }
.staff-import label { font-size: 1.0625rem; font-weight: 650; }
.staff-import .staff-field { gap: .7rem; }
.staff-instructions { margin: 0; padding: 1rem clamp(1rem, 2vw, 1.6rem); }
.staff-preview { table-layout: fixed; }
.staff-preview th:first-child { width: 17%; }
.staff-preview th:nth-child(2) { width: 20%; }
.staff-preview th:nth-child(3) { width: 38%; }
.staff-table-actions {
  display: flex; align-items: center; flex-wrap: wrap; gap: 1.1rem;
  padding: 1.1rem clamp(1rem, 2vw, 1.6rem); margin: 0; border-top: 1px solid var(--line);
}
.staff-table-actions a, .access-panel > a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.access-panel { overflow-wrap: anywhere; }
.access-panel h1 { margin: 0 0 1.2rem; }
.access-panel .stack > button { width: 100%; }
.access-intro { margin: 0 0 1.2rem; }
.access-help { color: var(--muted); font-size: .875rem; line-height: 1.65; font-weight: 400; }
.access-help ul { padding-inline-start: 1.25rem; margin: 0; }
.access-panel .errorlist, .staff-error { margin: 0; color: #932e40; font-size: .9rem; }
.access-panel ul.errorlist { padding-inline-start: 1.1rem; }
.staff-error { padding: .75rem .9rem; margin-bottom: 1rem; background: #fff2f2; border-radius: .55rem; }
.access-setup { margin: 0 0 1.2rem; padding: 1rem; border: 1px solid var(--line); border-radius: .7rem; text-align: center; }
.access-setup .qr { display: block; width: 11.25rem; height: auto; max-width: 100%; margin: 0 auto; }
.access-setup details { margin: .35rem 0 0; }
.access-setup summary { min-height: 2.75rem; align-content: center; color: var(--accent); font-size: .9375rem; cursor: pointer; }
.access-setup details p { margin: .3rem 0; user-select: all; }
.access-panel .access-code { font-variant-numeric: tabular-nums; letter-spacing: .22em; }
.access-panel .access-secret {
  margin: 1rem 0 .6rem; padding: 1rem; color: var(--accent); background: #f4f3fa;
  border: 1px solid var(--line); border-radius: .6rem; overflow-wrap: anywhere; user-select: all;
}
@media (max-width: 920px) {
  .staff-identity dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .staff-table, .staff-table tbody { display: block; }
  .staff-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .staff-table tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem 1rem; padding: 1rem; }
  .staff-table tbody tr + tr { border-top: 1px solid var(--line); }
  .staff-table td { display: grid; align-content: start; justify-items: start; gap: .25rem; min-width: 0; padding: 0; border: 0; }
  .staff-table td::before { content: attr(data-label); font-size: .8125rem; color: var(--muted); }
  .staff-roster td:first-child { grid-column: 1 / -1; }
  .staff-roster td:first-child::before { display: none; }
  .staff-name { display: inline-flex; align-items: center; min-height: 2.75rem; }
  .staff-preview td:nth-child(n+3) { grid-column: 1 / -1; justify-items: stretch; }
  .staff-preview input { max-width: 100%; }
}
@media (max-width: 600px) {
  .staff-directory-tools { display: grid; }
  .staff-inline select, .staff-inline input:not([type=hidden]) { min-width: 0; flex: 1 1 6rem; }
}
@media (max-width: 400px) {
  .staff-identity dl { grid-template-columns: 1fr; }
  .staff-heading { gap: .65rem; }
}
