/* Сайт «Задачи» — «жидкое стекло» по макету этапа 1 (reference/maket/, метод theme()):
   спокойный графит, стеклянные плавающие панели, белые карточки, оранжевый акцент только на главных действиях.
   Основная тема — тёмная; светлая — переключателем внизу меню (data-theme="light"). */

:root {
  color-scheme: dark;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  /* движение: резкий старт и мягкая остановка; лист снизу — как в iOS */
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --page: linear-gradient(180deg, #1C1D21 0%, #131417 100%);
  --page-solid: #18191C;
  --glass: rgba(255, 255, 255, .055);
  --glass-strong: rgba(44, 45, 50, .72);
  --glass-border: rgba(255, 255, 255, .10);
  --glass-shadow: 0 20px 50px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .10);
  --pill-shadow: 0 12px 30px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .12);
  --blur: blur(30px) saturate(140%);
  --sheet-bg: rgba(36, 37, 42, .94);
  --head-bg: rgba(39, 40, 45, .9);          /* как панель под шапкой полос */
  --sub: rgba(255, 255, 255, .06);
  --sub-border: rgba(255, 255, 255, .07);
  --sub-hover: rgba(255, 255, 255, .10);
  --field: rgba(0, 0, 0, .22);
  --field-border: rgba(255, 255, 255, .09);
  --text: #F5F5F7;
  --text2: rgba(245, 245, 247, .78);
  --text3: rgba(245, 245, 247, .62);
  --faded: rgba(245, 245, 247, .28);
  --sep: rgba(255, 255, 255, .08);
  --accent: #CC4B0C;
  --accent-hover: #B8430A;
  --accent-text: #E0936D;
  --tint: rgba(204, 75, 12, .24);
  --nav: rgba(245, 245, 247, .78);
  --tab-on: rgba(255, 255, 255, .14);
  --tab-on-text: #F5F5F7;
  --sel-bg: rgba(255, 255, 255, .10);
  --cell: rgba(255, 255, 255, .035);
  --grey: rgba(255, 255, 255, .08);
  --bubble: rgba(255, 255, 255, .08);
  --mine: rgba(204, 75, 12, .30);
  --service: rgba(255, 255, 255, .08);
  --ev-bg: rgba(31, 95, 175, .28);
  --ev-text: #A9C4EE;
  --danger: #FF7B6E;
  --danger-bg: rgba(255, 123, 110, .14);
  --ok: #4CC17A;
  --ok-bg: rgba(76, 193, 122, .16);
  --warn: #F2B544;
  --warn-bg: rgba(242, 181, 68, .14);
  --overlay: rgba(8, 9, 11, .55);
  /* белые карточки — одинаковые в обеих темах */
  --card-text: #16181D;
  --card-text2: #5E6470;
  --card-border: rgba(17, 24, 39, .06);
  --card-shadow: 0 1px 2px rgba(0, 0, 0, .30), 0 8px 24px rgba(0, 0, 0, .18);
}
[data-theme="light"] {
  color-scheme: light;
  /* мягкая серая (16.10): всё на ступень темнее, белые — только карточки задач и выбранное */
  --page: linear-gradient(180deg, #DADCE0 0%, #CDD0D5 100%);
  --page-solid: #D4D6DA;
  --glass: rgba(255, 255, 255, .45);
  --glass-strong: rgba(246, 247, 248, .88);
  --glass-border: rgba(255, 255, 255, .55);
  --glass-shadow: 0 20px 50px rgba(17, 24, 39, .10), inset 0 1px 0 rgba(255, 255, 255, .7);
  --pill-shadow: 0 12px 30px rgba(17, 24, 39, .14), inset 0 1px 0 rgba(255, 255, 255, .95);
  --sheet-bg: rgba(238, 239, 241, .97);
  --head-bg: rgba(234, 235, 239, .9);
  --sub: rgba(255, 255, 255, .55);
  --sub-border: rgba(17, 24, 39, .06);
  --sub-hover: rgba(255, 255, 255, .8);
  --field: rgba(255, 255, 255, .6);
  --field-border: rgba(17, 24, 39, .09);
  --text: #1A1C21;
  --text2: #474C55;
  --text3: #5C616B;
  --faded: rgba(22, 24, 29, .3);
  --sep: rgba(17, 24, 39, .1);
  --accent-text: #B8440B;
  --tint: rgba(204, 75, 12, .12);
  --nav: #4B515C;
  --tab-on: rgba(255, 255, 255, .9);
  --tab-on-text: #16181D;
  --sel-bg: rgba(255, 255, 255, .85);
  --cell: rgba(17, 24, 39, .045);
  --grey: rgba(17, 24, 39, .075);
  --bubble: rgba(255, 255, 255, .75);
  --mine: rgba(204, 75, 12, .14);
  --service: rgba(17, 24, 39, .06);
  --ev-bg: #E6EEF8;
  --ev-text: #1F5FAF;
  --danger: #C62828;
  --danger-bg: rgba(198, 40, 40, .09);
  --ok: #1E7D3A;
  --ok-bg: rgba(30, 125, 58, .1);
  --warn: #9A5B00;
  --warn-bg: rgba(242, 181, 68, .2);
  --overlay: rgba(17, 24, 39, .28);
  --card-shadow: 0 1px 2px rgba(17, 24, 39, .05), 0 6px 18px rgba(17, 24, 39, .06);
}

/* ---------- основа ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
html { background: var(--page-solid); }
body { background: var(--page); background-attachment: fixed; color: var(--text); font: 14px/1.4 var(--font);
  -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.ico { display: inline-flex; flex: none; width: 18px; height: 18px; }
.ico svg { width: 100%; height: 100%; display: block; }
.muted { color: var(--text3); }
.small { font-size: 12.5px; }
.pad { padding: 4px 6px 8px; }
.center-text { text-align: center; }
.bad { color: var(--danger); }
.center { text-align: center; padding: 48px 16px; color: var(--text3); }
.center.bad { color: var(--danger); }
.empty { padding: 18px; text-align: center; color: var(--text3); }
.empty.small { padding: 10px 8px; font-size: 13px; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--text3); font-size: 14.5px; }
.empty-state .big { width: 44px; height: 44px; margin: 0 auto 10px; display: block; color: var(--faded); }
.empty-state .link-btn { margin-top: 6px; }

/* ---------- раскладка: меню слева, раздел, панель справа ---------- */
#app { height: 100vh; height: 100dvh; display: flex; gap: 20px; padding: 20px; }
.panel { border-radius: 34px; border: 1px solid var(--glass-border); background: var(--glass); box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.panel.strong { background: var(--glass-strong); }
.section-area { flex: 1 1 auto; min-width: 0; display: flex; gap: 20px; }
.panel.main { flex: 1 1 auto; min-width: 0; position: relative; display: flex; flex-direction: column; overflow: hidden; padding: 22px 24px 0; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 88px; margin: 0 -24px; padding-left: 24px; padding-right: 24px; }
.column { max-width: 820px; margin: 0 auto; width: 100%; }

/* меню */
.rail { flex: 0 0 72px; padding: 12px; border-radius: 36px; display: flex; flex-direction: column; align-items: center;
  justify-content: space-between; gap: 16px; }
.rail-logo { width: 48px; height: 48px; display: grid; place-items: center; color: var(--accent-text); }
.rail-logo .ico { width: 30px; height: 30px; }
.rail-items, .rail-bottom { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rail-btn { position: relative; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 16px; background: transparent;
  color: var(--nav); display: flex; align-items: center; justify-content: center; text-decoration: none; }
@media (hover: hover) { .rail-btn:hover { background: var(--sub); color: var(--text); } }
.rail-btn.on { background: var(--accent); color: #fff; }
.rail-btn .ico { width: 22px; height: 22px; }
/* число на значке раздела (nav.js, badge): у «Созвонов» — сколько ждут разбора */
.rail-badge { position: absolute; top: 5px; right: 5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--accent); color: #fff; font-size: 10px; line-height: 16px; font-weight: 700; text-align: center; }
.rail-btn.on .rail-badge { background: #fff; color: var(--accent); }
.rail-btn.round { border-radius: 24px; border: 1px solid var(--sub-border); background: var(--sub); }
.rail-btn.round .ico { width: 20px; height: 20px; }
.rail-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* шапка раздела */
.sec-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 14px; flex: none; }
.sec-title { flex: 1 1 220px; min-width: 0; }
.sec-title h1 { margin: 0; font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -.3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec-title p { margin: 2px 0 0; font-size: 13px; line-height: 18px; color: var(--text3); }
.head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ---------- кнопки и поля ---------- */
.btn { height: 40px; padding: 0 16px; border-radius: 20px; border: 1px solid var(--sub-border); background: var(--sub); color: var(--text);
  font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
  text-decoration: none; }
@media (hover: hover) { .btn:hover { background: var(--sub-hover); } }
.btn .ico { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; }
@media (hover: hover) { .btn.primary:hover { background: var(--accent-hover); } }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent-text); }
.btn.danger { color: var(--danger); }
.btn.block { display: flex; width: 100%; margin-top: 8px; }
.btn.big { height: 46px; border-radius: 23px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { flex: none; width: 40px; height: 40px; padding: 0; border-radius: 20px; border: 1px solid var(--sub-border); background: var(--sub);
  color: var(--text); display: inline-grid; place-items: center; }
@media (hover: hover) { .icon-btn:hover:not(:disabled) { background: var(--sub-hover); } }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 16px; }
.icon-btn.sm .ico { width: 16px; height: 16px; }
.link-btn { background: none; border: 0; padding: 8px 0 2px; color: var(--accent-text); font-size: 14px; font-weight: 600; }
.link-btn.danger { color: var(--danger); }
.hint-link { background: none; border: 0; padding: 0; color: var(--accent-text); font-size: 12.5px; }

.seg { display: inline-flex; padding: 3px; border-radius: 20px; border: 1px solid var(--sub-border); background: var(--sub); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: none; height: 32px; padding: 0 12px; border: 0; border-radius: 16px; background: transparent; color: var(--text);
  font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.seg button.on { background: var(--tab-on); color: var(--tab-on-text); font-weight: 600; }
[data-theme="light"] .seg button.on { box-shadow: 0 1px 3px rgba(17, 24, 39, .1); }
.seg.small button { height: 28px; padding: 0 10px; font-size: 12px; }
.seg .caret, .lg .caret, .float-switch .caret, .pb-who .caret { width: 12px; height: 12px; opacity: .7; }

.field-search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 20px;
  border: 1px solid var(--field-border); background: var(--field); color: var(--text3); }
.field-search .ico { width: 16px; height: 16px; }
.field-search input { flex: 1; min-width: 0; padding: 0; border: 0; background: transparent; color: var(--text); font-size: 14px; outline: none; }
.field-search.as-btn { width: 200px; font-size: 14px; text-align: left; cursor: text; }
@media (hover: hover) { .field-search.as-btn:hover { border-color: var(--sub-hover); color: var(--text2); } }
.field-search.big { height: 48px; border-radius: 24px; max-width: 820px; width: 100%; margin: 0 auto 14px; flex: none; }
.big-search { font-size: 16px !important; }
.search { width: 100%; height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--field-border); background: var(--field);
  color: var(--text); outline: none; margin-bottom: 8px; }
.search:focus, .field-search:focus-within { border-color: var(--accent-text); }

/* фильтры: эпик, горизонт, выполненные */
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; flex: none; }
.lg:disabled { opacity: .45; cursor: default; }
.lg { flex: none; height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--field-border); background: var(--field);
  color: var(--text); font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; max-width: 100%; }
@media (hover: hover) { .lg:hover { border-color: var(--sub-hover); } }
.lg.on { border-color: var(--accent); background: var(--tint); }
.lg i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.lg-name { overflow: hidden; text-overflow: ellipsis; }
.lg-n { color: var(--text3); font-weight: 400; }
.lg-ico { width: 14px; height: 14px; }
.head-actions .lg { height: 40px; border-radius: 20px; padding: 0 14px; font-size: 14px; }

/* плавающий выбор «Мои / Поставил / Сотрудник / Все» — стекло над карточками */
.float-switch { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 5; display: flex; padding: 4px;
  border-radius: 26px; border: 1px solid var(--glass-border); background: var(--glass-strong); box-shadow: var(--pill-shadow);
  -webkit-backdrop-filter: blur(24px) saturate(150%); backdrop-filter: blur(24px) saturate(150%); max-width: calc(100% - 24px); }
.float-switch button { height: 40px; padding: 0 18px; border: 0; border-radius: 20px; background: transparent; color: var(--text);
  font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
@media (hover: hover) { .float-switch button:hover:not(.on) { background: var(--sub); } }
.float-switch button.on { background: var(--accent); color: #fff; font-weight: 600; }

.person-bar { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 10px; border-radius: 18px; border: 1px solid var(--accent);
  background: var(--tint); margin-bottom: 10px; flex: none; }
.pb-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 0; border: 0; background: none; color: var(--text); text-align: left; }
.pb-text { min-width: 0; display: flex; flex-direction: column; }
.pb-text b { font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-note { font-size: 12px; color: var(--text3); }
.banners { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; flex: none; }
.banner { height: 32px; padding: 0 12px; border-radius: 16px; border: 0; background: var(--sub); color: var(--text); font-size: 13px; font-weight: 600; }
.banner.bad { background: var(--danger-bg); color: var(--danger); }
.banner.warn { background: var(--warn-bg); color: var(--warn); }

/* аватары: фото поверх инициалов — не загрузилось, видны инициалы */
.avatar { position: relative; overflow: hidden; flex: none; width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center;
  color: #fff; font-size: 12px; font-weight: 600; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 22px; height: 22px; font-size: 9.5px; }
.avatar.md { width: 44px; height: 44px; font-size: 15px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }

/* ---------- главная: люди и канбаны по эпикам ---------- */
.people { flex: 0 0 248px; min-width: 0; padding: 18px 12px 12px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.people h2 { margin: 0; font-size: 20px; line-height: 26px; font-weight: 600; }
/* «Люди» (22.10, people-view.js): карандаш у заголовка — неприметный, ярче при наведении; булавка у строки — при наведении,
   у закреплённых видна всегда */
.people-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 2px 0 8px; }
.pv-edit { flex: none; width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 14px;
  background: none; color: var(--text3); opacity: .45; transition: opacity .15s, background-color .15s; }
.pv-edit .ico { width: 15px; height: 15px; }
.people:hover .pv-edit, .pv-edit:focus-visible { opacity: .8; }
@media (hover: hover) { .pv-edit:hover { opacity: 1; color: var(--text); background: var(--sub); } }
.person-item { position: relative; flex: none; display: flex; }
.person-item > .person-row { flex: 1; min-width: 0; }
.pr-pin { position: absolute; top: 50%; right: 8px; width: 28px; height: 28px; margin-top: -14px; display: grid; place-items: center;
  padding: 0; border: 0; border-radius: 10px; background: none; color: var(--text3); opacity: 0; transition: opacity .15s, color .15s; }
.pr-pin .ico { width: 15px; height: 15px; }
.pr-pin.on { opacity: .7; color: var(--accent-text); }
.pr-pin.on svg { fill: currentColor; }
.person-item:hover .pr-pin, .pr-pin:focus-visible { opacity: 1; }
@media (hover: hover) { .pr-pin:hover { color: var(--text); background: var(--sub-hover); } .pr-pin.on:hover { color: var(--accent-text); } }
@media (min-width: 900px) {
  .person-item:hover > .person-row, .person-item.pinned > .person-row, .person-item:focus-within > .person-row { padding-right: 40px; }
}
.pv-row { gap: 10px; }
.pv-reset { margin-right: auto; padding: 0; font-size: 13.5px; }
.people-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.person-row { flex: none; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 10px; border-radius: 16px;
  color: var(--text); text-decoration: none; }
@media (hover: hover) { .person-row:hover { background: var(--sub); } }
.person-row.on { background: var(--sel-bg); }
.pr-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pr-name { font-size: 14px; line-height: 18px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-row.on .pr-name { font-weight: 600; }
.pr-note { font-size: 12px; line-height: 16px; color: var(--text3); }
.home-main .sec-head { gap: 12px 14px; }
.home-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 12px; font-size: 13px; color: var(--text3); flex: none; }
.lg-person { display: inline-flex; align-items: center; gap: 6px; color: var(--text2); }
.lg-person i { width: 14px; height: 14px; border-radius: 4px; }
.lanes-scroll { flex: 1; min-height: 0; overflow: auto; margin: 0 -24px; padding: 0 24px 24px; }
.lanes { --colw: 104px; display: flex; flex-direction: column; gap: 6px;
  min-width: calc(var(--cols) * var(--colw) + (var(--cols) - 1) * 6px); }
.lane-row { display: grid; grid-template-columns: repeat(var(--cols), minmax(var(--colw), 1fr)); gap: 6px; }
/* Шапка колонок — капсулы прямо на панели, без своей подложки; когда полосы уехали под неё — мягкое размытие
   под цвет панели на всю ширину, без краёв */
.lanes-head { position: sticky; top: 0; z-index: 4; padding: 2px 0 8px; }      /* над карточками и подписями связей */
.lanes-head::before { content: ""; position: absolute; z-index: -1; left: -24px; right: -24px; top: 0; bottom: -14px; pointer-events: none;
  background: var(--head-bg); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  -webkit-mask-image: linear-gradient(#000 62%, transparent); mask-image: linear-gradient(#000 62%, transparent);
  opacity: 0; transition: opacity .2s var(--ease-out); }
.lanes-scroll.scrolled .lanes-head::before { opacity: 1; }
.lh-col { container-type: inline-size; min-width: 0; height: 40px; border-radius: 999px; background: var(--sub); }
.lh-in { height: 100%; padding: 0 14px 0 8px; display: flex; align-items: center; gap: 8px;
  font-size: 14px; line-height: 18px; font-weight: 600; white-space: nowrap; }
.lh-num { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--c); color: var(--on-c); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lh-num svg { width: 14px; height: 14px; stroke-width: 2.4; }
.lh-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lh-col.grey .lh-name { color: var(--text2); }
/* узкая колонка (ноутбук): название переносится на вторую строку, а не обрезается */
@container (max-width: 132px) {
  .lh-in { padding: 0 9px 0 6px; gap: 6px; font-size: 12.5px; line-height: 14px; white-space: normal; }
  .lh-num { width: 20px; height: 20px; font-size: 11px; }
  .lh-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; -webkit-hyphens: auto; hyphens: auto; }
}
.lane { margin-top: 8px; }
.lane-title { position: sticky; left: 0; display: inline-flex; align-items: center; gap: 8px; height: 22px; padding: 0 2px; margin-bottom: 6px;
  font-size: 13px; font-weight: 600; }
.lane-n { font-size: 12px; font-weight: 400; color: var(--text3); }
/* Свой порядок полос (19.10, lane-order.js): ручка слева от названия — видна при наведении на полосу и в фокусе */
.lane-grip { display: inline-grid; place-items: center; width: 18px; height: 22px; margin: 0 -4px 0 -6px; padding: 0; border: 0;
  border-radius: 6px; background: none; color: var(--text3); cursor: grab; opacity: 0; touch-action: none; transition: opacity .15s; }
.lane-grip .ico { width: 14px; height: 14px; }
.lane:hover .lane-grip, .lane-grip:focus-visible, .lane.dragging .lane-grip { opacity: 1; }
.lane-grip:hover { color: var(--text2); background: rgba(127, 127, 127, .14); }
@media (hover: none) { .lane-grip { opacity: .7; } }
.lane.dragging { position: relative; z-index: 3; border-radius: 14px; background: rgba(127, 127, 127, .10);
  box-shadow: 0 0 0 6px rgba(127, 127, 127, .10), 0 14px 32px rgba(0, 0, 0, .30); }
.lanes.reordering > svg.links { visibility: hidden; }
/* Пока тянут полосу — все свёрнуты до названий, одной высоты (20.10): через высокую полосу не тянуть на пол-экрана */
.lanes.reordering > .lane { margin-top: 0; padding: 6px 10px; border-radius: 10px; background: var(--cell); }
.lanes.reordering > .lane .lane-row { display: none; }
.lanes.reordering > .lane .lane-title { margin-bottom: 0; }
.lanes.reordering > .lane.dragging { background: var(--sheet-bg); }   /* плотная: соседняя строка под ней не просвечивает */
.lanes.reordering .lane-grip { opacity: .7; }
.lanes.reordering .lanes-head { visibility: hidden; }
.lanes.reordering .hcard { pointer-events: none; }
body.lane-drag, body.lane-drag * { cursor: grabbing !important; user-select: none; }
/* зазор от карточки до края ячейки и между карточками — 10: в нём идут линии связей (links.js) */
.lane-cell { min-height: 72px; padding: 10px; border-radius: 12px; background: var(--cell); display: flex; flex-direction: column; gap: 10px; }
.lane-cell.grey { background: var(--grey); }
.lane-cell.over { box-shadow: inset 0 0 0 2px var(--accent); background: var(--tint); }
/* карточка над линиями связей (svg.links — z-index 1): линия уходит под карточку и не закрывает текст */
.hcard { position: relative; z-index: 2; width: 100%; padding: 6px 7px 7px; border: 0; border-radius: 10px; background: var(--pc, #fff); color: var(--card-text);
  text-align: left; display: flex; flex-direction: column; gap: 3px; box-shadow: 0 1px 2px rgba(0, 0, 0, .18); }
.hcard[draggable="true"] { cursor: grab; }
@media (hover: hover) { .hcard:hover { filter: brightness(1.03); box-shadow: 0 2px 8px rgba(0, 0, 0, .22); } }
.hc-top { display: flex; align-items: center; gap: 4px; font-size: 10px; line-height: 12px; font-weight: 700; }
.hc-done { width: 11px; height: 11px; color: #1E7D3A; }
/* срок в углу (home.js: due) — плашка как .due-pill на канбане, только меньше */
.hc-due { margin-left: auto; flex: none; height: 16px; padding: 0 6px; border-radius: 8px; background: rgba(0, 0, 0, .06); color: #4B515C;
  font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; }
.hc-due.none { padding: 0; background: none; font-weight: 400; color: #7A808A; }
.hc-due.today { background: #F9EBE3; color: #BC450B; }
.hc-due.bad { background: #FBEAEA; color: #C62828; }
.hc-title { font-size: 11.5px; line-height: 14px; font-weight: 500; overflow: hidden; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.hcard.done { opacity: .65; }
.hcard.done .hc-title { text-decoration: line-through; }
.hcard.bad { box-shadow: inset 3px 0 0 #C62828, 0 1px 2px rgba(0, 0, 0, .18); }
.hcard.bad .hc-num { color: #C62828; }
.hcard.dragging, .bcard.dragging { opacity: .4; }
.hcard.sel, .bcard.sel, .lrow.sel, .wblock.sel, .mchip.sel { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- все задачи: канбан горизонтов ---------- */
.board { flex: 1; min-height: 0; display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden; margin: 0 -24px; padding: 0 24px; }
/* 21.10: без потолка ширины — канбан во всю страницу */
.bcol { flex: 1 1 0; min-width: 196px; display: flex; flex-direction: column; padding: 10px 10px 0;
  border-radius: 22px 22px 0 0; border: 1px solid var(--sub-border); border-bottom: 0; background: var(--sub); }
.bcol.grey { background: var(--grey); }
.bcol.over { border-color: var(--accent); background: var(--tint); }
.bcol-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 4px 4px 10px; }
.bcol-dot { flex: none; width: 10px; height: 10px; border-radius: 5px; background: var(--c); }
.bcol-title { flex: 1; min-width: 0; font-size: 14px; line-height: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bcol-n { font-size: 13px; color: var(--text3); }
.bcol-sub { flex-basis: 100%; margin-top: -4px; padding-left: 18px; font-size: 11.5px; color: var(--text3); }
.bcol-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin: 0 -4px; padding: 0 4px 92px; }
.bcol-empty { padding: 10px 0; text-align: center; font-size: 12px; color: var(--text3); }
/* 23.10: узких полосок с повёрнутым названием больше нет — все колонки обычные, во всю ширину окна */
.bcol-more { flex: none; width: 26px; height: 22px; margin: -2px -4px -2px 0; padding: 0; border: 0; border-radius: 11px; background: transparent;
  color: var(--text3); display: grid; place-items: center; cursor: pointer; }
.bcol-more .ico { width: 16px; height: 16px; }
@media (hover: hover) { .bcol-more:hover { background: var(--sub-hover); color: var(--text); } }
/* перетаскивание колонок за шапку (23.10): едет вся колонка с задачами, соседние расступаются (board.js, colDrag) */
.bcol-head.grab { cursor: grab; border-radius: 12px; touch-action: none; }
@media (hover: hover) { .bcol-head.grab:hover { background: var(--sub-hover); } }
.bcol.col-dragging { position: relative; z-index: 6; border-color: var(--accent); box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
  background: var(--sheet-bg); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); transition: none !important; }
body.col-drag, body.col-drag * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.bcol-add { flex: 0 0 150px; align-self: flex-start; height: 44px; display: flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 22px; border: 1px dashed var(--sub-border); background: transparent; color: var(--text2); font: inherit; font-size: 14px; cursor: pointer; }
@media (hover: hover) { .bcol-add:hover { border-color: var(--accent); color: var(--text); } }
.bcard { flex: none; padding: 12px; border-radius: 16px; border: 1px solid var(--card-border); background: #fff; color: var(--card-text);
  box-shadow: var(--card-shadow); display: flex; flex-direction: column; gap: 10px; cursor: pointer; }
.bcard[draggable="true"] { cursor: grab; }
@media (hover: hover) { .bcard:hover { box-shadow: 0 2px 4px rgba(0, 0, 0, .25), 0 10px 28px rgba(0, 0, 0, .2); } }
.bc-title { font-size: 14px; line-height: 19px; font-weight: 600; overflow-wrap: anywhere; }
.bc-move { float: right; width: 26px; height: 26px; margin: -5px -6px 0 4px; padding: 0; border: 0; border-radius: 13px; background: none;
  color: var(--card-text2); display: inline-grid; place-items: center; }
@media (hover: hover) { .bc-move:hover { background: #F1F2F4; color: var(--card-text); } }
.bc-move .ico { width: 15px; height: 15px; }
.bc-meta { display: flex; align-items: center; gap: 8px; min-width: 0; }
.due-pill { flex: none; height: 22px; padding: 0 8px; border-radius: 11px; background: #F1F2F4; color: #4B515C; font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; white-space: nowrap; }
.due-pill.bad { background: #FBEAEA; color: #C62828; }
.due-pill.today { background: #F9EBE3; color: #BC450B; }
.bc-epic { flex: 1; min-width: 0; font-size: 12px; color: var(--card-text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-missed { flex: none; display: inline-flex; align-items: center; gap: 2px; color: #C62828; font-size: 12px; font-weight: 600; }
.bc-missed .ico { width: 12px; height: 12px; }
.bc-who { flex: none; width: 24px; height: 24px; border-radius: 12px; color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.bcard.bad { box-shadow: inset 3px 0 0 #C62828, var(--card-shadow); }
.bcard.done { opacity: .72; }
.bcard.done .bc-title { text-decoration: line-through; }

/* ---------- списки ---------- */
.group-title { margin: 18px 6px 8px; font-size: 13px; font-weight: 600; color: var(--text2); }
.column > .group-title:first-child, .column > .legend + .group-title { margin-top: 4px; }
.group-title.bad { color: var(--danger); }
.group-title.today { color: var(--accent-text); }
button.group-title { display: block; width: calc(100% - 12px); text-align: left; border: 0; background: none; padding: 4px 8px; margin-left: 0; border-radius: 10px; }
@media (hover: hover) { button.group-title:hover { background: var(--sub); } }
.group-title.sel { background: var(--tint); color: var(--accent-text); }
.lrows { border-radius: 20px; border: 1px solid var(--sub-border); background: var(--sub); overflow: hidden; }
.lrow { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--sep); cursor: pointer;
  transition: opacity .25s var(--ease-out), transform .25s var(--ease-out), background-color .2s var(--ease-out); }
.lrow:first-child { border-top: 0; }
@media (hover: hover) { .lrow:hover { background: var(--sub-hover); } }
.lrow.completing { opacity: .35; transform: translateX(8px); }
.lrow.sel { outline-offset: -2px; border-radius: 20px; }
.check { flex: none; width: 24px; height: 24px; padding: 0; border-radius: 12px; border: 1.5px solid var(--text3); background: none;
  display: grid; place-items: center; color: #fff; }
.check .ico { width: 14px; height: 14px; }
@media (hover: hover) { .check:hover:not(:disabled) { border-color: var(--ok); } }
.check.on { background: var(--ok); border-color: var(--ok); }
.check:disabled:not(.on) { opacity: .35; cursor: default; }
.check.sm { width: 20px; height: 20px; border-radius: 10px; }
.check.sm .ico { width: 12px; height: 12px; }
.lr-body { flex: 1; min-width: 0; }
.lr-title { font-size: 14.5px; line-height: 1.3; overflow-wrap: anywhere; }
.lrow.done .lr-title { text-decoration: line-through; color: var(--text3); }
.lr-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; font-size: 12.5px; color: var(--text3); }
.lr-who { display: inline-flex; align-items: center; gap: 5px; color: var(--text); font-weight: 600; }
.hz-mini { display: inline-flex; align-items: center; gap: 4px; }
.hz-mini i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.due.bad { color: var(--danger); font-weight: 600; }
.due.today { color: var(--accent-text); font-weight: 600; }
.rep { display: inline-flex; align-items: center; gap: 2px; color: var(--danger); }
.rep .ico { width: 12px; height: 12px; }
.chev { flex: none; width: 16px; height: 16px; color: var(--text3); }

/* ---------- поиск ---------- */
.s-hint { color: var(--text3); font-size: 14px; padding: 16px 6px; line-height: 1.45; }
.s-hint.bad { color: var(--danger); }
.s-matched { color: var(--text3); font-size: 13px; margin: 0 6px 6px; }
.s-more { display: block; width: 100%; height: 44px; margin-top: 12px; border: 1px dashed var(--field-border); border-radius: 20px;
  background: none; color: var(--accent-text); font-size: 14px; font-weight: 600; }
.s-done-head { display: flex; justify-content: space-between; align-items: center; }
.s-done-head .link-btn { padding: 0; font-size: 13px; }
mark.hl { background: rgba(255, 179, 0, .35); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- панель справа: задача, форма, перенос срока, встреча ---------- */
.detail { flex: 0 0 420px; min-width: 0; display: flex; flex-direction: column; overflow: hidden; outline: none; }
.dhead { flex: none; display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px; }
.dhead-title { flex: 1; min-width: 0; font-size: 13px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dbody { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px 16px; }
.dfoot { flex: none; padding: 12px 16px 16px; border-top: 1px solid var(--sep); }
.dfoot .btn.block { margin-top: 0; height: 46px; border-radius: 23px; font-size: 15px; }

.hero { padding: 2px 2px 8px; }
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; background: var(--tint); color: var(--accent-text);
  font-size: 12px; font-weight: 600; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.bad { background: var(--danger-bg); color: var(--danger); }
.hero-title { margin: 10px 0 12px; font-size: 20px; line-height: 26px; font-weight: 600; letter-spacing: -.2px; overflow-wrap: anywhere; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hchip { height: 34px; padding: 0 12px; border-radius: 17px; border: 1px solid var(--sub-border); background: var(--sub); color: var(--text);
  font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.hchip .ico { width: 15px; height: 15px; }
.hchip .dot { width: 8px; height: 8px; border-radius: 4px; }
.hchip.act { color: var(--text); }
@media (hover: hover) { .hchip.act:hover { background: var(--sub-hover); border-color: var(--accent-text); } }
.hchip:disabled { opacity: 1; cursor: default; }
.hchip.bad { color: var(--danger); }
.hero + .btn.big { margin: 4px 0 14px; }

.section { border-radius: 20px; border: 1px solid var(--sub-border); background: var(--sub); overflow: hidden; margin-bottom: 12px; }
.kv { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 6px 14px; border-top: 1px solid var(--sep); }
.kv:first-child { border-top: 0; }
.kv .k { flex: none; width: 116px; font-size: 13px; color: var(--text3); }
.kv .v { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.who-inline { display: inline-flex; align-items: center; gap: 6px; }
.text-block { padding: 10px 14px 12px; border-top: 1px solid var(--sep); }
.text-block:first-child { border-top: 0; }
.text-block .k { margin-bottom: 3px; font-size: 12px; color: var(--text3); }
.text-block .v { font-size: 14px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.sec-title { margin: 16px 4px 8px; font-size: 13px; font-weight: 600; color: var(--text2); }
.cl-item { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 14px; border-top: 1px solid var(--sep); font-size: 14px; }
.cl-item:first-child { border-top: 0; }
.cl-item.on span { text-decoration: line-through; color: var(--text3); }
.hist { padding: 6px 14px 10px; }
.hist div { position: relative; padding: 6px 0 6px 18px; font-size: 13.5px; }
.hist div::before { content: ""; position: absolute; left: 3px; top: 13px; width: 7px; height: 7px; border-radius: 50%; background: var(--text3); }
.comments { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.cm { display: flex; align-items: flex-end; gap: 8px; }
.cm.mine { justify-content: flex-end; }
.cm-bubble { max-width: 82%; padding: 7px 12px 6px; border-radius: 18px 18px 18px 6px; background: var(--bubble); }
.cm.mine .cm-bubble { border-radius: 18px 18px 6px 18px; background: var(--mine); }
.cm-who { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--text2); }
.cm-text { font-size: 14px; line-height: 19px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cm-at { margin-top: 2px; font-size: 11px; line-height: 14px; color: var(--text3); text-align: right; }
.cm.sys { align-self: center; flex-direction: column; align-items: center; gap: 1px; max-width: 90%; padding: 4px 12px; border-radius: 12px;
  background: var(--service); color: var(--text2); font-size: 12px; font-weight: 500; text-align: center; }
.cm.sys .cm-at { margin: 0; text-align: center; }
.actions { display: grid; gap: 8px; margin: 12px 0 4px; }
.actions .btn.block { margin-top: 0; }
.comment-box { display: flex; align-items: flex-end; gap: 8px; }
.comment-box textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 160px; padding: 12px 16px; border-radius: 22px;
  border: 1px solid var(--field-border); background: var(--field); color: var(--text); font-size: 14px; line-height: 19px; resize: none; outline: none; }
.comment-box textarea:focus { border-color: var(--accent-text); }
.send-btn { flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 22px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.send-btn:disabled { opacity: .5; }

/* вложения */
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.ftile { position: relative; aspect-ratio: 1; min-width: 0; padding: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--field-border);
  background: var(--field); color: var(--text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.ftile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ftile.add { border-style: dashed; background: none; color: var(--accent-text); font-size: 12.5px; font-weight: 600; }
.ftile .fn { max-width: 100%; padding: 0 6px; font-size: 11px; line-height: 1.2; text-align: center; color: var(--text3); overflow: hidden;
  overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ftile.loading::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .35)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='%23E0936D' stroke-width='2.5' stroke-dasharray='40 20'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='0.9s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") no-repeat center / 26px; }
.ftile-x { position: absolute; top: 4px; right: 4px; z-index: 1; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 11px;
  background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; }
.ftile-x .ico { width: 12px; height: 12px; }
.fi { position: relative; flex: none; width: 30px; height: 34px; display: inline-grid; place-items: center; color: var(--text2); }
.fi .ico { width: 30px; height: 34px; }
.fi b { position: absolute; bottom: 6px; left: 0; right: 0; text-align: center; font-size: 7.5px; font-weight: 800; letter-spacing: .02em; }
.tfiles { padding: 12px 14px; display: grid; gap: 8px; }
.tfiles .ftile { cursor: zoom-in; }
.frow { width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 0; border: 0; border-top: 1px solid var(--sep); background: none;
  color: inherit; text-align: left; }
.tfiles .files + .frow, .tfiles .frow:first-child { border-top: 0; }
.lightbox { position: fixed; inset: 0; z-index: 70; padding: 56px 12px 64px; background: rgba(0, 0, 0, .92);
  display: flex; align-items: center; justify-content: center; }
.lb-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.lb-cap { position: absolute; left: 16px; right: 160px; bottom: 20px; color: #ddd; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-x, .lb-prev, .lb-next { position: absolute; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 22px; background: rgba(255, 255, 255, .14);
  color: #fff; display: grid; place-items: center; }
.lb-x { top: 12px; right: 12px; }
.lb-prev { left: 12px; top: 50%; translate: 0 -50%; }
.lb-next { right: 12px; top: 50%; translate: 0 -50%; }
.lightbox { animation: fade-in .2s var(--ease-out); }
.lightbox.closing { animation: fade-out .16s var(--ease-out) forwards; pointer-events: none; }
.lb-img { touch-action: pinch-zoom; }
.lb-open { position: absolute; right: 12px; bottom: 12px; height: 36px; padding: 0 14px; border: 0; border-radius: 18px;
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 13px; font-weight: 600; }

/* ---------- форма задачи ---------- */
.source { margin-bottom: 12px; padding: 10px 14px; border-radius: 16px; border: 1px solid var(--sub-border); background: var(--sub); color: var(--text3); font-size: 13.5px; }
.source q { display: block; margin-top: 4px; color: var(--text); font-style: italic; }
.field { padding: 12px 14px; border-top: 1px solid var(--sep); }
.field:first-child { border-top: 0; }
.field.text-field { cursor: text; }
.label { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 12.5px; color: var(--text3); }
.label .req::after { content: " *"; color: var(--danger); }
.count.over { color: var(--danger); }
.field.invalid .label > span:first-child { color: var(--danger); }
.err { margin-top: 6px; font-size: 12.5px; color: var(--danger); }
.err:empty { display: none; }
.field textarea, .field input.text { display: block; width: 100%; padding: 0; border: 0; background: transparent; color: var(--text);
  font-size: 15px; line-height: 1.35; outline: none; resize: none; }
.field textarea { min-height: 1.4em; }
.field textarea[rows="2"] { min-height: 2.8em; }
textarea::placeholder, input::placeholder { color: var(--text3); }
.pick { width: 100%; display: flex; align-items: center; gap: 10px; padding: 2px 0; border: 0; background: none; color: var(--text); text-align: left; font-size: 15px; }
.pick .value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick .value.with-avatar { display: flex; align-items: center; gap: 10px; }
.pick .placeholder { flex: 1; color: var(--text3); }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.chips:empty { display: none; }
.chips.first { margin: 0 0 10px; }
.chip { height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--sub-border); background: transparent; color: var(--text);
  font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
@media (hover: hover) { .chip:hover { background: var(--sub); } }
.chip.on { background: var(--accent); border-color: transparent; color: #fff; }
.chip.add { border-style: dashed; border-color: var(--field-border); color: var(--accent-text); }
.chip .x { width: 12px; height: 12px; opacity: .6; }
.chip .avatar { margin-left: -8px; }
.hz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.hz { height: 38px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--sub-border); background: none; color: var(--text);
  font-size: 13.5px; text-align: left; display: flex; align-items: center; gap: 8px; }
@media (hover: hover) { .hz:hover:not(.on) { background: var(--sub); } }
.hz.on { border-color: transparent; font-weight: 600; }
.hz .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.hz .tick { width: 14px; height: 14px; }
.step { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--sep); }
.step:first-child { border-top: 0; }
.step .num { width: 20px; font-size: 14px; color: var(--text3); }
.step input { flex: 1; }
.step .del { flex: none; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 14px; background: none; color: var(--text3); display: grid; place-items: center; }
@media (hover: hover) { .step .del:hover { background: var(--sub); color: var(--text); } }
.step .del .ico { width: 14px; height: 14px; }
.tform.drop .section:has([data-field="files"]) { box-shadow: inset 0 0 0 2px var(--accent); }
.hint-line { margin: 10px 6px 4px; font-size: 12.5px; line-height: 1.4; color: var(--text3); }

/* ---------- календарь ---------- */
.cal-arrows { display: flex; align-items: center; gap: 6px; }
.cal-body { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -24px; padding: 0 24px 88px; }
.cal-main.view-week .cal-body { overflow: hidden; padding-bottom: 0; display: flex; flex-direction: column; }
@media (min-width: 1100px) {
  .cal-main.view-month .cal-body { overflow: hidden; padding-bottom: 80px; display: flex; flex-direction: column; }
  .cal-main.view-month .mgrid { flex: 1; min-height: 0; grid-template-rows: auto repeat(var(--weeks), minmax(0, 1fr)); }
  .cal-main.view-month .mday { min-height: 0; }
}

/* месяц */
.mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-radius: 18px; border: 1px solid var(--sub-border);
  background: var(--cell); overflow: hidden; }
.mwd { padding: 8px 0 6px; border-bottom: 1px solid var(--sep); text-align: center; font-size: 12px; font-weight: 600; color: var(--text3); }
.mday { min-width: 0; min-height: 84px; padding: 4px; border-right: 1px solid var(--sep); border-bottom: 1px solid var(--sep); overflow: hidden;
  display: flex; flex-direction: column; gap: 2px; cursor: pointer; }
.mday:nth-child(7n) { border-right: 0; }
@media (hover: hover) { .mday:hover { background: var(--sub); } }
.mday.other .mnum { color: var(--faded); }
.mday.sel { background: var(--tint); }
.mday.drop { box-shadow: inset 0 0 0 2px var(--accent); }
.mnum { align-self: center; width: 24px; height: 24px; line-height: 24px; border-radius: 12px; text-align: center; font-size: 12.5px; font-weight: 500; }
.mday.today .mnum { background: var(--accent); color: #fff; font-weight: 700; }
.mchip { flex: none; padding: 2px 6px; border-radius: 6px; font-size: 11.5px; line-height: 1.3; font-weight: 500; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; cursor: pointer; }
.mchip.task { background: #fff; color: var(--card-text); box-shadow: inset 3px 0 0 var(--c); }
.mchip.task.bad { color: #C62828; font-weight: 600; }
.mchip.done { opacity: .55; text-decoration: line-through; }
.mchip.gev { background: var(--c); color: #fff; }
.mchip.gtask { background: transparent; border: 1px dashed var(--text3); color: var(--text); }
.mchip.hidden-ev, .wblock.hidden-ev { opacity: .5; background: transparent; border: 1px dashed var(--c); color: var(--text); }
.mchip.dragging, .wblock.dragging { opacity: .25; }
.mmore { padding-left: 4px; font-size: 10.5px; color: var(--text3); }
.month-wrap { display: flex; flex-direction: column; gap: 16px; }

/* неделя */
.week { flex: 1; min-height: 0; display: flex; flex-direction: column; border-radius: 18px 18px 0 0; border: 1px solid var(--sub-border);
  border-bottom: 0; background: var(--cell); overflow: hidden; }
.wk-head { flex: none; display: grid; padding: 6px 0; border-bottom: 1px solid var(--sep); }
.wk-day { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 2px 0; border: 0; border-radius: 12px; background: none; color: var(--text); }
@media (hover: hover) { button.wk-day:hover { background: var(--sub); } }
.wk-day.sel { background: var(--tint); }
.wk-day .wd { font-size: 12px; font-weight: 600; color: var(--text3); }
.wk-day .dn { width: 32px; height: 32px; line-height: 32px; border-radius: 16px; text-align: center; font-size: 15px; font-weight: 600; }
.wk-day.today .wd { color: var(--accent-text); }
.wk-day.today .dn { background: var(--accent); color: #fff; }
.wk-allday { flex: none; display: grid; padding: 4px 0; border-bottom: 1px solid var(--sep); }
.wk-ad-label { padding: 3px 6px 0 0; text-align: right; font-size: 10.5px; color: var(--text3); }
.wk-ad-cell { min-width: 0; padding: 0 2px; display: flex; flex-direction: column; gap: 2px; }
.wk-body { flex: 1; min-height: 0; overflow-y: auto; position: relative; padding-bottom: 76px; }
.wk-grid { display: grid; position: relative; }
.wk-gutter { position: relative; }
.wk-hour { position: relative; height: var(--hour); }
.wk-hour span { position: absolute; top: -7px; right: 8px; font-size: 11px; color: var(--text3); }
.wcol { position: relative; border-left: 1px solid var(--sep); cursor: pointer;
  background: repeating-linear-gradient(to bottom, var(--sep) 0, var(--sep) 1px, transparent 1px, transparent var(--hour)); }
.wcol.today { background-color: rgba(204, 75, 12, .05); }
.wcol.drop { background-color: var(--tint); }
.wblock { position: absolute; padding: 3px 7px; border-radius: 8px; overflow: hidden; font-size: 12px; line-height: 15px; cursor: pointer;
  display: flex; flex-direction: column; gap: 1px; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.wb-time { font-size: 11px; line-height: 13px; font-weight: 500; }
.wb-title { font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.wblock.task { background: #fff; color: var(--card-text); border-top: 3px solid var(--c); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.wblock.task .wb-time { color: var(--card-text2); }
.wblock.task.bad .wb-time { color: #C62828; }
.wblock.task.done { opacity: .6; }
.wblock.task.done .wb-title { text-decoration: line-through; }
.wblock.gev { background: var(--c); color: #fff; }
.wblock.gev .wb-time { color: rgba(255, 255, 255, .85); }
.wblock.short { padding-top: 2px; }
.wblock.short .wb-title { -webkit-line-clamp: 1; }
.wblock.more { display: grid; place-items: center; padding: 0; background: var(--sub-hover); color: var(--text); font-size: 13px; font-weight: 700; }
.now-line { position: absolute; left: 0; right: 0; z-index: 2; height: 2px; background: var(--accent); pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }

/* список дня и расписание */
.drow .dtime { flex: none; width: 48px; font-size: 13px; line-height: 1.25; font-weight: 600; color: var(--text3); white-space: pre-line; text-align: center; }
.drow .dtime.bad { color: var(--danger); }
.drow .dtime .ico { width: 14px; height: 14px; }
.drow .dbar { flex: none; width: 4px; align-self: stretch; border-radius: 2px; }
.dbar.gtask-bar { width: 3px; background: transparent; border: 1.5px dashed var(--text3); }
.drow.hidden-ev .lr-title { color: var(--text3); }
.dtime-edit { width: 100%; min-width: 0; margin: 0; padding: 5px 0; border: 0; border-radius: 8px; background: var(--tint); color: var(--accent-text);
  font-weight: 600; text-align: center; -webkit-appearance: none; appearance: none; }
.dtime-edit.bad { background: var(--danger-bg); color: var(--danger); }
.dtime-edit:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--accent); }
.dtime-edit::-webkit-calendar-picker-indicator { display: none; }
.dtime-edit::-webkit-datetime-edit, .dtime-edit::-webkit-datetime-edit-fields-wrapper, .dtime-edit::-webkit-datetime-edit-text,
.dtime-edit::-webkit-datetime-edit-hour-field, .dtime-edit::-webkit-datetime-edit-minute-field { padding: 0; }
.eye-btn { flex: none; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 17px; background: none; color: var(--text3); display: grid; place-items: center; }
@media (hover: hover) { .eye-btn:hover { background: var(--sub); } }
.eye-btn.on { color: var(--danger); }

/* колонка справа: мини-месяц, день, календари */
.cal-aside { flex: 0 0 320px; min-width: 0; padding: 18px; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; }
.mini-month { flex: none; padding: 14px 12px 10px; border-radius: 22px; border: 1px solid var(--sub-border); background: var(--sub); }
.mm-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px 8px; }
.mm-head h2, .day-panel h2, .cal-cals h2 { margin: 0; font-size: 15px; line-height: 20px; font-weight: 600; }
.mm-arrows { display: flex; gap: 6px; }
.mm-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 2px; text-align: center; }
.mm-wd { padding: 2px 0 4px; font-size: 11px; color: var(--text3); }
.mm-day { height: 38px; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--text);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.mm-day span { width: 28px; height: 28px; line-height: 28px; border-radius: 14px; font-size: 13px; font-weight: 500; }
.mm-day i { width: 4px; height: 4px; border-radius: 2px; }
.mm-day i.on { background: var(--accent-text); }
.mm-day.other { color: var(--faded); }
.mm-day.in { background: var(--sub); }
@media (hover: hover) { .mm-day:hover span { background: var(--sub-hover); } }
.mm-day.today span { box-shadow: inset 0 0 0 1.5px var(--accent); }
.mm-day.sel span { background: var(--accent); color: #fff; font-weight: 700; }
.dp-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0 4px 8px; }
.dp-btns { display: flex; gap: 6px; }
.dp-add { height: 30px; padding: 0 10px; border: 0; border-radius: 15px; background: var(--tint); color: var(--accent-text);
  font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.dp-add .ico { width: 13px; height: 13px; }
.dp-add.ev { background: var(--ev-bg); color: var(--ev-text); }
.dp-empty { padding: 16px; border-radius: 16px; background: var(--sub); text-align: center; font-size: 13.5px; color: var(--text3); }
.cal-aside .lrow { padding: 9px 10px; gap: 10px; }
.cal-aside .lr-title { font-size: 13.5px; }
.cal-aside .drow .dtime { width: 40px; font-size: 12px; }
.cal-cals { display: flex; flex-direction: column; }
.cal-cals h2 { margin: 0 4px 2px; }
.cal-cals .list-title { margin-top: 10px; }
.row.cal-row { padding: 8px 6px; border-bottom: 0; border-radius: 12px; }
.cal-check { flex: none; width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--c); display: grid; place-items: center; color: #fff; }
.cal-check.on { background: var(--c); }
.cal-check .ico { width: 12px; height: 12px; }
.cal-cals .btn.block { margin-top: 10px; }

.ac-ico { flex: none; width: 34px; height: 34px; color: var(--accent-text); }
.fix-steps { display: grid; gap: 8px; margin: 4px 2px 12px; font-size: 14.5px; }
.drag-ghost { position: fixed; z-index: 50; pointer-events: none; padding: 7px 10px; border-radius: 10px; background: #fff; color: var(--card-text);
  font-size: 13px; box-shadow: inset 3px 0 0 var(--c), 0 12px 28px rgba(0, 0, 0, .35); transform: rotate(2deg) scale(1.03); }
.dg-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drag-label { margin-top: 2px; font-size: 12px; font-weight: 600; color: #BC450B; }
.drag-label:empty { display: none; }
body.drag-mode, body.drag-mode * { -webkit-user-select: none; user-select: none; }

/* встреча */
.ev-where { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 4px 12px; font-size: 13.5px; font-weight: 600; }
.ev-where .ico { width: 16px; height: 16px; color: var(--ev-text); }
.ev-where span { font-weight: 400; color: var(--text3); }
.ev-when { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ev-times { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.field input.ev-input { width: auto; min-height: 38px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--field-border); background: var(--field); font-size: 15px; }
.field input.ev-input[type="time"] { width: 104px; }
.field input.ev-input[type="date"] { width: 160px; }
.ev-note { margin-top: 8px; font-size: 12.5px; line-height: 1.35; color: var(--text3); }
.ev-note:empty { display: none; }
.ev-note .bad { color: var(--danger); }

/* ---------- профиль ---------- */
.profile-card { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 16px; }
.profile-photo { padding: 0; border: 0; border-radius: 50%; background: none; }
.profile-text { flex: 1; min-width: 180px; display: grid; gap: 2px; font-size: 13.5px; }
.profile-name { font-size: 18px; font-weight: 600; }
.profile-photo-btns { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 2px; }
.share-row { flex-wrap: wrap; }
.share-row .v { min-width: 140px; }
.profile-main .btn.block { margin-top: 4px; }

/* ---------- листы, окна, всплывающее сообщение ---------- */
/* Открыть — .open, закрыть — снять .open (ui.js): всё уходит тем же путём, что пришло, и с того места, где было */
.overlay { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; background: transparent;
  transition: background-color .3s var(--ease-out); }
.overlay.open { background: var(--overlay); }
.overlay.closing { pointer-events: none; }
.overlay.center { align-items: center; padding: 16px; }
.sheet { width: 100%; max-height: 88vh; display: flex; flex-direction: column; border-radius: 26px 26px 0 0; border: 1px solid var(--glass-border);
  background: var(--sheet-bg); box-shadow: var(--pill-shadow); -webkit-backdrop-filter: blur(40px) saturate(150%); backdrop-filter: blur(40px) saturate(150%);
  transform: translateY(100%); transition: transform .36s var(--ease-drawer); outline: none; }
.overlay.open .sheet { transform: none; }
@media (min-width: 700px) {
  .overlay.bottom { align-items: center; padding: 24px; }
  .sheet { max-width: 520px; max-height: 80vh; border-radius: 26px; opacity: 0; transform: translateY(16px) scale(.97);
    transition: transform .26s var(--ease-out), opacity .2s var(--ease-out); }
  .overlay.open .sheet { opacity: 1; transform: none; }
}
/* Выбор из списка (эпик, горизонт, исполнитель) на компьютере — стеклянной панелью от кнопки, без затемнения */
.overlay.pop, .overlay.pop.open { display: block; padding: 0; background: transparent; }
.overlay.pop .sheet { position: fixed; max-width: none; border-radius: 22px; background: var(--glass-strong);
  -webkit-backdrop-filter: blur(30px) saturate(150%); backdrop-filter: blur(30px) saturate(150%); transform: scale(.95); }
.overlay.pop.open .sheet { transform: none; }
.sheet-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 8px 20px; }
.sheet-title { font-size: 17px; font-weight: 600; }
.sheet-body { overflow-y: auto; padding: 0 16px 16px; }
.sheet-note { margin: 0 4px 8px; }
.sheet-foot { margin-top: 8px; }
.sheet-actions { display: flex; gap: 8px; margin-top: 14px; }
.sheet-actions .btn { flex: 1; }
.area { width: 100%; min-height: 96px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--field-border); background: var(--field);
  color: var(--text); font-size: 14px; line-height: 1.4; resize: vertical; outline: none; }
.list-title { margin: 12px 8px 4px; font-size: 12px; font-weight: 600; color: var(--text3); }
.row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 8px; border: 0; border-bottom: 1px solid var(--sep);
  background: none; color: var(--text); text-align: left; font-size: 14.5px; text-decoration: none; }
@media (hover: hover) { .row:hover { background: var(--sub); } }
.row-text { flex: 1; min-width: 0; }
.row-sub { display: block; font-size: 12.5px; color: var(--text3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.on .row-text { font-weight: 600; }
.row .check-mark { width: 18px; height: 18px; color: var(--accent-text); }
.row .dot { flex: none; width: 12px; height: 12px; border-radius: 50%; }
.dot.none { background: none; box-shadow: inset 0 0 0 1.5px var(--text3); }
.row-count { min-width: 18px; text-align: right; font-size: 13px; color: var(--text3); }
.add-row .row-text { color: var(--accent-text); font-weight: 600; }
/* Фильтр по эпику: справа от эпика — «закрепить» (filters.js). Видна у закреплённых и при наведении на строку */
.ep-row { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--sep); }
.ep-row > .row { flex: 1; min-width: 0; border-bottom: 0; }
.ep-pin { flex: none; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 10px;
  background: none; color: var(--text3); opacity: 0; transition: opacity .15s, color .15s; }
.ep-pin .ico { width: 16px; height: 16px; }
.ep-pin.on { opacity: 1; color: var(--accent-text); }
.ep-pin.on svg { fill: currentColor; }
.ep-row:hover .ep-pin, .ep-pin:focus-visible { opacity: 1; }
@media (hover: hover) { .ep-pin:hover { color: var(--text); background: var(--sub); } .ep-pin.on:hover { color: var(--accent-text); } }
@media (hover: none) { .ep-pin:not(.on) { opacity: .5; } }
/* Несколько эпиков сразу (20.10, filters.js): отметка .ep-check (не .pick — так называются поля формы) слева от эпика в списке, кнопка «Готово» внизу; на главной — кнопки-отметки */
.ep-check { flex: none; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; border: 1.5px solid var(--text3);
  color: #fff; transition: background .15s, border-color .15s; }
.ep-check .ico { width: 13px; height: 13px; }
.ep-check.on { background: var(--accent); border-color: var(--accent); }
.pick-foot { position: sticky; bottom: -16px; display: flex; justify-content: flex-end; margin: 0 -16px -16px; padding: 20px 16px 16px;
  background: linear-gradient(to bottom, transparent, var(--sheet-bg) 45%); }
.epic-chips { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.add-choice { padding: 12px 6px; }
.ep-line { display: flex; gap: 8px; }
.ep-line input.text { flex: 1; min-width: 0; height: 42px; padding: 0 14px; border-radius: 21px; border: 1px solid var(--field-border); background: var(--field);
  color: var(--text); font-size: 15px; outline: none; }
.dialog { width: min(420px, 100%); padding: 22px 22px 16px; border-radius: 26px; border: 1px solid var(--glass-border); background: var(--sheet-bg);
  box-shadow: var(--pill-shadow); -webkit-backdrop-filter: blur(40px); backdrop-filter: blur(40px);
  opacity: 0; transform: scale(.96); transition: transform .22s var(--ease-out), opacity .18s var(--ease-out); }
.overlay.open .dialog { opacity: 1; transform: none; }
.dialog-text { font-size: 15px; line-height: 1.45; white-space: pre-wrap; }
.dialog-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* календарь срока (форма, перенос) */
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 8px; }
.cal-month { font-size: 15px; font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-wd { padding: 4px 0; font-size: 12px; color: var(--text3); }
.day { aspect-ratio: 1; max-height: 42px; border: 0; border-radius: 50%; background: none; color: var(--text); font-size: 14.5px; }
@media (hover: hover) { .day:hover:not(:disabled):not(.sel) { background: var(--sub-hover); } }
.day.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.day.sel { background: var(--accent); color: #fff; }
.day.off:not(.sel) { color: var(--text3); }
.day:disabled { opacity: .3; cursor: default; }
.time-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.time-row input { height: 32px; padding: 0 10px; border-radius: 16px; border: 1px solid var(--sub-border); background: none; color: var(--text); font-size: 14px; }
.time-row input.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.time-chips { display: contents; }

/* Сообщение снизу — стекло над карточками, как плавающий переключатель; стоит над ним, а не поверх */
.toast { position: fixed; left: 50%; bottom: 100px; z-index: 60; width: max-content; max-width: min(560px, calc(100% - 32px));
  padding: 12px 16px; border-radius: 22px; border: 1px solid var(--glass-border); background: var(--glass-strong); color: var(--text);
  box-shadow: var(--pill-shadow); -webkit-backdrop-filter: blur(24px) saturate(150%); backdrop-filter: blur(24px) saturate(150%);
  display: flex; align-items: center; gap: 14px; font-size: 14px; font-weight: 500;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: opacity .2s var(--ease-out), transform .3s var(--ease-out); }
.toast.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast span { flex: 1; }
.toast button { padding: 0; border: 0; background: none; color: var(--accent-text); font-size: 14px; font-weight: 700; }

/* ---------- вход ---------- */
body.login-page { overflow: auto; }
.login-page #app, body.login-page:not(:has(#app)) { display: grid; place-items: center; }
body.login-page:not(:has(#app)) { min-height: 100%; padding: 24px; }
.login-card { width: min(440px, 100%); padding: 40px 36px 30px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.login-card h1 { margin: 0; font-size: 26px; font-weight: 600; }
.login-card p { margin: 0; }
.login-logo { width: 56px; height: 56px; color: var(--accent-text); }
.dev-people { width: 100%; max-height: 60vh; overflow-y: auto; text-align: left; }
/* вход по телефону и паролю, страница по ссылке-приглашению (21.10, bot/web_auth.py) */
.auth-form { width: 100%; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text2); }
.auth-form input { height: 44px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--field-border); background: var(--field);
  color: var(--text); font: inherit; font-size: 16px; }
.auth-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.auth-form .btn { margin-top: 4px; }
.auth-error { color: var(--danger); }
.fatal { color: var(--danger); margin: auto; }

/* ---------- полосы прокрутки: тонкие, в покое почти не видны ---------- */
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: var(--faded) transparent; }
}
::-webkit-scrollbar { width: 9px; height: 9px; background: transparent; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--faded) padding-box; border: 2px solid transparent; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3) padding-box; }

/* ---------- ширина экрана ---------- */
/* Открыта задача, а экран не очень широкий: люди на главной и колонка календаря справа уступают место */
@media (max-width: 1499px) { #app.has-detail[data-section="home"] .people { display: none; } }
@media (max-width: 1599px) { #app.has-detail .cal-aside { display: none; } }

/* Уже 1100: панель справа — поверх раздела */
@media (max-width: 1099px) {
  .detail { position: fixed; z-index: 30; top: 12px; right: 12px; bottom: 12px; width: min(480px, calc(100% - 24px));
    background: var(--glass-strong); -webkit-backdrop-filter: blur(40px) saturate(150%); backdrop-filter: blur(40px) saturate(150%);
    box-shadow: var(--pill-shadow); }
  .people { flex-basis: 220px; }
}

/* Телефон и узкое окно: меню — панелью снизу, люди — лентой сверху. Доводка для телефона (вырез iPhone, подписи в меню,
   шапки одной строкой) — phone.css, этап 4. */
@media (max-width: 899px) {
  #app { padding: 10px 10px 90px; gap: 10px; }
  .rail { position: fixed; z-index: 20; left: 10px; right: 10px; bottom: 10px; height: 68px; flex-direction: row; padding: 6px 8px;
    border-radius: 34px; background: var(--glass-strong); box-shadow: var(--pill-shadow); }
  .rail-logo, .rail-bottom { display: none; }
  .rail-items { flex: 1; flex-direction: row; justify-content: space-around; gap: 4px; }
  .rail-btn { flex: 1; height: 56px; border-radius: 28px; flex-direction: column; gap: 2px; }
  .rail-label { position: static; width: auto; height: auto; clip: auto; overflow: visible; font-size: 10px; font-weight: 600; }
  .section-area { flex-direction: column; gap: 10px; min-height: 0; }
  .panel { border-radius: 26px; }
  .panel.main { padding: 16px 16px 0; }
  .scroll, .lanes-scroll, .board, .cal-body { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .sec-title h1 { font-size: 20px; line-height: 26px; }
  .field-search.as-btn { width: auto; flex: 1 1 140px; }
  .people { flex: none; padding: 8px; border-radius: 22px; }
  .people .people-head, .people .field-search, .pr-pin { display: none; }
  .people-list { flex-direction: row; overflow-x: auto; overflow-y: hidden; gap: 4px; }
  .person-row { min-height: 40px; padding: 0 12px 0 4px; border-radius: 20px; }
  .person-row .avatar { width: 30px; height: 30px; }
  .pr-note { display: none; }
  .legend { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .legend::-webkit-scrollbar { display: none; }
  .bcol { flex: 0 0 min(78vw, 280px); max-width: none; }
  .board { scroll-snap-type: x mandatory; scroll-padding: 0 16px; }
  .bcol { scroll-snap-align: start; }
  .cal-aside { display: none; }
  .detail { top: 0; right: 0; bottom: 0; left: 0; width: auto; border-radius: 0; }
  .float-switch { bottom: 12px; }
  .float-switch button { height: 36px; padding: 0 12px; font-size: 13px; }
}

/* ---------- отклик в момент нажатия, а не на отпускании ----------
   Стеклянные кнопки чуть светлеют и вдавливаются, белые карточки вдавливаются, строки списков подсвечиваются.
   Без свечения — в стиле его нет. Нажали — сразу, отпустили — плавно назад. На iPhone :active работает благодаря touchstart в ui.js. */
.btn, .icon-btn, .rail-btn, .seg button, .float-switch button, .lg, .chip, .hchip, .hz, .banner, .dp-add, .s-more, .send-btn,
.check, .eye-btn, .bc-move, .step .del, .ftile, .ftile-x, .day, .mm-day, .lb-x, .lb-prev, .lb-next, .lb-open, .link-btn, .hint-link,
.field-search.as-btn, .bcard, .hcard, .row, .person-row, button.group-title, .frow {
  transition: transform .2s var(--ease-out), background-color .2s var(--ease-out), border-color .2s var(--ease-out),
    color .2s var(--ease-out), box-shadow .2s var(--ease-out); }
:is(.btn, .seg button, .float-switch button, .lg, .chip, .hchip.act, .hz, .banner, .dp-add, .s-more, .ftile, .lb-open, .link-btn,
  .hint-link, .field-search.as-btn):active:not(:disabled) { transform: scale(.97); transition-duration: .06s; }
:is(.icon-btn, .rail-btn, .send-btn, .check, .eye-btn, .bc-move, .step .del, .ftile-x, .day, .mm-day, .lb-x, .lb-prev,
  .lb-next):active:not(:disabled) { transform: scale(.92); transition-duration: .06s; }
:is(.bcard, .hcard):active:not(:has(button:active)) { transform: scale(.98); transition-duration: .06s; }
:is(.btn:not(.primary), .icon-btn, .rail-btn:not(.on):not(.add), .seg button:not(.on), .float-switch button:not(.on), .chip:not(.on),
  .hz:not(.on), .hchip.act, .eye-btn, .step .del):active:not(:disabled) { background: var(--sub-hover); }
:is(.btn.primary, .send-btn, .rail-btn.on, .rail-btn.add, .float-switch button.on, .chip.on):active:not(:disabled) { background: var(--accent-hover); }
.lg:active { border-color: var(--text3); }
:is(.lrow, .row, .person-row, button.group-title, .frow):active:not(:has(button:active)) { background: var(--sub-hover); transition-duration: .06s; }

/* ---------- панель справа: приходит справа и уходит туда же (nav.js — .closing) ---------- */
.detail:not([hidden]) { animation: detail-in .28s var(--ease-out); }
.detail.closing { animation: detail-out .2s var(--ease-out) forwards; pointer-events: none; }
@keyframes detail-in { from { opacity: 0; transform: translateX(24px); } }
@keyframes detail-out { to { opacity: 0; transform: translateX(24px); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

/* ---------- настройки системы ---------- */
/* «Уменьшить движение»: без сдвигов и масштаба — только мягкое появление и смена цвета */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-property: opacity, background-color, border-color, color, box-shadow !important; }
  .sheet, .overlay.pop .sheet, .dialog { transform: none !important; }
  .sheet { opacity: 0; transition: opacity .2s var(--ease-out); }
  .overlay.open .sheet { opacity: 1; }
  .toast { transform: translate(-50%, 0); }
  .detail:not([hidden]), .lightbox { animation-name: fade-in; }
  .detail.closing, .lightbox.closing { animation-name: fade-out; }
}
/* «Понижение прозрачности»: стекло становится плотным, без размытия */
@media (prefers-reduced-transparency: reduce) {
  :root { --glass: #232428; --glass-strong: #2C2D32; --sheet-bg: #26272B; --head-bg: #232428; }
  [data-theme="light"] { --glass: #E9EAED; --glass-strong: #F3F4F6; --sheet-bg: #EEEFF1; --head-bg: #E9EAED; }
  .panel, .sheet, .overlay.pop .sheet, .dialog, .float-switch, .toast, .lanes-head::before { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
/* «Увеличение контраста»: плотные панели и чёткие кромки */
@media (prefers-contrast: more) {
  :root { --glass: #232428; --glass-strong: #2C2D32; --glass-border: rgba(255, 255, 255, .3); --sub-border: rgba(255, 255, 255, .24);
    --field-border: rgba(255, 255, 255, .32); --sep: rgba(255, 255, 255, .2); --text2: rgba(245, 245, 247, .92); --text3: rgba(245, 245, 247, .82); }
  [data-theme="light"] { --glass: #E9EAED; --glass-strong: #F3F4F6; --glass-border: rgba(17, 24, 39, .3); --sub-border: rgba(17, 24, 39, .22);
    --field-border: rgba(17, 24, 39, .32); --sep: rgba(17, 24, 39, .2); --text2: #2E333B; --text3: #3F4550; }
}

/* ---------- связи между задачами «после этой — эта» (этап 9б; вид — 19.10, links.js) ----------
   В покое линий нет: на верхнем крае карточки значок-цепочка с числом связей, красный — порядок нарушен. Навели на карточку
   или выбрали её — её линии (под карточками, с миниатюрным треугольником на конце), связанные карточки обведены и подписаны «до неё» / «после
   неё». «Все связи» — все линии бледно. Наведёшь на линию — красная (нажать — убрать). У карточки под мышью — четыре точки:
   тянуть к другой карточке. На телефоне точек нет — цепочка видна в задаче. */
:root { --link: rgba(245, 245, 247, .82); --link-label-bg: #F5F5F7; --link-label-text: #16181D; }
[data-theme="light"] { --link: rgba(22, 24, 29, .72); --link-label-bg: #1A1C21; --link-label-text: #FFFFFF; }
.lanes { position: relative; }
.lanes > svg.links { position: absolute; left: 0; top: 0; z-index: 1; overflow: visible; pointer-events: none; }
.link-line { fill: none; stroke: var(--link); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: opacity .15s var(--ease-out); }
.link.bad .link-line { stroke: var(--danger); }
.link-head { fill: var(--link); transition: opacity .15s var(--ease-out); }
.link.bad .link-head, .link.del .link-head { fill: var(--danger); }
.link-hit { fill: none; stroke: transparent; stroke-width: 14; pointer-events: stroke; cursor: pointer; }
.link.del .link-line { stroke: var(--danger); stroke-width: 3; }
.lanes.links-all .link .link-line { stroke-width: 1.75; opacity: .85; }           /* «Все стрелки»: видны чётко */
.lanes.links-all .link .link-head { opacity: .85; }
.lanes.links-all .link.bad :is(.link-line, .link-head) { opacity: 1; }
.lanes.links-all.links-focus .link :is(.link-line, .link-head) { opacity: .15; }
.lanes.links-all.links-focus .link.hot :is(.link-line, .link-head) { opacity: 1; }
.lanes.links-all.links-focus .link.hot .link-line { stroke-width: 2.25; }
.lanes.links-all .link.del :is(.link-line, .link-head) { opacity: 1; }
.lanes.links-all .link.del .link-line { stroke-width: 3; }
.link.temp .link-line { stroke: var(--accent); stroke-dasharray: 5 4; }
.lanes.linking, .lanes.linking * { cursor: crosshair !important; -webkit-user-select: none; user-select: none; }
.lanes.linking .link-hit, .lanes.linking .link-dot { pointer-events: none; }
.link-dots { position: absolute; left: 0; top: 0; z-index: 3; width: 0; height: 0; }
.link-dot { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #fff;
  border: 2px solid var(--accent); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); cursor: crosshair; touch-action: none;
  transition: transform .15s var(--ease-out), background-color .15s var(--ease-out); animation: fade-in .15s var(--ease-out); }
.link-dot::before { content: ""; position: absolute; inset: -7px; border-radius: 50%; }
@media (hover: hover) { .link-dot:hover { transform: scale(1.3); } }
.link-dot.on { transform: scale(1.3); background: var(--accent); }
.link-label { position: absolute; height: 18px; padding: 0 7px; margin-top: -15px;     /* над краем карточки, номер не закрывает */ border-radius: 9px; background: var(--link-label-bg);
  color: var(--link-label-text); font-size: 11px; line-height: 18px; font-weight: 700; white-space: nowrap; pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3); animation: fade-in .15s var(--ease-out); }
.link-label.bad { background: var(--danger); color: #fff; }
/* значок-цепочка — метка на верхнем крае карточки справа; красный — порядок нарушен */
.hc-link { position: absolute; top: -9px; right: 8px; height: 16px; padding: 0 5px 0 4px; border-radius: 8px; background: #2C2E33; color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35); display: inline-flex; align-items: center; gap: 2px; font-size: 10px; line-height: 16px;
  font-weight: 700; font-variant-numeric: tabular-nums; }
.hc-link svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.hc-link.bad { background: #C62828; }
.hcard.link-focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.hcard.link-peer { outline: 2px solid var(--link); outline-offset: 2px; }
.hcard.link-peer.link-badpeer { outline-color: var(--danger); }
.hcard.link-far { outline: 1.5px solid var(--link); outline-offset: 2px; }               /* дальнее звено цепочки */
.lane-cell .hcard { transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out), opacity .15s var(--ease-out); }
.hcard.link-dim { opacity: .35; }                                                        /* не из цепочки — бледнее */
.hcard.link-target { outline: 2px dashed var(--accent); outline-offset: 2px; }
.lg-hint { margin-left: auto; color: var(--text3); }
/* экран задачи: «До неё» / «После неё» */
.chain-row { display: flex; align-items: center; gap: 4px; padding: 4px 8px 4px 4px; }
.chain-row + .chain-row { border-top: 1px solid var(--sep); }
.chain-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px; border: 0;
  border-radius: 14px; background: none; text-align: left; }
@media (hover: hover) { .chain-open:hover { background: var(--sub-hover); } }
.chain-num { flex: none; font-size: 12px; font-weight: 600; color: var(--text3); }
.chain-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chain-row.done .chain-title { text-decoration: line-through; color: var(--text3); }
.chain-done { flex: none; width: 16px; height: 16px; color: var(--ok); }
/* План созвона (21.10, call-plan.js): чей план — строкой под заголовком, карандаш — рядом с «Закрыть»; шаги с отметкой
   слева, пояснения — мелко под шагом, пройденный — зачёркнут */
.cp-edit { margin-left: auto; margin-right: -4px; }
.cp-scope { margin: -4px 8px 4px; font-size: 12.5px; color: var(--text3); }
.cp-row { align-items: flex-start; }
.cp-row .ep-check { margin-top: 1px; }
.cp-text { display: block; }
.cp-note { display: block; margin-top: 3px; font-size: 12.5px; color: var(--text3); }
.cp-row.done .cp-text { text-decoration: line-through; color: var(--text3); }
/* правка полями (22.10): шаг — ручка, номер, поле, «пояснение» и «убрать» (видны у строки под курсором и в фокусе);
   пояснения — со сдвигом под текстом шага; строка в фокусе вдавлена, как поля формы задачи */
.cp-ed { position: relative; margin-bottom: 0; }
.cp-step { position: relative; padding: 4px 6px 4px 4px; border-top: 1px solid var(--sep); background: transparent; }
.cp-step:first-child { border-top: 0; }
.cp-line { display: flex; align-items: flex-start; gap: 4px; border-radius: 12px; transition: background-color .15s var(--ease-out), box-shadow .15s var(--ease-out); }
.cp-line:focus-within { background: var(--glc-well, var(--field)); box-shadow: var(--glc-well-shade, none), inset 0 0 0 1px var(--accent-text); }
.cp-sub { margin-left: 46px; }
.cp-grip, .cp-grip-gap { flex: none; width: 18px; height: 34px; }
.cp-grip { display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--text3);
  cursor: grab; opacity: 0; touch-action: none; transition: opacity .15s; }
.cp-grip .ico { width: 14px; height: 14px; }
.cp-step:hover .cp-grip, .cp-grip:focus-visible, .cp-step.dragging .cp-grip { opacity: 1; }
.cp-grip:hover { color: var(--text2); background: rgba(127, 127, 127, .14); }
.cp-num { flex: none; min-width: 20px; padding-top: 8px; font-size: 14px; line-height: 18px; color: var(--text3); font-variant-numeric: tabular-nums; }
.cp-dash { flex: none; width: 14px; padding: 6px 0 0 8px; box-sizing: content-box; font-size: 13px; line-height: 18px; color: var(--text3); }
.cp-in { flex: 1; min-width: 0; display: block; height: 34px; padding: 8px 6px; border: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 14.5px; line-height: 18px; resize: none; outline: none; overflow: hidden; }
.cp-sub .cp-in { height: 30px; padding: 6px 6px; font-size: 13px; color: var(--text2); }
.cp-btn { flex: none; width: 30px; height: 34px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 10px;
  background: none; color: var(--text3); opacity: 0; transition: opacity .15s; }
.cp-sub .cp-btn { height: 30px; }
.cp-btn .ico { width: 15px; height: 15px; }
.cp-line:hover .cp-btn, .cp-line:focus-within .cp-btn, .cp-btn:focus-visible { opacity: 1; }
@media (hover: hover) { .cp-btn:hover { color: var(--text); background: var(--sub-hover); } }
@media (hover: none) { .cp-grip, .cp-btn { opacity: .6; } }
.cp-add { gap: 8px; padding: 11px 14px; border-top: 1px solid var(--sep); border-bottom: 0; }
.cp-add .ico { width: 15px; height: 15px; color: var(--accent-text); }
.cp-step.dragging { z-index: 3; border-radius: 14px; border-top-color: transparent; background: var(--sheet-bg);
  box-shadow: 0 0 0 1px var(--sub-border), 0 12px 28px rgba(0, 0, 0, .3); }
.cp-step.dragging + .cp-step { border-top-color: transparent; }
body.cp-drag, body.cp-drag * { cursor: grabbing !important; user-select: none; }
.cp-reset { margin-right: auto; padding: 0; font-size: 13.5px; }
