/* Стили мини-приложения учёта уборки территории.
   Цвета фона и текста берутся из темы Telegram (--tg-theme-*), вне Telegram — из запасной палитры. */

:root {
  --fb-bg: #eef1f4;
  --fb-card: #ffffff;
  --fb-text: #11161c;
  --fb-hint: #77818d;
  --fb-link: #2378c8;
  --fb-accent: #2481cc;
  --fb-accent-text: #ffffff;
  --fb-sep: #e2e6eb;
  --fb-section-head: #6b7581;

  --bg: var(--tg-theme-secondary-bg-color, var(--fb-bg));
  --card: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, var(--fb-card)));
  --text: var(--tg-theme-text-color, var(--fb-text));
  --hint: var(--tg-theme-hint-color, var(--fb-hint));
  --link: var(--tg-theme-link-color, var(--fb-link));
  --accent: var(--tg-theme-button-color, var(--fb-accent));
  --accent-text: var(--tg-theme-button-text-color, var(--fb-accent-text));
  --sep: var(--tg-theme-section-separator-color, var(--fb-sep));
  --section-head: var(--tg-theme-section-header-text-color, var(--fb-section-head));

  --ok: #1a9350;
  --ok-soft: rgba(26, 147, 80, 0.12);
  --bad: #d93a2f;
  --bad-soft: rgba(217, 58, 47, 0.1);
  --warn: #b86e00;
  --warn-soft: rgba(230, 146, 0, 0.15);
  --info: #5a6a7b;
  --info-soft: rgba(90, 106, 123, 0.12);
  --fill: rgba(118, 128, 140, 0.12);
  --fill-strong: rgba(118, 128, 140, 0.2);
  --on-color: #ffffff;
  --shadow: 0 1px 2px rgba(17, 22, 28, 0.05), 0 4px 16px -8px rgba(17, 22, 28, 0.12);
  --radius: 16px;
  --radius-sm: 11px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --fb-bg: #0e1115;
    --fb-card: #1a1e24;
    --fb-text: #eef1f5;
    --fb-hint: #8c96a2;
    --fb-link: #62a9f0;
    --fb-accent: #3a8ee0;
    --fb-sep: #2a2f36;
    --fb-section-head: #8c96a2;
    --ok: #3fc47c;
    --ok-soft: rgba(63, 196, 124, 0.15);
    --bad: #ff6b60;
    --bad-soft: rgba(255, 107, 96, 0.15);
    --warn: #ffb547;
    --warn-soft: rgba(255, 181, 71, 0.15);
    --info: #9dabb9;
    --info-soft: rgba(157, 171, 185, 0.14);
    --fill: rgba(150, 160, 172, 0.14);
    --fill-strong: rgba(150, 160, 172, 0.22);
    --shadow: none;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --fb-bg: #0e1115;
  --fb-card: #1a1e24;
  --fb-text: #eef1f5;
  --fb-hint: #8c96a2;
  --fb-link: #62a9f0;
  --fb-accent: #3a8ee0;
  --fb-sep: #2a2f36;
  --fb-section-head: #8c96a2;
  --ok: #3fc47c;
  --ok-soft: rgba(63, 196, 124, 0.15);
  --bad: #ff6b60;
  --bad-soft: rgba(255, 107, 96, 0.15);
  --warn: #ffb547;
  --warn-soft: rgba(255, 181, 71, 0.15);
  --info: #9dabb9;
  --info-soft: rgba(157, 171, 185, 0.14);
  --fill: rgba(150, 160, 172, 0.14);
  --fill-strong: rgba(150, 160, 172, 0.22);
  --shadow: none;
}

*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; box-sizing: border-box; }
body { height: 100%; margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Каркас ---------- */
.app-root {
  position: relative; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--text);
  font: 15px/1.42 var(--font); -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
.screens { position: absolute; inset: 0; }
.screen { position: absolute; inset: 0; background: var(--bg); }
.screen.is-hidden { visibility: hidden; pointer-events: none; }
.screen.enter { animation: push-in 0.26s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes push-in { from { transform: translateX(28%); opacity: 0.3; } to { transform: none; opacity: 1; } }

.page { height: 100%; display: flex; flex-direction: column; }
.page-body {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 10px 16px 28px;
}
.page-footer {
  flex: none; padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--card); border-top: 1px solid var(--sep);
}
.page-head { padding: 6px 2px 12px; }
.page-head h1 { margin: 0; font-size: 27px; line-height: 1.12; font-weight: 750; letter-spacing: -0.02em; text-wrap: balance; }
.page-sub { margin: 4px 0 0; color: var(--hint); font-size: 14.5px; }
.page-back { display: inline-flex; align-items: center; gap: 2px; margin: 0 0 6px -6px; padding: 6px; border: 0; background: none; color: var(--link); font-size: 15px; }
.center-fill { display: grid; place-items: center; }
.center-pad { display: grid; place-items: center; padding: 22px 0; }
.footnote { margin: 18px 4px 0; color: var(--hint); font-size: 13px; line-height: 1.45; }

/* ---------- Секции и строки ---------- */
.section { margin-top: 20px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 4px 7px; color: var(--section-head);
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
}
.section-card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.section-empty { display: flex; align-items: center; gap: 8px; padding: 15px 16px; color: var(--hint); }
.section-empty .icon { color: var(--ok); }

.cell {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px;
  padding: 10px 14px; border: 0; background: none; text-align: left; color: var(--text);
}
.cell + .cell::before, .cell + .request::before, .request + .cell::before {
  content: ""; position: absolute; top: 0; left: 14px; right: 0; border-top: 1px solid var(--sep);
}
.cell.has-left + .cell::before, .cell + .cell.has-left::before { left: 64px; }
.cell.is-button:active { background: var(--fill); }
.cell-left { flex: none; display: flex; }
.cell-main { flex: 1; min-width: 0; }
.cell-title { font-size: 16px; line-height: 1.3; }
.cell-sub { margin-top: 2px; color: var(--hint); font-size: 13.5px; line-height: 1.35; }
.cell-right { flex: none; display: flex; align-items: center; gap: 6px; }
.cell-icon {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  background: var(--fill); color: var(--accent);
}
.chev { flex: none; width: 8px; height: 8px; margin-right: 2px; border-top: 2px solid var(--hint); border-right: 2px solid var(--hint); transform: rotate(45deg); opacity: 0.55; }
.row-title { display: inline-flex; align-items: center; gap: 10px; text-transform: capitalize; }

.dateblock {
  display: grid; place-items: center; width: 38px; height: 42px; border-radius: 11px; background: var(--fill);
  line-height: 1; font-variant-numeric: tabular-nums;
}
.dateblock b { font-size: 17px; font-weight: 700; }
.dateblock small { margin-top: -6px; color: var(--hint); font-size: 11px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 18px; border: 0; border-radius: 13px;
  font-size: 16px; font-weight: 650; line-height: 1.2; text-align: center;
  transition: transform 0.08s ease, opacity 0.15s ease, background-color 0.15s ease;
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-secondary { background: var(--fill); color: var(--text); }
.btn-ok { background: var(--ok); color: var(--on-color); }
.btn-danger { background: var(--bad); color: var(--on-color); }
.btn-soft-bad { background: var(--bad-soft); color: var(--bad); }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border: 0; border-radius: 12px; background: var(--fill); color: var(--text);
}
.icon-btn.sm { width: 34px; height: 34px; border-radius: 10px; font-size: 19px; font-weight: 600; }
.icon-btn:disabled { opacity: 0.35; }
.icon-btn.light { background: rgba(255, 255, 255, 0.14); color: #fff; }
.icon-btn-spacer { width: 40px; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; border: 0; background: none; color: var(--link); font-size: 14.5px; font-weight: 550; text-transform: none; letter-spacing: 0; }
.link-btn.danger { color: var(--bad); }

.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 650; white-space: nowrap; line-height: 1.2;
}
.chip-ok { color: var(--ok); background: var(--ok-soft); }
.chip-bad { color: var(--bad); background: var(--bad-soft); }
.chip-warn { color: var(--warn); background: var(--warn-soft); }
.chip-info { color: var(--info); background: var(--info-soft); }
.count-badge {
  display: inline-flex; align-items: center; min-width: 22px; height: 22px; padding: 0 8px; border-radius: 999px;
  background: var(--accent); color: var(--accent-text); font-size: 12.5px; font-weight: 700; letter-spacing: 0; text-transform: none;
}
.count-badge.warn { background: var(--warn); color: #fff; }
.you { margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: var(--fill); color: var(--hint); font-size: 12px; }

.avatar {
  display: inline-grid; place-items: center; flex: none; border-radius: 50%;
  background: hsl(var(--h) 55% 88%); color: hsl(var(--h) 45% 32%); font-weight: 700; letter-spacing: 0.02em;
}
:root[data-theme="dark"] .avatar { background: hsl(var(--h) 30% 28%); color: hsl(var(--h) 60% 85%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar { background: hsl(var(--h) 30% 28%); color: hsl(var(--h) 60% 85%); } }

.spinner {
  display: inline-block; width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--fill-strong); border-top-color: var(--accent); animation: spin 0.8s linear infinite;
}
.spinner-sm { width: 18px; height: 18px; border-width: 2.5px; border-color: rgba(255, 255, 255, 0.35); border-top-color: currentColor; }
.spinner-xs { width: 14px; height: 14px; border-width: 2px; }
.spinner.light { border-color: rgba(255, 255, 255, 0.25); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { display: grid; justify-items: center; gap: 6px; padding: 40px 20px; text-align: center; }
.empty-state h3 { margin: 8px 0 0; font-size: 18px; }
.empty-state p { max-width: 30ch; margin: 0 0 10px; color: var(--hint); }
.empty-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--fill); color: var(--hint); }
.empty-icon.bad { background: var(--bad-soft); color: var(--bad); }

/* ---------- Главный экран ---------- */
.hello { display: flex; align-items: center; gap: 12px; padding: 8px 2px 14px; }
.hello-text { flex: 1; min-width: 0; }
.hello-name { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.hello-role { color: var(--hint); font-size: 14px; }

.today { padding: 16px; border-radius: 20px; background: var(--card); box-shadow: var(--shadow); }
.today-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.eyebrow { color: var(--hint); font-size: 12.5px; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; }
.today-date { margin-top: 2px; font-size: 21px; font-weight: 750; letter-spacing: -0.015em; }
.today-text { margin: 12px 0 14px; color: var(--text); opacity: 0.86; font-size: 14.5px; }

.route { display: flex; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.route-step { display: flex; flex-direction: column; gap: 6px; flex: 1 1 0; min-width: 0; }
.route-step::before { content: ""; display: block; height: 6px; border-radius: 3px; background: var(--fill-strong); }
.route-step.s-progress::before { background: var(--warn); }
.route-step.s-clean::before { background: var(--ok); }
.route-step.s-violation::before { background: var(--bad); }
.route-num { display: none; }
.route-name { overflow: hidden; color: var(--hint); font-size: 11.5px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }

.resp-zones { display: grid; gap: 8px; margin-top: 10px; }
.resp-zone { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--fill); }
.resp-zone b { font-size: 16px; }
.resp-zone span { font-size: 13.5px; font-weight: 600; }
.resp-zone .ok { color: var(--ok); }
.resp-zone .bad { color: var(--bad); }

.bars { display: grid; gap: 10px; padding: 14px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) 24px; align-items: center; gap: 10px; }
.bar-row.tall { align-items: center; }
.bar-label { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.bar-row.tall .bar-label { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; white-space: normal; }
.bar-row.tall .bar-label small { grid-column: 2; color: var(--hint); font-size: 12.5px; }
.bar-track { height: 8px; overflow: hidden; border-radius: 4px; background: var(--fill); }
.bar-track i { display: block; height: 100%; min-width: 3px; border-radius: 4px; background: var(--fill-strong); }
.bar-track i.bad { background: var(--bad); }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; color: var(--hint); }
.bar-value.bad { color: var(--bad); }
.bars-foot { padding: 0 14px 13px; color: var(--hint); font-size: 12.5px; }

/* ---------- Заполнение отчёта ---------- */
.fill-progress { display: flex; align-items: center; gap: 12px; margin: 0 2px 4px; }
.progress-track { flex: 1; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.progress-track i { height: 6px; border-radius: 3px; background: var(--fill-strong); transition: background-color 0.25s; }
.progress-track i.s-progress { background: var(--warn); }
.progress-track i.s-clean { background: var(--ok); }
.progress-track i.s-violation { background: var(--bad); }
.progress-label { color: var(--hint); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.zone { margin-top: 12px; padding: 14px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); transition: box-shadow 0.3s; scroll-margin-top: 12px; }
.zone.is-highlight { box-shadow: 0 0 0 2.5px var(--warn); }
.zone-head { display: flex; align-items: flex-start; gap: 11px; }
.zone-num {
  display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 9px;
  background: var(--fill-strong); color: var(--text); font-size: 14px; font-weight: 750; font-variant-numeric: tabular-nums;
}
.zone-num.sm { width: 24px; height: 24px; border-radius: 8px; font-size: 13px; }
.zone-num.xs { width: 20px; height: 20px; border-radius: 6px; font-size: 11.5px; }
.zone-num.ok, .zone-clean .zone-num { background: var(--ok); color: var(--on-color); }
.zone-num.bad, .zone-violation .zone-num { background: var(--bad); color: var(--on-color); }
.zone-titles { flex: 1; min-width: 0; }
.zone-titles h3 { margin: 2px 0 0; font-size: 17px; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
.zone-titles p { margin: 2px 0 0; color: var(--hint); font-size: 13px; }
.zone-badge {
  display: inline-flex; align-items: center; gap: 4px; flex: none; margin-top: 2px; padding: 4px 9px; border-radius: 999px;
  background: var(--fill); color: var(--hint); font-size: 12.5px; font-weight: 650; white-space: nowrap;
}
.zone-badge.ok { background: var(--ok-soft); color: var(--ok); }
.zone-badge.bad { background: var(--bad-soft); color: var(--bad); }
.zone-badge.warn { background: var(--warn-soft); color: var(--warn); }

.photo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 13px; }
.tile {
  position: relative; display: block; width: 100%; max-width: 100%; aspect-ratio: 1; padding: 0; overflow: hidden;
  border: 0; border-radius: var(--radius-sm); background: var(--fill);
}
.tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tile.is-violation { box-shadow: 0 0 0 2.5px var(--bad); }
.tile-flag {
  position: absolute; top: 5px; right: 5px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--bad); color: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.tile-date {
  position: absolute; left: 4px; right: 4px; bottom: 4px; padding: 2px 4px; border-radius: 6px;
  background: rgba(186, 112, 0, 0.92); color: #fff; font-size: 10px; font-weight: 700; line-height: 1.2; text-align: center;
}
.tile-add {
  display: grid; place-content: center; justify-items: center; gap: 2px; padding: 4px;
  background: var(--fill); color: var(--accent); cursor: pointer;
  border: 1.5px dashed var(--fill-strong);
}
.tile-add span { font-size: 11.5px; font-weight: 650; line-height: 1.15; text-align: center; }
.tile-upload img { opacity: 0.55; }
.tile-ph { display: grid; place-items: center; height: 100%; color: var(--hint); }
.tile-over { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px; }
.tile-upload.error .tile-over { background: rgba(217, 58, 47, 0.35); }
.tile-mini { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.55); color: #fff; }
.ring {
  width: 30px; height: 30px; border-radius: 50%;
  background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255, 255, 255, 0.3) 0);
  -webkit-mask: radial-gradient(circle, transparent 9px, #000 10px);
  mask: radial-gradient(circle, transparent 9px, #000 10px);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.zone-count { margin-top: 8px; color: var(--hint); font-size: 12.5px; }
.zone-count.ok { color: var(--ok); }
.zone-question { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--sep); }
.zone-question > span { font-size: 15.5px; font-weight: 600; }
.seg { display: inline-flex; gap: 3px; padding: 3px; border-radius: 12px; background: var(--fill); }
.seg button { min-width: 74px; min-height: 40px; padding: 0 12px; border: 0; border-radius: 9px; background: none; font-size: 15px; font-weight: 650; color: var(--text); }
.seg button.on.ok { background: var(--ok); color: var(--on-color); }
.seg button.on.bad { background: var(--bad); color: var(--on-color); }
.zone-hint { display: flex; gap: 7px; margin: 10px 0 0; color: var(--hint); font-size: 13.5px; line-height: 1.4; }
.zone-hint .icon { flex: none; margin-top: 1px; }
.zone-hint.warn { padding: 9px 11px; border-radius: 11px; background: var(--warn-soft); color: var(--warn); }
.zone-note { margin: 10px 0 0; font-size: 14px; }
.zone-note b { color: var(--hint); font-weight: 600; }

.input {
  display: block; width: 100%; min-height: 44px; padding: 11px 13px; border: 0; border-radius: 12px; outline: none;
  background: var(--fill); color: var(--text); font-size: 16px; line-height: 1.35; resize: none;
}
.input::placeholder { color: var(--hint); opacity: 1; }
.input:focus { box-shadow: inset 0 0 0 1.5px var(--accent); }
select.input { appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--hint) 50%), linear-gradient(135deg, var(--hint) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.zone-comment { margin-top: 10px; font-size: 15px; }

.remark { display: flex; gap: 9px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--warn-soft); color: var(--text); }
.remark .icon { flex: none; margin-top: 2px; color: var(--warn); }
.remark b { color: var(--warn); font-size: 13px; }
.remark p { margin: 2px 0 0; font-size: 14px; }
.remark-add { margin-top: 10px; }
.remark-edit { margin-top: 12px; }
.remark-edit label { display: block; margin-bottom: 6px; color: var(--hint); font-size: 13px; font-weight: 600; }

.banner { margin: 0 0 12px; padding: 13px 14px; border-radius: var(--radius); }
.banner-title { display: flex; align-items: center; gap: 7px; font-weight: 700; }
.banner p { margin: 6px 0 0; }
.banner-meta { display: block; margin-top: 6px; font-size: 13px; opacity: 0.8; }
.banner-bad { background: var(--bad-soft); color: var(--bad); }
.banner-bad p { color: var(--text); }
.banner-info { margin-top: 12px; background: var(--info-soft); color: var(--info); }
.banner-info p { color: var(--text); font-size: 14px; }

.submit-bar { display: grid; gap: 8px; }
.submit-note { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--hint); font-size: 13px; }

/* ---------- Просмотр отчёта ---------- */
.summary { padding: 15px 16px; border-radius: 20px; background: var(--card); box-shadow: var(--shadow); }
.summary-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.verdict { margin-top: 12px; font-size: 18px; font-weight: 750; letter-spacing: -0.01em; }
.verdict.ok { color: var(--ok); }
.verdict.bad { color: var(--bad); }
.kv { display: grid; gap: 7px; margin: 12px 0 0; }
.kv div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.kv dt { color: var(--hint); }
.kv dd { margin: 0; text-align: right; }
.review-quote { margin: 12px 0 0; padding: 9px 12px; border-left: 3px solid var(--fill-strong); border-radius: 0 10px 10px 0; background: var(--fill); font-size: 14px; }
.summary-warn { display: flex; align-items: center; gap: 7px; margin-top: 12px; padding: 9px 11px; border-radius: 11px; background: var(--warn-soft); color: var(--warn); font-size: 13.5px; font-weight: 600; }
.zone.view .photo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.zstrip { display: inline-flex; gap: 3px; }
.zstrip i { width: var(--s); height: var(--s); border-radius: 3px; background: var(--fill-strong); }
.zstrip i.s-progress { background: var(--warn); }
.zstrip i.s-clean { background: var(--ok); }
.zstrip i.s-violation { background: var(--bad); }

.timeline { margin: 0; padding: 14px 16px 6px; border-radius: var(--radius); background: var(--card); list-style: none; box-shadow: var(--shadow); }
.tl { position: relative; display: flex; gap: 12px; padding-bottom: 14px; }
.tl:not(:last-child)::after { content: ""; position: absolute; top: 16px; bottom: 0; left: 5px; width: 2px; background: var(--sep); }
.tl-dot { flex: none; width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; background: var(--fill-strong); }
.tl-submitted .tl-dot, .tl-resubmitted .tl-dot { background: var(--warn); }
.tl-returned .tl-dot { background: var(--bad); }
.tl-approved .tl-dot { background: var(--ok); }
.tl-title { font-weight: 650; }
.tl-meta { color: var(--hint); font-size: 13px; }
.tl-comment, .tl-zone { margin: 5px 0 0; font-size: 14px; }
.tl-zone { color: var(--hint); }

/* ---------- Просмотр фото ---------- */
.overlay { position: fixed; inset: 0; }
.viewer { z-index: 40; display: flex; flex-direction: column; background: #0b0c0e; color: #fff; animation: fade-in 0.18s ease; }
.viewer-top { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.viewer-title { flex: 1; min-width: 0; text-align: center; }
.viewer-title b { display: block; overflow: hidden; font-size: 15.5px; text-overflow: ellipsis; white-space: nowrap; }
.viewer-title span { color: rgba(255, 255, 255, 0.6); font-size: 13px; }
.viewer-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: pan-y; }
.viewer-frame { position: absolute; }
.viewer-frame.is-editable { cursor: crosshair; }
.viewer-frame img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.viewer-loading { position: absolute; inset: 0; display: grid; place-items: center; }
.viewer-nav {
  position: absolute; top: 50%; display: grid; place-items: center; width: 40px; height: 40px; margin-top: -20px;
  border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.45); color: #fff;
}
.viewer-nav.prev { left: 8px; }
.viewer-nav.next { right: 8px; }
.marker {
  position: absolute; width: 48px; height: 48px; margin: -24px 0 0 -24px; border: 3.5px solid #ff3b30; border-radius: 50%;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.9), inset 0 0 0 1.5px rgba(255, 255, 255, 0.7);
  pointer-events: none; animation: marker-in 0.18s ease-out;
}
@keyframes marker-in { from { transform: scale(1.6); opacity: 0; } to { transform: none; opacity: 1; } }
.viewer-bottom { display: grid; gap: 10px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px)); background: #15171a; }
.viewer-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: rgba(255, 255, 255, 0.72); font-size: 13px; }
.viewer-meta span { display: inline-flex; align-items: center; gap: 5px; }
.viewer-warn { color: #ffb547; font-weight: 600; }
.viewer-hint { margin: 0; color: rgba(255, 255, 255, 0.78); font-size: 14px; line-height: 1.4; }
.violation-toggle {
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; min-height: 52px; padding: 8px 16px;
  border: 2px solid #ff5a4f; border-radius: 14px; background: transparent; color: #ff7a70; font-size: 16px; font-weight: 700;
}
.violation-toggle.on { border-color: #e5392e; background: #e5392e; color: #fff; }
.violation-toggle small { width: 100%; margin-top: -4px; font-size: 12px; font-weight: 500; opacity: 0.85; }
.viewer-badge { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 13px; font-weight: 650; }
.viewer-badge.bad { background: rgba(229, 57, 46, 0.2); color: #ff8a80; }
.viewer-badge.ok { background: rgba(63, 196, 124, 0.16); color: #7fe0a8; }

/* ---------- Нижние панели ---------- */
.sheet-backdrop { z-index: 50; display: flex; flex-direction: column; justify-content: flex-end; background: rgba(8, 10, 12, 0.45); animation: fade-in 0.2s ease; }
.sheet {
  display: flex; flex-direction: column; width: 100%; max-height: 90%; border-radius: 20px 20px 0 0;
  background: var(--card); color: var(--text); animation: sheet-in 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet-grip { width: 38px; height: 5px; margin: 8px auto 0; border-radius: 3px; background: var(--fill-strong); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 16px 4px; }
.sheet-head h2 { margin: 0; font-size: 20px; font-weight: 750; letter-spacing: -0.01em; }
.sheet-body { overflow-y: auto; padding: 6px 16px 16px; }
.sheet-footer { padding: 10px 16px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--sep); }
.sheet-text { margin: 4px 0 12px; font-size: 15px; }
.sheet-text.hint { display: flex; gap: 7px; margin: 14px 0 0; color: var(--hint); font-size: 13.5px; line-height: 1.45; }
.sheet-text.hint .icon { flex: none; margin-top: 2px; }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.field-label { display: block; margin: 14px 0 7px; color: var(--hint); font-size: 13.5px; font-weight: 600; }
.field-hint { margin: 7px 2px 0; color: var(--hint); font-size: 13px; line-height: 1.4; }
.form-error { margin: 10px 0 0; color: var(--bad); font-size: 14px; font-weight: 600; }

.problem-list, .summary-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.problem-list button {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 12px; border: 0; border-radius: 13px;
  background: var(--fill); text-align: left;
}
.problem-list button > span:nth-child(2) { flex: 1; display: grid; }
.problem-list small { color: var(--warn); font-size: 13.5px; }
.problem-list .icon { color: var(--hint); }
.summary-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--fill); }
.summary-name { flex: 1; min-width: 0; font-weight: 600; }
.summary-state { font-size: 13.5px; font-weight: 650; text-align: right; }
.summary-list li.ok .summary-state { color: var(--ok); }
.summary-list li.bad .summary-state { color: var(--bad); }
.remark-preview { padding: 10px 12px; border-radius: 12px; background: var(--warn-soft); font-size: 14px; }
.remark-preview b { color: var(--warn); }
.remark-preview ul { margin: 6px 0 0; padding-left: 18px; }

.choice-list { display: grid; gap: 8px; }
.choice { display: flex; align-items: center; gap: 12px; padding: 12px; border: 0; border-radius: 14px; background: var(--fill); text-align: left; }
.choice > span:last-child { display: grid; gap: 2px; }
.choice small { color: var(--hint); font-size: 13px; line-height: 1.35; }

/* ---------- Уведомления внутри приложения ---------- */
.toasts { position: fixed; left: 12px; right: 12px; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); z-index: 70; display: grid; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px;
  background: rgba(24, 28, 33, 0.94); color: #fff; font-size: 14.5px; line-height: 1.35;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.45); pointer-events: auto; animation: toast-in 0.22s ease;
}
.toast-ok .icon { color: #5fd694; }
.toast-bad .icon { color: #ff8a80; }
.toast-action { margin-left: auto; padding: 4px 8px; border: 0; background: none; color: #8cc4ff; font-weight: 650; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Списки и статистика ---------- */
.filters { display: flex; gap: 8px; margin: 0 -16px 4px; padding: 2px 16px 8px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter { flex: none; padding: 8px 14px; border: 0; border-radius: 999px; background: var(--card); color: var(--text); font-size: 14px; font-weight: 600; box-shadow: var(--shadow); }
.filter.on { background: var(--accent); color: var(--accent-text); }

.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.month-nav b { font-size: 17px; }
.stat-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.stat-tile { display: grid; gap: 2px; padding: 12px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); }
.stat-tile b { font-size: 24px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat-tile span { color: var(--hint); font-size: 12.5px; line-height: 1.3; }
.stat-tile.ok b { color: var(--ok); }
.stat-tile.bad b { color: var(--bad); }

.cal-card { padding: 12px 10px 12px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { padding-bottom: 4px; color: var(--hint); font-size: 11.5px; font-weight: 600; text-align: center; }
.cal-cell {
  position: relative; display: grid; align-content: space-between; justify-items: center; gap: 3px;
  min-height: 48px; padding: 6px 2px 7px; border: 0; border-radius: 10px; background: var(--fill); color: var(--text);
}
.cal-cell.blank { background: none; }
.cal-cell.off { background: transparent; color: var(--hint); }
.cal-cell.future { opacity: 0.45; }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-cell.ok { background: var(--ok-soft); }
.cal-cell.bad { background: var(--bad-soft); }
.cal-cell.pending { background-image: repeating-linear-gradient(135deg, transparent 0 5px, var(--fill) 5px 9px); }
.cal-num { font-size: 13.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.cal-dots { display: flex; gap: 2px; }
.cal-dots i { width: 5px; height: 5px; border-radius: 1.5px; background: var(--fill-strong); }
.cal-dots i.s-clean { background: var(--ok); }
.cal-dots i.s-violation { background: var(--bad); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 12px 4px 0; color: var(--hint); font-size: 12.5px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 4px; }
.lg.ok { background: var(--ok); }
.lg.bad { background: var(--bad); }
.lg.pending { background: repeating-linear-gradient(135deg, var(--fill-strong) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px var(--fill-strong); }
.lg.off { box-shadow: inset 0 0 0 1px var(--fill-strong); }
.cal-help { margin: 8px 4px 0; color: var(--hint); font-size: 12.5px; }

/* ---------- Администрирование ---------- */
.invite { display: flex; gap: 12px; padding: 14px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.invite-icon { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 13px; background: var(--fill); color: var(--accent); }
.invite-text { min-width: 0; }
.invite-text p { margin: 4px 0 0; color: var(--hint); font-size: 14px; line-height: 1.45; }
.invite-link { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 8px; }
.invite-link code { padding: 3px 8px; border-radius: 8px; background: var(--fill); font-size: 13.5px; }

.request { position: relative; display: grid; gap: 10px; padding: 13px 14px; }
.request-who { display: flex; align-items: center; gap: 11px; }
.request-who div { display: grid; }
.request-who small { color: var(--hint); font-size: 13px; }
.request-roles { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { padding: 8px 12px; border: 0; border-radius: 999px; background: var(--fill); color: var(--accent); font-size: 14px; font-weight: 650; }
.pill-bad { color: var(--bad); }
.pill:disabled { opacity: 0.5; }

.radio-list { display: grid; gap: 8px; }
.radio { display: flex; align-items: flex-start; gap: 11px; padding: 11px 12px; border-radius: 13px; background: var(--fill); cursor: pointer; }
.radio.on { box-shadow: inset 0 0 0 2px var(--accent); }
.radio.disabled { opacity: 0.45; cursor: default; }
.radio input { flex: none; width: 19px; height: 19px; margin: 2px 0 0; accent-color: var(--accent); }
.radio span { display: grid; gap: 2px; }
.radio small { color: var(--hint); font-size: 13px; line-height: 1.35; }
.block-link { margin-top: 16px; }

.zone-row { position: relative; display: flex; align-items: center; gap: 11px; padding: 10px 10px 10px 14px; }
.zone-row + .zone-row::before { content: ""; position: absolute; top: 0; left: 53px; right: 0; border-top: 1px solid var(--sep); }
.zone-row-main { flex: 1; min-width: 0; display: grid; gap: 2px; padding: 2px 0; border: 0; background: none; text-align: left; }
.zone-row-main b { font-size: 16px; font-weight: 600; }
.zone-row-main small { color: var(--hint); font-size: 13px; }
.zone-row-order { display: flex; gap: 4px; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; padding: 12px; border-radius: 13px; background: var(--fill); cursor: pointer; }
.switch-row span { display: grid; gap: 2px; }
.switch-row small { color: var(--hint); font-size: 13px; }
.switch { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 50px; height: 30px; margin: 0; border-radius: 999px; background: var(--fill-strong); transition: background-color 0.2s; cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.2s; }
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(20px); }

.setting { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 14px; }
.setting + .setting::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; border-top: 1px solid var(--sep); }
.setting.column { flex-direction: column; align-items: stretch; }
.setting > div:first-child { display: grid; gap: 2px; min-width: 0; }
.setting small { color: var(--hint); font-size: 13px; line-height: 1.35; }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper b { min-width: 18px; font-size: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.input.time { width: auto; min-width: 104px; text-align: center; font-variant-numeric: tabular-nums; }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.day { min-height: 40px; border: 0; border-radius: 11px; background: var(--fill); color: var(--hint); font-size: 14px; font-weight: 650; }
.day.on { background: var(--accent); color: var(--accent-text); }
.export { display: grid; gap: 12px; padding: 14px; }
.export p { margin: 0; color: var(--hint); font-size: 14px; line-height: 1.45; }
.export-row { display: flex; gap: 8px; }
.export-row .input { flex: 1; min-width: 0; }

.invite-box { margin-top: 16px; padding: 12px; border-radius: 13px; background: var(--fill); }
.invite-box .field-label { margin-top: 0; }
.invite-box .btn-row { margin-top: 10px; }
.invite-box .btn { min-height: 44px; font-size: 15px; }
.invite-state { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 14.5px; font-weight: 600; }
.invite-state.ok { color: var(--ok); }
.invite-state.warn { color: var(--warn); }
.invite-code { display: block; margin-top: 8px; padding: 9px 11px; border-radius: 10px; background: var(--card); font-size: 13px; overflow-wrap: anywhere; }
a.btn { text-decoration: none; }
.dev-switch {
  position: fixed; right: 10px; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); z-index: 80;
  padding: 7px 11px; border: 0; border-radius: 999px; background: rgba(24, 28, 33, 0.85); color: #fff; font-size: 12.5px; font-weight: 600;
}

/* ---------- Камера ---------- */
.camera { z-index: 45; display: flex; flex-direction: column; background: #000; color: #fff; }
.camera-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.camera-flash { position: absolute; inset: 0; background: #fff; opacity: 0.75; animation: fade-out 0.16s ease-out forwards; pointer-events: none; }
@keyframes fade-out { to { opacity: 0; } }
.camera-top, .camera-bottom, .camera-geo { position: relative; z-index: 1; }
.camera-top { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: linear-gradient(rgba(0, 0, 0, 0.55), transparent); }
.camera-title { flex: 1; min-width: 0; text-align: center; }
.camera-title b { display: block; overflow: hidden; font-size: 15.5px; text-overflow: ellipsis; white-space: nowrap; }
.camera-title span { color: rgba(255, 255, 255, 0.75); font-size: 13px; }
.icon-btn.light.on { background: #ffd60a; color: #000; }
.camera-geo {
  display: flex; align-items: center; gap: 6px; align-self: center; max-width: calc(100% - 24px); margin-top: 2px; padding: 6px 11px;
  border-radius: 999px; background: rgba(0, 0, 0, 0.55); font-size: 12.5px; font-weight: 600;
}
.camera-geo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.camera-geo.ok { color: #7fe0a8; }
.camera-geo.wait { color: #ffd27a; }
.camera-geo.bad { color: #ff9a92; }
.camera-geo button { flex: none; padding: 3px 8px; border: 0; border-radius: 999px; background: #fff; color: #000; font-size: 12px; font-weight: 700; }
.camera-center { position: relative; z-index: 1; flex: 1; display: grid; place-items: center; align-content: center; gap: 12px; padding: 24px; text-align: center; }
.camera-error p { max-width: 32ch; margin: 0; font-size: 15px; line-height: 1.45; }
.camera-error .hint { color: rgba(255, 255, 255, 0.7); font-size: 13.5px; }
.camera-error label.btn { cursor: pointer; }
.btn.is-disabled { opacity: 0.5; pointer-events: none; }
.camera-bottom {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-top: auto;
  padding: 18px 20px calc(22px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
}
.camera-last { width: 52px; height: 52px; overflow: hidden; border-radius: 12px; }
.camera-last img { width: 100%; height: 100%; object-fit: cover; border: 2px solid #fff; border-radius: 12px; }
.shutter { display: grid; place-items: center; width: 76px; height: 76px; padding: 0; border: 4px solid #fff; border-radius: 50%; background: transparent; }
.shutter span { width: 60px; height: 60px; border-radius: 50%; background: #fff; transition: transform 0.1s; }
.shutter:active:not(:disabled) span { transform: scale(0.88); }
.shutter:disabled { opacity: 0.45; }
.camera-done { justify-self: end; padding: 10px 14px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 15px; font-weight: 700; }

/* ---------- Подсказки ИИ ---------- */
.tile.is-ai { box-shadow: 0 0 0 2.5px var(--warn); }
.tile-ai {
  position: absolute; bottom: 5px; right: 5px; display: grid; place-items: center; min-width: 24px; height: 18px; padding: 0 5px;
  border-radius: 6px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.02em; color: #fff;
}
.tile-ai.warn { background: var(--warn); }
.tile-ai.bad { background: var(--bad); }
.tile-ai.busy { background: rgba(0, 0, 0, 0.55); }
.tile-ai .spinner-xs { width: 11px; height: 11px; border-width: 2px; border-color: rgba(255, 255, 255, 0.35); border-top-color: #fff; }
.zone-hint.ai { color: var(--hint); }
.ai-box {
  position: absolute; border: 2px dashed #ffcc00; border-radius: 6px; background: rgba(255, 204, 0, 0.1); pointer-events: none;
}
.ai-box small {
  position: absolute; left: -2px; top: -20px; max-width: 160px; overflow: hidden; padding: 1px 6px; border-radius: 5px;
  background: #ffcc00; color: #000; font-size: 11px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis;
}
.ai-panel { display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.08); font-size: 14px; line-height: 1.35; }
.ai-panel.warn { background: rgba(255, 181, 71, 0.16); color: #ffd27a; }
.ai-panel.ok { color: #9fe6bd; }
.ai-panel.muted { color: rgba(255, 255, 255, 0.6); }
.ai-panel:not(.warn):not(.ok):not(.muted) { display: flex; align-items: center; gap: 8px; color: rgba(255, 255, 255, 0.8); }
.ai-line { display: flex; gap: 7px; }
.ai-line .icon { flex: none; margin-top: 1px; }
.link-btn.light { justify-self: start; color: #8cc4ff; }
.geo-link { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: none; color: #8cc4ff; font-size: 13px; text-align: left; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
