/* Photo Capture + Live Rating pages. Chrome (site header/bottom-nav) is
   suppressed here to maximize camera space -- these pages use their own
   minimal top bar + in-app Back button instead. */
body.capture-page { margin: 0; overflow: hidden; height: 100dvh; -webkit-user-select: none; user-select: none; }

#preview {
  position: fixed; inset: 0; z-index: 0;
  background: radial-gradient(125% 95% at 50% 28%, #2a2018 0%, #1a1512 70%);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
#preview img, #preview video { width: 100%; height: 100%; object-fit: cover; display: block; }
#preview > span {
  color: var(--muted); font-size: 16px; line-height: 1.55; text-align: center; font-weight: 500;
  max-width: 290px; padding: 24px;
}

.cap-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) 14px 10px;
  background: linear-gradient(to bottom, rgba(26,21,18,0.6), rgba(26,21,18,0));
}
.cap-topbar .title { flex: 1; text-align: center; font-size: 16px; font-weight: 600; }

.mode-row { position: fixed; top: calc(env(safe-area-inset-top) + 60px); left: 0; right: 0; z-index: 19; display: flex; justify-content: center; gap: 8px; }
.mode-pill {
  padding: 9px 18px; border-radius: var(--radius-pill); border: 1px solid var(--hair);
  background: var(--surface); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; font-family: var(--font); text-decoration: none; display: inline-block;
}
.mode-pill.active { background: var(--accent); border-color: var(--accent); color: #2a1810; }

#rating {
  position: fixed; top: 22%; left: 0; right: 0; z-index: 10;
  text-align: center; padding: 0 20px; pointer-events: none; min-height: 132px;
}
#rating .num { font-size: 76px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; text-shadow: 0 2px 26px rgba(0,0,0,0.5); display: inline-block; }
#rating .num .of { font-size: 24px; font-weight: 500; color: var(--muted); margin-left: 6px; }
#rating .react { margin-top: 10px; font-size: 19px; font-weight: 600; color: var(--text); text-shadow: 0 1px 10px rgba(0,0,0,0.7); }
#rating .meta { margin-top: 7px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
#rating .meta.good { color: var(--good); }
#rating .meta.err { color: var(--live); }
#rating .err {
  color: #ffb4a0; font-size: 14px; line-height: 1.4; display: inline-block; font-weight: 500;
  background: rgba(26,21,18,0.6); padding: 10px 14px; border-radius: 14px; pointer-events: auto;
}

.cap-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px 14px calc(env(safe-area-inset-bottom) + 14px);
}
#subtitle { text-align: center; font-size: 12px; color: var(--muted); font-weight: 500; }

/* 3-column grid, not flex+justify-content:center -- with an uneven number
   of side buttons (1 left, 2 right on the Photo page) centering the whole
   flex group centers the GROUP, not the shutter itself. A dedicated middle
   column keeps the shutter exactly centered regardless of how many buttons
   sit in the side columns. */
.shutter-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 0 14px; }
.shutter-row-side { display: flex; align-items: center; gap: 16px; }
.shutter-row-side.side-left { justify-self: start; }
.shutter-row-side.side-right { justify-self: end; }

.shutter-wrap { justify-self: center; display: flex; flex-direction: column; align-items: center; gap: 6px; touch-action: none; }
.shutter {
  width: 78px; height: 78px; border-radius: 50%; border: 0; background: none; padding: 0; cursor: pointer;
}
.shutter:active .shutter-ring { transform: scale(0.94); }

/* Ring: idle border is --text (cream), turns --live (coral) once a live
   session is running -- this is the primary "is it running" affordance,
   not a fill-color swap on the whole button. */
.shutter-ring {
  width: 76px; height: 76px; border-radius: 50%; border: 3.5px solid var(--text);
  display: flex; align-items: center; justify-content: center; position: relative;
  transition: border-color 0.15s ease, transform 0.1s var(--spring);
}
.shutter-ring.live { border-color: var(--live); }
/* Photo page only: viewfinder is armed (first tap taken, ready for the
   second tap to actually capture) -- ring turns the app's own peach/coral
   accent (not the green "good" color used elsewhere) so it stays
   consistent with the rest of Snappy's palette. */
.shutter.armed .shutter-ring { border-color: var(--accent); }
.shutter.armed .shutter-inner { background: var(--accent); }

/* Idle: solid filled dot in the accent color. Live: swaps to a small
   rounded-square "stop" glyph in the live/coral color -- same shape
   language as a record button. */
.shutter-inner { width: 60px; height: 60px; border-radius: 50%; background: var(--accent); transition: all 0.15s var(--spring); }
.shutter-ring.live .shutter-inner { width: 30px; height: 30px; border-radius: 8px; background: var(--live); }

/* Threshold mode + live: up/down glyphs inside the ring hint that the
   shutter itself can be dragged to raise/lower Keep>=. Hidden otherwise
   (including in Relative mode, where drag is disabled -- see live-capture.js). */
.shutter-arrow-up, .shutter-arrow-down {
  position: absolute; left: 50%; transform: translateX(-50%);
  font-size: 10px; font-weight: 900; color: #fff; line-height: 1;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6); display: none;
}
.shutter-arrow-up { top: 5px; }
.shutter-arrow-down { bottom: 5px; }
.shutter-ring.threshold-live .shutter-arrow-up,
.shutter-ring.threshold-live .shutter-arrow-down { display: block; }

/* Relative mode + live: static caption instead of drag arrows (drag is
   disabled in this mode; holding the shutter resets the bar instead). */
.shutter-cap {
  font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.72); letter-spacing: 0.2px;
  display: none;
}
.shutter-wrap.relative-live .shutter-cap { display: block; }

.shutter-row.disabled .shutter-wrap { opacity: 0.4; }

/* Temporary center-screen bubble shown after a hold-to-reset in Relative
   mode (e.g. "reset · now keeping shots above 5.0"), auto-dismisses. */
.live-toast {
  position: fixed; left: 50%; top: 40%; transform: translateX(-50%) translateY(6px); z-index: 50;
  background: rgba(26,21,18,0.92); color: var(--text); font-size: 13.5px; font-weight: 600;
  padding: 10px 18px; border-radius: var(--radius-pill); border: 1px solid var(--hair);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: 86vw; text-align: center;
}
.live-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* "beat X.X" / "keep ≥ X.X" -- positioned top-right over the viewfinder
   (not in a bottom sheet), matching the reference app. Only shown once a
   live session is running. */
.sweet-spot-pill {
  position: fixed; top: calc(env(safe-area-inset-top) + 108px); right: 14px; z-index: 12;
  display: none; align-items: center; gap: 5px; max-width: 46%;
  padding: 6px 13px; border-radius: var(--radius-pill);
  background: rgba(26,21,18,0.45); border: 1.5px solid rgba(240,153,107,0.65);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: var(--accent); font-size: 14px; font-weight: 800; letter-spacing: 0.1px;
}
.sweet-spot-pill.show { display: inline-flex; }
.sweet-spot-pill .ico { width: 14px; height: 14px; flex: 0 0 auto; }

/* live-only elements are hidden outside live mode */
.live-only { display: none; }
body.live-mode .live-only { display: flex; }
body.live-mode .photo-only { display: none; }

/* permission priming (rendered by camera-controller.js) */
.cc-perm-prime { position: fixed; inset: 0; z-index: 999; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.6); padding: 24px; }
.cc-perm-card { max-width: 340px; width: 100%; background: var(--surface-strong); border: 1px solid var(--hair); border-radius: 18px; padding: 22px; text-align: center; }
.cc-perm-card p { color: var(--text); line-height: 1.5; margin: 0 0 18px; }
.cc-perm-actions { display: flex; flex-direction: column; gap: 10px; }

/* connectivity banner */
#connBanner {
  position: fixed; left: 12px; right: 12px; top: calc(env(safe-area-inset-top) + 96px); z-index: 30;
  display: none; cursor: pointer; border-radius: 16px; padding: 10px 14px; text-align: center;
  background: var(--surface-strong); color: var(--accent2); font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--hair);
}
#connBanner.show { display: block; }
