/* ═══════════════════════════════════════════════════════════
   Twitter Watcher — панель. Тёмная тема, живые подсветки.
   ═══════════════════════════════════════════════════════════ */
:root {
  --bg: #080a0e;
  --bg-2: #0c0f14;
  --panel: #13161d;
  --panel-2: #181c24;
  --panel-3: #20252f;
  --line: #242a34;
  --line-2: #333b47;
  --text: #e9edf2;
  --muted: #8b95a4;
  --faint: #5f6875;
  --accent: #2b8fff;
  --accent-2: #1f7ae0;
  --accent-soft: rgba(43,143,255,.14);
  --ok: #2fb56a;
  --ok-soft: rgba(47,181,106,.12);
  --warn: #e0a12a;
  --warn-soft: rgba(224,161,42,.12);
  --err: #ef4d4d;
  --err-soft: rgba(239,77,77,.12);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.26);
  --shadow-hi: 0 1px 2px rgba(0,0,0,.4), 0 18px 46px rgba(0,0,0,.4);
  --sidebar-w: 236px;
  /* Плавность: одна кривая на всё (мягкий выход) и три длительности */
  --ease: cubic-bezier(.22,.61,.36,1);
  --t-fast: 170ms;
  --t: 260ms;
  --t-slow: 420ms;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
/* scroll-behavior: smooth здесь НЕ ставим: он анимирует каждое изменение scrollTop
   и конфликтует с инерционной прокруткой колеса (app.js). Для якорей — scrollIntoView. */
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.55 -apple-system, "Segoe UI", system-ui, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
h2 { margin: 0; font-size: 15px; font-weight: 650; display: inline-flex; align-items: center; gap: 8px; }
h3 { margin: 0 0 8px; font-size: 13px; font-weight: 650; color: var(--text); }
.hint, .muted { color: var(--muted); font-weight: 400; font-size: 12px; }
.ic { width: 18px; height: 18px; fill: currentColor; flex: none; }
.head-ic { width: 16px; height: 16px; color: var(--accent); }
::selection { background: rgba(43,143,255,.3); }

/* ─── Фон ───
   Статичные радиальные градиенты вместо размытых пятен в анимации: blur(90px) на поверхностях
   в пол-экрана заставляет GPU пересчитывать размытие каждый кадр — от этого тормозит весь браузер,
   а не только вкладка. Градиент растеризуется один раз и ничего не стоит. */
.aurora {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(42vw 42vw at 8% -6%, rgba(43,143,255,.16), transparent 70%),
    radial-gradient(44vw 44vw at 104% 108%, rgba(123,92,255,.14), transparent 70%),
    radial-gradient(34vw 34vw at 76% 42%, rgba(31,184,122,.07), transparent 70%);
}
.aurora span { display: none; }

/* ─── Каркас ─── */
.layout { min-height: 100vh; }
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w); z-index: 30;
  /* непрозрачный фон вместо backdrop-filter: сайдбар зафиксирован поверх прокручиваемого
     контента, и размытие под ним пересчитывалось на каждый кадр прокрутки */
  background: #0c0f14;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 14px; gap: 18px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 6px; }
.logo {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 19px;
  background: linear-gradient(160deg, var(--panel-3), var(--panel)); border: 1px solid var(--line);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.brand:hover .logo { transform: rotate(-6deg) scale(1.04); box-shadow: 0 0 0 4px var(--accent-soft); }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text b { font-size: 14px; }
.brand-text span { font-size: 11px; color: var(--muted); }

.nav { position: relative; display: flex; flex-direction: column; gap: 3px; }
.nav-glow {
  position: absolute; left: 0; width: 100%; border-radius: var(--radius-sm); z-index: 0;
  background: linear-gradient(90deg, var(--accent-soft), rgba(43,143,255,.03));
  box-shadow: inset 2px 0 0 var(--accent);
  transition: transform var(--t) var(--ease), height var(--t) var(--ease), opacity var(--t-fast) linear; opacity: 0;
}
.nav-btn {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  background: transparent; border: 0; color: var(--muted); cursor: pointer;
  padding: 10px 11px; border-radius: var(--radius-sm); font: inherit; font-weight: 550;
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.nav-btn:hover { color: var(--text); background: rgba(255,255,255,.035); }
.nav-btn .ic { transition: color var(--t) var(--ease); }
.nav-btn.active { color: #fff; }
.nav-btn.active .ic { color: var(--accent); }
.nav-badge {
  margin-left: auto; min-width: 20px; text-align: center; font-size: 11px; font-weight: 700;
  padding: 1px 6px; border-radius: 999px; background: var(--panel-3); color: var(--muted);
  transition: background .2s, color .2s;
}
.nav-btn.active .nav-badge { background: var(--accent-soft); color: #cfe4ff; }
.side-foot { margin-top: auto; }

.status {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px; font-size: 12.5px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel);
  transition: border-color .3s, background .3s;
}
.status.ok { border-color: rgba(47,181,106,.35); }
.status.err { border-color: rgba(239,77,77,.35); }
/* Пульс точки: кольцо-псевдоэлемент на transform/opacity — это композитится на GPU,
   в отличие от анимации box-shadow, которая перерисовывает область каждый кадр. */
.dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%; background: inherit; opacity: 0;
}
.status.ok .dot { background: var(--ok); }
.status.warn .dot { background: var(--warn); }
.status.err .dot { background: var(--err); }

/* ─── Контент ─── */
.main { min-width: 0; margin-left: var(--sidebar-w); padding: 26px 30px 70px; max-width: 1200px; }
.view { display: none; flex-direction: column; gap: 18px; }
.view.active { display: flex; }
/* Появление вкладки: одно мягкое движение целиком, лёгкий стаггер только у первых карточек */
.view.active [data-anim] { animation: riseIn var(--t-slow) var(--ease) backwards; }
.view.active [data-anim]:nth-child(2) { animation-delay: 40ms; }
.view.active [data-anim]:nth-child(3) { animation-delay: 70ms; }
.view.active [data-anim]:nth-child(n+4) { animation-delay: 90ms; }
@keyframes riseIn { from { opacity: 0; transform: translate3d(0, 10px, 0); } to { opacity: 1; transform: none; } }

.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.view-sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tick { display: inline-flex; align-items: center; gap: 7px; color: var(--faint); font-size: 12px; }
.tick-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }

.card {
  position: relative; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.card:hover { border-color: var(--line-2); box-shadow: var(--shadow-hi); }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 + .hint { margin-left: -2px; }
.card-head .head-actions, .card-head .ring, .card-head > .btn:last-child { margin-left: auto; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.accent-card { border-color: rgba(43,143,255,.26); }
.accent-card::before {
  content: ''; position: absolute; inset: 0 0 auto; height: 2px; border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, transparent, var(--accent) 35%, #7b5cff 65%, transparent);
  opacity: .75;
}

/* ─── Hero ─── */
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line);
  padding: 20px 22px; box-shadow: var(--shadow);
  background: linear-gradient(150deg, var(--panel-2), var(--panel));
  display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap;
  transition: border-color .3s;
}
.hero::after {
  content: ''; position: absolute; inset: -40% -10% auto auto; width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(43,143,255,.16), transparent 65%); pointer-events: none;
  transition: background .4s;
}
.hero.ok { border-color: rgba(47,181,106,.3); }
.hero.ok::after { background: radial-gradient(circle, rgba(47,181,106,.15), transparent 65%); }
.hero.warn { border-color: rgba(224,161,42,.3); }
.hero.warn::after { background: radial-gradient(circle, rgba(224,161,42,.15), transparent 65%); }
.hero.err { border-color: rgba(239,77,77,.34); }
.hero.err::after { background: radial-gradient(circle, rgba(239,77,77,.16), transparent 65%); }
.hero-main { display: flex; align-items: center; gap: 16px; min-width: 240px; flex: 1; }
.hero-ring {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  border: 1px solid var(--line-2); background: rgba(0,0,0,.25);
}
.hero-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--faint); }
.hero.ok .hero-ring { border-color: rgba(47,181,106,.45); }
.hero.ok .hero-dot { background: var(--ok); }
.hero.warn .hero-ring { border-color: rgba(224,161,42,.45); }
.hero.warn .hero-dot { background: var(--warn); }
.hero.err .hero-ring { border-color: rgba(239,77,77,.5); }
.hero.err .hero-dot { background: var(--err); }
.hero-text { min-width: 0; }
.hero-title { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.hero-msg { color: var(--muted); font-size: 13px; margin-top: 3px; }
.hero-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; min-width: 300px; position: relative; }
.gauge { min-width: 160px; }
.gauge-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 11.5px; color: var(--muted); margin-bottom: 6px; }
.gauge-head b { font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }

.bar { height: 7px; border-radius: 999px; background: rgba(0,0,0,.35); overflow: hidden; border: 1px solid var(--line); }
.bar > i {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #5ab0ff);
  transition: width .6s var(--ease), background .3s;
}
.bar > i.warn { background: linear-gradient(90deg, var(--warn), #f4c56b); }
.bar > i.err { background: linear-gradient(90deg, var(--err), #ff8a8a); }
.bar.striped > i { background-image: linear-gradient(90deg, var(--accent), #5ab0ff); position: relative; }
.bar.striped > i::after {
  content: ''; position: absolute; inset: 0; animation: stripes 1s linear infinite;
  background: repeating-linear-gradient(115deg, rgba(255,255,255,.22) 0 8px, transparent 8px 16px);
}
@keyframes stripes { to { transform: translateX(16px); } }
.spark svg { display: block; width: 100%; height: 36px; overflow: visible; }

/* ─── Кольцо прогресса ─── */
.ring { position: relative; width: 42px; height: 42px; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; width: 42px; height: 42px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3; }
.ring .ring-bg { stroke: var(--line); }
.ring .ring-fg { stroke: var(--ok); stroke-linecap: round; stroke-dasharray: 97.4; stroke-dashoffset: 97.4; transition: stroke-dashoffset .7s var(--ease), stroke .3s; }
.ring b { font-size: 11px; font-variant-numeric: tabular-nums; color: var(--muted); }

/* ─── Чек-лист ─── */
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.chk {
  display: flex; align-items: center; gap: 11px; padding: 10px 8px; border-radius: var(--radius-sm);
  border-bottom: 1px solid var(--line); transition: background-color var(--t) var(--ease);
}
.chk:last-child { border-bottom: 0; }
.chk:hover { background: var(--panel-2); }
.chk-ic { width: 23px; height: 23px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--panel-3); color: var(--muted); transition: background .3s, color .3s; }
.chk-ic .ic { width: 14px; height: 14px; }
.chk.done .chk-ic { background: var(--ok-soft); color: var(--ok); }
.chk.todo .chk-ic { background: var(--warn-soft); color: var(--warn); }
.chk-body { min-width: 0; flex: 1; }
.chk-title { font-weight: 550; font-size: 13px; }
.chk-sub { color: var(--muted); font-size: 12px; }
.chk-go { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: 12px; white-space: nowrap; transition: opacity var(--t-fast) var(--ease); }
.chk-go:hover { text-decoration: underline; opacity: .8; }

/* ─── Метрики ─── */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px,1fr)); gap: 10px; }
.metric {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 13px; display: flex; flex-direction: column; gap: 3px; min-width: 0;
  transition: border-color var(--t) var(--ease), background-color var(--t) var(--ease);
}
.metric:hover { border-color: var(--line-2); background: var(--panel-3); }
.m-label { color: var(--muted); font-size: 11.5px; }
.m-value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-value.bump { animation: bump .5s var(--ease); }
@keyframes bump { 0% { transform: none; } 35% { transform: translateY(-3px) scale(1.06); color: var(--accent); } 100% { transform: none; } }

/* ─── Кнопки, поля ─── */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); padding: 9px 14px; font: inherit; font-weight: 550;
  cursor: pointer; white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
              box-shadow var(--t) var(--ease), transform 90ms var(--ease), filter var(--t-fast) var(--ease);
}
.btn:hover { background: var(--panel-3); border-color: #414a58; }
.btn:active { transform: scale(.97); }
.btn:disabled, .btn.loading { opacity: .6; cursor: default; pointer-events: none; }
.btn .ic { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.1); box-shadow: 0 6px 20px rgba(43,143,255,.3); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.small { padding: 6px 11px; font-size: 12px; }
.btn.danger { color: var(--err); border-color: transparent; background: transparent; }
.btn.danger:hover { background: var(--err-soft); border-color: rgba(239,77,77,.4); }
.btn .ripple { position: absolute; border-radius: 50%; transform: scale(0); background: rgba(255,255,255,.3); pointer-events: none; animation: ripple .55s ease-out forwards; }
@keyframes ripple { to { transform: scale(2.4); opacity: 0; } }
.btn.loading::after {
  content: ''; width: 13px; height: 13px; border-radius: 50%; margin-left: 2px;
  border: 2px solid currentColor; border-top-color: transparent; animation: spin .7s linear infinite;
}
.spin { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius-sm); padding: 10px 12px; font: inherit; outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
input:hover, select:hover, textarea:hover { border-color: var(--line-2); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--bg); }
textarea { resize: vertical; font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 12.5px; }
.row { display: flex; gap: 8px; }
.inline { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.inline input { width: auto; max-width: 170px; }
.note { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.note code, code { background: var(--bg); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; font-size: 12px; }
.empty { color: var(--muted); margin: 10px 0 0; font-size: 13px; }
.form-msg { font-size: 13px; color: var(--muted); }
.form-msg.err { color: var(--err); }
.form-msg.ok { color: var(--ok); }

/* ─── Панель инструментов: поиск + чипы ─── */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 4px; }
.search { position: relative; display: flex; align-items: center; flex: 1; min-width: 190px; }
.search .ic { position: absolute; left: 11px; width: 15px; height: 15px; color: var(--faint); pointer-events: none; transition: color .2s; }
.search:focus-within .ic { color: var(--accent); }
.search input { padding-left: 34px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 12px; cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip.active { border-color: var(--accent); background: var(--accent-soft); color: #cfe4ff; }
.set-nav { position: sticky; top: 0; z-index: 10; padding: 8px 0; background: linear-gradient(var(--bg) 60%, transparent); }

/* ─── Аккаунты ─── */
.add-form { display: flex; gap: 8px; }
.accounts, .feed, .chats { list-style: none; margin: 0; padding: 0; }
.accounts { margin-top: 6px; }
.acct {
  display: grid; grid-template-columns: 40px minmax(0,1fr) auto; gap: 12px; align-items: center;
  padding: 13px 10px; border-radius: var(--radius-sm); border-top: 1px solid var(--line);
  transition: background-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
  /* длинные списки: браузер не раскладывает то, что за экраном */
  content-visibility: auto; contain-intrinsic-size: auto 96px;
}
.acct:first-child { border-top: 0; }
.acct:hover { background: var(--panel-2); box-shadow: inset 2px 0 0 var(--accent); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--panel-3); object-fit: cover; display: grid; place-items: center; color: var(--muted); font-weight: 700; }
.acct-name { font-weight: 600; display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.acct-name .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-meta { color: var(--muted); font-size: 12px; }
.acct-last { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-err { color: var(--err); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; opacity: .55; transition: opacity .2s; }
.acct:hover .acct-actions { opacity: 1; }
.acct.paused { opacity: .6; }

.pill {
  font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--muted); font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px;
  transition: color .25s, border-color .25s, background .25s;
}
.pill.live, .pill.ok { color: var(--ok); border-color: rgba(47,181,106,.4); background: var(--ok-soft); }
.pill.paused, .pill.warn { color: var(--warn); border-color: rgba(224,161,42,.4); background: var(--warn-soft); }
.pill.err { color: var(--err); border-color: rgba(239,77,77,.4); background: var(--err-soft); }
.pill.busy { color: var(--accent); border-color: rgba(43,143,255,.4); background: var(--accent-soft); }
.pill.tag { color: var(--muted); }
.pill.busy::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.glow-ok { box-shadow: 0 0 0 3px rgba(47,181,106,.12); }
.pill.glow-err { box-shadow: 0 0 0 3px rgba(239,77,77,.14); }

/* сайт проекта у аккаунта */
.site { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; min-width: 0; flex-wrap: wrap; }
.site a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.site .copy.done { color: var(--ok); border-color: rgba(47,181,106,.5); }
.site-form input { max-width: 240px; padding: 6px 10px; font-size: 13px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.link-btn:hover { color: var(--accent); text-decoration: underline; }

/* ─── Лента ─── */
.post {
  padding: 13px 8px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 36px minmax(0,1fr);
  gap: 12px; border-radius: var(--radius-sm); transition: background-color var(--t) var(--ease);
  content-visibility: auto; contain-intrinsic-size: auto 104px;
}
.post:first-child { border-top: 0; }
.post:hover { background: var(--panel-2); }
.post .avatar { width: 36px; height: 36px; }
.post-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; font-size: 13px; }
.post-head b { font-weight: 600; }
.post-text { white-space: pre-wrap; word-break: break-word; margin: 5px 0; }
.post-foot { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: 12px; }
.post-foot .ok { color: var(--ok); }
.post-foot .err { color: var(--err); }

/* ─── Подготовка профилей ─── */
.prepare { display: flex; flex-direction: column; }
.prep-step { display: grid; grid-template-columns: 26px 1fr; gap: 14px; }
.prep-step + .prep-step { padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--line); }
.prep-num { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(160deg, var(--accent), var(--accent-2)); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; box-shadow: 0 0 0 4px var(--accent-soft); }
.prep-body { min-width: 0; }
.prep-title { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 10px; flex-wrap: wrap; }
.prep-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.step2-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.tag-picker { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; margin: 12px 0 2px; }
.tag-picker .empty { margin: 0; }
.tags-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease); }
.tag-chip:hover { border-color: var(--line-2); background: var(--panel-3); }
.tag-chip.active { border-color: var(--accent); background: var(--accent-soft); color: #fff; box-shadow: 0 0 0 3px rgba(43,143,255,.1); }
.tag-count { font-size: 11px; font-weight: 700; color: var(--muted); background: var(--bg); border-radius: 999px; padding: 0 7px; }
.tag-chip.active .tag-count { color: #fff; background: rgba(255,255,255,.2); }
/* тег есть в Octo, но профилей с ним в панели ещё нет */
.tag-chip.empty { border-style: dashed; color: var(--muted); }
/* закреплённые теги — первыми и заметнее */
.tag-chip.pinned { border-color: rgba(43,143,255,.4); }
.tag-chip .pin { margin-left: 2px; font-size: 11px; color: var(--faint); opacity: 0; transition: opacity var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.tag-chip:hover .pin, .tag-chip.pinned .pin { opacity: 1; }
.tag-chip.pinned .pin { color: var(--accent); }
.tag-chip .pin.role { color: var(--warn); opacity: 1; cursor: default; }
.tag-chip .pin:hover { color: var(--accent); }
.wk-filters { margin: 0 0 12px; }
.chip .tag-count { font-size: 10.5px; font-weight: 700; color: var(--faint); background: var(--bg); border-radius: 999px; padding: 0 6px; margin-left: 4px; }
.chip.active .tag-count { color: #cfe4ff; background: rgba(255,255,255,.12); }
optgroup { color: var(--muted); font-style: normal; }
optgroup option { color: var(--text); }

/* ─── Таблица профилей ─── */
.table-wrap { overflow: auto; max-height: 60vh; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-top: 10px; }
.profiles { width: 100%; border-collapse: collapse; font-size: 13px; }
/* Непрозрачный фон вместо backdrop-filter: прилипшая шапка не пересчитывает размытие на каждый кадр прокрутки */
.profiles thead th { position: sticky; top: 0; z-index: 1; background: #181c24; }
.profiles th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.profiles td { padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.profiles tr:last-child td { border-bottom: 0; }
.profiles tbody tr { transition: background-color var(--t-fast) var(--ease), box-shadow var(--t) var(--ease); }
.profiles tbody tr:hover { background: var(--panel-2); }
.profiles tbody tr.st-ready { box-shadow: inset 2px 0 0 var(--ok); }
.profiles tbody tr.st-busy { box-shadow: inset 2px 0 0 var(--accent); }
.profiles tbody tr.st-bad { box-shadow: inset 2px 0 0 var(--err); }
.profiles td.num, .profiles th.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.p-title { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.p-title .rename { cursor: pointer; border-bottom: 1px dashed transparent; }
.p-title .rename:hover { border-bottom-color: var(--muted); }
.p-sub { color: var(--faint); font-size: 11.5px; margin-top: 2px; }
.p-auth { font-size: 12px; color: var(--ok); display: inline-flex; align-items: center; gap: 4px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-proxy { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.p-proxy .ic, .p-auth .ic { width: 12px; height: 12px; }
.os-tag { font-size: 10px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
.p-err { color: var(--err); font-size: 12px; max-width: 260px; overflow-wrap: anywhere; margin-top: 3px; }
.p-actions { display: flex; gap: 4px; justify-content: flex-end; }
.chk-col { width: 36px; text-align: center; padding-left: 12px !important; }
.chk-col input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; margin: 0; }
.sel-bar { display: flex; align-items: center; gap: 8px; margin-left: auto; animation: riseIn .3s var(--ease); }
#sel-count { color: var(--muted); font-size: 13px; margin-right: 2px; }
.icon-btn { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; background: transparent; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); cursor: pointer; transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease), transform 90ms var(--ease); }
.icon-btn:hover { color: var(--text); border-color: var(--line-2); background: var(--panel-2); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.danger:hover { color: var(--err); border-color: rgba(239,77,77,.4); background: var(--err-soft); }
.icon-btn.go:hover { color: var(--ok); border-color: rgba(47,181,106,.4); background: var(--ok-soft); }
.icon-btn.sh:hover { color: var(--accent); border-color: rgba(43,143,255,.45); background: var(--accent-soft); }
.icon-btn .ic { width: 15px; height: 15px; }
.icon-btn.loading { opacity: .45; pointer-events: none; }
.icon-btn.loading .ic { animation: spin .9s linear infinite; }

/* ─── Дополнительно ─── */
.advanced { padding: 0; }
.advanced > summary, .sub-advanced > summary { cursor: pointer; color: var(--muted); font-size: 13px; list-style: none; transition: color .16s; }
.advanced > summary { padding: 16px 18px; }
.advanced > summary:hover, .sub-advanced > summary:hover { color: var(--text); }
.advanced > summary::-webkit-details-marker, .sub-advanced > summary::-webkit-details-marker { display: none; }
.advanced > summary::before, .sub-advanced > summary::before { content: "▸"; display: inline-block; margin-right: 7px; transition: transform .2s var(--ease); }
.advanced[open] > summary::before, .sub-advanced[open] > summary::before { transform: rotate(90deg); }
.adv-block { padding: 0 18px 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.adv-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.create-grid { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0; }
.create-grid .inline { flex-direction: column; align-items: flex-start; gap: 5px; color: var(--text); }
.create-grid .inline select, .create-grid .inline input { max-width: 200px; }
.mini-label { display: block; color: var(--muted); font-size: 12px; margin: 12px 0 5px; }
.sub-advanced { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.sub-advanced > summary { padding: 2px 0; }
.sub-advanced[open] > summary { margin-bottom: 8px; }

/* ─── Настройки ─── */
.settings { display: flex; flex-direction: column; gap: 18px; }
.settings .field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; margin-bottom: 12px; }
.settings .field:last-child { margin-bottom: 0; }
.settings fieldset { border: 0; padding: 14px 0 0; margin: 8px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; }
.settings legend { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; padding: 0 0 6px; }
.settings .card.flash-sec { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.checks { display: flex; flex-direction: column; gap: 10px; }
.check { display: flex; align-items: center; gap: 9px; font-size: 13px; cursor: pointer; transition: color .16s; }
.check:hover { color: #fff; }
.check:has(input:disabled) { color: var(--muted); cursor: default; }
.check input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.grid-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.grid-fields .field { margin: 0; }
.settings-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 55%); }
.chats { margin-top: 6px; }
.chats li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-top: 8px; font-size: 12px; transition: border-color .16s; }
.chats li:hover { border-color: var(--line-2); }
.chats li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Текущая операция: видна с любой вкладки ─── */
.job-bar {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 90;
  width: min(560px, calc(100vw - 32px));
  background: rgba(20,24,31,.97); border: 1px solid var(--accent);
  border-radius: var(--radius); padding: 11px 14px 12px; box-shadow: var(--shadow-hi);
  animation: riseIn var(--t) var(--ease);
}
.job-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; margin-bottom: 8px; }
.job-head b { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* несколько операций идут параллельно — по строке на каждую */
.job-row + .job-row { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
@media (max-width: 900px) { .job-bar { bottom: 12px; } }

/* ─── Тосты ─── */
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 10px; z-index: 100; max-width: 390px; }
.toast {
  position: relative; overflow: hidden; background: #1a1e27;
  border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: var(--radius-sm);
  padding: 11px 32px 12px 14px; box-shadow: var(--shadow-hi); font-size: 13px;
  animation: toastIn .26s var(--ease); transition: opacity .2s, transform .2s;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--err); }
.toast.pending { border-left-color: var(--warn); }
.toast .x { position: absolute; top: 6px; right: 8px; background: none; border: 0; color: var(--faint); cursor: pointer; font-size: 15px; line-height: 1; padding: 2px 4px; }
.toast .x:hover { color: var(--text); }
.toast .tl { position: absolute; left: 0; bottom: 0; height: 2px; background: currentColor; opacity: .45; width: 100%; transform-origin: left; }
.toast.ok .tl { color: var(--ok); } .toast.err .tl { color: var(--err); } .toast.pending .tl { color: var(--warn); }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes tl { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ─── Экран входа ─── */
.login-overlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; background: rgba(6,8,11,.88); backdrop-filter: blur(6px); padding: 20px; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 26px; width: 100%; max-width: 344px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-hi); text-align: center; animation: riseIn .4s var(--ease); }
.login-logo { width: 48px; height: 48px; margin: 0 auto 2px; border-radius: 13px; background: linear-gradient(160deg, var(--panel-3), var(--panel)); border: 1px solid var(--line); display: grid; place-items: center; font-size: 22px; box-shadow: 0 0 0 5px var(--accent-soft); }
.login-card h2 { font-size: 18px; display: block; }
.login-sub { color: var(--muted); font-size: 13px; margin: -6px 0 4px; }
.login-card .form-msg { text-align: center; min-height: 0; }

[hidden] { display: none !important; }

/* ─── Проекты под наблюдением ─── */
.project-add { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; animation: riseIn .3s var(--ease); }
.project-add input { flex: 1; min-width: 160px; }
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.project { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); padding: 13px 14px; display: flex; flex-direction: column; gap: 9px; transition: border-color var(--t) var(--ease), background-color var(--t) var(--ease); }
.project:hover { border-color: var(--line-2); background: var(--panel-3); }
.project-top { display: flex; align-items: center; gap: 8px; }
.project-name { font-weight: 650; font-size: 14px; color: var(--text); cursor: pointer; }
.project-name:hover { text-decoration: underline dotted; }
.project-del { margin-left: auto; opacity: 0; transition: opacity .2s; }
.project:hover .project-del { opacity: 1; }
.project-site { display: flex; align-items: center; gap: 6px; font-size: 12.5px; min-width: 0; }
.project-site .ic { width: 14px; height: 14px; color: var(--muted); }
.project-site a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-handles { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hchip { display: inline-flex; align-items: center; gap: 5px; background: var(--panel-3); border: 1px solid var(--line); border-radius: 999px; padding: 3px 5px 3px 9px; font-size: 12px; transition: border-color .16s; }
.hchip:hover { border-color: var(--line-2); }
.hchip .st { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.hchip .st.live { background: var(--ok); } .hchip .st.warn, .hchip .st.paused { background: var(--warn); } .hchip .st.err { background: var(--err); }
.hchip a { color: var(--text); }
.hchip .rm { background: transparent; border: 0; color: var(--faint); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
.hchip .rm:hover { color: var(--err); }
.project-add-acct { background: var(--panel-3); border: 1px dashed var(--line-2); border-radius: 999px; color: var(--muted); padding: 3px 10px; font: inherit; font-size: 12px; cursor: pointer; width: auto; }
.project-add-acct:focus { outline: none; border-color: var(--accent); }

/* ─── Аккаунты в работе ─── */
.roles { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; font-size: 12.5px; color: var(--muted); margin: 12px 0 4px; }
.role { display: inline-flex; align-items: center; gap: 7px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; }
.role b { color: var(--text); font-weight: 600; }
.role.off { border-color: rgba(224,161,42,.35); background: var(--warn-soft); }
.working { display: grid; grid-template-columns: repeat(auto-fill, minmax(262px, 1fr)); gap: 12px; }
.wk {
  position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel-2); padding: 12px 13px; display: flex; flex-direction: column; gap: 8px;
  transition: border-color var(--t) var(--ease), background-color var(--t) var(--ease);
}
.wk::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--faint); transition: background-color var(--t) var(--ease); }
.wk.st-ready::before { background: var(--ok); }
.wk.st-busy::before { background: var(--accent); }
.wk.st-bad::before { background: var(--err); }
.wk:hover { border-color: var(--line-2); background: var(--panel-3); }
.wk.sb { border-color: rgba(239,77,77,.35); }
.wk.nsb { border-color: rgba(47,181,106,.3); }
.wk-top { display: flex; align-items: center; gap: 8px; }
.wk-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-top .pill:last-child { margin-left: auto; }
.wk-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); }
.wk-meta .ic { width: 13px; height: 13px; vertical-align: -2px; }
.wk-row { display: flex; align-items: center; gap: 6px; font-size: 12px; flex-wrap: wrap; }
.wk-row .lbl { color: var(--faint); }
.wk-acts { display: flex; gap: 6px; margin-top: 2px; opacity: .6; transition: opacity .2s; }
.wk:hover .wk-acts { opacity: 1; }

/* ─── Шаги процесса ─── */
.steps { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.steps li { display: flex; align-items: baseline; gap: 10px; font-size: 13px; color: var(--muted); }
.steps li > b:first-child {
  flex: none; width: 19px; height: 19px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--accent-soft); color: #9fcbff; font-size: 11px; font-weight: 700; align-self: center;
}
.steps li b { color: var(--text); }

/* ─── Строка готовности: чего не хватает и кнопка, которая это чинит ─── */
.ready-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 2px; }
.req {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 7px 5px 13px; background: var(--panel-2);
  transition: border-color var(--t) var(--ease), background-color var(--t) var(--ease);
}
.req b { color: var(--text); font-weight: 600; }
.req.ok { border-color: rgba(47,181,106,.35); background: var(--ok-soft); }
.req.todo { border-color: rgba(224,161,42,.4); background: var(--warn-soft); }
.req .mini-select { max-width: 190px; padding: 4px 8px; font-size: 12px; border-radius: 999px; }
.req .btn.small { padding: 4px 11px; }
.req .tick { color: var(--ok); }

/* Выбор аккаунтов по тегу (теневой бан): тег вписывается, аккаунты — чипами */
.tag-input {
  width: 120px; padding: 4px 10px; font-size: 12px; border-radius: 999px;
  background: var(--panel-3); border: 1px solid var(--line-2); color: var(--text);
}
.tag-input:focus { border-color: var(--accent); outline: none; }
.acc-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; max-width: 100%; max-height: 108px; overflow-y: auto; }
.acc-chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: var(--panel-3); border: 1px solid var(--line); color: var(--text);
  border-radius: 999px; padding: 4px 11px; font-size: 12px; transition: border-color .15s, background-color .15s;
}
.acc-chip:hover { border-color: var(--line-2); }
.acc-chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.acc-chip .st { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.acc-chip .st.live { background: var(--ok); } .acc-chip .st.paused { background: var(--warn); } .acc-chip .st.err { background: var(--err); }

/* ─── Промо: прогоны ─── */
.promo-run { padding: 11px 0; border-top: 1px solid var(--line); }
.promo-run:first-child { border-top: 0; }
.promo-run-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.promo-run-top a { display: inline-flex; align-items: center; gap: 5px; color: var(--text); font-size: 13px; }
.promo-run-top a .ic { width: 14px; height: 14px; }
.promo-run-atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ─── Теневой бан ─── */
.run { margin: 12px 0 6px; animation: riseIn .3s var(--ease); }
.run-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.run-head b { color: var(--text); font-variant-numeric: tabular-nums; }
.shadow-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px,1fr)); gap: 10px; margin: 14px 0 4px; }
.sstat { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); padding: 11px 12px; display: flex; flex-direction: column; gap: 2px; transition: border-color var(--t) var(--ease), background-color var(--t) var(--ease); }
.sstat:hover { background: var(--panel-3); }
.sstat .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.sstat .l { font-size: 11.5px; color: var(--muted); }
.sstat.ok { border-color: rgba(47,181,106,.32); } .sstat.ok .v { color: var(--ok); }
.sstat.bad { border-color: rgba(239,77,77,.32); } .sstat.bad .v { color: var(--err); }
.sstat.warn { border-color: rgba(224,161,42,.3); } .sstat.warn .v { color: var(--warn); }
.shadow-posts { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.spost { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); padding: 12px 13px; transition: border-color .2s, background .2s; }
.spost:hover { border-color: var(--line-2); }
.spost-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.spost-head .who { color: var(--text); font-weight: 600; }
.spost-text { font-size: 13px; margin: 6px 0 8px; color: var(--text); opacity: .9; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.scomments { display: flex; flex-wrap: wrap; gap: 6px; }
.scom { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; background: var(--panel-3); transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease); }
.scom:hover { background: var(--line); }
.scom.ok { border-color: rgba(47,181,106,.4); color: #b8e9cd; }
.scom.bad { border-color: rgba(239,77,77,.42); color: #ffc9c9; }
.scom .dotm { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.scom.ok .dotm { background: var(--ok); }
.scom.bad .dotm { background: var(--err); }

/* ─── Токены ─── */
.tokens { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 10px; }
.tok {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel-2); padding: 12px 13px; display: flex; flex-direction: column; gap: 7px;
  transition: border-color var(--t) var(--ease), background-color var(--t) var(--ease);
}
.tok::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--faint); border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.tok.ok::before { background: var(--ok); }
.tok.bad::before { background: var(--warn); }
.tok.retired::before { background: var(--err); }
.tok.checking::before { background: var(--accent); }
.tok:hover { border-color: var(--line-2); background: var(--panel-3); }
.tok.retired { opacity: .85; }
.tok-top { display: flex; align-items: center; gap: 8px; }
.tok-top .tok-chk { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; margin: 0; flex: none; }
.tok-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tok-top .pill { margin-left: auto; }
.tok-meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.tok-meta .ic { width: 13px; height: 13px; }
.tok-err { font-size: 12px; color: var(--err); overflow-wrap: anywhere; }
.tok-foot { display: flex; align-items: center; gap: 8px; margin-top: 2px; font-size: 12px; flex-wrap: wrap; }
.tok-foot .btn { margin-left: auto; }
.tok-foot .btn + .btn { margin-left: 0; }

/* ─── Анализ аккаунтов ─── */
.mini-select { width: auto; padding: 6px 10px; font-size: 12px; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px 18px; margin-bottom: 4px; }
.filters .f { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); }
.filters .pair { display: flex; align-items: center; gap: 8px; }
.filters .pair input { width: 100%; padding: 8px 10px; }
.filters .unit { color: var(--faint); font-size: 12px; }
.scan-sum { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin: 14px 0 4px; font-size: 12.5px; color: var(--muted); }
.scan-sum b { color: var(--text); }
.scan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 12px; margin-top: 10px; }
.sacc {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel-2); padding: 13px 14px;
  transition: border-color var(--t) var(--ease), background-color var(--t) var(--ease);
}
.sacc:hover { border-color: var(--accent); background: var(--panel-3); }
/* вся карточка — ссылка на профиль (открыть и проверить вручную) */
.sacc-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.sacc .inner-link { position: relative; z-index: 2; }
.sacc.err { border-color: rgba(239,77,77,.3); }
.sacc.pending { opacity: .6; }
.sacc-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sacc .avatar { width: 38px; height: 38px; font-size: 14px; }
.sacc-id { min-width: 0; flex: 1; }
.sacc-name { font-weight: 650; display: flex; align-items: center; gap: 5px; min-width: 0; }
.sacc-name span.n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sacc-handle { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { width: 15px; height: 15px; flex: none; }
.badge.ver { color: #1d9bf0; }
.badge.lock { color: var(--warn); }
.sacc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 11px; }
.sacc-stats div { background: var(--bg-2); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; min-width: 0; }
.sacc-stats .k { display: block; color: var(--faint); font-size: 10.5px; }
.sacc-stats .v { display: block; font-weight: 650; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sacc-stats .v.stale { color: var(--warn); }
.sacc-stats .v.fresh { color: var(--ok); }
.sacc-err { color: var(--err); font-size: 12px; margin-top: 9px; overflow-wrap: anywhere; }
.sacc-go { position: absolute; top: 12px; right: 12px; color: var(--faint); opacity: 0; transition: opacity var(--t) var(--ease); }
.sacc:hover .sacc-go { opacity: 1; }
.sacc-go .ic { width: 14px; height: 14px; }

/* ─── Анимации списков (появление/исчезновение/подсветка) ─── */
.enter { animation: enterIn .34s var(--ease); }
@keyframes enterIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.leave { animation: leaveOut .2s ease forwards; pointer-events: none; }
@keyframes leaveOut { to { opacity: 0; transform: translateY(-6px) scale(.98); } }
.flash { animation: flashHi 1s var(--ease); }
@keyframes flashHi {
  0% { background-color: var(--accent-soft); box-shadow: 0 0 0 1px rgba(43,143,255,.4) inset; }
  100% { background-color: transparent; box-shadow: none; }
}
tr.enter { animation: rowIn .3s var(--ease); }
@keyframes rowIn { from { opacity: 0; } to { opacity: 1; } }

/* ═══════════ xxxtreblyator3000 — вид ═══════════ */
.brand-text b { font-size: 13px; letter-spacing: -.01em; line-height: 1.15; word-break: break-all; }
.brand-num { color: #bcd6ff; }

/* Кнопка-основное действие: градиент + лёгкий подъём */
.btn.primary {
  background: linear-gradient(160deg, var(--accent), var(--accent-2));
  border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(43,143,255,.28);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), filter var(--t-fast) var(--ease);
}
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 7px 20px rgba(43,143,255,.42); filter: brightness(1.05); }
.btn.primary:active { transform: translateY(0); box-shadow: 0 3px 10px rgba(43,143,255,.3); }

/* Баннер свежего поста (моложе часа) */
.fresh {
  display: flex; align-items: center; gap: 13px; margin-bottom: 16px;
  padding: 12px 14px; border-radius: var(--radius); color: var(--text); text-decoration: none;
  background: linear-gradient(100deg, var(--accent-soft), rgba(123,92,255,.08));
  border: 1px solid rgba(43,143,255,.4); animation: riseIn var(--t) var(--ease);
  transition: border-color var(--t) var(--ease);
}
.fresh:hover { border-color: var(--accent); text-decoration: none; }
.fresh-pulse { width: 9px; height: 9px; --c: var(--accent); flex: none; }
.fresh-body { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
.fresh-top { display: flex; align-items: baseline; gap: 9px; }
.fresh-name { font-size: 13.5px; font-weight: 650; }
.fresh-ago { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.fresh-text { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fresh-btn { background: transparent; border: 0; color: var(--faint); cursor: pointer; font-size: 14px; line-height: 1; padding: 4px 7px; border-radius: 6px; flex: none; }
.fresh-btn:hover { color: var(--text); background: rgba(255,255,255,.06); }
.fresh.min { padding: 8px 14px; }
.fresh.min .fresh-text { display: none; }

/* Состояние токенов на дашборде */
.tok-state { display: flex; flex-direction: column; gap: 8px; }
.tok-allok { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; padding: 6px 2px; }
.tok-allok .tick { color: var(--ok); font-weight: 700; }
.tok-empty { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 4px 2px; }
.tok-prob-head { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.tok-prob {
  display: flex; align-items: center; gap: 10px; padding: 8px 11px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2);
  transition: border-color var(--t-fast) var(--ease);
}
.tok-prob:hover { border-color: var(--line-2); }
.tok-prob > .st { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tok-prob > .st.err { background: var(--err); } .tok-prob > .st.warn { background: var(--warn); } .tok-prob > .st.busy { background: var(--accent); }
.tok-prob-id { display: flex; flex-direction: column; min-width: 0; flex: 1; font-size: 13px; font-weight: 600; }
.tok-prob-reason { font-size: 11.5px; color: var(--muted); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tok-prob-act { display: flex; gap: 6px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.tok-act { background: var(--panel-3); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 4px 11px; font-size: 11.5px; cursor: pointer; transition: border-color .15s, color .15s; }
.tok-act:hover { border-color: var(--accent); color: var(--accent); }
.tok-act.danger:hover { border-color: var(--err); color: var(--err); }
.tok-more { margin-top: 2px; }

/* ─── Адаптив ─── */
@media (max-width: 900px) {
  .sidebar { position: static; width: auto; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 10px; overflow: visible; }
  .nav { flex-direction: row; flex-wrap: wrap; flex: 1; }
  .nav-btn { width: auto; }
  .nav-glow { display: none; }
  .nav-btn.active { background: var(--accent-soft); box-shadow: inset 0 -2px 0 var(--accent); }
  .side-foot { margin: 0; }
  .grid-2 { grid-template-columns: 1fr; }
  .main { margin-left: 0; padding: 20px 16px 56px; }
  .hero { flex-direction: column; align-items: stretch; }
  .hero-side { min-width: 0; }
}
@media (max-width: 560px) {
  .metrics { grid-template-columns: repeat(2,1fr); }
  .grid-fields { grid-template-columns: 1fr; }
  .add-form { flex-direction: column; }
  .acct { grid-template-columns: 40px minmax(0,1fr); }
  .acct-actions { grid-column: 1 / -1; opacity: 1; }
  .brand-text { display: none; }
  .projects, .working { grid-template-columns: 1fr; }
  .toasts { left: 12px; right: 12px; max-width: none; }
}

/* ─── Меньше движения ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .aurora { display: none; }
}

/* ═══════════ Светящиеся индикаторы — ядро + мягкий ореол + плавное «дыхание» ═══════════ */
/* Не дешёвое жёсткое кольцо, а размытый ореол: само ядро чёткое, вокруг мягкий свет цвета статуса,
   «дыхание» — на псевдоэлементе через scale/opacity (композитится на GPU). */
.dot, .hero-dot, .fresh-pulse { position: relative; }
.status.ok .dot,   .status.warn .dot,   .status.err .dot,
.hero.ok .hero-dot, .hero.warn .hero-dot, .hero.err .hero-dot,
.fresh-pulse, .tok-prob > .st {
  border-radius: 50%; background: var(--c);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--c) 35%, transparent),
    0 0 3px 1px color-mix(in srgb, var(--c) 60%, transparent),
    0 0 10px 2px color-mix(in srgb, var(--c) 45%, transparent);
}
.status.ok .dot::after, .status.err .dot::after,
.hero.ok .hero-dot::after, .hero.err .hero-dot::after,
.fresh-pulse::after {
  content: ''; position: absolute; inset: -1px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, var(--c), transparent 68%);
  opacity: 0; animation: glowBreathe 2.8s var(--ease) infinite;
}
@keyframes glowBreathe { 0% { transform: scale(1); opacity: .5; } 70%, 100% { transform: scale(3); opacity: 0; } }
/* цвет каждого индикатора */
.status.ok .dot { --c: var(--ok); }  .status.warn .dot { --c: var(--warn); }  .status.err .dot { --c: var(--err); }
.hero.ok .hero-dot { --c: var(--ok); }  .hero.warn .hero-dot { --c: var(--warn); }  .hero.err .hero-dot { --c: var(--err); }
.fresh-pulse { --c: var(--accent); width: 9px; height: 9px; }
.tok-prob > .st.err { --c: var(--err); }  .tok-prob > .st.warn { --c: var(--warn); }  .tok-prob > .st.busy { --c: var(--accent); }

/* ─── Токены: строки списка ─── */
.tokens { display: flex; flex-direction: column; gap: 7px; }
.tok-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2);
  transition: border-color var(--t-fast) var(--ease);
}
.tok-item:hover { border-color: var(--line-2); }
.tok-item .tok-chk { flex: none; width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.tok-item > .st {
  width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--c);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 35%, transparent),
    0 0 3px 1px color-mix(in srgb, var(--c) 55%, transparent), 0 0 8px 1px color-mix(in srgb, var(--c) 35%, transparent);
}
.tok-main { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
.tok-h { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; }
.tok-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tok-proxy { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); flex: none; max-width: 175px; overflow: hidden; white-space: nowrap; }
.tok-proxy .ic { width: 13px; height: 13px; opacity: .7; }
.tok-acts { display: flex; gap: 6px; flex: none; }
@media (max-width: 760px) { .tok-proxy { display: none; } }

/* ─── Проекты ─── */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-top: 14px; }
.project { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); padding: 12px 13px; display: flex; flex-direction: column; gap: 10px; animation: riseIn var(--t) var(--ease); }
.project-top { display: flex; align-items: center; gap: 10px; }
.project-name { font-size: 14px; font-weight: 650; cursor: pointer; flex: 1; min-width: 0; }
.project-name:hover { color: var(--accent); }
.project-auto { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); cursor: pointer; flex: none; }
.project-auto input { accent-color: var(--accent); }
.project-sec { display: flex; flex-direction: column; gap: 6px; }
.project-label { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.project-chips, .project-arts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pchip { display: inline-flex; align-items: center; gap: 5px; background: var(--panel-3); border: 1px solid var(--line); border-radius: 999px; padding: 3px 6px 3px 10px; font-size: 12px; color: var(--text); }
.pchip button { background: transparent; border: 0; color: var(--faint); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
.pchip button:hover { color: var(--err); }
.pchip.add { cursor: pointer; padding: 3px 10px; color: var(--muted); border-style: dashed; }
.pchip.add:hover { color: var(--accent); border-color: var(--accent); }
.particle { display: flex; align-items: center; gap: 7px; width: 100%; font-size: 12px; padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-3); }
.particle.active { border-color: var(--accent); background: var(--accent-soft); }
.particle a { color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.particle .rm { background: transparent; border: 0; color: var(--faint); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; flex: none; }
.particle .rm:hover { color: var(--err); }
.pradio { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); background: transparent; cursor: pointer; flex: none; padding: 0; }
.particle.active .pradio { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 45%, transparent 50%); }

/* ─── Очередь промо ─── */
#pqueue-list { display: flex; flex-direction: column; gap: 7px; }
.pq-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); }
.pq-main { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; font-size: 13px; flex-wrap: wrap; }
.pq-main b { font-weight: 650; }
.pq-sub { color: var(--muted); font-size: 11.5px; }
.pq-act { display: flex; gap: 6px; align-items: center; flex: none; }

/* ─── Проекты: сетка карточек (аккаунт-цель + Article + комментаторы) ─── */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.proj {
  display: flex; flex-direction: column; gap: 11px; padding: 14px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease); animation: riseIn var(--t) var(--ease);
}
.proj:hover { border-color: var(--line-2); box-shadow: var(--shadow-hi); }
.proj.auto-on { border-left: 2px solid var(--accent); }
.proj.paused { opacity: .72; }
.proj-head { display: flex; align-items: center; gap: 10px; }
.proj-head .avatar, .proj-head img { width: 38px; height: 38px; border-radius: 50%; flex: none; }
.proj-id { min-width: 0; flex: 1; }
.proj-name { display: flex; align-items: center; gap: 7px; font-size: 14.5px; font-weight: 650; }
.proj-name .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-handle { font-size: 12px; color: var(--muted); }
.proj-auto { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); cursor: pointer; flex: none; }
.proj-auto input { accent-color: var(--accent); }
.proj-last { font-size: 12px; color: var(--muted); line-height: 1.45; max-height: 36px; overflow: hidden; }
.proj-sec { display: flex; flex-direction: column; gap: 7px; }
.proj-label { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.proj-label b { color: var(--accent); }
.proj-arts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.proj-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 2px; padding-top: 10px; border-top: 1px solid var(--line); }
.proj-meta { font-size: 11px; color: var(--faint); }
.proj-actions { display: flex; gap: 6px; flex: none; }
.proj [data-comm] { align-self: flex-start; }

/* ─── Модалка выбора комментаторов ─── */
.overlay { position: fixed; inset: 0; z-index: 150; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(6,8,11,.72); animation: fadeIn .18s ease; }
.modal { width: min(540px, 100%); max-height: 82vh; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-hi); animation: riseIn var(--t) var(--ease); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--line); font-size: 15px; }
.modal-x { background: transparent; border: 0; color: var(--faint); cursor: pointer; font-size: 16px; }
.modal-x:hover { color: var(--text); }
.modal-body { padding: 14px 18px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; border-top: 1px solid var(--line); }
.cm-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.cm-item { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 13px; cursor: pointer; }
.cm-item:hover { border-color: var(--line-2); }
.cm-item input { accent-color: var(--accent); }
.cm-item .st { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.cm-item .st.live { background: var(--ok); }
.cm-item .cm-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
