:root {
  --bg0: #0f1c18;
  --bg1: #1a2f28;
  --ink: #e8f2ed;
  --muted: #9bb5a8;
  --accent: #3d9b74;
  --accent-ink: #0b1512;
  --danger: #c97868;
  --panel: rgba(232, 242, 237, 0.06);
  --line: rgba(232, 242, 237, 0.14);
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
}

body {
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
  background:
    radial-gradient(1200px 600px at 10% -10%, #2a4a3c 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #163028 0%, transparent 50%),
    linear-gradient(165deg, var(--bg0), var(--bg1));
}

.shell {
  max-width: 28rem;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding:
    max(max(12vh, 3rem), env(safe-area-inset-top, 0px))
    max(1.25rem, env(safe-area-inset-right, 0px))
    max(3rem, env(safe-area-inset-bottom, 0px))
    max(1.25rem, env(safe-area-inset-left, 0px));
}

.brand {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 10vw, 3.75rem);
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--accent);
  animation: rise 0.55s ease-out both;
}

h1 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4.5vw, 1.7rem);
  font-weight: 600;
  line-height: 1.25;
  animation: rise 0.6s ease-out 0.05s both;
}

.lede {
  margin: 0 0 1.4rem;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
  animation: rise 0.65s ease-out 0.1s both;
}

.step-label {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.actions {
  display: grid;
  gap: 0.75rem;
  margin: 1.25rem 0 0;
  animation: rise 0.7s ease-out 0.15s both;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.1rem;
  padding: 0.85rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.55rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-secondary {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
  font-weight: 500;
}

.preview {
  margin: 1rem 0 0;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  overflow: hidden;
  background: var(--panel);
  animation: rise 0.5s ease-out both;
}

.preview img {
  display: block;
  width: 100%;
  max-height: 14rem;
  object-fit: contain;
  background: #0b1512;
}

.status-chip {
  display: inline-block;
  margin: 0 0 0.85rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.error {
  margin: 1rem 0 0;
  color: var(--danger);
  font-size: 0.95rem;
  line-height: 1.4;
}

.meta {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.field-label {
  display: block;
  margin: 1.1rem 0 0.4rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.select {
  display: block;
  width: 100%;
  margin: 0 0 0.75rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: rgba(11, 21, 18, 0.55);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  touch-action: manipulation;
}

.camera-wrap {
  position: relative;
  margin: 1rem 0 0;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  overflow: hidden;
  background: #0b1512;
  aspect-ratio: 3 / 4;
  max-height: min(70dvh, 28rem);
}

.camera-wrap video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-badge {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  margin: 0;
  padding: 0.25rem 0.5rem;
  border-radius: 0.35rem;
  background: rgba(11, 21, 18, 0.72);
  color: var(--ink);
  font-size: 0.75rem;
}

.action-list {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.6;
}

.action-list li.active {
  color: var(--accent);
  font-weight: 600;
}

.action-list li.done {
  text-decoration: line-through;
  opacity: 0.7;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand,
  h1,
  .lede,
  .actions,
  .preview {
    animation: none;
  }
}
