*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --theme: #1a1a1a;
  --bg: #ffffff;
  --text: #1a1a1a;
  --radius: 8px;
  --max-width: 800px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
}

#app {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1rem;
}

h1 { margin-bottom: 1rem; }

@media (orientation: landscape) and (min-height: 300px) {
  #app { padding: 1rem; }
}

.topbar { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1.5rem; }
.who { color: #666; font-size: 0.95rem; }

.panel { display: flex; flex-direction: column; gap: 1rem; align-items: center; text-align: center; }
.panel[hidden] { display: none; }

button.primary, button.secondary {
  font-size: 1.1rem;
  padding: 0.9rem 1.6rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  min-width: 180px;
}
button.primary { background: var(--theme); color: #fff; }
button.secondary { background: #eee; color: var(--text); }

#camera-preview, #captured-photo {
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius);
  background: #000;
}

.controls { display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }

.error { color: #b00020; }
.note { color: #8a6d00; font-size: 0.9rem; }

.fields { text-align: left; width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 0.6rem; }
.fields label { display: flex; flex-direction: column; font-size: 0.85rem; color: #555; font-weight: 600; gap: 0.2rem; }
.fields input[type="text"] { font: inherit; font-weight: 400; color: var(--text); padding: 0.5rem; border: 1px solid #ccc; border-radius: var(--radius); }
.fields ul { padding-left: 1.2rem; font-size: 0.9rem; }

#submitted-record { text-align: left; max-width: 420px; width: 100%; background: #f4f4f4; padding: 0.75rem; border-radius: var(--radius); font-size: 0.8rem; overflow-x: auto; }

.table-scroll { overflow-x: auto; width: 100%; }
table { border-collapse: collapse; width: 100%; min-width: 640px; }
th, td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid #eee; font-size: 0.9rem; }
th { color: #555; font-weight: 600; }
