/* HQ — командный центр. Дизайн-токены и раскладка.
   Источник: прототип claude.ai/design bbb487f3 ("Прототип командного
   центра.dc.html"), см. .superpowers/sdd/task-10-design-notes.md.
   Все цвета — только через переменные ниже, хардкодов hex вне :root нет. */

:root {
  --bg:          #0e0d0b;   /* фон страницы */
  --panel:       #14120e;   /* карточки, поля ввода */
  --panel-deep:  #0a0908;   /* блок tool-вызовов */
  --accent:      #c9a86a;   /* латунь — основной акцент */
  --accent-hi:   #e0c48f;   /* ховер */
  --line:        rgba(214, 183, 124, .12);   /* границы панелей */
  --line-soft:   rgba(214, 183, 124, .08);
  --line-hard:   rgba(214, 183, 124, .25);
  --tx:          #efe8da;   /* заголовки */
  --tx-body:     #e6dfd0;   /* основной текст */
  --tx-mute:     #bdb5a4;
  --tx-dim:      #9a917f;
  --tx-faint:    #847c6c;   /* моно-метки, плейсхолдеры. В макете было
                               #6e675a (3.47:1, ниже WCAG AA). Осветлено
                               до 4.70:1 на фоне / 4.53:1 на панели. */
  --ok:          #8fbf9a;   /* работает / успех */
  --warn:        #d9b36a;   /* ждёт ответа */
  --err:         #d98a7a;   /* ошибка */

  --sel-line:    rgba(201, 168, 106, .3);
  --sel-bg:      rgba(201, 168, 106, .09);
  --user-bg:     rgba(201, 168, 106, .1);

  --f-ui:      'Manrope', system-ui, -apple-system, sans-serif;
  --f-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  --f-display: 'Cormorant Garamond', Georgia, serif;

  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 16px;

  color-scheme: dark;
}

/* ---------- Сброс и база ---------- */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--tx-body);
  font-family: var(--f-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

h1, h2, h3, p, ul, ol, dl, dd {
  margin: 0;
}

ul, ol { padding: 0; list-style: none; }

button, input, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a { color: var(--accent); }

img, svg { max-width: 100%; display: block; }

/* Фокус-кольцо — везде одинаковое, видимое только при клавиатурной навигации. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Общие компоненты ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--tx-body);
  font-family: var(--f-ui);
  font-weight: 500;
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.btn:hover:not(:disabled) { border-color: var(--line-hard); color: var(--tx); }
.btn:disabled { cursor: not-allowed; }

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  font-weight: 600;
}
.btn-accent:hover:not(:disabled) { background: var(--accent-hi); border-color: var(--accent-hi); }

.btn-ghost {
  background: transparent;
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) { background: var(--line-soft); }

.btn-sm { min-height: 32px; padding: 0 10px; font-size: 12.5px; border-radius: var(--radius-sm); }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--tx-faint);
}
.field input {
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--tx);
}
.field input::placeholder { color: var(--tx-faint); }
.field input:focus { border-color: var(--line-hard); }

.field-hint {
  font-size: 12px;
  color: var(--tx-dim);
}
.field-error {
  font-size: 12.5px;
  color: var(--err);
}

/* Заблокированные элементы (решение владельца): видны, приглушены, клик
   молча ничего не делает, причина объясняется текстом рядом + title. */
.is-locked {
  opacity: .45;
  cursor: not-allowed;
}
.locked-hint {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--tx-faint);
}

.mono {
  font-family: var(--f-mono);
}
.label-mono {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--tx-faint);
}

mark {
  background: transparent;
  color: var(--accent);
  font-weight: 700;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.empty-state {
  padding: 24px 16px;
  text-align: center;
  color: var(--tx-dim);
  font-size: 13px;
}
.empty-state .big { font-size: 28px; margin-bottom: 8px; }

.spinner {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

/* ---------- Ловушка ошибок и загрузка ---------- */

.loading {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tx-dim);
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: .08em;
}

#crash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  color: var(--tx-body);
  padding: 32px 20px;
  overflow: auto;
}
#crash h2 {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 22px;
  color: var(--err);
  margin-bottom: 12px;
}
#crash pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--tx-mute);
  background: var(--panel-deep);
  border-radius: var(--radius-md);
  padding: 14px;
  max-height: 50vh;
  overflow: auto;
}
#crash button {
  margin-top: 16px;
}

/* ---------- Экран входа / второго фактора ---------- */

.auth-screen {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-card {
  width: min(380px, 100%);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-orb {
  width: 52px; height: 52px;
  border-radius: 50%;
  margin: 0 auto;
  background: radial-gradient(circle at 35% 30%, var(--accent-hi), var(--accent) 60%, #8a6f42 100%);
  box-shadow: 0 0 24px rgba(201, 168, 106, .35);
}

.auth-title {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 22px;
  color: var(--tx);
  text-align: center;
}
.auth-sub {
  font-size: 13px;
  color: var(--tx-dim);
  text-align: center;
  margin-top: -8px;
}

.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-qr-wrap {
  display: flex;
  justify-content: center;
  padding: 12px;
  background: #fff;
  border-radius: var(--radius-md);
}
.auth-qr-fallback {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--tx-mute);
  text-align: center;
  word-break: break-all;
  user-select: all;
}

.code-input {
  text-align: center;
  font-family: var(--f-mono);
  font-size: 22px;
  letter-spacing: .3em;
}

/* ---------- Каркас приложения ---------- */

.shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

.topbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 56px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.topbar-orb {
  width: 22px; height: 22px;
  border-radius: 50%;
  flex: none;
  background: radial-gradient(circle at 35% 30%, var(--accent-hi), var(--accent) 60%, #8a6f42 100%);
}
.topbar-title {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 19px;
  color: var(--tx);
  white-space: nowrap;
}
.topbar-tabs {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}
.topbar-tab {
  padding: 6px 12px;
  min-height: 32px;
  display: flex;
  align-items: center;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--tx-mute);
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
}
.topbar-tab.active {
  color: var(--tx);
  background: var(--panel);
  border-color: var(--line);
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.topbar-meta {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  color: var(--tx-faint);
  white-space: nowrap;
}

.layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr) 296px;
}

.col-sessions, .col-side {
  min-height: 0;
  overflow-y: auto;
  padding: 14px 0;
}
.col-sessions { border-right: 1px solid var(--line); }
.col-side { border-left: 1px solid var(--line); padding: 14px 14px; }

.col-header {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--tx-faint);
  padding: 0 14px 10px;
}

.col-center {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- Список сессий ---------- */

.session-card {
  padding: 10px 12px;
  margin: 0 8px 6px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  min-height: 44px;
}
.session-card:hover { background: var(--line-soft); }
.session-card.selected {
  border-color: var(--sel-line);
  background: var(--sel-bg);
}
.session-card.is-done { opacity: .6; }
.session-card.is-done.selected { opacity: 1; }

.session-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.session-card-name {
  font-size: 13.5px;
  color: var(--tx);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-card-sub {
  margin-top: 4px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--tx-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex: none;
  background: var(--tx-dim);
}
.status-dot.run { background: var(--ok); animation: pulse 1.6s infinite; }
.status-dot.err { background: var(--err); }

.today-block {
  margin: 16px 14px 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.today-block .row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--tx-mute);
  padding: 3px 0;
}
.today-block .row b { color: var(--tx); font-weight: 600; }

/* ---------- Центр: шапка сессии, лента, ввод ---------- */

.session-header {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  min-height: 60px;
}
.session-header-name {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 21px;
  color: var(--tx);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-header-meta {
  font-family: var(--f-mono);
  font-size: 10.5px;
  color: var(--tx-faint);
  margin-top: 2px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.badge.run { color: var(--ok); border-color: rgba(143, 191, 154, .35); }
.badge.done { color: var(--tx-dim); }
.badge.err { color: var(--err); border-color: rgba(217, 138, 122, .35); }

.session-header-actions {
  display: flex;
  gap: 8px;
  flex: none;
}

.feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feed-loadmore {
  align-self: center;
  margin: 6px 0;
}

.msg-row { display: flex; }
.msg-row.from-user { justify-content: flex-end; }
.msg-row.from-assistant { justify-content: flex-start; }

.msg {
  max-width: 78%;
  padding: 10px 13px;
  border-radius: var(--radius-md);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13.5px;
}
.msg.user {
  background: var(--user-bg);
  border-radius: 10px 10px 3px 10px;
  color: var(--tx-body);
}
.msg.assistant {
  background: var(--panel);
  border-radius: 10px 10px 10px 3px;
  color: var(--tx-body);
}
.msg-meta {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--tx-faint);
  margin-bottom: 5px;
}

.tool-wrap { max-width: 86%; }
.tool-block {
  background: var(--panel-deep);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--tx-mute);
  border: 1px solid var(--line-soft);
}
.tool-block .tool-name {
  color: var(--tx-faint);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-right: 6px;
}
.tool-block.ok { color: var(--ok); }
.tool-block.err { color: var(--err); }
.tool-block.warn { color: var(--warn); }

.subagent-tag {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: .06em;
  color: var(--tx-faint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 7px;
  margin-bottom: 4px;
}

.composer {
  flex: none;
  display: flex;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}
.composer input {
  flex: 1;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--tx);
}
.composer input::placeholder { color: var(--tx-faint); }
.composer .btn {
  width: 44px;
  padding: 0;
  flex: none;
}
.composer-hint {
  padding: 0 18px 12px;
  margin-top: -8px;
}

/* ---------- Правая колонка: детали сессии ---------- */

.side-section { margin-bottom: 22px; }
.side-section:last-child { margin-bottom: 0; }
.side-section-title {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--tx-faint);
  margin-bottom: 10px;
}
.side-note {
  font-size: 12px;
  color: var(--tx-dim);
  line-height: 1.5;
}
.file-chip {
  font-family: var(--f-mono);
  font-size: 11.5px;
  color: var(--tx-mute);
  padding: 5px 0;
  border-bottom: 1px solid var(--line-soft);
  overflow-wrap: break-word;
}
.file-chip:last-child { border-bottom: none; }

.attn-item {
  padding: 8px 10px;
  margin-bottom: 6px;
  border-radius: var(--radius-sm);
  background: rgba(217, 138, 122, .08);
  border: 1px solid rgba(217, 138, 122, .2);
}
.attn-item .t {
  font-family: var(--f-mono);
  font-size: 9.5px;
  color: var(--err);
  margin-bottom: 3px;
}
.attn-item .s {
  font-size: 12px;
  color: var(--tx-mute);
  white-space: pre-wrap;
  word-break: break-word;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  padding: 4px 0;
  color: var(--tx-mute);
}
.stat-row b { color: var(--tx); font-weight: 600; }

/* Мобильный disclosure для правой колонки (см. .layout media-запрос ниже) */
.mobile-details { display: none; }
.mobile-details summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--tx-faint);
  border-bottom: 1px solid var(--line);
}
.mobile-details[open] summary { color: var(--tx); }
.mobile-details .mobile-details-body {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

/* ---------- Поиск ---------- */

.search-bar {
  flex: none;
  display: flex;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.search-bar input {
  flex: 1;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--tx);
}
.search-results {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.result-card {
  padding: 12px 14px;
  cursor: pointer;
}
.result-card:hover { border-color: var(--line-hard); }
.result-card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.result-card-title {
  font-size: 13.5px;
  color: var(--tx);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.result-card-meta {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--tx-faint);
  flex: none;
}
.result-card-snippet {
  font-size: 13px;
  color: var(--tx-mute);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.result-agent-tag {
  font-family: var(--f-mono);
  font-size: 9px;
  color: var(--tx-faint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 7px;
}

/* ---------- Статистика ---------- */

.stats-screen {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 22px;
}
.stats-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.stats-toolbar h2 {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 21px;
  color: var(--tx);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  padding: 16px;
}
.stat-card .num {
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: 22px;
  color: var(--tx);
}
.stat-card .cap {
  margin-top: 6px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--tx-faint);
}
.stat-card .sub {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--tx-dim);
}

.model-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.model-table th {
  text-align: left;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--tx-faint);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.model-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--tx-mute);
  font-family: var(--f-mono);
}
.model-table td.model-name { color: var(--tx-body); font-family: var(--f-ui); }
.table-scroll { overflow-x: auto; }

/* ---------- Витрина «Состояние дел» ---------- */

.projects-screen {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 24px;
}

/* Пустая заготовка под блок «требует решения» не должна съедать gap
 * .projects-screen, пока в ней ничего нет — как только появятся дети, :empty
 * перестанет матчиться и блок сам проявится без правок здесь. */
.attention-block:empty { display: none; }

/* Блок «требует твоего решения» — сводка по всем проектам, над списком. */
.attention-block { display: flex; flex-direction: column; gap: 6px;
                   padding: 14px 16px; background: var(--panel);
                   border: 1px solid var(--line); border-radius: var(--radius-md); }
.attention-empty { font: 400 12px var(--f-ui); color: var(--tx-dim); }
.attention-row { display: flex; align-items: baseline; gap: 10px; }
.attention-kind { flex: none; }
.attention-text { font: 400 12.5px/1.45 var(--f-ui); color: var(--tx-mute); }

/* Та же колоночная раскладка с отступом, что у .projects-screen — иначе gap
 * родителя срабатывает один раз (между attention-block и списком), а сами
 * карточки внутри .projects-list встают вплотную. */
.projects-list { display: flex; flex-direction: column; gap: 12px; }

.project-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.project-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.project-card-name { font: 600 15px var(--f-ui); color: var(--tx); }
.project-card-summary {
  font: 400 13px/1.5 var(--f-ui);
  color: var(--tx-mute);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.project-card-meta { font: 400 11px var(--f-mono); color: var(--tx-faint); letter-spacing: .04em; }

/* Бейджи внимания — цветовые модификаторы поверх существующего .badge
 * (см. session-header), без своих размеров/скруглений/трекинга. */
.project-badges { display: flex; gap: 6px; flex: none; flex-wrap: wrap; }
.att-waiting { color: var(--warn); border-color: rgba(217,179,106,.4); }
.att-dirty   { color: var(--err);  border-color: rgba(217,138,122,.4); }
.att-stale   { color: var(--tx-dim); }

.project-session { display: flex; align-items: center; gap: 8px; padding: 5px 0;
                   min-height: 44px; cursor: pointer; border-top: 1px solid var(--line-soft); }
.project-session:hover .project-session-title { color: var(--tx); }
.project-session-title { font: 400 12px var(--f-ui); color: var(--tx-mute);
                         overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Мобильная раскладка (<900px) ---------- */

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .col-sessions, .col-side { display: none; }
  .col-center { display: none; }

  .layout.show-list .col-sessions {
    display: block;
    width: 100%;
    border-right: none;
  }
  .layout.show-detail .col-center { display: flex; }

  .col-side { display: none !important; }
  .mobile-details { display: block; }

  .topbar {
    flex-wrap: wrap;
    height: auto;
    min-height: 56px;
    padding: 8px 12px;
    row-gap: 8px;
  }
  .topbar-tabs {
    order: 3;
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .topbar-right { order: 2; }

  .msg { max-width: 88%; }

  .projects-screen { padding: 14px; }
  .project-card-top { flex-direction: column; gap: 6px; }
}

@media (min-width: 901px) {
  .mobile-back { display: none; }
}

/* ---------- Тост (реакция на клик по заблокированному элементу) ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 500;
  background: var(--panel);
  border: 1px solid var(--line-hard);
  color: var(--tx);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  max-width: min(90vw, 420px);
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
  animation: toastIn .15s ease-out;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(6px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ---------- Оверлей второго фактора (вызван 428 посреди работы) ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(14, 13, 11, .78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* Пустые сессии / обрывки — приглушены, чтобы не отвлекали от реальных. */
.session-card.is-empty { opacity: .45; }
.session-card.is-empty .session-card-name { font-style: italic; }

/* Попадания внутри карточки-сессии (сгруппированный поиск). */
.result-hit { padding: 10px 0; border-top: 1px solid var(--line-soft); }
.result-hit:first-of-type { border-top: none; padding-top: 8px; }
.result-hit-meta { display: flex; gap: 8px; align-items: center; margin-top: 5px; }

/* ---------------------------------------------------------------- пульт рассылки */
.outreach-queue, .outreach-stats, .outreach-table { padding: 16px; margin-bottom: 14px; }
.outreach-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.outreach-counters { display: flex; gap: 8px; flex-wrap: wrap; }
.outreach-card { margin-top: 12px; }
.outreach-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.outreach-num { color: var(--tx-dim); font-variant-numeric: tabular-nums; }
.outreach-name { font-weight: 600; }
.outreach-note { color: var(--tx-dim); font-size: 13px; margin: 4px 0 10px; }
.outreach-draft {
  white-space: pre-wrap; word-break: break-word; margin: 0 0 12px;
  padding: 12px; border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  background: var(--bg-soft, transparent); font-size: 13.5px; line-height: 1.55;
}
.outreach-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.outreach-actions .is-muted { opacity: .45; pointer-events: none; }
.outreach-wait { margin-top: 10px; color: var(--tx-dim); font-size: 13px; }
.outreach-tbl { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
.outreach-tbl th, .outreach-tbl td {
  text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.outreach-tbl th { color: var(--tx-dim); font-weight: 500; }
.outreach-tbl td .btn { margin: 0 4px 4px 0; }
/* мобилка: таблица не должна раздвигать страницу по горизонтали */
@media (max-width: 720px) {
  .outreach-table { overflow-x: auto; }
  .outreach-tbl { min-width: 460px; }
}
