.studio-team { min-width: 0; color: var(--ink,#0d0d0d); }
.studio-team *, .team-dialog * { box-sizing: border-box; }
.studio-team button, .team-dialog button, .studio-team input, .team-dialog input, .studio-team select, .team-dialog select { font: inherit; }
.studio-team h2, .team-dialog h2 { font-size: 22px; font-weight: 500; line-height: 1.35; letter-spacing: -.45px; margin: 0 0 9px; }
.studio-team h3, .team-dialog h3 { font-size: 17px; font-weight: 500; line-height: 1.4; letter-spacing: -.2px; margin: 0 0 8px; }
.studio-team [hidden], .team-dialog [hidden] { display: none !important; }
.team-heading { margin-bottom: 28px; }
.team-context-bar { border-bottom: 1px solid var(--line,#e6e6e6); display:flex; align-items:center; justify-content:space-between; gap:18px; padding:0 0 20px; }
.team-data-context { display:flex; flex-wrap:wrap; align-items:center; gap:12px; color:var(--muted,#727272); font-size:13px; }
.team-local-label { padding:5px 9px; border:1px solid var(--line,#e6e6e6); border-radius:7px; color:var(--ink-secondary,#444); background:var(--subtle,#f7f7f7); font-size:12px; }
.team-context-bar select, .team-review-bar select, .team-status-filter select { border:1px solid var(--control-border,var(--line,#ddd)); border-radius:var(--control-radius,12px); min-height:var(--control-height,44px); padding:8px 36px 8px var(--control-padding-x,14px); background:var(--surface,#fff); color:var(--ink,#0d0d0d); max-width:100%; }
.team-context-bar select { font-size:var(--control-font-size,14px); }
.team-review-bar { display:flex; align-items:center; justify-content:space-between; gap:22px; padding:21px 0 24px; }
.team-review-bar > div { display:flex; gap:12px; align-items:center; }
.team-review-bar p { margin:0; font-size:13px; color:var(--muted,#727272); }
.team-review-bar p strong { color:var(--ink,#0d0d0d); font-weight:500; }
.team-review-bar p span { display:block; margin-top:3px; font-size:12px; }
.team-review-bar > label { display:flex; align-items:center; gap:12px; font-size:12px; color:var(--muted,#727272); }
.team-review-bar select { font-size:var(--control-font-size,14px); max-width:250px; }
.team-avatar { display:grid; place-items:center; width:40px; height:40px; border:1px solid var(--line,#e6e6e6); background:var(--subtle,#f7f7f7); color:var(--ink-secondary,#444); border-radius:50%; font-size:12px; font-weight:500; flex-shrink:0; }
.team-avatar.small { width:34px; height:34px; font-size:11px; }
.team-avatar svg { width:18px; height:18px; }
.team-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); padding:24px 0 28px; border-top:1px solid var(--line,#e6e6e6); gap:32px; }
.team-summary > div { min-width:0; }
.team-summary span { display:block; color:var(--muted,#727272); font-size:13px; }
.team-summary strong { display:block; font-size:31px; line-height:1.2; letter-spacing:-.8px; font-weight:500; margin:8px 0; }
.team-summary strong.team-summary-role { font-size:26px; letter-spacing:-.55px; padding-top:4px; }
.team-summary small { color:var(--muted,#727272); display:block; line-height:1.5; font-size:12px; }
.team-tabs { display:flex; align-items:center; gap:27px; overflow-x:auto; border-bottom:1px solid var(--line,#e6e6e6); margin-bottom:29px; scrollbar-width:thin; }
.team-tabs button { background:none; color:var(--muted,#727272); border:0; border-bottom:2px solid transparent; min-height:50px; font-size:14px; padding:0 0 14px; display:flex; align-items:center; gap:9px; white-space:nowrap; }
.team-tabs button[aria-current=page] { color:var(--ink,#0d0d0d); border-bottom-color:var(--ink,#0d0d0d); }
.team-tab-count { min-width:23px; padding:2px 6px; background:var(--subtle,#f5f5f5); color:var(--ink-secondary,#444); border-radius:99px; font-size:11px; }
.team-section { min-width:0; }
.team-section-head { display:flex; align-items:flex-start; justify-content:space-between; gap:22px; margin-bottom:23px; }
.team-section-head p { margin:0; font-size:14px; color:var(--muted,#727272); line-height:1.65; max-width:550px; }
.team-filter-row { display:flex; align-items:center; gap:10px; flex-shrink:0; }
.team-search input, .team-field input, .team-field select, .team-invite-link input { border:1px solid var(--control-border,var(--line,#ddd)); background:var(--surface,#fff); color:var(--ink,#0d0d0d); border-radius:var(--control-radius,12px); min-height:var(--control-height,44px); padding:10px var(--control-padding-x,14px); width:100%; caret-color:var(--ink,#0d0d0d); }
.team-search { display:block; max-width:230px; }
.team-search input { font-size:var(--control-font-size,14px); }
.team-status-filter select { font-size:var(--control-font-size,14px); }
.team-table-wrap { max-width:100%; overflow-x:auto; scrollbar-width:thin; outline-offset:4px; }
.team-table { width:100%; border-collapse:collapse; font-size:13px; text-align:left; }
.team-table th, .team-table td { padding:18px 14px; border-bottom:1px solid var(--line,#e6e6e6); vertical-align:middle; font-weight:400; }
.team-table th:first-child, .team-table td:first-child { padding-left:0; }
.team-table th:last-child, .team-table td:last-child { padding-right:0; }
.team-table thead th { color:var(--muted,#727272); font-size:12px; padding-top:0; padding-bottom:14px; white-space:nowrap; }
.team-table tbody th { min-width:230px; font-weight:500; }
.team-table td small, .team-table th small { display:block; font-size:11px; font-weight:400; line-height:1.6; color:var(--muted,#727272); margin-top:4px; }
.team-person { display:flex; align-items:center; gap:12px; }
.team-person > span:last-child { min-width:0; }
.team-person strong { display:flex; flex-wrap:wrap; align-items:center; gap:8px; font-size:13px; font-weight:500; line-height:1.5; }
.team-person small { overflow-wrap:anywhere; }
.team-you { font-size:10px; color:var(--muted,#727272); background:var(--subtle,#f7f7f7); border-radius:5px; padding:2px 5px; font-weight:400; }
.team-role { font-weight:500; }
.team-status { display:inline-flex; border:1px solid var(--line,#e6e6e6); padding:4px 8px; border-radius:6px; color:var(--muted,#727272); background:var(--surface,#fff); font-size:11px; line-height:1.4; white-space:nowrap; }
.team-status.active { color:var(--ink-secondary,#444); background:var(--subtle,#f7f7f7); }
.team-text-button { display:inline-flex; align-items:center; gap:7px; border:0; background:none; color:var(--ink,#0d0d0d); padding:7px 0; font-size:13px; min-height:44px; white-space:nowrap; }
.team-text-button:hover { text-decoration:underline; text-underline-offset:3px; }
.team-text-button .studio-icon { width:15px; height:15px; }
.team-text-button.danger { color:var(--negative,#922e24); }
.team-footnote, .team-boundary { color:var(--muted,#727272); font-size:12px; line-height:1.65; margin:18px 0 0; max-width:800px; }
.team-boundary { border-top:1px solid var(--line,#e6e6e6); padding-top:22px; margin-top:34px; }
.team-empty { padding:48px 20px; text-align:center; border-top:1px solid var(--line,#e6e6e6); border-bottom:1px solid var(--line,#e6e6e6); }
.team-empty > .studio-icon { margin:0 auto 17px; width:26px; height:26px; color:var(--muted,#727272); }
.team-empty h3, .team-empty h2 { font-weight:500; }
.team-empty p { max-width:455px; margin:0 auto 20px; font-size:14px; color:var(--muted,#727272); line-height:1.65; }
.team-empty .team-footnote { font-size:12px; margin:21px auto 0; }
.team-empty.compact { padding:34px 20px; }
.team-start-note { display:flex; align-items:center; justify-content:space-between; gap:30px; padding:24px 0; }
.team-start-note h3 { margin-bottom:4px; }
.team-start-note p { margin:0; color:var(--muted,#727272); font-size:13px; line-height:1.65; }
.team-scroll-hint { display:none; color:var(--muted,#727272); font-size:12px; margin:0 0 14px; }
.team-permission-table { min-width:730px; }
.team-permission-table caption { text-align:left; color:var(--muted,#727272); font-size:12px; margin-bottom:15px; }
.team-permission-table thead th:not(:first-child), .team-permission-table td { text-align:center; }
.team-permission-table tbody th { width:43%; font-size:13px; }
.team-permission-value { display:flex; align-items:center; justify-content:center; min-width:48px; color:var(--muted,#727272); }
.team-permission-value svg { width:18px; height:18px; color:var(--ink,#0d0d0d); }
.team-role-list { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:27px; margin:35px 0; }
.team-role-list article { padding:18px 0 0; border-top:1px solid var(--line,#e6e6e6); }
.team-role-list article > div { display:flex; align-items:center; gap:9px; }
.team-role-list svg { width:17px; height:17px; }
.team-role-list h3 { font-size:15px; margin:0; }
.team-role-list p { color:var(--muted,#727272); font-size:13px; line-height:1.65; margin:10px 0 0; }
.team-access-note { display:flex; gap:15px; padding:23px; border-radius:12px; background:var(--subtle,#f7f7f7); }
.team-access-note > span { padding-top:3px; }
.team-access-note h3 { font-size:16px; }
.team-access-note p { margin:6px 0 0; font-size:13px; line-height:1.65; color:var(--muted,#727272); }
.team-actions { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.team-recovery { border:1px solid var(--control-border,var(--line,#ddd)); background:var(--subtle,#f7f7f7); border-radius:12px; padding:23px; margin:24px 0; }
.team-recovery h2 { font-size:18px; margin-top:12px; }
.team-recovery p { font-size:13px; color:var(--muted,#727272); line-height:1.65; }
.team-recovery .team-actions { margin-top:17px; }
.team-dialog { position:fixed; inset:auto; left:calc(var(--dialog-viewport-left,0px) + var(--dialog-viewport-width,100vw)/2); top:calc(var(--dialog-viewport-top,0px) + env(safe-area-inset-top,0px) + (var(--dialog-viewport-height,100dvh) - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px))/2); transform:translate(-50%,-50%); margin:0; width:min(584px,calc(var(--dialog-viewport-width,100vw) - 32px - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px))); max-height:calc(var(--dialog-viewport-height,100dvh) - 24px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)); overflow:hidden; border:1px solid var(--line,#e6e6e6); border-radius:18px; padding:0; background:var(--surface-raised,var(--surface,#fff)); color:var(--ink,#0d0d0d); font-family:inherit; font-size:14px; line-height:1.5; }
.team-dialog[open] { display:grid; grid-template-rows:auto minmax(0,1fr) auto; }
.team-dialog::backdrop { background:#0006; }
.team-dialog-head { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:22px 26px 19px; border-bottom:1px solid var(--line,#e6e6e6); }
.team-dialog-head h2 { font-size:21px; margin:0; min-width:0; overflow-wrap:anywhere; }
.team-dialog-head > button { flex-shrink:0; }
.team-dialog-content { padding:24px 26px; min-height:0; overflow-y:auto; overscroll-behavior:contain; scrollbar-gutter:stable; scroll-padding-block:20px; }
.team-dialog-footer { max-height:calc(var(--dialog-viewport-height,100dvh)*.35); overflow:auto; background:var(--surface-raised,var(--surface,#fff)); padding:18px 26px; display:flex; align-items:center; justify-content:space-between; gap:15px; border-top:1px solid var(--line,#e6e6e6); }
.team-dialog-content > .team-person { margin-bottom:24px; }
.team-dialog-copy { font-size:14px; color:var(--muted,#727272); line-height:1.65; margin:0 0 24px; }
.team-dialog-copy strong { color:var(--ink,#0d0d0d); font-weight:500; }
.team-form { display:grid; gap:18px; }
.team-form .team-footnote { margin:0; }
.team-form .team-dialog-copy { margin:0; }
.team-kind-fieldset { border:0; margin:0; padding:0; min-width:0; }
.team-kind-fieldset legend { font-size:13px; font-weight:500; padding:0 0 10px; }
.team-invite-kind { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.team-invite-kind label { display:flex; gap:10px; border:1px solid var(--control-border,var(--line,#ddd)); background:var(--surface,#fff); border-radius:12px; padding:15px 12px; cursor:pointer; }
.team-invite-kind label:has(input:checked) { border-color:var(--ink,#0d0d0d); background:var(--subtle,#f7f7f7); }
.team-invite-kind input { accent-color:var(--ink,#0d0d0d); margin:3px 0 0; flex-shrink:0; }
.team-invite-kind strong { display:block; font-weight:500; font-size:13px; }
.team-invite-kind small { color:var(--muted,#727272); display:block; font-size:11px; line-height:1.6; margin-top:4px; }
.team-field { display:grid; gap:8px; min-width:0; font-size:13px; font-weight:500; }
.team-field small { font-size:12px; font-weight:400; line-height:1.6; color:var(--muted,#727272); }
.team-field input, .team-field select { font-size:var(--control-font-size,14px); font-weight:400; }
.team-field select { padding-right:28px; }
.team-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.team-grant-preview { border-radius:12px; padding:17px; background:var(--subtle,#f7f7f7); }
.team-grant-preview strong { font-weight:500; font-size:13px; }
.team-grant-preview p { font-size:13px; color:var(--muted,#727272); line-height:1.65; margin:5px 0 0; }
.team-grant-preview .team-text-button { font-size:12px; margin-top:5px; }
.team-grant-preview:has(.team-role-details) { padding:0; background:transparent; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.team-role-details summary { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:44px; cursor:pointer; font-size:13px; font-weight:500; list-style:none; }
.team-role-details summary::-webkit-details-marker { display:none; }
.team-role-details summary svg { width:16px; height:16px; }
.team-role-details[open] summary svg { transform:rotate(90deg); }
.team-role-details ul { margin:12px 0 16px; padding-left:18px; font-size:12px; line-height:1.7; color:var(--muted); }
.team-project-scope { display:flex; gap:10px; align-items:flex-start; color:var(--muted,#727272); font-size:12px; }
.team-project-scope svg { width:16px; height:16px; flex-shrink:0; }
.team-project-scope strong { color:var(--ink,#0d0d0d); font-weight:500; }
.team-role-description { margin:0; color:var(--muted,#727272); font-size:13px; line-height:1.65; }
.team-dialog-scope { display:flex; justify-content:space-between; gap:20px; border-top:1px solid var(--line,#e6e6e6); border-bottom:1px solid var(--line,#e6e6e6); padding:14px 0; margin-bottom:22px; font-size:13px; }
.team-dialog-scope span { color:var(--muted,#727272); }
.team-dialog-scope strong { font-weight:500; }
.team-invitation-summary { display:flex; align-items:center; flex-wrap:wrap; gap:11px; margin-bottom:24px; }
.team-invitation-summary h3 { font-size:15px; overflow-wrap:anywhere; margin:0; min-width:0; }
.team-invitation-summary .team-status { margin-left:auto; }
.team-detail-list { margin:0 0 22px; display:grid; gap:14px; }
.team-detail-list > div { display:flex; justify-content:space-between; gap:20px; font-size:13px; }
.team-detail-list dt { color:var(--muted,#727272); }
.team-detail-list dd { margin:0; text-align:right; }
.team-invite-link { display:flex; align-items:flex-end; gap:10px; }
.team-invite-link label { display:grid; gap:8px; flex:1; min-width:0; font-size:12px; }
.team-invite-link input { font-size:var(--control-font-size,14px); color:var(--ink-secondary,#444); background:var(--subtle,#f7f7f7); }
.team-error { border-radius:9px; padding:12px 14px; color:var(--negative,#922e24); background:var(--error-surface,#fdf1f1); font-size:13px; line-height:1.65; margin-top:18px; }
.studio-team input::placeholder, .team-dialog input::placeholder { color:var(--muted,#727272); opacity:1; }
.studio-team select option, .team-dialog select option { background:var(--surface,#fff); color:var(--ink,#0d0d0d); }
.studio-team :focus-visible, .team-dialog :focus-visible { outline:2px solid var(--ink,#0d0d0d); outline-offset:4px; }
.studio-team :disabled, .team-dialog :disabled { opacity:.55; cursor:default; }
@media (max-width:1180px) { .team-section-head { flex-direction:column; } .team-filter-row { width:100%; } .team-search { flex:1; max-width:340px; } }
@media (max-width:760px) {
  .team-context-bar { align-items:flex-start; flex-direction:column; gap:12px; }
  .team-context-bar > label { width:100%; }
  .team-context-bar select { width:100%; }
  .team-review-bar { align-items:flex-start; flex-direction:column; gap:17px; }
  .team-review-bar > label { justify-content:space-between; width:100%; }
  .team-review-bar select { flex:1; min-width:0; }
  .team-summary { gap:22px 14px; grid-template-columns:1fr 1fr; }
  .team-summary > div:last-child { grid-column:1 / -1; }
  .team-summary strong { font-size:29px; }
  .team-summary > div:last-child { display:grid; grid-template-columns:1fr 1fr; align-items:center; gap:5px 14px; }
  .team-summary > div:last-child strong { grid-row:1 / span 2; grid-column:2; margin:0; padding:0; font-size:23px; }
  .team-summary > div:last-child small { grid-column:1; }
  .team-tabs { gap:25px; margin-bottom:25px; }
  .team-filter-row { flex-wrap:wrap; }
  .team-search { max-width:none; flex-basis:100%; }
  .team-status-filter, .team-status-filter select { width:100%; }
  .team-table:not(.team-permission-table) { display:block; min-width:0; }
  .team-table:not(.team-permission-table) thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
  .team-table:not(.team-permission-table) tbody { display:grid; gap:12px; }
  .team-table:not(.team-permission-table) tbody tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 14px; padding:16px; border:1px solid var(--line); border-radius:var(--control-radius,12px); background:var(--surface); }
  .team-table:not(.team-permission-table) tbody th { display:block; grid-column:1/-1; min-width:0; padding:0 0 4px; border:0; }
  .team-table:not(.team-permission-table) td[data-label] { display:flex; flex-direction:column; gap:5px; padding:4px 0; border:0; align-items:flex-start; min-width:0; }
  .team-table td[data-label]::before { content:attr(data-label); font-size:12px; color:var(--muted); }
  .team-table td[data-label] > small { margin:0; }
  .team-table td[data-label="Project role"] > small, .team-table td[data-label="Access"] > small { display:none; }
  .team-table td[data-label="Actions"] { grid-column:1/-1; padding:8px 0 0; }
  .team-table td[data-label="Actions"]::before { display:none; }
  .team-table td[data-label] > .team-status { justify-self:start; }
  .team-table td[data-label] > .team-text-button { justify-content:space-between; width:100%; padding:0 var(--control-padding-x,14px); min-height:var(--control-height,48px); border:1px solid var(--line); border-radius:var(--control-radius,12px); }
  .team-person strong { overflow-wrap:anywhere; }
  .team-role-list { grid-template-columns:1fr 1fr; gap:22px; }
  .team-permission-table { min-width:730px; }
  .team-scroll-hint { display:block; }
  .team-start-note { flex-direction:column; align-items:flex-start; gap:15px; }
  .team-access-note { padding:19px; }
  .team-heading { gap:20px; }
  .team-heading .studio-heading-actions { width:100%; padding-top:0; }
  .team-heading .studio-button { width:100%; }
  .team-dialog { width:calc(var(--dialog-viewport-width,100vw) - 24px - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px)); border-radius:15px; }
  .team-dialog-head { padding:17px 18px 14px; }
  .team-dialog-content { padding:21px 18px; }
  .team-dialog-footer { background:var(--surface-raised,var(--surface,#fff)); padding:15px 18px; flex-wrap:wrap; }
  .team-dialog-footer > .team-actions:last-child { margin-left:auto; }
  .team-form-grid { gap:14px; }
  .team-form { gap:14px; }
  .team-invite-kind label { padding:12px 10px; gap:8px; }
  .team-invite-kind small { font-size:12px; line-height:1.4; }
  .team-dialog-footer > .team-text-button.danger { width:100%; }
  .team-invitation-summary .team-status { margin-left:51px; }
}
@media (max-width:420px) { .team-role-list { grid-template-columns:1fr; } .team-dialog-footer > .team-actions { width:100%; } .team-dialog-footer > .team-actions .studio-button { flex:1; } }
@media (max-width:340px) { .team-form-grid, .team-invite-kind { grid-template-columns:1fr; } }
@media (max-height:450px) { .team-dialog-head { padding:10px 18px; } .team-dialog-content { padding:14px 18px; } .team-dialog-footer { padding:10px 18px; } }
@media (prefers-reduced-motion: reduce) { .studio-team *, .team-dialog * { scroll-behavior:auto; transition:none; } }

/* Keep off-screen accessible table labels inside the scroll region. */
.team-table-wrap{position:relative}
