/* ── Каркас «как у агентов» (макет .lavish/agent-runs-review-20261030, решение
   владельца 30.10.2026) ─────────────────────────────────────────────────────
   Слева спокойная панель: сервисы HolyCode и кнопка панели, знак и версия,
   карточка поста с прежней выпадашкой машин, «Новый разговор» и «Поиск»,
   разделы, списки разговоров и заданий Daenerys, внизу вы и состояние раннера.
   Над работой тонкая шапка-путь. Палитра — нейтральный графит, фиолетовый и
   голубой остаются акцентами. На телефоне (< 768 px) панели нет: общая полоса
   сверху и нижняя панель, как было. Палитры HolyCode (switcher/palettes.js)
   перекрашивают тёмные поверхности по яркости, графит под них ложится. */

:root {
  --bg-primary: #0f0f11;
  --bg-surface: #161618;
  --bg-card: #1d1d20;
  --bg-card-hover: #26262b;
  --border-color: #2a2a2f;
  --text-primary: #ececef;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --shell-sidebar: #18181b;
  --shell-hover: #222226;
  --shell-active: #27272c;
  --shell-pop: #1f1f23;
  --shell-pop-border: #34343a;
}

/* ── Общая полоса сверху — только на телефоне ───────────────────────────── */
@media (min-width: 768px) {
  .hcs-bar.app-shell-topbar { display: none; }
}

/* ── Боковая панель ─────────────────────────────────────────────────────── */
.app-sidebar.app-sidebar-shell {
  padding: 10px 10px 10px;
  gap: 1px;
  background: var(--shell-sidebar);
  border-right: 1px solid var(--border-color);
  font-size: 13.5px;
  overflow: visible;
}

.app-body-sidebar-collapsed .app-sidebar.app-sidebar-shell {
  padding: 10px 8px 10px;
  align-items: center;
}

.shell-top {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  margin: 0 2px 8px;
  color: var(--text-muted);
}

.app-body-sidebar-collapsed .shell-top {
  flex-direction: column;
  height: auto;
  margin: 0 0 6px;
}

.shell-top .hcs { flex: none; }
#root .shell-top .hcs .hcs-trigger {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border-color: transparent;
  background: transparent;
  color: var(--text-secondary);
}
#root .shell-top .hcs .hcs-trigger:hover,
#root .shell-top .hcs .hcs-trigger[aria-expanded='true'] {
  background: var(--shell-active);
  color: var(--text-primary);
}

/* Выпадашка сервисов в графите каркаса (макет agent-runs-review: svcpop
   #1f1f23, рамка #34343a, плитки #19191d, текущая — фиолетовая рамка на
   #1f1a33). Сам switcher/ общий для всех сервисов — красим его переменными
   отсюда, а не правкой switcher.css. */
#root .shell-top .hcs {
  --hcs-bg: var(--shell-pop, #1f1f23);
  --hcs-border: var(--shell-pop-border, #34343a);
  --hcs-divider: #2c2c32;
  --hcs-text: var(--text-primary, #ececef);
  --hcs-muted: var(--text-muted, #71717a);
  --hcs-accent: #6d4fd6;
  --hcs-accent-soft: #1f1a33;
  --hcs-accent-text: var(--shell-lilac, #c4b5fd);
  --hcs-tile: #19191d;
  --hcs-tile-border: #2c2c32;
  --hcs-tile-icon: #26262c;
  --hcs-hover: #232328;
  --hcs-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  --hcs-ring: rgba(196, 181, 253, 0.45);
}

/* Меню аккаунта у плашки внизу панели — тот же графит, что у выпадашки
   поста: строки #2a2a30 на наведении, без фиолетовой заливки. */
#root .shell-me .hca {
  --hca-bg: var(--shell-pop, #1f1f23);
  --hca-border: var(--shell-pop-border, #34343a);
  --hca-divider: #2c2c32;
  --hca-text: var(--text-primary, #ececef);
  --hca-muted: var(--text-muted, #71717a);
  --hca-icon: var(--text-secondary, #a1a1aa);
  --hca-hover: #2a2a30;
  --hca-seg-border: #2c2c32;
  --hca-seg-hover: rgba(255, 255, 255, 0.05);
  --hca-seg-on-bg: #2a2a30;
  --hca-seg-on-fg: var(--text-primary, #ececef);
  --hca-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  --hca-ring: rgba(196, 181, 253, 0.45);
  --hca-avatar-ring: #34343a;
  --hca-chip-fg: var(--text-secondary, #a1a1aa);
  --hca-chip-bg: #26262c;
  --hca-chip-border: #34343a;
  --hca-input-bg: #18181b;
  --hca-input-border: #34343a;
}

/* Счётчик у пункта панели (макет: моно 11 px справа; жёлтый — ждёт вас,
   красный — сбой, серый — просто число). */
.shell-it-count {
  margin-left: auto;
  padding-left: 6px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--text-muted);
  flex: none;
}
.shell-it-count-warn { color: #facc15; }
.shell-it-count-bad { color: #f87171; }

.shell-iconbtn {
  width: 30px;
  height: 30px;
  flex: none;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.shell-iconbtn:hover { background: var(--shell-active); color: var(--text-primary); }
.shell-iconbtn:disabled { opacity: 0.35; cursor: default; background: transparent; }
.shell-iconbtn svg { display: block; }

.shell-nav2 { display: flex; gap: 2px; margin-left: auto; }
.shell-nav2 .shell-iconbtn { width: 26px; height: 26px; }
.app-body-sidebar-collapsed .shell-nav2 { display: none; }

.shell-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 2px 6px 10px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
  min-width: 0;
}
.shell-brand-logo { width: 22px; height: 22px; border-radius: 6px; flex: none; }
.shell-brand-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.shell-brand-ver {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}
.app-body-sidebar-collapsed .shell-brand { padding: 0 0 8px; justify-content: center; }
.app-body-sidebar-collapsed .shell-brand-name,
.app-body-sidebar-collapsed .shell-brand-ver { display: none; }

/* Карточка поста: та же выпадашка, что в шапке «Поста», в оформлении панели. */
.post-switch-side { margin: 2px 0 8px; }
.post-switch-side .post-switch-btn {
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: 'name chev' 'sub chev' 'note chev';
  row-gap: 3px;
  padding: 8px 10px;
  border: 1px solid #2f4b63;
  border-radius: 12px;
  background: linear-gradient(180deg, #132232, #111a26);
}
.post-switch-side .post-switch-btn:hover,
.post-switch-side .post-switch-btn[aria-expanded='true'] { border-color: #3d6585; background: linear-gradient(180deg, #16283a, #13202e); }
.post-switch-side .post-brand-name { font-size: 9.5px; letter-spacing: 0.18em; color: #7dd3fc; }
.post-switch-side .post-switch-sub { font-size: 13.5px; font-weight: 600; color: var(--text-primary); gap: 4px 6px; flex-wrap: wrap; }
.post-switch-side .post-switch-machine { min-width: 5ch; flex: 1 1 100%; }
.post-switch-side .post-loc,
.post-switch-side .post-mode {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid #2f5f86;
  color: #7dd3fc;
  background: transparent;
}
.post-switch-side .post-switch-note {
  grid-area: note;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.post-switch-side .post-switch-chevron { color: var(--text-muted); }
.post-switch-side .post-switch-menu {
  left: 0;
  right: auto;
  width: 330px;
  background: var(--shell-pop);
  border-color: var(--shell-pop-border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}
.post-switch-side .post-switch-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 9px 14px;
  border: 0;
  border-top: 1px solid var(--shell-pop-border);
  background: transparent;
  color: #c4b5fd;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}
.post-switch-side .post-switch-foot:hover { background: var(--shell-hover); }
.post-switch-foot svg:last-child { margin-left: auto; }

/* Пока «Пост» не прислал машины: карточка-ожидание с той же геометрией. */
.post-switch-side-wait {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  row-gap: 3px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #2f4b63;
  border-radius: 12px;
  background: linear-gradient(180deg, #132232, #111a26);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.post-switch-side-wait .post-brand-name { font-size: 9.5px; letter-spacing: 0.18em; color: #7dd3fc; grid-column: 1; }
.post-switch-side-wait b { font-size: 13.5px; font-weight: 600; grid-column: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-switch-side-wait small { font-size: 11px; color: var(--text-muted); grid-column: 1; }
.post-switch-side-wait > svg { grid-column: 2; grid-row: 1 / span 3; align-self: center; color: var(--text-muted); }

/* Свёрнутая рельса: пост — значок места с точкой состояния. */
.app-body-sidebar-collapsed .post-switch-side { width: 44px; margin: 0 0 8px; }
.app-body-sidebar-collapsed .post-switch-side .post-switch-btn {
  grid-template-columns: 1fr;
  grid-template-areas: 'sub';
  padding: 8px 0;
  justify-items: center;
}
.app-body-sidebar-collapsed .post-switch-side .post-brand-name,
.app-body-sidebar-collapsed .post-switch-side .post-switch-note,
.app-body-sidebar-collapsed .post-switch-side .post-switch-chevron,
.app-body-sidebar-collapsed .post-switch-side .post-switch-machine,
.app-body-sidebar-collapsed .post-switch-side .post-mode { display: none; }
.app-body-sidebar-collapsed .post-switch-side .post-loc {
  font-size: 0;
  padding: 0;
  border: 0;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: #7dd3fc;
}
.app-body-sidebar-collapsed .post-switch-side .post-loc svg { width: 18px; height: 18px; }
.app-body-sidebar-collapsed .post-switch-side .post-switch-menu { left: 52px; top: 0; }
.app-body-sidebar-collapsed .post-switch-side-wait { width: 44px; grid-template-columns: 1fr; justify-items: center; padding: 8px 0; }
.app-body-sidebar-collapsed .post-switch-side-wait .post-brand-name,
.app-body-sidebar-collapsed .post-switch-side-wait b,
.app-body-sidebar-collapsed .post-switch-side-wait small { display: none; }
.app-body-sidebar-collapsed .post-switch-side-wait > svg { grid-column: 1; grid-row: 1; color: #7dd3fc; }

/* «Новый разговор», «Поиск» и пункты разделов — одна высота и одно поле. */
.shell-it {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}
.shell-it:hover { background: var(--shell-hover); }
.shell-it svg { color: var(--text-secondary); flex: none; }
.shell-it > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shell-it-key {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  flex: none;
}
.app-body-sidebar-collapsed .shell-it { width: 40px; height: 36px; justify-content: center; padding: 0; }
.app-body-sidebar-collapsed .shell-it > span,
.app-body-sidebar-collapsed .shell-it-key { display: none; }

.app-sidebar-shell .app-sidebar-nav {
  flex: 0 0 auto;
  gap: 1px;
  overflow: visible;
  padding-right: 0;
}
.app-sidebar-shell .sidebar-tab {
  padding: 6px 8px;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13.5px;
  transition: background 0.12s ease;
}
.app-sidebar-shell .sidebar-tab:hover { background: var(--shell-hover); color: var(--text-primary); }
.app-sidebar-shell .sidebar-tab.active {
  background: var(--shell-active);
  color: var(--text-primary);
  box-shadow: none;
}
.app-sidebar-shell .sidebar-tab-icon { width: 18px; flex-basis: 18px; color: var(--text-secondary); }
.app-sidebar-shell .sidebar-tab.active .sidebar-tab-icon { color: var(--text-primary); }
.app-sidebar-shell .sidebar-tab-badge {
  margin-left: auto;
  padding: 0;
  background: transparent;
  color: #facc15;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  box-shadow: none;
}
.app-sidebar-shell .sidebar-tab-chevron { color: var(--text-muted); }
.app-sidebar-shell .sidebar-tab-settings-child { padding-left: 34px; color: var(--text-secondary); }
.app-sidebar-shell .sidebar-tab-settings-child.active { color: var(--text-primary); }
.app-sidebar-shell .sidebar-settings-divider {
  padding: 10px 8px 2px 34px;
  font-size: 11px;
  color: var(--text-muted);
}
.app-body-sidebar-collapsed .app-sidebar-shell .sidebar-tab { width: 40px; height: 36px; justify-content: center; padding: 0; }
.app-body-sidebar-collapsed .app-sidebar-shell .sidebar-tab-badge { display: none; }

/* Разделы со списками: «Разговоры», «Задания Daenerys». */
.shell-lists {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  margin: 0 -4px;
  padding: 0 4px;
  scrollbar-width: thin;
}
.app-body-sidebar-collapsed .shell-lists { display: none; }
.shell-sec {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 8px 4px;
  font-size: 12px;
  color: var(--text-muted);
}
.shell-sec > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shell-sec small { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.shell-sec .shell-iconbtn { width: 22px; height: 22px; }
.shell-row {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 5px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}
.shell-row:hover { background: var(--shell-hover); color: var(--text-primary); }
.shell-row-on { background: var(--shell-active); color: var(--text-primary); }
.shell-row-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #475569;
  flex: none;
}
.shell-row-dot-ok { background: var(--accent-green); }
.shell-row-dot-work { background: var(--accent-yellow); animation: shell-pulse 1.4s ease-in-out infinite; }
.shell-row-dot-bad { background: var(--accent-red); }
.shell-row-dot-warn { background: var(--accent-orange); }
.shell-row-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shell-row-sm { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); white-space: nowrap; flex: none; }
.shell-empty { padding: 4px 8px 2px; font-size: 12px; color: var(--text-muted); }
@keyframes shell-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* Внизу: вы и состояние раннера. Плашка аккаунта — общая (switcher/account.css). */
.shell-me {
  margin-top: auto;
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
  min-width: 0;
}
.shell-me .sidebar-profile { flex: 1; min-width: 0; margin: 0; padding: 0; border: 0; }
#root .shell-me .hca-plaque { padding: 6px 6px; border-radius: 8px; }
#root .shell-me .hca-plaque:hover { background: var(--shell-hover); }
.shell-me-status {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 6px 4px;
}
.shell-me-status .shell-row-dot { display: inline-block; margin-right: 5px; vertical-align: 1px; }
.app-body-sidebar-collapsed .shell-me { flex-direction: column; padding-top: 6px; }
.app-body-sidebar-collapsed .shell-me-status { display: none; }
.app-body-sidebar-collapsed .shell-me .shell-iconbtn { width: 40px; }
.shell-me-foot { display: flex; flex-direction: column; min-width: 0; }
.app-body-sidebar-collapsed .shell-me-foot { align-items: center; }

/* ── Сцена: шапка-путь над работой ──────────────────────────────────────── */
.app-stage {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}
.app-stage > .app-main { flex: 1 1 auto; }

.shell-pathbar {
  height: 48px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px 0 18px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-primary);
  min-width: 0;
}
.shell-path {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.shell-path-sep,
.shell-path-dim { color: var(--text-muted); font-weight: 500; }
.shell-pathbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.shell-pathbar-right .hstatus-panel { left: auto; right: 0; }
/* Переключатель контура «Все · Россия · США» (общий ContourSwitch, .hcs-contour
   в switcher.css, 19.11.2026) в шапке-пути — графитом, как в Daenerys. */
.shell-pathbar .hcs-contour {
  --hcs-contour-border: var(--border-color);
  --hcs-contour-text: var(--text-secondary);
  --hcs-contour-hover: var(--shell-hover);
  --hcs-contour-on: #2a1f55;
  --hcs-contour-on-text: var(--text-primary);
  margin-right: 6px;
  padding: 3px;
  background: transparent;
}
.shell-pathbar-right .sidebar-update-chip { width: 30px; height: 30px; }
/* Окно обновления у кнопки в шапке открывается вниз и к правому краю: по
   умолчанию оно растёт вверх от плашки аккаунта внизу панели, а из шапки
   наверху окна уходило за край экрана — «модалка скачивания не открывается»
   (31.10.2026). Так же, как в старой верхней полосе .hcs-bar. */
.shell-pathbar-right .sidebar-update-pop {
  top: calc(100% + 0.45rem);
  bottom: auto;
  left: auto;
  right: 0;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
}
@media (max-width: 767.98px) {
  .shell-pathbar { display: none; }
}

/* Шапка «Поста»: карточка поста теперь в боковой панели — на широком
   экране ячейка «Пост» в телеметрии не повторяется, на телефоне остаётся. */
@media (min-width: 768px) {
  .post-hud .post-cell-post { display: none; }
}

/* Графит вместо фиолетовых градиентов там, где каркас виден всегда. */
.post-hud { background: var(--bg-surface); }
#root .hcs-bar { --hcs-bar-bg: var(--shell-sidebar); }

/* ── Экран «Посты» ──────────────────────────────────────────────────────── */
.posts-panel { display: flex; flex-direction: column; gap: 14px; }
.posts-head { display: flex; flex-direction: column; gap: 4px; }
.posts-title { display: flex; align-items: baseline; gap: 10px; }
.posts-title h2 { margin: 0; font-size: 20px; }
.posts-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 8px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
}
.posts-lead { margin: 0; color: var(--text-secondary); font-size: 13.5px; max-width: 720px; }
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.posts-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--bg-surface);
  min-width: 0;
}
.posts-card-current { border-color: #3d6585; }
.posts-card-busy { border-color: rgba(234, 179, 8, 0.4); }
.posts-card-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.posts-card-glyph {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--bg-card);
  color: var(--text-secondary);
  flex: none;
}
.posts-card-name { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.posts-card-name b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.posts-card-name small { font-size: 11.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.posts-card-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  font-size: 11.5px;
  color: var(--text-secondary);
  padding: 2px 8px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  white-space: nowrap;
}
.posts-card-state i { width: 7px; height: 7px; border-radius: 50%; background: #475569; }
.posts-card-state-on i { background: var(--accent-green); }
.posts-card-state-busy i { background: var(--accent-yellow); animation: shell-pulse 1.4s ease-in-out infinite; }
.posts-card-state-none i { border: 1.5px dashed #64748b; background: transparent; }
.posts-card-foot { display: flex; align-items: center; gap: 10px; min-width: 0; }
.posts-card-group { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.posts-card-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-card);
  color: #c4b5fd;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.posts-card-action:hover { background: var(--bg-card-hover); border-color: #3a3a42; }
.posts-card-action:disabled { opacity: 0.6; cursor: default; }
.posts-card-msg { margin: 8px 0 0; font-size: 12px; line-height: 1.35; color: #fcd34d; }
.posts-card-msg-error { color: #fca5a5; }
.posts-empty {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  padding: 18px;
  border: 1px dashed var(--border-color);
  border-radius: 14px;
  color: var(--text-secondary);
}
.posts-empty p { margin: 0; }

/* ── Поиск (⌘K) ─────────────────────────────────────────────────────────── */
.palette-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
}
.palette {
  width: min(560px, 100%);
  background: var(--shell-pop);
  border: 1px solid var(--shell-pop-border);
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 70vh;
}
.palette-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--shell-pop-border);
  color: var(--text-muted);
}
.palette-input input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 15px;
  outline: none;
}
.palette-input input::placeholder { color: var(--text-muted); }
.palette-list { overflow-y: auto; padding: 6px; }
.palette-section { padding: 8px 10px 4px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.palette-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}
.palette-item-on { background: var(--shell-active); }
.palette-item-icon { display: inline-flex; color: var(--text-secondary); flex: none; }
.palette-item-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-item-hint { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; flex: none; }
.palette-empty { padding: 18px; text-align: center; color: var(--text-muted); font-size: 13px; }
.palette-foot { padding: 6px 14px 8px; border-top: 1px solid var(--shell-pop-border); font-size: 11px; color: var(--text-muted); }

/* Знак в панели — кнопка на «Пост». */
.shell-brand { width: 100%; border: 0; background: transparent; cursor: pointer; text-align: left; font: inherit; font-weight: 700; }
.shell-brand:hover .shell-brand-name { color: #fff; }
.post-switch-menu-foot { margin-top: 4px; }

/* ── Вход, PIN и код устройства — в графите каркаса ──────────────────────
   Замечание владельца 30.10.2026: карточки входа остались фиолетовыми (градиент
   главной кнопки, сиреневая вторая, фиолетовый логотип). Фиолетовый — только
   плоская главная кнопка и кольцо фокуса. */
.auth-shell { background: var(--bg-primary); }
.auth-shell .auth-card,
.auth-shell .auth-card:hover {
  background: var(--bg-surface);
  border-color: var(--border-color);
  border-radius: 14px;
  box-shadow: none;
}
.auth-shell .app-logo { color: var(--text-primary); font-weight: 700; letter-spacing: -0.01em; }
.auth-shell .card-title { color: var(--text-primary); font-size: 1.05rem; }
.auth-shell .card-subtitle { color: var(--text-secondary); }
.auth-shell .form-label { color: var(--text-secondary); }
.auth-shell .form-input,
.auth-shell .form-select {
  background: var(--bg-primary);
  border-color: var(--border-color);
  border-radius: 10px;
}
.auth-shell .form-input:hover,
.auth-shell .form-select:hover { border-color: var(--shell-pop-border); }
.auth-shell .form-input:focus,
.auth-shell .form-input:focus-visible,
.auth-shell .form-select:focus,
.auth-shell .form-select:focus-visible {
  border-color: var(--btn-purple-fill);
  box-shadow: 0 0 0 2px rgba(148, 101, 255, 0.18);
}
.auth-shell .btn { border-radius: 10px; box-shadow: none; }
.auth-shell .btn-primary {
  background: var(--btn-purple-fill);
  border-color: var(--btn-purple-fill);
  color: #fff;
  box-shadow: none;
}
.auth-shell .btn-primary:hover { background: #a37bff; border-color: #a37bff; box-shadow: none; }
.auth-shell .btn-primary:active { background: #8457f0; border-color: #8457f0; box-shadow: none; }
.auth-shell .btn-secondary {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-primary);
  box-shadow: none;
}
.auth-shell .btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--shell-pop-border);
  color: #fff;
  box-shadow: none;
}
.auth-shell .btn-secondary:active { background: var(--shell-active); box-shadow: none; }
.auth-shell .auth-error { color: #fecaca; }

/* ── Экран «Разговоры» в каркасе (макет .lavish/agent-runs-review-20261030,
   замечание владельца 30.10.2026: «блок не вписывается по дизайну») ─────────
   Каналы — чипы, а не плитки; чаты — сплошной список строк с аватаром, без
   карточек и зазоров; лента, шапка и композер на графите без синевы и
   градиентов. Список чатов и чипы каналов привязаны к корню .comms-shell;
   лента, шапка и композер — к корню .chat-graphite, который стоит и на
   «Разговорах», и на чате «Поста» (31.10.2026). Те же классы .agent-chat-*
   рисуют мастер настройки, его вид не меняется. Фиолетовый здесь — только
   кнопка отправки и своё сообщение. */

.comms-shell {
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* Ряд каналов: чипы; «Подключения» — призрачная кнопка справа. */
.comms-shell .comms-tabs {
  gap: 6px;
  padding: 12px 16px 0;
  border-bottom: none;
  background: transparent;
}

@media (min-width: 768px) {
  .comms-shell .comms-tabs {
    flex-wrap: wrap;
    overflow: visible;
  }

  /* Чипам хватает места, а не хватит — ряд переносится: подпись
     «Подключений» больше не прячется в значок. */
  .comms-shell .comms-tab-settings .comms-tab-label {
    display: inline;
  }
}

.comms-shell .comms-tab {
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
}

.comms-shell .comms-tab-icon,
.comms-shell .comms-tab:hover .comms-tab-icon {
  color: var(--text-muted);
}

.comms-shell .comms-tab-icon svg {
  display: block;
  width: 14px;
  height: 14px;
}

.comms-shell .comms-tab:hover {
  background: var(--shell-hover);
  color: var(--text-primary);
}

.comms-shell .comms-tab-active,
.comms-shell .comms-tab-active:hover {
  background: var(--shell-active);
  color: var(--text-primary);
}

.comms-shell .comms-tab-active .comms-tab-icon {
  color: var(--text-primary);
}

/* Счётчик — моноширинная цифра в чипе: непрочитанные красные, черновики,
   ждущие решения, — приглушённые. */
.comms-shell .comms-tab-badge {
  min-width: 0;
  padding: 0;
  border-radius: 0;
  background: none;
  color: #f87171;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
}

.comms-shell .comms-tab-badge-wait {
  background: none;
  color: var(--text-muted);
}

.comms-shell .comms-tab-settings {
  margin-left: auto;
  padding: 0 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 12.5px;
}

.comms-shell .comms-body {
  margin-top: 10px;
  border-top: 1px solid var(--border-color);
}

/* Обе колонки — на фоне экрана, между ними одна линия. */
.chat-graphite .agent-chat-shell,
.chat-graphite .agent-chat-room-sidebar,
.chat-graphite .agent-chat-room-pane,
.chat-graphite .agent-chat-room-aside {
  background: var(--bg-primary);
}

/* ── Список чатов ── */
.comms-shell .agent-chat-room-sidebar {
  gap: 0;
  padding: 10px 8px;
  border-right: 1px solid var(--border-color);
}

/* Поиск над списком, под ним заголовок группы. */
.comms-shell .agent-chat-room-search-wrap {
  order: -1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 2px 8px;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 9px;
  background: var(--bg-primary);
  color: var(--text-muted);
}

.comms-shell .agent-chat-room-search-wrap:focus-within {
  border-color: #3a3a42;
}

.comms-shell .agent-chat-room-search-icon {
  display: inline-flex;
  flex: none;
  color: var(--text-muted);
}

.comms-shell .agent-chat-room-search-icon svg {
  display: block;
}

.comms-shell .agent-chat-room-search,
.comms-shell .agent-chat-room-search:focus {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 18px;
}

.comms-shell .agent-chat-room-search::placeholder {
  color: var(--text-muted);
}

.comms-shell .agent-chat-room-sidebar-head {
  min-height: 0;
  gap: 6px;
  padding: 6px 10px 4px;
}

.comms-shell .agent-chat-room-sidebar-title-row {
  flex: 1 1 auto;
  gap: 6px;
}

.comms-shell .agent-chat-room-section-label {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.comms-shell .agent-chat-room-count {
  min-width: 0;
  height: auto;
  margin-left: auto;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
}

.comms-shell .agent-chat-room-create {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
}

.comms-shell .agent-chat-room-create:hover {
  background: var(--shell-hover);
  color: var(--text-primary);
}

.comms-shell .agent-chat-room-create svg {
  width: 14px;
  height: 14px;
}

/* Быстрые фильтры «Все»: те же чипы, что в ряду каналов, только мельче. */
.comms-shell .agent-chat-room-filters {
  gap: 4px;
  margin: 0 2px 6px;
}

.comms-shell .agent-chat-room-filter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 8px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 400;
}

.comms-shell .agent-chat-room-filter:hover {
  background: var(--shell-hover);
  color: var(--text-primary);
}

.comms-shell .agent-chat-room-filter-on,
.comms-shell .agent-chat-room-filter-on:hover {
  background: var(--shell-active);
  color: var(--text-primary);
}

.comms-shell .agent-chat-room-filter-count {
  padding: 0;
  background: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
}

.comms-shell .agent-chat-room-sidebar-scroll {
  padding-right: 0;
}

.comms-shell .agent-chat-thread-list,
.comms-shell .agent-chat-thread-list-simple {
  gap: 0;
}

.comms-shell .agent-chat-thread-group > .agent-chat-thread-item + .agent-chat-thread-item {
  margin-top: 0;
}

.comms-shell .agent-chat-thread-group + .agent-chat-thread-group {
  margin-top: 8px;
  padding-top: 0;
  border-top: none;
}

.comms-shell .agent-chat-thread-group-head {
  padding: 6px 10px 4px;
}

.comms-shell .agent-chat-thread-empty {
  padding: 8px 10px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
}

/* Строка чата: аватар · имя и время · превью и непрочитанные. */
.comms-shell .agent-chat-thread-list-simple .agent-chat-thread-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  column-gap: 10px;
  row-gap: 1px;
  align-items: center;
  min-width: 0;
  padding: 7px 10px;
  border: none;
  border-radius: 9px;
  background: transparent;
  box-shadow: none;
  transform: none;
  transition: background 0.12s ease;
  color: var(--text-primary);
}

.comms-shell .agent-chat-thread-list-simple .agent-chat-thread-item:hover {
  border: none;
  background: var(--shell-hover);
  transform: none;
}

.comms-shell .agent-chat-thread-list-simple .agent-chat-thread-item-active,
.comms-shell .agent-chat-thread-list-simple .agent-chat-thread-item-active:hover {
  border: none;
  background: var(--shell-active);
  box-shadow: none;
}

.comms-shell .agent-chat-thread-item > * {
  grid-column: 2 / 4;
  min-width: 0;
}

.comms-shell .agent-chat-thread-item .agent-chat-thread-head,
.comms-shell .agent-chat-thread-item .agent-chat-thread-time {
  display: contents;
}

.comms-shell .agent-chat-thread-avatar {
  position: relative;
  grid-column: 1;
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #2a2a30;
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1;
}

.comms-shell .agent-chat-thread-avatar-group {
  border-radius: 10px;
}

.comms-shell .agent-chat-thread-avatar-channel {
  position: absolute;
  right: -3px;
  bottom: -3px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--shell-sidebar);
  color: var(--text-secondary);
}

.comms-shell .agent-chat-thread-avatar-channel svg {
  display: block;
}

.comms-shell .agent-chat-thread-list-simple .agent-chat-thread-title {
  grid-column: 2;
  grid-row: 1;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
}

/* Значок строки («#» у чата с агентом) стоит в аватаре, в имени он лишний. */
.comms-shell .agent-chat-thread-title .agent-chat-thread-icon {
  display: none;
}

.comms-shell .agent-chat-thread-time-text {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  white-space: nowrap;
}

.comms-shell .agent-chat-thread-unread {
  grid-column: 3;
  grid-row: 2;
  justify-self: end;
  min-width: 0;
  height: auto;
  margin: 0;
  padding: 0 6px;
  border-radius: 999px;
  background: #eab308;
  color: #0b0b0e;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 16px;
}

.comms-shell .agent-chat-thread-list-simple .agent-chat-thread-preview {
  grid-column: 2 / 4;
  grid-row: 2;
  display: block;
  margin: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
  -webkit-line-clamp: unset;
}

.comms-shell .agent-chat-thread-item:has(.agent-chat-thread-unread) .agent-chat-thread-preview {
  grid-column: 2;
}

/* Режим и канал разговора («авто», «владелец», TG) — мелкой строкой под
   превью, без рамок. */
.comms-shell .agent-chat-thread-list-simple .agent-chat-thread-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}

.comms-shell .agent-chat-thread-chips {
  gap: 4px;
  margin: 0;
}

.comms-shell .agent-chat-thread-chip {
  padding: 0 6px;
  border: none;
  border-radius: 999px;
  background: var(--shell-hover);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 16px;
}

.comms-shell .agent-chat-thread-chip-live {
  background: rgba(34, 197, 94, 0.08);
  color: #4ade80;
}

.comms-shell .agent-chat-room-sidebar-footer {
  padding: 8px 10px 0;
}

.comms-shell .agent-chat-room-footer-copy {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

/* ── Шапка разговора ── */
.chat-graphite .agent-chat-room-pane-head {
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-color);
  background: transparent;
}

.chat-graphite .agent-chat-room-pane-title-row {
  gap: 12px;
}

.chat-graphite .agent-chat-room-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 15px;
}

.chat-graphite .agent-chat-room-pane-title {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.chat-graphite .agent-chat-room-pane-subtitle {
  margin-top: 1px;
  color: var(--text-muted);
  font-size: 12px;
}

.chat-graphite .agent-chat-room-pane-statuses {
  gap: 6px;
  margin-top: 0;
}

/* На широком экране пилюля состояния уходит вправо, к кнопкам, и стоит по
   центру шапки, а не на строке имени. */
@media (min-width: 768px) {
  .chat-graphite .agent-chat-room-pane-heading {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 12px;
    align-items: center;
  }

  .chat-graphite .agent-chat-room-pane-title-line {
    display: contents;
  }

  .chat-graphite .agent-chat-room-pane-title-line > .agent-chat-room-pane-title {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .chat-graphite .agent-chat-room-pane-title-line > .agent-chat-room-pane-statuses {
    grid-column: 2;
    grid-row: 1 / 3;
    justify-content: flex-end;
  }

  .chat-graphite .agent-chat-room-pane-heading > .agent-chat-room-pane-subtitle {
    grid-column: 1;
    grid-row: 2;
  }
}

.chat-graphite .agent-chat-room-context-pill {
  gap: 6px;
  padding: 2px 9px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 16px;
  white-space: nowrap;
}

.chat-graphite .agent-chat-room-context-pill-live {
  border-color: #1f5f3a;
  background: rgba(34, 197, 94, 0.08);
  color: #4ade80;
}

.chat-graphite .agent-chat-room-context-pill-live::before {
  content: '';
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
}

.chat-graphite .agent-chat-room-context-pill-error {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
}

.chat-graphite .agent-chat-room-context-pill-warn {
  border-color: rgba(234, 179, 8, 0.45);
  background: rgba(234, 179, 8, 0.08);
  color: #facc15;
}

.chat-graphite button.agent-chat-room-context-pill-link:hover {
  background: var(--shell-hover);
  color: var(--text-primary);
}

/* Кнопки — призрачные: рамка, без заливки. */
.chat-graphite .agent-chat-room-pane-actions {
  gap: 6px;
}

.chat-graphite .agent-chat-room-action,
.chat-graphite .agent-chat-room-pane-actions .agent-chat-room-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.chat-graphite .agent-chat-room-action svg {
  display: block;
  flex: none;
}

.chat-graphite .agent-chat-room-icon-button,
.chat-graphite .agent-chat-room-pane-actions .agent-chat-room-icon-button {
  width: 34px;
  height: 30px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
}

.chat-graphite .agent-chat-room-action:hover:not(:disabled),
.chat-graphite .agent-chat-room-icon-button:hover:not(:disabled) {
  border-color: var(--border-color);
  background: var(--shell-hover);
  color: var(--text-primary);
}

.chat-graphite .agent-chat-room-icon-button-on {
  background: var(--shell-active);
  color: var(--text-primary);
}

/* Переключатели чата под шапкой: нейтральная дорожка, зелёная — когда
   включено. */
.chat-graphite .agent-chat-room-pane-controls {
  padding: 8px 18px;
  border-bottom: 1px solid var(--border-color);
  background: transparent;
}

.chat-graphite .agent-chat-rule-switch {
  border-color: var(--border-color);
  background: #2a2a30;
}

.chat-graphite .agent-chat-rule-on .agent-chat-rule-switch {
  border-color: #1f5f3a;
  background: #16a34a;
}

.chat-graphite .agent-chat-rule-mode {
  color: var(--text-muted);
}

/* Плашки (нет связи, ошибка, подсказка) — карточка графита, цвет только у
   ошибки. */
.chat-graphite .agent-chat-inline-alert {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12.5px;
}

.chat-graphite .agent-chat-room-pane > .agent-chat-inline-alert {
  margin-right: 18px;
  margin-left: 18px;
}

.chat-graphite .agent-chat-inline-alert-error {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
}

.chat-graphite .agent-chat-inline-alert-success {
  border-color: #1f5f3a;
  background: rgba(34, 197, 94, 0.08);
}

/* Боковая панель разговора (правила, ссылки) — карточка графита. */
.chat-graphite .agent-chat-room-panel {
  border-color: var(--border-color);
  background: var(--bg-surface);
}

/* ── Лента ── */
.chat-graphite .agent-chat-conversation-simple {
  gap: 10px;
  padding: 16px 18px;
  background: var(--bg-primary);
}

.chat-graphite .agent-chat-conversation-simple:has(> .agent-chat-empty-simple) {
  justify-content: center;
}

.chat-graphite .agent-chat-empty-simple,
.chat-graphite .agent-chat-room-scroll > .agent-chat-empty-simple {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  border: none;
  background: transparent;
}

.chat-graphite .agent-chat-empty-title {
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 700;
}

.chat-graphite .agent-chat-empty-copy {
  color: var(--text-muted);
  font-size: 13px;
}

.chat-graphite .agent-chat-day-separator {
  padding: 2px 0 4px;
}

.chat-graphite .agent-chat-day-pill {
  padding: 2px 9px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 400;
}

/* Пузырь: текст, под ним моноширинная подпись «кто · когда». */
.chat-graphite .agent-chat-bubble {
  display: flex;
  flex-direction: column;
  max-width: 62%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--bg-card);
  box-shadow: none;
  color: var(--text-primary);
}

.chat-graphite .agent-chat-bubble-user {
  border-color: #3b2f6b;
  background: #1f1a33;
  color: var(--text-primary);
}

.chat-graphite .agent-chat-bubble-error {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
}

.chat-graphite .agent-chat-bubble-system {
  background: transparent;
  color: var(--text-secondary);
}

.chat-graphite .agent-chat-bubble-body {
  color: inherit;
  font-size: 13.5px;
  line-height: 1.4;
}

.chat-graphite .agent-chat-bubble-head {
  order: 5;
  justify-content: flex-start;
  gap: 0;
  margin: 4px 0 0;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.chat-graphite .agent-chat-bubble-role {
  color: inherit;
  font-size: inherit;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.chat-graphite .agent-chat-bubble-meta,
.chat-graphite .agent-chat-bubble-user .agent-chat-bubble-meta {
  color: inherit;
  font-size: inherit;
}

.chat-graphite .agent-chat-bubble-meta:not(:empty)::before {
  content: ' · ';
  white-space: pre;
}

.chat-graphite .agent-chat-bubble-foot,
.chat-graphite .agent-chat-bubble-user .agent-chat-bubble-foot {
  order: 6;
  color: var(--text-muted);
}

/* Ответ, который сочинил агент (у него есть след контекста), подписан
   голубым. */
.chat-graphite .agent-chat-bubble:has(.telegram-context-row) .agent-chat-bubble-head {
  color: #7dd3fc;
}

.chat-graphite .agent-chat-bubble-channel {
  border-color: var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
}

/* На телефоне пузырю нужна почти вся ширина, а «‹ Чаты» — та же призрачная
   кнопка, что и в шапке. */
@media (max-width: 767.98px) {
  .chat-graphite .agent-chat-bubble {
    max-width: 85%;
  }

  .chat-graphite .agent-chat-room-back,
  .chat-graphite .agent-chat-shell-detail .agent-chat-room-back {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
  }
}

/* ── Композер ── */
.chat-graphite .agent-chat-room-composer {
  gap: 6px;
  padding: 0 18px 10px;
  border-top: none;
  background: transparent;
}

.chat-graphite .agent-chat-room-input-shell {
  align-items: center;
  gap: 4px;
  padding: 6px 8px 6px 14px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--bg-card);
}

.chat-graphite .agent-chat-room-input-shell:focus-within {
  border-color: #3a3a42;
}

.chat-graphite .agent-chat-room-input-shell-disabled {
  border-style: solid;
  background: var(--bg-surface);
  opacity: 1;
}

.chat-graphite .agent-chat-room-input {
  padding: 11px 0;
  color: var(--text-primary);
  font-size: 13.5px;
  line-height: 20px;
}

.chat-graphite .agent-chat-room-input::placeholder {
  color: var(--text-muted);
}

.chat-graphite .agent-chat-room-input-actions {
  gap: 2px;
}

.chat-graphite .agent-chat-room-round-button {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
}

.chat-graphite .agent-chat-room-round-button:hover:not(:disabled) {
  border: none;
  background: var(--shell-hover);
  color: var(--text-primary);
}

.chat-graphite .agent-chat-room-round-button-live {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
}

.chat-graphite .agent-chat-room-round-button svg {
  display: block;
  width: 16px;
  height: 16px;
}

.chat-graphite .agent-chat-room-send-button {
  width: 30px;
  height: 30px;
  margin-left: 4px;
  border: none;
  border-radius: 50%;
  background: #9465ff;
  color: #fff;
}

.chat-graphite .agent-chat-room-send-button:not(:disabled):hover {
  border: none;
  background: #a37cff;
  color: #fff;
}

.chat-graphite .agent-chat-room-send-button:disabled {
  opacity: 0.4;
}

.chat-graphite .agent-chat-room-send-button svg {
  display: block;
  width: 15px;
  height: 15px;
}

/* Под полем — служебная строка моноширинным мелким шрифтом. */
.chat-graphite .agent-chat-room-composer-meta {
  gap: 6px 10px;
  padding: 0 4px;
  color: var(--text-muted);
}

.chat-graphite .agent-chat-room-composer-meta .agent-chat-room-composer-hint,
.chat-graphite .agent-chat-room-composer-hint {
  margin-left: auto;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.chat-graphite .agent-chat-room-composer-button {
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
}

.chat-graphite .agent-chat-room-composer-button:hover:not(:disabled) {
  border-color: var(--border-color);
  background: var(--shell-hover);
  color: var(--text-primary);
}

.chat-graphite .agent-chat-room-composer-button-live {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
}

.chat-graphite .agent-chat-room-field {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 12.5px;
}

.chat-graphite .agent-chat-room-field:focus {
  border-color: #3a3a42;
}

/* Общие кнопки и поля внутри «Разговоров» («Подключить» в плашке, решения
   по черновикам, объединение контактов): вторая — призрачная, главная —
   плоская фиолетовая без градиента, поля — на фоне экрана. */
.comms-shell .btn {
  border-radius: 10px;
  box-shadow: none;
}

.comms-shell .btn-secondary {
  border-color: var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  box-shadow: none;
}

.comms-shell .btn-secondary:hover:not(:disabled) {
  border-color: var(--border-color);
  background: var(--shell-hover);
  color: var(--text-primary);
  box-shadow: none;
}

.comms-shell .btn-primary {
  border-color: var(--btn-purple-fill);
  background: var(--btn-purple-fill);
  color: #fff;
  box-shadow: none;
}

.comms-shell .btn-primary:hover:not(:disabled) {
  border-color: #a37bff;
  background: #a37bff;
  box-shadow: none;
}

.comms-shell .form-input,
.comms-shell .form-select,
.comms-shell .form-textarea {
  border-color: var(--border-color);
  border-radius: 10px;
  background: var(--bg-primary);
}

.comms-shell .form-input:focus,
.comms-shell .form-select:focus,
.comms-shell .form-textarea:focus {
  border-color: #3a3a42;
  box-shadow: none;
}

/* Подписи каналов под списком и карточки «Черновиков» — без синевы. */
.comms-shell .agent-chat-room-channel-pill {
  background: var(--shell-hover);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.comms-shell .agent-chat-room-channel-pill-on {
  background: rgba(34, 197, 94, 0.08);
  color: #4ade80;
}

.comms-shell .drafts-card {
  border-color: var(--border-color);
  background: var(--bg-surface);
}

.comms-shell .drafts-empty {
  border-color: var(--border-color);
}

/* ── Чат «Поста» в том же графите (замечание владельца 31.10.2026: «Разговоры»
   уже в новом стиле сообщений, а лента «На посту» осталась старой). Общее —
   лента, пузыри, композер, шапка — приходит от корня .chat-graphite; здесь
   только то, что есть лишь у поста: «История», «+ Новый», чип модели,
   подсказки над полем и голубая подпись ответа агента. */

.post-chat .agent-chat-history-button,
.post-chat .agent-chat-new-button,
.post-chat .agent-chat-model-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.post-chat .agent-chat-model-chip {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 400;
}

.post-chat .agent-chat-history-button:hover,
.post-chat .agent-chat-history-button-on,
.post-chat .agent-chat-model-chip:hover,
.post-chat .agent-chat-model-chip-on {
  border-color: var(--border-color);
  background: var(--shell-hover);
  color: var(--text-primary);
}

.post-chat .agent-chat-new-button {
  border-color: #3b2f6b;
  color: #c4b5fd;
}

.post-chat .agent-chat-new-button:hover {
  background: #1f1a33;
  color: #e9d5ff;
}

.post-chat .agent-chat-menu-pop {
  border: 1px solid var(--shell-pop-border);
  border-radius: 12px;
  background: var(--shell-pop);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.post-chat .agent-chat-history-item:hover,
.post-chat .agent-chat-history-item-on {
  background: var(--shell-hover);
}

.post-chat .agent-chat-suggestions {
  gap: 6px;
  margin: 0 0 8px;
}

.post-chat .agent-chat-suggestion {
  height: 26px;
  padding: 0 10px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
}

.post-chat .agent-chat-suggestion:hover {
  border-color: var(--border-color);
  background: var(--shell-hover);
  color: var(--text-primary);
}

.post-chat .agent-chat-suggestion-warn {
  border-color: rgba(250, 204, 21, 0.35);
  color: #facc15;
}

/* Ответ агента подписан голубым, как в «Разговорах». */
.post-chat .agent-chat-bubble-agent .agent-chat-bubble-head {
  color: #7dd3fc;
}

/* Окно «кто встанет на пост» со сцены поста: палитра поиска, строки с
   инициалами и должностью, «на посту» у текущего, внизу ссылки в настройки
   и на найм. */
.staff-pick {
  width: min(520px, 100%);
}

.staff-pick-title {
  padding: 12px 14px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.staff-pick-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--shell-active);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}

.staff-pick-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.staff-pick-sub {
  overflow: hidden;
  font-size: 11.5px;
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-pick-on {
  flex: none;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #4ade80;
}

.staff-pick-item:disabled {
  opacity: 0.6;
  cursor: default;
}

.staff-pick-error {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  font-size: 13px;
  color: #f87171;
}

.staff-pick-notice {
  padding: 8px 14px;
  border-bottom: 1px solid var(--shell-pop-border);
  font-size: 12px;
  color: #f87171;
}

.staff-pick-foot {
  display: flex;
  align-items: center;
  gap: 12px;
}

.staff-pick-foot-keys {
  flex: 1;
  min-width: 0;
}

.staff-pick-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 11.5px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.staff-pick-link:hover {
  color: var(--text-primary);
  text-decoration: underline;
}
/* Вход в HolyCode истёк: плашка на «Постах» и строка в выпадашке поста (31.10.2026). */
.posts-notice {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 0 0 14px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid rgba(234, 179, 8, 0.45); background: rgba(234, 179, 8, 0.08); color: #fde68a; font-size: 13px;
}
.posts-notice .posts-card-action { color: #fde68a; }
.post-switch-foot.post-switch-foot-warn { color: #fde68a; }

/* Звонок в списке: значок состояния в углу аватара, цвет — по состоянию
   (владелец, 01.11.2026; раньше значок занимал отдельную строку). */
.comms-shell .agent-chat-thread-avatar-channel-live { color: #f87171; }
.comms-shell .agent-chat-thread-avatar-channel-ok { color: #4ade80; }
.comms-shell .agent-chat-thread-avatar-channel-test { color: #a78bfa; }
.comms-shell .agent-chat-thread-avatar-channel-missed { color: var(--text-muted, #94a3b8); }
.comms-shell .call-run-toggle { display: inline-flex; align-items: center; gap: 6px; }
.comms-shell .call-run-toggle-on { border-color: var(--btn-purple-outline); color: var(--text-primary, #fafafa); }
.shell-sec .shell-iconbtn.shell-filter-on { color: var(--shell-lilac, #c4b5fd); background: var(--shell-active); }

/* Шапка-путь: ▾ после пути (переход к разделу), «Поделиться» и «Вид»
   (макет agent-runs-review: значки IconShare и IconSliders справа). */
.shell-pathbar .shell-path-caret { width: 24px; height: 24px; margin-left: -4px; color: var(--text-muted); flex: none; }
.shell-iconbtn-on { background: var(--shell-active); color: var(--text-primary); }
.shell-iconbtn-done { color: #4ade80; }
.shell-view { position: relative; display: inline-flex; }
.shell-view-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: 210px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--shell-pop);
  border: 1px solid var(--shell-pop-border);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}
.shell-view-pop button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.shell-view-pop button:hover { background: #2a2a30; }
.shell-view-pop svg { color: var(--text-secondary); flex: none; }

/* ⌘F в поиске по чатам и «правила по контактам: N» в подвале списка. */
.comms-shell .agent-chat-room-search-key {
  flex: none;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--text-muted);
}
.comms-shell .agent-chat-room-rules-note {
  margin-left: auto;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Фото собеседника из канала (17.11.2026): картинка ложится поверх инициалов,
   пока грузится или если её нет — видна буква. Инициалы — в оттенке канала. */
.comms-shell .agent-chat-thread-avatar .peer-avatar-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.comms-shell .agent-chat-thread-avatar-channel {
  z-index: 1;
}

.comms-shell .peer-avatar-ch-telegram { background: #1f3a52; }
.comms-shell .peer-avatar-ch-whatsapp_web,
.comms-shell .peer-avatar-ch-whatsapp { background: #1d4535; }
.comms-shell .peer-avatar-ch-instagram_web,
.comms-shell .peer-avatar-ch-instagram { background: #4a2440; }
.comms-shell .peer-avatar-ch-facebook { background: #23345a; }
.comms-shell .peer-avatar-ch-max { background: #2c2e5e; }
.comms-shell .peer-avatar-ch-sozv { background: #3b2a5c; }
.comms-shell .peer-avatar-ch-email,
.comms-shell .peer-avatar-ch-mail { background: #4a3a22; }
.comms-shell .peer-avatar-ch-voice { background: #283f3f; }

.comms-shell .agent-chat-room-profile-hit {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 50%;
}

.comms-shell .agent-chat-room-profile-title {
  border-radius: 6px;
  max-width: 100%;
}

.comms-shell .agent-chat-room-profile-title:hover .agent-chat-room-pane-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.comms-shell .agent-chat-room-profile-hit:focus-visible {
  outline: 2px solid var(--accent, #8b5cf6);
  outline-offset: 2px;
}

/* ── Акценты шапки и меню следуют палитре (решение владельца 19.11.2026) ──
   Перекраска палитрой (switcher/palettes.js) видит и токены :root, и var() —
   графит каркаса она переводит в поверхности палитры. Не красились акценты:
   с 30.10 выбранный пункт меню, кнопка «включено», текущий контур и открытая
   сетка сервисов были тем же серым --shell-active, что и наведение, — акцентного
   цвета, который палитра заменила бы своим, в шапке и меню просто не было.
   Здесь акценты возвращены литералами фиолетового (токены ниже): палитра
   переводит их в свой акцент и свою подсветку, поверхности остаются графитом. */
:root {
  --shell-lilac: #c4b5fd;
  --shell-accent-soft: rgba(148, 101, 255, 0.14);
  --shell-accent-on: rgba(148, 101, 255, 0.22);
  --shell-accent-ring: rgba(148, 101, 255, 0.55);
}
/* Выбранный пункт выпадающих меню и палитры команд ⌘K. */
.shell-pop-item-on,
.palette-item-on { background: var(--shell-accent-soft); color: var(--text-primary); }
.shell-pop-item-on svg,
.palette-item-on .palette-item-icon { color: var(--shell-lilac); }
.shell-pop-item:focus-visible,
.palette-item:focus-visible { outline: 2px solid var(--shell-accent-ring); outline-offset: -2px; }
/* Кнопки шапки «включено» (вид, фильтры) и открытая сетка сервисов. */
.shell-iconbtn-on { color: var(--shell-lilac); }
#root .shell-top .hcs .hcs-trigger[aria-expanded='true'] { color: var(--shell-lilac); }
#root .shell-top .hcs .hcs-trigger:focus-visible { outline: 2px solid var(--shell-accent-ring); outline-offset: 1px; }
/* Иконка выбранного раздела в панели — акцентом, плашка остаётся графитом. */
.app-sidebar-shell .sidebar-tab.active .sidebar-tab-icon { color: var(--shell-lilac); }
/* Текущий контур «Все · Россия · США» в шапке-пути — подсветкой палитры. */
.shell-pathbar .hcs-contour {
  --hcs-contour-on: var(--shell-accent-on);
  --hcs-ring: var(--shell-accent-ring);
}
/* Меню аккаунта: выбранная тема и язык — подсветкой палитры (наведение — графит). */
#root .shell-me .hca { --hca-seg-on-bg: var(--shell-accent-on); }

/* Режим показа (П4): строка «HolyAgent смотрит экран · <метка> · Остановить». */
.hands-show-bar { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 520px;
  padding: 4px 4px 4px 10px; border-radius: 999px; background: rgba(255, 69, 58, 0.12);
  border: 1px solid rgba(255, 69, 58, 0.35); font-size: 13px; }
.hands-show-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff453a; flex: none;
  animation: hands-show-pulse 1.6s infinite; }
@keyframes hands-show-pulse { 50% { opacity: 0.35; } }
.hands-show-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hands-show-error { color: #c93400; font-size: 12px; white-space: nowrap; }
.hands-show-stop { flex: none; border: 0; border-radius: 999px; padding: 4px 12px; background: #ff453a;
  color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.hands-show-stop:disabled { opacity: 0.6; cursor: default; }
.hands-perm-bar { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 560px;
  padding: 4px 4px 4px 10px; border-radius: 999px; background: rgba(255, 159, 10, 0.12);
  border: 1px solid rgba(255, 159, 10, 0.4); font-size: 13px; }
.hands-perm-text, .hands-perm-hint { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hands-perm-hint { font-size: 12px; color: var(--text-secondary, #6e6e73); }
.hands-perm-grant { flex: none; border: 0; border-radius: 999px; padding: 4px 12px; background: #ff9f0a;
  color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.hands-perm-grant:disabled { opacity: 0.6; cursor: default; }
.tasks-card-hands { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary, #6e6e73); }
.tasks-card-hands-live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #ff453a; }
.tasks-card-hands-run { border: 0; background: none; padding: 0; font: inherit; color: var(--accent, #0a84ff); cursor: pointer; }
.tasks-card-hands-run:hover { text-decoration: underline; }
.tasks-card-hands-succeeded { color: var(--success, #248a3d); }
.tasks-card-hands-needs_human { color: var(--warning, #b25000); }
.tasks-card-hands-failed { color: var(--danger, #d70015); }
