:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #16202e;
  --muted: #5b6676;
  --border: #dbe1ea;
  --primary: #1565c0;
  --primary-text: #ffffff;
  --selected: #e7f0fc;
  --danger: #c62828;
  --danger-bg: #fdecec;
  --ok: #2e7d32;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1318;
    --card: #181e26;
    --text: #e8edf4;
    --muted: #a3adbb;
    --border: #2a3340;
    --primary: #64a4f0;
    --primary-text: #08223f;
    --selected: #1c2c42;
    --danger: #ff8a80;
    --danger-bg: #3a1d1d;
    --ok: #81c784;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  font-weight: 700;
  max-width: 560px;
  margin: 0 auto;
}

.logo {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-text);
  font-weight: 900;
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 16px 24px;
  display: grid;
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
}

.center { text-align: center; }

h1 { font-size: 1.35rem; margin: 0 0 4px; }
.hint, .meta, .privacy, footer { color: var(--muted); }
.hint { margin: 0 0 16px; }

.vehicle { text-align: center; }
.photo {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 16px;
}

.plate {
  display: inline-block;
  padding: 8px 18px;
  border: 3px solid var(--text);
  border-radius: 10px;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: 2px;
  overflow-wrap: anywhere;
}

.meta { margin: 10px 0 0; font-weight: 600; }

.note {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--selected);
  text-align: left;
}
.geofence {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--selected);
}
.note-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.options {
  border: 0;
  padding: 0;
  margin: 0 0 16px;
  display: grid;
  gap: 8px;
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
}
.option:has(input:checked) {
  border-color: var(--primary);
  background: var(--selected);
}
.option input { width: 20px; height: 20px; accent-color: var(--primary); flex: none; }
.option.emergency { border-color: var(--danger); }
.option.emergency span { color: var(--danger); font-weight: 700; }
.option.emergency:has(input:checked) { background: var(--danger-bg); }

.field { display: block; font-weight: 600; margin-bottom: 6px; }
.optional { color: var(--muted); font-weight: 400; }

textarea {
  width: 100%;
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  resize: vertical;
}
textarea:focus, .option:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }

button, .button {
  display: block;
  width: 100%;
  margin-top: 16px;
  min-height: 52px;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.primary { background: var(--primary); color: var(--primary-text); border: 0; }
.primary:disabled { opacity: 0.6; }
.secondary {
  line-height: 52px;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  background: transparent;
}

.alert {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 600;
}

.privacy { font-size: 0.9rem; text-align: center; margin: 12px 0 0; }

.badge {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 12px;
}
.badge.ok { background: var(--selected); color: var(--primary); }
.badge.warn { background: var(--danger-bg); color: var(--danger); }

.status {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--selected);
}
.status p { margin: 0; }
.status.done { color: var(--ok); font-weight: 700; }
.reply { margin-top: 8px !important; color: var(--text); font-style: italic; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

footer {
  max-width: 560px;
  margin: 0 auto;
  padding: 8px 16px 32px;
  font-size: 0.85rem;
  text-align: center;
}
