body {
  font-family: "Work Sans", system-ui, sans-serif;
  margin: 0;
  padding: 1rem 1.5rem;
  background: #f7fafc;
  color: #111827;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

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

[x-cloak] {
  display: none !important;
}

h1,
h2,
.page-title,
.sidebar-title,
.filter-heading,
.navbar-brand {
  font-family: "Spectral SC", "Spectral", serif;
  font-weight: 600;
}

.card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  padding: 1.5rem;
}

.button {
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background: #ffffff;
  color: #111827;
  padding: 0.6rem 1rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.button:hover {
  background: #f3f4f6;
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.input {
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 0.6rem 0.8rem;
  width: 100%;
  max-width: 360px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0;
}

th,
td {
  text-align: left;
  padding: 0.75rem 0.8rem;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.95rem;
}

th {
  background: #f9fafb;
  font-weight: 600;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  flex-shrink: 0;
  margin: 0.75rem 0;
}

.status {
  color: #6b7280;
  font-size: 0.95rem;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #002147;
  color: #ffffff;
  padding: 0.8rem 1.5rem;
  border-radius: 0 0 0.75rem 0.75rem;
  margin-bottom: 1rem;
  flex-shrink: 0;
  position: relative;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.navbar-logo-icon {
  width: auto;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.navbar-logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.navbar-brand {
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.navbar-brand--short {
  display: none;
}

.navbar-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 0.28rem;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0;
  padding: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 0.5rem;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.navbar-menu-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

.navbar-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.navbar-links a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.navbar-links a:hover {
  color: #9ac0ff;
}

.footer {
  background: #002147;
  color: #ffffff;
  padding: 1rem 1.5rem;
  margin-top: 1rem;
  border-radius: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  flex-shrink: 0;
}

.footer a {
  color: #9ac0ff;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.footer-logo {
  height: 36px;
  display: block;
}

.layout {
  display: flex;
  gap: 1rem;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  min-height: 0;
  display: flex;
}

.filters-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 1rem;
}

.filters-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-height: 0;
  overflow-y: auto;
  flex: 1;
}

.filters-volumes {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-title {
  margin: 0;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.filters-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  flex-shrink: 0;
}

.filters-chevron {
  width: 0.65rem;
  height: 0.65rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.filters-toggle[aria-expanded="true"] .filters-chevron {
  transform: rotate(-135deg);
}

.stack-sm {
  margin-top: 0.5rem;
}

.stack-md {
  margin-top: 0.6rem;
}

.stack-lg {
  margin-top: 0.75rem;
}

.field-label {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.2rem 0;
}

.scroll-list {
  max-height: 12rem;
  overflow: auto;
  margin-top: 0.5rem;
  min-height: 0;
  flex: 1;
}

.range-values {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
}

.birth-track {
  position: relative;
  width: 100%;
  height: 2.5rem;
  margin-top: 0.75rem;
}

.birth-track-rail {
  position: absolute;
  left: 0;
  right: 0;
  top: 0.9rem;
  height: 0.4rem;
  background: #e2e8f0;
  border-radius: 999px;
}

.birth-track-range {
  position: absolute;
  top: 0.9rem;
  height: 0.4rem;
  background: #2563eb;
  border-radius: 999px;
}

.birth-thumb {
  position: absolute;
  top: 0.2rem;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  cursor: pointer;
  touch-action: none;
}

.birth-thumb--from {
  background: #1d4ed8;
}

.birth-thumb--to {
  background: #93c5fd;
}

.message {
  margin-top: 1rem;
  flex-shrink: 0;
}

.message--error {
  color: #b91c1c;
}

.message--muted {
  color: #374151;
}

.results-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
}

.table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f9fafb;
  box-shadow: inset 0 -1px 0 #e5e7eb;
}

@media (max-width: 768px) {
  body {
    height: auto;
    min-height: 100dvh;
    overflow-y: auto;
    padding: 0.75rem 1rem 1rem;
  }

  .navbar {
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }

  .navbar-brand--full {
    display: none;
  }

  .navbar-brand--short {
    display: inline;
  }

  .navbar-brand {
    font-size: 1.05rem;
  }

  .navbar-logo-icon {
    height: 40px;
  }

  .navbar-menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .navbar-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    order: 3;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 0.5rem;
  }

  .navbar-links.is-open {
    display: flex;
  }

  .navbar-links a {
    padding: 0.65rem 0.25rem;
  }

  .layout {
    flex-direction: column;
    overflow: visible;
    flex: none;
    gap: 0.75rem;
  }

  .sidebar {
    width: 100%;
    flex-shrink: 0;
  }

  .filters-card {
    overflow: visible;
  }

  .filters-body {
    display: none;
    flex: none;
    overflow: visible;
    margin-top: 0.75rem;
  }

  .filters-body.is-open {
    display: flex;
  }

  .filters-volumes {
    flex: none;
  }

  .scroll-list {
    flex: none;
    max-height: 10rem;
  }

  .main {
    flex: none;
    min-height: 0;
    overflow: visible;
  }

  .results-panel {
    flex: none;
    overflow: visible;
  }

  .table-wrap {
    flex: none;
    max-height: min(70vh, 36rem);
  }

  .footer {
    margin-top: 0.75rem;
  }

  .field-label {
    flex-wrap: wrap;
  }

  .field-label .input {
    max-width: none;
  }
}

@media (min-width: 769px) {
  .filters-toggle {
    pointer-events: none;
  }

  .filters-chevron {
    display: none;
  }

  .filters-body {
    display: flex;
  }
}
