/* uuu.bz — чисто, как в Заметках Apple */
:root {
  --bg: #ffffff;
  --fg: #1d1d1f;
  --muted: #8e8e93;
  --line: #e5e5ea;
  --accent: #e6a700;       /* жёлтый акцент Заметок */
  --accent-soft: #fff8e1;
  --hover: #f5f5f7;
  --danger: #d33;
  --mark: rgba(255, 204, 0, .34);   /* **жирное** в тексте — маркером, а не весом */
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1e;
    --fg: #f2f2f7;
    --muted: #8e8e93;
    --line: #3a3a3c;
    --accent: #ffd60a;
    --accent-soft: #2c2a20;
    --hover: #2c2c2e;
    --mark: rgba(255, 214, 10, .26);
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
/* авторские display-правила (например .overlay{display:flex}) сильнее браузерного
   [hidden]{display:none} — без !important все спрятанные диалоги видны всегда */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font: 18px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
/* Типографика по правилу владельца (20.09.2026): видимый текст от 18px, длинное
   чтение 20px, начертание не выше 400 — иерархия размером, интервалами и цветом.
   Браузер сам делает жирными заголовки, th, b и strong — снимаем это один раз
   здесь. Жирное в тексте документа — контент, его рисует маркер (.editor b). */
h1, h2, h3, h4, h5, h6, th, b, strong, optgroup, legend { font-weight: 400; }
/* поля без своего font браузер рисует системными 13px — наследуем 18px страницы */
input, select, textarea { font: inherit; }

/* -------- шапка -------- */
.top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 20px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 5;
}
.top .back { color: var(--accent); white-space: nowrap; display: inline-flex; align-items: center; min-height: 44px; }
.top .status { color: var(--muted); font-size: 18px; margin-left: auto; white-space: nowrap; }
.top .status.ok::before { content: '✓ '; color: #16a34a; }
.top .status.err { color: var(--danger); }
.top .brand { font-size: 22px; letter-spacing: .02em; }

/* панель форматирования */
.tools {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 14px;
  overflow-x: auto;
}
.tools button {
  color: var(--fg);
  font-size: 18px;
  padding: 5px 10px;
  white-space: nowrap;
  border-radius: 7px;
}
.tools button:hover { background: var(--hover); }
/* кнопка «B» показывает, как ляжет **жирное**: маркером, а не весом */
.tools .tb-mark { background: var(--mark); color: var(--fg); border-radius: 3px; padding: 0 .25em; }
.tools .sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; flex: 0 0 auto; }

button, .btn {
  font: inherit;
  border: none;
  background: none;
  color: var(--accent);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  min-height: 44px;                 /* тап-таргет — правило владельца */
}
.btn { display: inline-flex; align-items: center; }
button:hover, .btn:hover { background: var(--accent-soft); }
button.danger { color: var(--danger); }

/* -------- главная: боковая панель + список -------- */
.app { display: flex; min-height: 100%; align-items: stretch; }

.side {
  width: 240px;
  flex: 0 0 240px;
  border-right: 1px solid var(--line);
  padding: 16px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.side-brand { font-size: 22px; letter-spacing: .02em; padding: 4px 10px 14px; }

.create { position: relative; margin-bottom: 18px; }
.create-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  border-radius: 24px;
  background: var(--accent);
  color: #1d1d1f;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
}
.create-btn:hover { background: var(--accent); filter: brightness(1.06); }
.create-btn .plus { font-size: 22px; line-height: 1; }

.menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .16);
  padding: 6px;
  z-index: 20;
}
.menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  color: var(--fg);
  padding: 9px 12px;
  border-radius: 8px;
}
.menu button:hover { background: var(--hover); }
.menu .mi { color: var(--muted); display: flex; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 20px;
  font-size: 18px;
}
.nav a:hover { background: var(--hover); }
.nav a.active { background: var(--accent-soft); }
.nav .count { margin-left: auto; color: var(--muted); font-size: 18px; }

.main { flex: 1; min-width: 0; padding: 22px 28px 80px; max-width: 860px; }
.main-title { font-size: 26px; line-height: 1.3; margin: 22px 0 4px; }
.filter {
  width: 100%;
  font: inherit;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--hover);
  color: var(--fg);
  outline: none;
}
.filter:focus { border-color: var(--accent); }
.list { list-style: none; }
.list li { border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: none; }
.list a.item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 10px;
  border-radius: 8px;
}
.list a.item:hover { background: var(--hover); }
.list .ic { display: flex; flex: 0 0 auto; }
.list .ic.doc { color: #3b82f6; }
.list .ic.table { color: #16a34a; }
.list .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.list .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .sub {
  color: var(--muted);
  font-size: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.empty { color: var(--muted); padding: 14px 10px; font-size: 18px; }

/* -------- диалог «Создать» -------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}
.dialog {
  background: var(--bg);
  border-radius: 14px;
  padding: 22px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 14px 46px rgba(0, 0, 0, .3);
}
.dialog h3 { font-size: 22px; line-height: 1.3; margin-bottom: 14px; }
.dialog input {
  width: 100%;
  font: inherit;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--hover);
  color: var(--fg);
  outline: none;
}
.dialog input:focus { border-color: var(--accent); }
.dlg-buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.dlg-buttons button { color: var(--muted); }
.dlg-buttons .primary {
  background: var(--accent);
  color: #1d1d1f;
  padding: 8px 18px;
  border-radius: 8px;
}

/* -------- узкий экран -------- */
@media (max-width: 700px) {
  .app { display: block; }
  .side {
    width: auto;
    flex: none;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
  }
  .side-brand { padding: 0 6px 0 0; }
  .create { margin: 0; justify-self: end; }
  .create-btn { padding: 8px 14px; }
  .menu { left: auto; right: 0; min-width: 180px; }
  .nav { grid-column: 1 / -1; flex-direction: row; gap: 6px; overflow-x: auto; }
  .nav a { padding: 7px 13px; font-size: 18px; white-space: nowrap; min-height: 44px; }   /* палец: 44px */
  .main { padding: 16px 14px 60px; }
  /* шапка заметки/таблицы на телефоне: кнопок больше, чем ширины экрана — пусть
     шапка листается вбок, а не растягивает страницу (переполнение = зум и дрожь) */
  .top { gap: 8px; padding: 8px 12px; overflow-x: auto; scrollbar-width: none; }
  .top::-webkit-scrollbar { display: none; }
  .top > * { flex: 0 0 auto; white-space: nowrap; }
  .top .table-title { flex: 1 1 110px; min-width: 110px; }
  .top .status { margin-left: 4px; }
  .hist-body { flex-direction: column; height: 60vh; }
  .hist-list { width: auto; flex: 0 0 34%; }
}

/* -------- документ -------- */
.doc-wrap { max-width: 720px; margin: 0 auto; padding: 28px 20px 40vh; }
.doc-title {
  width: 100%;
  font-family: inherit;
  font-size: 30px;
  line-height: 1.3;
  border: none;
  outline: none;
  background: none;
  color: var(--fg);
  margin-bottom: 14px;
}
.editor {
  outline: none;
  min-height: 50vh;
  font-size: 20px;                  /* длинное чтение: 20px, строка ≈ 65ch при ширине 720px */
  line-height: 1.6;
  position: relative;
}
.editor.is-empty::before {
  content: attr(data-ph);
  position: absolute;
  color: var(--muted);
  pointer-events: none;
  font-size: 30px;
  line-height: 1.3;
}
/* первая строка — это заголовок заметки, как в Заметках Apple */
.editor > *:first-child { font-size: 30px; line-height: 1.3; margin: 0 0 12px; }
.editor > h1:first-child, .editor > h2:first-child, .editor > h3:first-child { margin-top: 0; }
.editor h1 { font-size: 30px; line-height: 1.3; margin: 24px 0 8px; }
.editor h2 { font-size: 26px; line-height: 1.3; margin: 20px 0 6px; }
.editor h3 { font-size: 22px; line-height: 1.35; margin: 16px 0 4px; }
.editor p { margin: 2px 0; min-height: 1.6em; }
/* **жирное** из markdown — маркер: начертание 400, подложка как у маркера в
   Заметках (решение владельца 11.10.2026). В markdown остаются **…** */
.editor b, .editor strong {
  background: var(--mark);
  border-radius: 3px;
  padding: 0 .12em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.editor ul, .editor ol { margin: 4px 0 4px 4px; padding-left: 20px; }
.editor li { margin: 2px 0; }
.editor hr { border: none; border-top: 1px solid var(--line); margin: 14px 0; }
.editor pre {
  background: var(--hover);
  border-radius: 8px;
  padding: 10px 12px;
  font: 18px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-x: auto;
  margin: 8px 0;
  white-space: pre-wrap;
}
.editor code {
  background: var(--hover);
  border-radius: 4px;
  padding: 1px 5px;
  font: 18px ui-monospace, SFMono-Regular, Menlo, monospace;
}
.editor pre code { background: none; padding: 0; }
.editor a { color: var(--accent); text-decoration: underline; }
.editor ul.checks { list-style: none; padding-left: 2px; }
.editor ul.checks li { display: flex; gap: 8px; align-items: baseline; }
.editor ul.checks input[type=checkbox] { accent-color: var(--accent); transform: translateY(2px); }
.editor ul.checks li.done { color: var(--muted); text-decoration: line-through; }

/* -------- таблица -------- */
.table-title {
  font: inherit;
  font-size: 22px;
  border: none;
  outline: none;
  background: none;
  color: var(--fg);
  flex: 1;
  min-width: 60px;
  padding: 4px 6px;
  border-radius: 6px;
}
.table-title:focus { background: var(--hover); }

/* отступ сверху — margin, а НЕ padding: в padding строки просвечивали над липкой шапкой */
/* max-height, а не height: маленькая таблица не должна тянуть пустую область
   на весь экран, а виртуальному скроллу хватает clientHeight в любом случае */
.table-wrap { padding: 0 20px; margin-top: 16px; overflow: auto; max-height: calc(100vh - 210px); overscroll-behavior: contain; }
/* overflow-anchor: none — обязательно. Иначе Chrome «якорит» прокрутку при смене
   содержимого выше экрана, сам двигает scrollTop, это вызывает новую отрисовку —
   и вкладка уходит в петлю до полного зависания. */
.table-wrap, .grid, .grid tbody { overflow-anchor: none; }
/* шапка не уезжает при прокрутке — на 27 тысячах строк это обязательное */
/* Лестница z-index, снизу вверх: обычная ячейка (auto) → примёрзшая колонка (1)
   → номер строки (2) → шапка (3) → примёрзшая шапка (4) → угол «номер+шапка» (6).
   Ломать порядок нельзя: разъедется либо шапка, либо примёрзшие колонки. */
.grid .ghead th { position: sticky; top: 0; z-index: 3; background: var(--hover); }
.grid .ghead th.rn { z-index: 6; }
/* распорки виртуального скролла: держат высоту, но ничего не рисуют */
.grid .vsp td { border: 0; padding: 0; background: none; }
/* fixed: ширины берутся из <colgroup>, а не из содержимого — иначе на каждой
   перерисовке пересчёт всей таблицы и прыгающие колонки при прокрутке */
.grid { border-collapse: separate; border-spacing: 0; }
/* fixed — только у редактируемой сетки: ширины берутся из <colgroup>, а не из
   содержимого, иначе на каждой перерисовке пересчёт всей таблицы и прыгающие
   колонки при прокрутке. Публичный просмотр (.view) остаётся авторазмерным. */
.grid:not(.view) { table-layout: fixed; }
.grid th, .grid td { border: 1px solid var(--line); border-width: 0 1px 1px 0; padding: 0; position: relative; }
.grid tr > *:first-child { border-left-width: 1px; }
.grid tr:first-child > *, .grid thead tr > * { border-top-width: 1px; }
/* у редактируемой сетки шапка в <thead>, её нижняя рамка уже есть: без этого первая
   строка tbody на 1px выше остальных, а виртуальный скролл умножает высоту ОДНОЙ
   строки — на 5000 строк прокрутка уезжала на сотню строк (нашёл QA 11.10.2026) */
.grid:not(.view) tbody tr:first-child > * { border-top-width: 0; }
.grid thead th, .grid tr:first-child th { background: var(--hover); }

/* номер строки слева */
.grid .rn {
  background: var(--hover);
  color: var(--muted);
  font-size: 18px;
  text-align: center;
  width: 72px;                      /* = RN_W в table.js: пятизначный номер в 18px */
  min-width: 72px;
  padding: 0 4px;
  position: sticky;
  left: 0;
  z-index: 2;
  cursor: pointer;
}
/* Замороженные колонки: какие именно — выбирает пользователь снежинкой в шапке.
   Смещение left считает JS по реальным ширинам. Фон обязателен и обязан быть
   непрозрачным: под ячейкой проезжает текст остальных колонок. */
.grid td.froz { position: sticky; z-index: 1; background: var(--bg); }
.grid thead th.froz { position: sticky; z-index: 4; background: var(--hover); }
.grid .froz-edge { box-shadow: 1px 0 0 var(--line); }
.grid th .frozb {
  position: absolute;
  right: 52px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  opacity: 0;
  font-size: 18px;
  width: 24px;
  padding: 0;
}
.grid th:hover .frozb { opacity: .7; }
.grid th .frozb.on { opacity: 1; color: var(--accent); }
.grid th .frozb:hover { opacity: 1; color: var(--accent); background: none; }

/* высота строки задана жёстко (44px + 1px рамки = ROW_GUESS в table.js): виртуальный
   скролл меряет одну строку и умножает — плавающая высота дала бы дрейф */
.grid input {
  font: inherit;
  font-size: 18px;
  border: none;
  outline: none;
  background: none;
  color: var(--fg);
  height: 44px;
  padding: 0 10px;
  width: 100%;
  min-width: 170px;
  display: block;
}
.grid td:focus-within, .grid th:focus-within { outline: 2px solid var(--accent); outline-offset: -2px; z-index: 1; }
.grid tr.blank .rn { color: var(--line); }

.grid .rowdel {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  opacity: 0;
  font-size: 18px;
  width: 26px;
  padding: 0;
}
.grid tr:hover .rowdel { opacity: 1; }
.grid .rowdel:hover { color: var(--danger); background: none; }

.table-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px 0;
  flex-wrap: wrap;
}
.table-tools .tools-label { color: var(--muted); font-size: 18px; }
.table-tools button {
  border: 1px solid var(--line);
  color: var(--fg);
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 18px;
}
.table-tools .sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.table-tools .tools-stats {
  margin-left: auto;
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 18px;
  white-space: nowrap;
}
.table-tools #colstat { color: var(--fg); }
.hint { color: var(--muted); font-size: 18px; padding: 12px 20px 40px; max-width: 75ch; line-height: 1.5; }

/* -------- логин -------- */
.login-box {
  max-width: 320px;
  margin: 26vh auto 0;
  padding: 0 20px;
  text-align: center;
}
.login-box h1 { font-size: 28px; margin-bottom: 18px; }
.login-box input {
  width: 100%;
  font: inherit;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--hover);
  color: var(--fg);
  outline: none;
  margin-bottom: 12px;
  text-align: center;
}
.login-box input:focus { border-color: var(--accent); }
.login-box button {
  width: 100%;
  background: var(--accent);
  color: #000;
  padding: 10px;
  border-radius: 10px;
}
.login-box .bad { color: var(--danger); font-size: 18px; margin-top: 10px; }

/* -------- Cmd+K: командная строка -------- */
.palette { align-items: flex-start; padding-top: 12vh; }
.palette-box {
  background: var(--bg);
  border-radius: 14px;
  width: 100%;
  max-width: 620px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .35);
  overflow: hidden;
}
.palette-input {
  width: 100%;
  font: inherit;
  font-size: 20px;
  padding: 16px 20px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--fg);
  outline: none;
}
.palette-list { list-style: none; max-height: 52vh; overflow-y: auto; }
.palette-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  cursor: pointer;
}
.palette-list li.on { background: var(--accent-soft); }
.palette-list .pk { color: var(--muted); font-size: 18px; width: 22px; text-align: center; }
.palette-list .pk.doc { color: #3b82f6; }
.palette-list .pk.table { color: #16a34a; }
.palette-list .pk.new { color: var(--accent); }
.palette-list .pt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.palette-list .p1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-list .p2 { color: var(--muted); font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-empty { color: var(--muted); padding: 16px 20px; cursor: default; }
.palette-foot {
  border-top: 1px solid var(--line);
  padding: 8px 20px;
  color: var(--muted);
  font-size: 18px;
}

/* выход — последним пунктом навигации: у любой панели есть вход И выход */
.nav .nav-out { margin-top: 6px; }
.nav .nav-out button { color: var(--muted); padding: 9px 14px; border-radius: 20px; min-height: 44px; }
.nav .nav-out button:hover { background: var(--hover); color: var(--fg); }
@media (max-width: 700px) {
  .nav .nav-out { margin: 0; }
  .nav .nav-out button { padding: 7px 13px; white-space: nowrap; }
}

kbd {
  font: inherit;
  font-size: 18px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 4px;
  margin-right: 2px;
}

/* -------- перетаскивание файла -------- */
.dropzone {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(230, 167, 0, .12);
  border: 3px dashed var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.dropzone div {
  background: var(--bg);
  padding: 18px 28px;
  border-radius: 14px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .2);
}

/* -------- история версий -------- */
.hist-box {
  background: var(--bg);
  border-radius: 14px;
  padding: 20px;
  width: 100%;
  max-width: 720px;
  box-shadow: 0 14px 46px rgba(0, 0, 0, .3);
}
.hist-box h3 { font-size: 22px; line-height: 1.3; margin-bottom: 14px; }
.hist-body { display: flex; gap: 14px; height: 46vh; }
.hist-list {
  list-style: none;
  width: 240px;
  flex: 0 0 240px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.hist-list li {
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  font-size: 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hist-list li:last-child { border-bottom: none; }
.hist-list li:hover { background: var(--hover); }
.hist-list li.on { background: var(--accent-soft); }
.hist-list li span { color: var(--muted); font-size: 18px; }
.hist-list .hist-empty { color: var(--muted); cursor: default; }
.hist-prev {
  flex: 1;
  overflow: auto;
  background: var(--hover);
  border-radius: 10px;
  padding: 14px;
  font: 18px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  color: var(--fg);
}

/* -------- сортировка таблицы -------- */
.grid th input { padding-right: 80px; }
.grid th .coldel {
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  opacity: 0;
  font-size: 18px;
  width: 24px;
  padding: 0;
}
.grid th:hover .coldel { opacity: .7; }
.grid th .coldel:hover { color: var(--danger); background: none; opacity: 1; }
.grid th .sortb {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  opacity: 0;
  font-size: 18px;
  width: 24px;
  padding: 0;
}
.grid th:hover .sortb { opacity: .7; }
.grid th .sortb.on { opacity: 1; color: var(--accent); }

/* миниатюра картинки в списке файлов */
.item .thumb {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: cover;
  flex: none;
  background: var(--hover);
}

.dlg-hint { color: var(--muted); font-size: 18px; line-height: 1.5; margin-top: 10px; }

/* кнопка «раскрыть строку» — в первой колонке, она примёрзшая и видна всегда */
.grid .rowopen {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  opacity: 0;
  font-size: 18px;
  width: 30px;
  padding: 0;
  border-radius: 6px;
  background: var(--bg);
}
.grid tr:hover .rowopen { opacity: .65; }
.grid .rowopen:hover { opacity: 1; color: var(--accent); background: var(--hover); }

/* -------- карточка строки -------- */
.rowcard { align-items: stretch; justify-content: flex-end; padding: 0; }
.card-box {
  background: var(--bg);
  width: min(560px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 40px rgba(0, 0, 0, .12);
  animation: card-in .18s ease;
}
@keyframes card-in { from { transform: translateX(24px); opacity: 0; } }
.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.card-title { font-size: 22px; margin-right: auto; }
.card-head button {
  color: var(--muted);
  font-size: 18px;
  padding: 2px 9px;
  border-radius: 8px;
  line-height: 1.2;
}
.card-head button:hover { background: var(--hover); color: var(--fg); }
.card-body { overflow: auto; padding: 6px 18px 30px; }
.card-field { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
.card-field:last-child { border-bottom: 0; }
.card-label {
  display: block;
  color: var(--muted);
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 5px;
}
.card-body textarea {
  width: 100%;
  font: inherit;
  font-size: 18px;
  color: var(--fg);
  background: none;
  border: 0;
  resize: none;
  overflow: hidden;
  padding: 2px 0;
  line-height: 1.5;
}
.card-body textarea:focus { outline: none; }
.card-field:focus-within .card-label { color: var(--accent); }
@media (max-width: 700px) {
  .card-box { width: 100%; border-left: 0; }
}

/* -------- плеер -------- */
.list .ic.audio { color: #e6a700; }
/* ============ Плеер аудио (переделан 08.09.2026) ============ */
/* Цвет всего плеера берётся от «обложки» книги: audio.js считает оттенок из
   имени и ставит --art-h / --art-h2 / --art-ink на <body>. От них живут
   свечение карточки, полоса, кнопка Play и подсветка текущей части — так
   каждая книга выглядит своей, а морда вокруг остаётся жёлтой, как везде.
   В тёмной теме краски приглушены: яркий экран ночью в руках — это боль. */
body.audio-page { --art-h: 42; --art-h2: 82; --art-ink: #1d1d1f; }

.player {
  max-width: 620px;
  margin: 0 auto;
  padding: 18px 16px calc(40px + env(safe-area-inset-bottom));
}
.pl-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 30px 26px 24px;
  background:
    radial-gradient(130% 90% at 50% -25%, hsl(var(--art-h) 80% 55% / .18), transparent 68%),
    var(--bg);
  box-shadow: 0 24px 60px -34px hsl(var(--art-h) 60% 32% / .55);
}
@media (prefers-color-scheme: dark) {
  .pl-card { background: radial-gradient(130% 90% at 50% -25%, hsl(var(--art-h) 60% 45% / .20), transparent 68%), var(--bg); }
}

/* обложка и название — по центру, как в любом «сейчас играет» */
.pl-hero { text-align: center; margin-bottom: 22px; }
.pl-art {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 0 auto 18px;
  border-radius: 28px;
  background: linear-gradient(155deg, hsl(var(--art-h) 78% 58%), hsl(var(--art-h2) 72% 42%));
  color: #fff;
  font-size: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 22px 44px -18px hsl(var(--art-h) 65% 30% / .8);
  text-shadow: 0 2px 14px rgba(0, 0, 0, .28);
  transition: transform .35s ease, box-shadow .35s ease;
}
body.playing .pl-art { transform: translateY(-2px) scale(1.02); box-shadow: 0 28px 54px -18px hsl(var(--art-h) 65% 30% / .9); }
/* играет — три полоски в углу обложки; это спокойнее пульсирующего кольца */
.pl-eq { position: absolute; right: 12px; bottom: 12px; display: none; align-items: flex-end; gap: 3px; height: 18px; }
body.playing .pl-eq { display: flex; }
.pl-eq i { width: 3px; height: 6px; border-radius: 2px; background: rgba(255, 255, 255, .92); animation: pl-eq 1s ease-in-out infinite; }
.pl-eq i:nth-child(2) { animation-delay: .22s; }
.pl-eq i:nth-child(3) { animation-delay: .44s; }
@keyframes pl-eq { 0%, 100% { height: 5px; } 50% { height: 17px; } }
@media (prefers-reduced-motion: reduce) {
  .pl-eq i { animation: none; height: 11px; }
  .pl-art, body.playing .pl-art { transition: none; transform: none; }
}
.pl-kicker {
  color: hsl(var(--art-h) 62% 42%);
  font-size: 18px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px;
}
@media (prefers-color-scheme: dark) { .pl-kicker { color: hsl(var(--art-h) 70% 68%); } }
.pl-name { font-size: 28px; line-height: 1.3; word-break: break-word; margin-bottom: 8px; }
.pl-sub { color: var(--muted); font-size: 18px; }
.pl-sub a { color: hsl(var(--art-h) 62% 44%); }
@media (prefers-color-scheme: dark) { .pl-sub a { color: hsl(var(--art-h) 70% 68%); } }

/* полоса: видимая тонкая, но зона нажатия во весь палец */
.pl-bar {
  position: relative;
  height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}
.pl-bar::before {
  content: '';
  position: absolute; left: 0; right: 0;
  height: 8px; border-radius: 99px;
  background: var(--line);
  transition: height .15s ease;
}
.pl-buf, .pl-fill { position: absolute; left: 0; height: 8px; border-radius: 99px; transition: height .15s ease; }
/* скачанное — очень тихо: раньше это читалось как «уже прослушано» */
.pl-buf { background: hsl(var(--art-h) 25% 50% / .22); }
.pl-fill {
  background: linear-gradient(90deg, hsl(var(--art-h) 80% 58%), hsl(var(--art-h2) 74% 47%));
  transition: width .12s linear, height .15s ease;
}
.pl-bar:hover::before, .pl-bar.seek::before,
.pl-bar:hover .pl-buf, .pl-bar.seek .pl-buf,
.pl-bar:hover .pl-fill, .pl-bar.seek .pl-fill { height: 12px; }
.pl-bar.seek .pl-fill { transition: height .15s ease; }   /* за пальцем — без задержки */
.pl-knob {
  position: absolute;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--bg);
  border: 3px solid hsl(var(--art-h) 74% 50%);
  transform: translateX(-50%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
  opacity: 0;
  transition: opacity .15s ease;
  pointer-events: none;
}
.pl-bar:hover .pl-knob, .pl-bar.seek .pl-knob { opacity: 1; }
@media (hover: none) { .pl-knob { opacity: 1; } }        /* на телефоне ручка видна всегда */
/* время под пальцем при перемотке: видно, куда попадёшь */
.pl-bubble {
  position: absolute; bottom: 38px; transform: translateX(-50%);
  background: var(--fg); color: var(--bg);
  font-size: 18px; font-variant-numeric: tabular-nums;
  padding: 4px 9px; border-radius: 9px; pointer-events: none; white-space: nowrap;
}
.pl-times {
  display: flex; justify-content: space-between; align-items: center;
  color: var(--muted); font-size: 18px; font-variant-numeric: tabular-nums;
  margin: 0 2px 18px;
}
.pl-tleft { color: var(--muted); font-size: 18px; padding: 4px 8px; min-height: 44px; border-radius: 8px; }
.pl-tleft:hover { background: var(--hover); }

/* кнопки: одна главная, остальные тише её */
.pl-controls { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 20px; }
.pl-controls button { color: var(--fg); display: inline-flex; align-items: center; justify-content: center; }
.pl-play {
  width: 76px; height: 76px; border-radius: 50%;
  color: var(--art-ink);
  background: linear-gradient(160deg, hsl(var(--art-h) 82% 60%), hsl(var(--art-h2) 74% 44%));
  box-shadow: 0 12px 26px -10px hsl(var(--art-h) 70% 34% / .85);
  transition: transform .12s ease, filter .12s ease;
}
/* фон повторяем: общий button:hover красит любую кнопку в бледно-жёлтый и
   бьёт по специфичности — без этого главная кнопка на наведении выцветала */
.pl-play:hover {
  filter: brightness(1.05);
  background: linear-gradient(160deg, hsl(var(--art-h) 82% 60%), hsl(var(--art-h2) 74% 44%));
}
.pl-play:active { transform: scale(.955); }
.pl-skip {
  width: 60px; height: 60px; border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg);
  transition: border-color .12s ease, background .12s ease;
}
.pl-skip:hover { border-color: hsl(var(--art-h) 70% 55%); background: hsl(var(--art-h) 80% 55% / .1); }
.pl-step { width: 48px; height: 48px; border-radius: 50%; color: var(--muted); }
.pl-step:hover { background: var(--hover); color: var(--fg); }
.pl-step:disabled { opacity: .22; cursor: default; background: none; }

/* скорость — шаговый регулятор вместо пяти кнопок; сон — одна кнопка по кругу */
.pl-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; }
.pl-stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.pl-stepper button { min-width: 48px; height: 44px; color: var(--fg); font-size: 18px; line-height: 1; }
.pl-stepper button:hover { background: var(--hover); }
.pl-stepper .pl-rate {
  min-width: 76px; font-size: 18px; font-variant-numeric: tabular-nums;
  border-left: 1px solid var(--line); border-right: 1px solid var(--line);
}
.pl-stepper .pl-rate.fast { color: hsl(var(--art-h) 62% 42%); }
@media (prefers-color-scheme: dark) { .pl-stepper .pl-rate.fast { color: hsl(var(--art-h) 70% 68%); } }
.pl-sleep {
  height: 44px; padding: 0 18px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--fg); font-size: 18px; font-variant-numeric: tabular-nums;
}
.pl-sleep:hover { background: var(--hover); }
.pl-sleep.on {
  border-color: hsl(var(--art-h) 70% 55%);
  background: hsl(var(--art-h) 80% 55% / .14);
}
.pl-hint { color: var(--muted); font-size: 18px; line-height: 1.5; margin-top: 20px; text-align: center; }

/* кнопка «Offline» в шапке и «все части» над списком */
.pl-off.on { background: var(--accent-soft); color: var(--fg); }
.pl-off-all { font-size: 18px; }
.pl-off-all:disabled { color: var(--muted); background: none; cursor: default; }

/* список частей */
.pl-queue { margin-top: 26px; }
.pl-queue-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 4px 6px; }
.pl-queue-head span { font-size: 20px; }
.pl-list { list-style: none; }
.q-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 12px;
  min-height: 60px;
  border-radius: 14px;
  cursor: pointer;
}
.q-item:hover { background: var(--hover); }
.q-item.on { background: hsl(var(--art-h) 80% 55% / .12); }
.q-n {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--hover); color: var(--muted);
  font-size: 18px; font-variant-numeric: tabular-nums;
}
.q-item.on .q-n { background: hsl(var(--art-h) 74% 50%); color: #fff; }
.q-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.q-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-meta { color: var(--muted); font-size: 18px; }
.q-chip {
  display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px;
  background: var(--hover); color: var(--muted); font-size: 18px;
}
.q-prog { display: block; height: 4px; border-radius: 99px; background: var(--line); margin-top: 5px; }
.q-prog span { display: block; height: 100%; border-radius: 99px; background: hsl(var(--art-h) 74% 52%); }
.q-play { color: var(--muted); flex: none; width: 30px; display: flex; align-items: center; justify-content: center; }
.q-item.on .q-play { color: hsl(var(--art-h) 62% 42%); }
@media (prefers-color-scheme: dark) { .q-item.on .q-play { color: hsl(var(--art-h) 70% 68%); } }

@media (max-width: 560px) {
  .player { padding: 12px 12px calc(40px + env(safe-area-inset-bottom)); }
  .pl-card { padding: 24px 18px 20px; border-radius: 22px; }
  .pl-art { width: 148px; height: 148px; font-size: 64px; border-radius: 26px; }
  .pl-name { font-size: 24px; }
  .pl-controls { gap: 10px; }
  .pl-play { width: 72px; height: 72px; }
  .pl-skip { width: 56px; height: 56px; }
  .pl-step { width: 44px; height: 44px; }
}

/* полоска прослушанного в списке и карточка «продолжить» */
.list .prog {
  display: block;
  height: 3px;
  border-radius: 2px;
  background: var(--line);
  margin-top: 6px;
  max-width: 260px;
}
.list .prog span { display: block; height: 100%; border-radius: 2px; background: var(--accent); }
.cont-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin: 16px 0 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--accent-soft);
}
.cont-card:hover { border-color: var(--accent); }
.cont-card .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.cont-card .name { font-size: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cont-card .sub { color: var(--muted); font-size: 18px; }
.cont-label {
  color: var(--accent);
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.cont-play {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent);
  color: #1d1d1f;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cont-card .prog { max-width: none; }
/* у видео вместо кружка — сам кадр: сразу видно, что продолжаем смотреть */
.cont-shot {
  position: relative; flex: none;
  width: 104px; height: 59px;
  border-radius: 10px; overflow: hidden; background: #000;
  display: grid; place-items: center;
}
.cont-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cont-play.sm {
  position: absolute; width: 34px; height: 34px; font-size: 18px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .45);
}

/* -------- промты -------- */
.list .ic.prompt { color: #0a84ff; }
.palette-list .pk.prompt { color: #0a84ff; }
.vars {
  background: var(--hover);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 22px;
}
.vars-title { font-size: 20px; margin-bottom: 8px; }
.vars-field { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.vars-field span { min-width: 130px; color: var(--muted); font-size: 18px; font-family: ui-monospace, monospace; }
.vars-field input {
  flex: 1; font: inherit; font-size: 18px; padding: 8px 11px; min-height: 44px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--fg);
}
.vars-field input:focus { outline: none; border-color: var(--accent); }
.vars-copy {
  margin-top: 10px; background: var(--accent); color: #1d1d1f;
  padding: 10px 18px; border-radius: 10px; min-height: 44px;
}
.vars-copy:hover { background: var(--accent); filter: brightness(1.06); }
.vars-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.vars-actions .vars-copy { margin-top: 0; }
.vars-open {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 10px; color: var(--fg); background: var(--bg);
}
.vars-open:hover { border-color: var(--accent); color: var(--accent); }
@media print { .vars { display: none; } }

/* -------- /add: быстрый вход текста -------- */
.add-wrap { max-width: 720px; margin: 0 auto; padding: 22px 20px 60px; }
.add-kind { display: flex; gap: 8px; margin-bottom: 14px; }
.add-kind button {
  min-height: 44px; padding: 0 18px; border: 1px solid var(--line); border-radius: 11px;
  color: var(--fg); font-size: 18px;
}
.add-kind button.on { background: var(--accent); border-color: var(--accent); color: #1d1d1f; }
#text {
  width: 100%; min-height: 46vh; font: inherit; font-size: 20px; line-height: 1.6; padding: 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--fg); resize: vertical;
}
#text:focus { outline: none; border-color: var(--accent); }
.add-save {
  margin-top: 14px; width: 100%; min-height: 50px; background: var(--accent); color: #1d1d1f;
 font-size: 18px; border-radius: 12px;
}
.add-save:hover { background: var(--accent); filter: brightness(1.06); }
.add-save:disabled { opacity: .5; }
.add-help { margin-top: 26px; color: var(--muted); font-size: 18px; line-height: 1.55; }
.add-help summary { cursor: pointer; color: var(--fg); }
.add-help p { margin: 10px 0 0; }
.add-help .add-k { color: var(--fg); }
.add-help code { background: var(--hover); padding: 1px 6px; border-radius: 5px; font-size: 18px; }
.add-help .bm {
  display: inline-block; padding: 4px 12px; border: 1px dashed var(--accent); border-radius: 8px;
  color: var(--accent); cursor: grab;
}

/* -------- тост с Undo -------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  background: var(--fg);
  color: var(--bg);
  padding: 4px 8px 4px 18px;
  border-radius: 12px;
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 18px;
  z-index: 120;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .28);
  animation: toast-in .22s ease;
  max-width: 92vw;
}
.toast span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast button {
  color: var(--accent);
  font-size: 18px;
  padding: 0 12px;
  flex: none;
}
.toast.gone { opacity: 0; transition: opacity .4s; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }
@media print { .toast { display: none !important; } }

/* экран «объекта нет» — вместо молча пустой страницы */
.broken { padding: 12vh 20px; text-align: center; color: var(--muted); }
.broken p { margin-bottom: 12px; }
.broken a { color: var(--accent); }

/* -------- «Поделиться» -------- */
.share-note { color: var(--muted); font-size: 18px; line-height: 1.5; margin-bottom: 12px; }
.share-url { font-size: 18px; }

/* -------- публичный просмотр -------- */
.share-loading { color: var(--muted); padding: 40px 20px; text-align: center; }
.editor.readonly input[type=checkbox] { pointer-events: none; }
.grid.view th.txt, .grid.view td.txt { padding: 7px 12px; min-width: 120px; font-size: 18px; }
.grid.view th.txt { text-align: left; }

/* -------- корзина -------- */
.main-head { display: flex; align-items: baseline; justify-content: space-between; }
.trash-link { color: var(--muted); }
.list .trash-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 10px;
}
.list .trash-row button { white-space: nowrap; }

/* -------- фильтр строк таблицы -------- */
.table-filter { display: flex; align-items: center; gap: 10px; padding: 12px 20px 0; }
.table-filter input {
  font: inherit;
  font-size: 18px;
  padding: 7px 12px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--hover);
  color: var(--fg);
  outline: none;
  width: 320px;
  max-width: 60vw;
}
.table-filter input:focus { border-color: var(--accent); }
.table-filter .fcount { color: var(--muted); font-size: 18px; }
.grid tr.hide { display: none; }

/* -------- закрепление -------- */
.list .pinb { opacity: 0; white-space: nowrap; flex: 0 0 auto; font-size: 18px; }
.list a.item:hover .pinb { opacity: 1; }
/* без hover (телефон, планшет) кнопки видны всегда и в размер пальца */
@media (hover: none) {
  .list .pinb { opacity: 1; min-height: 44px; }
}
.list .pin-mark { font-size: 18px; }

/* -------- перетаскивание строк -------- */
.grid .rn.draggable { cursor: grab; }
.grid tr.dragging { opacity: .4; }
.grid tr.dropline > * { border-top: 2px solid var(--accent); }

/* -------- цвета строк: 6 контрастных, работают в светлой и тёмной теме -------- */
.grid tr.c-red    > td { background: rgba(255, 59, 48, .14); }
.grid tr.c-yellow > td { background: rgba(255, 204, 0, .18); }
.grid tr.c-green  > td { background: rgba(52, 199, 89, .15); }
.grid tr.c-blue   > td { background: rgba(0, 122, 255, .13); }
.grid tr.c-purple > td { background: rgba(175, 82, 222, .14); }
.grid tr.c-gray   > td { background: rgba(142, 142, 147, .18); }

/* У примёрзшей колонки фон обязан быть НЕПРОЗРАЧНЫМ: сквозь полупрозрачную
   подсветку просвечивал бы текст, проезжающий под ней при горизонтальной
   прокрутке. Кладём цвет слоем поверх фона страницы. */
.grid tr.c-red    > td.froz { background: linear-gradient(rgba(255, 59, 48, .14), rgba(255, 59, 48, .14)), var(--bg); }
.grid tr.c-yellow > td.froz { background: linear-gradient(rgba(255, 204, 0, .18), rgba(255, 204, 0, .18)), var(--bg); }
.grid tr.c-green  > td.froz { background: linear-gradient(rgba(52, 199, 89, .16), rgba(52, 199, 89, .16)), var(--bg); }
.grid tr.c-blue   > td.froz { background: linear-gradient(rgba(10, 132, 255, .14), rgba(10, 132, 255, .14)), var(--bg); }
.grid tr.c-purple > td.froz { background: linear-gradient(rgba(191, 90, 242, .16), rgba(191, 90, 242, .16)), var(--bg); }
.grid tr.c-gray   > td.froz { background: linear-gradient(rgba(142, 142, 147, .18), rgba(142, 142, 147, .18)), var(--bg); }

.grid .rowcolor {
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  opacity: 0;
  font-size: 18px;
  width: 24px;
  padding: 0;
}
.grid tr:hover .rowcolor { opacity: 1; }
.grid .rowcolor:hover { color: var(--accent); background: none; }

.colorpop {
  position: fixed;
  display: flex;
  gap: 0;
  padding: 2px 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .22);
  z-index: 70;
}
/* кнопка 44×44 под палец, видимый кружок 24px: цвет красится только по
   content-box (padding 10px), кольцо — тенью внутри того же круга */
.colorpop .sw {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  padding: 10px;
  background-clip: content-box;
}
.colorpop .sw::before {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line);
}
.colorpop .sw:hover { transform: scale(1.18); }
.colorpop .sw.none { background-color: var(--bg); }
.colorpop .sw.none::after {
  content: '';
  position: absolute;
  inset: 14px;
  border-top: 2px solid var(--danger);
  transform: rotate(-45deg) translateY(6px);
}
.colorpop .sw.red    { background-color: #ff453a; }
.colorpop .sw.yellow { background-color: #ffcc00; }
.colorpop .sw.green  { background-color: #34c759; }
.colorpop .sw.blue   { background-color: #0a84ff; }
.colorpop .sw.purple { background-color: #bf5af2; }
.colorpop .sw.gray   { background-color: #8e8e93; }

/* -------- Диск: файлы -------- */
.list .upl { display: flex; align-items: center; gap: 12px; padding: 11px 10px; }
.list .upl progress { width: 160px; height: 8px; accent-color: var(--accent); vertical-align: middle; }
/* строка загрузки — не ссылка, ховера у неё нет: Stop виден всегда */
.list .upl .stop { opacity: 1; margin-left: auto; min-height: 44px; padding: 0 14px; }
/* на узком экране прогресс, проценты и скорость переносятся, а не обрезаются */
.list .upl .txt { flex: 1; min-width: 0; }
.list .upl .sub { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px;
                  overflow: visible; text-overflow: clip; font-size: 18px; }
.list .upl progress { flex: 1 1 90px; width: auto; max-width: 160px; }
.list .upl .rate { white-space: nowrap; }
.list .pinb.fdel:hover { color: var(--danger); }

/* публичная страница файла */
.file-card {
  max-width: 380px;
  margin: 18vh auto 0;
  padding: 30px 26px;
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: center;
}
/* карточка с превью шире и выше по странице, чем голая кнопка Download */
.file-card:has(.share-preview) { max-width: min(760px, 94vw); margin-top: 6vh; }
.share-preview {
  display: block;
  max-width: 100%;
  max-height: 62vh;
  margin: 0 auto 18px;
  border-radius: 12px;
}
.share-audio { display: block; width: 100%; margin: 0 auto 18px; }
.file-card-row { display: flex; gap: 10px; justify-content: center; }
.file-card-btn.ghostbtn { background: none; border: 1px solid var(--line); color: var(--fg); }
.file-card-name { font-size: 22px; line-height: 1.3; word-break: break-all; }
.file-card-size { color: var(--muted); font-size: 18px; margin: 6px 0 20px; }
.file-card-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  background: var(--accent);
  color: #1d1d1f;
  padding: 10px 26px;
  border-radius: 10px;
}

/* -------- главная-витрина (до входа) -------- */
body.landing {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(230, 167, 0, .12), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(230, 167, 0, .08), transparent 60%),
    var(--bg);
  padding: 24px;
}
.hero { width: 100%; max-width: 430px; text-align: center; }
.hero-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 18px;
  background: var(--accent);
  color: #fff;
  font-size: 40px;
  line-height: 72px;
  box-shadow: 0 10px 30px rgba(230, 167, 0, .35);
}
.hero-title { font-size: 40px; line-height: 1.2; letter-spacing: .01em; margin-bottom: 8px; }
.hero-tagline { color: var(--muted); font-size: 20px; line-height: 1.5; margin-bottom: 26px; }
.hero-feats {
  list-style: none;
  text-align: left;
  margin: 0 auto 30px;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hero-feats li { display: flex; gap: 12px; align-items: baseline; font-size: 18px; }
.hero-feats span { color: var(--accent); width: 18px; flex: 0 0 auto; }
.hero-form { display: flex; flex-direction: column; gap: 10px; max-width: 360px; margin: 0 auto; }
.hero-form input {
  width: 100%;
  font: inherit;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--fg);
  outline: none;
}
.hero-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(230, 167, 0, .18); }
.hero-btn {
  background: var(--accent);
  color: #1d1d1f;
  font-size: 18px;
  padding: 12px 26px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(230, 167, 0, .35);
  transition: transform .12s ease;
}
.hero-btn:hover { background: var(--accent); filter: brightness(1.06); transform: translateY(-1px); }
.hero .bad { color: var(--danger); margin-top: 12px; font-size: 18px; }
.hero-foot { color: var(--muted); font-size: 18px; margin-top: 30px; }
.hero-foot a { text-decoration: underline; }

/* -------- витрина: карточки фич -------- */
.hero { max-width: 660px; }
.hero-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0 0 30px;
  text-align: left;
}
.hero-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(4px);
  transition: transform .14s ease, box-shadow .14s ease;
}
.hero-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0, 0, 0, .1); }
.hc-icon { color: var(--accent); font-size: 22px; margin-bottom: 6px; }
.hc-name { font-size: 20px; margin-bottom: 3px; }
.hc-text { color: var(--muted); font-size: 18px; line-height: 1.5; }
.hc-text code {
  background: var(--hover);
  border-radius: 4px;
  padding: 0 4px;
  font: 18px ui-monospace, SFMono-Regular, Menlo, monospace;
}
.hc-text a { color: var(--accent); }
@media (max-width: 560px) {
  .hero-cards { grid-template-columns: 1fr; }
}

/* -------- зона загрузки в разделе Files -------- */
.drop-pad {
  border: 2px dashed var(--line);
  border-radius: 16px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  margin: 14px 0 6px;
  transition: border-color .15s ease, background .15s ease, transform .12s ease;
}
.drop-pad:hover, .drop-pad.over {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.drop-pad.over { transform: scale(1.01); }
.dp-icon { font-size: 30px; color: var(--accent); line-height: 1.2; }
.dp-title { font-size: 20px; margin-top: 6px; }
.dp-sub { color: var(--muted); font-size: 18px; margin-top: 5px; max-width: 460px; margin-left: auto; margin-right: auto; line-height: 1.5; }

/* -------- раздел Docs -------- */
.list .ic.mdoc { color: #a855f7; }
.palette-list .pk.mdoc { color: #a855f7; font-size: 18px; }
.palette-list .pk.file { color: #f59e0b; }
.main-head .head-actions { display: flex; gap: 8px; align-items: center; }
#docsSort { border: 1px solid var(--line); border-radius: 8px; padding: 4px 12px; color: var(--fg); font-size: 18px; }
#docsZip { font-size: 18px; }

/* -------- чистая печать: Cmd+P отдаёт только текст -------- */
@media print {
  .top, .side, .filter, .main-head button, .table-tools,
  .table-filter, .hint, .drop-pad, .overlay, .colorpop, .sync-banner, .new-row,
  .grid .colrs { display: none !important; }
  body { background: #fff; color: #000; }
  .doc-wrap { max-width: 100%; padding: 0; }
  .editor { min-height: 0; }
  .editor a { color: #000; }
  .grid input { color: #000; }
}

/* -------- режим чтения библиотечного дока -------- */
body.reading .editor { caret-color: transparent; }
body.reading .editor a { cursor: pointer; }
.toc {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 22px;
  background: var(--hover);
}
.toc-title {
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 8px;
}
.toc a { display: block; padding: 8px 0; color: var(--fg); font-size: 18px; line-height: 1.55; }
.toc a:hover { color: var(--accent); }
.toc-h2 { padding-left: 16px !important; }
.toc-h3 { padding-left: 32px !important; color: var(--muted) !important; }
@media print { .toc { background: none; } }

/* -------- вики-ссылки [[...]] -------- */
.editor a.wiki {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed var(--accent);
}

/* экран несуществующего дока (клик по битой вики-ссылке) */
.ghost-doc { text-align: center; padding: 12vh 20px; color: var(--muted); }
.ghost-doc p { font-size: 20px; margin-bottom: 18px; }
.ghost-create {
  background: var(--accent);
  color: #1d1d1f;
  padding: 10px 24px;
  border-radius: 10px;
}

/* -------- diff в истории версий -------- */
.diff-hint { color: var(--muted); font-size: 18px; margin-bottom: 8px; }
.hist-prev .dl-add { display: block; background: rgba(52, 199, 89, .16); }
.hist-prev .dl-del {
  display: block;
  background: rgba(255, 59, 48, .13);
  text-decoration: line-through;
  opacity: .75;
}
.hist-prev .dl-same { display: block; }

/* -------- живая синхронизация: чужая правка при несохранённом своём -------- */
.sync-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent-soft);
  font-size: 18px;
}
.sync-banner button { min-height: 44px; padding: 0 12px; }
.sync-banner button:first-of-type { margin-left: auto; }

/* -------- главная: найденное внутри текста -------- */
.list .found-head {
  color: var(--muted);
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 16px 10px 6px;
}

/* -------- ширина колонки перетаскиванием -------- */
.grid th .colrs {
  position: absolute;
  top: 0;
  right: -5px;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
  z-index: 5;
}
.grid th .colrs:hover, .grid.resizing th .colrs { background: var(--accent); opacity: .45; }
.grid.resizing { cursor: col-resize; user-select: none; }

/* -------- создать из строки поиска на главной -------- */
.list .new-row { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 10px; }
.list .new-row button {
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--fg);
  min-height: 44px;
  padding: 0 14px;
}
.list .new-row button:hover { border-color: var(--accent); background: var(--accent-soft); }

/* -------- «For an AI agent» в диалоге Share -------- */
.share-agent { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.share-agent h3 { margin-bottom: 6px; }
.share-api { font: 18px ui-monospace, SFMono-Regular, Menlo, monospace; }

/* публичная таблица: показана только часть */
.share-more { color: var(--muted); padding: 14px 20px 30px; }

/* -------- обратные ссылки: кто ссылается сюда через [[Название]] -------- */
.backlinks { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); }
.bl-title {
  color: var(--muted);
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 4px;
}
.bl-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;                 /* палец попадает без прицеливания */
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.bl-item:last-child { border-bottom: 0; }
.bl-name { color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-item:hover .bl-name { text-decoration: underline; }
.bl-kind { margin-left: auto; color: var(--muted); font-size: 18px; flex: none; }
@media print { .backlinks { display: none !important; } }

/* -------- командная строка агента (Cmd+J) -------- */
.agent { align-items: flex-start; padding-top: 10vh; }
.ag-box {
  background: var(--bg);
  border-radius: 14px;
  width: 100%;
  max-width: 620px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .35);
  overflow: hidden;
}
.ag-input {
  width: 100%;
  font: inherit;
  font-size: 20px;
  line-height: 1.5;
  padding: 16px 20px;
  border: none;
  background: none;
  color: var(--fg);
  outline: none;
  resize: none;
  display: block;
  max-height: 180px;
}
.ag-input:disabled { opacity: .6; }
.ag-out { border-top: 1px solid var(--line); padding: 14px 20px; max-height: 52vh; overflow-y: auto; }
.ag-working { color: var(--muted); font-size: 18px; }
.ag-answer { font-size: 18px; line-height: 1.5; white-space: pre-wrap; }
.ag-error { color: var(--danger); font-size: 18px; line-height: 1.5; }
.ag-ask { font-size: 18px; line-height: 1.5; margin-bottom: 10px; }
.ag-choices, .ag-refs { display: flex; flex-wrap: wrap; gap: 8px; }
.ag-choice {
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--fg);
  min-height: 44px;
  padding: 0 14px;
}
.ag-choice:hover { border-color: var(--accent); background: var(--accent-soft); }
.ag-refs { margin-top: 10px; }
.ag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 18px;
  color: var(--fg);
  background: var(--hover);
  min-height: 44px;
}
a.ag-chip:hover { border-color: var(--accent); color: var(--accent); }
.ag-chip-i { color: var(--muted); font-size: 18px; }
.ag-receipt { margin-top: 4px; }
.ag-sum { font-size: 18px; color: #16a34a; }
.ag-details { margin-top: 8px; }
.ag-details summary { color: var(--muted); font-size: 18px; cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.ag-change { display: flex; align-items: center; gap: 10px; padding: 7px 0; flex-wrap: wrap; }
.ag-what { color: var(--muted); font-size: 18px; }
.ag-confirm { border: 1px solid var(--accent); border-radius: 12px; padding: 14px; background: var(--accent-soft); }
.ag-conf-title { font-size: 20px; }
.ag-conf-sum { color: var(--muted); font-size: 18px; margin-top: 4px; line-height: 1.5; }
.ag-conf-buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.ag-conf-buttons button { min-height: 44px; padding: 0 16px; color: var(--muted); }
.ag-conf-buttons .primary { background: var(--accent); color: #1d1d1f; border-radius: 10px; }
.ag-foot {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding: 8px 20px;
  color: var(--muted);
  font-size: 18px;
  flex-wrap: wrap;
}
.ag-where { display: flex; align-items: center; gap: 6px; }
.ag-off-t { font-size: 20px; }
@media (max-width: 700px) {
  .agent { padding: 8px; align-items: flex-start; padding-top: 8px; }
  .ag-box { max-width: none; }
  .ag-hint { display: none; }              /* на телефоне подсказки про Enter не нужны */
  .ag-out { max-height: 60vh; }
}

/* -------- перестановка колонок за ⋮⋮ в шапке -------- */
.grid th .colgrip {
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  opacity: 0;
  font-size: 18px;
  letter-spacing: -6px;
  padding: 4px 6px 4px 1px;
  cursor: grab;
  user-select: none;
  line-height: 1;
}
.grid th:hover .colgrip { opacity: .6; }
.grid th .colgrip:hover { opacity: 1; color: var(--fg); }
.grid th.dragging { opacity: .4; }
.grid th.drop-l { box-shadow: inset 3px 0 0 var(--accent); }
.grid th.drop-r { box-shadow: inset -3px 0 0 var(--accent); }
.grid th input { padding-left: 20px; }
@media (hover: none) { .grid th .colgrip { opacity: .5; } }

/* -------- история таблицы: превью снимка сеткой -------- */
.hist-grid { padding: 0; overflow: auto; }
.hist-grid .grid.view { width: max-content; min-width: 100%; }
.hist-grid .grid.view th.txt, .hist-grid .grid.view td.txt { white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.hist-more { color: var(--muted); font-size: 18px; padding: 10px 14px; }
.hist-box .share-note { margin-bottom: 12px; }
@media (max-width: 700px) {
  .hist-body { flex-direction: column; height: 60vh; }
  .hist-list { width: auto; flex: 0 0 38%; }
}

/* -------- автодополнение [[вики-ссылок]] -------- */
.wl-pop {
  position: fixed;
  z-index: 70;
  min-width: 240px;
  max-width: min(420px, 92vw);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .22);
  padding: 6px;
  max-height: 46vh;
  overflow: auto;
}
.wl-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  min-height: 44px;
}
.wl-item.on, .wl-item:hover { background: var(--accent-soft); }
.wl-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-kind { color: var(--muted); font-size: 18px; flex: none; }
.vars-run { color: #1d1d1f; background: var(--accent); border-color: var(--accent); }
.vars-run:hover { color: #1d1d1f; filter: brightness(1.06); }

/* -------- озвучка: диалог на документе и очередь в Audio -------- */
.tts-dialog { max-width: 460px; }
.tts-field { display: flex; flex-direction: column; gap: 6px; font-size: 18px; color: var(--muted); margin: 8px 0 12px; }
.tts-field select {
  font: inherit; font-size: 18px; color: var(--fg); background: var(--hover);
  border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; min-height: 44px;
}
.tts-check { display: flex; gap: 10px; align-items: flex-start; font-size: 18px; line-height: 1.5; margin-bottom: 12px; cursor: pointer; }
.tts-check input { margin-top: 3px; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
#listen.busy { color: var(--muted); }
.voicing-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; margin: 12px 0 4px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--hover);
}
.voicing-row.failed { border-color: rgba(255, 59, 48, .4); }
.voicing-row .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.voicing-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voicing-row .sub { color: var(--muted); font-size: 18px; }
.voicing-row .prog { display: block; height: 4px; border-radius: 2px; background: var(--line); margin-top: 6px; }
.voicing-row .prog span { display: block; height: 100%; border-radius: 2px; background: var(--accent); }
.voicing-ic {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: #1d1d1f; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.voicing-row.failed .voicing-ic { background: var(--danger); color: #fff; }
.voicing-row .pinb { opacity: 1; min-height: 44px; }

/* -------- новые разделы: Days, Links, Reminders, Voice -------- */
.list .ic.day { color: #ff9f0a; }
.list .ic.link { color: #0a84ff; }
.list .ic.voice { color: #ff375f; }
.palette-list .pk.day { color: #ff9f0a; }
.palette-list .pk.link { color: #0a84ff; }
.main-head .primary-btn {
  background: var(--accent); color: #1d1d1f;
  border-radius: 10px; padding: 8px 14px; min-height: 44px;
}
.main-head .primary-btn:hover { background: var(--accent); filter: brightness(1.06); }
.main-head button:not(.primary-btn) { border: 1px solid var(--line); border-radius: 8px; padding: 4px 12px; color: var(--fg); font-size: 18px; min-height: 44px; }
.list .item .badge {
  font-size: 18px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px;
  padding: 0 8px; margin-left: 6px; white-space: nowrap;
}
.list .item .badge.on { color: var(--accent); border-color: var(--accent); }
.list .item.unread .ic.link::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: -6px; vertical-align: top; }

/* календарь дней: шесть недель, понедельник первым */
.cal { margin: 14px 0 8px; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 10px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-title { font-size: 20px; }
.cal-head button { min-width: 44px; min-height: 44px; font-size: 18px; color: var(--fg); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wd { text-align: center; color: var(--muted); font-size: 18px; padding: 2px 0 4px; }
.cal-day {
  min-height: 44px; border-radius: 10px; font: inherit; font-size: 18px; color: var(--fg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 1px solid transparent; padding: 2px;
}
.cal-day:hover { background: var(--hover); }
.cal-day.other { color: var(--muted); opacity: .6; }
.cal-day.has { background: var(--accent-soft); border-color: var(--accent); }
.cal-day.today { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-day.future { opacity: .35; cursor: default; }
/* точки активности дня — НАРИСОВАННЫЕ кружки, а не текст: символом «•» они
   были 11px и нарушали правило «шрифт от 14px везде» (нашёл аудит 09.09.2026) */
.cal-day .dots { display: flex; align-items: center; justify-content: center; gap: 3px; height: 11px; }
.cal-day .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.cal-foot { color: var(--muted); font-size: 18px; margin-top: 8px; }

/* напоминания */
.list .rem-head { color: var(--muted); font-size: 18px; text-transform: uppercase; letter-spacing: .05em; padding: 16px 10px 6px; }
.list .rem-head.overdue { color: var(--danger); }
.list .rem-row { display: flex; align-items: center; gap: 12px; padding: 10px 10px; min-height: 56px; }
.list .rem-row .rem-when { flex: 0 0 auto; min-width: 120px; font-variant-numeric: tabular-nums; font-size: 18px; color: var(--muted); display: flex; flex-direction: column; gap: 1px; }
.list .rem-row .rem-when .rem-rel { color: var(--fg); }
.list .rem-row.overdue .rem-when .rem-rel { color: var(--danger); }
.list .rem-row .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.list .rem-row .name { white-space: normal; }
.list .rem-row .sub a { color: var(--accent); }
.list .rem-row.done .name { color: var(--muted); text-decoration: line-through; }
.list .rem-row button { opacity: 1; min-height: 44px; white-space: nowrap; font-size: 18px; }
.list .rem-row .rem-done { border: 1px solid var(--line); border-radius: 10px; color: var(--fg); padding: 0 12px; }
.list .rem-row .rem-done:hover { border-color: #16a34a; color: #16a34a; }
.rem-hint { color: var(--muted); font-size: 18px; line-height: 1.5; padding: 12px 10px 0; max-width: 75ch; }
.rem-hint code { background: var(--hover); padding: 1px 6px; border-radius: 5px; font-size: 18px; }
.rem-dialog .rem-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.rem-dialog .rem-quick button { border: 1px solid var(--line); border-radius: 999px; color: var(--fg); min-height: 44px; padding: 0 14px; font-size: 18px; }
.rem-dialog .rem-quick button:hover, .rem-dialog .rem-quick button.on { border-color: var(--accent); background: var(--accent-soft); }
.rem-dialog input[type=datetime-local] { font: inherit; font-size: 18px; color: var(--fg); background: var(--hover); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; min-height: 44px; width: 100%; }
.rem-dialog .rem-about { color: var(--muted); font-size: 18px; margin-bottom: 10px; display: flex; gap: 6px; align-items: center; }
.rem-dialog .rem-about .rem-about-t { color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rem-toast-when { color: var(--accent); }

/* голосовые: большая кнопка записи */
.voice-pad { margin: 14px 0 6px; border: 1px solid var(--line); border-radius: 16px; padding: 22px 20px; text-align: center; }
.voice-pad .rec {
  width: 84px; height: 84px; border-radius: 50%; background: #ff375f; color: #fff; font-size: 34px;
  display: inline-flex; align-items: center; justify-content: center; border: none;
  box-shadow: 0 8px 24px rgba(255, 55, 95, .35); transition: transform .12s ease;
}
.voice-pad .rec:hover { background: #ff375f; filter: brightness(1.06); transform: translateY(-1px); }
.voice-pad .rec.on { animation: rec-pulse 1.2s ease-in-out infinite; background: #1d1d1f; color: #ff375f; }
@keyframes rec-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 55, 95, .45); } 50% { box-shadow: 0 0 0 14px rgba(255, 55, 95, 0); } }
.voice-pad .vp-title { font-size: 20px; margin-top: 12px; }
.voice-pad .vp-time { font-size: 28px; font-variant-numeric: tabular-nums; margin-top: 6px; min-height: 34px; }
.voice-pad .vp-sub { color: var(--muted); font-size: 18px; margin-top: 6px; line-height: 1.5; max-width: 480px; margin-left: auto; margin-right: auto; }
.voice-pad .vp-row { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }
.voice-pad .vp-row button { border: 1px solid var(--line); border-radius: 10px; color: var(--fg); min-height: 44px; padding: 0 16px; }
.voice-pad .vp-row button.primary { background: var(--accent); border-color: var(--accent); color: #1d1d1f; }
.voice-pad .vp-err { color: var(--danger); font-size: 18px; margin-top: 8px; }
.list .item .vstate { font-size: 18px; color: var(--muted); }
.list .item .vstate.failed { color: var(--danger); }
.list .item .vplay { color: var(--accent); font-size: 18px; flex: 0 0 auto; min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; }
.list .item .vplay:hover { background: var(--accent-soft); }

/* заметка-документ ссылки: оригинал в шапке */
.top #orig { white-space: nowrap; }
@media (max-width: 700px) {
  .cal { padding: 10px 8px 8px; }
  .cal-day { min-height: 44px; font-size: 18px; }
  .list .rem-row { flex-wrap: wrap; }
  .list .rem-row .txt { flex-basis: 100%; order: 3; }
}
.nav .count.overdue { color: var(--danger); }

/* ================= видео =================
   Внимание: классы .vp-row, .vp-time, .vp-title, .vp-sub и .vp-err уже заняты
   блоком записи голоса (public/voice.js) — у плеера свои имена (.vp-bottom,
   .vp-clock). Новый класс плеера сверяй с ними: правило без префикса протечёт. */
/* Плеер тёмный всегда: видео смотрят на чёрном, и в светлой теме белая рамка
   вокруг кадра только мешает. Всё внутри .vp — свои контролы: у родных нет
   ни скорости, ни превью кадра, ни памяти о том, где остановились. */
.vwrap { max-width: 1080px; margin: 0 auto; padding: 22px 20px 60px; }

.vp {
  position: relative;
  width: 100%;
  aspect-ratio: var(--vp-ratio, 16 / 9);
  max-height: calc(100vh - 250px);
  margin: 0 auto;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  color: #fff;
  outline: none;
  isolation: isolate;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .26), 0 2px 10px rgba(0, 0, 0, .14);
}
/* вертикальное видео с телефона: пусть сужается, а не растёт на весь экран */
.vp.tall { width: auto; height: min(78vh, 820px); }
.vp-video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.vp.playing:not(.show) { cursor: none; }

/* лёгкое затемнение до первого запуска — чтобы кнопка читалась на любом кадре */
.vp-veil {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(58% 58% at 50% 50%, rgba(0, 0, 0, .16), rgba(0, 0, 0, .46));
  transition: opacity .35s;
}
.vp.playing .vp-veil { opacity: 0; }

.vp-big {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 88px; height: 88px; padding: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .55);
  background: rgba(18, 18, 20, .42);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  color: #fff; cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .42);
  transition: transform .22s cubic-bezier(.2, .8, .3, 1), background .2s, opacity .25s;
}
.vp-big svg { width: 38px; height: 38px; fill: currentColor; margin-left: 5px; }
.vp-big:hover { transform: translate(-50%, -50%) scale(1.07); background: rgba(26, 26, 28, .6); }
.vp-big:active { transform: translate(-50%, -50%) scale(.97); }
.vp.playing .vp-big { opacity: 0; pointer-events: none; transform: translate(-50%, -50%) scale(.86); }

.vp-spin { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.vp-spin span {
  width: 46px; height: 46px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff;
  animation: vpspin .8s linear infinite;
}
@keyframes vpspin { to { transform: rotate(360deg); } }

/* двойной тап у края — ±10 секунд, как в больших плеерах */
.vp-seek-hint {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 92px; height: 92px; border-radius: 50%;
  background: rgba(0, 0, 0, .45);
  display: grid; place-items: center;
  font-size: 18px; letter-spacing: .02em;
  pointer-events: none; animation: vppop .5s ease-out;
}
.vp-seek-l { left: 5%; }
.vp-seek-r { right: 5%; }
@keyframes vppop { from { opacity: 0; transform: translateY(-50%) scale(.8); } 40% { opacity: 1; } to { opacity: .85; transform: translateY(-50%) scale(1); } }

/* короткая подпись поверх кадра: браузер отказал играть, нет сети и т.п. */
.vp-note {
  position: absolute; left: 12px; right: 12px; top: 12px;
  padding: 10px 14px; border-radius: 12px;
  background: rgba(12, 12, 14, .88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 18px; line-height: 1.5; text-align: center;
  pointer-events: none;
}
.vp-fail { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .88); padding: 24px; }
.vp-fail-in { max-width: 460px; text-align: center; font-size: 18px; line-height: 1.5; }
.vp-fail-t { display: block; font-size: 20px; }
.vp-fail p { margin-top: 10px; color: rgba(255, 255, 255, .78); font-size: 18px; }
.vp-fail a { color: var(--accent); text-decoration: underline; }

/* имя файла поверх кадра нужно только в полноэкранном режиме: на странице оно
   и так написано под плеером */
.vp-head {
  position: absolute; top: 0; left: 0; right: 0;
  padding: 16px 20px 40px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .65), transparent);
  font-size: 18px;
  opacity: 0; transition: opacity .25s; pointer-events: none;
}
.vp.full.show .vp-head { opacity: 1; }
.vp-head-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* -------- панель управления -------- */
.vp-ctl {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 44px 10px 6px;
  background: linear-gradient(to top, rgba(0, 0, 0, .86) 0%, rgba(0, 0, 0, .52) 46%, transparent 100%);
  opacity: 0; transform: translateY(10px);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
}
/* Панель кликов не ловит — их ловят только сами кнопки и полоса. Иначе на
   маленьком плеере (телефон, узкое окно) градиент накрывал центральную кнопку
   Play, и по ней нельзя было попасть; заодно тап по пустому месту панели теперь
   ставит паузу, как в любом плеере. */
.vp.show .vp-ctl { opacity: 1; transform: none; }
.vp.show .vp-bar, .vp.show .vp-b, .vp.show .vp-vol, .vp.show .vp-menu,
.vp.show .vp-rate-wrap, .vp.show .vp-clock { pointer-events: auto; }

.vp-bar { position: relative; height: 24px; display: flex; align-items: center; cursor: pointer; touch-action: none; outline: none; }
.vp-track { position: relative; width: 100%; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .3); overflow: hidden; transition: height .14s; }
.vp-bar:hover .vp-track, .vp-bar:focus-visible .vp-track { height: 7px; }
.vp-buf { position: absolute; top: 0; bottom: 0; left: 0; width: 0; background: rgba(255, 255, 255, .4); }
.vp-played { position: absolute; top: 0; bottom: 0; left: 0; width: 0; background: var(--accent); }
.vp-knob {
  position: absolute; top: 50%; left: 0;
  width: 13px; height: 13px; border-radius: 50%; background: #fff;
  transform: translate(-50%, -50%); opacity: 0; transition: opacity .14s;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .55); pointer-events: none;
}
.vp-bar:hover .vp-knob, .vp-bar:focus-visible .vp-knob { opacity: 1; }

.vp-tip {
  position: absolute; bottom: 28px; left: 0; transform: translateX(-50%);
  background: rgba(12, 12, 14, .94);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px; padding: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .55);
  pointer-events: none;
}
.vp-tip canvas { display: block; width: 168px; height: auto; border-radius: 6px; background: #000; }
.vp-tip span { display: block; text-align: center; font-size: 18px; padding: 3px 8px 1px; font-variant-numeric: tabular-nums; }

.vp-bottom { display: flex; align-items: center; gap: 1px; pointer-events: none; }
.vp-b {
  width: 44px; height: 44px; flex: none;         /* палец: 44px — правило проекта */
  display: grid; place-items: center;
  border: 0; background: none; color: #fff; padding: 0;
  border-radius: 10px; cursor: pointer;
  transition: background .15s, color .15s, transform .12s;
}
.vp-b svg { width: 23px; height: 23px; fill: currentColor; }
.vp-b:hover { background: rgba(255, 255, 255, .15); }
.vp-b:active { transform: scale(.93); }
.vp-b:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.vp-b.on { color: var(--accent); }
.vp-play svg, .vp-big svg { transition: none; }

.vp-vol { display: flex; align-items: center; }
.vp-vol-range {
  width: 0; opacity: 0; height: 44px; margin: 0;
  accent-color: var(--accent); cursor: pointer;
  transition: width .2s, opacity .2s, margin .2s;
}
.vp-vol:hover .vp-vol-range, .vp-vol-range:focus-visible { width: 84px; opacity: 1; margin: 0 8px 0 2px; }
/* на телефоне ползунка нет: iOS не даёт менять громкость программно, и он
   был бы обманом — остаётся кнопка «без звука» */
.vp-touch .vp-vol-range { display: none; }

.vp-clock { font-size: 18px; padding: 0 8px; white-space: nowrap; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, .94); }
.vp-clock i { font-style: normal; opacity: .5; margin: 0 5px; }
.vp-gap { flex: 1 1 auto; }

.vp-rate-wrap { position: relative; }
.vp-rate { width: auto; min-width: 44px; padding: 0 10px; font-size: 18px; }
.vp-menu {
  position: absolute; bottom: 52px; right: 0;
  min-width: 136px; padding: 6px;
  background: rgba(16, 16, 18, .96);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, .6);
}
.vp-menu button {
  display: block; width: 100%; min-height: 44px;
  text-align: left; padding: 10px 12px;
  background: none; border: 0; border-radius: 8px;
  color: #fff; font-size: 18px; cursor: pointer;
}
.vp-menu button:hover { background: rgba(255, 255, 255, .13); }
.vp-menu button.on { color: var(--accent); }

.vp.full { border-radius: 0; max-height: none; width: 100%; height: 100%; aspect-ratio: auto; box-shadow: none; }

/* -------- страница видео -------- */
.vmeta { margin: 18px 2px 0; }
.vname { font-size: 26px; line-height: 1.3; word-break: break-word; }
.vsub { color: var(--muted); font-size: 18px; margin-top: 4px; }
.vmore { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 14px; }
.vmore-head { font-size: 20px; margin-bottom: 8px; }
.vmore-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px; }
.vmore-item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; min-height: 44px; }
.vmore-item:hover { background: var(--hover); }
.vmore-item .txt { min-width: 0; flex: 1; }
.vmore-item .name { display: block; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vmore-item .sub { display: block; color: var(--muted); font-size: 18px; }
.vmore-thumb {
  width: 104px; height: 59px; flex: none;
  border-radius: 8px; overflow: hidden; background: #000;
  display: grid; place-items: center; color: rgba(255, 255, 255, .65);
}
.vmore-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vmore-noimg { font-size: 18px; }

/* миниатюра видео в списках главной: кадр плюс длительность уголком */
.vthumb { position: relative; width: 104px; height: 59px; flex: none; border-radius: 7px; overflow: hidden; background: #000; display: grid; place-items: center; }
.vthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vthumb .vt-play { color: rgba(255, 255, 255, .8); font-size: 18px; }
.vthumb .vt-dur {
  position: absolute; right: 3px; bottom: 3px;
  background: rgba(0, 0, 0, .74); color: #fff;
  font-size: 18px; line-height: 1.2; padding: 0 4px; border-radius: 4px;
  font-variant-numeric: tabular-nums;
}

/* публичная ссылка: тот же плеер, только читать */
.share-player { max-width: 1000px; margin: 0 auto; padding: 20px 20px 40px; }
.share-player .vp { max-height: calc(100vh - 220px); }
.share-file-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.share-file-name { font-size: 22px; line-height: 1.3; word-break: break-word; flex: 1 1 240px; }

@media (max-width: 700px) {
  .vwrap { padding: 0 0 60px; }
  .vp { border-radius: 0; max-height: 72vh; }
  .vp.tall { height: min(72vh, 640px); }
  .vmeta, .vmore, .video-page .pl-hint { margin-left: 14px; margin-right: 14px; }
  .vp-ctl { padding: 40px 4px 4px; }
  .vp-big { width: 74px; height: 74px; }
  .vp-big svg { width: 32px; height: 32px; }
  .vmore-list { grid-template-columns: 1fr; }
  .share-player { padding: 0 0 30px; }
  .share-player .vp { border-radius: 0; }
  .share-file-row { padding: 0 14px; }
}

/* ============ Агенты (08.09.2026) ============ */
/* Подпункт навигации: «Settings» принадлежит Агентам, а не соседям */
.nav a.nav-sub { padding-left: 26px; font-size: 18px; color: var(--muted); }
.nav a.nav-sub.active { color: var(--fg); }
.nav a.nav-sub::before { content: '· '; }

/* Значок агента в списке — класс .bot, а НЕ .agent: у командной строки Cmd+J
   уже есть .overlay.agent с padding-top: 10vh, и общий класс раздувал строку
   списка на 90 пикселей. Новый класс сверять с существующими. */
.list .ic.bot { color: #6366f1; }
.list .ag-row { display: flex; align-items: center; gap: 8px; padding-right: 6px; }
.list .ag-row a.item { flex: 1; min-width: 0; align-items: flex-start; }
/* У строки агента три строки текста, а значок — flex-контейнер: без этого
   svg растягивается по всей высоте строки и уезжает вниз. */
.list .ag-row .ic { align-self: flex-start; margin-top: 3px; }
.list .ag-row .agl-state { color: var(--muted); }
.list .ag-row.on .agl-state { color: #16a34a; }
.list .ag-row .agl-last { font-size: 18px; }
.list .ag-row .agl-last.bad { color: var(--danger); }
.list .ag-row .agl-last.busy { color: var(--accent); }
.list .ag-row .pinb {
  opacity: 1; min-height: 44px; min-width: 56px; border: 1px solid var(--line);
  border-radius: 10px; color: var(--fg); font-size: 18px; padding: 0 12px; flex: 0 0 auto;
}
.list .ag-row .pinb:hover { border-color: var(--accent); background: var(--accent-soft); }
.list .ag-row .agl-toggle { min-width: 60px; }
.list .ag-row.on .agl-toggle { border-color: #16a34a; color: #16a34a; }
.list .ag-row .pinb:disabled { opacity: .5; }

/* полоса шаблонов: с чего начать */
.ag-tpl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 10px 4px; }
.ag-tpl-lead { color: var(--muted); font-size: 18px; }
.ag-tpl-b {
  border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--fg);
  font: inherit; font-size: 18px; min-height: 44px; padding: 0 14px; cursor: pointer;
}
.ag-tpl-b:hover { border-color: var(--accent); background: var(--accent-soft); }
.ag-tpl-b:disabled { opacity: .5; }

/* ---- панель агента в редакторе ---- */
.ag-panel { border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 18px; background: var(--hover); }
.agp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.agp-f { display: flex; flex-direction: column; gap: 5px; font-size: 18px; }
.agp-f > span:first-child { color: var(--muted); font-size: 18px; }
.agp-f em { color: var(--muted); font-size: 18px; font-style: normal; line-height: 1.5; }
.agp-f input, .agp-f select {
  font: inherit; font-size: 18px; color: var(--fg); background: var(--bg);
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; min-height: 44px; width: 100%;
}
.agp-f input:focus, .agp-f select:focus { border-color: var(--accent); outline: none; }
.agp-pair { display: flex; gap: 8px; }
.agp-pair select { flex: 2; min-width: 0; }
.agp-pair input { flex: 1; min-width: 0; }
.agp-scopes { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 4px; }
.agp-scopes label { display: inline-flex; align-items: center; gap: 6px; font-size: 18px; min-height: 44px; cursor: pointer; }
.agp-scopes input { width: 18px; height: 18px; accent-color: var(--accent); }
.agp-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.agp-on { display: inline-flex; align-items: center; gap: 8px; font-size: 18px; min-height: 44px; cursor: pointer; margin-right: auto; }
.agp-on input { width: 20px; height: 20px; accent-color: var(--accent); }
.agp-foot button { border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--fg); font: inherit; font-size: 18px; min-height: 44px; padding: 0 16px; cursor: pointer; }
.agp-foot button:hover { border-color: var(--accent); }
.agp-foot button.primary { background: var(--accent); border-color: var(--accent); color: #1d1d1f; }
.agp-foot button.danger { color: var(--danger); }
.agp-state { flex: 1 1 100%; color: var(--muted); font-size: 18px; line-height: 1.5; }
.agp-hist { margin-top: 12px; }
.agp-hist summary { color: var(--muted); font-size: 18px; cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.agp-run-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; padding: 7px 0; border-top: 1px solid var(--line); font-size: 18px; }
.agp-run-when { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 108px; }
.agp-run-what { color: var(--muted); }
.agp-run-sum { flex: 1; min-width: 160px; }
.agp-run-cost { color: var(--muted); font-variant-numeric: tabular-nums; }
.agp-run-row.failed .agp-run-sum { color: var(--danger); }
.agp-run-row.running .agp-run-sum { color: var(--accent); }

/* ---- страница настроек ---- */
.set-wrap { padding: 6px 0 40px; max-width: 780px; }
.set-block { border-top: 1px solid var(--line); padding: 20px 0 4px; }
.set-block:first-child { border-top: none; padding-top: 8px; }
.set-block h2 { font-size: 24px; line-height: 1.3; margin-bottom: 6px; }
.set-note { color: var(--muted); font-size: 18px; line-height: 1.5; margin-bottom: 14px; max-width: 75ch; }
.set-note code { background: var(--hover); padding: 1px 6px; border-radius: 5px; font-size: 18px; }
.set-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 14px 0; }
.set-field { display: flex; flex-direction: column; gap: 5px; font-size: 18px; }
.set-field > span:first-child { color: var(--muted); }
.set-field em { color: var(--muted); font-style: normal; font-size: 18px; line-height: 1.5; }
.set-field input, .set-field select, .set-wrap textarea {
  font: inherit; font-size: 18px; color: var(--fg); background: var(--bg);
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; min-height: 44px; width: 100%;
}
.set-wrap textarea { min-height: 88px; line-height: 1.5; resize: vertical; }
.set-field input:focus, .set-field select:focus, .set-wrap textarea:focus { border-color: var(--accent); outline: none; }
.set-pair { display: flex; align-items: center; gap: 8px; }
.set-pair input { flex: 1; min-width: 0; }
.set-check, .set-switch { display: flex; align-items: flex-start; gap: 10px; font-size: 18px; line-height: 1.5; margin: 12px 0; cursor: pointer; }
.set-check input, .set-switch input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--accent); flex: none; }
.set-check em, .set-switch em { display: block; color: var(--muted); font-size: 18px; font-style: normal; }
.set-switch { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--hover); }
.set-scopes { display: flex; flex-wrap: wrap; gap: 10px; }
.set-scopes label { display: inline-flex; align-items: center; gap: 6px; font-size: 18px; min-height: 44px; cursor: pointer; }
.set-scopes input { width: 18px; height: 18px; accent-color: var(--accent); }
.set-status { position: sticky; bottom: 10px; color: var(--muted); font-size: 18px; opacity: 0; transition: opacity .2s; }
.set-status.show { opacity: 1; }

/* провайдер модели: ключ, состояние, адрес */
.prov { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.prov-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; font-size: 18px; }
.prov-name { font-size: 20px; }
.prov-state { font-size: 18px; color: var(--muted); }
.prov-state.ok { color: #16a34a; }
.prov-state.bad { color: var(--danger); }
.prov-state.warn { color: #b45309; }        /* ключ приняли, но работать им нельзя */
@media (prefers-color-scheme: dark) { .prov-state.warn { color: #fbbf24; } }
.prov-hint { color: var(--muted); font-size: 18px; line-height: 1.5; margin-top: 4px; }
.prov-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.prov-row input {
  flex: 1 1 220px; min-width: 0; font: inherit; font-size: 18px; color: var(--fg);
  background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; min-height: 44px;
}
.prov-row input:focus { border-color: var(--accent); outline: none; }
.prov-row button {
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--fg);
  font: inherit; font-size: 18px; min-height: 44px; padding: 0 14px; cursor: pointer; flex: 0 0 auto;
}
.prov-row button:hover { border-color: var(--accent); }
.prov-row button.primary { background: var(--accent); border-color: var(--accent); color: #1d1d1f; }
.prov-row button.danger { color: var(--danger); }
.prov-row button:disabled { opacity: .5; }
.prov-link { color: var(--accent); font-size: 18px; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; }
.prov-base.folded { display: none; }
.prov-note { color: var(--muted); font-size: 18px; flex: 1 1 220px; }
.prov-money { font-size: 18px; margin-top: 8px; color: #16a34a; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.prov-money:empty { display: none; }
.prov-money.warn { color: #b45309; }
.prov-money.low { color: var(--danger); }
.prov-money .prov-link { min-height: 44px; }
@media (prefers-color-scheme: dark) { .prov-money.warn { color: #fbbf24; } }
.prov-uses { color: var(--muted); font-size: 18px; line-height: 1.5; margin-top: 4px; }
/* Один ответ модели прямо в карточке: строка вопроса + ответ под ней */
.prov-try { margin-top: 12px; }
.prov-try input { flex: 1 1 260px; }
.prov-answer { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--hover); font-size: 18px; line-height: 1.5; }
.prov-answer.busy { color: var(--muted); }
.prov-answer.bad { color: var(--danger); }
.prov-answer-text { white-space: pre-wrap; }
.prov-answer-meta { color: var(--muted); font-size: 18px; margin-top: 6px; }
/* Деньги на ключе кончаются — говорим сверху, до карточек */
.set-alert { border: 1px solid var(--danger); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; font-size: 18px; line-height: 1.5; background: color-mix(in srgb, var(--danger) 8%, transparent); }
.set-alert a { color: var(--danger); white-space: nowrap; display: inline-flex; align-items: center; min-height: 44px; }
.set-alert-t { color: var(--danger); }
.prov-models { color: var(--muted); font-size: 18px; margin-top: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 700px) {
  /* на телефоне навигация листается вбок — отступ подпункта там лишний */
  .nav a.nav-sub { padding-left: 13px; }
  .ag-panel { padding: 14px; border-radius: 12px; }
  .agp-grid { grid-template-columns: 1fr; }
  .set-two { grid-template-columns: 1fr; }
  .list .ag-row .pinb { min-width: 52px; padding: 0 10px; }
}

/* ============ Researcher (09.09.2026) ============ */
.list .ic.find { color: #0ea5e9; }
.list .rs-row { display: flex; align-items: center; gap: 8px; padding-right: 6px; }
.list .rs-row a.item { flex: 1; min-width: 0; }
.list .rs-row.working .rs-state { color: var(--accent); }
.list .rs-row.bad .rs-state { color: var(--danger); }
.list .rs-row .pinb {
  opacity: 1; min-height: 44px; border: 1px solid var(--line); border-radius: 10px;
  color: var(--fg); font-size: 18px; padding: 0 12px; flex: 0 0 auto;
}
.list .rs-row .pinb:hover { border-color: var(--danger); color: var(--danger); }

/* поле заказа: композер, а не строка ввода */
.ask { max-width: 760px; margin: 10px auto 0; }
.ask-box {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--bg);
  padding: 14px 16px 12px;
  box-shadow: 0 10px 30px -22px rgba(0, 0, 0, .5);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.ask-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(230, 167, 0, .16), 0 16px 38px -24px rgba(0, 0, 0, .55);
  transform: translateY(-1px);
}
.ask-input {
  display: block; width: 100%;
  border: none; outline: none; resize: none; background: none;
  color: var(--fg); font: inherit; font-size: 18px; line-height: 1.5;
  min-height: 30px; max-height: 220px; padding: 2px 2px 0;
  overflow-y: auto;
}
.ask-input::placeholder { color: var(--muted); }
.ask-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.ask-modes { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; flex: none; }
.ask-modes button {
  min-height: 44px; padding: 0 16px; font-size: 18px; color: var(--muted);
  background: none; border: none; cursor: pointer;
}
.ask-modes button:hover { background: var(--hover); color: var(--fg); }
.ask-modes button.on { background: var(--accent-soft); color: var(--fg); }
.ask-hint {
  flex: 1; min-width: 0; color: var(--muted); font-size: 18px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right;
}
.ask-send {
  flex: none; width: 48px; height: 48px; border-radius: 50%;
  background: var(--accent); color: #1d1d1f; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .12s ease, filter .12s ease, background .12s ease;
}
.ask-send:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }
.ask-send:active:not(:disabled) { transform: scale(.95); }
.ask-send:disabled { background: var(--line); color: var(--muted); cursor: default; }
.ask-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 2px 0; }
.ask-chips button {
  border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--muted);
  font: inherit; font-size: 18px; min-height: 44px; padding: 0 14px; cursor: pointer;
}
.ask-chips button:hover { border-color: var(--accent); color: var(--fg); background: var(--accent-soft); }
.rs-off {
  color: var(--muted); font-size: 18px; line-height: 1.55; padding: 14px;
  margin: 12px auto 0; max-width: 760px; border: 1px solid var(--line); border-radius: 16px; background: var(--hover);
}
.rs-off code { background: var(--bg); padding: 1px 6px; border-radius: 5px; }
.rs-off a { color: var(--accent); }

/* строка состояния над отчётом в редакторе */
.rs-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 18px;
  background: var(--hover); color: var(--muted); font-size: 18px; line-height: 1.5;
}
.rs-banner.bad { color: var(--danger); border-color: var(--danger); }
.rs-banner button {
  margin-left: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
  color: var(--danger); font: inherit; font-size: 18px; min-height: 44px; padding: 0 14px;
}

@media (max-width: 700px) {
  .ask-box { border-radius: 22px; padding: 12px 14px 10px; }
  .ask-input { font-size: 18px; }
  .ask-hint { display: none; }              /* на телефоне ширины хватает только на кнопки */
  .ask-chips button { font-size: 18px; padding: 0 12px; }
}

/* ---------- Repos: страница репозитория (git.html), префикс .gt- ---------- */
.list .ic.repo { color: #f05033; }
.gt-name { font-size: 20px; color: var(--fg); white-space: nowrap; }
.gt-name:hover { color: var(--accent); }
.gt-branch {
  font: inherit; font-size: 18px; color: var(--fg); background: var(--hover);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; min-height: 44px; max-width: 200px;
}
.gt-wrap { max-width: 960px; margin: 0 auto; padding: 22px 20px 30vh; }
.gt-crumbs { font-size: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; min-height: 44px; }
.gt-crumbs a { color: var(--accent); padding: 8px 4px; border-radius: 6px; }
.gt-crumbs a:hover { background: var(--accent-soft); }
.gt-crumbs .gt-here { padding: 8px 4px; }
.gt-sep { color: var(--muted); }
.gt-desc { color: var(--muted); font-size: 18px; margin: 0 0 8px 4px; }
.gt-headline {
  display: block; color: var(--fg); font-size: 18px; background: var(--hover); border-radius: 10px;
  padding: 10px 12px; margin: 6px 0 10px; line-height: 1.5;
}
.gt-headline:hover { background: var(--accent-soft); }
.gt-headline code { font: 18px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); margin-right: 4px; }
.gt-dim { color: var(--muted); }
.gt-em { color: var(--fg); }
.gt-nowrap { white-space: nowrap; }
.gt-grow { flex: 1; }
.gt-tree { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.gt-tree li + li { border-top: 1px solid var(--line); }
.gt-row { display: flex; align-items: center; gap: 10px; padding: 0 12px; min-height: 44px; color: var(--fg); }
.gt-row:hover { background: var(--hover); }
.gt-ic { width: 18px; text-align: center; color: var(--muted); flex: none; }
.gt-ic.tree { color: var(--accent); }
.gt-fn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; }
.gt-sz { color: var(--muted); font-size: 18px; white-space: nowrap; }
.gt-sha { font: 18px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }
.gt-day { padding: 10px 12px 4px; font-size: 18px; color: var(--muted); background: var(--hover); }
.gt-h2 { font-size: 24px; line-height: 1.3; margin: 14px 0 10px; }
.gt-h2 code { font-size: 18px; }
.gt-more { display: block; margin: 12px auto; min-height: 44px; padding: 8px 20px; border: 1px solid var(--line); }
.gt-empty, .gt-err { color: var(--muted); padding: 24px 12px; text-align: center; font-size: 18px; }
.gt-err { color: var(--danger); }
.gt-readme { margin-top: 22px; border: 1px solid var(--line); border-radius: 12px; }
.gt-readme-h { padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 18px; }
.gt-readme-h a { color: var(--muted); }
.gt-readme .gt-md { padding: 6px 18px 18px; }
.gt-mdwrap { border: 1px solid var(--line); border-radius: 12px; }
.gt-mdwrap .gt-md { padding: 6px 18px 18px; }
.editor.gt-md { min-height: 0; }
/* README шире 75ch не читается: ширина страницы репо — 960px, текст 20px */
.editor.gt-md > :not(pre) { max-width: 75ch; }
.gt-filebar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 4px 10px; font-size: 18px; }
.gt-filebar .btn, .gt-filebar button { min-height: 44px; display: inline-flex; align-items: center; padding: 6px 12px; font-size: 18px; }
.gt-img { text-align: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.gt-img img { max-width: 100%; height: auto; }
/* код: строка = div, номер слева; на телефоне длинные строки уезжают вбок внутри блока */
.gt-code {
  font: 18px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; border: 1px solid var(--line); border-radius: 12px;
  overflow-x: auto; background: var(--bg); padding: 8px 0;
}
.gt-line { display: flex; min-height: 28px; white-space: pre; }
.gt-line:hover { background: var(--hover); }
.gt-line:target { background: var(--accent-soft); }
.gt-ln { flex: none; width: 64px; text-align: right; padding-right: 12px; color: var(--muted); user-select: none; font-size: 18px; }
.gt-ln:hover { color: var(--accent); }
.gt-lc { flex: 1; padding-right: 16px; }
.gt-line.add { background: rgba(46, 160, 67, .15); }
.gt-line.del { background: rgba(248, 81, 73, .15); }
.gt-line.hunk { color: var(--muted); background: var(--hover); }
.gt-line.ctx .gt-lc, .gt-line.add .gt-lc, .gt-line.del .gt-lc, .gt-line.hunk .gt-lc { padding-left: 12px; }
.gt-add { color: #2ea043; }
.gt-del { color: #f85149; }
.gt-diff { margin-top: 16px; }
.gt-diff-h {
  font: 18px ui-monospace, SFMono-Regular, Menlo, monospace; padding: 8px 12px; background: var(--hover);
  border: 1px solid var(--line); border-bottom: none; border-radius: 12px 12px 0 0;
}
.gt-diff .gt-code { border-radius: 0 0 12px 12px; }
.gt-files { margin: 10px 0 4px; }
.gt-msgbody { font: inherit; font-size: 18px; line-height: 1.5; white-space: pre-wrap; color: var(--fg); background: var(--hover); padding: 10px 14px; border-radius: 10px; }
/* правка */
.gt-edit { display: flex; flex-direction: column; gap: 10px; }
.gt-path, .gt-msg {
  font: inherit; font-size: 18px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--hover); color: var(--fg); outline: none; min-height: 44px; width: 100%;
}
.gt-path { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; }
.gt-path:focus, .gt-msg:focus, .gt-ta:focus { border-color: var(--accent); }
.gt-ta {
  width: 100%; min-height: 240px; resize: vertical; font: 18px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--fg); outline: none;
  tab-size: 2; -webkit-text-size-adjust: 100%;
}
.gt-commitbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; position: sticky; bottom: 0; background: var(--bg); padding: 10px 0; }
.gt-commitbar .gt-msg { flex: 1; min-width: 200px; width: auto; }
.gt-commitbar .btn { min-height: 44px; display: inline-flex; align-items: center; padding: 8px 14px; }
.gt-commitbar .primary-btn {
  background: var(--accent); color: #1d1d1f; border-radius: 10px; padding: 8px 18px; min-height: 44px;
}
.gt-commitbar .primary-btn:hover { background: var(--accent); filter: brightness(1.06); }
.gt-commitbar .primary-btn:disabled { opacity: .6; cursor: default; }
/* пустой репозиторий и диалоги */
.gt-cta { max-width: 640px; margin: 30px auto; text-align: center; font-size: 18px; line-height: 1.5; }
.gt-cta h2 { font-size: 26px; line-height: 1.3; margin-bottom: 8px; }
.gt-cta p { color: var(--muted); margin: 8px 0; }
.gt-cmd {
  text-align: left; font: 18px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--hover);
  padding: 12px 14px; border-radius: 10px; overflow-x: auto; margin: 12px 0; white-space: pre; user-select: all;
}
.gt-dialog { max-width: 520px; }
.gt-dialog .dlg-hint code { background: var(--hover); padding: 1px 6px; border-radius: 5px; font-size: 18px; }
.gt-dialog .dlg-hint a { color: var(--accent); }
.gt-lbl { display: block; font-size: 18px; color: var(--muted); margin-bottom: 10px; }
.gt-lbl input, .gt-lbl select { display: block; margin-top: 4px; font-size: 18px; min-height: 44px; }
.gt-lbl select {
  width: 100%; font: inherit; padding: 10px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--hover); color: var(--fg);
}
.gt-dialog .dlg-buttons button { min-height: 44px; }
@media (max-width: 700px) {
  .gt-wrap { padding: 12px 12px 30vh; }
  .gt-branch { max-width: 120px; }
  .gt-ln { width: 40px; padding-right: 8px; }
  .gt-readme .gt-md, .gt-mdwrap .gt-md { padding: 4px 12px 14px; }
}

/* ======== Списки разделов, выбор и действия (14.09.2026) ========
   Строка списка — прежний .item; слева кружок выбора, справа кнопки .pinb.
   Кружок на компьютере проявляется под курсором и в режиме выбора, на
   телефоне — только в режиме выбора (кнопка Select), чтобы не съедать ширину. */
.ws-tools { display: flex; align-items: center; gap: 4px; margin: 2px 0 10px; min-height: 44px; flex-wrap: wrap; }
.ws-spacer { flex: 1; }
.ws-tool { color: var(--accent); font-size: 18px; padding: 6px 10px; min-height: 44px; border-radius: 8px; }
.ws-tool.on { background: var(--accent-soft); }
.ws-tool:disabled { color: var(--muted); cursor: default; background: none; }
.ws-sort { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 18px; }
.ws-sort select {
  font: inherit; font-size: 18px; color: var(--fg); background: var(--hover); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 28px 6px 10px; min-height: 44px; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 8l4 4 4-4' fill='none' stroke='%238e8e93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 16px;
}
.ws-sort select:focus { outline: none; border-color: var(--accent); }

.list .ws-row { display: flex; align-items: center; gap: 0; position: relative; border-radius: 8px; }
.list .ws-row:hover, .list .ws-row.menu-open { background: var(--hover); }
.list .ws-row a.item { flex: 1; min-width: 0; padding: 11px 10px; }
.list .ws-row a.item:hover { background: none; }
.list .ws-row.selected { background: var(--accent-soft); }
.list .ws-row a.item[aria-disabled="true"] { cursor: default; }
.list .ws-row .sub .ws-changed { color: var(--accent); }
.list .ws-acts { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; padding-right: 6px; }
.list .ws-acts .pinb { min-height: 44px; padding: 4px 10px; border-radius: 8px; }
.list .ws-acts .pinb.more { font-size: 18px; letter-spacing: 1px; line-height: 1; padding: 2px 8px 6px; }
.list .ws-row:hover .pinb, .list .ws-row.menu-open .pinb, .list .ws-row .pinb:focus-visible, .list .ws-row .pinb[data-act="restore"] { opacity: 1; }
/* кружок выбора */
.list .ws-check { flex: 0 0 auto; width: 0; min-height: 44px; display: grid; place-items: center; overflow: hidden; cursor: pointer; transition: width .15s; }
.list .ws-check input {
  appearance: none; -webkit-appearance: none; width: 22px; height: 22px; margin: 0; border-radius: 50%;
  border: 1.5px solid var(--muted); background: var(--bg); cursor: pointer; display: grid; place-items: center; flex: none;
}
.list .ws-check input:checked { background: var(--accent); border-color: var(--accent); }
.list .ws-check input:checked::after { content: ''; width: 6px; height: 11px; border: solid #1d1d1f; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.list .ws-check input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.list.ws-select-mode .ws-check, .list .ws-row.selected .ws-check { width: 44px; }
@media (hover: hover) { .list .ws-row:hover .ws-check { width: 44px; } }
.list.ws-select-mode a.item { cursor: default; }
/* меню «⋯» под кнопкой строки */
.list .ws-menu { left: auto; right: 6px; top: calc(100% - 8px); min-width: 210px; }
.list .ws-menu button { font-size: 18px; min-height: 44px; }
/* репозитории под общим списком */
.ws-repos { margin-top: 18px; }
.ws-group { color: var(--muted); font-size: 18px; padding: 10px 10px 4px; border-bottom: none !important; }
/* страницы */
#wsPager { display: flex; gap: 6px; align-items: center; justify-content: center; margin: 18px 0 40px; color: var(--muted); font-size: 18px; }
#wsPager button { min-width: 44px; min-height: 44px; font-size: 22px; line-height: 1; color: var(--accent); }
#wsPager button:disabled { color: var(--line); background: none; cursor: default; }
/* панель выбранного */
.ws-bar {
  position: sticky; bottom: 14px; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px;
  margin: 14px 0 0; padding: 8px 8px 8px 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .14); font-size: 18px;
}
.ws-bar .ws-count { white-space: nowrap; }
.ws-bar button { min-height: 44px; font-size: 18px; padding: 6px 12px; white-space: nowrap; }
.ws-bar button.danger { color: var(--danger); }
.ws-bar button.danger:hover { background: rgba(221, 51, 51, .08); }
.ws-bar .ws-quiet { color: var(--muted); }
.ws-bar button:disabled { color: var(--muted); opacity: .6; cursor: default; background: none; }
/* отчёт о пачке — только когда есть что рассказать */
#wsOperation {
  position: fixed; bottom: 16px; right: 16px; z-index: 100; max-width: min(520px, calc(100vw - 32px));
  padding: 12px 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 40px rgba(0, 0, 0, .18); font-size: 18px;
}
#wsOperation summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
#wsOperation p { color: var(--muted); margin: 4px 0 6px; }
#wsOperation ul { max-height: 180px; overflow: auto; padding-left: 18px; }
#wsOperation .ws-actions { margin-top: 8px; }
#wsOperation button { min-height: 44px; font-size: 18px; }
.ws-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ws-actions label { display: flex; align-items: center; gap: 8px; }
.ws-help, .ws-review-note { font-size: 18px; color: var(--muted); line-height: 1.5; padding: 6px 10px 10px; max-width: 75ch; }
.ws-event .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
/* диалоги (переименование, поручение, сравнение) */
.ws-dialog { border: 1px solid var(--line); border-radius: 16px; background: var(--bg); color: var(--fg); padding: 22px; width: min(720px, calc(100vw - 32px)); max-height: 90dvh; overflow: auto; box-shadow: 0 14px 46px rgba(0, 0, 0, .3); }
.ws-dialog::backdrop { background: rgba(0, 0, 0, .35); }
.ws-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.ws-dialog h2 { font-size: 24px; line-height: 1.3; margin: 0; }
.ws-dialog h3 { font-size: 20px; margin: 14px 0 6px; }
.ws-dialog label { display: grid; gap: 6px; margin: 14px 0; font-size: 18px; color: var(--muted); }
.ws-dialog input, .ws-dialog textarea, .ws-dialog select { width: 100%; padding: 10px 13px; border: 1px solid var(--line); border-radius: 9px; font: inherit; color: var(--fg); background: var(--hover); min-height: 44px; }
.ws-dialog input:focus, .ws-dialog textarea:focus, .ws-dialog select:focus { outline: none; border-color: var(--accent); }
.ws-dialog p, .ws-dialog pre { font-size: 18px; line-height: 1.5; }
.ws-dialog p { color: var(--muted); }
.ws-dialog pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 18px; }
.ws-dialog button { min-height: 44px; font-size: 18px; }
.ws-dialog button.primary { background: var(--accent); color: #1d1d1f; padding: 8px 18px; border-radius: 8px; }
.ws-diff { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ws-diff section { min-width: 0; padding: 12px; background: var(--hover); border-radius: 10px; }
.ws-chip { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 10px; margin: 4px; border: 1px solid var(--line); border-radius: 12px; font-size: 18px; }
.ws-chip small { font-size: 18px; width: 100%; color: var(--muted); overflow-wrap: anywhere; }
.ws-event { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 10px; }
.ws-event .sub { display: block; font-size: 18px; color: var(--muted); }
.ws-event button { font-size: 18px; min-height: 44px; }

/* ---- левая колонка: группы, split-кнопка, прокрутка ---- */
.side { overflow-y: auto; height: 100dvh; scrollbar-width: thin; display: flex; flex-direction: column; }
.nav { flex: 1; }
.ws-nav-group { margin: 4px 0 0; }
.ws-nav-group > summary {
  display: flex; align-items: center; justify-content: space-between; list-style: none;
  padding: 10px 14px 4px; font-size: 18px; letter-spacing: .01em; color: var(--muted); cursor: pointer; user-select: none;
}
.ws-nav-group > summary::-webkit-details-marker { display: none; }
.ws-nav-group > summary svg { transition: transform .15s; opacity: .7; }
.ws-nav-group:not([open]) > summary svg { transform: rotate(-90deg); }
.ws-nav-group > summary:hover { color: var(--fg); }
.nav a { min-height: 44px; padding: 7px 14px; }
.nav a[aria-current="page"] { background: var(--accent-soft); }
.create { display: flex; margin-bottom: 14px; }
.create-btn { flex: 1; border-radius: 24px 0 0 24px; padding-right: 10px; }
#wsCreateMore {
  flex: 0 0 auto; display: grid; place-items: center; width: 44px; min-height: 44px; padding: 0; border-radius: 0 24px 24px 0;
  background: var(--accent); color: #1d1d1f; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); border-left: 1px solid rgba(0, 0, 0, .14);
}
#wsCreateMore:hover { background: var(--accent); filter: brightness(1.06); }
.create .menu { left: 0; right: 0; }
.mobbar, .ws-menu-close, .ws-backdrop { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
/* видимый фокус для клавиатуры — у кнопок и ссылок; редактор и поля ввода рисуют свой */
button:focus-visible, .btn:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.editor:focus, .editor:focus-visible, [contenteditable]:focus-visible { outline: none; }

/* ---- телефон: колонка выезжает слева, сверху своя полоска ---- */
@media (max-width: 700px) {
  .app { display: block; }
  .side {
    display: block; position: fixed; inset: 0 auto 0 0; width: min(320px, 86vw); z-index: 120; border-right: 1px solid var(--line);
    padding: 12px 12px 24px; background: var(--bg); transform: translateX(-104%); transition: transform .2s ease; box-shadow: none;
  }
  .ws-menu-open .side { transform: none; box-shadow: 20px 0 50px rgba(0, 0, 0, .25); }
  .ws-backdrop { display: block; position: fixed; inset: 0; z-index: 110; background: rgba(0, 0, 0, .3); }
  .ws-menu-close { display: grid; place-items: center; position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; color: var(--muted); font-size: 18px; border-radius: 50%; }
  .side-brand { padding: 6px 10px 12px; }
  .create { margin: 0 0 12px; justify-self: stretch; }
  .create-btn { padding: 11px 16px; }
  .nav { flex-direction: column; overflow: visible; gap: 2px; }
  .nav a { padding: 8px 14px; font-size: 18px; white-space: normal; min-height: 44px; }
  .mobbar { display: flex; align-items: center; gap: 8px; margin: -6px -4px 8px; }
  .mobbar #wsMenu { display: grid; place-items: center; width: 44px; height: 44px; color: var(--fg); border-radius: 10px; }
  .mobbar .mb-brand { font-size: 22px; letter-spacing: .02em; flex: 1; }
  .mobbar .mb-create { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #1d1d1f; font-size: 26px; line-height: 1; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
  .mobbar .mb-create:hover { background: var(--accent); }
  .main { padding: 10px 14px 60px; }
  .list .ws-check { width: 0; }
  .list.ws-select-mode .ws-check, .list .ws-row.selected .ws-check { width: 44px; }
  .list .ws-row { flex-wrap: wrap; }
  .list .ws-row a.item { flex: 1 1 60%; padding: 10px 6px 4px; }
  .list .ws-acts { flex: 1 1 100%; justify-content: flex-end; padding: 0 4px 6px 44px; }
  .list .ws-acts .pinb { min-height: 44px; }
  .list .ws-menu { right: 4px; }
  .ws-bar { bottom: 10px; padding: 8px 10px; }
  .ws-diff { grid-template-columns: 1fr; }
  .ws-event { display: block; }
  .ws-event .ws-actions { margin-top: 10px; }
  .ws-dialog { padding: 16px; }
}

/* ---- агент: карточка задания ---- */
.ag-config{margin-top:28px;padding:20px;border:1px solid var(--line,#ddd);border-radius:14px}.ag-config summary{font-size:22px;min-height:44px;padding:12px 0;cursor:pointer}.ag-config label{display:grid;gap:8px;margin:16px 0;font-size: 18px}.ag-config input:not([type=checkbox]),.ag-config select{padding:10px;min-height:44px;font:inherit;width:100%;box-sizing:border-box}.ag-config p{font-size: 18px;line-height:1.5}.ag-config fieldset label{display:flex;align-items:center;min-height:44px}.ag-config details{border-bottom:1px solid var(--line,#ddd)}.ag-config button{min-height:44px}.ag-run-actions{margin-top:20px}.ag-em{color:var(--fg)}.ag-access-summary{padding:14px;background:var(--accent-soft,#fffbc8);border-radius:10px}.ag-row{flex-wrap:wrap;gap:8px;padding:12px 4px}.ag-row .item{flex:1 1 100%}.ag-row .pinb{opacity:1;position:static;min-height:44px;margin:0}.ag-row .btn,.ag-row button{min-height:44px}#agRuns{display:grid;gap:6px}#agRuns button{text-align:left}#agTaskHeading{font-size:24px}
.agent-workspace .editor{min-height:130px;padding-bottom:20px}.agent-workspace .ag-config{margin-top:20px}.agent-workspace #agTaskHeading{margin-bottom:12px}

/* ---- палитра с типом и закладка чтения ---- */
.palette-controls { display: flex; align-items: center; gap: 8px; padding-right: 12px; }
.palette-controls .palette-input { min-width: 0; flex: 1; }
.palette-type { max-width: 170px; min-height: 44px; font-size: 18px; }
.reading-place { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 12px 0; color: var(--muted); font-size: 18px; }
.reading-place button { min-height: 44px; }
@media (max-width: 600px) { .palette-controls { align-items: stretch; flex-direction: column; padding: 8px; } .palette-type { max-width: 100%; width: 100%; } .card-head { flex-wrap: wrap; } }
