:root {
  color-scheme: light;
  --ink: #0f2d52;
  --muted: #4b5563;
  --line: #d8dee7;
  --paper: #f4f6f8;
  --panel: #ffffff;
  --primary: #2563eb;
  --primary-dark: #0f2d52;
  --dark: #0f2d52;
  --soft-accent: #eaf1ff;
  --primary-tint: #dbeafe;
  --danger: #9f3d32;
  --danger-tint: #fff0ed;
  --amber: #b45309;
  --blue: #2563eb;
  --shadow: 0 18px 50px rgba(15, 45, 82, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

button,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease,
    transform 100ms ease;
}

button:active {
  transform: translateY(1px);
}

button:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.24);
  outline-offset: 2px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  padding: 12px clamp(18px, 4vw, 54px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
}

.topnav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 26px);
  font-size: 0.94rem;
}

.topnav a {
  color: var(--muted);
  text-decoration: none;
}

.topnav a:hover {
  color: var(--primary);
}

.advisor-shell {
  position: relative;
  min-height: calc(100vh - 68px);
  padding: clamp(22px, 4vw, 58px);
  overflow: hidden;
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(15, 45, 82, 0.9), rgba(15, 45, 82, 0.54), rgba(244, 246, 248, 0.18)),
    url("assets/showroom-hero.png") center / cover no-repeat;
  filter: saturate(0.96);
}

.advisor-shell::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  z-index: -1;
  height: 22vh;
  background: linear-gradient(0deg, var(--paper), rgba(244, 246, 248, 0));
}

.advisor-grid {
  display: grid;
  grid-template-columns: minmax(320px, 760px) minmax(240px, 330px);
  align-items: end;
  gap: clamp(18px, 3vw, 32px);
  max-width: 1220px;
  min-height: calc(100vh - 186px);
  margin: 0 auto;
}

.advisor-panel,
.snapshot-panel {
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.advisor-panel {
  padding: clamp(20px, 3vw, 34px);
}

.snapshot-panel {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.advisor-panel h1 {
  max-width: 720px;
  margin: 0 0 22px;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.search-box label,
.control-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 10px;
}

textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 112px;
  padding: 14px;
  resize: vertical;
  line-height: 1.45;
}

select {
  min-height: 44px;
  padding: 0 12px;
}

.input-row button,
.result-actions button,
.quick-prompts button,
.compare-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  box-shadow: 0 1px 0 rgba(17, 24, 39, 0.04);
}

.input-row button {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.2);
}

.input-row button:hover {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
  color: #fff;
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.24);
}

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 18px;
}

.clear-search-button {
  min-height: 38px;
  margin-top: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 900;
  box-shadow: 0 1px 0 rgba(17, 24, 39, 0.04);
}

.clear-search-button:hover {
  border-color: var(--primary);
  background: var(--soft-accent);
  color: var(--primary-dark);
}

.quick-prompts button {
  min-height: 38px;
  padding: 0 12px;
  background: #fff;
}

.test-intro {
  display: grid;
  gap: 4px;
  margin: -2px 0 18px;
  padding: 12px 14px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 8px;
  background: var(--soft-accent);
  color: var(--primary-dark);
}

.test-intro[hidden] {
  display: none;
}

.test-intro strong {
  font-size: 0.92rem;
  font-weight: 950;
}

.test-intro span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.test-mode [hidden] {
  display: none !important;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.api-status {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f4f6f8;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.api-status.online {
  border-color: rgba(37, 99, 235, 0.28);
  background: var(--soft-accent);
  color: var(--primary-dark);
}

.api-status.checking {
  border-color: rgba(180, 83, 9, 0.28);
  background: #fff6e8;
  color: var(--amber);
}

.quick-prompts button:hover,
.quick-prompts button.active,
.result-actions button:hover,
.empty-actions button:hover,
.feedback-row button:hover,
.feedback-reason-panel button:hover,
.compare-button:hover,
.segmented-control button:not(.active):hover {
  border-color: var(--primary);
  background: var(--soft-accent);
  color: var(--primary-dark);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.14);
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.advanced-filter-panel {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.advanced-filter-panel summary {
  padding: 14px;
  color: var(--primary-dark);
  font-weight: 900;
  cursor: pointer;
}

.advanced-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 12px;
  padding: 0 14px 14px;
}

.advanced-filter-grid label,
.checkbox-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  padding: 0 14px 14px;
}

.checkbox-grid label {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f6f8;
}

.checkbox-grid input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.price-range-panel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.price-range-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.price-range-head strong {
  color: var(--primary-dark);
  text-align: right;
}

.range-stack {
  position: relative;
  min-height: 28px;
  --min-percent: 0%;
  --max-percent: 100%;
}

.range-stack::before,
.range-stack::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 11px;
  height: 6px;
  border-radius: 999px;
  pointer-events: none;
}

.range-stack::before {
  background: var(--line);
}

.range-stack::after {
  left: var(--min-percent);
  right: calc(100% - var(--max-percent));
  background: var(--primary);
}

.range-stack input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0;
  background: transparent;
  pointer-events: none;
  appearance: none;
  z-index: 2;
}

.range-stack input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: transparent;
}

.range-stack input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(15, 45, 82, 0.28);
  pointer-events: auto;
  appearance: none;
}

.range-stack input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: transparent;
}

.range-stack input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(15, 45, 82, 0.28);
  pointer-events: auto;
}

.toggle-row {
  align-content: end;
  grid-template-columns: 18px minmax(0, 1fr);
  min-height: 68px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.metric {
  display: block;
  color: var(--primary);
  font-size: 2.2rem;
  font-weight: 900;
}

.metric-label,
.snapshot-note,
.muted,
.query-summary {
  color: var(--muted);
}

.snapshot-note,
.query-summary {
  margin: 0;
  line-height: 1.45;
}

.intent-summary {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.intent-summary-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.intent-summary-head strong {
  color: var(--primary-dark);
}

.intent-warning {
  color: var(--amber);
  font-weight: 900;
}

.intent-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.intent-chip-row span {
  min-height: 28px;
  padding: 6px 9px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 999px;
  background: var(--soft-accent);
  color: var(--primary-dark);
  font-size: 0.8rem;
  font-weight: 850;
}

.compare-band,
.promo-band,
.data-band,
.evaluation-band {
  max-width: 1220px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) clamp(18px, 4vw, 26px);
}

.results-band {
  max-width: 1460px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) clamp(18px, 4vw, 26px);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.6rem, 2.8vw, 2.5rem);
  letter-spacing: 0;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.car-card,
.promo-card,
.data-layout article,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.06);
}

.car-card {
  display: grid;
  grid-template-rows: 124px 82px 64px 96px 76px 150px 66px auto 128px auto auto 46px;
  gap: 12px;
  height: auto;
  padding: 18px;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 22px;
}

.empty-state h3,
.empty-state p {
  margin: 0;
}

.empty-state p {
  margin-top: 8px;
  color: var(--muted);
}

.compact-empty {
  padding: 18px;
}

.empty-diagnostics {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.empty-diagnostics li {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.empty-diagnostics strong {
  display: inline-flex;
  justify-content: center;
  color: var(--primary-dark);
  font-size: 1.1rem;
}

.empty-diagnostics span {
  color: var(--muted);
  line-height: 1.35;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.empty-actions button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  box-shadow: 0 1px 0 rgba(17, 24, 39, 0.04);
}

.card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  align-items: start;
  gap: 12px;
  height: 124px;
  overflow: hidden;
}

.car-title {
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.25;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.car-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.data-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  max-height: 64px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.data-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f4f6f8;
  color: #4b5563;
  font-size: 0.72rem;
  font-weight: 900;
}

.data-status.verified {
  border-color: rgba(37, 99, 235, 0.28);
  background: var(--soft-accent);
  color: #0f2d52;
}

.data-status.estimated {
  border-color: rgba(151, 91, 26, 0.26);
  background: #fff6e8;
  color: #87510f;
}

.data-status.incomplete {
  border-color: rgba(165, 58, 46, 0.24);
  background: #fff0ed;
  color: #98382e;
}

.score {
  display: grid;
  place-items: center;
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  background: var(--soft-accent);
  color: var(--primary-dark);
  text-align: center;
}

.score strong {
  display: block;
  font-size: 1.45rem;
  line-height: 1;
}

.score span {
  display: none;
}

.price-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  height: 82px;
  overflow: hidden;
}

.price {
  font-size: 1.28rem;
  font-weight: 900;
}

.old-price {
  color: var(--muted);
  font-size: 0.86rem;
  text-decoration: line-through;
}

.price-caption,
.official-price {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.official-price {
  color: #4b5563;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
  height: 64px;
  overflow: hidden;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f4f6f8;
  color: #4b5563;
  font-size: 0.78rem;
  font-weight: 800;
}

.tag.promo {
  background: var(--soft-accent);
  color: var(--primary-dark);
}

.tag.safe {
  background: var(--soft-accent);
  color: var(--blue);
}

.reason {
  margin: 0;
  height: 76px;
  overflow: hidden;
  color: #0f2d52;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.fit-analysis {
  display: grid;
  gap: 0;
  height: 150px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.fit-analysis div {
  display: grid;
  grid-template-columns: minmax(112px, 0.46fr) minmax(0, 1fr);
  gap: 12px;
  height: 75px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  overflow: hidden;
}

.fit-analysis div:last-child {
  border-bottom: 0;
}

.fit-analysis span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.fit-analysis strong {
  color: #0f2d52;
  font-size: 0.84rem;
  line-height: 1.35;
  text-align: right;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.feedback-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 66px;
  overflow: hidden;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f6f8;
}

.feedback-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.feedback-row div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.feedback-row button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  box-shadow: 0 1px 0 rgba(17, 24, 39, 0.04);
}

.feedback-row button[data-feedback="yes"].active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.18);
}

.feedback-row button[data-feedback="no"].active {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
  box-shadow: 0 8px 16px rgba(159, 61, 50, 0.15);
}

.feedback-reason-panel {
  display: grid;
  gap: 7px;
  min-height: 0;
  max-height: 0;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  transition: max-height 0.2s ease, opacity 0.16s ease, padding 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.feedback-reason-panel.visible {
  max-height: 420px;
  padding: 12px 11px;
  border-color: var(--line);
  background: #fff;
  opacity: 1;
  visibility: visible;
  overflow: visible;
}

.feedback-reason-panel span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.feedback-reason-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: flex-start;
}

.feedback-reason-panel button {
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f6f8;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 900;
}

.feedback-reason-panel button.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.feedback-reason-panel small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.feedback-note-field {
  display: grid;
  gap: 6px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.feedback-note-field textarea {
  width: 100%;
  min-height: 88px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f6f8;
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
  resize: vertical;
}

.feedback-note-field textarea:focus {
  outline: 2px solid rgba(37, 99, 235, 0.22);
  border-color: var(--primary);
  background: #fff;
}

.offer-note {
  margin: 0;
  height: 96px;
  overflow: hidden;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-accent);
  color: var(--primary-dark);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.4;
}

.placeholder-offer {
  display: grid;
  align-items: center;
  background: #f4f6f8;
  color: var(--muted);
}

.offer-note a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin-left: 0;
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: none;
}

.offer-note a:hover {
  text-decoration: underline;
}

.score-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 62px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.84rem;
}

.score-row strong {
  color: var(--ink);
  text-align: right;
}

.score-row i {
  grid-column: 1 / -1;
  display: block;
  height: 6px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--primary) var(--bar), #d8dee7 var(--bar));
}

.quick-specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  height: 128px;
  overflow: hidden;
}

.quick-specs div {
  display: grid;
  gap: 4px;
  min-height: 54px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.quick-specs span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.quick-specs strong {
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.2;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.spec-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.main-specs .spec-grid {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.spec {
  display: grid;
  grid-template-columns: minmax(120px, 0.72fr) minmax(0, 1.28fr);
  gap: 12px;
  min-height: 64px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  align-items: center;
}

.spec:last-child {
  border-bottom: 0;
}

.spec span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.spec strong {
  line-height: 1.22;
  text-align: right;
  font-size: 0.83rem;
  overflow-wrap: anywhere;
}

.main-specs,
.technical-specs {
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.main-specs > summary,
.technical-specs > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 13px 16px;
  color: var(--primary-dark);
  font-weight: 900;
  cursor: pointer;
  transition:
    background-color 140ms ease,
    color 140ms ease;
}

.main-specs > summary:hover,
.technical-specs > summary:hover {
  background: var(--soft-accent);
}

.main-specs[open] > summary,
.technical-specs[open] > summary {
  background: var(--primary);
  color: #fff;
}

.main-specs > summary::after,
.technical-specs > summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-weight: 900;
}

.main-specs[open] > summary::after,
.technical-specs[open] > summary::after {
  content: "-";
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}

.spec-table {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 0 16px 16px;
}

.spec-table > .spec-section-title {
  width: 100%;
  min-height: 38px;
  padding: 16px 0 8px;
  border-bottom: 1px solid var(--line);
  color: var(--primary-dark);
  font-size: 0.84rem;
  font-weight: 900;
  text-transform: uppercase;
}

.spec-table > div:not(.spec-section-title) {
  display: grid;
  grid-template-columns: minmax(170px, 34%) minmax(0, 1fr);
  gap: 24px;
  width: 100%;
  min-height: 44px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.spec-table span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.spec-table strong {
  min-width: 0;
  text-align: right;
  font-size: 0.84rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.compare-button {
  width: 100%;
  background: #fff;
}

.compare-button.active {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
  color: #fff;
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.18);
}

.compare-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.compare-controls {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.segmented-control {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.segmented-control button {
  min-width: 108px;
  min-height: 38px;
  border: 0;
  background: #fff;
  color: var(--muted);
  font-weight: 900;
}

.segmented-control button.active {
  background: var(--primary);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(15, 45, 82, 0.18);
}

.compare-table table {
  width: 100%;
  min-width: 680px;
  table-layout: fixed;
  border-collapse: collapse;
}

.compare-table .compare-item-col {
  width: 190px;
}

.compare-table .compare-car-col {
  width: auto;
}

.compare-table table.compare-count-2 {
  min-width: 620px;
}

.compare-table table.compare-count-3 {
  min-width: 820px;
}

.compare-table th,
.compare-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: normal;
}

.compare-table th {
  background: #f4f6f8;
}

.compare-table thead th:first-child,
.compare-table tbody th {
  width: 190px;
}

.compare-table td.winner {
  background: var(--soft-accent);
  color: var(--primary-dark);
  font-weight: 900;
}

.winner-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-top: 6px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
}

.promo-grid,
.data-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.quality-summary,
.evaluation-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.quality-card {
  display: grid;
  gap: 4px;
  min-height: 112px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.05);
}

.quality-card span {
  color: var(--primary-dark);
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
}

.quality-card strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.quality-card small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.evaluation-details {
  display: grid;
  gap: 14px;
}

.evaluation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.evaluation-grid article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.05);
}

.evaluation-grid h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.evaluation-grid ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.evaluation-grid li {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 36px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.evaluation-grid li:last-child {
  border-bottom: 0;
}

.evaluation-grid li strong {
  color: var(--primary-dark);
}

.evaluation-grid li span {
  color: var(--muted);
  line-height: 1.35;
}

.quality-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.quality-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.quality-table th,
.quality-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.quality-table th {
  background: #f4f6f8;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.source-dashboard {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.source-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.source-card {
  display: grid;
  gap: 5px;
  min-height: 112px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.05);
}

.source-card span {
  color: var(--primary-dark);
  font-size: 1.65rem;
  font-weight: 900;
  line-height: 1;
}

.source-card strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.source-card small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.source-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.source-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

.source-table th,
.source-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.source-table th {
  background: #f4f6f8;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.source-table td strong,
.source-table td span {
  display: block;
}

.source-table td span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.source-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f4f6f8;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.source-status.ok {
  border-color: rgba(37, 99, 235, 0.28);
  background: var(--soft-accent);
  color: var(--primary-dark);
}

.source-status.review {
  border-color: rgba(180, 83, 9, 0.28);
  background: #fff6e8;
  color: var(--amber);
}

.quality-table tr:last-child td {
  border-bottom: 0;
}

.quality-table td > strong,
.quality-table td > span {
  display: block;
}

.quality-table td > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.promo-card,
.data-layout article {
  padding: 16px;
}

.promo-card h3,
.data-layout h3 {
  margin: 0 0 8px;
}

.promo-card p,
.data-layout p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.discount {
  color: var(--primary);
  font-size: 1.25rem;
  font-weight: 900;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 24px clamp(18px, 4vw, 54px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

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

@media (max-width: 900px) {
  .topbar,
  .section-head,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .topnav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .advisor-grid {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .advisor-shell {
    min-height: auto;
  }

  .control-grid,
  .input-row,
  .advanced-filter-grid,
  .checkbox-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .results-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .advisor-shell {
    padding: 14px;
  }

  .advisor-panel {
    padding: 18px;
  }

  .advisor-panel h1 {
    font-size: 2rem;
  }

  .spec-grid {
    grid-template-columns: 1fr;
  }

  .spec-table {
    grid-template-columns: 1fr;
  }

  .spec-table > div:not(.spec-section-title) {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .fit-analysis div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .fit-analysis strong {
    text-align: left;
  }

  .spec-table strong {
    text-align: left;
  }
}
