/* Vendy chat widget — visual language matches cashipindia.com (Segoe UI, same tokens), built as a
   standalone chat page rather than the Console's own design. System fonts only, light + dark. */
:root {
  --bg: #ffffff;
  --surface: #f5f5f5;
  --text: #242424;
  --muted: #616161;
  --line: #e0e0e0;
  --brand: #0067b8;
  --brand-hover: #005a9e;
  --on-brand: #ffffff;
  --bot-bubble: #f0f2f5;
  --user-bubble: #0067b8;
  --danger: #b10e1c;
  font-size: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1b1b; --surface: #242424; --text: #f5f5f5; --muted: #b5b5b5; --line: #3d3d3d;
    --brand: #479ef5; --brand-hover: #6cb8f6; --on-brand: #0b0b0b;
    --bot-bubble: #2b2b2b; --user-bubble: #2563a8; --danger: #ff8a8a;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  display: flex; flex-direction: column;
}
.wrap { display: flex; flex-direction: column; height: 100vh; max-width: 480px; margin: 0 auto; width: 100%; background: var(--bg); }

.hdr { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex: none; }
.hdr-av { width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; font-weight: 700; overflow: hidden; flex: none; }
.hdr-av img { width: 100%; height: 100%; object-fit: cover; }
.hdr-name { font-weight: 600; font-size: 0.9375rem; line-height: 1.2; }
.hdr-status { font-size: 0.75rem; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.hdr-status .dot { width: 7px; height: 7px; border-radius: 50%; background: #3fb950; flex: none; }

.log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 82%; padding: 9px 12px; border-radius: 14px; font-size: 0.9375rem; line-height: 1.5; word-wrap: break-word; white-space: pre-wrap; }
.msg.bot { align-self: flex-start; background: var(--bot-bubble); border-bottom-left-radius: 4px; }
.msg.user { align-self: flex-end; background: var(--user-bubble); color: var(--on-brand); border-bottom-right-radius: 4px; }
.msg .src { display: block; margin-top: 6px; font-size: 0.6875rem; opacity: .7; }
.typing { align-self: flex-start; display: flex; gap: 4px; padding: 10px 14px; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.card { align-self: flex-start; max-width: 90%; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 0.875rem; }
.card h4 { margin: 0 0 6px; font-size: 0.875rem; }
.card .row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; color: var(--muted); }
.card .row b { color: var(--text); font-weight: 600; }
.card .btns { display: flex; gap: 8px; margin-top: 10px; }

.btn { font: inherit; font-weight: 600; font-size: 0.8125rem; border-radius: 6px; padding: 7px 14px; cursor: pointer; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.btn.primary { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-hover); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.in { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); flex: none; }
.in input { flex: 1; font: inherit; font-size: 0.9375rem; padding: 10px 12px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--text); }
.in input:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.in button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; cursor: pointer; flex: none; }
.in button:disabled { opacity: .5; cursor: not-allowed; }
.in button svg { width: 18px; height: 18px; }

.err { color: var(--danger); font-size: 0.8125rem; padding: 4px 14px; }
.foot { text-align: center; font-size: 0.6875rem; color: var(--muted); padding: 4px 0 8px; flex: none; }
.foot a { color: var(--muted); }

@media (max-width: 480px) { .wrap { max-width: none; } }
