:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #526077;
  --border: #d5dbe6;
  --accent: #1d4ed8;
  --on-accent: #ffffff;
  --accent-soft: #e6edff;
  --error: #b42318;
  --error-soft: #fdecea;
  --ok: #157f3c;
  --radius: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --surface: #141b2e;
    --text: #eef2fb;
    --muted: #a3afc4;
    --border: #2b3550;
    --accent: #7aa2ff;
    --on-accent: #0b1020;
    --accent-soft: #1d2a4d;
    --error: #ff8a80;
    --error-soft: #3a1a1a;
    --ok: #5ad48a;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}
.wrap { max-width: 520px; margin: 0 auto; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); }
.top { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.logo {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 22px;
  background: var(--accent); color: var(--on-accent);
}
h1 { font-size: 20px; margin: 0; line-height: 1.2; }
h2 { font-size: 20px; margin: 8px 0; }
.sub { margin: 0; color: var(--muted); font-size: 14px; }
.plate {
  margin-left: auto; padding: 4px 10px; border-radius: 8px; border: 2px solid var(--text);
  font: 700 15px/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 1px;
}
.stack { display: grid; gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin: 0; }
.center { text-align: center; padding: 32px 16px; }
fieldset { min-width: 0; }
legend { font-weight: 700; padding: 0; margin-bottom: 10px; float: left; width: 100%; }
legend + * { clear: both; }
.muted { color: var(--muted); font-weight: 400; font-size: 14px; }
.kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kind {
  display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 10px 12px;
  border: 1.5px solid var(--border); border-radius: 12px; background: transparent; color: var(--text);
  font: inherit; font-weight: 600; text-align: left; cursor: pointer;
}
.kind svg { width: 24px; height: 24px; flex: none; }
.kind[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.kind:focus-visible, .button:focus-within, .button:focus-visible, textarea:focus, input[type=text]:focus {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
.emergency { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--error-soft); color: var(--error); font-weight: 600; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.thumbs:empty { display: none; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button {
  position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border-radius: 50%;
  border: 0; background: rgba(0, 0, 0, .65); color: #fff; font-size: 18px; cursor: pointer;
}
.label { display: block; font-weight: 600; margin: 4px 0 6px; }
textarea, input[type=text] {
  width: 100%; padding: 12px; border-radius: 10px; border: 1.5px solid var(--border);
  background: var(--bg); color: var(--text); font: inherit; resize: vertical; margin-bottom: 12px;
}
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.check input { width: 22px; height: 22px; margin: 0; flex: none; }
.button {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px;
  border-radius: 12px; font: inherit; font-weight: 700; cursor: pointer; border: 0;
}
.button.primary { background: var(--accent); color: var(--on-accent); font-size: 17px; }
.button.primary[disabled] { opacity: .6; cursor: progress; }
.button.ghost { border: 1.5px dashed var(--border); color: var(--accent); background: transparent; }
.error { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--error-soft); color: var(--error); font-weight: 600; }
.privacy { font-size: 13px; color: var(--muted); margin: 0; }
.tick {
  width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center;
  background: var(--ok); color: var(--surface); font-size: 34px; font-weight: 800;
}
.brand { margin-top: 20px; text-align: center; font-size: 14px; color: var(--muted); }
.brand a { color: var(--accent); font-weight: 700; text-decoration: none; }
.spinner {
  width: 32px; height: 32px; margin: 0 auto; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--accent); animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
[hidden] { display: none !important; }
