:root {
  color-scheme: light;
  --ink: #132033;
  --muted: #536174;
  --soft: #f5f7f8;
  --paper: #ffffff;
  --line: #d7dee7;
  --line-strong: #aeb9c8;
  --red: #9b1d2a;
  --teal: #127d73;
  --blue: #285d8f;
  --shadow: 0 12px 32px rgba(19, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

a {
  color: var(--blue);
  text-underline-offset: 3px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 22px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 210px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-weight: 800;
  font-size: 1.2rem;
}

.brand strong {
  display: block;
  font-size: 1.18rem;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  background: #eef3f5;
}

.search-workspace {
  padding: 10px 0 36px;
}

.section-inner {
  width: calc(100% - 20px);
  margin: 0 auto;
}

.section-heading {
  max-width: 820px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 760;
  text-transform: uppercase;
}

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

h2 {
  margin-bottom: 8px;
  font-size: 1.65rem;
  line-height: 1.2;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.18rem;
  line-height: 1.25;
}

.section-heading p:not(.eyebrow),
.view-pane p:not(.view-kicker) {
  color: var(--muted);
}

.search-layout {
  display: grid;
  grid-template-columns: minmax(330px, 28vw) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.filter-panel,
.view-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.filter-panel {
  padding: 14px;
}

.filter-section {
  display: grid;
  gap: 10px;
}

.filter-section-heading {
  margin-top: 2px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 820;
  letter-spacing: 0;
  text-transform: uppercase;
}

.filter-section-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.filter-group {
  display: grid;
  gap: 9px;
  margin: 0 0 16px;
  padding: 0 0 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.source-detail-filter[hidden] {
  display: none;
}

.filter-group label,
.filter-group legend {
  font-weight: 720;
}

.filter-search-block {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.filter-search-block .filter-group {
  margin-bottom: 0;
}

.access-filter {
  padding-bottom: 10px;
}

.filter-group label:has(input[type="checkbox"]),
.derived-options label,
.search-mode-row label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-weight: 560;
}

.filter-disclosure {
  display: grid;
  gap: 10px;
}

.filter-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 560;
  line-height: 1.45;
}

.filter-disclosure summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.filter-disclosure summary::-webkit-details-marker {
  display: none;
}

.filter-disclosure[open] summary {
  border-color: #a9c7c3;
  background: #f5fbfa;
}

.summary-state {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
}

.summary-action {
  flex: 0 0 auto;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 720;
  white-space: nowrap;
}

.facet-panel {
  display: grid;
  gap: 10px;
}

.facet-search {
  display: grid;
  gap: 5px;
}

.facet-search span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 680;
}

.facet-search input {
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.facet-search input:disabled {
  color: var(--muted);
  background: #f7f9fb;
}

.facet-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.derived-options label {
  justify-content: space-between;
}

.derived-options label input,
.derived-options label span:first-of-type {
  min-width: 0;
}

.derived-options label input {
  flex: 0 0 auto;
}

.derived-options label span:first-of-type {
  flex: 1 1 auto;
}

.facet-count {
  margin-left: auto;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.search-term-group input,
.date-card input,
.field-grid select,
.field-grid input {
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.search-term-group {
  display: grid;
  gap: 8px;
}

.search-mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.search-mode-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.date-range-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.date-card {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.date-card span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 680;
}

.date-card input {
  padding-right: 8px;
}

.date-card input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.72;
}

.filter-group input[type="checkbox"],
.derived-options input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.derived-options {
  display: grid;
  gap: 10px;
}

.primary-button {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: var(--teal);
  color: #fff;
  font: inherit;
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: #0f6d65;
}

.view-panel {
  min-height: 630px;
  padding: 24px;
}

.view-pane {
  display: none;
}

.view-pane.is-active {
  display: block;
}

.view-kicker {
  margin-bottom: 8px;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 780;
  text-transform: uppercase;
}

.result-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.result-preview div {
  min-height: 116px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.result-preview strong,
.result-preview span {
  display: block;
}

.result-preview span {
  margin-top: 8px;
  color: var(--muted);
}

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

.field-grid label {
  display: grid;
  gap: 8px;
  font-weight: 720;
}

.site-footer {
  padding: 24px 0;
  background: #f8fafb;
}

.footer-inner {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

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

@media (max-width: 1100px) {
  .search-workspace {
    padding-top: 8px;
  }
}

@media (max-width: 920px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    justify-content: flex-start;
  }

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

@media (max-width: 620px) {
  .site-header {
    padding-inline: 18px;
  }

  .section-inner,
  .footer-inner {
    width: min(100% - 28px, 1180px);
  }

  .search-workspace {
    padding-top: 10px;
  }

  .result-preview,
  .field-grid {
    grid-template-columns: 1fr;
  }
}
