/* NOVAMANYA Team — стиль по брендбуку novamanya (novomanya_typo_2.pdf), как в bonus-bot:
   красный #fc4224 + мятный #d5eae1, винный текст, конфетти-точки и круги.
   Шрифт бренда Peridot PE платный: вместо него Onest (текст) + Unbounded (акцент, заголовки).
   "Peridot PE" стоит первым в стеке: если положить лицензионные woff2, он подхватится сам. */
:root {
  /* брендбук */
  --red: #fc4224;
  --red-d: #d9341a;
  --mint: #d5eae1;
  --pink: #ffc0cc;
  --blush: #ffebef;
  --purple: #5f399b;
  --olive: #999b42;
  --lavender: #bb94f8;
  --lime: #dee96b;
  --wine: #900504;
  --panel: #fff;

  /* интерфейс */
  --bg: #f2f8f5;
  --ink: #24120e;
  --ink2: #5a4642;
  --muted: #7f716d;
  --line: #e3ebe7;
  --line2: #edf3f0;
  --hover: #f6faf8;
  --brand: var(--red);
  --brand-soft: var(--mint);
  --ok: #7f8132;
  --ok-ink: #5d5f18;
  --ok-soft: #eff2d4;
  --warn: #e07b39;
  --warn-ink: #9a4a0c;
  --warn-soft: #fff0e2;
  --bad: #d9341a;
  --bad-ink: var(--wine);
  --bad-soft: var(--blush);
  --col: #e4efea;
  --r: 14px;
  --focus: 0 0 0 3px rgba(252, 66, 36, .16);
  --shadow: 0 1px 2px rgba(36, 18, 14, .06), 0 1px 1px rgba(36, 18, 14, .03);
  --shadow-md: 0 8px 20px -8px rgba(36, 18, 14, .2);
  --shadow-lg: 0 28px 60px -14px rgba(36, 18, 14, .38);
  --font: 'Peridot PE', 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-x: 'Peridot PE Extended', 'Unbounded', var(--font);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
svg { flex: none; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }

/* ---------- бренд: логотип, точки, круги ---------- */
.logo { display: inline-flex; flex-direction: column; align-items: center; gap: 5px; color: inherit; line-height: 1; }
.logo .wm {
  display: block; width: 148px; aspect-ratio: 507 / 72; background: currentColor;
  -webkit-mask: url(/brand/wordmark.svg) center / contain no-repeat; mask: url(/brand/wordmark.svg) center / contain no-repeat;
}
.logo-sub { font-family: var(--font-x); font-weight: 600; font-size: 9.5px; letter-spacing: .42em; text-transform: uppercase; margin-right: -.42em; }
.dots { position: absolute; inset: 0; pointer-events: none; }
.dots i { position: absolute; border-radius: 50%; }
.blob { position: absolute; border-radius: 50%; pointer-events: none; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px;
  border-radius: 999px; font-weight: 600; font-size: 13.5px; white-space: nowrap; transition: background .15s, box-shadow .15s, transform .08s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.primary { background: var(--red); color: #fff; box-shadow: 0 8px 18px -10px rgba(252, 66, 36, .9); }
.btn.primary:hover { background: var(--red-d); }
.btn.ghost { background: var(--panel); border: 1px solid var(--line); color: var(--ink2); }
.btn.ghost:hover { background: var(--hover); border-color: #cfdcd6; }
.btn.soft { background: var(--mint); color: var(--wine); }
.btn.soft:hover { background: #c6e1d5; }
.btn.danger { color: var(--bad); }
.btn.danger.ghost:hover { background: var(--bad-soft); border-color: #f7c6cf; }
.btn.ok { background: var(--ok); color: #fff; }
.btn.sm { height: 31px; padding: 0 12px; font-size: 12.5px; }
.btn.lg { height: 50px; font-size: 15.5px; }
.btn.block { width: 100%; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--muted);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: rgba(36, 18, 14, .06); color: var(--ink); }
.icon-btn.sm { width: 28px; height: 28px; }
.input, .select, .textarea {
  width: 100%; height: 42px; border: 1.5px solid var(--line); background: #fff; border-radius: 14px; padding: 0 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; padding: 10px 14px; resize: vertical; min-height: 80px; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--red); box-shadow: var(--focus); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .lbl { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.field .hint { font-size: 12px; color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; }
.row > .field { flex: 1; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px; border-radius: 99px; border: 1px solid var(--line);
  background: #fff; font-weight: 500; font-size: 13px; color: var(--ink2); white-space: nowrap;
}
.chip:hover { border-color: #cbd9d2; }
.chip.on { background: var(--mint); border-color: var(--mint); color: var(--wine); font-weight: 600; }
.chip-n { min-width: 20px; height: 20px; padding: 0 6px; margin-right: -6px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; background: var(--mint); color: var(--wine); }
.chip.on .chip-n { background: #fff; }
.chip.over { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, #fff); font-weight: 600; }
.chip.over .chip-n { background: var(--bad); color: #fff; }
.chip.over.on { background: var(--bad); border-color: var(--bad); color: #fff; }
.chip.over.on .chip-n { background: #fff; color: var(--bad); }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--line2); color: var(--ink2); white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, #b3a7a3); flex: none; display: inline-block; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .45); }
.swatch.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c); }
.check-list { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow: auto; border: 1.5px solid var(--line); border-radius: 14px; padding: 6px; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; cursor: pointer; }
.check-row:hover { background: var(--line2); }
.check-row input { width: 17px; height: 17px; accent-color: var(--red); }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.toggle input { width: 17px; height: 17px; accent-color: var(--red); }

/* ---------- срочность и срок ---------- */
.urg { display: inline-flex; align-items: center; height: 21px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 700; white-space: nowrap; color: var(--c); background: color-mix(in srgb, var(--c) 13%, #fff); }
.urg.u4 { background: var(--c); color: #fff; box-shadow: 0 4px 10px -5px var(--c); }
.card.done .urg, .lrow.done .urg { opacity: .55; }
.tm-time { width: 96px; flex: none; padding: 0 8px; }
.date-row .input[type=date] { flex: 1; min-width: 0; }
@media (max-width: 1560px) and (min-width: 861px) { .toolbar .progress-mini { display: none; } }
.tm-time:disabled { opacity: .45; }
.due-quick { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.due-quick .chip { height: 26px; padding: 0 10px; font-size: 12px; }

/* ---------- присутствие и живые курсоры ---------- */
.av.on { position: relative; }
.av.on::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 32%; height: 32%; min-width: 7px; min-height: 7px; border-radius: 50%; background: #2fbf71; box-shadow: 0 0 0 2px #fff; }
.side .av.on::after { box-shadow: 0 0 0 2px var(--red); }
.online-list { display: flex; flex-direction: column; gap: 1px; padding: 0 2px; }
.ol { display: flex; align-items: center; gap: 9px; min-height: 32px; padding: 3px 10px; border-radius: 12px; color: #fff; font-size: 13px; font-weight: 600; }
.ol .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.ol .wh { font-size: 11px; font-weight: 500; color: var(--mint); white-space: nowrap; }
.ol.more { font-weight: 500; opacity: .8; padding-left: 12px; }
.st { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.st.on { color: #1f8f52; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.st.on i { width: 8px; height: 8px; border-radius: 50%; background: #2fbf71; box-shadow: 0 0 0 3px rgba(47, 191, 113, .18); }
#live-root { position: fixed; inset: 0; pointer-events: none; z-index: 450; overflow: hidden; }
.lc { position: absolute; left: 0; top: 0; transition: transform .1s linear, opacity .3s; will-change: transform; }
.lc svg { display: block; margin: -2px 0 0 -2px; filter: drop-shadow(0 2px 3px rgba(36, 18, 14, .3)); }
.lc span { position: absolute; left: 15px; top: 17px; background: var(--c); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; box-shadow: 0 4px 12px -4px rgba(36, 18, 14, .4); }
.lc.gone, .lc.hid { opacity: 0; }
.lc.idle { opacity: .35; }
.live-here { position: fixed; right: 16px; bottom: 16px; z-index: 440; display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 5px 6px 5px 12px; box-shadow: var(--shadow-md); font-size: 12.5px; font-weight: 600; color: var(--ink2); pointer-events: none; }
.live-here > i { width: 8px; height: 8px; border-radius: 50%; background: #2fbf71; animation: livepulse 1.8s ease-in-out infinite; }
@keyframes livepulse { 50% { box-shadow: 0 0 0 5px rgba(47, 191, 113, .18); } }

/* ---------- Telegram ---------- */
.side-foot .tg-btn { position: relative; }
.side-foot .tg-btn:not(.on)::after { content: ''; position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); }
.side-foot .tg-btn.on { color: var(--lime); }
.tg-hint { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line2); border-radius: 20px; padding: 12px 14px 12px 16px; margin-bottom: 16px; box-shadow: var(--shadow); color: #229ed9; }
.tg-hint > div { flex: 1; min-width: 0; color: var(--ink); }
.tg-hint b { display: block; font-weight: 650; }
.tg-hint span { font-size: 12.5px; color: var(--muted); }
.tg-steps { margin: 4px 0 16px; padding-left: 20px; line-height: 1.8; color: var(--ink2); }
.tg-mark { display: inline-flex; color: #229ed9; vertical-align: -1px; }

/* ---------- заказы ---------- */
.ord-search { display: flex; gap: 10px; max-width: 560px; }
.ord-search .search { flex: 1; }
.ord-search .search input { width: 100%; height: 46px; font-size: 16px; padding-left: 40px; }
.ord-search .search svg { left: 14px; }
.ord-search .btn { height: 46px; padding: 0 22px; }
.ord-recent { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.ord-recent .chip { height: 28px; font-variant-numeric: tabular-nums; }
#ord-res { margin-top: 18px; }
.warn-box { display: flex; gap: 12px; align-items: flex-start; background: var(--warn-soft); color: var(--warn-ink); border-radius: 18px; padding: 14px 16px; margin-bottom: 14px; max-width: 760px; }
.warn-box b { display: block; color: var(--warn-ink); }
.warn-box span { font-size: 13px; color: #7a4a22; }
.ord-card { background: #fff; border-radius: 22px; border: 1px solid var(--line2); box-shadow: var(--shadow); padding: 18px 20px; max-width: 760px; }
.ord-card + .ord-card { margin-top: 14px; }
.ord-many { margin-bottom: 10px; }
.ord-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.ord-ttl { flex: 1; min-width: 0; }
.ord-ttl span { display: block; }
.ord-ttl b { font-family: var(--font-x); font-weight: 600; font-size: 20px; }
.ord-st { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 99px; font-size: 12.5px; font-weight: 700; white-space: nowrap; background: var(--warn-soft); color: var(--warn-ink); }
.ord-st.ok { background: var(--ok-soft); color: var(--ok-ink); }
.ord-st.bad { background: var(--bad-soft); color: var(--bad-ink); }
.ord-grid a { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.ord-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line2); margin-top: 6px; padding: 10px 14px 0; }
.ord-total span { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ord-total b { font-family: var(--font-x); font-weight: 600; font-size: 18px; font-variant-numeric: tabular-nums; }
.ord-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 18px; }
.ord-grid span { display: block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ord-grid b { font-weight: 600; word-break: break-word; }
.ord-items { margin-top: 16px; border-top: 1px solid var(--line2); padding-top: 12px; }
.ord-items .lbl { margin-bottom: 6px; }

/* ---------- отделы ---------- */
.dpill {
  display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600;
  color: var(--c); background: color-mix(in srgb, var(--c) 13%, #fff); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.check-list.tall { max-height: 340px; }
.check-row.dept-row { margin-top: 4px; background: var(--hover); }
.check-row.dept-row:first-child { margin-top: 0; }
.check-row.sub { padding-left: 26px; }
.check-h { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 10px 8px 4px; }
.as-chip.dept { padding: 3px 8px 3px 9px; color: var(--c); border-color: color-mix(in srgb, var(--c) 35%, #fff); background: color-mix(in srgb, var(--c) 9%, #fff); font-weight: 650; }
.as-chip.dept .dot { --c: currentColor; width: 8px; height: 8px; }
.f-dept { height: 34px; width: auto; max-width: 210px; border-radius: 99px; padding: 0 12px; font-weight: 500; font-size: 13px; }
.f-dept.on { background: var(--mint); border-color: var(--mint); color: var(--wine); font-weight: 600; }
/* ---------- проект задачи (topics, 2026-11-25) ---------- */
/* плашка — сплошной цвет проекта, углы как у метки: не путать с отделом (светлая «таблетка») */
.tpill {
  display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 650;
  color: #fff; background: var(--c); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.f-topic.on[style] { background: color-mix(in srgb, var(--c) 14%, #fff); border-color: color-mix(in srgb, var(--c) 45%, #fff); color: var(--c); }
.topic-sel.on { background-color: color-mix(in srgb, var(--c) 10%, #fff); border-color: color-mix(in srgb, var(--c) 40%, #fff); color: var(--c); font-weight: 650; }
.qt-topic .select { max-width: 340px; }
.topic-list { display: flex; flex-direction: column; gap: 6px; }
.topic-row {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line2);
  background: #fff; text-align: left; font: inherit; color: inherit; cursor: pointer;
}
.topic-row:hover { background: var(--hover); }
.topic-row .dot { width: 10px; height: 10px; }
.topic-row svg { color: var(--muted); }
.dept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.dept-card {
  position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 10px; text-align: left; background: #fff;
  border: 1px solid var(--line2); border-radius: 20px; padding: 14px 16px; box-shadow: var(--shadow); transition: box-shadow .15s, border-color .15s;
}
.dept-card:hover { box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--c) 40%, #fff); }
.dept-card .dot { width: 12px; height: 12px; }
.dept-card b { font-weight: 650; }
.dept-card > span.muted { grid-column: 2; }
.dept-card .avs { grid-column: 2; margin-top: 6px; }
.dept-card .avs:empty { display: none; }
/* «Команда»: каждый отдел — своя карточка, шапка цвета отдела; колонки одинаковой ширины во всех карточках (table-layout: fixed) */
.tgrp-top { margin-top: 4px; }
.tgrp {
  background: #fff; border: 1px solid var(--line2); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; margin-bottom: 14px; position: relative;
}
.tgrp::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); z-index: 1; pointer-events: none; }
.tgrp-head {
  display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 8px 12px 8px 18px;
  background: color-mix(in srgb, var(--c) 8%, #fff); border-bottom: 1px solid color-mix(in srgb, var(--c) 18%, #fff);
}
.tgrp-head .dot { width: 11px; height: 11px; }
.tgrp-head b { font-family: var(--font-x); font-size: 14px; font-weight: 600; color: var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tgrp-n {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px;
  font-size: 12px; font-weight: 700; color: var(--c); background: color-mix(in srgb, var(--c) 15%, #fff); font-variant-numeric: tabular-nums;
}
.tgrp-on { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #1f8f52; white-space: nowrap; }
.tgrp-on:empty { display: none; }
.tgrp-on i { width: 7px; height: 7px; border-radius: 50%; background: #2fbf71; }
.tgrp-head .icon-btn { color: var(--c); }
.tgrp-body { overflow-x: auto; }
.team-tbl { table-layout: fixed; min-width: 660px; }
.team-tbl col.c-st { width: 28%; }
.team-tbl col.c-login { width: 17%; }
.team-tbl col.c-role { width: 160px; }
.team-tbl col.c-act { width: 100px; }
.team-tbl td { overflow: hidden; text-overflow: ellipsis; }
.team-tbl .person > div { min-width: 0; }
.team-tbl .person > div > b, .team-tbl .person > div > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-tbl .person .dpill { vertical-align: middle; }
.tgrp-cols { padding: 0 1px; }
.tgrp-cols .tbl th { border-bottom: 0; padding-top: 0; padding-bottom: 8px; }
/* телефон: строка = имя + кнопки, под именем «статус · логин» (без горизонтальной прокрутки) */
@media (max-width: 860px) {
  .tgrp-head { padding-left: 14px; }
  .team-tbl, .team-tbl tbody { display: block; min-width: 0; }
  .team-tbl colgroup { display: none; }
  .team-tbl tr { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; padding: 10px 8px 10px 12px; border-top: 1px solid var(--line2); }
  .team-tbl tr:first-child { border-top: 0; }
  .tbl.team-tbl td { display: block; padding: 0; border: 0; }
  .team-tbl td.c-p { flex: 1 1 calc(100% - 92px); min-width: 0; order: 1; }
  .team-tbl.ro td.c-p { flex-basis: 100%; }
  .team-tbl td.c-ac { flex: none; order: 2; }
  .team-tbl td.c-st { order: 3; margin-left: 42px; }
  .team-tbl td.c-lg { order: 4; font-size: 12px; color: var(--muted); }
  .team-tbl td.c-lg::before { content: '·'; margin-right: 6px; }
  .team-tbl td.c-rl { order: 5; }
  .team-tbl td.r-m { display: none; }
  .team-tbl .person { min-width: 0; }
  .team-tbl td.num .icon-btn { width: 32px; height: 32px; }
}

/* ---------- avatars ---------- */
.av {
  --c: #8a7b77; position: relative; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 700;
  background: var(--c); flex: none; letter-spacing: -.02em; text-transform: uppercase; user-select: none;
}
.av img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--c); }

/* ---------- фото профиля: поле с кадрированием ---------- */
.photo-f { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; }
.photo-view {
  --c: #8a7b77; position: relative; width: 96px; height: 96px; border-radius: 50%; background: var(--c); color: #fff; flex: none;
  display: grid; place-items: center; overflow: hidden; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--mint);
}
.photo-view.crop { width: 168px; height: 168px; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--red); }
.photo-ini { font: 600 30px/1 var(--font-x); letter-spacing: -.02em; text-transform: uppercase; }
.photo-view img, .photo-view canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-view canvas { cursor: grab; touch-action: none; background: #fff; }
.photo-view canvas:active { cursor: grabbing; }
.photo-side { min-width: 0; flex: 1; display: grid; gap: 10px; }
.photo-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-btns label.btn { cursor: pointer; }
.photo-zoom { display: flex; align-items: center; gap: 8px; color: var(--muted); max-width: 240px; }
.photo-f [hidden] { display: none !important; }
.photo-zoom input { flex: 1; accent-color: var(--red); }
.photo-hint { margin: 0; }
.prof-info { display: grid; gap: 3px; padding: 12px 14px; background: var(--mint); border-radius: 16px; }
.prof-info b { font-size: 15px; }
.prof-info .btn { justify-self: start; margin-top: 8px; background: #fff; }
/* админ по умолчанию красный — на красном сайдбаре кружок без обводки не видно */
.online-list .av { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .75); }
@media (max-width: 560px) {
  .photo-f { flex-direction: column; text-align: center; }
  .photo-side { justify-items: center; }
  .photo-view.crop { width: 200px; height: 200px; }
}
/* «Просмотрено» в карточке задачи */
.seen-list { display: grid; gap: 4px; }
.sn { display: flex; align-items: center; gap: 7px; font-size: 13px; min-width: 0; }
.sn .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sn-t { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.sn-not { margin-top: 4px; font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.sn-not span { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); }
.side-lbl svg { vertical-align: -2px; }
.seen-ok { color: #2e8b6a; }
.seen-no { color: var(--muted); }
.me-btn { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; background: none; border: 0; padding: 2px; margin: -2px; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: 14px; }
.me-btn:hover .who b { text-decoration: underline; text-underline-offset: 3px; }
.me-btn:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.av-xs { width: 20px; height: 20px; font-size: 8.5px; }
.av-sm { width: 24px; height: 24px; font-size: 9.5px; }
.av-md { width: 32px; height: 32px; font-size: 12px; }
.av-lg { width: 40px; height: 40px; font-size: 14px; }
.avs { display: inline-flex; }
.avs .av { box-shadow: 0 0 0 2px #fff; }
.avs .av + .av { margin-left: -6px; }
.av-more { background: var(--mint); color: var(--wine); }

/* ---------- splash / login ---------- */
.boot-splash { position: fixed; inset: 0; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(252, 66, 36, .2); border-top-color: var(--red); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-page {
  position: relative; overflow: hidden; min-height: 100dvh; display: grid; place-items: center; padding: 28px 20px;
  background: var(--red); color: var(--mint);
}
.login-blob-a { right: -120px; top: -110px; width: 360px; height: 360px; background: var(--pink); }
.login-blob-b { left: -140px; bottom: -160px; width: 380px; height: 380px; background: var(--mint); }
.login-wrap { position: relative; width: 100%; max-width: 410px; display: flex; flex-direction: column; align-items: center; gap: 26px; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.login-brand .logo .wm { width: min(300px, 72vw); }
.login-brand .logo-sub { font-size: 15px; }
.login-brand .logo { gap: 9px; }
.tagline { font-family: var(--font-x); font-weight: 600; font-size: 17px; line-height: 1.2; color: #fff; }
.tagline i { font-style: italic; font-family: var(--font); font-weight: 500; font-size: 19px; }
.login-card { width: 100%; background: #fff; color: var(--ink); border-radius: 28px; padding: 30px 28px 24px; box-shadow: 0 30px 60px -24px rgba(144, 5, 4, .55); }
.login-card h1 { font-family: var(--font-x); font-size: 22px; font-weight: 600; }
.login-card p.sub { margin: 6px 0 20px; color: var(--muted); }
.login-card .err { color: var(--bad); font-size: 13px; min-height: 18px; margin: -4px 0 10px; }
.pass-wrap { position: relative; }
.pass-wrap .icon-btn { position: absolute; right: 4px; top: 4px; }
.login-foot { text-align: center; margin-top: 16px; color: var(--muted); font-size: 12px; }
/* регистрация (2026-11-23) */
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--red); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.reg-done { text-align: center; }
.reg-done p.sub { line-height: 1.5; }
.reg-ok { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--mint); color: var(--wine); }
/* «Ожидайте подтверждения» (2026-11-24) */
.reg-ok.wait { background: var(--lime); animation: regwait 2.4s ease-in-out infinite; }
.reg-ok.no { background: var(--blush); color: var(--bad); }
@keyframes regwait { 50% { box-shadow: 0 0 0 10px rgba(222, 233, 107, .35); } }
.reg-info { display: grid; gap: 1px; margin: 0 0 16px; border-radius: 16px; overflow: hidden; background: var(--line); text-align: left; }
.reg-info div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; background: var(--bg); }
.reg-info span { color: var(--muted); font-size: 13px; }
.reg-info b { font-weight: 600; overflow-wrap: anywhere; text-align: right; }
.reg-live { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 14px; font-size: 13px; color: var(--ok-ink); }
.reg-live i { width: 8px; height: 8px; border-radius: 50%; background: #2fbf71; animation: livepulse 1.6s ease-in-out infinite; }
.icon-btn.del:hover { background: var(--bad-soft); color: var(--bad); }
.req-title { margin-top: 0; }
.req-title .badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--lime); color: var(--wine); }
.req-wrap { border-color: var(--red); }
.select.sm { height: 34px; font-size: 13px; padding-top: 0; padding-bottom: 0; min-width: 150px; }
.nowrap { white-space: nowrap; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 268px minmax(0, 1fr); height: 100dvh; }
.side { position: relative; overflow: hidden; background: var(--red); color: #fff; display: flex; flex-direction: column; min-height: 0; z-index: 30; }
.side .side-blob { right: -70px; top: -86px; width: 150px; height: 150px; background: var(--pink); }
.side .dots { height: 104px; bottom: auto; }
.side .brand { position: relative; display: flex; justify-content: flex-start; padding: 24px 20px 20px; color: var(--mint); }
.side-scroll { position: relative; flex: 1; overflow: auto; padding: 4px 12px 12px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .3) transparent; }
.nav-item, .pitem {
  display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 12px; border-radius: 99px; color: #fff; font-weight: 600;
  transition: background .12s, color .12s; position: relative;
}
.nav-item > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item:hover, .pitem:hover { background: rgba(255, 255, 255, .14); }
.nav-item.on, .pitem.on { background: var(--mint); color: var(--wine); }
.nav-item .badge, .pitem em {
  margin-left: auto; font-style: normal; font-size: 11.5px; font-weight: 700; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 99px;
  display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .22); color: #fff;
}
.nav-item.on .badge, .pitem.on em { background: rgba(144, 5, 4, .1); color: var(--wine); }
.nav-item .badge.hot, .nav-item.on .badge.hot { background: var(--lime); color: var(--wine); }
.side-sec { display: flex; align-items: center; justify-content: space-between; padding: 20px 12px 6px; font-family: var(--font-x); font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--mint); }
.side-sec .icon-btn { width: 26px; height: 26px; color: var(--mint); background: rgba(255, 255, 255, .14); }
.side-sec .icon-btn:hover { background: var(--mint); color: var(--wine); }
/* точка проекта на красном: белый кружок с цветом внутри, иначе красный проект не видно */
.pitem .pdot { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle, var(--c) 0 4px, #fff 4.5px); flex: none; }
.pitem span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-empty { padding: 6px 12px; font-size: 12.5px; color: #fff; opacity: .85; line-height: 1.45; }
.side-foot { position: relative; margin: 0 10px 10px; background: rgba(144, 5, 4, .22); border-radius: 20px; padding: 10px 8px 10px 10px; display: flex; align-items: center; gap: 10px; }
.side-foot .av { box-shadow: 0 0 0 2px var(--mint); }
.side-foot .who { min-width: 0; flex: 1; }
.side-foot .who b { display: block; color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who span { font-size: 11.5px; color: var(--mint); }
.side-foot .icon-btn { color: var(--mint); }
.side-foot .icon-btn:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.scrim { display: none; }

/* ---------- свернуть меню до иконок (только компьютер) ---------- */
.brand-mk { display: none; }
.side-toggle { display: none; }
.side-tip {
  position: fixed; z-index: 600; transform: translateY(-50%); pointer-events: none; background: var(--wine); color: #fff; font-size: 12.5px; font-weight: 600;
  padding: 6px 11px; border-radius: 10px; white-space: nowrap; box-shadow: 0 6px 18px -6px rgba(36, 18, 14, .45);
}
.ol .mini { display: none; }
@media (min-width: 861px) {
  .app { position: relative; transition: grid-template-columns .2s ease; }
  /* круглая стрелка на границе меню и шапки, по центру шапки (64 px) */
  .side-toggle {
    position: absolute; top: 18px; left: 254px; z-index: 40; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border-radius: 50%;
    border: 1px solid var(--line); background: #fff; color: var(--wine); cursor: pointer; box-shadow: 0 4px 12px -4px rgba(36, 18, 14, .35);
    transition: left .2s ease, background .12s, color .12s, box-shadow .12s;
  }
  .side-toggle:hover { background: var(--mint); box-shadow: 0 6px 16px -4px rgba(36, 18, 14, .45); }
  .side-toggle:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
  .side-toggle svg { transition: transform .2s ease; margin-left: -1px; }
  .side-mini .side-toggle { left: 62px; }
  .side-mini .side-toggle svg { transform: rotate(180deg); margin-left: 1px; }
  .app.side-mini { grid-template-columns: 76px minmax(0, 1fr); }
  .side-mini .side .dots { display: none; }
  .side-mini .side .side-blob { right: -50px; top: -50px; width: 80px; height: 80px; }
  .side-mini .side .brand { justify-content: center; padding: 26px 0 22px; }
  .side-mini .side .brand .logo { display: none; }
  .side-mini .side .brand-mk {
    display: block; width: 34px; margin-left: -6px; aspect-ratio: 71.22 / 31.86; background: currentColor;
    -webkit-mask: url(/brand/nm.svg) center / contain no-repeat; mask: url(/brand/nm.svg) center / contain no-repeat;
  }
  .side-mini .side-scroll { padding: 4px 12px 12px; scrollbar-width: none; }
  .side-mini .nav-item { justify-content: center; gap: 0; padding: 0; height: 44px; border-radius: 16px; }
  .side-mini .nav-item > span:not(.badge) { display: none; }
  .side-mini .nav-item .badge { position: absolute; top: 3px; right: 3px; margin: 0; min-width: 18px; height: 17px; padding: 0 4px; font-size: 10.5px; }
  .side-mini .nav-item:not(.on) .badge:not(.hot) { background: rgba(144, 5, 4, .35); }
  .side-mini .side-sec { justify-content: center; padding: 16px 0 8px; font-size: 0; }
  .side-mini .side-sec::before { content: ''; width: 28px; height: 1px; background: rgba(255, 255, 255, .35); }
  .side-mini .side-sec > span { display: none; }
  .side-mini .ol { justify-content: center; padding: 3px 0; gap: 0; }
  .side-mini .ol .nm, .side-mini .ol .wh, .side-mini .ol .full { display: none; }
  .side-mini .ol .mini { display: inline; font-size: 12px; }
  .side-mini .ol.more { padding-left: 0; }
  .side-mini .side-foot { flex-direction: column; gap: 4px; margin: 0 10px 10px; padding: 10px 0 6px; }
  .side-mini .side-foot .me-btn { flex: none; margin: 0 0 4px; }
  .side-mini .side-foot .who { display: none; }
}

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top {
  min-height: 64px; display: flex; align-items: center; gap: 12px; padding: 10px 22px; background: var(--panel); border-bottom: 1px solid var(--line);
  flex: none;
}
.top h1 { font-family: var(--font-x); font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.top-title .pdot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; }
.top .sub { color: var(--muted); font-size: 13px; white-space: nowrap; }
.content { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.page { padding: 22px; max-width: 1100px; width: 100%; margin: 0 auto; }
.only-m { display: none !important; }

/* ---------- toolbar ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 22px; flex-wrap: wrap; flex: none; }
.search { position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search input { height: 34px; width: 220px; border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 0 14px 0 36px; outline: none; }
.search input:focus { border-color: var(--red); box-shadow: var(--focus); }
.f-users { display: inline-flex; gap: 3px; padding: 0 4px; }
.f-users button { border-radius: 50%; padding: 2px; transition: opacity .15s; }
.f-users button .av { box-shadow: none; }
.f-users.has-on button:not(.on) { opacity: .38; }
.f-users button.on { box-shadow: 0 0 0 2px var(--red); }
.progress-mini { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.bar { width: 90px; height: 7px; border-radius: 7px; background: var(--mint); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--red); border-radius: 7px; }

/* ---------- board ---------- */
.board { flex: 1; min-height: 0; display: flex; gap: 14px; padding: 2px 22px 22px; overflow-x: auto; align-items: flex-start; }
.col { width: 292px; flex: 0 0 292px; max-height: 100%; display: flex; flex-direction: column; background: var(--col); border-radius: 22px; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 13px 10px 8px 16px; flex: none; }
.col-head .col-name { font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-head .col-count { font-size: 12px; font-weight: 700; color: var(--wine); background: rgba(255, 255, 255, .8); padding: 1px 8px; border-radius: 99px; }
.col-head .done-flag { color: var(--ok); display: inline-flex; }
.col-head .icon-btn { margin-left: auto; width: 28px; height: 28px; }
.col-stripe { height: 4px; margin: 0 16px; border-radius: 4px; background: var(--c); }
.col-body { flex: 1; min-height: 48px; overflow-y: auto; padding: 9px 9px 2px; }
.col-foot { padding: 2px 9px 10px; flex: none; }
.add-card { width: 100%; display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 10px; border-radius: 99px; color: var(--muted); font-weight: 600; }
.add-card:hover { background: rgba(255, 255, 255, .75); color: var(--red); }
.add-col {
  flex: 0 0 260px; height: 48px; border-radius: 22px; border: 2px dashed #c9dbd3; color: var(--muted); font-weight: 600; display: flex; align-items: center;
  justify-content: center; gap: 8px;
}
.add-col:hover { border-color: var(--red); color: var(--red); background: rgba(252, 66, 36, .04); }

.card {
  position: relative; display: flex; gap: 9px; align-items: flex-start; background: #fff; border-radius: 16px; padding: 11px 12px 11px 11px; margin-bottom: 8px;
  box-shadow: var(--shadow); cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; border: 1px solid transparent;
  transition: box-shadow .15s, border-color .15s;
}
.card:hover { box-shadow: var(--shadow-md); border-color: #f5cfc6; }
.card::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--pc, transparent); }
.card-main { flex: 1; min-width: 0; }
.card-title { font-weight: 550; line-height: 1.38; word-break: break-word; }
.card.done .card-title { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(127, 113, 109, .6); }
.card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 7px; color: var(--muted); font-size: 12px; }
.card-meta:empty { display: none; }
.card-meta .m { display: inline-flex; align-items: center; gap: 3px; font-weight: 500; }
.card-meta .avs { margin-left: auto; }
.dl { display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--line2); color: var(--ink2); }
.dl.soon { background: var(--warn-soft); color: var(--warn-ink); }
.dl.over { background: var(--bad); color: #fff; }
/* просроченная задача: красная рамка у карточки и строки списка */
.card.over { border-color: color-mix(in srgb, var(--bad) 55%, #fff); background: color-mix(in srgb, var(--bad) 4%, #fff); }
.lrow.over { box-shadow: inset 3px 0 0 var(--bad); }
.dl.ok { background: var(--ok-soft); color: var(--ok-ink); }
.chk {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid #c8d6cf; display: inline-flex; align-items: center; justify-content: center; color: transparent;
  flex: none; margin-top: 1px; transition: all .15s; background: #fff;
}
.chk:hover { border-color: var(--ok); color: var(--ok); }
.chk.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.chk.lg { width: 28px; height: 28px; margin-top: 4px; }
/* проджект менеджер: только просмотр (2026-11-24) */
.chk.ro, .chk.ro:hover { cursor: default; border-color: #c8d6cf; color: transparent; }
.chk.ro.on, .chk.ro.on:hover { border-color: var(--ok); color: #fff; }
.ro-note { display: flex; align-items: flex-start; gap: 8px; padding: 9px 12px; border-radius: 12px; background: var(--mint, #d5eae1); color: var(--wine, #900504); font-size: 13px; line-height: 1.35; }
.ro-note svg { flex: none; margin-top: 1px; }
.tm.ro .tm-title, .tm.ro .desc, .tm.ro .ck-text { cursor: default; }
.tm.ro .prio-seg button:disabled { cursor: default; opacity: .55; }
.tm.ro .prio-seg button.on:disabled { opacity: 1; }
.ph { border-radius: 16px; background: rgba(252, 66, 36, .07); border: 2px dashed rgba(252, 66, 36, .45); margin-bottom: 8px; }
.drag-ghost { position: fixed; z-index: 1000; pointer-events: none; transform: rotate(2.5deg); box-shadow: var(--shadow-lg) !important; opacity: .96; margin: 0; }
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none !important; }
.card.lifting { animation: lift .2s ease; }
@keyframes lift { 50% { transform: scale(1.03); } }

/* ---------- list rows (my tasks, archive, report) ---------- */
.tabs { display: inline-flex; padding: 4px; background: var(--col); border-radius: 99px; gap: 2px; }
.tabs button { height: 32px; padding: 0 15px; border-radius: 99px; font-weight: 600; color: var(--ink2); font-size: 13px; }
.tabs button.on { background: var(--red); color: #fff; box-shadow: 0 6px 14px -8px rgba(252, 66, 36, .9); }
.group { margin-top: 22px; }
.group-h { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px 6px; }
.group-h.bad { color: var(--bad); }
.group-h .n { background: var(--mint); color: var(--wine); padding: 1px 8px; border-radius: 99px; font-size: 11px; }
.list { background: #fff; border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--line2); }
.lrow { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line2); cursor: pointer; transition: background .12s; }
.lrow:first-child { border-top: 0; }
.lrow:hover { background: var(--hover); }
.lrow .t { flex: 1; min-width: 0; }
.lrow .t b { font-weight: 550; display: block; word-break: break-word; }
.lrow .t .sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; color: var(--muted); font-size: 12px; }
.lrow.done .t b { color: var(--muted); text-decoration: line-through; }
.lrow .r { display: flex; align-items: center; gap: 8px; flex: none; }
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty .em { font-size: 40px; margin-bottom: 8px; }
.empty b { display: block; color: var(--ink); font-family: var(--font-x); font-weight: 600; font-size: 15px; margin-bottom: 6px; }

/* ---------- activity ---------- */
.feed-day { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 22px 6px 8px; }
.feed-item { display: flex; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line2); }
.feed-item:first-child { border-top: 0; }
.feed-item.click { cursor: pointer; }
.feed-item.click:hover { background: var(--hover); }
.feed-item .body { flex: 1; min-width: 0; line-height: 1.45; }
.feed-item .body .what { color: var(--ink2); }
.feed-item .body .ttl { font-weight: 600; margin-top: 2px; word-break: break-word; }
.feed-item .body .sub { display: flex; gap: 8px; align-items: center; margin-top: 4px; font-size: 12px; color: var(--muted); }
.act-ic { width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; vertical-align: -4px; margin-right: 3px; }
.act-ic.done { background: var(--ok); color: #fff; }

/* ---------- stats & tables ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.stat { position: relative; overflow: hidden; background: #fff; border-radius: 20px; padding: 16px 18px; box-shadow: var(--shadow); border: 1px solid var(--line2); }
.stat span { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat b { display: block; font-family: var(--font-x); font-size: 26px; font-weight: 600; margin-top: 6px; letter-spacing: -.02em; }
.stat:first-child { background: var(--red); border-color: var(--red); color: #fff; }
.stat:first-child span { color: var(--mint); }
.stat:first-child::after { content: ''; position: absolute; right: -34px; top: -40px; width: 96px; height: 96px; border-radius: 50%; background: var(--pink); opacity: .9; }
.stat.ok b { color: var(--ok); }
.stat.bad b { color: var(--bad); }
.stat:first-child b, .stat:first-child span { position: relative; z-index: 1; }
.stat:first-child b { color: #fff; }
.table-wrap { background: #fff; border-radius: 20px; box-shadow: var(--shadow); border: 1px solid var(--line2); overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-top: 1px solid var(--line2); vertical-align: middle; }
.tbl tr:first-child td { border-top: 0; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--hover); }
.person { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.person > div > b { display: block; font-weight: 600; }
.person > div > span { font-size: 12px; color: var(--muted); }
.ontime { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.ontime .bar { width: 70px; }
.role-b { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--red); color: #fff; }
.role-b.m { background: var(--mint); color: var(--wine); }
.role-b.off { background: var(--bad-soft); color: var(--bad-ink); }
.sec-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 10px; }
.sec-title h3 { font-family: var(--font-x); font-size: 14px; font-weight: 600; }
.period { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.period input[type=date] { height: 32px; border: 1px solid var(--line); border-radius: 99px; padding: 0 10px; background: #fff; }
.period select { height: 32px; border: 1px solid var(--line); border-radius: 99px; padding: 0 10px; background: #fff; }

/* ---------- modals ---------- */
.back { position: fixed; inset: 0; background: rgba(36, 18, 14, .45); backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow: auto; animation: fade .15s ease; }
#tm-root .back { z-index: 100; }
#dlg-root .back { z-index: 200; align-items: center; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.dlg { width: 100%; max-width: 460px; background: #fff; border-radius: 24px; box-shadow: var(--shadow-lg); animation: pop .18s ease; display: flex; flex-direction: column; max-height: calc(100dvh - 40px); }
.dlg.wide { max-width: 620px; }
.dlg-head { display: flex; align-items: center; gap: 10px; padding: 20px 22px 6px; }
.dlg-head h3 { font-family: var(--font-x); font-size: 16px; font-weight: 600; flex: 1; }
.dlg-body { padding: 12px 22px 4px; overflow: auto; }
.dlg-body p { margin: 0 0 12px; line-height: 1.5; color: var(--ink2); }
.dlg-foot { display: flex; gap: 8px; align-items: center; padding: 12px 22px 20px; flex-wrap: wrap; }
.dlg-err { color: var(--bad); font-size: 13px; padding: 0 22px; min-height: 0; }
.dlg-err:not(:empty) { padding-bottom: 6px; }
.creds { background: var(--blush); color: var(--wine); border: 1px dashed #f3b3c0; border-radius: 16px; padding: 14px 16px; font-family: ui-monospace, Menlo, monospace; font-size: 13.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-all; }

.tm { width: 100%; max-width: 980px; background: #fff; border-radius: 26px; box-shadow: var(--shadow-lg); animation: pop .18s ease; overflow: hidden; }
.tm-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 0 24px; color: var(--muted); font-size: 13px; }
.tm-head a.pl { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--ink2); }
.tm-head a.pl:hover { color: var(--red); }
.tm-top { padding: 8px 24px 6px; display: flex; gap: 12px; align-items: flex-start; }
.tm-title {
  flex: 1; font-size: 21px; font-weight: 700; line-height: 1.3; border: 1.5px solid transparent; border-radius: 12px; padding: 4px 8px; margin-left: -8px;
  resize: none; outline: none; overflow: hidden; background: transparent; letter-spacing: -.01em;
}
.tm-title:hover { background: var(--hover); }
.tm-title:focus { background: #fff; border-color: var(--red); box-shadow: var(--focus); }
.tm-title.done { color: var(--muted); text-decoration: line-through; }
.tm-doneinfo { margin: 0 24px 4px 64px; display: inline-flex; align-items: center; gap: 8px; background: var(--ok-soft); color: var(--ok-ink); font-weight: 600; font-size: 13px; padding: 6px 13px; border-radius: 99px; }
.tm-body { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 0; border-top: 1px solid var(--line2); margin-top: 10px; }
.tm-main { padding: 18px 24px 26px; min-width: 0; }
.tm-side { padding: 18px 18px 22px; background: #f6faf8; border-left: 1px solid var(--line2); display: flex; flex-direction: column; gap: 16px; }
.tm-sec { margin-bottom: 24px; }
.tm-sec h4 { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink2); margin-bottom: 10px; }
.tm-sec h4 .muted { font-weight: 600; }
.desc {
  width: 100%; border: 1.5px solid transparent; background: var(--hover); border-radius: 16px; padding: 12px 14px; min-height: 90px; resize: none; outline: none;
  line-height: 1.55; overflow: hidden;
}
.desc:hover { border-color: var(--line); }
.desc:focus { background: #fff; border-color: var(--red); box-shadow: var(--focus); }
.saved-note { font-size: 12px; color: var(--ok); font-weight: 600; opacity: 0; transition: opacity .3s; }
.saved-note.on { opacity: 1; }
.ck-bar { height: 7px; background: var(--mint); border-radius: 7px; overflow: hidden; margin-bottom: 8px; }
.ck-bar i { display: block; height: 100%; background: var(--ok); transition: width .25s; }
.ck-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; }
.ck-item:hover { background: var(--hover); }
.ck-item .chk { width: 18px; height: 18px; margin: 0; }
.ck-item input.ck-text { flex: 1; border: 0; background: transparent; outline: none; padding: 3px 4px; border-radius: 6px; min-width: 0; }
.ck-item input.ck-text:focus { background: #fff; box-shadow: 0 0 0 2px rgba(252, 66, 36, .3); }
.ck-item.on input.ck-text { text-decoration: line-through; color: var(--muted); }
.ck-item .icon-btn { opacity: 0; }
.ck-item:hover .icon-btn { opacity: 1; }
.ck-add { display: flex; gap: 8px; margin-top: 6px; }
.ck-add .input { height: 38px; }
.cm { display: flex; gap: 10px; margin-bottom: 14px; }
.cm .bubble { flex: 1; min-width: 0; }
.cm .bubble .h { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.cm .bubble .h b { font-weight: 650; }
.cm .bubble .h .muted { font-size: 12px; }
.cm .bubble .x { margin-left: auto; opacity: 0; }
.cm:hover .bubble .x { opacity: 1; }
.cm .bubble .txt { margin-top: 4px; background: #f1f6f3; border-radius: 4px 16px 16px 16px; padding: 9px 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; display: inline-block; max-width: 100%; }
.cm.mine .bubble .txt { background: var(--blush); }
.cm .txt a { color: var(--red); text-decoration: underline; }
.cm-form { display: flex; gap: 10px; align-items: flex-end; margin-top: 8px; }
.cm-form textarea { flex: 1; border: 1.5px solid var(--line); border-radius: 16px; padding: 10px 13px; resize: none; outline: none; min-height: 42px; max-height: 180px; line-height: 1.45; }
.cm-form textarea:focus { border-color: var(--red); box-shadow: var(--focus); }
.hist { font-size: 12.5px; color: var(--muted); }
.hist .hi { display: flex; gap: 8px; padding: 5px 0; line-height: 1.45; }
.hist .hi b { color: var(--ink2); font-weight: 600; }
.side-lbl { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 7px; }
.done-btn { height: 46px; font-size: 14px; }
.done-btn.is-done { background: var(--ok-soft); color: var(--ok-ink); border: 1px solid #dde3b0; box-shadow: none; }
.as-list { display: flex; flex-wrap: wrap; gap: 6px; }
.as-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 3px; border-radius: 99px; background: #fff; border: 1px solid var(--line); font-size: 12.5px; font-weight: 550; }
.as-chip .x { width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.as-chip .x:hover { background: var(--bad-soft); color: var(--bad); }
.as-add { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px; border-radius: 99px; border: 1px dashed #c3d3cb; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.as-add:hover { border-color: var(--red); color: var(--red); }
.prio-seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.prio-seg button { height: 30px; border-radius: 99px; border: 1px solid var(--line); background: #fff; font-size: 11px; font-weight: 600; color: var(--ink2); padding: 0 2px; }
.prio-seg button.on { background: var(--c); border-color: var(--c); color: #fff; }
.date-row { display: flex; gap: 6px; }
.date-row .input { height: 38px; }
.meta-list { font-size: 12.5px; color: var(--muted); line-height: 1.6; border-top: 1px solid var(--line); padding-top: 14px; }
.meta-list b { color: var(--ink2); font-weight: 600; }
.side-actions { display: flex; flex-direction: column; gap: 6px; }
.side-actions .btn { justify-content: flex-start; }

/* ---------- popover ---------- */
.pop { position: fixed; z-index: 300; background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); padding: 6px; min-width: 200px; max-width: 300px; animation: pop .12s ease; max-height: 360px; overflow: auto; }
.pop .mi { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; text-align: left; font-weight: 500; font-size: 13.5px; }
.pop .mi:hover { background: var(--hover); }
.pop .mi.danger { color: var(--bad); }
.pop .mi .ck { margin-left: auto; color: var(--red); }
.pop .sep { height: 1px; background: var(--line); margin: 5px 4px; }
.pop .pop-h { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 6px 10px 4px; }
.pop .swatches { padding: 4px 10px 8px; }

/* ---------- toasts ---------- */
#toasts { position: fixed; z-index: 400; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--wine); color: #fff; padding: 11px 18px; border-radius: 99px; box-shadow: 0 12px 30px -10px rgba(144, 5, 4, .6); font-weight: 600; animation: pop .2s ease; max-width: 90vw; }
.toast.err { background: var(--red-d); }
.toast.ok::before { content: '✓  '; color: var(--lime); font-weight: 800; }

.loading { padding: 60px; display: grid; place-items: center; }
.err-box { margin: 40px auto; max-width: 420px; text-align: center; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; top: 0; bottom: 0; left: 0; width: 282px; transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg); padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  .app.side-open .side { transform: none; }
  .app.side-open .scrim { display: block; position: fixed; inset: 0; background: rgba(36, 18, 14, .45); z-index: 25; }
  .only-m { display: inline-flex !important; }
  .hide-m { display: none !important; }
  .top { padding: 8px 12px; gap: 8px; min-height: 56px; padding-top: max(8px, env(safe-area-inset-top)); }
  .top h1 { font-size: 15px; }
  .toolbar { padding: 10px 12px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .toolbar::-webkit-scrollbar { display: none; }
  .toolbar > * { flex: none; }
  .search input { width: 140px; }
  .board { padding: 2px 12px 16px; gap: 10px; scroll-snap-type: x proximity; }
  .col { width: min(84vw, 320px); flex-basis: min(84vw, 320px); scroll-snap-align: start; }
  .page { padding: 14px 12px 40px; }
  .back { padding: 0; }
  .tm { border-radius: 0; min-height: 100dvh; max-width: none; }
  .tm-body { display: flex; flex-direction: column; }
  .tm-side { order: -1; border-left: 0; border-bottom: 1px solid var(--line2); }
  .tm-title { font-size: 18px; }
  .tm-doneinfo { margin-left: 24px; }
  .dlg { max-height: 100dvh; border-radius: 24px 24px 0 0; align-self: flex-end; }
  #dlg-root .back { align-items: flex-end; padding: 0; }
  .lrow { padding: 12px; gap: 6px 10px; flex-wrap: wrap; }
  /* на телефоне плашки срочности/срока — под названием, а не сжимают его */
  .lrow .t { flex: 1 1 calc(100% - 40px); }
  .lrow .r { flex: 1 1 100%; padding-left: 30px; flex-wrap: wrap; }
  .lrow .r .pill { display: none; }
  .tbl th, .tbl td { padding: 10px; }
  .login-card { padding: 26px 20px 20px; border-radius: 24px; }
  .login-blob-a { right: -110px; top: -120px; width: 220px; height: 220px; }
  .login-blob-b { left: -120px; bottom: -150px; width: 300px; height: 300px; }
  .login-wrap { gap: 20px; }
}

/* ---------- повтор задачи (2026-11-23) ---------- */
.card-meta .rep, .lrow .sub .rep { color: var(--purple); }
.rep-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 38px; padding: 7px 12px; border-radius: 12px; border: 1.5px dashed #c3d3cb;
  background: #fff; color: var(--muted); font-weight: 600; font-size: 13px; text-align: left;
}
.rep-btn span { flex: 1; min-width: 0; }
.rep-btn > svg:last-child { opacity: .5; }
.rep-btn:hover { border-color: var(--purple); color: var(--purple); }
.rep-btn.on { border-style: solid; border-color: rgba(95, 57, 155, .25); background: rgba(187, 148, 248, .16); color: var(--purple); }
.rep-btn.ro { cursor: default; }
.rep-opts { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.rep-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; border: 1.5px solid var(--line); cursor: pointer; }
.rep-opt:hover { border-color: #cbd9d2; }
.rep-opt:has(input:checked) { border-color: var(--purple); background: rgba(187, 148, 248, .12); }
.rep-opt input { accent-color: var(--purple); width: 17px; height: 17px; margin: 0; }
.rep-opt b { font-weight: 600; }
.wd-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0 6px 38px; }
.wd-chips .chip { height: 34px; min-width: 44px; justify-content: center; padding: 0 10px; }
.wd-chips .chip.on { background: var(--purple); border-color: var(--purple); color: #fff; }
.md-row { display: flex; align-items: center; gap: 8px; padding: 2px 0 6px 38px; font-weight: 600; color: var(--ink2); }
.md-row .select { width: 84px; height: 38px; }
.rep-opts [hidden] { display: none !important; }
.rep-prev { background: rgba(187, 148, 248, .14); color: var(--ink2); border-radius: 14px; padding: 11px 14px; font-size: 13.5px; line-height: 1.5; margin-bottom: 12px; }
.rep-prev b { color: var(--purple); }
.rep-ic { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; background: rgba(187, 148, 248, .2); color: var(--purple); }
.act-ic.rep { background: var(--purple); color: #fff; }

/* ---------- «Взять в работу» (2026-11-23) ---------- */
.start-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 11px; border-radius: 99px; flex: none;
  background: var(--red); color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap;
  box-shadow: 0 6px 14px -9px rgba(252, 66, 36, .95); transition: transform .12s, background .12s;
}
.start-btn:hover { background: var(--wine); }
.start-btn:active { transform: scale(.96); }
.card-meta .start-btn { margin-left: auto; }
.card-meta .work, .lrow .sub .work { color: var(--red); font-weight: 600; }
.work-info { display: flex; align-items: center; gap: 7px; margin-top: -6px; padding: 8px 12px; border-radius: 12px; background: rgba(252, 66, 36, .08); color: var(--ink2); font-size: 13px; }
.work-info svg { color: var(--red); flex: none; }
.work-info b { color: var(--wine); }
.act-ic.start { background: var(--red); color: #fff; }

/* ---------- личная доска и фон доски (2026-11-23) ---------- */
.board-tabs { display: flex; align-items: center; gap: 12px; padding: 14px 22px 0; flex: none; flex-wrap: wrap; }
.content.has-bg { background: var(--board-bg) center / cover no-repeat; }
.content.has-bg .toolbar { background: rgba(255, 255, 255, .86); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); margin: 10px 22px 10px; padding: 8px 12px; border-radius: 18px; }
.content.has-bg .board-tabs .tabs { background: rgba(255, 255, 255, .88); }
.content.has-bg .board-tabs .muted { background: rgba(255, 255, 255, .85); padding: 3px 10px; border-radius: 99px; }
.content.has-bg .col { box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .55); }
.content.has-bg .add-col { background: rgba(255, 255, 255, .8); }
.bg-prev { height: 170px; border-radius: 16px; background: var(--col) center / cover no-repeat; display: grid; place-items: center; }
.bg-up:not(:empty) { margin-bottom: 12px; }

/* ---------- подзадачи с ответственным ---------- */
.ck-who { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 8px; border-radius: 99px; color: var(--muted); flex: none; font-size: 12px; font-weight: 600; max-width: 140px; }
.ck-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ck-who:hover { background: var(--mint); color: var(--wine); }
.ck-who.on { background: #f1f6f3; color: var(--ink2); }
.ck-item:not(:hover) .ck-who:not(.on) { opacity: .45; }
.ck-item.mine { background: #fff6e8; }
.lrow .sub .ck-mine, .card-meta .ck-mine { color: var(--purple); font-weight: 600; }
@media (pointer: coarse) { .ck-item .icon-btn, .ck-item .ck-who { opacity: 1 !important; } }

/* ---------- файлы: в задаче и в чате ---------- */
.tm-sec h4 .btn { font-weight: 600; }
.tfiles, .cm .cm-files { display: flex; flex-wrap: wrap; gap: 8px; }
.cm .cm-files { margin-top: 6px; }
.fa { position: relative; max-width: 100%; }
.fa.img a { display: block; border-radius: 12px; overflow: hidden; background: var(--col); }
.fa.img img { display: block; width: 180px; height: 140px; object-fit: cover; }
.tfiles .fa.img img { width: 132px; height: 104px; }
.fa.vid { width: 360px; }
.fa.vid video { display: block; width: 100%; max-height: 320px; border-radius: 12px; background: #000; }
.fa-cap { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fa.aud audio { width: 280px; max-width: 100%; display: block; }
.fa.doc a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 14px; background: #fff; border: 1px solid var(--line); color: var(--ink); width: 280px; max-width: 100%; }
.fa.doc a:hover { border-color: var(--red); color: var(--red); }
.fa.doc a > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fa.doc b { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.fa.doc small { color: var(--muted); font-size: 11.5px; }
.fa-x { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; opacity: 0; transition: opacity .15s; }
.fa:hover .fa-x { opacity: 1; }
@media (pointer: coarse) { .fa-x { opacity: 1; } }
@media (max-width: 600px) { .fa.vid { width: 100%; } .fa.img img { width: 140px; height: 112px; } }

/* загрузка: карточка файла с полосой */
.cm-up { display: flex; flex-wrap: wrap; gap: 6px; }
.cm-up:not(:empty) { margin-top: 8px; }
.up-chip { display: flex; align-items: center; gap: 9px; padding: 6px; border-radius: 14px; background: #fff; border: 1px solid var(--line); width: 270px; max-width: 100%; }
.up-chip img, .up-ic { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; flex: none; background: var(--col); display: grid; place-items: center; color: var(--muted); }
.up-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.up-t b { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-s { font-size: 11px; color: var(--muted); }
.pbar { height: 4px; border-radius: 4px; background: var(--line2); overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--red); transition: width .2s; }
.up-chip.st-ok .pbar i { background: var(--ok); }
.up-chip.st-err { border-color: var(--bad); }
.up-chip.st-err .up-s { color: var(--bad); }
.up-chip.st-wait .up-s { color: #b7791f; }
.cm.sending .bubble { opacity: .9; }
.cm-form .cm-att { flex: none; width: 42px; height: 42px; border-radius: 14px; cursor: pointer; color: var(--ink2); }
.cm-form .cm-att:hover { background: var(--hover); color: var(--red); }
.tm.drop-on { outline: 3px dashed var(--red); outline-offset: -10px; }

/* просмотр фото на весь экран */
.lb { position: fixed; inset: 0; z-index: 350; background: rgba(20, 10, 10, .9); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 18px; gap: 12px; }
.lb img { max-width: 100%; max-height: calc(100% - 64px); object-fit: contain; border-radius: 8px; cursor: zoom-out; }
.lb-bar { display: flex; align-items: center; gap: 8px; color: #fff; font-size: 13px; flex-wrap: wrap; justify-content: center; }
.lb-bar span { max-width: 50vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .85; }

/* ---------- чат задачи справа, как WhatsApp (2026-11-23) ---------- */
#chat-root .chat-panel { position: fixed; top: 0; right: 0; bottom: 0; width: 420px; max-width: 100vw; z-index: 120; display: flex; flex-direction: column; background: #efe7dd; box-shadow: -18px 0 50px -20px rgba(36, 18, 14, .5); animation: chatIn .2s ease; }
@keyframes chatIn { from { transform: translateX(48px); opacity: 0; } }
@media (min-width: 1000px) { #tm-root .back.with-chat { padding-right: 436px; } }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; background: #fff; border-bottom: 1px solid var(--line2); flex: none; min-height: 64px; }
.chat-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.chat-who > div { min-width: 0; display: flex; flex-direction: column; }
.chat-who b { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-who span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-who .avs { flex: none; }
.chat-body { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 12px 14px; overscroll-behavior: contain;
  background: #efe7dd radial-gradient(rgba(144, 5, 4, .07) 1.2px, transparent 1.4px) 0 0 / 18px 18px; }
.ch-day { display: flex; justify-content: center; margin: 12px 0 6px; position: sticky; top: 4px; z-index: 1; pointer-events: none; }
.ch-day span { background: rgba(255, 255, 255, .95); color: var(--ink2); font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 10px; box-shadow: 0 1px 1px rgba(0, 0, 0, .07); }
.ch-rep { display: flex; align-items: center; justify-content: center; gap: 5px; margin: 10px auto 2px; max-width: 320px; text-align: center; font-size: 12px; line-height: 1.35; color: var(--ink2); background: rgba(255, 255, 255, .7); padding: 5px 10px; border-radius: 10px; }
.ch-rep svg { flex: none; color: var(--purple); }
.ch-msg { display: flex; align-items: flex-start; gap: 6px; margin-top: 8px; }
.ch-msg.cont { margin-top: 2px; }
.ch-msg.me { justify-content: flex-end; }
.ch-av { width: 28px; flex: none; }
.ch-b { position: relative; max-width: min(80%, 340px); min-width: 64px; padding: 6px 9px 7px; border-radius: 12px; background: #fff; box-shadow: 0 1px 1px rgba(0, 0, 0, .09); line-height: 1.42; font-size: 14px; word-break: break-word; outline: none; }
.ch-msg.them:not(.cont) .ch-b { border-top-left-radius: 3px; }
.ch-msg.me .ch-b { background: #dcf8c6; }
.ch-msg.me:not(.cont) .ch-b { border-top-right-radius: 3px; }
.ch-name { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 1px; }
.ch-t { white-space: pre-wrap; }
.ch-t a { color: #027eb5; text-decoration: underline; }
.ch-sp { display: inline-block; width: 42px; height: 1px; }
.ch-time { position: absolute; right: 8px; bottom: 4px; font-size: 11px; color: rgba(0, 0, 0, .45); display: inline-flex; align-items: center; }
.ch-msg.media .ch-b { padding: 4px; }
.ch-msg.media .ch-time { background: rgba(0, 0, 0, .5); color: #fff; padding: 1px 7px; border-radius: 9px; right: 10px; bottom: 10px; }
.ch-files { display: flex; flex-direction: column; gap: 4px; margin: 0 -5px 3px; }
.ch-msg.media .ch-files { margin: 0; }
.ch-files .fa.img a { border-radius: 9px; }
.ch-files .fa.img img { width: 100%; max-width: 330px; height: auto; max-height: 340px; min-height: 60px; }
.ch-files .fa.vid { width: 300px; max-width: 100%; }
.ch-files .fa.vid video { border-radius: 9px; }
.ch-files .fa-cap { padding: 0 4px; }
.ch-msg.media .fa.vid .fa-cap { padding-right: 60px; }
.ch-files .fa.doc a { width: 270px; background: rgba(0, 0, 0, .045); border-color: transparent; }
.ch-files .up-chip { width: 260px; }
.ch-del { position: absolute; top: -9px; right: -9px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); color: var(--bad); display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 2; }
.ch-b:hover .ch-del, .ch-b:focus-within .ch-del, .ch-b:focus .ch-del { opacity: 1; pointer-events: auto; }
.ch-msg.sending .ch-b { opacity: .85; }
.ch-empty { margin: 40px auto; max-width: 280px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--ink2); background: rgba(255, 255, 255, .85); padding: 22px 18px; border-radius: 18px; }
.ch-empty svg { color: #25a35a; }
.ch-empty span { font-size: 13px; color: var(--muted); line-height: 1.45; }
.chat-foot { flex: none; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: #f5f0ea; border-top: 1px solid rgba(0, 0, 0, .05); }
.chat-foot .cm-up { margin-bottom: 6px; }
.chat-foot .cm-up:empty { display: none; }
.chat-foot .up-chip { width: 100%; }
.chat-foot .cm-form { margin: 0; gap: 6px; align-items: flex-end; }
.chat-foot .cm-form textarea { border: 0; border-radius: 22px; background: #fff; box-shadow: 0 1px 1px rgba(0, 0, 0, .07); padding: 11px 15px; min-height: 44px; font-size: 15px; }
.chat-foot .cm-form textarea:focus { box-shadow: 0 0 0 2px rgba(37, 163, 90, .35); }
.chat-foot .cm-att { width: 44px; height: 44px; border-radius: 50%; }
.cm-send { flex: none; width: 44px; height: 44px; border-radius: 50%; background: #25a35a; color: #fff; display: grid; place-items: center; box-shadow: 0 6px 14px -8px rgba(37, 163, 90, .9); }
.cm-send:hover { background: #1f8f4e; }
.chat-panel.drop-on { outline: 3px dashed #25a35a; outline-offset: -8px; }
@media (max-width: 860px) {
  #chat-root .chat-panel { width: 100%; box-shadow: none; }
  .chat-head { padding-left: 4px; }
}

/* карточка «Чат» в окне задачи */
.chat-entry { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 18px; background: #f0f8f2; border: 1px solid #d6ecdd; text-align: left; transition: border-color .15s, background .15s; }
.chat-entry:hover, .chat-entry.on { border-color: #25a35a; background: #e7f6ec; }
.ce-ic { width: 40px; height: 40px; border-radius: 50%; background: #25a35a; color: #fff; display: grid; place-items: center; flex: none; }
.chat-who .ce-ic { width: 36px; height: 36px; }
.ce-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ce-t b { font-weight: 700; font-size: 14.5px; display: flex; align-items: center; gap: 6px; color: var(--ink); }
.ce-t b i { font-style: normal; font-size: 11px; font-weight: 700; background: #25a35a; color: #fff; padding: 1px 7px; border-radius: 99px; }
.ce-t > span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ce-time { font-size: 11.5px; color: var(--muted); flex: none; }
.ce-go { color: var(--muted); display: inline-flex; flex: none; }
.chat-chip { cursor: pointer; border-radius: 6px; padding: 1px 4px; margin: -1px -4px; }
.chat-chip:hover { color: #1f8f4e; background: #e3f6ea; }

/* колонка заметок на личной доске (2026-11-24): карточка = просто текст, первая строка жирным */
.col-head .col-kind { display: inline-flex; color: var(--nc); flex: none; margin-right: -3px; }
.card.note { display: block; padding: 11px 13px; background: color-mix(in srgb, var(--nc) 7%, #fff); border-color: color-mix(in srgb, var(--nc) 20%, transparent); }
.card.note:hover { border-color: color-mix(in srgb, var(--nc) 45%, transparent); }
.card.note::before { display: none; }
.note-text {
  white-space: pre-wrap; word-break: break-word; line-height: 1.45; font-size: 13.5px; color: var(--ink2);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 14; line-clamp: 14; overflow: hidden;
}
.note-text b { font-weight: 650; color: var(--ink); }
.note-area { min-height: 280px; font-size: 15px; }
.kind-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kind-opt { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border-radius: 14px; border: 1.5px solid var(--line); cursor: pointer; }
.kind-opt:hover { border-color: #cbd9d2; }
.kind-opt:has(input:checked) { border-color: var(--red); background: rgba(252, 66, 36, .06); }
.kind-opt:has(input:focus-visible) { outline: 2px solid var(--red); outline-offset: 2px; }
.kind-opt input { position: absolute; opacity: 0; pointer-events: none; }
.kind-opt .ko-ic { display: inline-flex; color: var(--muted); margin-top: 1px; flex: none; }
.kind-opt:has(input:checked) .ko-ic { color: var(--red); }
.kind-opt b { display: block; font-weight: 650; }
.kind-opt small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; margin-top: 2px; }
@media (max-width: 520px) { .kind-opts { grid-template-columns: 1fr; } }

/* «Новая задача»: фото, видео, файлы сразу при создании (2026-11-24) */
.qt-ups { display: flex; flex-wrap: wrap; gap: 6px; }
.qt-ups:not(:empty) { margin-bottom: 8px; }
.qt-files .qt-add { align-self: flex-start; width: fit-content; cursor: pointer; }
.dlg.drop-on { outline: 3px dashed var(--red); outline-offset: -8px; }

/* ---------- подотделы (2026-11-24): «Дизайн», «SMM» внутри «Маркетинга» ---------- */
/* вкладки над доской отдела */
.sub-tabs[hidden] { display: none; }
.sub-tabs .tabs button { display: inline-flex; align-items: center; gap: 7px; }
.sub-tabs .tabs .dot { width: 8px; height: 8px; }
.sub-tabs .tabs button.on .dot { background: #fff; }
.tab-n {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
  font-size: 11.5px; font-weight: 700; background: color-mix(in srgb, var(--ink2) 12%, transparent); font-variant-numeric: tabular-nums;
}
.tabs button.on .tab-n { background: rgba(255, 255, 255, .25); }
.content.has-bg .sub-tabs .tabs { background: rgba(255, 255, 255, .88); }
.content.has-bg .sub-tabs .muted { background: rgba(255, 255, 255, .85); padding: 3px 10px; border-radius: 99px; }
/* «Кому?» и выбор в окне задачи: подотдел сдвинут под свой отдел */
.check-row.dept-row.sub-dept { margin-left: 18px; background: color-mix(in srgb, var(--hover) 60%, #fff); }
.check-row.sub2 { padding-left: 44px; }
.pop .mi.sub-dept { padding-left: 26px; }
/* «Команда»: строка-заголовок подотдела внутри карточки отдела */
.team-tbl tr.tsub td { padding: 8px 12px 6px 18px; background: color-mix(in srgb, var(--c) 6%, #fff); border-top: 1px solid var(--line2); }
.tsub-in { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tsub-in b { font-size: 13px; font-weight: 650; color: var(--c); white-space: nowrap; }
.tsub-in .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tsub-in .icon-btn { color: var(--c); }
.tsub + tr td.c-p, .tsub ~ tr td.c-p { padding-left: 30px; }
@media (max-width: 860px) {
  .team-tbl tr.tsub { padding: 0; }
  .team-tbl tr.tsub td { flex: 1 1 100%; padding: 8px 12px; }
  .tsub ~ tr td.c-p { padding-left: 14px; }
}
/* отчёт: строка подотдела под отделом */
tr.rep-sub td:first-child { padding-left: 34px; }

/* «Идеи» (2026-11-27): колонки = отделы, карточка — текст как у заметки + автор, 👍 и «Задача №N» */
.idea-ic { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: #fff1c2; color: #a86f00; flex: none; }
.ideas-board .col-head { gap: 7px; }
.card.idea .note-text { -webkit-line-clamp: 9; line-clamp: 9; }
.card.idea .card-meta { margin-top: 9px; gap: 6px; }
.card.idea .idea-by { min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.like {
  margin-left: auto; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 99px; flex: none;
  color: var(--muted); font-size: 12px; background: rgba(255, 255, 255, .8); border: 1px solid var(--line); transition: all .15s;
}
.like b { font-weight: 700; }
.like:hover { color: var(--red); border-color: #f5cfc6; }
.like.on { background: var(--red); border-color: var(--red); color: #fff; }
.idea-task { border-radius: 99px; padding: 1px 8px; background: var(--line2); color: var(--ink2); font-weight: 600; white-space: nowrap; }
.idea-task.done { background: var(--ok-soft); color: var(--ok-ink); }
.idea-task[data-act] { cursor: pointer; }
.idea-task[data-act]:hover { background: var(--mint); color: var(--wine); }
.idea-who { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.idea-who b { color: var(--ink); font-weight: 650; }
.idea-read {
  white-space: pre-wrap; word-break: break-word; line-height: 1.5; font-size: 15px; padding: 13px 15px; border-radius: 14px; background: var(--line2);
  margin-bottom: 10px; max-height: 50vh; overflow: auto;
}
.idea-read b { font-weight: 650; }
.idea-area { min-height: 190px; }
.idea-likes { display: flex; align-items: center; gap: 5px; }

/* «Календарь» (2026-11-27): месяц сеткой пн–вс, в клетке задачи со сроком; справа — список выбранного дня */
.cal-ic { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--mint); color: var(--wine); flex: none; }
.cal-nav { display: inline-flex; align-items: center; gap: 2px; height: 36px; padding: 2px; background: #fff; border: 1px solid var(--line); border-radius: 99px; }
.cal-nav b { min-width: 132px; text-align: center; font-family: var(--font-x); font-size: 13.5px; font-weight: 600; }
.cal-nav .icon-btn { width: 30px; height: 30px; }
.cal-wrap { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; padding: 2px 22px 22px; align-items: start; }
.cal { background: #fff; border-radius: 20px; border: 1px solid var(--line2); box-shadow: var(--shadow); overflow: hidden; transition: opacity .15s; }
.cal.loading { opacity: .5; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head { border-bottom: 1px solid var(--line); }
.cal-head span { padding: 9px 10px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cal-head span.we { color: var(--red); }
.cal-grid { grid-auto-rows: minmax(112px, auto); }
.cal-cell { position: relative; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 6px 6px 8px; border-right: 1px solid var(--line2); border-bottom: 1px solid var(--line2); cursor: pointer; transition: background .12s; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell:nth-last-child(-n+7) { border-bottom: 0; }
.cal-cell.we { background: #fbfcfb; }
.cal-cell.out { background: #f6f8f7; }
.cal-cell:hover { background: var(--hover); }
.cal-cell.sel { box-shadow: inset 0 0 0 2px var(--red); }
.cal-dh { display: flex; align-items: center; gap: 6px; min-height: 26px; }
.cal-dn { min-width: 26px; height: 26px; padding: 0 7px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; font-weight: 650; font-size: 13px; color: var(--ink2); white-space: nowrap; }
.cal-cell.out .cal-dn { color: #b6aeab; font-weight: 500; }
.cal-cell.today .cal-dn { background: var(--red); color: #fff; }
.cal-add { margin-left: auto; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: var(--wine); background: var(--mint); opacity: 0; transition: opacity .12s; }
.cal-cell:hover .cal-add, .cal-add:focus-visible { opacity: 1; }
.cal-items { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-ev { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; word-break: break-word;
  min-width: 0; padding: 3px 7px 3px 8px; border-radius: 7px; font-size: 12px; line-height: 1.35; cursor: pointer;
  background: color-mix(in srgb, var(--c) 11%, #fff); box-shadow: inset 3px 0 0 var(--c); transition: background .12s; }
.cal-ev:hover { background: color-mix(in srgb, var(--c) 22%, #fff); }
/* время + название — до двух строк, дальше многоточие (полностью — в подсказке и в списке дня) */
.cal-ev em { font-style: normal; font-weight: 700; font-size: 11px; color: var(--ink2); }
.cal-ev svg { vertical-align: -1px; color: var(--c); }
.cal-ev.done { background: #f2f5f3; box-shadow: inset 3px 0 0 #c5d1cb; }
.cal-ev.done span { color: var(--muted); text-decoration: line-through; }
.cal-ev.over { background: var(--blush); box-shadow: inset 3px 0 0 var(--bad); color: var(--wine); font-weight: 600; }
.cal-ev.over em { color: var(--bad); }
.cal-ev.ghost { background: transparent; box-shadow: none; border: 1px dashed color-mix(in srgb, var(--c) 50%, #fff); padding: 2px 7px; color: var(--muted); }
.cal-ev.ghost:hover { background: color-mix(in srgb, var(--c) 8%, #fff); }
.cal-more { padding: 1px 8px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.cal-side { position: sticky; top: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.cal-sh { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 4px 2px 0; }
.cal-st { display: grid; gap: 3px; min-width: 0; }
.cal-st h3 { font-family: var(--font-x); font-size: 16px; font-weight: 600; }
.cal-st .bad { color: var(--bad); font-weight: 650; }
.cal-side .lrow { padding: 11px 13px; gap: 6px 10px; flex-wrap: wrap; }
.cal-side .lrow .t { flex: 1 1 calc(100% - 40px); }
.cal-side .lrow .r { flex: 1 1 100%; padding-left: 30px; flex-wrap: wrap; }
.cal-side .lrow.ghost .t { flex-basis: calc(100% - 56px); }
.cal-side .lrow.ghost .r { padding-left: 44px; }
.lrow.ghost { background: #fcfdfc; }
.lrow.ghost .t b { font-weight: 500; color: var(--ink2); }
.cal-empty { padding: 28px 16px; text-align: center; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: 20px; }
.cal-empty:empty { display: none; }
.cal-note { margin: 0 4px; line-height: 1.5; }
.cal-note svg { vertical-align: -1px; color: var(--purple); }
@media (max-width: 1200px) {
  .cal-wrap { grid-template-columns: minmax(0, 1fr); }
  .cal-side { position: static; }
}
@media (max-width: 860px) {
  .cal-nav b { min-width: 112px; font-size: 12.5px; }
  .cal-wrap { padding: 0 10px 24px; gap: 12px; }
  .cal { border-radius: 16px; }
  .cal-head span { padding: 7px 0; text-align: center; font-size: 10.5px; letter-spacing: .03em; }
  .cal-grid { grid-auto-rows: 56px; }
  .cal-cell { align-items: center; gap: 4px; padding: 5px 2px; }
  .cal-dh { justify-content: center; min-height: 26px; }
  .cal-dn { font-size: 12.5px; padding: 0 5px; }
  .cal-add, .cal-more { display: none; }
  /* на телефоне в клетке только точки задач, всё остальное — в списке дня под сеткой */
  .cal-items { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 3px; }
  .cal-ev { display: block; width: 7px; height: 7px; padding: 0; border-radius: 50%; background: var(--c); box-shadow: none; pointer-events: none; }
  .cal-ev > * { display: none; }
  .cal-ev.done { background: #c5d1cb; }
  .cal-ev.over { background: var(--bad); }
  .cal-ev.ghost { padding: 0; background: transparent; border: 1.5px solid var(--c); }
}
