body.team-access-locked { overflow: hidden; }
[data-project-create][hidden] { display: none !important; }
body.team-access-locked > :not(.team-access-dialog) { visibility: hidden !important; pointer-events: none !important; }
.team-access-dialog { --bg: var(--shell-bg, #f1f3f0); --panel: var(--shell-panel, #fff); --text: var(--shell-text, #151b26); --muted: var(--shell-muted, #687386); --line: var(--shell-line, #d9e0ea); --accent: var(--shell-accent, #0f766e); box-sizing: border-box; width: min(1040px, calc(100vw - 32px)); max-width: none; max-height: 90vh; padding: 0; border: 1px solid var(--line, #d9e0ea); border-radius: 14px; background: var(--panel, #fff); color: var(--text, #151b26); box-shadow: var(--shadow, 0 18px 50px #1e293b14); }
.team-access-dialog::backdrop { background: #111827b3; }
.team-access-shell { min-width: 0; }
.team-access-head { display: flex; gap: 16px; justify-content: space-between; align-items: center; padding: 18px 24px; border-bottom: 1px solid var(--line, #d9e0ea); }
.team-access-dialog .team-access-head h2 { margin: 0; font-size: 20px; color: var(--text, #151b26); }
.team-access-body { padding: 22px 24px; }
.team-access-dialog p { line-height: 1.65; overflow-wrap: anywhere; }
.team-access-note { color: var(--muted, #687386); margin: 0 0 16px; }
.team-access-identity { font-weight: 650; margin: 0 0 8px; }
.team-access-dialog button { cursor: pointer; }
.team-access-dialog button:disabled { cursor: wait; opacity: .6; }
.team-access-dialog button:focus-visible, .team-access-dialog input:focus-visible, .team-access-dialog select:focus-visible, .team-access-dialog summary:focus-visible { outline: 2px solid var(--accent, #0f766e); outline-offset: 3px; }
.team-access-form { display: grid; gap: 14px; max-width: 700px; }
.team-access-dialog .team-access-field { display: grid; gap: 6px; min-width: 0; font-size: 14px; font-weight: 600; color: var(--text, #151b26); }
.team-access-dialog .team-access-field input, .team-access-dialog .team-access-field select, .team-access-dialog .team-access-role-row select { box-sizing: border-box; width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--line, #d9e0ea); border-radius: 7px; background: var(--panel, #fff); color: var(--text, #151b26); font: inherit; font-weight: 400; }
.team-access-dialog .team-access-check { display: flex; align-items: flex-start; gap: 9px; line-height: 1.6; color: var(--text, #151b26); }
.team-access-dialog .team-access-check input { min-height: 0; height: 16px; width: 16px; flex: 0 0 auto; margin-top: 4px; accent-color: var(--accent, #0f766e); }
.team-access-actions, .team-access-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.team-access-actions { margin-top: 4px; }
.team-access-error { color: var(--red, #a83232); background: #a832320a; padding: 10px 12px; border: 1px solid #a8323233; border-radius: 7px; margin: 0; white-space: pre-wrap; }
.team-access-error[hidden] { display: none; }
.team-access-password { padding: 16px 0; border-top: 1px solid var(--line, #d9e0ea); margin: 16px 0; }
.team-access-password summary { cursor: pointer; font-weight: 600; }
.team-access-password[open] summary { margin-bottom: 16px; }
.team-access-my-roles { padding-left: 22px; line-height: 1.9; }
.team-access-tabs { border-top: 1px solid var(--line, #d9e0ea); padding: 20px 0 14px; margin-top: 20px; }
.team-access-dialog .team-access-tabs button[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--panel)); color: var(--text); }
.team-access-members { display: grid; grid-template-columns: minmax(190px, 30%) minmax(0, 1fr); gap: 22px; }
.team-access-member-list { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.team-access-member-item { text-align: left; overflow-wrap: anywhere; line-height: 1.6; white-space: normal; }
.team-access-member-editor { min-width: 0; padding-left: 22px; border-left: 1px solid var(--line, #d9e0ea); }
.team-access-member-editor h3 { margin-top: 0; }
.team-access-roles { display: grid; gap: 10px; border: 1px solid var(--line, #d9e0ea); border-radius: 8px; padding: 12px; min-width: 0; }
.team-access-roles legend { padding: 0 5px; font-weight: 600; }
.team-access-dialog .team-access-role-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(100px, 150px); gap: 14px; align-items: center; color: var(--text, #151b26); }
.team-access-role-row span { overflow-wrap: anywhere; }
.team-access-audit { margin-bottom: 16px; }
.team-access-audit section { border-bottom: 1px solid var(--line, #d9e0ea); padding: 12px 0; }
.team-access-audit p { color: var(--muted, #687386); margin: 4px 0 0; font-size: 13px; }
.team-cost-filters { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) repeat(2, minmax(0, 1fr)) auto; align-items: end; gap: 10px; margin-bottom: 16px; }
.team-cost-filters .team-access-actions { margin: 0; }
.team-cost-summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .85fr) repeat(2, minmax(0, 1.25fr)); margin: 0 0 16px; border: 1px solid var(--line); border-radius: 8px; background: color-mix(in srgb, var(--accent) 5%, var(--panel)); }
.team-cost-summary > div { min-width: 0; padding: 12px 14px; }
.team-cost-summary > div + div { border-left: 1px solid var(--line); }
.team-cost-summary dt { margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.team-cost-summary dd { margin: 0; line-height: 1.6; }
.team-cost-total { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.team-cost-amount { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.team-cost-muted { color: var(--muted); font-size: 12px; line-height: 1.6; }
.team-cost-overflow { overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.team-cost-overflow:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.team-cost-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 13px; }
.team-cost-table th, .team-cost-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.team-cost-table thead th { background: var(--shell-panel-2, var(--bg)); font-weight: 650; }
.team-cost-table thead th:nth-child(-n+2) { width: 15%; }
.team-cost-table thead th:nth-child(3) { width: 29%; }
.team-cost-table thead th:nth-child(4) { width: 11%; }
.team-cost-table tbody tr:last-child > * { border-bottom: 0; }
.team-cost-table tbody tr:hover { background: color-mix(in srgb, var(--accent) 4%, var(--panel)); }
.team-cost-units { font-variant-numeric: tabular-nums; }
.team-cost-empty { margin: 0; padding: 18px 14px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); }
.team-cost-limitations { margin-top: 12px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.team-cost-limitations summary { width: fit-content; cursor: pointer; }
.team-cost-limitations ul { margin: 6px 0 0; padding-left: 20px; }
dialog.team-access-login[open] { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0; background: var(--bg, #f1f3f0); display: grid; align-items: center; justify-items: center; padding: 24px; overflow: auto; }
.team-access-login .team-access-shell { width: min(100%, 440px); border: 1px solid var(--line, #d9e0ea); border-radius: 14px; background: var(--panel, #fff); box-shadow: var(--shadow, 0 18px 50px #1e293b14); }
.team-access-login .team-access-actions button { width: 100%; }
@media (max-width: 640px) {
  .team-access-head { padding: 16px; }
  .team-access-body { padding: 18px 16px; }
  .team-access-members { grid-template-columns: 1fr; gap: 18px; }
  .team-access-member-list { max-height: 200px; overflow-y: auto; }
  .team-access-member-editor { padding: 16px 0 0; border-left: 0; border-top: 1px solid var(--line, #d9e0ea); }
  .team-access-dialog .team-access-role-row { grid-template-columns: minmax(0, 1fr) minmax(100px, 130px); gap: 8px; }
  .team-cost-filters, .team-cost-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .team-cost-summary > div:nth-child(odd) { border-left: 0; }
  .team-cost-summary > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  dialog.team-access-login[open] { padding: 16px; }
}
