/* ==========================================================================
   The chat agent page: the product's own surfaces, drawn to scale.

   Two drawings live on this page and both are copies of the real thing:
   the chat widget a visitor sees, and the analytics page the owner sees.
   The colours, the sizes, the shapes and the order are the product's, taken
   from the widget's own stylesheet and from the client page's analytics
   sheet, so a picture of the widget here looks like the widget there.

   The widget draws on the site's own palette, which is the widget's palette:
   the same near-black log, the same surface, the same line and the same
   signal green.
   ========================================================================== */

/* The widget, drawn as it is */
.hero-visual { min-width: 0; }
.agent-hero .agent-hero-row .hero-visual { width: 100%; }
.hero-widget {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  height: 640px;
}
/* On a narrow screen the panel is the width of the column, so the lines are
   shorter and the panel needs a little more height. */
@media (max-width: 700px) {
  .hero-widget { height: 760px; }
}

/* ── The chat widget ────────────────────────────────────────────────────── */
.tw {
  --tw-accent: #5de27e;
  --tw-accent-ink: #181818;
  --tw-ink: #eae3dd;
  --tw-muted: #a8978c;
  --tw-line: #3a3936;
  --tw-surface: #1f1e1d;
  --tw-log: #181818;
  /* The live widget sets these two from its own brand config: the header
     icons and the visitor's bubble are the warm grey, not the signal green. */
  --tw-icon: #a8978c;
  --tw-bubble: #a8978c;

  display: flex;
  flex-direction: column;
  width: 420px;
  max-width: 100%;
  border: 1px solid var(--tw-line);
  border-radius: 20px;
  background: var(--tw-surface);
  color: var(--tw-ink);
  box-shadow: 0 24px 64px rgba(26, 26, 26, .28);
  overflow: hidden;
  font: 400 15px/1.45 var(--font);
}

/* The header: the open-hours line, then the two controls. */
.tw-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px 14px 18px;
  border-bottom: 1px solid var(--tw-line);
}
.tw-sub {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--tw-muted);
}
.tw-sub b { color: var(--tw-ink); font-weight: 600; }
.tw-head-act { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.tw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--tw-muted);
}
.tw-btn .ico { width: 20px; height: 20px; }
.tw-btn--hist,
.tw-btn--new { color: var(--tw-icon); }
.tw-btn--x { font-size: 26px; line-height: 1; font-weight: 400; }

/* The conversation. */
.tw-log {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--tw-log);
}
.tw-msg {
  max-width: 88%;
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.45;
}
.tw-msg--bot {
  align-self: flex-start;
  background: var(--tw-surface);
  border: 1px solid var(--tw-line);
  border-bottom-left-radius: 5px;
}
.tw-msg--user {
  align-self: flex-end;
  background: var(--tw-bubble);
  color: var(--tw-accent-ink);
  border-bottom-right-radius: 5px;
}
/* Where the answer came from. One quiet line, the way the widget says it. */
.tw-src {
  align-self: flex-start;
  max-width: 88%;
  padding: 0 2px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--tw-muted);
}
.tw-src b { font-weight: 600; }
.tw-src a {
  color: var(--tw-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
/* The one control the bot offers, the way the widget draws a choice. */
.tw-opts { align-self: flex-start; display: flex; flex-wrap: wrap; gap: 8px; }
.tw-opt {
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid var(--tw-line);
  border-radius: 10px;
  background: var(--tw-surface);
  color: var(--tw-ink);
  font: 600 14px/1.2 var(--font);
}
.tw-opt--on { border-color: var(--tw-accent); }

/* The foot: the field, the quick replies, the small print. */
.tw-foot {
  flex: 0 0 auto;
  background: var(--tw-log);
  padding: 6px 12px 10px;
}
.tw-remember {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 4px;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--tw-ink);
}
.tw-remember input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin: 1px 0 0;
  accent-color: var(--tw-accent);
}
.tw-composer {
  border: 1px solid var(--tw-line);
  border-radius: 16px;
  background: var(--tw-surface);
  padding: 10px 16px 2px;
}
.tw-q {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0 0 2px;
  font: 400 14px/21px var(--font);
  color: var(--tw-ink);
}
.tw-q::placeholder { color: var(--tw-muted); opacity: 1; }
.tw-crow { display: flex; align-items: center; gap: 4px; padding: 2px 2px 2px; }
.tw-ib {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--tw-muted);
}
.tw-ib .ico { width: 18px; height: 18px; }
.tw-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--tw-accent);
  color: var(--tw-accent-ink);
}
.tw-send .ico { width: 18px; height: 18px; }
.tw-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 12px 2px 0; }
.tw-chip {
  min-height: 36px;
  padding: 9px 13px;
  border: 1px solid var(--tw-line);
  border-radius: 999px;
  background: var(--tw-surface);
  color: var(--tw-ink);
  font: 400 12.5px/1.3 var(--font);
  white-space: nowrap;
}
/* The record the team gets when a chat is handed to a person: who asked,
   what they asked, and what the agent had already told them. */
.tw-record {
  align-self: stretch;
  padding: 10px 12px;
  border: 1px solid var(--tw-line);
  border-radius: 10px;
  background: var(--tw-surface);
}
.tw-record-head {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: 0 0 .6rem;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tw-ink);
}
.tw-record-head i {
  width: .7rem;
  height: .7rem;
  flex: none;
  border-radius: 50%;
  background: var(--tw-accent);
}
.tw-record-row {
  display: flex;
  gap: 1rem;
  padding: .25rem 0;
  font-size: 12.5px;
  line-height: 1.35;
}
.tw-record-row span {
  flex: 0 0 6rem;
  color: var(--tw-muted);
}
.tw-record-row b {
  flex: 1 1 auto;
  font-weight: 500;
  color: var(--tw-ink);
}
.tw-fine {
  margin: 0;
  padding: 8px 4px 0;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--tw-muted);
}
/* The card the bot asks for the details on. */
.tw-form {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px;
  border: 1px solid var(--tw-line);
  border-radius: 10px;
  background: var(--tw-surface);
}
.tw-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font: 600 11.5px var(--font);
  color: var(--tw-muted);
}
.tw-form input {
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--tw-line);
  border-radius: 8px;
  background: var(--tw-surface);
  font: 400 14px var(--font);
  color: var(--tw-ink);
}
.tw-form input::placeholder { color: var(--tw-muted); }
.tw-form-row { display: flex; gap: 8px; justify-content: flex-end; }
.tw-form button {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--tw-line);
  border-radius: 10px;
  background: var(--tw-surface);
  color: var(--tw-ink);
  font: 700 13.5px var(--font);
}
.tw-form button.go {
  background: var(--tw-accent);
  color: var(--tw-accent-ink);
  border-color: var(--tw-accent);
}

/* ── The analytics page ─────────────────────────────────────────────────── */
.ax {
  --ax-page: #1c1c1c;
  --ax-bg: #141414;
  --ax-panel: #232323;
  --ax-ink: #f7f7f7;
  --ax-muted: #adadad;
  --ax-faint: #909090;
  --ax-line: rgba(255, 255, 255, .08);
  --ax-line-soft: rgba(255, 255, 255, .05);
  --ax-line-strong: rgba(255, 255, 255, .18);
  --ax-good: #61c884;
  --ax-warn: #e3b864;
  --ax-bar: #6b6b6b;
  --ax-accent: #5de27e;

  background: var(--ax-bg);
  color: var(--ax-ink);
  font: 400 14px/1.55 var(--font);
}
.ax-top {
  display: flex;
  align-items: center;
  gap: 26px;
  min-height: 64px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--ax-line);
  background: var(--ax-bg);
}
.ax-brand {
  font: 700 18px/1.2 var(--font);
  letter-spacing: -.02em;
  color: var(--ax-ink);
}
.ax-nav { display: flex; gap: 20px; margin-left: auto; align-items: center; }
.ax-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  color: var(--ax-muted);
}
.ax-nav a[aria-current] { color: var(--ax-ink); border-bottom: 2px solid var(--ax-accent); }
.ax-who {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 18px;
  border-left: 1px solid var(--ax-line);
  font-size: 13px;
  color: var(--ax-faint);
}
.ax-body { padding: 26px 28px 30px; }
.ax-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 4px;
  font: 600 26px/1.1 var(--font);
  letter-spacing: -.022em;
  color: var(--ax-ink);
}
.ax-title small { font-size: 13.5px; font-weight: 500; color: var(--ax-muted); }
.ax-sub { margin: 0 0 18px; font-size: 13.5px; color: var(--ax-muted); }

/* The month, its name and the arrows either side. */
.ax-month {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border: 1px solid var(--ax-line);
  border-radius: 10px;
  background: var(--ax-page);
}
.ax-arrow {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--ax-line);
  border-radius: 8px;
  color: var(--ax-muted);
}
.ax-arrow .ico { width: 16px; height: 16px; }
.ax-mname { display: flex; align-items: baseline; gap: 12px; }
.ax-mname b { font: 600 15px var(--font); letter-spacing: -.01em; }
.ax-mname span { font-size: 13px; color: var(--ax-muted); }

/* The four figures. */
.ax-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 16px;
  border: 1px solid var(--ax-line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--ax-page);
}
.ax-kpi { padding: 18px 20px 16px; border-left: 1px solid var(--ax-line); }
.ax-kpi:first-child { border-left: 0; }
.ax-kpi .n { font: 600 34px/1 var(--font); letter-spacing: -.03em; }
.ax-kpi .l { margin-top: 9px; font-size: 13px; color: var(--ax-muted); }
.ax-kpi .d { margin-top: 3px; font-size: 12px; color: var(--ax-faint); }
.ax-kpi .view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  margin-top: 12px;
  padding: 0 14px;
  border: 1px solid var(--ax-line-strong);
  border-radius: 6px;
  background: var(--ax-page);
  font-size: 13px;
  font-weight: 500;
  color: var(--ax-ink);
}

/* One chart, one scale. */
.ax-panel {
  margin-top: 16px;
  padding: 18px 20px 16px;
  border: 1px solid var(--ax-line);
  border-radius: 10px;
  background: var(--ax-page);
}
.ax-phead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ax-phead h3 { margin: 0; font: 600 13.5px var(--font); color: var(--ax-ink); }
.ax-phead .meta { font-size: 12px; color: var(--ax-faint); }
.ax-legend { display: flex; gap: 16px; margin-top: 14px; font-size: 11.5px; color: var(--ax-muted); }
.ax-legend .lg { display: flex; align-items: center; gap: 6px; }
.ax-legend .dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.ax-chart { display: flex; align-items: flex-end; gap: 18px; margin-top: 14px; height: 150px; }
.ax-col { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 4px; height: 100%; }
.ax-bars { flex: 1; max-width: 26px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.ax-v { font-style: normal; font-size: 9.5px; color: var(--ax-faint); white-space: nowrap; }
.ax-bar { display: block; width: 100%; border-radius: 2px 2px 0 0; }
.ax-axis {
  display: flex;
  gap: 18px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--ax-line-soft);
}
.ax-axis span { flex: 1; text-align: center; font-size: 11.5px; color: var(--ax-faint); }
.ax-axis span.now { color: var(--ax-ink); font-weight: 500; }

/* The questions the chat could not answer. */
.ax-gaps { margin-top: 16px; border: 1px solid var(--ax-line); border-radius: 10px; overflow: hidden; background: var(--ax-page); }
.ax-ghead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px 0;
}
.ax-ghead h3 { margin: 0; font: 600 15px var(--font); letter-spacing: -.01em; }
.ax-segs { display: flex; gap: 8px; margin-top: 12px; padding: 0 20px 12px; }
.ax-seg {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--ax-line-strong);
  border-radius: 8px;
  font-size: 13px;
  color: var(--ax-ink);
}
.ax-seg--on { background: var(--ax-panel); border-color: var(--ax-line-strong); font-weight: 500; }
.ax-count { margin: 0; padding: 0 20px 10px; font-size: 13px; color: var(--ax-muted); }
.ax-count b { color: var(--ax-ink); font-weight: 600; }
.ax-gap {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 20px;
  padding: 14px 20px;
  border-top: 1px solid var(--ax-line-soft);
  align-items: start;
}
.ax-gap .words { font: 500 14.5px/1.35 var(--font); color: var(--ax-ink); }
.ax-gap .chip {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 7px;
  border: 1px solid rgba(93, 226, 126, .25);
  border-radius: 20px;
  background: rgba(93, 226, 126, .06);
  color: var(--ax-accent);
  font-size: 11px;
  font-weight: 600;
  vertical-align: 2px;
}
.ax-gap .acts { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.ax-gap .act { font-size: 13px; color: var(--ax-accent); }
.ax-gap .act.plain { color: var(--ax-muted); }
.ax-gap .n { text-align: right; }
.ax-gap .n b { display: block; font: 600 20px/1 var(--font); letter-spacing: -.02em; }

/* The drawer the owner opens on one figure. */
.ax-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 520px;
  padding: 26px 28px 30px;
  border-left: 1px solid var(--ax-line);
  background: var(--ax-bg);
  overflow: hidden;
}
.ax-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ax-drawer-head h3 { margin: 0; font: 600 17px var(--font); }
.ax-drawer-head p { margin: 4px 0 0; font-size: 12.5px; color: var(--ax-muted); }
.ax-drawer-x { font-size: 18px; color: var(--ax-muted); }
.ax-drawer-sub { margin: 18px 0 4px; padding-top: 16px; border-top: 1px solid var(--ax-line); font-size: 13.5px; color: var(--ax-muted); }
.ax-chat {
  display: block;
  width: 100%;
  padding: 14px 0;
  border-top: 1px solid var(--ax-line-soft);
  text-align: left;
}
.ax-chat-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--ax-faint); }
.ax-chat-q { margin: 6px 0 0; font-size: 14.5px; line-height: 1.35; color: var(--ax-ink); }
.ax-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ax-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
}
.ax-tag--ok { background: rgba(97, 200, 132, .16); color: var(--ax-good); }
.ax-tag--hand { background: rgba(227, 184, 100, .16); color: var(--ax-warn); }
.ax-tag--other { background: var(--ax-panel); color: var(--ax-muted); }

/* ── How the drawings sit in the page ───────────────────────────────────── */
.shot-card {
  position: relative;
  display: grid;
  place-items: center;
  width: max-content;
  max-width: 100%;
  height: 100%;
  margin-inline: auto;
  padding: 2.4rem;
  background: var(--surface);
  color: var(--warm-100);
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  overflow: hidden;
}
/* The picture is drawn at the product's own size and then scaled to fit the
   frame, so a picture of the widget here looks like the widget there. */
.shot-fit {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.shot-fit > * { transform: scale(var(--fit, 1)); transform-origin: center center; }
/* The widget keeps the product's own width and its own height. */
.shot-card .tw { width: 420px; height: 620px; }
.shot-card--ax {
  width: 100%;
  padding: 0;
  background: #141414;
}
/* The drawer, and the page behind it, are cropped like a screenshot. */
.ax--drawer { width: 640px; }
.ax--drawer .ax-drawer {
  position: static;
  width: 100%;
  padding: 18px 26px 22px;
  border-left: 0;
  overflow: hidden;
}
.ax--page { width: 620px; }
.ax-nav span { color: var(--ax-muted); }
.ax-nav span[aria-current] { color: var(--ax-ink); border-bottom: 2px solid var(--ax-accent); }
.ax-arrow--off { opacity: .35; }

/* On a phone the frame is taller than it is wide, because the drawings are
   taller than they are wide and a square frame would shrink them to nothing. */
@media (max-width: 1023px) {
  .how-panel .how-shot { aspect-ratio: 3 / 4; }
}

/* The analytics drawing, packed so the whole screen fits one square. */
.ax--tight .ax-top { min-height: 50px; padding: 11px 20px; }
.ax--tight .ax-body { padding: 12px 20px 16px; }
.ax--tight .ax-title { font-size: 21px; }
.ax--tight .ax-month { margin-top: 8px; padding: 8px 14px; }
.ax--tight .ax-arrow { width: 28px; height: 28px; }
.ax--tight .ax-kpis { margin-top: 8px; }
.ax--tight .ax-kpi { padding: 10px 12px 11px; }
.ax--tight .ax-kpi .n { font-size: 24px; }
.ax--tight .ax-kpi .l { margin-top: 7px; font-size: 11.5px; }
.ax--tight .ax-kpi .d { font-size: 10.5px; }
.ax--tight .ax-kpi .view { min-height: 24px; margin-top: 6px; padding: 0 11px; font-size: 11.5px; }
.ax--tight .ax-panel { margin-top: 8px; padding: 10px 12px 8px; }
.ax--tight .ax-legend { margin-top: 9px; gap: 13px; font-size: 10.5px; }
.ax--tight .ax-chart { height: 52px; margin-top: 7px; }
.ax--tight .ax-axis { margin-top: 6px; padding-top: 6px; }
.ax--tight .ax-axis span { font-size: 10.5px; }
.ax--tight .ax-gaps { margin-top: 8px; }
.ax--tight .ax-ghead { padding: 11px 16px 0; }
.ax--tight .ax-ghead h3 { font-size: 14px; }
.ax--tight .ax-segs { margin-top: 9px; padding: 0 16px 8px; gap: 6px; }
.ax--tight .ax-seg { min-height: 28px; padding: 5px 10px; font-size: 11.5px; }
.ax--tight .ax-count { padding: 0 16px 6px; font-size: 11.5px; }
.ax--tight .ax-gap { padding: 9px 16px; }
.ax--tight .ax-gap .words { font-size: 13px; }
.ax--tight .ax-gap .acts { margin-top: 7px; gap: 11px; }
.ax--tight .ax-gap .act { font-size: 11.5px; }
.ax--tight .ax-gap .n b { font-size: 17px; }

