/* Directory snapshot controls; loaded after the existing portal styles. */
.psd-v2__summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.psd-v3__selection {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px; padding: 14px 16px; margin-bottom: 14px;
  border: 1px solid rgba(136, 162, 202, .24); border-radius: 14px;
}
.psd-v3__selection .muted { margin-left: 8px; }
.psd-v3__selection div.muted { margin: 5px 0 0; }
.psd-v3__notice {
  padding: 12px 16px; margin: 12px 0; border-radius: 12px;
  background: rgba(255, 175, 70, .08); border: 1px solid rgba(255, 175, 70, .28);
}
#psd-open-completed { margin: 0 0 12px; }
@media (min-width: 1600px) {
  .psd-v2__summary { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .psd-v2__summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .psd-v3__selection { align-items: stretch; }
  .psd-v3__selection .ps-btn { width: 100%; white-space: normal; }
}


/* Select AFP blocks / programs before exporting a bounded Excel file. */
.psd-export-backdrop {
  position: fixed; inset: 0; z-index: 100000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(2, 6, 23, .77);
}
.psd-export-modal {
  display: flex; flex-direction: column; max-height: min(92vh, 950px);
  width: min(960px, 100%); box-sizing: border-box;
  border: 1px solid rgba(148, 163, 184, .25); border-radius: 18px;
  color: #e2e8f0; background: #111827;
  box-shadow: 0 25px 80px rgba(0, 0, 0, .55);
}
.psd-export-modal__top { padding: 22px 24px 13px; display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.psd-export-modal__top h2 { margin: 0 0 8px; color: #f8fafc; font-size: 20px; }
.psd-export-modal__top p { margin: 0; font-size: 13px; color: #94a3b8; line-height: 1.4; }
.psd-export-modal__close { border: 0; border-radius: 8px; background: rgba(148, 163, 184, .11); color: #e2e8f0;
  width: 34px; height: 34px; flex-shrink: 0; font-size: 24px; cursor: pointer; }
.psd-export-modal__toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 0 24px 14px; }
.psd-export-modal__scope { font-size: 11px; color: #94a3b8; flex: 1 1 340px; }
.psd-export-modal__groups { overflow: auto; padding: 14px 24px 19px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start; gap: 12px; flex: 1 1 auto; min-height: 70px; border-top: 1px solid rgba(148, 163, 184, .13); }
.psd-export-modal__loading { grid-column: 1/-1; padding: 32px 8px; text-align: center; }
.psd-export-group { border: 1px solid rgba(148, 163, 184, .17); border-radius: 12px; background: #0b1220; overflow: hidden; }
.psd-export-group__title { display: flex; align-items: center; gap: 12px; padding: 12px; background: rgba(148, 163, 184, .06); cursor: pointer; }
.psd-export-group__title span { display: flex; flex-direction: column; min-width: 0; gap: 4px; }
.psd-export-group__title b { font-size: 13px; overflow-wrap: anywhere; }
.psd-export-group small { font-size: 11px; color: #94a3b8; font-weight: 400; }
.psd-export-group input[type="checkbox"] { flex: none; width: 17px; height: 17px; accent-color: #ff684a; cursor: pointer; }
.psd-export-group input:disabled { cursor: not-allowed; opacity: .4; }
.psd-export-group__programs { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 8px 12px 10px; }
.psd-export-group__program { display: flex; gap: 10px; align-items: center; cursor: pointer; min-width: 0; padding: 5px 1px; }
.psd-export-group__program span { min-width: 0; flex: 1; display: flex; justify-content: space-between; align-items: baseline;
  gap: 8px; color: #e2e8f0; font-size: 12px; }
.psd-export-group__program--empty { opacity: .5; }
.psd-export-modal__summary { margin: 0 24px; padding: 11px 13px; border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 10px; background: #0b1220; font-size: 13px; line-height: 1.6; }
.psd-export-modal__counts { font-size: 12px; color: #94a3b8; }
.psd-export-modal__counts b { color: #e2e8f0; }
.psd-export-modal__summary--over { border-color: rgba(251, 113, 133, .65); }
.psd-export-modal__limit-warning { display: block; color: #fda4af; }
.psd-export-modal__error { margin: 10px 24px 0; padding: 10px 12px; border-radius: 9px; font-size: 12px;
  border: 1px solid rgba(251, 113, 133, .52); color: #fecdd3; background: rgba(190, 24, 93, .09); }
.psd-export-modal__error[hidden] { display: none; }
.psd-export-modal__footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; padding: 18px 24px 22px; }
@media (max-width: 690px) {
  .psd-export-modal__groups { grid-template-columns: minmax(0, 1fr); padding: 12px 16px; }
  .psd-export-modal__top { padding: 16px; }
  .psd-export-modal__toolbar { padding: 0 16px 12px; }
  .psd-export-modal__summary { margin: 0 16px; }
  .psd-export-modal__error { margin: 8px 16px 0; }
  .psd-export-modal__footer { padding: 12px 16px 16px; }
  .psd-export-modal__footer .ps-btn { flex: 1 1 40%; white-space: normal; }
}

.psd-export-modal__footer #psd-export-submit:disabled { opacity: .45; cursor: not-allowed; }
.psd-export-modal__toolbar .ps-btn:disabled { opacity: .45; cursor: not-allowed; }

/* Optional export-only activity gate; does not modify saved squad membership. */
.psd-export-activity {
  margin: 0 24px 14px; border: 1px solid rgba(148,163,184,.25);
  border-radius: 12px; padding: 12px 15px 13px; min-width: 0;
}
.psd-export-activity legend { padding: 0 7px; color: #f8fafc; font-size: 13px; font-weight: 700; }
.psd-export-activity__switch { display: flex; align-items: center; gap: 9px; color: #f8fafc; font-size: 13px; cursor: pointer; }
.psd-export-activity__switch input { width: 17px; height: 17px; accent-color: #ff684a; }
.psd-export-activity__fields { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 11px 0; }
.psd-export-activity__fields label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: #cbd5e1; font-size: 12px; }
.psd-export-activity__fields input, .psd-export-activity__fields select {
  box-sizing: border-box; min-width: 100px; padding: 7px 9px; background: #0b1220;
  border: 1px solid rgba(148,163,184,.35); border-radius: 8px; color: #f8fafc;
}
.psd-export-activity__fields--disabled { opacity: .55; }
.psd-export-activity__help { color: #94a3b8; font-size: 11px; margin: 4px 0 0; line-height: 1.5; }
@media(max-width:690px) { .psd-export-activity { margin: 0 16px 12px; } }
