/* Кабинет офиса «Объектив» — Sprint 94: точная реализация дизайн-handoff.
   Один связный слой на токенах /shared/base.css (источник: docs/design/design-tokens.css).
   Эталоны: docs/design/reference/{object-prototype,object-flow,checklists-1c}.dc.html. */

* { box-sizing: border-box; }

/* Атрибут hidden обязан скрывать элемент, даже когда класс задаёт display
   (.workspace/.wizard/.topsearch и др. — flex). Без этого «экраны»-секции
   (мастер создания объекта, ручная форма) не прячут список и открываются
   ниже него, за пределами экрана. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink);
  background: var(--bg-canvas);
}

/* ===== Топбар ===== */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand svg { flex: none; }
.brand span { font-size: 14px; font-weight: 600; }
.brand small { font-size: 12px; font-weight: 400; color: var(--text-muted); white-space: nowrap; }
.topsearch {
  display: flex; align-items: center; gap: 8px;
  width: 280px; height: 32px; padding: 0 10px;
  border: 1px solid var(--border); background: var(--surface-sunken); border-radius: 6px;
  transition: border-color .12s, box-shadow .12s;
}
.topsearch:focus-within { border-color: #7D9FBE; box-shadow: 0 0 0 2px #DCE8F2; }
.topsearch input {
  flex: 1; min-width: 0; border: 0; background: none; padding: 0;
  font: inherit; font-size: 13px; color: var(--ink);
}
.topsearch input::placeholder { color: var(--text-muted); }
.topsearch svg { flex: none; color: var(--text-muted); }
.topuser { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.topuser .who { font-size: 12.5px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: #D9DCE0; color: #5A616A;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
}
.topbar button.link { color: var(--text-secondary); }

.devnote {
  background: var(--status-warn-tint);
  color: var(--status-warn);
  font-size: var(--text-sm);
  padding: 5px 20px;
  border-bottom: 1px solid var(--status-warn-border);
}

/* ===== Каркас: сайдбар + рабочая область ===== */
main { min-height: calc(100vh - 51px); }
.workspace { display: flex; align-items: stretch; min-height: calc(100vh - 51px); }
.shell-sidebar {
  flex: none; width: 184px;
  background: var(--surface-sunken);
  border-right: 1px solid #E3E5E8;
  padding: 12px 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.shell-nav { display: flex; flex-direction: column; gap: 2px; }
.shell-nav-item {
  display: flex; align-items: center; gap: 8px;
  text-align: left; font: inherit; font-size: 13px; color: var(--text-secondary);
  background: none; border: 1px solid transparent; border-left: 3px solid transparent;
  border-radius: 6px; padding: 7px 10px; cursor: pointer;
}
/* Иконка раздела — inline-SVG маска в CSS, а не узел в разметке: кнопка
   остаётся простой подписью, а сворачивание не зависит от состава и порядка
   разделов. Раздел без своего правила получает эту запасную иконку и работает
   наравне с остальными. */
.shell-nav-item::before {
  content: ""; flex: none; width: 16px; height: 16px;
  background-color: currentColor;
  mask-repeat: no-repeat; -webkit-mask-repeat: no-repeat;
  mask-position: center; -webkit-mask-position: center;
  mask-size: contain; -webkit-mask-size: contain;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='10' height='10' rx='2.2'/%3E%3Ccircle cx='8' cy='8' r='1.4' fill='%23000' stroke='none'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='10' height='10' rx='2.2'/%3E%3Ccircle cx='8' cy='8' r='1.4' fill='%23000' stroke='none'/%3E%3C/svg%3E");
}
#navDash::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.4 7.2 8 2.6l5.6 4.6'/%3E%3Cpath d='M3.8 8.2v5h8.4v-5'/%3E%3Cpath d='M6.6 13.2V9.6h2.8v3.6'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.4 7.2 8 2.6l5.6 4.6'/%3E%3Cpath d='M3.8 8.2v5h8.4v-5'/%3E%3Cpath d='M6.6 13.2V9.6h2.8v3.6'/%3E%3C/svg%3E");
}
#navProjects::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.6 13.4V3.4h5.6v10'/%3E%3Cpath d='M8.2 13.4V6.8h5v6.6'/%3E%3Cpath d='M1.8 13.4h12.4'/%3E%3Cpath d='M4.6 5.6h1.6M4.6 8.2h1.6M10.2 9.6h1.4'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.6 13.4V3.4h5.6v10'/%3E%3Cpath d='M8.2 13.4V6.8h5v6.6'/%3E%3Cpath d='M1.8 13.4h12.4'/%3E%3Cpath d='M4.6 5.6h1.6M4.6 8.2h1.6M10.2 9.6h1.4'/%3E%3C/svg%3E");
}
#navMessenger::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.2 3.2h11.6v8H7l-3.4 2v-2H2.2z'/%3E%3Cpath d='M4.8 6h6.4M4.8 8.5h4.4'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.2 3.2h11.6v8H7l-3.4 2v-2H2.2z'/%3E%3Cpath d='M4.8 6h6.4M4.8 8.5h4.4'/%3E%3C/svg%3E");
}
#navClients::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='5.4' r='2.6'/%3E%3Cpath d='M3.2 13.3c0-2.5 2.1-4.1 4.8-4.1s4.8 1.6 4.8 4.1'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='5.4' r='2.6'/%3E%3Cpath d='M3.2 13.3c0-2.5 2.1-4.1 4.8-4.1s4.8 1.6 4.8 4.1'/%3E%3C/svg%3E");
}
#navTasks::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.4 4.4 3.6 5.6 5.8 3.2'/%3E%3Cpath d='M2.4 9.4 3.6 10.6 5.8 8.2'/%3E%3Cpath d='M8 4.6h5.6M8 9.6h5.6'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.4 4.4 3.6 5.6 5.8 3.2'/%3E%3Cpath d='M2.4 9.4 3.6 10.6 5.8 8.2'/%3E%3Cpath d='M8 4.6h5.6M8 9.6h5.6'/%3E%3C/svg%3E");
}
#navVisits::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 14s4.4-4.3 4.4-7A4.4 4.4 0 0 0 3.6 7c0 2.7 4.4 7 4.4 7z'/%3E%3Ccircle cx='8' cy='6.9' r='1.7'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 14s4.4-4.3 4.4-7A4.4 4.4 0 0 0 3.6 7c0 2.7 4.4 7 4.4 7z'/%3E%3Ccircle cx='8' cy='6.9' r='1.7'/%3E%3C/svg%3E");
}
#navEmployees::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='6.2' cy='6' r='2.4'/%3E%3Cpath d='M1.8 13.2c0-2.2 2-3.6 4.4-3.6s4.4 1.4 4.4 3.6'/%3E%3Cpath d='M10.8 4c1.3 0 2.2.9 2.2 2.1s-.9 2.1-2.2 2.1'/%3E%3Cpath d='M12 9.8c1.4.4 2.2 1.5 2.2 3'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='6.2' cy='6' r='2.4'/%3E%3Cpath d='M1.8 13.2c0-2.2 2-3.6 4.4-3.6s4.4 1.4 4.4 3.6'/%3E%3Cpath d='M10.8 4c1.3 0 2.2.9 2.2 2.1s-.9 2.1-2.2 2.1'/%3E%3Cpath d='M12 9.8c1.4.4 2.2 1.5 2.2 3'/%3E%3C/svg%3E");
}
#navSubs::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='5.2' width='12' height='8' rx='1.4'/%3E%3Cpath d='M6 5.2V3.8h4v1.4'/%3E%3Cpath d='M2 8.6h12'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='5.2' width='12' height='8' rx='1.4'/%3E%3Cpath d='M6 5.2V3.8h4v1.4'/%3E%3Cpath d='M2 8.6h12'/%3E%3C/svg%3E");
}
#navCompany::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.2 6.6 8 3.2l5.8 3.4'/%3E%3Cpath d='M3.8 7.4v5M6.6 7.4v5M9.4 7.4v5M12.2 7.4v5'/%3E%3Cpath d='M2.4 13.4h11.2'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.2 6.6 8 3.2l5.8 3.4'/%3E%3Cpath d='M3.8 7.4v5M6.6 7.4v5M9.4 7.4v5M12.2 7.4v5'/%3E%3Cpath d='M2.4 13.4h11.2'/%3E%3C/svg%3E");
}
#navAnalytics::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.4 13.4h11.2'/%3E%3Cpath d='M4.6 13V8.4M8 13V3.6M11.4 13V6.4'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.4 13.4h11.2'/%3E%3Cpath d='M4.6 13V8.4M8 13V3.6M11.4 13V6.4'/%3E%3C/svg%3E");
}
#navLog::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.4 2.6h9.2v10.8H3.4z'/%3E%3Cpath d='M5.6 5.4h4.8M5.6 8h4.8M5.6 10.6h3'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.4 2.6h9.2v10.8H3.4z'/%3E%3Cpath d='M5.6 5.4h4.8M5.6 8h4.8M5.6 10.6h3'/%3E%3C/svg%3E");
}
.shell-nav-item:hover { background: none; color: var(--ink); }
.shell-nav-item.active {
  font-weight: 600; color: var(--ink);
  background: var(--surface);
  border: 1px solid #E0E2E5; border-left: 3px solid var(--accent);
}
.shell-nav-item:disabled { color: var(--text-disabled); cursor: default; }
.shell-nav-item:disabled:hover { color: var(--text-disabled); background: none; }
.shell-sidebar-note { margin-top: auto; padding: 5px 13px; font-size: 11px; color: var(--text-muted); line-height: 1.45; }

/* ---- Сворачивание панели ----
   Свёрнутая панель — колонка настоящей ширины, а не слой поверх содержимого:
   рабочая область получает освободившееся место, вёрстка не перекрывается и
   горизонтальная прокрутка не появляется. */
.shell-collapse {
  display: flex; align-items: center; gap: 8px;
  font: inherit; font-size: 12px; color: var(--text-muted);
  background: none; border: 1px solid transparent; border-radius: 6px;
  padding: 6px 10px; margin-bottom: 4px; cursor: pointer;
}
.shell-collapse:hover { color: var(--ink); border-color: #E0E2E5; background: var(--surface); }
.shell-collapse-icon { flex: none; }
.shell-sidebar.collapsed { width: 52px; padding: 12px 6px; }
/* gap: 0 — иначе зазор до сжатой подписи сдвигал бы иконку из центра колонки. */
.shell-sidebar.collapsed .shell-nav-item,
.shell-sidebar.collapsed .shell-collapse {
  justify-content: center; gap: 0; padding-left: 0; padding-right: 0;
}
.shell-sidebar.collapsed .shell-collapse-icon { transform: scaleX(-1); }
.shell-sidebar.collapsed .shell-sidebar-note { display: none; }
/* Подпись не удаляется и не прячется display: none — она остаётся в дереве
   доступности, поэтому у свёрнутой кнопки сохраняется имя для скринридера и
   голосового управления. Иконка (::before) задана в пикселях и от font-size не
   зависит, поэтому остаётся видимой. */
.shell-sidebar.collapsed .shell-nav-item,
.shell-sidebar.collapsed .shell-collapse-label { font-size: 0; }
.shell-sidebar.collapsed .shell-nav-item::before { font-size: 13px; }
.workarea { flex: 1; min-width: 0; padding: 16px 24px; }

/* ===== Вход ===== */
.login {
  max-width: 460px; margin: 40px auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 20px 22px;
}
.login h2 { margin: 0 0 6px; font-size: 18px; }
.login p { color: var(--text-secondary); margin: 0 0 14px; }
.loginrow { display: flex; gap: 8px; }
.loginrow input { flex: 1; }

input[type="text"], input[type="date"], input[type="datetime-local"], select, textarea {
  font: inherit; font-size: 12.5px; color: var(--ink);
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface);
}

button {
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  height: 34px; padding: 0 15px;
  border: none; background: var(--accent); color: var(--on-accent); border-radius: 6px;
}
button:hover { background: var(--accent-hover); }
button:disabled { opacity: .55; cursor: default; }
button.secondary, .secondary-button {
  height: 32px; padding: 0 13px;
  font-size: 12.5px; font-weight: 500;
  background: var(--surface); color: var(--ink); border: 1px solid var(--border);
}
button.secondary:hover, .secondary-button:hover, button.secondary.active { background: var(--surface-sunken); }
button.link {
  height: auto; padding: 0; font-size: 12.5px; font-weight: 400;
  background: none; border: none; color: var(--text-secondary); text-decoration: none;
}
button.link:hover { background: none; color: var(--ink); }
button.link.primary { color: var(--accent); font-weight: 500; }
button.link.primary:hover { color: var(--accent-hover); }
button.danger { background: var(--status-danger); }
button.danger:hover { background: var(--status-danger); opacity: .9; }
.danger-link { color: var(--status-danger) !important; }
.icon-button, .iconbtn {
  width: 32px; height: 32px; flex: none; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: 6px; font-size: 16px; font-weight: 400; line-height: 1;
}
.icon-button:hover, .iconbtn:hover { background: var(--surface-sunken); color: var(--ink); }

/* ===== Чипы статусов (outline) и мягкие pill ===== */
.chip-status {
  display: inline-flex; align-items: center; padding: 3px 8px;
  border: 1px solid var(--status-neutral-border); color: var(--status-neutral);
  background: var(--surface); border-radius: 4px; font-size: 12px; font-weight: 500; white-space: nowrap;
}
.chip-status.ok { border-color: var(--status-ok-border); color: #2E6B4C; }
.chip-status.warn { border-color: var(--status-warn-border); color: var(--status-warn); }
.chip-status.danger { border-color: var(--status-danger-border); color: var(--status-danger); }
.chip-status.info { border-color: var(--status-info-border); color: var(--status-info); }
.pill { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 999px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.pill.ok { background: var(--status-ok-tint); color: #2E6B4C; }
.pill.warn { background: var(--status-warn-tint); color: #8F6209; }
.pill.neutral { background: var(--surface-sunken); color: var(--status-neutral); }
.pill.accent { background: var(--accent-tint); color: var(--accent-hover); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { background: var(--surface-sunken); color: var(--text-secondary); border-radius: 999px; padding: 2px 9px; font-size: 12px; white-space: nowrap; }

/* ===== Список объектов ===== */
.listhead { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.listhead h1 { margin: 0; font-size: 18px; font-weight: 700; }
.listhead h1 span { color: var(--text-muted); font-weight: 400; font-size: 15px; }
.list-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-chip {
  height: 32px; padding: 0 11px; font-size: 12.5px; color: var(--text-secondary);
  border: 1px solid var(--border); background: var(--surface); border-radius: 6px;
}
.projects-table { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.pt-head, .pt-row {
  display: grid;
  grid-template-columns: 2.1fr 1.1fr 1fr 1.5fr 0.8fr 0.3fr;
  gap: 12px; align-items: center; padding: 9px 16px;
}
.pt-head { border-bottom: 1px solid var(--border-soft); }
.pt-head span { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.pt-row { padding: 11px 16px; border-bottom: 1px solid var(--divider); cursor: pointer; }
.pt-row:last-child { border-bottom: none; }
.pt-row:hover { background: #FBFAF9; }
.pt-name { font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.pt-addr { font-size: 12.5px; color: var(--text-muted); margin-top: 1px; overflow-wrap: anywhere; }
.pt-cell { font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
.pt-cell small { display: block; font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.pt-cell.muted { color: var(--text-muted); }
.pt-menu { justify-self: end; color: var(--text-muted); background: none; border: none; height: auto; padding: 4px 6px; font-weight: 400; font-size: 14px; }
.pt-menu:hover { background: var(--surface-sunken); color: var(--ink); border-radius: 6px; }
.list-footnote { margin-top: 8px; font-size: 12px; color: var(--text-muted); }

/* ===== Пустые/ошибочные/загрузочные состояния ===== */
.empty-state {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 26px 20px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.empty-state .tile {
  width: 38px; height: 38px; border: 1.5px dashed var(--text-disabled); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 18px;
}
.empty-state.error .tile { border: 1.5px solid var(--status-danger-border); color: var(--status-danger); }
.empty-state b { font-size: 13.5px; font-weight: 600; }
.empty-state p { margin: 0; font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.empty-state button { margin-top: 8px; height: 32px; font-size: 12.5px; }
.empty-inline { padding: 10px 0; font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
/* Эмпти-стейт списка объектов (дизайн «настройки-компании», экран 04) */
.empty-objects {
  background: none; border: none; border-radius: 0;
  max-width: 560px; margin: 48px auto 0; padding: 0 0 32px; gap: 0;
}
.empty-objects > svg { opacity: .9; }
.empty-objects > b { font-size: 18px; font-weight: 700; margin-top: 16px; }
.empty-objects .empty-lead {
  font-size: 14px; color: var(--text-secondary); line-height: 1.55;
  margin-top: 6px; max-width: 420px; text-wrap: pretty;
}
.empty-objects .empty-create {
  height: 44px; padding: 0 22px; font-size: 14.5px; font-weight: 600;
  border-radius: 6px; margin-top: 20px;
}
.empty-objects .empty-minute { font-size: 12.5px; color: var(--text-muted); margin-top: 10px; }
.empty-objects .empty-steps { display: flex; align-items: stretch; margin-top: 36px; width: 100%; }
.empty-objects .empty-step { flex: 1; padding: 0 14px; }
.empty-objects .empty-step-head { display: flex; align-items: center; gap: 8px; justify-content: center; }
.empty-objects .empty-step-head i {
  font-family: ui-monospace, Menlo, monospace; font-style: normal;
  font-size: 13px; font-weight: 700; color: var(--accent);
}
.empty-objects .empty-step-head b { font-size: 13px; font-weight: 600; }
.empty-objects .empty-step p { margin: 4px 0 0; font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.empty-objects .empty-sep { width: 1px; background: #E3E5E8; flex: none; }
.skeleton { height: 8px; border-radius: 4px; background: var(--divider); margin: 8px 0; }
.skeleton.w2 { width: 64%; background: #F4F5F6; }
.spinner {
  display: inline-block; width: 14px; height: 14px; border-radius: 50%;
  border: 2.5px solid var(--accent-tint); border-top-color: var(--accent);
  animation: spin .8s linear infinite; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error { color: var(--status-danger); font-size: 12.5px; min-height: 1em; margin: 4px 0; }

/* ===== Карточка объекта — отдельная страница ===== */
.workspace.object-open .list { display: none; }
.card { flex: 1; min-width: 0; }
.crumb { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.crumb button { height: auto; padding: 0; font: inherit; font-size: 12px; color: var(--text-muted); background: none; border: none; font-weight: 400; }
.crumb button:hover { color: var(--accent); background: none; }
.object-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.object-title-row { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.object-title-row h1 { margin: 0; font-size: 20px; font-weight: 700; overflow-wrap: anywhere; }
.object-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; overflow-wrap: anywhere; }
.object-head-actions { position: relative; margin-left: auto; display: flex; align-items: center; gap: 8px; }
.avatar-stack { display: flex; align-items: center; }
.avatar-stack .avatar { border: 2px solid var(--bg-canvas); margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-stack .avatar:nth-child(2n) { background: #CBD4DC; }
.avatar-stack .avatar:nth-child(3n) { background: #D9D3CB; }
.object-tabs { display: flex; gap: 2px; border-bottom: 1px solid #E3E5E8; margin-top: 12px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.object-tabs::-webkit-scrollbar { display: none; }
.object-tabs button {
  flex: none; height: auto; font-size: 13px; font-weight: 400; color: var(--text-secondary);
  padding: 8px 12px; border: none; background: none; border-radius: 0;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.object-tabs button:hover { background: none; color: var(--ink); }
.object-tabs button.active { font-weight: 600; color: var(--ink); border-bottom-color: var(--accent); }
.object-tabs button span { color: var(--text-muted); font-weight: 400; margin-left: 4px; }
.object-tabs button .tabbadge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 4px; margin-left: 5px;
  background: var(--status-warn-tint); color: #8F6209; border-radius: 999px; font-size: 10.5px; font-weight: 700;
}
.cardbody { padding: 14px 0 28px; }
.object-tab-panel[hidden] { display: none; }
.cardsection { min-width: 0; }
.cardsectionbody { min-width: 0; }

/* Карточки-панели */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.panel + .panel { margin-top: 16px; }
.panel-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.panel-title .alllink { margin-left: auto; font-size: 12.5px; font-weight: 500; color: var(--accent); background: none; border: none; height: auto; padding: 0; }
.panel-title .alllink:hover { color: var(--accent-hover); background: none; }
.section-label { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); margin: 16px 0 8px; }

/* Обзор */
.overview-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 16px; align-items: flex-start; }
.overview-main, .overview-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.timeline-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; position: relative; }
.timeline-node { flex: none; width: 12px; height: 12px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface); }
.timeline-row.done .timeline-node { background: var(--status-ok); border-color: var(--status-ok); }
.timeline-row.current .timeline-node { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.timeline-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.timeline-row.future .timeline-title { font-weight: 400; color: var(--text-secondary); }
.timeline-meta { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.reportline { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--divider); cursor: pointer; }
.reportline:last-child { border-bottom: none; }
.reportline:hover { background: #FBFAF9; }
.report-thumb { flex: none; width: 44px; height: 33px; border-radius: 5px; background: repeating-linear-gradient(45deg, var(--divider), var(--divider) 4px, var(--surface-sunken) 4px, var(--surface-sunken) 8px); }
.reportline b { display: block; font-size: 13px; font-weight: 600; }
.reportline .rmeta { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.reportline > div { flex: 1; min-width: 0; }
.summary-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--divider); }
.summary-row:last-child { border-bottom: none; }
.summary-row span { font-size: 12.5px; color: var(--text-muted); }
.summary-row b { font-size: 13px; font-weight: 500; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.photo-grid img, .photo-grid .more {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; display: block;
}
.photo-grid .more { background: var(--surface-sunken); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: var(--text-secondary); }

/* Готовность объекта (новый объект) */
.object-success {
  display: flex; align-items: center; gap: 10px;
  background: #EFF5F1; border: 1px solid #CDE2D5; border-radius: 8px; padding: 11px 14px;
  font-size: 13px; color: #2E5A42;
}
.object-success .okmark { flex: none; width: 22px; height: 22px; border-radius: 999px; background: var(--status-ok); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.object-success button { margin-left: auto; }
.object-readiness .readiness-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.readiness-head b { font-size: 14px; font-weight: 700; }
.readiness-progress { flex: 1; max-width: 180px; height: 6px; border-radius: 3px; background: var(--divider); overflow: hidden; }
.readiness-progress i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.readiness-count { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); }
.readiness-note { margin-left: auto; font-size: 12px; color: var(--text-muted); }
.readiness-item { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid #F3F4F6; }
.readiness-item:last-child { border-bottom: none; }
.readiness-item.attention { background: #FDFBF6; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.readiness-mark { flex: none; width: 22px; height: 22px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; border: 1.5px solid #C9CDD2; color: var(--text-muted); }
.readiness-item.done .readiness-mark { background: var(--status-ok); border-color: var(--status-ok); color: #fff; }
.readiness-item.attention .readiness-mark { background: var(--status-warn); border-color: var(--status-warn); color: #fff; }
.readiness-item > div { flex: 1; min-width: 0; }
.readiness-item b { font-size: 13.5px; font-weight: 600; }
.readiness-item.done b { text-decoration: line-through; color: var(--text-secondary); font-weight: 500; }
.readiness-item small { display: block; font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.readiness-item button { flex: none; height: 30px; font-size: 12.5px; }

/* Сводка/строки карточки */
.project-summary { display: grid; gap: 0; }
.project-summary .row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--divider); }
.project-summary .row:last-child { border-bottom: none; }
.project-summary .row span:first-child { font-size: 12.5px; color: var(--text-muted); }
.project-summary .row span:last-child { font-size: 13px; font-weight: 500; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.internal-info-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 22px;
}
.overview-internal, .overview-summary { position: relative; }
.overview-internal > .panel-title, .overview-summary > .panel-title { padding-right: 42px; }
.internal-info-menu { position: absolute; top: 12px; right: 14px; }
.internal-info-menu-list { min-width: 180px; }
.internal-info-item {
  min-width: 0; min-height: 57px; padding: 8px 0; border: 0;
  border-bottom: 1px solid var(--divider); background: transparent;
  color: inherit; font-family: inherit; text-align: left;
}
.internal-info-item span { display: block; color: var(--text-muted); font-size: 12px; }
.internal-info-item b { display: block; margin-top: 4px; font-size: 13px; overflow-wrap: anywhere; }
.internal-info-field input, .internal-info-field select, .internal-info-field textarea {
  width: 100%; min-width: 0; margin-top: 4px; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface);
  color: var(--ink); font: inherit; font-size: 13px; padding: 7px 9px;
}
.internal-info-field textarea { resize: vertical; }
.internal-info-actions {
  grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; padding-top: 12px;
}
.overview-summary .internal-info-actions { grid-column: auto; }

/* Предложенные шаги */
.suggested { margin-top: 0; }
.suggestedrow { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--divider); }
.suggestedrow:last-child { border-bottom: none; }
.suggestedrow span:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.suggeststatus { color: var(--text-muted); font-size: 12px; white-space: nowrap; }

/* ===== Параметры ===== */
.params { min-width: 0; }
.paramnote { background: var(--status-warn-tint); color: var(--status-warn); border-radius: 6px; padding: 6px 10px; font-size: 12.5px; margin-bottom: 8px; }
.param-field { display: grid; grid-template-columns: minmax(150px, 200px) minmax(210px, 460px) minmax(90px, 1fr); align-items: center; gap: 8px 14px; padding: 10px 0; border-bottom: 1px solid #F3F4F6; }
.param-field > label { font-size: 13px; font-weight: 600; color: var(--ink); }
.param-field select, .param-multi > summary { width: 100%; min-height: 34px; font: inherit; font-size: 12.5px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.param-multi { min-width: 0; }
.param-multi > summary { cursor: pointer; list-style-position: inside; overflow-wrap: anywhere; }
.param-multi-choices { display: grid; gap: 7px; padding: 10px; border: 1px solid var(--border); border-top: 0; }
.param-multi-choices label { display: flex; align-items: center; gap: 7px; }
.param-custom { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 8px; }
.param-custom[hidden] { display: none; }
.param-custom input { min-width: 0; width: 100%; }
.param-save-state { color: #2E6B4C; font-size: 12px; min-height: 1em; }
.params .field { margin: 8px 0; display: flex; flex-direction: column; gap: 4px; }
.params label { font-size: 12.5px; color: var(--text-secondary); }
.params .checks { display: flex; flex-wrap: wrap; gap: 10px; }
.params .checks label { color: var(--ink); display: flex; align-items: center; gap: 5px; }
.params .formbtns { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.tzupload { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); }
.tzstatus { color: var(--text-muted); font-size: 12px; margin-top: 6px; min-height: 1em; }
.tzpreview { margin-top: 8px; }
.tzpreview button { margin-top: 8px; }
.tz-change-preview { display: grid; gap: 12px; }
.tz-change-table { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.tz-change-row {
  display: grid; grid-template-columns: 28px minmax(180px, 1.2fr) minmax(150px, 1fr) minmax(150px, 1fr);
  gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--divider);
  font-size: 13px;
}
.tz-change-row:last-child { border-bottom: 0; }
.tz-change-row.head { background: var(--surface-sunken); color: var(--text-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.tz-change-row small { display: block; color: var(--text-muted); margin-top: 2px; }
.tz-change-row input { margin: 0; }
.tz-change-reason { display: grid; gap: 5px; font-size: 13px; }
.tz-change-reason textarea { width: 100%; box-sizing: border-box; resize: vertical; }
.tz-change-modes, .tz-change-recipients { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.tz-change-modes label, .tz-change-recipients label, .tz-change-notify { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; }
.tz-change-recipients { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.tz-change-recipients > b { flex-basis: 100%; }
.tz-change-notify[hidden], .tz-change-recipients[hidden] { display: none; }

/* ===== Ручная форма (в мастере) ===== */
.newform .field { margin-bottom: 11px; display: flex; flex-direction: column; gap: 4px; }
.newform label { font-size: 12.5px; color: var(--text-secondary); }
.newform .checks { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 11px; }
.newform .checks label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.newform .formbtns { display: flex; align-items: center; gap: 12px; margin-top: 4px; }

/* ===== История/журнал ===== */
.activity { min-width: 0; }
.event { padding: 8px 6px; border-bottom: 1px solid var(--divider); cursor: pointer; border-radius: 6px; }
.event:last-child { border-bottom: none; }
.event:hover { background: #FBFAF9; }
.eventhead { font-size: 13px; font-weight: 600; }
.eventsummary { font-size: 12.5px; color: var(--text-muted); margin: 3px 0; }
.event .chips { margin-top: 4px; }
.audit { margin-top: 14px; border-top: 1px solid var(--divider); padding-top: 8px; }
.auditrow { display: flex; gap: 9px; align-items: baseline; font-size: 12.5px; color: var(--text-secondary); padding: 6px 0; border-bottom: 1px solid #F3F4F6; line-height: 1.45; }
.auditrow:last-child { border-bottom: none; }
.checkrow { font-size: 13px; padding: 4px 0; border-bottom: 1px dashed var(--divider); line-height: 1.4; }

/* ===== Документы ===== */
.documents { min-width: 0; }
.doc-drop {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border: 1.5px dashed #C9CDD2; border-radius: 8px; padding: 12px 14px; margin-bottom: 14px;
  font-size: 12.5px; color: var(--text-secondary); cursor: pointer;
}
.doc-drop:hover, .doc-drop.dragover { border-color: var(--accent); }
.doc-drop b { color: var(--accent); font-weight: 500; }
.doc-group { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.doc-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid #F3F4F6; }
.doc-row:last-child { border-bottom: none; }
.doc-type {
  flex: none; width: 30px; height: 30px; border: 1px solid #E0E2E5; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 9px; font-weight: 700; color: var(--status-info);
}
.doc-type.pdf { color: var(--status-danger); }
.document-info { flex: 1; min-width: 0; }
.document-info h4 { margin: 0; font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
.document-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.doc-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.doc-actions .link { font-size: 12px; }
.doc-menu { position: relative; }
/* Слой открытого ⋯-меню. position: fixed вместо absolute: карточка группы
   документов (.doc-group) и таблица объектов (.projects-table) заданы с
   overflow: hidden, и абсолютный слой резался их границей — нижние пункты
   становились недоступны, а больший z-index не помогал. Координаты считает
   positionMenuLayer() от кнопки и вьюпорта, поэтому left/top задаются из
   скрипта, а right/bottom сброшены, чтобы прежние правила с ними не спорили. */
.doc-menu-list {
  position: fixed; left: 0; top: 0; right: auto; bottom: auto;
  z-index: var(--z-dropdown, 1000);
  min-width: 220px; max-width: min(340px, calc(100vw - 16px));
  max-height: calc(100vh - 16px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow-md); padding: 6px; display: flex; flex-direction: column; gap: 2px;
}
.doc-menu-list button { height: auto; text-align: left; font-size: 12.5px; font-weight: 400; color: var(--ink); background: none; border: none; padding: 7px 9px; border-radius: 6px; }
.doc-menu-list button:hover { background: var(--surface-sunken); }
.docfilters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.docfilters input[type="text"] { flex: 1; min-width: 130px; }
.docmatch { font-size: 12px; color: var(--text-muted); padding: 2px 0 6px 4px; word-break: break-word; }
.docform { display: grid; grid-template-columns: minmax(150px, 220px) minmax(180px, 1fr) auto; align-items: center; gap: 8px; padding: 10px 0; }
.mediarow { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 18px; font-size: 13px; padding: 10px 0; border-bottom: 1px solid var(--divider); }
.mediaactions { display: flex; flex-wrap: wrap; gap: 8px 12px; min-width: 0; }
.visbadge { display: inline-block; margin: 8px 0; padding: 3px 10px; border-radius: 999px; font-size: 12px; background: var(--status-ok-tint); color: #2E6B4C; }
.visbadge.hidden { background: var(--status-warn-tint); color: var(--status-warn); }

.lightbox { position: fixed; inset: 0; background: rgba(28, 30, 34, .62); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: var(--z-overlay, 1200); }
.lightbox-box { background: var(--surface); border-radius: 10px; max-width: 92vw; max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; }
.lightbox-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 14px; border-bottom: 1px solid var(--divider); font-size: 13px; }
.lightbox-box img { max-width: 92vw; max-height: 82vh; object-fit: contain; display: block; background: var(--surface-sunken); }

/* ===== Участники ===== */
.members { min-width: 0; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #F3F4F6; }
.member-row:last-child { border-bottom: none; }
.inviterow { display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: 13px; padding: 9px 0; border-bottom: 1px dashed var(--divider); }
.inviteinfo { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.inviteinfo span { color: var(--text-muted); font-size: 12px; overflow-wrap: anywhere; }
.inviteactions, .invitesendactions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.inviteform { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: end; gap: 10px; margin-top: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-sunken); }
.invitefield { min-width: 0; display: flex; flex-direction: column; gap: 4px; color: var(--text-secondary); font-size: 12px; }
.invitefield input, .invitefield select { width: 100%; min-width: 0; }
.inviteform > button { grid-column: 1 / -1; justify-self: start; min-height: 34px; white-space: nowrap; }
.invitesend { margin-top: 10px; padding: 12px; border: 1px solid var(--status-ok-border); border-radius: 8px; background: var(--status-ok-tint); }
.invitesendsummary { margin: 3px 0 9px; color: var(--text-secondary); font-size: 13px; }
.invitehint { margin-top: 8px; color: var(--text-muted); font-size: 12px; }

/* ===== Контроль и выезды ===== */
.controlplan { margin: 4px 0 12px; background: var(--surface); }
.plantitle { font-weight: 600; word-break: break-word; font-size: 13.5px; }
.planmeta { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.planstages { margin: 8px 0 0; padding: 0; list-style: none; font-size: 13px; }
.planstages li { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid #F3F4F6; word-break: break-word; }
.planstages li:last-child { border-bottom: none; }
.planstages .plannum { font-family: var(--font-mono); font-size: 11px; color: var(--text-disabled); flex: none; width: 18px; }
.planstages .plancount { margin-left: auto; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.plannote { font-size: 13px; color: var(--text-muted); margin: 4px 0 12px; }
.srcbadge { font-size: 11px; color: var(--status-warn); background: var(--status-warn-tint); border-radius: 4px; padding: 1px 5px; }
.checklist-recommendation { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; padding: 11px 14px; border: 1px solid #CDE2D5; border-radius: 8px; background: #EFF5F1; font-size: 13px; line-height: 1.45; }
.checklist-recommendation span { color: #2E5A42; }
.checklist-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.checklist-saved { margin-top: 9px; font-size: 13px; }
.checklist-saved > summary { color: var(--text-secondary); cursor: pointer; }
.checklist-saved-row, .checklist-saved > div { display: flex; gap: 8px; margin-top: 8px; }
.checklist-saved select { min-width: 0; flex: 1; }
.tmpl-mgmt { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--divider); }
.tmpl-mgmt h4 { margin: 0 0 6px; font-size: 13px; }
.tmplrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 5px 0; }
.tmpllabel { flex: 1 1 100%; font-size: 12px; color: var(--text-muted); }
.tmplrow select, .tmplrow input { max-width: 100%; }
.draftedit { margin-top: 8px; padding: 8px; border: 1px dashed var(--border); border-radius: 8px; }
.drafthead { font-size: 12px; font-weight: 600; margin-bottom: 4px; word-break: break-word; }

.visits { margin-top: 14px; border-top: 1px solid var(--divider); padding-top: 10px; }
.visitnewform { background: var(--surface-sunken); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin: 8px 0; }
.visitfield { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text-secondary); margin-bottom: 8px; }
.visit-free-toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-secondary); }
.visit-free-toggle input { min-width: 0; width: 16px; height: 16px; margin: 0; }
.visitformbtns { display: flex; align-items: center; gap: 12px; }
.visitlist { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.visititem { display: block; width: 100%; height: auto; text-align: left; background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-weight: 400; }
.visititem:hover { background: #FBFAF9; }
.visititem.active { background: var(--accent-tint); border-color: var(--accent); }
.visititem-main { font-size: 13px; font-weight: 600; }
.visititem-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.visitdetail { margin-top: 10px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: var(--surface-sunken); }
.visitdetail-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.visitsubhead { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin: 12px 0 4px; font-weight: 600; }
.visitbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.visitnote { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.visittitle { font-weight: 600; margin: 10px 0 6px; }
.assignrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; padding: 4px 0; border-bottom: 1px dashed var(--divider); }
.assignform { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.assignform select { flex: 1; min-width: 150px; }
.visitstatusbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.visitbar select, .visitfield select, .assignform select { max-width: 100%; }

/* Sprint 111 (волна C): «Пакет выезда» + инлайн-планировщик выездов. */
.visit-package {
  margin-top: 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); padding: 10px 12px;
}
.vp-title { font-size: 12.5px; font-weight: 700; }
.vp-note { margin: 2px 0 8px; font-size: 11px; color: var(--text-muted); }
.vp-row { display: flex; gap: 10px; padding: 4px 0; border-top: 1px solid #F5F6F7; font-size: 12px; }
.vp-row.warn .vp-value { color: #A8730A; font-weight: 600; }
.vp-label { width: 110px; flex: none; color: var(--text-muted); }
.vp-value { flex: 1; min-width: 0; }
.vp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.vp-inline { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.visit-scheduler {
  margin: 10px 0; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-sunken); padding: 12px 14px;
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px;
}
.vsch-title { width: 100%; font-size: 13px; font-weight: 700; }
.vsch-field { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--text-muted); }
.vsch-field select, .vsch-field input { min-width: 170px; }
.visitresults { margin-top: 10px; }
.resultrow { border-left: 3px solid var(--border); padding: 4px 0 4px 8px; margin: 6px 0; }
.resultrow.s-pass { border-left-color: var(--status-ok); }
.resultrow.s-fail { border-left-color: var(--status-danger); }
.resultrow.s-not_applicable { border-left-color: var(--text-muted); }
.resulttitle { font-size: 13px; font-weight: 600; }
.resultcomment { font-size: 13px; color: var(--text-muted); margin-top: 2px; word-break: break-word; }
.resultphotos { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.visitreport { margin-top: 12px; border-top: 1px solid var(--divider); padding-top: 8px; }
.reportstatus { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 999px; margin: 4px 0; }
.reportstatus.pub { background: var(--status-ok-tint); color: #2E6B4C; }
.reportstatus.unpub { background: var(--surface-sunken); color: var(--text-muted); }
.reportdefect { font-size: 13px; color: var(--status-danger); padding: 2px 0 2px 8px; word-break: break-word; }
.clientvis-item { border: 1px solid var(--border-soft); border-radius: 6px; padding: 8px 10px; margin: 6px 0; }
.clientvis-cp { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.clientvis-cp input, .clientvis-media input { margin-top: 2px; flex: none; }
.clientvis-media { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); margin: 4px 0 0 22px; cursor: pointer; }
.clientvis-media input:disabled { cursor: not-allowed; }
.clientvis-hint { font-size: 12px; color: var(--text-muted); margin: 4px 0 0 22px; }

/* ===== Задачи и замечания ===== */
.defects { min-width: 0; }
.defectrow { display: flex; gap: 9px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid #F3F4F6; }
.defectrow:last-child { border-bottom: none; }
.defect-mark { flex: none; width: 20px; height: 20px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; margin-top: 1px; }
.defectrow.s-open .defect-mark { background: var(--status-danger-tint); color: var(--status-danger); }
.defectrow.s-fixed .defect-mark { background: var(--status-warn-tint); color: var(--status-warn); }
.defectrow.s-verified .defect-mark { background: var(--status-ok-tint); color: #2E6B4C; }
.defectrow > div { flex: 1; min-width: 0; }
.defecttitle { font-size: 13px; font-weight: 600; word-break: break-word; }
.defectrow.s-verified .defecttitle { text-decoration: line-through; color: var(--text-secondary); font-weight: 500; }
.defectmeta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.defectactions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }

/* ===== Мастер создания объекта ===== */
.create-choice { width: min(640px, calc(100vw - 32px)); border: none; border-radius: 10px; padding: 26px 28px; box-shadow: var(--shadow-lg); }
.create-choice::backdrop { background: rgba(28, 30, 34, 0.42); }
.create-choice h2 { margin: 0 0 4px; font-size: 19px; font-weight: 700; }
.create-choice-lead { margin: 0 0 16px; font-size: 13px; color: var(--text-secondary); }
.create-choice-close { position: absolute; top: 14px; right: 14px; border: none; background: none; }
.create-choice-inner { position: relative; }
.create-paths { display: flex; gap: 14px; align-items: stretch; }
.create-path { flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 18px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.create-path:hover { border-color: var(--text-disabled); }
.create-path.recommended { flex: 1.15; border: 2px solid var(--accent); background: #FDFBFA; }
.create-path .ribbon { position: absolute; top: -9px; left: 14px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.create-path .pathicon { width: 32px; height: 32px; border: 1px solid #E2CBB8; background: var(--accent-tint); border-radius: 6px; color: var(--accent-hover); display: flex; align-items: center; justify-content: center; font-size: 15px; }
.create-path:not(.recommended) .pathicon { background: var(--bg-canvas); border-color: #E0E2E5; color: var(--text-secondary); }
.create-path h3 { margin: 0; font-size: 15px; font-weight: 700; }
.create-path p { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--text-secondary); flex: 1; }
.create-path .pathmeta { font-size: 11.5px; color: var(--text-muted); }
.create-path button { height: 36px; }

.wizard { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg-canvas); }
.wizard-top { display: flex; align-items: center; gap: 18px; padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--border-soft); position: sticky; top: 0; z-index: var(--z-sticky); }
.wizard-top .wtitle { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; min-width: 0; }
.wizard-top .wtitle small { font-weight: 400; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.wizard-steps { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.wstep { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.wstep i { font-style: normal; width: 22px; height: 22px; border-radius: 999px; display: flex; align-items: center; justify-content: center; background: var(--surface); border: 1.5px solid var(--border); color: var(--text-muted); font-size: 11.5px; }
.wstep.current { color: var(--ink); }
.wstep.current i { background: var(--accent); border-color: var(--accent); color: #fff; }
.wstep.done { color: var(--ink); }
.wstep.done i { background: var(--status-ok); border-color: var(--status-ok); color: #fff; }
.wconnector { width: 26px; height: 1.5px; background: var(--border); }
.wconnector.done { background: var(--status-ok); }
.wizard-exit { font-size: 12.5px; color: var(--text-secondary); background: none; border: none; height: auto; padding: 0; font-weight: 400; }
.wizard-exit:hover { background: none; color: var(--ink); }
.wizard-body { flex: 1; width: 100%; }
.wizard-body.narrow { max-width: 720px; margin: 0 auto; padding: 34px 24px 30px; }
.wizard-body.wide { max-width: 1120px; margin: 0 auto; padding: 26px 24px 24px; display: flex; gap: 20px; align-items: flex-start; }
.wizard-main { flex: 1.7; min-width: 0; }
.wizard-aside { width: 300px; flex: none; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 76px; }
.wizard-foot { display: flex; align-items: center; gap: 14px; padding: 12px 20px; background: var(--surface); border-top: 1px solid var(--border-soft); position: sticky; bottom: 0; }
.wizard-foot .whint { margin-left: auto; font-size: 12px; color: var(--text-muted); }
.wizard-foot .primary-next { height: 38px; }
.wizard-h1 { margin: 0 0 6px; font-size: 20px; font-weight: 700; }
.wizard-sub { margin: 0 0 18px; font-size: 13.5px; line-height: 1.5; color: var(--text-secondary); }

.dropzone {
  border: 1.5px dashed #C9CDD2; border-radius: 8px; background: var(--surface); padding: 30px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; cursor: pointer;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); }
.dropzone .dropicon { width: 44px; height: 44px; border: 1px solid #E2CBB8; background: var(--accent-tint); border-radius: 8px; color: var(--accent-hover); display: flex; align-items: center; justify-content: center; font-size: 19px; }
.dropzone b { font-size: 14.5px; font-weight: 600; }
.dropzone b span { color: var(--accent); }
.dropzone small { font-size: 12px; color: var(--text-muted); }
.filecard { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-top: 14px; }
.filerow { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--divider); }
.filerow:last-child { border-bottom: none; }
.filerow .doc-type { width: 32px; height: 32px; }
.filerow > div { flex: 1; min-width: 0; }
.filerow b { display: block; font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.filerow small { font-size: 12px; color: var(--text-muted); }
.callout { display: flex; gap: 9px; align-items: flex-start; background: var(--status-info-tint); border: 1px solid var(--status-info-border); border-radius: 8px; padding: 10px 13px; margin-top: 14px; font-size: 12.5px; line-height: 1.5; color: #33546F; }
.callout i { font-style: normal; font-weight: 700; color: var(--status-info); }

.fieldcard { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-bottom: 14px; }
.fieldcard-label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.fieldcard input[type="text"] { width: 100%; height: 38px; font-size: 13.5px; font-weight: 500; }
.fieldcard input.needs-confirm { border: 1.5px solid #E2CBA0; background: #FDFBF6; }
.provenance { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); margin-top: 6px; overflow-wrap: anywhere; }
.candidates { border: 1px solid var(--border-soft); border-radius: 6px; margin-top: 8px; overflow: hidden; }
.candidate { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--divider); cursor: pointer; }
.candidate:last-child { border-bottom: none; }
.candidate.selected { background: var(--bg-canvas); }
.candidate > div { flex: 1; min-width: 0; font-size: 12.5px; }
.candidate .provenance { margin-top: 2px; }
.candidate .pickbtn { flex: none; font-size: 12.5px; font-weight: 500; color: var(--accent); background: none; border: none; height: auto; padding: 0; }
.paramcard-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.paramcard-head b { font-size: 13.5px; font-weight: 700; }
.found-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.found-row { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-bottom: 1px solid #F3F4F6; min-width: 0; }
.found-row .okdot { flex: none; width: 18px; height: 18px; border-radius: 999px; background: var(--status-ok); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; }
.found-row span { font-size: 13px; color: var(--text-secondary); }
.found-row b { font-size: 13px; font-weight: 600; margin-left: auto; text-align: right; overflow-wrap: anywhere; }
.review-row { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #FDFBF6; border: 1px solid #E2CBA0; border-radius: 6px; padding: 9px 10px; margin: 6px 0; }
.review-row .warndot { flex: none; width: 18px; height: 18px; border-radius: 999px; background: var(--status-warn); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.review-row > div { flex: 1; min-width: 160px; }
.review-row b { display: block; font-size: 13px; font-weight: 600; }
.review-row select { height: 32px; min-width: 150px; }
.review-row .confirmbtn { height: 30px; font-size: 12.5px; font-weight: 500; background: var(--surface); color: #2E6B4C; border: 1px solid var(--status-ok-border); }
.review-row .confirmbtn:hover { background: var(--status-ok-tint); }
.unknown-row { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid #F3F4F6; }
.unknown-row .nonedot { flex: none; width: 18px; height: 18px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface); }
.progresscard .bar { height: 6px; border-radius: 3px; background: var(--divider); overflow: hidden; margin: 8px 0; }
.progresscard .bar i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.progresscard .mono { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); }
.todoline { font-size: 12.5px; padding: 3px 0; color: var(--text-muted); }
.todoline.done { color: #2E6B4C; text-decoration: line-through; }
.todoline.warn { color: #8F6209; }
.sourcerow { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 12px; }
.sourcerow .doc-type { width: 26px; height: 26px; font-size: 8px; }
.autosave-note { background: var(--surface-sunken); border-radius: 8px; padding: 12px 14px; font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.autosave-note b { color: #2E6B4C; font-weight: 600; }

.radiocard { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 13px 14px; cursor: pointer; margin-bottom: 10px; }
.radiocard.selected { border: 2px solid var(--accent); background: #FDFBFA; padding: 12px 13px; }
.radiocard .radio { flex: none; width: 18px; height: 18px; border-radius: 999px; border: 1.5px solid #C9CDD2; background: var(--surface); margin-top: 1px; }
.radiocard.selected .radio { border: 5.5px solid var(--accent); }
.radiocard > div { flex: 1; min-width: 0; }
.radiocard b { font-size: 13.5px; font-weight: 600; }
.radiocard small { display: block; font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.togglerow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #F3F4F6; cursor: pointer; }
.togglerow:last-child { border-bottom: none; }
.togglerow > div { flex: 1; min-width: 0; }
.togglerow b { font-size: 13px; font-weight: 600; }
.togglerow small { display: block; font-size: 12px; color: var(--text-muted); }
.switch { flex: none; width: 34px; height: 20px; border-radius: 999px; background: var(--border); position: relative; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 999px; background: #fff; transition: left .15s; }
.switch.on { background: var(--status-ok); }
.switch.on::after { left: 16px; }
.summarycard .summary-row b { font-weight: 600; }

.intake-steps { display: none; }
.intakedoc { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--divider); font-size: 13px; }
.intakebucket { margin: 10px 0; }
.intakebucket h5 { margin: 6px 0; font-size: 13px; color: var(--text-muted); }
.intakebucket ul { margin: 4px 0 0 18px; font-size: 13px; color: var(--text-muted); }
.intakerow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 0; }
.intakerow span { font-size: 13px; }
.intakerow select { min-width: 180px; }
.intakeidentitymeta { margin-top: 5px; color: var(--text-muted); font-size: 12px; }
.intakeidentitymeta.found { color: #2E6B4C; }
.intakeidentitymeta.needs_review { color: var(--status-warn); }

/* ===== Бейджи (общие, поверх base.css) ===== */
.badge { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 999px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.badge.ok { background: var(--status-ok-tint); color: #2E6B4C; }
.badge.warn { background: var(--status-warn-tint); color: #8F6209; }
.badge.info { background: var(--status-info-tint); color: var(--status-info); }
.badge.danger { background: var(--status-danger-tint); color: var(--status-danger); }

/* ===== Редактор чек-листов (форма 1c) ===== */
.cl-screen { min-width: 0; }
.cl-crumb { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; font-size: 13px; color: var(--text-muted); }
.cl-crumb button { height: auto; padding: 0; font-size: 13px; font-weight: 400; color: var(--text-muted); background: none; border: none; }
.cl-crumb button:hover { color: var(--accent); background: none; }
.cl-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.cl-head h1 { margin: 0; font-size: 19px; font-weight: 700; }
.cl-meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); }
.cl-savestate { font-size: 12px; color: #2E6B4C; font-weight: 500; min-width: 90px; }
.cl-head-actions { margin-left: auto; display: flex; gap: 8px; }
.cl-import { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin-bottom: 14px; }
.cl-import .dropzone { padding: 20px; }
.cl-filerow { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.cl-filecard { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 260px; border: 1px solid #E0E2E5; border-radius: 6px; padding: 7px 10px; }
.cl-filecard .doc-type { width: 28px; height: 28px; font-size: 8.5px; }
.cl-filecard > div { flex: 1; min-width: 0; }
.cl-filecard b { display: block; font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
.cl-filecard small { font-size: 11px; color: var(--text-muted); }
.cl-import-mode { height: 32px; font-size: 12.5px; }
.cl-import-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cl-import-foot .note { font-size: 11.5px; color: var(--text-muted); }
.cl-import-foot .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.cl-grid { display: flex; gap: 14px; align-items: flex-start; }
.cl-stages { flex: 1.35; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.cl-dropbar { height: 2px; background: transparent; transition: background 0.12s; }
.cl-dropbar.on { background: var(--accent); }
.cl-dropbar.inner { margin: 0 14px 0 24px; border-radius: 1px; }
.cl-stage-row { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--divider); cursor: pointer; background: var(--surface); transition: background 0.15s, opacity 0.15s; }
.cl-stage-row:hover { background: #FBFAF9; }
.cl-stage-row.open { background: #FDFCFB; }
.cl-stage-row.dragging, .cl-point.dragging { opacity: .35; }
.cl-drag { flex: none; color: #C9CDD2; font-size: 13px; cursor: grab; background: none; border: none; height: auto; padding: 0; font-weight: 400; }
.cl-drag:active { cursor: grabbing; }
.cl-drag:hover { background: none; color: var(--text-muted); }
.cl-check { flex: none; width: 15px; height: 15px; border-radius: 4px; background: var(--surface); border: 1.5px solid #C9CDD2; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: 700; box-sizing: border-box; cursor: pointer; }
.cl-check.on { background: var(--accent); border-color: var(--accent); }
.cl-stage-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-stage-row.off .cl-stage-title { color: var(--text-muted); }
.cl-rename { flex: 1; height: 28px; border: 1.5px solid var(--accent); border-radius: 6px; padding: 0 9px; font-size: 13px; font-weight: 600; min-width: 0; }
.cl-rename-done { font-size: 12px; color: #2E6B4C; font-weight: 600; background: none; border: none; height: auto; padding: 0; }
.cl-pencil { font-size: 12px; color: #B3B8BE; background: none; border: none; height: auto; padding: 0; font-weight: 400; }
.cl-pencil:hover { color: var(--accent); background: none; }
.cl-count { flex: none; font-size: 11.5px; color: var(--text-muted); }
.cl-chev { flex: none; color: var(--text-muted); font-size: 11px; }
.cl-mergesel { flex: none; width: 16px; height: 16px; border-radius: 999px; border: 1.5px solid #C9CDD2; background: var(--surface); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 9px; font-weight: 700; box-sizing: border-box; cursor: pointer; }
.cl-mergesel.on { background: var(--ink); border-color: var(--ink); }
.cl-points { background: #FDFCFB; border-bottom: 1px solid var(--divider); padding: 4px 0 8px; }
.cl-point { display: flex; align-items: flex-start; gap: 9px; padding: 8px 14px 8px 24px; cursor: pointer; border-left: 3px solid transparent; transition: background 0.15s, opacity 0.15s; }
.cl-point:hover { background: #F2F3F5; }
.cl-point.selected { background: var(--accent-tint); border-left-color: var(--accent); }
.cl-point .cl-drag { font-size: 12px; margin-top: 1px; }
.cl-point .cl-check { margin-top: 1px; }
.cl-point-text { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.45; overflow-wrap: anywhere; }
.cl-point.off .cl-point-text { color: #B3B8BE; text-decoration: line-through; }
.cl-tol { display: inline-flex; padding: 1px 6px; border: 1px solid #D5D8DC; color: var(--status-neutral); border-radius: 4px; font-size: 10.5px; margin-left: 5px; white-space: nowrap; }
.cl-strict { display: inline-flex; padding: 1px 6px; background: #FBEFE8; color: var(--accent-hover); border-radius: 4px; font-size: 10.5px; margin-left: 5px; white-space: nowrap; }
.cl-stage-foot { display: flex; gap: 16px; padding: 7px 14px 2px 24px; }
.cl-stage-foot button, .cl-list-foot button { height: auto; padding: 0; font-size: 12px; font-weight: 500; background: none; border: none; }
.cl-stage-foot .addpoint, .cl-list-foot .addstage { color: var(--accent); }
.cl-stage-foot .delstage { color: var(--text-muted); }
.cl-stage-foot .delstage:hover { color: var(--status-danger); background: none; }
.cl-list-foot { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.cl-list-foot .mergetoggle { color: var(--text-secondary); font-size: 12.5px; }
.cl-list-foot .hint { margin-left: auto; font-size: 11.5px; color: var(--text-muted); }
.cl-panel-wrap { width: 340px; flex: none; position: sticky; top: 76px; }
.cl-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
.cl-panel-label { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cl-panel-label span { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-panel-label .cl-savestate { margin-left: auto; font-size: 11px; min-width: 0; }
.cl-panel textarea { width: 100%; border-radius: 6px; font-size: 12.5px; line-height: 1.5; resize: vertical; }
.cl-panel textarea:focus { border-color: var(--accent); outline: none; }
.cl-field-label { font-size: 11.5px; color: var(--text-secondary); margin: 10px 0 4px; }
.cl-panel input[type="text"] { width: 100%; height: 30px; }
.cl-panel input[type="text"]:disabled { background: var(--surface-sunken); }
.cl-checkline { display: flex; align-items: center; gap: 7px; font-size: 12.5px; margin-top: 9px; cursor: pointer; }
.cl-panel-foot { display: flex; gap: 12px; border-top: 1px solid var(--divider); margin-top: 12px; padding-top: 10px; }
.cl-panel-foot button { height: auto; padding: 0; font-size: 12px; font-weight: 400; background: none; border: none; color: var(--text-secondary); }
.cl-panel-foot button:hover { color: var(--ink); background: none; }
.cl-panel-foot .delpoint { color: var(--status-danger); }
/* «Вернуть к ТЗ» — возврат к исходному, а не удаление: выделяем акцентом, но
   без красноты опасного действия. */
.cl-panel-foot .cl-restore { color: var(--accent-hover, #C75A2C); font-weight: 500; }
.cl-panel-note { margin-top: 10px; font-size: 12px; line-height: 1.45;
  color: var(--text-muted); background: var(--surface-sunken); border-radius: 6px;
  padding: 7px 10px; }
.cl-placeholder { background: var(--surface); border: 1px dashed #C9CDD2; border-radius: 8px; padding: 22px; text-align: center; }
.cl-placeholder b { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.cl-placeholder p { margin: 0; font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.cl-note { background: var(--surface-sunken); border-radius: 8px; padding: 10px 12px; font-size: 11.5px; color: var(--text-secondary); line-height: 1.55; margin-top: 12px; }
.cl-merge-bar {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--ink); color: #fff; border-radius: 10px; padding: 11px 18px; font-size: 13px;
  box-shadow: 0 12px 32px rgba(32, 34, 38, 0.3); z-index: var(--z-toast, 1400);
  display: flex; align-items: center; gap: 16px;
}
.cl-merge-bar b { font-weight: 600; }
.cl-merge-bar .mergego { height: 32px; padding: 0 14px; font-size: 12.5px; }
.cl-merge-bar .mergego:disabled { background: #5A5E66; opacity: 1; }
.cl-merge-bar .link { color: #AEB4BB; font-size: 12.5px; }
.cl-merge-bar .link:hover { color: #fff; }

/* ===== Тосты ===== */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--ink); color: #fff; border-radius: 8px; padding: 10px 18px;
  font-size: 13px; font-weight: 500; box-shadow: 0 12px 32px rgba(32, 34, 38, 0.3);
  z-index: var(--z-toast, 1400);
}

/* ===== Адаптив ===== */
@media (max-width: 1100px) {
  .overview-grid { grid-template-columns: 1fr; }
  .wizard-body.wide { flex-direction: column; }
  .wizard-aside { width: 100%; position: static; }
  .cl-grid { flex-direction: column; align-items: stretch; }
  .cl-stages { width: 100%; }
  .cl-panel-wrap { width: 100%; position: static; }
  .found-grid { grid-template-columns: 1fr; }
  .docform { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 8px 12px; padding: 10px 12px; }
  .topsearch { order: 3; width: 100%; }
  .workspace { display: block; }
  .shell-sidebar { width: 100%; flex-direction: row; align-items: center; overflow-x: auto; border-right: none; border-bottom: 1px solid #E3E5E8; padding: 8px; }
  .shell-nav { flex-direction: row; gap: 4px; }
  .shell-nav-item { white-space: nowrap; border-left-width: 1px; }
  .shell-nav-item.active { border-left: 1px solid #E0E2E5; border-bottom: 2px solid var(--accent); border-radius: 6px 6px 0 0; }
  .shell-sidebar-note { display: none; }
  /* На узком экране панель уже горизонтальная лента с прокруткой — второй,
     свёрнутой, панели рядом не появляется: сохранённое предпочтение здесь
     просто не действует, а его кнопки нет. */
  .shell-collapse { display: none; }
  .shell-sidebar.collapsed { width: 100%; padding: 8px; }
  .shell-sidebar.collapsed .shell-nav-item {
    justify-content: flex-start; padding: 7px 10px; font-size: 13px;
  }
  .workarea { padding: 12px; }
  .tz-change-row { grid-template-columns: 24px minmax(0, 1fr); gap: 6px 8px; }
  .tz-change-row.head { display: none; }
  .tz-change-row > span:nth-child(3), .tz-change-row > span:nth-child(4) { grid-column: 2; }
  .tz-change-row > span:nth-child(3)::before { content: "Сейчас: "; color: var(--text-muted); }
  .tz-change-row > span:nth-child(4)::before { content: "Заменить на: "; color: var(--text-muted); }
  .pt-head { display: none; }
  .pt-row { grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 12px; }
  .pt-row > .pt-cell { grid-column: 1 / -1; }
  .pt-row > .pt-cell:first-child { grid-column: 1; }
  .pt-row > .pt-cell:nth-child(5) { grid-column: 2; grid-row: 1; justify-self: end; }
  /* Действия документа должны оставаться доступны и на телефоне. Скрываем
     многоточие только у строк задач, где действия продублированы карточкой. */
  .pt-row .pt-menu { display: none; }
  .object-head { flex-direction: column; align-items: stretch; }
  .object-head-actions { margin-left: 0; align-self: flex-start; }
  .create-paths { flex-direction: column; }
  .wizard-steps { display: none; }
  .wizard-body.narrow, .wizard-body.wide { padding: 16px 12px; }
  .wizard-foot { flex-wrap: wrap; }
  .param-field { grid-template-columns: 1fr; gap: 5px; }
  .param-save-state { min-height: 0; }
  .docform, .mediarow { grid-template-columns: 1fr; }
  .mediaactions { justify-content: flex-start; }
  .listhead { align-items: center; }
  .doc-row { flex-wrap: wrap; }
  .doc-actions { margin-left: 40px; }
  .visitbar, .visitfield, .assignform { min-width: 0; }
  .visitbar select, .visitfield select, .assignform select { width: 100%; }
  button.link { padding: 6px 4px; }
  .loginrow { flex-direction: column; }
  .intakerow { flex-wrap: wrap; align-items: stretch; }
  .intakerow select { width: 100%; min-width: 0; }
  .inviteform { grid-template-columns: 1fr; align-items: stretch; }
  .inviteform > button { grid-column: auto; justify-self: stretch; width: 100%; }
  .inviterow { align-items: flex-start; flex-direction: column; }
  .checklist-actions { flex-direction: column; align-items: stretch; }
  .cl-head-actions { margin-left: 0; width: 100%; }
  .cl-head-actions button { flex: 1; }
  .cl-merge-bar { width: calc(100vw - 24px); flex-wrap: wrap; gap: 10px; bottom: 12px; }
  .photo-grid { grid-template-columns: 1fr 1fr; }
  .summary-row b { text-align: left; }
  .object-tabs { margin-left: -12px; margin-right: -12px; padding: 0 12px; }
}

/* ===== Sprint 95: разделы кабинета (форма «кабинет-разделы») ===== */

/* Убираем нативные стрелочки спиннера date/time/number */
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator { opacity: .5; }
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button { display: none; -webkit-appearance: none; appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

/* Общие для разделов: заголовок блока, счётчик, аватар-размеры, role-badge, ⋯, фильтр-чипы */
.block-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.block-head b { font-size: 15px; font-weight: 700; }
.block-head .count { font-size: 14px; font-weight: 400; color: var(--text-muted); }
.avatar.sm { width: 22px; height: 22px; font-size: 9.5px; }
.avatar.pending { background: var(--surface-sunken); color: var(--text-muted); border: 1px dashed #C9CDD2; }
.role-badge { flex: none; display: inline-flex; align-items: center; padding: 3px 9px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; color: var(--text-secondary); background: var(--surface); white-space: nowrap; }
.row-menu { flex: none; width: 30px; height: 28px; padding: 0; color: var(--text-muted); background: none; border: none; font-size: 15px; border-radius: 6px; }
.row-menu:hover { background: var(--surface-sunken); color: var(--ink); }
.filter-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-pill { height: auto; padding: 4px 11px; font-size: 12.5px; font-weight: 500; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); }
.filter-pill:hover { background: var(--surface-sunken); }
.filter-pill.active { background: var(--accent-tint); border-color: var(--accent-tint); color: var(--accent-hover); font-weight: 600; }
.filter-pill.muted { color: var(--text-disabled); cursor: default; }
.filter-pill.muted:hover { background: var(--surface); }
.block-note { margin: 14px 0 0; font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.pill.danger { background: var(--status-danger-tint); color: var(--status-danger); }

/* Участники */
.members-grid, .tasks-grid, .params-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) 320px; gap: 20px; align-items: flex-start; }
.members-grid { grid-template-columns: 1fr; }
.members-main, .tasks-main, .params-main { min-width: 0; }
.members-side, .tasks-side, .params-side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.members-side { position: static; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.members-side > .invite-panel { width: 100%; min-width: 0; margin-top: 0; }
.people-list { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.people-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #F3F4F6; }
.people-row:last-child { border-bottom: none; }
.people-row.pending { background: var(--surface); }
.people-info { flex: 1; min-width: 0; }
.people-info b { display: block; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.people-info small { display: block; font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); margin-top: 1px; }
.member-table-row { display: grid; grid-template-columns: minmax(190px, 1.25fr) minmax(130px, .85fr) minmax(135px, .75fr) minmax(145px, .9fr) 30px; align-items: center; gap: 12px; padding: 11px 12px; border-bottom: 1px solid #F3F4F6; }
.member-table-row:last-child { border-bottom: none; }
.member-table-head { min-height: 38px; padding-top: 8px; padding-bottom: 8px; background: var(--surface-sunken); color: var(--text-muted); font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.member-table-row .emp-who { min-width: 0; }
.member-job, .member-phone { min-width: 0; color: var(--text-secondary); font-size: 12.5px; overflow-wrap: anywhere; }
.member-phone { font-family: var(--font-mono); }
.member-table-row + .member-actions { margin: -1px 12px 10px; }
.invites-block { margin-top: 18px; }
.invite-panel .invitefield { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; color: var(--text-secondary); font-size: 12.5px; }
.invite-panel .invitefield input, .invite-panel .invitefield select { width: 100%; }
.invite-submit { width: 100%; }
.invite-hint { margin: 10px 0 0; font-size: 11.5px; color: var(--text-muted); line-height: 1.5; }

/* Задачи */
.task-card { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--border); border-radius: 8px; padding: 13px 14px; margin-bottom: 12px; }
.task-card.s-open { border-left-color: var(--status-danger); }
.task-card.s-fixed { border-left-color: var(--status-warn); }
.task-card.s-verified { border-left-color: var(--status-ok); }
.task-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-who { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-secondary); }
.task-head .row-menu { margin-left: auto; }
.task-desc { font-size: 13px; line-height: 1.5; color: var(--ink); margin: 9px 0; overflow-wrap: anywhere; }
.task-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.task-meta { font-size: 12px; color: var(--text-muted); }
.task-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.task-actions .secondary { height: 30px; }
.task-composer .composer-sub { margin: 0 0 12px; font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.task-composer textarea { width: 100%; border-radius: 6px; font-size: 12.5px; line-height: 1.5; resize: vertical; }
.task-composer select { width: 100%; }
.composer-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.composer-submit { width: 100%; margin-top: 14px; }
.composer-note { margin: 10px 0 0; font-size: 11.5px; color: var(--text-muted); line-height: 1.5; }

/* Параметры */
.params-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.params-hint { margin-left: auto; font-size: 12px; color: var(--text-muted); }
.param-readrow { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #F3F4F6; }
.param-readrow span { font-size: 13px; color: var(--text-secondary); }
.param-readrow b { font-size: 13px; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.param-readrow b.muted { color: var(--text-muted); font-weight: 400; }
.param-field.needs-fill { background: #FDFBF6; border-radius: 6px; margin: 0 -8px; padding-left: 8px; padding-right: 8px; }
.param-field.needs-fill select, .param-field.needs-fill .param-multi > summary { border: 1.5px solid #E2CBA0; }
.fill-badge { margin-left: 8px; padding: 1px 7px; background: var(--status-warn-tint); color: #8F6209; border-radius: 999px; font-size: 10.5px; font-weight: 600; vertical-align: middle; }
.param-save-state.saving { color: var(--text-muted); }
.rules-list { margin: 4px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--text-secondary); line-height: 1.6; }
.rules-list li { margin: 3px 0; }
.mini-history { display: flex; flex-direction: column; gap: 2px; }
.mini-history-row { display: flex; gap: 9px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid #F3F4F6; font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; }
.mini-history-row:last-child { border-bottom: none; }
.mh-time { flex: none; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }

@media (max-width: 1250px) {
  .members-grid, .tasks-grid, .params-grid { grid-template-columns: 1fr; }
  .members-side, .tasks-side, .params-side { position: static; width: 100%; }
  .params-hint { margin-left: 0; }
}

@media (max-width: 720px) {
  .members-side { grid-template-columns: 1fr; }
  .member-table-head { display: none; }
  .member-table-row { grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; padding: 12px; }
  .member-table-row .emp-who { grid-column: 1; grid-row: 1; }
  .member-table-row .member-job { grid-column: 1; grid-row: 2; padding-left: 42px; }
  .member-table-row .member-phone { grid-column: 1; grid-row: 3; padding-left: 42px; }
  .member-table-row .role-badge { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .member-table-row .row-menu { grid-column: 2; grid-row: 3; justify-self: end; }
}

/* Согласование: четыре исходных поля в одну понятную строку, остальное — ниже. */
.change-composer { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
.change-composer > h2,
.change-composer > .composer-sub,
.change-composer > .change-comment-field,
.change-composer > .change-people-field,
.change-composer > button,
.change-composer > .error,
.change-composer > .block-note { grid-column: 1 / -1; }
.change-composer > .field { min-width: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.change-composer > .field > input,
.change-composer > .field > select,
.change-composer > .field > textarea { width: 100%; min-width: 0; }
.change-composer > .change-comment-field textarea { resize: vertical; }
.change-composer > button { justify-self: start; }
@media (max-width: 1100px) {
  .change-composer { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .change-composer { grid-template-columns: 1fr; }
}

/* Контроль и выезды — 2 колонки (план+выезды слева, деталь выезда справа) */
.control-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) 340px; gap: 20px; align-items: flex-start; }
.control-main { min-width: 0; }
.control-side { position: sticky; top: 16px; min-width: 0; }
.visits-head { margin-top: 16px; }
.visits-head > button { margin-left: auto; }
.visitdetail { background: var(--surface); border: 1px solid var(--border); }
.visit-placeholder { text-align: left; align-items: stretch; }
.cardsectionbody.issues .visits { margin-top: 0; border-top: 0; padding-top: 0; }
.cardsectionbody.issues .visits-head,
.cardsectionbody.issues .visitdetail { margin-top: 0; }
@media (max-width: 1100px) {
  .control-grid { grid-template-columns: 1fr; }
  .control-side { position: static; width: 100%; }
}

/* ===== Sprint 96: Контроль и выезды по форме «кабинет-разделы» ===== */

/* План контроля: баннер над карточкой, карточка с кнопками и этапами */
.controlplan { background: none; }
.plan-card { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); padding: 14px 16px; }
.plan-card .plantitle { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.checklist-actions .secondary.active {
  background: var(--accent-tint); border-color: var(--accent-tint); color: var(--accent-hover); font-weight: 600;
}
.plan-card .planstages { margin-top: 14px; border-top: 1px solid var(--divider); padding-top: 2px; }
.planstages .stagename { min-width: 0; overflow-wrap: anywhere; }
.planstages .srcbadge {
  margin-left: auto; background: var(--surface-sunken); color: var(--text-secondary);
  border: 1px solid var(--border-soft); font-weight: 500;
}
/* mgmt-блок (сохранённые/расширенные) уходит под карточку — без разделителя сверху */
.tmpl-mgmt { margin-top: 8px; padding-top: 0; border-top: none; }

/* Карточки выездов: цветная полоса статуса слева + статус справа */
.visititem { border-left-width: 3px; }
.visititem.s-assigned, .visititem.s-in_progress, .visititem.s-submitted { border-left-color: var(--accent); }
.visititem.s-reviewed { border-left-color: var(--status-ok); }
.visititem.s-cancelled { border-left-color: var(--text-disabled); }
.visititem-top { display: flex; align-items: center; gap: 8px; }
.visititem-top .visititem-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.visititem-status { flex: none; font-size: 12px; font-weight: 500; white-space: nowrap; }
.visititem-status.tone-warn { color: var(--accent-hover); }
.visititem-status.tone-neutral { color: var(--text-muted); }
.visititem-status.tone-muted { color: var(--text-disabled); }
.visititem-status.tone-ok { color: #2E6B4C; background: #E3EFE7; padding: 2px 9px; border-radius: 999px; }

/* Деталь выезда: предупреждение о недостающих обязательных документах */
.visit-doc-warn {
  margin: 8px 0; padding: 9px 12px; border: 1px solid #E2CBA0; background: #FDFBF6;
  border-radius: 8px; font-size: 12.5px; color: #8F6209; line-height: 1.45;
}
.visit-doc-warn::before { content: "! "; font-weight: 700; }

/* ===== Sprint 99: участники — статус, действия, отправка приглашения ===== */

/* Статус-чип участника/приглашения (принял / ещё не принял) */
.member-status {
  flex: none; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.member-status.ok { background: var(--status-ok-tint); color: #2E6B4C; }
.member-status.pending { background: var(--surface-sunken); color: var(--text-muted); }

/* Инлайн-действия над участником (раскрываются по «⋯») */
.member-actions {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px; margin: 0; background: var(--surface-sunken);
  border-bottom: 1px solid #F3F4F6;
}
.member-actions-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.member-actions-row select { flex: 1; min-width: 150px; }
.member-actions-row .secondary { height: 32px; }
.link.danger { color: var(--status-danger); }
button.link.danger { background: none; }
button.link.danger:hover { background: none; opacity: .85; }

/* Кнопка «Готово» в блоке доставки приглашения */
.invite-done { width: 100%; margin-top: 10px; }

/* ===== Sprint 103: настройки компании (дизайн «настройки-компании») ===== */

/* Чип компании в топбаре: аватар-инициалы + название + ▾ */
.cmp-chip { display: inline-flex; align-items: center; gap: 8px; margin-right: 4px; }
.cmp-chip-avatar {
  width: 26px; height: 26px; border-radius: 6px; background: #24262A; color: #fff;
  font-size: 10.5px; font-weight: 600; display: inline-flex; align-items: center;
  justify-content: center; letter-spacing: 0.02em;
}
.cmp-chip-name { font-size: 13px; font-weight: 500; }
.cmp-chip-caret { font-size: 10px; color: var(--text-muted); }

/* Экран настроек */
.cmp-screen { padding: 2px 0; }
.cmp-h1 { font-size: 18px; font-weight: 700; margin: 0 0 14px; }
.cmp-count { color: var(--text-muted); font-weight: 400; font-size: 15px; margin-left: 4px; }
.cmp-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 16px; align-items: start; }
.cmp-col { display: flex; flex-direction: column; gap: 16px; }
.cmp-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.cmp-card-flush { padding: 0; overflow: hidden; }
.cmp-card-head { display: flex; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--border-divider); }
.cmp-card-head .cmp-btn-sm { margin-left: auto; }
.cmp-card-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.cmp-card-head .cmp-card-title { margin-bottom: 0; }
.cmp-msg { font-size: 12.5px; color: #A8730A; background: #F4EAD2; border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; }
.cmp-hint { font-size: 11.5px; color: var(--text-muted); line-height: 1.5; }
.cmp-opt { color: var(--text-muted); font-weight: 400; }
.cmp-empty { padding: 14px 16px; font-size: 12.5px; color: var(--text-muted); }
.cmp-warn-text { color: #A8730A; }

.cmp-logo-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cmp-logo {
  width: 56px; height: 56px; border-radius: 8px; background: #24262A; color: #fff;
  font-size: 20px; font-weight: 600; display: inline-flex; align-items: center;
  justify-content: center; flex: none; letter-spacing: 0.02em; overflow: hidden;
}
.cmp-logo img { width: 100%; height: 100%; object-fit: cover; }
.cmp-logo-ctl { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }

.cmp-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.cmp-label { font-size: 12px; font-weight: 500; }
.cmp-field input {
  height: 38px; border: 1px solid var(--border); border-radius: 6px; padding: 0 12px;
  font-family: inherit; font-size: 13.5px;
}
.cmp-site { color: #3B6EA5; }
.cmp-save-row { display: flex; align-items: center; gap: 10px; }

.cmp-btn-primary {
  height: 36px; padding: 0 15px; background: var(--accent); color: #fff; border: none;
  border-radius: 6px; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.cmp-btn-primary:hover { background: var(--accent-hover); }
.cmp-btn-sm { height: 32px; padding: 0 13px; font-size: 12.5px; }
.cmp-btn-outline {
  height: 36px; padding: 0 13px; background: #fff; border: 1px solid var(--border); color: var(--ink);
  border-radius: 6px; font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
}
.cmp-btn-outline:hover { background: var(--surface-sunken); }
.cmp-btn-danger {
  height: 34px; padding: 0 13px; background: #fff; border: 1px solid #E5BAB4; color: #B3403A;
  border-radius: 6px; font-family: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer;
}
.cmp-btn-danger:hover { background: #FDF6F5; }
.cmp-btn-danger:disabled { opacity: 0.5; cursor: default; }
.cmp-danger { border-color: #E5BAB4; }
.cmp-danger-title { color: #B3403A; margin-bottom: 6px; }

.cmp-row-wrap { border-bottom: 1px solid var(--border-divider); }
.cmp-row-wrap:last-child { border-bottom: none; }
.cmp-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.cmp-row-main { flex: 1; min-width: 0; }
.cmp-row-title { font-size: 13.5px; font-weight: 600; }
.cmp-row-meta { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--text-muted); }
.cmp-pill-ok {
  display: inline-flex; padding: 3px 9px; background: #E3EFE7; color: #2E6B4C;
  border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap;
}
.cmp-dots {
  width: 28px; height: 28px; padding: 0; border: 1px solid var(--border-soft); border-radius: 6px;
  background: #fff; color: var(--text-muted); cursor: pointer; font-family: inherit;
}
.cmp-dots:hover { background: var(--surface-sunken); color: var(--ink); }
.cmp-actions { display: flex; align-items: center; gap: 14px; padding: 8px 16px 12px; flex-wrap: wrap; }
.cmp-actions select { height: 30px; border: 1px solid var(--border); border-radius: 6px; font-family: inherit; font-size: 12.5px; }

.cmp-dropzone {
  width: 100%; height: auto; border: 1.5px dashed #C9CDD2; border-radius: 8px; padding: 14px;
  background: #fff; text-align: center; font-size: 12.5px; color: var(--text-muted); font-weight: 400;
  font-family: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 3px; align-items: center;
}
.cmp-dropzone:hover { border-color: var(--accent); background: #fff; }
.cmp-dz-sub { font-size: 12.5px; }
.cmp-dz-link { color: var(--accent); font-weight: 500; }
.cmp-or { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.cmp-or span { flex: 1; height: 1px; background: var(--border-soft); display: block; }
.cmp-or b { font-size: 12px; color: var(--text-muted); font-weight: 400; }
.cmp-entity-form { border-top: 1px solid var(--border-divider); margin-top: 12px; padding-top: 12px; }

/* Сотрудники */
.emp-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.emp-head .cmp-btn-primary { margin-left: auto; }
.emp-head .cmp-h1 { margin: 0; }
.emp-invite-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.emp-invite-form .cmp-field { margin-bottom: 0; }
.emp-contact-field { flex: 1; min-width: 220px; }
.emp-invite-form select { height: 36px; min-width: 190px; border: 1px solid var(--border); border-radius: 6px; font-family: inherit; font-size: 13px; padding: 0 8px; }
.emp-invite-form input { height: 36px; }
.emp-invite-result { margin-top: 10px; }
.emp-invite-link { display: flex; align-items: center; gap: 10px; font-size: 12.5px; flex-wrap: wrap; }
.emp-invite-link a { word-break: break-all; }
#employeesScreen .cmp-card-flush { margin-top: 14px; }

.emp-row {
  /* Задача 10.6: сотрудник · должность · доступ · контакт · статус · меню. */
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.1fr 1fr 0.3fr; gap: 12px;
  padding: 11px 16px; align-items: center;
}
.emp-row-head {
  padding: 9px 16px; border-bottom: 1px solid var(--border-soft);
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-muted);
}
.emp-who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.emp-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: #D9DCE0; color: #5A616A;
  font-size: 10px; font-weight: 600; display: inline-flex; align-items: center;
  justify-content: center; flex: none;
}
.emp-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.emp-avatar-invited { background: transparent; border: 1.5px dashed #C9CDD2; color: var(--text-muted); font-size: 12px; }
.emp-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emp-you { color: var(--text-muted); font-weight: 400; }
.emp-dept {
  display: inline-flex; padding: 3px 8px; border: 1px solid var(--border); color: var(--text-secondary);
  border-radius: 4px; font-size: 12px; font-weight: 500; white-space: nowrap;
}
.emp-contact { font-size: 12.5px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; }
.emp-status { display: inline-flex; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.emp-status.ok { background: #E3EFE7; color: #2E6B4C; }
.emp-status.warn { background: #F4EAD2; color: #8F6209; }
/* Вторая строка под чипом (пользовательская роль) — переносится, не обрезается. */
.emp-delivery { margin-top: 4px; font-size: 11.5px; color: var(--text-secondary); }
.emp-row-open { cursor: pointer; }
.emp-row-open:hover, .emp-row-open:focus { background: #FBFAF9; outline: none; }
.emp-row-open:focus-visible { box-shadow: inset 3px 0 var(--accent); }
.emp-open-mark { color: var(--text-muted); font-size: 22px; line-height: 1; }

.emp-detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.emp-detail-head .cmp-h1 { margin: 0; }
.emp-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.emp-detail-column { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.emp-detail-card { display: flex; flex-direction: column; gap: 10px; }
.emp-detail-title { font-size: 15px; margin: 0; }
.emp-detail-subtitle { font-size: 13px; margin: 8px 0 0; }
.emp-detail-profile { display: flex; align-items: center; gap: 12px; }
.emp-avatar-large { width: 72px; height: 72px; font-size: 20px; overflow: hidden; }
.emp-avatar-actions { display: flex; align-items: flex-start; flex-direction: column; gap: 7px; }
.emp-access-summary { margin: 0; font-size: 14px; font-weight: 600; }
.emp-access-row { display: flex; align-items: center; gap: 8px; }
.emp-access-row select, .emp-detail-card > select {
  min-width: 210px; height: 36px; border: 1px solid var(--border); border-radius: 6px;
  background: #fff; padding: 0 8px; font: inherit;
}
.emp-permissions { display: flex; flex-direction: column; border-top: 1px solid var(--border-soft); }
.emp-override-details { border-top: 1px solid var(--border-soft); padding-top: 10px; }
.emp-override-details summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.emp-override-details[open] summary { margin-bottom: 8px; }
.emp-override-details .cmp-btn-primary { margin-top: 10px; }
.emp-permission-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-soft); font-size: 12.5px; }
.emp-permission-row select { height: 32px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.emp-project-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); }
.emp-project-name { font-size: 13.5px; font-weight: 600; }
.emp-detail-empty { padding: 10px 0; }
.emp-work-controls, .emp-work-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.emp-work-controls select, .emp-work-controls input,
.emp-work-filters select { min-width: 0; flex: 1 1 130px; }
.emp-work-body { display: flex; flex-direction: column; gap: 10px; }
.emp-work-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.emp-work-stat { padding: 9px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); }
.emp-work-stat strong, .emp-work-stat span { display: block; }
.emp-work-stat strong { font-size: 18px; }
.emp-work-stat span { color: var(--text-muted); font-size: 12px; }
.emp-work-stat.danger strong, .emp-work-task-state.overdue,
.emp-work-task-state.late { color: var(--status-danger); }
.emp-work-stat.warn strong, .emp-work-task-state.due_soon { color: var(--status-warn); }
.emp-work-stat.ok strong, .emp-work-task-state.on_time { color: var(--status-ok); }
.emp-work-task { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; text-align: left; padding: 10px 0; border: 0; border-bottom: 1px solid var(--divider); background: transparent; color: inherit; cursor: pointer; }
.emp-work-task:hover { color: var(--accent); }
.emp-work-task-title { font-weight: 600; min-width: 0; }
.emp-work-task-state { font-size: 12px; white-space: nowrap; }
.emp-work-task .cmp-hint { grid-column: 1 / -1; }
.emp-chat-messages { display: flex; flex-direction: column; gap: 8px; max-height: 320px;
  overflow: auto; padding: 2px; }
.emp-chat-message { max-width: 86%; padding: 8px 10px; border-radius: 10px;
  background: var(--surface-soft); overflow-wrap: anywhere; }
.emp-chat-message.own { align-self: flex-end; background: var(--accent-tint); }
.emp-chat-message.other { align-self: flex-start; }
.emp-chat-message time { display: block; margin-top: 4px; }
.emp-chat-body { white-space: pre-wrap; }
.emp-chat-form { display: flex; align-items: flex-end; gap: 8px; }
.emp-chat-form textarea { min-width: 0; flex: 1; resize: vertical; }
.emp-chat-unread:empty { display: none; }
.emp-activity-list, .emp-security-block, .emp-security-form,
.emp-session-info { display: flex; flex-direction: column; gap: 8px; }
.emp-activity-row {
  display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 3px 8px;
  padding: 8px 0; border-bottom: 1px solid var(--border-soft); align-items: baseline;
}
.emp-activity-row:last-child { border-bottom: 0; }
.emp-activity-dot { color: var(--accent); font-weight: 700; }
.emp-activity-title { font-size: 13px; font-weight: 600; }
.emp-activity-project { grid-column: 2 / -1; }
.emp-security-block + .emp-security-block {
  border-top: 1px solid var(--border-soft); padding-top: 10px;
}
.emp-security-status {
  display: flex; justify-content: space-between; gap: 12px; font-size: 13px;
}
.emp-security-status strong { text-align: right; overflow-wrap: anywhere; }
.emp-security-status strong.ok { color: var(--status-ok); }
.emp-security-details { border-top: 1px solid var(--border-soft); padding-top: 9px; }
.emp-security-details summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.emp-security-details[open] summary { margin-bottom: 9px; }
.emp-session-row {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--border-soft);
}
.emp-session-info { min-width: 0; gap: 2px; overflow-wrap: anywhere; }
.emp-security-warning { color: var(--status-warn); font-size: 12px; }
.vtask-row.task-highlight { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-tint); }

/* ===== Задача 10.8: окно передачи приглашения ===== */
.invmodal-backdrop {
  position: fixed; inset: 0; background: rgba(28, 30, 34, .62);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  z-index: var(--z-overlay, 1200);
}
.invmodal {
  background: var(--surface); border-radius: 12px; padding: 18px 20px 20px;
  width: 420px; max-width: min(92vw, 420px); max-height: 90vh; overflow: auto;
  display: flex; flex-direction: column; gap: 12px;
}
.invmodal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.invmodal-title { font-size: 17px; font-weight: 600; margin: 0; }
.invmodal-close {
  border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer;
  color: var(--text-muted); padding: 0 2px;
}
.invmodal-summary { display: flex; flex-direction: column; gap: 6px; }
.invmodal-row { display: flex; gap: 10px; font-size: 13px; }
.invmodal-label { color: var(--text-muted); min-width: 132px; flex: none; }
.invmodal-value { color: var(--ink); word-break: break-word; }
/* Кнопки в колонку: на телефоне это единственная читаемая раскладка, а на
   десктопе окно узкое и три кнопки в строку всё равно не помещаются. */
.invmodal-actions { display: flex; flex-direction: column; gap: 8px; }
/* Цвет текста задаём явно: глобальное правило для button красит подпись в белый
   под акцентную заливку, а здесь фон светлый — иначе кнопка выглядит пустой. */
.invmodal-btn {
  height: 38px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--ink);
  font-family: inherit; font-size: 13.5px; cursor: pointer;
}
.invmodal-btn:hover { background: var(--surface-sunken, #F2F3F5); color: var(--ink); }
.invmodal-note { font-size: 12.5px; color: var(--text-secondary); min-height: 16px; }
.invmodal-qr { display: flex; flex-direction: column; gap: 8px; align-items: center; }
/* QR не должен вылезать за окно ни на десктопе, ни на узком экране. */
.invmodal-qr img { width: 100%; max-width: 240px; height: auto; display: block; }
.invmodal-qr .cmp-hint, .invmodal-qr .cmp-warn-text { text-align: center; }

@media (max-width: 480px) {
  .invmodal { width: 100%; max-width: 100%; padding: 16px; }
  .invmodal-row { flex-direction: column; gap: 2px; }
  .invmodal-label { min-width: 0; }
  .invmodal-qr img { max-width: 200px; }
}

@media (max-width: 900px) {
  .cmp-grid { grid-template-columns: 1fr; }
  /* На узком экране остаются сотрудник, должность и контакт — как и раньше
     скрываем хвост строки, добавив к нему новую колонку доступа. */
  .emp-row { grid-template-columns: 1.4fr 1fr 1fr; }
  .emp-row > div:nth-child(3), .emp-row > div:nth-child(5),
  .emp-row > div:nth-child(6) { display: none; }
  .emp-detail-grid { grid-template-columns: 1fr; }
  .emp-work-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .emp-access-row { align-items: stretch; flex-direction: column; }
  .emp-access-row select { width: 100%; }
}

@media (max-width: 480px) {
  .emp-row-head { display: none; }
  .emp-row:not(.emp-row-head) {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "who who"
      "job job"
      "access status"
      "projects projects";
  }
  .emp-row:not(.emp-row-head) > div:nth-child(1) { grid-area: who; }
  .emp-row:not(.emp-row-head) > div:nth-child(2) { grid-area: job; }
  .emp-row:not(.emp-row-head) > div:nth-child(3) { display: block; grid-area: access; }
  .emp-row:not(.emp-row-head) > div:nth-child(4) { grid-area: projects; }
  .emp-row:not(.emp-row-head) > div:nth-child(5) { display: block; grid-area: status; }
  .emp-detail-head { align-items: flex-start; flex-direction: column; }
  .emp-permission-row { grid-template-columns: 1fr; gap: 5px; }
  .emp-chat-form { align-items: stretch; flex-direction: column; }
  .emp-chat-form button { width: 100%; }
  .emp-activity-row { grid-template-columns: 16px minmax(0, 1fr); }
  .emp-activity-row time, .emp-activity-project { grid-column: 2; }
  .emp-security-status, .emp-session-row { align-items: flex-start; flex-direction: column; }
  .emp-security-status strong { text-align: left; }
}

/* ===== Sprint 106.1: инвайт сбоку от сотрудников; Компания — политика/брендинг/шаблоны ===== */

.emp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
#employeesScreen .emp-layout .cmp-card-flush { margin: 0; }
.emp-invite-side .emp-invite-form { flex-direction: column; align-items: stretch; }
.emp-invite-side .emp-contact-field { min-width: 0; }
.emp-invite-side .emp-invite-form select { min-width: 0; width: 100%; }

.cmp-policy-row {
  display: flex; align-items: center; gap: 9px; padding: 6px 8px; margin: 0 -8px;
  width: calc(100% + 16px);
  border: 0; background: none; font-family: inherit; font-size: 13px;
  color: var(--text-secondary); cursor: pointer; text-align: left;
}
.cmp-policy-row.active { color: var(--ink); cursor: default; }
/* Отменяем глобальный button:hover (акцентная заливка): пункт — не кнопка-CTA. */
.cmp-policy-row:hover { background: var(--surface-sunken); border-radius: 6px; }
.cmp-policy-row.active:hover { background: none; }
.cmp-radio { width: 16px; height: 16px; border-radius: 999px; border: 1.5px solid #C9CDD2; flex: none; box-sizing: border-box; }
.cmp-radio.on { border: 5px solid var(--accent); }
.cmp-brand-text { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }
.cmp-link-btn { border: 0; background: none; padding: 0; font-family: inherit; font-size: 12.5px; color: var(--accent); font-weight: 500; cursor: pointer; }
.cmp-link-btn:hover { background: none; color: var(--accent-hover); }
/* Sprint 111 (волна I): выбор фирменного цвета. */
.cmp-brand-row { display: flex; align-items: center; gap: 12px; margin: 12px 0 4px; }
.cmp-color { width: 44px; height: 32px; padding: 0; border: 1px solid #D7DBDF; border-radius: 6px; background: none; cursor: pointer; }
.cmp-brand-swatch { width: 26px; height: 26px; border-radius: 6px; border: 1px solid rgba(0,0,0,.12); display: inline-flex; align-items: center; justify-content: center; font-size: 9px; color: #fff; text-align: center; line-height: 1.1; }
.cmp-brand-hex { font-size: 12.5px; font-weight: 600; letter-spacing: .3px; color: var(--ink); }
.cmp-tpl-head { padding: 11px 14px; border-bottom: 1px solid #EEF0F2; font-size: 14px; font-weight: 600; }
.cmp-tpl-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid #EEF0F2; }
.cmp-tpl-row:last-child { border-bottom: 0; }
.cmp-tpl-name { flex: 1; font-size: 13px; }
.cmp-tpl-row .cmp-link-btn { font-size: 11.5px; }
.cmp-tpl-soon { font-size: 11.5px; color: #8A9096; }

@media (max-width: 900px) {
  .emp-layout { grid-template-columns: 1fr; }
}

/* ===== Sprint 108 (Стадия 2, волна A): ревью отчётов во вкладке «Отчёты и замечания» ===== */

.vr-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.vr-row { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.vr-head {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 14px; border: 0; background: none; font-family: inherit;
  font-size: 13px; color: var(--ink); cursor: pointer; text-align: left;
}
.vr-head:hover { background: #FBFAF9; }
.vr-head b { font-weight: 600; }
.vr-date { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--text-muted); }
.vr-defects { font-size: 11.5px; color: #B3403A; }
.vr-pill {
  margin-left: auto; display: inline-flex; padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.vr-pill.ok { background: #E3EFE7; color: #2E6B4C; }
.vr-pill.ok-outline { background: none; border: 1px solid #BFD9CA; color: #2E6B4C; }
.vr-pill.warn { background: #F4EAD2; color: #8F6209; }
.vr-pill.danger { background: #F9E7E5; color: #B3403A; }
.vr-pill.muted { background: #EEF0F2; color: #5C636B; }
.vr-returned {
  margin: 0 14px 10px; padding: 8px 10px; background: #F9E7E5;
  border: 1px solid #E5BAB4; border-radius: 6px; font-size: 12.5px; color: #B3403A;
}
.vr-detail { padding: 0 14px 12px; border-top: 1px solid var(--border-soft); }
.vr-review-row { display: flex; gap: 8px; margin: 10px 0 0; }
.vr-return-box { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.vr-return-box textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 6px;
  font-family: inherit; font-size: 13px; padding: 8px 10px; resize: vertical;
}
.vr-free-compact { padding: 0 14px 12px; }
.vr-free-meta { margin: 0 0 6px; color: var(--text-muted); font-size: 12px; }
.vr-free-conclusion,
.vr-free-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.vr-free-summary {
  display: grid; gap: 8px; margin: 12px 0; padding: 14px;
  border-radius: 8px; background: #F7F8F9;
}
.vr-free-summary h5,
.vr-free-section-title { margin: 14px 0 8px; font-size: 14px; }
.vr-free-counts { color: var(--text-muted); font-size: 12px; }
.vr-free-item {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px;
  padding: 14px 0; border-bottom: 1px solid var(--border-soft);
}
.vr-free-item h6 { margin: 0 0 6px; font-size: 14px; overflow-wrap: anywhere; }
.vr-free-no { color: var(--text-muted); font: 12px ui-monospace, Menlo, monospace; }
.vr-free-gallery {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px; margin-top: 10px;
}
.vr-free-gallery-compact { max-width: 430px; }
.vr-free-photo {
  min-width: 0; min-height: 88px; padding: 0; border: 1px solid var(--border);
  border-radius: 8px; background: #EEF0F2; overflow: hidden; cursor: zoom-in;
}
.vr-free-photo:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.vr-free-photo img { display: block; width: 100%; height: 112px; object-fit: cover; }
.vr-free-photo.unavailable::after { content: "Фото недоступно"; color: var(--text-muted); font-size: 11px; }
.vr-free-more {
  min-height: 44px; display: grid; place-items: center; align-self: stretch;
  min-width: 44px; border: 1px solid var(--border); cursor: zoom-in;
  border-radius: 8px; background: #EEF0F2; color: var(--text-muted); font-weight: 600;
}
.vr-free-client {
  min-width: 0; margin: 16px 0 8px; padding: 14px;
  border: 1px solid var(--border); border-radius: 8px;
}
.vr-free-client legend { padding: 0 5px; font-weight: 600; }
.vr-free-client-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
  margin: 10px 0;
}
.vr-free-client-choice {
  min-width: 0; padding: 8px; border: 1px solid var(--border-soft); border-radius: 8px;
}
.vr-free-client-choice label {
  display: flex; min-height: 44px; align-items: center; gap: 7px; font-size: 12px;
}
.vr-free-client-choice .vr-free-photo { width: 100%; }
.vr-gallery-stage { min-width: 0; min-height: 180px; display: grid; place-items: center; background: var(--surface-sunken); }
.vr-gallery-stage > * { grid-area: 1 / 1; }
.vr-gallery-status { margin: 0; padding: 24px; color: var(--text-muted); }
.vr-gallery-controls { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 14px; }
.vr-gallery-control { min-width: 44px; min-height: 44px; }
.vr-gallery-count { min-width: 70px; text-align: center; }
@media (max-width: 600px) {
  .vr-free-gallery, .vr-free-client-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vr-head { flex-wrap: wrap; }
}
@media (max-width: 390px) {
  .vr-free-gallery, .vr-free-client-grid { grid-template-columns: minmax(0, 1fr); }
  .vr-free-item { grid-template-columns: 1fr; }
  .vr-free-photo img { height: auto; max-height: 240px; }
  .vr-lightbox { padding: 8px; }
  .vr-lightbox .lightbox-box { width: 100%; max-width: 100%; }
  .vr-gallery-controls { justify-content: space-between; gap: 6px; }
}
/* Прижимание к правому краю кнопки теперь считает positionMenuLayer(): у
   fixed-слоя right: 0 отсчитывался бы от вьюпорта, а не от шапки карточки. */
.card-more-menu { min-width: 240px; }

/* ===== Sprint 110: параметры v3 (дизайн «параметры-редактор») ===== */

.pv3-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.pv3-head b { font-size: 14px; }
.pv3-fillpill {
  display: inline-flex; padding: 3px 9px; background: #F4EAD2; color: #8F6209;
  border-radius: 999px; font-size: 11.5px; font-weight: 600;
}
.pv3-fillpill.full { background: #E3EFE7; color: #2E6B4C; }
.pv3-set { font-size: 12px; color: var(--text-muted); }
.pv3-editbtn { margin-left: auto; }
.pv3-progress { height: 5px; border-radius: 3px; background: #EEF0F2; overflow: hidden; margin-bottom: 14px; }
.pv3-progress div { height: 100%; background: #2E7D52; }
.pv3-primary-intro {
  margin: 0 0 10px; padding: 9px 12px; border: 1px solid #E3E7EA; border-radius: 8px;
  color: var(--text-secondary); font-size: 12px; line-height: 1.45; background: #FAFBFB;
}
.pv3-primary-intro b { color: var(--ink); }
.pv3-primary-grid { margin-bottom: 14px; }
.pv3-primary-row { align-items: flex-start; }
.pv3-primary-value { flex-wrap: wrap; }
.pv3-select { width: 100%; box-shadow: none; background: #fff; }
.pv3-evidence { flex-basis: 100%; font-size: 11px; color: var(--text-muted); }
.pv3-evidence summary { cursor: pointer; user-select: none; width: max-content; }
.pv3-evidence div { margin-top: 4px; line-height: 1.45; }
.pv3-legacy-source { margin-top: 2px; }
.pv3-level { margin-top: 4px; }
.pv3-level > summary {
  cursor: pointer; list-style-position: inside; padding: 10px 2px; font-size: 13px;
  font-weight: 700; color: var(--text-secondary);
}
.pv3-level-body { padding-top: 2px; }
.pv3-toolbar {
  background: #F6E9E1; border: 1px solid #E7CDBC; border-radius: 8px;
  padding: 8px 8px 8px 14px; display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.pv3-toolbar-note { flex: 1; min-width: 220px; font-size: 12.5px; color: #8A4B29; line-height: 1.35; }
.pv3-reason {
  height: 34px; min-width: 250px; background: #fff; border: 1px solid #E7CDBC;
  border-radius: 6px; padding: 0 11px; font-family: inherit; font-size: 12.5px;
}
.pv3-save { white-space: nowrap; }
.pv3-cancel { color: #8A4B29; }
.pv3-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.pv3-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.pv3-card-head {
  padding: 8px 14px; background: #F6F7F8; border-bottom: 1px solid #EEF0F2;
  display: flex; align-items: center; gap: 8px;
}
.pv3-card-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-secondary);
}
.pv3-card-count { margin-left: auto; font-size: 11px; color: var(--text-muted); }
.pv3-delsection { font-size: 11px; color: #B3403A; }
.pv3-delsection:hover { color: #8f2f2b; }
.pv3-row {
  display: flex; align-items: center; gap: 10px; padding: 7px 14px;
  border-bottom: 1px solid #F5F6F7;
}
.pv3-row.hidden .pv3-label, .pv3-row.hidden .pv3-value-text { text-decoration: line-through; color: var(--text-muted); }
.pv3-label { width: 40%; flex: none; font-size: 12.5px; color: var(--text-muted); }
.pv3-value { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.pv3-value-text { font-size: 12.5px; font-weight: 500; cursor: default; }
.pv3-value-text.empty { color: var(--text-muted); font-weight: 400; }
.pv3-row .pv3-value-text[tabindex] { cursor: pointer; }
.pv3-input {
  flex: 1; border: 1.5px solid var(--accent); border-radius: 6px; padding: 6px 10px;
  font-family: inherit; font-size: 12.5px; box-shadow: 0 0 0 3px rgba(192, 91, 46, 0.10);
  min-width: 0;
}
.pv3-was {
  display: inline-flex; padding: 2px 7px; background: #E6EDF5; color: #3B6EA5;
  border-radius: 999px; font-size: 10.5px; font-weight: 600; white-space: nowrap;
}
.pv3-clarify {
  display: inline-flex; align-items: center; width: auto; height: auto; min-height: 0;
  padding: 3px 8px; background: #F4EAD2; color: #8F6209;
  border: 0; border-radius: 9px; font: inherit; font-size: 10.5px; font-weight: 600;
  line-height: 1.15; white-space: nowrap; cursor: pointer;
}
.pv3-clarify:hover { background: #ECDDCA; }
.pv3-hide { font-size: 11.5px; }
.pv3-addrow { display: flex; gap: 8px; padding: 9px 14px; }
.pv3-addrow .pv3-input { border-color: var(--border); box-shadow: none; }
.pv3-addname { width: 40%; flex: none; }
.pv3-addsection { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.pv3-addsection .pv3-input {
  border: 1.5px dashed #C9CDD2; box-shadow: none; background: var(--surface);
  font-weight: 600; color: var(--accent); max-width: 280px;
}
.pv3-addhint { font-size: 11.5px; }
.pv3-rules {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 14px; margin-top: 12px;
}
.pv3-rules b { font-size: 12px; }
.pv3-rules p { margin: 6px 0 0; font-size: 11.5px; color: var(--text-secondary); line-height: 1.65; }

/* Наборы параметров компании (экран 02) */
.pset-layout { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.pset-row {
  display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 10px 14px;
  border: 0; border-bottom: 1px solid #EEF0F2; background: none; font-family: inherit;
  text-align: left; cursor: pointer;
}
.pset-row.active { background: #FBF8F6; }
.pset-row b { font-size: 12.5px; font-weight: 600; }
.pset-row small { font-size: 11px; color: var(--text-muted); }
.pset-create { padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.pset-create input[type="text"], .pset-create input:not([type]) {
  height: 34px; border: 1px solid var(--border); border-radius: 6px; padding: 0 10px;
  font-family: inherit; font-size: 12.5px;
}
.pset-ways { display: flex; gap: 6px; flex-wrap: wrap; }
.pset-editor-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pset-name {
  flex: 1; font-size: 14px; font-weight: 700; border: 1px solid transparent;
  border-radius: 6px; padding: 4px 8px; font-family: inherit;
}
.pset-name:focus { border-color: var(--border); outline: none; }
.pset-version {
  display: inline-flex; padding: 3px 9px; border: 1px solid var(--border);
  color: var(--text-secondary); border-radius: 4px; font-size: 11.5px; font-weight: 500;
}
.pset-sections { display: flex; flex-direction: column; gap: 10px; }
.pset-section { border: 1px solid #E8EAED; border-radius: 8px; overflow: hidden; }
.pset-section-head {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px;
  background: #F6F7F8; border-bottom: 1px solid #EEF0F2;
}
.pset-section-head input {
  flex: 1; border: 1px solid transparent; background: none; font-family: inherit;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-secondary); border-radius: 4px; padding: 3px 6px;
}
.pset-section-head input:focus { border-color: var(--border); background: #fff; outline: none; }
.pset-param { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-bottom: 1px solid #F5F6F7; }
.pset-param input[type="text"], .pset-param input:not([type]):not([type="checkbox"]) {
  flex: 1; border: 1px solid transparent; font-family: inherit; font-size: 12.5px;
  border-radius: 4px; padding: 4px 6px;
}
.pset-param input:focus { border-color: var(--border); outline: none; }
.pset-req { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.pset-addparam, .pset-addsection {
  border: 1px dashed #C9CDD2; border-radius: 6px; padding: 6px 10px; margin: 8px 12px;
  font-family: inherit; font-size: 12.5px; color: var(--accent); width: calc(100% - 24px);
}
.pset-addsection { margin: 12px 0 0; width: 280px; }
.pset-archive { margin-top: 12px; color: #B3403A; }

@media (max-width: 900px) {
  .pv3-grid { grid-template-columns: 1fr; }
  .pset-layout { grid-template-columns: 1fr; }
}

/* ===== Sprint 111: задачи-поручения ===== */

.task-form { margin-bottom: 12px; padding: 12px 14px; }
.task-form-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.task-form-title {
  flex: 1 1 260px; height: 34px; border: 1px solid var(--border); border-radius: 6px;
  padding: 0 11px; font-family: inherit; font-size: 13px;
}
.task-form-due {
  height: 34px; border: 1px solid var(--border); border-radius: 6px;
  padding: 0 8px; font-family: inherit; font-size: 12.5px;
}
.vtask-prio { color: #B3403A; font-size: 11px; font-weight: 700; text-transform: uppercase; }

/* ===== Sprint 104: «Контрольные точки» + библиотека шаблонов (дизайн «контрольные-точки») ===== */

/* Рабочий режим: шапка плана (одна строка; длинное имя — «…», клик раскрывает) */
.ctb-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ctb-title-box { flex: 1; min-width: 0; }
.ctb-title {
  font-size: 15px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.ctb-title.full { white-space: normal; overflow: visible; }
.ctb-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
/* Компактная сводка под заголовком: этапы, точки, проверено, замечания. */
.ctb-summary { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctb-summary-issues.has-issues { color: #B3403A; font-weight: 600; }
.ctb-hint { font-size: 12.5px; color: var(--text-muted); }
.ctb-approved {
  display: inline-flex; padding: 3px 9px; background: #E3EFE7; color: #2E6B4C;
  border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; flex: none;
}
.ctb-actions { margin-left: auto; display: flex; gap: 8px; flex: none; }
.ctb-assign-btn { height: 34px; padding: 0 14px; font-size: 13px; font-weight: 600; }
.ctb-edit-btn { height: 34px; padding: 0 14px; font-size: 13px; font-weight: 600; gap: 7px; border-color: #C9CDD2; }
.ctb-cancel { margin-left: auto; height: 32px; padding: 0 13px; color: var(--text-secondary); font-size: 12.5px; font-weight: 500; }

/* Карточка этапов */
.ctb-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.ctb-stage-wrap { border-bottom: 1px solid var(--border-divider); }
.ctb-stage-wrap:last-child { border-bottom: none; }
.ctb-stage { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.ctb-stage.selectable { cursor: pointer; }
.ctb-stage.locked { opacity: 0.55; }
.ctb-num { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--text-muted); width: 20px; flex: none; }
.ctb-stage-title { flex: 1; font-size: 13.5px; font-weight: 600; min-width: 0; }
.ctb-whole { color: var(--accent-hover); font-weight: 500; }
.ctb-progress {
  width: 120px; height: 4px; border-radius: 2px; background: var(--border-divider);
  overflow: hidden; flex: none; display: inline-block;
}
.ctb-progress i { display: block; height: 100%; background: var(--accent); }
.ctb-progress i.done { background: #2E7D52; }
.ctb-count { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--text-muted); width: 46px; text-align: right; flex: none; }
.ctb-count.ok { color: #2E6B4C; }
.ctb-chip { display: inline-flex; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; flex: none; }
.ctb-chip.accepted { background: #E3EFE7; color: #2E6B4C; }
.ctb-chip.in_progress { background: var(--accent-tint); color: var(--accent-hover); }
.ctb-chip.pending { background: var(--border-divider); color: #6B7178; }
.ctb-chev { font-size: 11px; color: var(--text-muted); background: none; border: none; height: auto; padding: 0 2px; flex: none; }
.ctb-chev:hover { background: none; color: var(--ink); }

/* Раскрытые точки этапа */
.ctb-points { padding: 0 16px 12px 48px; display: flex; flex-direction: column; background: #FBFBFC; }
.ctb-point { display: flex; align-items: center; gap: 10px; min-height: 40px; border-bottom: 1px solid #F0F2F4; padding: 4px 0; }
.ctb-point:last-child { border-bottom: none; }
.ctb-point.selectable { cursor: pointer; }
.ctb-mark {
  width: 22px; height: 22px; border-radius: 999px; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; flex: none; color: #fff;
}
.ctb-mark.accepted { background: #2E7D52; }
.ctb-mark.issue { background: #A8730A; }
.ctb-mark.pending { background: none; border: 1.5px solid var(--border); }
.ctb-point-main { flex: 1; min-width: 0; }
.ctb-point-title { font-size: 13px; }
.ctb-point-title.issue { font-weight: 500; }
.ctb-point-title.pending { color: var(--text-secondary); }
.ctb-req { font-family: ui-monospace, Menlo, monospace; font-size: 10.5px; color: var(--text-muted); margin-top: 1px; }
.ctb-req.strict { color: #A8730A; }
.ctb-when { font-size: 11.5px; color: var(--text-muted); flex: none; }
.ctb-when.muted { color: var(--text-disabled); }
.ctb-task-link { font-size: 11.5px; font-weight: 500; flex: none; }
.ctb-more { background: none; border: none; height: auto; color: var(--text-muted); font-size: 11.5px; padding: 8px 0 2px 32px; text-align: left; font-weight: 400; }
.ctb-more:hover { background: none; color: var(--ink); }

/* Режим «Поручить контроль»: чекбоксы и sticky-бар */
.ctb-check {
  width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  font-size: 11px; font-weight: 700; color: #fff; position: relative; background: #fff;
}
.ctb-check.on { background: var(--accent); border-color: var(--accent); }
.ctb-check.disabled { background: var(--bg); border-color: var(--border-soft); }
.ctb-check-part { position: absolute; inset: 3px; background: var(--accent); border-radius: 2px; opacity: 0.45; }
.ctb-stage.picked { background: #FBF8F6; }
.ctb-assignbar {
  position: sticky; top: 8px; margin: 0 0 14px; background: var(--ink); border-radius: 8px;
  padding: 12px 16px; display: flex; align-items: center; gap: 14px;
  box-shadow: 0 12px 32px rgba(32, 34, 38, 0.25); flex-wrap: wrap; z-index: 4;
}
.ctb-assignbar-text { font-size: 13px; color: #fff; font-weight: 500; }
.ctb-assignbar-total { color: #9BA1A8; }
.ctb-assignbar-controls { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ctb-free-toggle { display: inline-flex; align-items: center; gap: 7px; color: #fff; font-size: 12px; white-space: nowrap; }
.ctb-free-toggle input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.ctb-assignbar-select {
  height: 34px; min-width: 200px; background: #2E3237; border: 1px solid #3A3E44; border-radius: 6px;
  color: #fff; font-family: inherit; font-size: 12.5px; padding: 0 11px;
}
.ctb-assignbar-select.due { min-width: 110px; }
.ctb-assignbar-select.duedate { min-width: 140px; color-scheme: dark; }

/* Редактор: баннер режима правки утверждённого плана */
.cl-editbanner {
  background: var(--accent-tint); border: 1px solid #E7CDBC; border-radius: 8px;
  padding: 8px 8px 8px 14px; display: flex; align-items: center; gap: 12px; margin: 0 0 14px;
  min-width: 0;
}
.cl-editbanner-text { flex: 1; min-width: 0; font-size: 12.5px; color: #8A4B29; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-editbanner-save {
  height: 34px; padding: 0 13px; border: 1px solid #E7CDBC; background: #fff; color: #8A4B29;
  border-radius: 6px; font-size: 13px; font-weight: 500; flex: none; white-space: nowrap;
}
.cl-editbanner-save:hover { background: #FDFBFA; }
.cl-editbanner-finish { height: 34px; padding: 0 15px; font-size: 13px; font-weight: 600; flex: none; white-space: nowrap; }
.cl-lock { flex: none; font-size: 12px; }
.cl-point.locked { opacity: 0.75; }
.cl-point.locked .cl-point-text { color: var(--text-secondary); }
.cl-drag.disabled { color: var(--border-soft); cursor: default; }
.cl-lock-note { font-size: 12px; color: var(--text-muted); background: var(--surface-sunken); border-radius: 6px; padding: 7px 10px; margin-bottom: 10px; }

/* Диалог «Куда применить изменения?» */
.apply-overlay {
  position: fixed; inset: 0; background: rgba(32, 34, 38, 0.45);
  display: flex; align-items: center; justify-content: center; z-index: 60; padding: 16px;
}
.apply-dialog {
  background: #fff; border-radius: 10px; padding: 24px; width: 464px; max-width: 100%;
  box-shadow: 0 12px 32px rgba(32, 34, 38, 0.30); max-height: 90vh; overflow: auto;
}
.apply-title { font-size: 17px; font-weight: 700; }
.apply-sub { font-size: 12.5px; color: var(--text-muted); margin: 3px 0 16px; }
.apply-options { display: flex; flex-direction: column; gap: 8px; }
.apply-option {
  border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px;
  display: flex; gap: 11px; cursor: pointer;
}
.apply-option.selected { border: 1.5px solid var(--accent); background: #FBF6F2; }
.apply-radio {
  width: 18px; height: 18px; border-radius: 999px; border: 1.5px solid #C9CDD2; flex: none;
  margin-top: 1px; box-sizing: border-box; background: #fff;
}
.apply-radio.on { border: 5px solid var(--accent); }
.apply-option-title { font-size: 13.5px; font-weight: 600; }
.apply-option-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.45; margin-top: 2px; }
.apply-name { height: 36px; border: 1px solid var(--border); border-radius: 6px; padding: 0 11px; font-family: inherit; font-size: 13px; margin-top: 8px; width: 100%; }
.apply-buttons { display: flex; gap: 10px; margin-top: 16px; align-items: center; }
.apply-save { height: 40px; padding: 0 18px; font-size: 13.5px; font-weight: 600; }
.apply-cancel { color: var(--text-secondary); font-size: 13.5px; font-weight: 500; }

/* «Компания»: вкладки раздела */
.cmp-tabs {
  display: flex; gap: 2px; max-width: 100%; overflow-x: auto;
  border-bottom: 1px solid #E3E5E8; margin-bottom: 14px; font-size: 13px;
}
.cmp-tabs button {
  background: none; border: none; height: auto; padding: 8px 12px; color: var(--text-secondary);
  flex: none; white-space: nowrap; font-size: 13px; font-weight: 400; border-radius: 0;
}
.cmp-tabs button:hover { background: none; color: var(--ink); }
.cmp-tabs button.active { color: var(--ink); font-weight: 600; border-bottom: 2px solid var(--accent); margin-bottom: -1px; }

/* Библиотека шаблонов */
.lib-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.lib-h1 { font-size: 16px; font-weight: 700; }
.lib-head .cmp-btn-primary { margin-left: auto; }
.lib-paths { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.lib-path {
  background: #fff; border: 1.5px dashed #C9CDD2; border-radius: 8px; padding: 14px;
  text-align: center; height: auto; font-family: inherit; display: flex; flex-direction: column;
  gap: 3px; align-items: center; color: var(--ink); font-weight: 400;
}
.lib-path:hover { background: #fff; border-color: var(--accent); }
.lib-path b { font-size: 13px; font-weight: 600; }
.lib-path span { font-size: 11.5px; color: var(--text-muted); line-height: 1.45; }
/* Закрытая дорога добавления выглядит закрытой: пунктир бледнеет, курсор не
   обещает клика. Причина написана в самой карточке, а не приходит тостом. */
.lib-path:disabled { opacity: .55; cursor: not-allowed; }
.lib-path:disabled:hover { border-color: #C9CDD2; }
.lib-paths-note { font-size: 12px; color: var(--text-muted); margin: -6px 0 14px; }
.lib-path-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.lib-path-form select, .lib-path-form input {
  height: 36px; border: 1px solid var(--border); border-radius: 6px; font-family: inherit;
  font-size: 13px; padding: 0 10px; min-width: 200px;
}
.lib-row {
  display: grid; grid-template-columns: 2.1fr 1fr 1.1fr 0.9fr 0.9fr 0.3fr; gap: 12px;
  padding: 11px 16px; align-items: center;
}
.lib-row-head {
  padding: 9px 16px; border-bottom: 1px solid var(--border-soft);
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-muted);
}
.lib-name { font-size: 13.5px; font-weight: 600; }
.lib-version { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--text-muted); font-weight: 400; }
.lib-cell { font-size: 12.5px; color: var(--text-secondary); }
.lib-cell.muted { color: var(--text-muted); }
.lib-hint { margin-top: 10px; }

@media (max-width: 900px) {
  .lib-paths { grid-template-columns: 1fr; }
  .lib-row { grid-template-columns: 1.6fr 1fr 0.4fr; }
  .lib-row > div:nth-child(3), .lib-row > div:nth-child(4), .lib-row > div:nth-child(5) { display: none; }
  .ctb-assignbar-select { min-width: 150px; }
}

@media (max-width: 720px) {
  .ctb-assignbar { align-items: stretch; padding: 12px; }
  .ctb-assignbar-text, .ctb-assignbar-controls { width: 100%; }
  .ctb-assignbar-controls { margin-left: 0; align-items: stretch; }
  .ctb-assignbar-select, .ctb-assignbar-controls .ctb-assign-btn {
    width: 100%; min-width: 0; max-width: 100%;
  }
  .ctb-free-toggle { width: 100%; white-space: normal; }
  .visit-scheduler { align-items: stretch; }
  .visit-scheduler .vsch-field { width: 100%; min-width: 0; }
  .visit-scheduler .vsch-field select,
  .visit-scheduler .vsch-field input { width: 100%; min-width: 0; max-width: 100%; }
  .visit-scheduler > button { width: 100%; }
}

/* --- Sprint 105: жизненный цикл объекта (стадии, воронка, карточка до стройки) --- */

/* Пилюли-фильтры стадий */
.stage-pills { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.stage-pill {
  height: auto; padding: 5px 11px; border-radius: 999px; font-size: 12.5px;
  background: var(--surface); border: 1px solid var(--border); color: #5C636B; font-weight: 400;
}
.stage-pill:hover { border-color: #C05B2E; color: #A64E27; }
.stage-pill.active { background: #F6E9E1; border-color: #F6E9E1; color: #A64E27; font-weight: 600; }

/* Чипы стадий */
.lc-chip {
  display: inline-block; padding: 3px 8px; border-radius: 4px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.lc-chip.lc-design { background: #E6EDF5; color: #3B6EA5; }
.lc-chip.lc-contract_not_concluded { background: #ECEDEF; color: #5C636B; }
.lc-chip.lc-contract { background: #F4EAD2; color: #8F6209; }
.lc-chip.lc-construction { background: #F6E9E1; color: #A64E27; }
.lc-chip.lc-construction_in_progress { background: #F6E9E1; color: #A64E27; }
.pt-row.lc-build { background: #FBF8F6; }
.pt-row.lc-build:hover { background: #F7F2EE; }
.pt-step { font-size: 12.5px; color: #5C636B; }
.pt-updated { font-size: 12px; }

/* Степпер стадий в карточке */

/* Заблокированная вкладка «Контрольные точки» до стройки */
.object-tabs button.locked { color: #B3B8BE; cursor: default; }
.object-tabs button.locked:hover { color: #B3B8BE; border-color: transparent; }
.lc-locked-note { font-size: 13px; color: var(--text-muted); margin: 8px 0; }

/* Обзор стадии: чек-лист «Что нужно на этой стадии» */
.lc-checklist { display: flex; flex-direction: column; }
.lc-checkrow {
  display: flex; align-items: center; gap: 10px; min-height: 38px;
  border-bottom: 1px solid #F0F2F4; padding: 4px 0;
}
.lc-checkrow:last-child { border-bottom: none; }
.lc-checkmark {
  width: 20px; height: 20px; min-width: 20px; border-radius: 50%; padding: 0;
  background: var(--surface); border: 1.5px solid #D8DBDF; color: #fff; font-size: 11px;
  display: inline-flex; align-items: center; justify-content: center; height: 20px;
}
.lc-checkrow.done .lc-checkmark { background: #2E7D52; border-color: #2E7D52; }
.lc-checktext { flex: 1; font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
.lc-checkrow.done .lc-checktext { color: #5C636B; }
.lc-checkstate { font-size: 11.5px; color: #B3B8BE; white-space: nowrap; }
.lc-state-build { margin-top: 10px; }
.lc-state-build[hidden] { display: none; }
.lc-stagehint { font-size: 11.5px; color: var(--text-muted); margin: 10px 0 0; }

/* Документы стадии */
.lc-stagedocs .panel-title { display: flex; align-items: center; justify-content: space-between; }
button.lc-alldocs { background: none; border: none; height: auto; padding: 0; color: #C05B2E; font-size: 12px; font-weight: 500; }
button.lc-alldocs:hover { color: #A64E27; background: none; }
.lc-docrow { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid #F0F2F4; }
.lc-docrow:last-child { border-bottom: none; }
.lc-docrow b { display: block; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.lc-docrow small { font-size: 11.5px; color: var(--text-muted); }
.lc-docsempty { font-size: 12.5px; color: var(--text-muted); margin: 6px 0 0; }
.doc-tile {
  width: 30px; height: 30px; min-width: 30px; border-radius: 6px; background: var(--surface-sunken);
  color: #5C636B; font-size: 9px; font-weight: 700; font-family: ui-monospace, monospace;
  display: inline-flex; align-items: center; justify-content: center;
}

/* Сводка и «Заказчик ещё не приглашён» */
.lc-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.lc-note { font-size: 12.5px; color: var(--text-secondary, #5C636B); margin: 8px 0 0; }
.lc-invitecard {
  background: #F2F3F5; border: 1.5px dashed #C9CDD2; border-radius: 8px;
  padding: 12px 14px; margin-top: 14px;
}
.lc-invitecard b { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.lc-invitecard p { font-size: 12px; color: var(--text-muted); margin: 0 0 8px; }
.lc-advwarn { font-size: 12.5px; color: #8F6209; background: #F4EAD2; border-radius: 6px; padding: 8px 10px; margin: 8px 0; }

/* Модал «Новый объект»: плитки стадий и форма */
.lc-modal { max-width: 560px; }
.lc-tiles { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin: 10px 0 14px; }
.lc-tile {
  height: auto; padding: 9px 6px; border-radius: 8px; font-size: 12.5px; font-weight: 400;
  background: var(--surface); border: 1.5px solid #D8DBDF; color: #5C636B;
}
.lc-tile:hover { border-color: #C05B2E; color: #A64E27; }
.lc-tile.active { border-color: #C05B2E; background: #F6E9E1; color: #A64E27; font-weight: 700; }
.lc-drop {
  border: 1.5px dashed #C9CDD2; border-radius: 8px; padding: 14px; text-align: center;
  cursor: pointer; margin-bottom: 10px;
}
.lc-drop:hover, .lc-drop.dragover { border-color: #C05B2E; }
.lc-drop b { display: block; font-size: 13px; font-weight: 600; }
.lc-drop small { font-size: 11.5px; color: #8A9096; }
.lc-files { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.lc-filerow { display: flex; align-items: center; gap: 8px; }
.lc-filerow b { font-size: 12px; font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.lc-filerow .doc-tile { width: 28px; height: 28px; min-width: 28px; }
.lc-filestatus { font-size: 10.5px; color: var(--text-muted); white-space: nowrap; margin-left: auto; }
.lc-filestatus.ok { color: #2E7D52; }
.lc-or { display: flex; align-items: center; gap: 10px; margin: 10px 0; color: #8A9096; font-size: 11.5px; }
.lc-or::before, .lc-or::after { content: ""; flex: 1; height: 1px; background: var(--divider); }
/* Единая раскладка полей модала: метка над полем, поле на всю ширину колонки.
   Без этого базовый input (без width:100%) и inline-label «разъезжаются». */
.lc-form { display: flex; flex-direction: column; gap: 10px; }
.lc-modal .field { display: flex; flex-direction: column; gap: 4px; margin: 0; min-width: 0; }
.lc-modal .field label {
  font-size: 12px; font-weight: 500; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lc-modal .field input, .lc-modal .field select, .lc-modal .field textarea {
  width: 100%; box-sizing: border-box;
}
.lc-fieldrow { display: flex; gap: 10px; align-items: flex-start; }
.lc-fieldrow .field { flex: 1; min-width: 0; }
.lc-fieldrow .lc-grow { flex: 1.4; }
.lc-tag { color: #2E7D52; font-size: 10.5px; margin-left: 6px; text-transform: none; letter-spacing: 0; }
input.lc-recognized, textarea.lc-recognized { border-color: #BFD9CA; background: #FBFDFB; }
.lc-create-actions { display: flex; gap: 8px; margin-top: 14px; }
.lc-create-actions button { height: 40px; }
.lc-create { flex: 1; }
.lc-cancel { flex: 0 0 auto; }
.lc-hint { font-size: 11.5px; color: var(--text-muted); text-align: center; margin: 8px 0 0; }
.lc-altpath { text-align: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--divider); }
.lc-altpath .link { font-size: 12.5px; }

@media (max-width: 720px) {
  /* Мобильная строка воронки: чип стадии — в правый верхний угол */
  .pt-row > .pt-cell:nth-child(5) { grid-column: 1 / -1; grid-row: auto; justify-self: start; }
  .pt-row > .pt-cell:nth-child(2) { grid-column: 2; grid-row: 1; justify-self: end; }
  .lc-fieldrow { flex-direction: column; gap: 10px; }
}

/* --- Sprint 106: кабинет v2 (дизайн «кабинет-прототип-v2») --- */

/* Каркас разделов */
.v2-screen { min-width: 0; }
.screen-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.screen-head h1 { margin: 0; font-size: 19px; font-weight: 700; }
.v2-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
button.v2-secondary {
  height: 34px; padding: 0 13px; border: 1px solid #D8DBDF; background: var(--surface);
  color: var(--ink); border-radius: 6px; font-size: 13px; font-weight: 500; white-space: nowrap;
}
button.v2-secondary:hover { background: var(--surface-sunken); }
.v2-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.v2-panel-title { padding: 11px 14px; border-bottom: 1px solid var(--divider); font-size: 14px; font-weight: 600; }
.v2-empty-row { padding: 12px 14px; font-size: 12.5px; color: var(--text-muted); }
.v2-hidden-card {
  background: var(--surface-sunken); border: 1px dashed #C9CDD2; border-radius: 8px; padding: 14px;
}
.v2-hidden-card b { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.v2-hidden-card p { margin: 0; font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

/* Топбар: колокольчик уведомлений */
button.bell {
  position: relative; width: 30px; height: 30px; min-width: 30px; padding: 0;
  border: 1px solid #E0E2E5; border-radius: 6px; background: var(--surface);
  font-size: 13px; color: #5C636B; display: inline-flex; align-items: center; justify-content: center;
}
button.bell:hover { background: var(--surface-sunken); }
.bell-badge {
  position: absolute; top: -4px; right: -4px; min-width: 15px; height: 15px;
  background: #C05B2E; color: #fff; border-radius: 999px; font-size: 9.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}

/* Главная: KPI и панели */
.dash-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 16px; }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.kpi-card b { display: block; font-size: 22px; font-weight: 700; }
.kpi-card span { font-size: 12px; color: #5C636B; }
.kpi-card.danger { border-color: #E5BAB4; }
.kpi-card.danger b { color: #B3403A; }
.kpi-card.warn { border-color: #E2CBA0; }
.kpi-card.warn b { color: #A8730A; }
.dash-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 16px; align-items: start; }
.attn-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-bottom: 1px solid var(--divider); cursor: pointer; font-size: 13px;
}
.attn-row:last-child { border-bottom: none; }
.attn-row:hover { background: #FBF8F6; }
.attn-dot { width: 8px; height: 8px; border-radius: 999px; flex: none; background: #A8730A; }
.attn-dot.danger { background: #B3403A; }
.attn-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.attn-cta { font-size: 12px; color: #C05B2E; font-weight: 500; white-space: nowrap; }
.upc-row {
  display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--divider);
  font-size: 13px; cursor: pointer;
}
.upc-row:last-child { border-bottom: none; }
.upc-row:hover { background: #FBF8F6; }
.upc-when {
  font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: #8A9096;
  width: 74px; flex: none;
}

@media (max-width: 1100px) {
  .dash-kpis { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
}

/* --- Sprint 106 W2: раздел «Объекты» — 4 вида --- */

.obj-views {
  display: flex; border: 1px solid #D8DBDF; border-radius: 6px; overflow: hidden;
  background: var(--surface);
}
.obj-view {
  height: auto; padding: 6px 13px; font-size: 12.5px; color: #5C636B; font-weight: 400;
  background: var(--surface); border: none; border-radius: 0;
}
.obj-view + .obj-view { border-left: 1px solid var(--border-soft); }
.obj-view:hover { background: var(--surface-sunken); }
.obj-view.active { background: #F6E9E1; color: #A64E27; font-weight: 600; }
.obj-filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }

/* Стандартная таблица: 8 согласованных колонок; адрес остаётся под объектом. */
.pt-head, .pt-row {
  grid-template-columns: 1.7fr .9fr .85fr .8fr .65fr .9fr 2.05fr .65fr;
  gap: 8px; padding-left: 12px; padding-right: 12px;
}
.pt-progress { display: flex; align-items: center; gap: 6px; }
.pt-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--divider); overflow: hidden; }
.pt-bar i { display: block; height: 100%; background: #C05B2E; }
.pt-progress span {
  font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: #8A9096;
}
.pt-defects { color: #B3403A; font-weight: 600; }
.pt-edit-cell {
  display: block; width: 100%; min-width: 0; height: auto; padding: 5px 7px;
  border: 1px dashed transparent; border-radius: 6px; background: transparent;
  color: var(--ink); font: inherit; text-align: left; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.pt-edit-cell:hover { border-color: var(--border); background: var(--surface-sunken); }
.pt-plan-cell {
  color: var(--accent-hover); white-space: normal; overflow: visible;
  text-overflow: clip; overflow-wrap: anywhere; line-height: 1.35;
}
.object-editor-dialog textarea { width: 100%; min-height: 110px; resize: vertical; }
.object-editor-error { min-height: 18px; margin: 8px 0 0; color: var(--status-danger); font-size: 12px; }
.chip-status.critical { background: #B3403A; color: #fff; border-color: #B3403A; }
.chip-status.danger { border-color: #E5BAB4; color: #B3403A; }

/* Канбан */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; align-items: start; }
.kanban-col { background: var(--surface-sunken); border: 1px solid #E3E5E8; border-radius: 8px; padding: 10px; }
.kanban-title { font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.kanban-card {
  background: var(--surface); border: 1px solid #E0E2E5; border-radius: 6px;
  padding: 10px 12px; margin-bottom: 8px; cursor: pointer;
}
.kanban-card:last-child { margin-bottom: 0; }
.kanban-card:hover { background: #FBF8F6; }
.kanban-card.trouble { border-color: #E5BAB4; }
.kanban-name { font-size: 12.5px; font-weight: 600; }
.kanban-sub { font-size: 11px; color: #8A9096; }
.kanban-sub.danger { color: #B3403A; }

/* Трасса */
.trassa-legend {
  display: flex; align-items: center; gap: 6px; margin-bottom: 10px;
  font-size: 11.5px; color: #5C636B; flex-wrap: wrap;
}
.trassa-swatch { width: 10px; height: 10px; border-radius: 3px; margin-left: 6px; }
.trassa-swatch:first-child { margin-left: 0; }
.trassa-note { margin-left: auto; color: #8A9096; }
.trassa {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 16px 16px 12px; position: relative;
}
.trassa-zone {
  position: absolute; right: 18px; font-family: ui-monospace, Menlo, monospace;
  font-size: 9px; letter-spacing: 0.06em;
}
.trassa-zone.top { top: 20px; color: #B98A6E; }
.trassa-zone.bottom { bottom: 18px; color: #9BB3A4; }
.trassa-lane { display: grid; grid-template-columns: repeat(var(--trassa-cols, 8), 1fr); gap: 4px; }
.trassa-lane.top .trassa-cell { height: 64px; }
.trassa-lane.bottom .trassa-cell { height: 56px; }
.trassa-cell { border-left: 2px solid #E3E5E8; position: relative; }
.trassa-chip {
  position: absolute; left: -14px; width: 32px; height: 32px; min-width: 32px;
  border-radius: 8px; background: var(--surface); border: 2px solid #D8DBDF;
  color: var(--ink); font-size: 11px; font-weight: 700; padding: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(32, 34, 38, 0.12); cursor: pointer;
  transition: transform 0.18s ease, top 0.18s ease;
}
/* Sprint 108: стек-веер — при hover фишки раскрываются в ряд (дизайн v2). */
.trassa-stack:hover { z-index: 6; }
.trassa-stack:hover .trassa-chip {
  top: 4px !important;
  transform: translateX(var(--fan-x, 0px));
  z-index: 6;
}
.trassa-stack:hover .trassa-chip:hover {
  border-color: var(--ink);
  z-index: 7;
}
.trassa-chip:hover { background: #FBF8F6; }
.trassa-chip.tone-ok { border-color: #2E7D52; }
.trassa-chip.tone-warn { border-color: #A8730A; }
.trassa-chip.tone-danger, .trassa-chip.tone-critical { border-color: #B3403A; }
.trassa-dot {
  position: absolute; top: -5px; right: -5px; width: 11px; height: 11px;
  border-radius: 999px; background: #B3403A; border: 2px solid #fff;
}
.trassa-dot.warn { background: #A8730A; }
.trassa-scale {
  display: grid; grid-template-columns: repeat(var(--trassa-cols, 8), 1fr); gap: 4px;
  border-top: 2px solid #24262A; padding: 8px 0;
}
.trassa-stage { font-size: 10px; color: #5C636B; line-height: 1.3; }
.trassa-stage span { font-family: ui-monospace, Menlo, monospace; color: #8A9096; }
.trassa-caption { font-size: 11px; color: #8A9096; margin-top: 8px; line-height: 1.5; }

/* Бесплатная пилотная карта: MapLibre + OpenFreeMap. */
.objmap {
  position: relative; height: 440px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border);
  background: #E8EAED;
}
.objmap .maplibregl-ctrl button,
.location-picker-map .maplibregl-ctrl button {
  min-width: 29px; height: 29px; padding: 0; border: 0; border-radius: 0;
  background-color: transparent; box-shadow: none;
}
.objmap-marker {
  width: 28px; height: 28px; border: 3px solid #fff; border-radius: 50% 50% 50% 8px;
  background: var(--accent); box-shadow: 0 3px 10px rgba(32, 34, 38, .28);
  transform: rotate(-45deg); cursor: pointer;
}
.objmap-popup b { display: block; margin-bottom: 3px; font-size: 13px; }
.objmap-popup span { display: block; max-width: 260px; color: var(--text-secondary); font-size: 12px; }
.objmap-popup-actions { display: flex; gap: 10px; margin-top: 8px; font-size: 12px; }
.objmap-popup-actions a { color: var(--accent); }
.objmap-status {
  position: absolute; z-index: 2; left: 12px; bottom: 12px; max-width: min(390px, calc(100% - 24px));
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 7px;
  background: rgba(255, 255, 255, .94); color: var(--text-secondary); font-size: 12px;
  box-shadow: 0 2px 8px rgba(32, 34, 38, .12);
}
.location-field-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.location-field-row button { flex: none; }
.location-field-row span { color: var(--text-secondary); font-size: 12px; }
.location-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.location-card-actions button, .location-card-actions a {
  min-height: 34px; padding: 7px 11px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--surface); color: var(--text-primary); font-size: 12px; text-decoration: none;
}
.location-picker { width: min(760px, calc(100vw - 24px)); max-width: 760px; }
.location-picker-map {
  height: min(480px, 58vh); margin: 12px 0; border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden; background: #E8EAED;
}
.location-picker-help { margin: 0; color: var(--text-secondary); font-size: 12px; }
.location-picker-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.location-picker-error { min-height: 18px; color: var(--status-danger); font-size: 12px; }

@media (max-width: 1100px) {
  .kanban { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .kanban { grid-template-columns: 1fr; }
  .obj-views { flex-wrap: wrap; }
  .objmap { height: 390px; }
  .location-picker-map { height: 50vh; }
}

/* Мобильная строка: имя + срок ГПР, прочие колонки — стеком. */
@media (max-width: 720px) {
  .pt-row { grid-template-columns: 1fr auto; }
  .pt-row > .pt-cell { grid-column: 1 / -1; grid-row: auto; justify-self: start; }
  .pt-row > .pt-cell:first-child { grid-column: 1; }
  .pt-row > .pt-cell:nth-child(2),
  .pt-row > .pt-cell:nth-child(5) { grid-column: 1 / -1; grid-row: auto; justify-self: start; }
  .pt-row > .pt-cell:nth-child(8) { grid-column: 2; grid-row: 1; justify-self: end; }
  .pt-edit-cell { width: 100%; }
  .internal-info-grid { grid-template-columns: 1fr; }
}

/* --- Sprint 106 W3: карточка объекта v2 --- */
.object-title-box { min-width: 0; }
.object-meta { font-size: 12px; color: #8A9096; margin-top: 3px; overflow-wrap: anywhere; }
.tab-badge { color: #B3403A; font-weight: 600; }

/* Обзор v2: стоп-точка */
.stop-panel { border-color: #E5BAB4; }
.stop-title { color: #B3403A; }
.stop-text { font-size: 13px; line-height: 1.5; margin: 0 0 8px; }
button.stop-link { background: none; border: none; height: auto; padding: 0; color: #C05B2E; font-size: 12.5px; font-weight: 500; }
button.stop-link:hover { color: #A64E27; background: none; }

/* Вкладка ГПР: список этапов */
.gpr-stage-row {
  display: flex; align-items: center; gap: 8px; padding: 5px 14px;
  border-bottom: 1px solid #F5F6F7; font-size: 11.5px; color: #3F444B;
}
.gpr-stage-row:last-child { border-bottom: none; }
.gpr-stage-row.current { font-weight: 600; color: var(--ink); }
.gpr-num { font-family: ui-monospace, Menlo, monospace; font-size: 10px; color: #8A9096; }
.gpr-stage-row.current .gpr-num { color: #C05B2E; }

/* Sprint 111 (волна D): ГПР — Гант + прогноз + режим корректировки. */
.gpr-forecast-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  background: #F9E7E5; border: 1px solid #E5BAB4; border-radius: 8px;
  padding: 10px 12px; font-size: 12.5px; margin-bottom: 12px;
}
.gpr-forecast-banner button { margin-left: auto; }
.gpr-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.gpr-toolbar button { margin-left: auto; }
.gpr-correct-banner {
  background: #F6E9E1; border: 1px solid #E4C7B4; border-radius: 8px;
  padding: 8px 12px; font-size: 12px; color: #8f5a34; margin-bottom: 10px;
}
.gpr-gantt {
  position: relative; border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; background: var(--surface);
}
.gpr-months {
  font-family: ui-monospace, Menlo, monospace; font-size: 10.5px; color: var(--text-muted);
  padding: 6px 14px 6px 224px; background: #F6F7F8; border-bottom: 1px solid #EEF0F2;
}
.gpr-row {
  position: relative; display: flex; flex-wrap: wrap; align-items: center;
  border-bottom: 1px solid #F5F6F7; min-height: 30px;
}
.gpr-row:last-child { border-bottom: none; }
.gpr-row.done { background: #FBFDFB; }
.gpr-row-label {
  width: 210px; flex: none; display: flex; align-items: center; gap: 8px;
  padding: 4px 8px 4px 14px; min-width: 0;
}
.gpr-row-name { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gpr-track { position: relative; flex: 1; height: 20px; min-width: 0; }
.gpr-bar {
  position: absolute; top: 5px; height: 10px; border-radius: 3px; min-width: 3px;
}
.gpr-bar-plan { background: #EEF0F2; border: 1px solid #D8DBDF; }
.gpr-bar-fact { background: #2E7D52; }
.gpr-bar-forecast { background: #FBF6F2; border: 1px dashed #C9A08A; }
.gpr-bar-overrun { background: #B3403A; }
.gpr-bar-milestone { border-radius: 2px; transform: rotate(0deg); box-shadow: 0 0 0 1.5px #A8730A inset; }
.gpr-row-dates {
  width: 190px; flex: none; text-align: right; padding: 0 14px;
  font-family: ui-monospace, Menlo, monospace; font-size: 10.5px; color: var(--text-muted);
}
.gpr-nodate { font-size: 11px; color: var(--text-muted); padding-left: 4px; }
.gpr-today {
  position: absolute; top: 26px; bottom: 0; width: 0;
  border-left: 1.5px dashed #B3403A; pointer-events: none;
}
.gpr-legend {
  display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px;
  font-size: 11px; color: var(--text-muted);
}
.gpr-swatch { display: inline-block; width: 14px; height: 8px; border-radius: 2px; vertical-align: middle; }
.gpr-correct-form {
  width: 100%; flex-basis: 100%; order: 3; padding: 8px 14px 10px;
  background: #FBF8F6; border-top: 1px dashed #E4C7B4;
}
.gpr-cf-line { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin-bottom: 6px; }
.gpr-cf-field { display: flex; flex-direction: column; gap: 2px; font-size: 10.5px; color: var(--text-muted); }
.gpr-cf-line input[type="text"] { flex: 1; min-width: 140px; }

/* Отчёты и замечания: цепочка статусов */
.report-flow {
  display: flex; align-items: center; gap: 6px; margin-bottom: 12px;
  font-size: 11.5px; color: #8A9096; flex-wrap: wrap;
}
.report-flow-note { margin-left: 12px; }

/* Параметры v2: карточки-группы */
.param-group {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; margin-bottom: 12px;
}
.param-group-title {
  padding: 8px 14px; background: var(--bg-canvas); border-bottom: 1px solid var(--divider);
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: #5C636B;
}
.param-group .param-readrow { padding: 8px 14px; border-bottom: 1px solid #F5F6F7; }
.param-group .param-readrow:last-child { border-bottom: none; }

/* --- Sprint 106 W5: разделы Задачи / Выезды / Субподрядчики / Аналитика / Журнал --- */

/* Задачи компании */
.vtask-head, .vtask-row {
  display: grid; grid-template-columns: 2.2fr 1.2fr 1fr 0.8fr 1fr 0.3fr;
  gap: 10px; padding: 10px 14px; align-items: center;
}
.vtask-head {
  border-bottom: 1px solid var(--border-soft); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; color: #8A9096; padding: 9px 14px;
}
.vtask-row { border-bottom: 1px solid var(--divider); font-size: 12.5px; cursor: pointer; }
.vtask-row:last-child { border-bottom: none; }
.vtask-row:hover { background: #FBF8F6; }
.vtask-row.overdue { background: #FDF7F6; }
.vtask-title { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.vtask-project { color: #C05B2E; }
.vtask-due-overdue { color: #B3403A; font-weight: 600; }
.pill.info { background: #E6EDF5; color: #3B6EA5; }

/* Календарь выездов */
.vweek { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 12px; }
.vday {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px; min-height: 120px;
}
.vday.today { background: #FBF8F6; border: 1.5px solid #C05B2E; }
.vday.problem { border-color: #E5BAB4; }
.vday-title { font-size: 11px; font-weight: 600; color: #8A9096; margin-bottom: 8px; }
.vday.today .vday-title { color: #A64E27; }
.vday-item {
  border-radius: 6px; padding: 8px; font-size: 11.5px; line-height: 1.4;
  margin-bottom: 6px; cursor: pointer;
}
.vday-item:last-child { margin-bottom: 0; }
.vday-item.done { background: #E3EFE7; }
.vday-item.planned { background: #E6EDF5; }
.vday-item.unassigned { background: #F9E7E5; border: 1px dashed #E5BAB4; }
.vday-item.unassigned b { color: #B3403A; }
.vday-assign { color: #C05B2E; font-weight: 600; }

/* Субподрядчики: пилюли-специализации */
.subs-pills { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.subs-pill {
  display: inline-flex; padding: 4px 10px; border: 1px solid #D8DBDF; color: #5C636B;
  border-radius: 999px; font-size: 12px; background: var(--surface);
}
.subs-pill.active { background: #F6E9E1; border-color: #F6E9E1; color: #A64E27; font-weight: 600; }
.subs-pill { cursor: pointer; }

/* Sprint 111 (волна E): таблица + форма субподрядчиков. */
.subs-head, .subs-row {
  display: grid; grid-template-columns: 1.7fr 1.1fr 1.4fr 0.9fr 0.9fr 0.4fr;
  gap: 10px; align-items: center; padding: 8px 12px;
}
.subs-head {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
}
.subs-row { border-bottom: 1px solid #F5F6F7; font-size: 12.5px; }
.subs-row:hover { background: #FBF8F6; }
.subs-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.subs-contact { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; }
.sub-form {
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface-sunken);
  padding: 12px 14px; margin-bottom: 14px; display: flex; flex-wrap: wrap;
  align-items: flex-end; gap: 10px;
}
.sub-form-title { width: 100%; font-size: 13px; font-weight: 700; }
.sub-field { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--text-muted); }
.sub-field input[type="text"], .sub-field select { min-width: 150px; }
.sub-form-checks { display: flex; flex-wrap: wrap; gap: 4px 12px; max-width: 420px; }
.sub-form-checks label { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--ink); }

/* Sprint 111 (волна F): план-факт аналитики + панель шаблонов задач. */
.pf-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 12px; }
.pf-name { width: 150px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-track { flex: 1; height: 12px; background: #EEF0F2; border-radius: 3px; min-width: 0; }
.pf-bar { height: 12px; border-radius: 3px; min-width: 2px; }
.pf-ok { background: #2E7D52; }
.pf-warn { background: #E2CBA0; }
.pf-danger { background: #B3403A; }
.pf-val { width: 44px; flex: none; text-align: right; font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; }
.task-templates { border: 1px solid var(--border); border-radius: 8px; background: var(--surface-sunken); padding: 12px 14px; margin-bottom: 14px; }
.tpl-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.tpl-form input[type="text"] { flex: 1; min-width: 160px; }
.tpl-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid #F5F6F7; font-size: 12.5px; }
.tpl-row > div:first-child { flex: 1; min-width: 0; }
.tpl-meta { color: var(--text-muted); font-size: 11.5px; }

/* Аналитика */
.analytics-kpis { grid-template-columns: repeat(4, 1fr); }

/* Журнал компании */
.log-note { font-size: 11.5px; color: #8A9096; margin: -8px 0 10px; }
.log-day {
  padding: 7px 14px; background: var(--bg-canvas); border-bottom: 1px solid var(--divider);
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: #8A9096;
}
.log-row {
  display: flex; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--divider);
  align-items: baseline; font-size: 13px; cursor: pointer;
}
.log-row:last-child { border-bottom: none; }
.log-row:hover { background: #FBF8F6; }
.log-time {
  font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: #8A9096;
  width: 38px; flex: none;
}
.log-text { overflow-wrap: anywhere; }
.log-project { color: #C05B2E; }
/* Событие уровня компании (роли): объекта у него нет и открывать нечего —
   курсор не должен обещать переход в карточку. */
.log-row-flat { cursor: default; }

/* Задача 8: реестр изменений и согласований объекта. */
.changes-pending {
  margin: 6px 0 12px; font-size: 13px; font-weight: 600; color: #B3403A;
}
.changes-pending.muted { color: #8A9096; font-weight: 400; }
.change-row {
  border: 1px solid var(--divider); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 10px; background: #fff;
}
.change-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.change-title { font-size: 14px; }
.change-cat { font-size: 11.5px; color: #8A9096; }
.change-values {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 8px 0; font-size: 13px;
}
.change-was { color: #8A9096; text-decoration: line-through; }
.change-arrow { color: #C05B2E; }
.change-new { font-weight: 600; }
.change-reason, .change-meta { font-size: 12px; color: #8A9096; margin-top: 4px; }
.change-actions { display: flex; gap: 10px; margin-top: 10px; }
.change-roles { display: flex; flex-direction: column; gap: 4px; }
.change-role { display: flex; align-items: center; gap: 6px; font-size: 13px; }

@media (max-width: 1100px) {
  .vweek { grid-template-columns: repeat(2, 1fr); }
  .vtask-head { display: none; }
  .vtask-row { grid-template-columns: 1fr auto; }
  .vtask-row > div { grid-column: 1 / -1; }
  .analytics-kpis { grid-template-columns: repeat(2, 1fr); }
}

/* Задача 22: задачи офиса по объекту — в карточке рядом с композером. */
.ptasks { margin-top: 14px; }
.ptask-row {
  display: grid;
  grid-template-columns: 1fr 140px 96px 104px;
  gap: 8px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--divider);
  font-size: 12.5px;
}
.ptask-row:last-child { border-bottom: none; }
.ptask-title { font-weight: 500; }
.ptask-who, .ptask-due { color: var(--text-secondary); }
@media (max-width: 720px) {
  .ptask-row { grid-template-columns: 1fr auto; }
}

/* Этап 6: «Компания → Роли и права» — список ролей слева, форма роли справа. */
.roles-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.role-row { display: flex; align-items: flex-start; gap: 16px; padding: 12px 16px; }
.role-main { flex: 1; min-width: 0; }
.role-name { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.role-desc { margin-top: 3px; font-size: 12.5px; color: var(--text-secondary); }
.role-perms { margin-top: 4px; font-size: 11.5px; color: var(--text-muted); line-height: 1.5; }
.role-side { flex: none; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.role-row-system { background: var(--surface-sunken); border-top: 1px solid var(--divider); }
.role-system-badge {
  padding: 2px 7px; border-radius: 999px; background: #EAF1F8;
  color: #35658F; font-size: 10.5px; font-weight: 600;
}
.roles-section-head { border-bottom: 0; }
.roles-section-hint {
  margin: -4px 16px 12px; color: var(--text-muted); font-size: 12px; line-height: 1.5;
}
.roles-section-divider { height: 12px; border-top: 1px solid var(--divider); background: var(--bg-canvas); }
.role-members { padding: 0 16px 12px; }
.role-member { font-size: 12.5px; padding: 2px 0; }
.roles-empty { padding: 18px 16px; }
.roles-empty b { font-size: 13px; }
.roles-empty p { margin: 6px 0 0; max-width: 460px; font-size: 12.5px; color: var(--text-muted); line-height: 1.6; }
.role-form textarea {
  border: 1px solid var(--border); border-radius: 6px; padding: 7px 10px;
  font-family: inherit; font-size: 12.5px; resize: vertical;
}
.role-perm-grid { display: flex; flex-direction: column; gap: 7px; margin: 8px 0 12px; }
.role-perm { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.role-form-buttons { display: flex; align-items: center; gap: 8px; }

/* Роль сотрудника — отдельной строкой внутри ⋯-меню на экране «Сотрудники». */
.emp-role-box { display: flex; align-items: center; gap: 10px; width: 100%; flex-wrap: wrap; }
.emp-role-box .cmp-label { flex: none; }
.cmp-create-role { display: block; margin-top: 6px; text-align: left; }

.clients-card { overflow: hidden; }
.client-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(130px, .8fr) minmax(180px, 1fr) 90px auto;
  gap: 12px;
  align-items: center;
  min-height: 52px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
}
.client-row:last-child { border-bottom: none; }
.client-row-head { min-height: 36px; color: var(--text-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.client-name { font-weight: 600; }
.client-project { justify-self: start; text-align: left; }

@media (max-width: 1180px) {
  .roles-layout { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .role-row { flex-direction: column; gap: 6px; }
  .role-side { white-space: normal; }
  .client-row-head { display: none; }
  .client-row { grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; padding: 12px; }
  .client-row > :nth-child(1), .client-row > :nth-child(3) { grid-column: 1; }
  .client-row > :nth-child(2), .client-row > :nth-child(4) { grid-column: 2; }
  .client-row > :nth-child(5) { grid-column: 1 / -1; justify-self: stretch; }
}

/* Задача 11: конфигурируемый ГПР — график объекта и редактор шаблона. */
.sched-start { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sched-label { color: var(--muted); font-size: 12px; }
.sched-date, .sched-select, .sched-input { border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 8px; font: inherit; background: var(--card);
  color: var(--ink); }
.sched-duration { width: 64px; border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 8px; font: inherit; background: var(--card); color: var(--ink); }
.sched-chip { border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px;
  font-size: 12px; color: var(--muted); }
.sched-chip.overdue { border-color: #E5484D; color: #E5484D; }
.sched-table { display: flex; flex-direction: column; gap: 2px; overflow-x: auto; }
.sched-row { display: grid; grid-template-columns:
  minmax(180px, 2fr) minmax(120px, 1fr) 70px minmax(150px, 1fr) minmax(150px, 1fr)
  110px 90px minmax(160px, 2fr); gap: 8px; align-items: center; padding: 6px 4px;
  border-bottom: 1px solid var(--line); font-size: 13px; }
.sched-row-head { color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); }
.sched-cell { overflow: hidden; text-overflow: ellipsis; }
.sched-name { font-weight: 500; }
.sched-flag { font-size: 11px; color: var(--accent, #2E7D32); }
.sched-flag.muted { color: var(--muted); }
.sched-stage { display: flex; align-items: center; gap: 12px; margin-top: 12px;
  padding: 6px 4px; }
.sched-stage-name { font-weight: 600; }
.sched-state { border-radius: 999px; padding: 2px 8px; font-size: 12px;
  border: 1px solid var(--line); }
.sched-state.done { border-color: #2E7D32; color: #2E7D32; }
.sched-state.in_progress { border-color: #1F6FEB; color: #1F6FEB; }
.sched-state.overdue { border-color: #E5484D; color: #E5484D; }
.sched-dev.late { color: #E5484D; }
.sched-dev.early { color: #2E7D32; }
.sched-chart { position: relative; height: 14px; background: var(--line);
  border-radius: 7px; display: block; }
.sched-bar { position: absolute; top: 0; height: 14px; border-radius: 7px;
  background: #1F6FEB; }
.sched-bar.done { background: #2E7D32; }
.sched-bar.overdue { background: #E5484D; }
.sched-bar.not_started { background: #8A94A6; }
.sched-actions { grid-column: 1 / -1; display: flex; gap: 12px; }
.sched-work-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 8px 4px; }
.sched-empty { display: flex; flex-direction: column; gap: 8px; }
.sched-empty-title { font-weight: 600; }
.sched-apply { display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 8px; }
.sched-replace { margin-top: 12px; }
.sched-compact { display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px; align-items: center; }
.sched-compact-line { display: flex; justify-content: space-between; gap: 12px;
  align-items: baseline; grid-column: 1 / -1; }
.sched-compact-current { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-weight: 600; }
.sched-compact-progress { flex: none; color: var(--muted); font-size: 12px; }
.sched-compact-meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted);
  font-size: 12px; align-items: center; min-width: 0; }
.sched-compact-empty { color: var(--muted); font-size: 13px; }
.sched-compact-bar { width: 100%; height: 4px; overflow: hidden; border-radius: 999px;
  background: var(--surface-sunken); grid-column: 1 / -1; }
.sched-compact-bar > i { display: block; height: 100%; border-radius: inherit;
  background: var(--status-ok); transition: width .15s ease; }
.sched-compact-action { grid-column: 2; grid-row: 2; height: 30px; padding: 3px 10px; }
.sched-compact > .cmp-link-btn:not(.sched-compact-action) {
  grid-column: 1 / -1; justify-self: start; height: auto;
}
.sched-dash-row { display: flex; flex-direction: column; gap: 5px; padding: 10px 14px;
  border-bottom: 1px solid var(--line); }
.sched-dash-row:last-child { border-bottom: none; }
.sched-dash-row > .cmp-link-btn { align-self: flex-start; height: auto; text-align: left; }
.sched-dash-slot { min-width: 0; }
.sched-editor { margin-top: 16px; }
.sched-editor-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sched-tpl-row { align-items: center; }
.sched-tpl-stage { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.sched-tpl-stage-head { display: flex; gap: 12px; align-items: center; }
.sched-tpl-work { display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 4px 0 4px 16px; font-size: 13px; }
.sched-tpl-work-name { font-weight: 500; }
.sched-tpl-add, .sched-tpl-publish { display: flex; gap: 8px; align-items: center;
  margin-top: 12px; }
.sched-tpl-versions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
@media (max-width: 1100px) {
  .sched-row { grid-template-columns: minmax(140px, 2fr) 60px minmax(120px, 1fr)
    100px minmax(120px, 1fr); }
  .sched-row .sched-cell:nth-child(2), .sched-row .sched-cell:nth-child(5) { display: none; }
}

/* Задача 11.1: выбор рабочей недели. */
.sched-week { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sched-week-day { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px;
  color: var(--muted); }
/* OFFICE-12.1 + приёмка 12.2 + читаемость UX-1: диаграмма Ганта ГПР.
   Один контейнер прокрутки: панель работ закреплена слева, календарная шапка —
   сверху. Высоты строк должны совпадать с GANTT_ROW_H / GANTT_STAGE_H в app.js. */
.gantt-panel { display: flex; flex-direction: column; gap: 12px; --gantt-side: 360px;
  --gantt-navy: #17324A; --gantt-orange: #C75A2C; --gantt-green: #2F855A;
  --gantt-red: #BD3F3F; --gantt-blue: #2F7CCB; --gantt-plan: #CFD5DA;
  --gantt-future: #E9EDF0; }
/* Фокус-режим разворачивает график внутри страницы: Fullscreen API увёл бы из
   кабинета и сломал бы возврат по Esc. */
.gantt-panel.focus { position: fixed; inset: 0; z-index: 1000; overflow: hidden;
  height: 100vh; box-sizing: border-box; background: var(--card, #fff);
  padding: 14px; }
.gantt-panel.focus .gantt { flex: 1; min-height: 0; max-height: none; }
.gantt-toolbar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center;
  justify-content: space-between; }
.gantt-views, .gantt-scales, .gantt-modes { display: flex; gap: 4px; flex-wrap: wrap; }
.gantt-views { margin-right: 4px; }
.gantt-modes { margin-left: auto; }
.gantt-view, .gantt-mode { border: 1px solid var(--line); background: transparent;
  border-radius: 8px; padding: 4px 10px; font-size: 12px; cursor: pointer; color: inherit; }
.gantt-view:hover, .gantt-mode:hover { border-color: var(--gantt-orange); }
.gantt-view.active, .gantt-mode.active { border-color: var(--gantt-orange);
  color: var(--gantt-orange); font-weight: 600; background: #FAEBE4; }
.gantt-scale { border: 1px solid var(--line); background: transparent; border-radius: 8px;
  padding: 4px 12px; font-size: 12px; cursor: pointer; color: inherit; }
.gantt-scale:hover { border-color: var(--gantt-orange); }
.gantt-scale.active { border-color: var(--gantt-orange); color: var(--gantt-orange);
  background: #FAEBE4; font-weight: 600; }
/* Условные обозначения живут под диаграммой и переносятся по строкам. */
.gantt-legend { display: flex; flex-wrap: wrap; gap: 8px 12px; color: var(--muted);
  font-size: 12px; padding-top: 2px; }
.gantt-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  border: 1px solid #1F6FEB; background: #F5F9FF; border-radius: 10px; padding: 8px 12px; }
.gantt-legend-item { display: inline-flex; align-items: center; gap: 4px; }
.gantt-swatch { width: 12px; height: 8px; border-radius: 3px; display: inline-block; }
.gantt-swatch.plan { background: var(--gantt-plan); }
.gantt-swatch.on_time { background: var(--gantt-green); }
.gantt-swatch.late { background: var(--gantt-red); }
.gantt-swatch.overdue { background: var(--gantt-red); }
.gantt-swatch.fact { background: var(--gantt-green); }
.gantt-swatch.milestone { width: 10px; height: 10px; background: #7C4DFF; transform: rotate(45deg); }
.gantt-swatch.point { width: 10px; height: 10px; border-radius: 50%; background: #8A94A6; }
.gantt-swatch.off { background: #E4E8EE; }
/* Восемь обозначений диаграммы: исходный план, актуальный и два состояния факта,
   поставка, выезд, оплата и сегодняшний день. */
.gantt-swatch.baseline { background: transparent; border: 1px dashed #8A94A6; height: 10px; }
.gantt-swatch.supply { width: 10px; height: 10px; background: #2E7D32; transform: rotate(45deg); }
.gantt-swatch.visit { width: 10px; height: 10px; background: #E5484D; transform: rotate(45deg); }
.gantt-swatch.payment { width: 10px; height: 10px; background: #1F6FEB; transform: rotate(45deg); }
.gantt-swatch.today { width: 0; height: 14px; border-radius: 0; border-left: 2px solid #E5484D; }
.gantt-warn { border: 1px solid #E5A400; border-radius: 10px; padding: 8px 12px;
  font-size: 12px; color: #8A6100; }
.gantt-details { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 6px; background: var(--card, #fff); }
.gantt-details.empty { display: none; }
.gantt-details-hint { color: var(--muted); font-size: 12px; }
.gantt-details-title { font-weight: 600; font-size: 14px; }
.gantt-details-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gantt-details-facts { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; }
.gantt-fact-item b { font-weight: 500; color: var(--muted); }
.gantt-details-point { font-size: 12px; color: var(--muted); }
.gantt-details-point.accepted { color: #2E7D32; }
.gantt-details-point.issue { color: #E5484D; }
.gantt-details-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding-top: 6px; border-top: 1px solid var(--line); }
.task-work-context { margin-top: 6px; padding: 7px 9px; border-radius: 6px;
  background: var(--surface-sunken); color: var(--text-secondary); font-size: 12px; }
.gantt-details-close { flex: none; }
.gantt-danger { margin-left: auto; border: 1px solid #E5484D; background: transparent;
  color: #E5484D; border-radius: 8px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
.gantt-danger:hover { background: #FDECEC; }
.gantt { position: relative; overflow: auto; max-height: calc(100vh - 280px);
  border: 1px solid var(--line); border-radius: 10px; background: var(--card, #fff); }
/* width: max-content обязателен: без него блок шириной с контейнер уезжает
   вместе с прокруткой и sticky-колонке не за что держаться. */
.gantt-head { display: flex; width: max-content; position: sticky; top: 0; z-index: 10;
  background: var(--gantt-navy); color: #fff; border-bottom: 1px solid #FFFFFF44; }
.gantt-side-head { position: sticky; left: 0; z-index: 11; width: var(--gantt-side);
  min-width: var(--gantt-side); display: flex; align-items: center;
  padding: 0 12px; height: 30px; background: var(--gantt-navy);
  border-right: 1px solid #FFFFFF44; }
.gantt-hcell { font-size: 12px; font-weight: 600; }
.gantt-cal { display: flex; flex-direction: column; }
.gantt-months { display: flex; height: 30px; }
.gantt-month { font-size: 11px; font-weight: 600; color: #fff; padding-left: 6px;
  border-right: 1px solid #FFFFFF44; overflow: hidden; white-space: nowrap;
  line-height: 30px; }
.gantt-grid { display: flex; align-items: flex-start; width: max-content; }
.gantt-side { position: sticky; left: 0; z-index: 8; width: var(--gantt-side);
  min-width: var(--gantt-side); background: var(--card, #fff);
  border-right: 2px solid var(--line); }
/* Плотность образца ГПР: работа — одна строка 30px, этап — 36px. Значения
   продублированы в app.js (GANTT_ROW_H / GANTT_STAGE_H): панель и холст обязаны
   совпадать до пикселя. Кликабельна вся строка, а не только полоса. */
.gantt-row { height: 30px; padding: 2px 10px; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 0; justify-content: center; cursor: pointer; }
.gantt-row:hover, .gantt-row.hl,
.gantt-row[data-work-id]:hover, .gantt-row[data-work-id].hl { background: #FAEBE4; }
.gantt-row.selected { background: #FAEBE4; box-shadow: inset 3px 0 0 var(--gantt-orange); }
.gantt-row:focus-visible { outline: 2px solid var(--gantt-orange); outline-offset: -2px; }
.gantt-row[data-work-id] { padding-left: 29px; background: #F7F8F9; }
.gantt-row[data-work-id] { flex-direction: row; align-items: center; gap: 6px; }
.gantt-row[data-work-id].selected {
  background: #FAEBE4; box-shadow: inset 3px 0 0 var(--gantt-orange);
}
.gantt-name { font-size: 12px; font-weight: 500; line-height: 1.3; max-height: 16px;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.gantt-row[data-work-id] .gantt-name { display: block; flex: 1; min-width: 0;
  max-height: none; white-space: nowrap; text-overflow: ellipsis; }
.gantt-duration { width: 56px; border: 1px solid var(--line); border-radius: 6px;
  padding: 2px 6px; font-size: 12px; background: transparent; color: inherit; }
.gantt-chip { white-space: nowrap; font-size: 11px; }
.gantt-chip.milestone { color: #7C4DFF; }
.gantt-chip.point { color: #8A94A6; }
.gantt-stage { height: 36px; display: flex; align-items: center; gap: 10px; padding: 0 10px;
  background: var(--card, #fff); font-size: 12px; border-top: 1px solid var(--line); }
.gantt-stage:hover, .gantt-stage.hl { background: #FAEBE4; }
.gantt-stage.current { background: #FBF8F6; box-shadow: inset 3px 0 0 var(--gantt-orange); }
.gantt-stage-toggle { border: 0; background: transparent; font: inherit; font-weight: 600;
  cursor: pointer; padding: 0; color: inherit; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
button.gantt-stage-toggle:hover,
button.gantt-stage-toggle:focus,
button.gantt-stage-toggle:active {
  background: transparent !important; color: inherit !important; box-shadow: none;
}
.gantt-stage-count { color: var(--muted); font-size: 11px; white-space: nowrap; }
/* В узкой панели «+ работа» переносилась на две строки и ломала высоту этапа. */
.gantt-stage .cmp-link-btn { white-space: nowrap; flex: none; }
/* Холст можно тянуть мышью; скроллбар и трекпад продолжают работать. */
.gantt-canvas { position: relative; flex: none; cursor: grab; }
.gantt-canvas.grabbing { cursor: grabbing; }
/* Действующий комплект контроля: что именно получит следующий выезд. */
.cp-authority { border: 1px solid var(--border, #E3E6EA); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 12px; background: var(--surface-2, #F4F6F9); }
.cp-authority-title { font-weight: 600; margin-bottom: 2px; }
.cp-authority-note { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.cp-authority-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cp-authority-select { max-width: 320px; }

.gantt-bar.pickable, .gantt-stage-progress.pickable, .gantt-milestone.pickable,
.gantt-point.pickable,
.gantt-nodate.pickable { cursor: pointer; }
/* Строка без даты кликабельна: иначе её нечем открыть — на шкале её нет. */
.gantt-nodate.pickable { text-decoration: underline dotted; }
.gantt-col { position: absolute; top: 0; bottom: 0; }
.gantt-col.month-start { border-left: 2px solid #C2C9D4; }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 0;
  border-left: 2px dashed var(--gantt-red); opacity: .9; z-index: 5; }
.gantt-stage-track { position: absolute; left: 0; right: 0; height: 36px; background: #fff;
  border-top: 1px solid var(--line); }
.gantt-stage-track.hl { background: #FAEBE4; }
.gantt-stage-track.current { background: #FBF8F6; }
.gantt-track { position: absolute; left: 0; right: 0; height: 30px;
  border-top: 1px solid var(--line); }
.gantt-track.hl { background: #FAEBE4; }
.gantt-track.selected { background: #FAEBE4; }
/* Исходный план: пунктирный контур на прежних датах. Лежит под полосами и выше
   их по краям — видно, откуда и куда уехала работа. */
.gantt-baseline { position: absolute; top: 7px; height: 15px; min-width: 4px;
  border: 1px dashed #6F7882; border-radius: 3px; background: transparent; z-index: 2; }
.gantt-bar { position: absolute; top: 11px; height: 7px; min-width: 3px; border-radius: 3px;
  background: var(--gantt-plan); border: 1px solid #BFC6CC; z-index: 3; overflow: hidden; }
.gantt-bar.not_started { background: var(--gantt-future); border-color: #D6DBE0; }
.gantt-bar.shifted { top: 11px; height: 7px; background: var(--gantt-future);
  border-color: #D6DBE0; }
.gantt-bar-label { display: block; padding: 0 7px; line-height: 13px; font-size: 10px;
  color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-bar:not(.stage) .gantt-bar-label { display: none; }
.gantt-fact { position: absolute; top: 10px; height: 10px; min-width: 3px; border-radius: 3px;
  background: var(--gantt-green); z-index: 4; }
.gantt-fact.on_time { background: var(--gantt-green); }
.gantt-fact.late { background: var(--gantt-red); }
.gantt-milestone { position: absolute; top: 6px; width: 12px; height: 12px;
  background: #7C4DFF; transform: rotate(45deg); z-index: 4; }
.gantt-point { position: absolute; top: 19px; width: 8px; height: 8px; border-radius: 50%;
  background: #8A94A6; border: 1px solid #fff; z-index: 4; }
/* Секции под производственными этапами: снабжение, выезды, оплаты. Заголовок
   ниже строки этапа — это не этап, а разделитель дорожек. */
.gantt-row.gantt-section { height: 27px; flex-direction: row; align-items: center;
  gap: 8px; background: var(--surface-2, #F4F6F9); border-left: 5px solid #8A94A6; }
.gantt-visit-label { position: absolute; top: 8px; margin-left: 9px;
  font-size: 10px; color: var(--muted); white-space: nowrap; }
/* Пустая дорожка: раздел на месте, записей пока нет. */
.gantt-empty-row { justify-content: center; }
.gantt-empty-text { font-size: 11px; color: var(--muted); font-style: italic; }
.gantt-section-add { margin-left: auto; font-size: 11px; white-space: nowrap; flex: none; }
.gantt-row-edit, .gantt-row-remove { font-size: 11px; padding: 0 4px; flex: none; }
.gantt-row.gantt-row-with-actions { flex-direction: row; align-items: center; gap: 6px; }
.gantt-row.gantt-row-with-actions .gantt-name { flex: 1; min-width: 0; }
.gantt-visit-row { cursor: pointer; }
.gantt-payment-over .gantt-name { color: #B3403A; }
.gantt-add-work-btn { font-weight: 600; }
/* Слой формы поверх графика. Подложка гасит диаграмму, а сама панель — сплошной
   непрозрачный фон: без него поля лежали на строках работ и читались вперемешку
   с ними (референс 04). Слой вставляется в .gantt-panel, поэтому переполнение
   .gantt его не режет, а фокус-режим (position: fixed, z-index 1000) не
   накрывает — прежний портал в body с z-index 60 уходил под него. */
.gantt-sheet-overlay { position: fixed; inset: 0; z-index: 1100; display: flex;
  align-items: center; justify-content: center; padding: 16px;
  background: rgba(23, 50, 74, .55); }
.gantt-sheet { width: min(520px, 100%); max-height: min(88vh, 720px); overflow: auto;
  box-sizing: border-box; display: flex; flex-direction: column; gap: 10px;
  padding: 16px; border-radius: 12px; background: var(--card, #fff);
  border: 1px solid var(--line); box-shadow: 0 20px 48px rgba(16, 24, 40, .28); }
.gantt-sheet-title { font-weight: 600; font-size: 15px; }
.gantt-sheet-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.gantt-sheet-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding-top: 4px; }
.gantt-extra-dialog, .gantt-work-dialog { min-width: 0; }
.gantt-sheet .sched-work-form { display: grid;
  grid-template-columns: auto minmax(0, 1fr); gap: 6px 10px; align-items: center;
  padding: 0; }
/* Сообщение об ошибке и кнопки — на всю ширину сетки: иначе кнопка вставала во
   вторую колонку и накрывала подпись поля (референс 04). */
.gantt-sheet .sched-work-form > .cmp-warn-text,
.gantt-sheet .sched-work-form > .gantt-sheet-actions { grid-column: 1 / -1; }
.gantt-sheet .sched-input, .gantt-sheet .sched-select,
.gantt-sheet .sched-date, .gantt-sheet .sched-duration {
  width: 100%; box-sizing: border-box; }
/* Правка выбранной работы: поля живут в подвале её карточки, рядом с
   действиями. Сетка перестраивается в одну колонку на узком экране. */
.gantt-edit-grid { flex-basis: 100%; display: grid; gap: 8px 12px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); padding-bottom: 8px;
  border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.gantt-edit-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.gantt-edit-field .sched-input, .gantt-edit-field .sched-select,
.gantt-edit-field .sched-date, .gantt-edit-field .gantt-duration {
  width: 100%; box-sizing: border-box; }
.gantt-edit-hint { font-size: 11px; color: var(--muted); }
.gantt-edit-static { font-size: 13px; }
/* Отметка закрепления — обычный флажок: растягивать его по ширине ячейки
   (как поля ввода) незачем. */
.gantt-edit-lock { align-self: flex-start; width: auto; }
.gantt-edit-deps { grid-column: 1 / -1; }
.gantt-dep-list { display: flex; flex-direction: column; gap: 2px; max-height: 132px;
  overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.gantt-dep-row { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; }
/* Удержанная строка: это состояние, а не поручение — цвет предупреждающий,
   но без красноты ошибки. */
.gantt-hold { font-weight: 500; }
/* Закреплённая дата — барьер пересчёта, а не тревога: спокойная серая пометка.
   Строка списка и без неё тесная, поэтому подпись не переносится. */
.gantt-lock { flex: none; font-size: 11px; color: var(--muted); white-space: nowrap; }
/* Причина удержания поставки приходит с сервера уже спроецированной по
   видимости актора — на дорожке она сжимается, в форме показывается целиком. */
.gantt-supply-note { font-size: 11px; color: #8A6100; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }
.gantt-supply-leads { flex: none; font-size: 11px; color: var(--muted); white-space: nowrap; }
.gantt-extra-hold { display: flex; flex-direction: column; gap: 2px; margin: 6px 0; }
.gantt-extra-hold .gantt-supply-note { max-width: none; white-space: normal; }
.gantt-compact-edit { align-self: flex-start; }
.gantt-row.gantt-section.supply { border-left-color: #2E7D32; }
.gantt-row.gantt-section.visit { border-left-color: #E5484D; }
.gantt-row.gantt-section.payment { border-left-color: #1F6FEB; }
.gantt-section-title { font-size: 10px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
button.gantt-section-title { border: 0; background: transparent; padding: 0;
  cursor: pointer; text-align: left; }
button.gantt-section-title:hover { background: transparent; color: var(--muted); }
.gantt-section-track { position: absolute; left: 0; right: 0; height: 27px;
  background: var(--surface-2, #F4F6F9); border-top: 1px solid var(--line); }
/* Поставка: линия от заказа до прихода, точка в начале, ромб в конце. */
.gantt-supply { position: absolute; top: 13px; height: 3px; background: #2E7D32;
  min-width: 4px; z-index: 3; }
.gantt-supply::before { content: ""; position: absolute; left: -3px; top: -2px;
  width: 7px; height: 7px; border-radius: 50%; background: #2E7D32; }
.gantt-supply::after { content: ""; position: absolute; right: -5px; top: -4px;
  width: 10px; height: 10px; background: #2E7D32; transform: rotate(45deg); }
.gantt-visit { position: absolute; top: 10px; width: 10px; height: 10px;
  background: #9AA3AD; transform: translateX(-50%) rotate(45deg); z-index: 4; }
.gantt-visit.actual { background: #E5484D; }
.gantt-payment { position: absolute; top: 10px; width: 10px; height: 10px;
  background: #1F6FEB; transform: translateX(-50%) rotate(45deg); z-index: 4; }
.gantt-payment-label { position: absolute; top: 8px; margin-left: 9px;
  font-size: 10px; color: var(--muted); white-space: nowrap; }
.gantt-hover-dependency { position: absolute; width: 1px; background: #8A94A6;
  pointer-events: none; z-index: 2; }
.gantt-point.accepted { background: #2E7D32; }
.gantt-point.issue { background: #E5484D; }
.gantt-nodate { position: absolute; left: 8px; top: 8px; font-size: 10px; color: var(--muted); }
/* Обзор этапов: одна полоса на этап, спокойнее работ — это не задача, а свод. */
.gantt-bar.stage { top: 10px; height: 16px; border-radius: 4px;
  background: var(--gantt-future); border-color: #D6DBE0; }
.gantt-stage-progress { position: absolute; height: 16px; min-width: 4px;
  border-radius: 4px; z-index: 4; }
.gantt-stage-progress.on_time { background: var(--gantt-green); }
.gantt-stage-progress.late { background: var(--gantt-red); }
.gantt-bar.stage.shifted { top: 12px; height: 10px; background: var(--gantt-future);
  border-color: #D6DBE0; }
.gantt-bar.stage .gantt-bar-label { position: relative; z-index: 1; line-height: 16px; font-size: 11px; }
/* Пунктир, план и факт этапа разной высоты, но всегда с одним центром. */
.gantt-stage-track .gantt-baseline,
.gantt-stage-track .gantt-bar.stage,
.gantt-stage-track .gantt-stage-progress { top: 50%; transform: translateY(-50%); }
/* Бегунки границ: видны только у выбранной работы в режиме правки. */
.gantt-handle { position: absolute; top: 4px; width: 10px; height: 17px; border-radius: 4px;
  background: #fff; border: 2px solid #1F6FEB; cursor: ew-resize; box-sizing: border-box;
  z-index: 5; }
/* Контекстное меню и выбор точек — поверх графика, у места нажатия. */
.gantt-menu { position: fixed; z-index: 70; min-width: 220px; max-width: 340px;
  background: var(--card, #fff); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, .18); padding: 6px; display: flex;
  flex-direction: column; gap: 2px; }
.gantt-menu-title { font-size: 11px; color: var(--muted); padding: 4px 8px; }
.gantt-menu-item { border: 0; background: transparent; text-align: left; font: inherit;
  font-size: 13px; padding: 6px 8px; border-radius: 6px; cursor: pointer; color: inherit; }
.gantt-menu-item:hover { background: #F2F6FC; }
.gantt-picker { max-height: 60vh; overflow: auto; }
.gantt-picker-list { display: flex; flex-direction: column; gap: 4px; padding: 4px 8px; }
.gantt-picker-row { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; }
.gantt-compact { display: none; flex-direction: column; }
.gantt-compact-row { display: flex; flex-direction: column; gap: 4px;
  padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.gantt-compact-name { font-weight: 500; }
.gantt-compact-stage { color: var(--muted); font-size: 12px; }
.gantt-compact-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.gantt-compact-dates { color: var(--muted); font-size: 12px; }
.gantt-compact-point { font-size: 12px; color: var(--muted); }
.gantt-compact-point.accepted { color: #2E7D32; }
.gantt-compact-point.issue { color: #E5484D; }
.gantt-acts { display: flex; gap: 10px; flex-wrap: wrap; }
@media (min-width: 1600px) { .gantt-panel { --gantt-side: 380px; } }
@media (max-width: 1279px) { .gantt-panel { --gantt-side: 330px; } }
@media (max-width: 1023px) { .gantt-panel { --gantt-side: 300px; } }
@media (max-width: 720px) {
  /* Диаграммы здесь нет — вместе с ней уходят её масштаб, режимы просмотра,
     разворот на весь экран и легенда. Правка графика остаётся: без неё на
     телефоне нельзя было ни открыть редактор работы, ни добавить строку. */
  .gantt, .gantt-legend, .gantt-views, .gantt-scales, .gantt-zoom-btn { display: none; }
  .gantt-toolbar { justify-content: flex-start; }
  .gantt-modes { margin-left: 0; }
  .gantt-compact { display: flex; }
  /* Карточка выбранной работы прячется сама, пока работа не выбрана
     (.gantt-details.empty), поэтому отдельного правила ей здесь не нужно. */
  .gantt-edit { flex-direction: column; align-items: stretch; }
  .gantt-sheet { width: 100%; max-height: 92vh; padding: 14px; }
  .gantt-sheet .sched-work-form { grid-template-columns: minmax(0, 1fr); }
  .gantt-edit-grid { grid-template-columns: minmax(0, 1fr); }
}
/* OFFICE-12.1: выбор плана контроля и пикер точек в редакторе шаблона. */
.sched-control { display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 12px; }
.sched-points { display: flex; flex-direction: column; gap: 4px; width: 100%;
  border-top: 1px solid var(--line); padding-top: 8px; }
.sched-points-stage { font-size: 12px; font-weight: 600; margin-top: 6px; }
.sched-point { display: flex; align-items: center; gap: 6px; font-size: 13px; }

/* Состав по ТЗ (semantic generation). Отдельного экрана нет: это разметка
   поверх существующих вкладок, поэтому и стилей ровно столько, сколько нужно,
   чтобы вторичное читалось как вторичное. */
.gen-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 12px; }
.gen-mode { border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px;
  color: var(--muted); }
.gen-mode-generated_draft { border-color: #2F6FEB; color: #2F6FEB; }
.gen-mode-manual { border-color: #E5A400; color: #8A6100; }
.gen-count { color: var(--muted); }
.gen-review { color: #8A6100; }
.gen-manual-note { flex-basis: 100%; }
.gen-status { flex-basis: 100%; color: var(--muted); display: flex; gap: 8px;
  align-items: center; flex-wrap: wrap; }
.gen-suppressed { flex-basis: 100%; font-size: 12px; }
.gen-suppressed-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.gen-suppressed-name { color: var(--muted); }
.gantt-scope { flex: none; max-width: 38%; overflow: hidden; text-overflow: ellipsis;
  font-size: 11px; color: var(--muted); white-space: nowrap; }
.gantt-needs-review { flex: none; font-size: 11px; color: #8A6100; white-space: nowrap; }
.lc-transition-actions { display: flex; margin-top: 10px; }

@media (prefers-reduced-motion: reduce) {
  .sched-compact-bar > i { transition: none; }
}
@media (max-width: 720px) {
  /* Прежнее правило переносило меню к левому краю шапки; теперь слой сам
     прижимается к краю вьюпорта на любой ширине, и отдельный сдвиг не нужен. */
  .sched-compact { grid-template-columns: 1fr; }
  .sched-compact-action { grid-column: 1; grid-row: auto; justify-self: start; }
}
.gantt-details-technical { font-size: 12px; color: var(--muted); }
.pv3-generation { display: flex; flex-direction: column; gap: 6px; }
.pv3-gen-summary { font-size: 12px; color: var(--muted); }
.pv3-gen-headline { font-size: 13px; font-weight: 500; }
.pv3-questions { display: flex; flex-direction: column; gap: 6px; }
.pv3-question { display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  border: 1px solid #E5A400; border-radius: 10px; padding: 6px 10px; font-size: 12px; }
.pv3-question-text { flex: 1; min-width: 240px; }
.pv3-diagnostics { font-size: 12px; color: var(--muted); }
.pv3-diagnostic { padding: 1px 0; }
.cp-generated { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.cp-generated-head { display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 16px 18px; border: 1px solid var(--border-soft);
  border-radius: 12px; background: var(--surface); }
.cp-generated-heading { min-width: 0; }
.cp-generated-title { font-weight: 650; font-size: 17px; color: var(--ink); }
.cp-generated-subtitle { margin-top: 3px; font-size: 12px; color: var(--text-muted); }
.cp-generated-total { flex: none; min-width: 38px; padding: 7px 11px; border-radius: 999px;
  background: #EAF1FF; color: #2459A9; font-size: 14px; font-weight: 700;
  text-align: center; }
.cp-generated-stage { overflow: hidden; border: 1px solid var(--border-soft);
  border-radius: 12px; background: var(--surface); }
.cp-generated-stage-summary, .cp-generated-work-summary, .cp-generated-review summary {
  cursor: pointer; list-style: none; }
.cp-generated-stage-summary::-webkit-details-marker,
.cp-generated-work-summary::-webkit-details-marker { display: none; }
.cp-generated-stage-summary { display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; background: var(--surface-sunken); }
.cp-generated-stage-summary::before, .cp-generated-work-summary::before {
  content: "›"; flex: none; color: var(--text-muted); font-size: 18px; line-height: 1;
  transform: rotate(0); transition: transform .15s ease; }
.cp-generated-stage[open] > .cp-generated-stage-summary::before,
.cp-generated-work[open] > .cp-generated-work-summary::before { transform: rotate(90deg); }
.cp-generated-stage[open] > .cp-generated-stage-summary { border-bottom: 1px solid var(--border-soft); }
.cp-generated-stage-title { flex: 1; min-width: 0; font-size: 14px; font-weight: 650; }
.cp-generated-count { flex: none; padding: 2px 8px; border-radius: 999px;
  background: var(--surface); color: var(--text-muted); font-size: 11px; font-weight: 600; }
.cp-generated-work { margin: 10px 12px; overflow: hidden; border: 1px solid var(--border-soft);
  border-radius: 10px; background: var(--surface); }
.cp-generated-work-summary { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.cp-generated-work[open] > .cp-generated-work-summary { border-bottom: 1px solid var(--border-soft); }
.cp-generated-work-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; }
.cp-generated-point-list { display: flex; flex-direction: column; }
.cp-generated-point { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px;
  align-items: start; padding: 10px 12px; color: var(--ink); }
.cp-generated-point + .cp-generated-point { border-top: 1px solid var(--border-soft); }
.cp-generated-point-index { display: grid; place-items: center; width: 24px; height: 24px;
  border: 1px solid var(--border-soft); border-radius: 7px; color: var(--text-muted);
  font-size: 11px; font-weight: 650; }
.cp-generated-point-body { min-width: 0; }
.cp-generated-text { font-size: 13px; line-height: 1.45; }
.cp-generated-evidence { display: inline-flex; margin-top: 6px; padding: 3px 8px;
  border-radius: 999px; background: #EAF1FF; color: #2459A9; font-size: 11px;
  font-weight: 600; }
.cp-generated-review { border: 1px solid #E5A400; border-radius: 10px; padding: 10px 12px; }

/* Кандидаты фактов в окне подтверждения объекта. Карточка живёт рядом с
   параметрами дома и повторяет их вид: это не новый экран. */
.factcard { display: flex; flex-direction: column; gap: 8px; }
.factgroup { display: flex; flex-direction: column; gap: 6px; }
.factgroup h5 { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.factrow { display: flex; align-items: flex-start; gap: 10px; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 10px; }
.factrow-pending_confirmation, .factrow-conflict { border-color: #E5A400; }
.factrow-rejected { opacity: 0.6; }
.factrow-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.factrow-value { font-size: 13px; }
.factrow-ai { font-size: 11px; color: #2F6FEB; }
.factrow-source { font-size: 12px; color: var(--muted); }
.factrow-source summary { cursor: pointer; }
.factrow-source-item { padding: 2px 0; }
.factrow-file { font-size: 12px; }
.factrow-quote { font-size: 12px; font-style: italic; }
.factrow-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Не распределённые строки ТЗ: отдельный блок, визуально отличный от значений. */
.pv3-unmapped { margin-top: 14px; }
.pv3-unmapped-note { margin: 0 0 10px; }
.pv3-unmapped-row {
  border: 1px solid var(--line); border-left-width: 3px; border-radius: 8px;
  padding: 8px 10px; margin-bottom: 8px;
}
.pv3-unmapped-row.ambiguous { border-left-color: #C08A2E; }
.pv3-unmapped-row.unknown { border-left-color: #8A9096; }
.pv3-unmapped-head { display: flex; align-items: center; gap: 8px; }
.pv3-unmapped-badge {
  font-size: 11px; color: #8A9096; border: 1px solid var(--line);
  border-radius: 10px; padding: 1px 7px;
}
.pv3-unmapped-value { font-size: 13px; margin: 2px 0 4px; }
.pv3-unmapped-src summary { font-size: 12px; color: #8A9096; cursor: pointer; }
.pv3-unmapped-pick { margin-top: 6px; }
/* Шапка блока: заголовок и запрос подсказки на одной линии. */
.pv3-unmapped-top {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
/* Черновик ИИ виден как черновик и не похож на сохранённое значение. */
.pv3-unmapped-draft {
  margin-top: 6px; padding: 6px 8px; border-radius: 6px;
  background: #FBF6EC; font-size: 13px;
}
.pv3-unmapped-pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pv3-unmapped-pick .pv3-input { flex: 1 1 220px; min-width: 0; }
.pv3-unmapped-apply { flex: 0 0 auto; }
.pv3-unmapped-remember-label {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: #6B7075; white-space: nowrap;
}
.pv3-unmapped-proposals { margin-top: 12px; padding-top: 10px; border-top: 1px solid #E7E9EC; }
.pv3-unmapped-proposal { font-size: 13px; margin-bottom: 4px; }
@media (max-width: 640px) {
  .pv3-unmapped-pick { flex-direction: column; align-items: stretch; }
  .pv3-unmapped-pick .pv3-input, .pv3-unmapped-apply { width: 100%; }
}
.pv3-showall { margin-top: 8px; }
/* Переключатель показывает скрытые строки, не меняя данные. */
.pv3-show-hidden .pv3-row.hidden { display: flex; opacity: .65; }

/* --- Мессенджер: раздел кабинета ---------------------------------------------
   Три колонки на широком экране, одна на узком. Ширины боковых колонок фиксированы,
   центральная — единственная растущая: иначе длинное сообщение растягивало бы весь
   грид и документ уезжал бы вбок. */
.msg-screen {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 240px;
  gap: 12px;
  align-items: start;
  min-width: 0;
}
.msg-side, .msg-main, .msg-people {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  min-width: 0;
}
.msg-side { padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.msg-side-title {
  font-size: 11.5px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em; padding: 6px 4px 2px;
}
.msg-list, .msg-contacts { display: flex; flex-direction: column; gap: 4px; }
.msg-row, .msg-contact {
  display: block; width: 100%; text-align: left; height: auto; padding: 8px 10px;
  border: 1px solid transparent; border-radius: 6px; background: none; color: var(--ink);
  font: inherit; font-size: 13px; min-width: 0;
}
.msg-row:hover, .msg-contact:hover:not(:disabled) { background: var(--surface-sunken); }
.msg-row.active { background: #F6E9E1; border-color: #E4CFC2; }
.msg-contact:disabled { opacity: .55; }
.msg-row-title, .msg-contact-name {
  display: block; font-size: 13px; font-weight: 600; overflow-wrap: anywhere;
}
.msg-row-preview, .msg-contact-role {
  display: block; font-size: 12px; color: var(--text-secondary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.msg-row-unread {
  display: inline-block; margin-top: 4px; min-width: 17px; padding: 0 5px;
  border-radius: 999px; background: #C05B2E; color: #fff;
  font-size: 10.5px; font-weight: 600; text-align: center;
}

.msg-main { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 12px; }
.msg-thread-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.msg-thread-title { font-size: 14px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.msg-back {
  display: none; align-items: center; gap: 5px; height: 30px; padding: 0 10px;
  border: 1px solid #D8DBDF; border-radius: 6px; background: var(--surface);
  color: var(--ink); font-size: 12.5px;
}
.msg-search {
  margin-left: auto; height: 30px; min-width: 0; flex: 0 1 200px; padding: 0 9px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface-sunken);
  font: inherit; font-size: 12.5px; color: var(--ink);
}
.msg-people-toggle {
  height: 30px; padding: 0 10px; border: 1px solid #D8DBDF; border-radius: 6px;
  background: var(--surface); color: var(--ink); font-size: 12.5px; white-space: nowrap;
}

/* Полоса закреплённых: горизонтальная прокрутка внутри себя, а не у документа. */
.msg-pins {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px;
  border: 1px solid var(--border-soft); border-radius: 6px; background: var(--surface-sunken);
  overflow-x: auto; min-width: 0;
}
.msg-pins-title {
  flex: none; font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em;
}
.msg-pin-box { display: flex; align-items: center; gap: 4px; flex: none; max-width: 320px; }
.msg-pin-chip {
  height: auto; max-width: 260px; padding: 4px 9px; text-align: left;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface);
  color: var(--ink); font: inherit; font-size: 12px; min-width: 0;
}
.msg-pin-author { display: block; font-size: 11.5px; font-weight: 600; }
.msg-pin-text {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text-secondary);
}

.msg-feed, .msg-results {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 52vh; overflow-y: auto; min-width: 0;
}
.msg-item {
  max-width: 86%; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--border-soft); background: var(--surface); min-width: 0;
}
.msg-item.own { align-self: flex-end; background: var(--accent-tint); }
.msg-item.targeted { border-color: #C05B2E; box-shadow: 0 0 0 2px #F6E9E1; }
.msg-item-meta { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.msg-item-author { font-size: 12.5px; font-weight: 600; }
.msg-item-time { font-size: 11px; color: var(--text-muted); }
/* Текст сообщения переносится по любому месту: длинная ссылка от пользователя
   иначе распирает колонку и добавляет документу горизонтальную прокрутку. */
.msg-item-body { margin: 3px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-item-body.deleted { color: var(--text-muted); font-style: italic; }
/* Вложение в ленте: имя с размером и действия рядом. Имя переносится по любому
   месту — иначе присланный с телефона файл с длинным именем распирает пузырь. */
.msg-item-file {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px;
  margin-top: 3px; font-size: 12px; color: var(--text-secondary); min-width: 0;
}
.msg-item-file-name { overflow-wrap: anywhere; min-width: 0; }
.msg-item-actions { display: flex; gap: 10px; margin-top: 5px; }
.msg-status:empty, .msg-error:empty { display: none; }
.msg-status { margin: 0; font-size: 12px; color: var(--text-secondary); }
/* Композер — колонка: панель вложений над строкой ввода. В одну строку с
   textarea кнопки и очередь файлов сжали бы поле ввода до нечитаемого. */
.msg-compose { display: flex; flex-direction: column; gap: 8px; }
.msg-compose-row { display: flex; align-items: flex-end; gap: 8px; }
.msg-compose-row textarea { flex: 1; min-width: 0; resize: vertical; }
.msg-attach { display: flex; flex-direction: column; gap: 6px; }
.msg-attach-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.msg-attach-note { margin: 0; font-size: 12px; color: var(--text-secondary); }
.msg-attach-note:empty { display: none; }
/* Полоса считает принятые сервером файлы, а не байты: fetch не сообщает, сколько
   тела ушло, и «73 %» здесь были бы нарисованы, а не измерены. */
.msg-attach-progress { width: 100%; height: 4px; }
.msg-attach-item {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px;
  font-size: 12px; min-width: 0;
}
.msg-attach-name { overflow-wrap: anywhere; min-width: 0; }
.msg-attach-state { color: var(--text-secondary); }
.msg-attach-item[data-state="ready"] .msg-attach-state { color: var(--status-ok); }
.msg-attach-item[data-state="failed"] .msg-attach-state { color: var(--status-danger); }
.msg-older { align-self: center; }

.msg-people { padding: 10px; }
.msg-people-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.msg-people-title {
  font-size: 11.5px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px;
}
.msg-people-close { display: none; }
.msg-people.collapsed .msg-people-body { display: none; }
.msg-person { padding: 6px 4px; border-bottom: 1px solid var(--divider); min-width: 0; }
.msg-person:last-child { border-bottom: none; }
.msg-person-name { display: block; font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
.msg-person-role { display: block; font-size: 11.5px; color: var(--text-secondary); }
.msg-person-job { display: block; font-size: 11px; color: var(--text-muted); }

/* Информационная доска объекта на обзоре — над карточкой приглашения. */
.lc-board { margin-bottom: 12px; }
.lc-board-body { padding: 4px 0; }
.lc-board-row { padding: 8px 14px; border-bottom: 1px solid var(--divider); }
.lc-board-row:last-child { border-bottom: none; }
.lc-board-author { font-size: 12.5px; font-weight: 600; }
.lc-board-text { margin: 2px 0 0; font-size: 12.5px; overflow-wrap: anywhere; }
.lc-board-open { margin: 4px 14px 12px; }

@media (max-width: 1100px) {
  .msg-screen { grid-template-columns: 220px minmax(0, 1fr); }
  .msg-people { grid-column: 1 / -1; }
}

/* Узкий экран (390px и уже): список и открытая беседа — разные состояния.
   Пока беседа не открыта, центра нет вовсе; «Назад» возвращает к списку. */
@media (max-width: 720px) {
  .msg-screen { grid-template-columns: minmax(0, 1fr); }
  .msg-screen .msg-main, .msg-screen .msg-people { display: none; }
  .msg-screen.thread-open .msg-side { display: none; }
  .msg-screen.thread-open .msg-main { display: flex; }
  .msg-screen.thread-open .msg-people:not(.collapsed) {
    display: block; position: fixed; inset: 12px; z-index: var(--z-overlay, 1200);
    overflow-y: auto; background: var(--surface); box-shadow: 0 14px 40px rgba(20, 33, 48, .2);
  }
  .msg-screen.thread-open .msg-people.collapsed { display: none; }
  .msg-people-close { display: inline-flex; }
  .msg-back { display: inline-flex; }
  .msg-search { flex: 1 1 100%; margin-left: 0; }
  .msg-item { max-width: 100%; }
  .msg-compose-row { flex-direction: column; align-items: stretch; }
  .msg-compose-row button { width: 100%; }
  /* Кнопки вложений на узком экране остаются в строке: они короткие, и
     растягивать каждую на всю ширину значило бы отдать им пол-экрана. */
  .msg-attach-actions button { flex: 1 1 auto; }
}

/* --- Мессенджер: визуальный слой в логике Telegram Web ----------------------
   Поведение и API остаются прежними. Здесь только плотность, иерархия и
   расположение уже существующих элементов: список, лента и информация. */
#messengerScreen > .screen-head { margin-bottom: 10px; }
.msg-screen {
  --msg-blue: #3390EC;
  --msg-blue-soft: #E7F2FD;
  --msg-own: #E5F3FF;
  --msg-wall: #DDEBF1;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 0;
  height: calc(100vh - 142px);
  min-height: 570px;
  overflow: hidden;
  position: relative;
  border: 1px solid #DCE3E8;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(32, 54, 72, .08);
}
.msg-screen.people-open { grid-template-columns: 320px minmax(0, 1fr) 310px; }
.msg-side, .msg-main, .msg-people {
  height: 100%;
  border: 0;
  border-radius: 0;
}

/* Список бесед */
.msg-side {
  padding: 0;
  gap: 0;
  overflow-y: auto;
  border-right: 1px solid #E5E9ED;
  background: #fff;
}
.msg-side-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 14px 14px 10px;
  border-bottom: 1px solid #F0F2F4;
  background: #fff;
}
.msg-side-heading {
  display: block;
  margin: 0 2px 10px;
  font-size: 17px;
  line-height: 1.2;
}
.msg-list-search {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 38px;
  border: 1px solid transparent;
  border-radius: 999px;
  outline: 0;
  background-color: #F1F3F5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none' stroke='%23828B95' stroke-width='1.7'%3E%3Ccircle cx='8' cy='8' r='5'/%3E%3Cpath d='m12 12 4 4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 13px center;
  background-size: 16px;
  color: var(--ink);
  font: inherit;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.msg-list-search:focus {
  border-color: #8BC4F4;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(51, 144, 236, .12);
}
.msg-side-title {
  padding: 13px 16px 6px;
  color: #75808B;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .055em;
}
.msg-list, .msg-contacts { gap: 1px; padding: 0 7px; }
.msg-list { flex: none; overflow: visible; }
.msg-contacts {
  flex: none;
  overflow: visible;
  padding-bottom: 8px;
  border-top: 1px solid #F0F2F4;
}
.msg-row, .msg-contact {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 7px 9px;
  border: 0;
  border-radius: 11px;
  transition: background-color .12s, color .12s;
}
.msg-contact { min-height: 55px; }
.msg-row:hover, .msg-contact:hover:not(:disabled) { background: #F1F5F8; }
.msg-row.active, .msg-row.active:hover {
  background: var(--msg-blue);
  color: #fff;
}
.msg-avatar {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #7FB7D8, #477FA5);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}
.msg-avatar.project { background: linear-gradient(145deg, #51B59A, #2E7F72); }
.msg-row-copy, .msg-contact-copy, .msg-person-copy, .msg-thread-copy {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
}
.msg-row-title, .msg-contact-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.msg-row-preview, .msg-contact-role { margin-top: 3px; }
.msg-row.active .msg-row-preview { color: rgba(255, 255, 255, .86); }
.msg-row-tail {
  flex: none;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  min-width: 34px;
}
.msg-row-time { max-width: 70px; color: #87919B; font-size: 10px; white-space: nowrap; }
.msg-row.active .msg-row-time { color: rgba(255, 255, 255, .85); }
.msg-row-unread {
  margin: 0;
  min-width: 20px;
  height: 20px;
  padding: 2px 6px;
  background: var(--msg-blue);
  font-size: 10px;
}
.msg-row.active .msg-row-unread { background: #fff; color: var(--msg-blue); }

/* Лента */
.msg-main {
  gap: 0;
  padding: 0;
  overflow: hidden;
  background-color: var(--msg-wall);
  background-image:
    radial-gradient(circle at 24px 24px, rgba(74, 126, 143, .10) 0 2px, transparent 2.5px),
    radial-gradient(circle at 60px 54px, rgba(74, 126, 143, .07) 0 5px, transparent 5.5px),
    linear-gradient(135deg, rgba(255, 255, 255, .20) 25%, transparent 25% 75%, rgba(255, 255, 255, .20) 75%);
  background-size: 84px 84px, 84px 84px, 42px 42px;
}
.msg-thread-head {
  flex: none;
  flex-wrap: nowrap;
  min-height: 58px;
  margin: 10px 12px 7px;
  padding: 7px 9px;
  border: 1px solid rgba(203, 215, 223, .92);
  border-radius: 16px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 3px 12px rgba(35, 61, 77, .10);
  backdrop-filter: blur(8px);
  z-index: 2;
}
.msg-thread-avatar { flex-basis: 40px; width: 40px; height: 40px; }
.msg-thread-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.25;
}
.msg-thread-subtitle {
  margin-top: 2px;
  overflow: hidden;
  color: #75808B;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg-back, .msg-people-toggle {
  min-width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #63707C;
}
.msg-back:hover, .msg-people-toggle:hover { background: #EDF3F7; color: var(--msg-blue); }
.msg-people-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  padding: 0;
}
.msg-people-toggle svg { width: 18px; height: 18px; }
.msg-search {
  flex: 0 1 175px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: #F1F3F5;
}
.msg-search:focus { outline: 2px solid rgba(51, 144, 236, .28); background: #fff; }
.msg-pins {
  flex: none;
  margin: 0 12px 7px;
  padding: 6px 10px;
  border: 1px solid rgba(203, 215, 223, .92);
  border-left: 3px solid var(--msg-blue);
  border-radius: 12px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 2px 8px rgba(35, 61, 77, .08);
}
.msg-pins-title { color: var(--msg-blue); }
.msg-pin-chip { border: 0; background: transparent; padding: 2px 6px; }
.msg-pin-author { color: var(--msg-blue); }
.msg-feed, .msg-results {
  flex: 1 1 auto;
  max-height: none;
  padding: 12px clamp(14px, 5vw, 70px) 16px;
  gap: 6px;
  scrollbar-gutter: stable;
}
.msg-older { margin-top: 4px; border-radius: 999px; background: rgba(255, 255, 255, .92); }
.msg-empty { align-self: center; border-radius: 999px; background: rgba(46, 87, 104, .62); color: #fff; }
.msg-item {
  position: relative;
  max-width: min(74%, 680px);
  padding: 7px 10px 6px;
  border: 0;
  border-radius: 14px 14px 14px 5px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(35, 61, 77, .13);
}
.msg-item.own {
  border-radius: 14px 14px 5px 14px;
  background: var(--msg-own);
}
.msg-item.targeted { border-color: var(--msg-blue); box-shadow: 0 0 0 3px rgba(51, 144, 236, .25); }
.msg-item-meta { justify-content: space-between; gap: 12px; flex-wrap: nowrap; }
.msg-item-author { color: #2876A8; font-size: 11px; }
.msg-item.own .msg-item-author { color: #34735E; }
.msg-item-time { flex: none; order: 2; font-size: 9.5px; }
.msg-item-body { margin-top: 2px; font-size: 12.5px; line-height: 1.42; }
.msg-item-quote {
  display: flex;
  width: 100%;
  margin: 4px 0;
  padding: 4px 7px;
  flex-direction: column;
  align-items: flex-start;
  overflow: hidden;
  border: 0;
  border-left: 3px solid var(--msg-blue);
  background: rgba(51, 144, 236, .08);
  color: inherit;
  text-align: left;
}
.msg-item-quote span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-select-check {
  display: none;
  position: absolute;
  left: -28px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(63, 86, 99, .38);
  box-shadow: 0 0 0 1px rgba(63, 86, 99, .28);
}
.msg-screen.selecting .msg-select-check { display: block; }
.msg-select-check[aria-checked="true"] { background: var(--msg-blue); }
.msg-select-check[aria-checked="true"]::after { content: "✓"; color: #fff; }
.msg-item.selected { box-shadow: 0 0 0 3px rgba(51, 144, 236, .32); }
.msg-item-file {
  margin-top: 7px;
  padding: 8px 9px;
  border-radius: 10px;
  background: rgba(73, 126, 152, .08);
}
.msg-item-actions { justify-content: flex-end; margin-top: 3px; opacity: .72; }
.msg-item-actions .link { font-size: 10.5px; }

/* Композер */
.msg-status, .msg-error, .msg-retry { margin-left: 14px; margin-right: 14px; }
.msg-compose {
  flex: none;
  gap: 6px;
  margin: 0 12px 12px;
  padding: 7px 8px;
  border: 1px solid rgba(203, 215, 223, .94);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 3px 14px rgba(35, 61, 77, .13);
}
.msg-compose-row { align-items: center; gap: 4px; }
.msg-compose-row textarea {
  height: 36px;
  min-height: 36px;
  max-height: 156px;
  padding: 8px 7px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  line-height: 1.4;
}
.msg-compose-row.dragging { outline: 2px dashed var(--msg-blue); border-radius: 12px; background: var(--msg-blue-soft); }
.msg-compose-context {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  border-left: 3px solid var(--msg-blue);
  background: var(--msg-blue-soft);
}
.msg-compose-context-copy { display: flex; min-width: 0; flex-direction: column; }
.msg-compose-context-copy span { overflow: hidden; color: #65717C; text-overflow: ellipsis; white-space: nowrap; }
.msg-selection-bar {
  display: flex;
  flex: none;
  gap: 8px;
  align-items: center;
  padding: 7px 14px;
  background: rgba(255, 255, 255, .96);
}
.msg-selection-count { margin-right: auto; }
.msg-context-menu {
  position: fixed;
  z-index: var(--z-overlay, 1200);
  display: flex;
  min-width: 190px;
  padding: 6px;
  flex-direction: column;
  border: 1px solid #DDE3E8;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(24, 43, 57, .24);
}
.msg-context-action, .msg-forward-target {
  padding: 9px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.msg-context-action:hover, .msg-forward-target:hover { background: #EDF3F7; }
.msg-context-action.danger { background: transparent; color: #C23C32; opacity: 1; }
.msg-context-action.danger:hover { background: #EDF3F7; color: #C23C32; opacity: 1; }
.msg-forward-dialog {
  position: fixed;
  z-index: var(--z-overlay, 1200);
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(24, 43, 57, .34);
}
.msg-forward-card {
  display: flex;
  width: min(390px, 100%);
  max-height: min(620px, 80vh);
  padding: 12px;
  flex-direction: column;
  gap: 3px;
  overflow: auto;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 16px 42px rgba(24, 43, 57, .25);
}
.msg-forward-head { display: flex; justify-content: space-between; gap: 12px; padding: 7px; }
.msg-attach-actions { flex: none; flex-wrap: nowrap; gap: 1px; }
.msg-attach-pick, .msg-attach-voice, .msg-send {
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  font-size: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.msg-attach-pick, .msg-attach-voice { background: transparent; color: #75808B; }
.msg-attach-pick:hover, .msg-attach-voice:hover { background: #EDF3F7; color: var(--msg-blue); }
.msg-send { background: var(--msg-blue); color: #fff; }
.msg-send:hover { background: #2384DE; }
.msg-attach-pick::before, .msg-attach-voice::before, .msg-send::before {
  content: "";
  width: 19px;
  height: 19px;
  background: currentColor;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}
.msg-attach-pick::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%23000' d='M13.9 5.2 7.4 11.7a2 2 0 1 0 2.8 2.8l6.2-6.2a4 4 0 0 0-5.7-5.7L4.2 9.1a6 6 0 0 0 8.5 8.5l5.1-5.1-1.4-1.4-5.1 5.1a4 4 0 0 1-5.7-5.7L12.1 4a2 2 0 1 1 2.8 2.8L8.7 13a.5.5 0 1 1-.7-.7l6.5-6.5-1.4-1.4Z'/%3E%3C/svg%3E");
}
.msg-attach-voice::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%23000' d='M10 13a3 3 0 0 0 3-3V5a3 3 0 1 0-6 0v5a3 3 0 0 0 3 3Zm5-3a5 5 0 0 1-10 0H3a7 7 0 0 0 6 6.9V19h2v-2.1A7 7 0 0 0 17 10Z'/%3E%3C/svg%3E");
}
.msg-send::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%23000' d='m2 3 16 7-16 7 2-6 8-1-8-1Z'/%3E%3C/svg%3E");
}
.msg-attach { gap: 4px; }
.msg-attach-note, .msg-attach-list { padding: 0 7px; }

/* Информация о беседе */
.msg-people { display: none; padding: 0; overflow-y: auto; border-left: 1px solid #E5E9ED; background: #F5F6F8; }
.msg-screen.people-open .msg-people:not(.collapsed) { display: flex; flex-direction: column; }
.msg-people-head {
  min-height: 58px;
  padding: 12px 14px;
  border-bottom: 1px solid #E5E9ED;
  background: #fff;
}
.msg-people-title {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
}
.msg-people-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #6F7983;
  font-size: 0;
}
.msg-people-close::before { content: "×"; font-size: 23px; font-weight: 300; }
.msg-people-close:hover { background: #EDF1F4; }
.msg-people-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 16px 18px;
  background: #fff;
}
.msg-people-avatar { width: 74px; height: 74px; flex-basis: 74px; font-size: 19px; }
.msg-people-name { margin-top: 12px; font-size: 16px; text-align: center; }
.msg-people-kind { margin-top: 3px; color: #7B858F; font-size: 11.5px; }
.msg-people-body { margin: 10px; overflow: hidden; border-radius: 13px; background: #fff; }
.msg-person { display: flex; align-items: center; gap: 10px; padding: 9px 11px; }
.msg-person .msg-avatar { flex-basis: 36px; width: 36px; height: 36px; font-size: 10px; }
.msg-person-name { font-size: 12.5px; }
.msg-person-role { margin-top: 2px; color: var(--msg-blue); }
.msg-notification-toggle {
  display: flex;
  margin: 10px;
  padding: 11px 13px;
  align-items: center;
  gap: 9px;
  border-radius: 13px;
  background: #fff;
}
.msg-people-manage { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; padding: 10px; border-bottom: 1px solid #EEF1F3; }
.msg-people-manage select { min-width: 0; }
.msg-person > .link { margin-left: auto; flex: none; }

@media (max-width: 1180px) and (min-width: 721px) {
  .msg-screen, .msg-screen.people-open { grid-template-columns: 275px minmax(0, 1fr); }
  .msg-screen.people-open .msg-people:not(.collapsed) {
    display: flex;
    position: absolute;
    inset: 0 0 0 auto;
    width: min(330px, 38vw);
    z-index: 4;
    box-shadow: -10px 0 30px rgba(20, 42, 58, .16);
  }
  .msg-people-close { display: inline-flex; align-items: center; justify-content: center; }
}

@media (max-width: 1350px) and (min-width: 721px) {
  .msg-search {
    flex-basis: 34px;
    width: 34px;
    padding: 0;
    color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none' stroke='%2363707C' stroke-width='1.7'%3E%3Ccircle cx='8' cy='8' r='5'/%3E%3Cpath d='m12 12 4 4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px;
  }
  .msg-search::placeholder { color: transparent; }
}

@media (max-width: 720px) {
  #messengerScreen > .screen-head { margin-bottom: 8px; }
  .msg-screen, .msg-screen.people-open {
    grid-template-columns: minmax(0, 1fr);
    height: calc(100dvh - 270px);
    min-height: 480px;
    border-radius: 12px;
  }
  .msg-side { border-right: 0; }
  .msg-side-heading { font-size: 16px; }
  .msg-row, .msg-contact { min-height: 60px; }
  .msg-screen.thread-open .msg-main { display: flex; }
  .msg-thread-head { min-height: 54px; margin: 7px 7px 6px; padding: 6px; }
  .msg-thread-avatar { flex-basis: 34px; width: 34px; height: 34px; font-size: 10px; }
  .msg-search { display: none; }
  .msg-people-toggle { margin-left: auto; padding: 0; font-size: 0; }
  .msg-pins { margin: 0 7px 5px; }
  .msg-feed, .msg-results { padding: 10px 8px 12px; }
  .msg-screen.selecting .msg-feed, .msg-screen.selecting .msg-results { padding-left: 38px; }
  .msg-item { max-width: 88%; }
  .msg-compose { margin: 0 7px 7px; padding: 5px 6px; border-radius: 16px; }
  .msg-compose-row { flex-direction: row; align-items: center; }
  .msg-compose-row button { width: 34px; min-width: 34px; height: 34px; }
  .msg-attach-actions { flex: none; }
  .msg-attach-actions button { flex: none; }
  .msg-selection-bar { flex-wrap: wrap; padding: 6px 8px; }
  .msg-selection-bar button { flex: 1; }
  .msg-selection-count { flex-basis: 100%; }
  .msg-screen.thread-open .msg-people:not(.collapsed) {
    display: flex;
    inset: 7px;
    height: auto;
    border-radius: 14px;
  }
}
.msg-inline-approval { margin-top: 8px; }
.msg-approval-shade {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay, 1200);
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(17, 24, 39, .45);
}
.msg-approval-card {
  width: min(520px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  overflow: auto;
  padding: 22px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(17, 24, 39, .24);
}
.msg-approval-card h2 { margin: 0 0 14px; }
.msg-approval-path { font-weight: 700; }
.msg-approval-value { padding: 10px 12px; border-radius: 10px; background: #f3f4f6; }
.msg-approval-value.proposed { margin-top: 8px; background: #eef7f1; }
.msg-approval-card textarea { width: 100%; margin-top: 10px; resize: vertical; }
.msg-approval-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
