/* Camera page: a full-screen viewfinder with a floating bottom bar. Builds on style.css tokens. */
body.cam {
  position: fixed;
  inset: 0;
  height: auto;
  overflow: hidden;
  background: #111111;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.cam #gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.cam-top {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  pointer-events: none;
}
.cam-top a.tag { pointer-events: auto; color: var(--ink); text-decoration: none; }

/* Start screen */
.start {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--page);
}
.start-card { width: min(360px, 100%); display: grid; gap: 10px; justify-items: start; }
.start-card h1 { margin: 0; font-weight: 400; font-size: 34px; letter-spacing: -0.01em; line-height: 1.1; }
.start-card p { margin: 0; font-size: 15px; line-height: 1.45; color: #3a3a3a; }
.start-card .fine, .sheet .fine { font-size: 11px; line-height: 1.4; color: var(--muted); }
.start-card .error { color: var(--warn); font-size: 13px; }
.primary {
  margin-top: 8px;
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: var(--r-ctl);
  background: var(--ink);
  color: var(--card);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

/* Bottom bar */
.cam-bottom {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  display: grid;
  gap: 8px;
}
.cam-bottom .dist { justify-content: center; }
.calib {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.calib .chips { justify-content: center; }
.cam-bottom .calib .chip { background: var(--chip); backdrop-filter: none; -webkit-backdrop-filter: none; }
.cam-bottom .chip { background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.cam-bottom .chip[aria-pressed="true"] { background: var(--ink); }
.who-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.seg.who {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.seg.who button {
  display: grid;
  gap: 2px;
  justify-items: center;
  padding: 9px 6px;
  border-radius: 10px;
  min-width: 0;
}
.seg.who .label { color: inherit; opacity: 0.6; }
.seg.who .rx { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.02em; white-space: nowrap; }
.seg.who button[aria-checked="true"] .label { opacity: 0.7; }
.edit {
  border: 0;
  border-radius: 14px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

/* Edit sheet */
.sheet {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.25);
}
.sheet-card {
  width: 100%;
  max-height: 86%;
  overflow-y: auto;
  box-sizing: border-box;
  display: grid;
  gap: 8px;
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
  border-radius: var(--r-card) var(--r-card) 0 0;
  background: var(--card);
  -webkit-user-select: none;
  user-select: none;
}
.sheet-head { display: flex; justify-content: space-between; align-items: baseline; }
.sheet .chips { padding-bottom: 2px; }
.sheet .slider, .sheet select { --row: 32px; }
.sheet .slider { height: 32px; }
.sheet input[type="range"] { touch-action: pan-y; }

@media (min-width: 700px) {
  .cam-bottom { left: 50%; right: auto; width: 460px; transform: translateX(-50%); }
  .sheet { justify-content: center; align-items: flex-end; }
  .sheet-card { width: 460px; }
}

/* Where the eye is looking (tap the picture to move it) */
.gaze {
  position: absolute;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 1.5px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}
.sheet input:disabled { opacity: 0.4; cursor: default; }
