/* IndexPro · приложение: экран замерщика (zamer.js). Переменные темы задаёт оболочка:
   --bg --bg2 --fg --muted --line --accent --accent-ink --ok --warn --err --r */
.z-view { padding-bottom: 8px; }
.z-view input, .z-view textarea, .z-view select { font-size: 17px; }
.z-load, .z-empty { padding: 24px 0; text-align: center; }
.z-spacer { height: calc(88px + env(safe-area-inset-bottom, 0px)); }
.z-acts { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.z-acts .btn { margin: 0; }

/* сводка */
.z-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 4px 0 8px; }
.z-tile { min-height: 64px; border: 1px solid var(--line); background: var(--bg2); color: var(--fg); border-radius: var(--r, 14px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 2px; font: inherit; cursor: pointer; }
.z-tile b { font: 700 22px/1 'JetBrains Mono', ui-monospace, monospace; }
.z-tile span { font-size: 12px; color: var(--muted); }
.z-tile.warn b { color: var(--warn); }
.z-tile.err b { color: var(--err); }
.z-tile.on { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.z-prog { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-bottom: 10px; }
.z-prog i { display: block; height: 100%; background: var(--ok); }

/* фильтры */
.z-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.z-chips::-webkit-scrollbar { display: none; }
.z-chips.wrap { flex-wrap: wrap; overflow: visible; }
.z-chips .chip { flex: 0 0 auto; min-height: 44px; white-space: nowrap; }
.z-chips.wrap .chip { white-space: normal; text-align: left; }
.z-n { font-family: 'JetBrains Mono', monospace; opacity: .7; margin-left: 2px; }

/* группы и строки */
.z-grp { margin: 6px 0 12px; }
.z-gh { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; margin: 0; padding: 8px 4px;
  font-size: 14px; font-weight: 700; color: var(--muted); background: var(--bg); text-transform: uppercase; letter-spacing: .03em; }
.z-gc { font-family: 'JetBrains Mono', monospace; }
.z-row { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 8px 12px; margin-bottom: 6px; border-radius: var(--r, 14px);
  background: var(--bg2); border: 1px solid var(--line); color: var(--fg); text-decoration: none; -webkit-tap-highlight-color: transparent; }
.z-row:active { transform: scale(.99); border-color: var(--accent); }
.z-row.z-flash { animation: z-flash 1.2s ease-out 1; }
@keyframes z-flash { 0% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 0 transparent; } }
.z-dot { flex: 0 0 12px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--muted); }
.st-work .z-dot { border-color: var(--accent); background: transparent; }
.st-done .z-dot { border-color: var(--ok); background: var(--ok); }
.st-prob .z-dot { border-color: var(--warn); background: var(--warn); }
.z-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.z-id { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.z-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.z-size { flex: 0 0 auto; font: 600 15px 'JetBrains Mono', ui-monospace, monospace; }
.z-size.none { font: 400 13px Manrope, sans-serif; color: var(--muted); }
.z-bd { flex: 0 0 auto; min-width: 24px; text-align: center; }
.badge.err, .z-bd.err { background: var(--err); color: #fff; }
.badge.warn, .z-bd.warn { background: var(--warn); color: #111; }

/* карточка проёма */
.z-ophead { display: flex; justify-content: space-between; align-items: center; min-height: 48px; }
.z-back { display: inline-flex; align-items: center; min-height: 48px; padding-right: 12px; color: var(--fg); text-decoration: none; font-weight: 600; }
.z-opid { margin: 0 0 6px; font: 700 22px/1.2 'JetBrains Mono', ui-monospace, monospace; word-break: break-word; }
.z-posl { margin: 0 0 8px; }
.z-note-ok { margin: 0 0 8px; padding: 10px 12px; border-radius: var(--r, 14px); border: 1px solid var(--ok); color: var(--fg); }
.z-st.st-none { background: var(--line); color: var(--fg); }
.z-st.st-work { background: var(--accent); color: var(--accent-ink); }
.z-st.st-done { background: var(--ok); color: #fff; }
.z-st.st-prob { background: var(--warn); color: #111; }
.z-card { margin-bottom: 10px; }
.z-lbl { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 0 6px; font-size: 14px; font-weight: 700; color: var(--muted); }
.z-lbl:first-child { margin-top: 0; }
.z-eq { min-height: 40px; padding: 0 12px; font-size: 14px; }
.z-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.z-num { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.z-num span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.z-num input { width: 100%; box-sizing: border-box; height: 56px; padding: 0 8px; text-align: center; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); color: var(--fg); font: 600 22px 'JetBrains Mono', ui-monospace, monospace; }
.z-num input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.z-num input::placeholder { color: var(--muted); font-weight: 400; font-size: 15px; }
.z-min { min-height: 18px; margin-top: 4px; font-size: 13px; }
.z-box { margin-top: 12px; padding: 12px 14px; border-radius: var(--r, 14px); background: var(--bg); border: 1px dashed var(--line);
  display: flex; flex-direction: column; gap: 2px; }
.z-box b { font: 700 28px/1.1 'JetBrains Mono', ui-monospace, monospace; color: var(--accent); }
.z-boxl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.z-box small { font-size: 12px; color: var(--muted); }
.z-disc:empty { display: none; }
.z-disc { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.z-dl { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); font-size: 15px; line-height: 1.35; }
.z-dl b { font-family: 'JetBrains Mono', monospace; }
.z-dl.ok { border-color: var(--ok); }
.z-dl.bad { border-color: var(--err); background: color-mix(in srgb, var(--err) 14%, transparent); }

.z-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.z-seg button { flex: 1 1 0; min-width: 64px; min-height: 48px; padding: 6px 8px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 15px; }
.z-pic { width: 28px; height: 34px; }
.z-cond.z-okc.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.z-cond.on:not(.z-okc) { background: var(--warn); border-color: var(--warn); color: #111; }
.z-fnote { margin-top: 10px; }
.z-fnote textarea { width: 100%; box-sizing: border-box; min-height: 64px; }
.z-phr { margin-top: 6px; }
.z-phr .chip { min-height: 40px; font-size: 14px; }

.z-phs { display: flex; gap: 8px; flex-wrap: wrap; }
.z-ph, .z-phadd { width: 96px; height: 96px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); padding: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center; font: inherit; font-size: 12px; cursor: pointer; }
.z-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.z-phadd { flex-direction: column; border-style: dashed; border-width: 2px; font-weight: 600; }
.z-phadd b { font-size: 30px; line-height: 1; color: var(--accent); }
.z-loc summary { min-height: 48px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }

.z-msgs { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.z-msgs li { padding: 10px 12px; border-radius: 12px; border-left: 4px solid var(--line); background: var(--bg2); font-size: 14px; line-height: 1.35; }
.z-msgs li.ok { border-left-color: var(--ok); }
.z-msgs li.warn { border-left-color: var(--warn); }
.z-msgs li.bad { border-left-color: var(--err); }

/* просмотр фото */
.z-lb { position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, .92); display: flex; flex-direction: column; justify-content: center; gap: 12px;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px)); color: #fff; }
.z-lb img { max-width: 100%; max-height: 74vh; object-fit: contain; align-self: center; border-radius: 8px; }

/* новый проём */
.z-step { display: grid; grid-template-columns: 56px 1fr 56px; gap: 8px; align-items: center; }
.z-step .btn { margin: 0; font-size: 24px; min-width: 0; padding: 0; }
.z-step input { height: 56px; text-align: center; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--fg);
  font: 600 22px 'JetBrains Mono', ui-monospace, monospace; min-width: 0; }

/* документы */
.z-kv { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; text-align: center; }
.z-kv b { display: block; font: 700 20px 'JetBrains Mono', ui-monospace, monospace; }
.z-kv span { font-size: 11px; color: var(--muted); }
.z-sig { margin-top: 12px; }
.z-sig-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.z-sig-box { position: relative; }
.z-sig-cv, .z-sig-img { display: block; width: 100%; height: 170px; border-radius: 12px; border: 1px solid var(--line); background: #fff; object-fit: contain; box-sizing: border-box; }
.z-resign { position: absolute; right: 8px; bottom: 8px; }
.z-sig > .btn.sm { margin-top: 6px; }
.z-docs { display: flex; flex-direction: column; gap: 8px; }
.z-docs .btn { margin: 0; justify-content: space-between; }
.z-send { width: 100%; min-height: 60px; font-size: 18px; }
.z-sendst { margin: 8px 0 0; }

@media (min-width: 640px) {
  .z-ph, .z-phadd { width: 120px; height: 120px; }
}
