* { box-sizing: border-box; }
:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f4f6;
  color: #111827;
}
body { margin: 0; min-height: 100vh; }
.container { width: min(100% - 28px, 680px); margin: 36px auto; }
.header { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.brand-mark {
  display: grid; place-items: center; width: 48px; height: 48px;
  border-radius: 14px; background: #2563eb; color: white; font-weight: 800;
}
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 1.45rem; margin-bottom: 3px; }
h2 { font-size: 1.2rem; margin-bottom: 7px; }
h3 { font-size: 1rem; margin-bottom: 10px; }
.muted { color: #6b7280; font-size: .9rem; margin-bottom: 0; }
.panel {
  background: white; border: 1px solid #e5e7eb; border-radius: 18px;
  padding: 22px; box-shadow: 0 8px 30px rgba(15, 23, 42, .05);
}
#login-form { display: grid; gap: 10px; margin-top: 20px; }
label { font-size: .9rem; font-weight: 650; }
input {
  width: 100%; padding: 13px 14px; border: 1px solid #d1d5db;
  border-radius: 10px; font-size: 1rem;
}
button {
  border: 0; border-radius: 10px; padding: 12px 16px;
  font-size: .95rem; font-weight: 700; cursor: pointer;
}
button:disabled { opacity: .45; cursor: not-allowed; }
.primary { background: #2563eb; color: white; }
.secondary { background: #e5e7eb; color: #111827; }
.small { padding: 9px 12px; font-size: .85rem; }
.message { min-height: 1.2em; margin: 10px 0 0; color: #b91c1c; font-size: .9rem; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.camera-frame {
  position: relative; overflow: hidden; margin-top: 18px; background: #111827;
  border-radius: 14px; aspect-ratio: 4 / 3;
}
video { width: 100%; height: 100%; object-fit: cover; display: block; }
.camera-hint {
  position: absolute; left: 10px; right: 10px; bottom: 10px; text-align: center;
  padding: 8px; border-radius: 8px; color: white; background: rgba(0,0,0,.55);
  font-size: .8rem; pointer-events: none;
}
.button-row { display: flex; gap: 10px; margin-top: 14px; }
.button-row button { flex: 1; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.result-card { padding: 14px; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 12px; }
.result-card span { display: block; font-size: .8rem; }
.result-card strong { display: block; margin-top: 7px; font-size: 1.35rem; overflow-wrap: anywhere; }
.log-box { margin-top: 18px; }
pre {
  white-space: pre-wrap; overflow-wrap: anywhere; min-height: 70px; max-height: 260px;
  overflow: auto; background: #111827; color: #e5e7eb; padding: 13px;
  border-radius: 10px; font-size: .82rem;
}
.note { color: #6b7280; font-size: .8rem; line-height: 1.6; margin: 14px 0 0; }
footer { text-align: center; color: #9ca3af; font-size: .8rem; padding: 20px; }
[hidden] { display: none !important; }
@media (max-width: 480px) {
  .container { margin: 20px auto; }
  .panel { padding: 17px; }
  .panel-heading { align-items: center; }
}
