:root {
  --page-bg: #faf8f4;
  --map-fill: #f7f4ed;
  --text: #1a1a1a;
  --text-muted: #334155;
  --accent: #2f5233;
  --accent-hover: #3d6a42;
  --card-border: #d4cfc4;
  --county-selected: #b8860b;
  --county-hover: #ebe4d4;
  --font-serif: Georgia, "Times New Roman", Times, serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--page-bg);
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-hover);
}

.site-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--card-border);
  background: #fff;
}

.site-header__brand {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.site-header__brand a {
  color: var(--text);
  text-decoration: none;
}

.site-header__brand a:hover {
  color: var(--accent);
}

.site-header__tagline {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.site-main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem;
}

.site-main--wide {
  max-width: 90rem;
}

.site-footer {
  margin-top: 2rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--card-border);
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
}

.intro {
  margin: 0 0 1.5rem;
  max-width: 40rem;
  color: var(--text-muted);
}

.card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.map-card {
  display: block;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--card-border);
  border-radius: 0.5rem;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.map-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(47, 82, 51, 0.12);
}

.map-card__title {
  margin: 0 0 0.5rem;
  font-family: var(--font-serif);
  font-size: 1.125rem;
  color: var(--accent);
}

.map-card__desc {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.page-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-serif);
  font-size: 1.375rem;
}

.page-lead {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.9375rem;
}

.map-panel {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 56rem) {
  .map-panel {
    grid-template-columns: 18rem 1fr;
    align-items: start;
  }
}

.sidebar {
  padding: 1.25rem;
  border: 1px solid var(--card-border);
  border-radius: 0.5rem;
  background: #fff;
}

.sidebar__instructions {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.sidebar__actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.sidebar__actions .btn {
  width: 100%;
  text-align: center;
}

.btn--secondary {
  color: var(--accent);
  background: transparent;
}

.btn--secondary:hover {
  color: #fff;
  background: var(--accent);
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 0.375rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.selection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.selection-header__title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.selection-count {
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
}

.selection-list {
  margin: 0;
  padding: 0;
  max-height: 24rem;
  overflow-y: auto;
  list-style: none;
}

.selection-list__empty {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-style: italic;
}

.selection-list li {
  padding: 0.25rem 0;
  font-size: 0.9375rem;
  border-bottom: 1px solid var(--card-border);
}

.selection-list li:last-child {
  border-bottom: none;
}

.map-wrap {
  padding: 0.75rem;
  border: 1px solid var(--card-border);
  border-radius: 0.5rem;
  background: #fff;
}

#map-root {
  width: 100%;
  line-height: 0;
}

#map-root svg {
  display: block;
  width: 100%;
  height: auto;
}

#map-root .county {
  cursor: pointer;
}

#map-root .county:hover:not(.is-selected) path {
  fill: var(--county-hover);
}

#map-root .county.is-selected path {
  fill: var(--county-selected);
}

.map-loading,
.map-error {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
}

.map-error {
  color: #991b1b;
}
