/* I-CTRL, приложение механика. Экраны: заставка -> вход -> главный (пока заглушка).
   Светлый сиреневый фон, фирменный фиолетовый #4E3392, шрифт Montserrat. */
:root {
  --brand: #4E3392;
  --bg: #F5F3FA;
  --ink: #4E3392;
  --muted: #8A82A6;
  --track: #E2DDEF;
  --shadow: rgba(78, 51, 146, .30);
  --surface: #FFFFFF;
  --line: #DCD6EA;
  --text: #2A2340;
  --btn: #4E3392;
  --btn-press: #3E2878;
  --danger: #C8332F;
  --warn: #B26A00;
  --warn-bg: #FFF1D6;
  --ok: #1E8A3A;
  --ok-bg: #DFF5E4;
  --danger-bg: #FDE3E2;
  --tint: #ECE7F8;
  --viewer-bg: #0E0B1A;
  --pic-bg: #F4F4F4;
  --go: #1E8A3A;
  --stop: #C8332F;
  --font: "Montserrat", "Proxima Nova", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17132A; --ink: #CDBFF7; --muted: #8C84AA; --track: #2D2649; --shadow: rgba(0, 0, 0, .55);
    --surface: #221C3B; --line: #3B3361; --text: #EAE5FA; --btn: #6A4FCB; --btn-press: #5A40B8; --danger: #FF8B86; --go: #2E9E4F; --stop: #D9443F;
    --warn: #FFC266; --warn-bg: #3D2E12; --ok: #6EDB8A; --ok-bg: #173A22; --danger-bg: #42191C; --tint: #2C2450;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17132A; --ink: #CDBFF7; --muted: #8C84AA; --track: #2D2649; --shadow: rgba(0, 0, 0, .55);
  --surface: #221C3B; --line: #3B3361; --text: #EAE5FA; --btn: #6A4FCB; --btn-press: #5A40B8; --danger: #FF8B86; --go: #2E9E4F; --stop: #D9443F;
  --warn: #FFC266; --warn-bg: #3D2E12; --ok: #6EDB8A; --ok-bg: #173A22; --danger-bg: #42191C; --tint: #2C2450;
  color-scheme: dark;
}
html, body { height: 100%; margin: 0; background: var(--bg); }
[hidden] { display: none !important; }
/* пока картинки и шрифт не загрузились, логотип и подпись скрыты, чтобы анимация не прошла впустую */
.wait .center, .wait .bar i { visibility: hidden; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
}
.splash {
  position: fixed;
  inset: 0;
  user-select: none;
  display: grid;
  grid-template-rows: 1fr auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: calc(24px + env(safe-area-inset-top, 0px)) calc(28px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}
.center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
}
/* Логотип собран из трёх частей оригинала «Флажок лого» (264×440): фон, надпись, щит */
.tag {
  position: relative;
  width: clamp(108px, 32vw, 140px);
}
.tag img { display: block; width: 100%; height: auto; }
/* тень только у фона флажка: тень на всём блоке с падающими частями ломает отрисовку на части телефонов */
.l-base { filter: drop-shadow(0 14px 22px var(--shadow)); }
.tag .layer { position: absolute; will-change: transform; }
.l-text   { left: 17.803%; top: 80.682%; width: 64.773% !important; }
.l-shield { left: 23.864%; top: 36.136%; width: 52.652% !important; }
.title {
  margin: 0;
  font-size: clamp(18px, 5.2vw, 22px);
  font-weight: 700;
  letter-spacing: .01em;
  text-align: center;
  text-wrap: balance;
}
.titles { display: flex; flex-direction: column; align-items: center; gap: 8px; }
/* слоган: крупнее и шире строки «Инспекционный контроль», подогнан под ширину телефона */
.subtitle {
  margin: 0;
  font-size: clamp(20px, 6.6vw, 30px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
  white-space: nowrap;
  text-align: center;
}
.bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.bar {
  width: min(180px, 50vw);
  height: 3px;
  border-radius: 3px;
  background: var(--track);
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--brand);
  transform-origin: 0 50%;
}
:root[data-theme="dark"] .bar i { background: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bar i { background: var(--ink); } }
.company { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .04em; }
.ver { font-size: 11px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }

/* --- анимация, общая длительность ~1,8 с:
       фон флажка 0-0,3 с, надпись I-CTRL 0,3-0,8 с, щит 0,7-1,2 с, подпись 1,2-1,6 с --- */
.run .l-base   { animation: appear 300ms ease-out both; }
.run .l-text   { animation: fall 480ms cubic-bezier(.3, .8, .35, 1) 300ms both; }
.run .l-shield { animation: fall 520ms cubic-bezier(.3, .8, .35, 1) 700ms both; }
.run .title    { animation: rise 400ms ease-out 1200ms both; }
.run .subtitle { animation: rise 400ms ease-out 1350ms both; }
.run .bar i    { animation: load 1700ms cubic-bezier(.4, 0, .2, 1) 100ms both; }

@keyframes appear { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes fall {
  0%   { transform: translate3d(0, -100vh, 0); }
  70%  { transform: translate3d(0, 5px, 0); }
  85%  { transform: translate3d(0, -2px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes load { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes fade { to { opacity: 1; } }

/* Заставка проигрывается всегда, даже если в системе выключены анимации:
   она короткая (1,8 с) и это часть фирменного стиля. */

/* уход заставки: подписи и полоса гаснут, флажок «переезжает» на экран входа */
.splash.leaving .titles, .splash.leaving .bar, .splash.leaving .sp-next { opacity: 0; transition: opacity 200ms ease; }
/* кнопка «Далее»: появляется вместо полосы загрузки, пока не нажата — заставка стоит */
.sp-next { width: min(280px, 72vw); margin: 0 0 6px; }
.sp-next[hidden] { display: none; }
.splash.ready .bar { display: none; }
.splash.ready .sp-next { animation: rise 380ms ease-out both; }

/* ---------- общие для экранов входа и главного ---------- */
.screen {
  min-height: 100%;
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  max-width: 440px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: calc(28px + env(safe-area-inset-top, 0px)) calc(28px + env(safe-area-inset-bottom, 0px));
}
.brand { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 4vh; }
.brand .logo { width: 64px; height: auto; display: block; filter: drop-shadow(0 8px 14px var(--shadow)); }
.brand .name { margin: 0; font-size: 17px; font-weight: 700; color: var(--ink); text-align: center; }
.foot { display: flex; flex-direction: column; align-items: center; gap: 10px; }

/* ---------- вход ---------- */
.form { align-self: center; display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.input {
  position: relative;
}
.input input {
  box-sizing: border-box;
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: 500 16px/1 var(--font);   /* 16px: iPhone не увеличивает экран при вводе */
  outline: none;
  transition: border-color 150ms, box-shadow 150ms;
}
.input input:focus { border-color: var(--btn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--btn) 22%, transparent); }
.input input[aria-invalid="true"] { border-color: var(--danger); }
.input.has-eye input { padding-right: 52px; }
.eye {
  position: absolute; right: 4px; top: 4px;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 0; border-radius: 10px; background: transparent;
  color: var(--muted); cursor: pointer;
}
.eye:focus-visible { outline: 2px solid var(--btn); outline-offset: -2px; }
.eye svg { width: 22px; height: 22px; }
.btn {
  height: 52px;
  border: 0; border-radius: 12px;
  background: var(--btn); color: #FFFFFF;
  font: 600 16px/1 var(--font);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 4px;
}
.btn:active { background: var(--btn-press); }
.btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--btn) 40%, transparent); outline-offset: 2px; }
.btn[disabled] { opacity: .75; cursor: default; }
.btn .spin {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #FFFFFF;
  animation: spin 700ms linear infinite;
}
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:active { background: var(--surface); }
@keyframes spin { to { transform: rotate(360deg); } }
.err { min-height: 20px; margin: 0; font-size: 14px; font-weight: 600; color: var(--danger); text-align: center; text-wrap: balance; }
.shake { animation: shake 320ms ease; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.demo {
  margin: 4px 0 0; padding: 10px 12px;
  border: 1px dashed var(--line); border-radius: 10px;
  font-size: 12px; line-height: 1.45; color: var(--muted); text-align: center;
}
.demo b { color: var(--ink); font-weight: 600; }
.demo button { font: inherit; color: var(--ink); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }


/* ================= ПРИЛОЖЕНИЕ: верхняя полоска, вкладки ================= */
.app { min-height: 100%; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .mini { width: 22px; height: auto; display: block; }
.topbar .who { flex: 1; min-width: 0; display: grid; }
.topbar .who b { font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .who span { font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border: 0; border-radius: 10px; background: transparent; color: var(--ink); cursor: pointer;
}
.icon-btn:active { background: var(--tint); }
.icon-btn svg { width: 22px; height: 22px; }
.menu {
  position: absolute; right: max(12px, env(safe-area-inset-right, 0px)); top: calc(56px + env(safe-area-inset-top, 0px));
  min-width: 200px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 30px var(--shadow);
}
.menu button {
  width: 100%; text-align: left; padding: 12px; border: 0; border-radius: 8px;
  background: none; color: var(--text); font: 500 15px var(--font); cursor: pointer;
}
.menu button:active { background: var(--tint); }

.panel {
  flex: 1;
  width: 100%; max-width: 560px; margin: 0 auto; box-sizing: border-box;
  padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(96px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr 1fr;
  padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
  background: var(--surface); border-top: 1px solid var(--line);
}
.tab {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 4px; border: 0; border-radius: 12px; background: none;
  color: var(--muted); font: 600 12px var(--font); cursor: pointer;
}
.tab svg { width: 24px; height: 24px; }
.tab[aria-selected="true"] { color: var(--ink); background: var(--tint); }
.badge {
  position: absolute; top: 4px; left: calc(50% + 8px);
  min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
  border-radius: 9px; background: var(--danger); color: #FFFFFF;
  font: 700 11px/18px var(--font); text-align: center;
}

/* ================= НОВЫЙ ОСМОТР ================= */
.head { display: grid; gap: 10px; margin-bottom: 18px; }
.head h2 { margin: 0; font-size: 22px; font-weight: 700; color: var(--text); }
.steps { display: grid; gap: 6px; }
.steps .lbl { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.steps .seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.steps .seg i { height: 4px; border-radius: 2px; background: var(--track); }
.steps .seg i.on { background: var(--btn); }

.group { display: grid; gap: 8px; margin-bottom: 22px; }
.group > .glabel { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.group.bad > .glabel { color: var(--danger); }
.gerr { margin: 0; font-size: 13px; font-weight: 600; color: var(--danger); }
.ghint { margin: 0; font-size: 13px; color: var(--muted); }

.picker {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 56px; padding: 10px 14px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  color: var(--text); font: 500 16px var(--font); text-align: left; cursor: pointer;
}
.group.bad .picker, .group.bad .input input { border-color: var(--danger); }
.picker .ph { color: var(--muted); flex: 1; }
.picker .val { flex: 1; min-width: 0; display: grid; gap: 2px; }
.picker .val b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker .val span { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.picker svg { width: 20px; height: 20px; color: var(--muted); flex: none; }

.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cat {
  position: relative;
  display: grid; justify-items: center; align-content: center; gap: 8px;
  min-height: 104px; padding: 12px 8px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  color: var(--text); font: 600 14px var(--font); cursor: pointer;
}
.cat img { height: 40px; width: auto; }
.cat[aria-checked="true"] { border: 2px solid var(--btn); padding: 11px 7px; background: var(--tint); color: var(--ink); }
.group.bad .cat { border-color: var(--danger); }

.seg-ctl { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; gap: 4px; border-radius: 12px; background: var(--track); }
.seg-ctl button {
  height: 40px; border: 0; border-radius: 9px; background: transparent;
  color: var(--muted); font: 600 14px var(--font); cursor: pointer;
}
.seg-ctl button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px var(--shadow); }
.plate input { font-size: 22px; font-weight: 700; letter-spacing: .08em; height: 58px; font-variant-numeric: tabular-nums; }
.input input::placeholder { color: var(--muted); opacity: .55; font-weight: 500; }
.plate .ok-mark { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ok); }
.plate .ok-mark svg { width: 22px; height: 22px; display: block; }
.suffix { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.mileage input { padding-right: 48px; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }

.known {
  display: grid; gap: 10px; padding: 12px 14px;
  border-radius: 12px; background: var(--tint); color: var(--text);
}
.known p { margin: 0; font-size: 14px; line-height: 1.45; }
.known p b { color: var(--ink); }
.known .row { display: flex; gap: 8px; }
.btn.sm { height: 40px; padding: 0 16px; font-size: 14px; margin: 0; }

.next-wrap { padding-top: 4px; }
.next-wrap .btn { width: 100%; box-shadow: 0 8px 20px var(--shadow); }

/* ================= ВЫБОР ПОКУПАТЕЛЯ (лист поверх экрана) ================= */
.sheet {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column;
  background: var(--bg);
}
.sheet-head {
  display: flex; align-items: center; gap: 6px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) max(8px, env(safe-area-inset-right, 0px)) 8px max(8px, env(safe-area-inset-left, 0px));
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.sheet-head h3 { margin: 0; font-size: 17px; font-weight: 700; color: var(--text); }
.sheet-search { padding: 12px max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px)); }
.sheet-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px));
}
.sheet-foot {
  padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  border-top: 1px solid var(--line); background: var(--surface);
}
.sheet-foot .btn { width: 100%; margin: 0; }
.list-cap { margin: 14px 0 6px; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
.list { display: grid; }
.item {
  display: grid; gap: 2px; padding: 12px 4px; width: 100%;
  border: 0; border-bottom: 1px solid var(--line); background: none;
  text-align: left; cursor: pointer; font-family: var(--font);
}
.item:active { background: var(--tint); }
.item b { font-size: 15px; font-weight: 600; color: var(--text); }
.item span { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.item mark { background: color-mix(in srgb, var(--btn) 18%, transparent); color: inherit; border-radius: 3px; }
.empty { padding: 28px 8px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.5; }
.empty.bad { color: var(--danger); }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--text); cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--btn); }
.manual { display: grid; gap: 16px; padding-top: 16px; }

/* ================= ПРОВЕДЁННЫЕ ================= */
.day { margin: 18px 0 6px; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
.insp {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center;
  width: 100%; padding: 12px; margin-bottom: 8px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  text-align: left; font-family: var(--font); cursor: pointer;
}
.insp:active { background: var(--tint); }
.insp .ico { width: 44px; height: 44px; border-radius: 50%; background: var(--tint); display: grid; place-items: center; }
.insp .ico img { width: 30px; height: auto; }
.insp .main { min-width: 0; display: grid; gap: 3px; }
.insp .plate-txt { font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.insp .sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.insp .side { display: grid; justify-items: end; gap: 6px; }
.chips { display: flex; gap: 4px; }
.chip { min-width: 22px; height: 22px; padding: 0 6px; box-sizing: border-box; border-radius: 11px; font: 700 12px/22px var(--font); text-align: center; }
.chip.crit { background: var(--danger-bg); color: var(--danger); }
.chip.att { background: var(--warn-bg); color: var(--warn); }
.pill { padding: 3px 8px; border-radius: 8px; font: 600 11px var(--font); white-space: nowrap; }
.pill.draft { background: var(--track); color: var(--muted); }
.pill.wait { background: var(--warn-bg); color: var(--warn); }
.pill.sent { background: var(--ok-bg); color: var(--ok); }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  transform: translateX(-50%);
  max-width: min(92vw, 420px); padding: 12px 16px; box-sizing: border-box;
  border-radius: 12px; background: var(--text); color: var(--bg);
  font: 500 14px/1.4 var(--font); text-align: center;
  box-shadow: 0 10px 30px var(--shadow);
}

/* ================= ШАГ 2: ФОТО ================= */
.ctx { display: flex; align-items: center; gap: 6px; margin: -4px 0 10px -8px; }
.ctx-t { min-width: 0; display: grid; }
.ctx-t b { font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.ctx-t span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 18px; }
.shot {
  position: relative; overflow: hidden;
  aspect-ratio: 4 / 3; max-width: 100%;
  display: grid; place-items: center; align-content: center; gap: 6px;
  padding: 0; border: 1px dashed var(--line); border-radius: 14px; background: var(--surface);
  color: var(--text); font-family: var(--font); cursor: pointer;
}
.shot .cam { width: 44px; height: 44px; border-radius: 50%; background: var(--tint); color: var(--ink); display: grid; place-items: center; }
.shot .cam svg { width: 24px; height: 24px; }
.shot .nm { font-size: 15px; font-weight: 700; }
.shot .tip { font-size: 12px; color: var(--muted); }
.shot.next { border: 2px solid var(--btn); background: var(--tint); }
.shot.next .tip { color: var(--ink); font-weight: 600; }
.shot.bad { border: 2px solid var(--danger); }
.shot.has { border: 0; display: block; }
.shot.has img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shot.vert { background: rgba(128, 126, 140, .14); }
.shot.vert img { object-fit: contain; }
.shot .vbadge { position: absolute; top: 36px; left: 8px; padding: 3px 8px; border-radius: 9px; background: var(--warn); color: #FFFFFF; font-size: 11px; font-weight: 700; }
.rot-hint { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--tint); color: var(--ink); }
.rot-hint svg { width: 44px; height: 30px; flex: none; }
.rot-hint div { display: grid; gap: 2px; }
.rot-hint b { font-size: 15px; font-weight: 700; color: var(--text); }
.rot-hint span { font-size: 13px; color: var(--muted); }
#shots-vert { display: grid; gap: 8px; margin: -8px 0 16px; }
#shots-vert:empty { display: none; }
.vnote { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--warn-bg); }
.vnote .tx { flex: 1; display: grid; gap: 2px; }
.vnote b { font-size: 14px; color: var(--warn); }
.vnote span { font-size: 12.5px; color: var(--text); }
.vnote .btn { flex: none; margin: 0; }
.shot .over {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 22px 10px 8px;
  background: linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,0));
  color: #FFFFFF; font-size: 15px; font-weight: 700; text-align: left;
}
.shot .st {
  position: absolute; top: 8px; left: 8px;
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 9px;
  color: #FFFFFF; font-size: 11px; font-weight: 700;
}
.shot .st svg { width: 12px; height: 12px; }
.st.up { background: rgba(30, 138, 58, .92); }
.st.wait { background: rgba(178, 106, 0, .94); }
.st.going { background: rgba(78, 51, 146, .94); }
.link-danger {
  display: block; margin: 18px auto 0; padding: 10px 14px;
  border: 0; background: none; color: var(--danger); font: 600 14px var(--font); cursor: pointer;
}

.viewer { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: var(--viewer-bg); }
.viewer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(8px + env(safe-area-inset-top, 0px)) max(8px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px));
}
.viewer-head h3 { margin: 0; color: #FFFFFF; font-size: 17px; font-weight: 700; }
.viewer-head .icon-btn { color: #FFFFFF; }
.viewer img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
.viewer-foot {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.viewer-foot .btn { margin: 0; }
.viewer-foot .btn.ghost { color: #FFFFFF; border-color: rgba(255,255,255,.35); }

/* ошибка отправки на сервер */
.sync-err {
  margin: 0 0 12px; padding: 10px 12px; border-radius: 10px;
  background: var(--danger-bg); color: var(--danger); font-size: 13px; font-weight: 600; line-height: 1.4;
}
.st.err { background: rgba(200, 51, 47, .94); }

/* ================= ШАГ 3: КОЛЁСА ================= */
.wstate {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px;
  padding: 12px 16px; margin-bottom: 14px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
}
.wstate-l { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.wstate b { grid-row: span 2; font-size: 34px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.wstate-n { font-size: 12px; color: var(--muted); }
.wscheme { display: grid; grid-template-columns: minmax(0, 1fr) minmax(72px, 24%) minmax(0, 1fr); gap: 8px; align-items: center; margin-bottom: 8px; }
.wlegend { margin: 0 0 16px; text-align: center; font-size: 12px; }
.wcol { display: grid; gap: 8px; min-width: 0; }
.wpic { border-radius: 14px; background: var(--pic-bg); overflow: hidden; }
.wpic img { display: block; width: 100%; height: auto; }
.wh {
  display: grid; gap: 3px; width: 100%; min-width: 0; padding: 8px 8px 8px 10px; box-sizing: border-box;
  border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 12px;
  background: var(--surface); text-align: left; font-family: var(--font); cursor: pointer;
}
.wh:active { background: var(--tint); }
.wh-h { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text); }
.wh-h img { width: 18px; height: 18px; flex: none; }
.wh-r { display: flex; justify-content: space-between; gap: 4px; font-size: 12px; color: var(--muted); }
.wh-r b { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wh-r b.ok { color: var(--ok); } .wh-r b.att { color: var(--warn); } .wh-r b.crit { color: var(--danger); }
.wh-r b.na { color: var(--muted); font-weight: 500; }
.wh.empty { border-style: dashed; border-left-style: dashed; }
.wh.empty .wh-e { font-size: 12px; font-weight: 600; color: var(--ink); }
.wh.next { border-color: var(--btn); border-left-color: var(--btn); background: var(--tint); border-style: solid; }
.wh.s-ok { border-left-color: var(--ok); } .wh.s-att { border-left-color: var(--warn); } .wh.s-crit { border-left-color: var(--danger); }
.wh.bad { border-color: var(--danger); }

.wsheet { position: fixed; inset: 0; z-index: 45; }
.wsheet-bg { position: absolute; inset: 0; background: rgba(14, 11, 26, .45); }
.wsheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: 560px; margin: 0 auto;
  display: grid; gap: 12px;
  padding: 14px max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: var(--bg); border-radius: 18px 18px 0 0; box-shadow: 0 -10px 30px var(--shadow);
}
.ws-head { display: flex; align-items: flex-start; justify-content: space-between; }
.ws-head h3 { margin: 0; font-size: 18px; font-weight: 700; color: var(--text); }
.ws-head span { font-size: 12px; color: var(--muted); }
.ws-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ws-f { display: grid; gap: 6px; align-content: start; }
.ws-f > label:first-child { font-size: 13px; font-weight: 600; color: var(--muted); }
.ws-f input[type="text"] { padding-right: 34px; font-size: 20px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.ws-f .suffix { right: 10px; font-size: 13px; }
.ws-f.ok input[type="text"] { border: 2px solid var(--ok); padding-left: 13px; }
.ws-f.att input[type="text"] { border: 2px solid var(--warn); padding-left: 13px; }
.ws-f.crit input[type="text"] { border: 2px solid var(--danger); padding-left: 13px; }
.ws-f input[type="text"]:disabled { opacity: .45; }
.check.sm { font-size: 12px; gap: 6px; color: var(--muted); }
.check.sm input { width: 18px; height: 18px; }

/* ================= ШАГ 4: ЧЕК-ЛИСТ ================= */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ck-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.ck-num { font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ck-jump { min-width: 0; flex: 0 1 230px; }
.ck-jump select {
  width: 100%; height: 40px; padding: 0 10px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  color: var(--ink); font: 600 13px var(--font);
}
.ck-jump select:disabled { opacity: .5; }
.ck-prog { height: 4px; border-radius: 2px; background: var(--track); overflow: hidden; margin-bottom: 18px; }
.ck-prog i { display: block; height: 100%; width: 0; background: var(--btn); transition: width 200ms ease; }
.ck-sys { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.ck-sys img { width: 112px; height: 112px; flex: none; }
.ck-sys div { display: grid; min-width: 0; }
.ck-sys b { font-size: 22px; font-weight: 700; line-height: 1.2; color: var(--ink); text-wrap: balance; }
.ck-sys span { font-size: 15px; color: var(--muted); margin-top: 2px; }
.ck-text { margin: 0 0 18px; font-size: 21px; font-weight: 600; line-height: 1.35; color: var(--text); text-wrap: pretty; }
.ck-was { margin: -6px 0 16px; font-size: 13px; font-weight: 600; color: var(--muted); }
.ck-was b.ok { color: var(--ok); } .ck-was b.bad { color: var(--danger); }
.ck-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ck-row2 .btn { margin: 0; }
.btn.ok { background: var(--go); height: 64px; font-size: 18px; }
.btn.bad { background: var(--stop); height: 64px; font-size: 18px; }
.btn.ok:active, .btn.bad:active { filter: brightness(.9); }
.ck-small { margin-top: 12px; }
.ck-na {
  display: block; width: 100%; min-height: 48px; padding: 8px 10px; line-height: 1.25;
  border: 1px solid var(--line); border-radius: 10px; background: transparent;
  color: var(--muted); font: 600 14px var(--font); cursor: pointer;
}
.ck-defect { display: grid; gap: 8px; margin-bottom: 8px; }
.ck-defect label { font-size: 13px; font-weight: 700; color: var(--danger); }
.ck-defect textarea {
  box-sizing: border-box; width: 100%; padding: 12px 14px; resize: vertical; min-height: 110px;
  border: 2px solid var(--stop); border-radius: 12px; background: var(--surface); color: var(--text);
  font: 500 16px/1.4 var(--font); outline: none;
}
.ck-defect textarea::placeholder { color: var(--muted); opacity: .6; }
.ck-cnt { text-align: right; font-size: 12px; font-weight: 600; color: var(--muted); }
.ck-cnt .ok { color: var(--ok); }
.ck-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ck-ph {
  position: relative; aspect-ratio: 1; max-width: 100%; padding: 0; overflow: hidden;
  border: 1px dashed var(--line); border-radius: 12px; background: var(--surface);
  display: grid; place-items: center; align-content: center; gap: 4px;
  color: var(--ink); font: 600 12px var(--font); cursor: pointer;
}
.ck-ph svg { width: 24px; height: 24px; }
.ck-ph.has { border: 0; display: block; }
.ck-ph.has img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ck-ph .st { position: absolute; left: 6px; bottom: 6px; top: auto; padding: 2px 6px; font-size: 10px; }
.ck-done {
  display: grid; gap: 8px; justify-items: center; text-align: center;
  padding: 26px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
}
.ck-done b { font-size: 20px; font-weight: 700; color: var(--text); }
.ck-done span { font-size: 14px; color: var(--muted); }
.ck-done .btn { width: 100%; margin-top: 8px; }
.ck-ph .st {
  position: absolute; left: 6px; bottom: 6px;
  display: inline-flex; align-items: center; padding: 2px 6px; border-radius: 8px;
  color: #FFFFFF; font-size: 10px; font-weight: 700;
}

/* «Нет возможности осмотреть»: та же панель, жёлтая */
.ck-defect.noacc label { color: var(--warn); }
.ck-defect.noacc textarea { border-color: var(--warn); }
.ck-was b.na { color: var(--warn); }

/* ================= ШАГ 5: ИТОГ ================= */
.sm-status { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--tint); color: var(--ink); font-size: 13px; font-weight: 600; }
.sm-status.wait { background: var(--warn-bg); color: var(--warn); }
.sm-status.sent { background: var(--ok-bg); color: var(--ok); }
.sm-sec { margin-bottom: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.sm-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.sm-h h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--text); }
.sm-edit { border: 0; background: none; padding: 6px 4px; color: var(--ink); font: 600 13px var(--font); cursor: pointer; }
.sm-shots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.sm-shots figure { margin: 0; display: grid; gap: 3px; }
.sm-shots img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--track); display: block; }
.sm-shots figcaption { font-size: 11px; color: var(--muted); text-align: center; }
.sm-wheels { display: grid; gap: 6px; }
.sm-wstate { display: flex; align-items: baseline; justify-content: space-between; }
.sm-wstate span { font-size: 13px; color: var(--muted); }
.sm-wstate b { font-size: 24px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.sm-wrow { font-size: 13px; color: var(--text); line-height: 1.5; }
.sm-wrow b.ok { color: var(--ok); } .sm-wrow b.att { color: var(--warn); } .sm-wrow b.crit { color: var(--danger); }
.sm-wrow .nm { font-weight: 700; }
.sm-ok { font-size: 13px; color: var(--ok); font-weight: 600; }
.sm-item {
  display: grid; grid-template-columns: 40px 1fr; gap: 10px; width: 100%; padding: 10px 0; box-sizing: border-box;
  border: 0; border-top: 1px solid var(--line); background: none; text-align: left; font-family: var(--font); cursor: pointer;
}
.sm-item:first-child { border-top: 0; padding-top: 0; }
.sm-item img.ico { width: 40px; height: 40px; }
.sm-item .tx { display: grid; gap: 3px; min-width: 0; }
.sm-item .sy { font-size: 12px; font-weight: 700; color: var(--muted); }
.sm-item .q { font-size: 14px; font-weight: 600; color: var(--text); }
.sm-item .c { font-size: 13px; color: var(--danger); line-height: 1.4; }
.sm-item.nc .c { color: var(--warn); }
.sm-item .th { display: flex; gap: 4px; margin-top: 4px; }
.sm-item .th img { width: 52px; height: 40px; object-fit: cover; border-radius: 6px; }
.sm-absent { margin: -6px 0 18px; font-size: 13px; color: var(--muted); text-align: center; }
.sm-comment {
  box-sizing: border-box; width: 100%; padding: 12px 14px; resize: vertical;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--text);
  font: 500 15px/1.4 var(--font); outline: none;
}
.sm-comment:focus { border-color: var(--btn); }
.sm-comment[readonly] { opacity: .8; }
#sm-finish.armed { background: var(--go); }

.sm-sys { padding: 12px 0; border-top: 1px solid var(--line); }
.sm-sys:first-child { border-top: 0; padding-top: 0; }
.sm-sys-h { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.sm-sys-h .ico { width: 48px; height: 48px; flex: none; }
.sm-sys-t { display: grid; gap: 2px; min-width: 0; }
.sm-sys-t b { font-size: 16px; font-weight: 700; color: var(--ink); }
.sm-cnt { font-size: 13px; font-weight: 600; color: var(--muted); }
.sm-cnt .ok { color: var(--ok); } .sm-cnt .bad { color: var(--danger); }
.sm-item.nosys { grid-template-columns: 1fr; margin-left: 58px; width: calc(100% - 58px); padding: 8px 0; border-top: 1px dashed var(--line); }
.sm-sys .sm-item.nosys:nth-child(2) { border-top: 0; }

/* процент исправных узлов на подложке маркетолога «Подложка с круглым краем» */
.sm-sys-t { flex: 1; }
.sm-pct {
  flex: none; align-self: center;
  width: 82px; height: 44px; padding-left: 4px; box-sizing: border-box;
  display: grid; place-items: center;
  background: url("../icons/backing-round.png") right center / 100% 100% no-repeat;
  color: var(--ink); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums;
}

/* колёса в итоге: название, под ним три колонки */
.sm-wrow { padding-top: 8px; border-top: 1px solid var(--line); }
.sm-wrow .nm { display: block; margin-bottom: 4px; font-size: 14px; font-weight: 700; color: var(--text); }
.sm-wcols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sm-wcol { display: grid; gap: 1px; }
.sm-wcol span { font-size: 12px; color: var(--muted); }
.sm-wcol b { font-size: 16px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sm-wcol b.ok { color: var(--ok); } .sm-wcol b.att { color: var(--warn); } .sm-wcol b.crit { color: var(--danger); }
.sm-wcol b.na { font-size: 13px; font-weight: 600; color: var(--muted); }

/* «мм» мелко, чтобы значения влезали в карточку */
.wh-r b small { font-size: 10px; font-weight: 600; opacity: .85; }
.wh-r span { white-space: nowrap; }
.wh.ro { cursor: default; }
.wh.ro:active { background: var(--surface); }
.wstate.sm { padding: 10px 12px; margin-bottom: 12px; border: 0; background: var(--bg); }
.sm-sec .wscheme { margin-bottom: 4px; }
.sm-sec .wlegend { margin-bottom: 0; }
/* в «Итоге» блок уже из-за полей карточки: схема шире, подписи компактнее */
.sm-sec .wscheme { grid-template-columns: minmax(0, 1fr) minmax(54px, 19%) minmax(0, 1fr); gap: 6px; margin: 0 -8px 4px; }
.sm-sec .wh { padding: 7px 6px 7px 8px; overflow: hidden; }
.sm-sec .wh-r { font-size: 11px; gap: 2px; }
.sm-sec .wh-h { font-size: 12px; }
.wh { overflow: hidden; }
/* узкие телефоны: на шаге «Колёса» карточки тоже компактнее */
.wscheme { grid-template-columns: minmax(0, 1fr) minmax(54px, 19%) minmax(0, 1fr); gap: 6px; }
.wh { padding: 7px 6px 7px 8px; }
.wh-r { font-size: 11px; gap: 2px; }
@media (min-width: 420px) { .wh-r { font-size: 12px; } .wh { padding: 8px 8px 8px 10px; } }
/* строки в карточке колеса без просветов, карточки не растягиваются по высоте */
.wcol { align-content: start; }
.wh { align-content: start; gap: 1px; }
.wh-h { margin-bottom: 3px; }
.wh-r { line-height: 1.35; }
/* «Состояние колёс»: подписи плотно, без просветов */
.wstate { align-content: center; row-gap: 0; }
.wstate b { grid-row: 1 / 3; grid-column: 2; align-self: center; line-height: 1; }
.wstate-l, .wstate-n { line-height: 1.3; }
.sm-sec .sm-h { margin-bottom: 6px; }
.sm-wheels { gap: 0; }
.wstate.sm { margin-bottom: 10px; }
/* пункты в «Системах» и «Не удалось осмотреть»: текст плотно, без просветов */
.sm-item { display: flex; align-items: flex-start; gap: 10px; line-height: 1.35; }
.sm-item img.ico { flex: none; }
.sm-item .tx { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.sm-item .sy, .sm-item .q, .sm-item .c { line-height: 1.35; }
.sm-item.nosys { display: flex; }
.sm-sys-t { gap: 0; }
.sm-sys-t b, .sm-cnt { line-height: 1.3; }
/* подложка с процентом правым краем касается границы блока (просьба маркетолога) */
.sm-pct { margin-right: -15px; }
/* «Исправно N узлов» и «Неисправно N узлов» — каждая своей строкой, без переносов и просветов */
.sm-cnt { display: flex; flex-direction: column; gap: 0; }
.sm-cnt span { white-space: nowrap; line-height: 1.3; }

/* подсказка «Установить на iPhone» */
.ih { gap: 10px; }
.ih-steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; color: var(--text); font-size: 15px; line-height: 1.45; }
.ih-steps b { color: var(--ink); }

/* ================= ПОЛЬЗОВАТЕЛИ (администратор) ================= */
.tabbar.three { grid-template-columns: repeat(3, 1fr); }
.tabbar.four { grid-template-columns: repeat(4, 1fr); }
.tabbar.four .tab { font-size: 11px; padding: 8px 2px; }
.panel.recv { max-width: 1360px; }
.rv-dept { width: 100%; margin-bottom: 14px; }
@media (min-width: 1000px) { body.is-admin .rv-side { max-height: calc(100vh - 170px); } }
.u-seg { margin-bottom: 16px; }
.mini-badge { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 9px; background: var(--danger); color: #FFFFFF; font: 700 11px/18px var(--font); text-align: center; margin-left: 4px; }
.u-tools { display: grid; gap: 10px; margin-bottom: 8px; }
.u-tools .btn { margin: 0; }
.u-dept { margin: 18px 0 6px; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
.u-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; margin-bottom: 8px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  text-align: left; font-family: var(--font); cursor: pointer;
}
.u-row:active { background: var(--tint); }
.u-av { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--tint); color: var(--ink); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.u-row .tx { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.u-row b { font-size: 15px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-row span.sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-row.off { opacity: .55; }
.role { flex: none; padding: 3px 8px; border-radius: 8px; font: 600 11px var(--font); background: var(--track); color: var(--muted); }
.role.mechanic { background: var(--tint); color: var(--ink); }
.role.admin { background: var(--ok-bg); color: var(--ok); }
.role.off { background: var(--danger-bg); color: var(--danger); }
.flabel { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.seg-ctl.seg3 { grid-template-columns: repeat(3, 1fr); }
.u-select {
  box-sizing: border-box; width: 100%; height: 52px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: 500 16px var(--font);
}
.u-pass-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.u-pass-row input { font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.u-phone-info { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--tint); color: var(--text); font-size: 13px; line-height: 1.4; }
.u-done { display: grid; gap: 8px; justify-items: start; padding: 12px; border-radius: 12px; background: var(--ok-bg); color: var(--text); font-size: 14px; }
.u-done code { font: 700 20px var(--font); letter-spacing: .08em; color: var(--ink); user-select: all; }
.u-foot { display: grid; gap: 4px; }
.u-foot .link-danger { margin: 0 auto; }
.u-h { margin: 6px 0 10px; font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
.ph-card { padding: 14px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); display: grid; gap: 8px; }
.ph-card.req { border: 2px solid var(--warn); }
.ph-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ph-code { font: 700 22px var(--font); letter-spacing: .1em; color: var(--ink); font-variant-numeric: tabular-nums; }
.ph-kind { font-size: 12px; font-weight: 700; color: var(--warn); text-align: right; }
.ph-name { font-size: 16px; font-weight: 700; color: var(--text); }
.ph-rows { display: grid; gap: 2px; font-size: 13px; color: var(--muted); line-height: 1.4; }
.ph-rows b { color: var(--text); font-weight: 600; }
.ph-rows .zone-ok { color: var(--ok); font-weight: 700; }
.ph-rows .zone-bad { color: var(--danger); font-weight: 700; }
.ph-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.ph-btns .btn { margin: 0; height: 46px; }
.ph-users { display: flex; flex-wrap: wrap; gap: 6px; }
.ph-user { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 10px; border-radius: 16px; background: var(--tint); color: var(--ink); font: 600 13px var(--font); }
.ph-user button { width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; font: 700 14px/1 var(--font); }
.ph-user button.armed { background: var(--danger); color: #FFFFFF; }
.ph-acts { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ph-acts .sm-edit, .ph-acts .link-danger { margin: 0; padding: 6px 0; }
.ph-kind { white-space: pre-line; }
.ph-rename { font-weight: 700 !important; }
.u-row b { white-space: normal; overflow: visible; text-overflow: clip; }

/* экран «Телефон ждёт подтверждения» */
.dev-wait { align-self: center; display: grid; gap: 12px; justify-items: center; text-align: center; }
.dev-wait h2 { margin: 0; font-size: 20px; font-weight: 700; color: var(--text); text-wrap: balance; }
.dev-wait p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); max-width: 34ch; }
.dw-ico { width: 64px; height: 64px; border-radius: 50%; background: var(--tint); color: var(--ink); display: grid; place-items: center; }
.dw-ico svg { width: 32px; height: 32px; }
.dw-code { font: 700 34px var(--font); letter-spacing: .12em; color: var(--ink); padding: 10px 18px; border-radius: 14px; background: var(--surface); border: 2px dashed var(--line); font-variant-numeric: tabular-nums; user-select: all; }
.dev-wait .btn { width: 100%; }
.dev-wait .ck-na { width: auto; margin: 0; }

/* ================= УВЕДОМЛЕНИЯ И ЖУРНАЛ (администратор) ================= */
.push-card {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center;
  padding: 12px 14px; margin-bottom: 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface);
}
.push-card.on { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.push-card.warn { border-color: var(--warn); background: var(--warn-bg); }
.push-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--tint); color: var(--ink); }
.push-ico svg { width: 22px; height: 22px; }
.push-card.on .push-ico { background: var(--ok-bg); color: var(--ok); }
.push-card.warn .push-ico { background: transparent; color: var(--warn); }
.push-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.35; }
.push-tx b { font-size: 15px; font-weight: 700; color: var(--text); }
.push-tx span { font-size: 13px; color: var(--muted); }
.push-btns { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.push-btns .btn { flex: 1 1 0; min-width: 120px; }
.push-btns [hidden] { display: none; }
.push-off { border: 0; background: none; padding: 8px 4px; color: var(--muted); font: 600 13px var(--font); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.j-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.j-filter button {
  height: 34px; padding: 0 14px; border-radius: 17px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); font: 600 13px var(--font); cursor: pointer;
}
.j-filter button[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.j-day { margin: 16px 0 6px; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
.j-row {
  display: grid; grid-template-columns: 10px 1fr auto; gap: 2px 10px; align-items: start;
  width: 100%; padding: 10px 12px; margin-bottom: 6px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  text-align: left; font-family: var(--font); color: var(--text);
}
button.j-row { cursor: pointer; }
.j-row.new { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); background: color-mix(in srgb, var(--danger-bg) 55%, var(--surface)); }
.j-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--muted); }
.j-row.alert .j-dot { background: var(--danger); }
.j-row.wait .j-dot { background: var(--warn); }
.j-row.admin .j-dot { background: var(--ink); }
.j-row.info .j-dot { background: var(--line); }
.j-t { font-size: 14px; font-weight: 700; line-height: 1.35; }
.j-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 2px; }
.j-b { grid-column: 2 / -1; font-size: 13px; line-height: 1.4; color: var(--text); }
.j-m { grid-column: 2 / -1; font-size: 12px; color: var(--muted); }
.j-new { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 6px; background: var(--danger); color: #FFFFFF; font-size: 10px; font-weight: 700; vertical-align: 2px; letter-spacing: .03em; }

/* прототип: системное уведомление телефона (нейтральные цвета системы, не фирменные) */
.sys-note {
  position: fixed; z-index: 80; left: 50%; top: max(10px, env(safe-area-inset-top, 0px));
  width: min(420px, calc(100% - 20px)); transform: translate(-50%, 0);
  display: grid; grid-template-columns: 20px 1fr; gap: 2px 8px; align-items: center;
  padding: 12px 14px; border: 0; border-radius: 18px; text-align: left; cursor: pointer;
  background: #FFFFFF; color: #1C1B1F; box-shadow: 0 8px 28px rgba(0,0,0,.22);
  font-family: Roboto, "Segoe UI", -apple-system, Arial, sans-serif;
  animation: sn-in 320ms cubic-bezier(.2,.9,.3,1) both;
}
.sys-note img { width: 20px; height: 20px; border-radius: 5px; }
.sys-note .sn-app { font-size: 12px; color: #5F6368; }
.sys-note b { grid-column: 2; font-size: 14px; font-weight: 600; }
.sys-note #sn-body { grid-column: 2; font-size: 14px; line-height: 1.35; color: #3C4043; }
:root[data-theme="dark"] .sys-note { background: #2B2930; color: #E6E1E5; }
:root[data-theme="dark"] .sys-note .sn-app, :root[data-theme="dark"] .sys-note #sn-body { color: #CAC4D0; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sys-note { background: #2B2930; color: #E6E1E5; }
  :root:not([data-theme="light"]) .sys-note .sn-app, :root:not([data-theme="light"]) .sys-note #sn-body { color: #CAC4D0; }
}
@keyframes sn-in { from { opacity: 0; transform: translate(-50%, -24px); } to { opacity: 1; transform: translate(-50%, 0); } }
.j-geo { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 2px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.j-geo a { color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ================= КАБИНЕТ МАСТЕРА-ПРИЁМЩИКА ================= */
.viewer.ro .viewer-foot { display: none; }
body.is-recv .panel.recv { max-width: 1360px; padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); }
.rv-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.rv-center { font-size: 14px; font-weight: 600; color: var(--muted); }
.rv-period { margin-bottom: 12px; }
.rv-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.rv-tile { display: grid; gap: 1px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.rv-tile b { font-size: 24px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.15; }
.rv-tile span { font-size: 12px; font-weight: 600; color: var(--muted); }
.rv-tile small { font-size: 11px; color: var(--muted); }
.rv-tile.bad b { color: var(--danger); }
.rv-tile.off b { color: var(--ink); }
.rv-tile.ok b { color: var(--ok); }
.rv-q { margin-bottom: 10px; }
.rv-row {
  position: relative; display: grid; gap: 3px; width: 100%; padding: 11px 12px; margin-bottom: 8px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text);
  text-align: left; font-family: var(--font); cursor: pointer;
}
.rv-row:hover { border-color: color-mix(in srgb, var(--ink) 35%, var(--line)); }
.rv-row.cur { border: 2px solid var(--ink); padding: 10px 11px; }
.rv-row.unseen { background: color-mix(in srgb, var(--tint) 70%, var(--surface)); }
.rv-r1 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rv-plate { font-size: 16px; font-weight: 700; letter-spacing: .02em; }
.rv-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rv-r2 { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-r3 { font-size: 12px; color: var(--muted); }
.rv-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.rv-n, .rv-sale { padding: 2px 8px; border-radius: 8px; font-size: 11px; font-weight: 700; }
.rv-n.bad { background: var(--danger-bg); color: var(--danger); }
.rv-n.okn { background: var(--ok-bg); color: var(--ok); }
.rv-n.nc { background: var(--warn-bg); color: var(--warn); }
.rv-sale.s-new { background: var(--track); color: var(--text); }
.rv-sale.s-offered { background: var(--tint); color: var(--ink); }
.rv-sale.s-agreed { background: var(--ok-bg); color: var(--ok); }
.rv-sale.s-declined { background: var(--danger-bg); color: var(--danger); }
.rv-new { position: absolute; top: 11px; right: 56px; padding: 1px 6px; border-radius: 6px; background: var(--ink); color: var(--surface); font-size: 10px; font-weight: 700; letter-spacing: .03em; }

.rv-main { min-width: 0; }
.rv-empty { display: none; }
.rv-report { display: grid; gap: 14px; }
.rv-rhead { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; align-items: center; padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.rv-back { grid-column: 1 / -1; justify-self: start; border: 0; background: none; padding: 0; color: var(--ink); font: 600 14px var(--font); cursor: pointer; }
.rv-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.rv-title h2 { margin: 0; font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: .02em; }
.rv-catn { font-size: 14px; font-weight: 600; color: var(--muted); }
.rv-pdf { gap: 8px; }
.rv-pdf svg { width: 18px; height: 18px; }
.rv-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.rv-linkst { grid-column: 1 / -1; font-size: 13px; font-weight: 600; color: var(--muted); }
.rv-linkst.seen { color: var(--ok); }
.rv-linkst[hidden] { display: none; }
.rv-share { grid-column: 1 / -1; display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: var(--tint); }
.rv-share[hidden] { display: none; }
.rv-share > b { font-size: 14px; color: var(--text); }
.rv-sh-row { display: flex; gap: 8px; flex-wrap: wrap; }
.rv-sh-row input { flex: 1; min-width: 220px; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 600 14px var(--font); }
.rv-sh-info { margin: 0; font-size: 12.5px; color: var(--muted); }
.rv-share .rv-sh-close { justify-self: start; width: auto; margin: 0; padding: 4px 0; text-align: left; font-size: 13px; }
.rv-sh-err { margin: 0; color: var(--danger); font-size: 13px; }
.rv-meta { grid-column: 1 / -1; display: grid; gap: 4px 24px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); font-size: 14px; }
.rv-meta div { display: grid; gap: 1px; }
.rv-meta span { font-size: 12px; color: var(--muted); }
.rv-meta b { font-weight: 600; color: var(--text); }
.rv-sec { padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 10px; }
.rv-sec h3 { margin: 0; font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
.rv-sale-sec { border: 2px solid color-mix(in srgb, var(--ink) 40%, var(--line)); }
.rv-sale-seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.rv-sale-seg .sb {
  min-height: 44px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg);
  color: var(--text); font: 600 13px/1.2 var(--font); cursor: pointer;
}
.rv-sale-seg .sb[aria-pressed="true"] { border-width: 2px; }
.rv-sale-seg .sb.s-new[aria-pressed="true"] { border-color: var(--muted); background: var(--track); }
.rv-sale-seg .sb.s-offered[aria-pressed="true"] { border-color: var(--ink); background: var(--tint); color: var(--ink); }
.rv-sale-seg .sb.s-agreed[aria-pressed="true"] { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.rv-sale-seg .sb.s-declined[aria-pressed="true"] { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); }
.rv-ta {
  box-sizing: border-box; width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: 500 15px/1.4 var(--font); resize: vertical;
}
.rv-sale-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.rv-sale-foot .btn { min-width: 140px; }
.rv-who { font-size: 12px; color: var(--muted); }
.rv-none { margin: 0; padding: 12px; border-radius: 12px; background: var(--ok-bg); color: var(--ok); font-weight: 600; font-size: 14px; }
.rv-item { display: grid; gap: 8px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); border-left: 4px solid var(--danger); background: var(--bg); }
.rv-item.nc { border-left-color: var(--warn); }
.rv-ih { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; }
.rv-ih img { width: 40px; height: 40px; object-fit: contain; }
.rv-ih div { display: grid; gap: 2px; }
.rv-sys { font-size: 12px; font-weight: 700; color: var(--muted); }
.rv-ih b { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.35; }
.rv-mc, .rv-rec { margin: 0; font-size: 14px; line-height: 1.45; color: var(--text); }
.rv-mc span { font-weight: 700; color: var(--muted); }
.rv-rec { padding: 8px 10px; border-radius: 10px; background: var(--tint); }
.rv-rec span { font-weight: 700; color: var(--ink); }
.rv-cons summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--danger); }
.rv-cons p { margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: var(--text); }
.rv-dph { display: flex; flex-wrap: wrap; gap: 8px; }
.rv-dph .rv-ph { width: 120px; }
.rv-wl { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; line-height: 1.4; }
.rv-wl li.crit span { color: var(--danger); font-weight: 700; }
.rv-wl li.att span { color: var(--warn); font-weight: 700; }
.rv-pgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.rv-ph { position: relative; display: block; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: var(--pic-bg); cursor: zoom-in; aspect-ratio: 4 / 3; }
.rv-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rv-ph span { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 8px; background: rgba(14, 11, 26, .6); color: #FFFFFF; font: 600 12px var(--font); }
.rv-ph.none { display: grid; place-items: center; cursor: default; color: var(--muted); font-size: 13px; }
.rv-absent { margin: 0; font-size: 13px; color: var(--muted); }
.rv-comm p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text); }
.rv-wheels .wscheme { max-width: 520px; }

/* узкий экран: либо список, либо отчёт */
@media (max-width: 999px) {
  .rv-wrap.open .rv-side { display: none; }
  .rv-wrap:not(.open) .rv-main { display: none; }
  .rv-sale-seg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* компьютер: список слева, отчёт справа */
@media (min-width: 1000px) {
  .rv-wrap { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 24px; align-items: start; }
  .rv-side { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow-y: auto; padding-right: 6px; }
  .rv-empty { display: grid; place-items: center; gap: 10px; min-height: 60vh; border: 2px dashed var(--line); border-radius: 16px; color: var(--muted); text-align: center; }
  .rv-empty svg { width: 48px; height: 48px; }
  .rv-empty p { margin: 0; font-size: 15px; }
  .rv-empty[hidden] { display: none; }
  .rv-back { display: none; }
  .rv-pgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* решение клиента по неисправности */
.rv-sumbar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; border-radius: 16px; overflow: hidden; border: 2px solid var(--warn); background: var(--line); }
.rv-sumbar.done { border-color: var(--ok); }
.rv-sumbar[hidden] { display: none; }
.rv-sumbar > div { display: grid; gap: 2px; padding: 12px 14px; background: var(--surface); }
.rv-sumbar b { font-size: 20px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.rv-sumbar span { font-size: 12px; color: var(--muted); line-height: 1.3; }
.rv-sumbar .todo b { color: var(--warn); }
.rv-sumbar .ok b { color: var(--ok); }
.rv-sumbar .no b { color: var(--danger); }
.rv-sumbar .money b { color: var(--ink); }
.rv-item.dec-agreed { border-left-color: var(--ok); }
.rv-item.dec-declined { border-left-color: var(--muted); }
.rv-dec { display: grid; gap: 8px; padding: 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.rv-item.dec-none .rv-dec { border-color: var(--warn); background: color-mix(in srgb, var(--warn-bg) 60%, var(--surface)); }
.rv-dec-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rv-dec-btns .db { min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 700 14px var(--font); cursor: pointer; }
.rv-dec-btns .db.yes[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #FFFFFF; }
.rv-dec-btns .db.no[aria-pressed="true"] { background: var(--danger); border-color: var(--danger); color: #FFFFFF; }
.rv-dec-btns .db.yes:hover { border-color: var(--ok); } .rv-dec-btns .db.no:hover { border-color: var(--danger); }
.rv-dec-hint { margin: 0; font-size: 13px; font-weight: 700; color: var(--warn); }
.rv-agreed { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--ok) 45%, var(--line)); background: var(--ok-bg); color: var(--text); font: 600 14px var(--font); cursor: pointer; text-align: left; }
.rv-agreed b { margin-left: auto; font-size: 18px; color: var(--ok); font-variant-numeric: tabular-nums; }
.rv-agreed .ed { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; font-size: 13px; }
.rv-agreed.empty { background: var(--bg); border-style: dashed; border-color: var(--ok); }
.rv-agreed.empty .ed { margin-left: auto; }
.rv-decline { display: grid; gap: 6px; }
.rv-reason { box-sizing: border-box; width: 100%; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 500 14px var(--font); }
.rv-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rv-chips button { height: 30px; padding: 0 10px; border-radius: 15px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: 600 12px var(--font); cursor: pointer; }
.rv-dec-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--muted); }
.rv-reset { border: 0; background: none; padding: 0; color: var(--muted); font: 600 12px var(--font); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* окно «Работы и запчасти» */
.of-panel { max-height: 92vh; overflow-y: auto; }
.of-panel .ws-head span { display: block; max-width: 56ch; margin-top: 2px; }
.of-body { display: grid; gap: 14px; }
.of-sec { display: grid; gap: 8px; }
.of-sec h4 { margin: 0; font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
.of-line { display: grid; grid-template-columns: 1fr auto 32px; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.of-line .tx { display: grid; gap: 2px; min-width: 0; }
.of-line .tx b { font-size: 14px; font-weight: 600; color: var(--text); }
.of-line .tx span { font-size: 12px; color: var(--muted); }
.of-line .sum { font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.of-del { width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--track); color: var(--muted); font: 700 16px/1 var(--font); cursor: pointer; }
.of-form { display: grid; gap: 8px; padding: 12px; border-radius: 12px; border: 1px dashed var(--line); }
.of-form input { box-sizing: border-box; width: 100%; height: 46px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 500 15px var(--font); }
.of-found { font-size: 13px; color: var(--muted); line-height: 1.35; }
.of-found.ok { color: var(--ok); font-weight: 700; font-size: 14px; }
.of-found.bad { color: var(--danger); font-weight: 600; }
.of-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; }
.of-nums[hidden] { display: none; }
.of-nums .btn { grid-column: 1 / -1; margin: 0; }
.of-psum { grid-column: 1 / -1; font-size: 15px; font-weight: 700; color: var(--ink); }
.of-psum:empty { display: none; }
.of-hint { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); margin-top: -2px; }
.of-hint:empty { display: none; }
.of-hint.none { color: var(--warn, #b26a00); }
.of-plist { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; max-height: 280px; overflow-y: auto; overflow-x: hidden; }
.of-pi b, .of-pi span span { overflow-wrap: anywhere; }
.of-pi { display: block; width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); text-align: left; cursor: pointer; font-family: var(--font); }
.of-pi .tx { display: grid; gap: 2px; }
.of-pi b { font-size: 14px; font-weight: 600; color: var(--text); }
.of-pi span span { font-size: 12px; color: var(--muted); }
.of-pi.on { border: 2px solid var(--ink); padding: 8px 11px; background: var(--tint); }
.of-foot { position: sticky; bottom: -16px; display: flex; align-items: center; gap: 12px; padding: 12px 0 4px; background: var(--bg); border-top: 1px solid var(--line); }
.of-total { display: grid; gap: 2px; margin-right: auto; }
.of-total span { font-size: 12px; color: var(--muted); }
.of-total b { font-size: 20px; color: var(--text); font-variant-numeric: tabular-nums; }
.of-foot .btn { margin: 0; min-width: 140px; }
@media (min-width: 1000px) {
  .of-panel { top: 50%; bottom: auto; transform: translateY(-50%); max-width: 760px; border-radius: 18px; }
  .of-nums { grid-template-columns: 140px 180px 1fr; }
  .of-nums .btn { grid-column: auto; }
  .of-psum { grid-column: auto; }
  .of-nums:has(.of-psum) { grid-template-columns: 120px 170px 1fr auto; }
}
@media (max-width: 999px) { .rv-sumbar { grid-template-columns: 1fr 1fr; } }

/* предложение по неисправности */
.rv-make { width: 100%; margin: 0; height: 48px; }
.rv-dec-hint.wait { color: var(--ink); }
.rv-item.dec-wait { border-left-color: var(--ink); }
.rv-item.dec-wait .rv-dec { border-color: color-mix(in srgb, var(--ink) 40%, var(--line)); }
.rv-item.dec-wait .rv-agreed, .rv-item.dec-declined .rv-agreed { background: var(--tint); border-color: color-mix(in srgb, var(--ink) 30%, var(--line)); }
.rv-item.dec-wait .rv-agreed b, .rv-item.dec-declined .rv-agreed b { color: var(--ink); }
.rv-sumbar.st-todo { border-color: var(--warn); }
.rv-sumbar.st-wait { border-color: var(--ink); }
.rv-sumbar.st-done { border-color: var(--ok); }
.rv-sumbar .wait b { color: var(--ink); }
/* поиск в окне подбора */
.of-search { display: grid; gap: 8px; }
.of-pi.part { padding: 0; display: grid; }
.of-pi.part .pm { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; background: none; text-align: left; cursor: pointer; font-family: var(--font); }
.of-pi.part .pm .tx { flex: 1; min-width: 0; }
.of-pi .stk { flex: none; padding: 3px 8px; border-radius: 8px; font: 700 12px var(--font); white-space: nowrap; }
.of-pi .stk.yes { background: var(--ok-bg); color: var(--ok); }
.of-pi .stk.no { background: var(--track); color: var(--muted); }
.of-pi .grp { justify-self: start; margin: 0 12px 9px; padding: 4px 10px; border-radius: 8px; border: 1px dashed var(--ink); background: var(--surface); color: var(--ink); font: 600 12px var(--font); cursor: pointer; }
.of-pi .grp.open { background: var(--tint); border-style: solid; }
.of-pi .grp::after { content: " ▾"; }
.of-pi .grp.open::after { content: " ▴"; }
.of-pi .glist { display: grid; gap: 4px; margin: 0 12px 10px; padding-left: 10px; border-left: 3px solid var(--tint); }
.of-pi .glist[hidden] { display: none; }
.of-pi.ingroup { background: var(--bg); }
.of-pi.ingroup .pm { padding: 7px 10px; }
.of-pi.part.on { padding: 0; }

/* неисправность, найденная после осмотра */
.rv-addf { justify-self: start; margin: 2px 0 0 58px; padding: 4px 0; border: 0; background: none; color: var(--ink); font: 600 13px var(--font); cursor: pointer; }
.rv-addf:hover { text-decoration: underline; }
.rv-item.found { border-style: dashed; }
.rv-found { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 12.5px; color: var(--muted); }
.rv-found .tag { padding: 2px 8px; border-radius: 8px; background: var(--tint); color: var(--ink); font-weight: 700; }
.rv-found-ed { border: 0; background: none; padding: 0; color: var(--ink); font: 600 13px var(--font); cursor: pointer; text-decoration: underline; }
.fd-list { display: grid; gap: 6px; }
.fd-q { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
        background: var(--surface); color: var(--text); font-family: var(--font); text-align: left; cursor: pointer; }
.fd-q:hover:not(:disabled) { border-color: var(--btn); }
.fd-q:disabled { opacity: .55; cursor: default; }
.fd-q .tx { display: grid; gap: 2px; } .fd-q .tx b { font-size: 14px; font-weight: 600; } .fd-q .tx span { font-size: 12px; color: var(--muted); }
.fd-q .mk { flex: none; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 8px; background: var(--ok-bg); color: var(--ok); }
.fd-q .mk.absent, .fd-q .mk.not_checked, .fd-q .mk.found { background: var(--tint); color: var(--muted); }
.fd-q .mk.critical { background: var(--danger-bg); color: var(--danger); }
.fd-head { display: grid; gap: 3px; padding: 10px 12px; border-radius: 12px; background: var(--tint); }
.fd-head b { font-size: 15px; color: var(--text); } .fd-head span { font-size: 12.5px; color: var(--muted); } .fd-head .rv-found-ed { justify-self: start; margin-top: 2px; }
.fd-lab { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.fd-lab textarea { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 500 15px/1.4 var(--font); resize: vertical; }
.fd-photos { display: flex; flex-wrap: wrap; gap: 8px; }
.fd-ph { position: relative; width: 104px; height: 104px; border-radius: 10px; overflow: hidden; background: var(--tint); }
.fd-ph img { width: 100%; height: 100%; object-fit: cover; }
.fd-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 17px; line-height: 1; cursor: pointer; }
.fd-add { width: 104px; height: 104px; border-radius: 10px; border: 1px dashed var(--line); background: var(--surface); color: var(--ink); font: 700 14px var(--font); cursor: pointer; }
.fd-del { justify-self: start; margin: 0; padding: 4px 0; }
.fd-err { flex: 1; margin: 0; color: var(--danger); font-size: 13px; }
.fd-err[hidden] { display: none; }
#fd-sheet .of-foot { justify-content: flex-end; }

/* текст для клиента (после ИИ) */
.rv-cc { display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--tint); }
.rv-cc-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.rv-cc .lb { font-size: 12px; font-weight: 700; color: var(--ink); text-transform: uppercase; letter-spacing: .04em; }
.rv-cc .nt { font-size: 12px; color: var(--muted); }
.rv-cc-t { margin: 0; font-size: 14.5px; line-height: 1.45; color: var(--text); font-weight: 600; }
.rv-cc-t.wait { font-weight: 500; }
.rv-cc-m { margin: 0; font-size: 12.5px; color: var(--muted); }
.rv-cc-m span { font-weight: 700; }
.rv-cc textarea { width: 100%; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 500 14.5px/1.4 var(--font); resize: vertical; }
.rv-cc-btns { display: flex; gap: 8px; }
