:root {
  --ink: #16324a;
  --ink-soft: rgba(22, 50, 74, 0.72);
  --teal: #0d7f86;
  --teal-deep: #0a5a60;
  --sand: #f1d5a5;
  --mist: #edf4f3;
  --paper: #ffffff;
  --line: rgba(22, 50, 74, 0.12);
  --shadow: 0 28px 70px rgba(22, 50, 74, 0.1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(13, 127, 134, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(241, 213, 165, 0.24), transparent 26%),
    linear-gradient(180deg, #fcfdfd 0%, #f4f7f6 100%);
}

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

.shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  background: rgba(252, 253, 253, 0.84);
  border-bottom: 1px solid var(--line);
}

.header-row,
.footer-grid,
.hero-grid,
.section-heading,
.result-topline,
.result-actions,
.search-primary,
.hero-stats,
.business-layout,
.search-layout {
  display: flex;
}

.header-row {
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
}

.brand-mark {
  display: grid;
  gap: 0.18rem;
}

.brand-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-subtitle,
.eyebrow {
  color: var(--teal);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  gap: 1.1rem;
  font-size: 0.95rem;
}

.main-nav a,
.text-link,
.result-actions a {
  color: var(--teal-deep);
}

.hero,
.section-block,
.page-head {
  padding: 3.2rem 0;
}

.hero-grid {
  gap: 1.4rem;
  align-items: start;
}

.hero-grid > * {
  flex: 1;
}

.hero-search-block {
  width: 100%;
  margin-top: 1.5rem;
}

.hero-search-block .search-panel {
  width: 100%;
}

.search-page-layout,
.search-sidebar-stack {
  display: flex;
}

.public-site-layout {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 2.25rem 0 3rem;
}

.public-site-sidebar {
  width: min(23rem, 100%);
  flex: 0 0 23rem;
}

.public-site-sidebar-stack {
  position: sticky;
  top: 6.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.public-sidebar-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 1.4rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.public-site-main {
  min-width: 0;
  flex: 1;
}

.public-site-main > .shell {
  width: 100%;
}

.public-sidebar-intro {
  padding: 1.25rem 1.35rem;
  background: linear-gradient(180deg, rgba(13, 127, 134, 0.08), rgba(255, 255, 255, 0.96));
  border-bottom: 1px solid var(--line);
}

.public-sidebar-intro h2 {
  margin-bottom: 0.6rem;
}

.public-sidebar-intro p:last-child {
  margin-bottom: 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

.search-page-layout {
  gap: 1.5rem;
  align-items: flex-start;
  padding: 3.2rem 0;
}

.search-sidebar-column {
  width: min(23rem, 100%);
  flex: 0 0 23rem;
}

.search-sidebar-stack {
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 6.2rem;
}

.search-content-column {
  min-width: 0;
  flex: 1;
}

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

h1 {
  font-size: clamp(2.7rem, 5vw, 4.7rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
}

.hero-copy,
.page-head p,
.result-summary,
.site-footer p {
  color: var(--ink-soft);
  line-height: 1.7;
}

.hero-panel,
.search-panel,
.card-block,
.result-card,
.facet-panel,
.browse-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 1.4rem;
  box-shadow: var(--shadow);
}

.hero-panel,
.card-block,
.facet-panel {
  padding: 1.5rem;
}

.search-panel {
  padding: 1.4rem 1.5rem 1.5rem;
  margin-top: 1.8rem;
}

.search-panel-sidebar {
  margin-top: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.search-panel-sidebar .search-primary {
  flex-direction: column;
}

.search-panel-sidebar .search-field,
.search-panel-sidebar .search-primary button {
  width: 100%;
}

.search-panel-sidebar .filter-grid {
  grid-template-columns: 1fr;
}

.search-panel-sidebar .filter-field {
  gap: 0.45rem;
}

.scope-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.scope-chips {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.scope-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: #e5f3f2;
  color: var(--teal-deep);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.scope-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 0.5rem;
  opacity: 0.6;
}

.scope-chip-muted {
  background: #eef3f3;
  color: var(--ink-soft);
}

.autosubmit-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
}

.autosubmit-toggle input {
  accent-color: var(--teal);
  width: 1rem;
  height: 1rem;
}

.search-primary {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}

.search-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.25rem;
}

.search-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.search-input-wrap .search-icon {
  position: absolute;
  left: 1.1rem;
  color: var(--ink-soft);
  pointer-events: none;
}

.search-primary input,
.filter-grid select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  padding: 0.9rem 1rem;
  background: #fff;
  font-size: 0.95rem;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-primary input {
  padding-left: 2.75rem;
}

.search-primary input:focus,
.filter-grid select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(20, 115, 124, 0.12);
}

.filter-grid select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2350646e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.4rem;
}

.filter-grid select:disabled {
  background-color: #f5f7f7;
  color: rgba(22, 50, 74, 0.55);
  cursor: not-allowed;
}

.search-primary button {
  border: 0;
  border-radius: 0.85rem;
  padding: 0.9rem 1.5rem;
  background: linear-gradient(135deg, var(--teal-deep), var(--teal));
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.search-actions button {
  min-width: 13rem;
}

.search-primary button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(20, 115, 124, 0.25);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.1rem;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.filter-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.filter-help {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.4;
  opacity: 0.85;
}

.hero-stats,
.badge-row,
.pagination-row {
  gap: 0.8rem;
  flex-wrap: wrap;
}

.hero-stats {
  margin-top: 1.2rem;
}

.hero-stats div {
  min-width: 10rem;
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  background: var(--mist);
}

.hero-stats strong {
  display: block;
  font-size: 1.6rem;
}

.browse-grid,
.results-grid {
  display: grid;
  gap: 1rem;
}

.browse-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.browse-card,
.result-card {
  padding: 1.3rem;
}

.browse-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.browse-card:hover {
  transform: translateY(-2px);
  border-color: var(--teal);
  box-shadow: 0 12px 28px rgba(20, 115, 124, 0.12);
}

.browse-card strong {
  font-size: 1.05rem;
  color: var(--ink);
}

.browse-card span,
.result-actions span,
.crumbs,
.facet-group span,
.facet-group a {
  color: var(--ink-soft);
}

.browse-card span {
  font-size: 0.85rem;
  font-weight: 600;
}

.section-lead {
  margin-top: 0.5rem;
  max-width: 42rem;
  color: var(--ink-soft);
  line-height: 1.65;
}

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

.how-step {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.6rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 1.4rem;
  box-shadow: var(--shadow);
}

.how-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--teal-deep), var(--teal));
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}

.how-step strong {
  font-size: 1.05rem;
  color: var(--ink);
}

.how-step span {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.55;
}

.nav-admin {
  opacity: 0.55;
  font-size: 0.88rem;
}

.nav-admin:hover {
  opacity: 1;
}

.grade {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-weight: 700;
  background: #eef3f3;
}

.grade-a { color: #0b6b42; }
.grade-b { color: #9b5e00; }
.grade-c,
.grade-d { color: #8b1d33; }

.tag {
  display: inline-flex;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: #eef7f6;
  color: var(--teal-deep);
  font-size: 0.88rem;
}

.tag.muted {
  background: #f5f4ee;
  color: #725d3f;
}

.search-layout {
  gap: 1.2rem;
  align-items: start;
}

.search-sidebar-panel {
  width: 100%;
}

.page-head-compact,
.section-block-tight {
  padding-top: 0;
}

.facet-panel {
  width: 18rem;
  flex-direction: column;
  display: flex;
  gap: 1rem;
}

.search-results,
.business-main {
  flex: 1;
}

.business-layout {
  gap: 1rem;
  align-items: start;
  padding-bottom: 3rem;
}

.business-sidebar {
  width: 20rem;
}

.pagination-row a {
  min-width: 2.5rem;
  text-align: center;
  padding: 0.6rem 0.75rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
}

.pagination-row a.active {
  background: var(--teal);
  color: #fff;
}

.site-footer {
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--line);
}

.footer-grid {
  gap: 2rem;
}

.footer-grid > * {
  flex: 1;
}

.footer-grid a {
  display: block;
  margin-top: 0.35rem;
  color: var(--ink-soft);
}

.crumbs ol {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.crumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.75rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 1100px) {
  .browse-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .filter-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .public-site-layout,
  .hero-grid,
  .search-page-layout,
  .search-layout,
  .business-layout,
  .header-row,
  .footer-grid {
    flex-direction: column;
  }

  .scope-toolbar,
  .search-primary {
    flex-direction: column;
    align-items: stretch;
  }

  .search-primary button {
    width: 100%;
  }

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

  .browse-grid,
  .results-grid,
  .how-grid {
    grid-template-columns: 1fr;
  }

  .public-site-sidebar,
  .public-site-sidebar-stack,
  .search-sidebar-column,
  .search-sidebar-stack,
  .facet-panel,
  .business-sidebar {
    width: 100%;
  }

  .search-sidebar-stack {
    position: static;
  }

  .public-site-sidebar-stack {
    position: static;
  }
}
