.team-view-switch { display: inline-flex; gap: 4px; padding: 5px; margin: 0 0 28px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-muted); }
.team-view-switch a { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 42px; padding: 10px 18px; border: 1px solid transparent; border-radius: 10px; color: var(--muted); font-size: 13px; font-weight: 650; text-decoration: none; }
.team-view-switch a[aria-current="page"] { background: var(--surface); border-color: var(--line); color: var(--accent-ink); box-shadow: 0 2px 5px rgb(0 0 0 / 0.04); }
.team-view-switch a:hover { color: var(--accent); }
.team-tree { min-width: 0; }
.team-tree-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 0 28px; }
.team-tree-toolbar h3 { margin: 0 0 7px; font-size: 18px; letter-spacing: -0.3px; }
.team-tree-toolbar p { margin: 0; max-width: 560px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.team-tree-actions { display: flex; flex-shrink: 0; flex-wrap: wrap; gap: 8px; }
.team-tree-actions .button { gap: 8px; min-height: 40px; padding: 9px 12px; border-radius: 10px; font-size: 12px; }
.org-owner { display: flex; align-items: center; gap: 16px; padding: 22px; border: 1px solid var(--accent-line); border-radius: 18px; background: var(--accent-tint); }
.org-owner-mark { display: grid; place-items: center; width: 48px; height: 48px; flex-shrink: 0; border-radius: 14px; color: var(--accent); background: var(--accent-soft); font-size: 21px; }
.org-owner strong { display: block; margin-bottom: 5px; font-size: 18px; }
.org-owner div > span { color: var(--accent-ink); font-size: 13px; }
.org-owner p { max-width: 250px; margin: 0 0 0 auto; color: var(--muted); font-size: 12px; line-height: 1.7; }
.org-roots, .org-children { list-style: none; margin: 0 0 0 24px; padding: 18px 0 0 26px; }
.org-children { margin-left: 48px; }
.org-children[hidden] { display: none; }
.org-branch { position: relative; padding: 0 0 18px; }
.org-branch:last-child { padding-bottom: 0; }
.org-branch::before { position: absolute; top: -18px; bottom: 0; left: -26px; border-left: 1px solid var(--accent-line); content: ""; }
.org-branch:last-child::before { display: none; }
.org-row { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 12px; }
.org-row::before { position: absolute; top: -18px; left: -26px; width: 26px; height: calc(50% + 18px); border-left: 1px solid var(--accent-line); border-bottom: 1px solid var(--accent-line); border-bottom-left-radius: 10px; content: ""; }
.org-row::after { position: absolute; top: 50%; left: 32px; width: 12px; border-top: 1px solid var(--accent-line); content: ""; }
.org-toggle, .org-leaf { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: 11px; }
.org-toggle { cursor: pointer; }
.org-toggle:hover { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
.org-toggle[aria-expanded="false"] i { transform: rotate(-90deg); }
.org-leaf { border-color: transparent; background: var(--accent-tint); color: var(--accent); }
.org-card { display: grid; grid-template-columns: 68px minmax(0, 1fr) auto 14px; align-items: center; gap: 20px; min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); text-decoration: none; box-shadow: 0 3px 14px rgb(0 0 0 / 0.025); }
.org-card:hover { border-color: var(--accent-line); background: color-mix(in srgb, var(--surface) 96%, var(--accent)); }
.org-avatar { display: grid; place-items: center; width: 68px; height: 68px; overflow: hidden; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.org-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.org-avatar b { font-size: 22px; }
.org-identity { min-width: 0; }
.org-identity strong { display: block; color: var(--ink); font-size: 18px; line-height: 1.4; overflow-wrap: anywhere; }
.org-role { display: block; margin-top: 5px; color: var(--accent-ink); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.org-reports { display: block; margin-top: 9px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.org-state { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 8px; background: var(--surface-muted); color: var(--muted); font-size: 11px; line-height: 1.5; }
.org-state.active { background: var(--accent-tint); color: var(--accent-ink); }
.org-state.halted { background: var(--danger-tint); color: var(--danger); }
.org-open { color: var(--muted); font-size: 12px; }
.org-unlinked { margin-top: 28px; padding: 22px; border: 1px solid var(--attention-line); border-radius: 18px; background: var(--attention-soft); }
.org-unlinked h3 { margin: 0 0 8px; font-size: 16px; }
.org-unlinked > p { margin: 0; color: var(--attention-ink); font-size: 12px; line-height: 1.7; }
.team-tree-note { display: flex; align-items: flex-start; gap: 10px; margin: 26px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.team-tree-note > i { margin-top: 4px; color: var(--accent); }
@media (max-width: 1100px) {
  .team-tree-toolbar { align-items: flex-start; flex-direction: column; }
  .org-card { grid-template-columns: 58px minmax(0, 1fr) 14px; gap: 12px 16px; padding: 18px; }
  .org-avatar { width: 58px; height: 58px; grid-row: 1 / 3; }
  .org-state { grid-column: 2; justify-self: start; }
  .org-open { grid-column: 3; grid-row: 1; }
  .org-children { margin-left: 22px; }
  .org-owner { flex-wrap: wrap; }
  .org-owner p { flex-basis: 100%; max-width: none; margin: 0; }
}
@media (max-width: 600px) {
  .org-roots, .org-children { margin-left: 0; padding-left: 14px; }
  .org-branch::before, .org-row::before { left: -14px; }
  .org-row::before { width: 14px; }
  .org-row { grid-template-columns: 24px minmax(0, 1fr); gap: 6px; }
  .org-row::after { left: 24px; width: 6px; }
  .org-toggle, .org-leaf { width: 24px; height: 30px; border-radius: 8px; }
  .org-card { grid-template-columns: 40px minmax(0, 1fr); padding: 14px; gap: 10px; border-radius: 14px; }
  .org-avatar { width: 40px; height: 40px; grid-row: 1; }
  .org-avatar b { font-size: 15px; }
  .org-identity strong { font-size: 15px; }
  .org-role { font-size: 12px; }
  .org-reports { font-size: 10px; }
  .org-state { grid-column: 1 / -1; font-size: 10px; }
  .org-open { display: none; }
  .org-owner { padding: 18px; gap: 12px; }
  .org-owner-mark { width: 40px; height: 40px; }
  .org-owner div { flex: 1; min-width: 0; }
  .org-unlinked { padding: 14px; }
}
