:root {
  --bg: #ffffff;
  --fg: #202124;
  --muted: #5f6368;
  --line: #dfe1e5;
  --soft: #f1f3f4;
  --accent: #0b7a75;
  --accent-ink: #ffffff;
  --shadow: 0 1px 6px rgba(32, 33, 36, .28);
  --radius: 24px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #202124;
    --fg: #e8eaed;
    --muted: #9aa0a6;
    --line: #5f6368;
    --soft: #303134;
    --accent: #4fd1c5;
    --accent-ink: #202124;
    --shadow: 0 1px 6px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 500; line-height: 1.25; }
main.page { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; }
main.wide { flex: 1; width: 100%; }

/* Logo */
.logo { font-weight: 600; letter-spacing: -.02em; color: var(--fg); }
.logo span { color: var(--accent); }
.logo:hover { text-decoration: none; }
.logo--big { font-size: clamp(48px, 10vw, 84px); display: block; text-align: center; margin-bottom: 28px; }
.logo--small { font-size: 22px; white-space: nowrap; }

/* Top bar (hidden on the landing page) */
.topbar { display: flex; align-items: center; gap: 24px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.topbar__search { flex: 1; max-width: 640px; }
.topbar__nav { margin-left: auto; display: flex; gap: 16px; font-size: 14px; white-space: nowrap; }
.home .topbar { border-bottom: 0; }
.home .topbar .logo, .home .topbar__search { visibility: hidden; }

/* Landing */
.hero { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 0 16px 18vh; }
.hero__tagline { color: var(--muted); margin: 18px 0 0; font-size: 14px; text-align: center; }

/* Search box + suggestions */
.searchbox { position: relative; width: 100%; max-width: 584px; }
.searchbox__field {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0 8px 0 18px; height: 48px; background: var(--bg);
}
.searchbox__field:hover, .searchbox__field:focus-within { box-shadow: var(--shadow); border-color: transparent; }
.searchbox__icon { width: 18px; height: 18px; fill: var(--muted); flex: none; }
.searchbox .searchbox__input, .searchbox .searchbox__input:focus {
  flex: 1; border: 0; outline: 0; padding: 0; border-radius: 0; background: transparent;
  color: var(--fg); font: inherit; font-size: 16px; min-width: 0;
}
.searchbox--compact .searchbox__field { height: 40px; }
.suggestions:empty { display: none; }
.suggestions {
  position: absolute; z-index: 1000; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--bg); border-radius: 16px; box-shadow: var(--shadow);
  list-style: none; margin: 0; padding: 8px 0;
}
.suggestion a { display: flex; gap: 12px; align-items: baseline; padding: 8px 20px; color: var(--fg); }
.suggestion a:hover, .suggestion a:focus { background: var(--soft); text-decoration: none; outline: 0; }
.suggestion__meta { color: var(--muted); font-size: 13px; margin-left: auto; }
.suggestion__kind { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 6px 20px 2px; }

/* Buttons & forms */
.btn {
  display: inline-block; border: 1px solid var(--line); background: var(--soft); color: var(--fg);
  border-radius: 6px; padding: 9px 18px; font: inherit; font-size: 14px; cursor: pointer;
}
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--link { background: none; border: 0; color: var(--accent); padding: 0; }
.form { display: grid; gap: 18px; }
.form fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin: 0; display: grid; gap: 14px; }
.form legend { padding: 0 6px; font-weight: 500; }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 500; }
.field .help { font-size: 13px; color: var(--muted); }
.field .errorlist { color: #d93025; font-size: 13px; margin: 0; padding: 0; list-style: none; }
input[type=text], input[type=email], input[type=url], input[type=tel], input[type=password],
input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--fg); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; list-style: none; margin: 0; padding: 0; }
.checks label { font-weight: 400; display: flex; gap: 6px; align-items: center; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }

/* Registry picker (used on /join) */
.picker { list-style: none; margin: 8px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.picker:empty { display: none; }
.picker li + li { border-top: 1px solid var(--line); }
.picker label { display: flex; gap: 12px; align-items: center; padding: 12px 14px; cursor: pointer; }
.picker label:hover { background: var(--soft); }
.picker__name { font-weight: 500; }
.picker__meta { color: var(--muted); font-size: 13px; }
.picker__note { padding: 12px 14px; color: var(--muted); font-size: 14px; }
.picker__status { padding: 8px 14px; background: var(--soft); color: var(--muted); font-size: 12px; display: grid; gap: 2px; }

/* Results */
.results { display: grid; grid-template-columns: minmax(320px, 520px) 1fr; height: calc(100vh - 69px); }
.results__list { overflow-y: auto; padding: 8px 16px 32px; }
.results__map { position: sticky; top: 0; height: 100%; min-height: 320px; }
.results__summary { color: var(--muted); font-size: 14px; margin: 8px 0 12px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; }
.chip { border: 1px solid var(--line); border-radius: 16px; padding: 4px 12px; font-size: 14px; color: var(--fg); }
.chip--on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip:hover { text-decoration: none; border-color: var(--muted); }
.result { padding: 14px 0; border-bottom: 1px solid var(--line); }
.result h2 { font-size: 19px; margin: 0 0 2px; }
.result__meta { color: var(--muted); font-size: 14px; }
.badge { display: inline-block; font-size: 12px; border-radius: 10px; padding: 1px 8px; background: var(--soft); color: var(--muted); margin-right: 4px; }
.badge--ok { color: var(--accent); }
.empty { color: var(--muted); padding: 32px 0; }
@media (max-width: 800px) {
  .results { grid-template-columns: 1fr; height: auto; }
  .results__map { position: relative; height: 45vh; order: -1; }
  .topbar { flex-wrap: wrap; gap: 12px; }
  .topbar__search { order: 3; flex-basis: 100%; max-width: none; }
}

/* Profile */
.profile__head { display: grid; gap: 4px; margin-bottom: 18px; }
.profile__head h1 { margin: 0; font-size: 30px; }
.profile section { margin: 24px 0; }
.profile h2 { font-size: 18px; margin: 0 0 8px; }
.profile__map { height: 260px; border-radius: 12px; overflow: hidden; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* Misc */
.messages { list-style: none; margin: 12px auto 0; padding: 0 16px; max-width: 760px; width: 100%; }
.message { background: var(--soft); border-radius: 8px; padding: 10px 14px; font-size: 14px; }
.notice { background: var(--soft); border-radius: 12px; padding: 14px 18px; }
.prose p { color: var(--fg); }
.muted { color: var(--muted); }
.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--soft); color: var(--muted); font-size: 14px; padding: 12px 16px;
}
.footer__links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer__links a { color: var(--muted); }
.footer__lang select { width: auto; padding: 4px 8px; font-size: 13px; background: transparent; }
.htmx-indicator { opacity: 0; transition: opacity .2s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
main.page--narrow { max-width: 440px; }
main.page--narrow form { display: grid; gap: 14px; }
main.page--narrow button[type=submit] { justify-self: start; }
.hero__actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }
.helptext { font-size: 13px; color: var(--muted); }
.errorlist { color: #d93025; font-size: 13px; margin: 0; padding: 0; list-style: none; }
.field--check { display: flex; flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 8px; }
.field fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.field fieldset legend { font-size: 14px; font-weight: 500; padding: 0; }
.field fieldset > div { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.field fieldset label { font-weight: 400; display: flex; gap: 6px; align-items: center; }
