/* ═══════════════════════════════════════════════════════════════════════
   Цифровой акт — дизайн-система личного кабинета и лендинга.

   Цвета и типографика взяты 1:1 из мобильного приложения
   (digital-act-app/lib/core/theme/app_theme.dart), чтобы веб выглядел
   продолжением приложения. Свой CSS (а не CDN-фреймворк) — чтобы кабинет
   работал офлайн как PWA: всё, что нужно, лежит рядом и кэшируется.
   ═══════════════════════════════════════════════════════════════════════ */

@font-face { font-family: Inter; src: url(../fonts/Inter-Regular.woff2) format('woff2');  font-weight: 400; font-display: swap; }
@font-face { font-family: Inter; src: url(../fonts/Inter-Medium.woff2) format('woff2');   font-weight: 500; font-display: swap; }
@font-face { font-family: Inter; src: url(../fonts/Inter-SemiBold.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: Inter; src: url(../fonts/Inter-Bold.woff2) format('woff2');     font-weight: 700; font-display: swap; }

:root {
  --accent: #036AD3;
  --accent-dark: #0257ac;
  --accent-2: #AFC8E3;
  --light-blue: #EAF4FF;
  --red: #E53935;
  --green: #1FAA4B;
  --text: #000000;
  --text-2: #4A4A4A;
  --text-off: #9E9E9E;
  --bg: #FBFBFB;
  --white: #FFFFFF;
  --stroke: #E0E0E0;

  --r-sm: 12px;      /* поля ввода, пункты меню, тосты */
  --r-pill: 999px;   /* всё кликабельное: кнопки, чипы, бейджи, вкладки */
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
  --shadow-lg: 0 8px 32px rgba(3, 106, 211, .12);
  --header-h: 64px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.55 Inter, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
button { font: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; }
h1 { font-size: clamp(30px, 5vw, 52px); }
h2 { font-size: clamp(24px, 3.4vw, 36px); }
h3 { font-size: 20px; }
p  { margin: 0; }
.muted { color: var(--text-2); }
.dim { color: var(--text-off); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
/* Атрибут hidden прячет так же надёжно, как класс: у элемента может стоять
   свой display, и браузерное правило по умолчанию тогда не срабатывает. */
[hidden] { display: none !important; }

/* ── Раскладка ──────────────────────────────────────────────────────── */
.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.section { padding: 72px 0; }
.section-sm { padding: 44px 0; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.gap-16 { gap: 16px; } .gap-24 { gap: 24px; } .gap-32 { gap: 32px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.flex-1 { flex: 1; min-width: 0; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; } .mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; } .mb-32 { margin-bottom: 32px; }

/* ── Кнопки ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--r-pill); border: 1px solid transparent;
  background: var(--accent); color: #fff; font-weight: 500; font-size: 15px;
  cursor: pointer; transition: .15s ease; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--stroke); }
.btn-ghost:hover { background: var(--light-blue); color: var(--accent); border-color: var(--accent-2); }
.btn-soft { background: var(--light-blue); color: var(--accent); }
.btn-soft:hover { background: #dbeafe; color: var(--accent-dark); }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #c62828; }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn-lg { padding: 15px 30px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; border-radius: var(--r-pill); }

/* ── Карточки ───────────────────────────────────────────────────────── */
.card {
  background: var(--white); border: 1px solid var(--stroke);
  border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow);
}
.card-flat { box-shadow: none; }
.card-hover { transition: .18s ease; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--accent-2); }
.card-accent { background: var(--light-blue); border-color: var(--accent-2); }
.card-tight { padding: 16px; border-radius: var(--r); }

.ico {
  width: 44px; height: 44px; border-radius: var(--r-sm); display: grid; place-items: center;
  background: var(--light-blue); color: var(--accent); flex: none;
}
.ico svg { width: 22px; height: 22px; }

/* ── Бейджи / чипы ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: var(--r-pill); background: var(--light-blue); color: var(--accent);
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.badge-green { background: #e8f7ed; color: var(--green); }
.badge-red { background: #fdeaea; color: var(--red); }
.badge-gray { background: #f2f2f2; color: var(--text-2); }
.badge-amber { background: #fff4e0; color: #b26a00; }
.chip {
  padding: 8px 14px; border-radius: var(--r-pill); border: 1px solid var(--stroke);
  background: var(--white); cursor: pointer; font-size: 14px; transition: .15s;
}
.chip:hover { border-color: var(--accent-2); }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Формы ──────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.input, .select, .textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--stroke);
  border-radius: var(--r-sm); background: var(--white); color: var(--text);
  font: inherit; transition: .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(3, 106, 211, .12);
}
.textarea { resize: vertical; min-height: 84px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%239E9E9E' stroke-width='2'%3E%3Cpath d='M4 7l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }
.hint { font-size: 12px; color: var(--text-off); }
.err { font-size: 13px; color: var(--red); }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.check-like { align-items: center; padding: 10px 12px; border: 1px solid var(--stroke); border-radius: var(--r-sm); background: var(--white); }

/* ── Модалка ────────────────────────────────────────────────────────── */
.backdrop {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .45); z-index: 60;
  display: grid; place-items: center; padding: 16px; backdrop-filter: blur(2px);
}
.modal {
  width: 100%; max-width: 440px; background: var(--white); border-radius: var(--r-xl);
  padding: 26px; box-shadow: 0 24px 64px rgba(16, 24, 40, .24);
  max-height: 92vh; overflow: auto;
}
.modal-lg { max-width: 720px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.x { border: 0; background: transparent; color: var(--text-off); cursor: pointer; font-size: 24px; line-height: 1; padding: 0 4px; }
.x:hover { color: var(--text); }

/* ── Куки-плашка ────────────────────────────────────────────────────── */
.cookie {
  position: fixed; left: 16px; bottom: 16px; z-index: 70; max-width: 360px;
  background: var(--white); border: 1px solid var(--stroke); border-radius: var(--r-lg);
  padding: 16px 18px; box-shadow: 0 12px 40px rgba(16, 24, 40, .16);
}
.cookie p { font-size: 13px; color: var(--text-2); }

/* ── Шапка ──────────────────────────────────────────────────────────── */
.hdr {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: rgba(251, 251, 251, .88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--stroke);
}
.hdr .container { height: 100%; display: flex; align-items: center; gap: 20px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text); }
.logo img { width: 32px; height: 32px; border-radius: 10px; }
.nav { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.nav a:not(.btn) { color: var(--text-2); font-size: 15px; }
.nav a:not(.btn):hover { color: var(--accent); }
/* Пунктов в шапке семь (последний — кнопка «Скачать», её дописывает скрипт),
   и на узком десктопе они переставали помещаться до включения бургера.
   Поджимаем промежутки на этом промежутке ширин. */
@media (min-width: 721px) and (max-width: 980px) {
  .nav { gap: 14px; }
  .nav a:not(.btn) { font-size: 14px; }
}
.burger { display: none; }

/* ── Hero ───────────────────────────────────────────────────────────── */
.hero { padding: 64px 0 56px; }
.hero h1 span { color: var(--accent); }
.hero-sub { font-size: 17px; color: var(--text-2); max-width: 560px; margin-top: 18px; }
.metrics { display: flex; gap: 32px; flex-wrap: wrap; margin-top: 32px; }
.metric b { display: block; font-size: 26px; font-weight: 600; }
.metric span { font-size: 13px; color: var(--text-off); }
.hero-art {
  background: linear-gradient(160deg, var(--light-blue), #f7fbff);
  border: 1px solid var(--accent-2); border-radius: var(--r-xl); padding: 26px;
}
.mock { background: #fff; border-radius: var(--r); border: 1px solid var(--stroke); padding: 14px; box-shadow: var(--shadow); }
.mock-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f2f4f7; font-size: 14px; }
.mock-row:last-child { border-bottom: 0; }
.tick { width: 20px; height: 20px; border-radius: 6px; background: var(--green); color: #fff; display: grid; place-items: center; flex: none; font-size: 12px; }
.tick.off { background: #eef1f4; color: var(--text-off); }

/* ── Шаги / нумерация ───────────────────────────────────────────────── */
.step-n {
  width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 600; font-size: 14px; flex: none;
}

/* ── FAQ (аккордеон) ────────────────────────────────────────────────── */
.acc { border: 1px solid var(--stroke); border-radius: var(--r); background: var(--white); overflow: hidden; }
.acc + .acc { margin-top: 10px; }
.acc summary {
  padding: 16px 18px; cursor: pointer; font-weight: 500; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: '+'; color: var(--accent); font-size: 20px; line-height: 1; }
.acc[open] summary::after { content: '−'; }
.acc .acc-body { padding: 0 18px 18px; color: var(--text-2); font-size: 14px; }

/* ── FAQ кабинета ──────────────────────────────────────────────────── */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-card {
  background: var(--white); border: 1px solid var(--stroke);
  border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.faq-card[open] { border-color: var(--accent-2); box-shadow: var(--shadow-lg); }
.faq-card summary {
  list-style: none; cursor: pointer; padding: 18px 20px;
  display: flex; align-items: center; gap: 12px;
}
.faq-card summary::-webkit-details-marker { display: none; }
.faq-card summary::after { content: '+'; margin-left: auto; color: var(--accent); font-size: 22px; line-height: 1; }
.faq-card[open] summary::after { content: '−'; }
.faq-num {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: var(--light-blue);
  color: var(--accent); font-size: 13px; font-weight: 600;
}
.faq-question { color: var(--text); font-weight: 600; line-height: 1.35; }
.faq-answer { padding: 0 20px 20px 62px; color: var(--text-2); font-size: 15px; }
.faq-img {
  margin-top: 14px; padding: 0; border: 1px solid var(--stroke); background: var(--bg);
  border-radius: var(--r); overflow: hidden; cursor: zoom-in; width: min(100%, 520px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .65);
}
.faq-img img { width: 100%; max-height: 340px; object-fit: contain; }

.image-viewer { background: rgba(16, 24, 40, .82); }
.image-viewer-box { width: min(100%, 980px); max-height: 92vh; display: flex; flex-direction: column; gap: 12px; }
.image-viewer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  color: #fff; font-weight: 500;
}
.image-viewer-count { margin-left: auto; color: rgba(255, 255, 255, .72); font-size: 13px; }
.image-viewer-head .x { color: #fff; opacity: .86; }
.image-viewer-head .x:hover { opacity: 1; }
.image-viewer-stage { position: relative; display: grid; place-items: center; min-height: 180px; overflow: hidden; touch-action: none; }
.image-viewer-box img {
  max-height: calc(92vh - 48px); width: 100%; object-fit: contain;
  border-radius: var(--r-lg); background: rgba(255, 255, 255, .06);
  cursor: zoom-in; transform-origin: center; transition: transform .14s ease;
  user-select: none; -webkit-user-drag: none;
}
.image-viewer-stage.is-zoomed { cursor: grab; }
.image-viewer-stage.is-zoomed img { cursor: grab; transition: none; }
.image-viewer-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 46px; height: 58px; border: 0; border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .16); color: #fff; cursor: pointer;
  font-size: 42px; line-height: 1; display: grid; place-items: center;
}
.image-viewer-nav:hover { background: rgba(255, 255, 255, .28); }
.image-viewer-nav.prev { left: 10px; }
.image-viewer-nav.next { right: 10px; }
.photo-thumb {
  width: 76px; height: 76px; padding: 0; border: 1px solid var(--stroke);
  border-radius: 10px; overflow: hidden; background: var(--bg); cursor: zoom-in;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.photo-thumb:hover { border-color: var(--accent-2); box-shadow: var(--shadow-lg); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Снимок выбран, но ещё не отправлен: пунктир — видно, что он ждёт
   сохранения акта. */
.photo-thumb.pending { border-style: dashed; border-color: #e6b566; }
.photo-cell { position: relative; }
.photo-x {
  position: absolute; top: -6px; right: -6px; width: 22px; height: 22px;
  display: grid; place-items: center; border: 0; border-radius: var(--r-pill);
  background: var(--red); color: #fff; font-size: 12px; line-height: 1;
  cursor: pointer; box-shadow: var(--shadow);
}
.photo-x:hover { background: #c62828; }

/* ── Футер ──────────────────────────────────────────────────────────── */
.ftr { border-top: 1px solid var(--stroke); padding: 44px 0 32px; background: var(--white); }
.ftr h4 { font-size: 14px; margin-bottom: 12px; }
.ftr a { display: block; color: var(--text-2); font-size: 14px; padding: 4px 0; }
.ftr a:hover { color: var(--accent); }

/* ═══ КАБИНЕТ ═══════════════════════════════════════════════════════ */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.side {
  position: fixed; left: 0; top: 0; bottom: 0; width: 232px;
  background: var(--white); border-right: 1px solid var(--stroke); padding: 14px 12px; overflow-y: auto;
}

/* Логотип в меню — вместо прежней верхней панели. Крупнее, чем был в шапке:
   тут он единственный ориентир «где я». */
.side-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px 14px; margin-bottom: 8px;
  border-bottom: 1px solid var(--stroke);
  font-weight: 600; font-size: 17px; color: var(--text); letter-spacing: -.01em;
}
.side-logo:hover { color: var(--accent); }
.side-logo img { width: 40px; height: 40px; border-radius: 11px; flex: none; }
.side a {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--r-sm);
  color: var(--text-2); font-size: 15px; font-weight: 500;
}
.side a:hover { background: var(--bg); color: var(--text); }
.side a.on { background: var(--light-blue); color: var(--accent); }
.side a svg { width: 19px; height: 19px; flex: none; }
.main { margin-left: 232px; padding: 26px 0 90px; flex: 1; }

/* Боковое меню: ссылки сверху, блок пользователя прижат к низу. */
.side { display: flex; flex-direction: column; }
.side-links { flex: 1; }
.side-user { border-top: 1px solid var(--stroke); padding-top: 10px; margin-top: 10px; }
.side-hello { display: flex; align-items: center; gap: 10px; padding: 8px 12px 12px; }
.side-ava {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 15px;
}
.side-exit {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 14px;
  border: 0; background: transparent; border-radius: var(--r-sm); cursor: pointer;
  color: var(--red); font-size: 15px; font-weight: 500; font-family: inherit;
}
.side-exit:hover { background: #fdeaea; }
.side-exit svg { width: 19px; height: 19px; }
.main > .container { max-width: 1060px; }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left; padding: 11px 14px; color: var(--text-2); font-weight: 500;
  font-size: 13px; background: var(--bg); border-bottom: 1px solid var(--stroke); white-space: nowrap;
}
.tbl td { padding: 13px 14px; border-bottom: 1px solid #f2f4f7; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #fcfdff; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--stroke); border-radius: var(--r-lg); background: var(--white); }

.empty { padding: 54px 20px; text-align: center; color: var(--text-off); }
.empty .ico { margin: 0 auto 14px; width: 54px; height: 54px; }

.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }

/* Этапы редактора акта (как шаги в приложении). */
.steps { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.step {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px 8px 8px;
  border: 1px solid var(--stroke); background: var(--white); border-radius: var(--r-pill);
  cursor: pointer; font-size: 14px; color: var(--text-2); white-space: nowrap; transition: .15s;
}
.step:hover { border-color: var(--accent-2); }
.step.on { border-color: var(--accent); color: var(--accent); background: var(--light-blue); }
.step .step-n { width: 24px; height: 24px; font-size: 13px; background: var(--accent-2); color: #fff; }
.step.on .step-n { background: var(--accent); }
/* Последний шаг — текущее место: не кнопка, а отметка «вы здесь». */
.step[aria-current="step"] { cursor: default; }
.step > span:last-child { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

/* Этаж в подъездном акте — раскрывающаяся группа помещений. */
.floor { border: 1px solid var(--accent-2); background: var(--light-blue); border-radius: var(--r-lg); overflow: hidden; }
.floor + .floor { margin-top: 10px; }
.floor summary {
  list-style: none; cursor: pointer; padding: 12px 18px; font-weight: 600; color: var(--accent);
  display: flex; align-items: center; gap: 10px;
}
.floor summary::-webkit-details-marker { display: none; }
.floor summary::after { content: '⌄'; margin-left: auto; font-size: 18px; line-height: 1; }
.floor[open] summary::after { content: '⌃'; }
.floor-body { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.mt-4 { margin-top: 4px; }

/* Нижняя навигация — только на мобиле, как в приложении */
.bnav { display: none; }

/* Тосты */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--text); color: #fff; padding: 12px 16px; border-radius: var(--r-sm);
  font-size: 14px; box-shadow: var(--shadow-lg); max-width: 320px; animation: pop .18s ease;
}
.toast.ok { background: var(--green); }
.toast.err { background: var(--red); }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }

/* Загрузка */
.spin {
  width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff; border-radius: 50%; animation: rot .7s linear infinite; display: inline-block;
}
.spin-dark { border-color: var(--stroke); border-top-color: var(--accent); }

/* Кнопка документа, пока сервер его собирает. Нажать нельзя — файла ещё нет.
   Кружок здесь свой: обычный .spin белый и на светлой кнопке не виден. */
.btn.is-loading {
  cursor: default; opacity: .75; pointer-events: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn.is-loading .spin {
  width: 14px; height: 14px;
  border-color: rgba(3, 106, 211, .25); border-top-color: var(--accent);
}

/* Подсказки под полем ввода (см. attachSuggest в common.js).
   Своё оформление вместо системного <datalist>: тот рисуется браузером
   по-своему в каждой ОС и в общий интерфейс не вписывается. */
.has-suggest { position: relative; }
.suggest {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 30;
  margin-top: 4px; max-height: 236px; overflow-y: auto;
  background: var(--white); border: 1px solid var(--stroke); border-radius: var(--r-sm);
  box-shadow: 0 10px 28px rgba(16, 24, 40, .12);
}
.suggest-item {
  display: block; width: 100%; padding: 9px 12px; border: 0; background: none;
  text-align: left; font: inherit; font-size: 14px; color: var(--text); cursor: pointer;
}
.suggest-item + .suggest-item { border-top: 1px solid #f2f4f7; }
.suggest-item:hover, .suggest-item.on { background: var(--light-blue); color: var(--accent); }

/* Текстовая кнопка-ссылка: действие второго плана, набирается как ссылка.
   Так в приложении сделано «Сохранить без размеров». */
.link-btn {
  display: block; width: 100%; margin-top: 12px; padding: 10px 0;
  background: none; border: 0; text-align: center;
  color: var(--accent); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }
@keyframes rot { to { transform: rotate(360deg); } }
.skel { background: linear-gradient(90deg, #f2f4f7, #fafbfc, #f2f4f7); background-size: 200% 100%;
  animation: sh 1.1s infinite; border-radius: 8px; height: 14px; }
@keyframes sh { to { background-position: -200% 0; } }

/* Офлайн-плашка */
.offline {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 80;
  background: #fff4e0; color: #b26a00; border: 1px solid #f0d3a0;
  padding: 9px 16px; border-radius: var(--r-pill); font-size: 13px; box-shadow: var(--shadow);
}

/* ── Адаптив ────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .side { display: none; }
  .main { margin-left: 0; padding: 16px 0 96px; }
  .bnav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
    background: var(--white); border-top: 1px solid var(--stroke);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bnav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 7px 2px; color: var(--text-off); font-size: 11px; font-weight: 500;
  }
  .bnav a.on { color: var(--accent); }
  .bnav svg { width: 22px; height: 22px; }
}
@media (max-width: 720px) {
  .section { padding: 48px 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .nav { display: none; }
  .nav.open {
    display: flex; flex-direction: column; align-items: stretch; gap: 4px;
    position: absolute; left: 12px; right: 12px; top: calc(var(--header-h) - 4px);
    background: #fff; border: 1px solid var(--stroke); border-radius: var(--r);
    padding: 10px; box-shadow: var(--shadow-lg);
  }
  .nav.open a { padding: 11px 12px; border-radius: var(--r-sm); }
  .nav.open a:hover { background: var(--bg); }
  .burger { display: grid; place-items: center; margin-left: auto; background: transparent; border: 1px solid var(--stroke);
    border-radius: var(--r-pill); width: 40px; height: 40px; cursor: pointer; }
  .hero { padding: 40px 0; }
  .metrics { gap: 20px; }
  .cookie { left: 12px; right: 12px; max-width: none; bottom: 12px; }
  .modal { padding: 20px; border-radius: var(--r-lg); }
  .card { padding: 18px; }
  .faq-card summary { padding: 16px; }
  .faq-answer { padding: 0 16px 16px; }
  .faq-question { font-size: 14px; }
}

/* ═══ Лендинг: кнопки магазинов, интерактивное демо, QR ══════════════ */

/* ── Кнопки «Скачать в …» ───────────────────────────────────────────── */
.store {
  display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px;
  border-radius: var(--r-pill); background: #101828; color: #fff; transition: .16s ease;
}
.store:hover { background: #000; color: #fff; transform: translateY(-1px); }
.store svg { width: 22px; height: 22px; flex: none; }
.store span { display: flex; flex-direction: column; line-height: 1.2; }
.store i { font-style: normal; font-size: 10px; opacity: .7; }
.store b { font-size: 14px; font-weight: 600; }
.store, .store:hover, .store b, .store i { color: #fff; }

/* ── Интерактивное демо в hero ──────────────────────────────────────── */
.demo {
  background: var(--white); border: 1px solid var(--stroke); border-radius: var(--r-xl);
  box-shadow: 0 18px 50px rgba(16, 24, 40, .10); overflow: hidden;
}
.demo-head { display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid var(--stroke); background: #fcfdff; }
.demo-tab {
  flex: 1; border: 0; background: transparent; padding: 9px 6px; border-radius: var(--r-pill);
  font: inherit; font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; transition: .15s;
}
.demo-tab:hover { background: var(--light-blue); color: var(--accent); }
.demo-tab.on { background: var(--accent); color: #fff; }
.demo-body { padding: 16px; min-height: 372px; }
.demo-fx { animation: fade .26s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
.demo-note { font-size: 11.5px; color: var(--text-off); margin-top: 12px; text-align: center; }

.formula { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; margin-top: 3px; }
.formula b { color: var(--accent); font-weight: 600; }
.dims { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.dim { border: 1px solid var(--stroke); border-radius: var(--r-sm); padding: 7px 4px; text-align: center; background: var(--bg); }
.dim > span { display: block; font-size: 9.5px; color: var(--text-off); text-transform: uppercase; letter-spacing: .04em; }
.dim-ctl { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 3px; }
.dim-ctl button {
  width: 22px; height: 22px; border-radius: var(--r-pill); border: 1px solid var(--stroke); background: #fff;
  color: var(--accent); font-size: 15px; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.dim-ctl button:hover { background: var(--light-blue); border-color: var(--accent-2); }
.dim-ctl b { min-width: 30px; font-size: 14px; font-variant-numeric: tabular-nums; }

.df {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm);
  border: 1px solid transparent; cursor: pointer; transition: .15s; width: 100%; text-align: left;
  background: transparent; font: inherit; color: inherit;
}
.df:hover { background: var(--bg); border-color: var(--stroke); }
.df.on { background: #f3faf5; border-color: #cfead9; }
.df .tick { margin-top: 1px; transition: .15s; }
.df-t { display: block; font-size: 13.5px; line-height: 1.35; }
.df.on .df-t { font-weight: 500; }
.df-s { display: block; font-size: 11.5px; color: var(--text-off); margin-top: 2px; }

.doc-r { padding: 9px 0; border-bottom: 1px solid #f2f4f7; font-size: 12.5px; }
.doc-r:last-child { border-bottom: 0; }
.doc-r b { font-size: 13px; }
.doc-r .src { color: var(--accent); font-size: 11.5px; }
.sm-r { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed #eceff3; font-size: 13px; }
.sm-r span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sm-total { display: flex; justify-content: space-between; padding-top: 12px; font-weight: 600; font-size: 16px; }

/* ── Появление блоков при прокрутке ─────────────────────────────────── */
/* Скрывает блоки ДО появления сам скрипт (класс .js на <html>), а не CSS.
   Раньше `.rv` был прозрачным всегда, и весь текст лендинга — а он почти
   целиком лежит в этих карточках — зависел от того, отработает ли
   IntersectionObserver. Без JS (и у краулера, который его не исполняет)
   страница оказывалась пустой. Теперь по умолчанию всё видно, а анимацию
   включает только тот браузер, который её умеет показать. */
.js .rv { opacity: 0; transform: translateY(16px); transition: opacity .55s ease, transform .55s ease; }
.js .rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .rv { opacity: 1; transform: none; transition: none; }
  .demo-fx { animation: none; }
  .store:hover, .card-hover:hover { transform: none; }
}
.hdr.on { box-shadow: 0 1px 14px rgba(16, 24, 40, .09); }

/* ── QR входа ───────────────────────────────────────────────────────── */
.qr-box {
  width: 224px; max-width: 100%; aspect-ratio: 1; margin: 0 auto; padding: 8px;
  background: #fff; border: 1px solid var(--stroke); border-radius: var(--r);
}
.qr-box svg { width: 100%; height: 100%; display: block; border-radius: 10px; }
.qr-box.dim-out { opacity: .25; filter: grayscale(1); }
.lg-foot { border-top: 1px solid var(--stroke); margin-top: 18px; padding-top: 14px; text-align: center; font-size: 13.5px; color: var(--text-2); }
.lg-foot button { border: 0; background: transparent; font: inherit; color: var(--accent); font-weight: 500; cursor: pointer; padding: 0; }
.lg-foot button:hover { text-decoration: underline; }

@media (max-width: 420px) {
  .dims { grid-template-columns: repeat(2, 1fr); }
  .demo-body { min-height: 0; }
}

/* ═══ Список недостатков: закрепление и перетаскивание ════════════════ */

.fail-row { transition: box-shadow .15s ease, transform .12s ease, opacity .15s ease; }
.fail-row.pinned { border-color: var(--accent-2); background: var(--light-blue); }

/* Строка, которую тащат: приподнята и следует за пальцем. */
.fail-row.dragging {
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
  opacity: .95;
  position: relative;
  z-index: 5;
}
/* Пока идёт перетаскивание — не выделяем текст под пальцем. */
.reordering, .reordering * { user-select: none; -webkit-user-select: none; }

/* Кнопка-иконка закрепления: только значок, без подписи. */
.pin-btn {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  border-radius: var(--r-pill); border: 1px solid var(--stroke);
  background: var(--white); color: var(--text-off); cursor: pointer; transition: .15s;
}
.pin-btn:hover { border-color: var(--accent-2); color: var(--accent); background: var(--light-blue); }
.pin-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pin-btn svg { width: 17px; height: 17px; }

/* Ручка перетаскивания — только у закреплённых. touch-action: none, иначе
   первый же сдвиг пальца уедет в прокрутку страницы вместо переноса. */
.grip {
  width: 26px; flex: none; display: grid; place-items: center;
  color: var(--text-off); cursor: grab; touch-action: none;
}
.grip:active { cursor: grabbing; }
.grip svg { width: 16px; height: 16px; }

/* ═══ Недостатки элемента: строка-чек как в приложении ════════════════

   Свои и справочные недостатки выглядят одинаково — отличает их только
   значок руки («вписал сам»). Системный чекбокс заменён своим: браузерный
   рисуется по-разному в каждой ОС и выбивался из остального интерфейса.
   ─────────────────────────────────────────────────────────────────── */

.chk-row {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px;
  border: 1px solid var(--stroke); border-radius: var(--r-sm); background: var(--white);
  transition: border-color .15s ease, background .15s ease;
}
/* Отмечается вся строка, а не только чекбокс: попасть пальцем в квадрат
   22×22 неудобно (см. обработчик в act.html). Курсор об этом и говорит. */
.chk-row { cursor: pointer; }
.chk-row:hover { border-color: var(--accent-2); }
.chk-row.on { border-color: var(--accent); background: var(--light-blue); }
.chk-row.off { opacity: .6; }
.chk-row > .flex-1 { font-size: 14px; line-height: 1.35; }

.chk-box { position: relative; width: 22px; height: 22px; flex: none; cursor: pointer; }
.chk-box input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chk-box i {
  position: absolute; inset: 0; border: 2px solid var(--stroke); border-radius: 7px;
  background: #fff; display: grid; place-items: center; pointer-events: none; transition: .15s;
}
.chk-box i::after {
  content: ''; width: 11px; height: 6px; margin-top: -2px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg) scale(.4); opacity: 0; transition: .15s;
}
.chk-box input:checked + i { background: var(--accent); border-color: var(--accent); }
.chk-box input:checked + i::after { opacity: 1; transform: rotate(-45deg) scale(1); }
.chk-box input:focus-visible + i { box-shadow: 0 0 0 3px rgba(3, 106, 211, .18); }

/* Значок руки: недостаток вписан человеком, а не взят из справочника. */
.by-hand {
  display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none;
  border-radius: var(--r-pill); background: #fff4e0; color: #b26a00; vertical-align: middle;
}
.by-hand svg { width: 15px; height: 15px; }

/* Мелкие действия строки: значок без подписи — иначе строка не помещается. */
.icon-btn {
  width: 32px; height: 32px; flex: none; display: grid; place-items: center;
  border-radius: var(--r-pill); border: 1px solid transparent;
  background: transparent; color: var(--text-off); cursor: pointer; transition: .15s;
}
.icon-btn:hover { background: #fff; border-color: var(--accent-2); color: var(--accent); }
.icon-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.icon-btn.danger:hover { border-color: var(--red); color: var(--red); }
.icon-btn svg { width: 17px; height: 17px; }

.fail-item { animation: fail-in .16s ease both; }

/* ── Перетаскивание закреплённых ──────────────────────────────────────
   touch-action: none на ручке обязателен: без него палец, начавший движение
   с неё, прокручивает страницу, и до перетаскивания дело не доходит.       */

.pin-zone { display: flex; flex-direction: column; gap: 8px; }
.pin-zone + .fail-item, .pin-tip + .fail-item { margin-top: 8px; }
.pin-tip { margin: 6px 0 2px; }

.drag-handle {
  display: grid; place-items: center; width: 22px; height: 28px; flex: none;
  margin-left: -4px; color: var(--text-off); cursor: grab;
  touch-action: none; user-select: none;
}
.drag-handle:hover { color: var(--accent); }
.drag-handle svg { width: 16px; height: 16px; }

/* Пока тащим: строка приподнята, остальные приглушены — видно, что двигаем. */
.fail-item.dragging { animation: none; }
.fail-item.dragging .chk-row {
  border-color: var(--accent); box-shadow: 0 6px 18px rgba(3, 106, 211, .18);
  transform: scale(1.01);
}
.fail-item.dragging .drag-handle { cursor: grabbing; color: var(--accent); }
.pin-zone.drag-on .fail-item:not(.dragging) { opacity: .65; }
.pin-zone.drag-on { cursor: grabbing; }
.fail-size { display: flex; gap: 8px; align-items: flex-end; padding: 8px 12px 2px 44px; }
@keyframes fail-in { from { opacity: 0; transform: translateY(-4px); } }

@media (max-width: 560px) {
  .fail-size { padding-left: 12px; }
}

/* ═══ Редактор акта: плоскости, вычеты, подсказки ═════════════════════ */

/* Пол и стены — отдельными карточками, как в приложении. */
.plane {
  background: var(--white); border: 1px solid var(--stroke); border-radius: var(--r);
  padding: 12px; box-shadow: var(--shadow);
}
.plane-eq { font-size: 16px; white-space: nowrap; min-width: 62px; }
.dim-ico { width: 24px; flex: none; color: var(--text-off); display: grid; place-items: center; }
.dim-ico svg { width: 20px; height: 20px; }

/* Шапка блока вычетов. */
.ded-head {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  height: 36px; background: var(--light-blue); border-radius: 10px; font-size: 13px;
}

/* Кнопка-подсказка «?» — как help-иконка в приложении. */
.help-btn {
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  border: 1px solid var(--accent-2); background: var(--light-blue); color: var(--accent);
  font-size: 14px; font-weight: 600; line-height: 1; cursor: pointer; padding: 0;
}
.help-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Обязательное и незаполненное — подсвечиваем, как isError в приложении. */
.input-err { border-color: var(--red); background: #fff8f8; }
.input-err:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(229, 57, 53, .12); }

/* ═══ Мелкие анимации ═════════════════════════════════════════════════
   Правило одно: анимируем только смену экрана, появление модалок и момент,
   когда число пересчиталось. Списки и карточки НЕ анимируем — разметка
   пересобирается на каждый введённый символ, и «оживление» превратилось бы
   в мигание. Двигаем только opacity и transform: они не вызывают пересчёт
   раскладки и не дёргают прокрутку.
   ═══════════════════════════════════════════════════════════════════ */

@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } }
.screen-in { animation: screenIn .22s cubic-bezier(.2, .7, .3, 1) both; }

/* Модалка: подложка проявляется, окно чуть подъезжает снизу. */
@keyframes backdropIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.backdrop { animation: backdropIn .16s ease both; }
.backdrop > .modal { animation: modalIn .2s cubic-bezier(.2, .7, .3, 1) both; }

/* Площадь пересчиталась — короткая подсветка поля: видно, что число живое. */
@keyframes flashCalc {
  0%   { background: var(--light-blue); border-color: var(--accent-2); }
  100% { background: var(--white); border-color: var(--stroke); }
}
.flash-calc { animation: flashCalc .5s ease both; }

/* Нажатия и наведения. */
.card-tight, .plane, .fail-row { transition: box-shadow .16s ease, border-color .16s ease; }
.chip, .step, .pin-btn, .help-btn, .store { will-change: transform; }
.btn:active, .chip:active, .pin-btn:active, .help-btn:active { transform: translateY(1px); }

/* Галочка недостатка — мягкое нажатие вместо резкого переключения. */
.check input { transition: transform .12s ease; }
.check:active input { transform: scale(.9); }

/* Раскрытие помещения и этажа: содержимое проявляется, а не выпрыгивает. */
@keyframes revealIn { from { opacity: 0; transform: translateY(-4px); } }
.floor[open] > .floor-body, .acc[open] > .acc-body { animation: revealIn .18s ease both; }

@media (prefers-reduced-motion: reduce) {
  .screen-in, .backdrop, .backdrop > .modal, .flash-calc,
  .floor[open] > .floor-body, .acc[open] > .acc-body { animation: none; }
  .check:active input, .btn:active { transform: none; }
}

/* Работы по устранению внутри карточки своего недостатка. */
.works { border-top: 1px dashed var(--stroke); margin-top: 12px; padding-top: 12px; }
.work-row { padding-bottom: 2px; }

/* Отключённая кнопка пагинации: видно, что дальше листать некуда. */
.chip[disabled] { opacity: .45; cursor: not-allowed; }
.chip[disabled]:hover { border-color: var(--stroke); }
