:root {
  --bg: #f7f4ee;
  --ink: #1f2623;
  --muted: #66716b;
  --line: #d9d2c6;
  --card: #fffdf8;
  --green: #0f6a4f;
  --blue: #294c72;
  --gold: #c6812c;
  --red: #9d3d31;
  --shadow: 0 18px 50px rgba(45, 37, 24, 0.13);
  font-family: "Avenir Next", "Gill Sans", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 52px);
  background: rgba(247, 244, 238, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #21352d;
  background: #21352d;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav a,
.source-link,
.filter-btn,
.section-tab {
  border: 1px solid var(--line);
  background: #fffaf0;
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.nav a:hover,
.source-link:hover,
.filter-btn:hover,
.section-tab:hover {
  transform: translateY(-1px);
  border-color: #8d7f69;
  background: #fff4dc;
}

main {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 34px 0 60px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 28px;
  align-items: stretch;
  min-height: 310px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vw, 58px);
  background: #24332c;
  color: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 760px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 0.95;
  font-weight: 600;
}

.hero-copy p {
  max-width: 520px;
  margin-top: 22px;
  color: #dfe7df;
  font-size: 18px;
  line-height: 1.5;
}

.hero-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-panel div {
  display: grid;
  grid-template-columns: 42px 1fr;
  column-gap: 14px;
  align-content: center;
  padding: 18px;
  border: 1px solid #eadfce;
  background: #fbf6ec;
  border-radius: 7px;
}

.hero-panel span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #20392f;
  color: #fff;
  font-weight: 800;
}

.hero-panel strong {
  font-size: 18px;
}

.hero-panel small {
  color: var(--muted);
}

.section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #efe8db;
}

.section-tab {
  cursor: pointer;
}

.section-tab.active {
  border-color: #20392f;
  background: #20392f;
  color: #fff;
}

.tab-panel {
  margin-top: 0;
}

.tab-panel[hidden] {
  display: none;
}

.controls {
  display: grid;
  grid-template-columns: 1fr minmax(230px, 310px);
  gap: 14px;
  margin: 28px 0 18px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-btn {
  cursor: pointer;
}

.filter-btn.active {
  border-color: #20392f;
  background: #20392f;
  color: #fff;
}

.search-box {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  background: #fffdf8;
  border-radius: 7px;
}

.search-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.category-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 12px 36px rgba(45, 37, 24, 0.08);
}

.category-image {
  position: relative;
  height: 250px;
  background: #ddd3c3;
}

.category-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.score-pill {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(20, 35, 29, 0.9);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.category-body {
  padding: 18px;
}

.category-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.category-body h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  line-height: 1.05;
}

.category-tag {
  flex: 0 0 auto;
  color: #fff;
  background: var(--blue);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
}

.one-liner {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.mini {
  padding: 10px;
  min-height: 70px;
  border: 1px solid #eadfce;
  background: #fbf6ec;
  border-radius: 7px;
}

.mini small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.mini strong {
  display: block;
  margin-top: 5px;
  font-size: 14px;
  line-height: 1.15;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.source-link.primary {
  background: #20392f;
  color: #fff;
  border-color: #20392f;
}

.payment-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 18px;
  align-items: end;
  margin: 28px 0 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: 0 12px 36px rgba(45, 37, 24, 0.08);
}

.payment-hero h2 {
  max-width: 700px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.02;
}

.payment-hero p {
  max-width: 780px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.payment-doc-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.payment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.payment-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 12px 36px rgba(45, 37, 24, 0.08);
}

.payment-card-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.payment-card-head h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  line-height: 1.05;
}

.payment-card-head span {
  display: inline-block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.payment-card-head strong {
  display: grid;
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  background: #20392f;
  color: #fff;
  font-size: 18px;
}

.payment-lines {
  display: grid;
  gap: 9px;
}

.payment-lines p {
  display: grid;
  gap: 4px;
  padding: 11px;
  border: 1px solid #eadfce;
  border-radius: 7px;
  background: #fbf6ec;
  line-height: 1.35;
}

.payment-lines small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.payment-split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
  margin-top: 26px;
}

.provider-list,
.method-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.provider-row,
.method-row {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid #eadfce;
  border-radius: 7px;
  background: #fbf6ec;
}

.provider-row:hover {
  border-color: #8d7f69;
  background: #fff4dc;
}

.provider-row span,
.method-row span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 26px;
}

.decision-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.decision-card h2,
.credits h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
}

.gate-grid,
.avoid-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.gate-grid span,
.avoid-list span {
  padding: 9px 11px;
  border-radius: 7px;
  font-weight: 800;
  font-size: 13px;
}

.gate-grid span {
  background: #e6f2ec;
  color: var(--green);
}

.avoid-list span {
  background: #f5e4df;
  color: var(--red);
}

.credits {
  margin-top: 26px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #efe8db;
}

.credits p {
  margin-top: 8px;
  color: var(--muted);
}

#creditList,
#paymentCreditList {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

#creditList a,
#paymentCreditList a {
  color: var(--blue);
  font-weight: 800;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 30px;
  border: 1px dashed #b7aa97;
  border-radius: 8px;
  background: #fffdf8;
  color: var(--muted);
}

@media (max-width: 860px) {
  .topbar,
  .controls,
  .hero,
  .split,
  .payment-hero,
  .payment-grid,
  .payment-split,
  .category-grid,
  #creditList,
  #paymentCreditList {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
  }

  .hero-panel {
    min-width: 0;
  }

  .category-image {
    height: 210px;
  }

  .mini-grid {
    grid-template-columns: 1fr;
  }

  .payment-doc-links {
    justify-content: flex-start;
  }
}
