/* car-search.ai home: the feature carousel (the gallery from the dealer websites we build) on the left, the guide
   (the chat from the Try page) docked on the right, a draggable divider between them. Phone: stacked. */
@font-face { font-family: 'Space Grotesk'; src: url('/fonts/SpaceGrotesk/SpaceGrotesk-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url('/fonts/SpaceGrotesk/SpaceGrotesk-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('/fonts/DMSans/DMSans_18pt-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('/fonts/DMSans/DMSans-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }

:root {
  --presenter-bg: #d2cbcb;   /* the background her takes were made on (the raw clips play, no cut-out) */
  --bg: #141414; --surface: #1e1e1e; --surface-2: #252525; --surface-3: #2a2a2a; --line: #383838; --line-2: rgba(255, 255, 255, .12);
  --fg: #ffffff; --fg-2: #e0e0e0; --fg-3: #9a9a9a; --fg-4: #666;
  --accent: #EC660A; --accent-deep: #d45a08; --teal: #38B6A3; --on-accent: #ffffff;
  --overlay: rgba(20, 20, 20, .72); --shadow: 0 12px 48px rgba(0, 0, 0, .45);
  --chat-w: 35%; --divider-w: 10px; --bar-h: 60px;
  --head: 'Space Grotesk', system-ui, sans-serif; --body: 'DM Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { height: 100%; background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; height: 100%; color: var(--fg); font: 400 16px/1.5 var(--body); background: var(--bg); display: flex; flex-direction: column; overflow: hidden; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* bar */
.bar { flex: none; height: var(--bar-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand img { height: 34px; width: auto; }
.bar-links { display: flex; align-items: center; gap: 18px; }
.bar-links a { color: var(--fg-2); text-decoration: none; font-weight: 500; font-size: 15px; }
.bar-links a:hover { color: var(--fg); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 10px; border: 1px solid transparent; font: 500 15px var(--body); cursor: pointer; color: var(--on-accent); background: var(--accent); text-decoration: none; }
.btn:hover { background: var(--accent-deep); }
.btn:focus-visible, .tool:focus-visible, .gallery-nav button:focus-visible, .thumbs button:focus-visible, .pill:focus-visible, .divider:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.btn-bar { min-height: 38px; padding: 8px 16px; }

/* the split */
.split { flex: 1; min-height: 0; display: flex; position: relative; }

/* the welcome: covers the split until Start here is clicked */
.welcome { position: absolute; inset: 0; z-index: 20; display: flex; background: var(--bg); opacity: 1; transition: opacity .6s ease; }
.welcome.is-leaving { opacity: 0; pointer-events: none; }
.welcome-visual { flex: 1 1 auto; min-width: 0; position: relative; overflow: hidden; }
.welcome-visual canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; cursor: crosshair; }
.welcome-brand { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 40px; pointer-events: none; text-align: center; }
.welcome-brand img { width: min(560px, 70%); height: auto; filter: drop-shadow(0 0 28px rgba(0, 0, 0, .9)) drop-shadow(0 0 60px rgba(0, 0, 0, .7)); animation: welcome-in 1.1s ease both; }
.welcome-side { flex: none; width: var(--chat-w); min-width: 300px; max-width: 65%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 40px 28px; background: var(--surface); border-left: 1px solid var(--line); text-align: center; }
.welcome-kicker { margin: 0; font: 500 13px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--teal); }
.start { min-height: 92px; width: min(100%, 360px); padding: 22px 36px; border: 0; border-radius: 18px; font: 700 clamp(26px, 2.4vw, 34px)/1 var(--head); color: var(--on-accent); background: var(--accent); cursor: pointer; box-shadow: 0 0 0 0 rgba(236, 102, 10, .55); animation: start-pulse 2.4s ease-out infinite; transition: transform .15s, background .15s; }
.start:hover { background: var(--accent-deep); transform: translateY(-2px); }
.start:focus-visible { outline: 3px solid var(--teal); outline-offset: 4px; }
.welcome-note { margin: 0; color: var(--fg-3); font: 500 15px var(--body); letter-spacing: .02em; }
@keyframes welcome-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes start-pulse { 0% { box-shadow: 0 0 0 0 rgba(236, 102, 10, .55); } 70% { box-shadow: 0 0 0 22px rgba(236, 102, 10, 0); } 100% { box-shadow: 0 0 0 0 rgba(236, 102, 10, 0); } }
.show { flex: 1 1 auto; min-width: 0; min-height: 0; overflow: hidden; padding: 20px 26px 20px; display: flex; flex-direction: column; gap: 14px; }
.divider { flex: none; width: var(--divider-w); cursor: col-resize; display: flex; align-items: center; justify-content: center; background: var(--surface); border-left: 1px solid var(--line); border-right: 1px solid var(--line); touch-action: none; user-select: none; }
.divider span { width: 3px; height: 44px; border-radius: 2px; background: var(--line); }
.divider:hover span, .divider.dragging span { background: var(--accent); }
.chat { flex: none; width: var(--chat-w); min-width: 300px; max-width: 65%; min-height: 0; display: flex; flex-direction: column; background: var(--surface); border-top: 2px solid var(--accent); }
body.dragging { cursor: col-resize; user-select: none; }
body.dragging .show, body.dragging .chat { pointer-events: none; }

/* the gallery (the dealer website's) */
/* the picture is sized to the room: never taller than the screen leaves it, so the panel never scrolls */
.gallery { position: relative; min-width: 0; width: min(100%, calc((100dvh - var(--bar-h) - 250px) * 16 / 9)); margin: 0 auto; }
.gallery-main { margin: 0; overflow: hidden; background: var(--surface); aspect-ratio: 16 / 9; position: relative; border-radius: 12px; box-shadow: var(--shadow); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; transition: opacity .15s ease; }
.gallery.is-loading .gallery-main img { opacity: .55; }
.gallery-main figcaption { position: absolute; right: 10px; bottom: 10px; background: var(--overlay); color: var(--fg); font-size: 13px; padding: 4px 9px; letter-spacing: .02em; border-radius: 6px; }
.gallery-nav button { position: absolute; top: calc(50% - 22px); width: 44px; height: 44px; background: var(--overlay); color: var(--fg); display: flex; align-items: center; justify-content: center; border: 0; cursor: pointer; z-index: 2; padding: 0; }
.gallery-nav button svg { width: 26px; height: 26px; }
.gallery-prev { left: 0; border-radius: 0 8px 8px 0; } .gallery-next { right: 0; border-radius: 8px 0 0 8px; }
.gallery-nav button[hidden] { display: none; }
.gallery-nav button:hover { background: var(--accent); }
.thumbs { list-style: none; margin: 8px 0 0; padding: 0; display: flex; gap: 6px; overflow-x: auto; max-width: 100%; scroll-snap-type: x mandatory; scrollbar-width: none; }
.thumbs::-webkit-scrollbar { display: none; }
.thumbs li { flex: 0 0 104px; scroll-snap-align: start; }
.thumbs button { display: block; width: 100%; padding: 0; overflow: hidden; border: 2px solid transparent; background: var(--surface); cursor: pointer; border-radius: 6px; }
.thumbs li.current button { border-color: var(--accent); }
.thumbs img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.thumb-text { display: grid; place-items: center; aspect-ratio: 16 / 9; padding: 6px; font: 500 12px/1.2 var(--body); color: var(--fg-2); text-align: center; }
.gallery-main video { display: none; width: 100%; height: 100%; object-fit: cover; }
.gallery.is-video .gallery-main video { display: block; }
.gallery-main video { transition: opacity .35s ease; }
.gallery-main video.is-fading { opacity: 0; }
.gallery.is-video .gallery-main img { display: none; }
.gallery.is-form .gallery-main img, .gallery.is-form figcaption { display: none; }
.gallery.is-form .gallery-main { aspect-ratio: auto; min-height: 0; }

/* the form on the Talk to us slide */
.talk { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; padding: 28px; }
.talk[hidden] { display: none; }
.talk h2 { grid-column: 1 / -1; margin: 0 0 4px; font: 700 clamp(24px, 2.6vw, 34px)/1.1 var(--head); letter-spacing: -.02em; }
.talk label { display: grid; gap: 5px; font-size: 13px; color: var(--fg-3); }
.talk .wide, .talk-foot, .talk .note { grid-column: 1 / -1; }
.talk input, .talk textarea { font: inherit; font-size: 16px; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-3); color: var(--fg); width: 100%; }
.talk input:focus, .talk textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.talk-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.form-msg { color: var(--fg-3); font-size: 14px; }
.talk .note { margin: 0; color: var(--fg-4); font-size: 14px; }
.talk .note a { color: var(--fg-3); }

/* the feature under the gallery */
.feature { display: grid; gap: 4px; width: min(100%, calc((100dvh - var(--bar-h) - 250px) * 16 / 9)); margin: 0 auto; }
.kicker { margin: 0; font: 700 12px/1 var(--head); letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.feature h1 { margin: 0; font: 700 clamp(22px, 2.4vw, 34px)/1.15 var(--head); letter-spacing: -.02em; }
.fscript { margin: 2px 0 0; color: var(--fg-2); font-size: 15px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* the chat (the Try page widget, docked) */
.chat-tools { display: flex; gap: 6px; }
.tool { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--fg-2); display: grid; place-items: center; cursor: pointer; }
.tool[aria-pressed="true"] { color: var(--teal); border-color: var(--teal); }
.tool:hover { background: var(--surface-3); }
.tool-text { width: auto; padding: 0 14px; font: 500 14px var(--body); }
.tool-text[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
/* the presenter panel: the face above the messages, extended by dragging its grip (owner 2026-10-14) */
.presenter { position: relative; flex: none; height: var(--presenter-h, 380px); min-height: 96px; max-height: 70vh; background: var(--presenter-bg); border-bottom: 1px solid var(--line); overflow: hidden; }
.presenter[hidden] { display: none; }
.presenter { transition: height 0.7s ease; }
body.presenting .presenter { max-height: none; }   /* while she presents the panel is the whole column; the explicit height is set by the script */
body.presenting .presenter canvas { object-fit: contain; object-position: center top; }
body.presenting .presenter-grip, body.presenting .chat-body, body.presenting .chat-chips { display: none; }   /* the text box stays under her (owner 2026-10-14: "there is no way to do the chat input") */
.presenter canvas { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; }
.presenter-grip { position: absolute; left: 0; right: 0; bottom: 0; height: 14px; cursor: ns-resize; display: flex; align-items: center; justify-content: center; touch-action: none; }
.presenter-grip span { width: 44px; height: 4px; border-radius: 2px; background: var(--line); }
.presenter-grip:hover span, .presenter-grip:focus-visible span, .presenter-grip.dragging span { background: var(--accent); }
.presenter-grip:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.chat-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.chat-body::-webkit-scrollbar { width: 6px; }
.chat-body::-webkit-scrollbar-track { background: transparent; }
.chat-body::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.chat-body::-webkit-scrollbar-thumb:hover { background: var(--fg-4); }
.messages { display: flex; flex-direction: column; gap: 12px; }
.message { display: flex; gap: 10px; max-width: 100%; animation: slideIn .3s ease; }
.message[hidden] { display: none; }   /* a reply waiting for her first words */
.message.user { flex-direction: row-reverse; }
.message-avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font: 700 12px var(--head); }
.message.user .message-avatar { background: var(--surface-3); color: var(--fg-2); }
.message-content { min-width: 0; max-width: 85%; background: var(--surface-3); color: var(--fg-2); padding: 12px 16px; border-radius: 12px; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); line-height: 1.55; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.user .message-content { background: var(--accent); color: var(--on-accent); }
.message.thinking .message-content { color: var(--fg-3); }
.message.thinking .message-content::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.2s steps(4, end) infinite; }
.message.speaking .message-avatar { box-shadow: 0 0 0 3px rgba(56, 182, 163, .45); }
@keyframes slideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.chat-foot { flex: none; padding: 10px 16px 12px; background: var(--surface-2); border-top: 1px solid var(--line); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.pills:empty { display: none; }
.message.assistant { flex-wrap: wrap; }
.message-pills { flex-basis: 100%; margin: 2px 0 0 42px; }   /* the AI's own choices, under its reply */
.pill { background: var(--surface); border: 1px solid var(--accent); color: var(--fg); padding: 9px 14px; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 500; text-align: left; transition: background .2s, transform .2s; }
.pill:hover { background: var(--accent); color: var(--on-accent); transform: translateX(3px); }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-input { flex: 1; min-height: 44px; max-height: 140px; resize: none; scrollbar-width: none; overflow-y: auto; border: 1.5px solid var(--line); border-radius: 22px; padding: 11px 16px; font: 400 16px/1.4 var(--body); color: var(--fg); background: var(--surface); }
.chat-input:focus { outline: none; border-color: var(--accent); }
.chat-input::placeholder { color: var(--fg-4); }
.chat-input::-webkit-scrollbar { display: none; }
.chat-send { flex: none; width: 44px; height: 44px; border-radius: 22px; border: 0; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; cursor: pointer; }
.chat-send:hover:not(:disabled) { background: var(--accent-deep); }
.chat-send:disabled { opacity: .4; cursor: not-allowed; }
.chat-brand { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--fg-3); }
.chat-who { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.chat-logo { height: 24px; width: auto; }
.status { font: 500 13px var(--body); color: var(--fg-2); white-space: nowrap; }
.status { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* phone and narrow screens: stacked */
@media (max-width: 860px) {
  :root { --bar-h: 54px; }
  .bar { padding: 0 14px; }
  .brand img { height: 28px; }
  .bar-links a { display: none; }
  .split { flex-direction: column; }
  /* owner 2026-10-15: on phones the slide (the closing form too) keeps to the top half and never more, scrolling inside it;
     the chat takes the bottom half and covers her picture once the talk turns to chat */
  .show { flex: none; max-height: calc((100dvh - var(--bar-h)) / 2); min-height: 0; overflow: hidden; padding: 0 0 8px; gap: 8px; }
  .gallery { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; }
  .gallery-main { flex: 0 1 auto; min-height: 0; }
  .thumbs, .feature { flex: none; }
  .gallery.is-form .gallery-main { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .gallery, .feature { width: 100%; }
  .gallery-main { border-radius: 0; box-shadow: none; }
  .thumbs { margin: 0; padding: 6px 12px; } .thumbs li { flex-basis: 88px; }
  .gallery-main figcaption { top: 8px; right: 8px; bottom: auto; font-size: 12px; }
  .feature { padding: 0 14px; gap: 2px; }
  .feature h1 { font-size: 19px; }
  .fscript { display: none; }
  .divider { display: none; }
  .welcome { flex-direction: column; }
  .welcome-visual { flex: 1 1 auto; }
  .welcome-brand img { width: min(320px, 78%); }
  .welcome-side { width: auto; max-width: none; min-width: 0; flex: none; padding: 26px 20px; padding-bottom: max(26px, env(safe-area-inset-bottom)); border-left: 0; border-top: 1px solid var(--line); gap: 14px; }
  .start { min-height: 72px; }
  .chat { width: auto; max-width: none; min-width: 0; flex: 1 1 0; min-height: 0; position: relative; border-top: 1px solid var(--line); }
  body:not(.presenting) .presenter { position: absolute; inset: 0; height: auto; max-height: none; z-index: 0; border-bottom: 0; }
  .chat > :not(.presenter) { position: relative; z-index: 1; }
  .chat-body { background: var(--surface); }
  .chat-body { padding: 12px; }
  .chat-foot { padding: 8px 12px 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .chat-logo { height: 22px; } .status { display: none; }
  .message-content { max-width: 90%; }
  .talk { grid-template-columns: 1fr; padding: 18px 14px; }
  .talk-foot .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .start, .welcome-brand img { animation: none; } .welcome { transition: none; } .message { animation: none; } .chat-body { scroll-behavior: auto; } .pill { transition: none; } }

.model-stats { position: fixed; left: 8px; bottom: 8px; z-index: 50; max-width: calc(100vw - 16px); padding: 4px 8px; border-radius: 6px; background: var(--overlay); color: var(--fg-2); font: 12px/1.3 ui-monospace, monospace; pointer-events: none; }   /* ?stats=1: the browser model's numbers (testing) */
