:root {
  color-scheme: light;
  --ink: #182230;
  --muted: #687586;
  --line: #e4e9ef;
  --blue: #2463eb;
  --bg: #f4f7fb;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.shell { width: min(1120px, calc(100% - 32px)); margin: 42px auto; }
.hero { margin-bottom: 26px; }
.eyebrow { color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .15em; }
h1 { margin: 10px 0 8px; font-size: clamp(30px, 4vw, 44px); letter-spacing: -.04em; }
.hero p { margin: 0; color: var(--muted); line-height: 1.6; max-width: 720px; }
.status { margin-top: 18px; padding: 11px 14px; border: 1px solid #f2d49a; border-radius: 12px; background: #fff9e9; color: #875d06; font-size: 13px; }
.status.ready { background: #eaf8ef; color: #17683b; border-color: #c8ecd5; }
.status.error { background: #fff0f0; color: #a52a2a; border-color: #f2cccc; }
.grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; align-items: start; }
.panel { min-width: 0; background: white; border: 1px solid var(--line); border-radius: 20px; padding: 22px; box-shadow: 0 8px 28px rgba(28, 43, 66, .04); }
.camera-panel { grid-row: span 2; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.panel-head > div { display: flex; align-items: center; gap: 10px; }
.step { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: #edf3ff; color: var(--blue); font-size: 12px; font-weight: 800; }
h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.pill { background: #f0f3f7; border-radius: 999px; padding: 6px 9px; color: #647184; font-size: 11px; white-space: nowrap; }
.video-wrap { position: relative; aspect-ratio: 4 / 3; background: #111827; overflow: hidden; border-radius: 14px; }
video, canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
video { transform: scaleX(-1); }
canvas { pointer-events: none; transform: scaleX(-1); }
.placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: white; background: linear-gradient(145deg, #18263c, #0b1220); text-align: center; }
.placeholder[hidden] { display: none; }
.placeholder small { color: #b8c4d5; }
.camera-icon { font-size: 40px; color: #90b4ff; }
.actions { display: flex; gap: 10px; margin-top: 14px; }
.button { border: 0; border-radius: 11px; padding: 12px 16px; font-size: 13px; font-weight: 750; cursor: pointer; transition: transform .15s, opacity .15s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.primary { color: white; background: var(--blue); }
.secondary { background: #edf1f6; color: #334155; }
.dark { background: #172335; color: white; }
.full { width: 100%; margin-top: 8px; }
label { display: block; margin: 15px 0 7px; font-size: 12px; font-weight: 750; color: #344154; }
input:not([type=checkbox]) { width: 100%; min-width: 0; padding: 12px 13px; border: 1px solid #dce3eb; border-radius: 10px; outline: none; font: inherit; font-size: 14px; background: white; }
input:focus { border-color: #7aa2ff; box-shadow: 0 0 0 3px #2463eb19; }
.consent { display: flex; align-items: flex-start; gap: 9px; line-height: 1.5; color: #566274; font-weight: 500; }
.consent input { margin-top: 3px; accent-color: var(--blue); }
.hint { margin: 13px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.result { display: flex; align-items: flex-start; gap: 12px; margin-top: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #f8fafc; }
.result-icon { display: grid; flex: 0 0 28px; width: 28px; height: 28px; place-items: center; border-radius: 9px; background: #e5eaf1; color: #4a5a70; font-weight: 800; }
.result strong { display: block; font-size: 13px; }
.result p { margin: 5px 0 0; color: #647184; font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.result.success { border-color: #bfe8ce; background: #f0fbf4; }
.result.success .result-icon { background: #d8f5e2; color: #167344; }
.result.error { border-color: #f0caca; background: #fff6f6; }
.result.error .result-icon { background: #ffe4e4; color: #b42323; }
footer { padding: 22px 2px 0; color: #778395; font-size: 12px; line-height: 1.7; }
@media (max-width: 760px) {
  .shell { width: min(100% - 22px, 540px); margin: 24px auto; }
  .grid { grid-template-columns: 1fr; }
  .camera-panel { grid-row: auto; }
  .panel { padding: 17px; border-radius: 16px; }
}
