:root {
  --bg: #f8f7f3;
  --ink: #1c1917;
  --muted: #5c5952;
  --line: #e2ded4;
  --card: #ffffff;
  --accent: #2c5f4a;
  --accent-light: #3a7a5f;
  --accent-ink: #f4fff9;
  --shadow: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
  --shadow-sm: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
}

* { box-sizing: border-box; }
html { font-size: 17px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  font-size: 17px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-light); text-decoration: underline; text-underline-offset: 3px; }

header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.disclaimer {
  max-width: 720px;
  margin: 0 auto;
  padding: 0.75rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}
.header-bar {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}
.brand {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.brand a { color: inherit; }
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.15rem;
  font-size: 0.95rem;
  font-weight: 500;
}
nav a, nav span {
  color: var(--ink);
  padding: 0.25rem 0;
  position: relative;
}
nav a:hover {
  color: var(--accent);
}
nav span {
  color: var(--accent);
  font-weight: 700;
}

main {
  max-width: 720px;
  margin: 2rem auto;
  padding: 0 1rem;
}
.article { max-width: 720px; }
h1 {
  font-size: 2.25rem;
  line-height: 1.1;
  margin: 0 0 1rem;
  letter-spacing: -0.04em;
  font-weight: 700;
}
h2 {
  font-size: 1.35rem;
  margin: 0 0 0.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.promise {
  font-size: 1.1rem;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 2.5rem;
  max-width: 620px;
}

.page-home .hero {
  background: linear-gradient(135deg, #1e3a2f 0%, #2c5f4a 100%);
  color: white;
  padding: 4.5rem 2rem 4rem;
  border-radius: 24px;
  margin-bottom: 3rem;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgb(44 95 74 / 0.25);
  position: relative;
  overflow: hidden;
}
.page-home .hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.18) 0%, transparent 60%);
  pointer-events: none;
}
.page-home h1 {
  color: white;
  font-size: 2.85rem;
  margin-bottom: 1.25rem;
  letter-spacing: -0.05em;
}
.page-home .promise {
  color: #d1ede0;
  font-size: 1.2rem;
  max-width: 560px;
  margin: 0 auto;
  opacity: 0.95;
}

.section-cards {
  display: grid;
  gap: 1.25rem;
  margin-top: 1rem;
}
.section-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.75rem 1.5rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.section-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.08);
  border-color: var(--accent-light);
}
.section-card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
  color: var(--ink);
}
.section-card .count {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #f1f0eb;
  color: var(--accent);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  margin: 0 0 1rem;
}
.section-card .count strong { font-size: 1.35rem; }
.section-card .count span { color: var(--muted); font-weight: 500; font-size: 0.95rem; }
.section-card p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.5;
}

.filters {
  margin: 2rem 0 1.5rem;
  display: grid;
  gap: 1.25rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.filters .sort, .filters .filter, .filters fieldset {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
}
.filters legend, .filters .legend {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.75rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.filters .hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.25rem;
  font-weight: 400;
}
.filters label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem 0;
}
.filters input[type="radio"] {
  accent-color: var(--accent);
  transform: scale(1.1);
}

.sort-keys, .filter-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.sort-key, .filter-key {
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 9999px;
  padding: 0.45rem 1rem;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}
.sort-key:hover, .filter-key:hover {
  border-color: var(--accent-light);
  background: #f8f7f3;
}
.sort-key.is-on {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  box-shadow: 0 4px 6px -1px rgb(44 95 74 / 0.2);
}
.filter-key.is-on {
  border-color: var(--accent);
  background: #e7f3ec;
  color: var(--accent);
  font-weight: 700;
  box-shadow: 0 4px 6px -1px rgb(44 95 74 / 0.12);
}
.sort-key .n {
  display: inline-block;
  min-width: 1.25em;
  margin-right: 0.35rem;
  font-weight: 700;
  opacity: 0.9;
}
.sort-clear, .filter-clear {
  display: block;
  margin-top: 0.75rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  background: #b91c1c;
  color: #fff;
  border: 1px solid #991b1b;
  border-radius: 8px;
  padding: 0.45rem 1rem;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}
.sort-clear:hover, .filter-clear:hover {
  background: #991b1b;
  color: #fff;
  border-color: #7f1d1d;
}

.list {
  width: 100%;
  display: grid;
  gap: 1.25rem;
}
.listing {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.listing:hover {
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  border-color: var(--accent-light);
}
.listing.is-hidden { display: none; }

.listing-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.listing .name {
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.25;
  color: var(--ink);
  text-decoration: none;
}
.listing .name:hover {
  color: var(--accent);
}
.visit-wrap {
  margin: 1.25rem 0 0;
}
.visit-btn {
  display: block;
  width: 100%;
  text-align: center;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  text-decoration: none;
  box-shadow: 0 4px 6px -1px rgb(44 95 74 / 0.25);
}
.visit-btn:hover {
  background: var(--accent-light);
  color: var(--accent-ink);
  text-decoration: none;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.35em 0.85em;
  border-radius: 9999px;
  white-space: nowrap;
}
.badge-open {
  background: #166534;
  color: #f0fdf4;
  box-shadow: 0 1px 3px rgba(22, 101, 52, 0.3);
}
.badge-closed {
  background: #44403c;
  color: #f5f5f4;
}
.badge-unknown {
  background: #f3f2ee;
  color: var(--muted);
  border: 1px solid var(--line);
}
.badge-stale {
  background: #fefce8;
  color: #713f12;
  border: 1px solid #fde047;
}
.badge-unpaid {
  background: #9f1239;
  color: #fff;
  box-shadow: 0 1px 3px rgba(159, 18, 57, 0.35);
  letter-spacing: 0.08em;
}
.listing.is-unpaid {
  border: 2px solid #9f1239;
  background: #fff7f8;
}
.listing.is-unpaid .unpaid-pay {
  color: #9f1239;
  font-weight: 700;
  font-style: normal;
}

.listing-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.1rem 2rem;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.field .k {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.1rem;
}
.field .v {
  font-size: 1rem;
  line-height: 1.45;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.unknown {
  color: var(--muted);
  font-style: italic;
}
.listing-fields .field[data-field="source"] .v a {
  font-weight: 500;
}

footer {
  margin-top: auto;
  padding: 2.5rem 1rem 2rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  border-top: 1px solid var(--line);
  background: var(--card);
}
footer p {
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.5;
}

@media (min-width: 700px) {
  html { font-size: 18px; }
  .header-bar {
    max-width: 720px;
    margin: 0 auto;
    padding: 1rem;
  }
  .section-cards { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
  .filters {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .listing-fields {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

@media (min-width: 1024px) {
  main {
    padding: 0 2rem;
  }
  .section-cards {
    gap: 1.5rem;
  }
}

@media print {
  body { background: #fff; }
  .listing { break-inside: avoid; }
}
