body {
  font-family: Arial, Helvetica, sans-serif;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.3;
}

/* Page shell: full width minus a small inset from the viewport (Bootstrap .container gutters overridden). */
.layout-shell,
body > div.container.py-3 {
  --bs-gutter-x: 0;
  box-sizing: border-box;
  max-width: calc(100% - 10px) !important;
  width: calc(100% - 10px) !important;
  margin: 5px !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.search-panel,
.results-panel {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: solid 1px #000;
  padding: 8px 12px;
}

.search-heading {
  display: block;
  font-size: 0.95rem;
  line-height: 1.25;
}

.search-form {
  margin-top: 0.4rem;
}

.search-field {
  margin-bottom: 0.4rem;
}

.search-field .form-label {
  margin-bottom: 0.15rem;
  font-size: 0.85rem;
}

.search-error {
  margin-top: 0.4rem;
  margin-bottom: 0;
}

.search-input {
  max-width: 320px;
}

.year-input {
  max-width: 120px;
}

.field-validation-error {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  display: block;
  line-height: 1.2;
}

.results-table {
  width: 100%;
  margin-bottom: 12px;
  font-size: 0.875rem;
}

.results-table thead th,
.results-table tbody td {
  padding: 0.3rem 0.45rem;
  line-height: 1.25;
  vertical-align: middle;
}

.results-table thead th {
  background-color: #4a3c8c;
  color: #f7f7f7;
}

.results-pagination .page-link {
  padding: 0.25rem 0.5rem;
}

.instructions {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 0.5rem;
  padding-left: 12px;
  padding-right: 12px;
  font-size: 0.85rem;
  line-height: 1.3;
}

.instructions p {
  margin-top: 0;
  margin-bottom: 0.35rem;
}

.instructions p:last-child {
  margin-bottom: 0;
}

#search-results-root {
  width: 100%;
  max-width: 100%;
}

#search-results-root.htmx-request {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.search-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.72);
}

.search-loading-overlay[hidden] {
  display: none !important;
}

.search-loading-dialog {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  text-align: center;
}

.search-loading-spinner {
  width: 1.75rem;
  height: 1.75rem;
  border: 3px solid #cfcfcf;
  border-top-color: #4a3c8c;
  border-radius: 50%;
  animation: search-loading-spin 0.75s linear infinite;
}

.search-loading-text {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #222;
}

@keyframes search-loading-spin {
  to {
    transform: rotate(360deg);
  }
}
