/* ---------- mobile capture ---------- */
/* Column fills the scroll area: toolbar -> flexible preview stage -> history list.
   The stage takes all spare height so the latest photo is always fully visible
   above the dock; the history list scrolls the page naturally as it grows. */
.cap-screen {
  --cap-stage-ratio: 3 / 4;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cap-toolbar { display: flex; align-items: center; gap: 10px; }
.cap-gallery {
  width: 42px; height: 42px; flex-shrink: 0; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 50%; background: var(--bg-2); color: var(--text-2);
  -webkit-tap-highlight-color: transparent; transition: transform .12s ease;
}
.cap-gallery:active { transform: scale(.94); }
.cap-location {
  position: relative; flex: 1; min-width: 0; height: 42px;
  display: flex; align-items: center; gap: 8px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 21px; background: var(--bg-2); color: var(--text-2);
  transition: color .18s ease, border-color .18s ease;
}
.cap-location-ic { display: grid; place-items: center; flex-shrink: 0; }
.cap-location-text {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; font-weight: 550; text-align: left;
}
.cap-location.is-set { color: var(--accent-2); border-color: rgba(139, 152, 255, .44); }
.cap-location.needs-location { color: #facc15; border-color: rgba(234, 179, 8, .82); }
.cap-location.needs-location .cap-location-ic,
.cap-location.needs-location .cap-location-text { color: inherit; }
.cap-location select {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0;
  border: 0; border-radius: 21px; font: inherit; font-size: 16px;
}
.cap-location:focus-within { border-color: var(--accent); }
.cap-location option { background: var(--bg); color: var(--text); }
.cap-stage {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: var(--cap-stage-ratio);
  min-height: 240px;
  border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--bg-2);
}
.cap-stage img,
.cap-stage video { position: absolute; inset: 0; width: 100%; height: 100%; }
.cap-stage img { object-fit: cover; }
/* Keep latest shot framing consistent with live camera preview. */
.cap-stage .cap-shot { background: #07090d; object-fit: cover; }
.cap-camera-shell {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px; padding: 0;
}
.cap-camera-frame {
  position: relative; flex: 1; min-height: 0; overflow: hidden;
  background: #07090d;
}
.cap-camera-frame video {
  width: 100%; height: 100%; display: block; object-fit: cover;
}
.cap-pending-location {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: flex-end;
  padding: 14px; background: linear-gradient(180deg, rgba(5, 7, 11, .08), rgba(5, 7, 11, .72));
  opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.cap-pending-location.is-visible { opacity: 1; }
.cap-pending-card {
  width: 100%; display: flex; flex-direction: column; gap: 4px; padding: 12px 13px;
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 14px;
  background: rgba(10, 12, 16, .72); color: #fff;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.cap-pending-card b { font-size: 13px; }
.cap-pending-card span { color: rgba(255, 255, 255, .72); font-size: 11.5px; line-height: 1.4; }
.cap-detect-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.cap-detect-box {
  position: absolute; left: 0; top: 0; border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, .45);
  transition: transform .2s ease, width .2s ease, height .2s ease;
  will-change: transform, width, height;
}
.cap-detect-box.primary {
  border-color: rgba(139, 152, 255, .9);
  box-shadow: 0 0 0 1px rgba(11, 13, 18, .5), 0 0 18px rgba(108, 124, 255, .25);
}
.cap-detect-label {
  position: absolute; top: -26px; left: -2px;
  padding: 3px 8px; border-radius: 999px; white-space: nowrap;
  background: rgba(10, 12, 16, .72); border: 1px solid rgba(255, 255, 255, .12);
  color: #fff; font-size: 11px; font-weight: 650; text-transform: capitalize;
}
.cap-camera-hud {
  position: absolute; left: 0; right: 0; top: 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 10px 0; color: #fff; font-size: 12px; text-shadow: 0 1px 2px rgba(0, 0, 0, .55);
}
.cap-hud-close {
  width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, .14); border-radius: 50%;
  background: rgba(10, 12, 16, .58); color: #fff;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  -webkit-tap-highlight-color: transparent; transition: transform .12s ease;
}
.cap-hud-close:active { transform: scale(.92); }
/* closed-shutter lens: minimal dark stage with a dim camera icon */
.cap-lens {
  position: absolute; inset: 0; background: #07090d;
  display: grid; place-items: center;
}
.cap-hold-screen {
  position: absolute; inset: 0; display: grid; place-items: center; gap: 8px;
  padding: 18px; text-align: center; background: radial-gradient(circle at top, rgba(108, 124, 255, .18), transparent 46%), #07090d;
}
.cap-hold-screen b { font-size: 14px; color: #fff; }
.cap-hold-screen span { max-width: 220px; color: var(--text-2); font-size: 12px; line-height: 1.45; }
.cap-lens-ic { color: rgba(255, 255, 255, .18); }
.cap-lens-ic svg { width: 38px; height: 38px; stroke-width: 1.4; }
.cap-status {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 10px; padding: 26px 14px 12px;
  background: linear-gradient(180deg, transparent, rgba(5, 7, 11, .82));
}
.cap-status-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.cap-status-txt b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cap-status-txt span { color: var(--text-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cap-status-txt span.err { color: var(--red); }
.cap-status-actions { display: flex; align-items: center; gap: 8px; }
.cap-retake {
  border: 1px solid rgba(255, 255, 255, .12); background: rgba(10, 12, 16, .5); color: #fff;
  border-radius: 999px; padding: 7px 10px; font-size: 11px; font-weight: 650;
  white-space: nowrap; backdrop-filter: blur(10px);
}
.cap-mark { font-size: 15px; flex-shrink: 0; }
.cap-mark.ok { color: var(--green); }
.cap-mark.err { color: var(--red); }
.cap-list { display: flex; flex-direction: column; }
.cap-desktop-hint { color: var(--text-3); font-size: 12px; text-align: center; margin-top: 26px; line-height: 1.55; }
.capcard {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px;
}
.capcard .cap-mark { font-size: 14px; }
.capcard img { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: var(--bg-3); flex-shrink: 0; }
.capinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.capinfo b { font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.capinfo .sub { color: var(--text-3); font-size: 11.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.capinfo .sub.err { color: var(--red); }