:root {
  --bs-primary: #124f78;
  --bs-primary-rgb: 18, 79, 120;
  --bs-secondary: #6f7f8d;
  --bs-secondary-rgb: 111, 127, 141;
  --bs-body-bg: #edf2f6;
  --bs-body-color: #213243;
  --bs-border-color: #d3dee9;
  --bs-link-color: #124f78;
  --bs-link-hover-color: #0b3857;
  --bs-font-sans-serif: "Source Sans 3", "Trebuchet MS", "Lucida Sans Unicode", sans-serif;

  --title-font: "Outfit", "Gill Sans", "Trebuchet MS", sans-serif;
  --app-bg: #edf2f6;
  --panel-bg: #ffffff;
  --panel-border: #d6e1ec;
  --panel-shadow: 0 12px 28px rgba(17, 44, 72, 0.08);
  --accent: var(--bs-primary);
  --highlight: #fda83f;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(1400px 480px at -15% -10%, rgba(18, 79, 120, 0.16) 0%, rgba(18, 79, 120, 0) 68%),
    radial-gradient(920px 320px at 112% 5%, rgba(253, 168, 63, 0.18) 0%, rgba(253, 168, 63, 0) 72%),
    linear-gradient(180deg, #f7fafc 0%, var(--app-bg) 42%, #f1f5f8 100%);
  color: var(--bs-body-color);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1040;
  background: rgba(247, 250, 252, 0.9);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 rgba(17, 45, 78, 0.08);
}

.eyebrow {
  color: #6b7786;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 700;
}

.site-header h1 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  letter-spacing: 0.015em;
  font-family: var(--title-font);
  font-weight: 700;
  color: #153955;
}

.subtitle {
  color: #5d6f84;
  font-size: 0.98rem;
}

.panel-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 1rem;
  box-shadow: var(--panel-shadow);
}

.filters-panel,
.results-panel,
.detail-panel {
  height: 100%;
}

.filters-panel .form-control,
.filters-panel .form-select {
  border-radius: 0.75rem;
  border-color: #cddbea;
}

.filters-panel .form-control:focus,
.filters-panel .form-select:focus {
  border-color: #90b5d4;
  box-shadow: 0 0 0 0.2rem rgba(18, 79, 120, 0.16);
}

.filters-actions .btn-link {
  text-decoration: none;
  justify-self: center;
  font-weight: 600;
}

.filters-help {
  line-height: 1.25;
}

.results-head .badge {
  border-color: #d3e0ed !important;
  background: #f8fbff !important;
  color: #45607a !important;
  font-weight: 600;
}

.results-list {
  display: grid;
  gap: 0.62rem;
}

.result-item {
  border: 1px solid #d7e2ef;
  border-radius: 0.9rem;
  overflow: hidden;
  background: #fff;
  animation: resultRise 260ms ease both;
}

.result-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(var(--bs-primary-rgb), 0.24), 0 8px 20px rgba(18, 79, 120, 0.12);
}

.result-link {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.78rem 0.82rem;
}

.result-link:hover {
  background: #f4f9ff;
}

.result-title {
  display: block;
  font-weight: 700;
  line-height: 1.28;
  margin-bottom: 0.25rem;
}

.result-meta {
  display: block;
  color: #627386;
  font-size: 0.85rem;
}

.detail-content.empty {
  color: #637486;
}

.detail-title {
  margin: 0;
  font-size: 1.2rem;
  font-family: var(--title-font);
}

.detail-meta {
  margin: 0.4rem 0 1rem;
  color: #5f7082;
}

.detail-content p {
  line-height: 1.5;
}

.detail-grid {
  display: grid;
  gap: 0.35rem;
}

.detail-grid dt {
  font-weight: 700;
  margin-top: 0.55rem;
}

.detail-grid dd {
  margin: 0;
  color: #3a4a5b;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  margin: 0.9rem 0 0;
}

.tag {
  border: 1px solid #d6e2ef;
  border-radius: 999px;
  font-size: 0.8rem;
  padding: 0.18rem 0.58rem;
  background: #f7fbff;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.cta {
  display: inline-block;
  text-decoration: none;
  border-radius: 0.62rem;
  padding: 0.54rem 0.84rem;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  font-weight: 600;
}

.cta:hover {
  background: #0b3e68;
  border-color: #0b3e68;
}

.cta.secondary {
  background: #fff;
  color: var(--accent);
}

.detail-modal-content {
  border: 0;
  border-radius: 1rem;
}

.modal-header {
  border-bottom-color: #e3ebf3;
}

.modal-body {
  background: #f8fbff;
}

.warning {
  color: #b42318;
  margin: 0;
  border: 1px solid #f5c7c2;
  background: #fff6f4;
  border-radius: 0.72rem;
  padding: 0.68rem 0.74rem;
}

@keyframes resultRise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 991.98px) {
  .filters-shell {
    width: min(90vw, 380px);
    border-right: 0;
  }

  .filters-shell .offcanvas-body {
    background: #f4f8fc;
  }

  .panel-card {
    border-radius: 0.92rem;
  }

  .results-panel {
    animation: resultRise 320ms ease both;
  }
}

@media (min-width: 992px) {
  .filters-panel {
    position: sticky;
    top: 5.3rem;
    max-height: calc(100vh - 6rem);
    overflow: auto;
  }

  .results-panel,
  .detail-panel {
    max-height: calc(100vh - 6rem);
    overflow: auto;
  }
}

@media (max-width: 575.98px) {
  .site-header {
    padding-top: env(safe-area-inset-top, 0);
  }

  .eyebrow {
    font-size: 0.72rem;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  .result-link {
    padding: 0.7rem;
  }

  .result-title {
    font-size: 0.95rem;
  }

  .result-meta {
    font-size: 0.8rem;
  }

  .cta {
    width: 100%;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .result-item,
  .results-panel {
    animation: none !important;
  }
}
