.smart-parts-guide {
  overflow: hidden;
  padding: 14px 0 18px;
  border-block: 1px solid var(--line);
  background: #111113;
}

.smart-parts-guide__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "form";
  align-items: start;
  gap: 32px;
  direction: rtl;
	max-width: 920px;
}

.smart-parts-guide__form-column { grid-area: form; min-width: 0; direction: rtl; }
.smart-parts-guide__preview-column { grid-area: preview; min-width: 0; padding-top: 34px; direction: rtl; }

.smart-parts-guide__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  padding: 5px 10px;
  border: 1px solid rgba(244, 96, 12, .36);
  border-radius: 999px;
  color: var(--orange-hi);
  background: rgba(244, 96, 12, .06);
  font-size: 11.5px;
  font-weight: 800;
}

.smart-parts-guide__eyebrow::before { content: "âœ¦"; }

.smart-parts-guide h2 {
  max-width: 680px;
  margin-bottom: 10px;
  color: var(--ivory);
  font-size: clamp(32px, 3vw, 48px);
  line-height: 1.32;
  font-weight: 900;
}

.smart-parts-guide__intro {
  max-width: 620px;
  margin-bottom: 18px;
  color: #aaaab0;
  font-size: 14px;
  line-height: 1.9;
}

.smart-parts-guide__form {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--black-card);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .18);
}

.smart-parts-guide__form label {
  display: block;
  margin-bottom: 7px;
  color: var(--ivory);
  font-size: 12.5px;
  font-weight: 800;
}

.smart-parts-guide__form textarea {
  display: block;
  width: 100%;
  height: 120px;
  min-height: 120px;
  max-height: 165px;
  padding: 12px 14px;
  resize: vertical;
  border: 1px solid #38383f;
  border-radius: 10px;
  outline: none;
  color: var(--ivory);
  background: #111113;
  line-height: 1.8;
  transition: border-color .18s, box-shadow .18s;
}

.smart-parts-guide__form textarea::placeholder { color: #73737a; }
.smart-parts-guide__form textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(244, 96, 12, .1); }
.smart-parts-guide__form textarea[aria-invalid="true"] { border-color: #e35d5d; }

.smart-parts-guide__field-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  color: var(--steel);
  font-size: 11px;
}

.smart-parts-guide__counter { direction: ltr; white-space: nowrap; }
.smart-parts-guide__counter b { color: var(--ivory); font-weight: 700; }
.smart-parts-guide__error { min-height: 16px; padding-top: 1px; color: #ff8f8f; font-size: 11.5px; }
.smart-parts-guide__submit { width: 100%; min-height: 44px; padding-block: 8px; justify-content: center; border: 0; cursor: pointer; }

.smart-parts-guide__examples { margin-top: 8px; }
.smart-parts-guide__examples > p { margin-bottom: 4px; color: var(--steel); font-size: 11px; }
.smart-parts-guide__examples > div { display: flex; flex-wrap: nowrap; gap: 6px; }

.smart-parts-guide__examples button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 32px;
  padding: 5px 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #c4c4c9;
  background: var(--black-card);
  font-size: 10.5px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: color .18s, border-color .18s, background .18s;
}

.smart-parts-guide__examples button:hover { border-color: var(--orange); color: var(--orange-hi); background: rgba(244, 96, 12, .06); }

.smart-parts-result {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(244, 96, 12, .4);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(244, 96, 12, .06), rgba(30, 30, 34, .96) 38%);
}

.smart-parts-result[hidden] { display: none; }
.smart-parts-result > header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.smart-parts-result > header > span { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 9px; color: #101012; background: var(--orange); font-weight: 900; }
.smart-parts-result header small { color: var(--orange-hi); font-size: 9.5px; }
.smart-parts-result h3 { color: var(--ivory); font-size: 18px; }
.smart-parts-result__notice { margin-bottom: 12px; padding: 9px 11px; border-right: 3px solid var(--hazard); color: #c4c4c9; background: rgba(255, 201, 60, .05); font-size: 11.5px; line-height: 1.8; }
.smart-parts-result__details { display: grid; gap: 7px; }
.smart-parts-result__details > div { padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #17171a; }
.smart-parts-result__details dt { margin-bottom: 2px; color: var(--orange-hi); font-size: 10.5px; font-weight: 800; }
.smart-parts-result__details dd { color: #d4d4d7; font-size: 12px; line-height: 1.7; }
.smart-parts-result__confidence { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; color: var(--steel); font-size: 11px; }
.smart-parts-result__confidence > div { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: #111113; }
.smart-parts-result__confidence > div span { padding: 3px 8px; border-radius: 999px; }
.smart-parts-result__confidence > div .is-active { color: #141414; background: var(--hazard); font-weight: 800; }
.smart-parts-result__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.smart-parts-result__actions .btn { flex: 1 1 180px; justify-content: center; text-align: center; }

.smart-motor-preview {
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #18181b;
}

.smart-motor-preview__visual {
  display: grid;
  place-items: center;
  height: 360px;
  padding: 10px 14px 4px;
  background: #141416;
}

.smart-motor-preview__visual img {
  width: 100%;
  height: 100%;
  max-height: 350px;
  object-fit: contain;
  object-position: center;
  filter: saturate(.86) contrast(1.04) drop-shadow(0 14px 14px rgba(0, 0, 0, .4));
}

.smart-motor-preview figcaption {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  color: var(--steel);
  text-align: center;
  font-size: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .smart-parts-guide *, .smart-parts-guide *::before, .smart-parts-guide *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

@media (max-width: 1024px) {
  .smart-parts-guide { padding-block: 42px; }
  .smart-parts-guide__layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .smart-parts-guide__preview-column { padding-top: 28px; }
  .smart-motor-preview__visual { height: 320px; }
}

@media (max-width: 820px) {
  .smart-parts-guide { padding-block: 40px; }
  .smart-parts-guide__layout { grid-template-columns: 1fr; grid-template-areas: "form"; gap: 24px; }
  .smart-parts-guide__preview-column { padding-top: 0; }
  .smart-parts-guide h2 { max-width: 620px; font-size: clamp(28px, 5vw, 38px); }
  .smart-motor-preview__visual { height: 300px; }
}

@media (max-width: 560px) {
  .smart-parts-guide { padding-block: 34px; }
  .smart-parts-guide h2 { font-size: clamp(25px, 7.5vw, 32px); line-height: 1.42; }
  .smart-parts-guide__intro { margin-bottom: 14px; font-size: 13px; line-height: 1.85; }
  .smart-parts-guide__form, .smart-parts-result { padding: 14px; }
  .smart-parts-guide__form textarea { height: 120px; min-height: 120px; max-height: 160px; padding: 11px 12px; }
  .smart-parts-guide__field-meta { align-items: flex-start; }
  .smart-parts-guide__examples > div { display: grid; grid-template-columns: 1fr; }
  .smart-parts-guide__examples button { width: 100%; white-space: normal; }
  .smart-motor-preview__visual { height: 260px; padding: 6px 8px 2px; }
  .smart-motor-preview__visual img { max-height: 252px; }
  .smart-parts-result__confidence { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 380px) {
  .smart-parts-guide h2 { font-size: 25px; }
  .smart-parts-guide__form textarea { height: 116px; min-height: 116px; }
  .smart-parts-result__actions { display: grid; }
  .smart-parts-result__actions .btn { width: 100%; }
  .smart-motor-preview__visual { height: 238px; }
}
.smart-parts-guide__examples-dropdown {
	overflow: hidden;
	border: 1px solid rgba(255, 122, 0, 0.35);
	border-radius: 14px;
	background: #171717;
}

.smart-parts-guide__examples-dropdown summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px 18px;
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	list-style: none;
	user-select: none;
}

.smart-parts-guide__examples-dropdown summary::-webkit-details-marker {
	display: none;
}

.smart-parts-guide__dropdown-icon {
	color: #ff7a00;
	font-size: 24px;
	line-height: 1;
	transition: transform 0.25s ease;
}

.smart-parts-guide__examples-dropdown[open] .smart-parts-guide__dropdown-icon {
	transform: rotate(180deg);
}

.smart-parts-guide__examples-list {
	display: grid;
	gap: 8px;
	padding: 0 12px 12px;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.smart-parts-guide__examples-list button {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 10px;
	background: #202020;
	color: #eee;
	font: inherit;
	text-align: right;
	cursor: pointer;
	transition:
		background-color 0.2s ease,
		border-color 0.2s ease,
		color 0.2s ease;
}

.smart-parts-guide__examples-list button:first-child {
	margin-top: 12px;
}

.smart-parts-guide__examples-list button:hover,
.smart-parts-guide__examples-list button:focus-visible {
	border-color: #ff7a00;
	background: rgba(255, 122, 0, 0.12);
	color: #fff;
	outline: none;
}

/* Compact progressive-disclosure UI. */
.smart-parts-guide__layout { max-width: 860px; }
.smart-parts-guide__form textarea { height: 96px; min-height: 96px; }
.smart-parts-guide__examples { margin-top: 12px; }
.smart-parts-guide__examples > p { margin-bottom: 7px; }
.smart-parts-guide__quick-examples {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 7px;
}
.smart-parts-guide__quick-examples button {
	min-height: 40px;
	padding: 7px 10px;
	border: 1px solid var(--line);
	border-radius: 999px;
	color: #d4d4d7;
	background: #19191c;
	font: inherit;
	font-size: 11px;
	cursor: pointer;
}
.smart-parts-guide__quick-examples button:hover,
.smart-parts-guide__quick-examples button:focus-visible {
	border-color: var(--orange);
	color: var(--orange-hi);
	outline: none;
}
.smart-parts-guide__examples-dropdown { margin-top: 8px; }
.smart-parts-guide__examples-dropdown summary { min-height: 44px; padding: 9px 14px; font-size: 12px; }

body.smart-guide-modal-open { overflow: hidden; }
.smart-parts-result-modal[hidden] { display: none; }
.smart-parts-result-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	place-items: center;
	padding: 24px;
}
.smart-parts-result-modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .76); backdrop-filter: blur(4px); }
.smart-parts-result-modal__dialog {
	position: relative;
	z-index: 1;
	width: min(760px, 100%);
	max-height: min(84vh, 820px);
	margin: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
}
.smart-parts-result-modal__close {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border: 1px solid var(--line);
	border-radius: 50%;
	color: var(--ivory);
	background: #202024;
	font-size: 25px;
	cursor: pointer;
}
.smart-parts-result-card__details { margin-top: 10px; border-top: 1px solid var(--line); }
.smart-parts-result-card__details summary { padding: 11px 0 4px; color: var(--orange-hi); font-size: 11.5px; font-weight: 800; cursor: pointer; }

@media (max-width: 700px) {
	.smart-parts-guide__quick-examples { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.smart-parts-guide__quick-examples button { min-height: 44px; }
	.smart-parts-result-modal { align-items: end; padding: 0; }
	.smart-parts-result-modal__dialog {
		width: 100%;
		max-height: 88dvh;
		border-radius: 20px 20px 0 0;
		padding: 18px 14px calc(16px + env(safe-area-inset-bottom));
	}
	.smart-parts-result-modal__dialog::before {
		content: "";
		display: block;
		width: 42px;
		height: 4px;
		margin: -7px auto 12px;
		border-radius: 999px;
		background: #55555c;
	}
}