:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #16181d;
  --muted: #646b78;
  --line: #e1e4ea;
  --accent: #1f5eff;
  --accent-text: #ffffff;
  --danger: #c62828;
  --ok: #1b8a4b;
  --radius: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --card: #181b21;
    --text: #eceef2;
    --muted: #9aa1ad;
    --line: #2a2f38;
    --accent: #5b8cff;
    --danger: #ff6b6b;
    --ok: #3ccf7d;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
body.no-scroll { overflow: hidden; }
.wrap { max-width: 560px; margin: 0 auto; padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 18px; }
.center { text-align: center; }
h1 { font-size: 1.5rem; line-height: 1.25; margin: 0 0 12px; }
h2 { font-size: 1.25rem; margin: 0 0 12px; }
.muted { color: var(--muted); }
.prose { margin: 0 0 20px; overflow-wrap: anywhere; }
.prose a { color: var(--accent); }
.hint { background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 10px; padding: 10px 12px; }
.error { color: var(--danger); font-size: .92rem; margin: 6px 0 0; }

.steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 4px 0 14px; }
.steps li { flex: 1; height: 4px; border-radius: 2px; background: var(--line); transition: background .2s; }
.steps li.on { background: var(--accent); }

.btn {
  appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--text);
  font: inherit; font-weight: 600; padding: 12px 18px; border-radius: 12px; cursor: pointer;
  min-height: 48px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.linklike { background: none; border: 0; color: var(--accent); font: inherit; padding: 8px; cursor: pointer; text-decoration: underline; }
.row { display: flex; gap: 10px; justify-content: space-between; margin-top: 18px; }
.row .btn { flex: 1; }
.actions { display: grid; gap: 10px; margin: 16px 0 4px; }

.policy {
  max-height: 45vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; font-size: .93rem; background: var(--bg);
}
.check { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }

.items { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 12px; }
.items li { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.items img, .items video { display: block; width: 100%; max-height: 55vh; object-fit: contain; background: #000; }
.item-bar { display: flex; gap: 8px; align-items: center; padding: 8px 10px; }
.item-bar .muted { flex: 1; font-size: .85rem; }

.field { margin: 0 0 16px; }
.field > label { display: block; font-weight: 600; margin: 0 0 6px; }
.field input:not([type=checkbox]), .field textarea, .field select {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; min-height: 46px;
}
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: var(--danger); }
.field small { display: block; margin-top: 4px; }

.progress { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; margin: 18px 0 10px; }
#progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.tick { width: 64px; height: 64px; margin: 4px auto 12px; border-radius: 50%; background: var(--ok); position: relative; }
.tick::after { content: ""; position: absolute; left: 23px; top: 14px; width: 14px; height: 28px; border: solid #fff; border-width: 0 5px 5px 0; transform: rotate(45deg); }

/* ---------- camera ---------- */
.camera { position: fixed; inset: 0; background: #000; z-index: 50; color: #fff; }
.camera[hidden] { display: none; }
.camera video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.camera video.mirror { transform: scaleX(-1); }
.camera.flash::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: .7; }
.guide { position: fixed; pointer-events: none; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.guide-grid i { position: absolute; background: rgba(255, 255, 255, .55); }
.guide-grid i:nth-child(1) { left: 33.333%; top: 0; bottom: 0; width: 1px; }
.guide-grid i:nth-child(2) { left: 66.666%; top: 0; bottom: 0; width: 1px; }
.guide-grid i:nth-child(3) { top: 33.333%; left: 0; right: 0; height: 1px; }
.guide-grid i:nth-child(4) { top: 66.666%; left: 0; right: 0; height: 1px; }
.guide .shape { border: 3px dashed rgba(255, 255, 255, .9); box-shadow: 0 0 0 200vmax rgba(0, 0, 0, .45); }
.guide-oval .shape { border-radius: 50%; }
.guide-rect .shape { border-radius: 12px; }
.guide img { width: 100%; height: 100%; object-fit: contain; opacity: .85; }
.cam-top {
  position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
}
.icon-btn {
  width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .5); color: #fff;
  font-size: 22px; cursor: pointer;
}
.icon-btn:disabled { opacity: .35; }
.cam-timer { font: 600 1.1rem ui-monospace, monospace; background: rgba(0, 0, 0, .55); padding: 4px 12px; border-radius: 20px; }
.cam-timer.warn { background: var(--danger); }
.cam-hint {
  position: absolute; left: 16px; right: 16px; bottom: calc(118px + env(safe-area-inset-bottom)); margin: 0;
  text-align: center; text-shadow: 0 1px 3px #000; font-weight: 600;
}
.cam-bottom { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; padding: 16px 0 calc(24px + env(safe-area-inset-bottom)); }
.shutter { width: 76px; height: 76px; border-radius: 50%; border: 5px solid #fff; background: rgba(255, 255, 255, .85); cursor: pointer; }
.shutter.rec { background: #e53935; }
.shutter.recording { border-radius: 18px; transform: scale(.82); transition: all .2s; }
.cam-error {
  position: absolute; top: 40%; left: 20px; right: 20px; text-align: center; background: rgba(0, 0, 0, .75);
  padding: 16px; border-radius: 12px;
}
