:root {
  --team-ink: #17211c;
  --team-muted: #66736d;
  --team-line: #c8d8d0;
  --team-card: #ffffff;
  --team-soft: #f4f7f2;
  --team-green: #0f6b4d;
  --team-gold: #d9a82f;
  --team-blue: #3d6ea8;
  --team-red: #b65a4d;
  --team-shadow: 0 18px 48px rgba(26, 48, 38, .12);
}

* {
  box-sizing: border-box;
}

body.team-page {
  margin: 0;
  color: var(--team-ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background:
    linear-gradient(135deg, rgba(15, 107, 77, .09), rgba(217, 168, 47, .08) 42%, rgba(61, 110, 168, .09)),
    #f8faf6;
  min-height: 100vh;
}

.team-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 48px;
}

.team-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.team-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  font-weight: 800;
}

.team-brand img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  box-shadow: 0 10px 24px rgba(15, 79, 56, .16);
}

.team-lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(23, 33, 28, .12);
  background: rgba(255, 255, 255, .76);
  color: var(--team-green);
  text-decoration: none;
  font-weight: 800;
}

.team-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: end;
  padding: 28px 0 20px;
}

.team-eyebrow {
  color: var(--team-green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.team-hero h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 64px);
  line-height: .98;
  letter-spacing: 0;
}

.team-hero p {
  max-width: 650px;
  margin: 14px 0 0;
  color: var(--team-muted);
  font-size: 17px;
  line-height: 1.55;
}

.team-hero-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.team-lrneo-action {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  max-width: min(100%, 310px);
}

.team-lrneo-action small {
  max-width: 280px;
  color: rgba(31, 58, 45, .68);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
  text-align: right;
}

.team-lrneo-action small[hidden] {
  display: none;
}

.team-refresh,
.team-add,
.team-invite-trigger {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 850;
  cursor: pointer;
}

.team-refresh {
  background: var(--team-green);
  color: #fff;
  box-shadow: 0 14px 28px rgba(15, 107, 77, .22);
}

.team-refresh:disabled,
.team-refresh.is-disabled {
  cursor: not-allowed;
  color: rgba(31, 58, 45, .58);
  background: rgba(31, 58, 45, .12);
  box-shadow: none;
  opacity: .72;
}

.team-person.has-points {
  position: relative;
  border-color: rgba(22, 163, 74, .32);
  box-shadow: 0 14px 26px rgba(22, 163, 74, .1);
}

.team-person.no-lr-data {
  filter: saturate(.72);
}

.team-person.near-next-level {
  border-color: rgba(217, 168, 47, .62);
  box-shadow: 0 16px 30px rgba(217, 168, 47, .18);
}

.team-person.manual-node .team-manual-dot {
  background: #2563eb;
}

.team-neo-badge {
  position: absolute;
  right: -4px;
  bottom: -4px;
  min-width: 31px;
  height: 22px;
  padding: 0 4px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: #16a34a;
  border: 2px solid #fff;
  font-size: 9px;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(22, 163, 74, .28);
  z-index: 3;
}

.team-neo-badge:hover {
  background: #0f6b4d;
}

.team-neo-badge-problem {
  min-width: 38px;
  background: #dc2626;
  box-shadow: 0 8px 18px rgba(220, 38, 38, .28);
}

.team-neo-badge-problem:hover {
  background: #b91c1c;
}

.team-person.lrneo-pull-problem {
  border-color: rgba(220, 38, 38, .42);
}

.team-action-panel-label {
  margin: 4px 0 8px;
  color: var(--team-green);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.team-action-panel-label-actions {
  flex-basis: 100%;
  width: 100%;
  margin-top: 10px;
}

.team-add {
  background: #fff;
  color: var(--team-green);
  border: 1px solid rgba(15, 107, 77, .18);
  box-shadow: 0 12px 26px rgba(26, 48, 38, .08);
}

.team-invite-trigger {
  background: rgba(15, 107, 77, .1);
  color: var(--team-green);
  border: 1px solid rgba(15, 107, 77, .18);
  box-shadow: 0 12px 26px rgba(26, 48, 38, .08);
}

.team-refresh:focus-visible,
.team-add:focus-visible,
.team-invite-trigger:focus-visible,
.team-person:focus-visible,
.team-close:focus-visible,
.team-action-primary:focus-visible,
.team-action-secondary:focus-visible {
  outline: 3px solid rgba(217, 168, 47, .46);
  outline-offset: 3px;
}

.team-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 8px 0 22px;
}

.team-stats-below {
  margin: 18px 0 0;
}

.team-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(205, 220, 211, .76);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
  color: #617266;
  font-size: 12px;
  font-weight: 800;
}

.team-legend strong {
  color: #173827;
  margin-right: 2px;
}

.team-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.team-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #94a3b8;
}

.team-legend i.green { background: #16a34a; }
.team-legend i.gray { background: #94a3b8; }
.team-legend i.gold { background: #d9a82f; }
.team-legend i.red { background: #dc2626; }
.team-legend i.blue { background: #2563eb; }
.team-legend i.neo { background: #16a34a; box-shadow: inset 0 0 0 2px rgba(255,255,255,.7); }

.team-stat {
  min-height: 104px;
  padding: 16px;
  border: 1px solid rgba(23, 33, 28, .08);
  border-radius: 8px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 12px 32px rgba(30, 54, 43, .07);
}

.team-stat span {
  display: block;
  color: var(--team-muted);
  font-size: 13px;
  font-weight: 700;
}

.team-stat strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
  line-height: 1;
}

.team-invite-card {
  display: grid;
  gap: 12px;
  margin: 18px 0 26px;
  padding: 18px;
  border: 1px solid rgba(23, 33, 28, .08);
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 18px 50px rgba(23, 33, 28, .08);
}

.team-invite-head span {
  display: block;
  color: var(--team-green);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.team-invite-head strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.team-invite-card p {
  margin: 0;
  color: var(--team-muted);
  line-height: 1.55;
}

.team-invite-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.team-invite-row input {
  min-height: 42px;
  border: 1px solid rgba(23, 33, 28, .14);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
}

.team-invite-row a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.team-status {
  min-height: 24px;
  color: var(--team-muted);
  font-size: 14px;
  margin-bottom: 10px;
}

.team-board {
  position: relative;
  min-height: 300px;
  padding: 28px 20px 34px;
  border: 1px solid rgba(23, 33, 28, .08);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.78)),
    radial-gradient(circle at 12% 15%, rgba(15,107,77,.12), transparent 28%),
    radial-gradient(circle at 88% 8%, rgba(217,168,47,.14), transparent 26%);
  box-shadow: var(--team-shadow);
  overflow-x: auto;
}

.team-loading,
.team-empty,
.team-error {
  display: grid;
  place-items: center;
  min-height: 260px;
  text-align: center;
  color: var(--team-muted);
  line-height: 1.6;
  padding: 24px;
}

.team-empty strong,
.team-error strong {
  display: block;
  color: var(--team-ink);
  font-size: 20px;
  margin-bottom: 6px;
}

.team-empty-note {
  max-width: 640px;
  margin: 26px auto 0;
  padding: 16px 18px;
  border: 1px solid rgba(23, 33, 28, .08);
  border-radius: 8px;
  background: rgba(244, 247, 242, .88);
  color: var(--team-muted);
  text-align: center;
  line-height: 1.55;
}

.team-empty-note strong {
  display: block;
  color: var(--team-ink);
  font-size: 18px;
  margin-bottom: 4px;
}

.team-empty-note span {
  display: block;
}

.team-tree {
  display: flex;
  justify-content: center;
  min-width: max-content;
}

.team-tree ul {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 34px 0 0;
  margin: 0;
  list-style: none;
}

.team-tree > ul {
  padding-top: 0;
}

.team-tree li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 8px;
}

.team-tree li::before,
.team-tree li::after {
  content: "";
  position: absolute;
  top: -18px;
  width: calc(50% + 9px);
  height: 18px;
  border-top: 2px solid var(--team-line);
}

.team-tree li::before {
  right: 50%;
}

.team-tree li::after {
  left: 50%;
  border-left: 2px solid var(--team-line);
}

.team-tree li:only-child::before,
.team-tree li:only-child::after {
  display: none;
}

.team-tree li:first-child::before,
.team-tree li:last-child::after {
  border-top: 0;
}

.team-tree ul ul::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  height: 34px;
  border-left: 2px solid var(--team-line);
}

.team-tree-growth ul ul::before,
.team-tree-growth li::before,
.team-tree-growth li::after {
  border-color: rgba(128, 153, 142, .45);
}

.team-person {
  position: relative;
  width: 140px;
  min-height: 164px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid rgba(23, 33, 28, .1);
  border-radius: 8px;
  background: var(--team-card);
  color: var(--team-ink);
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(20, 42, 32, .1);
  padding: 14px 12px;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.team-person:hover {
  transform: translateY(-3px);
  border-color: rgba(15, 107, 77, .35);
  box-shadow: 0 18px 38px rgba(20, 42, 32, .16);
}

.team-node-wrap {
  position: relative;
  display: inline-flex;
}

.team-quick-points {
  position: absolute;
  right: -8px;
  top: -8px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(15, 107, 77, .18);
  border-radius: 999px;
  background: #fff;
  color: var(--team-green);
  cursor: pointer;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(20, 42, 32, .16);
}

.team-quick-points:hover {
  background: var(--team-green);
  color: #fff;
}

.team-percent-badge {
  position: absolute;
  left: -8px;
  top: -8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(217, 168, 47, .35);
  background: #fff7df;
  color: #7b5512;
  font-size: 11px;
  font-weight: 950;
  box-shadow: 0 10px 22px rgba(20, 42, 32, .14);
  pointer-events: none;
}

.team-person-success {
  border-color: rgba(34, 197, 94, .42);
  background: linear-gradient(180deg, #f3fff7 0%, #ffffff 68%);
  box-shadow: 0 14px 30px rgba(22, 163, 74, .16);
}

.team-person-success:hover {
  border-color: rgba(22, 163, 74, .62);
  box-shadow: 0 20px 42px rgba(22, 163, 74, .22);
}

.team-person-success .team-percent-badge {
  border-color: rgba(34, 197, 94, .46);
  background: #dcfce7;
  color: #166534;
}

.team-person-placeholder {
  cursor: default;
  border-style: dashed;
  border-color: rgba(128, 153, 142, .42);
  background: rgba(255, 255, 255, .46);
  box-shadow: none;
  opacity: .72;
}

.team-person-placeholder:hover {
  transform: none;
  border-color: rgba(128, 153, 142, .42);
  box-shadow: none;
}

.team-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  position: relative;
  display: block;
  color: #fff;
  background: linear-gradient(135deg, var(--team-green), var(--team-blue));
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.38), 0 10px 22px rgba(15,79,56,.2);
}

.team-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.team-avatar-has-image::before,
.team-avatar-has-image::after {
  display: none;
}

.team-avatar::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 18px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  transform: translateX(-50%);
}

.team-avatar::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 16px;
  width: 36px;
  height: 20px;
  border-radius: 18px 18px 10px 10px;
  background: rgba(255,255,255,.92);
  transform: translateX(-50%);
}

.team-node-info {
  display: grid;
  gap: 3px;
  width: 100%;
  text-align: center;
  line-height: 1.18;
}

.team-node-name,
.team-node-level,
.team-node-points {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.team-node-name {
  color: var(--team-ink);
  font-size: 14px;
  font-weight: 900;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.team-node-level,
.team-node-points {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-node-level {
  color: var(--team-green);
  font-size: 11px;
  font-weight: 850;
}

.team-node-points {
  color: var(--team-muted);
  font-size: 11px;
  font-weight: 800;
}

.team-person[data-status="pending"] .team-avatar {
  background: linear-gradient(135deg, var(--team-gold), #b8831f);
}

.team-person[data-status="rejected"] .team-avatar {
  background: linear-gradient(135deg, var(--team-red), #8e433c);
}

.team-person-contact .team-avatar,
.team-person-linked .team-avatar {
  background: linear-gradient(135deg, #66736d, var(--team-green));
}

.team-person-placeholder .team-avatar {
  background: linear-gradient(135deg, rgba(128,153,142,.5), rgba(190,202,196,.72));
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.52);
}

.team-person-placeholder {
  min-height: 118px;
}

.team-node-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  min-height: 14px;
}

.team-status-dot,
.team-link-dot,
.team-manual-dot {
  display: block;
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(255,255,255,.9);
}

.team-status-dot {
  width: 11px;
  height: 11px;
  background: var(--team-muted);
}

.team-status-dot.approved {
  background: var(--team-green);
}

.team-status-dot.pending {
  background: var(--team-gold);
}

.team-status-dot.rejected {
  background: var(--team-red);
}

.team-status-dot.stage-kontakt {
  background: var(--team-muted);
}

.team-status-dot.stage-razgovor {
  background: var(--team-blue);
}

.team-status-dot.stage-zainteresovan {
  background: var(--team-gold);
}

.team-status-dot.stage-registrovan,
.team-status-dot.stage-aktivan {
  background: var(--team-green);
}

.team-link-dot {
  width: 20px;
  height: 8px;
  background: var(--team-blue);
}

.team-manual-dot {
  width: 8px;
  height: 8px;
  background: #fff;
  border: 2px solid var(--team-green);
}

.team-detail[hidden] {
  display: none;
}

.team-detail {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.team-detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 18, 15, .42);
  backdrop-filter: blur(4px);
}

.team-detail-panel {
  position: absolute;
  top: 16px;
  left: 50%;
  width: min(760px, calc(100% - 64px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(0,0,0,.24);
  padding: 20px;
  transform: translateX(-50%);
}

.team-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  border-bottom: 1px solid rgba(23, 33, 28, .08);
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.team-detail-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.team-detail-head p {
  margin: 6px 0 0;
  color: var(--team-muted);
}

.team-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(23, 33, 28, .1);
  background: #f7f9f5;
  color: var(--team-ink);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.team-detail-list {
  display: grid;
  gap: 10px;
}

.team-manual-note {
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(15, 107, 77, .08);
  color: var(--team-green);
  font-weight: 800;
  line-height: 1.45;
}

.team-detail-row {
  display: grid;
  grid-template-columns: 135px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid rgba(23, 33, 28, .06);
}

.team-detail-row span {
  color: var(--team-muted);
  font-size: 13px;
  font-weight: 800;
}

.team-detail-row strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.team-detail-actions,
.team-form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.team-action-primary,
.team-action-secondary,
.team-action-danger {
  min-height: 42px;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 850;
  cursor: pointer;
}

.team-action-primary {
  border: 0;
  background: var(--team-green);
  color: #fff;
}

.team-action-primary:disabled {
  opacity: .65;
  cursor: wait;
}

.team-action-secondary {
  border: 1px solid rgba(23, 33, 28, .12);
  background: #fff;
  color: var(--team-ink);
}

.team-action-danger {
  border: 1px solid rgba(182, 90, 77, .25);
  background: rgba(182, 90, 77, .08);
  color: #8e433c;
}

.team-form-modal[hidden] {
  display: none;
}

.team-form-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
}

.team-invite-modal[hidden] {
  display: none;
}

.team-invite-modal {
  position: fixed;
  inset: 0;
  z-index: 1120;
}

.team-quick-points-modal {
  z-index: 1130;
}

.team-invite-panel {
  position: absolute;
  top: 16px;
  left: 50%;
  width: min(720px, calc(100% - 28px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(0,0,0,.24);
  padding: 20px;
  transform: translateX(-50%);
}

.team-form-panel {
  position: absolute;
  top: 16px;
  left: 50%;
  width: min(720px, calc(100% - 28px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(0,0,0,.24);
  padding: 20px;
  transform: translateX(-50%);
}

.team-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.team-form label {
  display: grid;
  gap: 7px;
  color: var(--team-muted);
  font-size: 13px;
  font-weight: 850;
}

.team-form input,
.team-form select,
.team-form textarea {
  width: 100%;
  border: 1px solid rgba(23, 33, 28, .14);
  border-radius: 8px;
  background: #fff;
  color: var(--team-ink);
  font: inherit;
  padding: 11px 12px;
}

.team-form input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.team-form input[type="number"]::-webkit-outer-spin-button,
.team-form input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.team-form textarea {
  resize: vertical;
  min-height: 100px;
}

.team-form-wide,
.team-form-error,
.team-form-actions {
  grid-column: 1 / -1;
}

.team-form [hidden] {
  display: none;
}

.team-form-error {
  display: none;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(182, 90, 77, .1);
  color: #8e433c;
  font-weight: 800;
}

.team-form-help {
  display: block;
  color: rgba(76, 88, 80, .82);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.team-form-section {
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(15, 107, 77, .08);
  color: var(--team-green);
  font-size: 13px;
  font-weight: 900;
}

.team-link-form {
  display: grid;
  gap: 14px;
}

.team-link-contact {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(15, 107, 77, .08);
  color: var(--team-green);
  font-weight: 850;
}

.team-link-contact span {
  color: var(--team-muted);
  font-size: 13px;
}

.team-link-list-wrap h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.team-link-list {
  display: grid;
  gap: 10px;
  max-height: 330px;
  overflow: auto;
  padding-right: 4px;
}

.team-link-user {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid rgba(23, 33, 28, .1);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.team-link-user:has(input:checked) {
  border-color: rgba(15, 107, 77, .55);
  box-shadow: 0 0 0 3px rgba(15, 107, 77, .1);
}

.team-link-user span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.team-link-user small,
.team-link-user em {
  color: var(--team-muted);
  font-size: 12px;
  font-style: normal;
  overflow-wrap: anywhere;
}

.team-link-user em {
  color: var(--team-green);
  font-weight: 850;
}

.team-empty-inline {
  padding: 14px;
  border-radius: 8px;
  background: rgba(23, 33, 28, .05);
  color: var(--team-muted);
  font-weight: 800;
}

@media (min-width: 821px) {
  .team-detail-panel {
    padding: 24px;
  }

  .team-detail-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
  }

  .team-detail-row {
    min-height: 72px;
    grid-template-columns: 1fr;
    gap: 6px;
    align-content: start;
    padding: 12px;
    border: 1px solid rgba(23, 33, 28, .08);
    border-radius: 8px;
    background: rgba(247, 249, 245, .72);
  }

  .team-manual-note {
    grid-column: 1 / -1;
  }

  .team-detail-actions {
    position: sticky;
    bottom: -24px;
    margin: 18px -24px -24px;
    padding: 14px 24px;
    border-top: 1px solid rgba(23, 33, 28, .1);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(12px);
  }

  .team-form-modal:not(.team-link-modal) .team-form-panel {
    width: min(760px, calc(100% - 64px));
    padding: 24px;
  }

  .team-invite-panel {
    width: min(760px, calc(100% - 64px));
    padding: 24px;
  }

  .team-form-modal:not(.team-link-modal) .team-form {
    gap: 16px 18px;
  }
}

body.team-modal-open {
  overflow: hidden;
}

@media (max-width: 820px) {
  .team-shell {
    width: min(100% - 20px, 680px);
    padding-top: 12px;
  }

  .team-hero {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .team-hero-actions {
    justify-content: flex-start;
  }

  .team-hero h1 {
    font-size: 40px;
  }

  .team-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-invite-row {
    grid-template-columns: 1fr;
  }

  .team-invite-row .team-action-primary,
  .team-invite-row .team-action-secondary {
    justify-content: center;
  }

  .team-board {
    padding: 22px 12px 28px;
  }

  .team-tree {
    justify-content: flex-start;
    padding: 0 10px;
  }

  .team-person {
    width: 118px;
    min-height: 150px;
  }

  .team-quick-points {
    right: -4px;
    top: -6px;
    width: 38px;
    height: 38px;
  }

  .team-percent-badge {
    left: -4px;
    top: -6px;
    width: 38px;
    height: 38px;
  }

  .team-avatar {
    width: 58px;
    height: 58px;
  }

  .team-avatar::before {
    top: 17px;
    width: 17px;
    height: 17px;
  }

  .team-avatar::after {
    bottom: 15px;
    width: 32px;
    height: 18px;
  }

  .team-person-placeholder {
    min-height: 106px;
  }

  .team-node-name {
    font-size: 13px;
  }

  .team-node-level,
  .team-node-points {
    font-size: 10px;
  }
}

@media (max-width: 520px) {
  .team-topbar {
    align-items: flex-start;
  }

  .team-stats {
    grid-template-columns: 1fr;
  }

  .team-stat {
    min-height: 86px;
  }

  .team-detail-panel {
    top: auto;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-height: 86vh;
    border-radius: 8px 8px 0 0;
    transform: none;
  }

  .team-detail-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .team-form-panel {
    top: max(8px, env(safe-area-inset-top));
    display: flex;
    flex-direction: column;
    width: calc(100% - 18px);
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    overflow: hidden;
    padding: 16px 16px 0;
  }

  .team-invite-panel {
    top: max(8px, env(safe-area-inset-top));
    width: calc(100% - 18px);
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    padding: 16px;
  }

  .team-form-panel .team-detail-head {
    flex: 0 0 auto;
  }

  .team-form {
    grid-template-columns: 1fr;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .team-form textarea {
    min-height: 78px;
  }

  .team-form-actions {
    justify-content: stretch;
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: 6px -16px 0;
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(255,255,255,.92), #fff 34%);
    border-top: 1px solid rgba(23, 33, 28, .08);
  }

  .team-form-actions button {
    flex: 1 1 140px;
  }
}
