/* Aura Camera — web test build. Mobile-first portrait, dark theme. */

:root {
  --bg: #0d0f12;
  --panel: #16191f;
  --ink: #eef1f4;
  --dim: #9aa3ad;
  --accent: #7fd4c1;
  --line: #262b33;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(13, 15, 18, 0.92);
  backdrop-filter: blur(6px);
  z-index: 10;
}

.app-header h1 {
  font-size: 1.1rem;
  font-weight: 650;
  margin: 0;
  letter-spacing: 0.01em;
}

.badge {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0d0f12;
  background: var(--accent);
  border-radius: 999px;
  padding: 3px 10px;
}

.app {
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 12px 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ---------- Stage ---------- */

.stage {
  position: relative;
  background: #000;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

#gl {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  background: #000;
}

#video { display: none; }

.error {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: rgba(10, 10, 12, 0.9);
  color: #ffb4a6;
  font-size: 0.95rem;
  line-height: 1.5;
}

.status {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--dim);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  pointer-events: none;
}

/* ---------- Controls ---------- */

.controls {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.palette-group {
  border: none;
  margin: 0;
  padding: 0;
}

.palette-group legend {
  font-size: 0.78rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--dim);
  padding: 0;
  margin-bottom: 8px;
}

.chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.chip {
  border: 2px solid transparent;
  border-radius: 8px;
  min-height: 40px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
  cursor: pointer;
  padding: 6px 4px;
}

.chip.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.sliders {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.slider {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.88rem;
}

.slider-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.slider .val {
  color: var(--dim);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  min-height: 32px; /* comfortable touch target */
}

.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 8px;
}

/* ---------- Relief controls ---------- */

.relief-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.relief-controls[hidden] { display: none; }

.mode-toggle button,
.pip-toggle button,
.buttons button {
  border: 1px solid var(--line);
  background: #20252d;
  color: var(--ink);
  border-radius: 8px;
  padding: 12px 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.mode-toggle button.active,
.pip-toggle button.active,
.buttons button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0d0f12;
}

.norm-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.norm-toggle input[type="checkbox"] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}

.norm-note {
  font-size: 0.75rem;
  color: var(--dim);
  margin: 0;
  line-height: 1.45;
}

/* ---------- PIP controls (Phase 4) ---------- */

.pip-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.pip-controls[hidden] { display: none; }

.pip-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.pip-toggle button {
  border: 1px solid var(--line);
  background: #20252d;
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 4px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.captures-head {
  font-size: 0.75rem;
  color: var(--dim);
  margin: 0 0 6px;
  line-height: 1.45;
}

.captures-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  min-height: 4px;
}

.capture-thumb {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0;
  background: #000;
  cursor: pointer;
  flex: 0 0 auto;
  overflow: hidden;
}

.capture-thumb img {
  display: block;
  width: 84px;
  height: 63px;
  object-fit: cover;
}

.buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.buttons button:active {
  transform: scale(0.98);
}

/* ---------- Legend ---------- */

.legend {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.legend h2,
.explainer h2 {
  font-size: 0.78rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--dim);
  margin: 0 0 10px;
}

.legend-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.legend-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 56px;
}

.swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.lname {
  font-size: 0.68rem;
  color: var(--dim);
  text-align: center;
  line-height: 1.25;
}

.fine {
  font-size: 0.75rem;
  color: var(--dim);
  margin: 10px 0 0;
  line-height: 1.5;
}

/* ---------- Explainer ---------- */

.explainer {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.explainer p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: #d6dbe1;
  margin: 0 0 10px;
}

.explainer p:last-child { margin-bottom: 0; }

/* ---------- Transfer features (2026-10-21.4) ---------- */

.live-controls,
.static-controls,
.session-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.live-controls[hidden],
.static-controls[hidden],
.still-controls[hidden] { display: none; }

.still-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gallery {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gallery h2 {
  font-size: 0.78rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--dim);
  margin: 0;
}

.gallery-viewer img,
.gallery-viewer video,
.gallery-viewer canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: #000;
}

.gallery-viewer [hidden] { display: none; }

.video-speed {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
}

.video-speed[hidden] { display: none; }

.video-speed select {
  min-height: 40px;
  background: #20252d;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.95rem;
}

.compare-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gallery-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gallery-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}

.gallery-item .gthumb {
  flex: 0 0 auto;
  width: 96px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  background: #000;
  display: block;
}

.gallery-item .gmeta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gallery-item .gname {
  font-size: 0.75rem;
  color: var(--dim);
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.gallery-item .gbtns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gallery-item .gbtns button {
  border: 1px solid var(--line);
  background: #20252d;
  color: var(--ink);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.gallery-item .gbtns button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0d0f12;
}

/* ---------- Wider screens ---------- */

@media (min-width: 560px) {
  .chips { grid-template-columns: repeat(4, 1fr); }
  .buttons { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Gap builds (2026-10-22.1) ---------- */

.ui-mode-switch {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.ui-mode-switch input[type="checkbox"] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}

#annotCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  touch-action: none;
  z-index: 3;
}

.framing-guide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  opacity: 0.9;
}

.framing-guide[hidden] { display: none; }

.framing-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 26px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  margin: 0;
  pointer-events: none;
  z-index: 2;
}

.framing-caption[hidden] { display: none; }

/* Looks strip (G3) */
.looks {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.looks h2 {
  font-size: 0.78rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--dim);
  margin: 0;
}

.looks-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.look-thumb {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #000;
  padding: 6px;
  cursor: pointer;
  color: var(--ink);
}

.look-thumb.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.look-canvas {
  width: 72px;
  height: 96px;
  display: block;
  border-radius: 4px;
  background: #111;
}

.look-name {
  font-size: 0.75rem;
  font-weight: 650;
}

/* Capture tools + assessment (G6/G7/G9 panels) */
.capture-tools,
.assessment-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.assess-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.assess-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.assess-label {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 36px;
  background: #20252d;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.85rem;
}

.assess-shot-status {
  flex: 0 0 auto;
  font-size: 0.72rem;
  color: var(--dim);
  min-width: 52px;
}

.assess-row button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: #20252d;
  color: var(--ink);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

/* Presentation mode (G5) */
.exit-present {
  display: none;
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 50;
  border: 1px solid var(--line);
  background: rgba(32, 37, 45, 0.92);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 650;
  cursor: pointer;
}

body.presenting .exit-present { display: block; }

body.presenting .app-header,
body.presenting .controls,
body.presenting .looks,
body.presenting .simple-view,
body.presenting .gallery,
body.presenting .legend,
body.presenting .explainer { display: none; }

body.presenting .app {
  max-width: none;
  padding: 0;
  gap: 0;
}

body.presenting .stage {
  border: none;
  border-radius: 0;
  height: 100vh;
  height: 100dvh;
}

body.presenting #gl {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Simple front end (N) */
.simple-view { display: none; }

body.simple .simple-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

body.simple .controls,
body.simple .legend,
body.simple .explainer { display: none; }

body.simple .gallery { display: none; }

body.simple.peek-gallery .gallery { display: flex; }

body.simple .look-canvas {
  width: 108px;
  height: 144px;
}

body.simple .look-name { font-size: 0.9rem; }

.simple-capture {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #0d0f12;
  border-radius: 10px;
  padding: 20px 12px;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}

.simple-nav {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.simple-nav button {
  border: 1px solid var(--line);
  background: #20252d;
  color: var(--ink);
  border-radius: 8px;
  padding: 16px 6px;
  font-size: 1rem;
  font-weight: 650;
  cursor: pointer;
}
