.vehicle-chat-page {
  --chat-navy: #0b1424;
  --chat-line: #dce5ec;
  background: #f0f4f8;
}

.vehicle-chat-page .site-nav [aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: .12em;
  text-underline-offset: .3em;
}

.vehicle-chat-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: var(--white);
  background: #0a111e;
}

.vehicle-chat-hero > img {
  position: absolute;
  z-index: -2;
  inset: 0 0 0 auto;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right 65%;
}

.vehicle-chat-hero::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(90deg, #0a111e 0%, rgb(10 17 30 / .92) 24%, rgb(10 17 30 / .49) 50%, transparent 76%),
    linear-gradient(0deg, rgb(10 17 30 / .55), transparent 45%);
  content: "";
}

.vehicle-chat-hero-copy { padding-block: clamp(3.25rem, 6.3vw, 6rem) clamp(4.5rem, 7.2vw, 7rem); }

.vehicle-chat-hero h1 {
  max-width: 14ch;
  font-size: clamp(2.55rem, 5.1vw, 4.85rem);
  font-weight: 800;
  line-height: .99;
  letter-spacing: -.065em;
}

.vehicle-chat-hero h1 span { display: block; color: var(--lime); }

.vehicle-chat-hero p {
  max-width: 47ch;
  margin-top: 1.15rem;
  color: #e1e8f0;
  font-size: clamp(1rem, 1.45vw, 1.15rem);
  line-height: 1.6;
}

.vehicle-chat-workspace {
  position: relative;
  z-index: 1;
  margin-top: -2.15rem;
  padding-bottom: clamp(3.25rem, 6vw, 5rem);
}

.chat-workbench {
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--chat-line);
  border-radius: 1.25rem;
  box-shadow: 0 .9rem 2.4rem rgb(12 27 44 / .09);
}

.chat-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .45rem;
  padding: .6rem;
  background: var(--chat-navy);
}

.chat-mode-tab {
  min-width: 0;
  min-height: 4rem;
  padding: .65rem clamp(.6rem, 1.5vw, 1.1rem);
  color: #e9f1f8;
  border: 1px solid transparent;
  border-radius: .75rem;
  background: transparent;
  text-align: left;
}

.chat-mode-tab[aria-selected="true"] {
  border-color: var(--lime);
  background: var(--lime);
  color: var(--chat-navy);
}

.chat-mode-tab:not([aria-selected="true"]):hover { border-color: #506178; background: #18283e; }
.chat-mode-tab:focus-visible { outline-color: #f2ffcb; outline-offset: -5px; }
.chat-mode-tab[aria-selected="true"]:focus-visible { outline-color: var(--chat-navy); }

.chat-mode-label, .chat-mode-note { display: block; }
.chat-mode-label { font-size: clamp(.9rem, 1.5vw, 1.04rem); font-weight: 800; line-height: 1.25; }
.chat-mode-note { margin-top: .18rem; color: #c0ccda; font-size: .76rem; font-weight: 550; line-height: 1.3; }
.chat-mode-tab[aria-selected="true"] .chat-mode-note { color: #334421; }

.chat-mode-panel { min-width: 0; }
.chat-workbench .vehicle-chat-card {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.chat-search, .chat-workbench .vehicle-chat-context { padding: clamp(1.15rem, 3.35vw, 2.55rem); }
.chat-workbench .vehicle-chat-context > :where(form, details, section, .chat-vehicle-profile) { max-width: 45rem; }
.chat-workbench .vehicle-chat-context #chat-lookup { width: auto; min-width: min(100%, 11rem); }

.chat-search-assistant {
  margin-top: .9rem;
  padding-inline: .85rem;
  border: 1px solid var(--chat-line);
  border-radius: .65rem;
  background: #f7faff;
}
.chat-search-assistant form { padding: .45rem 0 .85rem; }
.chat-search-assistant .chat-meta { margin: .4rem 0 .7rem; }
.chat-search-assistant .chat-progress { margin: .55rem 0 0; white-space: pre-line; }
.chat-search-suggestion-note { margin-top: .75rem; white-space: pre-line; overflow-wrap: anywhere; }
.chat-search-form { margin-top: 1.1rem; }
.chat-search-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; align-items: end; }
.chat-search-fields > * { min-width: 0; }

.chat-search-filters {
  margin-top: 1rem;
  border-top: 1px solid var(--chat-line);
}

:is(.chat-search-assistant, .chat-search-filters, .chat-searched-sources) summary {
  display: list-item;
  width: fit-content;
  min-height: 2.5rem;
  align-content: center;
  padding-block: .45rem;
  color: #28476b;
  cursor: pointer;
  font-size: .88rem;
  font-weight: 750;
}

.chat-search-filters[open] summary { margin-bottom: .55rem; }
.chat-search-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1rem; margin-top: .95rem; }
.chat-search-actions .chat-progress { margin: 0; }
#chat-search-zip { font-variant-numeric: tabular-nums; }

.chat-search-results {
  margin-top: 1.55rem;
  padding-top: 1.3rem;
  border-top: 1px solid var(--chat-line);
}

.chat-search-results h3 { margin-bottom: .55rem; font-size: 1.12rem; line-height: 1.3; }
.chat-search-results .chat-search-result h3 { margin-bottom: 0; }
.chat-search-sources { display: flex; flex-wrap: wrap; gap: .5rem; margin-block: .65rem; }
.chat-search-sources button {
  min-height: 2.55rem;
  padding: .45rem .85rem;
  color: var(--ink);
  border: 1px solid #aebed0;
  border-radius: .55rem;
  background: #f5f8fb;
  font-size: .84rem;
  font-weight: 750;
}
.chat-search-sources button:hover { border-color: #375677; }
.chat-search-sources button[aria-pressed="true"] { color: var(--white); border-color: #2e4563; background: #253b56; }
.chat-searched-sources .chat-meta { overflow-wrap: anywhere; }
#chat-search-filter-status, .chat-search-price-note { margin-top: .6rem; }
#chat-search-broaden { min-height: 2.7rem; margin-top: .65rem; }

.chat-inventory-tools, .chat-compare-tools, .chat-compare-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .8rem;
}
.chat-inventory-tools {
  justify-content: space-between;
  margin-top: .85rem;
  padding: .7rem .8rem;
  border: 1px solid var(--chat-line);
  border-radius: .65rem;
  background: #f7faff;
}
.chat-compare-tools .button { min-height: 2.6rem; padding: .45rem .75rem; font-size: .85rem; }
.chat-inventory-sort { width: min(100%, 14rem); }
.chat-inventory-sort label { margin-bottom: .25rem; }
.chat-compare-panel { margin-top: .9rem; padding: .8rem; border: 1px solid var(--chat-line); border-radius: .65rem; }
.chat-compare-heading { justify-content: space-between; margin-bottom: .45rem; }
.chat-compare-heading h4 { font-size: 1.1rem; line-height: 1.3; }
.chat-compare-scroll-hint { display: none; margin-bottom: .35rem; }
.chat-compare-scroll { max-width: 100%; overflow-x: auto; }
.chat-compare-table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; font-size: .87rem; }
.chat-compare-table :is(th, td) { min-width: 9rem; padding: .65rem .55rem; border-bottom: 1px solid var(--chat-line); vertical-align: top; overflow-wrap: anywhere; }
.chat-compare-table th { font-weight: 750; background: #f2f6fb; }
.chat-compare-table :is(thead th:first-child, tbody th) { position: sticky; left: 0; min-width: 7rem; }
.chat-compare-table a { color: #264969; font-weight: 750; text-underline-offset: .2rem; }
.chat-compare-table .chat-clear { display: block; padding-inline: .3rem; margin-top: .15rem; }
.chat-compare-missing { color: var(--muted); }

.chat-search-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: .85rem;
  margin: .85rem 0 0;
  padding: 0;
  list-style: none;
}

.chat-search-result {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--chat-line);
  border-radius: .82rem;
  background: #f7faff;
}

.chat-search-photo { display: block; width: 100%; aspect-ratio: 16 / 8.5; object-fit: cover; }
.chat-search-result-content { display: flex; height: 100%; flex-direction: column; align-items: start; gap: .38rem; padding: .9rem; }
.chat-search-result h3 { overflow-wrap: anywhere; font-size: 1.06rem; font-weight: 800; line-height: 1.27; }
.chat-search-result-price { font-size: 1.18rem; font-weight: 800; letter-spacing: -.025em; }
.chat-search-result-meta { color: var(--muted); overflow-wrap: anywhere; font-size: .83rem; line-height: 1.45; }
.chat-search-alternates { width: 100%; font-size: .83rem; }
.chat-search-alternates summary { align-content: center; min-height: 2rem; cursor: pointer; font-weight: 750; }
.chat-search-result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .55rem; margin-top: auto; padding-top: .5rem; }
.chat-search-result-actions a:not(.button) { color: #264969; font-size: .85rem; font-weight: 800; text-underline-offset: .2rem; }
.chat-search-result-actions .button { min-height: 2.5rem; padding: .45rem .65rem; font-size: .8rem; }
.chat-search-result-actions .chat-compare-toggle[aria-pressed="true"] { color: #253716; border-color: #91a876; background: #e7f4d7; }
.chat-search-suggestion { margin-top: .6rem; }

.chat-active-context {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .7rem;
  align-items: center;
  width: fit-content;
  margin: .95rem clamp(1.05rem, 3vw, 1.7rem) 0;
  padding: .43rem .7rem;
  color: #233624;
  border: 1px solid #cbdcaf;
  border-radius: .55rem;
  background: #f1f8e5;
  font-size: .84rem;
  font-weight: 750;
}

.chat-active-context button {
  min-height: 2rem;
  padding: .15rem .3rem;
  color: inherit;
  border: 0;
  background: transparent;
  font-size: .78rem;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: .15em;
}

.vehicle-chat-noscript {
  margin-bottom: .75rem;
  padding: .8rem 1rem;
  border: 1px solid var(--line);
  border-radius: .6rem;
  background: var(--white);
}

.vehicle-chat-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dbe3eb;
  border-radius: .95rem;
  background: var(--white);
  box-shadow: 0 12px 30px rgb(16 29 45 / .045);
}

.vehicle-chat-card h2 {
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.035em;
}

.vehicle-chat-context { padding: clamp(1.05rem, 2.7vw, 1.65rem); }
.vehicle-chat-context h2 { margin-bottom: .85rem; }
.vehicle-chat-page fieldset { min-inline-size: 0; margin: 0; padding: 0; border: none; }

.vehicle-chat-page label {
  display: block;
  margin-bottom: .45rem;
  font-size: .86rem;
  font-weight: 800;
}

.vehicle-chat-page :is(input, select, textarea) {
  display: block;
  width: 100%;
  border: 1px solid #a6b5c5;
  border-radius: .58rem;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.vehicle-chat-page :is(input, select, textarea):disabled {
  border-color: var(--line);
  background: #f2f5f8;
}

.vehicle-chat-page input[aria-invalid="true"] { border-color: #b42a20; }
.vehicle-chat-page :is(input, select) { min-height: 2.85rem; padding: .55rem .8rem; }

#chat-vin {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.chat-meta { color: var(--muted); font-size: .8rem; line-height: 1.45; }
#chat-vin-hint { margin: .45rem 0 .8rem; }
.vehicle-chat-page button { font-family: inherit; cursor: pointer; }
.vehicle-chat-page button:disabled { cursor: default; }
.vehicle-chat-page .button:disabled { border-color: transparent; background: #dce4ed; color: #45576d; }
#chat-lookup { width: 100%; }

.chat-vin-location, .chat-vehicle-facts {
  margin-top: .85rem;
  color: #364a60;
  font-size: .86rem;
  line-height: 1.5;
}

.chat-vin-location summary, .chat-vehicle-facts summary {
  min-height: 2rem;
  align-content: center;
  cursor: pointer;
  font-weight: 750;
  color: var(--ink);
}

.chat-vin-location p { margin-top: .3rem; }

.chat-privacy {
  margin-top: .9rem;
  padding-top: .85rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.55;
}

.chat-vehicle-profile h3 {
  font-size: 1.22rem;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.chat-vehicle-profile > .chat-meta { margin-top: .25rem; }
.chat-vehicle-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.chat-vehicle-actions .button { min-height: 2.7rem; }
.chat-save, .chat-saved { margin-top: .9rem; }
.chat-save > .chat-meta { margin-top: .4rem; }
.chat-saved { padding-top: .85rem; border-top: 1px solid var(--line); }
.chat-saved h3, .chat-next h3 { font-size: .95rem; font-weight: 800; }
.chat-saved ul { margin: .45rem 0 0; padding: 0; list-style: none; }
.chat-saved li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0 .65rem;
  padding-block: .2rem;
  border-bottom: 1px solid #edf0f4;
}
.chat-saved li button {
  min-height: 2.75rem;
  padding: .25rem 0;
  border: 0;
  background: transparent;
  color: #234e78;
  font-size: .84rem;
  font-weight: 750;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: .18em;
  overflow-wrap: anywhere;
}
.chat-vehicle-facts dl { margin: .5rem 0; }

.chat-vehicle-facts dl > div {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: .5rem;
  padding-block: .42rem;
  border-bottom: 1px solid #edf0f4;
  overflow-wrap: anywhere;
}

.chat-vehicle-facts dt { font-weight: 750; }
.chat-vehicle-facts dd { margin: 0; }

.chat-vehicle-checks { margin-top: 1rem; border-top: 1px solid var(--chat-line); padding-top: .85rem; }
.chat-vehicle-checks h4 { margin: 0 0 .3rem; font-size: 1rem; }

.chat-conversation-heading, .chat-conversation-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  column-gap: 1rem;
}

.chat-conversation-heading {
  min-height: 4.2rem;
  padding: .6rem clamp(1.05rem, 3vw, 1.7rem);
  border-bottom: 1px solid #e6edf3;
}

.chat-clear {
  min-height: 2.75rem;
  padding: .2rem .15rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: .2em;
}

.chat-topics { padding: 1.3rem clamp(1.05rem, 3vw, 1.7rem) 0; }
.chat-topics h3 { font-size: .9rem; font-weight: 800; }

.chat-topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .65rem;
}

.chat-topic-list button {
  min-height: 2.75rem;
  padding: .45rem .75rem;
  border: 1px solid #c5d2df;
  border-radius: 100px;
  background: #f8fafc;
  color: #243950;
  font-size: .84rem;
  font-weight: 750;
  line-height: 1.3;
  text-align: left;
}

.chat-topic-list button:not(:disabled):hover { border-color: #7087a0; background: #eef3f8; }
.chat-topic-list button:disabled { background: #f3f5f8; color: #4d5f74; }

.chat-progress, .chat-error {
  margin-top: .65rem;
  font-size: .87rem;
  line-height: 1.45;
}

.chat-progress { color: #465a70; }
.chat-error { color: #a42620; font-weight: 750; }
.chat-progress:empty, .chat-error:empty { display: none; }

.chat-conversation-status, .chat-conversation-error {
  margin-inline: clamp(1.05rem, 3vw, 1.7rem);
  margin-top: .9rem;
}

.chat-transcript {
  display: grid;
  align-content: start;
  gap: 1rem;
  max-height: min(58vh, 34rem);
  padding: 1.3rem clamp(1.05rem, 3vw, 1.7rem) .1rem;
  overflow: auto;
  overscroll-behavior: contain;
}
.chat-transcript:focus-visible { outline-offset: -3px; }

.chat-turn { min-width: 0; justify-self: start; max-width: min(95%, 42rem); }
.chat-turn-user { justify-self: end; }

.chat-turn-label {
  margin-bottom: .25rem;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 800;
}

.chat-turn-user .chat-turn-label { text-align: right; }

.chat-bubble {
  padding: .72rem .9rem;
  border-radius: .8rem;
  background: #eff4f8;
  color: var(--ink);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.chat-turn-user .chat-bubble { background: #17283d; color: var(--white); }
.chat-turn-assistant .chat-bubble { border: 1px solid #deebf0; }
.chat-bubble p { white-space: pre-line; }
.chat-bubble p + p { margin-top: .65rem; }

.chat-source-list {
  display: flex;
  flex-wrap: wrap;
  gap: .2rem .55rem;
  margin: .55rem 0 0;
  padding: 0;
  list-style: none;
}

.chat-source-list a {
  display: inline-block;
  padding-block: .3rem;
  color: #234e78;
  font-size: .8rem;
  font-weight: 750;
  overflow-wrap: anywhere;
  text-underline-offset: .18em;
}
.chat-source-list li:has(.chat-source-excerpt) { width: 100%; }
.chat-source-excerpt { white-space: pre-line; overflow-wrap: anywhere; }

.chat-answer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .15rem .65rem;
  margin-top: .15rem;
}

.chat-compose { padding: 1.05rem clamp(1.05rem, 3vw, 1.7rem) 1.15rem; }

.vehicle-chat-page textarea {
  min-height: 4.25rem;
  padding: .65rem .8rem;
  resize: vertical;
}

.vehicle-chat-page textarea::placeholder { color: #5b6b7f; }

.chat-compose-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .8rem;
  margin-top: .6rem;
}

.chat-compose textarea[readonly] { background: #f2f5f8; }
.chat-compose-actions .button { min-width: 5.4rem; min-height: 2.75rem; }

.chat-conversation-footer {
  gap: .35rem 1rem;
  padding: .7rem clamp(1.05rem, 3vw, 1.7rem);
  border-top: 1px solid #e6edf3;
  color: var(--muted);
  font-size: .81rem;
  line-height: 1.45;
}

.chat-conversation-footer a {
  display: inline-flex;
  min-height: 2rem;
  align-items: center;
  gap: .3rem;
  color: #234e78;
  font-weight: 800;
  text-underline-offset: .18em;
}

.chat-next {
  margin-top: 1.05rem;
  padding: 1.05rem clamp(1.05rem, 3vw, 1.7rem);
  border: 1px solid #dce5ec;
  border-radius: .85rem;
  background: #f8fafc;
}

.chat-next-options { margin-top: .45rem; }
.chat-next-options > * + * { border-top: 1px solid #e6edf3; }
.chat-next-options summary, .chat-next-options a {
  min-height: 2.75rem;
  padding-block: .55rem;
  align-content: center;
  font-size: .9rem;
  font-weight: 750;
}
.chat-next-options summary { cursor: pointer; }
.chat-next-options a { display: block; color: #234e78; text-underline-offset: .18em; }
.chat-next-options details > :not(summary) { margin-inline-start: 1rem; }
.chat-next-options details p { color: var(--muted); font-size: .84rem; }

@media (max-width: 42rem) {
  .vehicle-chat-page .site-nav { font-size: clamp(.73rem, 3.5vw, .9rem); }
  .vehicle-chat-page .site-nav a { white-space: nowrap; }
  .vehicle-chat-hero > img { object-position: 64% 61%; }
  .vehicle-chat-hero::after { background: linear-gradient(90deg, rgb(10 17 30 / .93), rgb(10 17 30 / .74) 48%, rgb(10 17 30 / .32)); }
  .vehicle-chat-hero-copy { padding-block: 2.6rem 4.7rem; }
  .vehicle-chat-hero p { max-width: 33ch; }
  .chat-mode-tabs { gap: .25rem; padding: .4rem; }
  .chat-mode-tab { min-height: 3.35rem; text-align: center; }
  .chat-mode-note { display: none; }
  .chat-search-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .chat-compare-scroll-hint { display: block; }
  .chat-transcript { max-height: 54vh; }
}

@media (max-width: 23rem) {
  .chat-mode-tab { padding-inline: .4rem; }
  .chat-mode-label { font-size: .82rem; }
  .chat-search-actions .button { width: 100%; }
}
