.tm-quick-find {
  position: relative;
}

.tm-quick-find__title {
  margin: 0 0 8px 0;
  color: var(--tm-text);
  font-size: clamp(1.15rem, 3.5vw, 1.45rem);
  line-height: 1.2;
}

.tm-quick-find__copy {
  margin: 0 0 14px 0;
  max-width: 62ch;
}

.tm-quick-find__form {
  margin: 0;
}

.tm-quick-find__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tm-quick-find__controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.quick-find-input-wrap {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  line-height: 0;
}

.quick-find-input-wrap input {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 12px 46px 12px 14px;
  border: 1px solid var(--tm-border);
  border-radius: 14px;
  background: var(--tm-surface);
  box-shadow: var(--tm-shadow-sm);
  color: var(--tm-text);
  font: inherit;
}

.quick-find-input-wrap > input.tm-quick-find__input {
  width: 100%;
  padding-right: 46px !important;
}

.quick-find-input-wrap input::-webkit-search-cancel-button,
.quick-find-input-wrap input::-webkit-search-decoration {
  appearance: none;
  -webkit-appearance: none;
}

.tm-quick-find__input::placeholder {
  color: var(--tm-text-muted);
}

.quick-find-clear {
  position: absolute;
  top: 50%;
  right: 10px;
  z-index: 2;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  margin: 0;
  padding: 0;
  transform: translateY(-50%);
  float: none;
  clear: none;
}

.quick-find-clear:not([hidden]) {
  display: inline-flex;
}

.quick-find-clear[hidden] {
  display: none !important;
}

.quick-find-clear {
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--tm-text-muted);
  font-size: 1.35rem;
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.quick-find-clear:hover,
.quick-find-clear:focus-visible {
  background: rgba(15, 23, 42, .08);
  color: var(--tm-text);
}

.tm-quick-find__button {
  width: 100%;
}

.tm-quick-find__hint,
.tm-quick-find__empty {
  margin: 10px 0 0 0;
  font-size: 0.94rem;
  line-height: 1.5;
}

.tm-quick-find__results {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.tm-quick-find__result {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--tm-border);
  border-radius: 14px;
  background: var(--tm-surface);
  box-shadow: var(--tm-shadow-sm);
  color: inherit;
  text-decoration: none;
}

.tm-quick-find__result-type {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--tm-text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tm-quick-find__result-title {
  margin: 0 0 4px 0;
  color: var(--tm-text);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.3;
}

.tm-quick-find__result-subtitle {
  margin: 0 0 8px 0;
  color: var(--tm-text-muted);
  line-height: 1.45;
}

.tm-quick-find__result-footer {
  color: var(--tm-text);
  font-size: 0.92rem;
  font-weight: 700;
}

@media (min-width: 720px) {
  .tm-quick-find__controls {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .tm-quick-find__button {
    width: auto;
    min-width: 96px;
  }

  .tm-quick-find__results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* =========================================================
   TorqueMech Quick Find — Dark Navy / Orange
   ========================================================= */

.tm-section {
  padding-top: 18px;
  padding-bottom: 18px;
}

.tm-section .tm-quick-find {
  border: 1px solid rgba(96, 165, 250, 0.22);
  border-radius: 16px;
  background:
    radial-gradient(
      circle at top right,
      rgba(249, 115, 22, 0.1),
      transparent 34%
    ),
    linear-gradient(
      145deg,
      #101b2f 0%,
      #0c1728 55%,
      #0a1424 100%
    );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 36px rgba(0, 0, 0, 0.24);
  color: #f8fafc;
  padding: 20px;
}

.tm-quick-find .tm-eyebrow {
  margin-bottom: 10px;
  color: #60a5fa;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tm-quick-find__title {
  margin: 0 0 10px;
  color: #f8fafc;
  font-size: clamp(1.3rem, 5vw, 1.65rem);
  font-weight: 900;
  line-height: 1.12;
}

.tm-quick-find__copy {
  margin: 0 0 18px;
  color: #cbd5e1;
  font-size: 0.96rem;
  line-height: 1.55;
}

.quick-find-input-wrap input {
  min-height: 48px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 12px;
  background: #e9edf3;
  box-shadow:
    inset 0 1px 2px rgba(15, 23, 42, 0.08),
    0 6px 14px rgba(0, 0, 0, 0.14);
  color: #0f172a;
}

.quick-find-input-wrap input:focus {
  border-color: #60a5fa;
  outline: 3px solid rgba(96, 165, 250, 0.18);
}

.tm-quick-find__input::placeholder {
  color: #64748b;
}

.quick-find-clear {
  color: #64748b;
}

.quick-find-clear:hover,
.quick-find-clear:focus-visible {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}

.tm-quick-find__button {
  min-height: 46px;
  border: 1px solid #fb923c;
  border-radius: 12px;
  background: linear-gradient(180deg, #ff7a18 0%, #f97316 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 10px 20px rgba(249, 115, 22, 0.2);
  color: #111827;
  font-weight: 900;
}

.tm-quick-find__button:hover,
.tm-quick-find__button:focus-visible {
  background: linear-gradient(180deg, #ff8a2f 0%, #fb7c1d 100%);
  border-color: #fdba74;
  transform: translateY(-1px);
}

.tm-quick-find__hint,
.tm-quick-find__empty {
  margin-top: 14px;
  color: #aebdd0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.tm-quick-find__results {
  gap: 12px;
  margin-top: 16px;
}

.tm-quick-find__result {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: rgba(15, 29, 49, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 8px 18px rgba(0, 0, 0, 0.16);
  color: #f8fafc;
}

.tm-quick-find__result:hover,
.tm-quick-find__result:focus-visible {
  border-color: rgba(96, 165, 250, 0.48);
  background: #14243a;
}

.tm-quick-find__result-type {
  color: #60a5fa;
}

.tm-quick-find__result-title,
.tm-quick-find__result-footer {
  color: #f8fafc;
}

.tm-quick-find__result-subtitle {
  color: #b9c6d8;
}

@media (max-width: 719px) {
  .tm-section .tm-quick-find {
    padding: 18px;
  }

  .tm-quick-find__controls {
    gap: 10px;
  }
}

/* =========================================================
   Quick Find final page corrections
   ========================================================= */

/* Force readable text over the dark card */
.tm-quick-find .tm-quick-find__title {
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
  opacity: 1 !important;
}

.tm-quick-find .tm-quick-find__copy {
  color: #cbd5e1 !important;
  -webkit-text-fill-color: #cbd5e1 !important;
  opacity: 1 !important;
}

.tm-quick-find .tm-quick-find__hint,
.tm-quick-find .tm-quick-find__empty {
  color: #aebdd0 !important;
  -webkit-text-fill-color: #aebdd0 !important;
  opacity: 1 !important;
}

/* Keep the Quick Find content compact */
.tm-quick-find-page,
.tm-quick-find-page .tm-section {
  min-height: 0 !important;
}

.tm-quick-find-page .tm-section {
  padding-top: 18px;
  padding-bottom: 18px;
}

/* Keep the footer at the bottom of the visible page */
body:has(.tm-quick-find-page) {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body:has(.tm-quick-find-page) > main.tm-container {
  flex: 0 0 auto;
}

body:has(.tm-quick-find-page) > .tm-footer {
  margin-top: auto !important;
}

/* Remove excessive footer depth */
body:has(.tm-quick-find-page) .tm-footer {
  padding-top: 20px;
  padding-bottom: 22px;
}

body:has(.tm-quick-find-page) .tm-footer-inner {
  min-height: 0;
}

/* Popular OBD codes */
.tm-quick-find__popular {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.tm-quick-find__popular-label {
  color: #cbd5e1;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.tm-quick-find__code-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tm-quick-find__code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid rgba(96, 165, 250, 0.34);
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: #bfdbfe;
  padding: 7px 12px;
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    color 0.16s ease;
}

.tm-quick-find__code:hover,
.tm-quick-find__code:focus-visible {
  border-color: rgba(249, 115, 22, 0.6);
  background: rgba(249, 115, 22, 0.14);
  color: #fed7aa;
  transform: translateY(-1px);
}

/* =========================================================
   Diagnostic Search — Best Match / Related Results
   ========================================================= */

.tm-quick-find__results {
  display: block;
  margin-top: 18px;
}

.tm-quick-find__best-match {
  margin-bottom: 18px;
}

.tm-quick-find__best-label,
.tm-quick-find__related-heading {
  margin-bottom: 8px;
  color: #fbbf24;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tm-quick-find__result--best {
  position: relative;
  padding: 18px;
  border-color: rgba(249, 115, 22, 0.48);
  background:
    linear-gradient(
      145deg,
      rgba(24, 42, 66, 0.98),
      rgba(13, 28, 48, 0.98)
    );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 24px rgba(0, 0, 0, 0.2);
}

.tm-quick-find__result--best .tm-quick-find__result-title {
  font-size: 1.15rem;
}

.tm-quick-find__preview {
  margin-top: 14px;
}

.tm-quick-find__preview-label {
  margin-bottom: 6px;
  color: #e2e8f0;
  font-size: 0.88rem;
  font-weight: 850;
}

.tm-quick-find__preview-list {
  margin: 0;
  padding-left: 20px;
  color: #b8c5d6;
  font-size: 0.9rem;
  line-height: 1.48;
}

.tm-quick-find__preview-list li + li {
  margin-top: 4px;
}

.tm-quick-find__result-main {
  display: block;
  color: inherit;
  text-decoration: none;
}

.tm-quick-find__result-footer {
  display: inline-block;
  margin-top: 14px;
  text-decoration: none;
}

.tm-quick-find__related-results {
  padding-top: 4px;
}

.tm-quick-find__related-heading {
  color: #94a3b8;
}

.tm-quick-find__related-grid {
  display: grid;
  gap: 10px;
}

.tm-quick-find__result--compact {
  padding: 13px 14px;
}

.tm-quick-find__result--compact .tm-quick-find__result-type {
  margin-bottom: 4px;
}

.tm-quick-find__result--compact .tm-quick-find__result-title {
  font-size: 0.98rem;
}

.tm-quick-find__result--compact .tm-quick-find__result-subtitle {
  margin-bottom: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tm-quick-find__result--compact .tm-quick-find__result-footer {
  margin-top: 8px;
  font-size: 0.86rem;
}

@media (min-width: 720px) {
  .tm-quick-find__related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 719px) {
  .tm-quick-find__result--best {
    padding: 15px;
  }

  .tm-quick-find__preview-list {
    padding-left: 18px;
  }
}

/* =========================================================
   Diagnostic Search — Add as Finding
   ========================================================= */

.tm-quick-find__result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.tm-quick-find__result-actions .tm-quick-find__result-footer {
  margin-top: 0;
}

.tm-quick-find__workflow {
  display: inline-block;
}

.tm-quick-find__add-finding {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid rgba(249, 115, 22, 0.55);
  border-radius: 9px;
  background: rgba(249, 115, 22, 0.12);
  color: #fed7aa;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
}

.tm-quick-find__add-finding:hover,
.tm-quick-find__add-finding:focus-visible {
  border-color: #fb923c;
  background: rgba(249, 115, 22, 0.2);
  color: #fff7ed;
}

.tm-quick-find__finding-panel {
  width: min(100%, 480px);
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 12px;
  background: #0b1728;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 10px 24px rgba(0, 0, 0, 0.22);
}

.tm-quick-find__finding-heading {
  margin-bottom: 12px;
  color: #f8fafc;
  font-size: 0.95rem;
  font-weight: 900;
}

.tm-quick-find__field {
  display: grid;
  gap: 6px;
}

.tm-quick-find__field + .tm-quick-find__field {
  margin-top: 10px;
}

.tm-quick-find__field label {
  color: #cbd5e1;
  font-size: 0.8rem;
  font-weight: 800;
}

.tm-quick-find__field select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 9px;
  background: #f8fafc;
  color: #0f172a;
  font: inherit;
}

.tm-quick-find__field select:focus {
  border-color: #60a5fa;
  outline: 3px solid rgba(96, 165, 250, 0.16);
}

.tm-quick-find__field select:disabled {
  background: #cbd5e1;
  color: #64748b;
  cursor: not-allowed;
}

.tm-quick-find__finding-error {
  margin: 10px 0 0;
  color: #fca5a5;
  font-size: 0.85rem;
  font-weight: 750;
}

.tm-quick-find__finding-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.tm-quick-find__finding-cancel,
.tm-quick-find__finding-submit {
  min-height: 38px;
  padding: 8px 13px;
  border-radius: 9px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 850;
  cursor: pointer;
}

.tm-quick-find__finding-cancel {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: transparent;
  color: #cbd5e1;
}

.tm-quick-find__finding-submit {
  border: 1px solid #fb923c;
  background: #f97316;
  color: #111827;
}

.tm-quick-find__finding-submit:hover,
.tm-quick-find__finding-submit:focus-visible {
  background: #fb923c;
}

.tm-quick-find__finding-submit:disabled {
  opacity: 0.65;
  cursor: wait;
}

@media (max-width: 719px) {
  .tm-quick-find__result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .tm-quick-find__workflow,
  .tm-quick-find__add-finding {
    width: 100%;
  }

  .tm-quick-find__finding-panel {
    box-sizing: border-box;
  }

  .tm-quick-find__finding-actions {
    flex-direction: column-reverse;
  }

  .tm-quick-find__finding-cancel,
  .tm-quick-find__finding-submit {
    width: 100%;
  }
}

/* =========================================================
   Diagnostic Search — action row / finding panel alignment
   ========================================================= */

.tm-quick-find__result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.tm-quick-find__result-actions .tm-quick-find__result-footer {
  margin-top: 0;
}

.tm-quick-find__workflow {
  display: contents;
}

.tm-quick-find__add-finding {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid rgba(249, 115, 22, 0.48);
  border-radius: 10px;
  background: rgba(249, 115, 22, 0.12);
  color: #fed7aa;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.tm-quick-find__add-finding:hover,
.tm-quick-find__add-finding:focus-visible {
  border-color: #fb923c;
  background: rgba(249, 115, 22, 0.2);
  color: #fff7ed;
}

.tm-quick-find__finding-panel {
  flex: 0 0 100%;
  width: 100%;
  margin-top: 2px;
  padding: 14px;
  border: 1px solid rgba(96, 165, 250, 0.28);
  border-radius: 12px;
  background: rgba(8, 20, 36, 0.82);
}

.tm-quick-find__finding-panel[hidden] {
  display: none !important;
}

.tm-quick-find__finding-heading {
  margin-bottom: 12px;
  color: #f8fafc;
  font-size: 0.92rem;
  font-weight: 850;
}

.tm-quick-find__field + .tm-quick-find__field {
  margin-top: 10px;
}

.tm-quick-find__field label {
  display: block;
  margin-bottom: 5px;
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 800;
}

.tm-quick-find__field select {
  width: 100%;
  min-height: 40px;
}

.tm-quick-find__finding-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

@media (max-width: 719px) {
  .tm-quick-find__result-actions {
    align-items: stretch;
  }

  .tm-quick-find__result-footer,
  .tm-quick-find__add-finding {
    min-height: 40px;
  }

  .tm-quick-find__finding-actions {
    flex-direction: column-reverse;
  }

  .tm-quick-find__finding-actions button {
    width: 100%;
  }
}