/* ProjectLeKa — стиль на основе токенов Elastic UI (тема Borealis) */

:root {
  --bg: #f6f9fc;
  --surface: #ffffff;
  --surface-subdued: #fbfcfe;
  --border: #e3e8f2;
  --border-strong: #cad3e2;
  --text: #1d2a3e;
  --text-heading: #111c2c;
  --text-muted: #516381;
  --text-faint: #798eaf;

  --primary: #0b64dd;
  --primary-dark: #1750ba;
  --primary-soft: #d9e8ff;
  --primary-soft-2: #f1f6ff;

  --success: #008a5e;
  --success-text: #09724d;
  --success-soft: #c9f3e3;

  --warning: #facb3d;
  --warning-text: #6a4906;
  --warning-soft: #fde9b5;

  --danger: #c61e25;
  --danger-text: #a71627;
  --danger-soft: #fddddd8;
  --danger-soft: #fdddd8;

  --risk: #ed6723;
  --risk-text: #9e3a16;
  --risk-soft: #ffdebf;

  --radius: 4px;
  --font-body: 'Inter', -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: 'Roboto Mono', Consolas, Menlo, monospace;

  --ease: cubic-bezier(.32,.72,0,1);
  --ease-bounce: cubic-bezier(.34,1.61,.7,1);
  --speed-fast: 150ms;
  --speed-normal: 250ms;
  --speed-slow: 350ms;

  --shadow-xs: 0px 0px 2px 0px hsla(216,30%,24%,.16), 0px 1px 4px 0px hsla(216,30%,24%,.06), 0px 2px 8px 0px hsla(216,30%,24%,.04);
  --shadow-s: 0px 0px 2px 0px hsla(216,30%,24%,.16), 0px 2px 7px 0px hsla(216,30%,24%,.08), 0px 4px 11px 0px hsla(216,30%,24%,.05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { color: var(--text-heading); font-weight: 600; }

a { color: var(--primary); text-decoration: none; transition: color var(--speed-fast) var(--ease); }
a:hover { color: var(--primary-dark); text-decoration: underline; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius); }

.layout { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--surface);
  color: var(--text);
  padding: 16px 12px;
  border-right: 1px solid var(--border);
}

.sidebar .brand-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 0 10px 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.sidebar .brand {
  font-weight: 700;
  font-size: 19px;
  color: var(--text-heading);
  text-transform: uppercase;
  letter-spacing: .04em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.sidebar .brand-logo {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 9px;
  object-fit: cover;
}

/* Кнопка-название компании (владельца системы, см. app/models/company.py)
   — под брендом, отделена линией сверху, ведёт в отдельное хранилище
   документов компании (СРО, устав и т.п.), не привязанное ни к одному
   проекту. */
.sidebar .brand-org {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  text-decoration: none;
  color: var(--text-muted);
}
.sidebar .brand-org:hover {
  color: var(--text);
}
.sidebar .brand-org-logo {
  width: 18px; height: 18px; flex-shrink: 0;
  border-radius: 4px;
  object-fit: cover;
}
.sidebar .brand-org-logo-placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; background: var(--surface); border: 1px dashed var(--border-strong);
}
.sidebar .brand-org-name {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 13.5px;
  margin-bottom: 1px;
  position: relative;
  transition: background-color var(--speed-fast) var(--ease), color var(--speed-fast) var(--ease);
}
.sidebar nav a svg { flex-shrink: 0; opacity: .8; }
.sidebar nav a.active svg { opacity: 1; }

.sidebar nav a:hover, .sidebar nav a.active {
  background: var(--primary-soft-2);
  color: var(--primary-dark);
  text-decoration: none;
}
.sidebar nav a.active { font-weight: 500; }
.sidebar nav a.active::before {
  content: "";
  position: absolute; left: -12px; top: 3px; bottom: 3px; width: 3px;
  background: var(--primary); border-radius: 0 3px 3px 0;
}

.sidebar .section-label {
  padding: 14px 10px 5px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-faint);
}

/* Наименование объекта в шапке проекта на левой панели — крупнее и
   чёрным, в отличие от мелких серых заголовков разделов (.section-label
   выше): это не служебная подпись, а сам проект, должен бросаться в глаза. */
.sidebar .sidebar-project-name {
  padding: 14px 10px 6px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: #000;
}

/* ---------- Main / topbar ---------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  /* Боковые отступы совпадают с .content ниже, чтобы заголовок был на
     одной вертикали с содержимым страницы. min-height вместо height:
     при фиксированной высоте длинное наименование объекта переносилось
     на вторую строку и вылезало за пределы панели, упираясь в край. */
  padding: 8px 28px;
  min-height: 48px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
/* Заголовок — в одну строку с многоточием: длина наименований объектов
   не ограничена, а высота панели должна быть одинаковой на всех
   страницах. Полное наименование видно в боковом меню. */
.topbar > :first-child { min-width: 0; flex: 1; }
.topbar h1, .topbar h2, .topbar h3 {
  font-size: 19px; margin: 0; font-weight: 700; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.topbar .user-info {
  font-size: 13px; color: var(--text-muted);
  display: flex; align-items: center; gap: 9px; flex-shrink: 0;
}
.user-avatar {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary); color: #fff; font-size: 10px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}

.content { padding: 24px 28px 40px; flex: 1; }

/* ---------- Panels / cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--speed-normal) var(--ease);
  display: flex;
  flex-direction: column;
}
a.card:hover, .card.hoverable:hover { box-shadow: var(--shadow-s); }

.card h2, .card h3 { margin-top: 0; }
.card h3 { font-size: 13px; text-transform: none; }
/* Карточки вроде "Участники"/"Сроки" на вкладке "Обзор" — список из
   обычных <p> без своего класса; убираем крупный браузерный отступ
   абзаца, чтобы строки не разъезжались. Явный inline-стиль (margin-bottom:0
   у последней строки и т.п.) продолжает работать поверх. */
.card p { margin: 5px 0; line-height: 1.4; }

.grid { display: grid; gap: 16px; margin-bottom: 16px; align-items: stretch; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

/* Внутри сетки карточки не добавляют собственный отступ — расстояние
   между ними задаёт только gap сетки, все карточки одной высоты. */
.grid > .card, .grid > .metric { margin-bottom: 0; height: 100%; }

@media (max-width: 900px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr 1fr; }
}

.metric { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-xs); }
.metric .label { font-size: 10.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.metric .value { font-size: 24px; font-weight: 600; margin-top: 4px; color: var(--text-heading); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--text-faint); font-weight: 600; font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em; }
tr { transition: background-color var(--speed-fast) var(--ease); }
tr:hover td { background: rgba(54,95,178,.06); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 16px;
  border-radius: var(--radius);
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: background-color var(--speed-fast) var(--ease), border-color var(--speed-fast) var(--ease), transform var(--speed-fast) var(--ease-bounce), box-shadow var(--speed-fast) var(--ease);
}
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-s); color: #fff; }
.btn.secondary { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn.secondary.active { background: var(--primary-soft); color: var(--primary-dark); border-color: var(--primary); }
.btn.secondary:hover { background: var(--primary-soft-2); color: var(--primary-dark); border-color: var(--primary); box-shadow: none; }
.btn.small { height: 26px; padding: 0 11px; font-size: 12px; }
/* Единая высота маленьких контролов (кнопка .btn.small — 26px) — эти
   <select> стоят рядом с такими кнопками ("Сохранить" на сводке
   проекта), уменьшены под ту же высоту вместо того, чтобы расти кнопке. */
#summary-stage-form select { height: 26px; padding: 0 8px; font-size: 12px; }

/* Кнопки-иконки в один ряд (тулбар над деревом документов) — крупный
   значок, без подписи, подсказка — через title (нативный tooltip). */
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  width: 34px; height: 34px; padding: 0;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background-color var(--speed-fast) var(--ease), border-color var(--speed-fast) var(--ease), color var(--speed-fast) var(--ease);
}
.btn-icon:hover { background: var(--primary-soft-2); color: var(--primary-dark); border-color: var(--primary); text-decoration: none; }
.btn-icon svg { width: 18px; height: 18px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius);
  font-size: 11.5px;
  font-weight: 500;
  background: #ecf1f9;
  color: var(--text-muted);
}
.badge.success { background: var(--success-soft); color: var(--success-text); }
.badge.warning { background: var(--warning-soft); color: var(--warning-text); }
.badge.danger { background: var(--danger-soft); color: var(--danger-text); }
.badge.primary { background: var(--primary-soft); color: var(--primary-dark); }

/* ---------- Forms ---------- */
form .field { margin-bottom: 14px; }
form label { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; color: var(--text-faint); font-weight: 600; }
input, select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 13.5px;
  font-family: var(--font-body);
  background: #fff;
  color: var(--text);
  transition: border-color var(--speed-fast) var(--ease), box-shadow var(--speed-fast) var(--ease);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft-2), 0 0 0 1px var(--primary);
}
textarea { resize: vertical; }
input[type="checkbox"] { width: auto; }

input[type="file"] {
  padding: 6px;
  font-size: 12.5px;
  color: var(--text-faint);
}
input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 11px;
  margin-right: 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12px;
  cursor: pointer;
  transition: background-color var(--speed-fast) var(--ease), border-color var(--speed-fast) var(--ease), color var(--speed-fast) var(--ease);
}
input[type="file"]::file-selector-button:hover,
input[type="file"]::-webkit-file-upload-button:hover {
  background: var(--primary-soft-2);
  color: var(--primary-dark);
  border-color: var(--primary);
}

.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; font-size: 13.5px; }
.flash.success { background: var(--success-soft); color: var(--success-text); }
.flash.danger { background: var(--danger-soft); color: var(--danger-text); }
.flash.warning { background: var(--warning-soft); color: var(--warning-text); }
.flash.info { background: var(--primary-soft); color: var(--primary-dark); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs a {
  padding: 9px 14px;
  color: var(--text-muted);
  font-size: 13.5px;
  border-bottom: 2px solid transparent;
  transition: color var(--speed-fast) var(--ease), border-color var(--speed-fast) var(--ease);
}
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }
.tabs a:hover { color: var(--text); text-decoration: none; }

.empty-state { color: var(--text-faint); font-style: italic; padding: 20px 0; }

.chat-messages { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; max-height: 60vh; overflow-y: auto; padding-right: 4px; }
.chat-message { padding: 10px 14px; border-radius: 10px; max-width: 88%; font-size: 13.5px; }
.chat-message.user { align-self: flex-end; background: var(--primary); color: #fff; white-space: pre-wrap; }
.chat-message.assistant { align-self: flex-start; background: var(--surface-subdued); color: var(--text); border: 1px solid var(--border); }

/* Ответ ассистента рендерится из markdown (см.
   app/utils/template_helpers.py::chat_markdown) — структурные отступы
   и списки берём от самого HTML, а не от белого пространства в тексте. */
.chat-message-body > *:first-child { margin-top: 0; }
.chat-message-body > *:last-child { margin-bottom: 0; }
.chat-message-body p { margin: 0 0 10px; }
.chat-message-body ul, .chat-message-body ol { margin: 0 0 10px; padding-left: 20px; }
.chat-message-body li { margin-bottom: 4px; }
.chat-message-body li:last-child { margin-bottom: 0; }
.chat-message-body h1, .chat-message-body h2, .chat-message-body h3, .chat-message-body h4 {
  font-size: 1em; font-weight: 700; margin: 14px 0 6px; color: var(--text-heading);
}
.chat-message-body h1:first-child, .chat-message-body h2:first-child,
.chat-message-body h3:first-child, .chat-message-body h4:first-child { margin-top: 0; }
.chat-message-body code { background: var(--surface); border: 1px solid var(--border); border-radius: 3px; padding: 1px 4px; font-size: 12px; }
.chat-message-body strong { color: var(--text-heading); }
.chat-message-body hr { border: none; border-top: 1px solid var(--border); margin: 10px 0; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
.login-card { width: 360px; padding: 6px; position: relative; z-index: 2; box-shadow: var(--shadow-s); }
.login-back-btn { width: 100%; justify-content: center; margin-top: 8px; }
.login-logo { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; display: block; margin-bottom: 10px; }
.login-card h2 { font-size: 22px; margin: 0 0 2px; }
.login-card > p { font-size: 13px; }
.login-card .btn { width: 100%; justify-content: center; }

/* ---------- Крупный заголовок графы с иконкой-стикером ---------- */
.panel-title { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.panel-title .icon {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: var(--primary-soft); color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center;
}
.panel-title .text { font-size: 16px; font-weight: 700; color: var(--text-heading); }

/* ---------- Статус проекта (крупно) ---------- */
.status-display { display: flex; align-items: center; gap: 10px; }
.status-display .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.status-display .label { font-size: 22px; font-weight: 700; color: var(--text-heading); letter-spacing: -.01em; }
.status-display.status-done .dot { background: var(--success); }
.status-display.status-done .label { color: var(--success-text); }
.status-display.status-paused .dot { background: var(--warning); }
.status-display.status-paused .label { color: var(--warning-text); }

/* ---------- Таймлайн сроков (компактный, календарного вида) ---------- */
.timeline-viz { position: relative; margin-top: 10px; padding: 22px 2px 0; overflow: hidden; }

.timeline-track { position: relative; height: 3px; background: var(--border-strong); border-radius: 2px; }
.timeline-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--primary); border-radius: 2px; }

.timeline-point {
  position: absolute; top: 50%; left: 0; transform: translate(-50%, -50%);
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border-strong);
  z-index: 2;
}
.timeline-point.is-past { border-color: var(--primary); background: var(--primary); }

.timeline-point-label {
  position: absolute; bottom: 10px; left: 0;
  font-size: 10px; line-height: 1.35; white-space: nowrap;
}
.timeline-point-label .t-name { font-weight: 600; color: var(--text); }
.timeline-point-label .t-date { color: var(--text-faint); margin-left: 3px; }
.timeline-point-label.align-center { transform: translateX(-50%); text-align: center; }
.timeline-point-label.align-start { text-align: left; }
.timeline-point-label.align-end { left: auto; right: 0; text-align: right; }

.timeline-today-marker {
  position: absolute; top: -20px; left: 0;
  font-size: 9.5px; font-weight: 600; color: var(--primary-dark);
  background: var(--primary-soft); padding: 1px 6px; border-radius: 999px; white-space: nowrap;
  z-index: 3;
}
.timeline-today-marker.align-center { transform: translateX(-50%); }
.timeline-today-marker.align-end { left: auto; right: 0; }

/* Календарная сетка месяцев под шкалой */
.timeline-ticks { position: relative; height: 20px; margin-top: 8px; }
.timeline-tick { position: absolute; top: 0; left: 0; width: 1px; height: 5px; background: var(--border-strong); }
.timeline-tick-label {
  position: absolute; top: 7px; left: 0; font-size: 9.5px; color: var(--text-faint); white-space: nowrap;
}
.timeline-tick-label.align-center { transform: translateX(-50%); }
.timeline-tick-label.align-end { left: auto; right: 0; }

/* ---------- Проектирование: дерево структуры ---------- */
.design-layout { display: flex; gap: 16px; align-items: flex-start; }
.design-tree-panel { width: 320px; flex-shrink: 0; }
.design-tree-panel.full-width { width: 100%; }
.design-workspace { flex: 1; min-width: 0; }

/* Колонки Статус/Версия/Исполнитель — видны только в полноэкранном
   виде "Проектная документация" (когда ничего не выбрано); в узкой
   боковой панели (документ/раздел выбраны) остаются скрытыми. */
.doc-meta { display: none; }
.design-tree-panel.full-width .doc-meta {
  display: flex; align-items: center; gap: 0; flex-shrink: 0; margin-left: 12px; align-self: stretch;
}
.doc-meta .meta-status, .doc-meta .meta-approval, .doc-meta .meta-version, .doc-meta .meta-executor {
  border-left: 1px solid var(--border); padding: 0 14px;
  display: flex; align-items: center;
}
.doc-meta .meta-status { width: 120px; flex-shrink: 0; }
.doc-meta .meta-approval { width: 150px; flex-shrink: 0; }
.doc-meta .meta-version { width: 46px; flex-shrink: 0; font-size: 12px; color: var(--text-faint); justify-content: center; }
.doc-meta .meta-executor {
  width: 160px; flex-shrink: 0; font-size: 12px; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tree-columns-head {
  display: flex; align-items: center; gap: 18px; padding: 0 8px 8px 30px;
}
.tree-columns-head .doc-meta { display: flex; margin-left: 12px; }
.tree-columns-head .meta-status, .tree-columns-head .meta-approval, .tree-columns-head .meta-version, .tree-columns-head .meta-executor {
  font-size: 10.5px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .03em; text-align: left;
}

.tree-list { list-style: none; margin: 0; padding: 0; }
.tree-list .tree-list { padding-left: 16px; }
.tree-node { margin-bottom: 1px; }
.tree-row {
  display: flex; align-items: flex-start; gap: 6px; padding: 6px 8px; border-radius: var(--radius);
  cursor: pointer; transition: background-color var(--speed-fast) var(--ease);
}
.tree-row .tree-toggle, .tree-row .tree-code { margin-top: 2px; }
.tree-row:hover { background: var(--primary-soft-2); }
.tree-row.is-selected { background: var(--primary-soft); }
.tree-toggle {
  width: 16px; height: 16px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  transition: transform 200ms ease-out; color: var(--text-faint);
}
.tree-node.is-open > .tree-row .tree-toggle { transform: rotate(90deg); }
.tree-children { max-height: 3000px; opacity: 1; overflow: hidden; transition: max-height 200ms ease-out, opacity 200ms ease-out; }
.tree-node:not(.is-open) > .tree-children { max-height: 0; opacity: 0; }
.tree-label { font-size: 13px; flex: 1; min-width: 0; white-space: normal; word-break: break-word; line-height: 1.35; }
/* Разделы (без своей колонки статуса/версии) резервируют то же место
   справа, что фактически занимает doc-meta у строк документов — тогда
   текст everywhere упирается в одну и ту же вертикальную границу,
   независимо от глубины вложенности раздела. */
.design-tree-panel.full-width .tree-label { margin-right: 480px; }
.tree-label-link {
  display: flex; align-items: flex-start; gap: 6px; flex: 1; min-width: 0;
  text-decoration: none; color: inherit; border-radius: var(--radius-sm);
  padding: 2px 6px; margin: -2px -6px; transition: background-color var(--speed-fast) var(--ease);
}
.tree-label-link:hover { text-decoration: none; background: var(--primary-soft-2); }
.tree-label-link.is-selected { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }

/* ---------- Список документов раздела (компактные строки в 1 строку) ---------- */
.section-doc-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); margin-bottom: 6px; text-decoration: none; color: inherit;
  transition: background-color var(--speed-fast) var(--ease), border-color var(--speed-fast) var(--ease);
}
.section-doc-row:hover { background: var(--surface-subdued); border-color: var(--border-strong); text-decoration: none; }
.section-doc-row .doc-icon { flex-shrink: 0; color: var(--text-faint); }
.section-doc-row .doc-name { font-size: 13px; font-weight: 600; color: var(--text-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.section-doc-row .doc-code { font-size: 11.5px; color: var(--text-faint); flex-shrink: 0; }
.section-doc-row .doc-spacer { flex: 1; min-width: 8px; }
.tree-code { font-size: 10.5px; color: var(--text-faint); font-family: var(--font-mono, monospace); flex-shrink: 0; margin-right: 6px; }
.tree-count {
  font-size: 10px; font-weight: 600; color: var(--danger-text); background: var(--danger-soft);
  border-radius: 999px; padding: 1px 6px; flex-shrink: 0;
}
.tree-doc-row {
  display: flex; align-items: flex-start; gap: 8px; padding: 5px 8px 5px 30px; border-radius: var(--radius);
  cursor: pointer; font-size: 12.5px; color: var(--text-muted); line-height: 1.35;
}
.tree-doc-row { transition: background-color var(--speed-fast) var(--ease), color var(--speed-fast) var(--ease); }
.tree-doc-row svg { flex-shrink: 0; margin-top: 2px; }
.tree-doc-row .doc-meta { align-self: stretch; }
.tree-doc-row:hover { background: var(--primary-soft-2); color: var(--text); }
.tree-doc-row.is-selected { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }

/* ---------- Карточка документа + просмотрщик ---------- */
.doc-card { animation: fadeSlideIn 260ms var(--ease) both; }
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.doc-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.doc-status-select { display: inline-flex; gap: 6px; }
.version-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius); font-size: 12.5px;
}
.version-row.is-current { background: var(--primary-soft-2); }
.version-row:not(.is-current) { color: var(--text-faint); }
.version-row[data-version-link] { cursor: pointer; }
.version-row[data-version-link]:hover { background: var(--surface-subdued); }
.version-row.is-active { box-shadow: inset 0 0 0 1.5px var(--primary); }
.version-row .btn-icon { width: 28px; height: 28px; flex-shrink: 0; }

.version-more-wrap { position: relative; }
.version-popup {
  display: none;
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-s);
  padding: 6px;
}
.version-popup.is-open { display: block; }

.upload-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--speed-fast) var(--ease);
}
.upload-panel.is-open { max-height: 260px; }
.upload-panel.attachments-panel.is-open { max-height: 420px; overflow-y: auto; }
/* Редактор маршрута согласования: одна строка этапа ~130px, этапов обычно
   несколько — базовых 260px не хватает и кнопка "Сохранить" обрезается. */
.upload-panel.approval-panel.is-open { max-height: 720px; overflow-y: auto; }
.upload-panel-inner { padding-top: 14px; }

.pdf-viewer-wrap { position: relative; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #525659; }
.pdf-toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--surface); border-bottom: 1px solid var(--border); font-size: 12.5px; }
/* justify-content: center вместе с overflow: auto заставлял страницы
   дёргаться влево-вправо: страницы дорисовываются по очереди, ширина
   содержимого меняется, и центрирование пересчитывается на каждой.
   Центрируем через margin: auto у содержимого — оно не пересчитывает
   раскладку при дорисовке и не прячет левый край при прокрутке. */
.pdf-canvas-stack { position: relative; overflow: auto; max-height: 75vh; padding: 12px; }
/* Центрируем КАЖДУЮ страницу, а не контейнер: у контейнера ширина
   fit-content меняется по мере дорисовки страниц, и центрирование
   пересчитывается — картинка снова начинала прыгать. */
.pdf-canvas-stack > * { width: 100%; }
.pdf-canvas-stack .pdf-page { margin-left: auto; margin-right: auto; }
#pdf-pages { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pdf-page { position: relative; }
.pdf-page canvas { display: block; box-shadow: 0 2px 10px rgba(0,0,0,.3); background: #fff; }
.pdf-page-overlay { position: absolute; top: 0; left: 0; }
.remark-pin {
  position: absolute; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 999px;
  background: var(--primary); border: 2.5px solid #fff; transform: translate(-50%, -50%);
  cursor: pointer; box-shadow: var(--shadow-s); z-index: 5;
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s var(--ease);
}
.remark-pin:hover { transform: translate(-50%, -50%) scale(1.12); }
.remark-pin.is-fixed { background: var(--warning); }
.remark-pin.is-fixed span { color: var(--warning-text); }
.remark-pin.is-closed { background: var(--success); }
.remark-pin span { font-size: 12px; font-weight: 700; color: #fff; line-height: 1; white-space: nowrap; }
.pin-placing .pdf-page canvas { cursor: crosshair; }

/* ---------- График проектирования: таблица + временная шкала ---------- */
.sched-legend { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; font-size: 12px; color: var(--text-muted); }
.sched-legend-item { display: flex; align-items: center; gap: 5px; color: var(--text); }
.sched-legend-item .dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sched-wrap { overflow-x: auto; }
.sched-table { min-width: 1560px; }
.sched-head { display: grid; grid-template-columns: 260px 82px 82px 70px 70px 118px 130px 56px minmax(540px, 1fr); font-size: 10.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .03em; padding: 0 8px 8px; border-bottom: 1px solid var(--border); }
.sched-head .sched-col-dates { display: contents; }
.sched-row { display: grid; grid-template-columns: 260px 82px 82px 70px 70px 118px 130px 56px minmax(540px, 1fr); align-items: center; padding: 6px 8px; border-bottom: 1px solid var(--surface-subdued); }
.sched-row-section { background: var(--surface-subdued); border-bottom: 1px solid var(--border); cursor: pointer; font-weight: 600; }
.sched-row-section .sched-col-name { font-size: 12.5px; color: var(--text); }
.sched-row .sched-col-dates { display: contents; }
.sched-doc-form { display: contents; }
.sched-col-name { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; }
.sched-col-name a { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-row:not(.sched-row-section) .sched-col-name a { font-size: 12px; color: var(--text); }
.sched-row:not(.sched-row-section) .sched-col-name a:hover { color: var(--primary); }
.sched-col-date-static { font-size: 11.5px; color: var(--text-muted); }
.sched-doc-form input[type="date"] { height: 26px; padding: 0 6px; font-size: 11px; width: 100%; }
.sched-col-resp { font-size: 11.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-col-pct { display: flex; align-items: center; gap: 3px; font-size: 11px; color: var(--text-muted); }
.sched-col-pct input[type="number"] { height: 26px; width: 46px; padding: 0 4px; font-size: 11px; }
.sched-col-doc .badge, .sched-col-appr .badge { font-size: 10.5px; padding: 2px 7px; }
.sched-col-remarks { display: flex; justify-content: center; }
.sched-remarks-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 9px; background: var(--danger-soft); color: var(--danger-text);
  font-size: 10.5px; font-weight: 700;
}
.sched-col-timeline { min-width: 540px; }
.sched-months { display: flex; height: 100%; align-items: flex-end; padding-bottom: 2px; }
.sched-months span { flex: 1; text-align: center; font-size: 10.5px; color: var(--text-faint); text-transform: uppercase; border-left: 1px solid var(--border); }
.sched-months span:first-child { border-left: none; }
.sched-track { position: relative; height: 20px; background: var(--surface-subdued); border-radius: var(--radius); }
.sched-today { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--danger); opacity: .5; }
.sched-bar { position: absolute; top: 2px; height: 16px; border-radius: var(--radius); overflow: visible; border: 1px solid; }
.sched-bar-fill { height: 100%; border-radius: var(--radius); overflow: hidden; }
.sched-bar.status-track { background: var(--primary-soft); border-color: var(--primary); }
.sched-bar.status-risk { background: var(--warning-soft); border-color: var(--warning); }
.sched-bar.status-overdue { background: var(--danger-soft); border-color: var(--danger); }
.sched-bar.status-done { background: var(--success-soft); border-color: var(--success); }
.sched-bar.status-track .sched-bar-fill { background: var(--primary); }
.sched-bar.status-risk .sched-bar-fill { background: var(--warning); }
.sched-bar.status-overdue .sched-bar-fill { background: var(--danger); }
.sched-bar.status-done .sched-bar-fill { background: var(--success); }
.sched-bar.is-editable { cursor: grab; }
.sched-bar.is-editable:active { cursor: grabbing; }
.sched-bar.is-editable.is-dragging { z-index: 6; box-shadow: var(--shadow-s); }
.sched-bar-handle { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; z-index: 3; }
.sched-bar-handle.left { left: -3px; }
.sched-bar-handle.right { right: -3px; }
.sched-drag-handle { color: var(--text-faint); flex-shrink: 0; cursor: grab; }
.sched-stage-row.is-dragging { opacity: .4; }
.sched-stage-row.drag-over-top { border-top: 2px solid var(--primary); }
.sched-stage-row.drag-over-bottom { border-bottom: 2px solid var(--primary); }
.sched-row-section.drag-over-stage { background: var(--primary-soft-2); }
.sched-row-section.is-dragging { opacity: .4; }
.sched-row-section.drag-over-top { border-top: 2px solid var(--primary); }
.sched-row-section.drag-over-bottom { border-bottom: 2px solid var(--primary); }
.sched-toggle { display: inline-flex; width: 10px; flex-shrink: 0; color: var(--text-faint); transition: transform .15s var(--ease); }
.sched-node.is-open > .sched-row-section .sched-toggle { transform: rotate(90deg); }
.sched-remove-form { position: absolute; top: -1px; right: -28px; opacity: 0; transition: opacity .1s; }
.sched-row:hover .sched-remove-form { opacity: 1; }
.sched-remove-btn { border: none; background: transparent; color: var(--text-faint); cursor: pointer; font-size: 13px; padding: 2px 4px; line-height: 1; }
.sched-remove-btn:hover { color: var(--danger); }

.sched-switcher-wrap { position: relative; }
.sched-switcher-dropdown {
  display: none;
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0;
  min-width: 100%; width: max-content; max-width: 360px; max-height: 320px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: var(--shadow-s);
  padding: 4px;
}
.sched-switcher-dropdown.is-open { display: block; }
.sched-switcher-item {
  display: block; padding: 8px 10px; border-radius: var(--radius);
  font-size: 12.5px; color: var(--text); text-decoration: none; white-space: nowrap;
}
.sched-switcher-item:hover { background: var(--surface-subdued); text-decoration: none; }
.sched-switcher-item.is-active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.sched-children { overflow: hidden; max-height: 4000px; transition: max-height 200ms ease-out; }
.sched-node:not(.is-open) > .sched-children { max-height: 0; }

/* ---------- Модальное окно: инструмент формирования структуры ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,22,34,.5); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal-panel {
  background: var(--surface); border-radius: var(--radius); width: min(760px, 100%);
  max-height: 88vh; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: var(--shadow-s); animation: fadeSlideIn 200ms var(--ease);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 14px; }
.modal-body { padding: 4px 20px 22px; overflow-y: auto; }
/* Просмотр документа — модалка пошире и повыше обычной (форм), сам
   PDF-вьюер уже сам скроллит страницы внутри modal-body. */
.modal-panel-lg { width: min(1100px, 96vw); max-height: 94vh; }

/* Панель "Инструменты" карточки документа — выкатывается в потоке
   страницы (раздвигает контент, сдвигая превью ниже вниз), а не наплывает
   поверх него: превью остаётся полностью видимым и кликабельным и когда
   панель открыта, и когда закрыта. */
.doc-tools-wrap { margin-top: 12px; }
.doc-tools-dropdown {
  max-height: 0; overflow: hidden;
  border: 1px solid transparent; border-radius: var(--radius);
  transition: max-height 260ms var(--ease), border-color 260ms var(--ease), margin-top 260ms var(--ease);
}
.doc-tools-dropdown.is-open {
  max-height: 2400px; margin-top: 10px;
  border-color: var(--border-strong); background: var(--surface-subdued); padding: 16px;
}
@media (max-width: 760px) { .doc-tools-dropdown .grid.grid-2 { grid-template-columns: 1fr; } }

.tool-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: grab; font-size: 12.5px;
  transition: background-color var(--speed-fast) var(--ease);
}
.tool-row:hover { background: var(--surface-subdued); }
.tool-row.is-dragging { opacity: .4; }
.tool-row.drag-over-top { border-top: 2px solid var(--primary); }
.tool-row.drag-over-bottom { border-bottom: 2px solid var(--primary); }
.tool-drag-handle { color: var(--text-faint); flex-shrink: 0; }
.tool-row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-row-btn { border: none; background: transparent; color: var(--text-faint); cursor: pointer; font-size: 12px; padding: 3px 5px; border-radius: 4px; flex-shrink: 0; }
.tool-row-btn:hover { background: var(--border-soft); color: var(--text); }
.tool-edit-form { display: none; gap: 6px; margin: 4px 0 8px 26px; }
.tool-edit-form input { font-size: 12px; padding: 6px 8px; }

/* ---------- Гантт ---------- */
.gantt { position: relative; }
.gantt-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border-soft); }
.gantt-row:last-child { border-bottom: none; }
.gantt-label { width: 220px; flex-shrink: 0; font-size: 12.5px; }
.gantt-label .resp { display: block; font-size: 11px; color: var(--text-faint); }
.gantt-track { flex: 1; position: relative; height: 18px; background: var(--border-soft); border-radius: 4px; }
.gantt-bar {
  position: absolute; top: 0; bottom: 0; border-radius: 4px; background: var(--primary-soft);
  border: 1px solid var(--primary-soft); overflow: hidden;
}
.gantt-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--primary); border-radius: 4px 0 0 4px; }
.gantt-today-line { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--danger); z-index: 2; }
.gantt-pct { font-size: 10.5px; color: var(--text-faint); width: 34px; text-align: right; flex-shrink: 0; }

/* ---------- Сравнение документов ---------- */
.compare-wrap { position: relative; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #525659; }
.compare-stack { position: relative; }
.compare-stack canvas { position: absolute; top: 0; left: 0; }
.compare-curtain-handle {
  position: absolute; top: 0; bottom: 0; width: 3px; background: #fff; cursor: ew-resize; z-index: 6;
  box-shadow: 0 0 6px rgba(0,0,0,.5);
}
.compare-curtain-handle::after {
  content: ""; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.legend-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }

/* ---------- Публичная главная (лендинг) ----------
   Разметка — app/templates/home.html. Показывается только гостям
   (см. base.html: block guest_content). Цвета берутся из токенов темы,
   поэтому страница автоматически следует активной теме (theme-citadel). */

.lp-nav {
  position: sticky; top: 0; z-index: 50;
  background: hsla(0,0%,100%,.88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.lp-nav-inner {
  max-width: 1180px; margin: 0 auto; padding: 12px 32px;
  display: flex; align-items: center; gap: 28px;
}
.lp-brand {
  display: flex; align-items: center; gap: 12px;
  font-weight: 700; font-size: 20px; letter-spacing: .05em;
  text-transform: uppercase; color: var(--text-heading); text-decoration: none;
  flex-shrink: 0;
}
.lp-brand:hover { text-decoration: none; color: var(--text-heading); }
.lp-brand-logo { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.lp-brand-logo.sm { width: 34px; height: 34px; border-radius: 8px; }

.lp-nav-links { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.lp-nav-links a {
  font-size: 13.5px; color: var(--text-muted); text-decoration: none;
  padding: 6px 0; position: relative; transition: color var(--speed-fast) var(--ease);
}
.lp-nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--primary); border-radius: 2px;
  transform: scaleX(0); transition: transform var(--speed-fast) var(--ease);
}
.lp-nav-links a:hover { color: var(--primary-dark); text-decoration: none; }
.lp-nav-links a:hover::after { transform: scaleX(1); }
.lp-nav-cta { flex-shrink: 0; }

/* --- Первый экран: слоистая 2.5D-сцена (горы, озеро) ---
   Каждый слой — свой SVG на весь .lp-hero-wrap (viewBox общий для всех,
   поэтому силуэты стыкуются друг с другом без ручной подгонки по px).
   Порядок слоёв в разметке = порядок от заднего плана к переднему; JS
   (hero_parallax.js) двигает их с разной скоростью через --px/--py —
   сам список слоёв ничего про JS не знает, только читает --depth. */
.lp-hero-wrap {
  position: relative;
  overflow: hidden;
  min-height: 480px;
  border-bottom: 1px solid var(--border);
  isolation: isolate; /* сцена не проваливается под соседние секции по z-index */
}
.lp-scene { position: absolute; inset: 0; z-index: 0; }
.lp-scene-sky {
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    #0a3d3a 0%, #12615c 32%, #4c9a91 56%, #a9d2c4 74%, #eadfae 88%, #f4ecc9 100%);
}
@media (prefers-color-scheme: dark) {
  .lp-scene-sky {
    background: linear-gradient(180deg, #051f1d 0%, #0a3d3a 32%, #21625a 56%, #4f766b 74%, #7c7350 88%, #8c815a 100%);
  }
}
.lp-scene-sun {
  position: absolute; left: 50%; top: 46%; width: 260px; height: 260px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,238,196,.95) 0%, rgba(255,224,160,.5) 42%, rgba(255,224,160,0) 72%);
}
.lp-scene-cloud {
  position: absolute; height: 40px; border-radius: 999px; filter: blur(9px);
  background: hsla(0,0%,100%,.32);
}
/* Выше и по краям, вне текстовой колонки .lp-hero (она по центру,
   max-width:860px) — иначе на узких/средних экранах облако лезло
   прямо под плашку-киккер над заголовком. */
.lp-scene-cloud.c1 { width: 170px; top: 7%; left: 3%; animation: lp-drift 70s linear infinite; }
.lp-scene-cloud.c2 { width: 150px; top: 9%; right: 4%; left: auto; animation: lp-drift 95s linear infinite reverse; }
@keyframes lp-drift { from { transform: translateX(0); } to { transform: translateX(60px); } }

.lp-scene-layer { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lp-scene-lake { position: absolute; inset: 0; }
.lp-scene-shimmer {
  position: absolute; left: 0; right: 0; bottom: 0; height: 22%;
  background-image: repeating-linear-gradient(100deg, hsla(0,0%,100%,0) 0 40px, hsla(0,0%,100%,.16) 41px 43px, hsla(0,0%,100%,0) 44px 120px);
  background-size: 340px 100%;
  animation: lp-shimmer 7s linear infinite;
  mix-blend-mode: overlay;
  opacity: .8;
}
@keyframes lp-shimmer { from { background-position-x: 0; } to { background-position-x: 340px; } }

.lp-hero-wrap [data-depth] { transition: transform .06s linear; will-change: transform; }
@media (prefers-reduced-motion: reduce) {
  .lp-hero-wrap [data-depth] { transition: none; transform: none !important; }
  .lp-scene-cloud, .lp-scene-shimmer { animation: none; }
}

.lp-hero { position: relative; z-index: 2; padding: 84px 32px 76px; text-align: center; max-width: 860px; margin: 0 auto; }
.lp-kicker {
  font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--primary-dark); background: var(--primary-soft);
  display: inline-block; padding: 6px 14px; border-radius: 999px; margin-bottom: 20px;
}
.lp-hero h1 { font-size: 44px; line-height: 1.15; margin: 0 0 18px; letter-spacing: -.02em; }
.lp-hero p { font-size: 16.5px; color: var(--text-muted); line-height: 1.65; margin: 0 auto 30px; max-width: 660px; }
.lp-hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.lp-stats {
  display: flex; justify-content: center; gap: 56px; flex-wrap: wrap;
  margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--border);
}
.lp-stat { text-align: center; }
.lp-stat .value { font-size: 30px; font-weight: 700; color: var(--primary-dark); letter-spacing: -.02em; line-height: 1.1; }
.lp-stat .label { font-size: 12.5px; color: var(--text-muted); margin-top: 8px; line-height: 1.45; }

/* Текст лежит поверх тёмного верха сцены (небо/дальние горы) — тёмные
   тона темы там нечитаемы, поэтому весь блок текста внутри hero светлый,
   с лёгкой тенью для запаса контраста над любым участком сцены. */
.lp-hero-wrap .lp-kicker { background: hsla(0,0%,100%,.18); color: #fff; backdrop-filter: blur(6px); }
.lp-hero-wrap .lp-hero h1 { color: #fff; text-shadow: 0 3px 28px rgba(4,28,26,.35); }
.lp-hero-wrap .lp-hero p { color: hsla(0,0%,100%,.88); text-shadow: 0 2px 16px rgba(4,28,26,.3); }
.lp-hero-wrap .lp-hero-actions .btn.secondary {
  background: hsla(0,0%,100%,.12); color: #fff; border-color: hsla(0,0%,100%,.55); backdrop-filter: blur(6px);
}
.lp-hero-wrap .lp-hero-actions .btn.secondary:hover { background: hsla(0,0%,100%,.22); color: #fff; border-color: #fff; }
.lp-hero-wrap .lp-stats { border-top-color: hsla(0,0%,100%,.28); }
.lp-hero-wrap .lp-stat .value { color: #fff; }
.lp-hero-wrap .lp-stat .label { color: hsla(0,0%,100%,.78); }

/* --- Секции --- */
.lp-section { padding: 76px 32px; max-width: 1180px; margin: 0 auto; }
.lp-section-alt { max-width: none; background: var(--surface-subdued); border-block: 1px solid var(--border); }
.lp-section-alt > * { max-width: 1180px; margin-inline: auto; }
.lp-section-head { text-align: center; max-width: 680px; margin: 0 auto 44px; }
.lp-section-head .lp-kicker { margin-bottom: 14px; }
.lp-section-head h2 { font-size: 30px; margin: 0 0 12px; letter-spacing: -.02em; line-height: 1.25; }
.lp-section-head p { font-size: 15px; color: var(--text-muted); line-height: 1.65; margin: 0; }

.lp-grid { display: grid; gap: 20px; }
.lp-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lp-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1000px) { .lp-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .lp-grid.cols-3, .lp-grid.cols-2 { grid-template-columns: 1fr; } }

/* Карточка возможности */
.lp-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 26px 24px 26px; box-shadow: var(--shadow-xs);
  display: flex; flex-direction: column; /* чтобы плашка-тег липла к низу карточки */
  transition: transform var(--speed-normal) var(--ease), box-shadow var(--speed-normal) var(--ease), border-color var(--speed-normal) var(--ease);
}
.lp-card .lp-tag { margin-top: auto; align-self: flex-start; }
.lp-card p { margin-bottom: 14px; }
.lp-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-s); border-color: var(--primary); }
.lp-icon {
  width: 42px; height: 42px; border-radius: 10px; background: var(--primary-soft-2);
  color: var(--primary); display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.lp-card h3 { font-size: 16px; margin: 0 0 10px; letter-spacing: -.01em; }
.lp-card p { font-size: 13.5px; color: var(--text-muted); line-height: 1.65; margin: 0; }
.lp-tag {
  display: inline-block; margin-top: 14px; font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; color: var(--primary-dark);
  background: var(--primary-soft-2); border: 1px solid var(--primary-soft);
  padding: 4px 9px; border-radius: 999px;
}

/* Карточка модуля системы */
.lp-module {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 24px; box-shadow: var(--shadow-xs);
  border-top: 3px solid var(--primary);
}
.lp-module h3 { font-size: 16px; margin: 0 0 8px; letter-spacing: -.01em; }
.lp-module > p { font-size: 13px; color: var(--text-muted); line-height: 1.6; margin: 0 0 14px; }
.lp-module ul { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--border); padding-top: 12px; }
.lp-module li {
  font-size: 12.5px; color: var(--text); padding: 5px 0 5px 18px; position: relative; line-height: 1.5;
}
.lp-module li::before {
  content: ""; position: absolute; left: 2px; top: 11px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--primary);
}

/* Шаги */
.lp-steps { display: flex; gap: 0; }
@media (max-width: 860px) { .lp-steps { flex-direction: column; gap: 26px; } }
.lp-step { flex: 1; padding: 0 20px; position: relative; }
.lp-step:not(:last-child)::after {
  content: ""; position: absolute; top: 19px; left: calc(50% + 32px); right: calc(-50% + 32px);
  height: 1px; background: var(--border-strong);
}
@media (max-width: 860px) { .lp-step:not(:last-child)::after { display: none; } }
.lp-step .num {
  width: 38px; height: 38px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600;
  margin: 0 auto 16px; position: relative; z-index: 1;
}
.lp-step h4 { font-size: 14.5px; text-align: center; margin: 0 0 8px; color: var(--text-heading); }
.lp-step p { font-size: 12.5px; color: var(--text-muted); text-align: center; margin: 0; line-height: 1.6; }

/* Аудитория */
.lp-audience {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 26px 24px 28px; box-shadow: var(--shadow-xs);
}
.lp-audience .role {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--primary-dark); background: var(--primary-soft);
  display: inline-block; padding: 4px 10px; border-radius: 999px; margin-bottom: 12px;
}
.lp-audience h3 { font-size: 19px; margin: 0 0 4px; letter-spacing: -.01em; }
.lp-audience ul { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 11px; }
.lp-audience li {
  font-size: 13.5px; color: var(--text); line-height: 1.55;
  padding-left: 24px; position: relative;
}
.lp-audience li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 15px; height: 15px;
  border-radius: 50%; background: var(--primary-soft);
}
.lp-audience li::after {
  content: ""; position: absolute; left: 4.5px; top: 8.5px;
  width: 5px; height: 2.5px; border-left: 1.6px solid var(--primary-dark); border-bottom: 1.6px solid var(--primary-dark);
  transform: rotate(-45deg);
}

/* О компании */
.lp-about { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 48px; align-items: start; }
@media (max-width: 900px) { .lp-about { grid-template-columns: 1fr; gap: 32px; } }
.lp-about-text h2 { font-size: 30px; margin: 0 0 8px; letter-spacing: -.02em; }
.lp-about-tagline { font-size: 15px; color: var(--primary-dark); font-weight: 500; margin: 0 0 16px; }
.lp-about-text p { font-size: 14.5px; color: var(--text-muted); line-height: 1.7; margin: 0 0 14px; }
.lp-about-facts { display: flex; flex-direction: column; gap: 14px; }
.lp-fact {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 18px 20px; box-shadow: var(--shadow-xs);
  border-left: 3px solid var(--primary);
}
.lp-fact .value { font-size: 15px; font-weight: 600; color: var(--text-heading); margin-bottom: 5px; }
.lp-fact .label { font-size: 12.5px; color: var(--text-muted); line-height: 1.55; }

/* Контакты */
/* auto-fit — карточек может быть от одной до пяти: показываем только
   заполненные контакты (см. home.html), пустые не выводим вовсе */
.lp-contacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
@media (max-width: 900px) { .lp-contacts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .lp-contacts { grid-template-columns: 1fr; } }
.lp-contact-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 22px 20px; box-shadow: var(--shadow-xs); text-align: center;
}
.lp-contact-icon {
  width: 38px; height: 38px; border-radius: 50%; background: var(--primary-soft-2);
  color: var(--primary); display: flex; align-items: center; justify-content: center; margin: 0 auto 12px;
}
.lp-contact-card .label {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-faint); margin-bottom: 7px;
}
.lp-contact-card .value { font-size: 14px; color: var(--text-heading); font-weight: 500; display: block; line-height: 1.5; }
a.lp-contact-card .value, .lp-contact-card a.value { color: var(--primary-dark); }
.lp-contact-card a.value:hover { text-decoration: underline; }
.lp-contact-card .value.empty { color: var(--text-faint); font-weight: 400; }

.lp-cta {
  margin-top: 44px; padding: 34px 40px; border-radius: 12px;
  background: var(--text-heading); color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.lp-cta-text h2 { color: #fff; font-size: 22px; margin: 0 0 6px; letter-spacing: -.01em; }
.lp-cta-text p { color: #b9c4d6; font-size: 14px; margin: 0; }
.lp-cta .btn { flex-shrink: 0; }

/* Подвал */
.lp-footer { background: var(--text-heading); color: #c3cdde; padding: 56px 32px 0; }
.lp-footer-inner {
  max-width: 1180px; margin: 0 auto; padding-bottom: 40px;
  display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 40px;
}
@media (max-width: 900px) { .lp-footer-inner { grid-template-columns: 1fr 1fr; gap: 30px; } }
@media (max-width: 560px) { .lp-footer-inner { grid-template-columns: 1fr; } }
.lp-footer .lp-brand, .lp-footer .lp-brand-text { color: #fff; }
.lp-footer-brand p { font-size: 13px; line-height: 1.65; margin: 16px 0 0; color: #9aa7bd; max-width: 340px; }
.lp-footer-col h4 {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: #7f8da6; margin: 0 0 14px;
}
.lp-footer-col a, .lp-footer-col span {
  display: block; font-size: 13.5px; color: #c3cdde; text-decoration: none; margin-bottom: 9px; line-height: 1.5;
}
.lp-footer-col a:hover { color: #fff; text-decoration: none; }
.lp-footer-bottom {
  max-width: 1180px; margin: 0 auto; padding: 18px 0 22px;
  border-top: 1px solid hsla(0,0%,100%,.10);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 12px; color: #7f8da6;
}

/* Планшет / телефон */
@media (max-width: 860px) {
  .lp-nav-links { display: none; }
  .lp-nav-inner { padding: 12px 20px; }
  .lp-hero-wrap { min-height: 380px; }
  .lp-scene-cloud { display: none; } /* лишний filter:blur на слабом GPU телефона */
  .lp-hero { padding: 56px 20px 52px; }
  .lp-hero h1 { font-size: 32px; }
  .lp-hero p { font-size: 15px; }
  .lp-stats { gap: 32px; margin-top: 40px; }
  .lp-section { padding: 56px 20px; }
  .lp-section-head h2, .lp-about-text h2 { font-size: 24px; }
  .lp-cta { padding: 26px 24px; }
  .lp-footer { padding: 44px 20px 0; }
}

/* ---------- Колокольчик уведомлений ---------- */
.notif-bell-wrap { position: relative; }
.notif-bell {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: transparent; color: var(--text); cursor: pointer;
}
.notif-bell:hover { background: var(--primary-soft-2); color: var(--primary-dark); border-color: var(--primary); }
.notif-bell-badge {
  position: absolute; top: -6px; right: -6px;
  min-width: 16px; height: 16px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--danger-text, #c0392b); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 999px;
}
.notif-bell-dropdown {
  display: none;
  position: absolute; z-index: 30; top: calc(100% + 8px); right: 0;
  width: 320px; max-height: 360px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: var(--shadow-s);
}
.notif-bell-dropdown.is-open { display: block; }
.notif-bell-item {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  text-decoration: none; color: var(--text); font-size: 12.5px;
}
.notif-bell-item:hover { background: var(--surface-subdued); text-decoration: none; }
.notif-bell-item.is-unread { background: var(--primary-soft-2); }
.notif-bell-item .badge { align-self: flex-start; }
.notif-bell-all {
  display: block; text-align: center; padding: 10px; font-size: 12.5px;
  color: var(--primary); text-decoration: none;
}
.notif-bell-all:hover { background: var(--surface-subdued); }

.notif-list-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 8px; font-size: 13px;
}
.notif-list-item.is-unread { background: var(--primary-soft-2); }

/* Тег объекта у уведомления — какому проекту оно принадлежит, см.
   Notification.project_id. */
.notif-project-tag {
  display: inline-block; font-size: 10.5px; font-weight: 600; color: var(--primary-dark);
  background: var(--primary-soft); border-radius: 4px; padding: 1px 6px; margin-right: 6px;
}

/* ---------- Проектирование: этапы согласования ---------- */
.approval-stage {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px;
}
.approval-stage.is-active { border-color: var(--primary); background: var(--primary-soft-2); }
.approval-stage-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; text-transform: uppercase; letter-spacing: .03em;
  color: var(--text-faint); margin-bottom: 4px;
}
.approval-participant {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 3px 0; font-size: 12.5px;
}
.approval-participant + .approval-participant { border-top: 1px solid var(--border); }
.approval-comment {
  display: flex; align-items: flex-start; gap: 6px;
  padding: 0 0 6px; font-size: 11.5px; color: var(--text-muted); line-height: 1.4;
}
.approval-comment .badge { flex-shrink: 0; }
.approval-stage-row {
  display: flex; gap: 10px; align-items: flex-end; margin-bottom: 10px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}

/* Вертикальный степпер согласования — вместо блоков текста: видно с
   одного взгляда, на каком этапе документ и кто утвердил/отклонил. */
.appr-stepper { display: flex; flex-direction: column; }
.appr-step { display: flex; gap: 10px; }
.appr-step .rail { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.appr-step .node {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.appr-step .node svg { width: 12px; height: 12px; }
.appr-step.done .node { background: var(--success); color: #fff; }
.appr-step.rejected .node { background: var(--danger); color: #fff; }
.appr-step.active .node { background: var(--primary); color: #fff; box-shadow: 0 0 0 3px var(--primary-soft); }
.appr-step.pending .node { background: var(--surface-subdued); border: 1.5px solid var(--border-strong); color: var(--text-faint); }
.appr-step .line { width: 2px; flex: 1; min-height: 14px; background: var(--border-strong); margin: 2px 0; }
.appr-step .line.done { background: var(--success); }
.appr-step-body { flex: 1; min-width: 0; padding-bottom: 14px; }
.appr-step.is-last .appr-step-body { padding-bottom: 2px; }
.appr-step-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; text-transform: uppercase; letter-spacing: .03em;
  color: var(--text-faint); margin-bottom: 4px;
}

/* Вкладки в карточке документа (Версии / Вложения / Замечания) — вместо
   стопки отдельных раскрывашек одинакового веса. */
.doc-tabs { display: inline-flex; gap: 2px; background: var(--surface-subdued); border-radius: 6px; padding: 3px; }
.doc-tab-btn {
  border: none; background: transparent; cursor: pointer;
  padding: 6px 11px; font-size: 11.5px; font-weight: 600; color: var(--text-faint);
  border-radius: 4px; font-family: var(--font-body);
}
.doc-tab-btn.is-active { background: var(--surface); color: var(--text-heading); box-shadow: var(--shadow-xs); }
.doc-tab-panel { display: none; }
.doc-tab-panel.is-active { display: block; }

/* ---------- Компактная история попыток согласования ---------- */
.history-attempt-toggle {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: var(--surface-subdued); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 6px 10px; font-size: 12px; cursor: pointer; text-align: left;
  font-family: var(--font-body); color: var(--text);
}
.history-attempt-toggle:hover { border-color: var(--border-strong); }
.history-attempt-label { font-weight: 600; flex-shrink: 0; }
.history-attempt-date { color: var(--text-faint); flex: 1; }
.history-attempt-arrow { color: var(--text-faint); transition: transform var(--speed-fast) var(--ease); flex-shrink: 0; }
.history-attempt.is-open .history-attempt-arrow { transform: rotate(180deg); }
.history-attempt-details {
  display: none; padding: 8px 10px 2px; border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 var(--radius) var(--radius); margin-top: -1px;
}
.history-attempt.is-open .history-attempt-details { display: block; }

/* ---------- Фотографии объекта (Общая информация → Фотографии) ---------- */
.photo-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px; margin-bottom: 18px;
}
.photo-card {
  position: relative; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--surface-subdued);
}
.photo-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo-card-meta {
  display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; font-size: 12px;
}
.photo-card-meta span:first-child { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-card-date { color: var(--text-faint); }
.photo-card-delete { position: absolute; top: 6px; right: 6px; opacity: 0; transition: opacity .15s; }
.photo-card:hover .photo-card-delete { opacity: 1; }
.photo-card-delete .btn { background: var(--surface); box-shadow: var(--shadow-xs); }

/* ---------- Календарь: сетка месяца ---------- */
.cal-card { overflow-x: auto; }
.cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-title { font-weight: 600; font-size: 15px; min-width: 160px; text-align: center; }
/* minmax(0, 1fr), не просто 1fr — иначе трек с самым широким
   содержимым (длинное название события) растягивается сверх своей
   доли 1/7, остальные столбцы перестают быть равными. */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-grid-head { margin-bottom: 4px; }
.cal-weekday { text-align: center; font-size: 11px; color: var(--text-muted); text-transform: uppercase; padding: 4px 0; }
.cal-cell {
  /* min-width:0 обязателен — grid-элементы по умолчанию не сжимаются
     уже ширины своего содержимого (min-width:auto), из-за длинного
     текста внутри столбец с этой ячейкой растягивался шире соседних
     вместо равных 1fr. */
  position: relative;
  min-width: 0;
  height: 84px; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 4px 6px; background: var(--surface-subdued); cursor: pointer;
  transition: background var(--speed-fast) var(--ease);
}
.cal-cell:hover { background: var(--primary-soft); }
.cal-cell-empty { border: none; background: none; cursor: default; }
.cal-cell.is-today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.cal-daynum { font-size: 12px; color: var(--text-muted); }
.cal-cell.is-today .cal-daynum { color: var(--primary-dark); font-weight: 700; }
.cal-dots { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.cal-dot {
  width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0;
  box-shadow: 0 0 0 1.5px var(--surface);
}
.cal-dot-meeting { background: var(--primary); }
.cal-dot-deadline { background: var(--danger); }
.cal-dot-inspection { background: var(--risk); }
.cal-dot-delivery { background: var(--success); }
.cal-dot-design_review { background: #7c3aed; }
.cal-dot-other { background: var(--text); }
.cal-dot-task { background: var(--surface); border: 2px solid var(--text-heading); width: 7px; height: 7px; box-shadow: none; }
.cal-dot-more { font-size: 10px; color: var(--text-muted); }

/* Текст события/задачи прямо на числе — вместо точки, см. summary.html
   и calendar/overview.html. Цвет левой полосы = тип события; задачи —
   отдельный нейтральный цвет. */
.cal-day-items { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; max-height: 58px; overflow: hidden; }
.cal-day-item {
  /* min-width:0 обязателен — без него flex-элемент не сжимается уже
     родителя (min-width:auto по умолчанию), и text-overflow:ellipsis
     ниже просто не срабатывает, текст вылезает за границы ячейки. */
  min-width: 0;
  font-size: 10.5px; line-height: 1.25; padding: 1px 4px; border-radius: 3px;
  border-left: 2px solid var(--text-faint); background: var(--surface);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-day-item-meeting { border-left-color: var(--primary); }
.cal-day-item-deadline { border-left-color: var(--danger); }
.cal-day-item-inspection { border-left-color: var(--risk); }
.cal-day-item-delivery { border-left-color: var(--success); }
.cal-day-item-design_review { border-left-color: #7c3aed; }
.cal-day-item-other { border-left-color: var(--text); }
.cal-day-item-task { border-left-color: var(--text-muted); border-left-style: dashed; }
.cal-day-item-more { font-size: 10px; color: var(--text-muted); padding: 0 4px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0; font-size: 11px; color: var(--text-muted); }
.cal-legend-item { display: flex; align-items: center; gap: 4px; }
.cal-month-events h4 { margin: 4px 0 8px; font-size: 13px; color: var(--text-muted); }
.cal-month-events .cal-dot { margin-right: 4px; }
tr.is-flash { background: var(--primary-soft) !important; transition: background var(--speed-slow) var(--ease); }

/* Попап "что на эту дату" по клику на день календаря — см. project_calendar.js */
.cal-day-popover {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; width: 260px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-s); padding: 10px 12px; cursor: default; white-space: normal;
}
.cal-day-popover-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 13px; }
.cal-day-popover-close { border: none; background: none; cursor: pointer; font-size: 15px; color: var(--text-muted); line-height: 1; padding: 0 2px; }
.cal-day-popover-body p { font-size: 12.5px; margin: 4px 0; }

/* ---------- Задачи: канбан-доска ---------- */
.kanban-board { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; margin-top: 14px; }
.kanban-col { flex: 1 1 220px; min-width: 220px; background: var(--surface-subdued); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; }
.kanban-col-header { display: flex; align-items: center; gap: 6px; padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.kanban-col-name { flex: 1; cursor: text; border-radius: 4px; padding: 2px 4px; margin: -2px -4px; }
.kanban-col-name:hover { background: var(--surface); color: var(--text); }
.kanban-col-count { background: var(--border); color: var(--text); border-radius: 10px; padding: 0 7px; font-size: 11px; flex-shrink: 0; }
.kanban-col-delete-form { display: inline; }
.kanban-col-delete-btn {
  border: none; background: none; color: var(--text-faint); cursor: pointer; font-size: 13px;
  line-height: 1; padding: 2px 4px; border-radius: 4px; flex-shrink: 0;
}
.kanban-col-delete-btn:hover { color: var(--danger-text); background: var(--danger-soft); }
.kanban-col-body { flex: 1; min-height: 60px; padding: 8px; display: flex; flex-direction: column; gap: 8px; transition: background var(--speed-fast) var(--ease); }
.kanban-col-new {
  flex: 0 0 180px; display: flex; flex-direction: column; gap: 6px; padding: 8px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius); align-self: flex-start;
}
.kanban-col-new input { font-size: 12.5px; }
.kanban-card {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--border-strong);
  border-radius: var(--radius); padding: 8px 10px; cursor: pointer; box-shadow: var(--shadow-xs);
  position: relative;
}
.kanban-card:hover { box-shadow: var(--shadow-s); }
.kanban-card-ghost { opacity: .4; }
.kanban-card.kanban-prio-low { border-left-color: var(--text-faint); }
.kanban-card.kanban-prio-medium { border-left-color: var(--warning); }
.kanban-card.kanban-prio-high { border-left-color: var(--danger); }
.kanban-card-title { font-size: 13px; font-weight: 500; margin-bottom: 6px; padding-right: 20px; }
.kanban-card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kanban-due { font-size: 11px; color: var(--text-muted); }
.kanban-due.is-overdue { color: var(--danger-text); font-weight: 600; }
.kanban-card-assignee {
  position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary-dark); font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; text-transform: uppercase;
}
.chat-pending-action-done { font-size: 11.5px; color: var(--text-faint); margin-top: 4px; font-style: italic; }

/* ---------- Камеры: обёртка видео с кнопкой "На весь экран" ---------- */
.cam-video-wrap { position: relative; }
.cam-fullscreen-btn {
  position: absolute; top: 8px; right: 8px; width: 28px; height: 28px;
  border: none; border-radius: var(--radius-sm); background: rgba(0,0,0,.55); color: #fff;
  font-size: 15px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background var(--speed-fast) var(--ease);
}
.cam-fullscreen-btn:hover { background: rgba(0,0,0,.75); }

/* ---------- Мои задачи: сквозной список по объектам ---------- */
.my-tasks-projects { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.my-tasks-project-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: var(--surface-subdued); }
.my-tasks-project-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.my-tasks-project-name { font-weight: 600; font-size: 14px; color: var(--text-heading); }
.my-tasks-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 7px 10px; background: var(--surface); border-left: 3px solid var(--border-strong);
  border-radius: var(--radius-sm); margin-bottom: 5px; font-size: 13px;
}
.my-tasks-row:last-child { margin-bottom: 0; }
.my-tasks-row.my-tasks-prio-low { border-left-color: var(--text-faint); }
.my-tasks-row.my-tasks-prio-medium { border-left-color: var(--warning); }
.my-tasks-row.my-tasks-prio-high { border-left-color: var(--danger); }
.my-tasks-row-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Письма и обращения: форма слева / просмотр результата справа ---------- */
.letters-layout { display: grid; grid-template-columns: minmax(0, 460px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .letters-layout { grid-template-columns: 1fr; } }
.letters-form-card, .letters-preview-card { margin: 0; }
.letters-preview-empty { color: var(--text-muted); font-size: 13px; padding: 24px 4px; }
.letters-preview-actions { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.letters-sign-btn { font-family: "Segoe Script", "Brush Script MT", cursive; font-style: italic; }
.letters-sign-stamp {
  margin-top: 10px; display: flex; align-items: center; gap: 6px; font-size: 12.5px;
  color: var(--primary-dark); border: 1px dashed var(--primary); border-radius: var(--radius-sm);
  padding: 6px 10px; width: fit-content;
}
.field-hint { font-size: 11.5px; color: var(--text-faint); margin-top: 4px; }

/* ---------- Список проектов: карточки объектов ----------
   Разметка — dashboard/projects_list.html. Вместо строк таблицы —
   карточки с цветной шапкой: цвет кодирует статус проекта, поэтому
   объекты в портфеле различаются с одного взгляда. */

.project-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 16px;
}
@media (max-width: 700px) { .project-cards { grid-template-columns: 1fr; } }

.project-card {
  --pc-accent: var(--primary);
  --pc-accent-dark: var(--primary-dark);
  --pc-tint: var(--primary-soft-2);
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--pc-accent); border-radius: 10px;
  overflow: hidden; text-decoration: none; color: inherit;
  box-shadow: var(--shadow-xs);
  transition: transform var(--speed-normal) var(--ease), box-shadow var(--speed-normal) var(--ease);
}
.project-card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-s);
  text-decoration: none; color: inherit; border-color: var(--pc-accent);
}

/* Статусы: заливка шапки и подложка тела */
.project-card.status-construction { --pc-accent: #0f7d76; --pc-accent-dark: #0a5f5a; --pc-tint: #ddf2f0; }
.project-card.status-planning     { --pc-accent: #3f6ea8; --pc-accent-dark: #2f5585; --pc-tint: #e2ebf7; }
.project-card.status-done         { --pc-accent: #0a7d55; --pc-accent-dark: #08624a; --pc-tint: #ddf2e8; }
.project-card.status-paused       { --pc-accent: #c07a12; --pc-accent-dark: #945c07; --pc-tint: #fbeed5; }

/* Шапка фиксированной высоты, чтобы карточки в ряду выглядели одинаково
   независимо от длины наименования: заголовок обрезается по двум
   строкам, местоположение — по одной. */
.project-card-head {
  height: 98px; box-sizing: border-box;
  background: linear-gradient(135deg, var(--pc-accent) 0%, var(--pc-accent-dark) 100%);
  color: #fff; padding: 16px 20px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
}
.project-card-headline {
  min-width: 0; height: 100%;
  display: flex; flex-direction: column;
}
.project-card-head h3 {
  color: #fff; font-size: 16.5px; margin: 0; line-height: 1.35; letter-spacing: -.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-card-address {
  margin-top: auto; padding-top: 6px;   /* прижат к низу — местоположение
                                            на всех карточках на одной линии */
  display: flex; align-items: center; gap: 5px; min-width: 0;
  font-size: 12.5px; color: hsla(0,0%,100%,.82); line-height: 1.4;
}
.project-card-address svg { flex-shrink: 0; }
.project-card-address span {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.project-card-status {
  flex-shrink: 0; font-size: 11px; font-weight: 600; letter-spacing: .03em;
  background: hsla(0,0%,100%,.20); color: #fff;
  border: 1px solid hsla(0,0%,100%,.32);
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}

.project-card-body { background: var(--pc-tint); padding: 16px 20px 18px; flex: 1; }
.project-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.project-card-meta:empty { display: none; }
.pc-chip {
  font-size: 11.5px; color: var(--pc-accent-dark);
  background: var(--surface); border: 1px solid var(--border);
  padding: 3px 9px; border-radius: 999px;
  /* длинное название этапа не должно распирать карточку */
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Две колонки, а не четыре: суммы бюджета бывают длинными (миллиарды),
   в узкой ячейке они обрезались многоточием и читались неверно. */
.project-card-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pc-stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 11px; text-align: center; min-width: 0;
}
.pc-stat .v {
  font-size: 20px; font-weight: 700; color: var(--text-heading); letter-spacing: -.02em; line-height: 1.15;
}
.pc-stat .v.money { font-size: 14.5px; font-weight: 600; line-height: 1.3; word-break: break-word; }
.pc-stat .l {
  font-size: 10.5px; color: var(--text-faint); text-transform: uppercase;
  letter-spacing: .04em; margin-top: 5px; line-height: 1.3;
}
.pc-stat.is-hot .v { color: var(--pc-accent-dark); }
.pc-stat.is-alert { border-color: var(--danger-soft); background: var(--danger-soft); }
.pc-stat.is-alert .v { color: var(--danger-text); }
.pc-stat.is-alert .l { color: var(--danger-text); opacity: .8; }

.project-card-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 7px;
  padding: 11px 20px; background: var(--surface); border-top: 1px solid var(--border);
  font-size: 12.5px; font-weight: 600; color: var(--pc-accent-dark);
}
.project-card:hover .project-card-foot svg { transform: translateX(3px); }
.project-card-foot svg { transition: transform var(--speed-fast) var(--ease); }


/* ---------- Выдача рабочей документации в производство работ ----------
   Разметка — work_docs/issuance.html и кнопка в work_docs/overview.html.
   Страница доступна только именным ответственным (см.
   app/services/work_issuance.py). */

.issuance-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-bottom: 16px; padding: 14px 18px;
  background: var(--primary-soft-2); border: 1px solid var(--primary-soft);
  border-left: 3px solid var(--primary); border-radius: var(--radius);
}
.issuance-cta b { color: var(--text-heading); font-size: 14px; }
.issuance-cta div > div { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

.issuance-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px; align-items: start;
}
@media (max-width: 1100px) { .issuance-layout { grid-template-columns: 1fr; } }
.issuance-layout > .card { margin: 0; }

.issuance-docs {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  max-height: 340px; overflow-y: auto; margin-bottom: 16px;
}
.issuance-doc {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid var(--border); cursor: pointer;
}
.issuance-doc:last-child { border-bottom: none; }
.issuance-doc:hover { background: var(--primary-soft-2); }
.issuance-doc input { margin-top: 3px; flex-shrink: 0; }
.issuance-doc-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.issuance-doc-name { font-size: 13.5px; color: var(--text); line-height: 1.4; }
.issuance-doc-meta { font-size: 11.5px; color: var(--text-faint); }

.issuance-picked {
  font-size: 12.5px; color: var(--primary-dark);
  background: var(--primary-soft-2); border: 1px solid var(--primary-soft);
  border-radius: var(--radius-sm); padding: 8px 12px; margin-bottom: 14px;
}
.issuance-empty { color: var(--text-muted); font-size: 13px; padding: 20px 4px; }
.issuance-empty p { margin: 0 0 10px; line-height: 1.6; }

.issuance-responsibles {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px; margin-bottom: 14px;
}
.issuance-responsible {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer;
}
.issuance-responsible:hover { background: var(--primary-soft-2); }

/* Степпер трёх шагов выдачи: кружки сверху, под ними карточка текущего шага. */
.issuance-stepper {
  display: flex; align-items: flex-start; gap: 0; margin: 4px 0 20px;
}
.issuance-stepper .step {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 8px; position: relative; text-align: center;
}
.issuance-stepper .step::before {
  content: ""; position: absolute; top: 17px; left: -50%; width: 100%; height: 2px;
  background: var(--border); z-index: 0;
}
.issuance-stepper .step:first-child::before { display: none; }
.issuance-stepper .step.done::before,
.issuance-stepper .step.current::before { background: var(--primary); }
.issuance-stepper .step .dot {
  width: 36px; height: 36px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
  background: var(--surface); border: 2px solid var(--border); color: var(--text-faint);
  position: relative; z-index: 1;
}
.issuance-stepper .step.current .dot { border-color: var(--primary); color: var(--primary-dark); }
.issuance-stepper .step.done .dot { border-color: var(--primary); background: var(--primary); color: #fff; }
.issuance-stepper .step.locked .dot { opacity: .55; }
.issuance-stepper .step .label { font-size: 12.5px; color: var(--text-muted); max-width: 160px; }
.issuance-stepper .step.current .label { color: var(--text-heading); font-weight: 600; }
.issuance-stepper .step.locked .label { opacity: .55; }
.issuance-stepper a.step { text-decoration: none; }
.issuance-stepper a.step:hover .dot { border-color: var(--primary); }

.issuance-step-card.is-dimmed { opacity: .5; pointer-events: none; }
.issuance-item-block {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-bottom: 14px;
}
.issuance-item-block > h4 { margin: 0 0 8px; font-size: 13.5px; color: var(--text-heading); }
.issuance-sha {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 10.5px; color: var(--text-faint); word-break: break-all; margin: 2px 0;
}
.issuance-place-note {
  font-size: 12px; color: var(--warning-text); background: var(--warning-soft);
  border-radius: var(--radius-sm); padding: 7px 10px; margin: 8px 0;
}
.stamp-viewer .pdf-canvas-stack { max-height: 60vh; }
.stamp-page-bar {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  padding: 6px; background: var(--surface); border-bottom: 1px solid var(--border);
  font-size: 12.5px; flex-wrap: wrap;
}
.stamp-page-excluded { position: relative; }
.stamp-page-excluded::after {
  content: "штамп убран с этой страницы"; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(120,120,120,.28); color: #fff; font-size: 13px; font-weight: 600;
  text-shadow: 0 1px 3px rgba(0,0,0,.6); pointer-events: none;
}


/* ---------- Страница проверки выдачи по QR (публичная) ----------
   Разметка — issuance_verify.html. Открывается телефоном на стройке,
   поэтому вёрстка одноколоночная и крупная. */

.verify-page {
  min-height: 100vh; background: var(--bg);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px 16px 40px;
}
.verify-card {
  width: 100%; max-width: 480px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-s); padding: 22px 20px 18px;
}
.verify-brand {
  display: flex; align-items: center; gap: 10px; margin-bottom: 18px;
  font-weight: 700; letter-spacing: .05em; color: var(--text-heading);
}
.verify-brand img { width: 32px; height: 32px; border-radius: 7px; }

.verify-status {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; border-radius: 10px; margin-bottom: 18px;
}
.verify-status.ok { background: var(--success-soft); color: var(--success-text); }
.verify-status.revoked { background: var(--danger-soft); color: var(--danger-text); }
.verify-status.unknown { background: var(--warning-soft); color: var(--warning-text); display: block; }
.verify-status svg { flex-shrink: 0; }
.verify-status-title { font-size: 17px; font-weight: 700; line-height: 1.25; }
.verify-status-sub { font-size: 13px; margin-top: 3px; opacity: .85; }
.verify-status p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.5; }

.verify-facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 20px; }
.verify-facts dt {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-faint); padding-top: 2px;
}
.verify-facts dd { margin: 0; font-size: 14px; color: var(--text-heading); font-weight: 500; }

.verify-docs-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-faint); margin-bottom: 8px;
}
.verify-docs { list-style: none; padding: 0; margin: 0 0 18px; }
.verify-docs li {
  display: flex; gap: 10px; padding: 9px 0;
  border-bottom: 1px solid var(--border); font-size: 13.5px;
}
.verify-docs li:last-child { border-bottom: none; }
.verify-doc-code { font-weight: 600; color: var(--primary-dark); flex-shrink: 0; }
.verify-doc-name { color: var(--text); min-width: 0; }
.verify-doc-ver { color: var(--text-faint); font-size: 12.5px; }

.verify-foot {
  border-top: 1px solid var(--border); padding-top: 12px;
  font-size: 11.5px; color: var(--text-faint); text-align: center;
}

/* ---------- Журнал выдач и подписание ---------- */
.issuance-log-card.is-revoked { border-left: 3px solid var(--danger); }
.issuance-log-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 6px;
}
.issuance-log-meta { font-size: 12.5px; color: var(--text-muted); margin-bottom: 12px; }
.issuance-signed { font-size: 11.5px; color: var(--text-faint); margin-top: 3px; }

.issuance-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.issuance-hint { font-size: 12px; color: var(--text-muted); margin-top: 8px; line-height: 1.5; }
.issuance-sign-result {
  margin-top: 8px; font-size: 12.5px; padding: 7px 10px; border-radius: var(--radius-sm);
  background: var(--surface-subdued); border: 1px solid var(--border); color: var(--text-muted);
  white-space: normal; text-align: left;
}
.issuance-sign-result.is-ok { background: var(--success-soft); border-color: var(--success-soft); color: var(--success-text); }
.issuance-sign-result.is-error { background: var(--danger-soft); border-color: var(--danger-soft); color: var(--danger-text); }

/* ---------- Подтверждение опасных действий ----------
   Замена window.confirm(): во встроенном браузере системный диалог не
   показывается и сразу возвращает "нет" (проверено — 0 мс), из-за чего
   формы с onsubmit="return confirm(...)" молча не отправлялись.
   Разметку строит app/static/js/confirm_action.js. */

.confirm-overlay {
  position: fixed; inset: 0; z-index: 900;
  background: hsla(220, 25%, 12%, .45);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.confirm-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-s); padding: 20px 22px; max-width: 420px; width: 100%;
}
.confirm-text { margin: 0 0 18px; font-size: 14px; line-height: 1.6; color: var(--text); }
.confirm-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- Расстановка штампа в просмотрщике ----------
   Штамп рисуется HTML-блоком поверх чистой страницы (см.
   app/static/js/issuance_stamp_viewer.js): так его можно двигать мышью,
   тянуть за угол и убирать кнопкой до того, как он впечатан в PDF. */

.stamp-page { position: relative; margin: 0 auto 14px; }
.stamp-page canvas { display: block; }

/* Фон прозрачный, рамка синяя — как в готовом PDF: предпросмотр должен
   показывать то же, что впечатается, иначе смысл расстановки теряется. */
.stamp-box {
  position: absolute; box-sizing: border-box;
  background: transparent; border: 1.5px solid #1757CC;
  display: flex; align-items: stretch; gap: 4px; padding: 4px 5px;
  cursor: move; overflow: visible; user-select: none;
}
.stamp-box.is-active { border-color: #0F3E96; box-shadow: 0 0 0 2px rgba(23,87,204,.25); }
.stamp-box-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 1px; }
/* Кегль строк задаёт JS от высоты рамки, а обрезки нет намеренно:
   пользователь просил, чтобы текст не обрезался при изменении размера. */
.stamp-box-line {
  font-family: var(--font-mono); line-height: 1.2; color: #1757CC;
  white-space: nowrap; overflow: visible;
}
/* Текст лежит в inline-span: у блочного элемента scrollWidth никогда не
   меньше его собственной ширины, поэтому измерить по нему реальную ширину
   строки нельзя — шрифт ужимался до микроскопического. */
.stamp-box-line > span { display: inline-block; }
/* Заголовок ничем не выделяется: шрифт в штампе единый по стилю,
   размеру и высоте строки. */
.stamp-box-line.is-title { font-weight: inherit; }
.stamp-box-qr {
  flex-shrink: 0; aspect-ratio: 1; align-self: center; height: 82%;
  background: #fff; border: 0.5px solid #1757CC;
  display: block; object-fit: contain;
}
.stamp-box-remove {
  position: absolute; top: -9px; right: -9px; width: 18px; height: 18px;
  border-radius: 50%; border: 1px solid var(--danger); background: #fff;
  color: var(--danger-text); font-size: 13px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.stamp-box-remove:hover { background: var(--danger-soft); }
.stamp-box-grip {
  position: absolute; right: -6px; bottom: -6px; width: 14px; height: 14px;
  background: var(--primary); border: 2px solid #fff; border-radius: 3px;
  cursor: nwse-resize;
}
.stamp-restore {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  background: var(--warning-soft); color: var(--warning-text);
  border: 1px solid var(--warning); border-radius: var(--radius-sm);
  padding: 5px 12px; font-size: 12px; cursor: pointer;
}
