:root {
  --bg: #f3f4f6;
  --card: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #c2ff6b;
  --chip: #ead9f9;
  --chip-ink: #5b2a86;
  --danger: #b91c1c;
  --ok: #166534;
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

a { color: inherit; }

.topbar {
  background: #000;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 4px solid var(--accent);
}
.topbar img { height: 26px; width: auto; }
.topbar .brand { font-weight: 700; font-size: 18px; letter-spacing: -0.01em; text-decoration: none; }

main {
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

h1 { font-size: 24px; line-height: 1.25; margin: 0 0 8px; letter-spacing: -0.02em; }
h2 { font-size: 17px; margin: 0 0 10px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }

.from {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--chip);
  color: var(--chip-ink);
  border-radius: 999px;
  padding: 5px 12px;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 12px;
}

.quote {
  border-left: 3px solid var(--line);
  padding: 4px 0 4px 12px;
  margin: 12px 0 0;
  color: #374151;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

label { display: block; font-weight: 600; font-size: 14px; margin: 0 0 6px; }
input[type=text], input[type=number], input[type=password], textarea {
  width: 100%;
  font: inherit;
  font-size: 16px; /* stops iOS zooming on focus */
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 80px; resize: vertical; }
.field { margin-bottom: 14px; }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  font: inherit;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  background: #000;
  color: #fff;
}
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.secondary { background: #f3f4f6; color: var(--ink); }
.btn.accent { background: var(--accent); color: #000; }
.btn.danger { background: var(--danger); color: #fff; }
.btn + .btn { margin-top: 10px; }

.city { font-weight: 600; font-size: 18px; margin: 4px 0 10px; }

.error {
  color: var(--danger);
  font-size: 14px;
  margin: 10px 0 0;
  min-height: 1em;
}

.status-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  margin: 4px auto 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  background: var(--accent);
}
.status-icon.neutral { background: #e5e7eb; }

.data-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.data-row:first-child { border-top: 0; }
.data-row .k { color: var(--muted); }
.data-row .v { font-weight: 600; text-align: right; }
.tag { font-size: 12px; color: var(--muted); font-weight: 400; display: block; }

.photo {
  border-radius: 14px;
  overflow: hidden;
  margin: 10px 0 4px;
  background: #000;
}
.photo img {
  display: block;
  width: 100%;
  -webkit-touch-callout: none; /* no long-press "Save Image" on iOS */
  -webkit-user-select: none;
  user-select: none;
  pointer-events: none;
}

footer {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  padding: 8px 16px 32px;
}
footer a { color: var(--muted); }

.hidden { display: none !important; }

.prose h2 { margin-top: 24px; }
.prose p, .prose li { color: #374151; }

.mt { margin-top: 14px; }
body.obscured #key-body { filter: blur(24px); }

/* Key page: the shared area */
.map { height: 220px; border-radius: 14px; overflow: hidden; margin: 10px 0; }
[data-caption] { white-space: pre-line; }
