.pds-bulk {
  margin: 4px 0 16px;
  padding: 14px 0 16px;
  border-top: 1px solid var(--border-subtle, #e2e8f0);
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
}

.pds-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.pds-heading h4 {
  margin: 0;
  color: var(--text-primary, #0f172a);
  font-size: 1rem;
  letter-spacing: 0;
}

.pds-heading p,
.pds-summary,
.pds-empty {
  margin: 2px 0 0;
  color: var(--text-muted, #64748b);
  font-size: 0.82rem;
}

.pds-heading strong {
  color: var(--text-secondary, #475569);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.pds-heading-actions {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 8px;
}

.pds-company-selector {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: var(--bg-muted, #f1f5f9);
}

.pds-company-selector button {
  min-height: 44px;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary, #475569);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
}

.pds-company-selector button.active {
  background: var(--bg-card, #fff);
  color: var(--accent-green, #166534);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.pds-company-selector button:focus-visible {
  outline: 3px solid var(--accent-green, #16a34a);
  outline-offset: 2px;
}

.pds-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.pds-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.pds-group legend {
  margin: 0;
  padding: 0;
  color: var(--text-primary, #0f172a);
  font-size: 0.85rem;
  font-weight: 700;
}

.pds-description {
  display: block;
  margin-top: 3px;
  color: var(--text-secondary, #475569);
  font-size: 0.8rem;
}

.pds-summary {
  display: block;
  min-height: 20px;
  margin-bottom: 7px;
}

.pds-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pds-actions button,
.pds-retry {
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--border-default, #cbd5e1);
  border-radius: 6px;
  background: var(--bg-card, #fff);
  color: var(--text-primary, #0f172a);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0;
}

.pds-actions button:hover:not(:disabled),
.pds-retry:hover:not(:disabled) {
  border-color: var(--accent-green, #16a34a);
  color: var(--accent-green, #15803d);
}

.pds-actions button:focus-visible,
.pds-retry:focus-visible,
.profile-access-check input:focus-visible {
  outline: 3px solid var(--accent-green, #16a34a);
  outline-offset: 2px;
}

.profile-access-controls .toggle-switch input:focus-visible + .toggle-slider {
  outline: 3px solid var(--accent-green, #16a34a);
  outline-offset: 3px;
}

.pds-actions button:disabled,
.pds-retry:disabled,
.pds-bulk[aria-busy="true"] button {
  cursor: not-allowed;
  opacity: 0.55;
}

.pds-status {
  display: flex;
  min-height: 22px;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  color: var(--text-secondary, #475569);
  font-size: 0.82rem;
}

.pds-status--success { color: #166534; }
.pds-status--error { color: #b91c1c; }
.pds-status--progress { color: #1d4ed8; }

.profile-access-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.profile-access-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border-subtle, #e2e8f0);
}

.profile-access-row:first-child { border-top: 0; }

.profile-access-list { min-width: 0; }

.profile-access-identity {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.profile-access-identity .emp-name {
  overflow-wrap: anywhere;
  color: var(--text-primary, #0f172a);
  font-weight: 600;
}

.profile-access-identity .emp-dept,
.profile-access-empty {
  color: var(--text-muted, #64748b);
  font-size: 0.82rem;
}

.profile-access-empty { padding: 12px 0 4px; }

.profile-access-check {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary, #475569);
  font-size: 0.8rem;
}

.profile-access-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-green, #16a34a);
}

.profile-access-excluded {
  color: var(--text-muted, #64748b);
  font-size: 0.76rem;
}

.profile-access-toggle-label {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary, #475569);
  font-size: 0.8rem;
  font-weight: 600;
}

.profile-access-surface[aria-busy="true"] input,
.profile-access-surface[aria-busy="true"] button {
  pointer-events: none;
}

/* Portal has fixed feedback/chat controls at the viewport edge. Keep the last row actionable. */
.profile-access-surface.td-section .td-section-body {
  padding-bottom: 84px;
}

@media (max-width: 700px) {
  .pds-heading,
  .profile-access-row {
    align-items: stretch;
    flex-direction: column;
  }

  .pds-heading strong { white-space: normal; }
  .pds-heading-actions { align-items: stretch; }
  .pds-company-selector { display: grid; grid-template-columns: 1fr 1fr; }
  .pds-company-selector button { width: 100%; }
  .pds-groups { grid-template-columns: 1fr; }
  .pds-actions { display: grid; grid-template-columns: 1fr; }
  .pds-actions button { width: 100%; }
  .profile-access-controls { justify-content: flex-start; }
}
