/* Anima — общий тёмный иммерсивный стиль для всех экранов (Волны 1–4).
   Дополняет tokens.css. Используется через layout_anima.html.
   Изолирован от app.css — не конфликтует со старыми экранами.

   Компоненты:
     .anima-bg      — ambient background (blooms + grid + grain)
     .anima-nav     — тёмная навигация
     .anima-shell   — контентная оболочка
     .anima-hero    — hero-заголовок страницы
     .anima-stat    — карточка статистики (3-колоночная)
     .anima-card    — glass-карточка общего назначения
     .anima-badge   — статус-бейдж
     .anima-btn     — кнопка primary (зелёная)
     .anima-btn-ghost — кнопка ghost
     .anima-pill    — теговая пилюля
     .anima-row     — строка реестра аналитик
     .anima-select  — выпадающий список в тёмном стиле
*/

/* ── Сброс в рамках .anima ─────────────────────────────── */
.anima { box-sizing: border-box; }
.anima *, .anima *::before, .anima *::after { box-sizing: inherit; margin: 0; padding: 0; }

/* ── Локальные алиасы к tokens.css ────────────────────── */
.anima {
  /* Корень «белых рамочек»: --pl-border в светлой теме = чёрный, а .dark-override
     мёртв (на body нет класса dark). Переопределяем тут — чинит все .hairline. */
  --pl-border: var(--pl-line);
  --a-bg:     var(--pl-bg-0);
  --a-bg1:    var(--pl-bg-1);
  --a-bg2:    var(--pl-bg-2);
  --a-text:   var(--pl-text-0);
  --a-muted:  var(--pl-text-1);
  --a-subtle: var(--pl-text-2);
  --a-line:   var(--pl-line);
  --a-line2:  var(--pl-line-2);
  --a-glass:  var(--pl-glass);
  --a-glass2: var(--pl-glass-2);
  --a-green:  var(--pl-accent);
  --a-glow:   var(--pl-accent-glow);
  --a-bright: var(--pl-accent-bright);
  --a-font:   var(--pl-font-ui);
  --a-display:var(--pl-font-display);
  --a-mono:   var(--pl-font-mono);
  font-family: var(--a-font);
  color: var(--a-text);
  background: var(--a-bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ── Background layer ──────────────────────────────────── */
.anima-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.anima-bloom {
  position: absolute;
  border-radius: 50%;
  filter: blur(95px);
  animation: anima-drift 26s ease-in-out infinite alternate;
  pointer-events: none;
}
.anima-bloom.b1 {
  width: 55vw; height: 55vw;
  left: -10vw; top: -18vw;
  background: radial-gradient(circle, rgba(33,160,56,.40) 0%, transparent 65%);
  opacity: .55;
}
.anima-bloom.b2 {
  width: 48vw; height: 48vw;
  right: -12vw; bottom: -12vw;
  background: radial-gradient(circle, rgba(24,150,180,.30) 0%, transparent 65%);
  opacity: .48;
  animation-delay: -9s;
}
@keyframes anima-drift {
  from { transform: translate3d(0,0,0) scale(1); }
  to   { transform: translate3d(2vw,3vh,0) scale(1.1); }
}
.anima-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--a-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--a-line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 85% 65% at 50% 20%, #000 25%, transparent 72%);
  mask-image: radial-gradient(ellipse 85% 65% at 50% 20%, #000 25%, transparent 72%);
  opacity: .40;
}
.anima-grain {
  position: absolute;
  inset: 0;
  opacity: .45;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Navigation ────────────────────────────────────────── */
.anima-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(7,9,10,.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--a-line);
}
.anima-nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--a-text);
}
.anima-nav-mark {
  width: 36px; height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--a-green), var(--a-glow));
  display: grid;
  place-items: center;
  box-shadow: 0 6px 20px -4px rgba(62,207,103,.55);
  flex-shrink: 0;
}
.anima-nav-mark svg { width: 20px; height: 20px; }
.anima-nav-wordmark {
  font-family: var(--a-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -.02em;
  background: linear-gradient(100deg, #B4BCB6 0%, #B4BCB6 20%, #d9ffe6 36%, #ffffff 48%, #d9ffe6 60%, #B4BCB6 76%, #B4BCB6 100%);
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: anima-sheen 12s ease-in-out infinite;
}
@keyframes anima-sheen {
  0%   { background-position: 130% 0; }
  42%  { background-position: -30% 0; }
  100% { background-position: -30% 0; }
}
.anima-nav-sub {
  display: block;
  font-family: var(--a-mono);
  font-size: 9.5px;
  color: var(--a-muted);
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-top: 2px;
}
.anima-nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.anima-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--a-muted);
  text-decoration: none;
  transition: background .16s, color .16s;
}
.anima-nav-link:hover {
  background: var(--a-glass2);
  color: var(--a-text);
}
.anima-nav-link.active {
  background: rgba(33,160,56,.12);
  color: var(--a-bright);
}
.anima-nav-link svg { width: 15px; height: 15px; flex-shrink: 0; }
.anima-nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
  background: var(--a-green);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 10px 28px -8px rgba(62,207,103,.60);
  transition: opacity .15s, box-shadow .15s;
}
.anima-nav-cta:hover {
  opacity: .9;
  box-shadow: 0 14px 36px -8px rgba(62,207,103,.80);
}
.anima-nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.anima-ava {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2a2f2c, #10130f);
  border: 1px solid var(--a-line2);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--a-text);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Shell (content wrapper) ───────────────────────────── */
.anima-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1280px;
  min-width: 0;
  margin: 0 auto;
  padding: 0 24px 80px;
  box-sizing: border-box;
}
@media (max-width: 640px) {
  .anima-shell { padding: 0 16px 60px; }
  .anima-nav   { padding: 12px 16px; }
}

/* ── Hero ───────────────────────────────────────────────── */
.anima-hero {
  padding: 44px 4px 32px;
  user-select: none;
}
.anima-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--a-mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--a-glow);
  margin-bottom: 12px;
}
.anima-eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--a-glow);
  box-shadow: 0 0 10px var(--a-glow);
}
.anima-h1 {
  font-family: var(--a-display);
  font-weight: 800;
  font-size: clamp(32px, 4.8vw, 52px);
  line-height: 1.05;
  letter-spacing: -.035em;
}
.anima-h1 .accent {
  background: linear-gradient(120deg, var(--a-glow), var(--a-bright));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.anima-hero-sub {
  color: var(--a-muted);
  font-size: 15px;
  line-height: 1.5;
  margin-top: 14px;
  max-width: 500px;
}
.anima-hero-actions {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Buttons ────────────────────────────────────────────── */
.anima-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--pl-radius-md);
  font-family: var(--a-font);
  font-size: 14px;
  font-weight: 700;
  background: var(--a-green);
  color: #fff;
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--pl-shadow-btn);
  transition: box-shadow .18s, opacity .15s;
  white-space: nowrap;
}
.anima-btn:hover {
  opacity: .92;
  box-shadow: var(--pl-shadow-btn-hover);
}
.anima-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.anima-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--pl-radius-md);
  font-family: var(--a-font);
  font-size: 13px;
  font-weight: 600;
  background: var(--a-glass);
  color: var(--a-text);
  border: 1px solid var(--a-line2);
  cursor: pointer;
  text-decoration: none;
  transition: background .16s, border-color .16s;
  white-space: nowrap;
}
.anima-btn-ghost:hover {
  background: var(--a-glass2);
  border-color: rgba(255,255,255,.18);
}
.anima-btn-ghost.sm {
  padding: 7px 13px;
  font-size: 12px;
  border-radius: var(--pl-radius-sm);
}

/* ── Glass card ─────────────────────────────────────────── */
.anima-card {
  background: linear-gradient(180deg, var(--a-glass2), var(--a-glass));
  border: 1px solid var(--a-line);
  border-radius: var(--pl-radius-xl);
  padding: 28px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--pl-shadow-card);
}
.anima-card-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.anima-card-title {
  font-family: var(--a-font);
  font-size: 14px;
  font-weight: 700;
  color: var(--a-text);
}
.anima-card-link {
  font-family: var(--a-mono);
  font-size: 11px;
  color: var(--a-glow);
  text-decoration: none;
  transition: color .14s;
}
.anima-card-link:hover { color: var(--a-bright); }

/* ── Stats ──────────────────────────────────────────────── */
.anima-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 24px 0;
}
@media (max-width: 480px) {
  .anima-stats { grid-template-columns: 1fr; }
}
.anima-stat {
  background: var(--a-glass);
  border: 1px solid var(--a-line);
  border-radius: var(--pl-radius-lg);
  padding: 18px 20px;
  backdrop-filter: blur(10px);
}
.anima-stat-label {
  font-family: var(--a-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--a-muted);
  margin-bottom: 8px;
}
.anima-stat-value {
  font-family: var(--a-display);
  font-weight: 800;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -.03em;
  color: var(--a-text);
  line-height: 1;
}
.anima-stat.accent .anima-stat-value { color: var(--a-bright); }
.anima-stat.accent { border-color: rgba(33,160,56,.22); }

/* ── Фильтры реестра аналитик ───────────────────────────── */
.subs-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 18px;
}
.subs-filter-mine {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-family: var(--a-mono);
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--a-muted);
  padding: 6px 12px;
  border-radius: var(--pl-radius-full);
  border: 1px solid var(--a-line2);
  background: transparent;
  transition: color .15s, border-color .15s, background .15s;
  white-space: nowrap;
}
.subs-filter-mine input { display: none; }
.subs-filter-mine:hover { color: var(--a-text); border-color: var(--a-line); }
.subs-filter-mine.active {
  color: var(--a-bright);
  border-color: rgba(62,207,103,.35);
  background: rgba(33,160,56,.1);
}
.subs-filter-select {
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--a-font);
  font-size: 12px;
  color: var(--a-muted);
  padding: 6px 28px 6px 11px;
  border-radius: var(--pl-radius-full);
  border: 1px solid var(--a-line2);
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  cursor: pointer;
  max-width: 160px;
  min-width: 80px;
  transition: color .15s, border-color .15s;
}
.subs-filter-select:hover { color: var(--a-text); border-color: var(--a-line); }
.subs-filter-select:focus { outline: none; border-color: var(--a-green); color: var(--a-text); }
.subs-filter-select.active {
  color: var(--a-text);
  border-color: var(--a-line);
  background-color: var(--a-glass2);
}
.subs-filter-reset {
  font-family: var(--a-mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--a-muted);
  padding: 6px 10px;
  text-decoration: none;
  transition: color .15s;
  white-space: nowrap;
}
.subs-filter-reset:hover { color: var(--a-text); }

/* ── Status badge ───────────────────────────────────────── */
.anima-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--a-mono);
  font-size: 10px;
  letter-spacing: .06em;
  font-weight: 600;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: var(--pl-radius-full);
  border: 1px solid;
  white-space: nowrap;
}
.subs-type-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--a-mono);
  font-size: 10px;
  letter-spacing: .06em;
  font-weight: 600;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: var(--pl-radius-full);
  border: 1px solid;
  white-space: nowrap;
}
.subs-type-badge.analysis {
  color: var(--a-muted);
  border-color: var(--a-line2);
  background: var(--a-glass2);
}
.subs-type-badge.focused {
  color: #c4b5fd;
  border-color: rgba(167,139,250,.32);
  background: rgba(139,92,246,.12);
}
.anima-badge .dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.anima-badge.ready   { color: var(--a-bright); border-color: rgba(62,207,103,.35); background: rgba(33,160,56,.10); }
.anima-badge.ready .dot { background: var(--a-bright); box-shadow: 0 0 6px var(--a-glow); }
.anima-badge.pending { color: #93b4fd; border-color: rgba(147,180,253,.25); background: rgba(96,165,250,.08); }
.anima-badge.pending .dot { background: #93b4fd; }
.anima-badge.progress { color: #fcd34d; border-color: rgba(252,211,77,.25); background: rgba(251,191,36,.08); }
.anima-badge.progress .dot { background: #fcd34d; animation: anima-pulse 1.6s ease infinite; }
.anima-badge.clarify { color: #fdba74; border-color: rgba(253,186,116,.25); background: rgba(249,115,22,.08); }
.anima-badge.clarify .dot { background: #fdba74; }
.anima-badge.draft   { color: var(--a-muted); border-color: var(--a-line); background: var(--a-glass); }
.anima-badge.draft .dot { background: var(--a-muted); }
@keyframes anima-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .4; }
}

/* ── Pill tag ───────────────────────────────────────────── */
.anima-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--pl-radius-full);
  border: 1px solid var(--a-line2);
  background: var(--a-glass);
  color: var(--a-muted);
  white-space: nowrap;
}

/* ── Focus card (текущая задача) ────────────────────────── */
.anima-focus {
  position: relative;
  background: linear-gradient(135deg, rgba(33,160,56,.08), var(--a-glass));
  border: 1px solid rgba(62,207,103,.18);
  border-radius: var(--pl-radius-xl);
  padding: 24px 28px;
  margin-bottom: 28px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 0 0 1px rgba(62,207,103,.06) inset, var(--pl-shadow-card);
}
.anima-focus-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.anima-focus-label {
  font-family: var(--a-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--a-glow);
}
.anima-focus-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--a-text);
  margin-bottom: 8px;
}
.anima-focus-reason {
  font-size: 14px;
  color: var(--a-muted);
  line-height: 1.55;
  margin-bottom: 14px;
  max-width: 680px;
}
.anima-focus-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 18px;
}
.anima-focus-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Starred row (horizontal scroll) ───────────────────── */
.anima-starred-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 900px) {
  .anima-starred-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .anima-starred-grid { grid-template-columns: 1fr; }
}
.anima-starred-card {
  background: var(--a-glass);
  border: 1px solid var(--a-line);
  border-radius: var(--pl-radius-lg);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--a-text);
  display: block;
  transition: border-color .16s, background .16s;
}
.anima-starred-card:hover {
  border-color: var(--a-line2);
  background: var(--a-glass2);
}
.anima-starred-date {
  font-family: var(--a-mono);
  font-size: 10px;
  color: var(--a-subtle);
  margin-bottom: 8px;
}
.anima-starred-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.anima-starred-sub {
  font-size: 11px;
  color: var(--a-muted);
  margin-top: 4px;
}

/* ── Section header ─────────────────────────────────────── */
.anima-section {
  margin-top: 36px;
}
.anima-section-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.anima-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--a-text);
}
.anima-section-count {
  font-family: var(--a-mono);
  font-size: 11px;
  color: var(--a-muted);
}

/* ── Registry (filters + table) ────────────────────────── */
.anima-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--a-line);
}
.anima-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--a-glass);
  border: 1px solid var(--a-line);
  border-radius: var(--pl-radius-sm);
  padding: 8px 28px 8px 11px;
  font-family: var(--a-font);
  font-size: 12.5px;
  color: var(--a-text);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238C9590' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  min-width: 120px;
  transition: border-color .15s;
}
.anima-select:focus {
  outline: none;
  border-color: rgba(255,255,255,.34);
  box-shadow: 0 0 0 3px rgba(255,255,255,.06);
}
.anima-select option { background: #0E1013; color: #ECEFEA; }

.anima-star-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--pl-radius-sm);
  font-size: 12.5px;
  cursor: pointer;
  background: var(--a-glass);
  border: 1px solid var(--a-line);
  color: var(--a-muted);
  transition: border-color .15s, background .15s;
  user-select: none;
}
.anima-star-label:has(input:checked) {
  background: rgba(252,211,77,.08);
  border-color: rgba(252,211,77,.3);
  color: #fcd34d;
}
.anima-star-label input { display: none; }

/* ── Table rows ─────────────────────────────────────────── */
.anima-registry {
  background: var(--a-glass);
  border: 1px solid var(--a-line);
  border-radius: var(--pl-radius-xl);
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.anima-row {
  display: grid;
  grid-template-columns: 36px minmax(0,1fr) auto;
  gap: 12px;
  padding: 14px 18px;
  align-items: start;
  border-top: 1px solid var(--a-line);
  transition: background .14s;
}
.anima-row:first-child { border-top: none; }
.anima-row:hover { background: var(--a-glass2); }
.anima-row-star {
  display: grid;
  place-items: center;
  padding-top: 2px;
}
.anima-row-star button {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--a-line);
  background: none;
  color: var(--a-subtle);
  font-size: 14px;
  cursor: pointer;
  transition: color .14s, border-color .14s;
  display: grid;
  place-items: center;
}
.anima-row-star button:hover,
.anima-row-star button.starred { color: #fcd34d; border-color: rgba(252,211,77,.35); }
.anima-row-info { min-width: 0; }
.anima-row-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.anima-row-id {
  font-family: var(--a-mono);
  font-size: 10px;
  color: var(--a-subtle);
}
.anima-row-date {
  font-family: var(--a-mono);
  font-size: 10px;
  color: var(--a-subtle);
}
.anima-row-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--a-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  display: block;
}
a.anima-row-link:hover .anima-row-title { color: var(--a-bright); }
.anima-row-sub {
  font-size: 12px;
  color: var(--a-muted);
  margin-top: 2px;
}
.anima-row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.anima-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 2px;
  flex-shrink: 0;
}

/* ── Submissions feed (лёгкая лента разборов, в духе хаба) ─ */
.subs-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.subs-feed-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 14px;
}
.subs-feed-count {
  font-family: var(--a-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--a-subtle);
}
.subs-card {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--pl-radius-lg);
  background: var(--a-glass);
  border: 1px solid var(--a-line);
  text-decoration: none;
  transition: border-color .16s, background .16s, transform .16s;
}
.subs-card:hover {
  border-color: var(--a-line2);
  background: var(--a-glass2);
  transform: translateY(-2px);
}
.subs-card-body {
  flex: 1;
  min-width: 0;
}
.subs-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 7px;
}
.subs-card-date {
  font-family: var(--a-mono);
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--a-subtle);
}
.subs-card-title {
  font-family: var(--a-display);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: -.02em;
  color: var(--a-text);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.subs-card:hover .subs-card-title { color: var(--a-bright); }
.subs-card-sub {
  font-size: 12.5px;
  color: var(--a-muted);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.subs-card-arrow {
  width: 18px;
  height: 18px;
  color: var(--a-subtle);
  flex-shrink: 0;
  transition: transform .16s, color .16s, opacity .16s;
}
.subs-card:hover .subs-card-arrow {
  transform: translateX(4px);
  color: var(--a-text);
}
/* Удаление — тихая ссылка, появляется при наведении на строку */
.subs-card-row {
  position: relative;
  display: flex;
  align-items: stretch;
}
.subs-card-row-repeat {
  gap: 10px;
}
.subs-repeat-action {
  flex: 0 0 auto;
  min-width: 150px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--pl-radius-md);
  border: 1px solid rgba(62,207,103,.30);
  background: rgba(62,207,103,.14);
  color: var(--a-bright);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  padding: 0 14px;
  transition: background .14s, border-color .14s, transform .14s;
}
.subs-repeat-action:hover {
  background: rgba(62,207,103,.22);
  border-color: rgba(62,207,103,.46);
  transform: translateY(-1px);
}
.subs-del {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity .16s;
}
.subs-card-row:hover .subs-del,
.subs-del:focus-within { opacity: 1; }
.subs-del button {
  width: 30px;
  height: 30px;
  border-radius: var(--pl-radius-sm);
  border: 1px solid rgba(248,113,113,.22);
  background: rgba(220,38,38,.10);
  color: #fca5a5;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .14s, border-color .14s, color .14s;
}
.subs-del button:hover {
  background: rgba(220,38,38,.18);
  border-color: rgba(248,113,113,.4);
  color: #fecaca;
}
.subs-del button svg { width: 15px; height: 15px; }
/* На наведении строки прячем декоративную стрелку — её место аккуратно занимает кнопка удаления, без скачка раскладки */
.subs-card-row:has(.subs-del):hover .subs-card-arrow { opacity: 0; }
@media (max-width: 560px) {
  .subs-card { padding: 16px; gap: 12px; }
  .subs-card-arrow { display: none; }
  .subs-card-row-repeat {
    flex-direction: column;
  }
  .subs-repeat-action {
    width: 100%;
    min-height: 44px;
  }
}

/* ── Flash message ──────────────────────────────────────── */
.anima-flash {
  border-radius: var(--pl-radius-md);
  padding: 12px 16px;
  font-size: 13.5px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid;
}
.anima-flash.ok    { background: rgba(33,160,56,.1); border-color: rgba(62,207,103,.25); color: var(--a-bright); }
.anima-flash.error { background: rgba(220,38,38,.1); border-color: rgba(248,113,113,.25); color: #fca5a5; }
.anima-flash.warn  { background: rgba(251,191,36,.08); border-color: rgba(252,211,77,.2); color: #fcd34d; }
.anima-flash.info  { background: rgba(96,165,250,.08); border-color: rgba(147,180,253,.2); color: #93b4fd; }

/* ── Empty state ────────────────────────────────────────── */
.anima-empty {
  text-align: center;
  padding: 64px 20px;
}
.anima-empty-icon {
  font-size: 36px;
  margin-bottom: 16px;
  opacity: .4;
}
.anima-empty-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}
.anima-empty-sub {
  font-size: 14px;
  color: var(--a-muted);
  margin-bottom: 20px;
}

/* ── Divider ────────────────────────────────────────────── */
.anima-divider {
  border: none;
  border-top: 1px solid var(--a-line);
  margin: 0;
}

/* ── Form inputs ────────────────────────────────────────── */
.anima-input {
  width: 100%;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--a-line2);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: var(--a-font);
  font-size: 14px;
  color: var(--a-text);
  outline: none;
  transition: border-color .15s;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}
.anima-input::placeholder {
  color: var(--a-subtle);
}
.anima-input:focus {
  border-color: rgba(255,255,255,.34);
  background: rgba(255,255,255,.06);
}
textarea.anima-input {
  resize: vertical;
  min-height: 80px;
}

/* ═══════════════════════════════════════════════════════════
   TAILWIND COMPAT — тёмный режим для страниц, ещё
   использующих Tailwind-классы внутри layout_anima
═══════════════════════════════════════════════════════════ */

/* ── Фоны карточек ───────────────────────────────────────── */
.anima .bg-white            { background: var(--pl-glass)    !important; }
.anima .bg-white\/80        { background: rgba(255,255,255,.07) !important; }
.anima .bg-ink-50,
.anima .bg-ink-50\/40,
.anima .bg-ink-50\/50,
.anima .bg-ink-50\/60,
.anima .bg-ink-50\/70       { background: rgba(255,255,255,.04) !important; }
.anima .bg-ink-100          { background: rgba(255,255,255,.06) !important; }
.anima .bg-ink-200          { background: rgba(255,255,255,.08) !important; }
.anima .bg-ink-950          { background: rgba(255,255,255,.08) !important; }
.anima .bg-ink-900          { background: rgba(255,255,255,.07) !important; }
.anima .hover\:bg-ink-800:hover { background: rgba(255,255,255,.12) !important; }
.anima .hover\:bg-ink-50:hover  { background: rgba(255,255,255,.05) !important; }
.anima .hover\:bg-white:hover   { background: rgba(255,255,255,.07) !important; }
.anima .focus\:bg-white:focus   { background: rgba(255,255,255,.08) !important; }

/* ── Тени (убираем, карточки и так читаются) ─────────────── */
.anima .shadow-card,
.anima .shadow-lift         { box-shadow: none !important; }

/* ── Цвета текста ────────────────────────────────────────── */
.anima .text-ink-900,
.anima .text-ink-800        { color: var(--pl-text-0) !important; }
.anima .text-ink-700        { color: var(--pl-text-1) !important; }
.anima .text-ink-600,
.anima .text-ink-500        { color: var(--pl-text-1) !important; }
.anima .text-ink-400,
.anima .text-ink-300        { color: var(--pl-text-2) !important; }

/* ── Админ-таблицы: длинные id и JSON не ломают раскладку ────
   Раньше сырые UUID в колонке «Цель» переносились по буквам, а JSON в
   «Деталях» вылезал за правый край. Эти хелперы обрезают по ellipsis с
   тултипом (title), сохраняя ширину колонок. */
.admin-id {
  display: inline-block;
  max-width: 22ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.admin-json {
  display: inline-block;
  max-width: 30rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.admin-table td, .admin-table th { vertical-align: top; }
/* Разделители колонок — чтобы плотные таблицы (Пользователи) не «слипались»:
   соседние колонки визуально отделены тонкой линией. */
.admin-table.cols-sep td + td,
.admin-table.cols-sep th + th { border-left: 1px solid rgba(255,255,255,.12); }
.admin-table.cols-sep thead th { border-bottom: 1px solid rgba(255,255,255,.14); }
/* плотной шапке — чуть больше воздуха по бокам, чтобы заголовки не сливались */
.admin-table.cols-sep th, .admin-table.cols-sep td { padding-left: 14px; padding-right: 14px; }

/* ── Границы ─────────────────────────────────────────────── */
.anima .hairline,
.anima .border-ink-100,
.anima .border-ink-200,
.anima .border-ink-300,
.anima .divide-ink-100 > * + * { border-color: var(--pl-line-2) !important; }

/* ── Инпуты / textarea / select ──────────────────────────── */
.anima input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):not([type=range]):not(.sr-only):not(.anima-input),
.anima textarea:not(.anima-input),
.anima select:not(.anima-input) {
  background: rgba(255,255,255,.05) !important;
  border-color: var(--pl-line-2) !important;
  color: var(--pl-text-0) !important;
}
.anima input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):not([type=range]):not(.sr-only):focus,
.anima textarea:not(.anima-input):focus,
.anima select:not(.anima-input):focus {
  border-color: rgba(255,255,255,.34) !important;
  background: rgba(255,255,255,.08) !important;
  outline: none !important;
}
.anima input::placeholder,
.anima textarea::placeholder { color: var(--pl-text-2) !important; }
.anima select option          { background: #1A1D21; color: var(--pl-text-0); }

/* ── Акценты: Sber/зелёный ───────────────────────────────── */
.anima .bg-sber-50,
.anima .bg-sber-50\/40,
.anima .bg-sber-50\/60      { background: rgba(33,160,56,.07) !important; }
.anima .bg-sber-100         { background: rgba(33,160,56,.12) !important; }
.anima .bg-sber-500         { background: var(--pl-accent)    !important; color:#fff !important; }
.anima .hover\:bg-sber-600:hover { background: #1a8a30         !important; }
.anima .border-sber-200     { border-color: rgba(62,207,103,.2)  !important; }
.anima .border-sber-300     { border-color: rgba(62,207,103,.3)  !important; }
.anima .border-sber-500     { border-color: var(--pl-accent)     !important; }
.anima .text-sber-600,
.anima .text-sber-700       { color: var(--pl-accent-bright) !important; }
.anima .text-sber-800       { color: var(--pl-accent-bright) !important; }
.anima .text-sber-900,
.anima .text-sber-950       { color: var(--pl-text-0)        !important; }
.anima .hover\:border-sber-300:hover { border-color: rgba(62,207,103,.3) !important; }
.anima .hover\:bg-sber-50\/40:hover  { background: rgba(33,160,56,.07)  !important; }

/* ── Акценты: purple ─────────────────────────────────────── */
.anima .bg-purple-50        { background: rgba(139,92,246,.06) !important; }
.anima .bg-purple-100       { background: rgba(139,92,246,.12) !important; }
.anima .bg-purple-600       { background: #7c3aed !important; color:#fff !important; }
.anima .hover\:bg-purple-700:hover { background: #6d28d9      !important; }
.anima .border-purple-300   { border-color: rgba(139,92,246,.25) !important; }
.anima .text-purple-700     { color: #c4b5fd !important; }

/* ── Акценты: amber ──────────────────────────────────────── */
.anima .bg-amber-50         { background: rgba(217,119,6,.07) !important; }
.anima .bg-amber-100        { background: rgba(217,119,6,.12) !important; }
.anima .border-amber-200    { border-color: rgba(217,119,6,.25) !important; }
.anima .text-amber-700      { color: #fbbf24 !important; }
.anima .text-amber-800      { color: #fcd34d !important; }
.anima .text-amber-900      { color: #fde68a !important; }
.anima .bg-amber-500        { background: #d97706 !important; color:#fff !important; }

/* ── Акценты: emerald ────────────────────────────────────── */
.anima .bg-emerald-50       { background: rgba(16,185,129,.06) !important; }
.anima .bg-emerald-100      { background: rgba(16,185,129,.1)  !important; }
.anima .border-emerald-200  { border-color: rgba(16,185,129,.2) !important; }
.anima .text-emerald-700    { color: #34d399 !important; }
.anima .text-emerald-900    { color: #6ee7b7 !important; }

/* ── Акценты: blue ───────────────────────────────────────── */
.anima .bg-blue-50,
.anima .bg-blue-50\/50      { background: rgba(59,130,246,.05) !important; }
.anima .bg-blue-100         { background: rgba(59,130,246,.10) !important; }
.anima .border-blue-200     { border-color: rgba(59,130,246,.2) !important; }
.anima .text-blue-700       { color: #93c5fd !important; }
.anima .hover\:bg-blue-50:hover { background: rgba(59,130,246,.07) !important; }

/* ── Акценты: red/rose ───────────────────────────────────── */
.anima .text-red-600        { color: #f87171 !important; }
.anima .text-rose-700       { color: #fca5a5 !important; }
.anima .border-red-200      { border-color: rgba(220,38,38,.25) !important; }

/* ── Кнопки на тёмном фоне ───────────────────────────────── */
.anima .bg-ink-950.text-white,
.anima a.bg-ink-950,
.anima button.bg-ink-950 {
  background: rgba(255,255,255,.1) !important;
  color: var(--pl-text-0) !important;
  border-color: var(--pl-line-2) !important;
}
.anima .hover\:bg-ink-800:hover { background: rgba(255,255,255,.14) !important; }

/* ── Checked state для кастомных label-чекбоксов ────────── */
.anima [data-check-feedback="true"] {
  transition: background-color .08s ease, border-color .08s ease, box-shadow .08s ease, color .08s ease;
}
.anima [data-check-feedback="true"][data-checked="true"] {
  background: rgba(33,160,56,.09) !important;
  border-color: rgba(62,207,103,.3) !important;
  box-shadow: inset 3px 0 0 rgba(62,207,103,.55) !important;
}
.anima [data-check-feedback="true"][data-disabled="true"] {
  cursor: not-allowed !important;
  opacity: .62;
}

/* ── code/pre ────────────────────────────────────────────── */
.anima pre:not(.report-body pre) {
  background: rgba(0,0,0,.35) !important;
  border-color: var(--pl-line-2) !important;
  color: var(--pl-text-0) !important;
}
.anima code:not(.report-body code) {
  background: rgba(255,255,255,.07) !important;
  color: var(--pl-text-0) !important;
}

/* ── Mobile hardening: touch, wrapping, card feedback ───────── */
.anima a,
.anima button,
.anima summary,
.anima label {
  -webkit-tap-highlight-color: rgba(62,207,103,.18);
  touch-action: manipulation;
}
.anima a:focus-visible,
.anima button:focus-visible,
.anima summary:focus-visible,
.anima label:focus-within {
  outline: 3px solid rgba(62,207,103,.28);
  outline-offset: 2px;
}
.anima-btn:active,
.anima-btn-ghost:active,
.anima-nav-link:active,
.anima-starred-card:active,
.subs-card:active,
.anima-row:active,
.source-card:active,
.jv-overview-actions a:active {
  transform: translateY(1px);
}
.anima-pipeline-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 720px) {
  .anima {
    overflow-x: hidden;
  }

  .anima-nav {
    flex-wrap: wrap;
    gap: 8px 10px;
    align-items: center;
    padding: max(10px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) 10px max(12px, env(safe-area-inset-left, 0px));
  }

  .anima-nav-brand {
    min-width: 0;
    max-width: calc(100vw - 118px);
  }

  .anima-nav-brand > span:last-child {
    min-width: 0;
  }

  .anima-nav-wordmark {
    display: block;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
  }

  .anima-nav-sub {
    display: none;
  }

  .anima-nav-links {
    order: 3;
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap !important;
    justify-content: flex-start;
    gap: 6px !important;
    padding: 2px 0 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
  }

  .anima-nav-links::-webkit-scrollbar {
    display: none;
  }

  .anima-nav-link {
    min-height: 44px;
    flex: 0 0 auto;
    padding: 10px 12px;
  }

  .anima-nav-right {
    margin-left: auto;
  }

  .anima-ava {
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 640px) {
  .anima-shell {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 0 12px 56px;
    overflow-x: clip;
    box-sizing: border-box;
  }

  .anima {
    max-width: 100%;
    overflow-x: hidden;
  }

  .anima-shell > *,
  .anima :where(.anima-card, .anima-focus, .anima-registry, .subs-card, .new-submission-form, .new-submission-main, .new-submission-side) {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .anima :where(pre, table) {
    max-width: 100%;
  }

  .anima-hero {
    padding: 28px 2px 22px;
    user-select: auto;
  }

  .anima-h1 {
    font-size: 28px;
    letter-spacing: 0;
    overflow-wrap: anywhere;
  }

  .anima-hero-sub,
  .anima-focus-reason,
  .anima-row-sub,
  .anima-empty-sub,
  .subs-card-sub {
    color: #b5c0ba;
  }

  .anima-hero-actions,
  .anima-focus-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .anima-hero-actions > *,
  .anima-focus-actions > *,
  .anima-btn,
  .anima-btn-ghost,
  .anima-select,
  .anima-star-label {
    width: 100%;
    min-height: 44px;
    justify-content: center;
    white-space: normal;
  }

  .anima-pipeline-grid,
  .new-submission-form :where(.grid[class*="grid-cols-"]),
  .new-submission-form :where([class*="grid-cols-"]) {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .new-submission-form :where(button, a, summary, select, textarea, input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not(.sr-only)),
  .new-submission-form :where(label.cursor-pointer, .source-card) {
    min-height: 44px;
  }

  .new-submission-form :where(button[type="button"].w-full) {
    align-items: flex-start;
  }

  .new-submission-form :where(.px-5) {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .new-submission-form :where(.text-ink-500, .text-ink-400, .text-ink-300) {
    color: #b5c0ba !important;
  }

  .new-submission-form :where(label, .source-card, details, summary) {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .anima-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding: 12px;
  }

  .anima-section-hd {
    align-items: flex-start;
    flex-direction: column;
  }

  .anima-row {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px;
    padding: 14px;
    cursor: pointer;
  }

  .anima-row:focus-visible,
  .anima-row:hover,
  .anima-row:active {
    background: var(--a-glass2);
  }

  .anima-row-star button {
    width: 40px;
    height: 40px;
  }

  .anima-row-title {
    white-space: normal;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .anima-row-actions {
    grid-column: 2;
    width: 100%;
    flex-wrap: wrap;
  }

  .anima-row-actions > * {
    flex: 1 1 130px;
  }

  .anima-row-actions a,
  .anima-row-actions button {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  .anima-pill,
  .anima-badge {
    white-space: normal;
  }

  .subs-card {
    min-height: 76px;
  }

  .subs-del {
    position: static;
    transform: none;
    opacity: 1;
    display: flex;
    align-items: center;
    padding-right: 12px;
  }

  .subs-del button {
    width: 44px;
    height: 44px;
  }

  .anima-flash {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .jv-overview-panel {
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .jv-overview-scroll {
    max-width: 100%;
    min-width: 0;
    overflow: visible !important;
  }

  .jv-overview-table,
  .jv-overview-table thead,
  .jv-overview-table tbody,
  .jv-overview-table tr,
  .jv-overview-table th,
  .jv-overview-table td {
    display: block;
    width: 100%;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .jv-overview-table {
    table-layout: fixed;
  }

  .jv-overview-table thead,
  .jv-overview-table th {
    display: none !important;
  }

  .jv-overview-table tbody {
    display: grid;
    gap: 12px;
    padding: 12px;
  }

  .jv-overview-table tr {
    border: 1px solid var(--pl-line-2);
    border-radius: var(--pl-radius-lg);
    background: rgba(255,255,255,.04);
    overflow: hidden;
  }

  .jv-overview-table td {
    max-width: none !important;
    padding: 12px 14px !important;
    border-top: 1px solid var(--pl-line);
  }

  .jv-overview-table td:first-child {
    border-top: none;
  }

  .jv-overview-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 6px;
    font-family: var(--pl-font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #b5c0ba;
  }

  .jv-overview-actions {
    justify-content: stretch !important;
  }

  .jv-overview-actions a {
    width: 100%;
    min-height: 44px;
    justify-content: center;
    white-space: normal;
  }
}

/* ── Встроенный чат-ассистент (правая панель, на любой странице) ─────────── */
.chatd-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 80;
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--a-bright), #1f9c38);
  color: #06210f; border: none; cursor: pointer;
  box-shadow: 0 12px 30px -8px rgba(33,160,56,.6);
  transition: transform .15s ease, box-shadow .15s ease;
}
.chatd-fab svg { width: 24px; height: 24px; }
.chatd-fab:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 16px 38px -8px rgba(33,160,56,.7); }
.chatd-overlay {
  position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.45);
  opacity: 0; pointer-events: none; transition: opacity .2s ease; backdrop-filter: blur(2px);
}
.chatd-overlay.open { opacity: 1; pointer-events: auto; }
.chatd-drawer {
  position: fixed; top: 0; right: 0; z-index: 95; height: 100vh;
  width: min(440px, 92vw); display: flex; flex-direction: column;
  background: var(--pl-bg-1, #0e1013); border-left: 1px solid var(--a-line);
  box-shadow: -24px 0 60px -20px rgba(0,0,0,.6);
  transform: translateX(102%); transition: transform .26s cubic-bezier(.22,1,.36,1);
}
.chatd-drawer.open { transform: translateX(0); }
.chatd-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--a-line); flex-shrink: 0;
}
.chatd-title { font-weight: 800; font-size: 15px; color: var(--a-text); }
.chatd-sub { font-size: 11px; color: var(--a-subtle); margin-top: 2px; }
.chatd-close {
  background: var(--a-glass); border: 1px solid var(--a-line); color: var(--a-muted);
  width: 32px; height: 32px; border-radius: 9px; cursor: pointer; font-size: 14px;
}
.chatd-close:hover { color: var(--a-text); border-color: var(--a-line2); }
.chatd-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chatd-messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.chatd-msg { display: flex; }
.chatd-msg.me { justify-content: flex-end; }
.chatd-bubble {
  max-width: 86%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.5;
  background: var(--a-glass); border: 1px solid var(--a-line); color: var(--a-text);
}
.chatd-msg.me .chatd-bubble {
  background: rgba(33,160,56,.14); border-color: rgba(62,207,103,.3); color: var(--a-text);
}
.chatd-text { white-space: pre-wrap; }
.chatd-empty { text-align: center; margin: auto; padding: 30px 16px; }
.chatd-empty-ic { font-size: 34px; margin-bottom: 10px; }
.chatd-empty-t { font-weight: 700; color: var(--a-text); margin-bottom: 6px; }
.chatd-empty-s { font-size: 12.5px; color: var(--a-muted); line-height: 1.5; max-width: 280px; margin: 0 auto; }
.chatd-note { padding: 10px 18px; font-size: 12px; color: var(--a-muted); border-bottom: 1px solid var(--a-line); }
.chatd-note-warn { color: #fcd34d; }
.chatd-composer {
  display: flex; flex-direction: column; gap: 8px; padding: 10px 14px 12px;
  border-top: 1px solid var(--a-line); flex-shrink: 0;
}
.chatd-composer-row { display: flex; align-items: flex-end; gap: 8px; }
.chatd-toolbar { display: flex; align-items: center; gap: 8px; }
.chatd-model { display: inline-flex; align-items: center; gap: 6px; background: var(--a-glass); border: 1px solid var(--a-line2); border-radius: 9px; padding: 4px 8px 4px 9px; }
.chatd-model-ic { display: inline-flex; color: var(--a-bright); }
.chatd-model-ic svg { width: 14px; height: 14px; }
.chatd-model-select { background: transparent; border: none; color: var(--a-text); font-size: 12.5px; font-family: inherit; cursor: pointer; outline: none; max-width: 220px; }
.chatd-model-select option { background: var(--a-bg1); color: var(--a-text); }
.chatd-attach {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px; cursor: pointer;
  background: rgba(255,255,255,.04); border: 1px solid var(--a-line2); color: var(--a-muted);
  display: flex; align-items: center; justify-content: center;
}
.chatd-attach:hover { color: var(--a-text); border-color: var(--a-bright); }
.chatd-attach svg { width: 18px; height: 18px; }
.chatd-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.chatd-file-label { min-height: 14px; font-size: 11px; color: var(--a-subtle); padding-left: 2px; }
.chatd-file-note { margin-top: 6px; font-size: 11px; color: var(--a-muted); }
.chatd-input {
  flex: 1; resize: none; max-height: 160px; min-height: 42px;
  background: rgba(255,255,255,.04); border: 1px solid var(--a-line2); border-radius: 12px;
  padding: 11px 13px; font-size: 14px; color: var(--a-text); font-family: inherit; line-height: 1.4;
}
.chatd-input::placeholder { color: var(--a-subtle); }
.chatd-input:focus { outline: none; border-color: var(--a-bright); }
.chatd-send {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--a-bright), #1f9c38); color: #06210f;
  display: flex; align-items: center; justify-content: center;
}
.chatd-send svg { width: 18px; height: 18px; }
.chatd-send:disabled { opacity: .5; cursor: default; }
.chatd-think { font-size: 12.5px; color: var(--a-muted); margin-right: 8px; }
.chatd-bubble-error { background: rgba(248,113,113,.1) !important; border: 1px solid rgba(248,113,113,.32) !important; }
.chatd-bubble-error .chatd-text { color: #fca5a5; }
.chatd-dots { display: inline-flex; gap: 4px; align-items: center; padding: 3px 0; }
.chatd-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--a-muted); animation: chatd-bounce 1.2s infinite ease-in-out; }
.chatd-dots i:nth-child(2) { animation-delay: .15s; }
.chatd-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes chatd-bounce { 0%,60%,100% { opacity:.3; transform: translateY(0);} 30% { opacity:1; transform: translateY(-4px);} }
.chatd-messages .message-markdown { font-size: 14px; line-height: 1.55; color: var(--a-text); }
.chatd-messages .message-markdown p { margin: 0 0 8px; }
.chatd-messages .message-markdown strong { color: var(--a-text); font-weight: 700; }
.chatd-messages .message-markdown ul, .chatd-messages .message-markdown ol { margin: 6px 0; padding-left: 18px; }

/* ============================================================
   DESIGN KIT  ·  единые компоненты для всего сайта
   Чтобы не переделывать одни и те же ошибки на каждом экране:
   модалки, читаемый текст, сетки ключ→значение, пустые стейты, прогресс.
   ============================================================ */

/* — Модалка подтверждения / диалог (заменяет native confirm) — */
.pl-modal-overlay { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(6,8,12,.66); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .18s ease; }
.pl-modal-overlay.open { display: flex; opacity: 1; }
.pl-modal { width: 100%; max-width: 420px; background: var(--a-bg1); border: 1px solid var(--a-line2); border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.5); overflow: hidden; transform: translateY(10px) scale(.985); transition: transform .2s cubic-bezier(.2,.8,.2,1); }
.pl-modal-overlay.open .pl-modal { transform: none; }
.pl-modal-body { display: flex; gap: 14px; padding: 24px 24px 18px; align-items: flex-start; }
.pl-modal-icon { flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--a-glass2); color: var(--a-bright); }
.pl-modal-icon svg { width: 22px; height: 22px; }
.pl-modal-icon.danger { color: #f87171; background: rgba(248,113,113,.12); }
.pl-modal-text { font-size: 15px; line-height: 1.55; color: var(--a-text); padding-top: 6px; }
.pl-modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 0 24px 22px; }
.anima-btn.danger { background: linear-gradient(135deg, #ef4444, #b91c1c); }
@media (max-width: 520px) {
  .pl-modal-overlay { align-items: flex-end; padding: 0; }
  .pl-modal { max-width: none; border-radius: 18px 18px 0 0; }
  .pl-modal-actions { flex-direction: column-reverse; }
  .pl-modal-actions .anima-btn, .pl-modal-actions .anima-btn-ghost { width: 100%; justify-content: center; }
}

/* — Читаемый markdown отчёта/ответа (акценты, заголовки, списки, таблицы) — */
.pl-prose { font-size: 15px; line-height: 1.68; color: var(--a-text); }
.pl-prose > :first-child { margin-top: 0; }
.pl-prose > :last-child { margin-bottom: 0; }
.pl-prose p { margin: 0 0 14px; }
.pl-prose h1, .pl-prose h2, .pl-prose h3, .pl-prose h4 { color: #fff; font-weight: 700; line-height: 1.3; margin: 26px 0 12px; letter-spacing: -.01em; }
.pl-prose h1 { font-size: 22px; }
.pl-prose h2 { font-size: 18px; padding-bottom: 8px; border-bottom: 1px solid var(--a-line); }
.pl-prose h3 { font-size: 15.5px; }
.pl-prose h4 { font-size: 14px; color: var(--a-text); }
.pl-prose strong, .pl-prose b { color: #fff; font-weight: 700; }
.pl-prose em { color: var(--a-bright); font-style: normal; }
.pl-prose a { color: var(--a-bright); text-decoration: underline; text-underline-offset: 2px; }
.pl-prose ul, .pl-prose ol { margin: 0 0 14px; padding-left: 22px; }
.pl-prose li { margin: 0 0 7px; }
.pl-prose li::marker { color: var(--a-glow); }
.pl-prose blockquote { margin: 16px 0; padding: 6px 16px; border-left: 3px solid var(--a-glow); color: var(--a-muted); background: var(--a-glass); border-radius: 0 8px 8px 0; }
.pl-prose code { background: var(--a-glass2); padding: 2px 6px; border-radius: 6px; font-size: 13px; color: var(--a-bright); }
.pl-prose pre { background: var(--a-bg2); border: 1px solid var(--a-line); border-radius: 12px; padding: 14px 16px; overflow-x: auto; margin: 0 0 16px; }
.pl-prose pre code { background: none; padding: 0; color: var(--a-text); }
.pl-prose table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 14px; }
.pl-prose th, .pl-prose td { border: 1px solid var(--a-line); padding: 8px 12px; text-align: left; vertical-align: top; }
.pl-prose th { background: var(--a-glass); color: var(--a-text); font-weight: 600; }
.pl-prose hr { border: none; border-top: 1px solid var(--a-line); margin: 22px 0; }

/* — Сетка «ключ → значение» (фокус запуска, параметры) — */
.pl-meta { display: grid; grid-template-columns: minmax(140px, 200px) 1fr; gap: 1px; background: var(--a-line); border: 1px solid var(--a-line); border-radius: 14px; overflow: hidden; }
.pl-meta dt { background: var(--a-glass2); padding: 13px 16px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--a-muted); font-weight: 600; margin: 0; overflow-wrap: anywhere; }
.pl-meta dd { background: var(--a-glass); padding: 13px 18px; margin: 0; font-size: 14px; line-height: 1.6; color: var(--a-text); overflow-wrap: anywhere; }
@media (max-width: 600px) { .pl-meta { grid-template-columns: 1fr; } .pl-meta dt { padding-bottom: 3px; } .pl-meta dd { padding-top: 5px; } }

/* — Честный пустой стейт — */
.pl-empty { border: 1px dashed var(--a-line2); border-radius: 14px; padding: 22px; text-align: center; color: var(--a-muted); font-size: 13.5px; line-height: 1.6; background: var(--a-glass); }
.pl-empty .pl-empty-t { color: var(--a-text); font-weight: 600; margin-bottom: 4px; }

/* — Подключённые пакеты данных (карточки источников на странице разбора) — */
.sp-attached-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.sp-eyebrow { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--a-subtle); margin-bottom: 4px; }
.sp-attached-count { font-size: 12px; font-family: "JetBrains Mono", monospace; color: var(--a-subtle); white-space: nowrap; flex-shrink: 0; }
.sp-attached-grid { display: grid; gap: 12px; }
@media (min-width: 768px) { .sp-attached-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sp-tile { display: block; border: 1px solid var(--a-line); border-radius: 14px; background: var(--a-glass); padding: 16px 18px; text-decoration: none; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.sp-tile:hover { background: var(--a-glass2); border-color: var(--a-line2); transform: translateY(-1px); }
.sp-tile-title { font-size: 14.5px; font-weight: 700; line-height: 1.35; color: var(--a-text); }
.sp-tile-meta { margin-top: 6px; font-size: 12px; line-height: 1.5; color: var(--a-muted); }
.sp-tile-chips { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 7px; }
.sp-chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--a-line2); background: var(--a-glass2); font-size: 11px; font-weight: 600; color: var(--a-muted); }

/* — Недоступная функция: единый приём «серый + значок недоступно» —
   Класс .pl-na вешается на любую недоступную фичу (через макрос _unavailable.html
   или вручную). Плюс авто-серый для любых disabled/aria-disabled контролов. */
.pl-na { opacity: .5; cursor: not-allowed; }
.pl-na, .pl-na * { color: var(--a-subtle) !important; }
.pl-na input, .pl-na button, .pl-na a, .pl-na select, .pl-na textarea { pointer-events: none; }
.pl-na-badge {
  display: inline-flex; align-items: center; gap: 5px;
  margin-left: 8px; padding: 2px 9px;
  border-radius: 999px; border: 1px solid var(--a-line2);
  background: var(--a-glass); color: var(--a-subtle);
  font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  white-space: nowrap;
}
.pl-na-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--a-subtle); flex-shrink: 0; }
/* авто-серый для отключённых контролов по всему приложению */
.anima label:has(> input:disabled),
.anima label:has(> select:disabled),
.anima [aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

/* — Рабочий экран процесса: панели правки входа (прогрессивное раскрытие) — */
.pl-panels-head { margin-bottom: 14px; }
.pl-panels-sub { margin-top: 4px; font-size: 13px; line-height: 1.5; color: var(--a-muted); }
.pl-panel { border: 1px solid var(--a-line); border-radius: 14px; background: var(--a-glass); overflow: hidden; }
.pl-panel + .pl-panel { margin-top: 10px; }
.pl-panel-sum { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 18px; cursor: pointer; list-style: none; }
.pl-panel-sum::-webkit-details-marker { display: none; }
.pl-panel-sum::after { content: "⌄"; color: var(--a-subtle); font-size: 16px; line-height: 1; flex-shrink: 0; transition: transform .18s ease; }
.pl-panel[open] > .pl-panel-sum::after { transform: rotate(180deg); }
.pl-panel-sum:hover { background: var(--a-glass2); }
.pl-panel-titlewrap { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pl-panel-title { font-size: 14.5px; font-weight: 700; color: var(--a-text); }
.pl-panel-hint { font-size: 12px; color: var(--a-subtle); }
.pl-panel-body { padding: 16px 18px 18px; border-top: 1px solid var(--a-line); }
.pl-panel-note { font-size: 13px; line-height: 1.55; color: var(--a-muted); margin-bottom: 12px; }
.pl-fold-card {
  padding: 0 !important;
  overflow: hidden;
}
.pl-fold-summary {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 28px;
  cursor: pointer;
  text-align: left;
}
.pl-fold-summary:hover { background: var(--a-glass2); }
.pl-fold-titlewrap { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.pl-fold-title { font-size: 17px; line-height: 1.2; font-weight: 800; color: var(--a-text); }
.pl-fold-count { flex-shrink: 0; font: 600 12px/1.2 var(--a-mono); color: var(--a-subtle); text-align: right; }
.pl-fold-chevron {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--a-line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--a-subtle);
  flex-shrink: 0;
  transition: transform .16s ease, border-color .16s ease, color .16s ease;
}
.pl-fold-card[data-fold-expanded="true"] .pl-fold-chevron {
  transform: rotate(180deg);
  border-color: var(--a-bright);
  color: var(--a-bright);
}
.pl-fold-body {
  padding: 0 28px 28px;
  border-top: 1px solid var(--a-line);
}
.pl-fold-card[data-fold-expanded="false"] .pl-fold-body { display: none; }
.pl-fold-card[data-fold-expanded="true"] .pl-fold-body { display: block; }
.pl-field { display: block; }
.pl-field-label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--a-muted); margin-bottom: 6px; }
.pl-field-hint { display: block; font-size: 11.5px; color: var(--a-subtle); margin-top: 6px; line-height: 1.4; }
.pl-checkchip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--a-line2); background: var(--a-glass); cursor: pointer; font-size: 12.5px; color: var(--a-muted); user-select: none; }
.pl-checkchip:hover { background: var(--a-glass2); }
.pl-checkchip input { accent-color: var(--a-green); width: 14px; height: 14px; flex-shrink: 0; }
.pl-checkchip:has(input:checked) { border-color: var(--a-bright); color: var(--a-text); background: var(--a-glass2); }
/* — Компактный прогресс этапов (тонкие сегменты вместо больших пилюль) — */
.pl-steps { display: flex; gap: 4px; }
.pl-step { position: relative; flex: 1; min-width: 12px; height: 5px; border-radius: 3px; background: var(--a-line2); }
.pl-step.done { background: var(--a-green); }
.pl-step.active { background: var(--a-glow); animation: pl-step-pulse 1.4s ease-in-out infinite; }
.pl-step.err { background: #f87171; }
@keyframes pl-step-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
/* увеличенная зона наведения над тонкой полосой */
.pl-step::before { content: ""; position: absolute; inset: -10px 0; }
.pl-step:hover { background: var(--a-bright); }
.pl-step.done:hover { background: var(--a-bright); }
/* Tooltip lives in an attribute, not nested text, so failed CSS cannot leak prose into layout. */
.pl-step[data-step-tip]::after {
  content: attr(data-step-tip);
  position: absolute; bottom: calc(100% + 12px); left: 50%;
  transform: translateX(-50%) translateY(5px);
  z-index: 50; width: max-content; max-width: 260px; padding: 10px 12px; border-radius: 11px;
  background: rgba(18,22,25,.98); border: 1px solid var(--a-line2);
  box-shadow: 0 14px 36px -8px rgba(0,0,0,.72);
  color: var(--a-text); font-size: 12px; font-weight: 650; line-height: 1.4;
  opacity: 0; visibility: hidden; pointer-events: none; text-align: left; white-space: normal;
  transition: opacity .14s ease, transform .14s ease;
}
.pl-step[data-step-tip]:hover::after,
.pl-step[data-step-tip]:focus::after,
.pl-step[data-step-tip]:focus-visible::after {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}
.pl-step[data-step-tip]:first-child::after { left: 0; transform: translateX(0) translateY(5px); }
.pl-step[data-step-tip]:first-child:hover::after,
.pl-step[data-step-tip]:first-child:focus::after,
.pl-step[data-step-tip]:first-child:focus-visible::after { transform: translateX(0) translateY(0); }
.pl-step[data-step-tip]:last-child::after { left: auto; right: 0; transform: translateX(0) translateY(5px); }
.pl-step[data-step-tip]:last-child:hover::after,
.pl-step[data-step-tip]:last-child:focus::after,
.pl-step[data-step-tip]:last-child:focus-visible::after { transform: translateX(0) translateY(0); }
/* ховер-подсказка по этапу: имя + что делает + статус */
.pl-step-tip {
  position: absolute; bottom: calc(100% + 12px); left: 50%;
  transform: translateX(-50%) translateY(5px);
  z-index: 50; width: 216px; padding: 10px 12px; border-radius: 11px;
  background: rgba(18,22,25,.98); border: 1px solid var(--a-line2);
  box-shadow: 0 14px 36px -8px rgba(0,0,0,.72);
  opacity: 0; visibility: hidden; pointer-events: none; text-align: left;
  transition: opacity .14s ease, transform .14s ease;
}
.pl-step:hover .pl-step-tip, .pl-step:focus-visible .pl-step-tip {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}
.pl-step:first-child .pl-step-tip { left: 0; transform: translateX(0) translateY(5px); }
.pl-step:first-child:hover .pl-step-tip { transform: translateX(0) translateY(0); }
.pl-step:last-child .pl-step-tip { left: auto; right: 0; transform: translateX(0) translateY(5px); }
.pl-step:last-child:hover .pl-step-tip { transform: translateX(0) translateY(0); }
.pl-step-tip::after {
  content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: rgba(18,22,25,.98);
}
.pl-step-tip b { display: block; font-size: 12.5px; font-weight: 700; color: var(--a-text); }
.pl-step-tip em { display: block; margin-top: 3px; font-size: 11.5px; line-height: 1.45; color: var(--a-muted); font-style: normal; }
.pl-step-tip s { display: block; margin-top: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; text-decoration: none; }

/* — Живой прогресс «идёт исследование» — */
.pl-live { display: flex; gap: 16px; align-items: flex-start; padding: 20px 22px; border: 1px solid var(--a-line2); border-radius: 16px; background: linear-gradient(180deg, var(--a-glass2), var(--a-glass)); }
.pl-live-spin { flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--a-line2); border-top-color: var(--a-bright); animation: pl-spin .9s linear infinite; }
@keyframes pl-spin { to { transform: rotate(360deg); } }
.pl-live-body { flex: 1; min-width: 0; }
.pl-live-step { font-size: 15px; font-weight: 600; color: var(--a-text); }
.pl-live-meta { margin-top: 4px; font-size: 12.5px; color: var(--a-muted); }
.pl-live-bar { margin-top: 12px; height: 4px; border-radius: 4px; background: var(--a-line); overflow: hidden; }
.pl-live-bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--a-glow), var(--a-bright)); transition: width .6s ease; }
.pl-live.error { background: rgba(248,113,113,.07); border-color: rgba(248,113,113,.35); }
.pl-live.error .pl-live-spin { display: none; }
.pl-live.error .pl-live-bar { background: rgba(248,113,113,.18); }
.pl-live.error .pl-live-bar > i { background: #f87171; }
.pl-live-ico-err { flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; display: none; place-items: center; background: rgba(248,113,113,.14); color: #f87171; }
.pl-live.error .pl-live-ico-err { display: grid; }
.pl-live.error .pl-live-step { color: #fca5a5; }

/* — Поле формы кита (читаемое, не сжатое) — */
.pl-field { display: block; margin-bottom: 16px; }
.pl-field > .pl-label { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; color: var(--a-muted); margin-bottom: 6px; }
.pl-field > .pl-hint { font-size: 12px; color: var(--a-subtle); margin-top: 6px; line-height: 1.5; }

/* — Общая защита от «текст не влезает / обрезан» на любом экране — */
.anima h1, .anima h2, .anima h3, .anima h4, .anima .anima-h1, .anima .anima-h2 { overflow-wrap: break-word; word-break: normal; }
.anima-card, .anima-section { min-width: 0; }
.anima-card { overflow-wrap: break-word; }

/* — СИСТЕМНЫЙ ВЕРТИКАЛЬНЫЙ РИТМ ПО ВСЕМУ САЙТУ ───────────────────────────
   Вертикальные стопки были слишком тесные (Tailwind space-y-* по 8–24px).
   Поднимаем равномерно — сайт начинает дышать на каждом экране.
   Трогаем только вертикаль (не gap у горизонтальных рядов — там риск). */
.anima .space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: 11px; }
.anima .space-y-3 > :not([hidden]) ~ :not([hidden]) { margin-top: 16px; }
.anima .space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 22px; }
.anima .space-y-5 > :not([hidden]) ~ :not([hidden]) { margin-top: 26px; }
.anima .space-y-6 > :not([hidden]) ~ :not([hidden]) { margin-top: 32px; }
/* Заголовки внутри карточек не липнут к контенту */
.anima .anima-card > h2:first-child, .anima .anima-card > h3:first-child { margin-bottom: 16px; }

/* — Формам воздух: подпись не липнет к полю (мелкий mb-1 у капшенов → 8px) — */
.anima form label > span.mb-1 { margin-bottom: 8px !important; }
.anima form label.block { display: block; }

/* ── КОРЕНЬ «БЕЛЫХ РАМОЧЕК»: дефолт бордюра Tailwind = #e5e7eb (светло-серый).
   Через :where (0 специфичности) задаём тихий тёмный бордюр всем голым border-*,
   не перебивая явные border-{color} классы. ───────────────────────────────── */
.anima :where(.border, .border-t, .border-r, .border-b, .border-l, .border-x, .border-y, .border-2, .border-dashed) {
  border-color: var(--a-line);
}

/* ── СВЕТЛЫЕ ПЯТНА: классы светлой палитры, не покрытые тёмной темой,
   переводим в тёмные тон-в-тон (scoped .anima; standalone email/consent не задеты). */
.anima .bg-red-100 { background: rgba(248,113,113,.12) !important; }
.anima .text-red-700, .anima .text-red-600 { color: #fca5a5 !important; }
.anima .bg-blue-100, .anima .bg-blue-50\/60, .anima .bg-indigo-50 { background: rgba(96,165,250,.12) !important; }
.anima .text-blue-700, .anima .text-blue-600, .anima .text-indigo-900 { color: #93c5fd !important; }
.anima .bg-amber-100 { background: rgba(251,191,36,.14) !important; }
.anima .text-amber-500, .anima .text-amber-600 { color: #fcd34d !important; }
.anima .bg-violet-50 { background: rgba(139,92,246,.10) !important; }
.anima .text-violet-600, .anima .text-violet-700, .anima .text-violet-800 { color: #c4b5fd !important; }
.anima .bg-sber-100 { background: rgba(33,160,56,.14) !important; }
.anima .border-amber-100, .anima .border-blue-100, .anima .border-violet-100,
.anima .border-sber-100, .anima .border-indigo-400, .anima .border-red-200 { border-color: var(--a-line2) !important; }
.anima .to-white { --tw-gradient-to: rgba(255,255,255,0) !important; }

/* ── Нативные input[type=file]: «Choose File» больше не белая системная кнопка ── */
.anima input[type="file"] { color: var(--a-muted); font-size: 13px; max-width: 100%; }
.anima input[type="file"]::file-selector-button {
  background: var(--a-glass2); color: var(--a-text);
  border: 1px solid var(--a-line2); border-radius: 9px;
  padding: 7px 14px; margin-right: 12px; font-weight: 600; font-size: 13px;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.anima input[type="file"]::file-selector-button:hover { background: var(--a-glass); border-color: var(--a-bright); }

/* ── МЕЛКИЕ СЖАТЫЕ ЧИПЫ: 10px + py-0.5 (2px) = тесные пилюли в рамках по всему
   сайту. Поднимаем кегль до 11px и даём воздух внутри. ───────────────────── */
.anima .text-\[10px\] { font-size: 11px !important; }
.anima .text-\[11px\] { font-size: 11.5px !important; }
/* пилюли (rounded-full / rounded со скруглением) с мелким текстом — распереть */
.anima .rounded-full.text-\[10px\], .anima .rounded-full.text-\[11px\],
.anima .rounded.text-\[10px\], .anima .rounded-md.text-\[10px\] {
  padding-top: 3px !important; padding-bottom: 3px !important;
  padding-left: 10px !important; padding-right: 10px !important;
  line-height: 1.45 !important;
}
/* пастельные чипы-категории: тише фон, единый тихий бордюр, чтобы не пестрили */
.anima .rounded-full.bg-sber-50, .anima .rounded-full.bg-amber-50,
.anima .rounded-full.bg-blue-50, .anima .rounded-full.bg-ink-100,
.anima .rounded-full.bg-ink-50 { border-color: var(--a-line) !important; }
/* ряды чипов не слипаются: gap-1/gap-1.5 (4–6px) → больше воздуха */
.anima .flex-wrap.gap-1 { gap: 7px !important; }
.anima .flex-wrap.gap-1\.5 { gap: 8px !important; }

/* — Чиним «белые тесные формы» по всему приложению: светлые tailwind-поля
   (bg-white / bg-ink-50 / hairline-бордюр) на тёмных экранах перекрашиваем в тёмные,
   читаемые и чуть просторнее. Только поля ввода; контейнеры с теми же классами не трогаем.
   Standalone-страницы (email, consent) не имеют .anima — их это не касается. */
.anima input.bg-white, .anima input.bg-ink-50,
.anima textarea.bg-white, .anima textarea.bg-ink-50,
.anima select.bg-white, .anima select.bg-ink-50 {
  background: rgba(255,255,255,.04) !important;
  color: var(--a-text) !important;
  border-color: var(--a-line2) !important;
  padding-top: 9px !important;
  padding-bottom: 9px !important;
}
.anima input.bg-white::placeholder, .anima textarea.bg-white::placeholder,
.anima input.bg-ink-50::placeholder, .anima textarea.bg-ink-50::placeholder { color: var(--a-subtle) !important; }
.anima input.bg-white:focus, .anima input.bg-ink-50:focus,
.anima textarea.bg-white:focus, .anima textarea.bg-ink-50:focus,
.anima select.bg-white:focus, .anima select.bg-ink-50:focus { border-color: rgba(255,255,255,.34) !important; }
.anima select.bg-white option, .anima select.bg-ink-50 option { background: var(--a-bg1); color: var(--a-text); }

/* ── Мобильный чат-дровер: чёлка + клавиатура + анти-зум iOS ─────────── */
.chatd-drawer { height: 100dvh; }
.chatd-head {
  padding-top: calc(16px + env(safe-area-inset-top));
  padding-right: calc(18px + env(safe-area-inset-right));
}
@media (max-width: 560px) {
  .chatd-drawer { width: 100vw; border-left: none; }
  .chatd-composer { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .chatd-input { font-size: 16px; }
}

/* iOS не зумит при фокусе на поле, если шрифт ≥16px — глобально для всех полей
   на узких экранах (логин, формы, фокусное, админка и т.д.). */
@media (max-width: 768px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]),
  textarea,
  select {
    font-size: 16px !important;
  }
}
