:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --text-primary: #111827;
  --text-secondary: #374151;
  --text-muted: #4b5563;
  --border-color: #d4d4d8;
  --table-header-bg: #e5e7eb;
  --input-border: #9ca3af;
  --button-bg: #111827;
  --button-hover-bg: #1f2937;
  --button-text: #f9fafb;
  --link-color: #1d4ed8;
  --focus-color: #2563eb;
  --error-color: #b91c1c;
  --map-grid: rgba(255, 255, 255, 0.15);
  --map-dot-yellow: #ffcc00;
  --map-dot-pale-yellow: #fffbcc;
  --map-dot-pale-blue: #cde9ff;
}

[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #e2e8f0;
  --text-muted: #cbd5e1;
  --border-color: #475569;
  --table-header-bg: #1e293b;
  --input-border: #64748b;
  --button-bg: #1d4ed8;
  --button-hover-bg: #1e40af;
  --button-text: #ffffff;
  --link-color: #93c5fd;
  --focus-color: #60a5fa;
  --error-color: #fca5a5;
  --map-grid: rgba(0, 0, 0, 0.3);
  --map-dot-yellow: #fbbf24;
  --map-dot-pale-yellow: #fef3c7;
  --map-dot-pale-blue: #bfdbfe;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 1rem 2rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1 {
  font-size: 1.4rem;
  margin-bottom: 0.3rem;
}

h2 {
  font-size: 1.1rem;
  margin-top: 0;
}

.flex {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.card {
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--bg-secondary);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.small {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

table {
  border-collapse: collapse;
  width: 100%;
  margin-top: 0.5rem;
}

th,
td {
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
  text-align: left;
}

th {
  background: var(--table-header-bg);
  color: var(--text-primary);
}

/* Map container styling */

.map-container {
  width: 100%;
  max-width: 900px;
  margin-top: 1rem;
  border: 1px solid #555;
  border-radius: 4px;
  overflow: hidden;
}

##participantsMap {
  width: 100%;
  height: auto;
  display: block;
}

/* Thin, subtle grid on top of the background */
.map-grid-line {
  stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 0.8;
}

/* Main dots: larger, with a halo */
.map-city {
  fill: var(--map-dot-pale-yellow);
  stroke: #000000;
  stroke-width: 1.5;
}

/* Smaller groups still visible but slightly different color */
.map-city-small {
  fill: var(--map-dot-pale-blue);
}

.participant-dot {
  fill: var(--map-dot-yellow);
  stroke: #000;
  stroke-width: 1.5;
  opacity: 0.9;
}

input[type="number"] {
  width: 4rem;
}

.map-wrapper {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.world-map-image {
  display: block;
  width: 100%;
  height: auto;
}

.world-map-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.map-city {
  fill: var(--map-dot-yellow);
  stroke: #000;
  stroke-width: 0.7;
  opacity: 0.9;
}

.map-city-small {
  opacity: 0.8;
}

.map-grid-line {
  stroke: var(--map-grid);
  stroke-width: 0.5;
}

input,
select {
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--input-border);
  font-size: 0.9rem;
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* Textarea styling */
textarea {
  width: 100%;
  min-height: 160px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.85rem;
  border-radius: 4px;
  border: 1px solid var(--input-border);
  padding: 0.4rem 0.5rem;
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* Buttons with good contrast and clear focus */
button {
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid var(--button-bg);
  background: var(--button-bg);
  color: var(--button-text);
  font-size: 0.9rem;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

button:hover {
  background: var(--button-hover-bg);
  border-color: var(--button-hover-bg);
}

/* Smaller buttons for +/- people controls */
.people-btn {
  padding: 0.15rem 0.5rem;
  font-size: 0.85rem;
  margin: 0 0.15rem;
}

/* Focus visible for all interactive controls */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus-color);
  outline-offset: 2px;
}

/* Badges with AA contrast */
.badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  margin-left: 0.3rem;
  font-weight: 500;
}

.badge-good {
  background: #ecfdf5;   /* very light green */
  color: #065f46;        /* dark green, high contrast */
}

[data-theme="dark"] .badge-good {
  background: #064e3b;   /* dark green background */
  color: #d1fae5;        /* light green text */
}

.badge-ok {
  background: #fffbeb;   /* very light amber */
  color: #92400e;        /* dark amber, high contrast */
}

[data-theme="dark"] .badge-ok {
  background: #78350f;   /* dark amber background */
  color: #fef3c7;        /* light amber text */
}

.badge-bad {
  background: #fef2f2;   /* very light red */
  color: #b91c1c;        /* dark red, high contrast */
}

[data-theme="dark"] .badge-bad {
  background: #7f1d1d;   /* dark red background */
  color: #fecaca;        /* light red text */
}

.error {
  color: var(--error-color);
  font-size: 0.9rem;
}

.muted {
  color: var(--text-muted);
}

/* Link color with good contrast */
a {
  color: var(--link-color);
}

a:focus-visible {
  outline: 2px solid var(--focus-color);
  outline-offset: 2px;
}

/* Theme toggle button */
#themeToggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  padding: 0.5rem;
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#themeToggle:hover {
  transform: scale(1.05);
}

/* Optional visually hidden text helper if you need it later */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}



/* Bluesky Links */
/* Container card */
.post__likes {
  margin-block: 2rem;
  padding: 1.25rem 1.5rem;
  border-radius: 0.75rem;
  text-align: center;
  margin-inline: auto;

  /* KEY CHANGES: no hard-coded colors */
  color: inherit; /* use whatever the page is using (light or dark) */
  border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
  background-color: color-mix(in srgb, currentColor 4%, transparent);

  /* optional layout */
  max-width: 32rem;
}

/* Heading */
.post__likesTitle {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

/* CTA link */
.post__likesCta {
  display: inline-block;
  margin-bottom: 0.75rem;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  color: inherit; /* let the global link color / theme handle it */
  display: inline-block;
  margin-inline: auto;
}

/* Avatar list */
.post__likesList {
  list-style: none;
  padding: 0;
  margin: 1rem auto 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .5rem;
}

.post__like {
  margin: 0;
  padding: 0;
}

.post__like__avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;

  /* also theme-aware */
  border: 2px solid color-mix(in srgb, currentColor 40%, transparent);
  display: block;
}

.social-media-links {
    text-align: center;
}
