:root {
  color-scheme: light;
  --page: min(1120px, calc(100% - 40px));
  --radius: 8px;
  --bg: #f4f7f5;
  --ink: #17211f;
  --muted: #64716d;
  --surface: #ffffff;
  --surface-2: #eef3f1;
  --line: #d7dfdc;
  --teal: #087e8b;
  --green: #20775d;
  --coral: #d65f42;
  --gold: #b98f20;
  --blue: #3e6f98;
  --shadow: 0 18px 48px rgba(26, 43, 39, 0.1);
}

[data-theme="night"] {
  color-scheme: dark;
  --bg: #121716;
  --ink: #eef5f1;
  --muted: #a5b5af;
  --surface: #1d2422;
  --surface-2: #25302d;
  --line: #35413d;
  --teal: #35bdc7;
  --green: #80d6a8;
  --coral: #f28a6a;
  --gold: #e4bc55;
  --blue: #8fbde3;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(18px, 4vw, 54px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: 176px;
  height: auto;
}

.nav {
  display: flex;
  gap: clamp(12px, 3vw, 28px);
  color: var(--muted);
  font-size: 0.95rem;
}

.nav a {
  text-decoration: none;
}

.nav a:hover {
  color: var(--ink);
}

.icon-button,
.button,
.quick-needs button,
.chip,
.action-link {
  display: inline-grid;
  min-height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.icon-button:hover,
.button:hover,
.chip:hover,
.action-link:hover {
  transform: translateY(-1px);
  border-color: var(--teal);
}

.icon-button {
  width: 42px;
  padding: 0;
  font-weight: 850;
}

.button {
  min-width: 92px;
  padding: 0 16px;
  font-weight: 800;
}

.primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #ffffff;
}

main {
  overflow: hidden;
}

.directory-hero,
.popular-section,
.directory-layout,
.source-note,
.footer {
  width: var(--page);
  margin-inline: auto;
}

.directory-hero {
  padding: clamp(18px, 3.4vw, 30px) 0 12px;
}

.compact-search-shell {
  position: sticky;
  top: 69px;
  z-index: 8;
  padding-top: 12px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 18px;
  font-size: clamp(1.72rem, 3.2vw, 3rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(1.65rem, 3vw, 2.7rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.08rem;
}

.search-panel {
  max-width: 920px;
  margin-inline: auto;
  padding: clamp(14px, 2vw, 18px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--teal) 14%, transparent), transparent 38%),
    linear-gradient(45deg, color-mix(in srgb, var(--gold) 16%, transparent), transparent 36%),
    var(--surface);
  box-shadow: var(--shadow);
}

.compact-search-shell .search-panel {
  max-width: none;
}

.search-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(160px, 0.62fr) auto;
  gap: 10px;
  align-items: end;
}

.search-panel label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

input[type="search"] {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 82%, var(--bg));
  color: var(--ink);
  padding: 0 14px;
}

input[type="text"],
input[type="url"],
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 82%, var(--bg));
  color: var(--ink);
  padding: 9px 12px;
}

textarea {
  resize: vertical;
}

.popular-section {
  padding: 16px 0 34px;
}

.ad-shell {
  width: var(--page);
  margin-inline: auto;
}

.ad-banner-shell {
  padding: 0 0 18px;
}

.ad-slot {
  min-height: 96px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 70%, var(--bg));
}

.in-feed-ad {
  min-height: 120px;
}

.guide-ad-shell {
  padding-top: 28px;
}

.popular-section .section-title {
  margin-bottom: 10px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 14px;
}

.section-title p:last-child {
  max-width: 420px;
  color: var(--muted);
  text-align: right;
}

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

.category-tile {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 76px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent, var(--teal)) 12%, transparent), transparent 56%),
    var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow);
}

.category-tile:hover {
  border-color: var(--teal);
  transform: translateY(-1px);
}

.tile-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent, var(--teal)) 14%, transparent);
  color: var(--accent, var(--teal));
  font-size: 0.72rem;
  font-weight: 900;
}

.tile-icon svg,
.category-pill svg {
  width: 20px;
  height: 20px;
}

.tile-icon span,
.category-pill span {
  display: none;
}

.tile-icon:not(:has(svg)) span,
.category-pill:not(:has(svg)) span {
  display: inline;
}

.category-tile strong,
.category-tile small {
  display: block;
}

.category-tile strong {
  font-size: 0.9rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.category-tile small {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.25;
}

.directory-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding: 34px 0 72px;
  border-top: 1px solid var(--line);
}

.filters {
  position: sticky;
  top: 88px;
}

.category-search {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.category-search input {
  min-height: 42px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.chip-list {
  display: grid;
  gap: 8px;
}

.chip {
  justify-content: space-between;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  text-align: left;
}

.chip.active {
  border-color: var(--teal);
  background: color-mix(in srgb, var(--teal) 13%, var(--surface));
  font-weight: 850;
}

.chip span:last-child {
  color: var(--muted);
  font-size: 0.86rem;
}

.results-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
}

.results-tools {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.results-tools label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.results-tools select {
  min-width: 170px;
}

.subcategory-row,
.related-needs div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.subcategory-row {
  margin-bottom: 14px;
}

.subcategory-chip,
.related-need {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 750;
}

.subcategory-chip.active {
  border-color: var(--teal);
  background: color-mix(in srgb, var(--teal) 13%, var(--surface));
}

.related-needs {
  margin-top: 18px;
}

.results-title {
  font-size: clamp(1.35rem, 2.2vw, 2.1rem);
}

.results-header p:last-child {
  color: var(--muted);
  text-align: right;
}

.results-search {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.results-search input {
  min-height: 42px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}

.listing-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent, var(--teal)) 9%, transparent), transparent 92px),
    var(--surface);
  box-shadow: var(--shadow);
}

.sponsored-card {
  border-color: color-mix(in srgb, var(--gold) 58%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--gold) 16%, transparent), transparent 48%),
    var(--surface);
}

.sponsored-card .listing-category,
.sponsored-card .category-pill {
  color: #8a5a00;
}

.sponsored-card .category-pill {
  background: color-mix(in srgb, var(--gold) 22%, transparent);
}

.sponsored-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.listing-card h3 {
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.listing-category {
  margin-bottom: 7px;
  color: var(--accent, var(--teal));
  font-size: 0.78rem;
  font-weight: 850;
}

.category-pill {
  flex: none;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent, var(--teal)) 14%, transparent);
  color: var(--accent, var(--teal));
  font-size: 0.75rem;
  font-weight: 850;
  white-space: nowrap;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
}

.meta span {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.78rem;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.trust-row span {
  padding: 4px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--green) 12%, transparent);
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 800;
}

.detail-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.detail-list div {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.detail-list dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.detail-list dd {
  margin: 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.weather-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.weather-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.weather-table th,
.weather-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.weather-table thead th {
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 850;
}

.weather-table tbody th {
  width: 180px;
  color: var(--ink);
  font-weight: 850;
}

.weather-table tr:last-child th,
.weather-table tr:last-child td {
  border-bottom: 0;
}

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

.action-link {
  min-height: 34px;
  padding: 0 11px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
}

.primary-action {
  border-color: var(--teal);
  background: var(--teal);
  color: #ffffff;
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.inline-category {
  border: 0;
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  font: inherit;
  font-weight: 850;
  padding: 0;
}

.inline-category:hover {
  text-decoration: underline;
}

.source-note {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1fr);
  gap: clamp(24px, 6vw, 78px);
  padding: 64px 0;
  border-top: 1px solid var(--line);
}

.contribute-section {
  width: var(--page);
  margin-inline: auto;
  padding: 64px 0;
  border-top: 1px solid var(--line);
}

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

.submission-form {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.submission-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.admin-page {
  width: var(--page);
  min-height: 100svh;
  display: grid;
  align-items: center;
  margin-inline: auto;
  padding: 36px 0;
}

.admin-panel {
  max-width: 760px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-steps {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.admin-steps article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 72%, var(--bg));
}

.content-page {
  width: var(--page);
  margin-inline: auto;
  padding: clamp(32px, 6vw, 72px) 0;
}

.content-hero {
  max-width: 760px;
  margin-bottom: 28px;
}

.guide-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: 22px;
  align-items: stretch;
  max-width: none;
}

.guide-hero-copy {
  align-self: center;
}

.guide-banner {
  min-height: 260px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.featured-guides {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(220px, 0.85fr));
  gap: 14px;
  margin-bottom: 28px;
}

.featured-guide {
  display: grid;
  min-height: 240px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.featured-guide.primary-feature {
  grid-template-rows: minmax(220px, 1fr) auto;
}

.featured-guide:not(.primary-feature) {
  grid-template-rows: 150px auto;
}

.featured-guide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-guide-copy {
  padding: 16px;
}

.featured-guide-copy p {
  margin-bottom: 0;
  color: var(--muted);
}

.content-hero p:last-child {
  color: var(--muted);
  font-size: 1.05rem;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.content-grid article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.content-grid p {
  margin-bottom: 0;
  color: var(--muted);
}

.content-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.guide-list {
  display: grid;
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.guide-list li {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.guide-list a {
  color: var(--teal);
  font-weight: 800;
  text-decoration: none;
}

.guide-list a:hover {
  text-decoration: underline;
}

.guide-overview {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.guide-overview article {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.faq-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.faq-list details {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.faq-list summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 850;
}

.faq-list p {
  margin: 10px 0 0;
  color: var(--muted);
}

.featured-path-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.guide-overview h2 {
  margin-bottom: 0;
}

.guide-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(260px, 0.95fr);
  gap: 18px;
}

.guide-overview p,
.guide-overview li {
  color: var(--muted);
}

.guide-checks {
  margin: 0;
  padding-left: 18px;
}

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

.official-links a {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.official-links a:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.source-note p:last-child {
  color: var(--muted);
  font-size: 1.03rem;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-links a {
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--ink);
}

@media (max-width: 920px) {
  .nav {
    display: none;
  }

  .directory-hero,
  .popular-section,
  .directory-layout,
  .contribute-section,
  .source-note,
  .content-grid,
  .guide-overview-grid,
  .guide-hero,
  .featured-guides {
    grid-template-columns: 1fr;
  }

  .directory-hero {
    min-height: auto;
  }

  .filters {
    position: static;
  }

  .chip-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-fields {
    grid-template-columns: 1fr 1fr;
  }

  .category-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .card-grid,
  .contribute-grid,
  .chip-list,
  .search-fields {
    grid-template-columns: 1fr;
  }

  .category-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compact-search-shell {
    position: static;
  }

  .section-title,
  .results-header,
  .footer {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .section-title p:last-child,
  .results-header p:last-child {
    text-align: left;
  }

  .results-tools {
    justify-items: stretch;
  }
}

@media (max-width: 520px) {
  :root {
    --page: min(100% - 28px, 1180px);
  }

  .directory-hero,
  .popular-section,
  .directory-layout,
  .contribute-section,
  .source-note,
  .footer,
  .content-page {
    width: var(--page);
  }

  .topbar {
    padding-inline: 14px;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.58rem;
  }

  .directory-hero {
    padding-top: 22px;
  }

  .category-tile {
    grid-template-columns: 1fr;
    gap: 6px;
    min-height: 100px;
    align-content: start;
  }

  .tile-icon {
    width: 38px;
    height: 38px;
  }

  .detail-list div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
