:root {
  --brand: #143c8c;
  --brand-2: #0f2f6f;
  --accent: #ffcc00;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #667085;
  --border: #d8deea;
  --danger: #b42318;
  --danger-2: #7a271a;
  --radius: 22px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: linear-gradient(180deg, #eef3ff 0%, var(--bg) 48%, #ffffff 100%);
  color: var(--text);
  min-height: 100vh;
}
.app-shell { max-width: 900px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom)); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 8px 0 18px; }
h1 { margin: 0; font-size: clamp(28px, 7vw, 48px); line-height: 1; }
h2 { margin-top: 0; font-size: 26px; }
.eyebrow { color: var(--brand); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; }
.card, .scanner-card { background: rgba(255,255,255,.94); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 18px 48px rgba(20,60,140,.12); padding: 20px; }
.view { animation: fade .18s ease-out; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.form-grid { display: grid; gap: 14px; }
label { display: grid; gap: 7px; font-weight: 650; }
input, textarea { width: 100%; border: 1px solid var(--border); border-radius: 16px; padding: 14px 15px; font-size: 16px; background: #fff; }
input:disabled, textarea:disabled { background: #f5f6f9; color: #525b6b; }
.checkbox { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.checkbox input { width: auto; transform: scale(1.2); }
button { border: 0; border-radius: 16px; padding: 14px 16px; font-size: 16px; font-weight: 800; cursor: pointer; touch-action: manipulation; }
button:active { transform: translateY(1px); }
.primary { background: var(--brand); color: white; }
.primary:hover { background: var(--brand-2); }
.secondary { background: #e8eefb; color: var(--brand); }
.ghost { background: transparent; color: var(--brand); border: 1px solid var(--border); }
.danger { background: var(--danger); color: white; }
.danger:hover { background: var(--danger-2); }
.large { min-height: 72px; font-size: 20px; }
.menu-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.button-row button { flex: 1; min-width: 150px; }
.info-box { margin-top: 16px; padding: 14px; border-radius: 16px; background: #eef3ff; border: 1px solid var(--border); }
.scanner-card { position: relative; overflow: hidden; padding: 0; background: #111827; }
video { width: 100%; min-height: 58vh; max-height: 72vh; object-fit: cover; display: block; background: #111827; }
.scan-frame { position: absolute; inset: 18%; border: 3px solid var(--accent); border-radius: 22px; box-shadow: 0 0 0 9999px rgba(0,0,0,.32); }
.scanner-status { position: absolute; left: 14px; right: 14px; bottom: 14px; padding: 12px 14px; border-radius: 16px; color: white; background: rgba(20, 32, 50, .72); backdrop-filter: blur(8px); }
.sticky-actions { position: sticky; bottom: max(12px, env(safe-area-inset-bottom)); background: rgba(244,246,251,.78); backdrop-filter: blur(10px); padding: 10px 0; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.badge { padding: 8px 12px; border-radius: 999px; background: #eef3ff; color: var(--brand); font-weight: 800; }
.toast { position: fixed; left: 16px; right: 16px; bottom: max(18px, env(safe-area-inset-bottom)); max-width: 580px; margin: 0 auto; padding: 14px 16px; border-radius: 16px; background: #172033; color: white; box-shadow: 0 20px 50px rgba(0,0,0,.25); z-index: 10; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 560px) { .app-shell { padding-left: 12px; padding-right: 12px; } .topbar { align-items: flex-start; } .card { padding: 16px; } video { min-height: 64vh; } .scan-frame { inset: 16% 10%; } }
