:root {
  --bg: #f7f8fa;
  --card: #ffffff;
  --ink: #1c2330;
  --muted: #5b6573;
  --hairline: #e3e7ee;
  --link: #1657c8;
  --link-hover: #0e3f99;
  --accent: #143062;
  --accent-light: #1c4485;
  --cta: #c0392b;
  --cta-hover: #a72f22;
  --cta-bg: #fff1ee;
  --warn-bg: #fff7e6;
  --warn-border: #f0c977;
  --good-bg: #ecf7ee;
  --good-border: #2f9e44;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

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

/* ---------- header ----------------------------------------------------- */
.site-header {
  background: var(--accent);
  color: #fff;
  padding: 14px 0;
  border-bottom: 4px solid #0c2348;
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.site-header a.brand {
  color: #fff; font-weight: 700; font-size: 19px; text-decoration: none;
  letter-spacing: 0.2px;
}
.site-header a.brand:hover { color: #fff; }
.site-header .brand-com { color: #d6e4ff; font-weight: 500; }
.site-header nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-header nav a { color: #d6e4ff; font-weight: 500; }
.site-header nav a:hover { color: #fff; text-decoration: none; }
.site-header form.search { margin-left: auto; display: flex; }
.site-header form.search input {
  padding: 6px 10px; border: 1px solid var(--accent-light); background: #fff;
  border-radius: 4px 0 0 4px; width: 230px; font-size: 14px;
}
.site-header form.search button {
  padding: 6px 14px; border: 0; background: var(--cta); color: #fff;
  border-radius: 0 4px 4px 0; font-weight: 600; cursor: pointer;
}
.site-header form.search button:hover { background: var(--cta-hover); }

/* ---------- hero ------------------------------------------------------- */
.hero {
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--hairline);
}
.hero.compact { padding: 28px 0 24px; }
.hero h1 {
  font-size: 32px;
  margin: 0 0 12px;
  color: var(--accent);
  line-height: 1.15;
  letter-spacing: -0.3px;
}
.hero.compact h1 { font-size: 26px; }
.hero p.lede {
  font-size: 17px;
  color: var(--muted);
  max-width: 720px;
  margin: 0 0 20px;
}
.hero p.crumb { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.hero p.crumb a { color: var(--muted); }
.hero p.hero-note {
  font-size: 13px; color: var(--muted); max-width: 720px;
  margin: 14px 0 0; padding-top: 14px; border-top: 1px dashed var(--hairline);
}

.hero-search { display: flex; max-width: 560px; margin: 0; }
.hero-search input {
  flex: 1; padding: 12px 14px; font-size: 16px;
  border: 1px solid #ccd2de; border-radius: 4px 0 0 4px; background: #fff;
}
.hero-search input:focus {
  outline: none; border-color: var(--link); box-shadow: 0 0 0 3px #d6e4ff;
}
.hero-search button {
  padding: 12px 22px; border: 0; background: var(--cta); color: #fff;
  font-weight: 600; font-size: 15px; border-radius: 0 4px 4px 0; cursor: pointer;
}
.hero-search button:hover { background: var(--cta-hover); }

.vendor-hero { background: linear-gradient(180deg, #ffffff 0%, #f0f2f8 100%); }
.vendor-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

.btn {
  display: inline-block; padding: 9px 16px; border-radius: 4px;
  font-weight: 600; font-size: 14px; text-decoration: none;
}
.btn-primary { background: var(--cta); color: #fff; }
.btn-primary:hover { background: var(--cta-hover); color: #fff; text-decoration: none; }
.btn-secondary {
  background: #fff; color: var(--accent); border: 1px solid var(--hairline);
}
.btn-secondary:hover { background: #f0f2f8; text-decoration: none; }

/* ---------- sections --------------------------------------------------- */
.section { padding: 32px 0 8px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 0 0 14px; gap: 12px;
}
.section-head h2 {
  margin: 0; font-size: 20px; color: var(--accent); font-weight: 700;
}
.section-head h2 a { color: var(--accent); }
.section-more { font-size: 14px; color: var(--link); }
.cat-count-pill {
  background: var(--bg); border: 1px solid var(--hairline);
  padding: 3px 10px; border-radius: 999px; font-size: 13px; color: var(--muted);
}

/* ---------- category grid --------------------------------------------- */
.cat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}
.cat-grid.full { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.cat-card {
  background: var(--card); border: 1px solid var(--hairline); border-radius: 6px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 4px;
  text-decoration: none; transition: border-color 0.1s, transform 0.1s;
}
.cat-card:hover {
  border-color: var(--accent); text-decoration: none; transform: translateY(-1px);
}
.cat-label { color: var(--ink); font-weight: 600; font-size: 14px; }
.cat-count { color: var(--muted); font-size: 13px; }

/* ---------- vendor grid ---------------------------------------------- */
.vendor-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.vendor-card {
  background: var(--card); border: 1px solid var(--hairline); border-radius: 6px;
  padding: 16px; text-decoration: none; transition: border-color 0.1s;
}
.vendor-card:hover { border-color: var(--accent); text-decoration: none; }
.vendor-name { color: var(--accent); font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.vendor-count { color: var(--muted); font-size: 13px; }

/* ---------- explainer ------------------------------------------------- */
.explainer { padding-top: 36px; padding-bottom: 16px; }
.explainer h2 { color: var(--accent); }
.explainer .two-col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  margin-top: 14px;
}
.explainer .two-col > div {
  background: var(--card); border: 1px solid var(--hairline);
  border-radius: 6px; padding: 18px 20px;
}
.explainer h3 { margin: 0 0 8px; font-size: 16px; color: var(--accent); }
.explainer p { margin: 0; color: var(--muted); font-size: 14px; }
.explainer .two-col p a { color: var(--link); }
@media (max-width: 700px) { .explainer .two-col { grid-template-columns: 1fr; } }

/* ---------- vendor stats ---------------------------------------------- */
.vendor-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  margin: 18px 0 8px;
}
.vendor-stats .stat {
  background: var(--card); border: 1px solid var(--hairline);
  border-radius: 6px; padding: 16px 18px;
}
.vendor-stats .stat-num {
  font-size: 26px; font-weight: 700; color: var(--accent); line-height: 1.1;
}
.vendor-stats .stat-label { font-size: 13px; color: var(--muted); margin-top: 2px; }
.vendor-explainer {
  margin: 18px 0 28px; padding: 14px 16px;
  background: var(--card); border: 1px solid var(--hairline); border-radius: 6px;
  color: var(--muted); font-size: 14px;
}
@media (max-width: 700px) { .vendor-stats { grid-template-columns: 1fr; } }

/* ---------- vendor strip on category page ----------------------------- */
.vendor-strip {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin: 18px 0 14px;
}
.strip-label { font-size: 13px; color: var(--muted); margin-right: 4px; }
.strip-pill {
  background: var(--card); border: 1px solid var(--hairline);
  padding: 4px 12px; border-radius: 999px; font-size: 13px;
  text-decoration: none;
}
.strip-pill:hover { border-color: var(--accent); text-decoration: none; }
.strip-pill span { color: var(--muted); }
.strip-pill-active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.strip-pill-active:hover { color: #fff; background: var(--accent-light); border-color: var(--accent-light); }
.strip-pill-active span { color: #d6e4ff; }

.lookup-result {
  background: var(--card); border: 1px solid var(--hairline); border-radius: 6px;
  padding: 18px 20px; margin: 18px 0;
}
.lookup-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px; margin-bottom: 14px;
}
.lookup-meta .lookup-label {
  font-size: 11px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.4px; margin-bottom: 4px;
}
.lookup-vendor {
  font-weight: 700; font-size: 17px; color: var(--accent);
}
.lookup-meta .term {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--accent); font-weight: 600;
}
.lookup-cta { margin-top: 8px; }

/* ---------- explainer blocks (homepage) ----------------------------- */
.explainer-block { padding: 28px 0 8px; }
.explainer-block h2 {
  color: var(--accent); margin: 0 0 12px; font-size: 22px;
}
.explainer-block .two-col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 22px;
}
.explainer-block .two-col > div {
  background: var(--card); border: 1px solid var(--hairline);
  border-radius: 6px; padding: 20px 22px;
}
.explainer-block h3 { margin: 0 0 10px; color: var(--accent); font-size: 17px; }
.explainer-block p { margin: 0 0 10px; color: var(--ink); font-size: 14.5px; }
.explainer-block .prose-narrow {
  max-width: 760px; color: var(--ink); font-size: 14.5px;
  background: var(--card); border: 1px solid var(--hairline);
  border-radius: 6px; padding: 20px 22px;
}
@media (max-width: 700px) { .explainer-block .two-col { grid-template-columns: 1fr; } }

/* ---------- alphabetical category list (overflow on home) ---------- */
.cat-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 4px 16px; margin-top: 8px;
}
.cat-list-item {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 6px 8px; border-bottom: 1px dotted var(--hairline);
  text-decoration: none; font-size: 14px;
}
.cat-list-item:hover { background: var(--bg); text-decoration: none; }
.cat-list-item .cat-count { color: var(--muted); font-size: 12px; }

/* ---------- related categories strip --------------------------------- */
.related-strip {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin: 18px 0 14px;
  padding: 12px 14px;
  background: #f0f4fb; border: 1px solid #d2dcec; border-radius: 6px;
}
.related-strip .strip-label {
  font-size: 13px; color: var(--accent); font-weight: 600; margin-right: 4px;
}
.related-pill {
  background: #fff; border: 1px solid #c8d4e6;
  padding: 3px 10px; border-radius: 999px; font-size: 13px;
  text-decoration: none;
}
.related-pill:hover { border-color: var(--accent); text-decoration: none; }
.related-pill span { color: var(--muted); }

/* ---------- filter form (multi-select checkboxes) ------------------ */
.filter-form {
  background: var(--card); border: 1px solid var(--hairline);
  border-radius: 6px; padding: 16px 18px; margin: 18px 0;
}
.filter-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 12px; flex-wrap: wrap;
}
.filter-head strong { color: var(--accent); font-size: 15px; }
.filter-meta { color: var(--muted); font-size: 13px; }
.filter-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px 12px; margin-bottom: 12px;
}
.filter-grid-cats { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.filter-check {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; cursor: pointer;
  padding: 4px 6px; border-radius: 3px;
}
.filter-check:hover { background: var(--bg); }
.filter-check input { margin: 0; cursor: pointer; }
.filter-check span:first-of-type { flex: 1; }
.filter-count { color: var(--muted); font-size: 12px; }
.filter-actions { display: flex; gap: 8px; }
.filter-actions .btn { padding: 7px 14px; font-size: 13px; }

/* ---------- numbers tables ------------------------------------------- */
.numbers-table {
  width: 100%; border-collapse: collapse;
  background: var(--card); border: 1px solid var(--hairline); border-radius: 6px;
  overflow: hidden; margin: 14px 0;
}
.numbers-table th, .numbers-table td {
  padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--hairline);
  font-size: 14px;
}
.numbers-table.tight th, .numbers-table.tight td { padding: 7px 12px; font-size: 13px; }
.numbers-table th {
  background: var(--bg); font-weight: 600; color: var(--accent);
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.3px;
}
.numbers-table tr:last-child td { border-bottom: 0; }
.numbers-table .num { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 600; }
.numbers-table .term { font-family: ui-monospace, "SF Mono", Menlo, monospace; color: var(--accent); }

.status {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px;
}
.status-working { background: var(--good-bg); color: #1f6e30; }
.status-feature { background: #eef2ff; color: #2540a0; }
.status-request { background: var(--warn-bg); color: #8a5a13; }
.status-reserve { background: #f0f2f5; color: #5b6573; }
.status-transit { background: #fff1ee; color: #8a1f15; }

.vendors-table {
  width: 100%; border-collapse: collapse;
  background: var(--card); border: 1px solid var(--hairline); border-radius: 6px;
  margin: 18px 0;
}
.vendors-table th, .vendors-table td {
  padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--hairline);
}
.vendors-table th { background: var(--bg); font-size: 13px; color: var(--accent); }
.vendors-table tr:last-child td { border-bottom: 0; }

/* ---------- vendor category sections --------------------------------- */
.vendor-cat-section { margin: 26px 0; }
.vendor-cat-section .section-head { margin-bottom: 8px; }
.more-link { margin: 8px 0 0; font-size: 14px; }
.muted { color: var(--muted); font-size: 14px; }

.vendor-footer-cta {
  margin: 36px 0 0; padding: 20px;
  background: var(--card); border: 1px solid var(--hairline); border-radius: 6px;
  text-align: center;
}
.vendor-footer-cta p { margin: 0 0 12px; color: var(--muted); }

/* ---------- pager ---------------------------------------------------- */
.pager {
  display: flex; gap: 14px; align-items: center; justify-content: center;
  margin: 18px 0; font-size: 14px;
}
.pager span { color: var(--muted); }

/* ---------- CTA block (BUYER pages only) ----------------------------- */
.cta-block {
  margin: 36px 0 8px; padding: 18px 20px;
  background: var(--cta-bg); border: 1px solid #f5b8ae; border-radius: 6px;
}
.cta-block strong { color: var(--cta-hover); }
.cta-block .cta-link {
  display: inline-block; margin-top: 10px;
  color: var(--cta-hover); font-weight: 600;
}

/* ---------- prose --------------------------------------------------- */
.prose { max-width: 760px; margin: 18px 0; }
.prose h2 { color: var(--accent); margin: 24px 0 8px; font-size: 19px; }
.prose p { color: var(--ink); }

/* ---------- empty cats footer --------------------------------------- */
.empty-cats { margin: 28px 0 0; color: var(--muted); }
.empty-cats summary { cursor: pointer; font-size: 14px; }
.empty-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.empty-pill {
  background: var(--card); border: 1px solid var(--hairline);
  padding: 3px 10px; border-radius: 999px; font-size: 12px; color: var(--muted);
}

/* ---------- footer --------------------------------------------------- */
.site-footer {
  margin-top: 50px;
  border-top: 1px solid var(--hairline);
  background: #fff;
  padding: 24px 0;
  font-size: 13px;
  color: var(--muted);
}
.footer-tagline { font-weight: 600; color: var(--accent); margin-bottom: 4px; }
.footer-meta, .footer-nav { margin-top: 4px; }
.footer-nav a { color: var(--link); }
