:root {
  --bg: #f6f5f0;
  --surface: #ffffff;
  --ink: #1a1c19;
  --muted: #5c635a;
  --line: #dcdcd2;
  --accent: #2f6b45;
  --accent-ink: #ffffff;
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141714;
    --surface: #1d211d;
    --ink: #e9ece7;
    --muted: #9aa397;
    --line: #2e332e;
    --accent: #6fbf8b;
    --accent-ink: #10231a;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Respect the notch / home indicator when installed to the home screen. */
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
}

.topbar h1 {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.badge {
  font-size: 0.75rem;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.badge.ok { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.badge.bad { color: #c0392b; border-color: color-mix(in srgb, #c0392b 45%, transparent); }

.wrap {
  max-width: 34rem;
  margin: 0 auto;
  padding: 20px 20px 48px;
}

.lede { color: var(--muted); margin-top: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}

.card h2 {
  margin: 0 0 6px;
  font-size: 0.9375rem;
  font-weight: 650;
}

.muted { color: var(--muted); font-size: 0.875rem; }

label {
  display: block;
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 14px 0 6px;
}

input[type="text"] {
  width: 100%;
  /* 16px minimum, or iOS Safari zooms the viewport on focus. */
  font: inherit;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 9px;
}

input[type="text"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.row { display: flex; gap: 10px; margin-top: 12px; }

button {
  font: inherit;
  font-weight: 550;
  /* Comfortable thumb target with gloves on. */
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}

button.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

button:active { transform: translateY(1px); }

.status { min-height: 1.4em; margin: 12px 0 0; font-size: 0.875rem; color: var(--muted); }

.kv { margin: 8px 0 0; font-size: 0.875rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0 0 10px; font-variant-numeric: tabular-nums; word-break: break-word; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875em;
}
