/* ProofShot SR Camera — «Pro-камера».
   ВАЖНО: только hex/rgba (НЕ oklch/color-mix) — старые Android WebView.
   Токены --cam-*: циан = бренд-акцент админки (#22d3ee ≈ oklch(67% .19 192)). */

:root {
  --cam-accent:      #22d3ee;
  --cam-accent-rgb:  34, 211, 238;
  --cam-bg:          #000;
  --cam-surface:     rgba(13, 18, 22, 0.92);
  --cam-text:        #fff;
  --cam-text-dim:    rgba(255, 255, 255, 0.72);
  --cam-ok:          #34d399;
  --cam-warn:        #fbbf24;
  --cam-danger:      #f87171;
  --cam-insp:        #a78bfa;
  --cam-radius:      16px;
  --cam-dur:         220ms;
  --cam-ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

/* Design refresh 2026-07 — v2 (тумблер design.v2, синхронно с админкой,
   см. tokens.css). Полная палитра референса (не только геометрия — фаза 1
   этого тумблера была только --cam-radius). hex-only ограничение сохранено
   (см. шапку файла) — здесь только hex/rgba, никаких oklch/color-mix.
   Мини-апп всегда тёмный (нет светлой темы) — берём тёмную палитру
   референса. --cam-insp (роль «инспектор») намеренно НЕ совпадает с новым
   --cam-accent — иначе роль перестанет отличаться визуально от акцента. */
[data-design="v2"] {
  --cam-accent:      #7C6CFF;
  --cam-accent-rgb:  124, 108, 255;
  --cam-ok:          #31D158;
  --cam-warn:        #FFB020;
  --cam-danger:      #FF5C5C;
  --cam-insp:        #C084FC;
  --cam-radius:      20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body {
  width: 100%; height: 100%;
  background: var(--cam-bg); color: var(--cam-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
}
body { display: flex; flex-direction: column; }

.hidden { display: none !important; }

.stage {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  background: var(--cam-bg);
}

#video, #canvas {
  width: 100%; height: 100%;
  background: var(--cam-bg);
}
/* Live: показываем ВЕСЬ кадр без зума/обрезки (object-fit: contain).
   На устройствах с портретным потоком (Android) заполняет почти весь экран;
   на iOS-ландшафтном потоке — лёгкая матовая рамка сверху/снизу (без зума).
   Рамка-гид выравнивается по реальному кадру (см. videoDisplayRect в app.js). */
#video  { object-fit: contain; }
/* Review: всё снятое фото целиком, на макс. площади. */
#canvas { object-fit: contain; }

/* Верхний скрим — читаемость чипов поверх любого фона.
   (Нижний скрим уже даёт .controls.bottom своим градиентом.) */
#stage-live::before {
  content: '';
  position: absolute; left: 0; right: 0; top: 0;
  height: 150px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.5), rgba(0,0,0,0));
  pointer-events: none;
  z-index: 4;
}

/* ─── Watermark preview (live view) ──────────────────────────────────────────
   Скрыто по умолчанию (закрывало большую часть кадра) — открывается кнопкой
   «i» и само прячется. На СНИМКИ watermark наносится всегда (canvas). */
.watermark {
  position: absolute;
  left: 0; right: 0; bottom: 108px;
  padding: 10px 16px 12px;
  background: rgba(0,0,0,0.72);
  border-top: 2px solid rgba(var(--cam-accent-rgb), 0.55);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
  white-space: pre-line;
  pointer-events: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.watermark.open { opacity: 1; visibility: visible; }

/* Кнопка «i»: показать, что попадёт на фото */
.wm-toggle {
  position: absolute;
  left: 18px;
  bottom: calc(33px + env(safe-area-inset-bottom));
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(0,0,0,0.45);
  color: rgba(255,255,255,0.9);
  font-size: 16px; font-weight: 700;
  font-family: Georgia, serif;
  font-style: italic;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 7;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.wm-toggle:active { background: rgba(var(--cam-accent-rgb), 0.3); }

/* ─── Controls ──────────────────────────────────────────────────────────────── */
.controls.bottom {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 60%, rgba(0,0,0,0));
}

/* Кнопка съёмки: пружинное нажатие + progress-ring (1/3 за кадр) */
.snap {
  position: relative;
  width: 76px; height: 76px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.9);
  box-shadow: 0 0 0 4px rgba(var(--cam-accent-rgb), 0.22), 0 0 0 8px rgba(var(--cam-accent-rgb), 0.07);
  background: transparent;
  display: flex; justify-content: center; align-items: center;
  cursor: pointer;
  transition: transform 160ms var(--cam-ease-spring), box-shadow 0.15s;
}
.snap:active {
  transform: scale(0.9);
  box-shadow: 0 0 0 3px rgba(var(--cam-accent-rgb), 0.5), 0 0 0 7px rgba(var(--cam-accent-rgb), 0.15);
}
.snap-inner {
  width: 58px; height: 58px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.1s, background 0.1s;
}
.snap:active .snap-inner {
  transform: scale(0.88);
  background: rgba(var(--cam-accent-rgb), 0.9);
}
.snap-ring {
  position: absolute;
  inset: -9px;
  width: calc(100% + 18px);
  height: calc(100% + 18px);
  transform: rotate(-90deg);
  pointer-events: none;
}
.snap-ring .track { stroke: rgba(255,255,255,0.18); }
.snap-ring .fill {
  stroke: var(--cam-accent);
  stroke-linecap: round;
  transition: stroke-dashoffset 350ms var(--cam-ease-spring);
  filter: drop-shadow(0 0 4px rgba(var(--cam-accent-rgb), 0.7));
}

/* Кнопки review */
/* Единая система кнопок review: одинаковые токены, иконка + подпись */
.controls.three .action {
  flex: 1; max-width: 140px;
  min-height: 48px;
  padding: 12px 10px;
  border-radius: var(--cam-radius);
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: transform 120ms var(--cam-ease-spring), opacity 0.1s;
}
/* Иконки (inline SVG data-URI; цвет зашит под каждую кнопку) */
.controls.three .action::before {
  content: '';
  width: 17px; height: 17px;
  flex-shrink: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
.action.retake { background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.18); }
.action.retake::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 9-9 9 9 0 0 0-6.5 2.8L3 8'/%3E%3Cpath d='M3 3v5h5'/%3E%3C/svg%3E");
}
#btn-more      { background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.18); }
#btn-more::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z'/%3E%3Ccircle cx='12' cy='13' r='4'/%3E%3C/svg%3E");
}
.action.cancel { background: rgba(220,50,50,0.18); color: #ff8585; border: 1px solid rgba(220,50,50,0.3); }
.action.cancel::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff8585' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E");
}
.action.send   { background: rgba(var(--cam-accent-rgb), 0.18); color: var(--cam-accent); border: 1px solid rgba(var(--cam-accent-rgb), 0.3); }
.action:active { transform: scale(0.96); }

/* Иконка «Отправить» — тёмная (кнопка с циан-заливкой в шите) */
#review-sheet .action.send::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2306262e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='22' y1='2' x2='11' y2='13'/%3E%3Cpolygon points='22 2 15 22 11 13 2 9 22 2'/%3E%3C/svg%3E");
}

/* ─── Overlay ─────────────────────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 100;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  gap: 16px;
}
.overlay.hidden { display: none; }

.loader {
  width: 44px; height: 44px;
  border: 3px solid rgba(255,255,255,0.12);
  border-top-color: var(--cam-accent);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#overlay-text {
  font-size: 14px;
  text-align: center;
  padding: 0 28px;
  white-space: pre-line;
  color: rgba(255,255,255,0.85);
  line-height: 1.6;
}

/* ─── Error ──────────────────────────────────────────────────────────────── */
.error-box {
  background: rgba(20,20,28,0.95);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 28px 24px;
  border-radius: 20px;
  text-align: center;
  max-width: 82%;
  display: flex; flex-direction: column; gap: 18px;
}
#error-text { font-size: 14px; line-height: 1.6; white-space: pre-line; color: rgba(255,255,255,0.9); }
.error-box .action {
  background: rgba(var(--cam-accent-rgb), 0.15);
  color: var(--cam-accent);
  border: 1px solid rgba(var(--cam-accent-rgb), 0.3);
  border-radius: 12px;
  padding: 13px 20px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
}

/* ─── Status chips (top) ─────────────────────────────────────────────────── */
#guideBar {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: calc(12px + env(safe-area-inset-top)) 12px 0;
  pointer-events: none;
  z-index: 6;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--cam-surface);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--cam-text);
  line-height: 1.3;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.chip-step::before { background: var(--cam-accent); box-shadow: 0 0 5px rgba(var(--cam-accent-rgb), 0.8); }
#guideStepNum {
  font-size: 10px;
  color: var(--cam-text-dim);
  text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 700;
}
#guideStepTitle { font-size: 12px; font-weight: 700; }

.chip-gps      { color: var(--cam-text-dim); }
.chip-gps::before      { background: var(--cam-text-dim); }
.chip-gps.ok   { color: var(--cam-ok); }
.chip-gps.ok::before   { background: var(--cam-ok); box-shadow: 0 0 5px rgba(52,211,153,0.7); }
.chip-gps.warn { color: var(--cam-warn); }
.chip-gps.warn::before { background: var(--cam-warn); }
.chip-gps.bad  { color: var(--cam-danger); }
.chip-gps.bad::before  { background: var(--cam-danger); box-shadow: 0 0 5px rgba(248,113,113,0.7); }

.chip-queue { color: var(--cam-warn); }
.chip-queue::before { background: var(--cam-warn); }

.chip-insp {
  color: var(--cam-insp);
  border-color: rgba(167,139,250,0.45);
  background: rgba(45, 32, 80, 0.88);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10.5px;
}
.chip-insp::before { background: var(--cam-insp); box-shadow: 0 0 5px rgba(167,139,250,0.8); }

/* ─── Сканер QR-кода аптеки ──────────────────────────────────────────────── */
.scan-overlay {
  position: absolute; inset: 0;
  z-index: 9;                       /* выше кнопки съёмки — пока не отсканирован */
  background: rgba(0,0,0,0.5);
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  gap: 14px;
  padding: 20px;
}
.scan-frame {
  width: 220px; height: 220px;
  border-radius: 18px;
  border: 2px solid rgba(var(--cam-accent-rgb), 0.9);
  box-shadow: 0 0 0 4000px rgba(0,0,0,0.25), 0 0 24px rgba(var(--cam-accent-rgb), 0.35);
  position: relative;
  overflow: hidden;
}
.scan-frame::after {
  content: '';
  position: absolute; left: 8%; right: 8%; top: 0;
  height: 2px;
  background: rgba(var(--cam-accent-rgb), 0.9);
  box-shadow: 0 0 10px rgba(var(--cam-accent-rgb), 0.9);
  animation: scanline 2.2s ease-in-out infinite alternate;
}
@keyframes scanline { from { top: 6%; } to { top: 92%; } }
.scan-hint {
  font-size: 15px; font-weight: 700; color: #fff;
  text-align: center; text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.scan-sub {
  font-size: 12px; color: var(--cam-text-dim);
  text-align: center; margin-top: -8px;
}
.scan-skip {
  margin-top: 8px;
  background: rgba(255,255,255,0.12); color: #fff;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 12px; padding: 11px 18px;
  font-size: 13px; font-weight: 600; cursor: pointer;
}

/* ─── Tap-to-focus ring ──────────────────────────────────────────────────── */
#focus-ring {
  position: absolute;
  width: 76px; height: 76px;
  margin-left: -38px; margin-top: -38px;   /* центрируем по точке тапа */
  border: 2px solid var(--cam-accent);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(var(--cam-accent-rgb), 0.6);
  pointer-events: none;
  z-index: 8;
  opacity: 0;
}
#focus-ring.flash {
  animation: focusPulse 0.6s ease-out;
}
@keyframes focusPulse {
  0%   { opacity: 0; transform: scale(1.4); }
  30%  { opacity: 1; transform: scale(1.0); }
  60%  { opacity: 1; transform: scale(0.92); }
  100% { opacity: 0; transform: scale(0.92); }
}

/* ─── Steady (стабилизация) чип ──────────────────────────────────────────── */
.chip-steady {
  color: var(--cam-warn);
  border-color: rgba(251,191,36,0.45);
  background: rgba(60,45,10,0.9);
}
.chip-steady::before { background: var(--cam-warn); box-shadow: 0 0 5px rgba(251,191,36,0.8); }

/* ─── Flash / shutter overlay ────────────────────────────────────────────── */
#flashOverlay {
  position: absolute; inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.06s;
  z-index: 8;
}
#flashOverlay.shutter {
  background: #000;
  opacity: 1;
  transition: none;
}

/* ─── Shelf Camera: угловые скобки рамки + сетка третей ──────────────────── */
#frameCorners {
  position: absolute;
  pointer-events: none;
  transition: left 250ms ease, top 250ms ease, width 250ms ease, height 250ms ease;
}
.corner {
  position: absolute;
  width: 28px; height: 28px;
}
.corner::before, .corner::after {
  content: '';
  position: absolute;
  background: var(--frame-color, var(--cam-accent));
  border-radius: 2px;
  /* Свечение по цвету рамки */
  box-shadow: 0 0 6px var(--frame-color, var(--cam-accent));
}
.corner::before { width: 28px; height: 3px; top: 0; left: 0; }
.corner::after  { width: 3px; height: 28px; top: 0; left: 0; }
.corner.tl { top: -1px; left: -1px; }
.corner.tr { top: -1px; right: -1px; transform: rotate(90deg); transform-origin: right top; }
.corner.bl { bottom: -1px; left: -1px; transform: rotate(270deg); transform-origin: left bottom; }
.corner.br { bottom: -1px; right: -1px; transform: rotate(180deg); transform-origin: right bottom; }

#gridLines line {
  stroke: rgba(255,255,255,0.28);
  stroke-width: 1;
}

.frame-label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -36px;
  white-space: nowrap;
  background: rgba(0,0,0,0.72);
  border: 1px solid rgba(var(--cam-accent-rgb), 0.25);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* ─── Progress dots ──────────────────────────────────────────────────────── */
#progress-dots {
  position: absolute;
  bottom: 108px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  pointer-events: none;
}
.progress-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  transition: background 0.2s, transform 0.2s;
}
.progress-dot.active {
  background: var(--frame-color, var(--cam-accent));
  transform: scale(1.3);
  box-shadow: 0 0 5px var(--frame-color, var(--cam-accent));
}
.progress-dot.done {
  background: rgba(255,255,255,0.55);
}

/* ─── Zoom control ───────────────────────────────────────────────────────── */
.zoom-bar {
  position: absolute;
  left: 20px; right: 20px;
  /* ниже чипов и чёлки: фиксированный top наезжал на guideBar на iPhone */
  top: calc(64px + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(0,0,0,0.52);
  border-radius: 22px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10;
  pointer-events: auto;
}
.zoom-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.10);
  color: #fff;
  font-size: 20px; font-weight: 300; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  touch-action: manipulation;
}
.zoom-btn:active { background: rgba(var(--cam-accent-rgb), 0.22); }
/* Ползунок: видимая дорожка 3px, но touch-зона 26px — удобно пальцем */
.zoom-slider {
  flex: 1;
  height: 26px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  outline: none;
  cursor: pointer;
}
.zoom-slider::-webkit-slider-runnable-track {
  height: 3px;
  background: rgba(255,255,255,0.22);
  border-radius: 2px;
}
.zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  margin-top: -9.5px;            /* центрируем шарик на 3px-дорожке */
  border-radius: 50%;
  background: var(--cam-accent);
  box-shadow: 0 0 6px rgba(var(--cam-accent-rgb), 0.6);
  cursor: pointer;
}
.zoom-slider::-moz-range-track {
  height: 3px;
  background: rgba(255,255,255,0.22);
  border-radius: 2px;
}
.zoom-slider::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--cam-accent);
  border: none;
  cursor: pointer;
}
.zoom-label {
  font-size: 11px; font-weight: 700;
  color: rgba(255,255,255,0.85);
  min-width: 32px;
  text-align: right;
  flex-shrink: 0;
}

/* ─── Review bottom-sheet ────────────────────────────────────────────────── */
#review-sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 5;
  background: var(--cam-surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px 20px 0 0;
  border-top: 1px solid rgba(255,255,255,0.10);
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: sheetUp 260ms var(--cam-ease-spring);
}
@keyframes sheetUp {
  from { transform: translateY(48px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Миниатюры внутри шита — в потоке, не absolute */
#review-sheet #cap-thumbs {
  position: static;
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 0;
  flex-wrap: wrap;
}
.thumb-wrap { position: relative; }
.thumb-img {
  width: 78px; height: 104px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,0.4);
  display: block;
}
.thumb-del {
  position: absolute;
  top: -8px; right: -8px;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.5);
  background: var(--cam-danger);
  color: #fff;
  font-size: 15px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* Кнопки внутри шита: primary «Отправить» на всю ширину сверху */
#review-sheet .controls.three {
  position: static;
  padding: 0;
  background: none;
  flex-wrap: wrap;
  gap: 10px;
}
#review-sheet .action.send {
  flex-basis: 100%;
  max-width: none;
  order: -1;
  padding: 16px 12px;
  font-size: 15px;
  border-radius: var(--cam-radius);
  background: var(--cam-accent);
  color: #06262e;
  border: none;
  box-shadow: 0 4px 18px -4px rgba(var(--cam-accent-rgb), 0.55);
}

/* ─── Опрос после визита ─────────────────────────────────────────────────── */
#survey-box, #posm-box {
  width: 100%; max-width: 480px;
  padding: calc(18px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 12px;
}
#survey-title, #posm-title { font-size: 18px; font-weight: 700; color: #fff; }
#survey-desc, #posm-desc { font-size: 12.5px; color: var(--cam-text-dim); line-height: 1.5; margin-top: -6px; }
#survey-desc:empty, #posm-desc:empty { display: none; }
.sq {
  background: var(--cam-surface);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--cam-radius);
  padding: 14px;
}
.sq.missing { border-color: var(--cam-danger); }
.sq-text { font-size: 14px; font-weight: 600; color: #fff; line-height: 1.4; margin-bottom: 10px; }
.sq-text .req { color: var(--cam-danger); }
.sq-opts { display: flex; flex-direction: column; gap: 8px; }
.sq-opt {
  text-align: left;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff; border-radius: 12px;
  padding: 12px 14px; font-size: 14px; cursor: pointer;
  transition: background 120ms, border-color 120ms;
}
.sq-opt.sel {
  background: rgba(var(--cam-accent-rgb), 0.18);
  border-color: var(--cam-accent);
  color: var(--cam-accent);
  font-weight: 600;
}
.sq-yn { display: flex; gap: 10px; }
.sq-yn .sq-opt { flex: 1; text-align: center; font-weight: 600; }
.sq textarea {
  width: 100%; min-height: 84px; resize: vertical;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px; color: #fff;
  padding: 11px 13px; font-size: 14px;
  font-family: inherit; outline: none;
}
.sq textarea:focus { border-color: var(--cam-accent); }
.sq-photo-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(255,255,255,0.07);
  border: 1px dashed rgba(255,255,255,0.3);
  color: #fff; border-radius: 12px;
  padding: 13px; font-size: 14px; cursor: pointer; width: 100%;
}
.sq-photo-btn.done { border-style: solid; border-color: var(--cam-ok); color: var(--cam-ok); }
.sq-photo-thumb { width: 64px; height: 86px; object-fit: cover; border-radius: 10px; margin-top: 8px;
  border: 2px solid rgba(255,255,255,0.35); }
#survey-submit {
  margin-top: 6px; padding: 16px;
  background: var(--cam-accent); color: #06262e;
  border: none; border-radius: var(--cam-radius);
  font-size: 15px; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 18px -4px rgba(var(--cam-accent-rgb), 0.55);
}

/* ─── Success overlay (галочка) ──────────────────────────────────────────── */
#success-overlay {
  position: fixed; inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.92);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
}
#success-overlay svg {
  width: 96px; height: 96px;
}
.check-circle {
  stroke: var(--cam-accent);
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: checkDash 0.5s ease forwards;
  filter: drop-shadow(0 0 10px rgba(var(--cam-accent-rgb), 0.5));
}
.check-mark {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: checkDash 0.35s 0.45s ease forwards;
}
@keyframes checkDash { to { stroke-dashoffset: 0; } }
#success-text {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  animation: successFade 0.4s 0.6s ease both;
}
@keyframes successFade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */

/* Настоящие планшеты (телефон в ландшафте сюда НЕ попадает — у него высота мала) */
@media (min-width: 900px) and (orientation: landscape) and (min-height: 600px) {
  .snap { width: 88px; height: 88px; }
  .snap-inner { width: 68px; height: 68px; }
  .watermark { bottom: 120px; font-size: 15px; padding: 11px 22px 13px; }
  .controls.three .action { max-width: 170px; padding: 15px 12px; font-size: 14px; }
  #review-sheet { left: 50%; right: auto; transform: translateX(-50%); width: 560px; border-radius: 20px 20px 0 0; }
}

/* Телефон в ландшафте: раскладка как у нативной камеры —
   кнопка съёмки колонкой справа, watermark компактный слева внизу,
   зум сверху между чипами и рамкой. Ничего не перекрывается. */
@media (orientation: landscape) and (max-height: 520px) {
  /* чипы не заезжают под колонку кнопок и чёлку */
  #guideBar {
    padding-left: calc(12px + env(safe-area-inset-left));
    padding-right: 128px;
  }

  /* колонка управления справа */
  .controls.bottom {
    left: auto; right: 0; top: 0; bottom: 0;
    width: 116px;
    flex-direction: column;
    padding: 10px calc(10px + env(safe-area-inset-right)) 10px 10px;
    background: linear-gradient(to left, rgba(0,0,0,0.65) 55%, rgba(0,0,0,0));
  }
  .snap { width: 68px; height: 68px; }
  .snap-inner { width: 52px; height: 52px; }

  /* компактный watermark слева внизу, не под кнопкой */
  .watermark {
    right: 116px; bottom: 0;
    font-size: 10.5px;
    line-height: 1.35;
    padding: 7px 12px calc(7px + env(safe-area-inset-bottom));
    border-top-width: 1px;
  }

  /* зум — верхняя полоса, левее колонки кнопки, ниже чипов */
  .zoom-bar {
    left: 16px; right: 132px;
    top: calc(50px + env(safe-area-inset-top));
  }

  /* точки-прогресс дублируют кольцо — в ландшафте прячем */
  #progress-dots { display: none; }
  /* подпись рамки уходит под watermark — прячем */
  .frame-label { display: none; }

  /* review: боковая панель справа, фото остаётся видно слева */
  #review-sheet {
    left: auto; right: 0; top: 0; bottom: 0;
    width: 300px;
    border-radius: 20px 0 0 20px;
    border-top: none;
    border-left: 1px solid rgba(255,255,255,0.10);
    justify-content: center;
    overflow-y: auto;
    padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
    animation: sheetRight 260ms var(--cam-ease-spring);
  }
  #review-sheet .controls.three { flex-direction: column; flex-wrap: nowrap; }
  #review-sheet .controls.three .action { max-width: none; width: 100%; }
  #review-sheet .thumb-img { width: 64px; height: 86px; }
}
@keyframes sheetRight {
  from { transform: translateX(48px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@media (-webkit-min-device-pixel-ratio: 2) {
  .watermark { font-weight: 500; }
}

/* ─── Экран подтверждения аптеки ─────────────────────────────────────────── */
.confirm-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: rgba(13, 18, 22, 0.96);
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 20px;
  padding: 32px 24px 24px;
  max-width: 340px;
  width: calc(100% - 48px);
  gap: 0;
}
.confirm-icon {
  font-size: 40px;
  margin-bottom: 16px;
  line-height: 1;
}
.confirm-name {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.3;
}
.confirm-addr {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 4px;
  line-height: 1.4;
}
.confirm-contract {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 28px;
}
.confirm-btn-ok {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: #22d3ee;
  color: #000;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 10px;
  transition: opacity 0.15s;
}
.confirm-btn-ok:active { opacity: 0.8; }
.confirm-btn-back {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.confirm-btn-back:active { opacity: 0.6; }
