/* path: app/console/static/demo.css
   The public demo page. One column; the assistant's colour (jade) marks everything it does. */
:root {
  --bg: #f3f5f4; --surface: #ffffff; --ink: #111d1a; --muted: #5b6b66; --line: #dce3e0;
  --jade: #0b7356; --jade-ink: #ffffff; --jade-soft: #e1f1eb; --bad: #b3261e; --bad-soft: #fbe7e5;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Figtree", "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1513; --surface: #16201d; --ink: #e6efeb; --muted: #98a9a3; --line: #27332f;
    --jade: #4fc79e; --jade-ink: #08130f; --jade-soft: #163128; --bad: #f08a80; --bad-soft: #3a1d1a;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--body); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
h1, h2 { font-family: var(--display); margin: 0; line-height: 1.12; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 5vw, 3rem); letter-spacing: -0.02em; }
h2 { font-size: 1rem; font-family: var(--body); font-weight: 600; color: var(--muted); }
p { margin: 0; }
button { font: inherit; font-weight: 600; border-radius: 12px; border: 1px solid var(--jade); background: var(--jade);
  color: var(--jade-ink); padding: 12px 20px; cursor: pointer; white-space: nowrap; }
button:disabled { opacity: 0.55; cursor: default; }
button.quiet { background: transparent; color: var(--jade); }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--jade); outline-offset: 2px; }
input { font: inherit; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); min-width: 0; }
.error { color: var(--bad); background: var(--bad-soft); border-radius: 10px; padding: 10px 14px; }
.lede { color: var(--muted); font-size: 1.08rem; max-width: 60ch; }
.eyebrow { color: var(--muted); font-size: 0.9rem; word-break: break-all; }

.bar { display: flex; justify-content: space-between; align-items: center; max-width: 920px; margin: 0 auto;
  padding: 18px max(16px, env(safe-area-inset-left, 0px)) 0; }
.brand { font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.bar-note { font-size: 0.82rem; font-weight: 600; color: var(--jade); background: var(--jade-soft); border-radius: 99px; padding: 3px 10px; }
main { max-width: 920px; margin: 0 auto; padding: 36px max(16px, env(safe-area-inset-right, 0px)) 72px max(16px, env(safe-area-inset-left, 0px)); }

.start { display: grid; gap: 40px; }
.hero { display: grid; gap: 18px; }
.site-form, .chat-form { display: flex; gap: 10px; flex-wrap: wrap; }
.site-form input { flex: 1 1 260px; font-size: 1.1rem; }
.try-example { color: var(--muted); font-size: 0.95rem; }
button.link { background: none; border: 0; padding: 0; color: var(--jade); font-weight: 600; text-decoration: underline;
  text-underline-offset: 3px; border-radius: 4px; }
.picks { display: grid; gap: 22px; }
.picks > div { display: grid; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { background: var(--surface); color: var(--ink); border-color: var(--line); font-weight: 500; padding: 9px 14px;
  white-space: normal; text-align: left; }
.chips button:hover { border-color: var(--jade); }
.how { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.how li { display: grid; gap: 4px; padding-top: 14px; border-top: 2px solid var(--jade); }
.how span { color: var(--muted); font-size: 0.95rem; }

.building { display: grid; gap: 18px; max-width: 640px; }
.steps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 12px; }
.steps li { display: flex; gap: 12px; align-items: center; }
.steps li::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.steps li[data-state="running"]::before { border-color: var(--jade); border-top-color: transparent; animation: spin 0.9s linear infinite; }
.steps li[data-state="done"]::before { background: var(--jade); border-color: var(--jade); }
.steps li[data-state="failed"]::before { background: var(--bad); border-color: var(--bad); }
.steps li[data-state="pending"] { color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }

.ready { display: grid; gap: 20px; }
.ready-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted); padding: 10px 14px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--jade); }
.panel { display: grid; gap: 14px; }
.thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.thread li { max-width: 82%; padding: 10px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); white-space: pre-wrap; }
.thread li.user { justify-self: end; background: var(--jade); color: var(--jade-ink); border-color: var(--jade); }
.thread li.staff { border-style: dashed; }
.thread .note { display: block; font-size: 0.82rem; color: var(--muted); margin-top: 4px; }
.hint { color: var(--muted); font-size: 0.88rem; }

/* The chat tab is the customer's own conversation: one framed window, like the messenger it stands in for. */
.chat-window { --well: #e9eeec; display: grid; grid-template-rows: auto 1fr auto; max-width: 720px;
  height: clamp(460px, 68vh, 640px); background: var(--well); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; }
@media (prefers-color-scheme: dark) { .chat-window { --well: #0a100e; } }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--jade); color: var(--jade-ink); font: 700 0.95rem/1 var(--display); letter-spacing: 0.02em; }
.chat-name { font-weight: 600; line-height: 1.25; }
.chat-status { color: var(--muted); font-size: 0.84rem; line-height: 1.3; word-break: break-all; }
.chat-scroll { overflow-y: auto; padding: 18px 14px 10px; display: flex; flex-direction: column; overscroll-behavior: contain; }
.chat-empty { margin: auto; max-width: 30ch; text-align: center; color: var(--muted); font-size: 0.95rem; }
.chat-scroll .thread { gap: 6px; }
.chat-scroll .thread li { max-width: min(78%, 460px); padding: 8px 12px; border-radius: 18px; border: 0;
  font-size: 0.98rem; line-height: 1.45; box-shadow: 0 1px 0 rgb(0 0 0 / 0.06); }
.chat-scroll .thread li.bot { background: var(--surface); border-bottom-left-radius: 5px; }
.chat-scroll .thread li.user { background: var(--jade); color: var(--jade-ink); border-bottom-right-radius: 5px; }
.chat-scroll .thread li.user + li.bot, .chat-scroll .thread li.bot + li.user,
.chat-scroll .thread li.system + li, .chat-scroll .thread li + li.system { margin-top: 8px; }
.chat-scroll .thread li.staff { background: var(--surface); outline: 1px dashed var(--jade); }
.chat-scroll .thread li.system { justify-self: center; max-width: 92%; background: var(--jade-soft); color: var(--ink);
  border-radius: 10px; font-size: 0.84rem; text-align: center; box-shadow: none; padding: 6px 12px; }
.chat-scroll .thread li.photo { padding: 3px; width: min(78%, 300px); }
.chat-scroll .thread li.photo img { display: block; width: 100%; height: auto; border-radius: 15px; }
.chat-scroll .thread li.typing { display: flex; gap: 4px; padding: 13px 14px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: dot 1.2s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 60%, 100% { opacity: 0.3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.chat-foot { display: grid; gap: 8px; padding: 10px 12px 12px; background: var(--surface); border-top: 1px solid var(--line); }
/* Quick replies: one scrolling row, outlined so they never read as messages. */
.suggest { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px; }
.suggest::-webkit-scrollbar { display: none; }
.suggest:empty { display: none; }
.suggest button { flex: none; background: transparent; color: var(--jade); border: 1px solid var(--jade); border-radius: 99px;
  padding: 5px 12px; font-size: 0.86rem; font-weight: 500; }
.suggest button:hover { background: var(--jade-soft); }
.chat-form { display: flex; gap: 8px; align-items: center; }
.chat-form input { flex: 1; border-radius: 99px; padding: 10px 16px; background: var(--bg); border-color: transparent; }
.chat-form input:focus-visible { outline-offset: 0; }
#chat-send { width: 44px; height: 44px; padding: 0; border-radius: 50%; display: grid; place-items: center; flex: none; }

.call { display: grid; justify-items: center; gap: 14px; padding: 28px 0 8px; }
.orb { width: 136px; height: 136px; border-radius: 50%; font-size: 1.25rem; position: relative; }
.orb[data-state="listening"], .orb[data-state="speaking"] { background: var(--bad); border-color: var(--bad); color: #fff; }
.orb[data-state="connecting"] { animation: breathe 1.2s ease-in-out infinite; }
.orb[data-state="speaking"] { animation: talk 0.9s ease-in-out infinite; }
.orb[data-state="listening"]::after { content: ""; position: absolute; inset: -10px; border-radius: 50%;
  border: 2px solid var(--bad); animation: ring 1.8s ease-out infinite; }
@keyframes breathe { 50% { opacity: 0.55; } }
@keyframes talk { 50% { transform: scale(1.06); } }
@keyframes ring { from { transform: scale(0.95); opacity: 0.7; } to { transform: scale(1.25); opacity: 0; } }
.call-status { font-weight: 600; text-align: center; }

.stats { display: grid; gap: 22px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { display: grid; gap: 2px; align-content: start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.tile strong { font-family: var(--display); font-size: 1.7rem; line-height: 1.1; }
.tile span { color: var(--muted); font-size: 0.9rem; }
.tile small { color: var(--muted); font-size: 0.78rem; }
.stat-block { display: grid; gap: 10px; }
.stat-block h3 { margin: 0; font-size: 1rem; }
.mix-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--line); gap: 2px; }
.mix-bar span { flex-basis: 0; }
.mix-legend, .plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mix-legend li, .plain li { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.mix-legend li { justify-content: flex-start; align-items: center; }
.mix-legend li::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: currentColor; flex: none; }
.mix-legend li strong { margin-left: auto; }
.plain li small { color: var(--muted); white-space: nowrap; }
.mix-answered { color: var(--jade); background: var(--jade); }
.mix-set_response { color: #2f8fa3; background: #2f8fa3; }
.mix-canned { color: #8a9a95; background: #8a9a95; }
.mix-handed_over { color: #c7841f; background: #c7841f; }
.mix-other { color: var(--line); background: var(--line); }
.mix-legend li { background: none; }  /* the class gives the swatch its colour, not the row */
.mix-legend li span, .mix-legend li strong { color: var(--ink); }
.facts { display: grid; gap: 12px; }
.facts details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
.facts summary { cursor: pointer; font-weight: 600; }
.facts summary span { color: var(--muted); font-weight: 500; margin-left: 6px; }
.facts ul { margin: 10px 0 2px; padding: 0; list-style: none; display: grid; gap: 8px; }
.facts li { display: grid; gap: 2px; }
.facts li span { color: var(--muted); font-size: 0.92rem; }
@media (prefers-reduced-motion: reduce) { *, *::after { animation: none !important; } }
