:root {
  color-scheme: dark;
  --bg: #0e1714;
  --raised: #17241f;
  --ink: #f3f6f1;
  --mist: #e4ede7;
  --pine: #8fcbb0;
  --pine-ink: #062117;
  --amber: #e2b15a;
  --amber-ink: #241806;
  --clay: #ffb4a2;
  --clay-ink: #2a0c08;
  --line: #3a4a43;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f3f6f2;
    --raised: #ffffff;
    --ink: #14211c;
    --mist: #4e5c55;
    --pine: #1b5e45;
    --pine-ink: #f3fbf7;
    --amber: #8a5a12;
    --amber-ink: #fff8ee;
    --clay: #9a3412;
    --clay-ink: #fff8f6;
    --line: #d3ddd7;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}

body {
  min-height: 100dvh;
  padding:
    calc(16px + var(--safe-top))
    16px
    calc(24px + var(--safe-bottom));
}

.shell {
  width: min(32rem, 100%);
  margin: 0 auto;
}

.top h1 {
  margin: 0 0 12px;
  font-size: 2rem;
  font-weight: 560;
  letter-spacing: -0.03em;
}

.eyebrow {
  margin: 0;
  color: var(--pine);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 8px 0 18px;
}

.status h2 {
  margin: 8px 0 0;
  font-size: 1.6rem;
  font-weight: 560;
}

.status p, .lead, .fine {
  color: var(--mist);
}

.mark {
  width: 112px;
  height: 112px;
}

.mark svg { width: 100%; height: 100%; }

.tamper { color: var(--clay); margin: 8px 0 0; }

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

.panel h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 560;
}

.lead, .fine, .error, .note p { margin: 0; }

.fine { font-size: 0.92rem; }

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

.btn {
  appearance: none;
  border: 0;
  border-radius: 14px;
  min-height: 52px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 620;
  text-align: center;
  cursor: pointer;
}

.btn.primary { background: var(--pine); color: var(--pine-ink); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--clay); color: var(--clay-ink); }
.btn.text {
  background: transparent;
  color: var(--pine);
  min-height: 44px;
}
.btn.danger-text { color: var(--clay); }

.file { display: flex; align-items: center; justify-content: center; }
.file input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.field { display: flex; flex-direction: column; gap: 6px; color: var(--mist); font-size: 0.92rem; }

input[type="email"],
input[type="password"],
textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font: 0.92rem/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  padding: 12px;
  resize: vertical;
}

.viewfinder {
  background: black;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
}

video { width: 100%; height: 100%; object-fit: cover; }

.qr {
  background: white;
  border-radius: 16px;
  padding: 12px;
}

.qr svg { display: block; width: 100%; height: auto; }

.error { color: var(--clay); }

.note {
  border-radius: 14px;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--amber) 16%, transparent);
  color: var(--ink);
  margin-bottom: 14px;
}

.note.warn {
  background: color-mix(in srgb, var(--clay) 16%, transparent);
}

[hidden] { display: none !important; }
