/* Логотип: 50px ширина, высота авто (класс logo w-[150px] → 50px) */
.logo, img.logo, img[alt="logo"] {
  width: 50px !important; height: auto !important; max-width: 50px !important;
  object-fit: contain !important;
}
/* Убрать «цветок» справа на логине:
   class="relative hidden bg-muted lg:block overflow-hidden" */
.bg-muted.overflow-hidden { display: none !important; }
/* Форму логина — по центру всей ширины */
.bg-muted.overflow-hidden ~ *, form { }
.lg\:grid-cols-2 { grid-template-columns: 1fr !important; }

/* Убрать брендинг Chainlit и дисклеймер */
a[href*="chainlit"], a[href*="chainlit.io"], .watermark,
[class*="watermark"], [class*="Watermark"] { display: none !important; }
[class*="disclaimer"] { display: none !important; }

/* Карточка пользователя в меню (аватар + имя + email) */
[role="menu"]:has(.user-card) { min-width: 244px !important; }
.user-card {
  flex-direction: row !important; align-items: center; gap: 10px;
  padding: 4px 2px;
}
.uc-av {
  width: 38px; height: 38px; border-radius: 50%; object-fit: cover;
  flex-shrink: 0; background: rgba(127,127,127,.15);
}
.uc-meta { display: flex; flex-direction: column; min-width: 0; }
.uc-name { font-weight: 600; font-size: 13px; line-height: 1.25; }
.uc-email {
  font-size: 12px; opacity: .6; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 190px;
}

/* Логотип Layers в шапке чата */
.header-logo { height: 28px; width: auto; display: block; }

/* Бейдж активного воркспейса в шапке */
.header-ws {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: 10px; padding: 4px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 500; line-height: 1;
  color: rgba(127,127,127,.95); background: rgba(127,127,127,.12);
  border: 1px solid rgba(127,127,127,.16); max-width: 220px;
}
.header-ws svg { flex-shrink: 0; opacity: .8; }
.header-ws span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Строка воркспейса в карточке пользователя */
.uc-ws {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 3px;
  font-size: 12px; opacity: .7; max-width: 190px;
}
.uc-ws svg { flex-shrink: 0; }
.uc-ws span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Переключатель языка релизов в Readme */
.lang-toggle { display: flex; gap: 6px; margin: 2px 0 16px; }
.lang-toggle button {
  padding: 4px 14px; border-radius: 8px; font-size: 12px; font-weight: 600;
  border: 1px solid rgba(127, 127, 127, .3); background: transparent;
  color: inherit; opacity: .65; cursor: pointer; transition: all .15s;
}
.lang-toggle button:hover { opacity: .9; }
.lang-toggle button.on {
  background: #e0116b; border-color: #e0116b; color: #fff; opacity: 1;
}

/* Голосовой звонок: кнопка встроена в один ряд с ⚙️/«Агенты» под полем
   ввода (не плавает отдельно) — position:fixed с координатами, которые
   voice.js на лету подгоняет под тот ряд (сам ряд трогать нельзя, им владеет
   React). Прямое подключение к LiveKit со страницы — без отдельного
   приложения. Пока звонок активен, кнопка растягивается в прозрачную
   «пилюлю» с волной (порт WebGL-шейдера AgentAudioVisualizerWave из
   LiveKit Agents UI), поле ввода подсвечивается. Никакого фона под волной —
   альфу даёт сам шейдер, края гасим mask-градиентом, как в оригинале. */
.voice-call-btn {
  position: fixed;
  z-index: 45;
  width: 36px; height: 36px; padding: 0;
  border-radius: 999px;
  background: transparent; color: inherit;
  border: 1px solid rgba(127, 127, 127, .3);
  overflow: hidden;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s, width .25s ease;
}
.voice-call-btn svg { width: 16px; height: 16px; }
.voice-call-btn:hover { background: rgba(127, 127, 127, .12); }
.voice-call-btn canvas {
  display: none;
  width: 100%; height: 100%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
}
.voice-call-btn.voice-active {
  width: 100px;
  background: transparent;
  border-color: rgba(80, 164, 255, .35);
}
.voice-call-btn.voice-active:hover { background: rgba(80, 164, 255, .08); }
.voice-call-btn.voice-active svg { display: none; }
/* Волна не заезжает под крестик: справа отступ под ✕ */
.voice-call-btn.voice-active canvas {
  display: block;
  width: calc(100% - 26px);
  margin-right: 26px;
}
/* Крестик поверх правого (замаскированного) края волны: видно, что звонок
   можно завершить кликом. Вся кнопка и так кликабельна — это подсказка. */
.voice-call-btn .voice-x { display: none; }
.voice-call-btn.voice-active .voice-x {
  display: block;
  position: absolute; right: 8px; top: 50%;
  transform: translateY(-50%);
  opacity: .55;
  transition: opacity .15s;
}
.voice-call-btn.voice-active:hover .voice-x { opacity: 1; }
.voice-call-btn.voice-error {
  animation: voice-shake .4s ease;
}
@keyframes voice-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.voice-input-glow {
  box-shadow: 0 0 0 2px #50a4ff, 0 0 20px 2px rgba(80, 164, 255, .5) !important;
  transition: box-shadow .2s ease;
}

/* ── Панель «Агенты и инструменты» (#84) ──────────────────────────────────
   Один акцент, остальное — shadcn-токены (bg-card/border/muted), чтобы жить
   и в тёмной, и в светлой теме. */
:root { --agents-accent: #e0116b; }

/* Кнопка входа в ряду composer-тулбара (рядом с ботом/⚙️). */
.agents-panel-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: none; background: transparent;
  color: inherit; opacity: .75; cursor: pointer; border-radius: 8px;
  transition: opacity .15s ease, background .15s ease;
  /* Отделяем от селектора агента разделителем — кнопки перестают сливаться. */

}
.agents-panel-btn:hover { opacity: 1; background: rgba(127, 127, 127, .12); }
.agents-panel-btn svg { width: 18px; height: 18px; }

/* Оверлей + карточка. */
.agents-overlay {
  position: fixed; inset: 0; z-index: 50; display: flex;
  align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .5); padding: 16px;
}
.agents-card {
  display: flex; flex-direction: column;
  width: min(1040px, 92vw); height: min(680px, 88vh);
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}
.agents-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; flex: 0 0 auto;
}
.agents-btn-ghost {
  border: none; background: transparent; color: inherit; cursor: pointer;
  font-size: 13px; padding: 6px 10px; border-radius: 8px;
}
.agents-btn-ghost:hover:not(:disabled) { background: rgba(127, 127, 127, .12); }
.agents-btn-ghost:disabled { opacity: .4; cursor: default; }
.agents-btn-icon {
  border: none; background: transparent; color: inherit; cursor: pointer;
  width: 28px; height: 28px; border-radius: 8px; font-size: 15px; line-height: 1;
}
.agents-btn-icon:hover { background: rgba(127, 127, 127, .12); }
.agents-btn-primary {
  border: none; border-radius: 8px; cursor: pointer; font-size: 13px;
  font-weight: 500; padding: 7px 16px;
  background: rgba(127, 127, 127, .15); color: inherit;
}
.agents-btn-primary:disabled { opacity: .45; cursor: default; }

/* Единая модалка «Настройки» (#109): сайдбар разделов слева + контент справа.
   Заменил свап двух оверлеев — переключение раздела мгновенное. */
.settings-main { display: flex; flex: 1 1 auto; min-height: 0; }
.set-nav {
  width: 190px; flex: 0 0 190px; padding: 10px 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.set-nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: none; background: transparent; color: inherit; cursor: pointer;
  padding: 9px 10px; border-radius: 10px; text-align: left;
  font-size: 13px; font-weight: 500;
}
.set-nav-item:hover { background: rgba(127, 127, 127, .1); }
.set-nav-item.on { background: rgba(127, 127, 127, .16); }
.set-content { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
/* Внутри раздела «Агенты» список агентов уже не нужен во всю ширину сайдбара. */
.set-content .agents-list { width: 210px; flex-basis: 210px; }

/* Формы разделов «Модель и ключи» / «Ключ доступа». */
.keys-body { padding: 18px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.keys-label { font-size: 12px; opacity: .7; margin-top: 8px; }
.keys-hint { font-size: 11px; opacity: .6; margin-top: 4px; }
.keys-row { display: flex; align-items: center; gap: 10px; margin: 4px 0 2px; }
.keys-badge {
  font-size: 12px; padding: 3px 9px; border-radius: 999px;
  background: rgba(64, 200, 120, .16); color: #4fd18b;
  border: 1px solid rgba(64, 200, 120, .3);
}
.keys-link { background: none; border: none; color: #ff6b6b; cursor: pointer; font-size: 13px; padding: 0; }
.keys-oauth {
  width: 100%; box-sizing: border-box; margin-top: 2px; padding: 10px 14px;
  border-radius: 8px; border: none; background: var(--agents-accent, #e0116b);
  color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
}

/* Баннер-якорь с ментальной моделью (при первом открытии). */
.agents-intro {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 18px; flex: 0 0 auto; font-size: 12.5px; line-height: 1.45;
  background: rgba(224, 17, 107, .07);
}
.agents-intro span { flex: 1 1 auto; }

/* «?»-иконка с тултипом (hover + тап). */
.agents-help {
  position: relative; display: inline-flex; align-items: center;
  justify-content: center; width: 15px; height: 15px; border-radius: 50%;
  border: 1px solid rgba(127, 127, 127, .5); font-size: 10px; line-height: 1;
  cursor: help; opacity: .7; flex: 0 0 auto; vertical-align: middle;
}
.agents-help:hover { opacity: 1; }
/* Позицию (fixed top/bottom/left + width) задаёт JS в HelpTip. */
.agents-tip {
  background: rgba(20, 20, 24, .96); color: #fff; font-size: 12px;
  font-weight: 400; letter-spacing: normal; text-transform: none;
  line-height: 1.4; padding: 8px 10px; border-radius: 8px; z-index: 100;
  cursor: default; text-align: left; box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
}

.agents-body { display: flex; flex: 1 1 auto; min-height: 0; }

/* Список слева. */
.agents-list {
  width: 260px; flex: 0 0 260px; overflow-y: auto; padding: 8px;
  display: flex; flex-direction: column;
}
.agents-sec {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; letter-spacing: .04em; opacity: .6;
  padding: 10px 8px 4px;
}
.agents-sec-mcp { margin-top: 8px; }
.agents-sec-lbl { display: inline-flex; align-items: center; gap: 5px; }
.agents-empty {
  font-size: 12px; line-height: 1.45; padding: 4px 8px 8px;
}
.agents-empty-btn {
  display: block; margin-top: 8px; border: none; background: transparent;
  cursor: pointer; font-size: 12.5px; font-weight: 500; padding: 0;
}
.agents-empty-btn:hover { text-decoration: underline; }
.agents-add {
  border: none; background: transparent; color: inherit; cursor: pointer;
  font-size: 15px; line-height: 1; width: 20px; height: 20px; border-radius: 6px;
}
.agents-add:disabled { opacity: .35; cursor: default; }
.agents-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: none; background: transparent; color: inherit; cursor: pointer;
  padding: 8px; border-radius: 10px; text-align: left; font-size: 13px;
}
.agents-item:hover { background: rgba(127, 127, 127, .1); }
.agents-item.sel { background: rgba(127, 127, 127, .16); }
.agents-item-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; flex: 0 0 28px; border-radius: 8px;
}
.agents-item-name { flex: 1 1 auto; }
.agents-dot { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 6px; }
.agents-item-st { font-size: 11px; flex: 0 0 auto; }
.agents-mcp-row {
  display: flex; align-items: center; gap: 8px; padding: 8px;
  border-radius: 10px; font-size: 13px;
}
.agents-soon { font-size: 11px; padding: 4px 8px 8px; opacity: .7; }

/* Детальный редактор. */
.agents-detail {
  flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column;
  padding: 16px 18px; overflow-y: auto;
}
.agents-detail-head { display: flex; align-items: center; gap: 10px; }
.agents-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  border: none; cursor: pointer; border-radius: 999px;
  padding: 3px 10px 3px 4px; font-size: 12px; color: inherit;
  background: rgba(127, 127, 127, .2);
}
.agents-toggle.on { color: #fff; }
.agents-knob {
  width: 14px; height: 14px; border-radius: 50%; background: currentColor;
  opacity: .9;
}
.agents-toggle.on .agents-knob { background: #fff; opacity: 1; }
.agents-toggle-lbl { line-height: 1; }
.agents-prompt-lbl {
  display: flex; align-items: center; justify-content: space-between;
  margin: 14px 0 6px; font-size: 13px;
}
.agents-textarea {
  flex: 1 1 auto; min-height: 240px; resize: none; width: 100%;
  border-radius: 10px; padding: 12px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px; line-height: 1.55; color: inherit; outline: none;
}
.agents-textarea:focus { box-shadow: 0 0 0 2px var(--agents-accent); }
.agents-skills {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 10px;
}
.agents-chip {
  font-size: 11px; padding: 3px 8px; border-radius: 999px;
}
/* Выбор знаний своего агента (#251) — чекбоксы с человеческой подписью. */
.agents-skillpick { padding: 4px 2px; }
.agents-skillpick .agents-trow { align-items: flex-start; }
.agents-skillpick .agents-tdesc { white-space: normal; }
.agents-own {
  min-height: 110px; resize: vertical;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; line-height: 1.5;
}

/* Редактор своего агента: поля, грид иконок, выбор тулов. */
.agents-field-lbl {
  font-size: 12px; opacity: .7; margin: 12px 0 5px; display: block;
}
.agents-input {
  width: 100%; border-radius: 9px; padding: 8px 11px; font-size: 13px;
  color: inherit; outline: none;
}
.agents-input:focus { box-shadow: 0 0 0 2px var(--agents-accent); }
.agents-textarea-fixed { flex: 0 0 auto; min-height: 150px; height: 190px; }
.agents-icongrid {
  display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px;
}
.agents-iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  aspect-ratio: 1 / 1; border: 1px solid rgba(127, 127, 127, .3);
  border-radius: 9px; background: transparent; color: inherit; cursor: pointer;
}
.agents-iconbtn:hover { background: rgba(127, 127, 127, .12); }
.agents-iconbtn.sel { border-width: 2px; }
.agents-tools {
  border-radius: 10px; overflow: hidden auto;
  /* flex-item в column-колонке иначе схлопывается в 0 под давлением промпта —
     фиксируем высоту и даём собственный скролл по списку тулов. */
  flex: 0 0 auto; height: 220px; max-height: 220px;
}
.agents-tgroup { border-bottom: 1px solid rgba(127, 127, 127, .16); }
.agents-tgroup:last-child { border-bottom: none; }
.agents-tgroup > summary {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; padding: 8px 12px; font-size: 12px; user-select: none;
}
.agents-tgname { text-transform: capitalize; }
.agents-tcount { font-size: 11px; opacity: .6; }
.agents-trow {
  display: flex; align-items: flex-start; gap: 8px; padding: 5px 12px 5px 26px;
  font-size: 12px; cursor: pointer;
}
.agents-trow:hover { background: rgba(127, 127, 127, .08); }
.agents-trow input { accent-color: var(--agents-accent); margin-top: 2px; }

/* ToolPicker (#87): поиск, ярлык + видимое описание, «выбрать все» по группе. */
.agents-toolwrap { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
.agents-tsearch { font-size: 12px; padding: 6px 10px; }
.agents-tgright { display: flex; align-items: center; gap: 10px; }
.agents-tgsel {
  border: none; background: none; color: var(--agents-accent);
  cursor: pointer; font-size: 11px; padding: 0;
}
.agents-tgsel:hover { text-decoration: underline; }
.agents-tmeta { display: flex; flex-direction: column; min-width: 0; }
.agents-tdesc { font-size: 11px; opacity: .55; }

/* Стартовые подсказки: не сжиматься в flex-колонке и не липнуть к футеру. */
.agents-starters {
  flex: 0 0 auto; min-height: 88px; resize: vertical;
  margin-bottom: 16px; line-height: 1.5;
}

/* Выключенный агент в списке — приглушён, без цветной точки-статуса. */
.agents-item-off { opacity: .55; }
.agents-item-off-lbl {
  margin-left: auto; font-size: 10px; text-transform: uppercase;
  letter-spacing: .04em; opacity: .6;
}

/* Sticky action bar. */
.agents-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; flex: 0 0 auto;
}

/* Тост + инлайн-подтверждение. */
.agents-toast {
  position: absolute; bottom: 68px; left: 50%; transform: translateX(-50%);
  background: rgba(20, 20, 24, .92); color: #fff; font-size: 13px;
  padding: 8px 16px; border-radius: 999px; z-index: 2;
}
.agents-confirm-wrap {
  position: absolute; inset: 0; z-index: 3; display: flex;
  align-items: center; justify-content: center; background: rgba(0, 0, 0, .35);
}
.agents-confirm { width: min(360px, 86%); padding: 18px; border-radius: 12px; }

@media (max-width: 720px) {
  .agents-list { width: 200px; flex-basis: 200px; }
  .set-nav { width: 150px; flex-basis: 150px; }
  .set-content .agents-list { width: 160px; flex-basis: 160px; }
}
