:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1c1c1c;
  --text-muted: #5a5a5a;
  --border: #e2e0db;
  --accent: #1f5f4f;
  --accent-contrast: #ffffff;
  --banner-bg: #fff6da;
  --banner-border: #e8cf7a;
  --full: #2f7d5c;
  --partial: #b8860b;
  --none: #b4453e;
  --no-tax: #4a6fa5;
  --unknown: #8a8a8a;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --surface: #1c1f24;
    --text: #ececec;
    --text-muted: #a3a3a3;
    --border: #2c2f35;
    --accent: #4fae8c;
    --accent-contrast: #0b0e0c;
    --banner-bg: #2c2717;
    --banner-border: #6b5a24;
    --full: #4fae8c;
    --partial: #d3a441;
    --none: #d9756e;
    --no-tax: #7fa6d9;
    --unknown: #9a9a9a;
  }
}

* { box-sizing: border-box; }

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

.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 32px 0;
}

.site-header h1 {
  margin: 0 0 4px;
  font-size: 1.8rem;
}

.tagline {
  margin: 0;
  opacity: 0.9;
}

.banner {
  background: var(--banner-bg);
  border: 1px solid var(--banner-border);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 24px 0;
  font-size: 0.92rem;
}

.banner a {
  color: inherit;
  text-decoration: underline;
}

.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

#search {
  flex: 1;
  min-width: 200px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
}

#filter {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
}

.legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
}

.pill-full { background: var(--full); }
.pill-partial { background: var(--partial); }
.pill-none { background: var(--none); }
.pill-no-income-tax { background: var(--no-tax); }
.pill-unknown, .pill-unverified { background: var(--unknown); }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: var(--bg);
  position: sticky;
  top: 0;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

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

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

.state-name { font-weight: 600; white-space: nowrap; }

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

.loading, .empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 24px;
}

.site-footer {
  margin: 28px 0 48px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.site-footer code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}
