.discovery-shell {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(27, 42, 74, 0.08);
  border-radius: 28px;
  padding: 20px;
  box-shadow: 0 20px 46px rgba(13, 27, 42, 0.12);
  backdrop-filter: blur(18px);
}

.discovery-shell--hero {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 28px 64px rgba(13, 27, 42, 0.2);
}

.discovery-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.discovery-search {
  position: relative;
  flex: 1 1 320px;
  min-width: min(100%, 280px);
}

.discovery-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--text-muted, #5a7394);
  pointer-events: none;
}

.discovery-control {
  flex: 0 1 180px;
  min-width: 150px;
}

.discovery-input,
.discovery-select {
  width: 100%;
  min-height: 56px;
  border-radius: 18px;
  border: 1px solid rgba(27, 42, 74, 0.12);
  background: rgba(244, 248, 252, 0.92);
  color: var(--text, #152238);
  padding: 0.95rem 1rem;
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.discovery-search-input {
  padding-left: 48px;
}

.discovery-input::placeholder {
  color: var(--text-muted, #5a7394);
  opacity: 0.75;
}

.discovery-input:focus,
.discovery-select:focus {
  outline: none;
  border-color: rgba(61, 90, 128, 0.5);
  box-shadow: 0 0 0 4px rgba(61, 90, 128, 0.12);
  background: rgba(255, 255, 255, 0.98);
}

.discovery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-left: auto;
}

.discovery-button {
  min-height: 56px;
  padding: 0.95rem 1.2rem;
  border-radius: 18px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.discovery-button:hover {
  transform: translateY(-1px);
}

.discovery-button-primary {
  background: #1b2a4a;
  color: #ffffff;
  box-shadow: 0 16px 30px rgba(27, 42, 74, 0.2);
}

.discovery-button-primary:hover {
  background: #152238;
}

.discovery-button-secondary {
  background: rgba(27, 42, 74, 0.06);
  color: var(--text, #152238);
  border-color: rgba(27, 42, 74, 0.08);
}

.discovery-button-secondary:hover {
  background: rgba(27, 42, 74, 0.1);
}

.discovery-filters-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.discovery-field {
  display: grid;
  gap: 8px;
}

.discovery-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted, #5a7394);
}

.discovery-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.discovery-pill {
  border: 1px solid rgba(27, 42, 74, 0.1);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text-muted, #5a7394);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.discovery-pill:hover {
  transform: translateY(-1px);
  background: rgba(240, 244, 248, 0.96);
  border-color: rgba(61, 90, 128, 0.28);
  color: var(--text, #152238);
}

.discovery-pill.is-active {
  background: #1b2a4a;
  color: #ffffff;
  border-color: #1b2a4a;
  box-shadow: 0 14px 24px rgba(27, 42, 74, 0.18);
}

html.dark .discovery-shell {
  background: rgba(26, 39, 68, 0.92);
  border-color: rgba(141, 171, 196, 0.14);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

html.dark .discovery-shell--hero {
  background: rgba(26, 39, 68, 0.96);
}

html.dark .discovery-input,
html.dark .discovery-select {
  background: rgba(15, 23, 36, 0.84);
  border-color: rgba(141, 171, 196, 0.16);
  color: #e0e6ed;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

html.dark .discovery-input::placeholder {
  color: #8dabc4;
  opacity: 0.8;
}

html.dark .discovery-input:focus,
html.dark .discovery-select:focus {
  border-color: rgba(176, 199, 218, 0.38);
  box-shadow: 0 0 0 4px rgba(141, 171, 196, 0.14);
  background: rgba(15, 23, 36, 0.95);
}

html.dark .discovery-search-icon,
html.dark .discovery-label {
  color: #8dabc4;
}

html.dark .discovery-button-secondary {
  background: rgba(141, 171, 196, 0.12);
  border-color: rgba(141, 171, 196, 0.14);
  color: #e0e6ed;
}

html.dark .discovery-button-secondary:hover {
  background: rgba(141, 171, 196, 0.18);
}

html.dark .discovery-pill {
  background: rgba(15, 23, 36, 0.86);
  border-color: rgba(141, 171, 196, 0.15);
  color: #8dabc4;
}

html.dark .discovery-pill:hover {
  background: rgba(141, 171, 196, 0.14);
  border-color: rgba(141, 171, 196, 0.28);
  color: #e0e6ed;
}

html.dark .discovery-pill.is-active {
  background: #8dabc4;
  border-color: #8dabc4;
  color: #0f1724;
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.24);
}

@media (max-width: 1040px) {
  .discovery-filters-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .discovery-shell {
    border-radius: 24px;
    padding: 16px;
  }

  .discovery-toolbar {
    align-items: stretch;
  }

  .discovery-control,
  .discovery-search,
  .discovery-actions {
    flex: 1 1 100%;
    min-width: 100%;
    margin-left: 0;
  }

  .discovery-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .discovery-filters-grid {
    grid-template-columns: 1fr;
  }
}
