/* Портал выездного аудита — стили. Только системные шрифты, без сети. */

:root {
  --bg: #F2F4F1;
  --surface: #FFFFFF;
  --text: #16211B;
  --text-muted: #5E6B63;
  --line: #D8DED9;

  --accent: #2E5E47;
  --accent-soft: #E3EEE7;
  --accent-contrast: #FFFFFF;

  --st-ok: #2F7D4E;
  --st-ok-soft: #E5F3EA;
  --st-bad: #B42318;
  --st-bad-soft: #FBE7E4;
  --st-unclear: #9A6B00;
  --st-unclear-soft: #FBF0DA;
  --st-noaccess: #56616A;
  --st-noaccess-soft: #E7EAEC;
  --st-none: #A5B0A9;
  --st-none-soft: #ECEFEC;

  --stop-fg: #8F1D14;
  --stop-bg: #FCE9E7;

  --font-text: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;

  --radius: 10px;
  --tabbar-h: 60px;
  --topbar-h: 52px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1512;
    --surface: #17201B;
    --text: #E7EEE9;
    --text-muted: #9BA8A0;
    --line: #2A352F;

    --accent: #7BC39B;
    --accent-soft: #1E2B23;
    --accent-contrast: #0F1512;

    --st-ok: #4FBF7C;
    --st-ok-soft: #163524;
    --st-bad: #E5584B;
    --st-bad-soft: #3A1A16;
    --st-unclear: #D9A441;
    --st-unclear-soft: #3A2E12;
    --st-noaccess: #93A0A9;
    --st-noaccess-soft: #232D31;
    --st-none: #5C6B63;
    --st-none-soft: #1E2621;

    --stop-fg: #FF8A7A;
    --stop-bg: #3A1A16;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { overflow-x: hidden; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 15px;
  line-height: 1.45;
  overflow-x: hidden;
  min-height: 100vh;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 650;
  margin: 0 0 8px;
  color: var(--text);
}
h1 { font-size: 20px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }

p { margin: 0 0 8px; }

.mono, .code, code {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

button {
  font: inherit;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
}
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 10px; font-size: 13px; }

.input, textarea.input, select.input {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
textarea.input { min-height: 80px; resize: vertical; }
label.field-label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 4px;
}
.field { margin-bottom: 14px; }

.surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* ---------- layout shell ---------- */

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 16px; margin: 0; }
.topbar .actions { display: flex; gap: 6px; }
.icon-btn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text);
}
.icon-btn svg { width: 20px; height: 20px; }

main.view {
  flex: 1 1 auto;
  padding: 14px 14px calc(var(--tabbar-h) + 24px);
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.tabbar a {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 0 6px;
  min-height: 44px;
  color: var(--text-muted);
  font-size: 11px;
}
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.active { color: var(--accent); }

.sidenav { display: none; }

@media (min-width: 1000px) {
  #app { flex-direction: row; }
  .sidenav {
    display: flex;
    flex-direction: column;
    width: 220px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--line);
    padding: 16px 10px;
    height: 100vh;
    position: sticky;
    top: 0;
  }
  .sidenav .brand { font-family: var(--font-display); font-weight: 650; font-size: 16px; padding: 0 10px 16px; }
  .sidenav a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 10px;
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
  }
  .sidenav a svg { width: 18px; height: 18px; flex-shrink: 0; }
  .sidenav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
  .sidenav .spacer { flex: 1; }
  .tabbar { display: none; }
  #logoutBtnTop { display: none; }
  main.view { max-width: 880px; padding: 16px 32px 32px; }
  .content-col { max-width: 640px; }
}

/* ---------- generic states ---------- */

.state-block {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted);
}
.state-block strong { display: block; color: var(--text); margin-bottom: 4px; }

.banner {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 12px;
}
.banner-warn {
  background: var(--stop-bg);
  color: var(--stop-fg);
}

/* ---------- stat rows (Обзор) ---------- */

.stat-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.stat-row:last-child { border-bottom: none; }
.stat-row .label { color: var(--text-muted); font-size: 13px; }
.stat-row .value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 16px; font-weight: 600; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
@media (min-width: 560px) {
  /* 6 плиток: 3 + 3, на широком экране — в один ряд, без пустых мест */
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(6, 1fr); }
}
.stat-tile {
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}
.stat-tile .n { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 650; }
.stat-tile .t { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.stat-tile.ok .n { color: var(--st-ok); }
.stat-tile.bad .n { color: var(--st-bad); }
.stat-tile.unclear .n { color: var(--st-unclear); }
.stat-tile.noaccess .n { color: var(--st-noaccess); }

section.block { margin-bottom: 24px; }
section.block h2 { display: flex; align-items: center; justify-content: space-between; }

/* ---------- status chips / badges ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.chip-ok { background: var(--st-ok-soft); color: var(--st-ok); }
.chip-bad { background: var(--st-bad-soft); color: var(--st-bad); }
.chip-unclear { background: var(--st-unclear-soft); color: var(--st-unclear); }
.chip-noaccess { background: var(--st-noaccess-soft); color: var(--st-noaccess); }
.chip-none { background: var(--st-none-soft); color: var(--text-muted); }
.chip-done { background: var(--st-ok-soft); color: var(--st-ok); }
.chip-partial { background: var(--st-unclear-soft); color: var(--st-unclear); }
.chip-notdone { background: var(--st-bad-soft); color: var(--st-bad); }

.stop-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--stop-bg);
  color: var(--stop-fg);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
}

/* ---------- route / маршрут ---------- */

.route-line {
  position: relative;
  padding-left: 34px;
  margin-bottom: 8px;
}
.route-line::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--line);
}
.zone-station {
  position: relative;
  margin-bottom: 22px;
}
.zone-station .ring {
  position: absolute;
  left: -34px;
  top: 0;
  width: 28px;
  height: 28px;
}
.zone-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  min-height: 44px;
}
.zone-head .name { font-family: var(--font-display); font-weight: 650; font-size: 15px; flex: 1 1 auto; }
.zone-head .frac { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text-muted); font-size: 13px; }
.zone-head .chevron { display: inline-flex; color: var(--text-muted); }
.zone-head .chevron svg { width: 18px; height: 18px; transition: transform .15s ease; }
.zone-head.collapsed .chevron svg { transform: rotate(-90deg); }
.item-list.collapsed { display: none; }

.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.filters .input { flex: 1 1 120px; min-width: 0; }

.item-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

.item-card {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--st-none);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
  width: 100%;
  min-height: 44px;
  align-items: flex-start;
}
.item-card.st-ok { border-left-color: var(--st-ok); }
.item-card.st-bad { border-left-color: var(--st-bad); }
.item-card.st-unclear { border-left-color: var(--st-unclear); }
.item-card.st-noaccess { border-left-color: var(--st-noaccess); }
.item-card .body { flex: 1 1 auto; min-width: 0; }
.item-card .top-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 3px; }
.item-card .code { font-size: 12px; color: var(--text-muted); }
.item-card .title { font-size: 14px; font-weight: 600; word-break: break-word; }
.item-card .meta-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.item-card .meta-row .note-preview { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-card .photo-count { display: inline-flex; align-items: center; gap: 3px; }
.item-card .photo-count svg { width: 14px; height: 14px; }

/* ---------- list rows (План / Документы) ---------- */

.list-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.list-row:last-child { border-bottom: none; }
.list-row .main { flex: 1 1 auto; min-width: 0; }
.list-row .title { font-weight: 600; font-size: 14px; word-break: break-word; }
.list-row .sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.list-row .amount { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.group-title { margin-top: 22px; }
.group-title:first-child { margin-top: 0; }

.plan-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.plan-actions .btn-sm { flex: 0 0 auto; }
.plan-actions .btn-sm.active-done { background: var(--st-ok-soft); border-color: var(--st-ok); color: var(--st-ok); }
.plan-actions .btn-sm.active-partial { background: var(--st-unclear-soft); border-color: var(--st-unclear); color: var(--st-unclear); }
.plan-actions .btn-sm.active-notdone { background: var(--st-bad-soft); border-color: var(--st-bad); color: var(--st-bad); }

.doc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  min-height: 44px;
}
.doc-row:last-child { border-bottom: none; }
.doc-row .title { flex: 1 1 auto; font-size: 14px; font-weight: 600; word-break: break-word; }
.doc-row svg { width: 20px; height: 20px; color: var(--text-muted); flex-shrink: 0; }

/* ---------- drawer (шторка / панель) ---------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease;
}
.overlay.open { opacity: 1; visibility: visible; }

.drawer {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 41;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  border-top: 1px solid var(--line);
  padding: 16px 16px calc(env(safe-area-inset-bottom, 0) + 20px);
  transform: translateY(100%);
  transition: transform .25s ease;
}
.drawer.open { transform: translateY(0); }

@media (min-width: 1000px) {
  .drawer {
    left: auto;
    top: 0; bottom: 0;
    width: 420px;
    max-height: none;
    border-radius: 0;
    border-left: 1px solid var(--line);
    border-top: none;
    transform: translateX(100%);
  }
  .drawer.open { transform: translateX(0); }
}

.drawer .drag-handle {
  width: 40px; height: 4px;
  background: var(--line);
  border-radius: 4px;
  margin: 0 auto 14px;
}
@media (min-width: 1000px) { .drawer .drag-handle { display: none; } }

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.status-btn {
  min-height: 52px;
  border-radius: var(--radius);
  border: 2px solid var(--line);
  background: var(--surface);
  font-weight: 650;
  font-size: 14px;
  padding: 6px 8px;
  color: var(--text);
}
.status-btn.sel-ok { border-color: var(--st-ok); }
.status-btn.sel-bad { border-color: var(--st-bad); }
.status-btn.sel-unclear { border-color: var(--st-unclear); }
.status-btn.sel-noaccess { border-color: var(--st-noaccess); }
.status-btn.sel-done { border-color: var(--st-ok); }
.status-btn.sel-partial { border-color: var(--st-unclear); }
.status-btn.sel-notdone { border-color: var(--st-bad); }
.status-btn.active { color: var(--accent-contrast); }
.status-btn.active.sel-ok { background: var(--st-ok); }
.status-btn.active.sel-bad { background: var(--st-bad); }
.status-btn.active.sel-unclear { background: var(--st-unclear); }
.status-btn.active.sel-noaccess { background: var(--st-noaccess); }
.status-btn.active.sel-done { background: var(--st-ok); }
.status-btn.active.sel-partial { background: var(--st-unclear); }
.status-btn.active.sel-notdone { background: var(--st-bad); }

.photo-input-row { margin-bottom: 14px; }
.photo-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.photo-thumbs img, .photo-thumbs .pending {
  width: 64px; height: 64px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--accent-soft);
}

.history { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.history-entry { padding: 10px 0; border-bottom: 1px solid var(--line); }
.history-entry:last-child { border-bottom: none; }
.history-entry .who-when { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.history-entry .note { font-size: 13px; margin-top: 4px; }

/* ---------- login ---------- */

/* вход: фото главного корпуса на фоне гор, карточка поверх — снизу на телефоне, справа на компьютере */
.login-wrap {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: end center;
  padding: 16px;
  background: #16211b url("login.jpg") center 35% / cover no-repeat;
}
.login-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 18, 14, 0) 30%, rgba(10, 18, 14, 0.35) 60%, rgba(10, 18, 14, 0.78) 100%);
}
.login-wrap[hidden] { display: none; }
.login-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  padding: 26px 22px 22px;
  border-radius: 18px;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.3);
  margin-bottom: max(8px, env(safe-area-inset-bottom));
}
@media (min-width: 900px) {
  .login-wrap { place-items: center end; padding: 48px 7vw; }
  .login-wrap::before {
    background: linear-gradient(90deg, rgba(10, 18, 14, 0) 35%, rgba(10, 18, 14, 0.6) 100%);
  }
}
.login-card h1 { text-align: center; margin-bottom: 4px; }
.login-card .sub { text-align: center; color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }
.login-error { color: var(--st-bad); font-size: 13px; margin-bottom: 10px; min-height: 18px; }

/* ---------- modal (профиль) ---------- */

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  width: 100%; max-width: 360px;
  padding: 22px;
}

@media (max-width: 359px) {
  main.view { padding-left: 10px; padding-right: 10px; }
}

/* =====================================================================
   v2 — Аудит / Объект
   ===================================================================== */

.section-gap { margin-top: clamp(56px, 8vw, 120px); }

/* ---------- переключатель шагов (Аудит) ---------- */

.step-switcher {
  position: sticky;
  top: var(--topbar-h);
  z-index: 15;
  display: flex;
  gap: 4px;
  padding: 6px;
  margin: 0 -14px 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 1000px) { .step-switcher { margin: 0 -32px 14px; padding: 6px 32px; } }
.step-switcher button {
  flex: 1 1 0;
  min-height: 44px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
}
.step-switcher button.active { background: var(--surface); color: var(--accent); box-shadow: 0 1px 0 var(--line) inset; }

/* ---------- шаг 1: Итог — фото-полоса ---------- */

.hero-band {
  position: relative;
  height: 42vh;
  min-height: 260px;
  margin: 0 -14px 16px;
  overflow: hidden;
  background: var(--accent-soft);
  display: flex;
  align-items: flex-end;
}
@media (min-width: 1000px) { .hero-band { height: 44vh; margin: 0 -32px 12px; border-radius: var(--radius); } }
.hero-band img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero-band::after {
  content: "";
  position: absolute; inset: 0;
  /* единственное допустимое затемнение-градиент — на фото, не украшение */
  background: linear-gradient(180deg, rgba(8,14,11,0) 35%, rgba(8,14,11,.55) 75%, rgba(8,14,11,.85) 100%);
}
.hero-band .hero-text {
  position: relative;
  z-index: 1;
  padding: 18px 18px calc(env(safe-area-inset-bottom, 0) + 16px);
  color: #F2F4F1;
}
@media (min-width: 1000px) { .hero-band .hero-text { padding: 28px 32px 32px; } }
.hero-band .hero-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  opacity: .85;
  margin-bottom: 8px;
}
.hero-band .hero-verdict {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: clamp(26px, 4.6vw, 52px);
  line-height: 1.12;
  max-width: 18ch;
}

/* три плитки цифр — своя сетка, не 6-колоночная от .stat-grid (иначе на
   компьютере плитка уже 1/6 строки и сумма переносится на две строки) */
.figures-row { grid-template-columns: 1fr !important; margin-bottom: 6px; }
@media (min-width: 640px) { .figures-row { grid-template-columns: repeat(3, 1fr) !important; } }
.figure-tile .n { font-size: 20px; white-space: nowrap; }
.figure-tile .deadline-left { font-size: 11px; color: var(--st-unclear); margin-top: 2px; font-weight: 600; }

.answers-row { display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 1000px) {
  /* в ряд на компьютере — весь шаг 1 должен помещаться в первый экран */
  .answers-row { flex-direction: row; align-items: stretch; }
  .answers-row .answer-card { flex: 1 1 0; margin-bottom: 0; }
}
.answer-card {
  padding: 14px;
  margin-bottom: 10px;
}
.answer-card .short { margin: 4px 0 0; }
.answer-card .details {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  white-space: pre-wrap;
  color: var(--text-muted);
}
.answer-card .more-btn {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: none;
  padding: 4px 0;
  min-height: 32px;
}

/* ---------- шаг 2: Доказательства — находки ---------- */

.zone-group { margin-bottom: 18px; }
.zone-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
  border-left: 4px solid var(--st-none);
  padding-left: 10px;
}
.zone-group-head.zc-red { border-left-color: var(--st-bad); }
.zone-group-head.zc-amber { border-left-color: var(--st-unclear); }
.zone-group-head.zc-green { border-left-color: var(--st-ok); }
.zone-group-head .name { font-family: var(--font-display); font-weight: 650; font-size: 15px; flex: 1 1 auto; }
.zone-group-head .sub { font-size: 12px; color: var(--text-muted); display: none; }
@media (min-width: 700px) { .zone-group-head .sub { display: inline; } }
.zone-group-head .count { font-family: var(--font-mono); color: var(--text-muted); font-size: 13px; }
.zone-group-head .chevron svg { width: 18px; height: 18px; transition: transform .15s ease; color: var(--text-muted); }
.zone-group-head.collapsed .chevron svg { transform: rotate(-90deg); }

.finding-card {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--st-none);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
  width: 100%;
  min-height: 44px;
}
.finding-card.zc-red { border-left-color: var(--st-bad); }
.finding-card.zc-amber { border-left-color: var(--st-unclear); }
.finding-card.zc-green { border-left-color: var(--st-ok); }
.finding-card .body { flex: 1 1 auto; min-width: 0; }
.finding-card .title { font-size: 14px; font-weight: 600; word-break: break-word; margin-bottom: 3px; }
.finding-card .fact { font-size: 13px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.finding-card .meta-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
.finding-card .scan-count { display: inline-flex; align-items: center; gap: 3px; }
.finding-card .scan-count svg { width: 14px; height: 14px; }
.finding-card .basis-chip { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 2px 8px; font-size: 11px; }

/* шторка находки — переиспользует .drawer/.status-grid, добавляем своё */
.evidence-grid { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.evidence-grid .thumb {
  width: 76px; height: 76px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
  cursor: zoom-in;
  background: var(--accent-soft);
}
.doc-links-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 14px; }

/* ---------- шаг 3: Что делать — степпер условий ---------- */

.condition-stepper { position: relative; padding-left: 34px; }
.condition-stepper::before {
  content: "";
  position: absolute;
  left: 13px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--line);
}
.condition-item { position: relative; margin-bottom: 18px; }
.condition-item .num {
  position: absolute; left: -34px; top: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.condition-item .text { font-size: 14px; padding-top: 3px; }
.condition-item .deadline {
  display: inline-flex;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--stop-bg);
  color: var(--stop-fg);
  font-size: 12px;
  font-weight: 700;
}
.actions-cta { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.actions-cta .btn { flex: 1 1 200px; }

/* ---------- Объект ---------- */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 700px) { .photo-grid { grid-template-columns: repeat(4, 1fr); } }
.photo-grid figure { margin: 0; }
.photo-grid button {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--accent-soft);
  aspect-ratio: 4 / 3;
}
.photo-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-grid figcaption { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.media-list .list-row .sub a { color: var(--text-muted); }

/* ---------- лайтбокс (сканы и фото объекта) ---------- */

.lightbox {
  position: fixed; inset: 0;
  z-index: 60;
  background: rgba(8, 14, 11, .92);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: min(92vw, 1100px);
  max-height: 82vh;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform .15s ease;
  touch-action: pinch-zoom;
}
.lightbox img.zoomed { transform: scale(2); cursor: zoom-out; }
.lightbox .lb-close, .lightbox .lb-nav {
  position: absolute;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.12);
  color: #F2F4F1;
  display: flex; align-items: center; justify-content: center;
}
.lightbox .lb-close { top: 14px; right: 14px; }
.lightbox .lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-caption {
  position: absolute; left: 0; right: 0; bottom: 14px;
  text-align: center;
  color: #F2F4F1;
  font-size: 13px;
}
