/* Qween Web — стили в духе Apple.
   Вместо плоских панелей — материалы (translucency), вместо сплошных рамок —
   свет по кромке (hairline), движение — на пружинах с передачей скорости жеста.
   Источник принципов: skills/apple-design и skills/mobile-native
   (github.com/emilkowalski/skills — конспект WWDC, переложенный на веб). */

:root {
  color-scheme: light dark;

  /* — поверхности — */
  --bg-grouped: #0b0b0d;
  --surface-1: rgba(255, 255, 255, .06);
  --surface-2: rgba(255, 255, 255, .11);
  --bubble-bot: rgba(255, 255, 255, .065);
  --material-thin: rgba(28, 28, 30, .64);
  --material: rgba(28, 28, 30, .78);
  --material-thick: rgba(22, 22, 24, .84);
  /* Шапка — плотная поверхность, а не стекло: тонкий материал с blur наверху
     читался как «мутное пятно» под статус-баром (жалоба с телефона). */
  --surface-bar: #17171a;
  /* Панель вкладок — плотная и в тон системной полосе, которой iOS
     докрывает низ экрана (окно приложения короче экрана). */
  --tab-solid: #000000;

  /* — штрихи: не рамка, а свет по кромке материала — */
  --hairline: rgba(255, 255, 255, .13);
  --hairline-soft: rgba(255, 255, 255, .07);
  --edge: rgba(255, 255, 255, .10);
  --chip-edge: rgba(255, 255, 255, .07);

  /* — текст: vibrancy, то есть слой, а не «серый» — */
  --text: rgba(255, 255, 255, .97);
  --text-2: rgba(255, 255, 255, .62);
  --text-3: rgba(255, 255, 255, .38);

  /* — акцент: системный синий iOS — */
  --accent: #0a84ff;
  --accent-strong: #0a7bf0;
  --accent-soft: rgba(10, 132, 255, .16);
  --accent-edge: rgba(10, 132, 255, .42);
  --danger: #ff453a;
  --ok: #30d158;
  --warn: #ff9f0a;

  /* — глубина: тень и размытие растут вместе с размером поверхности — */
  --blur-thin: 20px;
  --blur-thick: 32px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .28);
  --shadow-2: 0 10px 30px rgba(0, 0, 0, .32);
  --shadow-sheet: 0 -1px 0 var(--edge) inset, 0 -22px 60px rgba(0, 0, 0, .55);

  /* — радиусы — */
  --r-sm: 12px; --r-md: 16px; --r-lg: 20px; --r-xl: 26px; --r-2xl: 34px;

  /* — движение: ease-out на вход, зеркальная кривая на обратный путь — */
  --ease-out: cubic-bezier(.22, .61, .36, 1);
  --ease-in-out: cubic-bezier(.4, 0, .2, 1);
  --d-press: 100ms;
  --d-quick: 180ms;
  --d-base: 260ms;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  /* Те же величины в чистом виде: --safe-bottom переопределяется из меню, а эти
     читает app.js, чтобы знать настоящие безопасные зоны устройства. */
  --inset-top: env(safe-area-inset-top, 0px);
  --inset-bottom: env(safe-area-inset-bottom, 0px);
  /* Высоту оболочки и «полосу» под ней считает app.js: если iOS отдаёт окно
     короче экрана, оболочка растягивается до экрана (см. stripPx в app.js). */
  --app-h: 100%;
  --strip: 0px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-grouped: #f2f2f7;
    --surface-1: rgba(120, 120, 128, .10);
    --surface-2: rgba(120, 120, 128, .18);
    --bubble-bot: rgba(120, 120, 128, .12);
    --material-thin: rgba(250, 250, 252, .68);
    --material: rgba(250, 250, 252, .80);
    --material-thick: rgba(252, 252, 254, .86);
    --surface-bar: #f7f7f9;
    --tab-solid: #ffffff;
    --hairline: rgba(60, 60, 67, .18);
    --hairline-soft: rgba(60, 60, 67, .10);
    --edge: rgba(255, 255, 255, .85);
    --text: #000;
    --text-2: rgba(60, 60, 67, .62);
    --text-3: rgba(60, 60, 67, .36);
    --accent: #007aff;
    --accent-strong: #0071eb;
    --accent-soft: rgba(0, 122, 255, .12);
    --accent-edge: rgba(0, 122, 255, .38);
    --danger: #ff3b30;
    --ok: #34c759;
    --warn: #ff9500;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .10);
    --shadow-2: 0 10px 30px rgba(0, 0, 0, .14);
    --shadow-sheet: 0 -1px 0 var(--edge) inset, 0 -18px 50px rgba(0, 0, 0, .18);
  }
}

* { box-sizing: border-box; }

html {
  -webkit-tap-highlight-color: transparent;  /* без серой вспышки при тапе */
  -webkit-text-size-adjust: 100%;            /* без раздувания шрифта в ландшафте */
  overscroll-behavior: none;                 /* без pull-to-refresh поверх жестов */
}

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg-grouped);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
               "Segoe UI Variable Text", "Segoe UI", Roboto, system-ui, sans-serif;
  font-size: 17px;           /* базовый размер iOS */
  line-height: 1.47;
  letter-spacing: -.011em;   /* tracking подобран под размер, а не один на всё */
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  
  /* Документ не скроллится вообще: прокручиваются только лента и вход. */
  overflow: hidden;
}

.hidden { display: none !important; }
.muted { color: var(--text-2); }
.error { color: var(--danger); font-size: 15px; margin: 12px 0 0; }

/* Элементы управления: без задержки тапа, без выделения текста и без
   контекстного меню при долгом нажатии. Текст-контент остаётся выделяемым. */
button, a, [role="button"] {
  font: inherit; color: inherit; cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}

/* Отклик живёт на нажатии, а не на отпускании: 100 мс, ease-out */
button, .chip, .model-item, .menu-item {
  transition: transform var(--d-base) var(--ease-out),
              background-color var(--d-quick) var(--ease-out),
              border-color var(--d-quick) var(--ease-out),
              opacity var(--d-quick) var(--ease-out);
}
button:active, .chip:active, .model-item:active, .menu-item:active,
.pressing { transform: scale(.97); transition-duration: var(--d-press); }

/* ----------------------------------------------------------- вход ---- */
.screen.login {
  position: fixed;
  inset: 0;
  height: var(--app-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow-y: auto; -webkit-overflow-scrolling: touch;   /* если экран низкий */
  padding: 32px 24px calc(32px + var(--safe-bottom));
  text-align: center;
  background:
    radial-gradient(120% 70% at 50% -10%, var(--accent-soft), transparent 65%),
    var(--bg-grouped);
}
.login-logo img {
  border-radius: 28%;                       /* «squircle» вместо квадрата */
  box-shadow: var(--shadow-2), 0 0 0 1px var(--hairline-soft);
}
.login h1 {
  margin: 20px 0 8px;
  font-size: clamp(30px, 9vw, 38px); line-height: 1.05;
  letter-spacing: -.022em; font-weight: 700;   /* крупный кегль — плотнее трекинг */
}
.login p { max-width: 330px; margin: 0; font-size: 15px; line-height: 1.4; letter-spacing: -.006em; }
.login form { width: 100%; max-width: 340px; margin-top: 26px; display: grid; gap: 10px; }
.login input {
  width: 100%; padding: 15px 16px; border-radius: var(--r-md);
  border: 1px solid var(--hairline-soft); background: var(--surface-1);
  color: var(--text); font-size: 16px; font-family: inherit;
  text-align: center; letter-spacing: .02em; outline: none;
  transition: border-color var(--d-quick) var(--ease-out),
              box-shadow var(--d-quick) var(--ease-out),
              background-color var(--d-quick) var(--ease-out);
}
.login input:focus {
  border-color: var(--accent-edge); background: var(--surface-2);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
button.primary {
  padding: 15px 16px; border: 0; border-radius: var(--r-md);
  font-size: 17px; font-weight: 600; letter-spacing: -.01em;
  background: var(--accent); color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .22) inset, 0 8px 22px -10px var(--accent-edge);
}

/* Экран загрузки: тот же вид, что у входа, плюс вращающийся индикатор
   и запасной путь — сразу ввести токен, если проверка доступа висит. */
.boot .spinner {
  width: 22px; height: 22px; margin-top: 22px; border-radius: 50%;
  border: 2.5px solid var(--hairline); border-top-color: var(--accent);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.boot .link-btn {
  margin-top: 20px; padding: 8px 10px; border: 0; background: none;
  color: var(--accent); font-size: 15px; text-decoration: underline;
}

/* --------------------------------------------------------- каркас ---- */
/* Оболочка занимает ровно видимую область. Размер берём не из 100dvh: в режиме
   «с иконки на экране Домой» iOS считает dvh короче экрана на высоту
   статус-бара, отсюда и полоса снизу. position: fixed + inset: 0 привязан к
   реальной области отрисовки и не зависит от этих единиц. */
.app {
  position: fixed;
  inset: 0;
  /* height перебивает bottom (переопределение по спецификации): высота бывает
     больше окна, когда iOS оставил снизу полосу системного фона. */
  height: var(--app-h);
  display: flex; flex-direction: column;
  background: var(--bg-grouped);
  animation: app-in var(--d-base) var(--ease-out);
  transition: transform var(--d-base) var(--ease-out), filter var(--d-base) var(--ease-out);
}
@keyframes app-in { from { opacity: 0; } to { opacity: 1; } }

/* Под шторкой слой отступает назад и темнеет — это «push back» из iOS,
   а не просто затемнение поверх. */
.app.behind {
  transform: scale(.972) translateY(4px);
  filter: brightness(.82);
  border-radius: var(--r-2xl);
  overflow: hidden;
}

/* Шапка — плотная поверхность без размытия. Стекло наверху выглядело
   «блюром»: под статус-баром собиралось мутное пятно, а сам чип модели терял
   резкость. Внизу стекло остаётся — там оно читается как панель, а не как
   затемнение над шапкой. */
.topbar {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center; gap: 8px;
  padding: calc(6px + var(--safe-top)) 10px 6px;
  background: var(--surface-bar);
  position: sticky; top: 0; z-index: 20;
}
/* Hairline вместо жёсткого разделителя: появляется, только если под шапкой
   действительно есть контент */
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--hairline); opacity: 0;
  transition: opacity var(--d-base) var(--ease-out);
}
.topbar[data-scrolled="1"]::after { opacity: 1; }
.topbar-leading { width: 44px; height: 44px; }

.model-chip {
  justify-self: center; min-width: 0; max-width: 100%;
  display: flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--surface-1);
  border: 1px solid var(--chip-edge);
  box-shadow: 0 1px 0 var(--edge) inset;
  font-size: 14px; font-weight: 600; letter-spacing: -.01em;
}
.model-chip span:nth-child(2) {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.model-chip .dot {
  flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 0 3px rgba(48, 209, 88, .18);
  transition: background-color var(--d-base) var(--ease-out),
              box-shadow var(--d-base) var(--ease-out);
}
/* Пока модель отвечает — точка дышит акцентом: статус видно, шума нет */
.model-chip.busy .dot {
  background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
  animation: dot-breathe 1.6s var(--ease-in-out) infinite;
}
@keyframes dot-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.22); } }

.icon-btn {
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--accent);
}
.icon-btn:active { background: var(--surface-1); }
/* Кнопка меню подсвечивается, когда открыт экран ИЗ меню (Фото, Видео, Тест):
   активной вкладки на нижней панели в этот момент нет */
.icon-btn.active { background: var(--accent-soft); color: var(--accent); }
.icon-btn.small { width: 30px; height: 30px; border-radius: 50%; color: var(--text-2); }

/* ------------------------------------------------------ сообщения ---- */
.messages {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;   /* прокрутка не улетает на страницу */
  /* Зазор между ходами больше, чем внутри хода: у ответа пузыря нет, и без
     воздуха два соседних хода сливались бы в один абзац. */
  padding: 16px 16px 12px; display: flex; flex-direction: column; gap: 18px;
}
/* Пустой экран — витрина приложения: крупный заголовок, подсказки-карточки */
.empty { margin: auto; text-align: center; width: 100%; max-width: 420px; padding: 8px 4px; position: relative; }
/* Свет за логотипом: тёплое пятно вместо голого квадрата иконки */
.empty::before {
  content: ""; position: absolute; left: 50%; top: -34px; width: 260px; height: 260px;
  margin-left: -130px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 68%);
  opacity: .9;
}
.empty img {
  position: relative;
  border-radius: 28%; width: 68px; height: 68px;
  box-shadow: var(--shadow-2), 0 0 0 1px var(--hairline-soft);
}
.empty h2, .empty .empty-title {
  position: relative;
  margin: 16px 0 6px; font-size: 32px; line-height: 1.06;
  letter-spacing: -.022em; font-weight: 700;
}
.empty p { position: relative; font-size: 15px; line-height: 1.5; margin: 0 auto; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 22px; }
.chips-left { justify-content: flex-start; margin: 10px 0 0; }
.chip {
  padding: 10px 15px; border-radius: 999px; font-size: 14px; letter-spacing: -.008em;
  background: var(--surface-1); border: 1px solid var(--chip-edge);
  box-shadow: 0 1px 0 var(--edge) inset; color: var(--text);
}
.chip:active { background: var(--surface-2); }

/* Подсказки на пустом экране — списком, как в Claude и ChatGPT: иконка,
   заголовок и пояснение. .chip оставлен намеренно: на нём держится
   обработчик отправки в app.js, здесь меняется только форма. */
/* Подсказки на пустом экране — списком, как в Claude и ChatGPT: иконка,
   заголовок и пояснение. .chip оставлен намеренно: на нём держится
   обработчик отправки в app.js, здесь меняется только форма. */
.suggest { position: relative; display: grid; gap: 8px; margin: 22px auto 0; width: 100%; }
.suggest .chip {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 11px 13px; border-radius: var(--r-md);
}
.sc-icon {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; font-size: 17px;
  background: var(--accent-soft); border: 1px solid var(--accent-edge);
}
.sc-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sc-text b { font-size: 15px; font-weight: 600; letter-spacing: -.012em; }
.sc-text i {
  font-style: normal; font-size: 13px; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.msg { display: flex; max-width: 100%; }
.msg.user { justify-content: flex-end; }
/* Ответ модели — колонка: над ним встаёт строка о поиске в интернете,
   а не поджимается сбоку (в строке flex она уезжала в узкую колонку слева). */
.msg.bot { flex-direction: column; align-items: flex-start; }
.bubble {
  max-width: 84%; padding: 10px 14px; border-radius: var(--r-lg);
  font-size: 16.5px; line-height: 1.42; letter-spacing: -.008em;
  word-wrap: break-word; overflow-wrap: anywhere;
}
/* Вопрос — мягкий серый пузырь справа, ответ — просто текст по всей ширине.
   Так устроены Claude, ChatGPT и Grok на iPhone: пузырь нужен только там,
   где его написал человек, а ответ читается как страница. */
.msg.user .bubble {
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface-1) 100%);
  color: var(--text); white-space: pre-wrap;
  border: 1px solid var(--chip-edge);
  border-bottom-right-radius: 7px;                       /* «хвост» у отправителя */
  box-shadow: 0 1px 0 var(--edge) inset;
}
.msg.bot .bubble {
  background: transparent; border: 0; box-shadow: none; padding: 0;
  max-width: 100%; border-radius: 0;
}
/* Свои картинки и файлы в пузыре вопроса видны лучше на акценте */
.msg.user .msg-images img { border-color: var(--chip-edge); }
.msg.bot.error .bubble { color: var(--danger); }

.bubble p { margin: 0 0 8px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble h3, .bubble h4, .bubble h5 {
  margin: 14px 0 6px; font-size: 17px; line-height: 1.25; letter-spacing: -.014em;
}
.bubble ul, .bubble ol { margin: 6px 0; padding-left: 22px; }
.bubble li { margin: 3px 0; }
.bubble a { color: var(--accent); text-decoration: none; }
.bubble strong { font-weight: 650; }

/* Таблица в ответе: модели любят сравнивать варианты таблицей, а на телефоне
   широкая таблица не должна ломать колонку — прокручиваем её боком. */
.md-table-wrap {
  margin: 10px 0; max-width: 100%; overflow-x: auto;
  scrollbar-width: none; border-radius: var(--r-sm);
  border: 1px solid var(--hairline-soft);
}
.md-table-wrap::-webkit-scrollbar { display: none; }
.md-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.md-table th, .md-table td {
  padding: 8px 11px; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--hairline-soft);
  white-space: nowrap;
}
.md-table th {
  font-weight: 650; color: var(--text); background: var(--surface-1);
  position: sticky; top: 0;
}
.md-table td { color: var(--text-2); }
.md-table tr:last-child td { border-bottom: 0; }

/* Рисунок из ответа (```svg): показываем картинку, исходник — по кнопке.
   Модели любят объяснять схемы кодом, а человеку нужно увидеть результат. */
.svg-fig {
  margin: 10px 0; padding: 12px; border-radius: var(--r-md);
  background: var(--surface-1); border: 1px solid var(--hairline-soft);
}
.svg-fig img {
  display: block; width: 100%; max-height: 340px; object-fit: contain;
  background: #fff; border-radius: var(--r-sm);
}
.svg-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.svg-source { margin-top: 10px; }

/* Картинка, нарисованная по голосовой команде («нарисуй…») */
.voice-image {
  display: block; width: 100%; max-width: 320px; margin-top: 6px;
  border-radius: var(--r-md); border: 1px solid var(--hairline-soft);
}

/* Размер текста (меню → Экран): у телефонов и глаз разные настройки */
html[data-text="large"] .bubble { font-size: 18px; }
html[data-text="large"] #input,
html[data-text="large"] .voice-type #voice-input { font-size: 17px; }
html[data-text="large"] .stats,
html[data-text="large"] .source-title { font-size: 13.5px; }
html[data-text="large"] .md-table { font-size: 15.5px; }
html[data-text="huge"] .bubble { font-size: 19.5px; line-height: 1.48; }
html[data-text="huge"] #input,
html[data-text="huge"] .voice-type #voice-input { font-size: 18.5px; }
html[data-text="huge"] .stats,
html[data-text="huge"] .source-title { font-size: 14.5px; }
html[data-text="huge"] .md-table { font-size: 16.5px; }
code.inline {
  background: var(--surface-2); padding: 2px 6px; border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px; letter-spacing: 0;
}

.code {
  margin: 10px 0; border-radius: var(--r-sm); overflow: hidden;
  background: rgba(0, 0, 0, .26); border: 1px solid var(--hairline-soft);
}
.code-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 10px; font-size: 12px; color: var(--text-2); letter-spacing: .01em;
  border-bottom: 1px solid var(--hairline-soft);
}
.code-head button {
  background: none; border: 0; color: var(--accent); font-size: 12.5px;
  padding: 4px 6px; border-radius: 8px;
}
.code pre { margin: 0; padding: 12px; overflow-x: auto; }
.code code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; line-height: 1.55; white-space: pre; letter-spacing: 0;
  color: var(--text);
}

/* «Печатает» и медленное пробуждение бесплатного тарифа */
.typing { display: inline-flex; gap: 4px; align-items: center; padding: 3px 0; }
.typing i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--text-3);
  animation: blink 1.25s var(--ease-in-out) infinite both;
}
.typing i:nth-child(2) { animation-delay: .16s; }
.typing i:nth-child(3) { animation-delay: .32s; }
.typing .wake { font-size: 14px; color: var(--text-2); line-height: 1.4; }
@keyframes blink {
  0%, 80%, 100% { opacity: .25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-1px); }
}

/* Каретка в конце потока — видно, что текст ещё пишется */
.caret {
  display: inline-block; width: 2px; height: 1.05em; margin-left: 2px;
  vertical-align: -.16em; border-radius: 1px; background: var(--accent);
  animation: caret 1.1s steps(1, end) infinite;
}
@keyframes caret { 0%, 45% { opacity: 1; } 46%, 100% { opacity: .15; } }

.stats {
  display: flex; flex-direction: column; gap: 1px;
  font-size: 12.5px; margin-top: 9px; letter-spacing: -.004em; color: var(--text-3);
}
/* Подпись модели — светлее сноски: видно, кто ответил, но без второго заголовка */
.stats .st-model { font-weight: 600; color: var(--text-2); }
.stats .st-meta { font-size: 12px; }

/* Строка о поиске над ответом. Живёт ВНЕ пузыря: сам пузырь перерисовывается
   на каждом фрагменте ответа и стёр бы её. */
.web-status {
  margin: 0 2px 6px; padding: 0 2px;
  font-size: 12.5px; line-height: 1.45; letter-spacing: -.005em;
  color: var(--text-2); word-break: break-word; max-width: 92%;
}
.web-status.is-work { color: var(--accent); }
.web-status.is-think, .web-status.is-empty, .web-status.is-done { color: var(--text-3); }
/* Пока идёт поиск — строка дышит: видно, что работа идёт, а не зависла */
.web-status.is-work, .web-status.is-think {
  animation: webBreathe 1.6s var(--ease-in-out) infinite both;
}
@keyframes webBreathe { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* Источники под ответом. Свёрнуты в одну строку: пять-шесть карточек с
   заголовком, выдержкой и сайтом занимали почти экран на телефоне. Список
   раскрывается тапом по строке «Источники · N». */
.sources { margin-top: 10px; }
.sources-head {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 10px; border-radius: 999px;
  background: var(--surface-1); border: 1px solid var(--chip-edge);
  font-size: 12px; font-weight: 600; letter-spacing: .01em;
  color: var(--text-2);
}
.sources-head:active { background: var(--surface-2); }
.sources-head .sources-chevron {
  display: inline-grid; place-items: center; color: var(--text-3);
  transition: transform var(--d-quick) var(--ease-out);
}
.sources.open .sources-chevron { transform: rotate(180deg); }
.sources-list { display: grid; gap: 4px; margin-top: 8px; }
.sources:not(.open) .sources-list { display: none; }
/* Журнал поиска: те же строки, что раньше были отдельным экраном вкладки
   «Поиск» (какие запросы ушли, что нашлось, что прочитано). */
.sources-log {
  display: grid; gap: 2px; margin-bottom: 2px;
  padding: 7px 9px; border-radius: var(--r-sm);
  background: var(--surface-1); border: 1px solid var(--hairline-soft);
}
.sources-log-line {
  font-size: 11.5px; color: var(--text-2); line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.source {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 9px; border-radius: var(--r-sm);
  background: var(--surface-1); border: 1px solid var(--hairline);
  text-decoration: none; color: inherit;
}
.source:active { background: var(--surface-2); }
/* Номер источника — по нему удобно ссылаться в переписке («источник 3») */
.source-num {
  flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; font-size: 10.5px; font-weight: 600;
  background: var(--surface-2); color: var(--text-2);
}
.source-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
/* Заголовок в одну строку: длинные названия статей раздували список */
.source-title {
  font-size: 12.5px; color: var(--text); line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.source-host { font-size: 11px; color: var(--text-3); }

/* Инструменты под ответом: озвучка, копирование и повтор другим ходом.
   Круглые иконки, как в ChatGPT/Claude: приглушены, пока на них не навели
   или не нажали — это действия «на потом», а не призыв к нажатию. */
.bubble-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.tool-btn {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; padding: 0; border-radius: 50%;
  font-size: 12.5px; letter-spacing: -.005em;
  background: var(--surface-1); border: 1px solid var(--chip-edge);
  color: var(--text-2);
}
.tool-btn:active { background: var(--surface-2); }
.tool-btn.speaking {
  color: var(--accent); background: var(--accent-soft); border-color: var(--accent-edge);
}
.tool-btn.wide { width: auto; padding: 0 12px; border-radius: 999px; gap: 6px; }
.tool-btn svg { flex: 0 0 auto; }
/* Кнопки без подписи (только иконка) — пустая подпись не должна занимать место */
.tool-btn .tb-label:empty { display: none; }
.tool-btn[data-done="1"] { color: var(--ok); border-color: rgba(48, 209, 88, .35); }

/* ------------------------------------------------------- установка --- */
.install-hint {
  display: flex; align-items: center; gap: 10px;
  margin: 0 12px 8px; padding: 11px 12px; border-radius: var(--r-md);
  background: var(--accent-soft); border: 1px solid var(--accent-edge);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font-size: 13.5px; line-height: 1.35; color: var(--text);
}
.install-hint span { flex: 1; }

/* --------------------------------------------------------- ввод ------ */
/* Возврат к последнему сообщению: круглая кнопка над полем ввода. Видна
   только когда человек ушёл читать вверх — в обычном потоке не мешает. */
.down-btn {
  position: absolute; right: 14px; top: -50px; z-index: 12;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; color: var(--text-2);
  background: var(--material-thick);
  backdrop-filter: saturate(180%) blur(var(--blur-thin));
  -webkit-backdrop-filter: saturate(180%) blur(var(--blur-thin));
  border: 1px solid var(--hairline); box-shadow: var(--shadow-2);
  animation: downIn var(--d-base) var(--ease-out) both;
}
.down-btn:active { color: var(--accent); background: var(--accent-soft); }
@keyframes downIn { from { opacity: 0; transform: translateY(6px) scale(.9); } }

.composer {
  /* Отступ снизу больше не нужен: нижнюю кромку держит панель вкладок,
     она же берёт на себя safe-area. */
  padding: 8px 12px 10px;
  position: relative;                  /* кнопка «вниз» встаёт над полем */
  background: var(--material);
  backdrop-filter: saturate(180%) blur(var(--blur-thin));
  -webkit-backdrop-filter: saturate(180%) blur(var(--blur-thin));
  border-top: 1px solid transparent;   /* кромка появляется на скролле */
  transition: border-color var(--d-base) var(--ease-out);
}
.composer[data-scrolled="1"] { border-top-color: var(--hairline); }
/* Чип режима поиска: раньше это был отдельный экран «Поиск», теперь — одна
   строка над полем ввода. Свёрнут в подпись, выбор открывается шторкой. */
.composer-tools {
  display: flex; gap: 6px; align-items: center;
  margin: 0 2px 8px; overflow-x: auto; scrollbar-width: none;
}
.composer-tools::-webkit-scrollbar { display: none; }
.web-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; font-size: 12.5px; white-space: nowrap;
  color: var(--text-2);
}
.web-chip .web-chip-icon { font-size: 13px; line-height: 1; }
.web-chip.active, .web-chip:not(.off) { color: var(--accent); border-color: var(--accent-edge); background: var(--accent-soft); }
.web-chip.off { color: var(--text-3); }
.web-chip:disabled { opacity: .5; }
.composer-row { display: flex; align-items: flex-end; gap: 8px; }
#input {
  flex: 1; resize: none; max-height: 140px; min-height: 44px;
  padding: 11px 15px; border-radius: 22px; font-size: 16px; line-height: 1.35;
  font-family: inherit; letter-spacing: -.008em;
  background: var(--surface-1); border: 1px solid var(--chip-edge); color: var(--text);
  outline: none; overflow-y: auto; scrollbar-width: none;
  transition: border-color var(--d-quick) var(--ease-out),
              box-shadow var(--d-quick) var(--ease-out),
              background-color var(--d-quick) var(--ease-out);
}
#input::-webkit-scrollbar { display: none; }
#input::placeholder { color: var(--text-3); }
#input:focus { border-color: var(--accent-edge); box-shadow: 0 0 0 4px var(--accent-soft); }
.send {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; border: 0;
  display: grid; place-items: center; color: #fff; background: var(--accent);
  box-shadow: 0 6px 18px -8px var(--accent-edge);
}
.send:disabled { opacity: .38; box-shadow: none; }
.send.stop { background: var(--surface-1); border: 1px solid var(--hairline-soft); color: var(--danger); }

/* -------------------------------------------------------- шторки ----- */
.sheet {
  position: fixed; inset: 0; height: var(--app-h);
  z-index: 50; display: flex; align-items: flex-end;
}

/* Прозрачностью управляет JS вместе с высотой шторки — затемнение и движение
   идут синхронно, без расхождения между слоями. */
.sheet-backdrop {
  position: absolute; inset: 0; background: rgba(0, 0, 0, .55);
  opacity: 0; will-change: opacity;
}
.sheet-panel {
  position: relative; display: flex; flex-direction: column;
  width: 100%; max-height: 88dvh; overflow: hidden;
  background: var(--material-thick);
  backdrop-filter: saturate(180%) blur(var(--blur-thick));
  -webkit-backdrop-filter: saturate(180%) blur(var(--blur-thick));
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  box-shadow: var(--shadow-sheet);
  transform: translate3d(0, 100%, 0);   /* позицию ведёт пружина в app.js */
  transform-origin: 50% 100%;
  will-change: transform;
}

/* Зона жеста: шторку тянут за шапку, содержимое остаётся прокручиваемым */
.sheet-head { padding: 6px 18px 0; touch-action: none; cursor: grab; }
.sheet-head:active, .sheet-panel.dragging .sheet-head { cursor: grabbing; }
.sheet-grabber {
  width: 36px; height: 5px; border-radius: 3px; background: var(--text-3);
  margin: 4px auto 12px;
}
.sheet h3 {
  margin: 0 0 12px; font-size: 20px; line-height: 1.15;
  letter-spacing: -.018em; font-weight: 700;
}
.sheet-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 4px 18px calc(20px + var(--safe-bottom) + var(--strip));
}

/* Меню — inset grouped список, как в настройках iOS */
.menu-body { display: grid; }
.menu-item {
  text-align: left; padding: 14px 16px; font-size: 16.5px; letter-spacing: -.01em;
  background: var(--surface-1); color: var(--text);
  border: 1px solid var(--hairline-soft); border-bottom-width: 0; border-radius: 0;
}
.menu-item:first-of-type { border-radius: var(--r-md) var(--r-md) 0 0; }
.menu-item:last-of-type {
  border-radius: 0 0 var(--r-md) var(--r-md);
  border-bottom-width: 1px;
}
.menu-item:active { background: var(--surface-2); }
.menu-item.danger { color: var(--danger); }
.version { font-size: 13px; text-align: center; margin: 18px 0 0; }

/* подсказка под настройками экрана в меню */
.drawer-hint { font-size: 12.5px; line-height: 1.45; margin: 8px 4px 0; }

.model-list { display: grid; gap: 6px; }
.model-group-title {
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
  text-transform: uppercase; letter-spacing: .06em; margin: 18px 4px 6px;
}
.model-list > .model-group-title:first-child { margin-top: 4px; }
/* Раздел списка: «Бесплатные» и «Платные». Между разделами — черта и отступ,
   чтобы граница читалась, а не сливалась с подзаголовками провайдеров. */
.model-group-title.section {
  display: flex; align-items: baseline; gap: 8px;
  color: var(--text); font-size: 13px; letter-spacing: .08em;
  margin: 24px 4px 10px; padding-top: 14px;
  border-top: 1px solid var(--hairline-soft);
}
.model-list > .model-group-title.section:first-child {
  margin-top: 4px; padding-top: 0; border-top-width: 0;
}
.model-group-title.section .sec-note {
  font-size: 12px; font-weight: 500; color: var(--text-3);
  text-transform: none; letter-spacing: 0;
}
.model-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 12px 14px; border-radius: var(--r-md); text-align: left;
  background: var(--surface-1); border: 1px solid var(--hairline-soft);
}
.model-item.active { background: var(--accent-soft); border-color: var(--accent-edge); }
.model-item .mi-body { flex: 1; min-width: 0; }
.model-item .mi-name {
  display: flex; align-items: center; font-size: 16px; font-weight: 600;
  letter-spacing: -.012em;
}
/* Подпись под названием — «для чего модель лучше всего». Крупнее и заметнее
   замеров: человек ищет модель по задаче, а не по числу tok/s. */
.model-item .mi-about {
  font-size: 13px; color: var(--text-2); margin-top: 3px; line-height: 1.35;
}
.model-item .mi-meta { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.model-item .mi-check { color: var(--accent); font-weight: 700; font-size: 17px; }
.tag-free, .tag-paid, .tag-default {
  font-size: 10px; padding: 2px 7px; border-radius: 999px; font-weight: 700;
  letter-spacing: .04em; margin-left: 6px; white-space: nowrap;
}
.tag-free { background: rgba(48, 209, 88, .18); color: var(--ok); }
.tag-paid { background: rgba(255, 159, 10, .18); color: var(--warn); }
/* «По умолчанию» — ответ на вопрос «а с чего я вообще начинаю» */
.tag-default { background: var(--accent-soft); color: var(--accent); }

/* Поиск по списку моделей: моделей больше тридцати, искать надо словом
   (название, задача или провайдер), а не глазами. */
.model-search { margin: 4px 0 12px; }

/* бейдж в шапке — тот же значок, но мельче */
.chip-price { flex: 0 0 auto; }
.chip-price .tag-free, .chip-price .tag-paid { margin-left: 0; font-size: 9.5px; padding: 1px 6px; }

.legend { font-size: 12.5px; color: var(--text-2); margin: 0 0 14px; line-height: 1.7; }
.legend .tag-free, .legend .tag-paid { margin-left: 0; }
.legend.empty-note { color: var(--text-3); font-style: italic; }

/* Выбор команды агентов: список наборов, как чипы настроек. У каждого —
   иконка, название и пояснение одной строкой. */
.teams { display: grid; gap: 8px; margin: 2px 0 4px; }
.teams .chip {
  display: flex; align-items: center; gap: 11px; text-align: left;
  padding: 11px 13px; border-radius: var(--r-md);
}
.teams .chip.active {
  background: var(--accent-soft); border-color: var(--accent-edge);
  box-shadow: 0 1px 0 var(--edge) inset, 0 0 0 1px var(--accent-edge);
}
.team-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.team-body b { font-size: 15px; font-weight: 600; letter-spacing: -.012em; }
.team-body i {
  font-style: normal; font-size: 12.5px; color: var(--text-2); line-height: 1.35;
}
.chip.active .team-body i { color: var(--text-2); }

/* --------------------------------------------------------- тост ------ */
.toast {
  position: fixed; left: 50%; bottom: calc(150px + var(--safe-bottom)); z-index: 80;
  max-width: calc(100% - 32px); text-align: center;
  padding: 12px 18px; border-radius: 999px;
  font-size: 15px; font-weight: 500; letter-spacing: -.01em;
  background: var(--material-thick);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--hairline-soft);
  box-shadow: var(--shadow-2);
  transform: translate3d(-50%, 0, 0);   /* дальше двигает пружина */
  will-change: transform, opacity;
}

/* ----------------------------------------------------- вложения ------ */
.attach {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  border: 0; background: transparent; color: var(--text-2);
}
.attach.ready { color: var(--accent); background: var(--accent-soft); }
@keyframes micPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .4; transform: scale(.88); }
}

.attachments {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px;
  scrollbar-width: none;
}
.attachments::-webkit-scrollbar { display: none; }

.attachment {
  position: relative; flex: 0 0 auto;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 26px 6px 6px; border-radius: var(--r-sm); max-width: 220px;
  background: var(--surface-1); border: 1px solid var(--hairline-soft);
  box-shadow: 0 1px 0 var(--edge) inset;
}
.attachment img {
  width: 40px; height: 40px; object-fit: cover; border-radius: 9px; display: block;
}
.attachment .file-badge {
  width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font-size: 10px; font-weight: 700; text-transform: uppercase;
}
.attachment .a-body { min-width: 0; }
.attachment .a-name {
  font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 130px;
}
.attachment .a-size { font-size: 11px; color: var(--text-2); }
.attachment .a-remove {
  position: absolute; top: -7px; right: -7px;
  width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--hairline);
  background: var(--material-thick); color: var(--text-2);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: 13px; line-height: 1; display: grid; place-items: center; padding: 0;
}
.attachment .a-remove:active { color: var(--danger); }
.attachment.broken { border-color: rgba(255, 69, 58, .5); }

.attach-hint {
  margin: 0 0 8px; padding: 8px 11px; border-radius: var(--r-sm); font-size: 13px;
  line-height: 1.4; color: var(--text); background: rgba(255, 159, 10, .12);
  border: 1px solid rgba(255, 159, 10, .3);
}
.link-btn {
  background: none; border: 0; padding: 0; font-size: 13px; font-weight: 600;
  color: var(--accent);
}

/* картинки внутри сообщения пользователя */
.bubble .msg-images { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.bubble .msg-images img {
  max-width: 100%; max-height: 240px; border-radius: var(--r-sm); display: block;
}
.bubble .msg-files { display: grid; gap: 4px; margin-bottom: 8px; }
.bubble .msg-files span {
  font-size: 12.5px; padding: 5px 9px; border-radius: 8px;
  background: rgba(255, 255, 255, .16); display: inline-block;
}

/* пометка vision в списке моделей */
.mi-vision { font-size: 12px; margin-left: 6px; opacity: .9; }

/* --------------------------------------------- вкладки и медиа ------ */
/* Панель вкладок — часть каркаса: она не «накрывает» экран, а забирает
   высоту у панелей. Поэтому полосы прокрутки и ввод не уезжают под неё. */
.panes { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.tabbar {
  /* Три вкладки — самые нужные (чат, голос, агенты); остальное (Поиск в чате,
     Фото, Видео, Тест моделей) живёт в строке ввода и в меню. */
  display: grid; grid-template-columns: repeat(3, 1fr);
  /* Плотный цвет вместо материала: на iPhone окно приложения короче экрана
     на высоту статус-бара, и последние ~62 px экрана iOS дорисовывает своим
     фоном (у нас это чистый чёрный — см. background_color в манифесте).
     Стеклянная панель на этом месте читалась как отдельная чёрная полоса под
     вкладками; теперь панель и полоса одного цвета и сливаются. */
  background: var(--tab-solid);
  border-top: 1px solid var(--hairline);
  box-shadow: 0 1px 0 var(--edge) inset;
  /* Сумма, а не max: оболочка выросла на --strip, поэтому панель обязана
     вырасти на ту же величину — иначе её содержимое съедет вниз вместе с
     оболочкой (и окажется за кромкой окна). Кнопки при этом стоят там же,
     где стояли. */
  padding-bottom: calc(var(--safe-bottom) + var(--strip));
  transition: padding-bottom var(--d-base) var(--ease-out);
}
.tab-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 2px 5px; border: 0; background: none;
  color: var(--text-2); font-size: 10px; letter-spacing: .005em;
}
/* Активная вкладка — не только цветом: под иконкой появляется мягкое
   пятно акцента (индикатор как в iOS/Material), пятно шире иконки за счёт
   box-shadow, поэтому вёрстка не сдвигается ни на пиксель. */
.tab-btn svg {
  border-radius: 10px;
  transition: background-color var(--d-base) var(--ease-out),
              box-shadow var(--d-base) var(--ease-out);
}
.tab-btn.active svg {
  background: var(--accent-soft);
  box-shadow: 0 0 0 5px var(--accent-soft);
}
.tab-btn.active { color: var(--accent); }
.tab-btn.pressing { transform: none; opacity: .7; }
.tab-btn.pressing svg { background: var(--surface-2); box-shadow: none; }

.pane-scroll {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 14px 12px 18px;
  display: flex; flex-direction: column; gap: 12px;
}

/* ---------------------------------------------- голосовой чат -------
   Отдельный экран разговора: сверху лента (она же история), снизу — сцена
   с живой сферой и большой кнопкой. Сфера — состояние разговора: дышит в
   покое, расходится кругами при слушании, пульсирует во время ответа. */
.voice-log {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 12px 6px;
}
/* Пустая лента — сама подсказка, а не отдельный экран */
.voice-empty {
  margin: auto 10px; text-align: center; font-size: 13.5px; line-height: 1.55;
  color: var(--text-2);
}
.voice-msg { display: flex; }
.voice-msg.user { justify-content: flex-end; }
.voice-msg .bubble { max-width: 88%; }
.voice-tools { display: flex; gap: 8px; margin-top: 8px; }

.voice-stage {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 8px 14px 12px;
  background: var(--material);
  backdrop-filter: saturate(180%) blur(var(--blur-thin));
  -webkit-backdrop-filter: saturate(180%) blur(var(--blur-thin));
  border-top: 1px solid var(--hairline);
  box-shadow: 0 1px 0 var(--edge) inset;
}
.voice-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
/* Что услышали — пока говоришь: слова появляются по мере речи */
.voice-heard {
  margin: 0; max-height: 48px; overflow: hidden;
  font-size: 15px; line-height: 1.35; text-align: center; color: var(--text);
}
.voice-status {
  margin: 0; font-size: 13px; letter-spacing: -.008em; color: var(--text-2);
}

.orb { position: relative; width: 104px; height: 104px; display: grid; place-items: center; }
.orb-halo {
  position: absolute; inset: -30px; border-radius: 50%; opacity: .5;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
  transition: opacity var(--d-base) var(--ease-out);
}
.orb-ring {
  position: absolute; inset: 0; border-radius: 50%; opacity: 0;
  border: 1.5px solid var(--accent-edge);
}
.orb-core {
  position: relative; width: 60px; height: 60px; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #8ccbff, var(--accent) 64%);
  box-shadow: 0 0 26px -4px var(--accent-edge);
  animation: orbBreathe 4.6s var(--ease-in-out) infinite both;
}
/* Слушаю: сфера дышит чаще, от неё расходятся круги */
.orb[data-state="listening"] .orb-halo { opacity: .9; }
.orb[data-state="listening"] .orb-core { animation-duration: 1.4s; }
.orb[data-state="listening"] .orb-ring { animation: orbRing 1.9s var(--ease-out) infinite; }
.orb[data-state="listening"] .orb-ring.r2 { animation-delay: .95s; }
/* Думаю: сфера сжимается — видно, что ход ушёл на сервер */
.orb[data-state="thinking"] .orb-core { animation: orbThink 1.05s var(--ease-in-out) infinite both; }
/* Говорю: сфера «звучит» — быстрая пульсация */
.orb[data-state="speaking"] .orb-halo { opacity: .85; }
.orb[data-state="speaking"] .orb-core { animation: orbSpeak .5s var(--ease-in-out) infinite alternate both; }
@keyframes orbBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes orbRing {
  0% { transform: scale(.6); opacity: .7; }
  100% { transform: scale(1.34); opacity: 0; }
}
@keyframes orbThink { 0%, 100% { transform: scale(.86); opacity: .72; } 50% { transform: scale(1); opacity: 1; } }
@keyframes orbSpeak { from { transform: scale(.92); } to { transform: scale(1.12); } }

/* Большая кнопка разговора: главный орган управления на этом экране */
.voice-btn {
  width: 62px; height: 62px; border-radius: 50%; border: 0;
  display: grid; place-items: center; color: #fff; background: var(--accent);
  box-shadow: 0 10px 24px -10px var(--accent-edge);
}
.voice-btn svg { width: 26px; height: 26px; }
.voice-btn.listening {
  background: var(--danger); box-shadow: 0 10px 24px -10px rgba(255, 69, 58, .6);
  animation: micPulse 1.15s var(--ease-in-out) infinite both;
}
.voice-btn:disabled { opacity: .4; box-shadow: none; }

.voice-type { display: flex; align-items: flex-end; gap: 8px; width: 100%; }
.voice-type #voice-input {
  flex: 1; resize: none; max-height: 96px; min-height: 44px; padding: 11px 14px;
  border-radius: var(--r-md); font-family: inherit; font-size: 16px; line-height: 1.35;
  background: var(--surface-1); border: 1px solid var(--chip-edge); color: var(--text);
  outline: none; scrollbar-width: none;
}
.voice-type #voice-input::-webkit-scrollbar { display: none; }
.voice-type #voice-input::placeholder { color: var(--text-3); }
.voice-type #voice-input:focus { border-color: var(--accent-edge); box-shadow: 0 0 0 4px var(--accent-soft); }

/* На низком экране сцена должна остаться целиком: сфера уступает место ленте */
@media (max-height: 660px) {
  .orb { width: 84px; height: 84px; }
  .orb-core { width: 50px; height: 50px; }
  .voice-heard { font-size: 14px; max-height: 38px; }
  .voice-stage { gap: 6px; padding-bottom: 10px; }
}

/* Карточка — это группа внутри листа, как inset-блок в настройках iOS */
.card {
  background: var(--bubble-bot); border: 1px solid var(--hairline-soft);
  border-radius: var(--r-lg); padding: 14px;
  box-shadow: 0 1px 0 var(--edge) inset;
}
.card-head { display: flex; align-items: center; gap: 8px; }
.card h3 {
  flex: 1; margin: 0; font-size: 18px; line-height: 1.2;
  letter-spacing: -.016em; font-weight: 650;
}
.card-hint { font-size: 12px; color: var(--text-2); }
.card-sub { font-size: 13.5px; line-height: 1.45; color: var(--text-2); margin: 6px 0 12px; }
.card-note { font-size: 12.5px; line-height: 1.4; color: var(--text-3); margin: 8px 0 0; }
.card-error { font-size: 13.5px; line-height: 1.4; color: var(--danger); margin: 10px 0 0; }

.field {
  width: 100%; resize: none; padding: 11px 13px; border-radius: var(--r-md);
  font-family: inherit; font-size: 16px; line-height: 1.35; letter-spacing: -.008em;
  background: var(--surface-1); border: 1px solid var(--chip-edge); color: var(--text);
  outline: none; scrollbar-width: none;
  transition: border-color var(--d-quick) var(--ease-out),
              box-shadow var(--d-quick) var(--ease-out);
}
.field::-webkit-scrollbar { display: none; }
.field::placeholder { color: var(--text-3); }
.field:focus { border-color: var(--accent-edge); box-shadow: 0 0 0 4px var(--accent-soft); }

.opt-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin: 14px 2px 6px; }
.opt-row { display: flex; flex-wrap: wrap; gap: 6px; }
.opt {
  padding: 8px 12px; border-radius: 999px; font-size: 13.5px; letter-spacing: -.006em;
  background: var(--surface-1); border: 1px solid var(--chip-edge); color: var(--text);
}
.opt.active {
  background: var(--accent-soft); border-color: var(--accent-edge);
  color: var(--accent); font-weight: 600;
}
.opt:disabled { opacity: .45; }

button.wide { width: 100%; margin-top: 14px; }
button.ghost {
  padding: 12px 14px; border-radius: var(--r-md);
  font-size: 15.5px; font-weight: 550; letter-spacing: -.01em;
  background: var(--surface-1); border: 1px solid var(--chip-edge); color: var(--accent);
  box-shadow: 0 1px 0 var(--edge) inset;
}
button.ghost:active { background: var(--surface-2); }

.progress {
  display: flex; align-items: center; gap: 10px; margin-top: 12px;
  font-size: 13px; color: var(--text-2);
}
/* Неопределённый прогресс: длительность генерации непредсказуема (3–90 с),
   поэтому врём не процентом, а ровным ходом. */
.progress-bar {
  position: relative; flex: 1; height: 4px; border-radius: 2px;
  background: var(--surface-2); overflow: hidden;
}
.progress-bar i {
  position: absolute; top: 0; bottom: 0; width: 40%; border-radius: 2px;
  background: var(--accent); animation: slide 1.4s var(--ease-in-out) infinite;
}
@keyframes slide { from { left: -40%; } to { left: 100%; } }

.result { margin-top: 14px; }
.result img {
  width: 100%; display: block; border-radius: var(--r-md);
  border: 1px solid var(--hairline-soft);
}
.result-meta { font-size: 12px; line-height: 1.45; color: var(--text-3); margin: 8px 0 0; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.action {
  padding: 9px 14px; border-radius: 999px; font-size: 14px;
  background: var(--surface-1); border: 1px solid var(--chip-edge); color: var(--accent);
}
.action:active { background: var(--surface-2); }

.preview { position: relative; margin-top: 12px; }
.preview img, .preview video {
  width: 100%; max-height: 340px; display: block; object-fit: contain;
  border-radius: var(--r-md); background: #000; border: 1px solid var(--hairline-soft);
}
.frames {
  display: flex; gap: 6px; overflow-x: auto; margin-top: 10px; scrollbar-width: none;
}
.frames::-webkit-scrollbar { display: none; }
.frames img {
  flex: 0 0 auto; width: 74px; height: 74px; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--hairline-soft);
}

/* Вывод анализа — те же пузыри, что в чате: не заводим второй язык вёрстки */
.out { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.out .bubble { max-width: 100%; }

.movie-canvas {
  width: 100%; display: block; margin-top: 12px;
  border-radius: var(--r-md); background: #000;
}
/* Готовый ролик играем здесь же: ссылки на файл в системе не всегда удобны */
.movie-player {
  width: 100%; display: block; margin-top: 12px;
  border-radius: var(--r-md); background: #000;
}

/* ------------------------------------------- адаптация и доступность -- */
/* На большом экране разговор держится колонкой, а не растягивается на монитор */
@media (min-width: 820px) {
  /* На широком экране разговор — колонка по центру. Смещение задаём явно:
     у fixed-элемента auto-поля не центрируют его при left/right: 0. */
  .app {
    left: 50%; right: auto; width: 780px; margin-left: -390px;
    box-shadow: 0 0 0 1px var(--hairline-soft);
  }
  .messages { padding: 18px 20px 12px; gap: 12px; }
  .composer { padding: 10px 16px 14px; }
  .sheet-panel { max-width: 780px; margin: 0 auto; }
  .toast { bottom: calc(126px + var(--safe-bottom)); }
  .chips-left { justify-content: flex-start; }
}

/* Клавиатурный фокус: мышь и палец остаются без рамок, а Tab — видно.
   Поля ввода и текстовые области исключены — у них своя мягкая обводка. */
:focus-visible:not(input):not(textarea):not(select) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-height: 700px) {
  /* Экран короткий (телефон в альбомной ориентации, окно браузера):
     витрина должна помещаться целиком, поэтому она сжимается. */
  .empty h2, .empty .empty-title { font-size: 26px; margin: 12px 0 4px; }
  .empty img { width: 56px; height: 56px; }
  .empty p { font-size: 14px; }
  .suggest { margin-top: 16px; gap: 6px; }
  .suggest .chip { padding: 9px 12px; }
  .sc-icon { width: 30px; height: 30px; font-size: 15px; }
}

/* Меньше движения — но не меньше отклика: вместо слайдов и пружин короткие
   затухания и затемнение на нажатии */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .16s !important;
  }
  button:active, .chip:active, .model-item:active, .menu-item:active,
  .pressing { transform: none; opacity: .72; }
  .app.behind { transform: none; filter: brightness(.86); }
}

/* Плотнее материал, если просили меньше прозрачности */
@media (prefers-reduced-transparency: reduce) {
  .topbar, .composer, .sheet-panel, .toast, .tabbar, .attachment .a-remove {
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .topbar, .composer, .sheet-panel, .toast, .tabbar {
    background: var(--bg-grouped);
  }
}

/* Повышенный контраст: мягкие hairlines уступают явным границам */
@media (prefers-contrast: more) {
  :root {
    --hairline: rgba(255, 255, 255, .45);
    --hairline-soft: rgba(255, 255, 255, .32);
    --text-2: rgba(255, 255, 255, .84);
  }
  .msg.bot .bubble, .chip, .model-item, .menu-item { border-color: var(--hairline); }
}
@media (prefers-contrast: more) and (prefers-color-scheme: light) {
  :root {
    --hairline: rgba(0, 0, 0, .5);
    --hairline-soft: rgba(0, 0, 0, .38);
    --text-2: rgba(60, 60, 67, .84);
  }
}

/* ------------------------------------------------ агенты ------------ */
/* Журнал работы команды — не чат, а протокол: строки-факты (кто, что,
   чем кончилось). Моноширинный шрифт только там, где он помогает читать
   пути и вывод песочницы. */

.agent-models { margin-top: 14px; }
.agent-models summary {
  font-size: 13.5px; font-weight: 600; color: var(--text-2);
  padding: 6px 0; cursor: pointer;
}
.agent-models summary::marker { color: var(--text-3); }
.agent-select {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 13.5px; color: var(--text-2); margin: 8px 0 0;
}
.agent-select select {
  flex: 1; max-width: 62%; padding: 8px 10px; font: inherit; font-size: 13.5px;
  color: var(--text); background: var(--surface-1);
  border: 1px solid var(--chip-edge); border-radius: var(--r-sm);
}
.agent-select select:disabled { opacity: .5; }

.agent-log {
  margin-top: 8px; display: flex; flex-direction: column; gap: 6px;
  max-height: 52vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.agent-line {
  font-size: 13px; line-height: 1.42; color: var(--text-2);
  padding: 7px 10px; border-radius: var(--r-sm);
  background: var(--surface-1); border: 1px solid var(--hairline-soft);
  word-break: break-word;
}
.agent-line b { color: var(--text); font-weight: 600; }
.agent-line ul { margin: 6px 0 0; padding-left: 18px; }
.agent-line li { margin: 0 0 3px; }

.agent-line.is-head { background: var(--accent-soft); border-color: var(--accent-edge); color: var(--text); }
.agent-line.is-agent {
  display: flex; align-items: baseline; gap: 8px; background: none;
  border: 0; padding: 8px 2px 2px; font-size: 12.5px;
}
.agent-who { color: var(--accent); font-weight: 650; }
.agent-model { font-size: 11.5px; }

.agent-line.is-msg { color: var(--text); }
.agent-text { margin-top: 4px; }
.agent-text p { margin: 0 0 6px; }
.agent-text p:last-child { margin-bottom: 0; }

.agent-line.is-tool, .agent-line.is-file {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 12px; background: none; border: 0; padding: 3px 4px;
}
.agent-tool-name { color: var(--text); }
.agent-tool-state {
  font-family: inherit; font-size: 10.5px; font-weight: 700; letter-spacing: .02em;
  padding: 1px 6px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2);
}
.agent-line:not(.is-bad) .agent-tool-state { color: var(--ok); }
.agent-line.is-bad { color: var(--danger); }
.agent-line.is-bad .agent-tool-state { color: var(--danger); }

.agent-line.is-run { background: var(--surface-2); }
.agent-run-head { font-size: 12px; color: var(--text-2); }
.agent-line.is-run pre {
  margin: 6px 0 0; padding: 8px 10px; border-radius: var(--r-sm);
  background: rgba(0, 0, 0, .28); color: var(--text);
  font-size: 11.5px; line-height: 1.45; white-space: pre-wrap;
  word-break: break-word; max-height: 220px; overflow: auto;
}
.agent-line.is-run pre.is-err { color: var(--danger); }
@media (prefers-color-scheme: light) {
  .agent-line.is-run pre { background: rgba(120, 120, 128, .16); }
}

.agent-line.is-review, .agent-line.is-check, .agent-line.is-plan { color: var(--text); }
.agent-line.is-note { background: none; border: 0; padding: 2px 4px; color: var(--text-3); font-size: 12px; }
.agent-line.is-error { background: rgba(255, 69, 58, .14); border-color: rgba(255, 69, 58, .35); color: var(--danger); }
.agent-line.is-switch { background: rgba(255, 159, 10, .16); border-color: rgba(255, 159, 10, .38); color: var(--text); }
.agent-line.is-done { background: var(--accent-soft); border-color: var(--accent-edge); color: var(--text); }

/* Список источников внутри журнала поиска: своё оформление, без рамки строки */
.agent-line.is-sources { background: none; border: 0; padding: 0; }
.agent-line.is-sources .sources { margin-top: 2px; }
/* В журнале ответ — обычный текст, но чуть крупнее журнальных строк */
.agent-line.is-msg .agent-text { font-size: 14px; line-height: 1.45; }
.agent-line.is-msg .typing { padding: 4px 0; }

/* Файлы проекта: строка-заголовок и раскрывающееся содержимое */
.file-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.file-item {
  border-radius: var(--r-sm); background: var(--surface-1);
  border: 1px solid var(--hairline-soft); overflow: hidden;
}
.file-head {
  width: 100%; display: flex; align-items: baseline; gap: 8px; padding: 10px 12px;
  background: none; border: 0; text-align: left; color: var(--text);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 12.5px;
}
.file-name { flex: 1; word-break: break-all; }
.file-size { font-size: 11.5px; flex: 0 0 auto; }
.file-body { padding: 0 12px 12px; }
.file-text {
  margin: 0; padding: 10px; border-radius: var(--r-sm);
  background: rgba(0, 0, 0, .28); color: var(--text);
  font-size: 11.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
  max-height: 320px; overflow: auto;
}
@media (prefers-color-scheme: light) {
  .file-text { background: rgba(120, 120, 128, .16); }
}

/* ------------------------------------------------------ статус моделей --
   Экран «Статус»: список моделей и их состояние. Цвет несёт смысл, поэтому
   состояние продублировано точкой, словом и историей проверок — не только
   оттенком (так экран читается и при дальтонизме, и в светлой схеме). */

.status-summary { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 2px; }
.status-pill {
  font-size: 12.5px; font-weight: 600; letter-spacing: -.006em;
  padding: 5px 10px; border-radius: 999px;
  background: var(--surface-1); border: 1px solid var(--chip-edge); color: var(--text-2);
}
.status-pill.ok { background: rgba(48, 209, 88, .16); border-color: rgba(48, 209, 88, .32); color: var(--ok); }
.status-pill.warn { background: rgba(255, 159, 10, .16); border-color: rgba(255, 159, 10, .34); color: var(--warn); }
.status-pill.fail { background: rgba(255, 69, 58, .16); border-color: rgba(255, 69, 58, .34); color: var(--danger); }

.status-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.status-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 12px; border-radius: var(--r-md);
  background: var(--surface-1); border: 1px solid var(--hairline-soft);
  box-shadow: 0 1px 0 var(--edge) inset;
  transition: opacity var(--d-quick) var(--ease-out),
              background-color var(--d-quick) var(--ease-out);
}
.status-row.is-probing { opacity: .55; }

.status-dot {
  flex: 0 0 auto; width: 9px; height: 9px; margin-top: 5px; border-radius: 50%;
  background: var(--text-3);
}
.status-dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(48, 209, 88, .18); }
.status-dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(255, 159, 10, .18); }
.status-dot.fail { background: var(--danger); box-shadow: 0 0 0 3px rgba(255, 69, 58, .18); }
.legend .status-dot { display: inline-block; margin: 0; vertical-align: middle; }

/* Идёт проверка этой модели: точка пульсирует — видно, что запрос жив */
.status-row.is-probing .status-dot { animation: pulse 1.1s var(--ease-in-out) infinite; }
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: .45; }
}

.status-main { flex: 1; min-width: 0; }
.status-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.status-name { font-size: 15px; font-weight: 600; letter-spacing: -.012em; }
.status-state { font-size: 12px; font-weight: 600; }
.status-state.ok { color: var(--ok); }
.status-state.warn { color: var(--warn); }
.status-state.fail { color: var(--danger); }
.status-state.off { color: var(--text-3); }
.status-sub { font-size: 12.5px; line-height: 1.45; color: var(--text-2); margin-top: 3px; }
.status-note {
  font-size: 12.5px; line-height: 1.4; color: var(--text-2); margin-top: 4px;
  word-break: break-word;
}

/* Точки прошлых проверок: слева старые, справа свежие — как в мониторинге */
.status-runs { display: flex; align-items: center; gap: 3px; margin-top: 7px; flex-wrap: wrap; }
.status-runs i { width: 7px; height: 7px; border-radius: 2px; background: var(--text-3); opacity: .8; }
.status-runs i.ok { background: var(--ok); }
.status-runs i.warn { background: var(--warn); }
.status-runs i.fail { background: var(--danger); }
.status-uptime { font-size: 11.5px; color: var(--text-3); margin-left: 6px; }

.status-check {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; line-height: 1; color: var(--accent);
  background: var(--accent-soft); border: 1px solid var(--accent-edge);
}
.status-check:disabled { opacity: .4; }

@media (prefers-reduced-motion: reduce) {
  .status-row.is-probing .status-dot { animation: none; }
}

/* --------------------------------------------------- боковое меню ----
   Панель справа, как в Claude и ChatGPT. Позицию ведёт пружина в app.js,
   поэтому CSS не анимирует transform — только задаёт вид и материал. */
.drawer {
  position: fixed; inset: 0; height: var(--app-h);
  z-index: 60; display: flex; justify-content: flex-end;
}
.drawer-backdrop {
  position: absolute; inset: 0; background: rgba(0, 0, 0, .5);
  opacity: 0; will-change: opacity;
}
.drawer-panel {
  position: relative; display: flex; flex-direction: column;
  width: min(360px, 86vw); height: 100%; overflow: hidden;
  background: var(--material-thick);
  backdrop-filter: saturate(180%) blur(var(--blur-thick));
  -webkit-backdrop-filter: saturate(180%) blur(var(--blur-thick));
  /* Свет по кромке вместо рамки: панель «отдвигает» приложение, а не висит
     над ним отдельным окном */
  box-shadow: -1px 0 0 var(--edge) inset, -24px 0 60px rgba(0, 0, 0, .45);
  padding-top: var(--safe-top);
  transform: translate3d(100%, 0, 0);   /* стартовое положение — за экраном */
  will-change: transform;
}
.drawer-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 10px 20px;
  touch-action: none; cursor: grab;   /* зона жеста: панель смахивают вправо */
}
.drawer-head h3 {
  flex: 1; margin: 0; font-size: 20px; line-height: 1.15;
  letter-spacing: -.018em; font-weight: 700;
}
.drawer-panel.dragging .drawer-head { cursor: grabbing; }
.drawer-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0 16px calc(20px + var(--safe-bottom) + var(--strip));
}
.drawer-title {
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
  margin: 14px 4px 8px; letter-spacing: 0;
}
.drawer-title:first-child { margin-top: 4px; }
.drawer-group { display: grid; gap: 6px; }

.drawer-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  text-align: left; padding: 12px 14px;
  background: var(--surface-1); border: 1px solid var(--hairline-soft);
  border-radius: var(--r-md); color: var(--text);
  box-shadow: 0 1px 0 var(--edge) inset;
}
.drawer-item:active { background: var(--surface-2); }
.drawer-icon {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.drawer-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.drawer-text b { font-size: 15.5px; font-weight: 600; letter-spacing: -.01em; }
.drawer-text i {
  font-style: normal; font-size: 12.5px; line-height: 1.3; color: var(--text-2);
}
.drawer-arrow { flex: 0 0 auto; color: var(--text-3); font-size: 20px; line-height: 1; }

/* Список действий — тот же inset grouped вид, что был у шторки меню */
.drawer-actions { display: grid; gap: 0; }

/* --------------------------------------------------------- диалоги ---
   Список разговоров в шторке: строки с названием, датой и тремя действиями.
   Кнопки маленькие и разнесены от текста, чтобы на телефоне не попасть
   в «удалить» вместо «открыть». */
.dialog-tools { display: flex; gap: 8px; align-items: stretch; margin-bottom: 4px; }
.dialog-tools .field { flex: 1; min-width: 0; font-size: 15px; }
.dialog-tools button {
  flex: 0 0 auto; margin-top: 0; padding: 0 14px;
  font-size: 15px; font-weight: 600; color: var(--accent);
}

.dialog-list { display: grid; gap: 6px; margin-top: 10px; }
.dialog-row {
  display: flex; align-items: center; gap: 4px;
  background: var(--surface-1); border: 1px solid var(--hairline-soft);
  border-radius: var(--r-md); box-shadow: 0 1px 0 var(--edge) inset;
  padding-right: 6px;
}
.dialog-row.active { background: var(--accent-soft); border-color: var(--accent-edge); }
/* Временный чат виден, но другим тоном: его не будет в списке после перезагрузки */
.dialog-row.temp { border-style: dashed; }
.dialog-row.temp .dialog-name { color: var(--text-2); }
.dia-flag { margin-right: 5px; font-size: 12px; }
.dialog-open {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px;
  text-align: left; padding: 12px 8px 12px 14px;
  background: none; border: 0; border-radius: var(--r-md);
}
.dialog-name {
  font-size: 15.5px; font-weight: 600; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dialog-meta { font-size: 12px; color: var(--text-2); }
.dialog-act {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-size: 14px; line-height: 1;
  color: var(--text-2); background: none; border: 0;
}
.dialog-act:active { background: var(--surface-2); }
.dialog-act.danger { color: var(--danger); }

/* Наведение — только там, где указатель действительно умеет наводиться */
@media (hover: hover) and (pointer: fine) {
  /* Действия под ответом (копировать, вслух, другая модель) — как в ChatGPT:
     в покое не мешают чтению, появляются при наведении на ход или с клавиатуры. */
  .msg .bubble-tools {
    opacity: 0;
    transition: opacity var(--d-quick) var(--ease-out);
  }
  .msg:hover .bubble-tools, .msg:focus-within .bubble-tools { opacity: 1; }
  .tool-btn:hover { color: var(--text); background: var(--surface-2); }
  .down-btn:hover { color: var(--text); border-color: var(--accent-edge); }
  button.primary:hover { background: var(--accent-strong); }
  .send:hover { background: var(--accent-strong); }
  .chip:hover { background: var(--surface-2); }
  .icon-btn:hover { background: var(--surface-1); }
  .model-item:hover { background: var(--surface-2); }
  .menu-item:hover { background: var(--surface-2); }
  .code-head button:hover { background: var(--surface-1); }
  .file-head:hover { background: var(--surface-2); }
  .status-row:hover { background: var(--surface-2); }
  .status-check:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
  .drawer-item:hover { background: var(--surface-2); }
  .dialog-row:hover { background: var(--surface-2); }
  .dialog-act:hover { background: var(--surface-1); color: var(--text); }
  .dialog-act.danger:hover { color: var(--danger); }
}
