.team-layout { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); align-items: start; gap: clamp(40px, 6vw, 100px); }
#page-team.page-view { padding-bottom: 16px; }
.team-heading { max-width: 490px; padding-top: 12px; text-align: left; }
.team-selection { width: 100%; min-width: 0; max-width: 720px; container: team-selection / inline-size; }
.team-heading > p:last-child { margin: 0; color: var(--muted); line-height: 1.6; }
#team-status { max-width: none; margin: 0 0 16px; text-align: left; }
#team-status:empty { display: none; }
#team-members { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); justify-items: start; gap: 20px; margin: 0; }
#team-members[data-member-count="1"] { grid-template-columns: minmax(0, 360px); }
#team-members[data-member-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#team-members[data-member-count="1"] .team-card, #team-members[data-member-count="2"] .team-card { max-width: 360px; }
.team-card { display: flex; flex-direction: column; min-width: 0; width: 100%; max-width: 240px; padding: 0; overflow: hidden; border: 1px solid #8f784951; border-radius: 15px; background: linear-gradient(140deg, #1b1b1c, #111112); color: var(--text); text-align: left; cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease; }
.team-card:hover { border-color: var(--gold); box-shadow: 0 5px 26px #e6c77b12; }
.team-card:focus-visible { outline: 2px solid #ffe2a1; outline-offset: 4px; }
.team-card-image { display: block; width: 100%; height: auto; aspect-ratio: 1; }
.team-card-copy { display: flex; flex: 1; flex-direction: column; align-items: start; gap: 9px; min-width: 0; padding: 18px; }
.team-functions { display: block; margin: 0; color: var(--gold); font-size: 11px; font-weight: 650; line-height: 1.6; letter-spacing: .07em; overflow-wrap: anywhere; }
.team-card-name { display: block; margin: 0 0 8px; font: 650 27px/1.15 Fraunces, Georgia, serif; overflow-wrap: anywhere; }
.team-card-link { display: inline-flex; align-items: center; justify-content: space-between; gap: 14px; align-self: stretch; margin-top: auto; font-size: 13px; }
.team-card-link span:first-child { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: #e6c77b88; }
.team-card-link span:last-child { color: var(--gold); font-size: 22px; }
html.team-profile-open { overflow: hidden; }
.team-profile-dialog { width: min(540px, calc(100% - 24px)); max-width: none; max-height: calc(100dvh - 24px); margin: auto; padding: 0; overflow: hidden; border: 1px solid #ac915b; border-radius: 18px; background: #141414; color: var(--text); box-shadow: 0 24px 100px #000b; }
.team-profile-dialog::backdrop { background: #000b; }
.team-profile-dialog[open] { display: flex; flex-direction: column; }
.team-profile-toolbar { display: flex; flex: none; justify-content: flex-end; padding: 6px 8px; border-bottom: 1px solid #ffffff0d; }
.team-profile-close { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 9px; color: var(--text); background: transparent; font: 300 32px/1 Outfit, sans-serif; cursor: pointer; }
.team-profile-close:hover { color: var(--gold); background: #ffffff09; }
.team-profile-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: #947c47 #141414; }
.team-profile-image { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; max-height: 45dvh; }
:is(.team-card-image, .team-profile-image, #team-edit-photo-preview) { object-fit: contain; object-position: center; background: transparent; }
.team-profile-copy { padding: clamp(18px, 4vw, 30px); overflow-wrap: anywhere; }
.team-profile-copy h2 { margin: 8px 0 20px; font: 650 clamp(28px, 5vw, 40px)/1.1 Fraunces, Georgia, serif; }
.team-profile-section { margin-top: 20px; }
.team-profile-section:first-of-type { padding-top: 20px; border-top: 1px solid #e6c77b66; }
.team-profile-section h3 { margin: 0 0 8px; font-size: 17px; }
.team-profile-section p { margin: 0; color: #d0cdc5; font-size: 15px; line-height: 1.65; white-space: pre-wrap; }
.team-local-editor[hidden], #remote-team-editor[hidden] { display: none; }
.team-local-editor { max-width: 880px; margin: 32px auto 0; padding: clamp(16px, 3vw, 26px); border: 1px solid var(--line); border-radius: 15px; background: #141414; }
.team-local-editor h3 { margin: 0 0 12px; font: 650 26px/1.2 Fraunces, Georgia, serif; }
.team-local-editor > p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.team-editor-selection { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.team-editor-selection label { flex: 1 1 200px; }
.team-local-editor label { display: grid; gap: 7px; min-width: 0; color: #d5d1c8; font-size: 14px; }
.team-local-editor input, .team-local-editor select, .team-local-editor textarea { box-sizing: border-box; width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid #ffffff28; border-radius: 8px; background: #09090a; color: var(--text); font: inherit; font-size: 16px; }
.team-local-editor textarea { resize: vertical; }
.team-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.team-editor-functions { margin: 0 0 16px; padding: 0; min-width: 0; border: 0; }
.team-editor-functions legend { margin-bottom: 8px; color: #d5d1c8; font-size: 14px; }
.team-function-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; padding: 0; list-style: none; }
.team-function-list:empty { display: none; }
.team-function-list li { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 0 0 0 10px; border: 1px solid #ad936055; border-radius: 8px; color: var(--gold); overflow-wrap: anywhere; font-size: 13px; }
.team-function-list button { flex: none; width: 44px; min-height: 44px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font: inherit; font-size: 22px; cursor: pointer; }
.team-function-add { display: flex; gap: 8px; }
.team-function-add input { flex: 1; }
.team-editor-photo { display: grid; grid-template-columns: 120px minmax(0, 1fr); align-items: start; gap: 16px; margin: 16px 0; }
.team-editor-photo img { display: block; width: 120px; height: 80px; border-radius: 9px; }
.team-editor-photo .panel-button { margin-top: 10px; }
.team-photo-adjust { margin-block: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; }
.team-photo-adjust[hidden] { display: none; }
.team-photo-adjust summary { cursor: pointer; color: var(--gold); }
.team-photo-adjust p { color: var(--muted); font-size: 14px; line-height: 1.5; }
.team-photo-adjust canvas { display: block; width: 100%; max-width: 420px; height: auto; aspect-ratio: 3 / 2; border-radius: 9px; background: #141414; }
.team-photo-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 12px; margin-top: 14px; }
.team-photo-controls input[type="range"] { padding: 0; accent-color: var(--gold); }
.team-photo-adjust .editor-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.team-editor-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.team-local-editor :is(button, input, select, textarea):focus-visible { outline: 2px solid #ffe2a1; outline-offset: 3px; }
.team-local-editor .auth-message:empty { display: none; }
.team-editor-confirm { padding: 14px; margin-top: 16px; border: 1px solid #b98a62; border-radius: 10px; }
.team-editor-confirm p { margin: 0 0 12px; overflow-wrap: anywhere; }
@container team-selection (max-width: 560px) {
  #team-members:not([data-member-count="1"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .team-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .team-heading { padding-top: 0; }
}
@media (max-width: 600px) {
  #team-members { gap: 14px; }
  #team-members[data-member-count="1"] .team-card, #team-members[data-member-count="2"] .team-card { max-width: 260px; }
  .team-card-copy { padding: 12px; gap: 7px; }
  .team-functions { font-size: 10px; letter-spacing: .02em; }
  .team-card-name { font-size: 23px; }
  .team-card-link { gap: 6px; font-size: 12px; }
  .team-editor-grid { grid-template-columns: minmax(0, 1fr); }
  .team-function-add { flex-wrap: wrap; }
  .team-function-add input { flex-basis: 180px; }
  .team-editor-photo { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 359px) { #team-members { grid-template-columns: minmax(0, 1fr) !important; } }
@media (prefers-reduced-motion: reduce) { .team-card { transition: none; } }
