:root {
  --onyx:   #1B1E25;
  --onyx-2: #232730;
  --line:   #333a45;
  --text:   #F5F7FA;
  --dim:    #9AA3AF;
  --accent: #10b981;     /* emerald — the shutter / primary */
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--onyx);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

.app-header {
  position: sticky; top: 0; z-index: 10;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px 14px;
  background: var(--onyx);
  border-bottom: 1px solid var(--line);
}
.app-header h1 { margin: 0; font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; }

.app-main {
  max-width: 560px; margin: 0 auto;
  padding: 16px 16px calc(env(safe-area-inset-bottom, 0px) + 24px);
  display: flex; flex-direction: column; gap: 14px;
}

.hint { margin: 0; color: var(--dim); font-size: 0.95rem; }

.stage {
  position: relative;
  width: 100%; aspect-ratio: 3 / 4;
  background: #000;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: grid; place-items: center;
}
.stage video, .stage img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.placeholder { font-size: 4rem; opacity: 0.5; }

.controls { display: flex; flex-wrap: wrap; gap: 10px; }

.btn {
  flex: 1 1 auto; min-width: 44%;
  min-height: 50px;
  border: 0; border-radius: var(--radius);
  font: inherit; font-weight: 600; font-size: 1rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 80ms ease, opacity 120ms ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: #07120d; }
.btn-ghost {
  background: var(--onyx-2); color: var(--text);
  border: 1px solid var(--line);
}
.btn[hidden] { display: none; }

.status { margin: 0; min-height: 1.2em; font-size: 0.92rem; color: var(--dim); }
.status.err { color: #fca5a5; }

.fallback { margin-top: 4px; }
.fallback summary {
  cursor: pointer; color: var(--dim); font-size: 0.9rem;
  list-style: none; padding: 6px 0;
}
.fallback summary::-webkit-details-marker { display: none; }
.fallback summary::before { content: "▸ "; }
.fallback[open] summary::before { content: "▾ "; }
.fallback-body { margin: 6px 0; color: var(--dim); font-size: 0.9rem; }
.fallback input[type="file"] { color: var(--dim); font-size: 0.9rem; }

.footnote { margin: 8px 2px 0; color: var(--dim); font-size: 0.78rem; line-height: 1.5; }
.footnote code {
  background: var(--onyx-2); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 5px; font-size: 0.85em;
}
