.qlm-search-wrap {
  --qlm-accent: #111827;
  --qlm-accent-soft: rgba(17, 24, 39, 0.08);
  --qlm-text: #111827;
  --qlm-muted: #6b7280;
  --qlm-border: rgba(17, 24, 39, 0.08);
  color: var(--qlm-text);
  margin: 24px 0;
}

.qlm-search-form,
.qlm-results-box {
  background: #fff;
  border: 1px solid var(--qlm-border);
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(17, 24, 39, 0.08);
}

.qlm-search-form {
  padding: 30px;
  position: relative;
  overflow: hidden;
}

.qlm-search-form::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255,255,255,0.8), transparent 35%), linear-gradient(135deg, var(--qlm-accent-soft), rgba(255,255,255,0.9));
  pointer-events: none;
}

.qlm-search-form > * {
  position: relative;
  z-index: 1;
}

.qlm-search-header {
  margin-bottom: 24px;
}

.qlm-search-kicker,
.qlm-results-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--qlm-accent);
  margin-bottom: 12px;
}

.qlm-search-header h3,
.qlm-results-header h3 {
  margin: 0 0 8px;
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1.1;
}

.qlm-search-header p,
.qlm-result-card p,
.qlm-empty-state p {
  margin: 0;
  color: var(--qlm-muted);
}

.qlm-search-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.qlm-search-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.qlm-field label {
  display: block;
  font-weight: 700;
  margin-bottom: 10px;
}

.qlm-field input,
.qlm-field select {
  width: 100%;
  min-height: 56px;
  border-radius: 16px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  padding: 0 16px;
  background: rgba(255,255,255,0.92);
  box-sizing: border-box;
  font-size: 16px;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}


.qlm-field select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--qlm-text) 50%), linear-gradient(135deg, var(--qlm-text) 50%, transparent 50%);
  background-position: calc(100% - 24px) calc(50% - 3px), calc(100% - 18px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 48px;
}

.qlm-field input:focus,
.qlm-field select:focus {
  outline: none;
  border-color: var(--qlm-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--qlm-accent) 14%, white);
  transform: translateY(-1px);
}

.qlm-search-actions {
  display: flex;
  gap: 14px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.qlm-search-button,
.qlm-search-reset,
.qlm-result-link {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font-weight: 700;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
  cursor: pointer;
}

.qlm-search-button {
  background: var(--qlm-accent);
  color: #fff;
  box-shadow: 0 12px 26px color-mix(in srgb, var(--qlm-accent) 28%, white);
}

.qlm-search-reset {
  background: #fff;
  color: var(--qlm-text);
  border: 1px solid rgba(17, 24, 39, 0.12);
}

.qlm-result-link {
  display: inline-flex;
  align-items: center;
  background: color-mix(in srgb, var(--qlm-accent) 8%, white);
  color: var(--qlm-accent);
  padding: 12px 16px;
}

.qlm-search-button:hover,
.qlm-search-reset:hover,
.qlm-result-link:hover {
  transform: translateY(-2px);
}

.qlm-search-results {
  margin-top: 20px;
}

.qlm-results-box {
  padding: 28px;
}

.qlm-results-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.qlm-result-card {
  border: 1px solid rgba(17, 24, 39, 0.08);
  background: linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(249,250,251,1) 100%);
  border-radius: 22px;
  padding: 22px;
}

.qlm-result-card h4 {
  margin: 10px 0 10px;
  font-size: 20px;
  line-height: 1.25;
}

.qlm-result-card h4 a {
  color: var(--qlm-text);
  text-decoration: none;
}

.qlm-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.qlm-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: color-mix(in srgb, var(--qlm-accent) 11%, white);
  color: var(--qlm-accent);
}

.qlm-badge-muted {
  background: #f3f4f6;
  color: #374151;
}

.qlm-empty-state {
  padding: 22px;
  border-radius: 18px;
  background: #f9fafb;
  border: 1px dashed rgba(17, 24, 39, 0.12);
}

.qlm-search-loading {
  opacity: .7;
  pointer-events: none;
}

.qlm-search-loading .qlm-search-button {
  position: relative;
}

.qlm-search-loading .qlm-search-button::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.45);
  border-top-color: #fff;
  margin-left: 10px;
  vertical-align: -2px;
  animation: qlm-spin .7s linear infinite;
}

@keyframes qlm-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 960px) {
  .qlm-results-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .qlm-search-form,
  .qlm-results-box {
    border-radius: 18px;
    padding: 20px;
  }

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

  .qlm-search-actions {
    flex-direction: column;
  }

  .qlm-search-button,
  .qlm-search-reset,
  .qlm-result-link {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}
