.search-app {
  margin: 1.5rem 0 2rem;
}

.search-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: end;
  background: linear-gradient(180deg, #17212b, #111820);
  border: 1px solid #2b3743;
  border-radius: 14px;
  padding: 1.15rem;
}

.search-field {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.search-field-wide {
  grid-column: 1 / -1;
}

.search-field label {
  color: #f8fafc;
  font-size: .88rem;
  font-weight: 700;
}

.search-field input,
.search-field select,
.search-reset {
  background: #0b1117;
  border: 1px solid #3a4754;
  border-radius: 8px;
  color: #e6edf3;
  font: inherit;
  min-height: 44px;
  padding: .65rem .75rem;
}

.search-field input::placeholder {
  color: #8b98a6;
}

.search-reset {
  cursor: pointer;
  font-weight: 700;
}

.search-reset:hover {
  background: #17212b;
  border-color: #58a6ff;
}

.search-count {
  color: #cbd5e1;
  font-weight: 700;
  margin: 1.25rem 0 .8rem;
}

.search-error {
  background: rgba(248, 81, 73, .12);
  border: 1px solid rgba(248, 81, 73, .55);
  border-radius: 10px;
  color: #ffb4ae;
  padding: .85rem 1rem;
}

.search-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1rem;
}

.search-result-card {
  background: linear-gradient(180deg, #17212b, #111820);
  border: 1px solid #2b3743;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .2);
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1.1rem;
}

.search-result-card h3 {
  margin: 0 0 .65rem;
}

.search-result-card p {
  color: #b7c1cc;
}

.search-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .3rem;
}

.search-pill {
  border: 1px solid #3a4754;
  border-radius: 999px;
  color: #cbd5e1;
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  padding: .18rem .5rem;
  text-transform: capitalize;
}

.pill-active,
.pill-fresh {
  border-color: rgba(63, 185, 80, .6);
  color: #7ee787;
}

.pill-retired,
.pill-reference {
  border-color: rgba(139, 92, 246, .65);
  color: #d2a8ff;
}

.pill-due-soon {
  border-color: rgba(210, 153, 34, .7);
  color: #f2cc60;
}

.pill-overdue,
.pill-invalid {
  border-color: rgba(248, 81, 73, .6);
  color: #ffb4ae;
}

.search-result-details {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: .35rem .65rem;
  margin: auto 0 0;
  padding-top: .65rem;
}

.search-result-details dt {
  color: #f8fafc;
  font-size: .8rem;
  font-weight: 700;
}

.search-result-details dd {
  color: #9da7b3;
  font-size: .8rem;
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

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

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

  .search-field-wide {
    grid-column: auto;
  }

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

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