:root {
  color-scheme: light dark;
  --background: #f6f7f9;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #6a707c;
  --accent: #2f6feb;
  --border: #dde1e7;
  --error: #c62828;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: #111318;
    --surface: #1b1e25;
    --text: #e8eaee;
    --muted: #9aa1ad;
    --accent: #6d9bff;
    --border: #2c313b;
    --error: #ff6b6b;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--background);
  border-bottom: 1px solid var(--border);
  padding: max(8px, env(safe-area-inset-top)) 10px 8px;
}
main { padding: 8px 10px 80px; }
.row { display: flex; gap: 8px; align-items: center; margin: 4px 0; }
input[type="search"], textarea, dialog input {
  flex: 1;
  min-width: 0;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}
textarea { width: 100%; resize: vertical; }
button {
  font: inherit;
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
}
#reload-button, #settings-button { background: var(--surface); color: var(--text); border: 1px solid var(--border); font-size: 20px; line-height: 1; padding: 9px 12px; }
.toggles { gap: 18px; color: var(--muted); font-size: 15px; }
.toggles label { display: flex; gap: 6px; align-items: center; }
#person-suggestions {
  list-style: none;
  margin: 4px 0;
  padding: 0;
  max-height: 55vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
#person-suggestions li { padding: 12px; border-bottom: 1px solid var(--border); }
#person-suggestions li:last-child { border-bottom: 0; }
#person-suggestions .meta { color: var(--muted); font-size: 13px; }
#status { margin: 4px 0; color: var(--muted); font-size: 14px; white-space: pre-wrap; }
#status.error { color: var(--error); }
#add-panel { margin: 6px 0 10px; }
#add-panel summary { color: var(--accent); padding: 6px 0; }
#add-form { display: grid; gap: 8px; }
#tag-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}
.chip.selected { background: var(--accent); color: #fff; border-color: var(--accent); }
#search-banner { color: var(--muted); font-size: 14px; }
#search-banner button { padding: 4px 10px; font-size: 14px; }
#points { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
#points li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  overflow-wrap: anywhere;
}
#points li.used { opacity: 0.5; text-decoration: line-through; }
#points .details { margin: 6px 0 0 12px; color: var(--muted); font-size: 14px; }
#points .meta { margin-top: 6px; color: var(--muted); font-size: 12px; }
#points a { color: var(--accent); }
#toast {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--text);
  color: var(--background);
}
#toast[hidden], #person-suggestions[hidden], #search-banner[hidden], .toggles label[hidden] { display: none; }
dialog { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); width: min(92vw, 460px); }
dialog form { display: grid; gap: 12px; }
dialog label { display: grid; gap: 4px; font-size: 14px; }
