@import url("/tokens.css");

:root {
  color-scheme: dark;
  font-family: var(--font-body);
  --dealer-brand: var(--blue);
  --dealer-ink: var(--text);
  --dealer-muted: var(--muted);
  --dealer-line: var(--border);
  --dealer-surface: var(--surface);
  --dealer-soft: var(--bg-elev);
  --dealer-shadow: var(--shadow-md);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--dealer-ink);
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 44px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 141, 247, 0.25);
}

.vehicle-page {
  position: relative;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(7, 11, 20, 0.96) 0%, rgba(7, 11, 20, 0.78) 48%, rgba(7, 11, 20, 0.62) 100%),
    linear-gradient(180deg, rgba(7, 11, 20, 0.78) 0%, rgba(7, 11, 20, 0.54) 42%, rgba(7, 11, 20, 0.92) 100%),
    url("/assets/hanania-subaru-storefront.jpeg"),
    var(--bg);
  background-size: cover, cover, auto 120%;
  background-position: center, center, center bottom;
  display: flex;
  align-items: center;
  padding: var(--space-10);
  overflow: hidden;
}

.vehicle-page::before {
  content: "";
  position: absolute;
  inset: 0;
  width: auto;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(7, 11, 20, 0.72) 0%, rgba(7, 11, 20, 0.18) 28%, rgba(7, 11, 20, 0.10) 58%, rgba(7, 11, 20, 0.78) 100%),
    radial-gradient(45% 35% at 18% 18%, rgba(56, 217, 240, 0.12), transparent 70%),
    radial-gradient(40% 35% at 78% 78%, rgba(108, 99, 255, 0.10), transparent 72%);
  box-shadow: none;
  transform: none;
  opacity: 1;
}

.vehicle-page::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 12%;
  bottom: 13%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(234, 240, 250, 0.28), transparent);
  opacity: 0.7;
}

.hero {
  position: relative;
  z-index: 1;
  max-width: 640px;
  color: var(--text);
}

body:not(.embed-mode) .hero {
  display: none;
}

.eyebrow {
  margin: 0 0 var(--space-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(42px, 7vw, 82px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero p:not(.eyebrow) {
  max-width: 560px;
  margin: var(--space-6) 0;
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.primary-action,
.secondary-action {
  border-radius: var(--radius-sm);
  padding: 0 var(--space-5);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), filter var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.primary-action {
  border: 0;
  background: var(--grad-brand);
  color: var(--bg);
  box-shadow: var(--shadow-glow);
}

.secondary-action {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.primary-action:hover,
.secondary-action:hover {
  transform: translateY(-1px);
}

.primary-action:hover {
  filter: brightness(1.05);
}

.secondary-action:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
}

.agent-shell {
  position: fixed;
  inset: 28px 44px;
  z-index: 20;
  display: grid;
  min-width: 0;
  --chat-column: 780px;
  grid-template-rows: auto 1fr auto auto auto;
  background:
    linear-gradient(180deg, rgba(10, 16, 32, 0.98), rgba(7, 11, 20, 0.985)),
    var(--bg);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--blue) 28%, transparent),
    0 0 28px color-mix(in srgb, var(--cyan) 12%, transparent),
    0 0 64px color-mix(in srgb, var(--indigo) 16%, transparent),
    var(--dealer-shadow);
  overflow: hidden;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.agent-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  padding: 1px;
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--cyan) 64%, transparent),
      color-mix(in srgb, var(--blue) 24%, transparent) 38%,
      color-mix(in srgb, var(--indigo) 52%, transparent) 72%,
      color-mix(in srgb, var(--cyan) 34%, transparent));
  -webkit-mask:
    linear-gradient(var(--text) 0 0) content-box,
    linear-gradient(var(--text) 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.72;
}

.agent-shell::after {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: 0;
  pointer-events: none;
  border-radius: calc(var(--radius-lg) - 1px);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--text) 10%, transparent),
    inset 0 0 34px color-mix(in srgb, var(--blue) 5%, transparent);
}

.agent-shell > * {
  position: relative;
  z-index: 1;
}

.embed-mode {
  min-height: 100vh;
  background: transparent;
}

.embed-mode .vehicle-page {
  display: none;
}

.embed-mode .agent-shell {
  position: fixed;
  inset: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.embed-mode .agent-shell::before,
.embed-mode .agent-shell::after {
  display: none;
}

.embed-mode .agent-launcher {
  display: none;
}

.agent-is-collapsed .agent-shell {
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px) scale(0.98);
}

.agent-launcher {
  position: fixed;
  left: 50%;
  bottom: max(var(--space-5), env(safe-area-inset-bottom));
  z-index: 25;
  min-width: min(320px, calc(100vw - var(--space-8)));
  min-height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--bg-elev) 76%, transparent);
  color: var(--text);
  box-shadow: var(--shadow-glow);
  font-family: var(--font-display);
  font-weight: 800;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px) scale(0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.agent-launcher:hover {
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  border-color: var(--border-2);
  transform: translate(-50%, 8px) scale(0.98);
}

.agent-is-collapsed .agent-launcher {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
}

.agent-launcher-orb,
.agent-launcher-arrow {
  flex: none;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-pill);
}

.agent-launcher-orb {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 48% 42%, color-mix(in srgb, var(--text) 82%, transparent), color-mix(in srgb, var(--cyan) 72%, transparent) 20%, color-mix(in srgb, var(--blue) 75%, var(--bg)) 58%, var(--bg-elev) 100%);
  box-shadow: var(--shadow-glow);
}

.agent-launcher-orb::after {
  content: "";
  position: absolute;
  inset: 13px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--text) 72%, transparent);
  filter: blur(5px);
  opacity: 0.8;
}

.agent-launcher-wave {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.agent-launcher-wave span {
  width: 3px;
  height: 12px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  opacity: 0.72;
  box-shadow: 0 0 16px color-mix(in srgb, var(--text) 52%, transparent);
  animation: waveIdle 1.65s ease-in-out infinite;
}

.agent-launcher-wave span:nth-child(2) {
  height: 19px;
  animation-delay: -0.28s;
}

.agent-launcher-wave span:nth-child(3) {
  height: 26px;
  animation-delay: -0.52s;
}

.agent-launcher-wave span:nth-child(4) {
  height: 17px;
  animation-delay: -0.78s;
}

.agent-launcher-wave span:nth-child(5) {
  height: 22px;
  animation-delay: -1s;
}

.agent-launcher-label {
  flex: 1;
  color: var(--text);
  text-align: left;
  font-size: 15px;
  line-height: 1;
}

.agent-launcher-arrow {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 24px;
  line-height: 1;
}

.agent-header {
  min-height: 64px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-6);
  border-bottom: 1px solid var(--dealer-line);
}

.agent-header h2 {
  margin: 0;
  color: var(--text);
  text-align: center;
  font-size: 20px;
  line-height: 1.2;
}

.icon-button,
.send-button,
.voice-button {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), filter var(--dur-fast) var(--ease);
}

.icon-button:hover,
.send-button:hover,
.voice-button:hover {
  transform: translateY(-1px);
  background: var(--surface-2);
  border-color: var(--border-2);
}

.status-pill {
  justify-self: end;
  color: var(--cyan);
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  padding: var(--space-1) var(--space-3);
  font-size: 12px;
  font-weight: 700;
}

.agent-log {
  overflow: auto;
  min-width: 0;
  padding: 28px var(--space-5) 18px;
}

.message {
  display: grid;
  min-width: 0;
  width: min(var(--chat-column), 100%);
  gap: var(--space-3);
  margin: 0 auto var(--space-6);
}

.message.user {
  justify-items: end;
}

.message > .media-gallery,
.message > .inventory-qualifier,
.message > .official-360-card,
.message > .lead-card,
.message > .finance-card,
.message > .vehicle-results-carousel,
.message > .vehicle-result-toolbar,
.message > .vehicle-result-followups,
.message > .vehicle-compare-grid,
.message > .carfax-card {
  justify-self: center;
}

.message > .media-gallery {
  width: 100%;
}

.bubble {
  min-width: 0;
  max-width: 100%;
  line-height: 1.55;
  font-size: 17px;
  overflow-wrap: anywhere;
}

.user .bubble {
  max-width: 520px;
  padding: 13px var(--space-4);
  border: 1px solid var(--dealer-line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.assistant .bubble {
  color: var(--dealer-ink);
}

.component-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-4) 0 var(--space-3);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.media-row,
.trim-grid,
.vehicle-results-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 280px);
  gap: var(--space-3);
  width: 100%;
  max-width: var(--chat-column);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding-bottom: var(--space-2);
  scroll-snap-type: inline mandatory;
  scroll-padding-inline: var(--space-1);
  scrollbar-color: var(--border-2) transparent;
}

.media-row.is-single {
  justify-content: center;
}

.media-row.is-single.is-video-row {
  grid-auto-columns: minmax(360px, 520px);
}

.media-row.is-video-row {
  max-width: var(--chat-column);
  justify-content: center;
}

.media-card,
.vehicle-result-card,
.vehicle-compare-card,
.trim-card,
.finance-card,
.lead-card {
  min-width: 0;
  border: 1px solid var(--dealer-line);
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-md);
}

.vehicle-results-row {
  grid-auto-columns: minmax(260px, 320px);
}

.vehicle-results-carousel {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: var(--space-2);
  max-width: var(--chat-column);
  min-width: 0;
}

.vehicle-results-nav {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.vehicle-results-nav:hover {
  transform: translateY(-1px);
  background: var(--surface-2);
  border-color: var(--border-2);
}

.vehicle-result-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  min-width: 0;
  width: 100%;
  max-width: var(--chat-column);
  margin: calc(var(--space-2) * -1) 0 var(--space-3);
}

.vehicle-result-chip {
  min-height: 36px;
  border: 1px solid var(--dealer-line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--muted);
  padding: 0 var(--space-3);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.vehicle-result-chip:hover {
  transform: translateY(-1px);
  border-color: var(--border-2);
  color: var(--text);
}

.vehicle-result-chip.is-active {
  border-color: var(--border-2);
  background: var(--grad-brand);
  color: var(--bg);
}

.vehicle-result-card {
  display: block;
  color: var(--text);
  text-decoration: none;
  scroll-snap-align: start;
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.vehicle-result-card {
  cursor: pointer;
}

.vehicle-result-card:hover,
.vehicle-result-card.is-selected {
  transform: translateY(-2px);
  border-color: var(--border-2);
  background: var(--surface-2);
}

.vehicle-result-card.is-selected {
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--cyan) 46%, transparent),
    0 0 30px color-mix(in srgb, var(--blue) 18%, transparent),
    var(--shadow-md);
}

.vehicle-result-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: var(--bg-elev);
}

.vehicle-result-body {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
}

.vehicle-result-kicker {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.vehicle-result-card h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
}

.vehicle-result-card h3 a,
.vehicle-compare-card h3 a {
  color: inherit;
  text-decoration: none;
}

.vehicle-result-card h3 a:hover,
.vehicle-compare-card h3 a:hover {
  color: var(--cyan);
}

.vehicle-result-card strong {
  font-family: var(--font-display);
  font-size: 18px;
}

.vehicle-result-card p,
.vehicle-result-card small {
  margin: 0;
  color: var(--muted);
}

.vehicle-result-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.vehicle-result-actions button,
.vehicle-result-link {
  min-width: 0;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  padding: 0 var(--space-2);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.vehicle-result-actions .vehicle-select-button {
  border-color: transparent;
  background: var(--grad-brand);
  color: var(--bg);
  font-family: var(--font-display);
  font-weight: 800;
}

.vehicle-result-link {
  border-color: var(--border-2);
  color: var(--cyan);
}

.vehicle-result-actions button:hover,
.vehicle-result-link:hover {
  border-color: var(--border-2);
  filter: brightness(1.08);
}

.vehicle-result-followups {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  max-width: var(--chat-column);
  margin: var(--space-3) 0 0;
}

.vehicle-result-followups button {
  min-height: 40px;
  border: 1px solid var(--dealer-line);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text);
  padding: 0 var(--space-4);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.vehicle-result-followups button:hover {
  transform: translateY(-1px);
  border-color: var(--border-2);
  background: var(--surface);
}

.vehicle-result-empty {
  min-height: 150px;
  display: grid;
  place-items: center;
  padding: var(--space-4);
  color: var(--muted);
  text-align: center;
}

.inventory-qualifier {
  max-width: 760px;
}

.inventory-qualifier-card {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-5);
  border: 1px solid var(--dealer-line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.inventory-qualifier-card p {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
}

.inventory-qualifier-card strong {
  font-family: var(--font-display);
  font-size: 17px;
}

.inventory-qualifier-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.inventory-qualifier-options button {
  min-height: 40px;
  border: 1px solid var(--dealer-line);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text);
  padding: 0 var(--space-4);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.inventory-qualifier-options button:hover {
  transform: translateY(-1px);
  border-color: var(--border-2);
  background: var(--surface);
}

.vehicle-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: var(--space-3);
  max-width: 900px;
}

.vehicle-compare-card {
  min-width: 0;
}

.vehicle-compare-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: var(--bg-elev);
}

.vehicle-compare-body {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
}

.vehicle-compare-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.vehicle-compare-card strong {
  font-family: var(--font-display);
  font-size: 20px;
}

.vehicle-compare-card dl {
  display: grid;
  gap: var(--space-2);
  margin: 0;
}

.vehicle-compare-card dl div {
  display: grid;
  grid-template-columns: minmax(72px, 0.35fr) minmax(0, 1fr);
  gap: var(--space-2);
  align-items: start;
  min-width: 0;
  border-top: 1px solid var(--dealer-line);
  padding-top: var(--space-2);
}

.vehicle-compare-card dt,
.vehicle-compare-card dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.vehicle-compare-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.vehicle-compare-card dd {
  color: var(--text);
}

.carfax-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-4);
  align-items: center;
  max-width: 760px;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.carfax-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.25;
}

.carfax-card p {
  margin: var(--space-2) 0;
  color: var(--muted);
  line-height: 1.5;
}

.carfax-card small {
  color: var(--muted-2);
}

.carfax-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--grad-brand);
  color: var(--bg);
  padding: 0 var(--space-4);
  font-family: var(--font-display);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.official-360-card {
  width: min(var(--chat-column), 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.official-360-loading,
.official-360-empty {
  padding: var(--space-5);
  color: var(--muted);
}

.official-360-header {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
}

.official-360-header h3,
.official-360-header p {
  margin: 0;
}

.official-360-header h3 {
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.25;
}

.official-360-header p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.official-360-tabs,
.official-360-controls,
.official-360-options,
.official-360-swatches {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.official-360-tabs {
  justify-content: center;
  padding: var(--space-1) var(--space-2);
  background: var(--surface-2);
}

.official-360-tabs button,
.official-360-controls button,
.official-360-options button {
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  padding: 0 var(--space-3);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.official-360-tabs button:hover,
.official-360-controls button:hover,
.official-360-options button:hover {
  transform: translateY(-1px);
  border-color: var(--border-2);
  background: var(--surface-2);
}

.official-360-tabs button.is-active,
.official-360-options button.is-active {
  border-color: var(--border-2);
  background: var(--grad-brand);
  color: var(--bg);
}

.official-360-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 180px;
  background: var(--bg-elev);
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
}

.official-360-stage.is-combined {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.official-360-stage:active {
  cursor: grabbing;
}

.official-360-stage figure {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  margin: 0;
  background:
    radial-gradient(60% 70% at 50% 78%, color-mix(in srgb, var(--blue) 12%, transparent), transparent 70%),
    var(--bg-elev);
}

.official-360-stage img {
  width: 100%;
  height: clamp(140px, 22vh, 210px);
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.official-360-stage figcaption {
  position: absolute;
  left: var(--space-2);
  bottom: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--bg-elev) 82%, transparent);
  color: var(--text);
  padding: 2px var(--space-2);
  font-size: 11px;
  font-weight: 700;
}

.official-360-rotate {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--bg-elev) 72%, transparent);
  color: var(--text);
  padding: 2px var(--space-2);
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
}

.official-360-controls {
  justify-content: center;
  position: relative;
  z-index: 2;
  margin-top: -46px;
  padding: var(--space-1);
  border-top: 0;
  pointer-events: none;
}

.official-360-controls button {
  width: 38px;
  min-height: 38px;
  padding: 0;
  font-size: 26px;
  line-height: 1;
  pointer-events: auto;
}

.official-360-strip {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-2) var(--space-1);
}

.official-360-strip > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.official-360-options,
.official-360-swatches {
  min-width: 0;
  overflow-x: auto;
  padding-bottom: var(--space-1);
  scrollbar-color: var(--border-2) transparent;
}

.official-360-options button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 var(--space-2);
}

.official-360-swatches button {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  padding: 4px;
  cursor: pointer;
}

.official-360-swatches button span {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid var(--border-2);
  border-radius: inherit;
}

.official-360-swatches button.is-active {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 24%, transparent);
}

.media-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: var(--bg-elev);
}

.media-card video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: var(--bg-elev);
}

.media-card p {
  margin: 0;
  min-height: 48px;
  padding: 10px var(--space-3);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
}

.video-card-heading {
  display: grid;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--cyan) 10%, transparent), color-mix(in srgb, var(--indigo) 10%, transparent)),
    var(--bg-elev);
}

.video-card-heading strong {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.25;
}

.video-thumb {
  position: relative;
}

.video-duration,
.play-mark {
  position: absolute;
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--border-2);
}

.video-duration {
  right: var(--space-2);
  bottom: var(--space-2);
  border-radius: var(--radius-pill);
  padding: 3px var(--space-2);
  font-size: 12px;
}

.play-mark {
  left: 50%;
  top: 50%;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-pill);
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
}

.video-chapters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--surface-2);
}

.video-chapters button {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.video-chapters button:hover,
.video-chapters button:focus-visible {
  border-color: var(--border-2);
  background: var(--grad-brand);
  color: var(--bg);
  transform: translateY(-1px);
}

.tag-list {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding: var(--space-3);
}

.tag-list span,
.check {
  color: var(--success);
  font-size: 13px;
}

.tag-list span {
  border: 1px solid #34D39933;
  border-radius: var(--radius-pill);
  background: #34D39920;
  padding: var(--space-1) var(--space-2);
}

.trim-grid {
  grid-auto-columns: minmax(300px, 420px);
}

.trim-card {
  padding: var(--space-5);
}

.trim-card h3 {
  margin: 0 0 var(--space-3);
  font-size: 20px;
}

.trim-card .price {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.trim-card .desc {
  margin: 0 0 var(--space-3);
  color: var(--muted);
  font-size: 14px;
}

.trim-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--space-2);
}

.trim-card li {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
}

.finance-card {
  max-width: 540px;
  padding: var(--space-6);
}

.payment-number {
  margin: 0;
  font-family: var(--font-display);
  font-size: 38px;
  line-height: 1.1;
  text-align: center;
  font-weight: 800;
}

.payment-label {
  margin: var(--space-1) 0 var(--space-6);
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.slider-row {
  margin: var(--space-5) 0;
}

.slider-row label {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
  font-weight: 700;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--blue);
}

.range-ends {
  display: flex;
  justify-content: space-between;
  color: var(--dim);
  font-size: 12px;
}

.lead-card {
  width: min(var(--chat-column), 100%);
  max-width: var(--chat-column);
  padding: var(--space-4);
  display: grid;
  gap: var(--space-2);
}

.lead-card > span {
  color: var(--muted);
}

.lead-card input,
.lead-card select,
.lead-card textarea,
.composer input {
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  color-scheme: dark;
  outline: none;
  font: inherit;
}

.lead-card select {
  background-color: var(--bg-elev);
}

.lead-card select option {
  background: var(--bg-elev);
  color: var(--text);
}

.lead-card select option:checked {
  background: var(--blue);
  color: var(--bg);
}

.lead-card input,
.lead-card select {
  min-height: 40px;
  padding: 0 var(--space-3);
}

.lead-card textarea {
  min-height: 64px;
  resize: vertical;
  padding: var(--space-3);
}

.lead-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
}

.lead-card-toggle {
  min-height: 34px;
  display: flex;
  gap: var(--space-2);
  align-items: center;
  color: var(--text);
}

.lead-card-toggle input {
  width: 18px;
  height: 18px;
  min-height: 0;
}

.lead-card input::placeholder,
.lead-card textarea::placeholder,
.composer input::placeholder {
  color: var(--dim);
}

.lead-card button {
  min-height: 40px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--grad-brand);
  color: var(--bg);
  font-family: var(--font-display);
  font-weight: 700;
  cursor: pointer;
}

.quick-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px var(--space-4) var(--space-2);
  min-width: 0;
}

.quick-actions button {
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  padding: 0 var(--space-3);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.quick-actions button:hover {
  transform: translateY(-1px);
  background: var(--surface-2);
  border-color: var(--border-2);
}

.agent-shell:has(.official-360-card) .quick-actions {
  display: none;
}

.voice-status {
  min-height: 22px;
  margin: 0 auto var(--space-2);
  color: var(--cyan);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-shadow:
    0 0 12px color-mix(in srgb, var(--cyan) 44%, transparent),
    0 0 28px color-mix(in srgb, var(--blue) 26%, transparent);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.voice-status.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.voice-status::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: var(--space-2);
  border-radius: var(--radius-pill);
  background: currentColor;
  box-shadow: 0 0 14px currentColor;
  vertical-align: 1px;
  animation: voiceStatusPulse 1.35s ease-in-out infinite;
}

.voice-status[data-status="thinking"] {
  color: var(--amber);
}

.voice-status[data-status="speaking"] {
  color: var(--success);
}

.voice-status[data-status="watching"] {
  color: var(--blue);
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px 54px;
  align-items: center;
  gap: var(--space-3);
  max-width: 780px;
  width: calc(100% - 36px);
  margin: 0 auto;
}

.composer input {
  min-width: 0;
  height: 56px;
  border-radius: var(--radius-md);
  padding: 0 var(--space-4);
  font-size: 16px;
}

.send-button,
.voice-button {
  height: 48px;
  border-radius: var(--radius-pill);
}

.send-button {
  border: 0;
  background: var(--grad-brand);
  color: var(--bg);
  font-size: 24px;
  font-weight: 800;
}

.voice-button {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-2);
  box-shadow: inset 0 0 0 1px rgba(234, 240, 250, 0.02);
}

.voice-button.is-live {
  border-color: color-mix(in srgb, var(--success) 28%, transparent);
  background: color-mix(in srgb, var(--success) 12%, transparent);
  animation: voicePulse 1.4s ease-in-out infinite;
}

.voice-button.is-muted {
  border-color: color-mix(in srgb, var(--amber) 30%, transparent);
  background: color-mix(in srgb, var(--amber) 10%, transparent);
}

.voice-button .voice-wave {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  pointer-events: none;
}

.voice-button .voice-wave span {
  width: 3px;
  height: 12px;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, var(--cyan), var(--blue));
  opacity: 0.72;
  box-shadow: 0 0 18px color-mix(in srgb, var(--cyan) 24%, transparent);
  animation: waveIdle 1.65s ease-in-out infinite;
}

.voice-button .voice-wave span:nth-child(2) {
  height: 20px;
  animation-delay: -0.28s;
}

.voice-button .voice-wave span:nth-child(3) {
  height: 28px;
  animation-delay: -0.52s;
}

.voice-button .voice-wave span:nth-child(4) {
  height: 18px;
  animation-delay: -0.78s;
}

.voice-button .voice-wave span:nth-child(5) {
  height: 24px;
  animation-delay: -1s;
}

.voice-button.is-live .voice-wave span {
  background: var(--success);
  box-shadow: 0 0 18px color-mix(in srgb, var(--success) 28%, transparent);
}

.voice-button .voice-mic {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: color-mix(in srgb, var(--text) 72%, transparent);
  opacity: 0.68;
  pointer-events: none;
}

.voice-button .voice-mic svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--cyan) 24%, transparent));
}

.voice-button.is-live .voice-mic {
  color: color-mix(in srgb, var(--success) 78%, var(--text));
  opacity: 0.78;
}

.voice-button.is-muted .voice-mic {
  color: color-mix(in srgb, var(--amber) 72%, var(--text));
  opacity: 0.72;
}

@keyframes waveIdle {
  0%,
  100% {
    transform: scaleY(0.45);
    opacity: 0.42;
  }

  50% {
    transform: scaleY(1);
    opacity: 0.94;
  }
}

@keyframes voicePulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 24%, transparent);
  }

  50% {
    box-shadow: 0 0 0 8px transparent;
  }
}

@keyframes voiceStatusPulse {
  0%,
  100% {
    opacity: 0.42;
    transform: scale(0.82);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.consent-copy,
.disclaimer {
  margin: var(--space-2) auto 0;
  max-width: 760px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.disclaimer {
  margin-bottom: var(--space-4);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .primary-action:hover,
  .secondary-action:hover,
  .icon-button:hover,
  .send-button:hover,
  .voice-button:hover,
  .quick-actions button:hover,
  .vehicle-result-card[href]:hover,
  .vehicle-results-nav:hover,
  .vehicle-result-chip:hover,
  .vehicle-result-followups button:hover {
    transform: none;
  }

  .voice-wave span,
  .agent-launcher-wave span,
  .voice-status::before,
  .voice-button.is-live {
    animation: none;
  }
}

@media (max-width: 760px) {
  body {
    min-width: 0;
  }

  .vehicle-page {
    padding: var(--space-6);
  }

  .agent-shell {
    inset: var(--space-2);
    width: auto;
    max-width: calc(100vw - var(--space-4));
    max-height: calc(100dvh - var(--space-4));
    border-radius: var(--radius-md);
  }

  .agent-launcher {
    bottom: max(var(--space-3), env(safe-area-inset-bottom));
    min-width: min(312px, calc(100vw - var(--space-6)));
    min-height: 60px;
  }

  .agent-launcher-orb,
  .agent-launcher-arrow {
    width: 44px;
    height: 44px;
  }

  .agent-header {
    grid-template-columns: 44px minmax(0, 1fr);
    min-width: 0;
    min-height: 56px;
    padding: 0 var(--space-3);
  }

  .status-pill {
    display: none;
  }

  .agent-header h2 {
    min-width: 0;
    font-family: var(--font-body);
    font-size: clamp(15px, 4.2vw, 18px);
    font-weight: 600;
    line-height: 1.22;
    overflow-wrap: anywhere;
  }

  .agent-log {
    padding: var(--space-3) var(--space-3);
  }

  .bubble {
    max-width: 100%;
    font-size: 15px;
  }

  .component-title {
    font-size: 16px;
  }

  .vehicle-result-toolbar {
    max-width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: var(--space-1);
  }

  .vehicle-result-chip {
    flex: 0 0 auto;
  }

  .vehicle-results-carousel {
    grid-template-columns: minmax(0, 1fr);
    max-width: calc(100vw - 42px);
  }

  .vehicle-results-nav {
    display: none;
  }

  .quick-actions {
    display: none;
  }

  .composer {
    grid-template-columns: minmax(0, 1fr) 44px 44px;
    gap: var(--space-2);
    width: calc(100% - 24px);
  }

  .composer input {
    height: 52px;
    padding-inline: var(--space-3);
  }

  .send-button,
  .voice-button {
    height: 44px;
    min-width: 44px;
  }

  .consent-copy,
  .disclaimer {
    display: none;
  }

  .media-row,
  .trim-grid,
  .vehicle-results-row {
    display: flex;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    gap: var(--space-2);
  }

  .official-360-header {
    padding: var(--space-3);
  }

  .official-360-header h3 {
    font-size: 16px;
  }

  .official-360-tabs {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .official-360-tabs button {
    flex: 0 0 auto;
  }

  .official-360-stage,
  .official-360-stage.is-combined {
    grid-template-columns: minmax(0, 1fr);
    min-height: 190px;
  }

  .official-360-stage img {
    height: min(220px, 32vh);
  }

  .official-360-strip {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-2);
    padding-inline: var(--space-3);
  }

  .official-360-rotate {
    top: auto;
    bottom: var(--space-3);
    white-space: nowrap;
  }

  .media-row.is-single {
    justify-content: flex-start;
  }

  .media-row.is-video-row {
    justify-content: flex-start;
  }

  .media-card,
  .trim-card,
  .vehicle-result-card {
    flex: 0 0 min(292px, 82vw);
    width: min(292px, 82vw);
  }

  .is-video-row .media-card {
    flex-basis: min(340px, 92vw);
    width: min(340px, 92vw);
  }

  .vehicle-result-body {
    padding: var(--space-3);
  }

  .vehicle-result-card h3,
  .vehicle-result-card strong {
    font-size: 16px;
  }

  .vehicle-result-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vehicle-result-actions button,
  .vehicle-result-link {
    padding-inline: var(--space-2);
  }

  .inventory-qualifier {
    max-width: 100%;
  }

  .inventory-qualifier-card {
    padding: var(--space-4);
  }

  .inventory-qualifier-options {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: var(--space-1);
  }

  .inventory-qualifier-options button {
    flex: 0 0 auto;
  }

  .vehicle-compare-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .carfax-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .carfax-link {
    width: 100%;
  }

  .lead-card-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
