/* Small additions on top of app.css's shared design tokens/components
   (--accent, --ink, .btn, .head, .loading, .empty, .error-box, .toast, ...)
   so this internal staff page matches the client cabinet's look. */
/* Staff shell — loaded on BOTH /projects (this file directly) and /team
   (team.html loads this file too, before team.css) — overrides app.css's
   .page max-width for the two internal cabinets. Unlike the client cabinet
   (a single-column card feed, capped at 900px in app.css for readable line
   length — see the comment there), staff's project/task cards are meant to
   flow into a multi-column grid on a wide monitor (.proj-list/.team-list
   below), so there's no reason to cap this one as tightly — 1600px covers
   even a large desktop display without cards going comically wide. */
@media(min-width:860px){
  .page{max-width:clamp(660px, 90vw, 1600px)}
}
/* SMM/ИИ tabs above the list — see tabOf()/render() in projects.js. Same
   "purple = ИИ" visual language as .edit-tab.ai in the edit popup and the
   avatar highlight on AI project cards, so it reads as one consistent idea
   rather than a new color scheme. */
.proj-tabs{display:flex;gap:8px;margin:4px 0 14px}
.proj-tab{flex:1;display:flex;align-items:center;justify-content:center;gap:7px;border:1px solid var(--line);background:#fff;color:var(--muted);border-radius:14px;padding:12px 14px;font-size:13.5px;font-weight:800;cursor:pointer;font-family:inherit;transition:background .15s,border-color .15s,color .15s}
.proj-tab.active{background:var(--accent);border-color:var(--accent);color:#fff}
.proj-tab.ai.active{background:var(--ai);border-color:var(--ai);color:#fff;box-shadow:0 0 0 1px var(--ai) inset,0 4px 14px rgba(155,90,246,.3)}
.proj-tab-ai-avatar{width:20px;height:20px;border-radius:50%;object-fit:cover;pointer-events:none}
.proj-tab-count{display:inline-flex;align-items:center;justify-content:center;min-width:21px;height:21px;padding:0 6px;border-radius:999px;background:rgba(0,0,0,.07);font-size:11.5px;font-weight:800}
.proj-tab.active .proj-tab-count{background:rgba(255,255,255,.25)}
@media(max-width:420px){
  .proj-tab{font-size:12px;padding:11px 8px;gap:5px}
  .proj-tab-ai-avatar{width:17px;height:17px}
}
.proj-search-row{display:flex;align-items:center;gap:10px;margin:4px 0 16px}
.proj-search{width:100%;border:1px solid var(--line);background:#fff;border-radius:14px;padding:12px 14px;font-size:14px;margin:0;outline:none;font:inherit;color:var(--ink);flex:1;min-width:0}
.proj-search:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(0,70,67,.08)}
/* "Архивные проекты" — выключен по умолчанию, показывает архивные проекты
   вместе с активными (не вместо них, см. render() в projects.js). Пилюля,
   а не чекбокс в рамке, чтобы не спорить визуально с полем поиска рядом. */
.archive-toggle-check{flex:0 0 auto;display:inline-flex;align-items:center;gap:7px;border:1px solid var(--line);border-radius:999px;padding:0 14px;height:44px;font-size:12.5px;font-weight:700;color:var(--muted);background:#fff;cursor:pointer;white-space:nowrap;user-select:none;transition:background .15s,border-color .15s,color .15s}
.archive-toggle-check input{width:15px;height:15px;accent-color:#7B8482;cursor:pointer;flex:none}
.archive-toggle-check:has(input:checked){color:var(--ink);border-color:#8b938f;background:#F1F2F2}
@media(max-width:520px){
  .proj-search-row{flex-wrap:wrap}
  .archive-toggle-check{flex:1 1 100%;justify-content:center}
}
/* Staff header — the same .head card as the client cabinet, but richer: a
   teal→purple gradient accent line on top, logo + two-line title with the
   brand word gradient-highlighted, and a "team-only" live pill on the right.
   (projects.html; the admin page, not shown to clients.) */
.staff-head{position:relative;padding:18px 22px;overflow:hidden}
.staff-head::before{content:"";position:absolute;top:0;left:0;right:0;height:4px;background:linear-gradient(90deg,var(--accent),var(--ai))}
.staff-head-main{display:grid;gap:12px}
/* Row 1 — logo and title are the SAME height: the logo's rendered height
   (44px) equals the title's line-height, so they read as one block. */
.staff-title-row{display:flex;align-items:center;gap:16px;min-width:0}
.staff-title-row .kf img{height:44px;width:auto;display:block}
.staff-title{margin:0;font-size:22px;font-weight:850;line-height:44px;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.staff-title-brand{background:linear-gradient(90deg,var(--accent),var(--ai));-webkit-background-clip:text;background-clip:text;color:transparent}
/* Row 2 — subtitle and the "team-only" pill share one line, pill on the right. */
.staff-sub-row{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0}
.staff-sub{margin:0;font-size:12.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.staff-head-pill{flex:0 0 auto;display:inline-flex;align-items:center;gap:7px;border:1px solid var(--line);border-radius:999px;padding:6px 11px;font-size:11px;font-weight:800;color:var(--muted);background:#FAFBFB}
.staff-head-pill::before{content:"";width:8px;height:8px;border-radius:50%;background:#79C94A;box-shadow:0 0 0 3px rgba(121,201,74,.18)}
@media(max-width:560px){
  .staff-head{padding:16px}
  .staff-title-row{gap:12px}
  .staff-title-row .kf img{height:34px}
  .staff-title{font-size:17px;line-height:34px}
  .staff-sub{font-size:11.5px}
}
@media(max-width:430px){
  .staff-head-pill{display:none}
}
.proj-list{display:grid;gap:12px}
/* Multi-column on a wide screen — auto-fill so the column count adapts to
   whatever width .page ends up at (see the clamp() above) instead of a
   hardcoded 2 or 3. align-items:start stops grid from stretching every card
   in a row to match the tallest one (cards vary in height — bead strip,
   archived badge, net chips are all optional). */
@media(min-width:860px){
  .proj-list{grid-template-columns:repeat(auto-fill, minmax(360px, 1fr));align-items:start}
}
.proj-card{background:#fff;border:1px solid var(--line);border-radius:18px;padding:14px 16px;display:grid;gap:9px}

/* Красная акцентная подсветка карточки проекта, не укладывающегося в KPI
   (kpi.tier === 'off' — см. kpiOffClass в projects.js). Раньше этот же
   box-shadow был ВРЕМЕННОЙ подсветкой проверки переноса с Mattermost
   (.proj-card.mig-issues) — пользователю понравилось, как это "светится",
   и по его запросу (2026-10-18, миграция подтверждена и закрыта) акцент
   оставлен, но перевешан на KPI. */
.proj-card.kpi-off{box-shadow:0 0 0 2px rgba(224,60,60,.55),0 0 10px rgba(224,60,60,.32)}
/* AI-project cards: driven by the "ИИ-проект" checkbox (project_settings.
   is_ai_project), not by prompt completeness — see aiStatusOf() in
   projectSettings.js. Flagged + all four prompts filled gets the AI accent;
   flagged but not fully configured gets the same avatar with an orange
   "needs attention" frame instead. Toned down ~50% from the original (was
   too saturated) — halved alphas throughout, border softened from a solid
   fill to a tinted one. */
.proj-card.ai{background:rgba(155,90,246,.10);border-color:rgba(155,90,246,.5);box-shadow:0 0 0 1px rgba(155,90,246,.5) inset,0 10px 24px rgba(155,90,246,.08)}
.proj-card.attention{background:rgba(238,130,8,.12);border-color:#EE8208;box-shadow:0 0 0 1px #EE8208 inset}
.proj-ai-avatar-wrap{position:relative;display:inline-flex;margin-bottom:2px}
.proj-ai-avatar{width:34px;height:34px;border-radius:50%;object-fit:cover;box-shadow:0 0 0 2px #fff,0 3px 10px rgba(155,90,246,.25),inset 0 -6px 9px rgba(0,0,0,.35),inset 0 5px 8px rgba(255,255,255,.10)}

/* "Это ИИ-проект" checkbox in the edit popup, next to the logo field. */
.ai-flag-check{display:flex;align-items:center;gap:8px;margin-top:10px;padding:8px 10px;background:#FAFBFB;border:1px solid var(--line);border-radius:12px;font-size:13px;cursor:pointer}
.ai-flag-check input{width:16px;height:16px;accent-color:var(--ai);cursor:pointer;flex:none}
.ai-flag-avatar{width:22px;height:22px;border-radius:50%;object-fit:cover;flex:none;box-shadow:0 0 0 1px rgba(155,90,246,.35)}
.ai-flag-check span{color:var(--ink)}
.ai-flag-check i{color:var(--muted);font-style:normal}

/* "Проект в архиве" toggle — same row/checkbox layout as .ai-flag-check
   above, graphite instead of purple so it reads as "paused", not "featured". */
.archive-flag-check{display:flex;align-items:center;gap:8px;margin-top:8px;padding:8px 10px;background:#FAFBFB;border:1px solid var(--line);border-radius:12px;font-size:13px;cursor:pointer}
.archive-flag-check input{width:16px;height:16px;accent-color:#7B8482;cursor:pointer;flex:none}
.archive-flag-check svg{color:#7B8482;flex:none}
.archive-flag-check span{color:var(--ink)}
.archive-flag-check i{color:var(--muted);font-style:normal}

/* Archived project card — desaturated/greyed-out variant of .proj-card,
   deliberately declared AFTER .ai/.attention above so it wins the cascade
   when a project is both AI-flagged and archived (pause outranks the AI
   highlight — see the aiClass/archivedClass note in projects.js render()).
   The "АРХИВНЫЙ" badge and logo stay visible so the card still reads
   at a glance, just muted. */
.proj-card.archived{background:#F5F6F6;border-color:var(--line);box-shadow:none}
.proj-card.archived .proj-logo{background:#8b938f;border-color:#8b938f}
.proj-card.archived .proj-logo img{filter:grayscale(1);opacity:.9}
.proj-card.archived .proj-logo-fallback{opacity:.9}
.proj-card.archived .proj-name{color:var(--muted)}
.proj-card.archived .proj-link{background:#EEF0EF;color:#8b938f}
.proj-card.archived .proj-actions-col{opacity:.6}
.proj-card.archived .proj-posts{opacity:.55}
.proj-name-row{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.archived-badge{position:relative;display:inline-flex;align-items:center;flex:0 0 auto;font-size:9.5px;font-weight:800;letter-spacing:.05em;color:#fff;background:#7B8482;border-radius:6px;padding:3px 7px;text-transform:uppercase;white-space:nowrap;cursor:default}
.archived-badge[data-tip]::after{
  content:attr(data-tip);
  position:absolute;
  top:calc(100% + 8px);
  left:0;
  background:#17201f;
  color:#fff;
  font-size:11px;
  font-weight:650;
  line-height:1.35;
  white-space:nowrap;
  padding:6px 9px;
  border-radius:8px;
  opacity:0;
  pointer-events:none;
  transition:opacity .15s;
  z-index:10;
  text-transform:none;
  letter-spacing:normal;
}
.archived-badge[data-tip]:hover::after{opacity:1}
/* Red "!" badge — paid-through date is under 5 days out (or already expired),
   see paidThroughStatus() in projects.js. Same dark-pill tooltip pattern as
   .archived-badge just above (they sit in the same .proj-name-row). */
.paid-warn-badge{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:16px;height:16px;border-radius:50%;background:var(--urgent);color:#fff;font-size:11px;font-weight:900;line-height:1;cursor:default}
.paid-warn-badge[data-tip]::after{
  content:attr(data-tip);
  position:absolute;
  top:calc(100% + 8px);
  left:0;
  background:#17201f;
  color:#fff;
  font-size:11px;
  font-weight:650;
  line-height:1.35;
  white-space:nowrap;
  padding:6px 9px;
  border-radius:8px;
  opacity:0;
  pointer-events:none;
  transition:opacity .15s;
  z-index:10;
}
.paid-warn-badge[data-tip]:hover::after{opacity:1}
/* Значок «Цербер» — проект защищён (см. cerberusBadge в projects.js).
   Тот же тёмный тултип-пилюля, что у archived-badge/paid-warn-badge выше
   (все три живут в .proj-name-row); цвет — тот же тёплый золотой, что у
   заполненной вкладки «Цербер» в попапе настроек (.edit-tab.cerberus.filled
   в этом же файле), чтобы бейдж в списке и вкладка в попапе читались как
   один и тот же визуальный язык «охраняется». */
.cerberus-badge{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:16px;height:16px;border-radius:50%;background:#F3C76A;color:#7A4D00;cursor:default}
.cerberus-badge[data-tip]::after{
  content:attr(data-tip);
  position:absolute;
  top:calc(100% + 8px);
  left:0;
  background:#17201f;
  color:#fff;
  font-size:11px;
  font-weight:650;
  line-height:1.35;
  white-space:nowrap;
  padding:6px 9px;
  border-radius:8px;
  opacity:0;
  pointer-events:none;
  transition:opacity .15s;
  z-index:10;
}
.cerberus-badge[data-tip]:hover::after{opacity:1}
.proj-card-top{display:flex;gap:12px;align-items:stretch}
.proj-logo{position:relative;flex:0 0 auto;width:52px;border-radius:14px;background:#044444;border:1px solid #044444;display:flex;align-items:center;justify-content:center}
/* overflow was hidden here, but the KPI dot (and its tooltip) needs to
   poke out of this box's corner — object-fit:contain below never overflows
   the box on its own, so dropping overflow:hidden doesn't change how the
   logo image/fallback letter looks, just unblocks the dot. */
.proj-logo img{border-radius:14px}
/* Traffic-light "в графике" dot — corner of the client logo. Only rendered
   when the project has a posts-per-month KPI set (backend/src/index.js's
   computeScheduleStatus); no dot at all otherwise, so projects that don't
   use this feature look exactly as before (see chat: "если не указано — не
   показываем"). Colors are reused, not invented: green matches
   .status.approved's tone, gold is the same one the calendar already uses
   for "waiting" (.cal-dot.waiting), red is the app-wide --urgent. */
.proj-kpi-dot{position:absolute;bottom:-2px;right:-2px;width:13px;height:13px;border-radius:50%;border:2px solid #fff;box-shadow:0 1px 3px rgba(0,0,0,.3);cursor:default}
.proj-kpi-dot.ontrack{background:#216A39}
.proj-kpi-dot.minor{background:#F5C518}
.proj-kpi-dot.off{background:var(--urgent)}
/* Same styled-tooltip idea as .icon-btn/.proj-ai-avatar-wrap (data-tip attr,
   dark pill, hover+touch), but anchored below instead of to the left — the
   dot sits at the bottom-right of the LOGO, on the card's left edge, so a
   leftward tooltip (like icon-btn's) would run off the page. */
.proj-kpi-dot[data-tip]::after{
  content:attr(data-tip);
  position:absolute;
  top:calc(100% + 9px);
  left:50%;
  transform:translateX(-50%);
  background:#17201f;
  color:#fff;
  font-size:11px;
  font-weight:650;
  line-height:1.35;
  white-space:nowrap;
  padding:6px 9px;
  border-radius:8px;
  opacity:0;
  pointer-events:none;
  transition:opacity .15s;
  z-index:10;
}
.proj-kpi-dot[data-tip]:hover::after,
.proj-kpi-dot[data-tip]:focus-visible::after{opacity:1}
@media (hover:none){
  .proj-kpi-dot[data-tip]::after{white-space:normal;max-width:180px}
  .proj-kpi-dot[data-tip]:active::after{opacity:1}
}
/* Beads-on-a-thread strip at the bottom of each project card — one bead per
   post planned this month (see postsForMonth in backend/src/index.js). The
   faint line underneath is the "thread" the beads sit on. Colors reuse the
   client cabinet's calendar dots (app.css .cal-dot.*), so a bead means
   exactly what the matching client-side post does: blue=опубликовано,
   green=согласовано, gold=ждёт решения, red=есть правки. */
.proj-posts{position:relative;display:flex;align-items:center;flex-wrap:wrap;row-gap:8px;gap:7px;padding:2px 2px 1px}
.proj-posts::before{content:"";position:absolute;left:5px;right:5px;top:50%;height:2px;border-radius:2px;background:linear-gradient(90deg,rgba(0,70,67,.05),rgba(0,70,67,.15) 8%,rgba(0,70,67,.15) 92%,rgba(0,70,67,.05));transform:translateY(-50%)}
.proj-bead-wrap{position:relative;display:inline-flex;cursor:pointer;text-decoration:none}
.proj-bead{width:9px;height:9px;border-radius:50%;background:#C9CFCD;border:2px solid #fff;box-shadow:0 1px 2px rgba(0,0,0,.22);z-index:1;transition:transform .12s ease}
.proj-bead-wrap:hover .proj-bead{transform:scale(1.4)}
.proj-bead.published{background:#3FA9F5}
.proj-bead.approved{background:#79C94A}
.proj-bead.waiting{background:#F5C518}
.proj-bead.changes{background:#E64545}
/* Post still in an internal production stage (not one of the client cabinet's
   statuses): graphite outline + light-gray fill — visible to the staff here,
   but the client cabinet doesn't show it (see buildTasks in taskMapper.js). */
.proj-bead.internal{background:#EDEFEF;border-color:#4B5654}
/* Tooltip for a bead: dark pill below the row (same pattern as .proj-kpi-dot
   above), but long post titles are allowed to wrap instead of overflowing. */
.proj-bead-wrap[data-tip]::after{
  content:attr(data-tip);
  position:absolute;
  top:calc(100% + 8px);
  left:50%;
  transform:translateX(-50%);
  background:#17201f;
  color:#fff;
  font-size:11px;
  font-weight:650;
  line-height:1.35;
  white-space:nowrap;
  padding:6px 9px;
  border-radius:8px;
  opacity:0;
  pointer-events:none;
  transition:opacity .15s;
  z-index:10;
}
.proj-bead-wrap[data-tip]:hover::after,
.proj-bead-wrap[data-tip]:focus-visible::after{opacity:1}
@media (hover:none){
  .proj-bead-wrap[data-tip]::after{white-space:normal;max-width:200px}
  .proj-bead-wrap[data-tip]:active::after{opacity:1}
}
.proj-logo img{width:100%;height:100%;object-fit:contain}
.proj-logo-fallback{font-weight:800;font-size:18px;color:#fff}
.proj-info{flex:1;min-width:0;display:grid;gap:9px;align-content:center}
.proj-name{font-weight:800;font-size:15px}
.proj-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.proj-row-label{font-size:11px;font-weight:800;color:var(--muted);text-transform:uppercase;letter-spacing:.03em;white-space:nowrap;min-width:74px}
.proj-link{flex:1;min-width:120px;border:1px solid var(--line);border-radius:10px;padding:9px 10px;font-size:12px;color:var(--muted);background:#FAFBFB;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
.proj-link-row{flex-direction:column;align-items:stretch;gap:6px}

/* Mini social-network chips on the project card — one small dot per network
   that has credentials saved (o.configuredNetworks, see projectSettings.js's
   getTokenAndLogo), so staff can see at a glance where a project can
   actually publish. Colors match the edit popup's .net-dot legend. */
/* Facepile «кто имеет доступ к проекту» — кружки с инициалами участников
   (project_access), СЕО/глобальный admin и FACEPILE_EXCLUDE_EMAILS в список
   не попадают (см. GET /api/projects в index.js). Роль admin (доступ к
   настройкам — НЕ то же самое, что менеджер, см. .proj-manager-badge ниже)
   идёт первой и выделена кольцом акцентного цвета — остальные участники
   внахлёст следом, по прямому запросу пользователя (2026-09-25; уточнение
   терминологии 2026-09-25: изначально этот кружок ошибочно подписывался как
   "Ответственный" — это отдельная функциональная роль, см. ниже). Тот же
   приём data-tip::after, что у .proj-net-chip выше, для всплывающей
   подсказки "Имя — роль" при наведении. */
.proj-members{display:flex;align-items:center;margin-top:1px}
.proj-avatar{position:relative;width:24px;height:24px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:800;color:#fff;border:2px solid var(--card,#fff);margin-left:-7px;cursor:default;box-shadow:0 1px 2px rgba(0,0,0,.15)}
.proj-avatar:first-child{margin-left:0}
.proj-avatar.admin{box-shadow:0 0 0 2px var(--accent),0 1px 2px rgba(0,0,0,.15)}
.proj-avatar.more{background:var(--line);color:var(--muted);font-size:9.5px}
.proj-avatar[data-tip]::after{
  content:attr(data-tip);
  position:absolute;
  top:calc(100% + 8px);
  left:50%;
  transform:translateX(-50%);
  background:#17201f;
  color:#fff;
  font-size:11px;
  font-weight:650;
  line-height:1.35;
  white-space:nowrap;
  padding:6px 9px;
  border-radius:8px;
  opacity:0;
  pointer-events:none;
  transition:opacity .15s;
  z-index:20;
}
.proj-avatar[data-tip]:hover::after{opacity:1}
@media(max-width:430px){.proj-avatar[data-tip]::after{white-space:normal;max-width:180px}}
/* Card-level "Менеджер: Имя" — the FUNCTIONAL role (who's accountable for
   deadlines/publications/materials), decoupled from the access-control
   facepile above; project_settings.project_manager, resolved to a display
   name server-side (see o.projectManager in GET /api/projects). Restored
   2026-09-25 by direct user request ("...всем должно быть ясно кто отвечает
   за сроки проекта, публикации и материал! это функциональная роль") after
   the field was dropped from the UI on 2026-09-20 in favor of project_access
   (which answers a different question — who can edit — not this one).
   Muted when unset so an unassigned project doesn't read as broken, just
   "nobody's set this yet". */
.proj-manager-line{font-size:11.5px;font-weight:700;color:var(--muted);margin-top:2px}
.proj-manager-line b{color:var(--ink);font-weight:800}
.proj-manager-line.unset{font-style:italic}

.proj-net-row{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.proj-net-chip{position:relative;width:10px;height:10px;border-radius:3px;display:inline-block;cursor:default;box-shadow:0 0 0 1px rgba(0,0,0,.08)}
.proj-net-chip[data-tip]::after{
  content:attr(data-tip);
  position:absolute;
  top:calc(100% + 8px);
  left:50%;
  transform:translateX(-50%);
  background:#17201f;
  color:#fff;
  font-size:11px;
  font-weight:650;
  line-height:1.35;
  white-space:nowrap;
  padding:6px 9px;
  border-radius:8px;
  opacity:0;
  pointer-events:none;
  transition:opacity .15s;
  z-index:10;
}
.proj-net-chip[data-tip]:hover::after{opacity:1}

/* Subscriber counts on the project card — small rounded chips showing how
   many devices are on Web Push (🔔) and how many TG chats subscribed to
   reminders (✈️) for this project. See GET /api/projects pushSubscribers /
   tgSubscribers. Grey so they never fight the colorful net chips above. */
.proj-notify-row{display:flex;gap:6px;align-items:center;flex-wrap:wrap;margin-top:6px}
.proj-notify-bit{position:relative;display:inline-flex;align-items:center;gap:3px;font-size:11px;font-weight:650;color:var(--muted);background:rgba(0,0,0,.04);border-radius:999px;padding:2px 8px;cursor:default}
.proj-notify-bit[data-tip]::after{
  content:attr(data-tip);
  position:absolute;
  top:calc(100% + 8px);
  left:50%;
  transform:translateX(-50%);
  background:#17201f;
  color:#fff;
  font-size:11px;
  font-weight:650;
  line-height:1.35;
  white-space:nowrap;
  padding:6px 9px;
  border-radius:8px;
  opacity:0;
  pointer-events:none;
  transition:opacity .15s;
  z-index:10;
}
.proj-notify-bit[data-tip]:hover::after{opacity:1}

/* Vertical column of action icons (copy / edit / regenerate), one above the
   other in the accent color. Hover shows a hint built from data-tip — the
   action's name + what it actually does. */
.proj-actions-col{flex:0 0 auto;display:flex;flex-direction:column;justify-content:center;gap:6px}
.icon-btn{position:relative;width:18px;height:18px;padding:0;display:inline-flex;align-items:center;justify-content:center;border-radius:6px;border:1px solid rgba(255,95,96,.35);background:var(--urgent);color:#fff;cursor:pointer}
.icon-btn svg{width:12px;height:12px}
.icon-btn:active{transform:scale(.94)}
.icon-btn:disabled{opacity:.55;cursor:default}
.icon-btn.danger{background:#CE3B3B;border-color:rgba(255,255,255,.25)}
.icon-btn.busy svg{animation:icon-spin .9s linear infinite}
@keyframes icon-spin{to{transform:rotate(360deg)}}
.icon-btn::after,
.proj-ai-avatar-wrap::after{
  content:attr(data-tip);
  position:absolute;
  right:calc(100% + 10px);
  top:50%;
  transform:translateY(-50%);
  background:#17201f;
  color:#fff;
  font-size:11px;
  font-weight:650;
  line-height:1.35;
  white-space:nowrap;
  padding:6px 9px;
  border-radius:8px;
  opacity:0;
  pointer-events:none;
  transition:opacity .15s;
  z-index:10;
}
.icon-btn:hover::after,
.icon-btn:focus-visible::after,
.proj-ai-avatar-wrap:hover::after,
.proj-ai-avatar-wrap:focus-visible::after{opacity:1}
/* Touch devices have no hover — a tap both focuses and activates the button,
   so show the same hint then (and let the text wrap instead of overflowing
   the narrow screen). */
@media (hover:none){
  .icon-btn::after,
  .proj-ai-avatar-wrap::after{
    white-space:normal;
    max-width:200px;
  }
  .icon-btn:hover::after,
  .icon-btn:focus::after,
  .icon-btn:active::after,
  .proj-ai-avatar-wrap:hover::after,
  .proj-ai-avatar-wrap:focus::after{opacity:1}
}
/* KPI summary banner above the search box — reuses app.css's .attention
   component (same one the client cabinet uses), two new color modifiers:
   .off (burning — same red as an urgent post) and .minor (amber, same gold
   as the calendar's "waiting" dot). Only rendered at all when at least one
   project needs a look — see renderKpiBanner() in projects.js. */
.attention.off{background:#FFF3F2;border-color:var(--urgent)}
.attention.minor{background:#FFFAE0;border-color:#F5C518}
/* Row-level (not container-level) tier color — a banner can show both an
   "off" row and a "minor" row at once (the container's own off/minor class
   above just picks the stronger background/border), so each row's own text
   color has to come from its own tier, not the container's. */
.row-off .attention-link{color:#E0484A}
.row-minor .attention-link{color:#8A6D00}

@media(max-width:430px){
  .proj-row-label{min-width:100%}
  .proj-logo{width:44px}
  .proj-logo-fallback{font-size:15px}
  .proj-kpi-dot{width:11px;height:11px}
}

/* "Редактировать" popup — logo URL + per-network credentials. Reuses
   .modal-wrap/.sheet/.sheet-actions from app.css (same bottom-sheet pattern
   as the client cabinet's feedback popup) so it matches visually.

   РЕДИЗАЙН 2026-10-02 — прямой запрос: попап "бросало по экрану" при
   переключении вкладок, и при этом часть контента/кнопок было не видно.
   Причина первого: .modal-wrap прижимает лист к низу экрана
   (align-items:flex-end в app.css), а .edit-sheet раньше сам был
   max-height+overflow-y:auto БЕЗ фиксированной высоты — высота листа
   подстраивалась под контент активной вкладки, и при переключении с
   длинной вкладки на короткую (или наоборот) верхний край листа резко
   прыгал вверх/вниз. Причина второго: 7 вкладок на одной строке с
   flex:1 физически не помещались в ширину попапа — подписи обрезались
   (см. скриншот с "Сти" вместо "🎟 Стикеры").
   Фикс: .edit-sheet теперь ФИКСИРОВАННОЙ высоты (не max-height) — высота
   листа больше не зависит от вкладки, прыжков нет. Шапка+вкладки
   (.edit-sheet-top) и низ с ошибкой/кнопками (.edit-sheet-bottom) — sticky
   внутри него, видны всегда; скроллится только контент самой вкладки
   (.edit-sheet-body) между ними — так что при вкладке с небольшим
   количеством полей просто остаётся пустое место внизу области контента,
   а не сжимается весь попап. Вкладки теперь не flex:1 в одну строку, а
   flex-wrap — переносятся на вторую строку вместо обрезания подписи,
   поэтому ни одна вкладка больше не может оказаться "невидимой". */
.edit-sheet{height:min(82vh,720px);max-height:82vh;overflow-y:auto;padding:0;display:flex;flex-direction:column}
.edit-sheet-top{position:sticky;top:0;z-index:3;background-color:inherit;border-radius:26px 26px 0 0;padding:20px 18px 12px;flex:0 0 auto}
.edit-sheet-body{padding:2px 18px 14px;flex:1 1 auto}
.edit-sheet-bottom{position:sticky;bottom:0;z-index:3;background-color:inherit;padding:10px 18px calc(14px + env(safe-area-inset-bottom));box-shadow:0 -8px 14px -10px rgba(0,0,0,.14);flex:0 0 auto}
.edit-sheet-bottom .sheet-actions{margin-top:0}
.edit-sheet-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}

/* Small MM ID tag, tucked in the corner of the edit popup — the Mattermost
   option id behind this project's "Проект" property value (see
   backend/src/index.js's GET /api/projects). Not shown anywhere in
   Mattermost's own UI; staff need it to point automations at the right
   project when creating new cards. Click-to-copy, same toast pattern as the
   other icon actions. */
.proj-mmid{flex:0 0 auto;text-align:right;font-size:10px;color:var(--muted);cursor:pointer;user-select:none;padding-top:2px}
.proj-mmid code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;background:#F6F7F7;border-radius:4px;padding:1px 6px;color:#7B8482}
.proj-mmid:hover code{background:#EDEFEF;color:var(--ink)}
.field-label{display:block;font-size:12px;font-weight:800;color:var(--muted);margin:14px 0 6px}
.field-input{width:100%;border:1px solid var(--line);border-radius:12px;padding:11px 12px;font-size:13px;outline:none;font:inherit;color:var(--ink);background:var(--card)}
.field-input:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(0,70,67,.08)}
/* Оплата истекает меньше чем через 5 дней — сама дата в попапе подсвечена
   красным (see updatePaidThroughHint() in projects.js), не только текст
   подсказки под полем. */
.field-input-danger{border-color:var(--urgent);color:var(--urgent);background:#FFF4F4}
.field-input-danger:focus{border-color:var(--urgent);box-shadow:0 0 0 3px rgba(230,69,69,.12)}
.logo-preview{display:flex;align-items:center;gap:10px;margin-top:10px;padding:8px 10px;background:#FAFBFB;border:1px solid var(--line);border-radius:12px}
.logo-preview img{width:40px;height:40px;object-fit:contain;border-radius:9px;background:#fff;border:1px solid var(--line)}
.logo-preview span{font-size:11px;color:var(--muted)}
.cred-intro{font-size:12px;color:var(--muted);line-height:1.5;margin:16px 0 10px;padding:10px 12px;background:#FAFBFB;border-radius:12px}
/* «Менеджер проекта» — функциональная роль (кто отвечает за сроки/
   публикации/материал), НЕ то же самое, что project_access-доступ к
   настройкам (см. .proj-fields/cred-intro ниже и MEMBER_ROLE_LABEL в
   projects.js). Собственная выделенная рамка с акцентной левой полосой —
   по прямому запросу пользователя (2026-09-25) вернуть поле так, чтобы
   "всем должно быть ясно кто отвечает". */
.proj-manager-row{margin-top:14px;padding:10px 12px;background:#FAFBFB;border:1px solid var(--line);border-left:3px solid var(--accent);border-radius:12px}
.proj-manager-row .field-label{margin:0 0 6px}
.proj-manager-row .field-label i{color:var(--muted);font-style:normal;font-weight:600}
.proj-fields{display:grid;gap:2px}
.proj-field-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.field-textarea{width:100%;border:1px solid var(--line);border-radius:12px;padding:10px 12px;font-size:13px;line-height:1.5;resize:vertical;outline:none;font:inherit;color:var(--ink);background:var(--card)}
.field-textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(0,70,67,.08)}
/* flex-wrap, не flex:1-в-одну-строку — 7 вкладок физически не помещаются в
   ширину попапа на одной строке без обрезания подписи (см. РЕДИЗАЙН
   2026-10-02 выше); перенос на вторую строку гарантирует, что подпись
   каждой вкладки всегда видна целиком, на любой ширине экрана. */
.edit-tabs{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:0}
.edit-tab{flex:1 1 148px;border:1px solid var(--line);background:#FAFBFB;color:var(--muted);border-radius:10px;padding:8px 12px;font-size:12px;font-weight:800;cursor:pointer;font-family:inherit}
.edit-tab.ai{display:flex;align-items:center;justify-content:center;gap:8px}
.edit-tab-ai-avatar{width:20px;height:20px;border-radius:50%;object-fit:cover;pointer-events:none;box-shadow:0 0 0 1px rgba(155,90,246,.35),0 2px 6px rgba(155,90,246,.45)}
.edit-tab.active{background:var(--accent);border-color:var(--accent);color:#fff}
.edit-tab.ai.active{background:var(--ai);border-color:var(--ai);color:#fff;box-shadow:0 0 0 1px var(--ai) inset,0 4px 14px rgba(155,90,246,.3)}
/* Вкладка «Цербер» — MD-файл от ИИ проекта (см. editTabCerberus в
   projects.html). Пустая — светло-серая (не выделена, см. .edit-tab.base
   выше только с мягким серым текстом); заполнена (refreshCerberusTab в
   projects.js) — яркая янтарная рамка/фон, чтобы прямо в попапе было видно,
   что инструкция для проекта загружена. */
.edit-tab.cerberus{color:#A6ACB4;background:#F4F5F6;border-color:#E4E7EA}
.edit-tab.cerberus.filled{color:#7A4D00;background:#FFF1D6;border-color:#F3C76A;font-weight:900}
.edit-tab.cerberus.active,.edit-tab.cerberus.filled.active{background:var(--accent);border-color:var(--accent);color:#fff;box-shadow:0 0 0 1px var(--accent) inset,0 4px 14px rgba(0,70,67,.2)}
.cerb-title{font-size:12px;font-weight:800;color:var(--ink)}
.cerb-sub{font-size:12px;line-height:1.5;color:var(--muted);margin:2px 0 10px}
.cerb-upload-row{display:flex;align-items:center;gap:10px;margin-bottom:2px}
.cerb-file-hint{font-size:12px;color:var(--muted)}
.cerb-textarea{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12.5px;line-height:1.55}
/* Вкладка «Секретики» — критичные креды/заметки проекта (см. editTabSecrets
   в projects.html). Тот же приём "пустая — серая / заполнена — яркая", что
   у «Цербер» выше, но на --urgent (тот же красно-коралловый, что уже
   используется в приложении для "🔥 горит") — сознательно тревожный цвет,
   а не нейтральный, чтобы визуально отличать "здесь пароли" от обычных
   заполненных вкладок. */
.edit-tab.secrets{color:#A6ACB4;background:#F4F5F6;border-color:#E4E7EA}
.edit-tab.secrets.filled{color:#A32E2F;background:#FDE7E7;border-color:var(--urgent);font-weight:900}
.edit-tab.secrets.active,.edit-tab.secrets.filled.active{background:var(--urgent);border-color:var(--urgent);color:#fff;box-shadow:0 0 0 1px var(--urgent) inset,0 4px 14px rgba(255,95,96,.3)}
.secrets-title{font-size:12px;font-weight:800;color:var(--ink)}
.secrets-sub{font-size:12px;line-height:1.5;color:var(--muted);margin:2px 0 10px}
.secrets-textarea{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12.5px;line-height:1.55}
/* «Только просмотр» — баннер над вкладками попапа, когда открывшему её
   участнику команды доступны «Секретики», но не остальные вкладки (editor
   проекта, не admin — см. editingCanManageProject/applyProjectPermissionUi
   в projects.js). Добавлено 2026-09-25 вместе с открытием /admin editor'ам. */
.readonly-notice{font-size:12px;font-weight:700;color:#8A6D00;background:#FFF6E0;border:1px solid #F0DFA0;border-radius:10px;padding:8px 12px;margin:0 0 10px}
.edit-panel input:disabled,.edit-panel textarea:disabled,.edit-panel select:disabled{opacity:.55;cursor:not-allowed}
/* «История правок» «Секретиков» — видна только тем, кому доступен и сам PUT
   .../settings (canManageProject: admin/ceo или admin именно этого проекта,
   см. GET .../secrets/log в index.js) — по прямому запросу пользователя
   (2026-09-25): «веди лог правок, показывающийся только сео», затем «и
   админу проекта тоже». Каждая запись — было/стало рядом, чтобы сразу
   видно было, что именно поменялось, а не только "кто-то что-то поменял". */
.secrets-log-btn{margin-top:10px;font-size:12px;font-weight:700;color:var(--accent);background:none;border:1px solid var(--line);border-radius:10px;padding:7px 12px;cursor:pointer}
.secrets-log-btn:hover{background:var(--card)}
.secrets-log-panel{margin-top:10px;border-top:1px solid var(--line);padding-top:10px;display:grid;gap:10px;max-height:360px;overflow-y:auto}
.secrets-log-empty{font-size:12px;color:var(--muted)}
.secrets-log-loading{font-size:12px;color:var(--muted)}
.secrets-log-entry{border:1px solid var(--line);border-radius:10px;padding:8px 10px;background:var(--card)}
.secrets-log-meta{display:flex;justify-content:space-between;gap:8px;font-size:11.5px;font-weight:700;color:var(--muted);margin-bottom:6px}
.secrets-log-actor{color:var(--ink)}
.secrets-log-diff{display:grid;grid-template-columns:1fr 1fr;gap:8px}
@media(max-width:430px){.secrets-log-diff{grid-template-columns:1fr}}
.secrets-log-diff-label{font-size:10.5px;font-weight:800;text-transform:uppercase;letter-spacing:.02em;color:var(--muted);margin-bottom:3px}
.secrets-log-old pre,.secrets-log-new pre{margin:0;white-space:pre-wrap;word-break:break-word;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11.5px;line-height:1.5;background:var(--bg);border-radius:8px;padding:6px 8px;max-height:160px;overflow-y:auto}
.secrets-log-old pre{color:#A32E2F}
.secrets-log-new pre{color:#216A39}

/* «Команда» вкладка — менеджер проекта (или CEO/admin) собирает команду
   прямо из карточки: добавляет участника с обязательной заметкой "за что
   отвечает" (project_access.role='editor' + note), убирает — сразу
   закрывает доступ. Добавлено 2026-09-25 по прямому запросу пользователя.
   Стиль сознательно спокойный/нейтральный (не тревожный, как у .secrets-* —
   это не про креды), перекликается с .secrets-title/.secrets-sub. */
.team-title{font-size:12px;font-weight:800;color:var(--ink)}
.team-sub{font-size:12px;line-height:1.5;color:var(--muted);margin:2px 0 10px}
.team-readonly-notice{font-size:12px;font-weight:700;color:#8A6D00;background:#FFF6E0;border:1px solid #F0DFA0;border-radius:10px;padding:8px 12px;margin:0 0 10px}
.team-add-row{display:grid;grid-template-columns:1fr 1.3fr auto;gap:8px;margin-bottom:12px}
@media(max-width:560px){.team-add-row{grid-template-columns:1fr}}
.team-add-btn{border:none;background:var(--accent);color:#fff;border-radius:12px;padding:0 16px;font-size:13px;font-weight:800;cursor:pointer;white-space:nowrap}
.team-add-btn:hover{opacity:.92}
.team-add-btn:disabled{opacity:.55;cursor:not-allowed}
.team-list{display:grid;gap:6px}
.team-row{display:flex;align-items:center;gap:10px;border:1px solid var(--line);border-radius:12px;padding:8px 10px;background:#FAFBFB}
.team-avatar{flex:none;width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:800;color:#fff}
.team-meta{flex:1;min-width:0;display:grid;gap:2px}
.team-name{font-size:13px;font-weight:700;color:var(--ink)}
.team-role{color:var(--muted);font-style:normal;font-weight:600;font-size:11.5px}
.team-note{font-size:12px;color:var(--muted);line-height:1.4;overflow-wrap:break-word}
.team-note.muted{font-style:italic;opacity:.7}
.team-remove-btn{flex:none;width:26px;height:26px;border-radius:50%;border:1px solid var(--line);background:#fff;color:var(--muted);font-size:16px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center}
.team-remove-btn:hover{background:#FDE7E7;border-color:var(--urgent);color:var(--urgent)}
.team-remove-btn:disabled{opacity:.5;cursor:not-allowed}
.team-empty{font-size:12px;color:var(--muted);padding:6px 2px}

.edit-panel{display:grid;gap:2px}
.edit-panel.ai{border:1px solid var(--ai);box-shadow:0 0 0 1px var(--ai) inset;border-radius:14px;padding:12px;background:linear-gradient(180deg,#FBF9FF,#fff 120px)}
.edit-panel.ai .field-label{margin-top:10px}
.edit-panel.ai .field-label:first-of-type{margin-top:0}
.ai-prompts-title{font-size:12px;font-weight:800;color:#5B3FA0;margin-bottom:2px}
@media(max-width:430px){.proj-field-row{grid-template-columns:1fr}}
/* "Оплачено до" status line under the date field — жёсткая блокировка
   автопостинга after this date happens server-side regardless (see
   isPaidThroughExpired in backend/src/index.js); this is the "предупреждение
   в интерфейсе" half, so staff sees it coming. Same green/amber/red palette
   as .proj-kpi-dot's tiers. */
.paid-through-hint{font-size:11px;font-weight:700;margin-top:5px}
.paid-through-hint.good{color:#216A39}
.paid-through-hint.warn{color:#8A6D00}
.paid-through-hint.bad{color:var(--urgent)}
.cred-networks{display:grid;gap:10px}
.cred-net label{display:flex;align-items:center;gap:7px;font-size:12px;font-weight:800;color:var(--ink);margin-bottom:5px}
.net-dot{width:9px;height:9px;border-radius:3px;display:inline-block}
.cred-net textarea{width:100%;border:1px solid var(--line);border-radius:12px;padding:9px 10px;font-size:12px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;resize:vertical;outline:none;color:var(--ink);background:var(--card)}
.cred-net textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(0,70,67,.08)}
#editError{margin-top:14px}

/* Telegram "куда публикует бот" picker — layered on the tg cred-net block
   above (see projects.js loadTgPickerData/applyTgTextareaToPicker). */
.tg-picker{display:grid;gap:2px;margin-bottom:6px}
.tg-picker-field .field-label{margin:0 0 4px;font-size:11px}
.tg-bot-hint{font-size:11px;color:var(--muted);display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin:-2px 0 8px}
.tg-bot-hint code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;background:var(--bg);border-radius:5px;padding:2px 6px;color:var(--ink)}
.tg-bot-hint button{border:1px solid var(--line);background:var(--card);color:var(--ink);border-radius:7px;padding:2px 8px;font-size:11px;font-weight:700;cursor:pointer;font-family:inherit}
.tg-bot-hint button:hover{background:var(--bg)}
.tg-chat-hint{font-size:11px;color:var(--muted);margin-top:4px}
.tg-manual-toggle{display:block;border:none;background:none;color:var(--muted);font-size:11px;text-decoration:underline;cursor:pointer;padding:4px 0 2px;font-family:inherit}
.tg-manual-toggle:hover{color:var(--ink)}

/* Instagram "accessToken/igUserId + Проверить" picker — layered on the ig
   cred-net block above, same spot the Telegram picker occupies for tg (see
   projects.js's applyIgTextareaToPicker/syncIgTextareaFromPicker). No
   dropdown here (unlike Telegram) — Instagram has no "list every account
   this token can see" API, so this is just two fields + a live validate
   call. */
.ig-picker{display:grid;gap:2px;margin-bottom:6px}
.ig-picker-field .field-label{margin:0 0 4px;font-size:11px}
/* Header row for the IG block — label on the left, small "Проверить"
   icon-button on the right (moved out of the picker fields entirely so it
   stays reachable in BOTH modes — guided fields and "Ввести вручную (JSON)"
   — see igValidateBtn's click handler in projects.js, which reads
   credentials from whichever mode is currently active). Added 2026-09-03
   at Дмитрий's request ("маленькую кнопку с пиктограммой... справа от
   области ввода настроек"). */
.cred-net-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:5px}
.cred-net-head label{margin-bottom:0}
.cred-net-head-actions{display:flex;align-items:center;gap:6px;flex:0 0 auto}
.ig-validate-icon-btn{flex:0 0 auto;width:22px;height:22px;padding:0;display:inline-flex;align-items:center;justify-content:center;border-radius:7px;border:1px solid var(--line);background:var(--card);color:var(--ink);cursor:pointer}
.ig-validate-icon-btn:hover{background:var(--bg);border-color:var(--accent);color:var(--accent)}
.ig-validate-icon-btn:disabled{opacity:.55;pointer-events:none}
/* Кнопка «Инструкция» — открывает credInstructionModal с готовым текстом
   для клиента (см. CRED_INSTRUCTIONS/openCredInstruction в projects.js,
   запрос пользователя 2026-09-30). Всегда активна, даже когда остальная
   вкладка «Интеграции» disabled по правам (см. applyProjectPermissionUi) —
   это просмотр готового текста, не изменение настроек. */
.cred-instruction-btn{flex:0 0 auto;border:1px solid var(--line);background:var(--card);color:var(--ink);border-radius:999px;padding:3px 10px;font-size:11px;font-weight:700;cursor:pointer;font-family:inherit;white-space:nowrap}
.cred-instruction-btn:hover{background:var(--bg);border-color:var(--accent);color:var(--accent)}

/* credInstructionModal — тот же .modal-wrap/.sheet, что и остальные попапы
   (app.css), плюс нумерованные шаги и строка «пришлите нам» под ними. */
.cred-instruction-sheet{width:min(560px,100%)}
.cred-instruction-body{max-height:50vh;overflow-y:auto;margin:4px 0 2px}
.cred-instruction-steps{margin:0;padding-left:20px;display:flex;flex-direction:column;gap:8px;font-size:13.5px;line-height:1.5;color:var(--ink)}
.cred-instruction-notes-label{margin:14px 0 4px;font-size:13px;color:var(--ink)}
.cred-instruction-notes{margin:0;padding-left:18px;display:flex;flex-direction:column;gap:6px;font-size:13px;line-height:1.45;color:var(--muted)}
.cred-instruction-ask{margin:14px 0 0;padding:10px 12px;background:var(--bg);border-radius:12px;font-size:13px;color:var(--ink)}
/* Result line — auto-cleared ~30s after each check (see projects.js) so a
   stale ✅/❌ doesn't linger once staff has moved on. */
.ig-validate-hint{font-size:11.5px;color:var(--muted);margin-bottom:4px}
.ig-validate-hint:empty{display:none}
.ig-validate-hint.good{color:#216A39;font-weight:700}
.ig-validate-hint.bad{color:var(--urgent);font-weight:700}
.ig-meta-hint{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:11px;color:var(--muted);margin-top:4px}
.ig-meta-hint.bad{color:var(--urgent)}
/* "Освежить" — exchanges the currently-saved IG token for a fresh one via
   Facebook's fb_exchange_token grant (POST /api/projects/:id/
   refresh-instagram-token, needs META_APP_ID/META_APP_SECRET set in
   «Управление»). Deliberately tiny, next to the expiry text it refreshes. */
#igRefreshBtn.ig-refresh-btn{flex:0 0 auto;border:1px solid var(--line);background:var(--card);color:var(--ink);border-radius:7px;padding:2px 8px;font-size:10.5px;font-weight:800;cursor:pointer;font-family:inherit}
#igRefreshBtn.ig-refresh-btn:hover{background:var(--bg)}
#igRefreshBtn.ig-refresh-btn:disabled{opacity:.55;pointer-events:none}
.ig-refresh-hint{font-size:11.5px;color:var(--muted);margin-top:4px}
.ig-refresh-hint:empty{display:none}
.ig-refresh-hint.good{color:#216A39;font-weight:700}
.ig-refresh-hint.bad{color:var(--urgent);font-weight:700}

/* Референсы картинок для ИИ-генерации (до 10 шт., "ИИ настройки" →
   editTabAi) — миниатюры с крестиком-удалить + строка добавления (ссылка
   ИЛИ загрузка файла — оба ведут в один и тот же массив imageReferences,
   см. projects.js). */
.ref-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(72px,1fr));gap:8px;margin-top:8px}
.ref-thumb{position:relative;aspect-ratio:1;border-radius:10px;overflow:hidden;background:#F2F4F4;border:1px solid var(--line)}
.ref-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.ref-thumb-remove{position:absolute;top:3px;right:3px;width:20px;height:20px;border:0;border-radius:999px;background:rgba(15,25,24,.72);color:#fff;font-size:12px;line-height:1;display:grid;place-items:center;cursor:pointer}
.ref-add-row{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}
.ref-url-input{flex:1;min-width:160px;margin:0}
.ref-add-btn{flex:0 0 auto;min-height:42px;border:1px solid var(--line);background:#fff;color:var(--ink);border-radius:12px;padding:0 14px;font-size:12.5px;font-weight:800;cursor:pointer}
.ref-add-btn:hover{background:#FAFBFB}
.ref-upload-btn{flex:0 0 auto;min-height:42px;display:inline-flex;align-items:center;border:1px solid var(--line);background:#fff;color:var(--ink);border-radius:12px;padding:0 14px;font-size:12.5px;font-weight:800;cursor:pointer}
.ref-upload-btn:hover{background:#FAFBFB}
.ref-upload-btn.uploading{opacity:.55;pointer-events:none}
.ref-error{margin-top:10px}

/* Стикеры (кастомные эмодзи клиента, вкладка «Стикеры» в попапе
   «Редактировать») — грид миниатюр по образцу .ref-gallery выше, плюс
   строка синхронизации по имени пака. */
.sticker-sub{font-size:12px;line-height:1.5;color:var(--muted);margin:2px 0 10px}
.sticker-title{font-weight:800;font-size:14px;margin-bottom:4px}
.sticker-packs-list{display:flex;flex-direction:column;gap:10px;margin-bottom:14px}
.sticker-pack-card{border:1px solid var(--line);border-radius:12px;padding:10px 12px;background:#F8F9F9}
.sticker-pack-header{display:flex;align-items:center;justify-content:space-between;gap:8px}
.sticker-pack-name{font-weight:700;font-size:13px}
.sticker-pack-remove-btn{border:1px solid var(--line);background:#fff;color:var(--muted);border-radius:8px;width:24px;height:24px;line-height:1;cursor:pointer;flex:0 0 auto}
.sticker-pack-remove-btn:hover{background:#FBE9E9;color:#C0392B;border-color:#E6B5B5}
.sticker-sync-row{display:flex;gap:8px;flex-wrap:wrap}
.sticker-sync-row .field-input{flex:1;min-width:160px;margin:0}
.sticker-synced-hint{font-size:11.5px;color:var(--muted);margin-top:8px}
.sticker-empty{font-size:12.5px;color:var(--muted);margin-top:12px}
.sticker-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(64px,1fr));gap:8px;margin-top:12px}
.sticker-tile{position:relative;aspect-ratio:1;border-radius:10px;overflow:hidden;background:#F2F4F4;border:1px solid var(--line);display:grid;place-items:center}
.sticker-tile img{width:70%;height:70%;object-fit:contain;display:block}
.sticker-tile-emoji{position:absolute;bottom:2px;right:3px;font-size:11px;line-height:1}

/* Вход в кабинет команды (frontend/team.html) — переиспользует
   .field-label/.field-input из стилей edit-popup выше. */
.fp-box{background:#fff;border:1px solid var(--line);border-radius:18px;padding:16px;display:grid;gap:4px}
.fp-intro{font-size:12px;color:var(--muted);line-height:1.5;margin:0 0 8px}
.fp-intro code{background:#FAFBFB;border:1px solid var(--line);border-radius:6px;padding:1px 5px;font-size:11px}
.fp-submit{width:100%;margin-top:12px}
.fp-result{margin-top:12px;font-size:13px;color:var(--ink);background:#FAFBFB;border:1px solid var(--line);border-radius:12px;padding:10px 12px;line-height:1.5}

/* Ссылки «Статистика»/«CEO-дашборд» в шапке админки — маленькие кнопки-иконки,
   .head-icon-link теперь общий для всех трёх кабинетов стиль, объявлен в
   app.css (грузится и здесь, и в кабинете команды). */
.staff-links{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}

/* Вкладка "SaaS" (2026-10-13, перенесена сюда из отдельной invites.html —
   см. её комментарий в projects.html) — третий .proj-tab, свой синий акцент
   (чтобы не путать с зелёным "активно"/фиолетовым "ИИ"), плюс всё содержимое
   самой вкладки: переключатель режима, результат создания/пересылки/сброса,
   строка фильтра и таблица аккаунтов. */
.proj-tab.saas.active{background:#2B6CB0;border-color:#2B6CB0;color:#fff}

.saas-panel{display:flex;flex-direction:column;gap:16px}
.saas-create-row{display:flex;align-items:center;gap:16px;flex-wrap:wrap}

/* Переключатель "Просто/С ИИ" — iOS-style ползунок вместо select (прямой
   запрос пользователя: "или чекбокс, или переключатель-ползунок"). Чекбокс
   остаётся настоящим input (доступность/клавиатура), просто визуально
   спрятан — ровно тот же приём, что и .archive-toggle-check чуть выше. */
.saas-toggle{display:inline-flex;align-items:center;gap:10px;cursor:pointer;user-select:none}
.saas-toggle-label{font-size:13px;font-weight:800;color:var(--muted);transition:color .15s}
.saas-toggle-label.off{color:var(--ink)}
.saas-toggle input:checked ~ .saas-toggle-label.off{color:var(--muted)}
.saas-toggle-switch{position:relative;display:inline-flex}
.saas-toggle-switch input{position:absolute;opacity:0;width:1px;height:1px}
.saas-toggle-track{display:inline-flex;align-items:center;width:44px;height:24px;border-radius:999px;background:var(--line);transition:background .15s;flex:0 0 auto}
.saas-toggle-thumb{width:18px;height:18px;margin:3px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:transform .15s}
.saas-toggle input:checked + .saas-toggle-track{background:var(--ai)}
.saas-toggle input:checked + .saas-toggle-track .saas-toggle-thumb{transform:translateX(20px)}
.saas-toggle input:focus-visible + .saas-toggle-track{box-shadow:0 0 0 2px var(--accent)}

.saas-result{background:#E1F3E5;border-radius:14px;padding:16px;font-size:14px}
.saas-result p{margin:6px 0}
.saas-result code{display:inline-block;background:#fff;border:1px solid var(--line);border-radius:8px;padding:4px 8px;font-size:13px;word-break:break-all}
.saas-result .saas-code{font-size:22px;font-weight:800;letter-spacing:.06em}
.saas-result.error{background:#FBE0E0}
.saas-share-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:6px 0}
.saas-share-row .icon-btn{background:var(--accent);border-color:var(--accent)}

.saas-filter-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.saas-segmented{display:inline-flex;border:1px solid var(--line);border-radius:12px;padding:3px;gap:2px;background:#fff}
.saas-seg{border:0;background:transparent;color:var(--muted);font-size:12.5px;font-weight:800;padding:7px 12px;border-radius:9px;cursor:pointer;font-family:inherit}
.saas-seg.active{background:var(--accent);color:#fff}

.saas-table{width:100%;border-collapse:collapse;font-size:13px}
.saas-table th,.saas-table td{text-align:left;padding:9px 7px;border-bottom:1px solid var(--line);vertical-align:middle}
.saas-table th{color:var(--muted);font-weight:800;font-size:11.5px;text-transform:uppercase;letter-spacing:.03em}
.saas-badge{font-size:11px;font-weight:800;padding:3px 8px;border-radius:999px;white-space:nowrap}
.saas-badge.pending{background:#FFF3C9;color:#755600}
.saas-badge.used{background:#E1F3E5;color:#216A39}
.saas-row-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.saas-empty{color:var(--muted);text-align:center;padding:18px 0}

@media (prefers-color-scheme: dark){
  :root{
    --bg:#12181A;
    --card:#1B2320;
    --ink:#ECEFED;
    --muted:#93A19C;
    --line:#2A3532;
    --accent:#3FA98F;
  }
  .proj-search{background:#262222}
  .archive-toggle-check{background:#262222}
  .archive-toggle-check:has(input:checked){background:#222626}
  .staff-head-pill{background:#222626}
  .proj-card{background:#262222}
  .ai-flag-check{background:#222626}
  .archive-flag-check{background:#222626}
  .proj-card.archived{background:#222626}
  .proj-card.archived .proj-link{background:#222624}
  .proj-kpi-dot{border:2px solid #403A3A}
  .proj-bead{border:2px solid #403A3A}
  .proj-bead.internal{background:#222626}
  .proj-link{background:#222626}
  .attention.off{background:#2E1B19}
  .attention.minor{background:#2E2B19}
  .row-minor .attention-link{color:#E9D177}
  .proj-mmid code{background:#222626}
  .proj-mmid:hover code{background:#222626}
  .logo-preview{background:#222626}
  .logo-preview img{background:#262222}
  .cred-intro{background:#222626}
  .proj-manager-row{background:#222626}
  .edit-tab{background:#222626}
  .edit-tab.cerberus{background:#222626;border-color:#353A3B;color:#7C8287}
  .edit-tab.cerberus.filled{background:#332A17;border-color:#8A6D2A;color:#F2C45C}
  .edit-tab.cerberus.filled.active{background:var(--accent);border-color:var(--accent);color:#fff}
  .cerberus-badge{background:#332A17;color:#F2C45C}
  .ref-thumb{background:#222525}
  .sticker-tile{background:#222525}
  .sticker-pack-card{background:#222626}
  .sticker-pack-remove-btn{background:#262222;border-color:#353A3B;color:#A9AEB2}
  .sticker-pack-remove-btn:hover{background:#3A2323;color:#E68A8A;border-color:#5A3333}
  .ref-add-btn{background:#262222}
  .ref-add-btn:hover{background:#222626}
  .ref-upload-btn{background:#262222}
  .ref-upload-btn:hover{background:#222626}
  .fp-box{background:#262222}
  .fp-intro code{background:#222626}
  .fp-result{background:#222626}
  .proj-tab{background:#262222}
  .proj-tab-count{background:rgba(255,255,255,.10)}
  .readonly-notice{background:#332A17;border-color:#5C4A1E;color:#F2C45C}
  .team-readonly-notice{background:#332A17;border-color:#5C4A1E;color:#F2C45C}
  .team-row{background:#222626}
  .team-remove-btn{background:#262222}
  .saas-result{background:#213626}
  .saas-result code{background:#12181A}
  .saas-segmented{background:#1B2320}
  .saas-toggle-track{background:#2A3532}
}
