/* WAYLAB-NAV-TEAM (T-1387) — правая часть .planner-topbar: видимость, команда, инвайт, короткая ссылка. */

.planner-topbar-right {
  grid-column: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  justify-self: end;
}

.ptm {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  height: 100%;
}
.ptm[hidden] { display: none; }

/* ---- видимость ---- */
.ptm-vis {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 11px 0 12px;
  border: 1px solid #e2e6e2;
  border-radius: 999px;
  background: #fff;
  color: #3e4a43;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.ptm-vis:hover { border-color: #cdd5cd; background: #fbfcfa; }
.ptm-vis:focus-visible { outline: 2px solid #14b8a6; outline-offset: 2px; }
.ptm-vis.is-static { cursor: default; }
.ptm-vis.is-static:hover { border-color: #e2e6e2; background: #fff; }
.ptm-vis-ico { display: inline-flex; width: 15px; height: 15px; color: #6b766f; }
.ptm-vis-ico svg { width: 15px; height: 15px; }
.ptm-vis-chev { display: inline-flex; width: 13px; height: 13px; margin-left: 1px; color: #8a948d; }
.ptm-vis-chev svg { width: 13px; height: 13px; }

/* ---- команда ---- */
.ptm-people { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.ptm-group { display: inline-flex; align-items: center; gap: 7px; }
.ptm-online-label {
  color: #1f9d55;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.ptm-avatars { display: inline-flex; align-items: center; padding-left: 2px; }
.ptm-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ptm-av-bg, #e6e2d6);
  color: var(--ptm-av-fg, #3b382c);
  border: 2px solid #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  user-select: none;
  transition: transform .15s, box-shadow .15s;
}
.ptm-avatar + .ptm-avatar { margin-left: -7px; }
.ptm-avatar:hover { transform: translateY(-1px); z-index: 2; }
.ptm-avatar.is-online {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, .55), 0 0 10px 2px rgba(34, 197, 94, .45);
  animation: ptm-online-pulse 2.6s ease-in-out infinite;
}
@keyframes ptm-online-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(34, 197, 94, .55), 0 0 10px 2px rgba(34, 197, 94, .45); }
  50% { box-shadow: 0 0 0 2px rgba(34, 197, 94, .35), 0 0 6px 1px rgba(34, 197, 94, .28); }
}
.ptm-more {
  background: #f4f6f2;
  color: #5c675f;
  font-size: 11px;
  font-weight: 600;
}

/* ---- действия ---- */
.ptm-invite {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 16px;
  border: 1px solid #cdf02f;
  border-radius: 999px;
  background: #d8fa4b;
  color: #16230a;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: filter .15s, transform .05s;
}
.ptm-invite svg { width: 14px; height: 14px; }
.ptm-invite:hover { filter: brightness(.97); }
.ptm-invite:active { transform: translateY(1px); }
.ptm-invite:focus-visible { outline: 2px solid #14b8a6; outline-offset: 2px; }

.ptm-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #e2e6e2;
  border-radius: 11px;
  background: #fff;
  color: #3e4a43;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.ptm-share svg { width: 16px; height: 16px; }
.ptm-share:hover { border-color: #cdd5cd; background: #fbfcfa; }
.ptm-share:focus-visible { outline: 2px solid #14b8a6; outline-offset: 2px; }
.ptm-share[disabled] { opacity: .55; cursor: progress; }

/* Заголовок ленты не должен резаться в «AI-конструк…»: чип тоталов уступает место. */
.planner-feed-head > .planner-page-head { font-size: 1rem; letter-spacing: -0.02em; }
.planner-feed-head > .rl-totals-flag { max-width: min(210px, 54%); }

/* Старый статус «В сети» дублирует группу присутствия — оставляем только
   содержательные состояния (офлайн / только чтение / polling). */
#wc-status[data-state="live"] { display: none !important; }

/* ---- адаптив ---- */
@media (max-width: 1440px) {
  .ptm-all .ptm-avatar:nth-child(n+4) { display: none; }
}
@media (max-width: 1240px) {
  .ptm-vis-text { display: none; }
  .ptm-vis { padding: 0 9px; }
  .ptm-all { display: none; }
}
@media (max-width: 1024px) {
  .ptm-people { display: none; }
  .planner-topbar-right { gap: 8px; }
}
@media (max-width: 860px) {
  /* На планшете/телефоне шапка не тянет ещё три блока: доступ и приглашение
     остаются в карточке маршрута ниже. */
  .ptm { display: none; }
}
@media (max-width: 760px) {
  .ptm-vis { display: none; }
  .ptm-invite { padding: 0 10px; }
  .ptm-invite-text { display: none; }
}

/* ---- T-1390 WAYLAB-NAV-TEAM-INVITE: мини-тултип участника (имя + присутствие) ---- */
.ptm-tip {
  position: fixed;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 260px;
  padding: 7px 10px 8px;
  border-radius: 10px;
  background: rgba(10, 22, 40, .95);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.3;
  text-align: left;
  box-shadow: 0 12px 26px -14px rgba(10, 22, 40, .7);
  pointer-events: none;
  animation: ptm-tip-in .12s ease-out;
}
.ptm-tip[hidden] { display: none; }
.ptm-tip::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(10, 22, 40, .95);
}
.ptm-tip.is-below::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: rgba(10, 22, 40, .95);
}
.ptm-tip-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.ptm-tip-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #c6d1c9;
  font-size: 11.5px;
  font-weight: 500;
}
.ptm-tip-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8b968f;
}
.ptm-tip-dot.is-on {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, .25);
}
.ptm-tip.is-more .ptm-tip-name { font-weight: 500; }
@keyframes ptm-tip-in {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
