:root {
  color-scheme: light dark;
  font-family: system-ui, sans-serif;
  --line: color-mix(in srgb, currentColor 18%, transparent);
  --soft: color-mix(in srgb, currentColor 7%, transparent);
  --wine: #7b1e3a;
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.45; }

header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
}
header h1 { font-size: 1.2rem; margin: 0; color: var(--wine); }
nav { display: flex; gap: 0.5rem; }
nav button {
  background: none;
  border: 1px solid var(--line);
}
nav button.active { background: var(--wine); color: #fff; border-color: var(--wine); }

main { max-width: 52rem; margin: 1.5rem auto; padding: 0 1rem; }

button, .link {
  font: inherit;
  padding: 0.4rem 0.8rem;
  border-radius: 0.4rem;
  border: 1px solid var(--line);
  background: var(--soft);
  cursor: pointer;
}
button:hover, .link:hover { background: color-mix(in srgb, currentColor 14%, transparent); }
.link { border: none; background: none; padding: 0.2rem 0; color: var(--wine); }
button.danger { color: #b00020; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.toolbar h2 { margin: 0; }
.filter { display: inline-flex; gap: 0.4rem; align-items: center; margin-bottom: 1rem; }
select, input, textarea {
  font: inherit;
  padding: 0.4rem 0.5rem;
  border-radius: 0.4rem;
  border: 1px solid var(--line);
  background: transparent;
  color: inherit;
}
.hint, .note { color: color-mix(in srgb, currentColor 65%, transparent); font-size: 0.9rem; }

.card {
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
}
.card.confirm { background: var(--soft); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.card-head .link { font-weight: 600; font-size: 1.02rem; }
.meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin: 0.4rem 0; font-size: 0.92rem; }
.card-actions { display: flex; gap: 0.75rem; align-items: center; margin-top: 0.5rem; }
.maplinks { display: inline-flex; gap: 0.9rem; font-size: 0.88rem; }

.badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.badge-to_identify { background: color-mix(in srgb, #b8860b 22%, transparent); }
.badge-identified  { background: color-mix(in srgb, #1f77b4 22%, transparent); }
.badge-contacted   { background: color-mix(in srgb, #2ca02c 22%, transparent); }
.badge-visiting    { background: color-mix(in srgb, #9467bd 22%, transparent); }
.badge-rejected    { background: color-mix(in srgb, #888 22%, transparent); }

.empty, .notice {
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: 0.6rem;
  color: color-mix(in srgb, currentColor 70%, transparent);
}
.notice code { background: var(--soft); padding: 0 0.25rem; border-radius: 0.25rem; }

.vform { display: grid; gap: 1rem; }
.vform fieldset { border: 1px solid var(--line); border-radius: 0.6rem; padding: 1rem; display: grid; gap: 0.75rem; }
.vform legend { padding: 0 0.4rem; font-weight: 600; }
.vform label { display: grid; gap: 0.25rem; font-size: 0.9rem; }
.vform input, .vform textarea, .vform select { width: 100%; }
.req { color: #b00020; }

.search-form { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.search-form input { flex: 1; }
.save-form { display: flex; gap: 0.5rem; margin-top: 0.5rem; }

.kv { width: 100%; border-collapse: collapse; margin-top: 0.75rem; }
.kv th, .kv td { text-align: left; vertical-align: top; padding: 0.35rem 0.5rem; border-top: 1px solid var(--line); }
.kv th { width: 11rem; font-weight: 600; }
