:root {
  --bg: #f5f3ee;
  --panel: #ffffff;
  --border: #ddd6c8;
  --text: #2a2620;
  --text-muted: #6b6558;
  --accent: #1b5e4a;
  --accent-light: #d7ece4;
  --score-high: #2e7d32;
  --score-medium: #b08900;
  --score-low: #a33;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1a17;
    --panel: #26241f;
    --border: #3a372f;
    --text: #ece8de;
    --text-muted: #a39d8c;
    --accent: #4cae92;
    --accent-light: #233a32;
    --score-high: #66bb6a;
    --score-medium: #e0b84a;
    --score-low: #e06060;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

#app-header {
  padding: 0.8em 1.2em;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 1em;
}
#app-header h1 { font-size: 1.2em; margin: 0; }
#result-count { color: var(--text-muted); margin: 0; font-size: 0.9em; }

#layout {
  display: flex;
  height: calc(100vh - 56px);
}

#sidebar {
  width: 340px;
  min-width: 340px;
  overflow-y: auto;
  padding: 1em;
  border-right: 1px solid var(--border);
  background: var(--panel);
}

#map { flex: 1; }

.filter-group {
  margin-bottom: 1.2em;
}
.filter-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3em;
  font-size: 0.9em;
}
.filter-group select, .filter-group input[type="range"] {
  width: 100%;
}
.filter-group select[multiple] {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.hint {
  font-size: 0.78em;
  color: var(--text-muted);
  margin: 0.3em 0 0;
}

#filter-reset {
  width: 100%;
  padding: 0.5em;
  margin-bottom: 1em;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
}
#filter-reset:hover { opacity: 0.9; }

#candidate-list {
  border-top: 1px solid var(--border);
  padding-top: 0.8em;
}

.candidate-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6em;
  margin-bottom: 0.6em;
  cursor: pointer;
  background: var(--bg);
}
.candidate-card:hover { border-color: var(--accent); }
.candidate-card img {
  width: 100%;
  max-height: 110px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  margin-bottom: 0.4em;
}
.candidate-card h3 {
  margin: 0 0 0.2em;
  font-size: 0.95em;
}
.candidate-card .meta {
  font-size: 0.78em;
  color: var(--text-muted);
}

.badge {
  display: inline-block;
  padding: 0.1em 0.5em;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: 600;
  color: white;
  margin-right: 0.3em;
}
.badge.score-high { background: var(--score-high); }
.badge.score-medium { background: var(--score-medium); }
.badge.score-low { background: var(--score-low); }
.badge.boats { background: var(--accent); }

.popup-content { max-width: 260px; }
.popup-content img {
  width: 100%;
  border-radius: 4px;
  margin-bottom: 0.4em;
}
.popup-content h3 { margin: 0 0 0.3em; font-size: 1em; }
.popup-content dl { font-size: 0.82em; margin: 0; }
.popup-content dt { font-weight: 600; margin-top: 0.3em; }
.popup-content dd { margin: 0; }
.popup-content .wiki { font-style: italic; color: var(--text-muted); margin-top: 0.4em; }

.fuel-icon {
  font-size: 18px;
  line-height: 22px;
  text-align: center;
  filter: drop-shadow(0 0 2px white);
}
