.team-directory-admin[hidden],
.team-profile-editor:not([open]),
.team-sort-dialog:not([open]),
.team-profile-toast[hidden] { display:none!important; }
.team-directory-admin{
  margin:0 auto 24px;padding:14px 16px;border:1.5px solid rgba(38,57,116,.18);
  border-radius:18px;background:var(--bg-subtle);display:flex;justify-content:space-between;
  align-items:center;gap:12px;flex-wrap:wrap;
}
.team-directory-admin strong{display:block;color:var(--navy);font-family:var(--font-h)}
.team-directory-admin span{color:var(--ink-soft);font-size:.84rem}
.team-admin-actions,.team-card-actions,.team-editor-actions{display:flex;gap:8px;flex-wrap:wrap}
.team-admin-button{
  border:1.5px solid var(--navy);border-radius:999px;background:var(--bg-surface);color:var(--navy);
  min-height:44px;padding:8px 13px;font:800 .86rem/1 var(--font-b);cursor:pointer
}
.team-admin-button.primary{background:var(--navy);color:#fff}
.team-admin-button.accent{background:var(--orange);border-color:var(--orange);color:#3A2410}
.team-admin-button.danger{border-color:#a52626;color:#a52626}
.team-admin-button:disabled{opacity:.55;cursor:wait}
.team-profile-admin-card{position:relative}
.team-profile-admin-card[data-status="draft"]{outline:2px dashed var(--orange);outline-offset:4px}
.team-profile-drag-handle{
  box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;gap:6px;
  min-width:44px;min-height:44px;padding:7px 10px;border:1.5px dashed rgba(38,57,116,.5);
  border-radius:11px;background:var(--bg-surface);color:var(--navy);font:800 .76rem/1 var(--font-b);
  cursor:grab;touch-action:none;white-space:nowrap;z-index:2
}
.team-profile-drag-handle:hover,.team-profile-drag-handle:focus-visible{background:var(--orange-soft);border-style:solid;outline:2px solid transparent}
.team-profile-drag-handle:active,.team-profile-drag-handle[aria-pressed="true"]{cursor:grabbing;background:var(--orange-soft)}
.leader>.team-profile-drag-handle{position:absolute;right:14px;top:14px}
.team-profile-tutor-shell{display:grid;gap:6px}
.roster-heading{display:flex;flex-direction:column;align-items:center}
.roster-heading-copy{width:100%;max-width:60ch}
.roster-heading-actions{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:12px;width:100%;white-space:normal}
.roster-view-options{display:flex;flex-wrap:wrap;justify-content:center;gap:6px;padding:5px;border:1px solid var(--line);border-radius:18px;background:var(--bg-surface);max-width:100%}
.roster-view-options[hidden]{display:none}
.roster-view-options button,.tutor-read-more{font:inherit;font-weight:700;cursor:pointer;min-height:44px;border-radius:12px;padding:9px 14px;color:var(--navy);border:1px solid transparent;background:transparent;white-space:normal}
.roster-view-options button[aria-pressed="true"]{background:var(--navy);color:#fff}
.roster-view-options button:focus-visible,.tutor-read-more:focus-visible,.tutor-prof summary:focus-visible{outline:3px solid var(--orange);outline-offset:3px}
.tutor-prof .tp-id .tp-role{font-size:.85rem;overflow-wrap:anywhere}
.tutor-prof [data-tutor-preview]{line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}
.tutor-prof .tp-meta,.tutor-prof .tp-tags{white-space:pre-wrap;overflow-wrap:anywhere}
.tutor-prof [data-tutor-preview]:empty{display:none}
.tp-extra{display:grid;gap:8px;overflow-wrap:anywhere;white-space:pre-wrap}
.tp-extra[hidden],.tutor-read-more[hidden]{display:none}
.tutor-read-more{justify-self:start;border-color:var(--line);background:var(--bg-surface)}
@media(max-width:640px){
  .roster-heading .roster-heading-actions{display:flex;flex-direction:column;align-items:center}
  .roster-view-options{width:100%}
  .roster-view-options button{flex:1 1 70px;padding:9px 6px;font-size:.82rem}
}
.team-profile-tutor-shell>.team-profile-drag-handle{justify-self:end;margin:0 10px -2px 0}
.team-profile-admin-card.team-profile-dragging{
  opacity:.72;z-index:20;box-shadow:0 16px 38px rgba(20,35,80,.24);border-color:var(--orange);
  transform:scale(.985);transition:none
}
body.team-profile-reordering,body.team-profile-reordering *{cursor:grabbing!important;user-select:none!important}
.team-profile-status{
  display:inline-flex;margin-left:8px;padding:3px 7px;border-radius:999px;
  background:var(--orange-soft);color:#8b4b12;font-size:.72rem;font-weight:800
}
.team-card-actions{padding:0 20px 14px}
.team-card-actions .team-admin-button{padding:6px 10px;font-size:.78rem;min-height:44px}
.team-directory-message{
  grid-column:1/-1;margin:0;padding:24px;text-align:center;border:1.5px dashed var(--line);
  border-radius:16px;color:var(--ink-soft);background:var(--bg-surface)
}
.team-profile-editor{
  width:min(920px,calc(100vw - 24px));height:min(90dvh,900px);max-height:calc(100dvh - 24px);padding:0;
  border:0;border-radius:22px;box-shadow:0 24px 80px rgba(20,35,80,.25);overflow:hidden
}
.team-profile-editor::backdrop{background:rgba(18,29,66,.56)}
.team-sort-dialog{
  width:min(540px,calc(100vw - 24px));max-height:min(90dvh,calc(100dvh - 24px));padding:0;
  border:0;border-radius:20px;background:var(--bg-surface);box-shadow:0 24px 80px rgba(20,35,80,.25);overflow:hidden
}
.team-sort-dialog::backdrop{background:rgba(18,29,66,.56)}
.team-sort-shell{display:flex;max-height:min(90dvh,calc(100dvh - 24px));box-sizing:border-box;flex-direction:column;gap:12px;padding:22px;overflow:hidden;color:var(--ink)}
.team-sort-shell h3,.team-sort-shell p{margin:0}.team-sort-shell h3{color:var(--navy)}
.team-sort-shell>h3,.team-sort-shell>p,.team-sort-shell>.team-editor-actions{flex:0 0 auto}
.team-sort-hint{color:var(--ink-soft);font-size:.9rem}
.team-sort-list{flex:1 1 auto;min-height:0;margin:2px 0;padding:8px;overflow-y:auto;overscroll-behavior:contain;border:1px solid var(--line);border-radius:13px;background:var(--bg-subtle);list-style:none;counter-reset:none}
.team-sort-list li{display:grid;grid-template-columns:32px minmax(0,1fr) auto;align-items:center;gap:8px;min-height:44px;padding:6px 8px;border-radius:9px;background:var(--bg-surface);font-weight:800}
.team-sort-list li+li{margin-top:6px}.team-sort-position{color:var(--ink-soft);font-variant-numeric:tabular-nums;text-align:center}
.team-sort-dialog .team-editor-actions{justify-content:flex-end}
.team-editor-shell{display:flex;flex-direction:column;height:100%;min-height:0;background:var(--bg-surface);overflow:hidden}
.team-editor-shell>[data-team-form]{display:flex;flex:1 1 auto;flex-direction:column;min-height:0;overflow:hidden}
.team-editor-head,.team-editor-footer{padding:18px 22px;border-bottom:1px solid var(--line)}
.team-editor-head{
  position:sticky;top:0;z-index:10;display:flex;flex:none;justify-content:space-between;
  gap:12px;align-items:flex-start;background:var(--bg-surface);box-shadow:0 5px 14px rgba(20,35,80,.04)
}
.team-editor-head h3{margin:0;color:var(--navy)}
.team-editor-body{
  flex:1 1 auto;min-height:0;padding:20px 22px;overflow-x:hidden;overflow-y:auto;
  overscroll-behavior:contain;scrollbar-gutter:stable;scrollbar-width:thin;
  scrollbar-color:rgba(38,57,116,.42) rgba(38,57,116,.06)
}
.team-editor-body::-webkit-scrollbar{width:8px}
.team-editor-body::-webkit-scrollbar-track{background:rgba(38,57,116,.06);border-radius:999px}
.team-editor-body::-webkit-scrollbar-thumb{background:rgba(38,57,116,.38);border-radius:999px}
.team-editor-body::-webkit-scrollbar-thumb:hover{background:rgba(38,57,116,.58)}
.team-editor-footer{
  position:sticky;bottom:0;z-index:10;display:flex;flex:none;justify-content:space-between;
  gap:12px;flex-wrap:wrap;border-top:1px solid var(--line);border-bottom:0;background:var(--bg-surface);
  box-shadow:0 -5px 14px rgba(20,35,80,.04)
}
.team-delete-confirm{display:flex;width:100%;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.team-delete-confirm p{margin:0;max-width:58ch;color:#7f1d1d;font-weight:800}
body.team-profile-modal-open{overflow:hidden}
.team-basic-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.team-field{display:flex;flex-direction:column;gap:6px;min-width:0}
.team-field.wide{grid-column:1/-1}
.team-field label,.team-field-label{font-weight:800;color:var(--navy)}
.team-field input,.team-field select,.team-field textarea{
  box-sizing:border-box;width:100%;min-width:0;border:1.5px solid var(--line);border-radius:11px;
  padding:10px 11px;background:var(--bg-surface);color:var(--ink);font:inherit
}
.team-field textarea{resize:vertical;min-height:92px}
.team-check{display:flex;align-items:flex-start;gap:8px;color:var(--ink)}
.team-check input{width:auto;margin-top:4px}
.team-locale-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:22px 0 14px}
.team-locale-tab{
  min-width:0;min-height:44px;border:1.5px solid var(--line);border-radius:11px;background:var(--bg-surface);padding:9px 8px;
  color:var(--navy);font-weight:800;cursor:pointer
}
.team-locale-tab[aria-selected="true"]{background:var(--navy);color:#fff;border-color:var(--navy)}
.team-locale-dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:#aaa;margin-right:5px}
.team-locale-tab[data-complete="true"] .team-locale-dot{background:#31a35b}
.team-locale-panel[hidden]{display:none}
.team-locale-panel{display:grid;gap:14px}
.team-form-error{margin:14px 0 0;color:#a52626;font-weight:800}
.team-profile-toast{
  position:fixed;left:50%;bottom:22px;transform:translateX(-50%);z-index:400;
  max-width:min(520px,calc(100vw - 24px));padding:11px 16px;border-radius:999px;
  background:var(--navy);color:#fff;font-weight:800;box-shadow:var(--shadow-lg)
}
.team-profile-toast[data-error="true"]{background:#9f2525}
@media(max-width:640px){
  .team-basic-grid{grid-template-columns:1fr}
  .team-field.wide{grid-column:auto}
  .team-editor-body,.team-editor-head,.team-editor-footer{padding-left:16px;padding-right:16px}
  .team-editor-footer,.team-editor-actions,.team-editor-actions .team-admin-button,.team-delete-confirm{width:100%}
  .team-editor-actions .team-admin-button{justify-content:center}
  .team-profile-drag-text{display:none}
  .team-profile-drag-handle{padding:7px;flex:0 0 44px}
  .tutor-prof summary{gap:9px}
  .team-sort-shell{padding:16px}.team-sort-dialog .team-editor-actions,.team-sort-dialog .team-admin-button{width:100%;justify-content:center}
}
@media(max-width:390px){
  .team-locale-tabs{grid-template-columns:1fr}
}
