:root {
  --bg: #f3f2ef;
  --panel: #ffffff;
  --ink: #1d1f22;
  --ink-2: #5b6068;
  --ink-3: #8a9099;
  --line: #e2e0db;
  --line-2: #cfccc5;
  --side: #1d2024;
  --side-ink: #c9ccd1;
  --accent: #e8590c;
  --accent-ink: #ffffff;
  --accent-soft: #fdebe0;
  --blue: #1c6dd0;
  --blue-soft: #e3eefb;
  --green: #2b8a3e;
  --green-soft: #e3f4e6;
  --amber: #b7791f;
  --amber-soft: #fbf0d9;
  --red: #c92a2a;
  --red-soft: #fbe4e4;
  --gray-soft: #ecebe8;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a; --panel: #1e2125; --ink: #e8e9eb; --ink-2: #a8adb5; --ink-3: #7c828b;
    --line: #2d3136; --line-2: #3b4047; --side: #0f1113; --side-ink: #b4b8be;
    --accent-soft: #3a2416; --blue: #5aa1f0; --blue-soft: #1a2a3e; --green: #5cc070; --green-soft: #1a3020;
    --amber: #e0a845; --amber-soft: #352a14; --red: #f06a6a; --red-soft: #3a1c1c; --gray-soft: #2a2d31;
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

/* ── каркас ── */
.app { display: flex; min-height: 100vh; }
.side {
  width: 230px; flex: none; background: var(--side); color: var(--side-ink);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { padding: 20px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand b { display: block; color: #fff; font-size: 16px; letter-spacing: .02em; }
.brand span { font-size: 12px; opacity: .7; }
.brand .mark { display: inline-block; width: 10px; height: 10px; background: var(--accent); border-radius: 2px; margin-right: 8px; }
.nav { padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
  color: var(--side-ink); font-weight: 500;
}
.nav a svg { width: 19px; height: 19px; flex: none; }
.nav a:hover { background: rgba(255,255,255,.05); }
.nav a.on { background: rgba(232,89,12,.16); color: #fff; }
.nav a.on svg { color: var(--accent); }
.nav .badge { margin-left: auto; }
.side-foot { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.07); font-size: 13px; }
.side-foot b { color: #fff; display: block; font-weight: 600; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top {
  display: flex; align-items: center; gap: 12px; padding: 18px 28px 6px; flex-wrap: wrap;
}
.top h1 { flex: 1; min-width: 0; }
.content { padding: 12px 28px 40px; max-width: 1180px; width: 100%; }
.bottom-nav { display: none; }

@media (max-width: 860px) {
  .side { display: none; }
  .top { padding: 14px 16px 4px; position: sticky; top: 0; z-index: 5; background: var(--bg); }
  .top h1 { font-size: 19px; }
  .content { padding: 8px 16px 96px; }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    background: var(--panel); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: 11px; color: var(--ink-3); padding: 4px 0; position: relative;
  }
  .bottom-nav a svg { width: 22px; height: 22px; }
  .bottom-nav a.on { color: var(--accent); }
  .bottom-nav .badge { position: absolute; top: 0; left: 55%; }
}

/* ── элементы ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--panel); color: var(--ink); font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.danger { color: var(--red); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.big { height: 52px; font-size: 16px; width: 100%; border-radius: 10px; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { width: 40px; padding: 0; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card, .section + .section { margin-top: 14px; }
.card-pad { padding: 16px 18px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.card-head h3 { flex: 1; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.input, select.input, textarea.input {
  width: 100%; height: 40px; padding: 0 11px; border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--panel); outline: none;
}
textarea.input { height: auto; min-height: 80px; padding: 9px 11px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .g2.stack, .g3.stack { grid-template-columns: 1fr; } }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }

.badge {
  display: inline-flex; align-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700; justify-content: center;
}
.pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 12px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.st-new { background: var(--blue-soft); color: var(--blue); }
.st-in_progress { background: var(--amber-soft); color: var(--amber); }
.st-done { background: var(--green-soft); color: var(--green); }
.st-accepted { background: var(--gray-soft); color: var(--ink-2); }
.st-cancelled { background: var(--red-soft); color: var(--red); }
.pill.urgent { background: var(--red); color: #fff; }
.chip { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 13px;
  background: var(--gray-soft); font-size: 13px; margin: 0 6px 6px 0; }

/* ── фильтры-вкладки ── */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { height: 34px; padding: 0 13px; border-radius: 17px; border: 1px solid var(--line-2); background: var(--panel);
  font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tab .n { color: var(--ink-3); font-weight: 600; }
.tab.on { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.tab.on .n { color: inherit; opacity: .7; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.search { position: relative; flex: 1; min-width: 200px; }
.search input { padding-left: 36px; }
.search svg { position: absolute; left: 11px; top: 11px; width: 18px; height: 18px; color: var(--ink-3); }

/* ── список нарядов ── */
.jobs { display: grid; gap: 10px; }
.job {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 16px; cursor: pointer;
  border-left: 4px solid transparent;
}
.job:hover { border-color: var(--line-2); }
.job.s-new { border-left-color: var(--blue); }
.job.s-in_progress { border-left-color: var(--amber); }
.job.s-done { border-left-color: var(--green); }
.job.s-accepted { border-left-color: var(--line-2); }
.job.s-cancelled { border-left-color: var(--red); opacity: .75; }
.job .plate { font-weight: 750; font-size: 16.5px; letter-spacing: .03em; }
.job .meta { color: var(--ink-2); font-size: 13.5px; }
.job .right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.job .what { grid-column: 1 / -1; font-size: 14px; }
.job .foot { grid-column: 1 / -1; display: flex; gap: 14px; flex-wrap: wrap; color: var(--ink-2); font-size: 13px; align-items: center; }
.progress { height: 5px; width: 80px; background: var(--gray-soft); border-radius: 3px; overflow: hidden; display: inline-block; vertical-align: middle; }
.progress i { display: block; height: 100%; background: var(--green); }
.empty { text-align: center; padding: 50px 20px; color: var(--ink-2); }
.empty svg { width: 42px; height: 42px; color: var(--ink-3); margin-bottom: 8px; }

/* ── карточка наряда ── */
.job-head { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.plate-big { font-size: 26px; font-weight: 800; letter-spacing: .04em; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 18px; margin-top: 14px; }
.facts div span { display: block; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.facts div b { font-weight: 600; }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 980px) { .layout-2 { grid-template-columns: 1fr; } }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); }
.checklist li:first-child { border-top: 0; }
.checklist .tick {
  width: 30px; height: 30px; border-radius: 8px; border: 2px solid var(--line-2); flex: none; cursor: pointer;
  display: grid; place-items: center; background: var(--panel);
}
.checklist .tick svg { width: 18px; height: 18px; color: #fff; opacity: 0; }
.checklist li.done .tick { background: var(--green); border-color: var(--green); }
.checklist li.done .tick svg { opacity: 1; }
.checklist li.done .wname { color: var(--ink-2); text-decoration: line-through; text-decoration-color: var(--ink-3); }
.checklist .wname { flex: 1; min-width: 0; }
.checklist .wmeta { font-size: 12.5px; color: var(--ink-3); }
.checklist .wprice { font-weight: 600; white-space: nowrap; }

.totals { display: grid; gap: 6px; padding: 14px 18px; border-top: 1px solid var(--line); }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font-size: 17px; font-weight: 750; padding-top: 6px; border-top: 1px dashed var(--line-2); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; padding: 14px 18px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--gray-soft); cursor: pointer; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.25); color: #fff; }
.thumb .play svg { width: 30px; height: 30px; }
.thumb .who { position: absolute; left: 0; right: 0; bottom: 0; font-size: 10.5px; color: #fff; padding: 12px 5px 3px;
  background: linear-gradient(transparent, rgba(0,0,0,.6)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 18px 16px; }
.upload-row .btn { height: 46px; flex-direction: column; gap: 2px; font-size: 12px; }
.upload-row .btn svg { width: 20px; height: 20px; }
.upbar { margin: 0 18px 14px; height: 6px; background: var(--gray-soft); border-radius: 3px; overflow: hidden; }
.upbar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }

.feed { padding: 6px 18px 4px; }
.ev { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.ev:first-child { border-top: 0; }
.ev .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); margin-top: 7px; flex: none; }
.ev.comment .dot { background: var(--blue); }
.ev.status .dot { background: var(--accent); }
.ev.file .dot { background: var(--green); }
.ev .when { font-size: 12px; color: var(--ink-3); }
.ev .txt { white-space: pre-wrap; word-break: break-word; }
.ev.comment .txt { background: var(--blue-soft); padding: 7px 10px; border-radius: 8px; margin-top: 3px; display: inline-block; }
.comment-box { display: flex; gap: 8px; padding: 10px 18px 16px; }
.comment-box textarea { min-height: 42px; height: 42px; }

.sticky-actions { position: sticky; bottom: 0; padding: 10px 0; margin-top: 14px; background: var(--bg); border-top: 1px solid var(--line); z-index: 4; }
.sticky-actions:empty { display: none; }
@media (max-width: 860px) { .sticky-actions { bottom: 64px; } }

/* ── форма наряда ── */
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 13px 0 10px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; user-select: none; font-weight: 500;
}
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.fluid { display: grid; grid-template-columns: 150px 1fr 90px; gap: 8px; align-items: center; }
.fluid + .fluid { margin-top: 8px; }
@media (max-width: 520px) { .fluid { grid-template-columns: 1fr 76px; } .fluid .check { grid-column: 1 / -1; } }
.lines { width: 100%; border-collapse: collapse; }
.lines th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 600; padding: 0 6px 6px; }
.lines td { padding: 3px; vertical-align: top; }
.lines td.n { width: 28px; text-align: center; color: var(--ink-3); padding-top: 13px; font-size: 13px; }
.lines .input { height: 38px; }
.lines td.x { width: 36px; }
.lines .sum { padding-top: 12px; font-weight: 600; text-align: right; white-space: nowrap; }
@media (max-width: 700px) {
  .lines thead { display: none; }
  .lines tr { display: grid; grid-template-columns: 1fr 70px 110px 36px; gap: 4px; padding: 8px 0; border-top: 1px solid var(--line); }
  .lines tr td.n { display: none; }
  .lines tr td.name { grid-column: 1 / -1; }
  .lines tr td.who { grid-column: 1 / 4; }
  .lines.parts tr { grid-template-columns: 70px 1fr 1fr 36px; }
  .lines.parts tr td.name { grid-column: 1 / -1; }
}
.workers-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.form-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; position: sticky; bottom: 0;
  padding: 12px 0; background: var(--bg); border-top: 1px solid var(--line); z-index: 3; }
@media (max-width: 860px) { .form-foot { bottom: 64px; } .form-foot .btn { flex: 1; } }
.suggest { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin-top: 4px; background: var(--panel);
  border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); overflow: hidden; }
.suggest div { padding: 9px 12px; cursor: pointer; border-top: 1px solid var(--line); font-size: 14px; }
.suggest div:first-child { border-top: 0; }
.suggest div:hover { background: var(--gray-soft); }

/* ── таблицы ── */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.r, table.t th.r { text-align: right; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--gray-soft); }
.bar { height: 6px; background: var(--gray-soft); border-radius: 3px; overflow: hidden; min-width: 60px; }
.bar i { display: block; height: 100%; background: var(--accent); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
@media (max-width: 860px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { padding: 14px 16px; }
.kpi span { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.kpi b { display: block; font-size: 22px; font-weight: 750; margin-top: 2px; font-variant-numeric: tabular-nums; }

.person { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-top: 1px solid var(--line); }
.person:first-child { border-top: 0; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 750; flex: none; }
.person .info { flex: 1; min-width: 0; }
.person .info b { display: block; }
.person.off { opacity: .55; }

/* ── вход ── */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth .card { width: 100%; max-width: 400px; padding: 26px 24px; }
.auth h1 { margin-bottom: 4px; }
.auth .lead { margin: 0 0 18px; color: var(--ink-2); }
.auth form { display: grid; gap: 12px; }
.auth .switch { text-align: center; margin-top: 14px; font-size: 14px; }
.logo-mark { width: 44px; height: 44px; border-radius: 11px; background: var(--side); display: grid; place-items: center; margin-bottom: 14px; }
.logo-mark i { width: 16px; height: 16px; background: var(--accent); border-radius: 3px; }

/* ── модальные окна и уведомления ── */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--panel); border-radius: 12px; width: 100%; max-width: 460px; max-height: 90vh; overflow: auto; }
.modal .card-head { position: sticky; top: 0; background: var(--panel); }
.modal-body { padding: 16px 18px; display: grid; gap: 12px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 0 18px 16px; }
.viewer { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 60; display: flex; flex-direction: column; }
.viewer .vbar { display: flex; gap: 10px; align-items: center; padding: 10px 14px; color: #fff; }
.viewer .vbar .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.viewer .vbody { flex: 1; display: grid; place-items: center; min-height: 0; padding: 0 10px 14px; }
.viewer img, .viewer video { max-width: 100%; max-height: 100%; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--panel);
  padding: 11px 18px; border-radius: 10px; z-index: 70; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 90vw; }
@media (max-width: 860px) { .toast { bottom: 84px; } }
.toast.err { background: var(--red); color: #fff; }
.loading { padding: 40px; text-align: center; color: var(--ink-3); }
.note { background: var(--amber-soft); color: var(--amber); padding: 10px 14px; border-radius: 8px; font-size: 14px; }

/* ── этап 2: клиенты, техника, оцифровка ── */
.input.unsure { border-color: var(--amber); background: var(--amber-soft); }
.raw { font-size: 11.5px; color: var(--ink-3); margin: 2px 2px 0; }
.plates { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.plate-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border: 1.5px solid var(--ink); border-radius: 4px;
  font-weight: 750; font-size: 12px; letter-spacing: .04em; background: var(--panel); white-space: nowrap; }
.plate-chip.big { height: 32px; font-size: 18px; padding: 0 10px; border-width: 2px; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; padding: 14px 18px; }
.vcard { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; color: inherit; }
.vcard:hover { border-color: var(--ink-3); }
.hist { display: flex; flex-direction: column; }
.hrow { display: grid; grid-template-columns: 90px 1fr auto; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--line); color: inherit; }
.hrow:first-child { border-top: 0; }
.hrow:hover { background: var(--gray-soft); }
.hworks { margin-top: 3px; font-size: 14px; }
.hsum { font-weight: 650; white-space: nowrap; }
@media (max-width: 600px) { .hrow { grid-template-columns: 1fr auto; } .hrow .hdate { grid-column: 1 / -1; display: flex; gap: 8px; align-items: baseline; } }
.ithumb { width: 46px; height: 58px; border-radius: 6px; overflow: hidden; background: var(--gray-soft); flex: none; display: grid; place-items: center; color: var(--ink-3); }
.ithumb img { width: 100%; height: 100%; object-fit: cover; }
.ithumb svg { width: 22px; height: 22px; }
.drop { border-style: dashed; border-width: 2px; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.content.wide { max-width: none; }
.review { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
.review-scan { position: sticky; top: 12px; }
.scanbox { overflow: hidden; }
.scanview { max-height: calc(100vh - 120px); overflow: auto; background: #6b6f75; }
.scanview img, .scanview canvas { display: block; width: 100%; height: auto; }
.scanview canvas + canvas { margin-top: 6px; }
.scanview.zoomed img, .scanview.zoomed canvas { width: 200%; max-width: none; }
.review-form .card + .card { margin-top: 14px; }
.review-form #formbox > form > .card { margin-top: 14px; }
.warnbox { margin-top: 10px; border-color: var(--amber); background: var(--amber-soft); color: var(--amber); }
.warnbox ul { margin: 0; padding-left: 20px; color: var(--ink); font-size: 14px; }
.warnbox li + li { margin-top: 4px; }
.warnbox.ok { border-color: var(--green); background: var(--green-soft); color: var(--green); }
@media (max-width: 1100px) {
  .review { grid-template-columns: 1fr; }
  .review-scan { position: static; }
  .scanview { max-height: 60vh; }
}
#jf > .card + .card { margin-top: 14px; }
.nv { display: none; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-2); margin: 3px 2px 0; cursor: pointer; }
.nv input { width: 14px; height: 14px; margin: 0; accent-color: var(--accent); }
#jf.vat-on .nv { display: inline-flex; }
.check.replace { border-color: var(--amber); background: var(--amber-soft); height: auto; min-height: 42px; padding: 8px 12px 8px 10px; width: 100%; font-weight: 600; }

/* ── связь и установка ── */
#offbar { position: fixed; left: 0; right: 0; top: 0; z-index: 80; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px; background: var(--red); color: #fff; font-size: 14px; }
#offbar span { flex: 1; min-width: 180px; opacity: .9; }
#offbar .btn { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.4); }
.off-ic { width: 56px; height: 56px; border-radius: 50%; background: var(--red-soft); color: var(--red); display: grid; place-items: center; margin: 0 auto 14px; }
.off-ic svg { width: 26px; height: 26px; }
.install-card { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); margin: 14px 0; text-align: left; }
.install-card.hidden { display: none; }
.install-ic { width: 38px; height: 38px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.install-ic svg { width: 20px; height: 20px; }
.ios-share { display: inline-block; border: 1px solid var(--line-2); border-radius: 4px; padding: 0 4px; font-size: 12px; }
.conn-ok { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.qr { width: 164px; height: 164px; padding: 8px; background: #fff; border-radius: 8px; border: 1px solid var(--line); flex: none; }
.qr img, .qr canvas { display: block; width: 148px !important; height: 148px !important; }
.url-big { font-size: 17px; font-weight: 700; word-break: break-all; margin-top: 4px; font-family: ui-monospace, Consolas, monospace; }
@media (max-width: 600px) {
  #offbar { padding: calc(6px + env(safe-area-inset-top)) 12px 6px; font-size: 13px; flex-wrap: nowrap; }
  #offbar span { display: none; }
  #offbar b { flex: 1; }
  #offbar b::after { content: " · переподключаемся…"; font-weight: 400; opacity: .85; }
  #offbar .btn { height: 28px; padding: 0 10px; font-size: 12px; }
}
