:root {
  color-scheme: light;
  --page:        #f9f9f7;
  --surface:     #fcfcfb;
  --ink:         #0b0b0b;
  --ink-2:       #52514e;
  --muted:       #898781;
  --border:      rgba(11,11,11,0.10);
  --good:        #0ca30c;
  --warning:     #fab219;
  --serious:     #ec835a;
  --critical:    #d03b3b;
  --intl:        #2a78d6;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page:    #0d0d0d;
    --surface: #1a1a19;
    --ink:     #ffffff;
    --ink-2:   #c3c2b7;
    --muted:   #898781;
    --border:  rgba(255,255,255,0.10);
    --intl:    #3987e5;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page:    #0d0d0d;
  --surface: #1a1a19;
  --ink:     #ffffff;
  --ink-2:   #c3c2b7;
  --muted:   #898781;
  --border:  rgba(255,255,255,0.10);
  --intl:    #3987e5;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
}
.wrap { max-width: 900px; margin: 0 auto; padding: 24px 20px 64px; }
h1 { font-size: 1.6rem; margin: 0 0 4px; }
h2 { font-size: 1.15rem; margin: 32px 0 12px; }
.subtitle { color: var(--ink-2); margin: 0 0 24px; }
.muted { color: var(--muted); font-size: 0.9rem; }
a { color: var(--intl); }

nav.top {
  display: flex; align-items: center; gap: 16px; margin-bottom: 24px; font-size: 0.95rem;
  flex-wrap: wrap;
}
nav.top a { text-decoration: none; font-weight: 600; }
/* Pushes the event picker to the right edge on wide screens; wraps below on narrow ones. */
#event-picker { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.event-picker-label {
  margin: 0; font-size: 0.78rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--muted); display: inline;
}
.event-select {
  font: inherit; font-size: 0.9rem; font-weight: 600; padding: 5px 10px;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink); cursor: pointer;
}

.legend { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 0.82rem; font-weight: 600;
  border: 1px solid var(--border);
}
.chip .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.tier-High .dot, .badge-High { background: var(--good); }
.tier-Medium .dot, .badge-Medium { background: var(--warning); }
.tier-Fair .dot, .badge-Fair { background: var(--serious); }
.tier-Low .dot, .badge-Low { background: var(--serious); }
.tier-Negative .dot, .badge-Negative { background: var(--critical); }
.tier-International .dot, .badge-International { background: var(--intl); }

.tier-group { margin-bottom: 28px; }
.tier-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tier-heading .dot { width: 14px; height: 14px; border-radius: 50%; }
.tier-heading h2 { margin: 0; }

.card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.card-name { font-weight: 600; }
.card-loc { color: var(--ink-2); font-size: 0.92rem; }
.card-meta { font-size: 0.85rem; color: var(--muted); margin-top: 2px; }
.card-note {
  margin-top: 8px; font-size: 0.88rem; color: var(--ink-2);
  border-left: 3px solid var(--border); padding-left: 10px;
}
.badge-International { color: #fff; }

.pill-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pill {
  color: #fff; font-size: 0.78rem; font-weight: 600;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.pill-nodata {
  color: var(--muted); font-size: 0.78rem; font-weight: 600;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
  border: 1px dashed var(--border); background: transparent;
}
.sources { margin-top: 8px; font-size: 0.82rem; }
.sources summary { cursor: pointer; color: var(--intl); font-weight: 600; }
.sources-links { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }

.callout {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 20px; font-size: 0.92rem;
}
/* Neutral, not an error: a stale event link is a question, not a failure. */
.chooser-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

footer { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 0.82rem; color: var(--muted); }

/* Survey + results shared */
button, .btn {
  font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink); padding: 8px 14px;
}
button.primary { background: var(--intl); color: #fff; border-color: transparent; font-weight: 600; }
button.small { padding: 4px 9px; font-size: 0.85rem; }
input[type="text"], textarea {
  width: 100%; font: inherit; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
}
label { font-weight: 600; font-size: 0.9rem; display: block; margin: 16px 0 6px; }
.pick-list { list-style: none; padding: 0; margin: 8px 0; }
.pick-list li {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
}
.pick-list .rank { font-weight: 700; color: var(--muted); width: 1.4em; }
.pick-list .item-label { flex: 1; }
.available-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 20px; }
.available-list .btn { font-size: 0.88rem; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bar-row .label { width: 220px; font-size: 0.9rem; flex-shrink: 0; }
.bar-track { flex: 1; background: var(--border); border-radius: 6px; height: 18px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--intl); border-radius: 6px; }
.bar-row .points { width: 3em; text-align: right; font-size: 0.85rem; color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.status-msg { padding: 10px 14px; border-radius: 8px; margin: 12px 0; font-size: 0.9rem; }
.status-msg.ok { background: rgba(12,163,12,0.12); color: var(--good); }
.status-msg.err { background: rgba(208,59,59,0.12); color: var(--critical); }
