/* ============================================================
   BENZOL — Smart Finder + Assistant  (scoped styles)
   Uses the site design tokens from site.css.
   ============================================================ */

/* ---------- shared shell ---------- */
.tool{max-width:880px;margin:0 auto;border:1px solid var(--line);border-radius:24px;
  background:radial-gradient(120% 90% at 50% 0%,#141018,#080809);
  padding:clamp(22px,3.4vw,40px);position:relative;overflow:hidden}
.tool + .tool{margin-top:26px}

/* ---------- mode tabs ---------- */
.fmodes{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:26px}
.fmode{padding:10px 18px;border:1px solid var(--line);border-radius:100px;color:var(--muted);
  font-size:13.5px;font-family:var(--body);background:var(--ink-2);cursor:pointer;transition:.25s;
  display:inline-flex;align-items:center;gap:8px}
.fmode svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:1.8}
.fmode:hover{border-color:var(--line-2);color:var(--text)}
.fmode.on{border-color:var(--gold);color:var(--text);background:rgba(220,175,80,.08)}

/* ---------- search row ---------- */
.fsearch{display:flex;gap:10px;align-items:stretch}
.fsearch .field{flex:1;display:flex;align-items:center;gap:12px;background:var(--ink-2);
  border:1px solid var(--line);border-radius:14px;padding:0 16px;transition:border-color .25s}
.fsearch .field:focus-within{border-color:var(--gold)}
.fsearch .field svg{width:18px;height:18px;stroke:var(--faint);fill:none;stroke-width:1.8;flex:0 0 auto}
.fsearch input{flex:1;background:none;border:0;outline:0;color:var(--text);font-family:var(--body);
  font-size:15px;padding:15px 0}
.fsearch input::placeholder{color:var(--faint)}
.flabel{font-family:var(--disp);font-size:13px;color:var(--muted);margin-bottom:12px;display:block}

/* quick example chips under the search */
.fex{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}
.fex button{font-family:var(--body);font-size:12.5px;color:var(--faint);background:transparent;
  border:1px dashed var(--line-2);border-radius:100px;padding:7px 13px;cursor:pointer;transition:.2s}
.fex button:hover{color:var(--gold);border-color:var(--gold)}

/* ---------- endpoint / tool trace (sells the "real API" story) ---------- */
.ftrace{margin-top:20px;font-family:var(--body);font-size:12px;color:var(--faint);
  display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-height:20px}
.ftrace .dot{width:7px;height:7px;border-radius:50%;background:var(--gold);
  box-shadow:0 0 10px var(--gold);animation:fpulse 1s var(--ease) infinite}
.ftrace code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px;
  color:var(--muted);background:var(--ink-3);border:1px solid var(--line);border-radius:6px;padding:3px 8px}
@keyframes fpulse{0%,100%{opacity:.4}50%{opacity:1}}

/* ---------- result cards ---------- */
.fresults{margin-top:24px;display:grid;gap:14px}
.fcard{display:flex;gap:20px;align-items:center;border:1px solid var(--line);border-radius:18px;
  background:linear-gradient(180deg,var(--ink-soft),#080809);padding:16px;
  opacity:0;transform:translateY(12px);animation:fcin .5s var(--ease) forwards}
@keyframes fcin{to{opacity:1;transform:none}}
.fcard .fimg{width:104px;height:104px;flex:0 0 auto;border-radius:12px;overflow:hidden;
  border:1px solid var(--line);background:#050506}
.fcard .fimg img{width:100%;height:100%;object-fit:cover}
.fcard .fbody{flex:1;min-width:0}
.fcard .fvisc{font-family:var(--pack);font-weight:700;font-size:30px;line-height:1;letter-spacing:.01em}
.fcard .fname{font-family:var(--disp);font-size:15px;margin-top:3px}
.fcard .freason{color:var(--muted);font-size:13px;margin-top:8px;line-height:1.5}
.fanchor{display:inline-flex;align-items:center;gap:7px;margin-top:10px;font-family:var(--disp);
  font-size:11px;letter-spacing:.06em;color:var(--gold);border:1px solid rgba(220,175,80,.35);
  border-radius:100px;padding:5px 11px;background:rgba(220,175,80,.06)}
.fcard .factions{display:flex;gap:9px;margin-top:15px;flex-wrap:wrap}
.fcard .factions .btn{font-size:13px;padding:11px 17px}
.fempty{color:var(--faint);font-size:14px;margin-top:22px}

/* ============================================================
   ASSISTANT CHAT
   ============================================================ */
.chat{display:flex;flex-direction:column;height:min(560px,72vh)}
.chat-head{display:flex;align-items:center;gap:11px;padding-bottom:16px;border-bottom:1px solid var(--line)}
.chat-head .ava{width:30px;height:30px;border-radius:8px;display:grid;place-items:center;
  background:var(--metal);color:#120d02;font-family:var(--disp);font-weight:700;font-size:15px;flex:0 0 auto}
.chat-head b{font-family:var(--disp);font-size:14px;font-weight:600}
.chat-head small{color:var(--faint);font-size:12px}
.chat-head .live{margin-left:auto;display:inline-flex;align-items:center;gap:7px;font-size:11px;color:var(--muted)}
.chat-head .live i{width:7px;height:7px;border-radius:50%;background:#4ad07a;box-shadow:0 0 9px #4ad07a}

.chat-log{flex:1;overflow-y:auto;padding:20px 4px;display:flex;flex-direction:column;gap:14px;scrollbar-width:thin}
.chat-log::-webkit-scrollbar{width:6px}.chat-log::-webkit-scrollbar-thumb{background:var(--line-2);border-radius:100px}

.msg{max-width:82%;padding:13px 16px;border-radius:16px;font-size:14.5px;line-height:1.55;
  animation:msgin .35s var(--ease)}
@keyframes msgin{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.msg.user{align-self:flex-end;background:var(--metal);color:#120d02;border-bottom-right-radius:5px;font-weight:500}
.msg.bot{align-self:flex-start;background:var(--ink-3);border:1px solid var(--line);border-bottom-left-radius:5px}

/* typing dots */
.typing{align-self:flex-start;display:inline-flex;gap:5px;padding:15px 17px;background:var(--ink-3);
  border:1px solid var(--line);border-radius:16px;border-bottom-left-radius:5px}
.typing i{width:7px;height:7px;border-radius:50%;background:var(--faint);animation:tping 1.2s infinite}
.typing i:nth-child(2){animation-delay:.18s}.typing i:nth-child(3){animation-delay:.36s}
@keyframes tping{0%,60%,100%{opacity:.3;transform:translateY(0)}30%{opacity:1;transform:translateY(-4px)}}

/* tool-call trace inside a bot message */
.worktrace{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:2px 0 6px;
  font-size:11px;color:var(--faint);font-family:var(--disp);letter-spacing:.04em}
.worktrace .tchip{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line);
  border-radius:100px;padding:4px 10px;color:var(--muted);opacity:.4;transform:scale(.96);
  transition:.35s var(--ease)}
.worktrace .tchip.done{opacity:1;transform:none;border-color:rgba(220,175,80,.4);color:var(--text)}
.worktrace .tchip svg{width:12px;height:12px;stroke:var(--gold);fill:none;stroke-width:2.2}

/* product card inside a bot message */
.msg .fcard{max-width:none;margin-top:10px;background:var(--ink-soft)}
.msg .fcard .fimg{width:76px;height:76px}
.msg .fcard .fvisc{font-size:24px}

/* quick-reply buttons the bot offers */
.quicks{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.quicks button{font-family:var(--body);font-size:13px;color:var(--text);background:var(--ink-2);
  border:1px solid var(--line-2);border-radius:100px;padding:8px 15px;cursor:pointer;transition:.2s}
.quicks button:hover{border-color:var(--gold);color:var(--gold)}

/* composer */
.chat-in{display:flex;gap:10px;align-items:center;padding-top:16px;border-top:1px solid var(--line)}
.chat-in .field{flex:1;display:flex;align-items:center;background:var(--ink-2);border:1px solid var(--line);
  border-radius:100px;padding:0 6px 0 18px;transition:border-color .25s}
.chat-in .field:focus-within{border-color:var(--gold)}
.chat-in input{flex:1;background:none;border:0;outline:0;color:var(--text);font-family:var(--body);
  font-size:14.5px;padding:14px 0}
.chat-in input::placeholder{color:var(--faint)}
.chat-in .send{width:42px;height:42px;flex:0 0 auto;border:0;border-radius:50%;background:var(--action-gold);
  color:#120d02;cursor:pointer;display:grid;place-items:center;transition:transform .2s}
.chat-in .send:hover{transform:none}
.chat-in .send svg{width:18px;height:18px;stroke:#120d02;fill:none;stroke-width:2.4}

/* demo-mode note under the chat header (only when answers come from the built-in rule set) */
.chat-note{font-size:11.5px;color:var(--faint);padding:8px 0 0;letter-spacing:.02em}
.chat-note[hidden]{display:none}

/* datasheet links inside a card */
.fdocs{display:flex;gap:14px;margin-top:11px;flex-wrap:wrap}
.fdoc{font-family:var(--disp);font-size:11.5px;letter-spacing:.04em;color:var(--muted);text-decoration:none;
  border-bottom:1px dashed var(--line-2);padding-bottom:1px;transition:.2s}
.fdoc:hover{color:var(--gold);border-color:var(--gold)}

/* finder-mode chips offered when an answer has no product */
.quicks.jumps button,.quicks a.jump{display:inline-block;font-family:var(--body);font-size:13px;color:var(--muted);
  background:var(--ink-2);border:1px dashed var(--line-2);border-radius:100px;padding:8px 15px;cursor:pointer;
  text-decoration:none;transition:.2s}
.quicks.jumps button:hover,.quicks a.jump:hover{border-color:var(--gold);color:var(--gold)}
.quicks button[data-act=enquiry]{border-color:rgba(220,175,80,.5);color:var(--gold)}

/* inline "Ask a distributor" form inside a bot message */
.chat-form{margin-top:12px;border:1px solid var(--line);border-radius:14px;padding:14px;background:var(--ink-2);
  display:grid;gap:10px;position:relative}
.cf-title{font-family:var(--disp);font-size:13.5px}
.cf-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.cf-grid input{min-width:0;background:var(--ink-3);border:1px solid var(--line);border-radius:10px;padding:10px 12px;
  color:var(--text);font-family:var(--body);font-size:13.5px;outline:0}
.cf-grid input:focus{border-color:var(--gold)}
.cf-row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.cf-row .btn{font-size:13px;padding:10px 16px}
.cf-cancel{background:none;border:0;color:var(--muted);font-family:var(--body);font-size:13px;cursor:pointer}
.cf-msg{font-size:13px;color:var(--muted);margin:0}
.cf-msg:empty{display:none}
.cf-msg a{color:var(--gold)}
.cf-fine{font-size:11px;color:var(--faint);margin:0;line-height:1.45}
@media (max-width:560px){.cf-grid{grid-template-columns:1fr}}

/* seed prompts (before the chat starts) */
.seed{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:4px}
.seed button{text-align:left;font-family:var(--body);font-size:13px;color:var(--muted);
  background:var(--ink-2);border:1px solid var(--line);border-radius:12px;padding:11px 14px;
  cursor:pointer;transition:.22s}
.seed button:hover{border-color:var(--gold);color:var(--text);transform:none}

@media (max-width:560px){
  .fcard{flex-direction:column;align-items:flex-start;text-align:left}
  .fcard .fimg{width:88px;height:88px}
  .msg{max-width:92%}
}

/* ============================================================
   LIGHT MODE — the tool/chat panels hardcode dark surfaces
   ============================================================ */
html.light .tool{background:#fff;box-shadow:0 20px 50px -30px rgba(120,105,60,.5)}
html.light .fcard{background:#fff}
html.light .fcard .fimg{background:#fff}
html.light .fmode{background:#fff}
html.light .fmode.on{background:var(--gold-tint);border-color:var(--gold);color:var(--gold-deep);font-weight:600}
html.light .fmode.on svg{stroke:var(--gold-deep)}
html.light .fsearch .field{background:#fff}
html.light .msg.bot,html.light .typing{background:var(--ink-3)}
html.light .chat-form{background:#fff}
html.light .cf-grid input{background:var(--ink-3)}
html.light .ftrace code{background:var(--ink-3)}
html.light .fanchor{background:var(--gold-tint);border-color:rgba(154,106,18,.35);color:var(--gold-deep)}

/* ---------- live agent (Gemini + grounded search + datasheet check) ---------- */
/* a step the agent is on right now: pulses until the next step starts */
.worktrace .tchip.live:not(.done){opacity:.85;transform:none;animation:fpulse 1s var(--ease) infinite}
.ftrace .worktrace{margin:0}

/* photo: camera button in the field, the pending-photo chip, the photo in the user's bubble */
.fcam{flex:0 0 auto;width:34px;height:34px;border:0;border-radius:10px;background:none;cursor:pointer;
  display:grid;place-items:center;color:var(--faint);transition:.2s}
.fcam:hover{color:var(--gold);background:rgba(220,175,80,.08)}
.fcam[hidden]{display:none}
.fsearch .field .fcam svg,.chat-in .fcam svg{width:19px;height:19px;stroke:currentColor;fill:none;stroke-width:1.8}
.fphoto{display:flex;align-items:center;gap:10px;margin-top:10px;font-size:12.5px;color:var(--muted)}
.fphoto[hidden]{display:none}
.fphoto img{width:44px;height:44px;object-fit:cover;border-radius:8px;border:1px solid var(--line)}
.fphoto button{border:1px solid var(--line);background:var(--ink-2);color:var(--muted);border-radius:50%;
  width:24px;height:24px;cursor:pointer;line-height:1;font-size:14px}
.fphoto button:hover{color:var(--gold);border-color:var(--gold)}
.chat-photo{margin:0 0 10px}
.msg-photo{display:block;max-width:180px;max-height:140px;border-radius:10px;margin-bottom:6px;object-fit:cover}

/* the finder's short conversation: a question, the customer's answer, the agent's answer */
.fask{border:1px solid rgba(220,175,80,.35);border-radius:16px;padding:16px 18px;background:rgba(220,175,80,.05)}
.fask-q{font-size:15px;line-height:1.5}
.fsaid{justify-self:end;font-size:13.5px;color:var(--muted);border:1px solid var(--line);border-radius:100px;padding:6px 14px}
.fanswer{font-size:15px;line-height:1.6;color:var(--text)}

/* requirement checklist on a card, verified against the data sheet on the server */
.fchecks{margin-top:10px;display:flex;flex-wrap:wrap;gap:6px}
.fchecks-h{flex-basis:100%;font-family:var(--disp);font-size:11.5px;letter-spacing:.04em;color:var(--muted)}
.fchecks.full .fchecks-h{color:var(--gold)}
.fchk{font-size:12px;border:1px solid var(--line);border-radius:100px;padding:3px 10px;color:var(--text)}
.fchk.listed,.fchk.newer{border-color:rgba(220,175,80,.4)}
.fchk.missing{color:var(--faint);border-style:dashed}
.fchk i{font-style:normal;color:var(--faint)}
.fcard.alt{opacity:.92}
.frole{font-family:var(--disp);font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--faint);margin-bottom:4px}

/* web sources and Google's search suggestions under a grounded answer */
.fsources{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;margin-top:10px;font-size:12px}
.fsources > span{font-family:var(--disp);letter-spacing:.04em;color:var(--faint)}
.fsources a{color:var(--muted);text-decoration:none;border-bottom:1px solid var(--line-2)}
.fsources a:hover{color:var(--gold);border-color:var(--gold)}
.fsuggest{flex-basis:100%;margin-top:4px;max-width:100%;overflow-x:auto}
/* the search chip folded under an arrow */
details.fsources{display:block}
details.fsources > summary{display:inline-flex;align-items:center;gap:6px;cursor:pointer;list-style:none;font-size:12px;color:var(--faint);user-select:none}
details.fsources > summary::-webkit-details-marker{display:none}
details.fsources > summary::after{content:'';width:6px;height:6px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:translateY(-2px) rotate(45deg);transition:transform .2s}
details.fsources[open] > summary::after{transform:translateY(1px) rotate(-135deg)}
details.fsources > summary:hover{color:var(--gold)}
details.fsources[open] .fsuggest{margin-top:8px}
/* the vehicle market an answer is for, and its one-tap switch */
.fmarket{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin-top:10px;font-size:12.5px;color:var(--muted)}
.fmarket b{color:var(--text);font-weight:600}
.fmarket > button{font:inherit;font-size:12px;color:var(--gold);background:none;border:0;border-bottom:1px dashed var(--gold);padding:0;cursor:pointer}
.fmarket-pick{flex-basis:100%;display:flex;flex-wrap:wrap;gap:6px}
.fmarket-pick[hidden]{display:none}
.fmarket-pick button{font:inherit;font-size:12.5px;color:var(--muted);background:none;border:1px solid var(--line-2);border-radius:100px;padding:6px 12px;cursor:pointer}
.fmarket-pick button:hover,.fmarket-pick button:focus-visible{border-color:var(--gold);color:var(--gold)}
/* AI disclaimer under a recommendation */
.fdisclaim{margin-top:12px;font-size:11.5px;line-height:1.5;color:var(--faint)}
@media (max-width:560px){.msg-photo{max-width:140px}.fask{padding:14px}}
/* a requirement no live source confirmed this turn */
.fnote{margin-top:10px;font-size:12.5px;line-height:1.5;color:var(--muted);border-left:2px solid var(--gold);padding:2px 0 2px 10px}
/* an image dragged over the chat or the finder */
.tool.fdrop,.fdrop .chat{outline:2px dashed var(--gold);outline-offset:-8px}

/* early finding: what the research found, shown while the Benzol match is still being checked */
.ffound{margin:6px 0 2px;font-size:13px;line-height:1.5;color:var(--muted);border-left:2px solid var(--gold);padding:2px 0 2px 10px}
.ffound b{color:var(--gold);font-weight:600;margin-right:4px}
.ffound-next{display:block;font-size:12px;color:var(--faint);margin-top:2px}
.msg .stream ~ .ffound .ffound-next,.ffound:has(~ .stream) .ffound-next,.ffound:has(~ .fanswer) .ffound-next{display:none}

/* local test servers only: TTFT and cost line under each answer */
.fmetrics{margin-top:10px;padding:6px 10px;border-radius:8px;border:1px dashed var(--line-2);font:12px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace;color:var(--muted);white-space:pre-wrap}

/* streamed text keeps the paragraph break between the research findings and the recommendation */
.msg .stream,.fanswer{white-space:pre-line}

/* ---------- 2026-10-11 assistant polish ---------- */
/* send button turns into Stop while an answer is on its way */
.chat-in .send .i-stop{display:none;width:16px;height:16px;fill:#120d02;stroke:none}
.chat-in .send.stop .i-send{display:none}
.chat-in .send.stop .i-stop{display:block}
.chat-in .send.stop{animation:fpulse 1.6s var(--ease) infinite}
.chat-in .send:focus-visible{outline:2px solid var(--gold);outline-offset:3px}
@media (prefers-reduced-motion:reduce){.chat-in .send.stop{animation:none}}
/* the step in progress shows its seconds after 3 s */
.worktrace .tchip em{font-style:normal;color:var(--faint);font-variant-numeric:tabular-nums}
.worktrace .tchip em:not(:empty)::before{content:"· "}
/* a failed turn */
.fnote.ferr{border-left-color:#d98b4a}
.msg.err > div:first-of-type{color:var(--muted)}
/* alternatives as compact rows under the main card */
.falts{margin-top:12px;border:1px solid var(--line);border-radius:16px;overflow:hidden}
.falts-h{font-family:var(--disp);font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--faint);padding:10px 14px 4px}
.falt{display:flex;align-items:center;gap:12px;padding:10px 14px;text-decoration:none;color:var(--text);transition:background .2s}
.falt + .falt{border-top:1px solid var(--line)}
.falt:hover{background:rgba(220,175,80,.06)}
.falt:focus-visible{outline:2px solid var(--gold);outline-offset:-2px}
.falt-img{width:44px;height:44px;flex:0 0 auto;border-radius:9px;overflow:hidden;border:1px solid var(--line);background:#050506}
.falt-img img{width:100%;height:100%;object-fit:cover;display:block}
.falt-t{flex:1;min-width:0;display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 10px}
.falt-v{font-family:var(--pack);font-weight:700;font-size:18px;line-height:1.1}
.falt-n{font-family:var(--disp);font-size:13px;line-height:1.35;min-width:0}
.falt-f{flex-basis:100%;font-size:11.5px;color:var(--faint)}
.falt-f.ok{color:var(--gold)}
.falt .arr{color:var(--gold);flex:0 0 auto}
html.light .falt-img{background:#fff}
html.light .falt-f.ok{color:var(--gold-deep)}
/* phones: the chat card keeps image and text side by side (a stacked bottle wasted a full row) */
@media (max-width:560px){
  .msg .fcard{flex-direction:row;align-items:flex-start;gap:14px;padding:14px}
  .msg .fcard .fimg{width:64px;height:64px}
  .msg .fcard .fvisc{font-size:21px}
  .msg .fcard .fname{font-size:13.5px;line-height:1.4}
  .msg .fcard .factions .btn{padding:10px 14px}
  .falt{padding:10px 12px}
}
/* Google's search-suggestion strip is a nowrap carousel: it must scroll inside its own width and never set the
   width of the conversation (it pushed the panel's column to 943 px inside 662 px, cutting off cards and the input) */
.fsuggest{width:100%;max-width:100%;overflow-x:auto;contain:inline-size}
.fsources{min-width:0;max-width:100%}
.chat,.chat-log,.chat-log > *,.msg .fcard,.msg .fbody{min-width:0}
.msg{max-width:100%}
