@charset "utf-8";
/* Панель чата: карточка файла и картинка в чате (01.10.2026), отметка идущего хода в списке чатов,
   окошко «Куки помнит» в заметках (28.09.2026). Отдельным файлом: kukai_chat_v5.html под
   храповиком строк. Цвета — переменные темы страницы ([data-theme]).
   Отдаваться должен как text/css: с application/octet-stream (nginx, блок types у /assets/) Chromium не
   разберёт ни одного правила; страхует это kukai_queue.js (ensureStyles). */

/* ── Карточка файла ─────────────────────────────────────────────────────────
   Одна строка: значок вида (цвет вида), имя (длинное — с многоточием В СЕРЕДИНЕ, чтобы был виден конец имени),
   бейдж расширения, размер и одна кнопка-круг «скачать» (kukai_files.js). Карточка целиком — её кнопка.
   10.10.2026, слово владельца: «мне не нравится интерфейс и ячейка, как это нужно скачать — некрасиво». Раньше: серый
   значок, имя резалось с конца (терялся конец имени и версия), «скачать» — стрелка 14 px без границ, не похожая на кнопку,
   нажатие ничем не отвечало. Теперь: значок и бейдж одного цвета вида, круглая кнопка 24 px (при наведении на карточку
   заливается), на время запроса — кольцо, потом — галочка. Высота и текст прежние (одна строка, не выше кнопок рядом).
   Значки стоят по размеру и в атрибутах svg — не загрузился этот файл, значок всё равно не растёт до ширины ленты. */
.file-card {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  max-width: min(100%, 420px);
  min-width: 0;
  height: 32px;       /* = кнопки .ibtn рядом; было 36, 30 (30.09) */
  margin: 2px 0;
  padding: 0 4px 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--hint);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.3;   /* 1 срезал подчёркивания в имени (overflow у .fc-name) */
  text-align: left;
  vertical-align: middle;
  cursor: pointer;
  transition: border-color var(--d) var(--ease), background var(--d) var(--ease), opacity var(--d) var(--ease);
}
[data-theme="light"] .file-card { box-shadow: 0 1px 2px rgba(17, 24, 39, .05); }
.file-card:hover { border-color: var(--border-f); background: var(--hint-h); }
.file-card:focus-visible { outline: 2px solid var(--brand-lite); outline-offset: 1px; }
.file-card.off { opacity: .5; cursor: default; }
.file-card.off:hover { border-color: var(--border); background: var(--hint); }

.fc-glyph { position: relative; flex: none; width: 15px; height: 15px; color: var(--fc-c, var(--text-3)); }   /* = значок кнопки .ibtn */
.fc-glyph svg {
  position: absolute; inset: 0; width: 15px; height: 15px;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
/* Копия уже на компьютере — точка у значка. */
.file-card.saved .fc-glyph::after {
  content: ''; position: absolute; right: -3px; bottom: -2px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 0 1.5px var(--panel);
}

.fc-name {
  flex: 1 1 auto; min-width: 0;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font-weight: 500;
}
/* Длинное имя: голова усекается многоточием, хвост (последние знаки — версия, дата) стоит всегда. */
.fc-name.mid { display: flex; text-overflow: clip; }
.fc-name .fc-h { flex: 0 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fc-name .fc-t { flex: none; white-space: pre; }
.fc-ext {
  flex: none;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .4px;
  color: var(--fc-c, var(--text-2));
  background: var(--fc-b, var(--hint-h));
}
.fc-size {
  flex: none; font-size: 11px; color: var(--text-3);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
/* Действие «скачать» — кнопка-круг в конце; карточка целиком — её нажатие. */
.fc-act {
  position: relative; flex: none; display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%;
  color: var(--text-2); background: var(--hint-h);
  transition: color var(--d) var(--ease), background var(--d) var(--ease);
}
.fc-act svg {
  display: block; width: 13px; height: 13px;
  fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
.file-card:hover:not(.off) .fc-act { color: #fff; background: var(--brand-lite); }
.file-card.off .fc-act { visibility: hidden; }
/* Файл уже на компьютере (плагин ≥ 1.4.58 ответил file_saved с can_open): вместо стрелки «скачать» — папка;
   щелчок по карточке открывает файл, по папке — показывает его в папке (kukai_files.js). */
.fc-act .fc-fo, .fc-act .fc-ck { display: none; }
.file-card.opens .fc-dl { display: none; }
.file-card.opens .fc-fo { display: block; }
/* Запрос ссылки: кольцо вместо стрелки; готово: галочка (kukai_files.js, viaLink). */
.file-card.busy { cursor: progress; }
.file-card.busy .fc-act svg { display: none; }
.file-card.busy .fc-act::after {
  content: ''; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: fcSpin .7s linear infinite;
}
@keyframes fcSpin { to { transform: rotate(360deg); } }
.file-card.ok .fc-act, .file-card.ok:hover .fc-act { color: #fff; background: var(--green-dk); }
.file-card.ok .fc-dl, .file-card.ok .fc-fo { display: none; }
.file-card.ok .fc-ck { display: block; }
/* Узкая панель: имени нужнее место, чем бейдж (вид и так в значке, цвете и подсказке). */
@media (max-width: 340px) { .file-card:not(.has-thumb) .fc-ext { display: none; } }
/* Цвета вида: значок, бейдж и (у новой карточки) всё, что внутри, берут их из карточки — переменные наследуются. У карточки
   из истории чата `data-k` стоит только на бейдже. */
[data-theme="light"] .file-card[data-k="sheet"],   [data-theme="light"] .fc-ext[data-k="sheet"]   { --fc-c: #177a45; --fc-b: rgba(23, 122, 69, .10); }
[data-theme="light"] .file-card[data-k="pdf"],     [data-theme="light"] .fc-ext[data-k="pdf"]     { --fc-c: #c8322b; --fc-b: rgba(200, 50, 43, .09); }
[data-theme="light"] .file-card[data-k="doc"],     [data-theme="light"] .fc-ext[data-k="doc"]     { --fc-c: #2458c6; --fc-b: rgba(36, 88, 198, .09); }
[data-theme="light"] .file-card[data-k="slide"],   [data-theme="light"] .fc-ext[data-k="slide"]   { --fc-c: #c2531f; --fc-b: rgba(194, 83, 31, .10); }
[data-theme="light"] .file-card[data-k="image"],   [data-theme="light"] .fc-ext[data-k="image"]   { --fc-c: #7a42c9; --fc-b: rgba(122, 66, 201, .09); }
[data-theme="light"] .file-card[data-k="model"],   [data-theme="light"] .fc-ext[data-k="model"]   { --fc-c: #a66200; --fc-b: rgba(166, 98, 0, .10); }
[data-theme="light"] .file-card[data-k="archive"], [data-theme="light"] .fc-ext[data-k="archive"] { --fc-c: #5b6472; --fc-b: rgba(91, 100, 114, .10); }
[data-theme="light"] .file-card[data-k="data"],    [data-theme="light"] .fc-ext[data-k="data"]    { --fc-c: #0e7c7b; --fc-b: rgba(14, 124, 123, .09); }
[data-theme="dark"] .file-card[data-k="sheet"],    [data-theme="dark"] .fc-ext[data-k="sheet"]    { --fc-c: #5fd39a; --fc-b: rgba(95, 211, 154, .13); }
[data-theme="dark"] .file-card[data-k="pdf"],      [data-theme="dark"] .fc-ext[data-k="pdf"]      { --fc-c: #ff8a80; --fc-b: rgba(255, 138, 128, .13); }
[data-theme="dark"] .file-card[data-k="doc"],      [data-theme="dark"] .fc-ext[data-k="doc"]      { --fc-c: #82aefc; --fc-b: rgba(130, 174, 252, .13); }
[data-theme="dark"] .file-card[data-k="slide"],    [data-theme="dark"] .fc-ext[data-k="slide"]    { --fc-c: #ffab70; --fc-b: rgba(255, 171, 112, .13); }
[data-theme="dark"] .file-card[data-k="image"],    [data-theme="dark"] .fc-ext[data-k="image"]    { --fc-c: #c3a0f7; --fc-b: rgba(195, 160, 247, .13); }
[data-theme="dark"] .file-card[data-k="model"],    [data-theme="dark"] .fc-ext[data-k="model"]    { --fc-c: #f2bd5c; --fc-b: rgba(242, 189, 92, .13); }
[data-theme="dark"] .file-card[data-k="archive"],  [data-theme="dark"] .fc-ext[data-k="archive"]  { --fc-c: #aeb4bf; --fc-b: rgba(174, 180, 191, .13); }
[data-theme="dark"] .file-card[data-k="data"],     [data-theme="dark"] .fc-ext[data-k="data"]     { --fc-c: #5fd6d0; --fc-b: rgba(95, 214, 208, .12); }

/* PDF с превью: первая страница миниатюрой (её рисует сервер), справа — имя, вид и размер; щелчок по
   миниатюре — страница крупно (просмотр поверх панели), по остальному — файл. Единственная карточка
   выше одной строки: превью без картинки смысла не имеет. */
.file-card.has-thumb { height: auto; min-height: 64px; align-items: stretch; gap: 10px; padding: 6px 8px 6px 6px; }
.fc-thumb {
  flex: none; width: 44px; height: 58px; overflow: hidden;
  border: 1px solid var(--border); border-radius: 4px; background: var(--hint-h); cursor: zoom-in;
}
.fc-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.fc-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.fc-body .fc-name { flex: 0 0 auto; }          /* в колонке не растёт по высоте — имя и вид стоят рядом */
.fc-meta { display: flex; align-items: center; gap: 6px; min-width: 0; }
.file-card.has-thumb .fc-act { align-self: center; }
.file-card.has-thumb.saved::after {
  content: ''; position: absolute; top: 6px; right: 6px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--green);
}

/* Папка выгрузок в настройках (kukai_files.js): путь, который плагин не принял. */
.sp-path-inp.bad { border-color: var(--danger); }

/* Строка-файл без рамки пузыря: карточка сама себе рамка; ширина — вся лента (пузырь ограничивал 85 %
   и отнимал у имени место в узкой панели). */
.msg.ai .bubble:has(> .file-card:only-child) {
  padding: 0; border: 0; background: none; max-width: 100%;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}

/* ── Картинка в чате (kukai_images.js) ────────────────────────────────────────
   «Копировать», «Сохранить» по наведению; просмотр поверх панели (24.09.2026, было в странице).
   01.10.2026: картинку, которую присылает модель, лента рисует строкой .model-image — по ширине
   (не шире 640 px), с потолком высоты (узкий высокий снимок не занимает панель целиком), границы
   и фон — из темы: в светлой прежняя белая рамка пропадала. */
.img-wrap { position: relative; display: inline-block; max-width: 100%; vertical-align: top; }
.img-wrap > img { display: block; max-width: 100%; }
.img-acts {
  position: absolute; top: 6px; right: 6px; display: flex; gap: 4px;
  opacity: 0; transition: opacity var(--d-fast) var(--ease);
}
.img-wrap:hover .img-acts, .img-wrap:focus-within .img-acts { opacity: 1; }
@media (hover: none) { .img-acts { opacity: 1; } }
.img-act {
  width: 26px; height: 26px; padding: 0; border-radius: 7px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.18); background: rgba(18,18,22,.72); color: #fff;
}
.img-act:hover { background: rgba(18,18,22,.92); }
.img-act:focus-visible { outline: 2px solid var(--brand-lite); outline-offset: 1px; }
.img-act svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.img-act.ok { color: var(--green); }
.img-act.bad { color: #ff6b6b; }
.img-view {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center;
  justify-content: center; padding: 44px 12px 12px; background: rgba(0,0,0,.84);
}
.img-view > img { width: 100%; height: 100%; object-fit: contain; }
.img-view .img-acts { top: 8px; right: 8px; opacity: 1; }

.model-image { align-self: flex-start; box-sizing: border-box; max-width: min(100%, 640px); min-width: 0; margin: 2px 0; }
.model-image .mi-cap {
  margin: 0 2px 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font-size: 12px; line-height: 1.4; color: var(--text-3);
}
.model-image .mi-text { color: var(--text-2); }
.model-image .mi-meta { font-variant-numeric: tabular-nums; }
.model-image img {
  display: block; width: auto; height: auto; max-width: 100%; max-height: min(56vh, 420px);
  border: 1px solid var(--border); border-radius: 10px; background: var(--hint); cursor: zoom-in;
}
/* Картинка по ссылке ещё идёт: пустая рамка, без подписи alt. */
.model-image.loading img { width: 168px; height: 96px; color: transparent; }
/* Копия на рабочем столе — точка у подписи (как у карточки файла). */
.model-image.saved .mi-cap::before {
  content: ''; display: inline-block; width: 5px; height: 5px; margin: 0 6px 1px 0;
  border-radius: 50%; background: var(--green);
}

/* ── Значки вложений (30.09.2026) ────────────────────────────────────────────
   Слово владельца: значки прикрепления файлов в чате «огромные, несуразные» — нужны
   аккуратные, соразмерные тексту и соседним кнопкам, в одном стиле с прочими значками
   панели. Один размер (14 px: рядом .ibtn 15, .img-act 14, .na-ico 14), линейный штрих
   currentColor, эмодзи нет. Размер стоит и атрибутами svg, и здесь: без стилей значок
   не вырастет до ширины строки. */
.att-ico {
  flex: none; width: 14px; height: 14px;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
/* Значок и имя в реплике человека — строка из двух частей: имя переносится в своём
   боксе, значок остаётся у первой строки (иначе узкая панель роняла значок отдельной строкой). */
.bubble .att-row { display: flex; align-items: flex-start; gap: 6px; }
.bubble .att-row .att-ico { margin-top: 4px; opacity: .7; }      /* по центру первой строки: (22 − 14) / 2 */
.bubble .att-name { min-width: 0; overflow-wrap: anywhere; }

/* Вставленная картинка — над строкой ввода (не внутри: там она теснила поле и
   выталкивала «Отправить» за край панели): миниатюра ограничена и по высоте, и по
   ширине (панорама не вылезает за панель), подпись — одной строкой. */
.att-chip {
  display: flex; width: fit-content; align-items: center; gap: 8px; box-sizing: border-box;
  min-width: 0; max-width: 100%; margin: 0 0 6px; padding: 4px 6px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--hint); color: var(--text-2); font-size: 12px;
}
.att-chip img { flex: none; display: block; height: 36px; max-width: 64px; object-fit: cover; border-radius: 4px; }
.att-chip span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-chip button {
  flex: none; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 6px;
  background: none; color: var(--text-3); font-size: 13px; line-height: 1; cursor: pointer;
}
.att-chip button:hover { background: var(--hint-h); color: var(--text-2); }

/* ── Очередь сообщений, кнопка отправки, «Стоп», «Продолжить» (30.09.2026) ────────────
   Слово владельца: занят Куки или свободен — видно по кнопке отправки: занят — серая, нажатие ставит
   сообщение в очередь (не отправляет и не останавливает); свободен — обычная; смена цвета плавная,
   серый читается и в тёмной, и в светлой теме. Очередь — над полем ввода: шрифт на 30 % мельче,
   приглушённо, с пометкой «в очереди» и крестиком. 01.10: «Стоп» — снова сама кнопка отправки, красная, пока
   идёт ход и поле пустое (`.send.stop`); строки состояния над полем нет совсем (слово владельца). */
.inp-row .send {
  transition: background-color .35s var(--ease), box-shadow .35s var(--ease), transform var(--d) var(--ease);
}
.inp-row .send svg { transition: stroke .35s var(--ease); }
[data-theme="dark"] .inp-row .send.busy { background: #565b67; box-shadow: none; }
[data-theme="dark"] .inp-row .send.busy svg { stroke: #f0f2f5; }
[data-theme="light"] .inp-row .send.busy { background: #7d8595; box-shadow: none; }
[data-theme="light"] .inp-row .send.busy svg { stroke: #ffffff; }
.inp-row .send.busy:hover { transform: none; }

.q-list {
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px; counter-reset: q;
  margin: 0 0 6px; padding: 1px 2px 0; max-height: 104px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.q-list:empty { display: none; }
/* Сообщение в очереди (вид 02.10, слово владельца: «непонятно, что оно в очереди; нужен user-friendly дизайн»;
   подпись «в очереди» — не делать). Маленький пузырь человека справа над полем: приглушённый, пунктирная кромка,
   по нижней кромке бежит тонкая полоса ожидания; несколько — номер по порядку. Модель взяла — пузырь переезжает
   в ленту и вырастает до обычного (kukai_queue.js, fly). */
.q-item {
  position: relative; display: flex; align-items: center; gap: 5px; min-width: 0; max-width: 88%;
  padding: 3px 3px 4px 10px; overflow: hidden; counter-increment: q;
  border: 1px dashed var(--border-f); border-radius: var(--r-xl) var(--r-xl) var(--r-xs) var(--r-xl);
  background: var(--bbl-user); color: var(--text-3); opacity: .8;
  font-size: calc(var(--chat-font-size) * .7);       /* на 30 % мельче обычного */
  line-height: 1.5;
  animation: qIn .28s var(--ease) backwards;
}
.q-item::after {
  content: ''; position: absolute; left: 0; bottom: 0; width: 38%; height: 1.5px; border-radius: 1px;
  background: linear-gradient(90deg, transparent, var(--brand-lite), transparent);
  animation: qWait 1.8s cubic-bezier(.45, 0, .55, 1) infinite;
}
@keyframes qWait { from { transform: translateX(-100%); } to { transform: translateX(270%); } }
@keyframes qIn { from { opacity: 0; transform: translateY(6px) scale(.97); } }
.q-list:has(> .q-item + .q-item) .q-item::before {
  content: counter(q); flex: none; min-width: 14px; height: 14px; margin-left: -5px; padding: 0 3px; border-radius: 7px;
  background: var(--border); color: var(--text-2); font-size: 9px; font-weight: 600; line-height: 14px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.q-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-x {
  flex: none; width: 16px; height: 16px; padding: 0; border: 0; border-radius: 50%;
  background: none; color: inherit; opacity: .7; font-size: 9px; line-height: 1; cursor: pointer;
  transition: opacity .15s var(--ease), background-color .15s var(--ease);
}
.q-x:hover, .q-x:focus-visible { opacity: 1; background: var(--hint-h); color: var(--text-2); }
.q-item { transition: opacity .2s var(--ease); }
.q-item.q-wait { opacity: .45; }                     /* крестик нажат, сервер ещё не ответил: строка ждёт его слова */
.q-item.q-wait::after { animation: none; opacity: 0; }
.q-x:disabled, .q-x:disabled:hover { background: none; color: inherit; cursor: default; opacity: .5; }
/* Без движения — полоса ожидания стоит тонкой чертой (бег по кругу — не короткий переход, его снимаем). */
@media (prefers-reduced-motion: reduce) {
  .q-item::after { animation: none; width: 100%; opacity: .35; background: var(--brand-lite); }
}
/* Пузырь в полёте из очереди в ленту (kukai_queue.js): выглядит как пузырь человека. */
.q-fly {
  position: fixed; z-index: 9999; box-sizing: border-box; margin: 0; overflow: hidden; pointer-events: none;
  background: var(--bbl-user); color: var(--text);
  border-radius: var(--r-xl); border-bottom-right-radius: var(--r-xs);
  line-height: 1.65; word-break: break-word;
}

/* Строки состояния над полем ввода нет (01.10, слово владельца «убрать тот статус бар вовсе»): ход показывает
   блок хода в ленте, «Стоп» — кнопка отправки. Элемент остаётся для кода, места не занимает. */
#status { display: none !important; }

/* «Продолжить» под итогом порции длинной работы. */
.continue-row { align-self: flex-start; margin: 2px 0 8px 2px; animation: msgEnter .2s var(--ease) both; }
.continue-btn {
  height: 26px; padding: 0 12px; border: 1px solid var(--border-f); border-radius: 13px;
  background: var(--hint); color: var(--text-2);
  font: inherit; font-size: 12px; font-weight: 500; cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.continue-btn:hover { background: var(--hint-h); color: var(--text); }
.continue-btn:focus-visible { outline: 2px solid var(--brand-lite); outline-offset: 1px; }

@media (prefers-reduced-motion: reduce) {
  .inp-row .send, .inp-row .send svg { transition: none; }
}

/* ── Список чатов: идёт ход — тихая точка у времени ──────────────────────── */
.history-item.running .history-item-date::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--data-c);
  vertical-align: 1px;
  animation: stBreath 1.8s ease-in-out infinite;
}
.history-item.running.asking .history-item-date::before { background: var(--warn); }

/* ── Заметки: «Куки помнит» — мини-файл у низа вкладки, только чтение ───────
   Свёрнуто — одна приглушённая строка без заливки. Раскрытие — высота
   (grid 0fr → 1fr) и прозрачность, ~220 мс; дни и записи — так же. */
.notes-agent {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 42%;
  border-top: 1px solid var(--border);
}
.notes-agent[hidden] { display: none; }
.na-file, .na-day-head {
  display: flex; align-items: center; gap: 7px;
  width: 100%; border: 0; background: none; cursor: pointer;
  font: inherit; text-align: left;
  color: var(--text-3);
  transition: color .15s, background .15s;
}
.na-file { flex: none; padding: 8px 14px; font-size: 12px; }
.na-file:hover, .notes-agent.open .na-file { color: var(--text-2); }
.na-file:focus-visible, .na-day-head:focus-visible { outline: 1px solid var(--border-f); outline-offset: -1px; border-radius: 6px; }
.na-ico { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.2;
          stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.na-chev { width: 12px; height: 12px; flex: none; margin-left: auto; fill: none; stroke: currentColor;
           stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; opacity: .6;
           transition: transform .22s ease; }
[aria-expanded="true"] > .na-chev { transform: rotate(90deg); }
.na-title { font-weight: 500; letter-spacing: .1px; }
.na-count { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; opacity: .85; }
.na-body {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows .22s ease, opacity .22s ease;
}
.na-body.open { grid-template-rows: 1fr; opacity: 1; }
.na-inner { min-height: 0; overflow: hidden; }
.notes-agent > .na-body { flex: 0 1 auto; min-height: 0; }
.notes-agent > .na-body > .na-inner { display: flex; flex-direction: column; }
.na-days {
  max-height: 30vh;
  overflow-y: auto;
  padding: 0 8px 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.na-day + .na-day { margin-top: 1px; }
.na-day-head { padding: 5px 6px; border-radius: 6px; font-size: 12px; }
.na-day-head:hover { background: var(--hint-h); color: var(--text-2); }
.na-day-head[aria-expanded="true"] { color: var(--text-2); }
.na-date { font-weight: 500; }
.na-day .na-inner { padding-left: 21px; }
.na-item {
  display: flex; align-items: baseline; gap: 8px;
  padding: 3px 6px; border-radius: 6px;
  cursor: pointer;
  transition: background .15s;
}
.na-item:hover { background: var(--hint-h); }
.na-kind { flex: none; width: 54px; font-size: 10.5px; line-height: 1.5; color: var(--text-3);
           white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.na-text {
  flex: 1 1 auto; min-width: 0;
  font-size: 12px; line-height: 1.5; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-height: 1.5em;
  transition: max-height .22s ease;
}
.na-item.open .na-text { white-space: normal; overflow-wrap: anywhere; max-height: 30em; color: var(--text); }
.na-item.done .na-text { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--border-f); }

@media (prefers-reduced-motion: reduce) {
  .history-item.running .history-item-date::before { animation: none; }
  .na-body, .na-chev, .na-text { transition: none; }
}

/* Сфера возможностей на пустом экране (02.10.2026, слово владельца: «слова по сфере, при наведении слово
   увеличивается, но всегда медленно крутится»). Место, размер, прозрачность и слой каждого слова пишет
   kukai_ribbon.js (transform, opacity, z-index); здесь — высота сферы, вид слова и цвет горящего (акцент панели). */
.kr-sphere {
  --kr-hot: var(--brand-lite); --kr-hot-bg: var(--brand-hover); --kr-hot-line: rgba(37, 99, 235, .26);
  position: relative; width: 100%; max-width: 520px; margin: 2px auto 0;
  height: clamp(260px, min(96vw, 58vh), 400px);
  overflow: hidden; contain: layout paint; touch-action: manipulation;
}
[data-theme="dark"] .kr-sphere { --kr-hot: var(--data-c); --kr-hot-bg: rgba(147, 197, 253, .10); --kr-hot-line: rgba(147, 197, 253, .30); }
.kr-sphere::before {
  content: ''; position: absolute; left: 50%; top: 50%; width: min(92%, 340px); aspect-ratio: 1;
  transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, var(--glow-brand), transparent);
}
.kr-word {
  position: absolute; left: 0; top: 0; z-index: 1; transform-origin: 50% 50%; opacity: 0;
  padding: 2px 9px; border: 0; border-radius: 999px; background: transparent; outline: none;
  font: inherit; font-size: 14px; font-weight: 500; line-height: 20px; white-space: nowrap; letter-spacing: .1px;
  color: var(--text); text-shadow: 0 0 1px var(--panel), 0 0 3px var(--panel), 0 0 8px var(--panel);
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: color .25s var(--ease), background-color .25s var(--ease), box-shadow .25s var(--ease);
}
/* горящее слово (под курсором или в фокусе: плашка и есть знак фокуса) — непрозрачная плашка поверх соседей */
.kr-word.is-hot { color: var(--kr-hot); background-color: var(--panel); box-shadow: inset 0 0 0 1px var(--kr-hot-line), inset 0 0 0 40px var(--kr-hot-bg); }
.kr-sphere .kr-word:focus-visible { outline: none; }
/* Уход шара после отправки: слова доигрывают в слое поверх ленты на прежнем месте ящика (kukai_ribbon.js, leave) */
.kr-sphere.kr-exit { position: fixed; z-index: 80; margin: 0; max-width: none; overflow: visible; contain: none; pointer-events: none; }
.kr-exit::before { transition: opacity .4s var(--ease); }
.kr-exit.is-out::before { opacity: 0; }

/* Полоса лимитов внизу настроек (слово владельца 01.10.2026): «Запросы ▬▬ 12/30 до 00:00» у
   бесплатного плана, «Сегодня ▬▬ 40 % до 00:00» у pro и ultra; «Неделя» — только при доле подписки.
   Данные — assets/js/kukai_limits.js. Ярлыки — 1–2 слова, без пояснений.
   Вид 02.10.2026 (слово владельца: «как-то не очень красиво + зелёный цвет»): строки — одной сеткой (ярлык, полоса,
   число, сброс ровно друг под другом), тонкая полоса цвета акцента панели; тревожный тон — только у порога
   (≥ 80 % — янтарь, 100 % — красный); «до 00:00» — мелко, со значком часов. */
.sp-limits {
  flex-shrink: 0; display: grid; grid-template-columns: auto minmax(40px, 1fr) auto auto;
  align-items: center; column-gap: 10px; row-gap: 8px;
  padding: 11px calc(var(--sp-3) + 4px) 10px; border-top: 1px solid var(--border);
}
.sp-limits[hidden] { display: none; }
.lim-row { display: contents; font-size: 11.5px; color: var(--text-2); }
.lim-lbl { grid-column: 1; min-width: 52px; color: var(--text-2); font-size: 11.5px; font-weight: 500; letter-spacing: .1px; }
.lim-track {
  position: relative; height: 4px; border-radius: 4px; overflow: hidden;
  background: var(--bg-3);
}
[data-theme="dark"] .lim-track { background: rgba(255, 255, 255, .08); }
.lim-fill {
  display: block; height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--brand-mid), var(--brand-lite));
  transition: width .5s var(--ease), background-color .3s var(--ease);
}
[data-theme="dark"] .lim-fill { background: linear-gradient(90deg, var(--brand-lite), #60A5FA); }
.lim-fill.warn { background: var(--warn); }
.lim-fill.crit { background: var(--danger); }
.lim-val {
  justify-self: end; min-width: 34px; text-align: right;
  font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text);
}
.lim-reset {
  display: inline-flex; align-items: center; gap: 3px; justify-self: end;
  font-size: 10.5px; font-variant-numeric: tabular-nums; color: var(--text-3); white-space: nowrap;
}
.lim-reset::before {
  content: ''; width: 10px; height: 10px; flex: none; background: currentColor; opacity: .8;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Иконки пунктов настроек — своя короткая анимация на наведении и на фокусе с клавиатуры (слово владельца 02.10:
   «когда наводишься на каждую кнопку — Лицензия, Тема, Безопасность и т. д. — должна проигрываться анимация иконки»).
   Привязка — по классам групп внутри SVG, а не по номеру пункта: с 10.09 первым пунктом стоит «Лицензия», правила
   :nth-child съехали на соседей, и ни одна анимация не играла (ключу — шестерёнка, шестерёнке — звёзды…).
   Играет один раз при входе, не по кругу. prefers-reduced-motion их не снимает: они короткие и мелкие, а Windows
   включает этот режим на удалённом столе сама (урок 24.09 про «Эффекты анимации»: «раньше эта анимация работала»). */
.sp-menu-icon svg { overflow: visible; }
.sp-menu-icon svg g { transform-origin: 12px 12px; }

/* Лицензия — ключ поворачивается, как в замке */
.sp-menu-item:hover .key-ring, .sp-menu-item:focus-visible .key-ring,
.sp-menu-item:hover .key-blade, .sp-menu-item:focus-visible .key-blade {
  animation: sph-key-turn .65s cubic-bezier(.34, 1.56, .64, 1) both; transform-origin: 7.5px 15.5px;
}
@keyframes sph-key-turn {
  0%   { transform: rotate(0); }
  40%  { transform: rotate(-32deg); }
  70%  { transform: rotate(8deg); }
  100% { transform: rotate(0); }
}

/* Общие — шестерёнка проворачивается, середина пульсирует */
.sp-menu-item:hover .gear-body, .sp-menu-item:focus-visible .gear-body { animation: sph-gear-spin .7s cubic-bezier(.34, 1.56, .64, 1) both; }
.sp-menu-item:hover .gear-center, .sp-menu-item:focus-visible .gear-center { animation: sph-gear-dot .5s .1s ease both; }
@keyframes sph-gear-spin {
  0%   { transform: rotate(0); }
  40%  { transform: rotate(200deg); }
  70%  { transform: rotate(170deg); }
  100% { transform: rotate(180deg); }
}
@keyframes sph-gear-dot {
  0%   { transform: scale(1); }
  40%  { transform: scale(.6); }
  70%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* Специализация — большая звезда вспыхивает, малая делает оборот */
.sp-menu-item:hover .ai-star-big, .sp-menu-item:focus-visible .ai-star-big { animation: sph-ai-pulse .6s ease both; transform-origin: 12px 10px; }
.sp-menu-item:hover .ai-star-sm, .sp-menu-item:focus-visible .ai-star-sm { animation: sph-ai-orbit .7s .1s ease both; transform-origin: 19px 17.5px; }
@keyframes sph-ai-pulse {
  0%   { transform: scale(1) rotate(0); opacity: 1; }
  30%  { transform: scale(.7) rotate(-15deg); opacity: .5; }
  60%  { transform: scale(1.15) rotate(10deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes sph-ai-orbit {
  0%   { transform: scale(0) rotate(0); opacity: 0; }
  40%  { transform: scale(1.3) rotate(90deg); opacity: 1; }
  70%  { transform: scale(.9) rotate(180deg); opacity: 1; }
  100% { transform: scale(1) rotate(360deg); opacity: 1; }
}

/* Безопасность — дужка замка подскакивает и защёлкивается */
.sp-menu-item:hover .lock-shackle, .sp-menu-item:focus-visible .lock-shackle { animation: sph-lock-shackle .6s cubic-bezier(.34, 1.56, .64, 1) both; }
.sp-menu-item:hover .lock-body, .sp-menu-item:focus-visible .lock-body { animation: sph-lock-body .3s .35s ease both; transform-origin: 12px 16.5px; }
@keyframes sph-lock-shackle {
  0%   { transform: translateY(0); }
  35%  { transform: translateY(-4px); }
  55%  { transform: translateY(-4px); }
  80%  { transform: translateY(1px); }
  100% { transform: translateY(0); }
}
@keyframes sph-lock-body {
  0%   { transform: scale(1, 1); }
  50%  { transform: scale(1.06, .95); }
  100% { transform: scale(1, 1); }
}

/* Быстрые промты — приглашение «печатается», курсор мигает */
.sp-menu-item:hover .cmd-prompt, .sp-menu-item:focus-visible .cmd-prompt { animation: sph-cmd-type .5s ease both; transform-origin: 7px 13px; }
.sp-menu-item:hover .cmd-cursor, .sp-menu-item:focus-visible .cmd-cursor { animation: sph-cmd-blink .6s .15s ease both; }
.sp-menu-item:hover .cmd-frame, .sp-menu-item:focus-visible .cmd-frame { animation: sph-cmd-frame .4s ease both; }
@keyframes sph-cmd-type {
  0%   { transform: translateX(-3px); opacity: 0; }
  40%  { transform: translateX(1px); opacity: 1; }
  60%  { transform: translateX(-.5px); }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes sph-cmd-blink {
  0%, 50%, 100% { opacity: 1; }
  25%, 75%      { opacity: 0; }
}
@keyframes sph-cmd-frame {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* Для разработчиков — скобки расходятся, косая черта прорисовывается */
.sp-menu-item:hover .code-left, .sp-menu-item:focus-visible .code-left { animation: sph-code-left .45s cubic-bezier(.34, 1.56, .64, 1) both; }
.sp-menu-item:hover .code-right, .sp-menu-item:focus-visible .code-right { animation: sph-code-right .45s cubic-bezier(.34, 1.56, .64, 1) both; }
.sp-menu-item:hover .code-slash, .sp-menu-item:focus-visible .code-slash { animation: sph-code-slash .4s .1s ease both; }
@keyframes sph-code-left {
  0%   { transform: translateX(0); }
  50%  { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}
@keyframes sph-code-right {
  0%   { transform: translateX(0); }
  50%  { transform: translateX(3px); }
  100% { transform: translateX(0); }
}
@keyframes sph-code-slash {
  0%   { stroke-dasharray: 20; stroke-dashoffset: 20; }
  100% { stroke-dasharray: 20; stroke-dashoffset: 0; }
}

/* Подвал настроек: «Сотрудничество» рядом с «Проблема» — плюс поворачивается, как у пунктов меню */
.sp-footer-card svg g { transform-origin: 19px 11px; }
.sp-footer-card:hover .coop-plus, .sp-footer-card:focus-visible .coop-plus { animation: sph-coop-plus .5s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes sph-coop-plus {
  0%   { transform: rotate(0) scale(1); }
  50%  { transform: rotate(90deg) scale(1.2); }
  100% { transform: rotate(90deg) scale(1); }
}

/* Таблица ответа → Excel (assets/js/kukai_tables.js, 01.10.2026): одна кнопка под таблицей, ярлык — одно слово. */
.bubble .kt-xlsx {
  display: flex; align-items: center; gap: 4px; margin: calc(-1 * var(--sp-1, 4px)) 0 var(--sp-2) auto;
  padding: 1px 8px; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: transparent; color: var(--text-2); font: inherit; font-size: var(--text-xs); line-height: 18px;
  cursor: pointer; transition: color .2s var(--ease), border-color .2s var(--ease);
}
.bubble .kt-xlsx:hover { color: var(--text); border-color: var(--brand-lite); }
.bubble .kt-xlsx:focus-visible { outline: 2px solid var(--brand-lite); outline-offset: 1px; }
.bubble .kt-xlsx svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.bubble .kt-xlsx.busy { opacity: .6; cursor: progress; }
.bubble .kt-xlsx.ok { color: var(--green); }
.bubble .kt-xlsx.bad { color: #ff6b6b; }
