:root {
  --bg: #f7f5f2;
  --surface: #ffffff;
  --border: #e7e2da;
  --text: #2b2620;
  --text-muted: #85796a;
  --accent: #1f8a70;
  --free: #e8f3ee;
  --free-text: #1f7a5c;
  --mid: #ffc2e5;
  --mid-text: #8a1a55;
  --high: #d9c2ff;
  --high-text: #4a1a8a;
  --shadow: 0 1px 2px rgba(30,20,10,0.04), 0 6px 20px rgba(30,20,10,0.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17140f;
    --surface: #211d17;
    --border: #332c22;
    --text: #f2ece2;
    --text-muted: #a89c8a;
    --accent: #4fd6ac;
    --free: #163227;
    --free-text: #7fe0bc;
    --mid: #4a2038;
    --mid-text: #ffb3dd;
    --high: #2f2050;
    --high-text: #c9adff;
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 6px 20px rgba(0,0,0,0.4);
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
header {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
}
header h1 { font-size: 1.15rem; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
header h1 span { color: var(--accent); }
.header-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pagenav { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
.pagenav a {
  padding: 6px 12px; border-radius: 6px; font-size: 0.82rem; text-decoration: none; color: var(--text-muted); font-weight: 600;
}
.pagenav a.active { background: var(--accent); color: var(--bg); }
.legend { display: flex; gap: 10px; font-size: 0.72rem; color: var(--text-muted); flex-wrap: wrap; }
.legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.dot.free { background: var(--free-text); }
.dot.mid { background: var(--mid); border: 1px solid var(--mid-text); }
.dot.high { background: var(--high); border: 1px solid var(--high-text); }

.city-filter { position: relative; }
.city-filter button {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 8px 14px; border-radius: 8px; font-size: 0.85rem; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
}
.city-filter button:hover { border-color: var(--accent); }
.city-panel {
  display: none;
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow); padding: 10px; min-width: 210px; max-height: 60vh; overflow-y: auto;
}
.city-panel.open { display: block; }
.city-panel label {
  display: flex; align-items: center; gap: 8px; padding: 6px 6px; border-radius: 6px;
  font-size: 0.85rem; cursor: pointer;
}
.city-panel label:hover { background: var(--bg); }
.city-panel .panel-actions {
  display: flex; gap: 8px; padding: 4px 6px 8px; border-bottom: 1px solid var(--border); margin-bottom: 6px;
}
.city-panel .panel-actions button { background: none; border: none; color: var(--accent); font-size: 0.75rem; cursor: pointer; padding: 0; }

.layout { display: flex; max-width: 1100px; margin: 0 auto; align-items: flex-start; }
nav.sidebar {
  position: sticky; top: 62px;
  width: 190px; flex-shrink: 0;
  padding: 24px 12px 24px 20px;
  max-height: calc(100vh - 62px);
  overflow-y: auto;
}
nav.sidebar a { display: block; padding: 6px 10px; margin-bottom: 2px; color: var(--text-muted); text-decoration: none; font-size: 0.85rem; border-radius: 6px; }
nav.sidebar a:hover { background: var(--surface); color: var(--text); }
nav.sidebar a .count { color: var(--text-muted); font-size: 0.72rem; }

main { flex: 1; min-width: 0; padding: 24px 20px 80px; }
main.full { max-width: 720px; margin: 0 auto; }

section.city-section { margin-bottom: 36px; scroll-margin-top: 70px; }
section.city-section h2 {
  font-size: 1.3rem; margin: 0 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--border);
  text-transform: lowercase;
}
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.cards.list { grid-template-columns: 1fr; gap: 10px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.card.past { opacity: 0.55; }
.card-img { height: 140px; width: 100%; object-fit: cover; display: block; background: var(--border); }
.card-img.placeholder {
  display: flex; align-items: center; justify-content: center; font-size: 2rem;
  background: linear-gradient(135deg, var(--free), var(--bg));
}
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-city-tag {
  font-size: 0.68rem; text-transform: lowercase; letter-spacing: .03em; color: var(--accent); font-weight: 700;
}
.card-title { font-size: 1rem; font-weight: 700; margin: 0; line-height: 1.3; }
.card-date { font-size: 0.78rem; color: var(--text-muted); }
.card-desc { font-size: 0.83rem; color: var(--text-muted); line-height: 1.45; flex: 1; }
.price-badge {
  display: inline-flex; align-items: center; gap: 5px; align-self: flex-start;
  font-size: 0.72rem; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: var(--free); color: var(--free-text);
}
.price-badge.mid { background: var(--mid); color: var(--mid-text); }
.price-badge.high { background: var(--high); color: var(--high-text); }
.card-link { font-size: 0.78rem; color: var(--accent); text-decoration: none; font-weight: 600; margin-top: 2px; }
.card-link:hover { text-decoration: underline; }
.past-tag { font-size: 0.68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }

/* Compact list rows for the per-stad page */
.list-row {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 12px;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  text-decoration: none; color: var(--text);
}
.list-row:hover { border-color: var(--accent); }
.list-row .name { font-size: 0.95rem; font-weight: 600; }
.list-row .meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.list-row .date { font-size: 0.76rem; color: var(--text-muted); white-space: nowrap; }
.price-badge { white-space: normal; text-align: left; }
.list-row.past { opacity: 0.5; }

.empty-state { color: var(--text-muted); font-size: 0.9rem; padding: 40px 0; text-align: center; }

@media (max-width: 720px) {
  nav.sidebar { display: none; }
  main { padding: 20px 16px 60px; }
}
