:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eef0f3;
  --border: #e1e4e8;
  --border-strong: #c9ced6;
  --text: #1f2328;
  --text-2: #5c6470;
  --text-3: #8a929d;
  --accent: #ffcc00;
  --accent-hover: #f5c000;
  --accent-text: #1f2328;
  --link: #2f6fde;
  --danger: #d93a3a;
  --ok: #2e9e5b;
  --sidebar: #1f2329;
  --sidebar-text: #c7ccd4;
  --sidebar-hover: #2c3139;
  --sidebar-active: #383e48;
  --shadow: 0 4px 16px rgba(20, 24, 31, .12);
  --st-new: #6b7787;
  --st-new-bg: #eceff3;
  --st-progress: #2361d6;
  --st-progress-bg: #e3edff;
  --st-paused: #b26b00;
  --st-paused-bg: #fff1d6;
  --st-done: #23874c;
  --st-done-bg: #dff4e7;
  --radius: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15181d; --surface: #1d2127; --surface-2: #22262d; --surface-3: #2a2f37; --border: #313740; --border-strong: #444b56;
    --text: #e6e8eb; --text-2: #a7aeb8; --text-3: #7c8490; --link: #6ea1ff; --sidebar: #111317; --sidebar-hover: #1d2127;
    --sidebar-active: #2a2f37; --shadow: 0 6px 24px rgba(0, 0, 0, .5);
    --st-new: #a7b0bd; --st-new-bg: #2c323a; --st-progress: #86adff; --st-progress-bg: #1f2d4a;
    --st-paused: #f0b45a; --st-paused-bg: #3d2f17; --st-done: #6ccf93; --st-done-bg: #193526;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15181d; --surface: #1d2127; --surface-2: #22262d; --surface-3: #2a2f37; --border: #313740; --border-strong: #444b56;
  --text: #e6e8eb; --text-2: #a7aeb8; --text-3: #7c8490; --link: #6ea1ff; --sidebar: #111317; --sidebar-hover: #1d2127;
  --sidebar-active: #2a2f37; --shadow: 0 6px 24px rgba(0, 0, 0, .5);
  --st-new: #a7b0bd; --st-new-bg: #2c323a; --st-progress: #86adff; --st-progress-bg: #1f2d4a;
  --st-paused: #f0b45a; --st-paused-bg: #3d2f17; --st-done: #6ccf93; --st-done-bg: #193526;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.45 "CEmojiBlank", -apple-system, "Segoe UI", "YS Text", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 14px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.hidden { display: none !important; }
.stack > * + * { margin-top: 12px; }

/* --- каркас */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 216px; flex: none; background: var(--sidebar); color: var(--sidebar-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px; color: #fff; font-weight: 700; font-size: 16px; }
.brand-logo { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; }
.nav { padding: 4px 8px; display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav button {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; color: var(--sidebar-text);
  background: none; border: 0; cursor: pointer; text-align: left; width: 100%; text-decoration: none;
}
.nav a:hover, .nav button:hover { background: var(--sidebar-hover); color: #fff; }
.nav a.active, .nav button.active { background: var(--sidebar-active); color: #fff; }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav-section { padding: 14px 18px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #7d8592; }
.nav .filter-link { padding: 5px 10px 5px 38px; font-size: 13px; }
.sidebar-bottom { margin-top: auto; padding: 8px; border-top: 1px solid #2c3139; }
.badge-count { margin-left: auto; background: var(--danger); color: #fff; border-radius: 10px; font-size: 11px; padding: 0 6px; line-height: 18px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 24px; background: var(--surface);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10;
}
.menu-toggle { display: none; }
.global-search { width: 320px; max-width: 40vw; }
.content { padding: 24px; max-width: 1400px; width: 100%; }
.content.wide { max-width: none; }

/* --- контролы */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 14px;
  border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer;
  white-space: nowrap; text-decoration: none !important; color: var(--text);
}
.btn:hover { background: var(--surface-3); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 500; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.danger { color: var(--danger); }
.btn.sm { height: 26px; padding: 0 9px; font-size: 13px; }
.btn.icon { width: 32px; padding: 0; }
.btn.sm.icon { width: 26px; }
.input, select.input, textarea.input {
  height: 32px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface);
  width: 100%; outline: none; min-width: 0;
}
textarea.input { height: auto; padding: 8px 10px; resize: vertical; min-height: 80px; line-height: 1.45; }
.input:focus { border-color: #8fb1f0; box-shadow: 0 0 0 3px rgba(47, 111, 222, .15); }
.input.query { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; }
label.field { display: block; }
label.field > span { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-pad { padding: 16px; }
.section-title { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs button {
  background: none; border: 0; padding: 8px 12px; cursor: pointer; color: var(--text-2); border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 500; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; height: 22px; border-radius: 11px;
  background: var(--surface-3); font-size: 12px; color: var(--text-2); white-space: nowrap;
}
.chip button { border: 0; background: none; padding: 0; cursor: pointer; color: var(--text-3); line-height: 1; }
.chip.clickable { cursor: pointer; border: 1px solid transparent; height: 28px; padding: 0 12px; border-radius: 14px; font-size: 13px; }
.chip.clickable:hover { border-color: var(--border-strong); }
.chip.clickable.active { background: var(--text); color: var(--surface); }

/* --- статусы, приоритеты, аватары */
.status {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 4px; font-size: 12px;
  font-weight: 500; white-space: nowrap; text-transform: uppercase; letter-spacing: .02em;
}
.status.new { color: var(--st-new); background: var(--st-new-bg); }
.status.inProgress { color: var(--st-progress); background: var(--st-progress-bg); }
.status.paused { color: var(--st-paused); background: var(--st-paused-bg); }
.status.done { color: var(--st-done); background: var(--st-done-bg); }
.prio { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.prio svg { width: 14px; height: 14px; }
.type-icon { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
.type-emoji { display: inline-grid; place-items: center; width: 16px; height: 16px; flex: none; font-size: 14px; line-height: 1; vertical-align: -3px; }
/* значок в справочниках — кнопка: нажать и выбрать смайлик */
.dict-icon-btn { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border: 1px dashed transparent; border-radius: 8px; background: none; cursor: pointer; padding: 0; }
.dict-icon-btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.dict-icon-btn .type-emoji, .dict-icon-btn .prio-emoji { font-size: 17px; width: 20px; height: 20px; }
.icon-pop { position: fixed; z-index: 3000; width: min(360px, calc(100vw - 16px)); max-height: min(420px, calc(100vh - 16px)); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 48px rgba(0, 0, 0, .35); }
.icon-pop-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.icon-pop-body { overflow-y: auto; padding: 6px 10px 10px; scrollbar-width: thin; }
.icon-pop-group { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin: 8px 0 4px; }
.icon-pop .icon-pick { border-color: transparent; background: none; }
.icon-pop .icon-pick:hover { background: var(--surface-2); }
.avatar {
  width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10px; font-weight: 600;
  color: #fff; flex: none; text-transform: uppercase; letter-spacing: -.02em;
}
.avatar.lg { width: 32px; height: 32px; font-size: 12px; }
.user { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.user > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.key { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; white-space: nowrap; }
.done-text { text-decoration: line-through; color: var(--text-3); }
.overdue { color: var(--danger); font-weight: 500; }

/* --- таблица задач */
.table-wrap { overflow-x: auto; }
table.issues { width: 100%; border-collapse: collapse; background: var(--surface); }
table.issues th {
  text-align: left; font-weight: 500; font-size: 12px; color: var(--text-2); padding: 8px 10px; border-bottom: 1px solid var(--border);
  white-space: nowrap; user-select: none; background: var(--surface-2);
}
table.issues th.sortable { cursor: pointer; }
table.issues th.sortable:hover { color: var(--text); }
table.issues td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.issues tr:last-child td { border-bottom: 0; }
table.issues tbody tr { cursor: pointer; }
table.issues tbody tr:hover td { background: var(--surface-2); }
table.issues td.summary { min-width: 260px; }
table.issues td.summary a { color: var(--text); }
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 10px 0; }
.empty { padding: 40px 16px; text-align: center; color: var(--text-2); }
.query-bar { display: flex; gap: 8px; margin-bottom: 10px; }
.quick-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.error-box { background: #fdecec; color: #a42424; border-radius: 6px; padding: 8px 12px; margin-bottom: 10px; }
:root[data-theme="dark"] .error-box { background: #3b1d1d; color: #ffb3b3; }

/* --- карточка задачи */
.issue-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.issue-title { font-size: 24px; font-weight: 600; line-height: 1.25; margin: 6px 0 14px; cursor: text; border-radius: 6px; padding: 2px 4px; margin-left: -4px; }
.issue-title:hover { background: var(--surface-3); }
.issue-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 18px; }
.block { margin-bottom: 24px; }
.block-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.block-head h3 { font-size: 15px; }
/* панель полей «прилипает» при прокрутке задачи; если выше окна — прокручивается сама, иначе низ недоступен */
.params { position: sticky; top: 72px; max-height: calc(100vh - 84px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.param { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px; align-items: center; padding: 5px 0; min-height: 34px; }
.param > .label { color: var(--text-2); font-size: 13px; }
.param .input, .param select.input { height: 28px; border-color: transparent; background: transparent; padding: 0 6px; }
.param .input:hover { border-color: var(--border); }
.param .input:focus { border-color: #8fb1f0; background: var(--surface); }
.param-group { padding: 8px 16px; border-bottom: 1px solid var(--border); }
.param-group:last-child { border-bottom: 0; }
.description { padding: 2px 0; }
.md { word-wrap: break-word; }
.md p { margin: 0 0 8px; }
.md h1, .md h2, .md h3 { margin: 14px 0 8px; }
.md ul, .md ol { margin: 0 0 8px; padding-left: 22px; }
.md code { background: var(--surface-3); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.md .mention { background: var(--st-progress-bg); color: var(--st-progress); border-radius: 4px; padding: 0 3px; }
.md > :last-child { margin-bottom: 0; }
.list-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; }
.list-row:hover { background: var(--surface-2); }
.list-row .actions { opacity: 0; }
.list-row:hover .actions { opacity: 1; }
.comment { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.comment:last-child { border-bottom: 0; }
.comment-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 4px; flex-wrap: wrap; }
.history-row { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.progress { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.progress > div { height: 100%; background: var(--ok); }

/* --- доски */
.board { display: flex; gap: 12px; align-items: flex-start; overflow-x: auto; padding-bottom: 12px; }
.column { flex: 0 0 280px; background: var(--surface-3); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 200px); }
.column-head { padding: 10px 12px; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.column-body { padding: 0 8px 8px; overflow-y: auto; min-height: 60px; flex: 1; }
.column.drop-target { outline: 2px dashed var(--link); outline-offset: -2px; }
.bcard {
  background: var(--surface); border-radius: 6px; padding: 10px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
  cursor: grab; border: 1px solid var(--border); display: block; color: var(--text); text-decoration: none !important;
}
.bcard:hover { border-color: var(--border-strong); }
/* доска во весь экран до низа: у каждой колонки свой вертикальный ползунок, горизонтальный — внизу и только при наведении */
.content:has(> .board-fit), .content:has(.board-fit) { padding-bottom: 0; }
.board.board-fit { align-items: stretch; padding-bottom: 4px; margin-bottom: 0; scrollbar-width: thin; scrollbar-color: transparent transparent; transition: scrollbar-color .2s; }
.board.board-fit:hover { scrollbar-color: color-mix(in srgb, var(--text-3) 55%, transparent) transparent; }
.board.board-fit::-webkit-scrollbar { height: 8px; }
.board.board-fit::-webkit-scrollbar-thumb { background: transparent; border-radius: 6px; }
.board.board-fit:hover::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text-3) 55%, transparent); }
.board.board-fit > .column { max-height: 100%; align-self: flex-start; }
.board.board-fit .column-body { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text-3) 50%, transparent) transparent; }
.board.board-fit .column-body::-webkit-scrollbar { width: 7px; }
.board.board-fit .column-body::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text-3) 50%, transparent); border-radius: 6px; }
/* подсветка карточки по приоритету — спокойная: полоска слева и легкий оттенок фона */
.bcard.prio-tint { background: color-mix(in srgb, var(--pc) 9%, var(--surface)); border-left: 3px solid color-mix(in srgb, var(--pc) 70%, transparent); padding-left: 8px; }
.prio-color-dot { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--pc); cursor: pointer; padding: 0; }
.prio-color-dot.none { background: repeating-linear-gradient(45deg, transparent 0 3px, var(--border-strong) 3px 4px); }
.bcard.prio-tint:hover { border-color: color-mix(in srgb, var(--pc) 45%, var(--border-strong)); border-left-color: var(--pc); }
.bcard.dragging { opacity: .45; }
.bcard .summary { margin: 4px 0 8px; line-height: 1.35; }
.sp { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--surface-3); font-size: 11px; font-weight: 600; color: var(--text-2); }
.backlog-section { margin-bottom: 16px; }
.backlog-section.drop-target { outline: 2px dashed var(--link); border-radius: var(--radius); }
.backlog-row { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--border); background: var(--surface); cursor: grab; }
.backlog-row:last-child { border-bottom: 0; }

/* --- плитки, списки карточек */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tile { padding: 14px 16px; cursor: pointer; }
.tile:hover { border-color: var(--border-strong); }
.tile .num { font-size: 28px; font-weight: 600; line-height: 1.1; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.qcard { padding: 16px; display: block; color: var(--text); text-decoration: none !important; }
.qcard:hover { border-color: var(--border-strong); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* --- модалки, всплывашки */
.overlay { position: fixed; inset: 0; background: rgba(15, 18, 23, .45); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; z-index: 100; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); width: 640px; max-width: 100%; }
.modal.sm { width: 440px; }
.modal-head { display: flex; align-items: center; padding: 16px 20px 0; }
.modal-body { padding: 16px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 18px; }
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--text); color: var(--surface); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); max-width: 380px; }
.toast.error { background: var(--danger); color: #fff; }
.popover { position: absolute; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); z-index: 50; }
.notif-panel { width: 380px; max-height: 70vh; overflow-y: auto; left: 224px; bottom: 16px; position: fixed; }
.notif { padding: 10px 14px; border-bottom: 1px solid var(--border); display: flex; gap: 10px; cursor: pointer; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: var(--st-progress-bg); }
.help-panel { padding: 12px 16px; font-size: 13px; }
.help-panel code { background: var(--surface-3); padding: 1px 5px; border-radius: 4px; cursor: pointer; }
.help-panel table td { padding: 3px 10px 3px 0; vertical-align: top; }

/* --- вход */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 360px; max-width: 100%; padding: 28px; }

/* --- редактор рабочего процесса */
.wf-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.wf-legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.wf-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.wf-legend-item::before, .wf-cat-dot { content: ''; width: 10px; height: 10px; border-radius: 3px; display: inline-block; border: 1.5px solid; flex: none; }
.cat-new.wf-legend-item::before, .wf-cat-dot.cat-new { background: var(--st-new-bg); border-color: var(--st-new); }
.cat-inProgress.wf-legend-item::before, .wf-cat-dot.cat-inProgress { background: var(--st-progress-bg); border-color: var(--st-progress); }
.cat-paused.wf-legend-item::before, .wf-cat-dot.cat-paused { background: var(--st-paused-bg); border-color: var(--st-paused); }
.cat-done.wf-legend-item::before, .wf-cat-dot.cat-done { background: var(--st-done-bg); border-color: var(--st-done); }
.wf-help { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--text-2); margin-bottom: 10px; }
.wf-dot-sample { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--link); vertical-align: -1px; }
.wf-canvas {
  position: relative; overflow: auto; height: 540px; min-height: 300px; resize: vertical; border: 1px solid var(--border); border-radius: 10px;
  background-color: var(--surface-2);
  background-image: radial-gradient(circle, var(--border-strong) 1px, transparent 1.2px); background-size: 20px 20px;
}
.wf-inner { position: relative; min-width: 100%; }
.wf-edges { position: absolute; left: 0; top: 0; overflow: visible; }
.wf-edge { fill: none; stroke: var(--text-3); stroke-width: 1.6; }
.wf-edge.any { stroke-dasharray: 5 4; }
.wf-edge.hot { stroke: var(--link); stroke-width: 2.4; }
.wf-edge-hit { fill: none; stroke: transparent; stroke-width: 14; cursor: pointer; pointer-events: stroke; }
.wf-edge-hit:hover { stroke: rgba(47, 111, 222, .15); }
.wf-temp { fill: none; stroke: var(--link); stroke-width: 2; stroke-dasharray: 6 4; pointer-events: none; }
.wf-labels { position: absolute; inset: 0; pointer-events: none; }
.wf-label {
  position: absolute; transform: translate(-50%, -50%); pointer-events: auto; white-space: nowrap; max-width: 190px; overflow: hidden; text-overflow: ellipsis;
  font-size: 11.5px; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06); z-index: 1;
}
.wf-label:hover, .wf-label.hot { border-color: var(--link); color: var(--link); z-index: 3; }
.wf-res { margin-left: 5px; font-size: 10px; color: var(--st-done); font-weight: 600; }
.wf-nodes { position: absolute; inset: 0; pointer-events: none; }
.wf-node {
  position: absolute; width: 180px; height: 48px; border-radius: 10px; border: 2px solid; display: flex; align-items: center; gap: 6px;
  padding: 0 26px 0 12px; cursor: grab; user-select: none; pointer-events: auto; box-shadow: 0 2px 6px rgba(0, 0, 0, .08); z-index: 2;
  transition: box-shadow .15s;
}
.wf-node:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, .14); }
.wf-node.dragging { cursor: grabbing; box-shadow: 0 10px 24px rgba(0, 0, 0, .22); z-index: 5; }
.wf-node.cat-new { background: var(--st-new-bg); border-color: var(--st-new); color: var(--st-new); }
.wf-node.cat-inProgress { background: var(--st-progress-bg); border-color: var(--st-progress); color: var(--st-progress); }
.wf-node.cat-paused { background: var(--st-paused-bg); border-color: var(--st-paused); color: var(--st-paused); }
.wf-node.cat-done { background: var(--st-done-bg); border-color: var(--st-done); color: var(--st-done); }
.wf-node.any { background: var(--surface); border-style: dashed; border-color: var(--border-strong); color: var(--text-2); }
.wf-node.drop { outline: 3px solid var(--link); outline-offset: 2px; }
.wf-node.flash { animation: wf-flash 1.2s ease; }
@keyframes wf-flash { 0%, 60% { outline: 3px solid var(--accent); outline-offset: 3px; } 100% { outline: 0 solid transparent; } }
.wf-node.deadend::after { content: 'нет выхода'; position: absolute; left: 10px; bottom: -17px; font-size: 10.5px; color: var(--text-3); white-space: nowrap; }
.wf-node-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.wf-count { font-size: 11px; font-weight: 600; background: var(--surface); border-radius: 9px; padding: 0 6px; color: var(--text-2); flex: none; }
.wf-start {
  position: absolute; top: -10px; left: 10px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  background: var(--accent); color: var(--accent-text); border-radius: 6px; padding: 1px 6px;
}
.wf-start.mini { position: static; }
.wf-node-menu {
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: inherit; cursor: pointer; font-size: 16px;
  line-height: 1; padding: 2px 3px; border-radius: 4px; opacity: 0;
}
.wf-node:hover .wf-node-menu { opacity: .8; }
.wf-node-menu:hover { background: rgba(0, 0, 0, .08); opacity: 1; }
.wf-handle {
  position: absolute; right: -8px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: var(--link);
  border: 2px solid var(--surface); cursor: crosshair; box-shadow: 0 0 0 1px var(--link); transition: transform .12s;
}
.wf-handle:hover, .wf-inner.connecting .wf-handle { transform: scale(1.35); }
.wf-inner.connecting .wf-node { cursor: crosshair; }
.wf-pop {
  position: absolute; width: 280px; z-index: 10; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow); padding: 12px; transform: translateX(-50%);
}
.wf-pop .input, .wf-pop select.input { height: 30px; }

/* ================================================================ разметка YFM */
:root {
  --tk-keyword: #a626a4; --tk-string: #50a14f; --tk-comment: #a0a1a7; --tk-number: #986801; --tk-fn: #4078f2; --tk-tag: #e45649; --tk-attr: #b07800;
  --mark: #fff0a0; --note-alert-bg: #fdecec;
  --c-red: #d93a3a; --c-orange: #e07800; --c-yellow: #b89300; --c-green: #23874c; --c-cyan: #0b8fb3; --c-blue: #2f6fde; --c-purple: #8b44d6; --c-gray: #7c8490;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --tk-keyword: #c678dd; --tk-string: #98c379; --tk-comment: #7f848e; --tk-number: #d19a66; --tk-fn: #61afef; --tk-tag: #e06c75; --tk-attr: #e5c07b;
    --mark: #5c4b00; --note-alert-bg: #3b1d1d;
    --c-red: #ff7b7b; --c-orange: #ffaa55; --c-yellow: #f0d050; --c-green: #6ccf93; --c-cyan: #5fd0f0; --c-blue: #7aa9ff; --c-purple: #c39bff; --c-gray: #9aa2ad;
  }
}
:root[data-theme="dark"] {
  --tk-keyword: #c678dd; --tk-string: #98c379; --tk-comment: #7f848e; --tk-number: #d19a66; --tk-fn: #61afef; --tk-tag: #e06c75; --tk-attr: #e5c07b;
  --mark: #5c4b00; --note-alert-bg: #3b1d1d;
  --c-red: #ff7b7b; --c-orange: #ffaa55; --c-yellow: #f0d050; --c-green: #6ccf93; --c-cyan: #5fd0f0; --c-blue: #7aa9ff; --c-purple: #c39bff; --c-gray: #9aa2ad;
}

.md { line-height: 1.55; overflow-wrap: anywhere; }
.md h1 { font-size: 20px; } .md h2 { font-size: 18px; } .md h3 { font-size: 16px; } .md h4, .md h5, .md h6 { font-size: 14px; margin: 12px 0 6px; }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }
.md mark { background: var(--mark); color: inherit; padding: 0 2px; border-radius: 2px; }
.md blockquote { margin: 0 0 10px; padding: 2px 12px; border-left: 3px solid var(--border-strong); color: var(--text-2); }
.md blockquote > :last-child { margin-bottom: 0; }
.md li > ul, .md li > ol { margin: 2px 0; }
.md code.yfm-mono { background: none; padding: 0; font-size: 13px; }
.md ul.yfm-tasks { list-style: none; padding-left: 2px; }
.md li.yfm-task { display: flex; gap: 8px; align-items: flex-start; }
.md li.yfm-task > input { margin-top: 4px; flex: none; }
.md li.yfm-task > div { min-width: 0; }
.yfm-color-red { color: var(--c-red); } .yfm-color-orange { color: var(--c-orange); } .yfm-color-yellow { color: var(--c-yellow); }
.yfm-color-green { color: var(--c-green); } .yfm-color-cyan { color: var(--c-cyan); } .yfm-color-blue { color: var(--c-blue); }
.yfm-color-purple { color: var(--c-purple); } .yfm-color-gray { color: var(--c-gray); }
.yfm-img { max-width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--border); cursor: zoom-in; vertical-align: top; margin: 2px 0; background: var(--surface-2); }
.md p > .yfm-img:only-child { display: block; max-height: 520px; object-fit: contain; width: auto; }
.yfm-file { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 6px; background: var(--surface-3); color: var(--text) !important; text-decoration: none !important; border: 1px solid var(--border); }
.yfm-file:hover { border-color: var(--border-strong); }
.yfm-cut { margin: 4px 0 10px; }
.yfm-cut > summary { cursor: pointer; color: var(--link); list-style: none; display: inline-flex; align-items: center; gap: 7px; font-weight: 500; user-select: none; border-radius: 4px; padding: 1px 4px 1px 0; }
.yfm-cut > summary::-webkit-details-marker { display: none; }
.yfm-cut > summary::before { content: ''; border-left: 6px solid currentColor; border-top: 4.5px solid transparent; border-bottom: 4.5px solid transparent; transition: transform .15s; }
.yfm-cut[open] > summary::before { transform: rotate(90deg); }
.yfm-cut > summary:hover { text-decoration: underline; }
.yfm-cut-content { padding: 8px 0 2px 14px; border-left: 2px solid var(--border); margin: 6px 0 0 2px; }
.yfm-cut-content > :last-child { margin-bottom: 0; }
.yfm-note { border-radius: 8px; padding: 10px 14px; margin: 0 0 10px; border-left: 4px solid; }
.yfm-note > :last-child { margin-bottom: 0; }
.yfm-note-info { background: var(--st-progress-bg); border-color: var(--c-blue); }
.yfm-note-tip { background: var(--st-done-bg); border-color: var(--c-green); }
.yfm-note-warning { background: var(--st-paused-bg); border-color: var(--c-orange); }
.yfm-note-alert { background: var(--note-alert-bg); border-color: var(--c-red); }
.md .yfm-note-title { font-weight: 600; margin-bottom: 4px; }
.yfm-table-wrap { overflow-x: auto; margin: 0 0 10px; }
.yfm-table-wrap.sticky { max-height: 420px; overflow-y: auto; }
.yfm-table-wrap.sticky th { position: sticky; top: 0; }
.yfm-table { border-collapse: collapse; }
.yfm-table th, .yfm-table td { border: 1px solid var(--border-strong); padding: 6px 10px; vertical-align: top; text-align: left; }
.yfm-table th { background: var(--surface-2); font-weight: 600; }
.yfm-table td > :last-child, .yfm-table th > :last-child { margin-bottom: 0; }
.yfm-table ul, .yfm-table ol { padding-left: 18px; }
.yfm-tabs { margin: 0 0 10px; }
.yfm-tabs-head { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 8px; flex-wrap: wrap; }
.yfm-tab { background: none; border: 0; padding: 6px 12px; cursor: pointer; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.yfm-tab:hover { color: var(--text); }
.yfm-tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 500; }
.yfm-tab-panel { display: none; }
.yfm-tab-panel.active { display: block; }
.yfm-tab-panel > :last-child { margin-bottom: 0; }
.yfm-code { border: 1px solid var(--border); border-radius: 8px; margin: 0 0 10px; overflow: hidden; background: var(--surface-2); }
.yfm-code-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 2px 12px; font-size: 11.5px; color: var(--text-3); border-bottom: 1px solid var(--border); text-transform: lowercase; }
.yfm-copy { background: none; border: 0; cursor: pointer; color: var(--text-2); font-size: 12px; padding: 3px 8px; border-radius: 4px; text-transform: none; }
.yfm-copy:hover { background: var(--surface-3); color: var(--text); }
.yfm-code pre { margin: 0; padding: 10px 12px; overflow-x: auto; font-size: 12.5px; line-height: 1.5; }
.md .yfm-code pre code { background: none; padding: 0; font-size: inherit; }
.tk-keyword { color: var(--tk-keyword); } .tk-string { color: var(--tk-string); } .tk-comment { color: var(--tk-comment); font-style: italic; }
.tk-number { color: var(--tk-number); } .tk-fn { color: var(--tk-fn); } .tk-tag { color: var(--tk-tag); } .tk-attr { color: var(--tk-attr); }
.yfm-formula, .yfm-formula-inline { font-family: "Cambria Math", "Times New Roman", serif; font-style: italic; }
.yfm-formula { text-align: center; padding: 8px; margin: 0 0 10px; background: var(--surface-2); border-radius: 6px; white-space: pre-wrap; font-size: 16px; }

/* --- просмотр картинок */
.lightbox { position: fixed; inset: 0; background: rgba(8, 10, 14, .88); z-index: 300; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 90px); border-radius: 4px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); background: #fff; }
.lightbox-bar { color: #ddd; margin-top: 12px; display: flex; gap: 16px; font-size: 13px; }
.lightbox-bar a { color: #9cc0ff; }

/* --- редактор */
.modal.lg { width: 1000px; }
.editor { border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); position: relative; }
.editor:focus-within { border-color: #8fb1f0; box-shadow: 0 0 0 3px rgba(47, 111, 222, .15); }
.editor.drag { border-color: var(--link); border-style: dashed; background: var(--st-progress-bg); }
.editor-head { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--border); padding: 4px 6px; flex-wrap: wrap; background: var(--surface-2); border-radius: 8px 8px 0 0; }
.ed-tab { background: none; border: 0; padding: 4px 10px; border-radius: 6px; cursor: pointer; color: var(--text-2); font-size: 13px; }
.ed-tab.active { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border); }
.editor-toolbar { display: flex; align-items: center; gap: 1px; flex: 1; flex-wrap: wrap; margin-left: 6px; min-width: 0; }
.tb { width: 28px; height: 28px; display: inline-grid; place-items: center; border: 0; background: none; border-radius: 5px; cursor: pointer; color: var(--text-2); font-size: 14px; padding: 0; }
.tb:hover { background: var(--surface-3); color: var(--text); }
.tb-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
.editor-body { position: relative; }
textarea.input.editor-text { border: 0; box-shadow: none; border-radius: 0; min-height: 70px; resize: none; display: block; padding: 10px 12px; }
.editor-preview { padding: 10px 12px; }
.editor-foot { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.editor-foot:has(> span:only-child:empty) { display: none; }
.mention-pop { position: absolute; left: 10px; top: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); z-index: 30; min-width: 280px; padding: 4px; }
.mention-item { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.mention-item.active, .mention-item:hover { background: var(--surface-3); }
.popover.menu { padding: 4px; min-width: 200px; max-width: 360px; }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: 0; padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text); }
.menu-item:hover { background: var(--surface-3); }
.color-dot { font-size: 15px; line-height: 1; }
.note-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.note-dot-info { background: var(--c-blue); } .note-dot-tip { background: var(--c-green); } .note-dot-warning { background: var(--c-orange); } .note-dot-alert { background: var(--c-red); }
.markup-help table { width: 100%; border-collapse: collapse; }
.markup-help th, .markup-help > table td { border-bottom: 1px solid var(--border); padding: 10px 8px; vertical-align: top; width: 50%; text-align: left; }
.markup-src { margin: 4px 0 0; font-size: 12px; background: var(--surface-2); padding: 8px; border-radius: 6px; white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

/* --- визуальный редактор */
.ed-modes { display: flex; gap: 2px; background: var(--surface-3); border-radius: 7px; padding: 2px; flex: none; }
.ed-preview.active { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border); }
.ve-root { outline: none; padding: 10px 12px; cursor: text; position: relative; }
.ve-root.ve-empty::before { content: attr(data-placeholder); color: var(--text-3); position: absolute; pointer-events: none; }
.ve-root p { margin: 0 0 6px; }
.ve [contenteditable="true"] { outline: none; }
.ve-block { border: 1px solid var(--border); border-radius: 8px; margin: 4px 0 10px; background: var(--surface); position: relative; cursor: default; }
.ve-block-head { display: flex; align-items: center; gap: 6px; padding: 3px 4px 3px 8px; font-size: 12px; color: var(--text-3); user-select: none; }
.ve-block-label { white-space: nowrap; }
.ve-spacer { flex: 1; }
.ve-del { opacity: 0; border: 0; background: none; cursor: pointer; color: var(--text-3); font-size: 17px; line-height: 1; width: 24px; height: 22px; border-radius: 4px; flex: none; padding: 0; }
.ve-block:hover > .ve-block-head > .ve-del, .ve-block:focus-within > .ve-block-head > .ve-del,
.ve-table:hover > .ve-table-tools > .ve-del, .ve-table:focus-within > .ve-table-tools > .ve-del { opacity: 1; }
.ve-del:hover { background: var(--surface-3); color: var(--danger); }
.ve-code, .ve-raw { background: var(--surface-2); }
.ve-code > .ve-block-head, .ve-raw > .ve-block-head { border-bottom: 1px solid var(--border); }
.ve-raw { border-style: dashed; }
.ve-lang { border: 0; background: transparent; font-size: 12px; color: var(--text-2); width: 190px; outline: none; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; padding: 2px 4px; border-radius: 4px; }
.ve-lang:focus { background: var(--surface); }
.ve-code > pre, .ve-raw > pre { margin: 0; padding: 10px 12px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; min-height: 1.5em; cursor: text; }
.ve-cut-toggle { width: 18px; height: 18px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; color: var(--link); padding: 0; flex: none; }
.ve-cut-toggle::before { content: ''; border-left: 6px solid currentColor; border-top: 4.5px solid transparent; border-bottom: 4.5px solid transparent; transform: rotate(90deg); transition: transform .15s; }
.ve-collapsed .ve-cut-toggle::before { transform: none; }
.ve-cut-title { flex: 1; color: var(--link); font-weight: 500; font-size: 14px; min-width: 60px; cursor: text; padding: 2px 0; }
.ve-cut-body { padding: 8px 12px 4px 30px; border-top: 1px dashed var(--border); cursor: text; min-height: 34px; }
.ve-collapsed > .ve-cut-body { display: none; }
.ve-note.yfm-note { padding: 0; border-width: 1px 1px 1px 4px; border-style: solid; }
.ve-note > .ve-block-head { padding: 6px 4px 0 10px; }
.ve-note-type { border: 0; background: transparent; font-size: 12px; color: var(--text-2); cursor: pointer; padding: 0; }
.ve-note-title { flex: 1; font-weight: 600; font-size: 14px; color: var(--text); min-width: 80px; cursor: text; padding: 2px 0; }
.ve-note-title:empty::before { content: attr(data-placeholder); opacity: .55; }
.ve-note-body { padding: 4px 14px 8px; cursor: text; min-height: 30px; }
.ve-table { border: 0; background: transparent; }
.ve-table-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; padding: 0 0 4px; opacity: .0; transition: opacity .15s; }
.ve-table:hover > .ve-table-tools, .ve-table:focus-within > .ve-table-tools { opacity: 1; }
.ve-table-tools button:not(.ve-del) { border: 1px solid var(--border); background: var(--surface); border-radius: 5px; font-size: 11.5px; padding: 1px 7px; cursor: pointer; color: var(--text-2); }
.ve-table-tools button:not(.ve-del):hover { background: var(--surface-3); color: var(--text); }
.ve-table td, .ve-table th { min-width: 90px; cursor: text; }
.ve-table td:focus, .ve-table th:focus { box-shadow: inset 0 0 0 2px #8fb1f0; }
.ve-root ul:has(> li.ve-task) { list-style: none; padding-left: 2px; }
.ve-task { position: relative; padding-left: 24px; }
.ve-task::before { content: ''; position: absolute; left: 2px; top: .28em; width: 15px; height: 15px; border: 1.5px solid var(--border-strong); border-radius: 4px; background: var(--surface); cursor: pointer; box-sizing: border-box; }
.ve-task[data-checked="true"]::before { border-color: var(--link); background: var(--link) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-4.8' stroke='white' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px no-repeat; }
.ve-uploading { background: var(--surface-3); border-radius: 4px; padding: 1px 6px; font-size: 12px; color: var(--text-2); }
.ve-root img.yfm-img { cursor: grab; }
.ve-root img.yfm-img:active { cursor: grabbing; }
.ve-root img.yfm-img:hover { outline: 2px solid #8fb1f0; }

/* --- боковое меню: сворачивается до значков */
.sidebar { transition: width .18s; overflow: hidden; }
.brand-logo { color: var(--accent-text); flex: none; }
.nav a, .nav button { position: relative; white-space: nowrap; }
.nav .filter-link { padding: 6px 10px; font-size: 13px; }
.nav .filter-link svg { width: 15px; height: 15px; }
.nav-collapse svg { transition: transform .18s; }
.layout.collapsed .sidebar { width: 60px; }
@media (min-width: 761px) { .layout:not(.collapsed) .sidebar { width: var(--sidebar-w, 216px); } }
/* правый край меню тянется мышкой */
.sidebar-resize { position: absolute; top: 0; right: 0; width: 7px; height: 100%; cursor: col-resize; z-index: 5; touch-action: none; }
.sidebar-resize::after { content: ''; position: absolute; top: 0; right: 0; width: 2px; height: 100%; background: var(--accent); opacity: 0; transition: opacity .15s; }
.sidebar-resize:hover::after, .layout.resizing .sidebar-resize::after { opacity: .8; }
.layout.resizing { cursor: col-resize; user-select: none; }
.layout.resizing .sidebar { transition: none; }
@media (max-width: 760px) { .sidebar-resize { display: none; } }
.layout.collapsed .nav-label, .layout.collapsed .nav-section { display: none; }
.layout.collapsed .nav a, .layout.collapsed .nav button { justify-content: center; padding: 9px 0; }
.layout.collapsed .brand { justify-content: center; padding: 16px 0 12px; }
.layout.collapsed .nav { padding: 4px 6px; }
.layout.collapsed .badge-count { position: absolute; top: 1px; right: 4px; margin: 0; font-size: 10px; padding: 0 4px; line-height: 15px; }
.layout.collapsed .nav-collapse svg { transform: rotate(180deg); }
.layout.collapsed .nav-filters { border-top: 1px solid #2c3139; margin-top: 6px; padding-top: 6px; }
.content { padding-top: 22px; }
.accent-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.accent-swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong); cursor: pointer; display: grid; place-items: center; padding: 0; }
.accent-swatch.on { box-shadow: 0 0 0 2px var(--text); }

/* --- роли, участники, ВК */
.chip-admin { background: var(--st-progress-bg); color: var(--st-progress); }
.chip-ok { background: var(--st-done-bg); color: var(--st-done); }
.role-help { font-size: 13px; color: var(--text-2); display: flex; flex-direction: column; gap: 4px; }
.queue-chips { border: 1px dashed transparent; background: none; cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 6px; text-align: left; }
.queue-chips:hover { border-color: var(--border-strong); }
.member-row { gap: 10px; }
.vk-steps { margin: 4px 0 14px; padding-left: 20px; color: var(--text-2); font-size: 13px; line-height: 1.6; }
.vk-code-box { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.vk-code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 30px; letter-spacing: .25em; font-weight: 700; padding: 8px 18px; border-radius: 10px; background: var(--surface-3); cursor: pointer; user-select: all; }
.notify-pref { display: flex; margin: 5px 0; }

/* --- файлы задачи в кате */
.files-toggle { cursor: pointer; user-select: none; }
.files-caret::before { content: ''; display: inline-block; border-left: 6px solid var(--text-2); border-top: 4.5px solid transparent; border-bottom: 4.5px solid transparent; transition: transform .15s; }
.files-open .files-caret::before { transform: rotate(90deg); }
.issue-main > .block:not(.files-open) > .files-toggle { border-bottom: 0; margin-bottom: -6px; padding-bottom: 0; }

/* --- плеер видео и аудио */
.yfm-media { display: inline-flex; flex-direction: column; width: 100%; max-width: 380px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface-2); margin: 4px 0 8px; vertical-align: top; }
.yfm-media video { width: 100%; max-height: 240px; background: #000; display: block; }
/* ролик еще не подъехал к экрану (адрес не выдан) — место под него заранее, чтобы лента не прыгала */
.yfm-media video:not([src]) { aspect-ratio: 16 / 9; height: auto; }
.yfm-media.big { max-width: 100%; }
.yfm-media.big video { max-height: 80vh; }
.yfm-media audio { width: 100%; display: block; height: 42px; }
.yfm-media-bar { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; font-size: 12px; }
.yfm-media-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2) !important; }
.yfm-speed { border: 1px solid var(--border); background: var(--surface); border-radius: 6px; font-size: 12px; padding: 1px 4px; color: var(--text); cursor: pointer; }
.yfm-media-expand { border: 0; background: none; cursor: pointer; font-size: 16px; line-height: 1; color: var(--text-2); padding: 2px 4px; border-radius: 4px; }
.yfm-media-expand:hover { background: var(--surface-3); color: var(--text); }
.chat-bubble.has-media { max-width: min(92%, 440px); width: 100%; }
.chat-bubble .yfm-media { max-width: 100%; }

/* --- окно «Сообщения» */
.messenger-overlay { padding: 4vh 16px; align-items: stretch; }
.messenger { width: min(1120px, 100%); height: 88vh; margin: 0 auto; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); display: flex; overflow: hidden; }
.msgr-left { width: 330px; flex: none; border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.msgr-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.msgr-head svg:first-child { color: var(--link); }
.msgr-search { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.msgr-list { flex: 1; overflow-y: auto; }
.msgr-item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; color: var(--text); }
.msgr-item:hover { background: var(--surface-2); }
.msgr-item.active { background: var(--st-progress-bg); }
.msgr-item-top { display: flex; align-items: center; gap: 6px; }
.msgr-item-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 2px 0; font-weight: 500; }
.msgr-item.unread .msgr-item-title { font-weight: 700; }
.msgr-item-last { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.msgr-item-last .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgr-item-last .chat-badge { margin-left: 0; }
.msgr-right { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--surface-2); }
.msgr-placeholder { margin: auto; color: var(--text-3); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.msgr-chat-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.msgr-chat-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; min-width: 0; }
.msgr-back, .msgr-close-mobile { display: none !important; }
.msgr-close { position: fixed; top: 14px; right: 18px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--surface); box-shadow: var(--shadow); cursor: pointer; display: grid; place-items: center; color: var(--text); }
.chat-view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-view.drag { outline: 2px dashed var(--link); outline-offset: -6px; }
.chat-panel > .chat-view { border-radius: 0 0 12px 12px; overflow: hidden; }

/* --- карточка задачи: шапка и блоки */
.issue-main > .issue-head {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 12px;
  padding: 14px 18px 12px; margin-bottom: 16px;
}
.issue-head .issue-title { margin: 6px 0 12px; }
.issue-head .issue-actions { margin-bottom: 0; padding-top: 12px; border-top: 1px solid var(--border); }
.issue-actions-label { font-size: 12px; color: var(--text-3); margin-left: 6px; }
.issue-main > .block { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 18px 14px; margin-bottom: 14px; }
.issue-main > .block > .block-head { margin: -2px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.issue-main > .block > .block-head h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }
.issue-main > .block-tabs { padding-top: 4px; }
.issue-main > .block-tabs > .tabs { margin: 0 -18px 14px; padding: 0 12px; }

/* --- ответы на комментарии */
.thread { border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.thread:last-of-type { border-bottom: 0; }
.thread > .comment { border-bottom: 0; }
.comment-foot { margin-top: 4px; }
.reply-btn { border: 0; background: none; padding: 2px 0; color: var(--link); font-size: 12.5px; cursor: pointer; }
.reply-btn:hover { text-decoration: underline; }
.replies { margin: 0 0 10px 42px; padding-left: 14px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.comment.reply { padding: 0; border: 0; gap: 8px; }
.comment.reply .comment-body { background: var(--surface-2); border-radius: 4px 14px 14px 14px; padding: 8px 12px; }
.comment.reply .comment-head { margin-bottom: 2px; }
.reply-editor { display: flex; gap: 8px; align-items: flex-start; }

/* --- аватарки */
img.avatar { object-fit: cover; background: var(--surface-3); }
.avatar-control { display: flex; align-items: center; gap: 12px; }
.avatar-pick { position: relative; border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; }
.avatar-pick .avatar { width: 64px; height: 64px; font-size: 22px; }
.avatar-pick-hint { position: absolute; right: -2px; bottom: -2px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-2); }
.avatar-control .stack > * + * { margin-top: 4px; }

/* --- доска задачи */
.wb { position: relative; height: 560px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; resize: vertical; min-height: 320px; background: var(--surface); }
.wb.wb-full { position: fixed; inset: 0; height: auto !important; z-index: 95; border-radius: 0; border: 0; resize: none; }
body.wb-lock { overflow: hidden; }
body.wb-lock .chat-fab { display: none; }
.wb-viewport {
  position: absolute; inset: 0; overflow: hidden; outline: none; touch-action: none; cursor: default;
  background-color: var(--surface-2); background-image: radial-gradient(circle, var(--border-strong) 1px, transparent 1.3px);
}
.wb-viewport.panning, .wb-viewport.space { cursor: grab; }
.wb-viewport.panning { cursor: grabbing; }
.wb-viewport[data-tool="text"] { cursor: text; }
.wb-viewport[data-tool="sticky"], .wb-viewport[data-tool="rect"], .wb-viewport[data-tool="ellipse"], .wb-viewport[data-tool="diamond"],
.wb-viewport[data-tool="arrow"], .wb-viewport[data-tool="pen"] { cursor: crosshair; }
.wb-viewport.drop { outline: 3px dashed var(--link); outline-offset: -6px; }
.wb-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; width: 1px; height: 1px; }
.wb-svg { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.wb-svg g { pointer-events: auto; cursor: pointer; }
.wb-svg .hit { fill: none; stroke: transparent; stroke-width: 14; pointer-events: stroke; }
.wb-svg .line { fill: none; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.wb-arrow .line { stroke-width: 2.2; }
.wb-arrow.sel .line, .wb-pen.sel .line { filter: drop-shadow(0 0 3px rgba(47, 111, 222, .7)); }
.wb-els, .wb-labels, .wb-overlay { position: absolute; left: 0; top: 0; }
.wb-el { position: absolute; box-sizing: border-box; user-select: none; }
.wb-el.sel { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 6px; }
.wb-el.wb-target { outline: 3px solid var(--accent); outline-offset: 3px; }
.wb-txt { white-space: pre-wrap; overflow-wrap: anywhere; outline: none; line-height: 1.35; color: var(--text); min-height: 1.35em; }
.wb-txt[contenteditable="true"] { cursor: text; user-select: text; }
.wb-text .wb-txt { padding: 4px 6px; border-radius: 6px; }
.wb-text.editing .wb-txt { background: var(--surface); box-shadow: 0 0 0 2px var(--link); }
.wb-text .wb-txt:empty::before { content: 'Текст…'; color: var(--text-3); }
.wb-sticky { border-radius: 4px; box-shadow: 0 6px 14px rgba(0, 0, 0, .14); padding: 14px; display: flex; }
.wb-sticky .wb-txt { color: #2b2b2b; flex: 1; overflow: hidden; }
.wb-sticky .wb-txt:empty::before { content: 'Заметка…'; color: rgba(0, 0, 0, .35); }
.wb-rect, .wb-ellipse, .wb-diamond { display: flex; align-items: center; justify-content: center; text-align: center; }
.wb-shape { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.wb-rect .wb-txt, .wb-ellipse .wb-txt, .wb-diamond .wb-txt { position: relative; padding: 8px 14px; max-width: 100%; max-height: 100%; overflow: hidden; }
.wb-diamond .wb-txt { padding: 8px 22%; }
.wb-image img { width: 100%; height: 100%; display: block; border-radius: 4px; box-shadow: 0 2px 10px rgba(0, 0, 0, .15); pointer-events: none; }
.wb-file .wb-file-inner {
  display: flex; align-items: center; gap: 8px; height: 100%; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); color: var(--text) !important; text-decoration: none !important; box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}
.wb-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; font-size: 13px; }
.wb-file-size { font-size: 11px; color: var(--text-3); }
.wb-label { position: absolute; transform: translate(-50%, -50%); background: var(--surface); border-radius: 6px; padding: 2px 8px; font-size: 13px; box-shadow: 0 0 0 1px var(--border); max-width: 220px; }
.wb-label.sel { box-shadow: 0 0 0 2px var(--link); }
.wb-label .wb-txt:empty::before { content: 'Подпись…'; color: var(--text-3); }
.wb-handle { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 2px solid var(--link); cursor: nwse-resize; pointer-events: auto; }
.wb-handle.wb-end { cursor: move; background: var(--link); }
.wb-tools {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 2px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); z-index: 3;
}
.wb-tool { width: 36px; height: 36px; border: 0; background: none; border-radius: 8px; display: grid; place-items: center; cursor: pointer; color: var(--text-2); }
.wb-tool:hover { background: var(--surface-3); color: var(--text); }
.wb-tool.active { background: var(--accent); color: var(--accent-text); }
.wb-tools-sep { height: 1px; background: var(--border); margin: 4px 2px; }
.wb-tools-sep.v { width: 1px; height: 20px; margin: 0 4px; }
.wb-top {
  position: absolute; right: 12px; top: 12px; display: flex; align-items: center; gap: 2px; padding: 4px; z-index: 3;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow);
}
.wb-btn { min-width: 32px; height: 32px; border: 0; background: none; border-radius: 7px; cursor: pointer; color: var(--text-2); display: inline-grid; place-items: center; font-size: 18px; padding: 0 6px; }
.wb-btn:hover { background: var(--surface-3); color: var(--text); }
.wb-btn.danger:hover { color: var(--danger); }
.wb-zoom-label { border: 0; background: none; cursor: pointer; font-size: 12px; color: var(--text-2); width: 48px; height: 32px; border-radius: 7px; }
.wb-zoom-label:hover { background: var(--surface-3); }
.wb-status { font-size: 12px; color: var(--text-3); padding: 0 8px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-status:empty { display: none; }
.wb-ctx {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 5px 8px; z-index: 3;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); max-width: calc(100% - 24px); flex-wrap: wrap;
}
.wb-swatches, .wb-sizes { display: flex; gap: 4px; align-items: center; padding-right: 6px; border-right: 1px solid var(--border); }
.wb-swatch { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong); cursor: pointer; padding: 0; }
.wb-swatch.on { box-shadow: 0 0 0 2px var(--link); }
.wb-size { border: 1px solid var(--border); background: var(--surface); border-radius: 6px; font-size: 11.5px; padding: 2px 7px; cursor: pointer; color: var(--text-2); }
.wb-size.on { background: var(--text); color: var(--surface); border-color: var(--text); }
.wb-hint { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--text-3); pointer-events: none; text-align: center; padding: 20px; }
.wb-hint b { color: var(--text-2); font-size: 15px; }
@media (max-width: 760px) {
  .wb-tools { top: auto; bottom: 64px; transform: none; flex-direction: row; flex-wrap: wrap; max-width: calc(100% - 24px); }
  .wb-tools-sep { width: 1px; height: 24px; margin: 0 2px; }
}

/* --- чат задачи */
.chat-badge {
  display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; padding: 0 7px 0 5px; height: 20px; border-radius: 10px;
  background: var(--link); color: #fff !important; font-size: 11.5px; font-weight: 600; vertical-align: 1px; white-space: nowrap; text-decoration: none !important;
}
.chat-badge svg { width: 12px; height: 12px; }
.bcard .summary .chat-badge { margin-left: 6px; }
.chat-fab {
  position: fixed; right: 24px; bottom: 24px; width: 54px; height: 54px; border-radius: 50%; border: 0; z-index: 60;
  background: var(--accent); color: var(--accent-text); box-shadow: 0 6px 20px rgba(0, 0, 0, .25); cursor: pointer; display: grid; place-items: center;
  transition: transform .15s;
}
.chat-fab:hover { transform: scale(1.06); }
.chat-fab.active { background: var(--surface); color: var(--text); box-shadow: 0 6px 20px rgba(0, 0, 0, .25), 0 0 0 1px var(--border); }
.chat-fab-badge {
  position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--danger);
  color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg);
}
.chat-panel {
  position: fixed; right: 24px; bottom: 90px; z-index: 61; display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); min-width: 300px; min-height: 300px;
  max-width: calc(100vw - 32px); max-height: calc(100vh - 110px);
}
.chat-panel.big { width: min(760px, calc(100vw - 48px)) !important; height: calc(100vh - 120px) !important; }
.chat-panel.drag { outline: 2px dashed var(--link); outline-offset: -6px; }
.chat-grip { position: absolute; left: -2px; top: -2px; width: 18px; height: 18px; cursor: nwse-resize; z-index: 3; border-top-left-radius: 12px; }
.chat-grip::after { content: ''; position: absolute; left: 5px; top: 5px; width: 7px; height: 7px; border-left: 2px solid var(--border-strong); border-top: 2px solid var(--border-strong); border-top-left-radius: 3px; }
.chat-edge { position: absolute; z-index: 2; }
.chat-edge-l { left: -3px; top: 16px; bottom: 0; width: 7px; cursor: ew-resize; }
.chat-edge-t { top: -3px; left: 16px; right: 0; height: 7px; cursor: ns-resize; }
body.chat-resizing { user-select: none; cursor: nwse-resize; }
body.chat-resizing iframe, body.chat-resizing img { pointer-events: none; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--border); flex: none; }
.chat-head svg:first-child { color: var(--link); }
.chat-list { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; background: var(--surface-2); }
.chat-empty { margin: auto; text-align: center; color: var(--text-3); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px; }
.chat-more { align-self: center; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; font-size: 12px; padding: 3px 12px; cursor: pointer; color: var(--text-2); margin-bottom: 6px; }
.chat-day, .chat-new { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 11.5px; margin: 10px 0 6px; }
.chat-day::before, .chat-day::after, .chat-new::before, .chat-new::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.chat-new { color: var(--danger); }
.chat-new::before, .chat-new::after { background: var(--danger); opacity: .5; }
.chat-msg { display: flex; align-items: flex-end; gap: 8px; margin-top: 8px; max-width: 100%; }
.chat-msg.cont { margin-top: 2px; }
.chat-msg.mine { justify-content: flex-end; }
.chat-av-space { width: 24px; flex: none; }
.chat-bubble {
  max-width: min(78%, 520px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px 12px 12px 4px;
  padding: 6px 10px 4px; min-width: 70px; position: relative; overflow-wrap: anywhere;
}
.chat-msg.mine .chat-bubble { background: var(--st-progress-bg); border-color: transparent; border-radius: 12px 12px 4px 12px; }
.chat-author { font-size: 12px; font-weight: 600; color: var(--link); margin-bottom: 1px; }
.chat-text { line-height: 1.45; white-space: normal; }
.chat-text .mention { background: var(--surface-3); border-radius: 4px; padding: 0 3px; color: var(--link); }
.chat-text .mention.me { background: var(--accent); color: var(--accent-text); }
.chat-images { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin: 4px 0 2px; }
.chat-images.single { grid-template-columns: 1fr; }
.chat-images img { width: 100%; max-height: 220px; object-fit: cover; border-radius: 8px; cursor: zoom-in; display: block; background: var(--surface-3); }
.chat-images.single img { object-fit: contain; width: auto; max-width: 100%; }
.chat-file { display: flex; align-items: center; gap: 6px; padding: 5px 8px; margin: 4px 0 2px; border-radius: 8px; background: var(--surface-3); color: var(--text) !important; text-decoration: none !important; font-size: 13px; }
.chat-file:hover { background: var(--border); }
.chat-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-meta { display: flex; justify-content: flex-end; align-items: center; gap: 8px; font-size: 10.5px; color: var(--text-3); margin-top: 1px; }
.chat-del { border: 0; background: none; color: var(--text-3); font-size: 10.5px; cursor: pointer; padding: 0; opacity: 0; }
.chat-msg:hover .chat-del { opacity: 1; }
.chat-del:hover { color: var(--danger); }
.chat-compose { border-top: 1px solid var(--border); padding: 8px; position: relative; flex: none; }
.chat-compose-row { display: flex; align-items: flex-end; gap: 6px; }
.chat-typing { position: absolute; left: 10px; bottom: 100%; margin-bottom: 4px; padding: 2px 10px; border-radius: 10px; background: var(--surface, #fff); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); color: var(--text-2); font-size: 12px; display: flex; align-items: center; gap: 6px; z-index: 2; pointer-events: none; }
.chat-typing.hidden { display: none; }
.chat-typing-dots { display: inline-flex; gap: 3px; }
.chat-typing-dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: typing-dot 1.2s infinite; }
.chat-typing-dots i:nth-child(2) { animation-delay: .2s; }
.chat-typing-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes typing-dot { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }
/* «печатает…», «отправляет файл…», «записывает голосовое…» — как в Telegram */
.typing-line { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.msgr-seen.typing, .msgr-item-typing { color: var(--accent, #3b82f6); }
.msgr-item-typing { min-width: 0; overflow: hidden; }
.typing-anim { display: inline-flex; align-items: center; flex: none; }
.typing-anim.file { position: relative; width: 16px; height: 4px; border-radius: 2px; overflow: hidden; background: color-mix(in srgb, currentColor 25%, transparent); }
.typing-anim.file i { position: absolute; top: 0; bottom: 0; left: 0; width: 45%; border-radius: 2px; background: currentColor; animation: typing-file 1.1s ease-in-out infinite; }
@keyframes typing-file { 0% { transform: translateX(-100%); } 100% { transform: translateX(230%); } }
.typing-anim.voice { gap: 2px; height: 11px; }
.typing-anim.voice b { width: 6px; height: 6px; margin-right: 2px; border-radius: 50%; background: #ef4444; animation: typing-rec 1s ease-in-out infinite; }
.typing-anim.voice i { width: 2px; height: 100%; border-radius: 1px; background: currentColor; transform: scaleY(.35); animation: typing-wave .9s ease-in-out infinite; }
.typing-anim.voice i:nth-child(3) { animation-delay: .15s; }
.typing-anim.voice i:nth-child(4) { animation-delay: .3s; }
.typing-anim.voice i:nth-child(5) { animation-delay: .45s; }
@keyframes typing-wave { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
@keyframes typing-rec { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .typing-anim i, .typing-anim b { animation: none; } }
.chat-input {
  flex: 1; resize: none; border: 1px solid var(--border-strong); border-radius: 18px; padding: 8px 14px; background: var(--surface);
  outline: none; line-height: 1.4; min-height: 38px; overflow-y: hidden;
}
.chat-input:focus { border-color: #8fb1f0; box-shadow: 0 0 0 3px rgba(47, 111, 222, .15); }
.chat-attach, .chat-send { width: 38px; height: 38px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; flex: none; }
/* поле ввода со смайликом внутри справа, как в Telegram */
.chat-input-wrap { flex: 1; min-width: 0; position: relative; display: flex; }
.chat-input-wrap .chat-input { flex: 1; min-width: 0; padding-right: 40px; }
.chat-input-wrap .chat-emoji { position: absolute; right: 3px; bottom: 2px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: none;
  display: grid; place-items: center; cursor: pointer; color: var(--text-3); opacity: .85; padding: 0; }
.chat-input-wrap .chat-emoji:hover { color: var(--text-2); opacity: 1; }
/* кнопки «голосовое» и «отправить» — одного размера везде */
.chat-compose-row .chat-mic, .chat-compose-row .chat-send { width: 40px; height: 40px; min-width: 40px; border-radius: 50%; padding: 0; }
.chat-attach { background: none; color: var(--text-2); }
.chat-attach:hover { background: var(--surface-3); }
.chat-send { background: var(--accent); color: var(--accent-text); }
.chat-send:disabled { opacity: .5; }
.chat-send.busy { opacity: .6; pointer-events: none; }
/* новое сообщение плавно появляется снизу */
.chat-msg-in { animation: chat-msg-in .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes chat-msg-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .chat-msg-in { animation: none; } }
.chat-pending { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.chat-chip { display: flex; align-items: center; gap: 6px; background: var(--surface-3); border-radius: 8px; padding: 3px 4px 3px 4px; max-width: 220px; font-size: 12px; }
.chat-chip.uploading { opacity: .65; }
.chat-chip img { width: 32px; height: 32px; object-fit: cover; border-radius: 5px; }
.chat-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.chat-chip button { border: 0; background: none; cursor: pointer; color: var(--text-3); font-size: 15px; line-height: 1; padding: 0 4px; }
.chat-mention { left: 50px; top: auto; bottom: 100%; margin-bottom: 4px; }
.chat-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text) !important; text-decoration: none !important; }
.chat-row:last-child { border-bottom: 0; }
.chat-row:hover { background: var(--surface-2); }
.chat-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-row-title, .chat-row-last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
  .chat-panel { right: 8px; left: 8px; bottom: 80px; width: auto !important; height: calc(100vh - 140px) !important; }
  .chat-grip, .chat-edge { display: none; }
  .chat-fab { right: 16px; bottom: 16px; }
}

/* --- файлы задачи */
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 8px; }
.thumb { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.thumb img { width: 100%; height: 110px; object-fit: cover; display: block; cursor: zoom-in; background: var(--surface-3); }
.thumb-bar { display: flex; align-items: center; gap: 0; padding: 2px 2px 2px 8px; font-size: 12px; }
.thumb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.dropzone { border: 1.5px dashed var(--border-strong); border-radius: 8px; padding: 14px; text-align: center; color: var(--text-3); font-size: 13px; cursor: pointer; }
.dropzone:hover { border-color: var(--link); color: var(--text-2); }
.block.drag { outline: 2px dashed var(--link); outline-offset: 4px; border-radius: 8px; }

@media (max-width: 1000px) {
  .issue-layout { grid-template-columns: 1fr; }
  .params { position: static; max-height: none; overflow: visible; }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  /* на телефоне меню всегда в виде узкой полосы со значками */
  .layout .sidebar { width: 52px; }
  .layout .nav-label, .layout .nav-section { display: none; }
  .layout .nav a, .layout .nav button { justify-content: center; padding: 9px 0; }
  .layout .brand { justify-content: center; padding: 14px 0 10px; }
  .layout .nav { padding: 4px; }
  .layout .badge-count { position: absolute; top: 1px; right: 2px; margin: 0; font-size: 10px; padding: 0 4px; line-height: 15px; }
  .nav-collapse { display: none !important; }
  .messenger { height: calc(100vh - 24px); }
  .messenger-overlay { padding: 12px 8px; }
  .msgr-left { width: 100%; border-right: 0; }
  .messenger.has-active .msgr-left { display: none; }
  .messenger:not(.has-active) .msgr-right { display: none; }
  /* телефон: переписка въезжает справа, список при возврате — слева, как в мессенджерах */
  .messenger.has-active .msgr-right { animation: msgr-in-right .2s cubic-bezier(.2, .8, .2, 1); }
  .messenger:not(.has-active) .msgr-left { animation: msgr-in-left .2s cubic-bezier(.2, .8, .2, 1); }
  .msgr-back, .msgr-close-mobile { display: inline-flex !important; }
  .msgr-close { display: none; }
  .content { padding: 16px; }
  .global-search { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .param { grid-template-columns: 110px minmax(0, 1fr); }
  .notif-panel { left: 16px; right: 16px; width: auto; }
}

/* ---------- избранное и сроки */
.star-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 0; background: none; border-radius: 6px; color: var(--text-3); cursor: pointer; flex: none; }
.star-btn.small { width: 24px; height: 24px; }
.star-btn:hover { background: var(--surface-3); color: var(--text-2); }
.star-btn.on { color: #f5b301; }
.fav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.fav-card { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; color: var(--text); text-decoration: none; min-height: 132px; transition: box-shadow .15s, transform .15s; }
.fav-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); text-decoration: none; }
.fav-title { font-weight: 600; line-height: 1.35; }
.fav-board { border-top: 3px solid var(--accent); }
.fav-board-stats { display: flex; align-items: baseline; gap: 6px; margin-top: auto; }
.fav-big { font-size: 26px; font-weight: 700; }
.life { display: flex; flex-direction: column; gap: 3px; min-width: 120px; }
.life-track { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.life-fill { height: 100%; border-radius: 99px; transition: width .6s ease; }
.life.overdue .life-fill { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.25) 0 6px, transparent 6px 12px) !important; animation: life-move 1s linear infinite; background-size: 17px 17px; }
@keyframes life-move { to { background-position: 17px 0; } }
.life-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); }
.life.overdue .life-meta { color: var(--danger); font-weight: 600; }
.life-pct { font-variant-numeric: tabular-nums; font-weight: 600; }
.life-list { padding: 4px 0; }
.life-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px 200px; gap: 14px; align-items: center; padding: 9px 14px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.life-row:last-child { border-bottom: 0; }
.life-row:hover { background: var(--surface-2); text-decoration: none; }
.life-row-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.life-row-sum { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.param-life { display: grid; gap: 4px; margin: -4px 0 6px; }
@media (max-width: 640px) { .life-row { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- поиск: фильтры и массовые действия */
.filter-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 99px; background: var(--surface); color: var(--text); cursor: pointer; font: inherit; font-size: 13px; }
.filter-chip:hover { background: var(--surface-2); }
.filter-chip.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--surface)); font-weight: 600; }
.filter-pop { width: 280px; max-height: 380px; display: flex; flex-direction: column; padding: 8px; }
.filter-options { overflow: auto; display: flex; flex-direction: column; }
.filter-options label { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; cursor: pointer; }
.filter-options label:hover { background: var(--surface-2); }
.bulk-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin-bottom: 10px; border-radius: 8px; background: var(--sidebar); color: #fff; box-shadow: var(--shadow); }
.bulk-bar.hidden { display: none; }
.sel-col { width: 34px; text-align: center; }
table.issues tr.picked td { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }

/* ---------- эмодзи и реакции */
.emoji-pop { width: 344px; padding: 0; display: flex; flex-direction: column; }
.emoji-tabs { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.emoji-tab { border: 0; background: none; border-radius: 6px; font-size: 18px; width: 32px; height: 32px; cursor: pointer; flex: none; opacity: .65; }
.emoji-tab:hover, .emoji-tab.active { background: var(--surface-3); opacity: 1; }
.emoji-title { padding: 6px 10px 2px; font-size: 12px; color: var(--text-3); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); padding: 4px 6px 8px; height: 260px; overflow-y: auto; align-content: start; }
.emoji-btn { border: 0; background: none; border-radius: 6px; font-size: 22px; height: 38px; cursor: pointer; line-height: 1; }
.emoji-btn:hover { background: var(--surface-3); transform: scale(1.12); }
.emoji-btn.more { font-size: 16px; color: var(--text-2); }
.reaction-pop { display: flex; padding: 4px; border-radius: 99px; }
.reactions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.reaction { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px; border: 1px solid var(--border); border-radius: 99px; background: var(--surface-2); cursor: pointer; font: inherit; font-size: 13px; color: var(--text); }
.reaction:hover { border-color: var(--border-strong); }
.reaction.mine { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 20%, var(--surface)); }
.reaction-emoji { font-size: 15px; }
.reaction-count { font-weight: 600; }
.reaction-who { display: inline-flex; }
.reaction-who .avatar { width: 16px !important; height: 16px !important; font-size: 8px; margin-left: -4px; border: 1px solid var(--surface); }
.reaction-add { height: 26px; padding: 0 8px; border: 1px dashed var(--border-strong); border-radius: 99px; background: none; color: var(--text-3); cursor: pointer; font-size: 12px; }
.reaction-add:hover { color: var(--text); border-style: solid; }
.tb-emoji, .chat-emoji { font-size: 16px; line-height: 1; }
.chip-bot { background: #e9e3ff; color: #5a3fc0; }

/* ---------- вкладки в визуальном редакторе и заголовки */
.ve-tabs-head { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--border); }
.ve-tab { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border-bottom: 2px solid transparent; cursor: pointer; color: var(--text-2); }
.ve-tab.active { border-bottom-color: var(--accent); color: var(--text); font-weight: 600; }
.ve-tab-title { outline: none; min-width: 20px; }
.ve-tab-del { border: 0; background: none; color: var(--text-3); cursor: pointer; padding: 0 2px; visibility: hidden; }
.ve-tab:hover .ve-tab-del { visibility: visible; }
.ve-tab-add { border: 0; background: none; color: var(--text-3); cursor: pointer; padding: 6px 10px; }
.ve-tab-add:hover { color: var(--text); }
.ve-tab-panel { display: none; padding: 8px 2px; outline: none; }
.ve-tab-panel.active { display: block; }
.md h1 { font-size: 26px; } .md h2 { font-size: 22px; } .md h3 { font-size: 18px; } .md h4 { font-size: 16px; } .md h5 { font-size: 14px; text-transform: uppercase; letter-spacing: .03em; }

/* ---------- размер задачи */
.size-block { padding-top: 10px; }
.size-head { display: flex; align-items: center; gap: 6px; width: 100%; padding: 4px 0; border: 0; background: none; color: var(--text-2); font: inherit; cursor: pointer; text-align: left; }
.size-head:hover { color: var(--text); }
.size-head svg { transform: rotate(-90deg); transition: transform .15s; }
.size-head.open svg { transform: none; }
.size-head b { color: var(--text); }
.size-parts { display: flex; flex-direction: column; gap: 6px; padding: 6px 0 2px 18px; }
.size-parts.hidden { display: none; }
.size-part { display: flex; flex-wrap: wrap; gap: 2px 8px; color: var(--text-2); }
.size-bar { flex-basis: 100%; height: 4px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.size-bar > div { height: 100%; border-radius: 99px; background: var(--accent); }

/* ---------- редактор документов (OnlyOffice) */
.office-overlay { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; background: var(--bg); }
.office-head { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px; border-bottom: 1px solid var(--border); background: var(--surface); flex: none; }
.office-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 50vw; }
.office-body { flex: 1; min-height: 0; }
.office-body > div { width: 100%; height: 100%; }
.office-body iframe { display: block; border: 0; }

/* ---------- плеер: статус сжатия и полный экран */
.yfm-media-state { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.yfm-media-state.busy { color: var(--st-progress); }
.yfm-media-state.busy::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 4px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; vertical-align: -1px; animation: spin .9s linear infinite; }
.yfm-media-state.done { color: var(--ok); }
@keyframes spin { to { transform: rotate(360deg); } }
.yfm-media-full { border: 0; background: none; cursor: pointer; font-size: 15px; line-height: 1; color: var(--text-2); padding: 2px 4px; border-radius: 4px; }
.yfm-media-full:hover { background: var(--surface-3); color: var(--text); }
.yfm-media video:fullscreen { max-height: none; width: 100%; height: 100%; object-fit: contain; }

/* ---------- личные сообщения и карточка пользователя */
.msgr-tabs { display: flex; gap: 4px; padding: 0 12px 8px; }
.msgr-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 28px; border: 1px solid var(--border); border-radius: 99px; background: var(--surface); color: var(--text-2); font: inherit; font-size: 12px; cursor: pointer; }
.msgr-tabs button.active { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.msgr-tab-dot { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 10px; line-height: 16px; }
.msgr-item.dm .msgr-item-top { gap: 8px; }
.msgr-item.dm .avatar { width: 26px; height: 26px; font-size: 11px; }
.msgr-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-read { margin-left: 4px; color: var(--text-3); letter-spacing: -2px; }
.chat-read.seen { color: var(--link); }
.popover.menu { max-height: 60vh; overflow-y: auto; }
.user-name, [data-uid].chat-author, .msgr-chat-title[data-uid] { cursor: default; }
.user-name:hover, .chat-author[data-uid]:hover { text-decoration: underline dotted; }
.user-card { width: 270px; padding: 14px; display: flex; flex-direction: column; gap: 10px; z-index: 300; }
.user-card-top { display: flex; gap: 12px; align-items: center; }
.user-card-photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 22px; }
.user-card-id { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.user-card-name { font-weight: 700; font-size: 15px; line-height: 1.25; }
a.user-card-name { display: block; color: var(--text); text-decoration: none; cursor: pointer; }
a.user-card-name:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.user-card-staff { color: var(--text-2); font-weight: 400; }
.user-card-photo.link { cursor: pointer; }
/* ---------------- редактор фото (imgedit.js): стрелки, текст, фигуры, маркер, размытие, обрезка */
/* окно поверх трекера: перетаскивается за заголовок, размер — за край и угол; .max — во весь экран, .full — телефон */
.ie-overlay { position: fixed; z-index: 3000; display: flex; flex-direction: column; background: #1b1d22; color: #e8eaee; outline: none;
  border-radius: 12px; overflow: hidden; box-shadow: 0 18px 60px rgb(0 0 0 / .5), 0 0 0 1px rgb(255 255 255 / .08); min-width: 360px; min-height: 300px; }
.ie-overlay.max, .ie-overlay.full { inset: 0 !important; width: auto !important; height: auto !important; border-radius: 0; }
.ie-title { display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 12px; background: #24262c; color: #e8eaee; cursor: move; user-select: none; touch-action: none; font-size: 13px; }
.ie-overlay.max .ie-title, .ie-overlay.full .ie-title { cursor: default; }
.ie-title-ic { display: inline-grid; color: #ffcc00; }
.ie-title-t { font-weight: 600; }
.ie-wbtn { width: 28px; height: 26px; border: 0; border-radius: 6px; background: none; color: #c3c7cf; display: grid; place-items: center; cursor: pointer; }
.ie-wbtn:hover { background: rgb(255 255 255 / .1); color: #fff; }
.ie-overlay.full .ie-wbtn:first-of-type { display: none; }
.ie-grip { position: absolute; z-index: 5; touch-action: none; }
.ie-grip-e { top: 40px; right: 0; bottom: 14px; width: 8px; cursor: ew-resize; }
.ie-grip-s { left: 0; right: 14px; bottom: 0; height: 8px; cursor: ns-resize; }
.ie-grip-se { right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, rgb(255 255 255 / .35) 50% 58%, transparent 58% 70%, rgb(255 255 255 / .35) 70% 78%, transparent 78%); }
.ie-overlay.max .ie-grip, .ie-overlay.full .ie-grip { display: none; }
.ie-top { display: flex; align-items: center; gap: 4px; padding: 6px 8px; background: #f3f4f6; color: #111; flex-wrap: wrap; }
.ie-tools { display: flex; gap: 2px; flex-wrap: wrap; }
.ie-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; background: none; color: inherit; border-radius: 6px; padding: 6px 10px; font: inherit; font-size: 14px; cursor: pointer; }
.ie-btn:hover { background: rgb(0 0 0 / .06); }
.ie-btn.on { background: #dbeafe; border-color: #93c5fd; }
.ie-btn:disabled { opacity: .35; cursor: default; }
.ie-btn.icon { padding: 6px; }
.ie-btn.primary { background: #ffcc00; color: #111; font-weight: 600; }
.ie-btn.primary:hover { background: #f5c400; }
.ie-btn.sm { padding: 4px 9px; font-size: 13px; }
.ie-ic { display: inline-grid; }
.ie-sep { width: 1px; height: 26px; background: #d1d5db; margin: 0 4px; }
.ie-space { flex: 1; }
.ie-opts { display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: #3a3d44; color: #e8eaee; flex-wrap: wrap; min-height: 42px; }
.ie-opts .ie-btn:hover { background: rgb(255 255 255 / .1); }
.ie-opts .ie-btn.on { background: #1f2937; border-color: #6b7280; }
.ie-seg { display: inline-flex; gap: 2px; background: #2a2c31; border-radius: 7px; padding: 2px; }
.ie-w { display: inline-block; width: 26px; background: currentColor; border-radius: 3px; }
.ie-colors { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.ie-color { width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgb(255 255 255 / .25); cursor: pointer; padding: 0; }
.ie-color.on { box-shadow: 0 0 0 2px #3a3d44, 0 0 0 4px #fff; }
.ie-hint { font-size: 13px; color: #c3c7cf; }
.ie-stage { position: relative; flex: 1; min-height: 0; overflow: auto; display: grid; place-items: center; padding: 16px; background: #c9d2dc; }
.ie-canvas { max-width: 100%; max-height: 100%; touch-action: none; box-shadow: 0 6px 30px rgb(0 0 0 / .35); cursor: crosshair; background: #fff; }
.ie-stage[data-tool="text"] .ie-canvas { cursor: text; }
.ie-text { position: absolute; z-index: 2; min-width: 60px; border: 1px dashed #fff; outline: 1px dashed rgb(0 0 0 / .5); background: rgb(255 255 255 / .12);
  font-weight: 700; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; line-height: 1.2; padding: 0; resize: none; overflow: hidden; white-space: pre; }
.ie-hover { position: fixed; z-index: 120; width: 32px; height: 32px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: rgb(20 22 26 / .78); color: #fff; box-shadow: 0 2px 8px rgb(0 0 0 / .35); }
.ie-hover:hover, .send-cell .send-edit:hover { background: var(--accent); color: var(--accent-text, #000); }
.send-cell .send-edit { position: absolute; left: 6px; top: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: rgb(20 22 26 / .72); color: #fff; cursor: pointer; }
.chat-chip .chip-edit { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 2px; display: inline-grid; }
@media (max-width: 760px) {
  .ie-lbl { display: none; }
  .ie-btn { padding: 7px 8px; }
  .ie-colors { margin-left: 0; }
  .ie-stage { padding: 8px; }
}
/* VS Code в трекере (/ide) */
.ide-page { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.ide-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ide-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ide-logo { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, #2f80ed, #1b5fc1); flex: none; }
.ide-on { color: #3dd68c; }
.user-card-login { align-self: flex-start; border: 0; background: none; padding: 0; color: var(--link); font-size: 12px; cursor: pointer; }
.user-card-login:hover { text-decoration: underline; }
.user-card-role { font-size: 12px; color: var(--text-3); }
.user-card-queues { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.user-card-write { justify-content: center; }

/* ---------- тексты уведомлений */
.texts-page { max-width: 820px; padding-bottom: 70px; }
.texts-item { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-top: 1px solid var(--border); }
.texts-item:first-of-type { border-top: 0; }
.texts-input { font-family: inherit; resize: vertical; min-height: 52px; }
.texts-vars { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.texts-var { display: inline-flex; gap: 6px; align-items: baseline; border: 1px solid var(--border); background: var(--surface-2); border-radius: 6px; padding: 2px 8px; font-size: 12px; cursor: pointer; color: var(--text); }
.texts-var:hover { border-color: var(--accent); }
.texts-var span { color: var(--text-3); font-size: 11px; }
.texts-preview-wrap { display: flex; flex-direction: column; gap: 2px; }
.texts-preview { white-space: pre-wrap; font-size: 13px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); border-left: 3px solid var(--accent); }
.texts-save { position: sticky; bottom: 12px; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow); }
.texts-save.hidden { display: none; }
@media (max-width: 640px) { .texts-var span { display: none; } }

/* =================================================================== телефон: нижняя панель вместо бокового меню */
.mob-only { display: none !important; }
.mob-sheet-overlay { position: fixed; inset: 0; z-index: 150; background: rgba(0, 0, 0, .45); display: flex; align-items: flex-end; animation: fade-in .15s; }
.mob-sheet { width: 100%; max-height: 85vh; overflow-y: auto; background: var(--surface); border-radius: 16px 16px 0 0; padding: 6px 10px calc(12px + env(safe-area-inset-bottom)); animation: sheet-up .2s ease-out; }
.mob-sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 4px auto 10px; }
.mob-sheet-user { display: flex; gap: 12px; align-items: center; padding: 6px 8px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.mob-sheet-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 10px; border: 0; background: none; border-radius: 10px; color: var(--text); font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.mob-sheet-item:active, .mob-sheet-item.active { background: var(--surface-3); }
.mob-sheet-item svg { width: 20px; height: 20px; color: var(--text-2); flex: none; }
.mob-sheet-item .avatar { width: 22px; height: 22px; font-size: 10px; }
.mob-sheet-item .badge-count { margin-left: auto; }
.mob-sheet-title { padding: 12px 10px 4px; font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes msgr-in-right { from { opacity: .4; transform: translateX(32px); } to { opacity: 1; transform: none; } }
@keyframes msgr-in-left { from { opacity: .4; transform: translateX(-32px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .messenger .msgr-right, .messenger .msgr-left { animation: none !important; } }

@media (max-width: 760px) {
  html { -webkit-text-size-adjust: 100%; }
  body { overflow-x: hidden; }
  .mob-only { display: flex !important; }
  .mob-hide { display: none !important; }
  .layout { display: block; min-height: 100vh; }
  .layout .sidebar, .layout.collapsed .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: 100% !important; height: calc(58px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom); flex-direction: row; z-index: 80; overflow: visible; transition: none;
    border-top: 1px solid #2c3139; box-shadow: 0 -4px 16px rgba(0, 0, 0, .18);
  }
  .layout .brand, .layout .sidebar-bottom, .layout .nav-section, .layout .nav-filters, .nav-collapse { display: none !important; }
  .layout .nav, .layout.collapsed .nav { display: flex; flex-direction: row; width: 100%; padding: 0 4px; gap: 0; align-items: stretch; }
  .layout .nav a, .layout .nav button, .layout.collapsed .nav a, .layout.collapsed .nav button {
    flex: 1 1 0; min-width: 0; flex-direction: column; gap: 3px; padding: 7px 0 5px !important; justify-content: center; align-items: center;
    border-radius: 10px; margin: 4px 0;
  }
  .layout .nav svg { width: 21px; height: 21px; }
  .layout .nav-label, .layout.collapsed .nav-label { display: block !important; font-size: 10.5px; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .layout .badge-count, .layout.collapsed .badge-count { position: absolute; top: 2px; left: calc(50% + 5px); right: auto; margin: 0; font-size: 10px; padding: 0 5px; line-height: 16px; min-width: 16px; text-align: center; }
  .main { min-height: 100vh; }
  .content, .content.wide { padding: 12px 12px calc(78px + env(safe-area-inset-bottom)) !important; }

  /* заголовки и кнопки */
  .page-head { gap: 8px; margin-bottom: 12px; }
  .page-head h1 { font-size: 21px; line-height: 1.25; }
  .page-head .btn.primary { margin-left: auto; }
  h2 { font-size: 16px; }
  .tabs { overflow-x: auto; scrollbar-width: none; white-space: nowrap; flex-wrap: nowrap; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: none; }
  .input, select.input, textarea.input { font-size: 16px; } /* иначе iPhone приближает страницу при вводе */

  /* главная */
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
  .tile { padding: 10px 12px; }
  .tile .num { font-size: 22px; }
  .fav-grid { grid-template-columns: 1fr; }
  .fav-card { min-height: 0; }

  /* таблицы прокручиваются внутри своей карточки, а не всей страницей */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.issues { min-width: 520px; }
  table.issues th, table.issues td { padding: 8px 8px; }

  /* чат задачи и всплывающие окна над нижней панелью */
  .chat-fab { right: 14px; bottom: calc(70px + env(safe-area-inset-bottom)); width: 50px; height: 50px; }
  .chat-panel { left: 6px; right: 6px; top: 8px; bottom: calc(66px + env(safe-area-inset-bottom)); width: auto !important; height: auto !important; max-height: none; border-radius: 12px; }
  .popover.notif-panel { position: fixed; left: 8px !important; right: 8px; top: auto !important; bottom: calc(66px + env(safe-area-inset-bottom)); width: auto; max-height: 70vh; overflow-y: auto; z-index: 90; }
  .messenger-overlay { padding: 0 !important; }
  .messenger { height: 100vh; height: 100dvh; max-height: none; width: 100%; border-radius: 0; }
  /* окна на телефоне: не выше экрана; заголовок и кнопки на месте, прокручивается только содержимое
     (раньше длинное окно «вытекало» за свой фон — текст поверх страницы, кнопки поверх нижнего меню) */
  .modal { width: calc(100vw - 16px) !important; max-width: none; max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); display: flex; flex-direction: column; overflow: hidden; }
  .modal-head, .modal-foot { flex: none; }
  .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .modal-foot { padding-top: 10px; border-top: 1px solid var(--border); flex-wrap: wrap; }
  .overlay { padding: 8px; align-items: center; overflow: hidden; }
  .user-card { width: min(300px, calc(100vw - 16px)); }
  .emoji-pop { width: calc(100vw - 16px) !important; left: 8px !important; }
  .emoji-grid { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); }
  .filter-pop { width: calc(100vw - 24px); left: 12px !important; }
  .bulk-bar { flex-wrap: wrap; position: sticky; top: 0; }
  .office-head { padding: 0 8px; gap: 6px; }
  .office-head .small { display: none; }
}

/* телефон: строки таблицы задач превращаются в карточки */
@media (max-width: 760px) {
  table.issues { min-width: 0 !important; width: 100%; }
  table.issues thead { display: none; }
  table.issues tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
  table.issues tbody tr:last-child { border-bottom: 0; }
  table.issues tbody td { display: block; padding: 0 !important; border: 0 !important; background: none !important; }
  table.issues td.sel-col { order: 0; width: auto; }
  table.issues td[data-col="type"] { order: 0; width: auto !important; }
  table.issues td[data-col="key"] { order: 0; font-size: 12px; }
  table.issues td[data-col="summary"] { order: 1; flex-basis: 100%; font-weight: 500; line-height: 1.35; white-space: normal; }
  table.issues td[data-col="status"] { order: 0; margin-left: auto; }
  table.issues td[data-col="priority"], table.issues td[data-col="assignee"], table.issues td[data-col="deadline"],
  table.issues td[data-col="updated"] { order: 2; font-size: 12px; color: var(--text-2); }
  table.issues td[data-col="assignee"] .avatar { width: 18px; height: 18px; font-size: 9px; }
  table.issues td[data-col="deadline"]:has(.faint) { display: none; }
  table.issues tbody tr.picked { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
}

/* телефон: поиск задач */
@media (max-width: 760px) {
  .quick-filters, .filter-bar { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; margin-left: -12px; margin-right: -12px; padding: 0 12px 2px; }
  .quick-filters::-webkit-scrollbar, .filter-bar::-webkit-scrollbar { display: none; }
  .quick-filters > *, .filter-bar > * { flex: none; }
  .query-bar { flex-wrap: wrap; }
  .query-bar .query { flex: 1 1 100%; min-width: 0; }
  .query-bar .btn.primary { flex: 1; justify-content: center; }
}

/* сетки не должны распираться содержимым (длинные вкладки, таблицы, код) */
.issue-layout > *, .two-col > *, .grid-cards > *, .stack > * { min-width: 0; }
@media (max-width: 1000px) {
  .issue-layout { grid-template-columns: minmax(0, 1fr) !important; }
  .two-col { grid-template-columns: minmax(0, 1fr) !important; }
}
@media (max-width: 760px) {
  .issue-actions { flex-wrap: wrap; gap: 6px; }
  .issue-title, .issue-title h1 { font-size: 20px; line-height: 1.3; overflow-wrap: anywhere; }
  .md pre, .md table { max-width: 100%; overflow-x: auto; }
  .md img { max-width: 100%; height: auto; }
  .comment-body { min-width: 0; }
  .yfm-media { max-width: 100%; }
}

/* телефон: редактор текста — режимы сверху, кнопки одной прокручиваемой строкой */
@media (max-width: 760px) {
  .editor-head { flex-direction: column; align-items: stretch !important; gap: 4px; padding: 6px !important; }
  .editor-head .ed-modes { align-self: flex-start; }
  .editor-toolbar { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; justify-content: flex-start !important; padding-bottom: 2px; }
  .editor-toolbar::-webkit-scrollbar { display: none; }
  .editor-toolbar > * { flex: none; }
  .editor-toolbar button { width: 34px; height: 34px; }
  .editor-foot { flex-wrap: wrap; }
  .editor-foot .faint, .editor-foot .small { display: none; }
  .row:has(> .grow > .editor) > .avatar { display: none; }
}

/* телефон: колонки доски листаются пальцем по одной */
@media (max-width: 760px) {
  .board { scroll-snap-type: x mandatory; margin: 0 -12px; padding: 0 12px 8px; scroll-padding: 0 12px; gap: 10px; }
  .board > .column { flex: 0 0 82vw !important; width: 82vw !important; max-width: 82vw; scroll-snap-align: start; }
}

/* телефон: шапка профиля и мелочи */
@media (max-width: 760px) {
  .stack > .row:has(> .avatar-control) { flex-direction: column; align-items: flex-start; gap: 10px; }
  .stack > .row:has(> .avatar-control) h1 { font-size: 22px; }
  .notify-pref { align-items: flex-start; }
  .comment-head { flex-wrap: wrap; row-gap: 2px; }
  .comment-head .btn.sm { padding: 0 6px; height: 26px; }
  .accent-picker { gap: 6px; }
  .login-card { width: calc(100vw - 24px); padding: 20px; }
}

/* ---------- аватар: фото фоном, точка «в сети» */
.avatar { position: relative; overflow: visible !important; flex: none; }
.avatar.photo { background-size: cover; background-position: center; background-color: var(--surface-3); }
.avatar.online::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 32%; height: 32%; min-width: 7px; min-height: 7px; max-width: 12px; max-height: 12px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 2px var(--surface); }
.user-card-seen { font-size: 12px; color: var(--text-3); }
.user-card-seen.on { color: #22c55e; font-weight: 600; }
.msgr-chat-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.staff-pick-list { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow-y: auto; }
.staff-pick-row { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; background: var(--surface-2); font-size: 13.5px; }
.staff-pick-row .avatar { width: 24px; height: 24px; font-size: 10px; }
/* обратный отсчет до «Конца» задачи — плавающая карточка поверх страницы */
.cd-widget { position: fixed; z-index: 900; top: 76px; right: 20px; min-width: 210px; padding: 8px 12px 10px; border-radius: 14px;
  color: #f2f4f8; background: rgba(24, 27, 34, .9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35); font-variant-numeric: tabular-nums; user-select: none; }
.cd-head { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #aeb5c2; cursor: move; margin: -2px -4px 2px 0; }
.cd-ic { font-size: 14px; }
.cd-btn { border: 0; background: none; color: #aeb5c2; width: 22px; height: 22px; border-radius: 6px; cursor: pointer; font-size: 14px; line-height: 1; }
.cd-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.cd-label { font-size: 11px; color: #9aa3b2; text-transform: uppercase; letter-spacing: .04em; }
.cd-big { font-size: 30px; font-weight: 700; letter-spacing: .01em; line-height: 1.15; white-space: nowrap; }
.cd-sub { font-size: 12px; color: #aeb5c2; margin-top: 2px; }
.cd-widget.late .cd-big { color: #ff6b6f; }
.cd-widget.late { box-shadow: 0 10px 30px rgba(0, 0, 0, .35), 0 0 0 1px rgba(229, 72, 77, .55); }
.cd-widget.min { min-width: 0; padding: 6px 10px; }
.cd-widget.min .cd-head { margin: 0; }
.cd-widget.min .cd-big { font-size: 17px; }
.cd-widget.min { display: flex; align-items: center; gap: 8px; flex-direction: row-reverse; }
@media (max-width: 760px) {
  .cd-widget { top: auto; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); min-width: 0; }
  .cd-big { font-size: 22px; }
}
/* выбор сообщений галочками (как в Telegram): кружок слева, выбранное — с фоном; внизу полоса вместо поля ввода */
.chat-view.selecting .chat-compose { display: none; }
.chat-select-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--surface); }
.chat-select-bar.hidden { display: none; }
.chat-view.selecting .chat-msg { position: relative; padding-left: 34px; cursor: pointer; border-radius: 10px; }
.chat-view.selecting .chat-msg::before { content: ''; position: absolute; left: 8px; top: 50%; width: 18px; height: 18px; margin-top: -9px;
  border-radius: 50%; border: 2px solid var(--text-3); background: var(--surface); box-sizing: border-box; }
.chat-view.selecting .chat-msg.sel { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.chat-view.selecting .chat-msg.sel::before { border-color: var(--accent); background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4L18 8.5'/%3E%3C/svg%3E") center / 12px no-repeat; }
.chat-view.selecting .chat-hover { display: none !important; }
.chat-view.selecting .chat-msg * { user-select: none; }

/* ---------- звонки (calls.js) */
.call-btns { display: inline-flex; align-items: center; gap: 2px; }
.call-join-btn { background: #2fa84f; color: #fff; border-color: transparent; gap: 6px; animation: call-pulse 1.6s ease-in-out infinite; }
.call-join-btn:hover { background: #28923f; }
.call-join-btn.on { animation: none; }
@keyframes call-pulse { 50% { box-shadow: 0 0 0 5px rgba(47, 168, 79, .25); } }
.call-round { width: 52px; height: 52px; border-radius: 50%; border: 0; display: inline-grid; place-items: center; cursor: pointer;
  background: rgba(255, 255, 255, .16); color: #fff; transition: background .15s, transform .1s; flex: none; }
.call-round:hover { background: rgba(255, 255, 255, .26); }
.call-round:active { transform: scale(.94); }
.call-round.off { background: #fff; color: #1c1f24; }
.call-round.call-active { background: #3e7bfa; color: #fff; }
.call-round.call-red { background: #e5484d; color: #fff; }
.call-round.call-red:hover { background: #d63e43; }
.call-round.call-green { background: #2fa84f; color: #fff; }
.call-round.call-green:hover { background: #28923f; }

.call-incoming { position: fixed; z-index: 10050; top: 16px; left: 50%; transform: translateX(-50%); width: min(420px, calc(100vw - 24px));
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; color: #fff;
  background: rgba(28, 31, 38, .94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
  animation: call-in .25s ease; }
@keyframes call-in { from { opacity: 0; transform: translate(-50%, -12px); } }
.call-in-av .avatar { width: 48px; height: 48px; font-size: 20px; animation: call-ring 1.2s ease-in-out infinite; }
@keyframes call-ring { 50% { box-shadow: 0 0 0 7px rgba(47, 168, 79, .35); } }
.call-in-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.call-in-text b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.call-in-text span { color: #c9ced8; font-size: 13px; }
.call-in-btns { display: flex; gap: 8px; }
.call-in-btns .call-round { width: 44px; height: 44px; }

.call-win { position: fixed; z-index: 10040; right: 20px; bottom: 20px; width: min(760px, calc(100vw - 40px)); height: min(500px, calc(100vh - 40px));
  display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; color: #fff; background: #15171c;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .5); resize: both; min-width: 320px; min-height: 260px; }
.call-win.hidden { display: none; }
.call-win.call-big { inset: 16px !important; width: auto; height: auto; resize: none; }
.call-head { display: flex; align-items: center; gap: 6px; padding: 10px 12px 6px 16px; cursor: move; user-select: none; }
.call-phone .call-head, .call-big .call-head { cursor: default; }
.call-title { display: flex; flex-direction: column; min-width: 0; }
.call-title b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.call-sub { color: #9aa3b2; font-size: 12px; }
.call-hbtn { width: 34px; height: 34px; border-radius: 10px; border: 0; background: transparent; color: #c9ced8; display: grid; place-items: center; cursor: pointer; }
.call-hbtn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.call-grid { flex: 1; min-height: 0; display: grid; gap: 8px; padding: 6px 12px; position: relative;
  grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); }
.call-tile { position: relative; border-radius: 14px; overflow: hidden; background: #262a33; min-height: 0; display: grid; place-items: center;
  outline: 3px solid transparent; outline-offset: -3px; transition: outline-color .15s; }
.call-tile.speaking { outline-color: #2fa84f; }
.call-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; background: #000; }
.call-tile.has-video video { display: block; }
.call-tile.screen video { object-fit: contain; }
.call-tile.mirror video { transform: scaleX(-1); }
.call-tile.has-video .call-av { display: none; }
.call-av .avatar { width: 84px; height: 84px; font-size: 34px; }
.call-name { position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); display: flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 8px; background: rgba(0, 0, 0, .5); font-size: 12px; white-space: nowrap; overflow: hidden; }
.call-mic-off { display: none; color: #ff7b7f; }
.call-tile.muted .call-mic-off { display: inline-flex; }
.call-conn { color: #c9ced8; }
/* вдвоем: собеседник — на все окно, я — маленьким окошком в углу */
.call-grid.call-duo { display: block; }
.call-duo .call-tile:not(.call-self) { position: absolute; inset: 6px 12px; }
.call-duo .call-self { position: absolute; right: 22px; bottom: 16px; width: 26%; max-width: 200px; aspect-ratio: 4 / 3; z-index: 2;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .45); }
.call-duo .call-self .call-av .avatar { width: 44px; height: 44px; font-size: 18px; }
.call-solo .call-self { max-width: 520px; width: 100%; justify-self: center; }
.call-ctrls { display: flex; justify-content: center; gap: 12px; padding: 12px 12px 16px; flex-wrap: wrap; }
.call-pill { position: fixed; z-index: 10040; right: 20px; bottom: 20px; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px;
  border: 0; border-radius: 999px; background: #2fa84f; color: #fff; font-weight: 600; cursor: pointer; box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  animation: call-pulse 1.6s ease-in-out infinite; }
/* запись и расшифровка звонка */
.call-round.call-rec-on { background: #e5484d; color: #fff; animation: call-rec-blink 1.6s ease-in-out infinite; }
@keyframes call-rec-blink { 50% { background: #b8343a; } }
.call-rec-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(229, 72, 77, .18); color: #ff8a8e; white-space: nowrap; }
.call-rec-badge::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #e5484d; animation: call-rec-blink 1.2s ease-in-out infinite; }
.call-rec-pop { position: absolute; z-index: 5; left: 50%; bottom: 84px; transform: translateX(-50%); width: min(330px, calc(100% - 24px));
  display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 14px; background: #23262e; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.call-rec-opt { display: flex; align-items: flex-start; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; }
.call-rec-opt:hover { background: rgba(255, 255, 255, .06); }
.call-rec-opt input { margin-top: 3px; width: 16px; height: 16px; accent-color: #e5484d; }
.call-rec-opt span { display: flex; flex-direction: column; gap: 1px; }
.call-rec-opt small { color: #9aa3b2; font-size: 12px; }
.call-rec-opt.disabled { opacity: .55; cursor: default; }
.call-rec-note { color: #9aa3b2; font-size: 12px; padding: 4px 8px 2px; }
/* телефон: звонок на весь экран */
.call-win.call-phone { inset: 0; width: auto; height: auto; border-radius: 0; resize: none; padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom); }
.call-phone .call-grid { padding: 6px; }
.call-phone .call-duo .call-tile:not(.call-self) { inset: 0; border-radius: 0; }
.call-phone .call-duo .call-self { width: 30%; right: 12px; bottom: 12px; aspect-ratio: 3 / 4; }
.call-phone .call-ctrls { gap: 14px; }
@media (max-width: 760px) {
  .call-pill { right: 12px; bottom: auto; top: calc(10px + env(safe-area-inset-top)); }
  .call-incoming { top: calc(10px + env(safe-area-inset-top)); }
  .call-btns .btn.icon { width: 36px; height: 36px; }
}

/* живые ASCII-обои (asciiwall.js): холст позади всего содержимого главной или доски */
.has-ascii-wall { isolation: isolate; }
/* прилипает к верху прокрутки и занимает экран; отрицательный отступ — чтобы не сдвигать содержимое */
canvas.ascii-wall { position: sticky; top: 0; display: block; width: 100%; height: 100vh; height: 100dvh; margin-bottom: -100vh; margin-bottom: -100dvh;
  z-index: -1; pointer-events: none; }
.desk.has-ascii-wall { overflow: clip; }  /* hidden сделал бы стол «прокруткой», и холст не прилипал бы к экрану */
/* телефон: стол — колонка с отступами 12/16 и промежутком 12 — холст на всю ширину, место в колонке не занимает */
.desk.mobile > canvas.ascii-wall { flex: none; width: calc(100% + 32px); margin: -12px -16px -100vh; margin-bottom: -100dvh; }
.board-styled > canvas.ascii-wall { border-radius: 10px; width: calc(100% + 28px); margin: -14px -14px calc(-100dvh + 14px); }
.desk-bg.ascii-prev span, .ascii-prev { font-family: ui-monospace, Menlo, Consolas, monospace; }
.desk-bg.ascii-prev { position: relative; overflow: hidden; }
.desk-bg.ascii-prev canvas.ascii-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.desk-bg.ascii-prev span { position: relative; background: rgba(0, 0, 0, .55); padding: 0 5px; border-radius: 5px; }
.cat-shop-card .desk-bgs { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.cat-ascii-card { grid-column: 1 / -1; }
/* свой эмодзи в поле ввода — «пустой» символ этой ширины (только символы U+E000…U+F8FF, остальной текст не трогает) */
@font-face { font-family: "CEmojiBlank"; src: url("/static/vendor/cemoji-blank.woff") format("woff"); unicode-range: U+E000-F8FF; font-display: block; }
/* подложка под полем ввода: тот же текст невидимым, а на месте своих эмодзи — сами эмодзи */
.chat-input-wrap .ce-mirror { position: absolute; inset: 0; pointer-events: none; overflow: hidden; white-space: pre-wrap; overflow-wrap: break-word; word-break: break-word;
  color: transparent; border: 1px solid transparent; border-radius: 18px; padding: 8px 40px 8px 14px; line-height: 1.4; font: inherit; box-sizing: border-box; display: none; }
.chat-input-wrap.has-ce .ce-mirror { display: block; background: var(--surface); }
.chat-input-wrap.has-ce .chat-input { background: transparent; position: relative; }
.ce-slot { position: relative; }
.ce-mirror .cemoji.ce-abs { position: absolute; left: 0; top: 50%; transform: translateY(-55%); width: 1.3em; height: 1.3em; }
/* профиль: мой пак эмодзи */
.ce-pack-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.ce-pack-item { position: relative; width: 64px; height: 64px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; }
.ce-pack-em .cemoji { width: 44px; height: 44px; }
.ce-pack-x { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--danger, #e5484d); color: #fff; cursor: pointer; font-size: 14px; line-height: 1; opacity: .85; }
.ce-pack-x:hover { opacity: 1; }
/* телефон: эмодзи — панелью внизу вместо клавиатуры */
.popover.emoji-pop.emoji-dock { position: fixed !important; left: 0 !important; right: 0; bottom: 0; top: auto !important; width: auto !important; height: min(320px, 45vh);
  border-radius: 14px 14px 0 0; z-index: 400; padding-bottom: env(safe-area-inset-bottom); display: flex; flex-direction: column; }
.popover.emoji-pop.emoji-dock .emoji-grid { flex: 1; max-height: none; height: auto; min-height: 0; }
/* свои эмодзи (премиум-эмодзи и стикеры из Telegram) — встают в строку как обычный смайлик, чуть крупнее */
.cemoji { display: inline-block; width: 1.3em; height: 1.3em; vertical-align: -0.3em; line-height: 1; text-align: center; }
.cemoji img, .cemoji video, .cemoji svg, .cemoji canvas { width: 100% !important; height: 100% !important; object-fit: contain; display: block; pointer-events: none; }
.md .cemoji, .chat-text .cemoji { cursor: pointer; }
/* сообщение из одних своих эмодзи — крупно, как в Telegram */
.emoji-btn .cemoji, .icon-pick .cemoji { width: 1.5em; height: 1.5em; vertical-align: middle; }
/* поле с подсказками имен (доступ к очереди, ветки Стаффа) */
.user-suggest { position: relative; flex: 1; min-width: 0; }
.user-suggest .input { width: 100%; }
.user-suggest-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 400; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, .3); padding: 4px; max-height: 300px; overflow-y: auto; }
.user-suggest-item { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; color: var(--text); text-align: left;
  padding: 6px 8px; border-radius: 7px; cursor: pointer; font: inherit; font-size: 13.5px; }
.user-suggest-item:hover, .user-suggest-item.on { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.user-suggest-item .avatar { width: 24px; height: 24px; font-size: 10px; flex: none; }
.msgr-seen { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.msgr-seen.on { color: #22c55e; }

/* ---------- всплывающие уведомления сбоку */
.push-stack { position: fixed; top: 14px; right: 14px; z-index: 400; display: flex; flex-direction: column; gap: 8px; width: min(340px, calc(100vw - 20px)); pointer-events: none; }
.push { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); box-shadow: 0 8px 28px rgba(0, 0, 0, .28); cursor: pointer; animation: push-in .25s ease-out; transition: opacity .4s, transform .4s; }
.push.leaving { opacity: 0; transform: translateX(30px); }
.push-dm { border-left-color: var(--link); }
.push-chat { border-left-color: #22c55e; }
.push .avatar { width: 32px; height: 32px; font-size: 12px; }
.push-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; color: var(--text-2); flex: none; }
.push-body { flex: 1; min-width: 0; }
.push-title { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.push-text { font-size: 13px; color: var(--text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.push-sub { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.push-close { border: 0; background: none; color: var(--text-3); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; }
@keyframes push-in { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@media (max-width: 760px) {
  .push-stack { top: calc(8px + env(safe-area-inset-top)); left: 8px; right: 8px; width: auto; }
}

/* ---------- голосовые сообщения */
.chat-mic svg { display: block; }
.chat-rec { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.chat-rec.hidden { display: none; }
.chat-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: rec-blink 1s infinite; }
.chat-rec-time { font-variant-numeric: tabular-nums; font-weight: 600; }
.chat-view.recording .chat-compose-row { display: none; }
/* запись с удержанием: кнопка микрофона остается под пальцем */
.chat-mic { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.chat-view.recording.rec-hold .chat-compose { display: flex; flex-direction: row-reverse; align-items: center; }
.chat-view.recording.rec-hold .chat-compose-row { display: flex; flex: none; }
.chat-view.recording.rec-hold .chat-compose-row > :not(.chat-mic) { display: none; }
.chat-view.recording.rec-hold .chat-rec { flex: 1; border-top: 0; }
.chat-view.rec-hold .chat-mic { width: 52px; height: 52px; border-radius: 50%; background: var(--danger); color: #fff; transform: scale(1.1); transition: transform .15s, background .15s; }
.chat-view.rec-hold.rec-cancel .chat-mic { background: var(--muted, #888); transform: scale(.9); }
.chat-view.rec-hold.rec-cancel .chat-rec-hint { color: var(--danger); }
.voice-toast { max-width: 360px; }
@keyframes rec-blink { 50% { opacity: .25; } }
.chat-voice .yfm-media { max-width: 280px; margin: 2px 0; }
.chat-voice .yfm-media-name { color: var(--text-2) !important; }

/* ---------- «Сообщения» на весь экран; чат задачи на телефоне — тоже */
.messenger-overlay { padding: 0 !important; }
.messenger { width: 100% !important; max-width: none; height: 100vh; height: 100dvh; border-radius: 0; box-shadow: none; }
.msgr-close { display: none !important; }
.msgr-close-mobile { display: inline-flex !important; }
.msgr-back { gap: 2px; padding-left: 4px !important; }
.msgr-back span { font-size: 13px; }
.msgr-people-head { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.chat-head-back { display: none; padding: 0 4px; }
@media (min-width: 761px) {
  .msgr-left { width: 360px; }
}
@media (max-width: 760px) {
  .chat-panel:not(.hidden) { inset: 0 !important; width: 100% !important; height: 100% !important; height: 100dvh !important; max-width: none; max-height: none; border-radius: 0; border: 0; z-index: 120; }
  .chat-panel .chat-grip, .chat-panel .chat-edge, .chat-panel .chat-head .icon[title="Развернуть"] { display: none; }
  .chat-head-back { display: inline-flex; }
  .chat-head { padding: 8px 8px 8px 4px; gap: 6px; }
  body:has(.chat-panel:not(.hidden)) .chat-fab { display: none; }
  .chat-compose-row { gap: 4px; }
  .chat-attach { width: 36px; height: 36px; }
}

/* страница никогда не уезжает вбок целиком */
html, body { max-width: 100%; overflow-x: clip; }

/* все переписки (создатель) */
.audit-avs { display: inline-flex; flex: none; }
.audit-avs > :nth-child(2) { margin-left: -8px; box-shadow: 0 0 0 2px var(--surface); }
.msgr-right > .audit-tabs { padding: 6px 12px; border-bottom: 1px solid var(--border); }
.audit-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.audit-files { flex: 1; overflow-y: auto; }
.audit-file { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--border); cursor: pointer; }
.audit-file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-list .chat-msg.mine .avatar, .audit-list .chat-msg.mine .photo { margin-left: 6px; }

/* ---------- «Сообщения» на компьютере колонками, как в Telegram: папки · чаты · переписка · информация */
.msgr-rail, .msgr-info { display: none; }
@media (min-width: 761px) {
  .msgr-rail { display: flex; flex-direction: column; align-items: stretch; gap: 2px; width: 78px; flex: none; padding: 8px 0; background: var(--surface-2); border-right: 1px solid var(--border); overflow-y: auto; }
  .msgr-folder { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border: 0; background: none; color: var(--text-3); font: inherit; font-size: 11.5px; cursor: pointer; border-left: 3px solid transparent; }
  .msgr-folder:hover { color: var(--text); background: var(--surface); }
  .msgr-folder.active { color: var(--link); background: var(--surface); border-left-color: var(--link); font-weight: 600; }
  .msgr-folder-ic { position: relative; display: grid; place-items: center; }
  .msgr-folder-badge { position: absolute; top: -6px; right: -12px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 10.5px; line-height: 18px; font-weight: 700; text-align: center; box-shadow: 0 0 0 2px var(--surface-2); }
  .msgr-folder-label { text-align: center; line-height: 1.15; }
  .msgr-rail-sep { height: 1px; background: var(--border); margin: 6px 14px; }
  .msgr-left .msgr-tabs:not(:has(.msgr-people-head)) { display: none; }
  .msgr-left .msgr-tabs { padding-top: 8px; }
  .msgr-audit { display: none !important; }
  .msgr-left { width: 340px; }

  .messenger { position: relative; }
  .messenger.info-open .msgr-info { display: flex; }
  .msgr-info { flex-direction: column; width: 340px; flex: none; border-left: 1px solid var(--border); background: var(--surface); min-height: 0; }
  .msgr-info-btn.on { color: var(--link); background: var(--st-progress-bg); }
}
@media (min-width: 761px) and (max-width: 1199px) {
  .msgr-info { position: absolute; top: 0; right: 0; bottom: 0; z-index: 5; box-shadow: var(--shadow); }
}
@media (max-width: 760px) {
  .messenger.info-open .msgr-info { display: flex; position: absolute; inset: 0; z-index: 6; flex-direction: column; background: var(--surface); }
  .messenger { position: relative; }
}
.msgr-info-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); min-height: 57px; }
.msgr-info-scroll { flex: 1; overflow-y: auto; min-height: 0; }
.msgr-info-profile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 16px 14px; text-align: center; }
.msgr-info-profile .avatar.lg { width: 92px; height: 92px; font-size: 34px; }
.msgr-info-name { font-size: 17px; word-break: break-word; }
.msgr-info-type svg { width: 40px; height: 40px; }
.audit-avs.lg > :nth-child(2) { margin-left: -22px; }
.msgr-info-actions { display: flex; gap: 8px; padding: 0 16px 14px; }
.msgr-info-actions > * { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border: 0; border-radius: 10px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 12px; cursor: pointer; text-decoration: none; }
.msgr-info-actions > *:hover { background: var(--st-progress-bg); }
.msgr-info-rows { border-top: 6px solid var(--surface-2); padding: 6px 0; }
.msgr-info-rows > div { display: flex; flex-direction: column; padding: 8px 20px; }
.msgr-info-rows small, .msgr-info-members > small, .msgr-info-file small { color: var(--text-3); font-size: 12px; }
.msgr-info-members { border-top: 6px solid var(--surface-2); padding: 10px 0 6px; }
.msgr-info-members > small { display: block; padding: 0 20px 6px; }
.msgr-info-member { display: flex; align-items: center; gap: 10px; padding: 6px 20px; }
.msgr-info-kinds { border-top: 6px solid var(--surface-2); padding: 6px 0; }
.msgr-info-kind { display: flex; align-items: center; gap: 18px; width: 100%; padding: 10px 20px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.msgr-info-kind svg { color: var(--text-2); flex: none; }
.msgr-info-kind:hover:not(:disabled) { background: var(--surface-2); }
.msgr-info-kind:disabled { cursor: default; color: var(--text-3); }
.msgr-info-total { border-top: 6px solid var(--surface-2); padding: 10px 20px 16px; display: grid; gap: 6px; font-size: 13px; }
.msgr-info-total > div { display: flex; justify-content: space-between; color: var(--text-2); }
.msgr-info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 2px; }
.msgr-info-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; cursor: zoom-in; display: block; }
.msgr-info-media { display: grid; gap: 12px; padding: 12px 14px; }
.msgr-info-media .yfm-media { max-width: 100%; margin: 4px 0 0; }
.msgr-info-list { padding: 4px 0; }
.msgr-info-file { display: flex; align-items: center; gap: 12px; padding: 8px 16px; color: var(--text); text-decoration: none; }
.msgr-info-file:hover { background: var(--surface-2); }
.msgr-info-file > .grow { display: flex; flex-direction: column; min-width: 0; }
.msgr-info-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgr-info-file-ic { width: 42px; height: 42px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--link); color: #fff; font-size: 10.5px; font-weight: 700; }
.msgr-info-file-ic.link { background: var(--st-progress-bg); color: var(--link); }
.msgr-info-media-head { display: flex; align-items: center; gap: 6px; min-height: 26px; }
.msgr-info-goto { flex: none; width: 26px; height: 26px; padding: 0; color: var(--text-3); }
.msgr-info-goto:hover { color: var(--link); }

/* чат с ботом (переписка в ВК) */
.chip-bot { font-size: 10.5px; padding: 0 6px; height: 17px; line-height: 17px; background: var(--st-progress-bg); color: var(--link); border: 0; }
.msgr-pin { font-size: 12px; opacity: .8; }
.msgr-item.pinned { background: color-mix(in srgb, var(--link) 5%, transparent); }
.msgr-item.pinned.active { background: var(--st-progress-bg); }
.bot-foot { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 12.5px; }
.bot-foot > a { flex: none; margin-left: auto; }

/* «Сообщения» на компьютере — как страница: боковое меню трекера остается видно и работает */
@media (min-width: 761px) {
  /* ширина меню может быть своя (его тянут за край) — окно начинается ровно там, где меню кончается */
  .messenger-overlay { left: var(--sidebar-w, 216px); background: var(--surface) !important; backdrop-filter: none !important; transition: left .18s; }
  body:has(.layout.collapsed) .messenger-overlay { left: 60px; }
}

/* групповые чаты */
.group-av { color: #fff; display: inline-grid; place-items: center; font-weight: 700; }
.msgr-new-group .group-av { background: var(--link); }
.chat-system { align-self: center; margin: 6px auto; padding: 3px 10px; border-radius: 99px; background: var(--surface); color: var(--text-3); font-size: 12px; text-align: center; max-width: 90%; }
.group-pick { max-height: 280px; overflow-y: auto; margin-top: 6px; border: 1px solid var(--border); border-radius: 8px; }
.group-pick-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; cursor: pointer; border-bottom: 1px solid var(--border); }
.group-pick-item:last-child { border-bottom: 0; }
.group-pick-item:hover { background: var(--surface-2); }

/* ---------- Календарь */
.content.cal-content { padding: 0 !important; max-width: none !important; height: 100vh; height: 100dvh; display: flex; }
.cal-page { display: flex; flex: 1; min-width: 0; min-height: 0; }
.cal-side { width: 250px; flex: none; padding: 16px 14px; border-right: 1px solid var(--border); overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.cal-create { width: 100%; justify-content: center; height: 40px; font-weight: 600; margin-bottom: 10px; }
.cal-mini { margin-bottom: 12px; }
.cal-mini-head { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; text-align: center; font-size: 13px; }
.cal-mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; text-align: center; }
.cal-mini-wd { font-size: 10.5px; color: var(--text-3); padding: 2px 0; }
.cal-mini-day { border: 0; background: none; color: var(--text); font: inherit; font-size: 12px; height: 26px; border-radius: 50%; cursor: pointer; }
.cal-mini-day:hover { background: var(--surface-2); }
.cal-mini-day.other { color: var(--text-3); }
.cal-mini-day.in-range { background: var(--st-progress-bg); border-radius: 4px; }
.cal-mini-day.today { background: var(--danger); color: #fff; font-weight: 700; border-radius: 50%; }
.cal-side-title { font-weight: 700; font-size: 13px; margin: 6px 0 2px; }
.cal-cal-row { display: flex; align-items: center; gap: 4px; }
.cal-cal-row .cal-check { flex: 1; min-width: 0; }
.cal-check { display: flex; align-items: center; gap: 9px; padding: 5px 4px; border-radius: 6px; cursor: pointer; }
.cal-check:hover { background: var(--surface-2); }
.cal-check input { position: absolute; opacity: 0; pointer-events: none; }
.cal-check-box { width: 18px; height: 18px; flex: none; border-radius: 5px; border: 2px solid var(--c); display: grid; place-items: center; }
.cal-check input:checked + .cal-check-box { background: var(--c); }
.cal-check input:checked + .cal-check-box::after { content: ''; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.cal-cal-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-cal-more { opacity: 0; }
.cal-cal-row:hover .cal-cal-more { opacity: 1; }
.cal-add { display: flex; align-items: center; gap: 8px; border: 0; background: none; color: var(--text-2); font: inherit; padding: 6px 4px; cursor: pointer; border-radius: 6px; }
.cal-add:hover { color: var(--text); background: var(--surface-2); }
.cal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.cal-head { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.cal-title { margin: 0; font-size: 21px; font-weight: 400; white-space: nowrap; }
.cal-views { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.cal-head-break { display: none; }
.cal-views button { border: 0; background: var(--surface); color: var(--text-2); font: inherit; padding: 6px 12px; cursor: pointer; }
.cal-views button.active { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.cal-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.cal-month { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: auto repeat(6, minmax(0, 1fr)); min-height: 0; overflow: auto; }
.cal-month-wd { text-align: center; padding: 6px; font-size: 12px; color: var(--text-3); border-bottom: 1px solid var(--border); }
.cal-month-cell { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 4px; min-height: 96px; display: flex; flex-direction: column; gap: 1px; overflow: hidden; cursor: default; }
.cal-month-cell:nth-child(7n+7) { border-right: 0; }
.cal-month-cell.other { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.cal-month-cell.other .cal-month-num { color: var(--text-3); }
.cal-month-cell.drop { background: var(--st-progress-bg); }
.cal-month-num { font-size: 12.5px; font-weight: 600; padding: 0 3px 2px; }
.cal-month-cell.today .cal-month-num { color: var(--danger); }
.cal-chip { display: flex; align-items: center; gap: 5px; padding: 1px 5px; border-radius: 4px; font-size: 12px; line-height: 18px; cursor: pointer; white-space: nowrap; overflow: hidden; user-select: none; touch-action: none; }
.cal-chip:hover { background: var(--surface-2); }
.cal-chip.all-day { background: color-mix(in srgb, var(--c) 25%, transparent); color: var(--text); }
.cal-chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.cal-chip-time { color: var(--text-2); flex: none; }
.cal-chip-title { overflow: hidden; text-overflow: ellipsis; }
.cal-chip.dragging { opacity: .4; }
.cal-ghost { position: fixed; z-index: 300; pointer-events: none; background: var(--surface); box-shadow: var(--shadow); max-width: 220px; }
.cal-more { border: 0; background: var(--surface-2); color: var(--text-2); font: inherit; font-size: 11.5px; text-align: left; padding: 1px 6px; border-radius: 4px; cursor: pointer; margin-top: auto; }
.cal-more:hover { color: var(--text); }

.cal-week { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.cal-grid-head, .cal-allday { display: grid; grid-template-columns: 56px repeat(var(--days), minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.cal-gutter { display: flex; align-items: center; justify-content: center; font-size: 11px; }
.cal-day-head { border: 0; background: none; color: var(--text-2); font: inherit; padding: 8px 4px; cursor: pointer; display: flex; justify-content: center; align-items: baseline; gap: 6px; }
.cal-day-head b { font-size: 17px; color: var(--text); font-weight: 500; }
.cal-day-head.today b { background: var(--danger); color: #fff; border-radius: 99px; padding: 0 7px; }
.cal-allday-cell { border-left: 1px solid var(--border); padding: 2px; min-height: 26px; display: flex; flex-direction: column; gap: 1px; }
.cal-scroll { flex: 1; overflow-y: auto; min-height: 0; }
.cal-grid { position: relative; display: grid; grid-template-columns: 56px repeat(var(--days), minmax(0, 1fr));
  background-image: linear-gradient(to bottom, var(--border) 1px, transparent 1px); background-size: 100% 48px; }
.cal-hours { position: relative; }
.cal-hours span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11px; color: var(--text-3); }
.cal-col { position: relative; border-left: 1px solid var(--border); cursor: cell; touch-action: none; }
.cal-col.today { background: color-mix(in srgb, var(--link) 4%, transparent); }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 3; pointer-events: none; }
.cal-now::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.cal-event { position: absolute; z-index: 2; border-radius: 5px; padding: 2px 6px; overflow: hidden; cursor: pointer; user-select: none; touch-action: none;
  background: color-mix(in srgb, var(--c) 30%, var(--surface)); border-left: 3px solid var(--c); color: var(--text); font-size: 12px; line-height: 15px; box-sizing: border-box; }
.cal-event:hover { z-index: 4; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.cal-event.short { padding-top: 0; padding-bottom: 0; white-space: nowrap; }
.cal-event.short .cal-event-title { overflow: hidden; text-overflow: ellipsis; }
.cal-event-title { font-weight: 600; }
.cal-event-time { color: var(--text-2); font-weight: 400; font-size: 11px; }
.cal-event.dragging { opacity: .85; z-index: 10; box-shadow: var(--shadow); cursor: grabbing; }
.cal-event.readonly { cursor: pointer; border-left-style: dashed; }
.cal-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.cal-resize:hover { background: color-mix(in srgb, var(--c) 50%, transparent); }
.cal-new-box { position: absolute; left: 2px; right: 2px; z-index: 5; border-radius: 5px; background: color-mix(in srgb, var(--link) 35%, var(--surface)); border: 1px dashed var(--link); font-size: 11.5px; padding: 2px 6px; pointer-events: none; }

.cal-pop { position: fixed; z-index: 250; width: 340px; max-width: calc(100vw - 16px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.cal-pop-head { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.cal-pop-dot { width: 11px; height: 11px; border-radius: 3px; flex: none; display: inline-block; }
.cal-pop-row { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.cal-pop-row > svg { flex: none; margin-top: 1px; color: var(--text-3); }
.cal-pop-desc { font-size: 13px; white-space: pre-wrap; background: var(--surface-2); border-radius: 8px; padding: 8px 10px; max-height: 220px; overflow: auto; }
.cal-pop-people { display: flex; flex-direction: column; gap: 5px; }
.cal-person { display: flex; align-items: center; gap: 8px; }

.cal-form { display: flex; flex-direction: column; gap: 12px; min-width: min(560px, 80vw); }
.cal-form-row { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: start; }
.cal-form-label { color: var(--text-2); padding-top: 8px; font-size: 13px; }
.cal-form-control { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cal-title-input { font-size: 15px; }
.cal-when { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cal-when input[type=time] { width: 100px; }
.cal-when input[type=date] { width: 150px; }
.cal-repeat-extra { display: flex; flex-direction: column; gap: 6px; }
.cal-days { display: flex; gap: 4px; flex-wrap: wrap; }
.cal-days button { width: 36px; height: 30px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: inherit; font-size: 12px; cursor: pointer; }
.cal-days button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.cal-people-wrap { position: relative; }
.cal-people { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; padding: 4px 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); min-height: 36px; }
.cal-people-input { flex: 1; min-width: 140px; border: 0; outline: 0; background: none; color: var(--text); font: inherit; padding: 4px; }
.cal-person-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 4px 2px 2px; border-radius: 99px; background: var(--surface-2); font-size: 12.5px; }
.cal-person-chip .avatar { width: 20px; height: 20px; font-size: 9px; }
.cal-person-chip button { border: 0; background: none; color: var(--text-3); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 3px; }
.cal-suggest { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); max-height: 260px; overflow: auto; }
.cal-suggest button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; color: var(--text); font: inherit; padding: 7px 10px; cursor: pointer; text-align: left; }
.cal-suggest button:hover { background: var(--surface-2); }

.cal-settings { display: flex; flex-direction: column; gap: 14px; min-width: min(620px, 82vw); }
.cal-settings-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.cal-settings-tabs button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: inherit; padding: 5px 12px; border-radius: 99px; cursor: pointer; }
.cal-settings-tabs button.active { border-color: var(--c); color: var(--text); font-weight: 600; background: color-mix(in srgb, var(--c) 14%, var(--surface)); }
.cal-settings-section h3 { margin: 0 0 8px; font-size: 14px; }
.cal-swatches { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px 0; }
.cal-swatches button { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.cal-swatches button.on { border-color: var(--text); box-shadow: inset 0 0 0 2px var(--surface); }
.cal-remind { display: flex; gap: 6px; flex-wrap: wrap; }
.cal-pill input { display: none; }
.cal-pill span { display: inline-block; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--border); font-size: 12.5px; cursor: pointer; color: var(--text-2); }
.cal-pill input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.cal-channel { align-items: flex-start; padding: 4px 0; }
.cal-channel.disabled { opacity: .55; }
.cal-channel-block { display: flex; flex-direction: column; gap: 6px; padding: 6px 0 6px 0; border-top: 1px dashed var(--border); }
.cal-vk-group { display: flex; align-items: center; gap: 8px; padding-left: 26px; flex-wrap: wrap; }
.cal-channel-block > .row { padding-left: 26px; }
.cal-code-box { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.cal-code-box ol { margin: 6px 0; padding-left: 18px; }
.cal-code { font-size: 17px; letter-spacing: 2px; }
.cal-preview { margin: 0; white-space: pre-wrap; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 13px; }

@media (max-width: 760px) {
  .content.cal-content { height: calc(100dvh - 60px); }
  .cal-side { display: none; }
  /* шапка в две низкие строки: [календари] Месяц … ‹ › / Сегодня [День|Неделя|Месяц] ＋ (настройки — в панели календарей) */
  .cal-head { padding: 6px 10px; gap: 6px; row-gap: 6px; }
  .cal-head .btn { height: 32px; min-height: 32px; padding-top: 0; padding-bottom: 0; }
  .cal-head .btn.icon { width: 32px; padding: 0; }
  .cal-side-btn { order: 1; }
  .cal-title { order: 2; font-size: 17px; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .cal-prev { order: 3; }
  .cal-next { order: 4; }
  .cal-head-break { display: block; order: 5; flex-basis: 100%; height: 0; }
  .cal-today { order: 6; padding-left: 10px !important; padding-right: 10px !important; }
  .cal-views { order: 7; flex: 1; display: flex; }
  .cal-views button { flex: 1; padding: 0 6px; height: 32px; }
  .cal-head-create { order: 8; }
  .cal-gear { display: none !important; }
  .cal-month-cell { min-height: 64px; padding: 2px; }
  .cal-chip { font-size: 10.5px; padding: 0 2px; }
  .cal-chip-time { display: none; }
  .cal-grid-head, .cal-allday, .cal-grid { grid-template-columns: 42px repeat(var(--days), minmax(0, 1fr)); }
  .cal-form-row { grid-template-columns: 1fr; gap: 4px; }
  .cal-form-label { padding-top: 0; }
  .cal-form, .cal-settings { min-width: 0; }
}
.cal-head-create { display: none !important; }
@media (max-width: 760px) { .cal-head-create { display: inline-flex !important; } }
/* кнопка «Мои календари» у названия месяца: число — сколько календарей показано */
.cal-side-btn { position: relative; }
.cal-side-btn-n { position: absolute; right: -4px; top: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; font-size: 10px; line-height: 16px; text-align: center;
  background: var(--accent); color: var(--accent-text, #000); font-weight: 700; }
.cal-page { position: relative; }
.cal-page.side-hidden .cal-side { display: none; }
.cal-side-shade, .cal-side-top { display: none; }
@media (max-width: 760px) {
  /* телефон: календари — панель, выезжающая слева поверх (с затемнением) */
  .cal-page .cal-side { display: flex !important; position: fixed; left: 0; top: 0; bottom: calc(58px + env(safe-area-inset-bottom)); width: min(320px, 86vw); z-index: 90;
    background: var(--surface); border-right: 1px solid var(--border); box-shadow: 8px 0 30px rgb(0 0 0 / .35); transform: translateX(-105%); transition: transform .22s ease; }
  .cal-page.side-open .cal-side { transform: none; }
  .cal-page.side-open .cal-side-shade { display: block; position: fixed; inset: 0; z-index: 89; background: rgb(0 0 0 / .45); }
  .cal-side-top { display: flex; align-items: center; gap: 6px; font-size: 16px; padding-bottom: 4px; }
}

/* ---------------- телефон: календарь как Samsung Календарь (свой функционал, вид — оттуда) */
.cal-fab { display: none; }
@media (max-width: 760px) {
  .cal-head { padding: 10px 14px 6px; gap: 6px; border-bottom: 0; flex-wrap: nowrap; }
  .cal-m-burger, .cal-m-icon { position: relative; border: 0; background: none; color: var(--text); width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; cursor: pointer; flex: none; }
  .cal-m-dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
  .cal-m-title { margin: 0 0 0 4px; font-size: 26px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cal-m-today { width: 32px; height: 32px; border: 2px solid var(--text); border-radius: 8px; background: none; color: var(--text); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; flex: none; margin-left: 4px; }
  /* меню слева: виды и календари */
  .cal-page .cal-side { border-radius: 0 22px 22px 0; padding: 14px 12px; gap: 4px; }
  .cal-m-views { display: flex; flex-direction: column; gap: 2px; }
  .cal-m-view { display: flex; align-items: center; gap: 16px; border: 0; background: none; color: var(--text); font: inherit; font-size: 16px; padding: 11px 14px; border-radius: 12px; cursor: pointer; text-align: left; }
  .cal-m-view.active { background: var(--surface-2); font-weight: 700; }
  .cal-m-sep { border-top: 1px dashed var(--border-strong); margin: 8px 6px; }
  /* плашка «Добав. на …» внизу */
  .cal-fab { display: flex; align-items: center; justify-content: space-between; gap: 18px; position: fixed; left: 50%; transform: translateX(-50%);
    bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 60; min-width: min(300px, calc(100vw - 48px)); padding: 12px 18px 12px 24px; border-radius: 999px;
    border: 1px solid var(--border); background: color-mix(in srgb, var(--surface-2) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    color: var(--text-2); font: inherit; font-size: 16px; box-shadow: 0 8px 26px rgb(0 0 0 / .3); cursor: pointer; }
  .cal-fab svg { color: var(--text); }
  .cal-body { padding-bottom: 72px; }
  /* год: 12 месяцев в три колонки */
  .cal-year { overflow-y: auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 10px; padding: 8px 10px 20px; }
  .cal-year-m { cursor: pointer; }
  .cal-year-title { text-align: center; font-size: 17px; font-weight: 600; margin-bottom: 6px; }
  .cal-year-title.cur { background: var(--text); color: var(--bg, #000); border-radius: 8px; width: fit-content; margin: 0 auto 6px; padding: 0 8px; }
  .cal-year-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
  .cal-year-wd { font-size: 8.5px; color: var(--text-3); }
  .cal-year-d { font-size: 10.5px; line-height: 17px; border-radius: 4px; background: var(--surface-2); }
  .cal-year-d.sun, .cal-year-wd.sun { color: var(--danger); }
  .cal-year-d.busy { background: color-mix(in srgb, var(--link) 40%, var(--surface-2)); }
  .cal-year-d.today { background: var(--text); color: var(--bg, #000); font-weight: 700; }
  /* месяц: сетка с днями, под ней — события выбранного дня */
  .cal-mm-wrap { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
  .cal-mm { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 0 10px; }
  .cal-mm-wd { text-align: center; font-size: 12px; color: var(--text-2); padding: 4px 0 6px; text-transform: uppercase; }
  .cal-mm-wd.sun { color: var(--danger); }
  .cal-mm-cell { border: 1.5px solid transparent; background: var(--surface-2); border-radius: 8px; min-height: 58px; padding: 4px 2px; display: flex; flex-direction: column; align-items: stretch; gap: 2px;
    color: var(--text); font: inherit; cursor: pointer; overflow: hidden; }
  .cal-mm-cell.other { opacity: .45; }
  .cal-mm-cell.sun .cal-mm-num { color: var(--danger); }
  .cal-mm-cell.sel { border-color: var(--text-2); background: color-mix(in srgb, var(--surface-2) 70%, var(--surface-3)); }
  .cal-mm-num { font-size: 15px; font-weight: 700; align-self: center; min-width: 24px; line-height: 22px; border-radius: 6px; }
  .cal-mm-num.today { background: var(--text); color: var(--bg, #000) !important; }
  .cal-mm-evs { display: flex; flex-direction: column; gap: 1px; }
  .cal-mm-ev { font-size: 9.5px; line-height: 13px; padding: 0 3px; border-radius: 3px; background: color-mix(in srgb, var(--c) 35%, transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
  .cal-mm-more { font-size: 9.5px; color: var(--text-3); }
  .cal-mm-day { padding: 14px 16px 10px; display: flex; flex-direction: column; gap: 4px; }
  .cal-mm-day-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
  .cal-mm-day-head b { font-size: 32px; font-weight: 700; }
  .cal-mm-day-head span { font-size: 15px; font-weight: 600; }
  .cal-mm-empty { border: 0; background: none; color: var(--text-3); font: inherit; padding: 18px 0; cursor: pointer; }
  /* расписание: список по дням */
  .cal-agenda { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 14px 20px; }
  .cal-ag-more { display: block; width: 100%; border: 0; background: none; color: var(--text-3); font: inherit; font-size: 13px; padding: 14px 0; cursor: pointer; }
  .cal-ag-day { padding: 10px 0; border-bottom: 1px solid var(--border); }
  .cal-ag-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 15px; }
  .cal-ag-today { background: var(--text); color: var(--bg, #000); border-radius: 6px; padding: 1px 8px; font-weight: 700; font-size: 14px; }
  .cal-ag-none { text-align: center; color: var(--text-2); padding: 12px 0; line-height: 1.6; }
  .cal-ag-ev { display: flex; align-items: flex-start; gap: 12px; width: 100%; border: 0; background: none; color: var(--text); font: inherit; text-align: left; padding: 8px 0; cursor: pointer; }
  .cal-ag-time { width: 66px; flex: none; font-size: 15px; font-weight: 600; padding-top: 1px; }
  .cal-ag-bar { width: 4px; align-self: stretch; min-height: 34px; border-radius: 2px; background: var(--c); flex: none; }
  .cal-ag-body { display: flex; flex-direction: column; min-width: 0; }
  .cal-ag-body b { font-size: 17px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
  .cal-ag-sub { color: var(--text-2); font-size: 13.5px; }
  /* неделя и день: дни сверху — плитками */
  .cal-grid-head { border-bottom: 0; padding: 0 0 6px; }
  .cal-day-head { flex-direction: column; align-items: center; gap: 2px; background: var(--surface-2); border-radius: 8px; margin: 0 2px; padding: 6px 0; }
  .cal-day-head span { font-size: 11px; text-transform: uppercase; }
  .cal-day-head b { font-size: 18px; font-weight: 700; }
  .cal-day-head.today { outline: 1.5px solid var(--text-2); }
  .cal-day-head.today b { background: var(--text); color: var(--bg, #000); border-radius: 6px; padding: 0 6px; }
  .cal-page[data-view="day"] .cal-day-head { flex-direction: row; justify-content: flex-start; gap: 12px; background: none; padding: 6px 12px; }
  .cal-page[data-view="day"] .cal-day-head b { font-size: 30px; order: -1; }
  .cal-page[data-view="day"] .cal-day-head span { font-size: 15px; text-transform: none; font-weight: 600; color: var(--text); }
  .cal-search-list { display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow-y: auto; }
  .cal-search-item { display: flex; align-items: center; gap: 10px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; padding: 8px 6px; border-radius: 8px; cursor: pointer; }
  .cal-search-item:hover { background: var(--surface-2); }
}

/* столбцы в описании и комментариях, как в газете */
.yfm-columns { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 20px; margin: 10px 0; }
.yfm-column > :first-child { margin-top: 0; }
.yfm-column > :last-child { margin-bottom: 0; }
.ve-columns-body { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 10px; padding: 8px; }
.ve-column { min-height: 60px; padding: 8px 10px; border: 1px dashed var(--border-strong, var(--border)); border-radius: 8px; outline: none; background: var(--surface); }
.ve-column:focus-within { border-color: var(--link); border-style: solid; }
.ve-col-add, .ve-col-del { border: 0; background: none; color: var(--link); font: inherit; font-size: 12px; cursor: pointer; padding: 2px 6px; }
.cols-sample { letter-spacing: 1px; color: var(--text-2); font-size: 11px; }
@media (max-width: 760px) {
  .yfm-columns { grid-template-columns: 1fr; gap: 10px; }
  .ve-columns-body { grid-template-columns: 1fr; }
}

/* дедлайн / начало / конец: дата и необязательное время рядом */
.due-input { display: flex; gap: 4px; min-width: 0; }
.due-input .due-date { flex: 1 1 auto; min-width: 0; }
.due-input .due-time { flex: 0 0 92px; min-width: 0; }
.due-input .overdue { color: var(--danger); }
.chat-via { font-size: 10.5px; padding: 0 5px; border-radius: 99px; background: var(--surface-2); color: var(--text-3); margin-right: 4px; }
.tr-job { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--border); }
.tr-job .chip.tr-done { background: color-mix(in srgb, #22c55e 18%, transparent); }
.tr-job .chip.tr-error { background: color-mix(in srgb, var(--danger) 18%, transparent); }
.tr-job .chip.tr-working { background: var(--st-progress-bg); }

/* телефон: панель редактора переносится на несколько строк — все кнопки видны, скрепка не уезжает за край */
@media (max-width: 760px) {
  .editor, .editor-head, .editor-body, .comment-form, .comments, .card { max-width: 100%; min-width: 0; }
  .editor-toolbar { flex-wrap: wrap !important; overflow: visible !important; margin-left: 0 !important; gap: 2px !important; row-gap: 4px !important; }
  .editor-toolbar .tb-sep { display: none; }
  .editor-toolbar .spacer { display: none; }
  .editor-toolbar button { width: 36px; height: 36px; }
  .editor-toolbar .ed-preview { width: auto; padding: 0 10px; }
}
.msgr-settings .card { box-shadow: none; border: 1px solid var(--border); }
.msgr-settings h2 { font-size: 15px; }
/* пока зажат микрофон — никакого выделения текста на странице */
body.no-select, body.no-select * { -webkit-user-select: none !important; user-select: none !important; -webkit-touch-callout: none !important; }
.chat-mic, .chat-mic * { -webkit-tap-highlight-color: transparent; }
.yfm-media-del { border: 0; background: none; color: var(--text-3); cursor: pointer; padding: 2px 4px; border-radius: 6px; display: inline-grid; place-items: center; flex: none; }
.yfm-media-del:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.storage-line { display: flex; align-items: baseline; gap: 8px; }
.storage-bar { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.storage-fill { height: 100%; border-radius: 99px; background: #22c55e; transition: width .3s; }
.storage-fill.warn { background: #f59e0b; }
.storage-fill.danger { background: var(--danger); }
.yfm-media-state.error { color: var(--danger); }

/* кнопка «скачать» в плеере */
.yfm-media-dl { color: var(--text-3); padding: 2px 4px; border-radius: 6px; display: inline-grid; place-items: center; flex: none; text-decoration: none; }
.yfm-media-dl:hover { color: var(--link); background: color-mix(in srgb, var(--link) 12%, transparent); }

/* ===================== холст: лента, бумага, списки, теги (общие для досок и книг) */
.wb.wb-ribbon { height: 100%; min-height: 0; border: 0; border-radius: 0; resize: none; }
.wb.wb-ribbon .wb-tools, .wb.wb-ribbon .wb-top { display: none; }
.wb.wb-ribbon.wb-full .wb-top { display: flex; }
.wb-readonly .wb-tools, .wb-readonly .wb-ctx { display: none !important; }
.wb-viewport.wb-paper-plain { background-image: none; background-color: var(--surface); }
.wb-viewport.wb-paper-lines { background-color: var(--surface); background-image: linear-gradient(to bottom, transparent calc(100% - 1px), color-mix(in srgb, var(--link) 22%, transparent) calc(100% - 1px)); }
.wb-viewport.wb-paper-grid { background-color: var(--surface); background-image: linear-gradient(to right, var(--border) 1px, transparent 1px), linear-gradient(to bottom, var(--border) 1px, transparent 1px); }
/* рамка текстового поля при наведении и при наборе — видно, что поле можно взять и растянуть */
.wb-ribbon .wb-text:hover .wb-txt { box-shadow: 0 0 0 1px var(--border-strong); }
.wb-ribbon .wb-text.editing .wb-txt { box-shadow: 0 0 0 1px var(--border-strong), 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); background: transparent; }
.wb-ribbon .wb-text[style*="min-height"] .wb-txt { min-height: inherit; box-sizing: border-box; }
.wb-ribbon .wb-text .wb-txt:empty::before { content: ''; }
.wb-ribbon .wb-handle.wb-resize { border-color: var(--text-2); }
/* авторство блока, как в OneNote: аватарка справа сверху, при наведении — карточка */
.wb-el .wb-author { position: absolute; right: -24px; top: 0; z-index: 2; opacity: .6; transition: opacity .15s; cursor: default; }
.wb-el .wb-author .avatar { width: 18px; height: 18px; font-size: 8.5px; box-shadow: 0 0 0 2px var(--surface); }
.wb-el:hover .wb-author, .wb-el.sel .wb-author { opacity: 1; }
.wb:not(.wb-authors) .wb-author { display: none; }
.wb-author-card { position: fixed; z-index: 300; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; max-width: 320px; pointer-events: none; }
.wb-author-head { display: flex; gap: 10px; align-items: center; }
.bk-full-btn { margin-left: 4px; }
/* доска задачи: лента + одна страница */
.wb-issue { height: 680px; min-height: 380px; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; resize: vertical; background: var(--surface); }
.wb-issue .bk-rpanel { min-height: 84px; }
.wb-issue-canvas { flex: 1; position: relative; min-height: 0; }
.wb-issue.wb-issue-full { position: fixed; inset: 0; z-index: 95; height: auto !important; border-radius: 0; border: 0; resize: none; }
.bk-paper-sample.p-dots { background-image: radial-gradient(circle, #9aa1ad 1px, transparent 1.3px); }
.wb-marquee { position: absolute; border: 1px dashed var(--link); background: color-mix(in srgb, var(--link) 10%, transparent); pointer-events: none; z-index: 5; }
.wb-viewport[data-tool="eraser"] { cursor: cell; }
.wb-viewport[data-tool="marquee"] { cursor: crosshair; }
.wb-li { display: flex; gap: 6px; align-items: baseline; }
.wb-bul { flex: none; min-width: 1em; color: inherit; opacity: .8; }
.wb-check { flex: none; width: .85em; height: .85em; border: 1.5px solid currentColor; border-radius: 3px; position: relative; top: .1em; cursor: pointer; opacity: .75; }
.wb-check.on { background: var(--link); border-color: var(--link); opacity: 1; }
.wb-check.on::after { content: ''; position: absolute; left: 28%; top: 6%; width: 28%; height: 55%; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.wb-done { text-decoration: line-through; opacity: .55; }
.wb-el .wb-tagicon { position: absolute; left: -24px; top: 5px; width: 18px; height: 18px; border-radius: 4px; display: grid; place-items: center; font-size: 12px; font-weight: 700; line-height: 1; cursor: default; }
.wb-tagicon.tag-todo { border: 1.5px solid #3e63dd; cursor: pointer; color: #fff; }
.wb-tagicon.tag-todo.on { background: #3e63dd; }
.wb-tagicon.tag-todo.on::after { content: '✓'; }
.wb-tagicon.tag-important { color: #f5a400; font-size: 16px; }
.wb-tagicon.tag-question { background: #8e4ec6; color: #fff; border-radius: 50%; }

/* ===================== Книги (как OneNote) */
.content.bk-content { padding: 0 !important; max-width: none !important; }
.bk { display: flex; flex-direction: column; height: 100vh; background: var(--surface); }
.bk.bk-full { position: fixed; inset: 0; z-index: 90; height: auto; }
.bk-ribbon { background: var(--surface); border-bottom: 1px solid var(--border); flex: none; }
.bk-rtop { display: flex; align-items: center; gap: 4px; padding: 4px 10px 0; }
.bk-rtabs { display: flex; gap: 2px; }
.bk-rtab { border: 0; background: none; padding: 7px 14px 8px; font-size: 13.5px; color: var(--text-2); cursor: pointer; border-bottom: 3px solid transparent; }
.bk-rtab:hover { color: var(--text); background: var(--surface-2); }
.bk-rtab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.bk-status { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-status .wb-status { padding: 0; }
.bk-share-btn { margin-left: 6px; }
.bk-rpanel { display: flex; align-items: stretch; gap: 0; padding: 6px 8px 2px; overflow-x: auto; background: var(--surface-2); border-top: 1px solid var(--border); min-height: 92px; scrollbar-width: thin; }
.bk-rgroup { display: flex; flex-direction: column; padding: 0 10px; border-right: 1px solid var(--border); flex: none; }
.bk-rgroup:last-child { border-right: 0; }
.bk-rgroup-body { display: flex; flex-wrap: wrap; gap: 3px; align-items: flex-start; align-content: flex-start; flex: 1; max-width: 520px; }
.bk-rgroup-title { font-size: 11px; color: var(--text-3); text-align: center; padding: 3px 0 2px; white-space: nowrap; }
.bk-rrow { display: flex; gap: 2px; align-items: center; width: 100%; flex-wrap: wrap; }
.bk-rb { border: 1px solid transparent; background: none; border-radius: 5px; min-width: 28px; height: 28px; padding: 0 5px; cursor: pointer; color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 4px; font-size: 13px; }
.bk-rb:hover:not(:disabled) { background: var(--surface-3); border-color: var(--border); }
.bk-rb.on { background: color-mix(in srgb, var(--accent) 28%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 80%, transparent); }
.bk-rb:disabled { opacity: .38; cursor: default; }
.bk-rb.big { flex-direction: column; height: 62px; min-width: 56px; max-width: 84px; font-size: 11.5px; line-height: 1.15; padding: 4px 6px; text-align: center; white-space: normal; }
.bk-select { height: 28px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--surface); color: var(--text); font-size: 13px; padding: 0 4px; width: 140px; }
.bk-select.sm { width: 58px; }
.bk-hl { background: #fff200; color: #111; padding: 0 3px; border-radius: 2px; font-weight: 600; }
.bk-fc { border-bottom: 3px solid; font-weight: 700; line-height: 1; padding: 0 2px; }
.bk-styles { display: grid; grid-template-columns: repeat(3, 96px); gap: 3px; }
.bk-style { border: 1px solid var(--border); background: var(--surface); border-radius: 4px; height: 28px; padding: 0 6px; cursor: pointer; text-align: left; overflow: hidden; white-space: nowrap; color: var(--text); font-size: 12px; }
.bk-style:hover:not(:disabled) { border-color: var(--accent); }
.bk-style.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.bk-style:disabled { opacity: .4; cursor: default; }
.bk-style.st-h1 { color: #1e4e79; font-size: 15px; font-family: 'Calibri Light', Calibri, sans-serif; }
.bk-style.st-h2 { color: #2e75b5; font-size: 13.5px; font-weight: 600; }
.bk-style.st-h3 { color: #5b9bd5; font-weight: 600; }
.bk-style.st-quote { font-style: italic; color: #6b7280; }
.bk-style.st-code { font-family: Consolas, monospace; }
.bk-tags { display: flex; flex-direction: column; gap: 2px; min-width: 150px; }
.bk-tag { border: 1px solid transparent; background: none; border-radius: 4px; height: 20px; font-size: 12.5px; display: flex; align-items: center; gap: 6px; cursor: pointer; color: var(--text); padding: 0 6px; text-align: left; }
.bk-tag:hover:not(:disabled) { background: var(--surface-3); }
.bk-tag.on { background: color-mix(in srgb, var(--accent) 28%, var(--surface)); }
.bk-tag:disabled { opacity: .4; cursor: default; }
.bk-tag-sym { width: 15px; height: 15px; display: grid; place-items: center; border-radius: 3px; font-size: 11px; font-weight: 700; }
.bk-tag.tag-todo .bk-tag-sym { color: #3e63dd; }
.bk-tag.tag-important .bk-tag-sym { color: #f5a400; font-size: 14px; }
.bk-tag.tag-question .bk-tag-sym { background: #8e4ec6; color: #fff; border-radius: 50%; }
.bk-pens { display: grid; grid-template-columns: repeat(5, 30px); gap: 3px; }
.bk-pen { width: 30px; height: 26px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); display: grid; place-items: center; cursor: pointer; padding: 0 4px; }
.bk-pen span { display: block; width: 100%; border-radius: 3px; }
.bk-pen.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.bk-pen:disabled { opacity: .4; }
.bk-paper-sample { width: 34px; height: 26px; border: 1px solid var(--border-strong); border-radius: 3px; background-color: #fff; background-size: 7px 7px; }
.bk-paper-sample.p-lines { background-image: linear-gradient(to bottom, transparent 6px, #9ec5ff 6px); }
.bk-paper-sample.p-grid { background-image: linear-gradient(to right, #d5d9e0 1px, transparent 1px), linear-gradient(to bottom, #d5d9e0 1px, transparent 1px); }

.bk-bar { display: flex; align-items: flex-end; gap: 6px; padding: 6px 10px 0; background: var(--surface-2); border-bottom: 1px solid var(--border); flex: none; min-width: 0; }
.bk-switcher { display: flex; align-items: center; gap: 6px; border: 0; background: none; padding: 5px 8px; margin-bottom: 3px; border-radius: 6px; cursor: pointer; color: var(--text); max-width: 220px; white-space: nowrap; overflow: hidden; }
.bk-switcher b { overflow: hidden; text-overflow: ellipsis; }
.bk-switcher:hover { background: var(--surface-3); }
.bk-switcher-ic { display: grid; }
.bk-sections { display: flex; gap: 2px; align-items: flex-end; overflow-x: auto; min-width: 0; scrollbar-width: none; }
.bk-sec { --c: #c39bd3; border: 0; background: color-mix(in srgb, var(--c) 55%, var(--surface)); color: #1f2328; padding: 6px 14px; border-radius: 6px 6px 0 0; font-size: 13px; cursor: pointer; white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; border-top: 3px solid var(--c); }
.bk-sec:hover { background: color-mix(in srgb, var(--c) 75%, var(--surface)); }
.bk-sec.active { background: var(--c); font-weight: 600; padding-bottom: 8px; box-shadow: 0 -1px 4px rgba(0, 0, 0, .12); }
.bk-sec-add { --c: var(--border-strong); background: transparent; color: var(--text-2); font-size: 17px; padding: 3px 12px; border-top-color: transparent; }
.bk-search-wrap { position: relative; display: flex; align-items: center; gap: 4px; margin-bottom: 4px; border: 1px solid var(--border); background: var(--surface); border-radius: 6px; padding: 0 8px; color: var(--text-3); }
.bk-search { border: 0; background: none; outline: none; height: 28px; width: 180px; color: var(--text); font-size: 13px; }
.bk-search-results { position: absolute; right: 0; top: calc(100% + 4px); width: 380px; max-height: 60vh; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); z-index: 30; padding: 4px; }
.bk-sr { display: flex; gap: 8px; align-items: flex-start; width: 100%; border: 0; background: none; text-align: left; padding: 8px; border-radius: 6px; cursor: pointer; color: var(--text); }
.bk-sr:hover { background: var(--surface-2); }
.bk-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; margin-top: 4px; display: inline-block; }
.bk-pages-toggle { margin-bottom: 4px; }

.bk-body { flex: 1; display: flex; min-height: 0; }
.bk-page { flex: 1; display: flex; flex-direction: column; min-width: 0; border-top: 3px solid var(--sc, #c39bd3); }
.bk-page-head { padding: 18px 40px 8px; flex: none; background: var(--surface); }
.bk-title { width: min(100%, 640px); border: 0; border-bottom: 1px solid var(--border-strong); background: none; outline: none; font-size: 28px; font-family: 'Calibri Light', Calibri, 'Segoe UI', sans-serif; color: var(--text); padding: 2px 0 4px; }
.bk-title:focus { border-bottom-color: var(--accent); }
.bk-date { display: flex; gap: 18px; font-size: 12.5px; color: var(--text-3); margin-top: 6px; }
.bk-canvas { flex: 1; position: relative; min-height: 0; }
.bk-pages { width: 250px; flex: none; border-left: 1px solid var(--border); background: var(--surface-2); display: flex; flex-direction: column; min-height: 0; }
.bk-pages.collapsed { display: none; }
.bk-add-page { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 10px 14px; color: var(--text); cursor: pointer; font-size: 13.5px; border-bottom: 1px solid var(--border); }
.bk-add-page:hover:not(:disabled) { background: var(--surface-3); }
.bk-add-page:disabled { opacity: .4; cursor: default; }
.bk-pages-list { overflow-y: auto; flex: 1; padding: 4px 0; }
.bk-pg { padding: 8px 14px; font-size: 13.5px; cursor: pointer; border-left: 4px solid transparent; color: var(--text); }
.bk-pg:hover { background: var(--surface-3); }
.bk-pg.active { background: color-mix(in srgb, var(--accent) 26%, var(--surface)); border-left-color: var(--accent); font-weight: 600; }
.bk-pg.drop { box-shadow: inset 0 2px 0 var(--accent); }
.bk-pg-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-menu { position: fixed; z-index: 200; min-width: 200px; }
.bk-menu-colors { display: grid; grid-template-columns: repeat(6, 24px); gap: 6px; padding: 8px 10px; }
.bk-menu-colors button { width: 24px; height: 24px; border-radius: 4px; border: 1px solid rgba(0, 0, 0, .15); cursor: pointer; }

/* список книг */
.bk-list-title { font-size: 15px; margin: 22px 0 10px; }
.bk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.bk-card { display: flex; gap: 14px; padding: 14px; text-decoration: none; color: var(--text); align-items: center; }
.bk-card:hover { border-color: var(--border-strong); box-shadow: 0 4px 14px rgba(0, 0, 0, .08); }
.bk-card-wrap { position: relative; display: grid; min-width: 0; }
.bk-card-wrap .bk-card { min-width: 0; padding-right: 40px; }
.bk-card-more { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); display: grid; place-items: center; cursor: pointer; }
.bk-card-more:hover { background: var(--surface-3); color: var(--text); }
.bk-card-cover { --c: var(--accent); width: 46px; height: 58px; border-radius: 4px 8px 8px 4px; background: var(--c); color: #fff; display: grid; place-items: center; flex: none; box-shadow: inset 5px 0 0 rgba(0, 0, 0, .18); }
.bk-card-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bk-card-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.bk-shared { color: #2e7d32; }
.bk-access { border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.bk-access.private { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent); }
.bk-access.shared { background: color-mix(in srgb, #30a46c 14%, var(--surface)); border: 1px solid color-mix(in srgb, #30a46c 45%, transparent); }
.bk-share-row { display: flex; align-items: center; gap: 8px; }

@media (max-width: 760px) {
  .bk { height: calc(100dvh - 64px); }
  .bk-pages { width: 160px; }
  .bk-page-head { padding: 12px 14px 6px; }
  .bk-title { font-size: 22px; }
  .bk-search { width: 90px; }
  .bk-rpanel { min-height: 80px; }
  .bk-status { display: none; }
}

/* ===================== переключатель, удаленные пользователи, кнопка «Я» */
.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; vertical-align: middle; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { width: 36px; height: 20px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background .18s; }
.switch-knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .18s; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track .switch-knob { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--link); outline-offset: 2px; }
.switch.disabled { opacity: .5; cursor: default; }
.user-deleted > span:last-child { text-decoration: line-through; opacity: .65; }
.avatar.deleted { filter: grayscale(1); opacity: .6; }
.me-row { display: flex; gap: 6px; align-items: center; min-width: 0; }
.me-row > :first-child { flex: 1; min-width: 0; }
.me-btn { flex: none; min-width: 30px; height: 26px; padding: 0 8px; font-weight: 700; }

/* ===================== холст: заголовок на листе, полосы прокрутки, ширина, фигуры, цвета */
.wb-header { position: absolute; left: 0; width: 760px; height: 110px; box-sizing: border-box; padding-top: 10px; z-index: 1; }
.wb-header .bk-page-head { padding: 0; background: transparent; }
.wb-sb { position: absolute; z-index: 6; border-radius: 6px; background: transparent; transition: background .15s; }
.wb-sb.h { left: 6px; right: 18px; bottom: 3px; height: 10px; }
.wb-sb.v { top: 6px; bottom: 18px; right: 3px; width: 10px; }
.wb-sb:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
.wb-thumb { position: absolute; border-radius: 6px; background: color-mix(in srgb, var(--text) 28%, transparent); cursor: grab; }
.wb-sb.h .wb-thumb { top: 2px; bottom: 2px; }
.wb-sb.v .wb-thumb { left: 2px; right: 2px; }
.wb-thumb:hover, .wb-thumb:active { background: color-mix(in srgb, var(--text) 45%, transparent); }
.wb-handle.wb-resize-w { cursor: ew-resize; width: 10px; height: 26px; border-radius: 5px; }
.wb-shapebox { display: flex; align-items: center; justify-content: center; text-align: center; }
.wb-shapebox .wb-txt { position: relative; padding: 8px 18%; max-width: 100%; max-height: 100%; overflow: hidden; }
.wb-shapebox.wb-rect .wb-txt, .wb-shapebox.wb-square .wb-txt, .wb-shapebox.wb-ellipse .wb-txt { padding: 8px 14px; }
.wb-viewport[data-tool="line"], .wb-viewport[data-tool="arrow2"], .wb-viewport[data-tool="dashed"] { cursor: crosshair; }
.wb-swatch-any { position: relative; display: inline-grid; place-items: center; overflow: hidden; background: conic-gradient(#e5484d, #facc15, #30a46c, #00b4d8, #3e63dd, #8e4ec6, #e5484d); }
.wb-swatch-any input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.wb-ctx-label { font-size: 11px; color: var(--text-3); padding: 0 2px; }
.wb-txt span[style*="font-size"] { line-height: 1.25; }
/* лента: выпадающие шрифт/размер, галерея фигур, «любой цвет» */
.bk-dd { display: inline-flex; align-items: center; justify-content: space-between; gap: 4px; height: 28px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--surface); color: var(--text); font-size: 13px; padding: 0 6px; cursor: pointer; }
.bk-dd.bk-select { width: 140px; }
.bk-dd.bk-select.sm { width: 58px; }
.bk-dd:disabled { opacity: .45; cursor: default; }
.bk-dd-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-shapes { display: grid; grid-template-columns: repeat(8, 28px); gap: 2px; }
.bk-shape { width: 28px; height: 28px; border: 1px solid transparent; border-radius: 5px; background: none; color: var(--text); display: grid; place-items: center; cursor: pointer; padding: 0; }
.bk-shape:hover:not(:disabled) { background: var(--surface-3); border-color: var(--border); }
.bk-shape.on { background: color-mix(in srgb, var(--accent) 30%, var(--surface)); border-color: var(--accent); }
.bk-shape:disabled { opacity: .4; }
.bk-pens { grid-template-columns: repeat(8, 26px) !important; }
.bk-pen { width: 26px !important; }
.bk-pen-any { position: relative; display: grid; place-items: center; font-size: 13px; cursor: pointer; overflow: hidden; }
.bk-pen-any input, .bk-menu-any input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.bk-menu-any { position: relative; width: 24px; height: 24px; border-radius: 4px; display: grid; place-items: center; cursor: pointer; border: 1px dashed var(--border-strong); }
.menu-item.on { font-weight: 600; background: color-mix(in srgb, var(--accent) 22%, transparent); }
.wb-issue-body { flex: 1; display: flex; min-height: 0; }
.wb-issue-body .wb-issue-canvas { flex: 1; min-width: 0; }
.wb-issue-pages { width: 190px; }
/* кнопка у края доски: скрыть / показать страницы */
.wb-issue-body { position: relative; }
.wb-pages-toggle { position: absolute; top: 8px; right: 8px; z-index: 6; display: inline-flex; align-items: center; gap: 4px; height: 28px; min-width: 28px; padding: 0 8px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text-2); font: inherit; font-size: 12px; cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.wb-pages-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.wb-pages-arrow { font-size: 17px; line-height: 1; margin-top: -2px; }
.wb-pages-toggle:has(~ .bk-pages:not(.collapsed)) { right: calc(190px + 8px); }
@media (max-width: 760px) { .wb-pages-toggle:has(~ .bk-pages:not(.collapsed)) { right: calc(120px + 8px); } }
/* ролик-превью: без кнопок, с пометкой, что можно нажать и смотреть со звуком */
.yfm-media-video.preview video { cursor: pointer; }
.yfm-media-video { position: relative; }
.yfm-media-video.preview::before { content: '▶ смотреть'; position: absolute; left: 8px; top: 8px; z-index: 2; padding: 2px 8px; border-radius: 10px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; pointer-events: none; }
@media (max-width: 760px) { .wb-issue-pages { width: 120px; } }

/* ===================== календарь: приглашения, ответы, напоминания события, касания */
.cal-col, .cal-event, .cal-chip { touch-action: pan-y; }
@media (pointer: fine) { .cal-col, .cal-event, .cal-chip { touch-action: none; } }
.cal-event.invite-pending, .cal-chip.invite-pending { opacity: .62; background: color-mix(in srgb, var(--c) 10%, var(--surface)) !important; outline: 1.5px dashed var(--c); outline-offset: -1.5px; }
.cal-event.invite { background: color-mix(in srgb, var(--c) 22%, var(--surface)); }
.cal-rsvp { margin-left: auto; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.cal-rsvp.rsvp-accepted { background: #30a46c; color: #fff; }
.cal-rsvp.rsvp-declined { background: #e5484d; color: #fff; }
.cal-rsvp.rsvp-pending { background: var(--surface-3); color: var(--text-3); }
.cal-person.declined > span:nth-child(2) { text-decoration: line-through; opacity: .6; }
.cal-pop-rsvp { display: flex; gap: 6px; align-items: center; padding: 8px 0 2px; border-top: 1px solid var(--border); margin-top: 6px; }
.cal-invites { margin: 12px 0 4px; }
.cal-invite { padding: 8px 10px; border: 1.5px dashed var(--border-strong); border-radius: 8px; margin-bottom: 6px; background: var(--surface); }
.cal-invite-title { font-weight: 600; font-size: 13px; }
.cal-remind-box { display: flex; flex-direction: column; gap: 6px; }
.cal-remind-modes { display: flex; gap: 4px; flex-wrap: wrap; }
.cal-pill-btn { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: 999px; padding: 3px 12px; font-size: 12.5px; cursor: pointer; }
.cal-pill-btn.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }

/* ===================== профиль: вкладки, просмотр глазами пользователя */
.profile-tabs { margin: 0; border-bottom: 0; }
.profile-tabs a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.view-as-banner { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 16px; background: color-mix(in srgb, #8e4ec6 22%, var(--surface)); border-bottom: 2px solid #8e4ec6; font-size: 13.5px; }
.view-as-banner .btn { margin-left: auto; }
.view-as-btn { margin-right: 4px; }

/* ===================== мессенджер: треды, реакции, меню сообщения, топики, папки */
.chat-view { flex-direction: row; }
.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.thread-host { width: 380px; flex: none; border-left: 1px solid var(--border); display: flex; min-height: 0; }
.thread-host.hidden { display: none; }
.chat-view.thread-overlay .thread-host { position: absolute; inset: 0; width: auto; z-index: 8; background: var(--surface); border-left: 0; }
.chat-view { position: relative; }
.thread-panel { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); animation: thread-in .18s cubic-bezier(.2, .8, .2, 1); }
/* тред выезжает справа и уезжает обратно — быстро, чтобы было видно, откуда он и куда делся */
.thread-host.closing .thread-panel { animation: thread-out .14s ease-in forwards; }
@keyframes thread-in { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes thread-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(28px); } }
@media (prefers-reduced-motion: reduce) { .thread-panel, .thread-host.closing .thread-panel, .msg-menu, .msg-reactors { animation: none; } }
.thread-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); min-height: 52px; }
.thread-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-bell { font-size: 16px; }
.thread-bell:not(.on) { opacity: .6; }
.thread-sep { display: flex; align-items: center; gap: 8px; margin: 10px 0 4px; color: var(--text-3); font-size: 12px; }
.thread-sep::before, .thread-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.thread-root .chat-bubble { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); }
.chat-col { display: flex; flex-direction: column; min-width: 0; max-width: min(78%, 620px); }
.chat-msg.mine .chat-col { align-items: flex-end; margin-left: auto; }
.chat-col .chat-bubble { max-width: 100%; }
.chat-bubble-row { display: flex; align-items: flex-end; gap: 4px; max-width: 100%; }
.chat-msg.mine .chat-bubble-row { flex-direction: row-reverse; }
.chat-hover { display: flex; gap: 2px; opacity: 0; transition: opacity .12s; flex: none; padding-bottom: 2px; }
.chat-msg:hover .chat-hover { opacity: 1; }
.chat-hover button { border: 0; background: var(--surface); color: var(--text-2); width: 26px; height: 26px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); font-size: 13px; padding: 0; }
.chat-hover button:hover { color: var(--text); background: var(--surface-3); }
@media (hover: none) { .chat-hover { display: none; } }
.chat-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.chat-react { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 1px 8px; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; color: var(--text); }
.chat-react span { font-size: 11.5px; color: var(--text-2); }
.chat-react.mine { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
/* аватарки поставивших у реакции — как в Telegram: маленькие, внахлест */
.chat-react-avs { display: inline-flex; align-items: center; }
.chat-react-avs .avatar { width: 16px; height: 16px; min-width: 16px; font-size: 7.5px; border: 1.5px solid var(--surface); margin-left: -5px; box-sizing: content-box; }
.chat-react-avs .avatar:first-child { margin-left: 0; }
.chat-react.mine .chat-react-avs .avatar { border-color: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.chat-react .chat-react-avs { font-size: inherit; }
/* кто и когда поставил реакции */
.msg-reactors { position: fixed; z-index: 410; width: 270px; max-width: calc(100vw - 16px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; gap: 4px; animation: pop-in .14s cubic-bezier(.2, .8, .2, 1); transform-origin: top left; }
.msg-reactors-tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; border-bottom: 1px solid var(--border); scrollbar-width: none; }
.msg-reactors-tabs button { flex: none; border: 0; background: none; border-radius: 999px; padding: 4px 9px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.msg-reactors-tabs button.active { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); color: var(--text); }
.msg-reactors-list { max-height: 280px; overflow-y: auto; display: flex; flex-direction: column; }
.msg-reactors-row { display: flex; align-items: center; gap: 9px; padding: 6px 6px; border-radius: 8px; }
.msg-reactors-row:hover { background: var(--surface-2); }
.msg-reactors-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.msg-reactors-who b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-reactors-em { font-size: 18px; }
.msg-reactors-empty { padding: 8px; }
.msg-menu-who .chat-react-avs .avatar { border-color: var(--surface); }
@keyframes pop-in { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
/* новая реакция на мое сообщение: значок у переписки в списке (как сердечко в Telegram) */
.chat-react-badge { flex: none; display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 3px; margin-left: 4px; border-radius: 999px; background: color-mix(in srgb, #ef4444 18%, var(--surface)); font-size: 13px; line-height: 1; cursor: pointer; animation: react-badge-in .25s cubic-bezier(.2, 1.4, .4, 1); }
.chat-react-badge:hover { background: color-mix(in srgb, #ef4444 30%, var(--surface)); }
@keyframes react-badge-in { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
/* в переписке: круглая кнопка над полем ввода справа — к сообщению с новой реакцией */
.chat-react-jump { position: absolute; right: 12px; bottom: 100%; margin-bottom: 8px; z-index: 3; display: inline-flex; align-items: center; gap: 3px; height: 38px; min-width: 38px; padding: 0 9px; justify-content: center; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); box-shadow: 0 2px 8px rgba(0, 0, 0, .18); cursor: pointer; animation: react-badge-in .25s cubic-bezier(.2, 1.4, .4, 1); }
.chat-react-jump.hidden { display: none; }
.chat-react-jump-em { font-size: 18px; line-height: 1; }
.chat-react-jump b { font-size: 12px; color: var(--text-2); }
.chat-react-jump:hover { transform: scale(1.06); }
@media (prefers-reduced-motion: reduce) { .chat-react-badge, .chat-react-jump { animation: none; } }
.chat-thread-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 3px; border: 0; background: none; color: var(--link); font-size: 12.5px; cursor: pointer; padding: 3px 6px; border-radius: 8px; }
.chat-thread-link:hover { background: color-mix(in srgb, var(--link) 10%, transparent); }
.chat-thread-link.unread b { color: var(--text); }
.chat-thread-avs { display: inline-flex; }
.chat-thread-avs .avatar { width: 18px; height: 18px; font-size: 8px; margin-right: -5px; box-shadow: 0 0 0 2px var(--surface-2); }
.chat-thread-new { background: var(--danger); color: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px; font-weight: 600; }
.chat-edited { font-style: italic; }
.chat-edit { display: flex; flex-direction: column; gap: 6px; min-width: 240px; }
.chat-edit-input { width: 100%; border: 1px solid var(--border-strong); border-radius: 8px; padding: 6px 8px; font: inherit; color: var(--text); background: var(--surface); resize: vertical; }
.chat-edit-btns { display: flex; gap: 6px; align-items: center; }
.msg-menu { position: fixed; z-index: 400; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; min-width: 230px; display: flex; flex-direction: column; animation: pop-in .12s cubic-bezier(.2, .8, .2, 1); transform-origin: top left; }
.msg-menu-reacts { display: flex; gap: 2px; padding: 2px 2px 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.msg-menu-reacts button { border: 0; background: none; font-size: 20px; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; padding: 0; transition: transform .1s; }
.msg-menu-reacts button:hover { background: var(--surface-3); transform: scale(1.15); }
.msg-menu-more { font-size: 16px !important; color: var(--text-2); }
.msg-menu-item { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--text); font-size: 13.5px; text-align: left; }
.msg-menu-item:hover { background: var(--surface-2); }
.msg-menu-item.danger { color: var(--danger); }
.msg-menu-ic { display: grid; place-items: center; width: 18px; color: var(--text-2); }
.msg-menu-item.danger .msg-menu-ic { color: var(--danger); }
.chat-del { display: none; }
/* список «Треды» */
.msgr-threads .msgr-threads-av, .msgr-threads-av { display: inline-grid; place-items: center; background: color-mix(in srgb, var(--link) 18%, var(--surface)); color: var(--link); }
/* ---------------- кот (cat.js): живет поверх трекера */
.cat-layer { position: fixed; inset: 0; z-index: 95; pointer-events: none;
  --cat-fur: #9aa3af; --cat-stripe: #6f7884; --cat-belly: #e6e9ee; --cat-ear: #f2a7b5; --cat-eye: #6cae4a; --cat-leg: var(--cat-fur); --cat-paw: var(--cat-fur); --cat-earout: var(--cat-fur); }
.cat-layer.hidden, .cat-layer.off-here { display: none; }
/* сообщения открываются слоем поверх трекера (z-index 100) — кот гуляет и там, но не поверх других окон */
body:has(.messenger-overlay):not(:has(.overlay:not(.messenger-overlay))) > .cat-layer { z-index: 101; }
.cat { position: absolute; left: 0; top: 0; width: 111px; height: 74px; pointer-events: auto; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; will-change: transform; }
.cat:active { cursor: grabbing; }
.cat-inner { width: 100%; height: 100%; transform-origin: 50% 100%; filter: drop-shadow(0 3px 3px rgb(0 0 0 / .25)); }
.cat-inner.flip .cat-svg { transform: scaleX(-1); }
.cat-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.cat-svg .eyes, .cat-svg .mouth, .cat-svg .tears { display: none; }
/* рисунок шерсти */
.cat-svg .pt-stripe, .cat-svg .pt-spot, .cat-svg .pt-calico, .cat-svg .pt-point, .cat-svg .pt-tux { display: none; }
[data-pattern="tabby"] .pt-stripe, [data-pattern="spots"] .pt-spot, [data-pattern="calico"] .pt-calico,
[data-pattern="point"] .pt-point, [data-pattern="tuxedo"] .pt-tux { display: inline; }
.cat-svg .legs-far { filter: brightness(.8); }
.cat[data-face="open"] .eyes-open, .cat[data-face="closed"] .eyes-closed, .cat[data-face="happy"] .eyes-happy,
.cat[data-face="sad"] .eyes-sad, .cat[data-face="angry"] .eyes-angry, .cat[data-face="wide"] .eyes-wide { display: inline; }
.cat-pic .eyes-open, .cat-pic .mouth-ok { display: inline; }
.cat .mouth-ok { display: inline; }
.cat[data-face="sad"] .mouth-ok, .cat[data-face="angry"] .mouth-ok, .cat[data-face="wide"] .mouth-ok { display: none; }
.cat[data-face="sad"] .mouth-sad, .cat[data-face="angry"] .mouth-sad { display: inline; }
.cat[data-face="wide"] .mouth-open { display: inline; }
.cat .blush, .cat-pic .blush { fill: #f2a7b5; opacity: 0; transition: opacity .3s; }
.cat[data-face="happy"] .blush, .cat.petted .blush { opacity: .7; }
.cat.crying .tears { display: inline; }
.cat .tear { animation: cat-tear 1.4s ease-in infinite; transform-box: fill-box; }
.cat .tear.t2 { animation-delay: .7s; }
@keyframes cat-tear { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(14px); opacity: 0; } }
/* хвост и дыхание — всегда, кроме сна и «в руках» */
.cat-tail { transform-origin: 24px 46px; animation: cat-tail 2.6s ease-in-out infinite; }
@keyframes cat-tail { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-12deg); } }
.cat.mood-grumpy .cat-tail { animation-duration: .45s; }
.cat-body { transform-origin: 52px 62px; animation: cat-breath 3.2s ease-in-out infinite; }
@keyframes cat-breath { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.01, 1.035); } }
.cat-head { transform-origin: 84px 40px; transition: transform .25s; }
.cat-layer, .cat-pic { --cat-line: rgb(0 0 0 / .28); }
/* толщина от веса: --gx/--gy (cat.js girth) */
.cat-girth { transform: scale(var(--gx, 1), var(--gy, 1)); transform-origin: 54px 63px; transition: transform 1.2s ease; }
/* ухо иногда дергается, хвост кончиком поигрывает */
.cat .ear-r { transform-box: fill-box; transform-origin: 30% 100%; animation: cat-ear 7s ease-in-out infinite; }
@keyframes cat-ear { 0%, 90%, 100% { transform: rotate(0); } 92% { transform: rotate(-14deg); } 94% { transform: rotate(4deg); } 96% { transform: rotate(-8deg); } }
/* шкодит: подняла переднюю лапу и толкнула вещь */
.cat[data-pose="swipe"] .leg-fn { animation: cat-swipe .4s ease-in-out 2 alternate; }
@keyframes cat-swipe { from { transform: rotate(0); } to { transform: rotate(-75deg) translateY(-4px); } }
.cat[data-pose="swipe"] .cat-head { transform: rotate(6deg); }
.cat .leg { transform-box: fill-box; transform-origin: 50% 8%; transition: transform .2s, opacity .3s; }
/* позы: идет — лапы крест-накрест (передняя ближняя с задней дальней), спина чуть покачивается */
.cat[data-pose="walk"] .cat-inner { animation: cat-walk .3s ease-in-out infinite alternate; }
@keyframes cat-walk { from { transform: translateY(0); } to { transform: translateY(-2.5px); } }
.cat[data-pose="walk"] .leg-fn, .cat[data-pose="walk"] .leg-bf { animation: cat-step .3s ease-in-out infinite alternate; }
.cat[data-pose="walk"] .leg-ff, .cat[data-pose="walk"] .leg-bn { animation: cat-step .3s ease-in-out infinite alternate-reverse; }
@keyframes cat-step { from { transform: rotate(-24deg); } to { transform: rotate(24deg); } }
.cat[data-pose="walk"] .cat-tail { animation: cat-tail .6s ease-in-out infinite; }
/* прыжок: передние лапы вперед, задние назад, вытянулся */
.cat[data-pose="jump"] .cat-inner { transform: rotate(-12deg) scale(1.06, .95); transition: transform .15s; }
.cat[data-pose="jump"] .leg-fn, .cat[data-pose="jump"] .leg-ff { transform: rotate(-55deg); }
.cat[data-pose="jump"] .leg-bn, .cat[data-pose="jump"] .leg-bf { transform: rotate(50deg); }
.cat[data-pose="land"] .cat-inner { transform: scale(1.08, .88); transition: transform .12s; }
.cat[data-pose="fall"] .cat-inner { transform: rotate(6deg); }
.cat[data-pose="fall"] .leg-fn, .cat[data-pose="fall"] .leg-ff { transform: rotate(-35deg); }
.cat[data-pose="fall"] .leg-bn, .cat[data-pose="fall"] .leg-bf { transform: rotate(35deg); }
/* сон: лег клубком — лапы поджал, голову опустил на лапы, хвост обернул */
.cat[data-pose="sleep"] .leg { opacity: 0; transform: scaleY(.3); }
.cat[data-pose="sleep"] .cat-body { transform: translateY(9px) scale(1, .92); animation: none; }
.cat[data-pose="sleep"] .cat-head { transform: translate(-6px, 17px) rotate(10deg); }
.cat[data-pose="sleep"] .cat-tail { animation: none; transform: translate(10px, 10px) rotate(60deg); }
/* за шкирку: повис, задние лапы и хвост вниз, слегка покачивается */
.cat[data-pose="held"] .cat-inner { transform-origin: 68% 22%; animation: cat-dangle 1.1s ease-in-out infinite; }
.cat[data-pose="held"] .cat-inner.flip { transform-origin: 32% 22%; animation-name: cat-dangle-l; }
@keyframes cat-dangle { 0%, 100% { transform: rotate(64deg); } 50% { transform: rotate(74deg); } }
@keyframes cat-dangle-l { 0%, 100% { transform: rotate(-64deg); } 50% { transform: rotate(-74deg); } }
.cat[data-pose="held"] .leg { transform: rotate(-58deg); }
.cat[data-pose="held"] .cat-head { transform: rotate(-50deg); }
.cat[data-pose="held"] .cat-tail { animation: none; transform: rotate(-70deg); }
/* ест: голова к миске */
.cat[data-pose="eat"] .cat-head { animation: cat-eat .5s ease-in-out infinite alternate; }
@keyframes cat-eat { from { transform: translate(3px, 15px) rotate(16deg); } to { transform: translate(3px, 18px) rotate(10deg); } }
.cat[data-pose="eat"] .leg-fn { transform: rotate(-10deg); }
.cat[data-pose="eat"] .leg-ff { transform: rotate(10deg); }
.cat.petted .cat-head { transform: rotate(-8deg); }
.cat.petted .cat-tail { animation-duration: .9s; }
/* сон: «z z z» */
.cat-zz { position: absolute; right: -6px; top: -4px; font: 700 13px/1 system-ui; color: #9fb3ff; display: none; }
.cat-zz i, .cat-zz b { font-style: normal; display: inline-block; margin-left: 2px; }
.cat[data-pose="sleep"] .cat-zz { display: block; }
.cat-zz, .cat-zz i, .cat-zz b { animation: cat-z 2.4s ease-in-out infinite; }
.cat-zz i { animation-delay: .5s; font-size: 11px; } .cat-zz b { animation-delay: 1s; font-size: 9px; }
@keyframes cat-z { 0% { opacity: 0; transform: translateY(4px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(-12px); } }
/* реплика над котом */
.cat-bubble { position: absolute; left: 0; top: 0; max-width: min(300px, calc(100vw - 16px)); padding: 8px 12px; border-radius: 14px; pointer-events: auto; cursor: pointer;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: 0 8px 24px rgb(0 0 0 / .25); font-size: 13px; line-height: 1.35; }
.cat-bubble::after { content: ''; position: absolute; left: var(--tail, 50%); bottom: -7px; width: 12px; height: 12px; margin-left: -6px; background: inherit;
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); transform: rotate(45deg); }
.cat-bubble.hidden { display: none; }
.cat-bubble.sticky { padding-right: 28px; cursor: default; max-width: min(340px, calc(100vw - 16px)); }
.cat-bubble-title { font-size: 11px; font-weight: 700; color: var(--text-2); margin-bottom: 3px; }
.cat-bubble-x { position: absolute; right: 6px; top: 6px; width: 20px; height: 20px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--text-2); cursor: pointer; line-height: 1; font-size: 14px; }
.cat-bubble-x:hover { background: var(--surface-3); color: var(--text); }
/* предмет в лапах (лупа, мячик, шар, телефон) — у передней лапы, поворачивается вместе с котом */
.cat-prop { position: absolute; left: 70%; top: 34%; width: 30px; height: 30px; display: none; pointer-events: none; transform-origin: 30% 80%; }
.cat-inner.flip .cat-prop { left: auto; right: 70%; transform: scaleX(-1); }
.cat[data-prop]:not([data-prop=""]) .cat-prop { display: block; animation: cat-prop-in .35s ease-out; }
.cat[data-prop="magnifier"] .cat-prop { animation: cat-loupe 2.2s ease-in-out infinite; }
@keyframes cat-prop-in { from { opacity: 0; transform: translateY(8px) scale(.6); } }
@keyframes cat-loupe { 0%, 100% { translate: 0 0; } 30% { translate: 6px -3px; } 60% { translate: -3px 2px; } }
.cat-prop svg { width: 100%; height: 100%; display: block; }
.cat[data-pose="peek"] .cat-head { transform: translate(3px, 3px) rotate(8deg); }
.cat[data-pose="peek"] .leg-fn { transform: rotate(-55deg) translateY(-3px); }
/* кот в кресле-качалке качается вместе с ним */
.cat.rocking .cat-inner { transform-origin: 50% 160%; animation: cat-rock-cat 2.6s ease-in-out infinite; }
@keyframes cat-rock-cat { 0%, 100% { rotate: -3deg; } 50% { rotate: 3deg; } }
/* +1 / −1 привязанности */
.cat-delta { position: absolute; font: 700 14px/1 system-ui, sans-serif; pointer-events: none; text-shadow: 0 1px 3px rgb(0 0 0 / .5); animation: cat-delta 1.8s ease-out forwards; white-space: nowrap; }
.cat-delta.up { color: #7cf29a; }
.cat-delta.down { color: #ff8a8a; }
@keyframes cat-delta { from { opacity: 0; transform: translateY(6px) scale(.7); } 15% { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-42px); } }
/* слезы: ручьи по щекам и крупные капли, всхлипывает */
.cat .streak { opacity: 0; }
.cat.crying .streak { opacity: .85; animation: cat-streak 1.2s ease-in-out infinite; }
@keyframes cat-streak { 50% { opacity: .45; } }
.cat.crying .cat-inner { animation: cat-sob 1.6s ease-in-out infinite; }
@keyframes cat-sob { 0%, 60%, 100% { translate: 0 0; } 65% { translate: 0 -2px; } 72% { translate: 0 0; } 78% { translate: 0 -2px; } }
.cat.crying .tear { animation-duration: 1s; }
/* грусть: сидит, опустив голову и уши, хвост поджат */
.cat[data-pose="sulk"] .cat-head { transform: translate(-3px, 9px) rotate(14deg); }
.cat[data-pose="sulk"] .cat-tail { animation: none; transform: rotate(35deg) translate(4px, 6px); }
.cat[data-pose="sulk"] .cat-body { transform: translateY(5px) scaleY(.94); animation: none; }
.cat[data-pose="sulk"] .leg { transform: scaleY(.75); }
.cat.hiding .cat-tail { animation: cat-tail 1.4s ease-in-out infinite; }
/* развлекается: мячик подбрасывает, селфи — лапа с телефоном вверх, охота — припал к полу */
.cat[data-pose="play"] .leg-fn { animation: cat-swipe .35s ease-in-out infinite alternate; }
.cat[data-prop="ball"] .cat-prop { top: 52%; left: 78%; animation: cat-ballhop .7s ease-in-out infinite; }
@keyframes cat-ballhop { 0%, 100% { translate: 0 0; } 50% { translate: 4px -18px; } }
.cat[data-pose="selfie"] .leg-fn { transform: rotate(-120deg) translateY(-6px); }
.cat[data-prop="phone"] .cat-prop { top: 0; left: 76%; }
.cat[data-pose="selfie"] .cat-head { transform: rotate(-10deg); }
.cat[data-prop="crystal"] .cat-prop { top: 46%; left: 80%; filter: drop-shadow(0 0 8px #b18cff); }
.cat[data-pose="crouch"] .cat-body { transform: translateY(8px) scaleY(.88); animation: cat-wiggle .25s ease-in-out infinite alternate; }
.cat[data-pose="crouch"] .leg { transform: scaleY(.6); }
.cat[data-pose="crouch"] .cat-head { transform: translateY(8px); }
@keyframes cat-wiggle { from { transform: translate(-1px, 8px) scaleY(.88); } to { transform: translate(1px, 8px) scaleY(.88); } }
.cat-flash { position: absolute; left: 60%; top: -20%; width: 60px; height: 60px; border-radius: 50%; background: radial-gradient(#fff, transparent 70%); animation: cat-flash .5s ease-out forwards; pointer-events: none; }
@keyframes cat-flash { from { opacity: 1; transform: scale(.3); } to { opacity: 0; transform: scale(1.6); } }
.cat-dream { position: absolute; right: -24px; top: -54px; pointer-events: none; }
.cat-dream i { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 4px rgb(0 0 0 / .25); left: 0; top: 46px; }
.cat-dream i + i { width: 12px; height: 12px; left: 8px; top: 34px; }
.cat-dream b { display: grid; place-items: center; width: 44px; height: 36px; margin-left: 12px; border-radius: 50%; background: var(--surface); box-shadow: 0 2px 8px rgb(0 0 0 / .3); font-size: 20px; animation: cat-prop-in .4s ease-out; }
/* туалет: присел, хвост трубой; струйка или «плюх»; закапывает — шкрябает лапой, летит «песок» */
.cat[data-pose="toilet"] .cat-body { transform: translateY(6px) scaleY(.9); animation: none; }
.cat[data-pose="toilet"] .leg-bn, .cat[data-pose="toilet"] .leg-bf { transform: scaleY(.55); }
.cat[data-pose="toilet"] .cat-tail { animation: none; transform: rotate(-25deg); }
.cat-toilet-fx { position: absolute; left: 22%; top: 78%; pointer-events: none; }
.cat-toilet-fx.pee { width: 3px; height: 30px; border-radius: 2px; background: linear-gradient(#f2d74e, #f2d74e00); animation: cat-pee .4s linear infinite; }
@keyframes cat-pee { 0% { opacity: .5; transform: scaleY(.85); } 50% { opacity: 1; transform: scaleY(1.05); } 100% { opacity: .6; transform: scaleY(.9); } }
.cat-toilet-fx.poop { width: 9px; height: 9px; border-radius: 50% 50% 45% 45%; background: #7a4b2a; animation: cat-poopdrop 1.4s ease-in 1.2s infinite; opacity: 0; }
@keyframes cat-poopdrop { 0% { opacity: 1; transform: translateY(0); } 70% { opacity: 1; transform: translateY(22px); } 100% { opacity: 0; transform: translateY(26px); } }
.cat[data-pose="bury"] .leg-fn { animation: cat-bury .22s ease-in-out infinite alternate; }
.cat[data-pose="bury"] .leg-ff { animation: cat-bury .22s ease-in-out infinite alternate-reverse; }
@keyframes cat-bury { from { transform: rotate(-35deg); } to { transform: rotate(25deg); } }
.cat[data-pose="bury"] .cat-head { transform: translate(3px, 10px) rotate(16deg); }
.cat[data-pose="bury"]::after { content: '· · ·'; position: absolute; left: 82%; bottom: 2px; color: #c9b27a; font-weight: 700; letter-spacing: 2px; animation: cat-sand .44s linear infinite; pointer-events: none; }
@keyframes cat-sand { from { opacity: 1; transform: translate(0, 0); } to { opacity: 0; transform: translate(14px, -10px); } }
/* укол: шприц летит к попе, жидкость уходит */
.cat-syringe { position: absolute; left: 0; top: 0; width: 60px; height: 20px; pointer-events: none; transition: transform .6s cubic-bezier(.3, .7, .4, 1); }
.cat-syringe svg { width: 100%; height: 100%; display: block; }
.cat-syringe.push .cat-syr-liquid { transition: width .8s ease-in; width: 0; }
/* бегом — лапы чаще */
.cat.running .leg-fn, .cat.running .leg-bf, .cat.running .leg-ff, .cat.running .leg-bn { animation-duration: .16s !important; }
/* лазер */
.cat-laser { position: absolute; left: 0; top: 0; width: 14px; height: 14px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, #fff 0 18%, #ff2b2b 30%, rgb(255 43 43 / .35) 60%, transparent 72%); box-shadow: 0 0 14px 6px rgb(255 30 30 / .55);
  animation: cat-laser .5s ease-in-out infinite alternate; }
@keyframes cat-laser { to { box-shadow: 0 0 20px 9px rgb(255 30 30 / .7); } }
body.cat-laser-on .desk-content, body.cat-laser-on .desk-content * { cursor: none !important; }
/* когтеточка: дерет столбик (на задних лапах), спит в домике */
.cat[data-pose="scratch"] .cat-inner { transform-origin: 30% 100%; transform: rotate(-38deg); }
.cat[data-pose="scratch"] .leg-fn { animation: cat-bury .18s ease-in-out infinite alternate; }
.cat[data-pose="scratch"] .leg-ff { animation: cat-bury .18s ease-in-out infinite alternate-reverse; }
.cat.in-house { opacity: 0; transition: opacity .4s; pointer-events: none; }
.cat-house-zz { position: absolute; font: 700 12px/1 system-ui; color: #9fb3ff; pointer-events: none; }
.cat-house-zz, .cat-house-zz i, .cat-house-zz b { animation: cat-z 2.4s ease-in-out infinite; font-style: normal; display: inline-block; }
.cat-house-zz i { animation-delay: .5s; } .cat-house-zz b { animation-delay: 1s; }
.cat-perch, .cat-seat { position: absolute; height: 4px; pointer-events: none; }
/* шкаф-полка: закрытый — доска с первыми пачками */
.cat-f-cabinet:not(.open) { display: flex; flex-direction: column; justify-content: flex-end; filter: drop-shadow(0 4px 4px rgb(0 0 0 / .22)); }
.cat-cab-mini { display: flex; gap: 4px; align-items: flex-end; justify-content: center; height: 46px; padding: 0 8px; pointer-events: none; }
.cat-cab-mini-pack { width: 28px; height: 36px; }
.cat-cab-mini-pack svg { width: 100%; height: 100%; display: block; }
.cat-cab-board { position: relative; height: 12px; border-radius: 3px; background: linear-gradient(#c8925f, #8a5d38); pointer-events: none; }
.cat-cab-board i { position: absolute; top: 12px; left: 16px; width: 12px; height: 12px; background: #6b4a2b; clip-path: polygon(0 0, 100% 0, 0 100%); }
.cat-cab-board i + i { left: auto; right: 16px; clip-path: polygon(0 0, 100% 0, 100% 100%); }
.cat-cab-tools { display: flex; gap: 6px; align-items: center; }
/* люстра-вентилятор и ветер от нее */
.cat-f-fan { z-index: 5; }
.cat-f-fan svg { overflow: visible; }
.cat-f-fan.spinning .fan-blades { transform-box: fill-box; transform-origin: 50% 50%; animation: cat-spin .45s linear infinite; }
@keyframes cat-spin { to { transform: rotate(360deg); } }
.desk.cat-wind .cat-plant-svg { animation: cat-sway-wind 1.3s ease-in-out infinite; }
@keyframes cat-sway-wind { 0%, 100% { transform: rotate(-5deg) skewX(2deg); } 50% { transform: rotate(4deg) skewX(-2deg); } }
.desk.cat-wind .vine-sway { animation: cat-vsway-wind 1.8s ease-in-out infinite; }
@keyframes cat-vsway-wind { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.desk.cat-wind .cat-curtain { animation: cat-breeze 1.3s ease-in-out infinite; }
.desk.cat-wind .cat-f-hook svg, .desk.cat-wind .cat-f-picture svg { animation: cat-sway-wind 2.6s ease-in-out infinite; transform-origin: 50% 0; }
/* виджет «Скорость печати» */
.cat-ty { display: flex; flex-direction: column; gap: 6px; }
.cat-ty-now b { font-size: 30px; line-height: 1; }
.cat-ty-rating { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.cat-ty-row { display: grid; grid-template-columns: 22px minmax(60px, 1fr) 1.2fr auto; align-items: center; gap: 6px; font-size: 12px; }
.cat-ty-row.me .cat-ty-name { font-weight: 700; }
.cat-ty-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-ty-bar { display: block; height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.cat-ty-bar b { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #7c6cf0, #4dd4ff); }
.cat-ty-num { color: var(--text-2); white-space: nowrap; }
/* ---------------- Стафф */
.staff-page { padding-top: 0 !important; }
.staff-top { display: flex; align-items: center; gap: 22px; padding: 12px 0 16px; flex-wrap: wrap; }
.staff-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-size: 22px; }
.staff-logo-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #ffb347, #ff7a1a); font-size: 18px; }
.staff-tab { color: var(--text-2); text-decoration: none; font-weight: 500; padding: 4px 2px; border-bottom: 2px solid transparent; }
.staff-tab.on, .staff-tab:hover { color: var(--text); border-bottom-color: var(--accent); }
.staff-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.staff-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.staff-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; }
.staff-pencil { position: absolute; right: 10px; top: 10px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--text); cursor: pointer;
  display: grid; place-items: center; opacity: 0; transition: opacity .15s; box-shadow: 0 2px 8px rgb(0 0 0 / .25); z-index: 2; }
.editable:hover > .staff-pencil, .staff-photo.editable:hover .staff-pencil, .staff-pencil:focus-visible { opacity: 1; }
@media (hover: none) { .staff-pencil { opacity: .85; } }
.staff-photo { position: relative; border-radius: 22px; overflow: hidden; aspect-ratio: 1 / 1; background: var(--surface-2); }
.staff-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.staff-photo-empty { display: grid; place-items: center; width: 100%; height: 100%; font-size: 90px; font-weight: 700; color: var(--text-2); }
.staff-thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.staff-thumbs img { width: 62px; height: 62px; object-fit: cover; border-radius: 14px; cursor: pointer; border: 2px solid transparent; }
.staff-thumbs img.main { border-color: var(--accent); }
.staff-thumb-add { width: 62px; height: 62px; border-radius: 14px; border: 2px dashed var(--border); background: none; color: var(--text-2); font-size: 24px; cursor: pointer; }
.staff-thumb-add:hover { border-color: var(--accent); color: var(--text); }
.staff-photo img { cursor: zoom-in; }
/* занятость: неделя под фото (Стафф) */
.busy-card { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.busy-head { display: flex; align-items: center; gap: 4px; }
.busy-range { white-space: nowrap; }
.busy-status { padding: 4px 10px; border-radius: 999px; align-self: flex-start; }
.busy-status.free { background: color-mix(in srgb, #30a46c 18%, transparent); color: #3dd68c; }
.busy-status.busy { background: color-mix(in srgb, #e5484d 18%, transparent); color: #ff8589; }
/* сутки 0–24 в прокрутке (видно 11 часов), дни — столбиками; заголовки дней — над прокруткой */
.busy-week { display: grid; grid-template-columns: 18px repeat(5, 1fr) repeat(2, .7fr); gap: 3px; }
.busy-scroll { overflow-y: auto; overscroll-behavior: contain; border-radius: 6px; scrollbar-width: thin; }
.busy-hours { position: relative; }
.busy-hours span { position: absolute; right: 2px; transform: translateY(-50%); font-size: 9.5px; color: var(--text-2); }
.busy-day { height: 30px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; font-size: 10.5px; color: var(--text-2); }
.busy-day b { font-size: 13px; color: var(--text); }
.busy-day.today b { color: #fff; background: #e5484d; border-radius: 999px; padding: 0 6px; }
.busy-day.weekend { opacity: .6; }
.busy-track { position: relative; height: 100%; border-radius: 4px; overflow: hidden;
  background: var(--surface-2) repeating-linear-gradient(transparent 0 calc(16px * 2 - 1px), rgb(127 127 127 / .14) calc(16px * 2 - 1px) calc(16px * 2)); }
.busy-track.weekend { background: repeating-linear-gradient(45deg, var(--surface-2) 0 6px, transparent 6px 10px); }
.busy-b { position: absolute; left: 2px; right: 2px; border-radius: 3px; background: #3e63dd; cursor: pointer; }
.busy-b.tent { background: repeating-linear-gradient(45deg, #3e63dd 0 4px, #3e63dd66 4px 8px); }
.busy-all { position: absolute; inset: 0; background: color-mix(in srgb, #3e63dd 28%, transparent); }
.busy-now { position: absolute; left: 0; right: 0; height: 2px; background: #e5484d; box-shadow: 0 0 4px #e5484d; }
/* занятость в форме события: строка на человека, часы по горизонтали */
.busy-tl { display: flex; flex-direction: column; gap: 6px; }
.busy-tl-scroll { overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid var(--border); border-radius: 10px; }
.busy-tl-grid { position: relative; min-width: 560px; padding: 4px 8px 6px; --who: 130px; }
.busy-tl-row { display: flex; align-items: center; gap: 8px; height: 30px; }
.busy-tl-who { width: var(--who); flex: none; display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12.5px; }
.busy-tl-who .avatar { width: 22px; height: 22px; flex: none; font-size: 10px; }
.busy-tl-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.busy-tl-dot { width: 8px; height: 8px; border-radius: 50%; background: #e5484d; flex: none; }
.busy-tl-track { position: relative; flex: 1; height: 20px; border-radius: 5px; background: var(--surface-2); cursor: copy; }
.busy-tl-hours { height: 18px; }
.busy-tl-hours .busy-tl-track { background: none; cursor: default; }
.busy-tl-hours .busy-tl-track span { position: absolute; transform: translateX(-50%); font-size: 10px; color: var(--text-2); }
.busy-tl-track .busy-b { top: 2px; bottom: 2px; left: auto; right: auto; }
.busy-tl-row.clash .busy-tl-name { color: #ff8589; }
/* время события — подсветка в каждой строке: зеленая, если человек свободен, красная — если занят */
.busy-tl-slot { position: absolute; top: -4px; bottom: -4px; border-radius: 4px; pointer-events: none; z-index: 1;
  background: color-mix(in srgb, #30a46c 22%, transparent); box-shadow: inset 0 0 0 2px #30a46c; }
.busy-tl-row.clash .busy-tl-slot { background: color-mix(in srgb, #e5484d 22%, transparent); box-shadow: inset 0 0 0 2px #e5484d; }
.busy-tl-hours .busy-tl-slot { display: none; }
@media (max-width: 760px) { .busy-tl-grid { --who: 92px; } }
.staff-branchbar { padding: 12px 20px; background: var(--surface-2); font-weight: 500; border-bottom: 1px solid var(--border); }
.staff-main-body { padding: 16px 20px 18px; display: flex; flex-direction: column; gap: 8px; }
.staff-name-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.staff-name { margin: 0; font-size: 26px; line-height: 1.2; }
.staff-name::first-letter { color: #ff4f4f; }
.staff-login { color: var(--text-2); font-size: 15px; }
.staff-position { font-size: 15px; }
.staff-event { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 999px; background: color-mix(in srgb, #3e63dd 22%, transparent);
  border: 1px solid color-mix(in srgb, #3e63dd 40%, transparent); font-size: 13px; }
.staff-event.now { background: color-mix(in srgb, #30a46c 22%, transparent); border-color: color-mix(in srgb, #30a46c 45%, transparent); }
.staff-sep { height: 1px; background: var(--border); margin: 6px 0; }
.staff-rows { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px 16px; align-items: center; }
.staff-contacts { padding: 18px 20px; }
.staff-k { color: var(--text-2); }
.staff-path { display: flex; flex-direction: column; gap: 3px; }
.staff-path a { color: var(--text); text-decoration: none; }
.staff-path a:hover { color: var(--accent); }
.staff-chev { color: var(--text-2); margin-left: 6px; }
.staff-label { display: inline-flex; align-items: center; gap: 8px; }
.staff-label-ic { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 12px; }
.staff-person { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; }
.staff-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.staff-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 6px 6px 8px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); text-decoration: none;
  background: var(--surface); font: inherit; font-size: 13.5px; cursor: pointer; max-width: 100%; }
.staff-chip:hover { border-color: var(--accent); }
.staff-chip-ic, .staff-chip-ic svg { width: 18px; height: 18px; display: block; flex: none; }
.staff-chip-v { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.staff-copy { border: 0; background: var(--surface-2); color: var(--text-2); border-radius: 8px; width: 26px; height: 26px; display: grid; place-items: center; cursor: pointer; flex: none; }
.staff-chip-msg { padding-right: 12px; }
.staff-side { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.staff-side-head { display: flex; align-items: center; gap: 4px; }
.staff-periods { display: flex; gap: 4px; background: var(--surface-2); border-radius: 10px; padding: 3px; }
.staff-periods button { flex: 1; border: 0; background: none; color: var(--text-2); padding: 5px 4px; border-radius: 8px; cursor: pointer; font-size: 12px; }
.staff-periods button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / .2); }
.staff-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.staff-stat { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); }
.staff-stat-ic { font-size: 16px; }
.staff-stat b { font-size: 18px; }
.staff-ach-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.staff-ach { position: relative; border: 0; background: var(--surface-2); border-radius: 14px; aspect-ratio: 1 / 1; padding: 6px; cursor: pointer; transition: transform .15s; }
.staff-ach:hover { transform: translateY(-2px) scale(1.04); }
.staff-ach img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 3px 4px rgb(0 0 0 / .3)); }
.staff-ach.big { aspect-ratio: auto; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text); }
.staff-ach.big img { width: 120px; height: 120px; }
.staff-pin { position: absolute; top: 4px; right: 6px; }
.staff-achbox { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.staff-ach-all { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.staff-ach-view { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.staff-ach-view > img { width: 180px; height: 180px; object-fit: contain; filter: drop-shadow(0 6px 8px rgb(0 0 0 / .35)); }
.staff-ach-msg { font-style: italic; margin: 8px 0; }
.staff-ach-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; max-height: 340px; overflow: auto; }
.staff-ach-opt { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px; border: 2px solid transparent; border-radius: 12px; background: var(--surface-2); color: var(--text); cursor: pointer; }
.staff-ach-opt.on { border-color: var(--accent); }
.staff-ach-opt img { width: 72px; height: 72px; object-fit: contain; }
.staff-ach-del { position: absolute; top: 2px; right: 6px; color: var(--text-2); }
.staff-ct-rows { display: flex; flex-direction: column; gap: 6px; }
.staff-ct-row { display: grid; grid-template-columns: 18px 130px 1fr 150px 30px; gap: 6px; align-items: center; }
.staff-ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.staff-ph { position: relative; border-radius: 14px; overflow: hidden; background: var(--surface-2); aspect-ratio: 1 / 1; border: 2px solid transparent; }
.staff-ph.main { border-color: var(--accent); }
.staff-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.staff-ph-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 4px; align-items: center; justify-content: space-between; padding: 6px; background: linear-gradient(transparent, rgb(0 0 0 / .65)); color: #fff; }
.staff-ph-add { display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 28px; color: var(--text-2); cursor: pointer; border: 2px dashed var(--border); }
.staff-people { display: flex; flex-direction: column; gap: 12px; max-width: 900px; }
.staff-branch { border-left: 3px solid var(--border); padding: 6px 0 6px 12px; display: flex; flex-direction: column; gap: 2px; }
.staff-branch:target { border-left-color: var(--accent); }
.staff-branch-head { display: flex; align-items: center; gap: 4px; font-size: 15px; padding-bottom: 4px; }
.staff-person-row { display: grid; grid-template-columns: 22px 28px minmax(140px, auto) 1fr; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; color: var(--text); text-decoration: none; }
a.staff-person-row:hover { background: var(--surface-2); }
.staff-crown { font-size: 15px; }
.staff-crown.lead { filter: drop-shadow(0 0 3px #f2c94c88); }
.staff-crown.assistant { filter: grayscale(1) brightness(1.3); }
.staff-crown-gap { width: 15px; }
.staff-offices { position: relative; min-height: 70vh; border-radius: 22px; overflow: hidden; background: linear-gradient(#05081a, #13213f); display: grid; place-items: center; color: #e6ecff; }
.staff-off-stars { position: absolute; inset: 0; background: radial-gradient(1.5px 1.5px at 20% 30%, #fff 50%, transparent 52%) 0 0 / 160px 130px,
  radial-gradient(1px 1px at 70% 60%, #cfe0ff 50%, transparent 52%) 0 0 / 110px 90px; animation: cat-twinkle 2.8s ease-in-out infinite alternate; }
.staff-off-stars.s2 { background-position: 50px 40px, 20px 70px; animation-duration: 1.9s; animation-delay: -1s; }
.staff-off-body { position: relative; text-align: center; padding: 30px; }
.staff-off-ic { font-size: 70px; animation: cat-gift 3s ease-in-out infinite; }
@media (max-width: 1100px) { .staff-grid { grid-template-columns: 260px minmax(0, 1fr); } .staff-right { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) {
  .staff-grid { grid-template-columns: 1fr; }
  .staff-right { display: flex; }
  .staff-rows { grid-template-columns: 1fr; gap: 4px 0; }
  .staff-k { margin-top: 8px; }
  .staff-ct-row { grid-template-columns: 18px 1fr 30px; }
  .staff-ct-row .input:nth-of-type(2), .staff-ct-row .input:nth-of-type(3) { grid-column: 2 / 3; }
  /* телефон: шапка как в Telegram (кружок слева, ФИО и должность справа); большое фото, ФИО и должность в карточке —
     скрыты (они в шапке); порядок: анкета, контакты, занятость и остальные фото, успехи, ачивки */
  .staff-m-head { display: grid !important; }
  .staff-left .staff-photo, .staff-d-thumbs { display: none !important; }
  .staff-main .staff-name-row, .staff-main .staff-position, .staff-main .staff-event, .staff-main .staff-sep { display: none; }
  .staff-grid > .staff-col:not(.staff-left):not(.staff-right) { order: 1; }
  .staff-grid > .staff-left { order: 2; }
  .staff-grid > .staff-right { order: 3; }
  .staff-m-photos { display: flex !important; }
}
.staff-m-head { display: none; grid-template-columns: 84px minmax(0, 1fr); gap: 4px 14px; align-items: center; margin-bottom: 14px; }
.staff-m-ava { position: relative; width: 84px; height: 84px; }
.staff-m-ava img, .staff-m-ava .staff-photo-empty { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--surface-2); font-size: 34px; cursor: zoom-in; }
.staff-m-ava-edit { position: absolute; right: -2px; bottom: -2px; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--bg); background: var(--surface-2); color: var(--text); font-size: 13px; cursor: pointer; }
.staff-m-info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.staff-m-info .staff-name { font-size: 20px; line-height: 1.2; }
.staff-m-info .staff-name-row { gap: 2px 8px; }
.staff-m-info .staff-login { font-size: 13px; }
.staff-m-info .staff-position { font-size: 14px; color: var(--text-2); }
.staff-m-ev { grid-column: 1 / -1; }
.staff-m-ev .staff-event { font-size: 13px; }
.staff-m-photos { display: none; flex-direction: column; gap: 8px; padding: 12px 14px; }
.staff-m-photos .staff-thumbs img, .staff-m-photos .staff-thumb-add { width: 56px; height: 56px; border-radius: 12px; }
/* ---------------- улица котов */
.street-page { padding: 0 !important; }
.st-wrap { display: flex; height: calc(100vh - var(--topbar-h, 0px)); min-height: 520px; }
.street { --cat-ear: #f2a7b5; --cat-line: rgb(0 0 0 / .3); position: relative; flex: 1; overflow: hidden; background: linear-gradient(#05081a 0%, #0b1433 55%, #10223a 100%); user-select: none; }
.street.planting, .visit-desk.placing { cursor: crosshair; }
.st-sky { position: absolute; inset: 0; pointer-events: none; }
.st-stars { position: absolute; inset: 0; background: radial-gradient(1.4px 1.4px at 10% 20%, #fff 50%, transparent 52%) 0 0 / 190px 150px,
  radial-gradient(1px 1px at 60% 70%, #cfe0ff 50%, transparent 52%) 0 0 / 130px 110px, radial-gradient(1.6px 1.6px at 80% 30%, #fff8d6 50%, transparent 52%) 0 0 / 260px 200px;
  animation: cat-twinkle 3.2s ease-in-out infinite alternate; }
.st-stars2 { background-position: 40px 60px, 90px 20px, 10px 120px; animation-duration: 2.3s; animation-delay: -1s; }
.st-comet { position: absolute; width: 140px; height: 2px; background: linear-gradient(90deg, #fff, transparent); transform: rotate(-24deg); animation: st-comet 1.5s ease-in forwards; border-radius: 2px; }
@keyframes st-comet { from { opacity: 0; translate: 0 0; } 15% { opacity: 1; } to { opacity: 0; translate: -340px 150px; } }
.street-page { max-width: none !important; }
/* перспектива: горизонт --hz (ставит JS); у горизонта — холмы и джунгли, ниже — вся земля */
.st-jungle-wrap { position: absolute; left: 0; right: 0; bottom: calc(100% - var(--hz, 60%) - 8px); height: 30%; pointer-events: none; }
.st-jungle { position: absolute; left: -3%; width: 106%; bottom: 0; transform-origin: 50% 100%; }
.st-jungle.far { height: 92%; opacity: .9; animation: st-sway 9s ease-in-out infinite; }
.st-jungle.near { height: 70%; animation: st-sway 7s ease-in-out infinite reverse; }
@keyframes st-sway { 0%, 100% { transform: skewX(0); } 50% { transform: skewX(1.2deg); } }
.street.gust .st-jungle { animation-duration: 1.4s; }
.street.gust .st-leaves { animation: st-rustle .35s ease-in-out infinite alternate; }
.st-leaves { transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes st-rustle { from { transform: rotate(-1deg) translateX(-2px); } to { transform: rotate(1deg) translateX(2px); } }
.st-flies i { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #e8ff8a; box-shadow: 0 0 8px 3px rgb(220 255 120 / .6); animation: st-fly 6s ease-in-out infinite; pointer-events: none; }
@keyframes st-fly { 0%, 100% { opacity: .1; translate: 0 0; } 30% { opacity: 1; translate: 18px -14px; } 60% { opacity: .3; translate: -10px -24px; } }
/* вещи на земле: место, размер и порядок (z) — по глубине, ставит JS */
.st-prop { position: absolute; pointer-events: none; }
.st-prop svg { width: 100%; height: 100%; display: block; overflow: visible; }
.st-car svg { transform: rotate(-4deg); }
.st-car { pointer-events: auto; }
.st-blink { animation: cat-lamp .9s steps(2) infinite; }
.st-ground { position: absolute; left: 0; right: 0; top: var(--hz, 60%); bottom: 0; pointer-events: none; box-shadow: 0 -10px 24px rgb(0 0 0 / .35); }
.st-ground svg { width: 100%; height: 100%; display: block; }
.st-moon-refl { animation: st-refl 3s ease-in-out infinite alternate; }
@keyframes st-refl { to { opacity: .25; } }
.st-ripple { animation: st-refl 2.2s ease-in-out infinite alternate-reverse; }
.st-plants { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.st-plant { pointer-events: auto; }
.st-tuft { opacity: .85; }
.st-shroom svg { animation: st-shroom 3s ease-in-out infinite alternate; }
.st-door { pointer-events: auto; border: 3px solid #5b3b20; border-radius: 6px 6px 0 0; background: linear-gradient(#9a6b43, #7a4f2e); padding: 0;
  color: #fff; font-size: 22px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.st-door span { font-size: 11px; }
.st-bird { position: absolute; left: 0; top: 0; width: 40px; height: 20px; pointer-events: none; z-index: 2; }
.st-bird svg { width: 100%; height: 100%; overflow: visible; }
.st-wing { animation: st-flap .25s ease-in-out infinite alternate; transform-origin: 50% 50%; transform-box: fill-box; }
@keyframes st-flap { to { transform: scaleY(-.6); } }
.st-cat { position: absolute; left: 0; top: 0; width: 111px; height: 74px; z-index: 4; cursor: pointer; transform-origin: 50% 100%; }
.st-tag { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); white-space: nowrap; font-size: 10px; line-height: 1.15; text-align: center; color: #dfe6ff;
  text-shadow: 0 1px 3px #000; pointer-events: none; display: flex; flex-direction: column; }
.st-tag b { font-size: 11px; }
.st-cat.st-here .st-tag b::after { content: ' ●'; color: #7cf29a; }
.st-cat.leaving .cat-inner { transition: opacity .45s, transform .45s; opacity: 0; transform: scale(.6); }
.st-panel { width: 340px; max-width: 42vw; overflow-y: auto; padding: 12px; background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.st-panel-head { display: flex; align-items: center; gap: 8px; }
.st-board { display: flex; flex-direction: column; gap: 4px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.st-board-name { font-weight: 600; font-size: 12.5px; margin-bottom: 2px; }
.st-rule { display: flex; align-items: center; gap: 4px; padding: 5px 6px; border-radius: 8px; border: 1px dashed var(--border); font-size: 12px; }
.st-rule.active { border-style: solid; border-color: #2f9e55; }
.st-add-rule { align-self: flex-start; }
/* соревнования на улице: набор — рамка-пунктир, идет — зеленая, завершено и не состоялось — приглушенно */
.st-contest { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: 10px; border: 1px dashed var(--border); background: var(--surface-2); }
.st-contest.running { border: 1px solid #2f9e55; }
.st-contest.done, .st-contest.cancelled { opacity: .8; }
.st-contest-head { display: flex; align-items: baseline; gap: 6px; }
.st-scroll { flex: 1; min-width: 0; position: relative; display: flex; }
.st-scroll > .street { flex: 1; }
/* небо и даль */
.st-moon { position: absolute; right: 9%; top: 8%; width: 74px; height: 74px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 36% 34%, #fffbe8, #f3e7b8 55%, #d9c88a); box-shadow: 0 0 40px 14px rgb(255 240 190 / .25), 0 0 120px 40px rgb(255 240 190 / .1); }
.st-moon::after { content: ''; position: absolute; left: 22%; top: 50%; width: 14px; height: 10px; border-radius: 50%; background: rgb(180 160 100 / .35); box-shadow: 22px -18px 0 -2px rgb(180 160 100 / .3), 30px 8px 0 -3px rgb(180 160 100 / .28); }
.st-clouds i { position: absolute; height: 26px; border-radius: 30px; background: rgb(150 170 220 / .12); filter: blur(2px); animation: st-cloud 90s linear infinite; pointer-events: none; }
.st-clouds i::before { content: ''; position: absolute; left: 25%; top: -14px; width: 50%; height: 30px; border-radius: 50%; background: inherit; }
.st-clouds i:nth-child(1) { top: 10%; width: 180px; animation-delay: -10s; }
.st-clouds i:nth-child(2) { top: 22%; width: 240px; animation-duration: 120s; animation-delay: -60s; }
.st-clouds i:nth-child(3) { top: 5%; width: 130px; animation-duration: 75s; animation-delay: -40s; }
@keyframes st-cloud { from { transform: translateX(-300px); } to { transform: translateX(calc(100vw + 300px)); } }
.st-hills { position: absolute; left: 0; right: 0; bottom: calc(100% - var(--hz, 60%)); height: 18%; pointer-events: none; }
.st-hills svg { width: 100%; height: 100%; display: block; }
/* домики участников — у горизонта; размер и место ставит JS (--k — масштаб вдали) */
.st-houses { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.st-house { position: absolute; border: 0; background: none; padding: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.st-house-art { display: block; width: 90%; aspect-ratio: 76 / 82; filter: drop-shadow(0 4px 6px rgb(0 0 0 / .5)); transition: transform .15s; }
.st-house-art svg { width: 100%; height: 100%; display: block; }
.st-house:hover .st-house-art { transform: translateY(-3px); }
.st-house-sign { margin-top: -2px; max-width: 130%; font-size: calc(11px * var(--k, 1) + 2px); padding: 1px 6px; border-radius: 4px; background: #5b3b20; color: #f4e3c8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-house.mine .st-house-sign { background: #2f9e55; color: #fff; }
.st-win-lit { filter: drop-shadow(0 0 6px #ffd77a); }
/* фонари: свет пятном вокруг */
.st-lamp::after { content: ''; position: absolute; left: 50%; top: 0; width: 700%; aspect-ratio: 1; transform: translate(-50%, -40%); border-radius: 50%;
  background: radial-gradient(circle, rgb(255 215 122 / .2), transparent 62%); }
.st-lamp-light { filter: drop-shadow(0 0 8px #ffd77a); }
@keyframes st-shroom { from { opacity: .45; } to { opacity: 1; filter: drop-shadow(0 0 4px #7cf2e0); } }
.st-cat.st-flash .cat-inner { animation: st-flash 1.2s ease-in-out 2; }
@keyframes st-flash { 50% { filter: drop-shadow(0 0 10px #ffd77a) drop-shadow(0 0 4px #fff); transform: translateY(-6px); } }
/* панель: свой кот, коты на улице, рейтинги */
.st-me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: linear-gradient(135deg, color-mix(in srgb, #f2994a 22%, var(--surface-2)), var(--surface-2)); }
.st-me-ic { font-size: 26px; }
.st-cats { display: flex; flex-direction: column; gap: 2px; }
.st-cat-row { display: flex; align-items: center; gap: 2px; }
.st-cat-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--text); text-align: left; padding: 5px 6px; border-radius: 8px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-cat-who:hover { background: var(--surface-2); }
.st-cat-who .small { overflow: hidden; text-overflow: ellipsis; }
.st-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong, #888); flex: none; }
.st-dot.on { background: #2f9e55; box-shadow: 0 0 6px #2f9e55; }
.st-sheet-btn, .st-sheet-close { display: none; }
@media (max-width: 760px) {
  /* телефон: улица во весь экран (высоту ставит JS), шире экрана — листается пальцем вбок; рейтинги — выдвижная панель */
  .st-wrap.mobile { position: relative; flex-direction: column; min-height: 0; }
  .st-wrap.mobile .st-scroll { overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; height: 100%; }
  .st-wrap.mobile .street { min-width: 1700px; height: 100%; }
  .st-wrap.mobile .st-panel { position: fixed; left: 0; right: 0; bottom: 0; width: auto; max-width: none; max-height: 64vh; z-index: 60; border: 0; border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 30px rgb(0 0 0 / .35); transform: translateY(110%); transition: transform .25s ease; padding-top: 14px; }
  .st-wrap.mobile .st-panel.open { transform: none; }
  .st-sheet-btn { display: block; position: absolute; right: 10px; top: 10px; z-index: 20; border: 0; border-radius: 999px; padding: 8px 14px; font-weight: 600;
    background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--text); box-shadow: 0 3px 12px rgb(0 0 0 / .35); backdrop-filter: blur(6px); }
  .st-sheet-close { display: block; position: absolute; right: 10px; top: 8px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--text); font-size: 18px; }
  .st-moon { width: 56px; height: 56px; top: 12%; right: 30%; }
}
/* в гостях */
.visit-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; flex-wrap: wrap; }
.visit-desk { position: relative; overflow: hidden; }
.visit-widget { position: absolute; display: flex; flex-direction: column; border-radius: 10px; background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--border); overflow: hidden; }
.visit-widget-body { flex: 1; display: grid; place-items: center; font-size: 22px; opacity: .4; }
.visit-poop { position: absolute; font-size: 22px; pointer-events: none; }
.visit-gifts { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.visit-gift { position: absolute; font-size: 30px; animation: cat-gift 2.4s ease-in-out infinite; }
.visit-lasers { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.visit-desk .st-cat { --cat-ear: #f2a7b5; --cat-line: rgb(0 0 0 / .3); }
body.cat-paused .street *, body.cat-paused .street *::before, body.cat-paused .street *::after { animation-play-state: paused !important; }
/* улица: все вещи и коты — внутри сцены; панель «Рейтинги и коты» (и кнопки) всегда поверх них */
.street { isolation: isolate; z-index: 0; }
/* коты на улице: тень под лапами и контур потемнее — видно и на тропинке такого же цвета, как шерсть */
.street .st-cat, .visit-desk .st-cat { --cat-line: rgb(0 0 0 / .6); }
.st-cat::before { content: ''; position: absolute; left: 20%; right: 16%; bottom: 1px; height: 9px; border-radius: 50%; background: rgb(0 0 0 / .32); pointer-events: none; }
/* плавность: то, что качается и мерцает, — отдельными слоями видеокарты (без перерисовки всей улицы на каждом кадре) */
.st-stars, .st-jungle, .st-clouds i, .st-flies i, .st-cat, .st-bird, .st-comet { will-change: transform, opacity; }
@keyframes st-shroom { from { opacity: .45; } to { opacity: 1; } }
.st-shroom svg { filter: drop-shadow(0 0 3px #7cf2e0); }
@media (max-width: 760px), (pointer: coarse) {
  /* телефон: без самых дорогих мелочей — рябь и блик на пруду (перерисовывают всю землю), размытие облаков,
     половина светлячков; звезды и заросли двигаются как раньше, но слоями */
  .st-moon-refl, .st-ripple, .st-shroom svg, .st-blink { animation: none !important; }
  .st-clouds i { filter: none; background: rgb(150 170 220 / .08); }
  .st-flies i:nth-child(n+8) { display: none; }
  .st-flies i { box-shadow: 0 0 6px 2px rgb(220 255 120 / .5); }
  .st-lamp-light, .st-win-lit { filter: none; }
}
/* кот уходит в дверь и появляется на новой странице */
.cat.leaving .cat-inner { transition: opacity .5s, transform .5s; opacity: 0; transform: scale(.6) translateY(10px); }
.cat.arriving .cat-inner { animation: cat-arrive .55s ease-out; }
@keyframes cat-arrive { from { opacity: 0; transform: scale(.6) translateY(10px); } }
.cat-f-door { z-index: 1; }
/* подарки и записки от гостей */
.cat-f-gift { z-index: 4; animation: cat-gift 2.4s ease-in-out infinite; }
@keyframes cat-gift { 0%, 100% { rotate: -3deg; } 50% { rotate: 3deg; } }
.cat-note { width: 170px; padding: 10px 12px; background: #fff7b0; color: #3a3220; border-radius: 4px; box-shadow: 0 6px 14px rgb(0 0 0 / .3); font-size: 12.5px; line-height: 1.35; text-align: left; transform: rotate(-2deg); }
.cat-note-text { max-height: 90px; overflow: hidden; white-space: pre-wrap; }
.cat-note-from { margin-top: 6px; font-style: italic; color: #7a6a40; text-align: right; }
/* экономия: окно не активно — все анимации кота и дома стоят (cat.js ставит body.cat-paused) */
body.cat-paused .cat-layer, body.cat-paused .cat-layer *, body.cat-paused .cat-layer *::before, body.cat-paused .cat-layer *::after,
body.cat-paused .desk *, body.cat-paused .desk *::before, body.cat-paused .desk *::after, body.cat-paused .desk::before,
body.cat-paused .cat-m-room * { animation-play-state: paused !important; }
/* мини-окно переписки и окно видео поверх трекера */
.chat-pop, .video-pop { position: fixed; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 16px 48px rgb(0 0 0 / .35); overflow: hidden; resize: both; min-width: 280px; min-height: 260px; max-width: calc(100vw - 8px); max-height: calc(100vh - 8px); }
.chat-pop-head { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid var(--border); cursor: move; user-select: none; background: var(--surface-2); }
.chat-pop-head b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.chat-pop-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-pop-body > * { flex: 1; min-height: 0; }
.video-pop { right: 24px; bottom: 24px; width: 520px; height: 360px; z-index: 125; background: #000; }
.video-pop video { flex: 1; min-height: 0; width: 100%; background: #000; object-fit: contain; }
.video-pop .vw-bar { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: #15171c; color: #fff; font-size: 12px; }
.video-pop .vw-btn, .video-pop .vw-speed { border: 0; background: #2a2d35; color: #fff; border-radius: 6px; height: 28px; min-width: 32px; cursor: pointer; }
.video-pop .vw-seek { flex: 1; min-width: 60px; accent-color: var(--accent); }
.video-pop .vw-vol { width: 70px; accent-color: var(--accent); }
.video-pop .vw-time { white-space: nowrap; color: #cfd3dc; }
.video-pop .chat-pop-head { touch-action: none; }
/* свернутое видео: окно уезжает в кружок (звук продолжает идти), нажать на кружок — развернуть */
.video-pop { transition: transform .22s ease, opacity .22s ease; transform-origin: 100% 100%; }
.video-pop.minimized { transform: scale(.12); opacity: 0; pointer-events: none; }
.vp-bubble { position: fixed; right: 26px; bottom: 160px; z-index: 126; width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--border);
  display: grid; place-items: center; cursor: pointer; touch-action: none; color: var(--text);
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(16px); box-shadow: 0 8px 26px rgba(0, 0, 0, .35);
  transform: scale(0); opacity: 0; pointer-events: none; transition: transform .22s cubic-bezier(.3, 1.6, .5, 1), opacity .18s; }
.vp-bubble.show { transform: scale(1); opacity: 1; pointer-events: auto; }
.vp-bubble.show.playing { animation: dp-bubble-pulse 2.2s ease-out infinite; }
.vp-bubble.show:hover { transform: scale(1.06); }
@media (prefers-reduced-motion: reduce) { .vp-bubble.show.playing { animation: none; } }
@media (max-width: 760px) {
  .video-pop { left: 8px; right: auto; bottom: calc(84px + env(safe-area-inset-bottom)); width: calc(100vw - 16px); height: auto; min-height: 0; resize: none; }
  .video-pop video { aspect-ratio: 16 / 9; height: auto; flex: none; max-height: 50vh; }
  .video-pop .vw-vol { display: none; }
  .vp-bubble { right: 12px; bottom: calc(200px + env(safe-area-inset-bottom)); }
}
/* форматирование сообщений */
.chat-fmt { position: fixed; z-index: 160; display: flex; gap: 2px; padding: 4px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 6px 20px rgb(0 0 0 / .25); }
.chat-fmt.hidden { display: none; }
.chat-fmt button { min-width: 30px; height: 28px; border: 0; border-radius: 6px; background: none; color: var(--text); cursor: pointer; font-size: 13px; }
.chat-fmt button:hover { background: var(--surface-2); }
.chat-fmt-b { font-weight: 800; } .chat-fmt-i { font-style: italic; font-family: Georgia, serif; } .chat-fmt-s { text-decoration: line-through; }
.chat-fmt-code, .chat-fmt-pre { font-family: ui-monospace, monospace; font-size: 12px !important; }
.chat-quote { display: block; border-left: 3px solid var(--accent); padding: 1px 0 1px 8px; margin: 2px 0; color: var(--text-2); }
.chat-spoiler { background: var(--text-2); color: transparent; border-radius: 4px; cursor: pointer; transition: all .2s; padding: 0 2px; }
.chat-spoiler.open { background: rgb(127 127 127 / .2); color: inherit; }
/* предмет качнулся под котом */
.cat-wobble, .cat-wobble-strong { transform-origin: 50% 100%; }
.cat-wobble { animation: cat-wobble .55s ease-out; }
.cat-wobble-strong { animation: cat-wobble .7s ease-out; --wob: 4deg; }
@keyframes cat-wobble { 0% { rotate: 0deg; } 25% { rotate: calc(var(--wob, 2.5deg) * -1); } 55% { rotate: var(--wob, 2.5deg); } 80% { rotate: calc(var(--wob, 2.5deg) * -.4); } 100% { rotate: 0deg; } }
/* свет торшера не обрезается рамкой рисунка */
.cat-f-lamp svg { overflow: visible; }
.cat-heart { position: absolute; font-size: 16px; animation: cat-heart 1.5s ease-out forwards; pointer-events: none; }
@keyframes cat-heart { from { opacity: 0; transform: translateY(0) scale(.6); } 20% { opacity: 1; } to { opacity: 0; transform: translateY(-46px) scale(1.15); } }
.cat-ball { position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; transition: transform .6s cubic-bezier(.2,.8,.3,1);
  background: radial-gradient(circle at 35% 35%, #ff9db5, #e5484d 60%, #b5303a); box-shadow: 0 3px 4px rgb(0 0 0 / .25); }
.cat-ball::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px dashed rgb(255 255 255 / .55); animation: cat-ball 1s linear infinite; }
@keyframes cat-ball { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cat *, .cat-inner { animation: none !important; } }
/* комната кота (виджет на главной) */
.cat-room { display: flex; flex-direction: column; gap: 6px; height: 100%; min-height: 300px; }
.cat-room-top { display: flex; align-items: center; gap: 8px; }
.cat-name { cursor: pointer; }
.cat-mood { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); }
.cat-mood.m-happy { background: color-mix(in srgb, #22c55e 18%, transparent); color: #16a34a; }
.cat-mood.m-sick, .cat-mood.m-grumpy { background: color-mix(in srgb, var(--danger, #d33) 16%, transparent); color: var(--danger, #d33); }
.cat-mood.m-hungry, .cat-mood.m-sad { background: color-mix(in srgb, #e0a100 18%, transparent); color: #b88400; }
.cat-streak { font-size: 13px; font-weight: 600; }
.cat-meters { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.cat-meter { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-2); }
.cat-meter i { flex: 1; height: 7px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.cat-meter i b { display: block; height: 100%; border-radius: 4px; background: #e0a100; transition: width .4s; }
.cat-meter i.low b { background: var(--danger, #d33); }
.cat-meter i.love b { background: #ff7aa8; }
.cat-meter small { width: 30px; text-align: right; }
.cat-scene { position: relative; flex: 1; min-height: 170px; border-radius: 10px; overflow: hidden; background: linear-gradient(#e9dfcf 0 70%, #c49a6c 70%); }
:root[data-theme="dark"] .cat-scene { background: linear-gradient(#3b3a45 0 70%, #6b5137 70%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .cat-scene { background: linear-gradient(#3b3a45 0 70%, #6b5137 70%); } }
.cat-wall { position: absolute; left: 0; right: 0; top: 0; height: 70%; background-image: repeating-linear-gradient(90deg, transparent 0 38px, rgb(0 0 0 / .04) 38px 40px); }
.cat-room-floor { position: absolute; left: 0; right: 0; top: 70%; height: 30%; }
.cat-item { position: absolute; border: 0; padding: 0; background: none; cursor: pointer; transition: transform .15s; }
.cat-item:hover { transform: translateY(-2px); }
.cat-item svg { width: 100%; height: 100%; display: block; }
.cat-cabinet { left: 4%; bottom: 22%; width: 15%; aspect-ratio: 70 / 90; }
.cat-count { position: absolute; left: 50%; top: -14px; transform: translateX(-50%); font-size: 11px; font-weight: 600; white-space: nowrap; background: var(--surface); color: var(--text); padding: 1px 6px; border-radius: 8px; box-shadow: 0 1px 3px rgb(0 0 0 / .2); }
.cat-bowl { left: 28%; bottom: 8%; width: 14%; aspect-ratio: 2 / 1; }
.cat-flower { right: 22%; bottom: 24%; width: 11%; aspect-ratio: 60 / 90; cursor: default; }
.cat-flower:hover { transform: none; }
.cat-bottle { right: 16%; bottom: 25%; width: 4.5%; aspect-ratio: 24 / 60; transform-origin: 50% 100%; }
.cat-bottle.pour, .cat-f-bottle.pour { animation: cat-pour .9s ease-in-out; }
@keyframes cat-pour { 40%, 70% { transform: translate(-14px, -18px) rotate(-75deg); } }
.cat-litter { right: 4%; bottom: 6%; width: 13%; aspect-ratio: 90 / 110; }
/* телефон: миска с водой в простой комнате */
.cat-scene .cat-bowl { left: 10%; }
.cat-scene .cat-water { left: 34%; bottom: 8%; width: 16%; aspect-ratio: 2 / 1; border-radius: 0 0 40% 40%; background: #3e63dd; overflow: hidden; display: flex; align-items: flex-end; justify-content: center; }
.cat-scene .cat-water .cat-water-lvl { position: absolute; left: 8%; right: 8%; bottom: 10%; border-radius: 0 0 40% 40%; background: #7cc4ff; max-height: 80%; }
.cat-scene .cat-water b { position: relative; font-size: 13px; }
.cat-scene .cat-water.empty { animation: cat-z-warn 1.6s ease-in-out infinite; }
/* унитаз: вонь колышется, при смыве вода закручивается */
.cat-stink path { animation: cat-stink 2.2s ease-in-out infinite; }
.cat-stink path:nth-child(2) { animation-delay: -.7s; }
.cat-stink path:nth-child(3) { animation-delay: -1.4s; }
@keyframes cat-stink { 0% { opacity: 0; transform: translateY(6px); } 40% { opacity: .9; } 100% { opacity: 0; transform: translateY(-10px); } }
.flushing .cat-toilet-water { transform-box: fill-box; transform-origin: 50% 50%; animation: cat-swirl 1.6s ease-in; }
@keyframes cat-swirl { 0% { transform: rotate(0) scale(1); } 60% { transform: rotate(540deg) scale(.6); fill: #9fd3ff; } 100% { transform: rotate(720deg) scale(1); fill: #9fd3ff; } }
.flushing .cat-flush-btn { fill: #5aa8f0; }
.cat-litter.dirty::after, .cat-f-litter.dirty::after { content: '💨'; position: absolute; right: -4px; top: -16px; font-size: 14px; animation: cat-z 2s ease-in-out infinite; }
.cat-warn { position: absolute; left: 8px; top: 8px; font-size: 12px; padding: 3px 8px; border-radius: 8px; background: rgb(0 0 0 / .45); color: #fff; }
.cat-room-foot { line-height: 1.3; }
/* вся Главная — комната: мебель стоит прямо на столе, переставляется мышью */
.cat-furn { position: absolute; z-index: 3; border: 0; padding: 0; background: none; cursor: grab; touch-action: none; user-select: none;
  filter: drop-shadow(0 5px 4px rgb(0 0 0 / .22)); transition: transform .15s; }
.cat-furn svg { width: 100%; height: 100%; display: block; pointer-events: none; }
.cat-furn:not(.cat-f-hud):hover { transform: translateY(-3px); }
.cat-furn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.cat-furn.dragging { cursor: grabbing; z-index: 50; opacity: .92; transition: none; transform: scale(1.04); }
.cat-f-flower { cursor: grab; }
.cat-f-bottle { transform-origin: 50% 100%; }
.cat-f-hud { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 12px; color: var(--text); font-size: 13px;
  background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(6px); box-shadow: 0 4px 16px rgb(0 0 0 / .16); filter: none; }
.cat-f-hud .cat-meters { grid-template-columns: 1fr; }
.cat-f-hud .btn { align-self: flex-start; }
.cat-hud-warn { font-size: 12px; color: var(--danger, #d33); }
.cat-m-room { margin: 0 0 12px; padding: 10px; border-radius: 12px; background: var(--surface); box-shadow: 0 2px 8px rgb(0 0 0 / .1); }
.cat-m-room .cat-room { min-height: 260px; }

/* ---------------- обои комнаты кота (catroom.js): стена, плинтус и пол — нижние --wp-fh стола; светлые и темные */
[data-wp] { --wp-fh: 150px; --wp-wall: #f1e4cc; --wp-pattern: repeating-linear-gradient(90deg, rgb(0 0 0 / .035) 0 2px, transparent 2px 46px);
  --wp-floor: #b98455; --wp-base: #8d5f3a; --wp-label: #3a2a1a; --wp-shadow: 0 1px 2px rgb(255 255 255 / .6); --win-frame: #f4efe6; --win-sill: #e2d6c2; }
.desk[data-wp], .cat-wp-prev[data-wp], .cat-m-scene[data-wp], .cat-desk-scene[data-wp] { background:
  repeating-linear-gradient(90deg, rgb(0 0 0 / .08) 0 2px, transparent 2px 120px) left bottom / 100% var(--wp-fh) no-repeat,
  linear-gradient(to top, var(--wp-floor) 0 var(--wp-fh), var(--wp-base) var(--wp-fh) calc(var(--wp-fh) + 10px), transparent calc(var(--wp-fh) + 10px)),
  var(--wp-pattern), var(--wp-wall); }
/* комната кота отдельной страницей (/cat, для телефона): сверху панель и табличка кота, ниже — сцена до нижнего меню */
.cat-page, .content.cat-page, .content.wide.cat-page { padding: 0 !important; max-width: none !important; display: flex; flex-direction: column; overflow: hidden; min-height: 0 !important; }
.cat-page-stage { position: relative; flex: 1 1 auto; min-height: 0; margin-top: 8px; display: flex; }
.cat-page-stage .cat-page-scene { flex: 1; margin-top: 0; height: 100%; }
.cat-page-stage .cat-page-hint { position: absolute; left: 8px; right: 8px; top: 6px; margin: 0; z-index: 60; pointer-events: none; opacity: .95; box-shadow: 0 3px 12px rgb(0 0 0 / .25); }
.cat-page-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px 0; }
.cat-page-hud-wrap { position: relative; margin: 8px 12px 0; }
.cat-page-hud { padding-right: 40px; }
.cat-hud-toggle { position: absolute; right: 6px; top: 6px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--text); font-size: 14px; cursor: pointer; }
.cat-page-hud.min { padding-top: 7px; padding-bottom: 7px; }
.cat-hud-mini { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; cursor: pointer; }
.cat-hud-mini .cat-mood { font-size: 11px; }
.cat-hud-chip { font-size: 12px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); white-space: nowrap; }
.cat-hud-chip.low { background: color-mix(in srgb, var(--danger, #d33) 25%, var(--surface-2)); }
.cat-page-hud .cat-hud-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-page-hint { margin: 6px 12px 0; padding: 6px 10px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.cat-page-hint.hidden { display: none; }
.cat-page-scene { margin-top: 8px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: thin; }
.cat-page-scene .cat-m-scene { min-width: 100%; }
/* телефон: комната как на компьютере — уменьшена под высоту экрана, листается вбок */
.cat-desk-sizer { position: relative; overflow: hidden; }
.cat-desk-scene { position: absolute; left: 0; top: 0; transform-origin: 0 0; overflow: hidden; }
body.cat-laser-on .cat-desk-scene, body.cat-laser-on .cat-desk-scene .cat-furn { touch-action: none; }
.cat-desk-scene .cat-furn:not(.cat-f-hud) { touch-action: pan-x pan-y; }
.cat-desk-scene.arranging .cat-furn { touch-action: none; outline: 2px dashed color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 3px; border-radius: 6px; }
.cat-desk-scene.arranging .cat-furn.dragging { outline-style: solid; }
.cat-m-scene { position: relative; overflow: hidden; }
.cat-m-scene[data-wp] { --wp-fh: 64px; }
/* обычный режим: палец листает страницу, касание — действие; «Переставить» — вещи идут за пальцем */
.cat-m-scene .cat-furn:not(.cat-f-hud) { touch-action: pan-x pan-y; }
.cat-m-scene.arranging .cat-furn { touch-action: none; outline: 2px dashed color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 3px; border-radius: 6px; }
.cat-m-scene.arranging .cat-furn.dragging { outline-style: solid; }
body.cat-laser-on .cat-m-scene, body.cat-laser-on .cat-m-scene .cat-furn { touch-action: none; }
.desk-cat-ic { background: #f2994a; }
.visit-desk.visit-mobile .cat-m-scene { position: relative; overflow: hidden; }
@media (hover: none) { .cat-furn:not(.cat-f-hud):hover { transform: none; } }
.desk[data-wp] .desk-icon-label, .desk[data-wp] .desk-hint { color: var(--wp-label); text-shadow: var(--wp-shadow); }
.desk[data-wp] .desk-icon:hover, .desk[data-wp] .desk-icon:focus { background: rgb(127 127 127 / .18); }
[data-wp="night"] { --wp-wall: #161c38; --wp-pattern: radial-gradient(1.3px 1.3px at 20% 30%, #ffffffaa 50%, transparent 52%) 0 0 / 180px 140px, radial-gradient(1px 1px at 70% 60%, #ffffff77 50%, transparent 52%) 0 0 / 130px 110px;
  --wp-floor: #33284a; --wp-base: #211a33; --wp-label: #eef0ff; --wp-shadow: 0 1px 3px rgb(0 0 0 / .8); --win-frame: #9aa0b8; --win-sill: #7a8098; }
[data-wp="space"] { --wp-wall: #0b0f24; --wp-pattern: radial-gradient(1.4px 1.4px at 25% 35%, #fff 50%, transparent 52%) 0 0 / 160px 130px, radial-gradient(1px 1px at 75% 65%, #bfe 50%, transparent 52%) 0 0 / 110px 90px,
  radial-gradient(ellipse 40% 30% at 70% 30%, #5b3aa855, transparent 70%), radial-gradient(ellipse 35% 25% at 20% 70%, #1f6aa844, transparent 70%);
  --wp-floor: #22223a; --wp-base: #15152a; --wp-label: #eef0ff; --wp-shadow: 0 1px 3px rgb(0 0 0 / .8); --win-frame: #8a90aa; --win-sill: #6a7088; }
.desk[data-wp="space"]::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(1.8px 1.8px at 30% 40%, #fff 50%, transparent 52%) 0 0 / 230px 170px, radial-gradient(1.4px 1.4px at 80% 20%, #ffe9a8 50%, transparent 52%) 0 0 / 190px 150px;
  animation: cat-twinkle 2.6s ease-in-out infinite alternate; }
[data-wp="forest"] { --wp-wall: #dcebd5; --wp-pattern: radial-gradient(ellipse 14px 6px at 50% 50%, #8fbf7a77 96%, transparent) 0 0 / 60px 48px, radial-gradient(ellipse 10px 5px at 50% 50%, #6aa35577 96%, transparent) 30px 24px / 60px 48px;
  --wp-floor: #7a5a3a; --wp-base: #5a3f26; --wp-label: #1f3320; }
[data-wp="brick"] { --wp-wall: #c8745a; --wp-pattern: linear-gradient(#e8d8c8 0 2px, transparent 2px) 0 0 / 64px 26px, linear-gradient(90deg, #e8d8c8 0 2px, transparent 2px) 0 0 / 64px 26px;
  --wp-floor: #6b4a33; --wp-base: #4a3322; --wp-label: #fff; --wp-shadow: 0 1px 3px rgb(0 0 0 / .7); }
[data-wp="sea"] { --wp-wall: #cfeaf7; --wp-pattern: radial-gradient(circle at 50% 100%, transparent 9px, #9fd3ef 10px 12px, transparent 13px) 0 0 / 40px 22px;
  --wp-floor: #c9ae82; --wp-base: #9c8460; --wp-label: #10324a; }
[data-wp="mint"] { --wp-wall: #dff5ec; --wp-pattern: repeating-linear-gradient(90deg, rgb(0 110 80 / .06) 0 12px, transparent 12px 30px); --wp-floor: #a98a68; --wp-base: #7d6448; --wp-label: #10372b; }
[data-wp="candy"] { --wp-wall: #ffe3ef; --wp-pattern: repeating-linear-gradient(90deg, #ffc9de 0 18px, transparent 18px 36px); --wp-floor: #c98fa8; --wp-base: #a06a83; --wp-label: #4a1630; }
:root[data-theme="dark"] [data-wp="warm"] { --wp-wall: #2a2631; --wp-pattern: repeating-linear-gradient(90deg, rgb(255 255 255 / .035) 0 2px, transparent 2px 46px); --wp-floor: #4a3426; --wp-base: #2a1c14; --wp-label: #efe7ff; --wp-shadow: 0 1px 3px rgb(0 0 0 / .8); --win-frame: #b7ae9f; --win-sill: #8e8577; }
:root[data-theme="dark"] [data-wp="forest"] { --wp-wall: #1d2d23; --wp-pattern: radial-gradient(ellipse 14px 6px at 50% 50%, #3b6a4a88 96%, transparent) 0 0 / 60px 48px, radial-gradient(ellipse 10px 5px at 50% 50%, #2f5a3c88 96%, transparent) 30px 24px / 60px 48px; --wp-floor: #3e2f22; --wp-base: #2a1f16; --wp-label: #e6f5e6; --wp-shadow: 0 1px 3px rgb(0 0 0 / .8); --win-frame: #a9b3a5; --win-sill: #828c7e; }
:root[data-theme="dark"] [data-wp="brick"] { --wp-wall: #5a2f26; --wp-pattern: linear-gradient(#3a2622 0 2px, transparent 2px) 0 0 / 64px 26px, linear-gradient(90deg, #3a2622 0 2px, transparent 2px) 0 0 / 64px 26px; --wp-floor: #3a281c; --wp-base: #241912; --win-frame: #b0a596; --win-sill: #887d70; }
:root[data-theme="dark"] [data-wp="sea"] { --wp-wall: #12324a; --wp-pattern: radial-gradient(circle at 50% 100%, transparent 9px, #1f5a7a 10px 12px, transparent 13px) 0 0 / 40px 22px; --wp-floor: #4a3d2a; --wp-base: #2e261a; --wp-label: #e2f4ff; --wp-shadow: 0 1px 3px rgb(0 0 0 / .8); --win-frame: #a3b4bf; --win-sill: #7b8c97; }
:root[data-theme="dark"] [data-wp="mint"] { --wp-wall: #163a32; --wp-pattern: repeating-linear-gradient(90deg, rgb(120 255 200 / .05) 0 12px, transparent 12px 30px); --wp-floor: #3d3226; --wp-base: #282018; --wp-label: #e2fff3; --wp-shadow: 0 1px 3px rgb(0 0 0 / .8); --win-frame: #a3b8b0; --win-sill: #7b9088; }
:root[data-theme="dark"] [data-wp="candy"] { --wp-wall: #3a1f33; --wp-pattern: repeating-linear-gradient(90deg, #4d2944 0 18px, transparent 18px 36px); --wp-floor: #4a2b3c; --wp-base: #2e1a26; --wp-label: #ffe6f2; --wp-shadow: 0 1px 3px rgb(0 0 0 / .8); --win-frame: #b9a3b0; --win-sill: #917b88; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) [data-wp="warm"] { --wp-wall: #2a2631; --wp-pattern: repeating-linear-gradient(90deg, rgb(255 255 255 / .035) 0 2px, transparent 2px 46px); --wp-floor: #4a3426; --wp-base: #2a1c14; --wp-label: #efe7ff; --wp-shadow: 0 1px 3px rgb(0 0 0 / .8); --win-frame: #b7ae9f; --win-sill: #8e8577; }
  :root:not([data-theme]) [data-wp="forest"] { --wp-wall: #1d2d23; --wp-floor: #3e2f22; --wp-base: #2a1f16; --wp-label: #e6f5e6; --wp-shadow: 0 1px 3px rgb(0 0 0 / .8); }
  :root:not([data-theme]) [data-wp="sea"] { --wp-wall: #12324a; --wp-floor: #4a3d2a; --wp-base: #2e261a; --wp-label: #e2f4ff; --wp-shadow: 0 1px 3px rgb(0 0 0 / .8); }
  :root:not([data-theme]) [data-wp="mint"] { --wp-wall: #163a32; --wp-floor: #3d3226; --wp-base: #282018; --wp-label: #e2fff3; --wp-shadow: 0 1px 3px rgb(0 0 0 / .8); }
  :root:not([data-theme]) [data-wp="candy"] { --wp-wall: #3a1f33; --wp-floor: #4a2b3c; --wp-base: #2e1a26; --wp-label: #ffe6f2; --wp-shadow: 0 1px 3px rgb(0 0 0 / .8); }
}
.cat-own-bg { display: grid; place-items: center; font-size: 34px; background: repeating-linear-gradient(45deg, var(--surface-2) 0 10px, var(--surface-3) 10px 20px); }
.cat-wp-prev { --wp-fh: 20px; display: block; width: 140px; height: 96px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .15); }
.desk-bg.cat-wp-prev { --wp-fh: 14px; width: auto; height: auto; }

/* ---------------- комната: мебель, растения, вьюнок, окно, шкаф */
.cat-vines { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 0; }
.cat-vines svg { display: block; }
.cat-f-rug, .cat-f-window, .cat-f-picture { z-index: 1; }
.cat-f-hud { z-index: 4; }
.cat-seat { position: absolute; left: 4%; right: 4%; top: 50%; height: 4px; pointer-events: none; }
.cat-coins { font-weight: 600; }
.cat-hud-btns { display: flex; flex-wrap: wrap; gap: 4px; }
.cat-f-plant { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.cat-plant-top { position: relative; z-index: 1; margin-bottom: -6px; pointer-events: none; }
.cat-plant-top svg, .cat-pot svg { width: 100%; height: 100%; display: block; }
.cat-pot { position: relative; z-index: 2; pointer-events: none; }
.cat-plant-svg { transform-origin: 50% 100%; animation: cat-sway 5s ease-in-out infinite; }
@keyframes cat-sway { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } }
.cat-f-plant.st-thirsty .cat-plant-svg { filter: saturate(.6) brightness(.95); }
.cat-f-plant.st-wilted .cat-plant-svg { filter: saturate(.3) sepia(.6) brightness(.85); transform: rotate(-8deg) scaleY(.9); animation: none; }
.cat-f-plant.st-wilted::after { content: '💧'; position: absolute; top: 0; right: 0; font-size: 14px; animation: cat-z 2s ease-in-out infinite; }
/* под горшком: голубая полоска — вода (пустая — пора поливать), зеленая — удобрение еще действует; подробности — щелчком */
.cat-f-plant.fert .cat-plant-svg { filter: drop-shadow(0 0 4px #7cf29a88); }
.cat-plant-bars { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; pointer-events: none; }
.cat-plant-bars i { display: block; height: 4px; border-radius: 2px; background: rgb(0 0 0 / .25); overflow: hidden; box-shadow: 0 0 0 1px rgb(255 255 255 / .15); }
.cat-plant-bars b { display: block; height: 100%; border-radius: 2px; transition: width .6s; }
.cat-plant-bars .bar-water b { background: linear-gradient(90deg, #4aa3e8, #7cc4ff); }
.cat-plant-bars .bar-water.low { animation: cat-z-warn 1.4s ease-in-out infinite; }
.cat-plant-bars .bar-fert b { background: linear-gradient(90deg, #2f9e55, #7cf29a); }
/* погода: подпись на окне и виджет */
.cat-win-temp { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); white-space: nowrap; font-size: 10.5px; font-weight: 600; line-height: 1;
  padding: 3px 7px; border-radius: 8px; background: rgb(0 0 0 / .45); color: #fff; z-index: 3; pointer-events: none; }
.cat-city-list { display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow: auto; }
.cat-city { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); cursor: pointer; text-align: left; }
.cat-city:hover { border-color: var(--accent); }
.cat-wx { display: flex; flex-direction: column; gap: 6px; height: 100%; }
.cat-wx-city { align-self: flex-start; border: 0; background: none; color: var(--text); font-weight: 600; cursor: pointer; padding: 0; }
.cat-wx-now { display: flex; align-items: center; gap: 10px; }
.cat-wx-icon { font-size: 38px; line-height: 1; }
.cat-wx-temp { font-size: 34px; line-height: 1; font-weight: 700; }
.cat-wx-text { line-height: 1.25; }
.cat-wx-days { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: auto; }
.cat-wx-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; border-radius: 8px; background: var(--surface-2); }
.cat-wx-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 100%; font-size: 40px; }
.cat-food-prev svg { width: 60px; height: 75px; }
.cat-cab-shop { border: 0; background: rgb(255 255 255 / .2); color: #fff; border-radius: 6px; padding: 1px 6px; cursor: pointer; font-size: 10.5px; }
/* вьюнок: кончик, за который тянут на крючок; свисающие побеги покачиваются */
.cat-vine-grips { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 6; }
.cat-vine-grip { position: absolute; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-size: 16px; cursor: grab; touch-action: none;
  border-radius: 50%; background: rgb(255 255 255 / .75); box-shadow: 0 1px 4px rgb(0 0 0 / .3); animation: cat-grip 2.4s ease-in-out infinite; }
.cat-vine-grip:hover { transform: scale(1.15); }
@keyframes cat-grip { 50% { box-shadow: 0 0 0 5px rgb(124 242 154 / .35), 0 1px 4px rgb(0 0 0 / .3); } }
.cat-vine-drag { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.cat-vine-hit { position: absolute; left: 0; top: 0; pointer-events: none; }
.cat-vine-hit path { fill: none; stroke: transparent; stroke-width: 16; stroke-linecap: round; stroke-linejoin: round; pointer-events: stroke; cursor: grab; }
.cat-vine-hit path:hover { stroke: rgb(124 242 154 / .18); }
.cat-vine-drag path { stroke: #4fb54a; stroke-width: 2.5; stroke-dasharray: 6 5; fill: none; }
.vine-sway { transform-box: view-box; animation: cat-vsway 4.5s ease-in-out infinite; }
@keyframes cat-vsway { 0%, 100% { transform: rotate(-1.6deg); } 50% { transform: rotate(1.6deg); } }
.cat-f-hook { z-index: 2; }
.cat-furn.nudged { transition: left .45s cubic-bezier(.2, .8, .3, 1); }
/* миска с водой и бутылка в руке */
.cat-f-water.empty { animation: cat-z-warn 1.6s ease-in-out infinite; }
@keyframes cat-z-warn { 50% { filter: drop-shadow(0 0 6px #7cc4ff); } }
.cat-f-bottle.in-hand { opacity: .25; }
.cat-bottle-hand { position: fixed; left: 0; top: 0; width: 30px; height: 75px; z-index: 210; pointer-events: none; }
.cat-bottle-hand svg { width: 100%; height: 100%; transform: rotate(-30deg); transform-origin: 50% 90%; transition: transform .2s; filter: drop-shadow(0 6px 6px rgb(0 0 0 / .35)); }
.cat-bottle-hand.pouring svg { animation: cat-pour-hand .9s ease-in-out; }
.cat-bottle-hand.pouring::after { content: ''; position: absolute; left: -4px; top: 6px; width: 4px; height: 46px; border-radius: 2px; background: linear-gradient(#7cc4ff, #7cc4ff00); animation: cat-stream .9s ease-in-out; opacity: 0; }
@keyframes cat-pour-hand { 30%, 70% { transform: rotate(-115deg); } }
@keyframes cat-stream { 30%, 70% { opacity: 1; } }
.cat-water-art { width: 100%; height: 100%; }
.cat-water-art svg { width: 100%; height: 100%; display: block; }
.cat-water-bars { width: 80%; margin: 3px auto 0; }
.cat-water-bars i { height: 5px; }
.cat-water-pct { position: absolute; right: -4px; top: -12px; font-size: 10px; font-weight: 700; padding: 0 4px; border-radius: 6px; background: rgb(20 40 90 / .75); color: #cfe9ff; pointer-events: none; }
.cat-f-water.filling .cat-water-art { animation: cat-ripple .35s ease-in-out 4; }
@keyframes cat-ripple { 50% { transform: scaleX(1.03) scaleY(.97); } }
.cat-bottle-hand.long svg { animation: cat-pour-long 1.9s ease-in-out; }
@keyframes cat-pour-long { 12%, 85% { transform: rotate(-125deg); } }
.cat-pour-stream { position: fixed; z-index: 209; width: 5px; border-radius: 3px; pointer-events: none; transform-origin: 50% 0;
  background: linear-gradient(#a8dcff, #4fb3ff); box-shadow: 0 0 6px #7cc4ff; animation: cat-stream-fall 1.65s ease-in-out forwards; }
@keyframes cat-stream-fall { 0% { transform: scaleY(0); opacity: 0; } 15% { transform: scaleY(1); opacity: 1; } 85% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(0) translateY(40px); opacity: 0; } }
.cat-splash { position: fixed; z-index: 209; width: 6px; height: 6px; border-radius: 50%; background: #8fd3ff; pointer-events: none; animation: cat-splash .7s ease-out forwards; }
@keyframes cat-splash { to { transform: translate(var(--dx), -22px) scale(.4); opacity: 0; } }
.cat-pour-tag { position: fixed; z-index: 211; transform: translate(-50%, -100%); padding: 3px 10px; border-radius: 999px; background: #1f6fd1; color: #fff; font-size: 12px; font-weight: 700;
  pointer-events: none; box-shadow: 0 3px 10px rgb(0 0 0 / .3); animation: cat-pour-tag 1.7s ease-out forwards; }
@keyframes cat-pour-tag { 0% { opacity: 0; margin-top: 6px; } 15% { opacity: 1; margin-top: 0; } 80% { opacity: 1; } 100% { opacity: 0; margin-top: -14px; } }
/* бутылка в руке: палец ведет бутылку, а не листает страницу */
body.cat-pouring-mode, body.cat-pouring-mode * { touch-action: none !important; }
body.cat-pouring-mode .cat-f-water, body.cat-pouring-mode .cat-f-plant { outline: 2px dashed #7cc4ff; outline-offset: 4px; border-radius: 8px; cursor: copy; }
.pot-rainbow svg, svg.pot-rainbow { animation: cat-hue 4s linear infinite; }
@keyframes cat-hue { to { filter: hue-rotate(360deg); } }
.pot-glow svg, svg.pot-glow { animation: cat-glow 2.4s ease-in-out infinite; }
@keyframes cat-glow { 0%, 100% { filter: drop-shadow(0 0 2px #ffffff66); } 50% { filter: drop-shadow(0 0 12px #ffffffbb) brightness(1.15); } }
.cat-pot.pot-stars::after, .cat-shop-prev:has(svg.pot-stars)::after { content: '✦ ✧ ✦'; position: absolute; left: 0; right: 0; top: -8px; text-align: center; font-size: 10px; color: #fff3a0; letter-spacing: 5px; animation: cat-sparkle 1.8s ease-in-out infinite; pointer-events: none; }
.cat-shop-prev { position: relative; }
@keyframes cat-sparkle { 0% { opacity: 0; transform: translateY(6px); } 50% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }
.cat-f-armchair.v-rock svg, .cat-shop-card .v-rock svg { transform-origin: 50% 95%; animation: cat-rock 2.6s ease-in-out infinite; }
@keyframes cat-rock { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
svg.lamp-glow .lamp-light { animation: cat-lamp 2.2s ease-in-out infinite; }
@keyframes cat-lamp { 50% { opacity: .4; } }
svg.lamp-disco { animation: cat-hue 3s linear infinite; }
/* окно и шторы */
.cat-win { position: absolute; inset: 0; }
.cat-win svg { width: 100%; height: 100%; display: block; }
.cat-rod { position: absolute; left: -8px; right: -8px; top: -5px; height: 6px; border-radius: 3px; background: #8a5a2b; z-index: 2; }
.cat-curtain { position: absolute; top: -3px; height: 90%; width: 17%; background-color: var(--cur, #c9a27a); z-index: 1; border-radius: 0 0 8px 8px;
  transition: width .7s cubic-bezier(.4, .1, .2, 1); box-shadow: inset 0 0 0 1px rgb(0 0 0 / .08); }
.cat-curtain::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: repeating-linear-gradient(90deg, rgb(0 0 0 / .14) 0 2px, transparent 2px 9px, rgb(255 255 255 / .1) 9px 11px, transparent 11px 16px); }
.cat-curtain.l { left: -5px; transform-origin: 0 0; }
.cat-curtain.r { right: -5px; transform-origin: 100% 0; }
.cat-f-window.closed .cat-curtain { width: 54%; }
.cat-curtain.v-stripes { background-image: repeating-linear-gradient(90deg, rgb(255 255 255 / .35) 0 6px, transparent 6px 16px); }
.cat-curtain.v-dots { background-image: radial-gradient(circle, rgb(255 255 255 / .6) 2.5px, transparent 3px); background-size: 14px 14px; }
.cat-curtain.v-breeze { animation: cat-breeze 3.4s ease-in-out infinite; }
.cat-curtain.r.v-breeze { animation-delay: -1.7s; }
@keyframes cat-breeze { 0%, 100% { transform: skewX(0); } 50% { transform: skewX(5deg) scaleX(1.04); } }
.cat-curtain.v-stars { background-image: radial-gradient(circle, #fff 1.2px, transparent 1.6px), radial-gradient(circle, #ffffff99 .9px, transparent 1.3px); background-size: 18px 22px, 11px 15px; background-position: 0 0, 6px 8px; }
.cat-curtain.v-stars::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background-image: radial-gradient(circle, #fffbe0 1.7px, transparent 2.3px); background-size: 26px 30px; background-position: 9px 4px; animation: cat-twinkle 1.6s ease-in-out infinite alternate; }
@keyframes cat-twinkle { from { opacity: .15; } to { opacity: 1; } }
.cat-curtain.v-aurora { background-image: linear-gradient(160deg, var(--cur), #3fe0b0, #7c6cf0, #ff7ab8, var(--cur)); background-size: 100% 400%; animation: cat-aurora 8s ease-in-out infinite alternate; }
@keyframes cat-aurora { to { background-position: 0 100%; } }
.cat-curt-prev { position: relative; width: 120px; height: 90px; background: linear-gradient(#8fd3ff, #d8f1ff); border: 5px solid #f4efe6; border-radius: 4px; }
.cat-curt-prev .cat-curtain { top: 0; height: 100%; width: 36%; }
/* открытый шкаф: дверцы распахнуты, три полки */
.cat-f-cabinet.open { background: linear-gradient(#9a6b43, #8a5d38); border-radius: 8px; padding: 6px; display: flex; flex-direction: column; gap: 4px; z-index: 8;
  box-shadow: 0 6px 18px rgb(0 0 0 / .3); filter: none; cursor: grab; }
.cat-f-cabinet.open:hover { transform: none; }
.cat-f-cabinet.open::before, .cat-f-cabinet.open::after { content: ''; position: absolute; top: 6px; bottom: 6px; width: 26px; background: linear-gradient(90deg, #b9845a, #a8774f); border-radius: 4px; }
.cat-f-cabinet.open::before { left: -24px; transform: perspective(160px) rotateY(-48deg); transform-origin: 100% 50%; }
.cat-f-cabinet.open::after { right: -24px; transform: perspective(160px) rotateY(48deg); transform-origin: 0 50%; }
.cat-cab-head { display: flex; align-items: center; color: #fff3e0; font-weight: 600; font-size: 13px; padding: 0 2px; }
.cat-cab-x { border: 0; background: rgb(0 0 0 / .22); color: #fff; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; line-height: 1; font-size: 15px; }
.cat-shelf { flex: 1; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 5px; padding: 4px 6px 3px; background: #b9845a; border-radius: 4px; border-bottom: 5px solid #7a5232; min-height: 54px;
  box-shadow: inset 0 6px 8px rgb(0 0 0 / .18); cursor: default; }
.cat-pack { position: relative; width: 34px; height: 44px; cursor: grab; touch-action: none; transition: transform .15s; flex: none; }
.cat-pack:hover { transform: translateY(-3px); }
.cat-pack svg { width: 100%; height: 100%; display: block; pointer-events: none; }
.cat-pack.empty { opacity: .35; }
.cat-pack.lifted { opacity: .25; }
.cat-pack-n { position: absolute; right: -5px; top: -6px; font-size: 10px; font-weight: 700; background: #fff; color: #333; border-radius: 8px; padding: 0 4px; box-shadow: 0 1px 2px rgb(0 0 0 / .3); }
.cat-pack-ghost { position: fixed; left: 0; top: 0; z-index: 200; pointer-events: none; width: 40px; height: 52px; filter: drop-shadow(0 6px 6px rgb(0 0 0 / .35)); }
.cat-cab-foot { font-size: 10.5px; color: #fbe9d6; opacity: .85; text-align: center; line-height: 1.2; }
.cat-drop-ok { outline: 3px dashed var(--accent); outline-offset: 3px; border-radius: 8px; }
/* магазин */
.cat-shop-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.cat-shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.cat-shop-card { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.cat-shop-prev { height: 110px; display: flex; align-items: center; justify-content: center; }
.cat-shop-prev > svg { max-width: 100%; max-height: 100%; }
.cat-shop-ctrls { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cat-shop-ctrls .input { width: auto; flex: 1; min-width: 90px; }
.cat-price { font-size: 14px; }
.cat-mine-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; }
.cat-mine-prev { width: 64px; height: 50px; display: flex; align-items: center; justify-content: center; flex: none; overflow: hidden; }
.cat-mine-prev > svg { max-width: 100%; max-height: 100%; }
.cat-mine-prev .cat-wp-prev { width: 64px; height: 46px; }
.cat-mine-prev .cat-curt-prev { transform: scale(.5); flex: none; }
/* посадка */
.cat-plant-dlg { display: flex; gap: 16px; flex-wrap: wrap; }
.cat-species { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.cat-species button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); cursor: pointer; }
.cat-species button.on, .cat-pots-pick button.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.cat-species button span { width: 54px; height: 70px; display: block; }
.cat-species svg { width: 100%; height: 100%; display: block; }
.cat-pots-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.cat-pots-pick button { width: 64px; height: 52px; padding: 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); cursor: pointer; color: var(--text); }
.cat-pots-pick svg { width: 100%; height: 100%; display: block; }
.cat-pot-buy { font-size: 12px; }
.cat-plant-side { width: 210px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cat-plant-preview { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-height: 210px; width: 100%; padding: 10px; border-radius: 10px; background: var(--surface-2); }
.cat-swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgb(0 0 0 / .25); cursor: pointer; padding: 0; }
/* окрас */
.cat-look { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.cat-look-pic { width: 210px; height: 150px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); border-radius: 12px; flex: none; }
.cat-pic { width: 186px; height: 124px; --cat-ear: #f2a7b5; }
.cat-look-presets { display: flex; flex-wrap: wrap; gap: 4px; }
.cat-look-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.cat-look-row { display: flex; align-items: center; gap: 10px; }
.cat-look-row > span { width: 120px; }
/* какашки на главной */
.cat-poops { position: absolute; left: 0; right: 0; top: 0; z-index: 6; pointer-events: none; }
.cat-poop { position: absolute; width: 38px; height: 32px; padding: 0; border: 0; background: none; cursor: pointer; pointer-events: auto; filter: drop-shadow(0 2px 2px rgb(0 0 0 / .3)); animation: cat-poop-in .4s ease-out; }
.cat-poop svg { width: 100%; height: 100%; }
.cat-poop::before { content: ''; position: absolute; left: 6px; right: 6px; top: -12px; height: 12px; background: repeating-linear-gradient(90deg, transparent 0 5px, rgb(120 140 60 / .5) 5px 7px); filter: blur(1px); animation: cat-z 1.8s ease-in-out infinite; }
.cat-poop.gone { animation: cat-poop-out .35s ease-in forwards; }
@keyframes cat-poop-in { from { transform: scale(0); } }
@keyframes cat-poop-out { to { transform: scale(0) rotate(90deg); opacity: 0; } }
/* нейросеть в редакторе: кнопки над выделенным текстом и перетаскиваемое окошко с ответом */
.llm-sel-bar { position: fixed; z-index: 1200; display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 6px 20px rgb(0 0 0 / .25); }
.llm-sel-bar button { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; color: var(--text); padding: 5px 9px; border-radius: 7px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.llm-sel-bar button:hover { background: color-mix(in srgb, #8b5cf6 16%, transparent); }
.llm-sel-ic { color: #8b5cf6; font-weight: 700; }
.llm-win { position: fixed; z-index: 1150; width: min(440px, calc(100vw - 16px)); display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 12px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 14px 40px rgb(0 0 0 / .35); }
.llm-win.busy { border-color: color-mix(in srgb, #8b5cf6 55%, var(--border)); }
.llm-win.dragging { opacity: .92; user-select: none; }
.llm-win-head { display: flex; align-items: center; gap: 8px; cursor: grab; touch-action: none; padding-bottom: 2px; }
.llm-win.dragging .llm-win-head { cursor: grabbing; }
.llm-win-ic { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; flex: none; color: #fff; font-weight: 700;
  background: linear-gradient(135deg, #8b5cf6, #4f46e5); }
.llm-win-status { font-size: 12px; color: var(--text-3); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.llm-win-status.error { color: var(--danger, #d33); white-space: normal; }
.llm-win-src summary { cursor: pointer; }
.llm-win-src > div { max-height: 120px; overflow: auto; margin-top: 4px; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); white-space: pre-wrap; }
.llm-win-text { width: 100%; resize: vertical; min-height: 140px; max-height: 60vh; font-size: 13.5px; line-height: 1.45; }
.llm-win-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.llm-win-foot .btn { display: inline-flex; align-items: center; gap: 6px; }
/* профиль: подключенные устройства и журнал входов */
.sec-list { display: flex; flex-direction: column; }
.sec-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--border); }
.sec-row:first-child { border-top: 0; }
.sec-row.current .sec-ic { color: var(--link); background: color-mix(in srgb, var(--link) 14%, transparent); }
.sec-ic { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); }
.sec-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sec-body > * { overflow-wrap: anywhere; }
.sec-chip { margin-left: 8px; font-size: 11px; font-weight: 500; vertical-align: 1px; }
.sec-day { margin: 10px 0 2px; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .03em; }
.sec-log { display: flex; gap: 12px; padding: 6px 4px; }
.sec-log.bad .sec-body > span:first-child { color: var(--danger, #d33); }
.sec-time { flex: none; width: 42px; color: var(--text-3); font-size: 12.5px; padding-top: 1px; }
/* бот «LLM модель»: значок, ответ по мере генерации, боковая панель настроек */
.avatar.llm-av { display: inline-grid; place-items: center; background: linear-gradient(135deg, #8b5cf6, #4f46e5); color: #fff; }
.avatar.llm-av > svg { width: 60%; height: 60%; }
.llm-status { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 12px; color: var(--text-3); min-width: 0; }
.llm-status.error { color: var(--danger, #d33); }
.llm-status .grow { min-width: 0; }
.llm-stop { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; font-size: 12px; }
.llm-stop-sq { width: 9px; height: 9px; border-radius: 2px; background: currentColor; }
.llm-dots { width: 18px; height: 6px; flex: none; background: radial-gradient(circle, currentColor 2px, transparent 2.5px) 0 50% / 6px 6px repeat-x; animation: llm-dots 1s steps(3) infinite; }
@keyframes llm-dots { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.llm-caret { display: inline-block; width: 7px; height: 1em; margin-left: 2px; vertical-align: -2px; background: currentColor; opacity: .6; animation: llm-blink 1s steps(2) infinite; }
@keyframes llm-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .llm-dots, .llm-caret { animation: none; } }
.llm-panel { display: flex; flex-direction: column; gap: 4px; padding: 4px 16px 16px; }
.llm-sec { display: flex; flex-direction: column; gap: 8px; padding: 10px 0; border-top: 1px solid var(--border); }
.llm-label { font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .03em; }
.llm-models { display: flex; flex-direction: column; gap: 6px; }
.llm-model { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.llm-model.on { border-color: var(--link); background: color-mix(in srgb, var(--link) 8%, transparent); }
.llm-model .grow { min-width: 0; overflow-wrap: anywhere; }
.llm-model-del { flex: none; border: 0; background: none; color: var(--text-3); font-size: 18px; line-height: 1; padding: 0 4px; cursor: pointer; border-radius: 6px; }
.llm-model-del:hover { color: var(--danger, #e5484d); background: var(--surface-2); }
.llm-prompt { width: 100%; resize: vertical; min-height: 90px; font-size: 13px; }
.llm-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.llm-num { width: 90px; }
.llm-saved { display: flex; flex-direction: column; gap: 4px; }
.llm-saved-item { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.llm-saved-item.on { border-color: var(--link); }
.llm-saved-item button { border: 0; background: none; color: var(--text); padding: 6px 10px; text-align: left; cursor: pointer; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.llm-saved-item button:hover { background: var(--surface-2); }
.llm-saved-del { flex: none; color: var(--text-3) !important; }
.llm-ctx { display: flex; flex-direction: column; gap: 6px; }
/* бот «API LLM»: заголовки разделов панели, полоса контекста, файлы топика */
.llm-sec-t { font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .03em; }
.llm-ctx-fill { height: 100%; background: var(--link); border-radius: 4px; transition: width .3s; }
.llm-ctx-fill.warn { background: #e0a100; }
.api-llm-files { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow: auto; }
.api-llm-file { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-radius: 6px; font-size: 13px; }
.api-llm-file:hover { background: var(--surface-2); }
.api-llm-file a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; }
.api-llm-panel details > summary { cursor: pointer; }
.api-llm-files { max-height: 360px; }
.api-llm-dir { border: 0; background: none; padding: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.api-llm-file.dir { font-weight: 500; }
.api-llm-panel.drag { outline: 2px dashed var(--accent); outline-offset: -4px; border-radius: 10px; }
.llm-ctx-top { display: flex; align-items: baseline; gap: 6px; }
.llm-ctx-bar { position: relative; height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.llm-ctx-bar > span { position: absolute; inset: 0 auto 0 0; background: var(--link); border-radius: 4px; transition: width .3s; }
.llm-ctx-bar.warn > span { background: #e0a100; }
.llm-ctx-bar.over > span { background: var(--danger, #d33); }
.llm-ctx-bar > i { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text-3); opacity: .6; }
.llm-note { padding: 12px 0; color: var(--text-2); font-size: 13px; }
/* «змейка» состояния модели на видеокарте */
.llm-srv { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.llm-snake { display: flex; align-items: center; padding: 4px 6px 0; }
.llm-snake-node { flex: none; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border-strong, var(--text-3)); background: var(--surface); transition: background .3s, border-color .3s; }
.llm-snake-node.done { background: var(--link); border-color: var(--link); }
.llm-snake-node.cur { box-shadow: 0 0 0 4px color-mix(in srgb, var(--link) 22%, transparent); border-color: var(--link); }
.llm-snake.moving .llm-snake-node.cur { animation: llm-pulse 1s ease-in-out infinite; }
.llm-snake.busy .llm-snake-node.cur { animation: llm-pulse 1.4s ease-in-out infinite; background: #22c55e; border-color: #22c55e; box-shadow: 0 0 0 4px rgb(34 197 94 / .22); }
@keyframes llm-pulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--link) 8%, transparent); } }
.llm-snake-link { flex: 1; height: 3px; margin: 0 3px; border-radius: 2px; background: var(--border); position: relative; overflow: hidden; }
.llm-snake-link.done { background: var(--link); }
/* к текущему этапу ползет «змейка» */
.llm-snake-link.live::after { content: ''; position: absolute; top: 0; bottom: 0; width: 45%; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--link), transparent); animation: llm-snake 1.1s linear infinite; }
.llm-snake.back .llm-snake-link.live::after { animation-direction: reverse; }
@keyframes llm-snake { from { left: -45%; } to { left: 100%; } }
.llm-snake-labels { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-3); }
.llm-snake-labels span { flex: 1; text-align: center; }
.llm-snake-labels span:first-child { text-align: left; }
.llm-snake-labels span:last-child { text-align: right; }
.llm-snake-labels .cur { color: var(--link); font-weight: 600; }
.llm-srv-row { display: flex; align-items: center; gap: 8px; }
.llm-srv-err { color: var(--danger, #d33); }
@media (prefers-reduced-motion: reduce) { .llm-snake-link.live::after, .llm-snake .llm-snake-node.cur { animation: none; } }
/* пересланное сообщение и окно «Переслать» */
.chat-fwd { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--link); margin-bottom: 3px; min-width: 0; }
.chat-fwd b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-fwd svg { flex: none; }
.chat-msg.mine .chat-fwd { color: inherit; opacity: .8; }
.fwd-body { display: flex; flex-direction: column; gap: 10px; }
.fwd-list { max-height: min(60vh, 460px); overflow-y: auto; margin: 0 -8px; }
.fwd-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer; border-radius: 8px; }
.fwd-item:hover, .fwd-topic:hover { background: var(--surface-2); }
.fwd-item-body { display: flex; flex-direction: column; min-width: 0; }
.fwd-item-body > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fwd-topics { display: flex; flex-direction: column; padding: 0 0 4px 44px; }
.fwd-topic { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer; border-radius: 8px; }
.chat-empty .msgr-saved-av { width: 44px; height: 44px; }
/* «Избранное» — синий кружок с закладкой */
.msgr-saved-av { display: inline-grid; place-items: center; background: linear-gradient(135deg, #5aa8f0, #2f7fd8); color: #fff; }
.msgr-saved-big .msgr-saved-av { width: 72px; height: 72px; }
.msgr-threads { border-bottom: 1px solid var(--border); }
.msgr-threads-list { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; background: var(--surface-2); }
.msgr-thread-item { border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 10px 12px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 4px; color: var(--text); }
.msgr-thread-item:hover { border-color: var(--border-strong); }
.msgr-thread-item.unread { border-left: 3px solid var(--link); }
.msgr-thread-where { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.msgr-thread-root { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.msgr-thread-last { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.msgr-thread-last .avatar { width: 20px; height: 20px; font-size: 9px; }
/* топики (как в Telegram) */
.msgr-topics-wrap { display: flex; flex: 1; min-height: 0; height: 100%; }
.msgr-mini { width: 62px; flex: none; border-right: 1px solid var(--border); overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0; }
.msgr-mini-item { position: relative; border: 0; background: none; padding: 3px; border-radius: 12px; cursor: pointer; }
.msgr-mini-item.active { background: color-mix(in srgb, var(--accent) 30%, transparent); }
/* чат, чьи топики показаны рядом: тонкая полоска слева, даже когда справа открыт другой чат */
.msgr-mini-item.forum::before { content: ''; position: absolute; left: -7px; top: 50%; width: 4px; height: 24px; margin-top: -12px; border-radius: 0 3px 3px 0; background: var(--accent); }
/* вход в топики — колонка въезжает справа; выход ко всем чатам — список въезжает слева */
.msgr-topics-wrap.msgr-enter .msgr-topics { animation: msgr-in-right .2s cubic-bezier(.2, .8, .2, 1); }
.msgr-topics-wrap.msgr-enter .msgr-mini { animation: fade-in .2s ease-out; }
.msgr-enter-back { animation: msgr-in-left .2s cubic-bezier(.2, .8, .2, 1); }
@media (prefers-reduced-motion: reduce) { .msgr-topics-wrap.msgr-enter .msgr-topics, .msgr-topics-wrap.msgr-enter .msgr-mini, .msgr-enter-back { animation: none; } }
.msgr-mini-item .avatar { width: 40px; height: 40px; font-size: 14px; }
.msgr-mini-item .msgr-folder-badge { position: absolute; top: -2px; right: -2px; }
/* «Треды» и «Избранное»: значок — доля кружка при любом его размере (рядом с фото он казался мелким) */
.avatar.msgr-threads-av > svg, .avatar.msgr-saved-av > svg { width: 60%; height: 60%; }
.msgr-mini-key { background: var(--surface-3); color: var(--text-2); font-size: 11px !important; font-weight: 700; display: inline-grid; place-items: center; }
.msgr-topics { flex: 1; min-width: 0; overflow-y: auto; display: flex; flex-direction: column; }
.msgr-topics-back { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.msgr-topics-back-label { font-size: 13px; }
.msgr-topics-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.msgr-topic { display: flex; gap: 10px; align-items: flex-start; border: 0; background: none; padding: 9px 12px; text-align: left; cursor: pointer; color: var(--text); border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent); }
.msgr-topic:hover { background: var(--surface-2); }
.msgr-topic.active { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.msgr-topic-ic { font-size: 22px; width: 32px; height: 32px; display: grid; place-items: center; flex: none; border-radius: 50%; background: var(--surface-2); }
.msgr-topic-body { min-width: 0; }
.chat-badge.muted { background: var(--text-3); }
/* заглушенный чат в списке: значок 🔕 у имени, серый счетчик, жирность «непрочитанного» не кричит */
.msgr-muted { font-size: 12px; opacity: .75; flex: none; margin-left: 2px; }
.msgr-item.is-muted.unread .msgr-item-title, .msgr-item.is-muted.unread .msgr-item-last { font-weight: inherit; }
.group-av.emoji { background: var(--surface-3) !important; font-size: 18px; }
.group-av.lg.emoji { font-size: 34px; }
.group-av.photo { background-size: cover; background-position: center; }
.group-av-pick { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.group-av-emoji { width: 34px; height: 34px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; font-size: 18px; cursor: pointer; padding: 0; color: var(--text); }
.group-av-emoji.on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 50%, transparent); }
.group-type { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.group-type-btn { border: 1.5px solid var(--border); background: var(--surface); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; cursor: pointer; text-align: left; color: var(--text); }
.group-type-btn.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.group-type-ic { font-size: 22px; }
/* свои папки */
.msgr-folder-ic.emoji { font-size: 21px; line-height: 1; }
.msgr-folder-add { opacity: .7; }
.msgr-tab-add { border: 0; background: none; color: var(--text-2); font-size: 16px; padding: 0 8px; cursor: pointer; }
/* чат с ботом: заметка себе */
.bot-foot { flex-direction: column; align-items: stretch; gap: 6px; }
.bot-compose { display: flex; flex-direction: column; gap: 6px; }
.bot-dest { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.bot-dest-btn { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: 999px; padding: 2px 10px; font-size: 12px; cursor: pointer; }
.bot-dest-btn.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
.bot-dest-btn:disabled { opacity: .45; cursor: default; }
/* телефон: нижняя панель трекера видна и при открытых «Сообщениях» */
@media (max-width: 760px) {
  .messenger-overlay { bottom: calc(58px + env(safe-area-inset-bottom)) !important; top: 0; height: auto; }
  .messenger { height: 100% !important; }
  .thread-host { width: auto; }
  .chat-col { max-width: 86%; }
  /* топики на телефоне: без колонки аватаров других чатов — список топиков во всю ширину */
  .msgr-topics-wrap .msgr-mini { display: none; }
  /* одна анимация за раз: пока список топиков въезжает, вся левая панель не въезжает еще раз */
  .messenger:not(.has-active) .msgr-left:has(.msgr-topics-wrap) { animation: none; }
  .msgr-topics-back { padding: 0 8px 0 4px; gap: 2px; }
  .msg-menu { left: 8px !important; right: 8px; width: auto; }
}

/* ===================== тикеты: комментарии, история, чеклист, полосы прогресса */
.comment-deleted { font-style: italic; color: var(--text-3); padding: 6px 0; }
.replies-toggle { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--text-2); font-size: 12.5px; cursor: pointer; padding: 4px 8px; margin: 2px 0 2px 44px; border-radius: 8px; }
.replies-toggle:hover { background: var(--surface-2); color: var(--text); }
.replies-tri { display: inline-block; transition: transform .18s; font-size: 11px; }
.replies-toggle.open .replies-tri { transform: rotate(90deg); }
.replies-avs { display: inline-flex; margin-left: 4px; }
.replies-avs .avatar { width: 18px; height: 18px; font-size: 8px; margin-right: -5px; box-shadow: 0 0 0 2px var(--surface); }
.text-diff { font-size: 13px; line-height: 1.55; background: var(--surface-2); border-radius: 8px; padding: 6px 10px; margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.text-diff del { background: color-mix(in srgb, #e5484d 22%, transparent); color: #e5484d; text-decoration: line-through; border-radius: 3px; }
.text-diff ins { background: color-mix(in srgb, #30a46c 24%, transparent); color: #30a46c; text-decoration: none; border-radius: 3px; }
.history-deleted { margin-top: 4px; padding: 6px 10px; border-radius: 8px; background: color-mix(in srgb, #e5484d 8%, var(--surface-2)); text-decoration: line-through; text-decoration-color: color-mix(in srgb, #e5484d 70%, transparent); opacity: .8; max-height: 220px; overflow: auto; }
.history-file-gone s { color: var(--text-2); }
.check-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
/* общий чеклист на нескольких участников: кто уже сделал, пометка «общий» в личном чеклисте */
.check-who { flex: none; display: inline-flex; align-items: center; gap: 5px; }
.check-who .chat-react-avs .avatar { border-color: var(--surface); }
.check-shared-chip { flex: none; font-size: 11px; padding: 0 7px; color: var(--text-2); }
.check-row.check-shared .check-text { color: var(--text); }
.check-note { margin: -2px 0 8px; }
.check-tabs button { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 2px 10px 2px 4px; font-size: 12.5px; cursor: pointer; color: var(--text); }
.check-tabs button:first-child { padding-left: 10px; }
.check-tabs button .avatar { width: 20px; height: 20px; font-size: 9px; }
.check-tabs button.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, var(--surface)); font-weight: 600; }
.check-row { gap: 6px; }
.check-row.dragging { opacity: .4; }
.check-row.drop { box-shadow: inset 0 2px 0 var(--accent); }
/* книга очереди: закрытые задачи — приглушенные вкладки */
.bk-sec.bk-sec-done:not(.active) { opacity: .6; text-decoration: line-through; }
.queue-book-btn { gap: 6px; }
/* ножницы: перенос видео робота */
.cut-bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 900; display: flex; align-items: center; gap: 10px;
  max-width: min(720px, calc(100vw - 32px)); padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--accent);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .35); font-size: 13px; }
.cut-bar-ic { font-size: 20px; }
.yfm-media-cut { font-size: 15px; line-height: 1; }
.yfm-media-cut.active { color: var(--accent); }
.btn.cut-paste { border-color: var(--accent); color: var(--accent); }
@media (max-width: 760px) { .cut-bar { bottom: calc(76px + env(safe-area-inset-bottom)); } }
/* чеклист в столбцах */
.check-cols { display: grid; grid-template-columns: repeat(var(--n), minmax(220px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.check-col { background: color-mix(in srgb, var(--text) 4%, transparent); border: 1px solid var(--border); border-radius: 10px; padding: 6px; min-width: 0; display: flex; flex-direction: column; }
.check-col.drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
.check-col-head { display: flex; align-items: center; gap: 6px; padding: 2px 2px 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.check-col-title { flex: 1; min-width: 0; font-weight: 600; font-size: 13px; background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 3px 6px; color: var(--text); }
input.check-col-title:hover, input.check-col-title:focus { border-color: var(--border); background: var(--surface); outline: none; }
.check-col .check-row { padding-left: 2px; padding-right: 2px; }
.check-col-add { margin-top: auto; height: 30px; font-size: 13px; }
@media (max-width: 760px) { .check-cols { grid-template-columns: 1fr; } }
.check-grip { cursor: grab; color: var(--text-3); font-size: 11px; letter-spacing: -2px; user-select: none; }
.check-edit { height: 28px; flex: 1; }
.check-text { cursor: text; }
/* тонкие полосы: срок и чеклист */
.pbars { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.pbar { position: relative; height: 4px; border-radius: 999px; background: color-mix(in srgb, var(--text) 10%, transparent); overflow: hidden; }
.pbar.big { height: 7px; margin: 2px 0 8px; }
.pbar-fill { height: 100%; border-radius: inherit; transition: width .6s cubic-bezier(.2, .8, .2, 1); background-size: 18px 18px; animation: pbar-move 1.4s linear infinite; }
@keyframes pbar-move { from { background-position: 0 0; } to { background-position: 18px 0; } }
@keyframes pbar-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes pbar-shine { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.pbar-time.early .pbar-fill { background-color: #30a46c; background-image: linear-gradient(45deg, rgba(255,255,255,.22) 25%, transparent 25% 50%, rgba(255,255,255,.22) 50% 75%, transparent 75%); animation-duration: 3s; }
.pbar-time.mid .pbar-fill { background-color: #d39e00; background-image: linear-gradient(45deg, rgba(255,255,255,.25) 25%, transparent 25% 50%, rgba(255,255,255,.25) 50% 75%, transparent 75%); animation-duration: 1.8s; }
.pbar-time.late .pbar-fill { background-color: #f76b15; background-image: linear-gradient(45deg, rgba(255,255,255,.28) 25%, transparent 25% 50%, rgba(255,255,255,.28) 50% 75%, transparent 75%); animation-duration: 1s; }
.pbar-time.over .pbar-fill { background-color: #e5484d; background-image: linear-gradient(45deg, rgba(255,255,255,.35) 25%, transparent 25% 50%, rgba(255,255,255,.35) 50% 75%, transparent 75%); animation: pbar-move .5s linear infinite, pbar-pulse 1.2s ease-in-out infinite; }
.pbar-time.done .pbar-fill { background: #8b8d98; animation: none; }
.pbar-check .pbar-fill { background: linear-gradient(90deg, #3e63dd, #00b4d8); animation: none; position: relative; overflow: hidden; }
.pbar-check .pbar-fill::after { content: ''; position: absolute; inset: 0; width: 40%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); animation: pbar-shine 2.4s ease-in-out infinite; }
.pbar-check.full .pbar-fill { background: linear-gradient(90deg, #30a46c, #84cc16); }
@media (prefers-reduced-motion: reduce) { .pbar-fill, .pbar-fill::after { animation: none !important; } }
.mob-params { padding: 0 !important; overflow: hidden; }
.mob-params-head { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 12px 14px; cursor: pointer; color: var(--text); text-align: left; }
.mob-params.open .replies-tri { transform: rotate(90deg); }
.mob-params-sum { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mob-params .params { position: static; max-height: none; overflow: visible; border: 0; box-shadow: none; padding: 0 12px 12px; }

/* ===================== настройки очереди, триггеры, значки, список очередей */
.settings-tabs { margin-bottom: 12px; }
.icon-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.icon-pick { width: 34px; height: 34px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; font-size: 18px; cursor: pointer; padding: 0; display: grid; place-items: center; color: var(--text-2); }
.icon-grid.small .icon-pick { width: 28px; height: 28px; font-size: 15px; }
.icon-pick:hover { border-color: var(--border-strong); }
.icon-pick.on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 50%, transparent); }
.prio-row { align-items: flex-start; gap: 10px; }
.prio-current { width: 22px; display: grid; place-items: center; padding-top: 4px; }
.prio-emoji { font-size: 13px; line-height: 1; }
.trigger-row { gap: 12px; align-items: center; padding: 10px 14px; }
.trigger-form .trigger-action { border: 1px solid var(--border); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.queue-list { padding: 4px 0; }
.queue-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.queue-row:last-child { border-bottom: 0; }
.queue-row:hover { background: var(--surface-2); }
.queue-icon { font-size: 20px; width: 28px; text-align: center; }
.board-queue-icon { flex: none; line-height: 1; }
.foreign { margin-top: 14px; }
.foreign > summary { cursor: pointer; color: var(--text-2); font-weight: 500; padding: 6px 0; user-select: none; }
.foreign[open] > summary { margin-bottom: 8px; }
.foreign-issues { margin-top: 14px; }
.queue-row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-col-set.drop { outline: 2px dashed var(--accent); }
.chat-hd { font-size: 10.5px !important; font-weight: 800; letter-spacing: -.3px; color: var(--text-3) !important; }
.chat-hd.on { color: var(--accent-text) !important; background: var(--accent) !important; border-radius: 6px; }
.notify-channel { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.yfm-media-share { border: 0; background: none; cursor: pointer; }

/* ===================== книги на телефоне: разделы → страницы → страница */
.bk-mnav { display: none; }
@media (max-width: 760px) {
  .bk-mnav { display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
  .bk[data-mview="sections"] .bk-mnav, .bk[data-mview="pages"] .bk-mnav { flex: 1; overflow-y: auto; }
  .bk[data-mview="sections"] > :not(.bk-mnav), .bk[data-mview="pages"] > :not(.bk-mnav) { display: none !important; }
  .bk[data-mview="page"] .bk-bar, .bk[data-mview="page"] .bk-pages { display: none !important; }
  .bk-mnav-head { display: flex; align-items: center; gap: 6px; padding: 8px 8px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; }
  .bk-mnav-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
  .bk-mlist { display: flex; flex-direction: column; padding: 6px 0 20px; }
  .bk-mitem { display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 14px 16px; text-align: left; color: var(--text); font-size: 15px; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); cursor: pointer; }
  .bk-mitem > svg:last-child { transform: rotate(180deg); color: var(--text-3); }
  .bk-mitem.page.active { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
  .bk-mtab { width: 6px; height: 28px; border-radius: 3px; background: var(--c); flex: none; }
  .bk-madd { color: var(--link); }
  .bk-rpanel { min-height: 0; padding: 4px; }
  .bk-rgroup { padding: 0 6px; }
  .bk-rgroup-title { display: none; }
  .bk-rb.big { height: 44px; min-width: 44px; }
  .bk-rb.big span:not(.bk-paper-sample) { display: none; }
  .bk-shapes { grid-template-columns: repeat(12, 28px); }
  .bk-rtop .bk-status, .bk-rtop .bk-share-btn { display: none; }
  .bk-rtabs { overflow-x: auto; scrollbar-width: none; }
  .wb-header { width: calc(100vw - 32px); }
}

/* ---------------- главная: рабочий стол */
.desk-content { padding: 0 !important; max-width: none !important; }
.desk { position: relative; min-height: calc(100vh - 60px); background-size: cover; overflow: hidden; }
.desk-hint { position: absolute; right: 16px; bottom: 10px; font-size: 12px; opacity: .55; pointer-events: none; }
.desk.dark-bg .desk-hint, .desk.dark-bg .desk-icon-label { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.desk-item { position: absolute; }
.desk-item.dragging { opacity: .85; z-index: 50; }
.desk-icon { width: 92px; height: 96px; border-radius: 10px; cursor: default; user-select: none; outline: none; }
.desk-icon:hover, .desk-icon:focus { background: rgba(255,255,255,.18); }
.desk-icon.drop { background: rgba(255,255,255,.35); box-shadow: 0 0 0 2px var(--accent); }
.desk-icon-body { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px; }
.desk-icon-img { font-size: 40px; line-height: 48px; position: relative; }
.desk-folder-n { position: absolute; right: -6px; bottom: 0; font-size: 11px; line-height: 16px; min-width: 16px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: #000; }
.desk-icon-label { font-size: 12px; text-align: center; max-width: 88px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.desk-widget { display: flex; flex-direction: column; background: var(--card, var(--bg)); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 8px 28px rgba(0,0,0,.25); overflow: hidden; }
.desk-w-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--border); cursor: move; user-select: none; }
.desk-w-btn { border: 0; background: none; color: inherit; opacity: .5; cursor: pointer; font-size: 15px; padding: 0 4px; }
.desk-w-btn:hover { opacity: 1; }
.desk-w-body { flex: 1; overflow: auto; padding: 8px 10px; }
.desk-w-resize { position: absolute; right: 0; bottom: 0; width: 16px; height: 16px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 50%, var(--border) 50%); }
.desk-list { display: flex; flex-direction: column; }
.desk-row { display: flex; align-items: center; gap: 6px; padding: 5px 4px; border-radius: 6px; color: inherit; text-decoration: none; font-size: 13px; }
.desk-row:hover { background: var(--hover, rgba(127,127,127,.12)); }
.desk-row-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.desk-more { display: block; padding: 6px 4px; font-size: 12px; }
.desk-empty { padding: 14px 4px; text-align: center; opacity: .6; }
.desk-tiles { display: flex; gap: 8px; height: 100%; }
.desk-tile { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; border-radius: 10px; background: rgba(127,127,127,.1); color: inherit; text-decoration: none; text-align: center; font-size: 12px; padding: 6px; }
.desk-tile b { font-size: 26px; }
.desk-today-date { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.desk-today-date b { font-size: 34px; }
.desk-sub { font-size: 12px; font-weight: 600; opacity: .7; margin: 8px 0 4px; }
.desk-ev { display: flex; gap: 8px; padding: 4px 6px; border-left: 3px solid var(--c, var(--accent)); margin-bottom: 4px; border-radius: 4px; color: inherit; text-decoration: none; font-size: 13px; background: rgba(127,127,127,.08); }
.desk-ev.pending { opacity: .6; border-left-style: dashed; }
.desk-ev-time { opacity: .7; white-space: nowrap; }
.desk-issue { display: flex; flex-direction: column; gap: 8px; color: inherit; text-decoration: none; }
.desk-board { display: flex; flex-direction: column; gap: 8px; color: inherit; text-decoration: none; }
.desk-board-cols { display: flex; gap: 6px; }
.desk-board-col { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 8px; background: rgba(127,127,127,.1); font-size: 12px; text-align: center; }
.desk-board-col b { font-size: 22px; }
.desk-note { width: 100%; height: 100%; border: 0; resize: none; background: transparent; color: inherit; font: inherit; outline: none; }
.w-note { background: #fff7b0; color: #333; }
.desk-clock { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; }
.desk-clock b { font-size: 40px; }
.desk-bgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.desk-bg { height: 70px; border-radius: 10px; border: 2px solid transparent; cursor: pointer; display: flex; align-items: flex-end; padding: 4px 6px; color: #fff; text-shadow: 0 1px 2px #000; font-size: 12px; }
.desk-bg.on { border-color: var(--accent); }
.desk-pick { display: flex; flex-direction: column; max-height: 300px; overflow: auto; }
.desk-pick-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 0; background: none; color: inherit; text-align: left; border-radius: 6px; cursor: pointer; }
.desk-pick-item:hover { background: rgba(127,127,127,.12); }
.desk-pick-ic { font-size: 20px; }
.desk-folder-icons { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.desk-file-thumb { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; cursor: zoom-in; }
.desk-m-icon { border: 0; background: none; color: inherit; padding: 0; border-radius: 10px; width: 92px; }
.desk.mobile { padding: 12px 16px 90px; display: flex; flex-direction: column; gap: 12px; }
.desk.mobile .desk-item { position: relative; }
.desk.mobile .desk-widget { width: auto; height: auto; max-height: 420px; }
.desk-m-icons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; justify-items: center; align-items: start; }
/* значки ряда — на одной высоте, подпись в две строки уходит вниз, а не поднимает значок */
.desk-m-icons .desk-m-icon { width: 100%; align-self: start; }
.desk-m-icons .desk-icon-body { justify-content: flex-start; }
.desk-m-icons .desk-icon-img { height: 64px; display: flex; align-items: center; justify-content: center; }
.desk-m-add { align-self: center; }

/* ---------------- редактор: перетаскивание блоков */
.ve-grip { position: fixed; z-index: 3000; width: 18px; height: 22px; display: flex; align-items: center; justify-content: center; border-radius: 5px; font-size: 12px; letter-spacing: -2px; color: var(--muted, #888); background: var(--card, var(--bg)); border: 1px solid var(--border); cursor: grab; user-select: none; touch-action: none; }
.ve-grip:active { cursor: grabbing; }
.ve-drop-line { position: fixed; z-index: 2999; height: 3px; border-radius: 2px; background: var(--accent); pointer-events: none; }
.ve-dragging { opacity: .45; outline: 2px dashed var(--accent); }
/* картинку в редакторе тащат прямо мышью */
.ve-root img { cursor: grab; }
.ve-root img:active { cursor: grabbing; }
@media (hover: none) { .ve-grip { display: none; } }

/* ---------------- телефон: мессенджер с открытой клавиатурой и мелочи */
@media (max-width: 760px) {
  body.kb-open .layout .sidebar { display: none !important; }
  body.kb-open .messenger-overlay { bottom: 0 !important; }
  /* поле ввода и лента едут за клавиатурой плавно и быстро, без рывка */
  .messenger-overlay { transition: bottom .16s cubic-bezier(.2, .8, .2, 1); }
  .chat-list { overflow-anchor: none; }
  .messenger textarea, .messenger input[type="text"], .messenger input:not([type]), .chat-view textarea, .chat-panel textarea, .thread-host textarea { font-size: 16px !important; }
  .msgr-list, .chat-list, .thread-host .chat-list { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .msgr-item { -webkit-tap-highlight-color: transparent; min-height: 60px; }
  .msgr-item:active { background: var(--surface-3); }
  .chat-msg { -webkit-touch-callout: none; }
  .chat-compose-row { padding-bottom: 4px; }
}

/* личные триггеры уведомлений */
.ptrigger { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); }
.ptrigger-when { flex: 1; min-width: 0; font-size: 13.5px; }
.ptrigger-sel { width: auto; max-width: 210px; flex: none; }
.ptrigger.off .ptrigger-when { opacity: .5; }
@media (max-width: 760px) { .ptrigger { flex-wrap: wrap; } .ptrigger-sel { max-width: none; width: 100%; } }
.desk-tile-ic { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.25); vertical-align: middle; }
.desk-pick-ic .desk-tile-ic { width: 26px; height: 26px; border-radius: 7px; }
.desk-pick-ic .desk-tile-ic svg { width: 15px; height: 15px; }
.desk { min-height: 100vh; }

/* заголовок страницы на холсте — крупно и спокойно, как в OneNote: линия видна только при наведении и вводе */
.wb-header .bk-title { width: 560px; font-size: 32px; font-weight: 300; letter-spacing: -.01em; line-height: 1.2; padding: 4px 2px 6px; border-bottom: 2px solid transparent; transition: border-color .15s; }
.wb-header .bk-title:hover { border-bottom-color: var(--border); }
.wb-header .bk-title:focus { border-bottom-color: var(--accent); }
.wb-header .bk-title::placeholder { color: var(--text-3); }
.wb-header .bk-date { display: flex; gap: 14px; margin-top: 6px; padding-left: 2px; font-size: 12.5px; color: var(--text-3); }
.bk-pens.quick { flex-wrap: nowrap; }
.bk-pen-more { font-size: 12px; color: var(--text-2); }
.bk-pen-pop { z-index: 400; width: 290px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.bk-pen-pop .bk-pens { display: flex; flex-wrap: wrap; gap: 4px; }
.bk-pen-anyrow { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.bk-pen-anyrow input { width: 28px; height: 22px; border: 0; padding: 0; background: none; }
.ve-table-tools { cursor: grab; }
.ve-table-tools:active { cursor: grabbing; }
.ve-block-head { cursor: grab; }
.ve-table-grip { color: var(--text-3); letter-spacing: -2px; padding: 0 6px 0 2px; user-select: none; }
.wb-txt img { display: block; max-width: 100%; border-radius: 4px; margin: 4px 0; }

/* предпросмотр файлов перед отправкой (как в Telegram) */
.send-preview { display: flex; flex-direction: column; gap: 10px; }
.send-preview > b { font-size: 16px; }
.send-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 4px; max-height: 52vh; overflow-y: auto; border-radius: 10px; }
.send-grid.single { grid-template-columns: 1fr; }
.send-cell { position: relative; aspect-ratio: 1; background: var(--surface-2); overflow: hidden; cursor: grab; border-radius: 6px; }
.send-grid.single .send-cell { aspect-ratio: auto; max-height: 52vh; display: grid; place-items: center; }
.send-cell img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.send-grid.single .send-cell img { object-fit: contain; height: auto; max-height: 52vh; }
.send-cell.file { aspect-ratio: auto; min-height: 64px; }
.send-file { display: flex; flex-direction: column; gap: 4px; padding: 12px; font-size: 13px; word-break: break-all; }
.send-x { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }
.send-x:hover { background: rgba(0,0,0,.85); }
.send-caption { resize: none; min-height: 38px; max-height: 120px; }
/* окно отправки фото: без пустой шапки — заголовок «Выбрано…» и крестик в одной строке */
.modal.send-modal .modal-head { position: absolute; top: 8px; right: 8px; padding: 0; border: 0; background: none; z-index: 2; }
.modal.send-modal .modal-head h2 { display: none; }
.modal.send-modal { position: relative; }
.modal.send-modal .send-preview > b { padding-right: 44px; min-height: 32px; display: flex; align-items: center; }
.modal.send-modal .modal-foot { gap: 8px; }
.send-more { gap: 6px; padding-left: 10px; }
@media (max-width: 760px) {
  .send-grid, .send-grid.single .send-cell, .send-grid.single .send-cell img { max-height: 42vh; }
  .modal.send-modal .modal-foot .btn { height: 40px; }
}

/* поиск в чате */
.chat-search { border-bottom: 1px solid var(--border); background: var(--surface); max-height: 55%; display: flex; flex-direction: column; flex: none; }
.chat-search-row-in { display: flex; align-items: center; gap: 8px; padding: 8px 12px; color: var(--text-3); }
.chat-search-row-in .input { flex: 1; }
.chat-search-results { overflow-y: auto; }
.chat-search-row { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 8px 14px; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer; font: inherit; border-top: 1px solid var(--border); }
.chat-search-row:hover { background: var(--surface-2); }
.chat-search-text { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.chat-search-text mark { background: color-mix(in srgb, var(--accent) 45%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.chat-search-thread { margin-left: 6px; font-size: 11px; padding: 0 6px; gap: 3px; }
.chat-msg.chat-found .chat-bubble { box-shadow: 0 0 0 2px var(--accent); transition: box-shadow .3s; }
/* карточка треда */
.thread-info { display: flex; flex-direction: column; gap: 8px; }
.thread-info-head { display: flex; align-items: center; gap: 10px; }
.thread-info-stats { display: flex; gap: 14px; color: var(--text-2); font-size: 13px; }
.thread-info-cats { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.thread-info-cat { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; border-radius: 8px; cursor: pointer; }
.thread-info-cat:hover:not(:disabled) { background: var(--surface-2); }
.thread-info-cat:disabled { color: var(--text-3); cursor: default; }
.thread-info-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.thread-info-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; cursor: zoom-in; }
.thread-info-link { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-info-detail:not(:empty) { border-top: 1px solid var(--border); padding-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.chat-main { display: flex; flex-direction: column; min-height: 0; }

/* комментарии: заметная кнопка ответов и непрочитанные */
.replies-toggle { color: var(--link); font-weight: 600; font-size: 13px; background: color-mix(in srgb, var(--link) 10%, transparent); padding: 4px 10px; }
.replies-toggle:hover { background: color-mix(in srgb, var(--link) 18%, transparent); color: var(--link); }
.replies-tri { font-size: 12px; }
.replies-new { background: var(--danger); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 7px; line-height: 18px; }
.comment-new > .comment-body { position: relative; }
.comment-new { background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 10px; box-shadow: inset 3px 0 0 var(--accent); }
.comment-new-badge { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--accent-text); background: var(--accent); border-radius: 4px; padding: 0 5px; line-height: 16px; }
.cert-help { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 10px; background: var(--surface-2); color: var(--text); }
.cert-help ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.cert-help .btn { align-self: flex-start; }

/* ---------------- главная v2: окна папок, файлы, общие папки, плеер */
.desk-wins { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.desk-win { position: fixed; pointer-events: auto; width: 600px; height: 420px; min-width: 300px; min-height: 200px; resize: both; overflow: hidden; display: flex; flex-direction: column;
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 18px 48px rgba(0,0,0,.45); }
.desk-win-head { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-bottom: 1px solid var(--border); cursor: move; user-select: none; }
.desk-win-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.desk-win-share { font-weight: 400; color: var(--text-3); font-size: 12px; }
.desk-win-tools { display: flex; gap: 2px; }
.desk-win-btn, .desk-win-x { border: 0; background: none; color: var(--text-2); width: 30px; height: 28px; border-radius: 6px; cursor: pointer; display: grid; place-items: center; font-size: 18px; }
.desk-win-btn:hover { background: var(--surface-3); color: var(--text); }
.desk-win-x:hover { background: #e5484d; color: #fff; }
.desk-win-body { flex: 1; overflow: auto; position: relative; }
.desk-win-body.desk-drop { box-shadow: inset 0 0 0 2px var(--accent); }
.desk-win-canvas { position: relative; min-width: 100%; }
.desk-win-canvas .desk-icon-label, .desk-grid .desk-icon-label { color: var(--text); text-shadow: none; }
.desk-win-hint { position: absolute; inset: 40% 0 auto; pointer-events: none; }
.desk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 4px; padding: 12px; }
.desk-icon.static { position: relative; width: auto; height: auto; }
.desk-icon-sub { font-size: 10.5px; color: var(--text-3); text-align: center; }
.desk-icon { width: 92px; height: 100px; }
.desk-icon-img { height: 56px; display: grid; place-items: center; position: relative; }
.desk-icon-img svg { filter: drop-shadow(0 2px 4px rgba(0,0,0,.25)); }
.desk-icon.desk-drop { background: rgba(255,255,255,.3); box-shadow: 0 0 0 2px var(--accent); }
.desk-ghost { position: fixed !important; z-index: 2000; pointer-events: none; opacity: .85; transform: scale(1.05); }
.desk-item.dragging { opacity: .35; }
.desk-thumb { width: 54px; height: 54px; border-radius: 6px; overflow: hidden; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); display: block; }
.desk-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.desk-doc { width: 42px; height: 52px; border-radius: 4px; background: #fff; position: relative; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.desk-doc::after { content: ''; position: absolute; top: 0; right: 0; border-width: 0 12px 12px 0; border-style: solid; border-color: transparent #d9d9d9 transparent transparent; }
.desk-doc span { font-size: 9.5px; font-weight: 800; color: #fff; background: #3e63dd; border-radius: 3px; padding: 1px 4px; }
.desk-emoji { font-size: 40px; line-height: 1; }
.desk-video-ic { width: 54px; height: 42px; border-radius: 8px; background: linear-gradient(135deg, #2b2f36, #111); color: #fff; display: grid; place-items: center; position: relative; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.desk-video-ic svg { opacity: .35; position: absolute; }
.desk-video-ic span { font-size: 18px; }
.desk-music-folder { position: relative; display: inline-block; }
.desk-folder-badge { position: absolute; right: -4px; bottom: -2px; }
.desk-video { width: 100%; max-height: 75vh; background: #000; border-radius: 8px; display: block; }
/* заметка: цвета */
.desk-widget.w-note .desk-w-head { border-bottom-color: rgba(0,0,0,.1); }
.desk-note-colors { display: flex; flex-wrap: wrap; gap: 6px; }
.desk-note-sw { width: 44px; height: 36px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.desk-note-sw.on { border-color: var(--accent); }
/* плеер */
.desk-player { position: fixed; right: 18px; bottom: 18px; z-index: 45; width: 320px; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px);
  border: 1px solid var(--border); box-shadow: 0 16px 40px rgba(0,0,0,.45); display: flex; flex-direction: column; gap: 6px; }
.dp-top { display: flex; align-items: center; gap: 10px; }
.dp-title { min-width: 0; display: flex; flex-direction: column; }
.dp-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.dp-seek { width: 100%; accent-color: var(--accent); }
.dp-ctrl { display: flex; align-items: center; gap: 2px; }
.dp-btn { border: 0; background: none; color: var(--text); font-size: 17px; width: 34px; height: 32px; border-radius: 8px; cursor: pointer; }
.dp-btn:hover { background: var(--surface-3); }
.dp-btn.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.dp-list { max-height: 220px; overflow-y: auto; border-top: 1px solid var(--border); padding-top: 4px; }
.dp-track { display: flex; gap: 8px; width: 100%; border: 0; background: none; color: var(--text); text-align: left; padding: 6px 4px; border-radius: 6px; cursor: pointer; font: inherit; font-size: 13px; }
.dp-track:hover { background: var(--surface-2); }
.dp-track.on { color: var(--accent); font-weight: 600; }
@media (max-width: 760px) {
  .desk-win { inset: 0 0 calc(58px + env(safe-area-inset-bottom)) 0 !important; width: auto !important; height: auto !important; border-radius: 0; resize: none; }
  .desk-player { left: 8px; right: 8px; bottom: calc(66px + env(safe-area-inset-bottom)); width: auto; }
  .desk-grid .desk-m-icon { width: 100%; }
}
/* выбор смайликов открывается и поверх окон (диалог топика, папки) */
.popover.emoji-pop { z-index: 300; position: absolute; }

/* список чатов как в Telegram: крупная круглая аватарка слева на обе строки */
.msgr-item.dm { position: relative; padding-left: 74px; min-height: 68px; display: flex; flex-direction: column; justify-content: center; }
.msgr-item.dm .msgr-item-top > .avatar:first-child, .msgr-item.dm .msgr-item-top > .audit-avs:first-child {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 50px; height: 50px; font-size: 19px; margin: 0; }
.msgr-item.dm .msgr-item-top > .avatar.emoji:first-child { font-size: 24px; }
.avatar.topics { border-radius: 14px !important; }
.msgr-item.dm .msgr-item-top > .audit-avs:first-child .avatar { width: 34px; height: 34px; }
.msgr-item.msgr-new-group { min-height: 56px; }
/* папки чатов — колонкой слева и на телефоне */
@media (max-width: 760px) {
  .msgr-rail { display: flex; flex-direction: column; align-items: stretch; gap: 2px; width: 62px; flex: none; padding: 6px 0; background: var(--surface-2); border-right: 1px solid var(--border); overflow-y: auto; }
  .msgr-folder { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 2px; border: 0; background: none; color: var(--text-3); font: inherit; font-size: 10px; border-left: 3px solid transparent; }
  .msgr-folder.active { color: var(--link); background: var(--surface); border-left-color: var(--link); font-weight: 600; }
  .msgr-folder-ic { position: relative; display: grid; place-items: center; }
  .msgr-folder-badge { position: absolute; top: -6px; right: -10px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 9.5px; line-height: 16px; font-weight: 700; text-align: center; }
  .msgr-folder-label { text-align: center; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; max-width: 58px; }
  .msgr-rail-sep { height: 1px; background: var(--border); margin: 4px 10px; }
  .messenger.has-active .msgr-rail { display: none; }
  .msgr-left .msgr-tabs:not(:has(.msgr-people-head)) { display: none; }
  .msgr-item.dm { padding-left: 68px; }
  .msgr-item.dm .msgr-item-top > .avatar:first-child { left: 8px; width: 48px; height: 48px; }
}
@media (max-width: 760px) { .msgr-left { width: auto !important; flex: 1 1 auto; min-width: 0; } }
.bk-ribbon.collapsed .bk-rpanel { display: none; }
.bk-hide-btn { font-size: 12px; color: var(--text-2); }
@media (max-width: 760px) {
  /* подписи разделов бокового меню («Избранные доски», «Мои фильтры») в нижней панели не нужны */
  .layout .nav-section.nav-label { display: none !important; }
  .layout .nav a, .layout .nav button { position: relative; }
}
/* доска на телефоне: колонки друг под другом, сворачиваются нажатием на заголовок */
@media (max-width: 760px) {
  .board { flex-direction: column; align-items: stretch; overflow-x: visible; scroll-snap-type: none; margin: 0; padding: 0 0 8px; gap: 10px; }
  .board > .column { flex: none !important; width: 100% !important; max-width: none; max-height: none; }
  .board > .column .column-head { cursor: pointer; user-select: none; }
  .board > .column.collapsed .column-body { display: none; }
  .column-tri { display: inline-block !important; transition: transform .15s; font-size: 11px; color: var(--text-3); }
  .board > .column.collapsed .column-tri { transform: rotate(-90deg); }
}

/* «Треды»: список слева, открытый тред справа */
.msgr-threads-split { flex: 1; min-height: 0; display: flex; }
.msgr-threads-split .msgr-threads-list { width: 46%; min-width: 280px; overflow-y: auto; border-right: 1px solid var(--border); }
.msgr-threads-side { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--surface); }
.msgr-threads-side .thread-panel { flex: 1; width: auto; border: 0; }
.msgr-thread-item.active { background: var(--st-progress-bg); }
@media (max-width: 760px) {
  .msgr-threads-split .msgr-threads-list { width: 100%; min-width: 0; border: 0; }
  .msgr-threads-split .msgr-threads-side { display: none; }
  .msgr-threads-split.open .msgr-threads-list { display: none; }
  .msgr-threads-split.open .msgr-threads-side { display: flex; }
}
.popover.bk-menu { z-index: 350; position: fixed; }
/* заголовок страницы книги: ширина по тексту, длинный — переносится в подсказку, не обрезается посреди буквы */
@supports (field-sizing: content) {
  .wb-header .bk-title { field-sizing: content; width: auto; min-width: 220px; max-width: 1100px; }
}
.wb-header { white-space: nowrap; }
.wb-header .bk-title { text-overflow: ellipsis; }
@media (max-width: 760px) {
  .wb-header .bk-title { font-size: 26px; }
  .bk-mnav-title { font-size: 15px; }
}

/* ---------------- блок кода: как в VS Code и Telegram, одинаковый в светлой и темной теме */
.yfm-code { --tk-keyword: #569cd6; --tk-string: #ce9178; --tk-comment: #6a9955; --tk-number: #b5cea8; --tk-fn: #dcdcaa; --tk-tag: #4ec9b0; --tk-attr: #9cdcfe;
  background: #1e1e1e; border-color: #333; color: #d4d4d4; border-left: 3px solid var(--accent); max-width: 100%; }
.yfm-code-head { background: #252526; border-bottom-color: #333; color: #9d9d9d; }
.yfm-code .yfm-copy { color: #cfcfcf; }
.yfm-code pre { white-space: pre; tab-size: 4; font-family: ui-monospace, "Cascadia Code", Consolas, "Courier New", monospace; color: inherit; background: none; }
.chat-text .yfm-code { margin: 6px 0; min-width: 240px; }
.chat-code { background: rgba(127, 127, 127, .2); padding: 1px 5px; border-radius: 4px; font-family: ui-monospace, Consolas, monospace; font-size: .92em; }
.wb-txt .yfm-code { margin: 0; text-align: left; width: 100%; }

/* ---------------- ответ на сообщение */
.chat-quote { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--accent); background: rgba(127, 127, 127, .12); color: inherit; padding: 3px 8px; margin: 2px 0 5px; border-radius: 4px; cursor: pointer; font: inherit; font-size: 12.5px; overflow: hidden; }
.chat-quote b { display: block; font-size: 12px; }
.chat-quote span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .8; }
.chat-quote.gone { cursor: default; font-style: italic; opacity: .7; }
.chat-replybar { display: flex; align-items: center; gap: 8px; padding: 4px 8px; margin-bottom: 6px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 6px; font-size: 13px; }
.chat-replybar-text { min-width: 0; }
.chat-replybar-text b { display: block; font-size: 12px; }
.chat-replybar-text span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-3); }
.chat-replybar button { border: 0; background: none; color: var(--text-3); cursor: pointer; font-size: 18px; line-height: 1; }
.history-sizes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.history-sizes > div { display: flex; flex-direction: column; gap: 2px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; }
.history-bar { padding: 6px 0 10px; }
.msgr-item.pinned[draggable="true"] { cursor: grab; }

/* ---------------- значки файлов */
.file-ic { flex: none; display: block; }
.file-tile { display: inline-flex; align-items: center; gap: 8px; max-width: min(360px, 100%); padding: 6px 8px; margin: 3px 4px 3px 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); text-decoration: none; vertical-align: middle; cursor: pointer; }
.file-tile:hover { border-color: var(--accent); text-decoration: none; }
.file-tile.compact { padding: 4px 6px; }
.file-tile-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.file-tile-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.file-tile-size { font-size: 11px; color: var(--text-3); }
.file-tile-actions { display: inline-flex; gap: 2px; margin-left: auto; flex: none; }
.file-act { border: 0; background: none; color: var(--text-3); cursor: pointer; padding: 3px; border-radius: 4px; display: grid; place-items: center; }
.file-act:hover { background: var(--surface); color: var(--text); }
.file-act.danger:hover { color: #e5484d; }
.file-tile-editors, .file-row-editors { display: inline-flex; gap: 4px; flex: none; }
.doc-editor { display: inline-flex; align-items: center; gap: 2px; }
.doc-editor .avatar { width: 20px; height: 20px; font-size: 10px; }
.doc-pencil { display: inline-block; font-size: 12px; animation: doc-pencil 1.1s ease-in-out infinite; transform-origin: 20% 80%; }
@keyframes doc-pencil { 0%, 100% { transform: translate(0, 0) rotate(-8deg); } 25% { transform: translate(2px, 1px) rotate(4deg); } 50% { transform: translate(4px, 0) rotate(-6deg); } 75% { transform: translate(2px, -1px) rotate(6deg); } }
.folder-tiles { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.yfm-folder, .yfm-file { white-space: nowrap; }
.list-row.dim { opacity: .5; }
.compress-btns { display: inline-flex; gap: 2px; margin-left: 4px; }
.compress-btn { width: 22px; height: 22px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); color: var(--text-2, var(--text)); cursor: pointer; display: grid; place-items: center; padding: 0; }
.compress-btn:hover { border-color: var(--accent); color: var(--text); }
.yfm-media-state.paused { color: var(--text-3); }
.tab-unread { margin-left: 6px; font-size: 11px; }
.reply-plain { display: flex; align-items: center; gap: 8px; width: 100%; border: 1px dashed var(--border); border-radius: 8px; background: none; color: var(--text-3); padding: 6px 10px; cursor: text; font: inherit; font-size: 13px; margin-top: 6px; }
.reply-plain:hover { border-color: var(--accent); color: var(--text); }
.fresh-pill { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 50; border: 0; border-radius: 99px; padding: 8px 16px; background: var(--accent); color: var(--accent-text); font-weight: 600; cursor: pointer; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); }

/* ---------------- окно папки */
.fw { display: flex; flex-direction: column; min-height: 46vh; }
.fw.drag { outline: 2px dashed var(--accent); outline-offset: 2px; border-radius: 8px; }
.fw-bar { display: flex; align-items: center; gap: 4px; padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.fw-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; min-width: 0; }
.fw-crumb { border: 0; background: none; color: var(--text); cursor: pointer; padding: 2px 5px; border-radius: 4px; font: inherit; }
.fw-crumb:hover { background: var(--surface-2); }
.fw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; align-content: start; flex: 1; }
.fw-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 8px; cursor: default; user-select: none; text-align: center; }
.fw-item:hover { background: var(--surface-2); }
.fw-name { font-size: 12.5px; line-height: 1.25; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fw-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; }
.ctx-menu { position: fixed; z-index: 3000; min-width: 190px; }

/* ---------------- редактор кода */
.ce-overlay { z-index: 2000; }
.ce { position: fixed; inset: 3vh 3vw; display: flex; flex-direction: column; background: #1e1e1e; color: #d4d4d4; border-radius: 10px; overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.ce-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: #252526; }
.ce-tabs { display: flex; gap: 2px; overflow-x: auto; min-width: 0; }
.ce-tab { display: inline-flex; align-items: center; gap: 6px; border: 0; background: #2d2d2d; color: #bdbdbd; padding: 5px 8px; border-radius: 6px 6px 0 0; cursor: pointer; font-size: 12.5px; white-space: nowrap; }
.ce-tab.active { background: #1e1e1e; color: #fff; }
.ce-tab-x { opacity: .6; padding: 0 2px; }
.ce-tab-x:hover { opacity: 1; }
.ce-wrap { color: #bdbdbd; font-size: 12px; white-space: nowrap; }
.ce-lang { background: #333; color: #ddd; border: 1px solid #444; border-radius: 5px; font-size: 12px; padding: 3px; }
.ce-body { flex: 1; display: flex; min-height: 0; font-family: ui-monospace, "Cascadia Code", Consolas, "Courier New", monospace; font-size: 13.5px; line-height: 20px; }
.ce-gutter { flex: none; min-width: 44px; padding: 8px 8px 8px 6px; text-align: right; color: #858585; background: #1e1e1e; white-space: pre; overflow: hidden; user-select: none; border-right: 1px solid #333; }
.ce-scroll { position: relative; flex: 1; min-width: 0; }
.ce-hl, .ce-input { position: absolute; inset: 0; margin: 0; padding: 8px 10px; border: 0; font: inherit; line-height: inherit; white-space: pre; tab-size: 4; overflow: auto; box-sizing: border-box; }
.ce.wrap .ce-hl, .ce.wrap .ce-input { white-space: pre-wrap; word-break: break-all; }
.ce-hl { --tk-keyword: #569cd6; --tk-string: #ce9178; --tk-comment: #6a9955; --tk-number: #b5cea8; --tk-fn: #dcdcaa; --tk-tag: #4ec9b0; --tk-attr: #9cdcfe; color: #d4d4d4; pointer-events: none; background: none; overflow: hidden; }
.ce-hl code { background: none; padding: 0; font: inherit; color: inherit; }
.ce-input { background: transparent; color: transparent; caret-color: #fff; resize: none; outline: 0; }
.ce-input::selection { background: rgba(38, 79, 120, .75); color: transparent; }
.ce-status { padding: 3px 10px; font-size: 11.5px; background: #007acc; color: #fff; white-space: pre; overflow: hidden; }
@media (max-width: 760px) { .ce { inset: 0; border-radius: 0; } }

/* ---------------- номера в нумерованных списках можно выделить и скопировать */
.md ol, [contenteditable="true"] ol { list-style: none; counter-reset: li; padding-left: 28px; }
.md ol > li, [contenteditable="true"] ol > li { counter-increment: li; position: relative; }
.md ol > li::before, [contenteditable="true"] ol > li::before { content: counter(li) "."; position: absolute; right: 100%; margin-right: 6px; white-space: nowrap; }
li.li-selected::before { background: Highlight; color: HighlightText; border-radius: 2px; }

/* ---------------- свой цвет */
.accent-custom { position: relative; background: conic-gradient(#ff5a5a, #ffcc00, #30a46c, #00a2c7, #3e63dd, #d6409f, #ff5a5a); cursor: pointer; overflow: hidden; }
.accent-color-input { position: absolute; inset: -6px; opacity: 0; width: calc(100% + 12px); height: calc(100% + 12px); cursor: pointer; }

/* ---------------- оформление дашборда */
.board-styled { min-height: calc(100vh - 40px); border-radius: 10px; padding: 14px; }
.board-styled .column { background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(4px); }
.board-styled h1, .board-styled .page-head { text-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
/* шапка доски: название с иконкой и звездой — одним блоком, тип доски — тихой подписью */
.board-title { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.board-title h1 { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-kind { font-size: 12px; color: var(--text-3); padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
/* доска с фоном: «стеклянные» кнопки и подложка под названием — читаются на любой картинке */
/* цветные значки внутри кнопок (🛠, 🧩, книга) — ровно по центру, как обычная иконка */
.ic-emoji { display: inline-grid; place-items: center; line-height: 1; flex: none; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.ic-color { display: inline-flex; flex: none; }
/* кнопки шапки доски — все одного размера */
.board-head .btn { height: 34px; padding: 0 14px; gap: 7px; font-size: 13px; border-radius: 10px; }
.board-head .btn.only-mine.active { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); border-color: var(--accent); }
/* доска с фоном: стекло как в macOS — без ободков, размытие и мягкая тень; читается на любой картинке */
.board-styled .board-head { gap: 8px; text-shadow: none; }
.board-styled .board-head .board-title,
.board-styled .board-head .btn,
.board-styled .board-head .board-kind,
.board-styled .board-head .tabs,
.board-styled .sprint-glass .btn {
  background: color-mix(in srgb, var(--surface) 40%, transparent);
  border: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .18), 0 8px 24px rgba(0, 0, 0, .16);
  backdrop-filter: blur(26px) saturate(1.8); -webkit-backdrop-filter: blur(26px) saturate(1.8);
  color: var(--text);
}
.board-styled .board-head .board-title { height: 40px; padding: 0 14px 0 12px; border-radius: 12px; }
.board-styled .board-head .board-title h1 { font-size: 19px; }
.board-styled .board-head .btn:hover { background: color-mix(in srgb, var(--surface) 58%, transparent); }
.board-styled .board-head .btn:active { transform: scale(.98); }
.board-styled .board-head .btn.primary { background: color-mix(in srgb, var(--accent) 78%, transparent); color: #fff; }
.board-styled .board-head .btn.primary:hover { background: color-mix(in srgb, var(--accent) 92%, transparent); }
.board-styled .board-head .btn.only-mine.active { background: color-mix(in srgb, var(--accent) 42%, transparent); }
.board-styled .board-head .board-kind { height: 34px; display: inline-flex; align-items: center; color: var(--text-2); border-radius: 10px; }
.board-styled .board-head .tabs { border-radius: 10px; padding: 2px; }
.in-app .board-styled .board-head .board-title, .in-app .board-styled .board-head .btn,
.in-app .board-styled .board-head .board-kind { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }

/* ---------------- рейтинг исполняемости */
.rating-wrap { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.rating-title { padding: 0 2px 4px; }
.rating-bars { flex: 1; display: flex; gap: 10px; align-items: stretch; min-height: 0; overflow-x: auto; padding-bottom: 2px; }
.rating-col { flex: 1 0 58px; max-width: 110px; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 0; }
.rating-val { font-size: 12px; font-weight: 700; }
.rating-track { flex: 1; width: 100%; min-height: 30px; display: flex; align-items: flex-end; background: rgba(127, 127, 127, .1); border-radius: 6px; overflow: hidden; }
.rating-bar { width: 100%; border-radius: 6px 6px 0 0; transform-origin: bottom; animation: rating-grow .9s cubic-bezier(.2, .8, .2, 1) backwards; position: relative; overflow: hidden; }
.rating-bar::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255, 255, 255, .3), transparent 45%); animation: rating-shine 2.8s ease-in-out infinite; }
@keyframes rating-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes rating-shine { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
.rating-name { font-size: 11px; text-align: center; line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- блок кода в редакторе: те же цвета, что после отправки */
.ve-code { --tk-keyword: #569cd6; --tk-string: #ce9178; --tk-comment: #6a9955; --tk-number: #b5cea8; --tk-fn: #dcdcaa; --tk-tag: #4ec9b0; --tk-attr: #9cdcfe; background: #1e1e1e; color: #d4d4d4; border-left: 3px solid var(--accent); }
.ve-code > .ve-block-head { background: #252526; border-bottom-color: #333; }
.ve-code .ve-block-label { color: #9d9d9d; }
.ve-code .ve-lang { color: #cfcfcf; }
.ve-code .ve-lang:focus { background: #333; }
.ve-code > pre { white-space: pre; overflow-x: auto; tab-size: 4; font-family: ui-monospace, "Cascadia Code", Consolas, "Courier New", monospace; color: #d4d4d4; caret-color: #fff; background: none; }

/* ---------------- свой цвет у каждой колонки: подмешивается к фону темы, поэтому не слепит */
.column.colored, .board-styled .column.colored { background: color-mix(in srgb, var(--col) 24%, var(--surface)); }
.column.colored .column-head { background: color-mix(in srgb, var(--col) 42%, var(--surface)); border-radius: 8px 8px 0 0; }
.column-color-menu { padding: 10px; max-width: 244px; display: flex; flex-direction: column; gap: 8px; }

/* ---------------- приложение для Android */
.in-app body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
.in-app a, .in-app button { touch-action: manipulation; }
.app-setting { display: flex; align-items: center; gap: 12px; padding: 4px 0; }
.app-settings h2 { margin: 0; }
.app-shortcuts { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.app-shortcut { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text); font: inherit; text-align: left; }
.app-shortcut.on { opacity: .6; }
/* удержание кнопки записи: жест не должен превращаться в прокрутку и обрывать запись */
.chat-mic { touch-action: none; user-select: none; -webkit-user-select: none; }

/* ---------------- работа без связи */
.off-badge { position: fixed; top: calc(8px + env(safe-area-inset-top)); right: 10px; z-index: 4000; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #e5202a; color: #fff; display: grid; place-items: center; box-shadow: 0 3px 12px rgba(229, 32, 42, .5); animation: off-pulse 2s ease-in-out infinite; }
.off-badge.syncing { background: #e08a00; box-shadow: 0 3px 12px rgba(224, 138, 0, .5); }
.off-count { position: absolute; right: -4px; bottom: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #fff; color: #1f2328; font-size: 11px; font-weight: 700; line-height: 18px; }
.off-wave { animation: off-wave 1.6s ease-in-out infinite; }
.off-wave.w2 { animation-delay: .3s; }
@keyframes off-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.09); } }
@keyframes off-wave { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.offline-btn.on, .file-act.on { color: #30a46c; }

/* ---------------- плавность в приложении */
.in-app *, .in-app *::before, .in-app *::after { -webkit-tap-highlight-color: transparent; }
.in-app .bcard, .in-app .card, .in-app .wb-el { box-shadow: none; }
.in-app .board-styled .column { backdrop-filter: none; }
/* только список чатов: в переписке и комментариях приблизительная высота ломает прокрутку к последнему сообщению */
.in-app .msgr-item { content-visibility: auto; contain-intrinsic-size: auto 72px; }
.wb-moving .wb-world { will-change: transform; }
.wb-moving .wb-author, .wb-moving .wb-ctx { display: none; }

/* ---------------- программа для Windows */
.win-solo .sidebar { display: none; }
.win-solo .layout { display: block; padding: 0; }
.win-solo .main { margin: 0; padding-bottom: 0; }
.win-solo-messenger .messenger-overlay { inset: 0; padding: 0; }
.win-solo-messenger .messenger { width: 100%; max-width: none; height: 100%; max-height: none; border-radius: 0; }
.win-solo-messenger .msgr-close, .win-solo-messenger .msgr-close-mobile { display: none; }
.in-win .nav-msgr.active { background: none; }
.win-tabs { position: sticky; top: 0; z-index: 30; display: flex; gap: 2px; padding: 6px 10px 0; overflow-x: auto; background: var(--bg); border-bottom: 1px solid var(--border); }
.win-tab { display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; background: none; color: var(--text-3); padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.win-tab:hover { background: var(--surface-2); color: var(--text); }
.win-tab.active { background: var(--surface); border-color: var(--border); color: var(--text); font-weight: 600; }
.win-tab-x { width: 16px; height: 16px; border-radius: 4px; line-height: 15px; text-align: center; color: var(--text-3); }
.win-tab-x:hover { background: var(--surface-3); color: var(--text); }
.win-tabs { align-items: flex-end; gap: 0; padding: 6px 10px 0 6px; box-shadow: inset 0 -2px 0 var(--fc); }
.tab-folders { display: flex; align-items: center; gap: 4px; flex: none; padding: 0 8px 6px 0; margin-right: 6px; border-right: 1px solid var(--border); align-self: stretch; }
.tab-folder { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 28px; padding: 0 9px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; max-width: 160px; }
.tab-folder:hover { background: var(--surface-2); color: var(--text); }
.tab-folder.on { background: color-mix(in srgb, var(--fc) 18%, transparent); border-color: color-mix(in srgb, var(--fc) 55%, transparent); color: var(--text); font-weight: 600; }
.tab-folder-name { overflow: hidden; text-overflow: ellipsis; }
.tab-folder-dot { display: inline-block; flex: none; border-radius: 50%; }
.tab-folder-home { display: inline-flex; }
.tab-folder-add { color: var(--text-3); padding: 0 7px; }
.tab-list { display: flex; gap: 2px; min-width: 0; align-items: flex-end; }
.win-tab { max-width: 240px; flex: none; }
.win-tab.active { box-shadow: inset 0 2px 0 var(--fc); }
.win-tab-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.win-tab svg { flex: none; }
.tab-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.tab-swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; position: relative; display: grid; place-items: center; }
.tab-swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.tab-swatch-custom { background: conic-gradient(#e5484d, #d39e00, #30a46c, #0090ff, #8e4ec6, #e5484d); color: #fff; font-weight: 700; overflow: hidden; }
.tab-swatch-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
/* в неоткрытой вкладке что-то изменилось — плавно мигает, как кнопка на панели задач Windows */
@keyframes tab-flash { 0%, 100% { background: transparent; } 50% { background: color-mix(in srgb, #f5a524 45%, transparent); } }
.win-tab.flash, .tab-folder.flash { animation: tab-flash 1.6s ease-in-out infinite; }
.win-tab.flash .win-tab-name { color: var(--text); font-weight: 600; }
/* вкладки в боковом меню: список под избранными досками, папки — раскрывашки */
.admin-mode-banner { background: color-mix(in srgb, #e5484d 16%, var(--surface)); }
.login-insecure { margin-top: 14px; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, #f5a524 14%, transparent); color: var(--text-2); line-height: 1.4; }
.login-code { font-size: 22px; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.nav-tabs-slot { display: flex; flex-direction: column; min-height: 0; flex: 0 1 auto; }
.nav-tabs-head { display: flex; align-items: center; }
.nav-tabs-add { border: 0; background: none; color: #7d8592; cursor: pointer; padding: 2px 4px; border-radius: 4px; display: inline-flex; }
.nav-tabs-add:hover { color: #fff; background: var(--sidebar-hover); }
.nav-tabs { overflow-y: auto; min-height: 0; scrollbar-width: thin; }
.nav .nav-tab, .nav .nav-tab-folder-head { padding: 5px 8px 5px 10px; font-size: 13px; gap: 8px; }
.nav .nav-tab svg, .nav .nav-tab-folder-head svg { width: 15px; height: 15px; }
.nav-tab-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-tab-x { opacity: 0; width: 18px; height: 18px; line-height: 17px; text-align: center; border-radius: 4px; color: #9aa1ac; flex: none; }
.nav-tab:hover .nav-tab-x, .nav-tab.active .nav-tab-x { opacity: 1; }
/* булавка: серая при наведении, у закрепленной — всегда видна */
.nav-tab-pin { opacity: 0; flex: none; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 4px; color: #7d8592; }
.nav-tab:hover .nav-tab-pin { opacity: 1; }
.nav-tab-pin.on { opacity: 1; color: #aeb4bd; }
.nav-tab-pin.on svg { fill: currentColor; }
.nav-tab-pin:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.nav-tab-pin svg { width: 13px !important; height: 13px !important; }
.nav-tabs-close { border: 0; background: none; color: #e5484d; cursor: pointer; padding: 2px 4px; border-radius: 4px; display: inline-flex; margin-left: 2px; }
.nav-tabs-close:hover { background: rgba(229, 72, 77, .18); }
.layout.collapsed .nav-tab-pin:not(.on), .layout.collapsed .nav-tabs-close { display: none; }
.nav-tab-x:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.tab-issue-mark { width: 15px; height: 15px; flex: none; border-radius: 4px; background: rgba(255, 255, 255, .1); font-size: 8.5px; font-weight: 700; display: grid; place-items: center; letter-spacing: -.02em; color: #c7ccd4; }
.nav-tab-caret { display: inline-grid; place-items: center; width: 16px; height: 16px; flex: none; transition: transform .15s; color: #aeb4bd; }
.nav .nav-tab-caret svg { width: 14px; height: 14px; opacity: 1; }
.nav-tab-folder-head:hover .nav-tab-caret { color: #fff; }
.tab-folder-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.nav-tab-folder.open .nav-tab-caret { transform: rotate(90deg); }
.nav-tab-count { margin-left: auto; font-size: 11px; color: #7d8592; }
.nav-tab-folder-body { margin-left: 14px; padding-left: 6px; border-left: 2px solid var(--fc); display: flex; flex-direction: column; gap: 2px; }
.nav-tab-empty { padding: 4px 10px; font-size: 12px; color: #7d8592; white-space: normal; }
.nav .nav-tab.flash, .nav .nav-tab-folder-head.flash { animation: tab-flash 1.6s ease-in-out infinite; color: #fff; }
.layout.collapsed .nav-tab-folder-body { margin-left: 0; padding-left: 0; border-left: 0; }
.layout.collapsed .nav-tab-x, .layout.collapsed .nav-tab-caret, .layout.collapsed .nav-tabs-add { display: none; }
/* загрузка больших файлов */
.upl-panel { position: fixed; left: 16px; bottom: 16px; z-index: 150; width: 360px; display: flex; flex-direction: column; gap: 8px; }
.upl-row { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 7px; }
.upl-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.upl-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.upl-pct { font-size: 13px; font-variant-numeric: tabular-nums; }
.upl-x { border: 0; background: none; color: var(--text-3); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; }
.upl-x:hover { color: var(--text); }
.upl-track { height: 7px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
@keyframes upl-snake { to { background-position: 28px 0; } }
.upl-fill { height: 100%; width: 2%; border-radius: 4px; transition: width .3s ease;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 10px, color-mix(in srgb, var(--accent) 55%, #fff) 10px 20px); background-size: 28px 28px; animation: upl-snake .7s linear infinite; }
.upl-row.ok .upl-fill { animation: none; background: #30a46c; }
.upl-row.bad .upl-fill { animation: none; background: #e5484d; }
.upl-info { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .upl-panel { left: 8px; right: 8px; width: auto; bottom: calc(74px + env(safe-area-inset-bottom)); } }
/* документ во вкладке: занимает место страницы под панелью вкладок; скрытый остается открытым */
.doc-pane { position: fixed; left: var(--doc-left, 0); top: var(--doc-top, 0); right: 0; bottom: 0; z-index: 25; display: flex; flex-direction: column; background: var(--bg); }
.doc-pane.off { visibility: hidden; pointer-events: none; }
.doc-pane > .empty { margin: auto; }
body.doc-tab-on .main > main, body.doc-tab-on .chat-fab, body.doc-tab-on .chat-panel { display: none; }

/* ---------------- «Боты»: программа во фрейме на всю высоту (bots-theme.css красит ее под трекер) */
.content.bots-page { padding: 0 !important; display: flex; flex-direction: column; min-height: 100vh; }
.bots-frame { flex: 1; width: 100%; min-height: 100vh; border: 0; display: block; background: var(--bg); }
@media (max-width: 760px) {
  .content.bots-page { padding: 0 0 calc(58px + env(safe-area-inset-bottom)) !important; min-height: 0; height: 100vh; height: 100dvh; }
  .bots-frame { min-height: 0; }
}

/* ---------------- окна программ (appwin.js): как окно в Windows */
.app-win { position: fixed; z-index: 60; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 10px; box-shadow: 0 18px 60px rgba(0, 0, 0, .35); overflow: hidden; min-width: 360px; min-height: 260px; }
.app-win.max { border-radius: 0; border-width: 0 0 0 1px; box-shadow: none; }
.app-win.min { display: none; }
.app-win-head { height: 36px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 0 0 10px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); cursor: default; user-select: none; touch-action: none; }
.app-win-ic { display: grid; place-items: center; }
.app-win-title { font-size: 13px; font-weight: 600; }
.app-win-btn { width: 44px; height: 36px; border: 0; background: none; color: var(--text-2); display: grid; place-items: center; cursor: pointer; }
.app-win-btn:hover { background: var(--surface-3); color: var(--text); }
.app-win-btn.app-win-close:hover { background: #e5484d; color: #fff; }
.app-win-body { flex: 1; min-height: 0; position: relative; }
.app-win-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: var(--bg); }
/* пока окно двигают или тянут за край — фрейм не забирает мышь себе */
body.app-win-busy .app-win-frame { pointer-events: none; }
body.app-win-busy { user-select: none; }
.app-win-grip { position: absolute; z-index: 2; }
.app-win.max .app-win-grip { display: none; }
.app-win-grip.g-n, .app-win-grip.g-s { left: 8px; right: 8px; height: 6px; cursor: ns-resize; }
.app-win-grip.g-n { top: -3px; } .app-win-grip.g-s { bottom: -3px; }
.app-win-grip.g-e, .app-win-grip.g-w { top: 8px; bottom: 8px; width: 6px; cursor: ew-resize; }
.app-win-grip.g-e { right: -3px; } .app-win-grip.g-w { left: -3px; }
.app-win-grip.g-ne, .app-win-grip.g-nw, .app-win-grip.g-se, .app-win-grip.g-sw { width: 14px; height: 14px; }
.app-win-grip.g-ne { top: -3px; right: -3px; cursor: nesw-resize; } .app-win-grip.g-sw { bottom: -3px; left: -3px; cursor: nesw-resize; }
.app-win-grip.g-nw { top: -3px; left: -3px; cursor: nwse-resize; } .app-win-grip.g-se { bottom: -3px; right: -3px; cursor: nwse-resize; }

/* значок «Боты» на главной: такая же плашка, как у разделов, только белая; кружок — пока работают правила */
.desk-tile-ic.desk-bots-ic { position: relative; background: #fff; }
.desk-bots-dot { position: absolute; right: -4px; bottom: -4px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; display: none; }
.desk-bots-dot.on { display: block; background: #2f6fde; animation: bots-pulse 2s ease-out infinite; }
.desk-bots-dot.down { display: block; background: #8b8d98; }
@keyframes bots-pulse {
  0% { box-shadow: 0 0 0 0 rgba(47, 111, 222, .75); }
  70% { box-shadow: 0 0 0 9px rgba(47, 111, 222, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 111, 222, 0); }
}
@media (prefers-reduced-motion: reduce) { .desk-bots-dot.on { animation: none; } }
.nav .nav-tab > svg:first-child rect { rx: 4; }
/* страница «Ак-боты» (телефон): та же шапка, что у окна */
.bots-page-head { flex: none; height: 44px; padding-left: 12px; }
.bots-page-head .app-win-btn { width: 48px; height: 44px; }

/* «Поделиться настройками чата» (Ак-боты) */
.bots-share-list { display: flex; flex-direction: column; gap: 2px; max-height: 46vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 4px; }
.bots-share-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.bots-share-row:hover { background: var(--surface-3); }
.bots-share-warn { margin-top: 8px; padding: 8px 10px; border-radius: 6px; background: var(--st-paused-bg); color: var(--st-paused); }

/* «Ак-боты»: переключатель «Мои» / общие чаты над программой */
.bots-spaces { flex: none; display: flex; gap: 4px; padding: 5px 8px; overflow-x: auto; scrollbar-width: none; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.bots-spaces::-webkit-scrollbar { display: none; }
.bots-space { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 12px; border-radius: 13px; border: 1px solid transparent; background: none; color: var(--text-2); font-size: 13px; cursor: pointer; white-space: nowrap; }
.bots-space:hover { background: var(--surface-3); color: var(--text); }
.bots-space.on { background: var(--text); color: var(--surface); }
.bots-space-ic { font-size: 12px; }

/* главная на телефоне: значки и виджеты переставляются пальцем (подержать — поднять — повести) */
.desk-m-icon, .desk-widget .desk-w-head { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.desk-m-lift { position: relative; z-index: 30; opacity: .92; transition: none !important; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .35)); }
.desk-m-over { position: relative; }
.desk-m-over::before { content: ''; position: absolute; top: 6%; bottom: 6%; left: -4px; width: 3px; border-radius: 2px; background: var(--accent); }
.desk-m-over.after::before { left: auto; right: -4px; }
.desk-widget.desk-m-over::before { top: -5px; bottom: auto; left: 8%; right: 8%; width: auto; height: 3px; }
.desk-widget.desk-m-over.after::before { top: auto; bottom: -5px; }

/* окно программы — только на главной: на других страницах спрятано, программа внутри работает */
.app-win.away { display: none; }

/* программа для Windows: «Ак-боты» в своем окне — у окна свой заголовок и крестик, кнопка «Закрыть» страницы не нужна */
.win-solo-bots .bots-page-head .app-win-btn[title="Закрыть"] { display: none; }
.win-solo-bots .content.bots-page { min-height: 100vh; }

/* голосовое — в сером кружке, чтобы рядом с «Отправить» смотрелось как пара кнопок */
.chat-compose-row .chat-mic { background: var(--surface-3); color: var(--text-2); }
.chat-compose-row .chat-mic:hover { background: color-mix(in srgb, var(--text) 14%, var(--surface-3)); color: var(--text); }

/* проигрыватель (player.js): перетаскивается за верх, кнопки — значками */
.desk-player { touch-action: none; }
.desk-player .dp-top { cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; }
.desk-player.dragging { opacity: .92; transition: none; }
.desk-player.dragging .dp-top { cursor: grabbing; }
.dp-btn { display: inline-grid; place-items: center; color: var(--text-2); }
.dp-btn:hover { color: var(--text); }
.dp-btn.dp-main { color: var(--text); }  /* «Играть/Пауза» — как остальные кнопки, только чуть заметнее цветом */
.dp-repeat { position: relative; display: inline-grid; place-items: center; }
.dp-repeat i { position: absolute; right: -5px; bottom: -4px; font-style: normal; font-size: 9px; font-weight: 700; line-height: 12px; min-width: 12px; padding: 0 2px; border-radius: 6px; background: var(--accent); color: var(--accent-text); }
.dp-speed { font-size: 12px; font-weight: 700; min-width: 30px; text-align: center; }
.dp-btn.dp-close { width: 28px; height: 28px; }
/* голосовое — как в мессенджерах: круглая кнопка, волна, длительность под ней, скорость справа */
.yfm-media.yfm-voice { display: inline-flex; flex-direction: row; align-items: center; gap: 10px; width: 100%; max-width: 340px; padding: 8px 10px 8px 8px;
  border: 0; border-radius: 14px; background: color-mix(in srgb, var(--link) 12%, var(--surface-2)); overflow: visible; }
.yfm-voice-play { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer; background: var(--link); position: relative; }
.yfm-voice-play::before { content: ''; position: absolute; left: 16px; top: 13px; border-style: solid; border-width: 8px 0 8px 13px; border-color: transparent transparent transparent #fff; }
.yfm-voice.playing .yfm-voice-play::before { left: 14px; top: 13px; width: 4px; height: 16px; border: 0; background: #fff; box-shadow: 9px 0 0 #fff; }
.yfm-voice-play:hover { filter: brightness(1.08); }
.yfm-voice-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.yfm-voice-wave { height: 26px; display: flex; align-items: center; gap: 2px; cursor: pointer; }
.yfm-voice-wave i { flex: 1; min-width: 2px; max-width: 3px; border-radius: 2px; background: color-mix(in srgb, var(--link) 45%, transparent); }
.yfm-voice-wave i.on { background: var(--link); }
.yfm-voice-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 12px; color: var(--link); line-height: 1; min-width: 0; }
/* длительность не сжимается: длинная подпись («в памяти · ждет сжатия» и кнопки) уходит на вторую строку,
   а не выдавливает цифры в столбик */
.yfm-voice-time { font-variant-numeric: tabular-nums; flex: none; white-space: nowrap; }
.yfm-voice-meta .yfm-media-state { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.yfm-voice-meta .compress-btns { flex: none; }
.yfm-voice-speed { flex: none; align-self: flex-start; border: 0; cursor: pointer; font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 10px;
  background: color-mix(in srgb, var(--link) 18%, transparent); color: var(--link); }
.yfm-voice-speed:hover { background: color-mix(in srgb, var(--link) 28%, transparent); }
.yfm-voice .yfm-media-bar { padding: 0; gap: 0; }
.yfm-voice .yfm-media-bar:empty, .yfm-voice .yfm-media-bar:not(:has(button)) { display: none; }
.chat-voice .yfm-media.yfm-voice { max-width: 300px; }
/* идет запись голосового, а переписка с ней не на экране — полоса поверх всего трекера */
.voice-rec-bar { position: fixed; z-index: 2000; top: calc(8px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); max-width: calc(100vw - 16px);
  display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid color-mix(in srgb, var(--danger) 55%, var(--border));
  box-shadow: 0 4px 18px rgba(0, 0, 0, .25); animation: pop-in .18s cubic-bezier(.2, .8, .2, 1); }
.voice-rec-bar .chat-rec-dot { flex: none; }
.voice-rec-bar-title { border: 0; background: none; padding: 0; color: var(--text); font-size: 13.5px; cursor: pointer; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-rec-bar-title:hover { text-decoration: underline; }
.voice-rec-bar-time { flex: none; font-variant-numeric: tabular-nums; color: var(--danger); font-weight: 600; font-size: 13px; }
.voice-rec-bar .btn { flex: none; }
@media (max-width: 760px) { .voice-rec-bar { left: 8px; right: 8px; transform: none; border-radius: 14px; } .voice-rec-bar-title { flex: 1; } }
/* кнопка «→A» в голосовом: расшифровать / показать / свернуть текст (как в Telegram) */
.yfm-voice-tx { flex: none; align-self: flex-start; height: 22px; min-width: 32px; padding: 0 7px; margin-right: -5px; border-radius: 10px; border: 0; cursor: pointer;
  display: inline-grid; place-items: center; color: var(--link); background: color-mix(in srgb, var(--link) 18%, transparent); transition: background .15s; }
.yfm-voice-tx svg { width: 15px; height: 15px; display: block; }
/* «1,5×» рядом — той же высоты и формы, что «→A» */
.yfm-voice .yfm-voice-speed { height: 22px; min-width: 32px; padding: 0 7px; display: inline-grid; place-items: center; line-height: 1; }
.yfm-voice-tx:hover { background: color-mix(in srgb, var(--link) 28%, transparent); }
.yfm-voice-tx.busy { animation: voice-tx-pulse 1.4s ease-in-out infinite; }
@keyframes voice-tx-pulse { 50% { background: color-mix(in srgb, var(--link) 34%, transparent); } }
/* текст голосового под плеером */
.voice-text { max-width: 340px; margin: 4px 0 2px; font-size: 13.5px; line-height: 1.4; color: var(--text); overflow-wrap: anywhere; animation: fade-in .18s ease-out; }
.voice-text.hidden { display: none; }
.chat-bubble .voice-text { max-width: 100%; }
/* анимация в конце текста, пока расшифровка продолжается */
.voice-text-dots { display: inline-flex; gap: 3px; margin-left: 2px; vertical-align: middle; }
.voice-text-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--link); animation: typing-dot 1.2s infinite; }
.voice-text-dots i:nth-child(2) { animation-delay: .2s; }
.voice-text-dots i:nth-child(3) { animation-delay: .4s; }
.voice-text .faint { font-size: 12.5px; }
.voice-text-body { white-space: pre-wrap; }
.voice-text-note { font-size: 12px; margin-top: 4px; }

/* CellGemma — «виртуальная клетка» (cellgemma.js) */
.desk-tile-ic.desk-cg-ic { background: linear-gradient(135deg, #0f9d58, #1a73e8); }
.cg-page { display: flex; flex-direction: column; gap: 14px; }
.cg-head { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; row-gap: 4px; align-items: center; }
.cg-head h1 { margin: 0; font-size: 22px; }
.cg-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.cg-title .cg-status { flex-direction: row; align-items: center; margin-left: auto; }
.cg-about { grid-column: 2; }
.cg-access { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow: auto; }
.cg-access label.row { gap: 8px; align-items: center; }
.cg-logo { display: flex; width: 42px; height: 42px; flex: none; border-radius: 50%; align-items: center; justify-content: center; color: #fff;
  background: linear-gradient(135deg, #0f9d58, #1a73e8); }
.cg-logo svg { width: 24px; height: 24px; }
.cg-status { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.cg-grid { display: grid; grid-template-columns: minmax(320px, 420px) 1fr; gap: 14px; align-items: start; }
.cg-form h2, .cg-result h2, .cg-history h2 { margin: 0 0 10px; font-size: 17px; }
.cg-pert { border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 8px; }
.cg-fields { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.cg-fields .full, .cg-fields > .faint { grid-column: 1 / -1; }
.cg-cell { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.cg-cell label.row { gap: 6px; align-items: center; font-size: 14px; }
.cg-files { display: flex; flex-direction: column; gap: 6px; padding-left: 22px; }
.cg-genes { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 10px; }
.cg-gene { font: 12px var(--mono, monospace); padding: 2px 6px; border-radius: 6px; }
.cg-gene.up { background: rgba(229, 72, 77, .12); color: #c42b30; }
.cg-gene.down { background: rgba(62, 123, 250, .12); color: #2459c9; }
.cg-up-t { color: #c42b30; }
.cg-down-t { color: #2459c9; }
.cg-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cg-table td { padding: 4px 8px; }
.cg-bar-wrap { position: relative; display: flex; align-items: center; gap: 8px; min-width: 180px; }
.cg-bar { height: 8px; border-radius: 4px; min-width: 2px; max-width: 120px; flex: none; }
.cg-bar.up { background: #e5484d; }
.cg-bar.down { background: #3e7bfa; }
.cg-progress { margin: 12px 0; display: flex; flex-direction: column; gap: 6px; }
.cg-pbar { height: 6px; border-radius: 3px; background: rgba(127, 127, 127, .18); overflow: hidden; }
.cg-pbar > div { height: 100%; background: linear-gradient(90deg, #0f9d58, #1a73e8); transition: width .5s; }
.cg-hist { display: flex; flex-direction: column; gap: 4px; }
.cg-hist-item { display: flex; gap: 10px; align-items: center; text-align: left; padding: 8px 10px; border-radius: 8px; border: 1px solid transparent; background: none; color: inherit; cursor: pointer; }
.cg-hist-item:hover { background: var(--hover, rgba(127, 127, 127, .08)); }
.cg-hist-item.active { border-color: var(--accent); }
.chip.cg-st-done { background: rgba(47, 168, 79, .15); color: #23863f; }
.chip.cg-st-error { background: rgba(229, 72, 77, .15); color: #c42b30; }
.chip.cg-st-working, .chip.cg-wait { background: rgba(245, 166, 35, .18); color: #a86b00; }
.chip.cg-off { background: rgba(127, 127, 127, .15); }
@media (max-width: 860px) {
  .cg-grid, .cg-two { grid-template-columns: 1fr; }
  .cg-grid { min-width: 0; }
  .cg-grid > .card, .cg-history { min-width: 0; padding: 14px; }
}
/* телефон: шапка в одну строку, поля друг под другом во всю ширину, длинные названия наборов не распирают экран */
@media (max-width: 760px) {
  .cg-head { grid-template-columns: auto 1fr; }
  .cg-logo { width: 34px; height: 34px; }
  .cg-logo svg { width: 20px; height: 20px; }
  .cg-head h1 { font-size: 20px; }
  .cg-about { grid-column: 1 / -1; }
  .cg-title .cg-status .btn { padding: 4px 8px; }
  .cg-pert { padding: 10px 8px; }
  .cg-fields { grid-template-columns: 1fr; }
  .cg-fields .row { display: grid; grid-template-columns: 1fr 90px; gap: 8px; }
  .cg-form select.input, .cg-form input.input { width: 100%; min-width: 0; max-width: 100%; }
  .cg-form select.input { text-overflow: ellipsis; }
  .cg-files { padding-left: 0; }
  .cg-hist-item { flex-wrap: wrap; gap: 6px; }
  .cg-hist-item .grow { flex-basis: 100%; order: 2; }
  .cg-table td, .cg-table th { padding: 4px; font-size: 12px; }
  .cg-bar-wrap { min-width: 0; }
  .cg-bar { max-width: 60px; }
}
.voice-text-body.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.voice-text-wait { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); }
.voice-text-btn, .voice-text-more { border: 0; background: none; padding: 2px 0; margin-right: 8px; font-size: 12.5px; color: var(--link); cursor: pointer; }
.voice-text-btn:hover, .voice-text-more:hover { text-decoration: underline; }
.yfm-speed-menu { position: fixed; z-index: 400; display: flex; gap: 2px; padding: 4px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.yfm-speed-menu button { border: 0; background: none; color: var(--text); font: inherit; font-size: 13px; font-weight: 600; padding: 5px 9px; border-radius: 7px; cursor: pointer; }
.yfm-speed-menu button:hover { background: var(--surface-3); }
.yfm-speed-menu button.on { background: var(--link); color: #fff; }

/* аудиофайл — карточкой, как файл на главной; нажали — играет в проигрывателе трекера */
.yfm-media.yfm-audio-file { flex-direction: row; align-items: center; max-width: 380px; }
.yfm-audio-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.yfm-audio-open:hover { background: var(--surface-3); }
.yfm-audio-open > svg { flex: none; }
.yfm-audio-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.yfm-audio-text .yfm-media-name { color: var(--text) !important; font-size: 13px; }
.yfm-audio-hint { font-size: 12px; color: var(--link); }
.yfm-audio-file .yfm-media-bar { flex: none; padding: 0 6px; }
/* папки: вид «списком» — значок, название, сведения строкой (на главной и в тикетах) */
.desk-rows { display: flex; flex-direction: column; padding: 4px; }
.desk-item.desk-row { position: relative; left: auto !important; top: auto !important; width: auto; height: auto; display: flex; align-items: center; gap: 10px;
  padding: 5px 8px; border-radius: 7px; }
.desk-row:hover, .desk-row:focus { background: var(--surface-2); }
.desk-row.desk-drop { box-shadow: inset 0 0 0 2px var(--accent); }
.desk-row-ic { flex: none; width: 30px; height: 30px; display: grid; place-items: center; }
.desk-row-ic svg, .desk-row-ic img { width: 28px !important; height: 28px !important; }
.desk-row-ic .desk-tile-ic { width: 26px; height: 26px; border-radius: 7px; box-shadow: none; }
.desk-row-ic .desk-tile-ic svg { width: 15px !important; height: 15px !important; }
.desk-row-ic .desk-thumb, .desk-row-ic .desk-thumb img { width: 28px; height: 28px; border-radius: 5px; object-fit: cover; }
.desk-row-ic .desk-folder-badge, .desk-row-ic .desk-folder-n, .desk-row-ic .desk-bots-dot { display: none; }
.desk-row-ic .desk-emoji { font-size: 22px; }
.desk-row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; color: var(--text); }
.desk-row-meta { flex: none; font-size: 12px; color: var(--text-3); white-space: nowrap; }

.fw-rows { display: flex; flex-direction: column; gap: 1px; flex: 1; align-content: start; }
.fw-rows .fw-item { flex-direction: row; align-items: center; gap: 10px; padding: 6px 8px; text-align: left; }
.fw-rows .fw-name { flex: 1; min-width: 0; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; -webkit-line-clamp: unset; }
.fw-rows .fw-thumb { width: 26px; height: 26px; border-radius: 5px; }
.fw-rows .fw-item > svg { flex: none; }
.fw-meta { flex: none; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.fw-view { display: inline-flex; }
@media (max-width: 760px) { .desk-row-meta, .fw-meta { font-size: 11px; } }
/* панель свойств задачи — обычный блок справа: стоит наверху и листается вместе со страницей, без своих прокруток
   (раньше «прилипала» с отступом под шапку, которой больше нет, и получала свою прокрутку снизу и сбоку) */
@media (min-width: 1001px) {
  .issue-layout { grid-template-columns: minmax(0, 1fr) 340px; }
}
@media (min-width: 761px) {
  .params { position: static; top: auto; max-height: none; overflow: visible; }
  .param { grid-template-columns: 104px minmax(0, 1fr); }
}
/* дата и время дедлайна, начала и конца — целиком: не влезают в строку — время переходит под дату */
.due-input { flex-wrap: wrap; }
.due-input .due-date { flex: 1 1 124px; min-width: 124px; }
.due-input .due-time { flex: 1 0 78px; min-width: 78px; max-width: 110px; }
/* карточка аудиофайла: название и «Слушать» — всегда на всю ширину; «сжато …», скачать, поделиться, удалить —
   строкой под ними, а не сбоку (на узком экране они сжимали название в ноль и «Слушать» шло столбиком по букве) */
.yfm-media.yfm-audio-file { flex-direction: column; align-items: stretch; }
.yfm-audio-open { width: 100%; }
.yfm-audio-text { flex: 1; min-width: 0; }
.yfm-audio-text .yfm-media-name { display: block; flex: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yfm-audio-hint { white-space: nowrap; }
.yfm-audio-file .yfm-media-bar { flex-wrap: wrap; justify-content: flex-end; gap: 4px; padding: 2px 8px 6px; border-top: 1px solid var(--border); }
.yfm-audio-file .yfm-media-bar .yfm-media-state { flex: 1; min-width: 0; white-space: normal; }
.yfm-audio-file .yfm-media-bar:not(:has(> :not(.yfm-media-state:empty))) { display: none; }
/* проигрыватель, свернутый в круглый значок с ноткой: нажать — развернуть, потянуть — передвинуть */
.desk-player.mini { width: auto; padding: 0; border-radius: 50%; background: none; border: 0; box-shadow: none; backdrop-filter: none; }
.dp-bubble { width: 54px; height: 54px; border-radius: 50%; border: 1px solid var(--border); display: grid; place-items: center; cursor: pointer; touch-action: none;
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(16px); box-shadow: 0 8px 26px rgba(0, 0, 0, .35); }
.dp-bubble:hover { transform: scale(1.05); }
.desk-player.mini.playing .dp-bubble { animation: dp-bubble-pulse 2.2s ease-out infinite; }
@keyframes dp-bubble-pulse {
  0% { box-shadow: 0 8px 26px rgba(0, 0, 0, .35), 0 0 0 0 color-mix(in srgb, var(--link) 55%, transparent); }
  70% { box-shadow: 0 8px 26px rgba(0, 0, 0, .35), 0 0 0 12px color-mix(in srgb, var(--link) 0%, transparent); }
  100% { box-shadow: 0 8px 26px rgba(0, 0, 0, .35), 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) { .desk-player.mini.playing .dp-bubble { animation: none; } }
@media (max-width: 760px) {
  .desk-player.mini { left: auto !important; right: 12px !important; width: auto !important; }
}
/* проигрыватель — над круглой кнопкой чата тикета (у нее слой 60–61), а свернутый значок по умолчанию стоит
   над этой кнопкой, а не на ней: его всегда видно и можно вытащить */
.desk-player { z-index: 64; }
.desk-player.mini { bottom: 92px; right: 26px; }
@media (max-width: 760px) {
  .desk-player.mini { bottom: calc(132px + env(safe-area-inset-bottom)) !important; right: 12px !important; }
}
/* заметка: узкая шапка — короткое название и кнопки, без лишней высоты */
.desk-widget.w-note .desk-w-head { padding: 3px 4px 3px 9px; gap: 4px; min-height: 0; border-bottom-color: rgba(0, 0, 0, .1); font-size: 12px; }
.desk-widget.w-note .desk-w-head b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desk-widget.w-note .desk-w-head .desk-w-btn { width: 22px; height: 22px; font-size: 13px; opacity: .65; }
.desk-widget.w-note .desk-w-head .desk-w-btn:hover { opacity: 1; }
.desk-widget.w-note .desk-w-body { padding: 6px 9px; }
/* заметка: прокручивается только текст (один ползунок), и он виден, лишь когда текст не влезает и на заметку навели */
.desk-widget.w-note .desk-w-body { overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.desk-widget.w-note .desk-note { flex: 1; height: auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 0 4px 0 0;
  scrollbar-width: thin; scrollbar-color: transparent transparent; transition: scrollbar-color .2s; }
.desk-widget.w-note:hover .desk-note, .desk-widget.w-note .desk-note:focus { scrollbar-color: color-mix(in srgb, currentColor 35%, transparent) transparent; }
.desk-widget.w-note .desk-note::-webkit-scrollbar { width: 6px; }
.desk-widget.w-note .desk-note::-webkit-scrollbar-button { display: none; height: 0; }
.desk-widget.w-note .desk-note::-webkit-scrollbar-track { background: transparent; }
.desk-widget.w-note .desk-note::-webkit-scrollbar-thumb { background: transparent; border-radius: 6px; }
.desk-widget.w-note:hover .desk-note::-webkit-scrollbar-thumb, .desk-widget.w-note .desk-note:focus::-webkit-scrollbar-thumb { background: color-mix(in srgb, currentColor 35%, transparent); }
/* свой цвет заметки */
.desk-note-sw.note-custom { position: relative; display: inline-grid; place-items: center; overflow: hidden;
  background: conic-gradient(#e5484d, #f76b15, #ffcc00, #30a46c, #0090ff, #8e4ec6, #e5484d); color: #fff; font-size: 18px; }
.desk-note-sw.note-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; border: 0; padding: 0; }

/* обратный отсчет: песочные часы и сколько осталось */
.cd { display: flex; align-items: center; gap: 14px; height: 100%; }
.cd-hg { flex: none; color: var(--link); display: grid; place-items: center; }
.cd-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cd-title { font-size: 13px; color: var(--text-2); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-nums { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.cd-part { display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.cd-part b { font-size: 26px; line-height: 1.1; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.cd-part span { font-size: 13px; color: var(--text-2); }
.cd-when { font-size: 11.5px; color: var(--text-3); }
.hg .hg-flip { transform-box: view-box; transform-origin: 20px 30px; animation: hg-flip 7s ease-in-out infinite; }
.hg .hg-sand-top, .hg .hg-sand-bot, .hg .hg-stream { fill: currentColor; }
.hg .hg-sand-top { opacity: .85; animation: hg-top 7s linear infinite; }
.hg .hg-sand-bot { opacity: .85; animation: hg-bot 7s linear infinite; }
.hg .hg-stream { opacity: .7; animation: hg-stream 7s linear infinite; }
@keyframes hg-top { 0% { transform: translateY(0); } 82%, 100% { transform: translateY(22px); } }
@keyframes hg-bot { 0% { transform: translateY(22px); } 82%, 100% { transform: translateY(0); } }
@keyframes hg-stream { 0%, 80% { opacity: .7; } 82%, 100% { opacity: 0; } }
@keyframes hg-flip { 0%, 84% { transform: rotate(0deg); } 100% { transform: rotate(180deg); } }
.cd.done .hg .hg-flip, .cd.done .hg rect { animation: none; }
@media (prefers-reduced-motion: reduce) { .hg .hg-flip, .hg rect { animation: none !important; } }

/* общие виджеты доски — полоса над колонками */
.bw-strip { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; margin: 0 0 16px; }
.bw-strip .desk-widget.bw { position: relative; box-shadow: var(--shadow); border-radius: 12px; max-width: 100%; }
.bw-strip .desk-widget.bw:not(.w-note) { background: var(--surface); }
.bw-strip .desk-widget.bw.dragging { opacity: .5; }
.bw-strip .desk-widget.bw.bw-over { outline: 2px dashed var(--accent); outline-offset: 2px; }
.bw-strip .desk-w-head { cursor: grab; }
@media (max-width: 760px) { .bw-strip .desk-widget.bw { width: 100% !important; } }
/* общие виджеты доски — свободно по странице доски: слой поверх, сами виджеты — где их поставили */
.content:has(> .bw-layer) { position: relative; }
.bw-layer { position: absolute; left: 0; top: 0; right: 0; height: 0; z-index: 6; pointer-events: none; }
.bw-layer .desk-widget.bw { position: absolute; pointer-events: auto; margin: 0; }
.bw-layer .desk-widget.bw.dragging { opacity: .88; box-shadow: 0 18px 44px rgba(0, 0, 0, .4); }
.bw-layer .desk-w-head { cursor: grab; touch-action: none; }
.bw-layer .desk-widget.bw.dragging .desk-w-head { cursor: grabbing; }
.bw-layer .desk-widget.bw { box-shadow: var(--shadow); border-radius: 12px; }
.bw-layer .desk-widget.bw:not(.w-note) { background: var(--surface); }
/* телефон: двигать нечем и некуда — виджеты списком над колонками */
@media (max-width: 760px) {
  .bw-layer { position: static; height: auto; display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; pointer-events: auto; }
  .bw-layer .desk-widget.bw { position: relative; left: auto !important; top: auto !important; width: 100% !important; }
  .bw-layer .desk-w-head { cursor: default; }
}
/* отсчет без песочных часов: числа сразу */
.cd { gap: 0; }
/* телефон: общие виджеты доски — внизу, под колонками с тикетами (на компьютере — где их поставили) */
@media (max-width: 760px) {
  .content:has(> .bw-layer) { display: flex; flex-direction: column; }
  .content:has(> .bw-layer) > * { min-width: 0; }
  .bw-layer { order: 99; margin: 16px 0 0; }
}
/* голосовое в пузыре сообщения — без своей подложки (была рамка в рамке), сливается с пузырем; на телефоне и на компьютере */
.chat-bubble .chat-voice .yfm-media.yfm-voice, .chat-bubble .yfm-media.yfm-voice { background: transparent; padding: 2px 0; border-radius: 0; max-width: 100%; }
/* чат с ботом: файл из ВК или Telegram — в тикет */
.chat-to-issue-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chat-to-issue { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); border-radius: 12px; padding: 2px 10px; font-size: 12px;
  cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-to-issue:hover { color: var(--text); background: var(--surface-3); }
.to-issue-list { display: flex; flex-direction: column; gap: 2px; max-height: 34vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 4px; }
.to-issue-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.to-issue-item:hover { background: var(--surface-2); }
.to-issue-item.on { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.to-issue-item .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-to-issue.danger:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, var(--border)); }
.chat-to-issue svg { vertical-align: -2px; }

/* чат задачи у того, кому она открыта только для чтения */
.chat-readonly .chat-compose { display: none; }
