:root {
  color-scheme: light dark;
  --bg: #f7f7f5;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --card: #ffffff;
  --border: #e4e4e0;
  --accent: #1a6b3c;
  --accent-bg: #e6f4ea;
  --removed-bg: #fdecea;
  --removed-accent: #a83232;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17181a;
    --fg: #e9e9e7;
    --muted: #9a9a97;
    --card: #212224;
    --border: #33342f;
    --accent: #4fd18b;
    --accent-bg: #143d27;
    --removed-bg: #3d1f1c;
    --removed-accent: #e08a80;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.4;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.subtitle {
  color: var(--muted);
  margin-bottom: 2rem;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

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

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-new { background: var(--accent-bg); color: var(--accent); }
.badge-removed { background: var(--removed-bg); color: var(--removed-accent); }

.section-title {
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.empty {
  color: var(--muted);
  padding: 1rem;
  font-style: italic;
}

.back {
  display: inline-block;
  margin-bottom: 1.5rem;
}

.meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.status-failed { color: var(--removed-accent); font-weight: 600; }
.status-running { color: var(--muted); font-style: italic; }

.nav-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.nav-cats a {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--fg);
  font-size: 0.85rem;
}

.nav-cats a.active {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.places-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.filter-input {
  flex: 1 1 240px;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--fg);
  font-size: 0.9rem;
}

.filter-select {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--fg);
  font-size: 0.9rem;
}

.result-count {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.places-map {
  height: 360px;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  background: var(--card);
}

.table-scroll {
  overflow-x: auto;
}

th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

th.sortable:hover { color: var(--fg); }

th.sortable::after {
  content: "";
  display: inline-block;
  width: 0.6em;
}

th.sort-asc::after { content: "▲"; font-size: 0.7em; }
th.sort-desc::after { content: "▼"; font-size: 0.7em; }
