@font-face {
  font-family: "Mona Sans";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/mona-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Mona Sans";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/mona-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* The page is a chat: the visitor's messages right in logo blue, RevoChat's left in white. */
:root {
  --blue: #1a56db;
  --blue-press: #1546b5;
  --blue-deep: #123c9e;
  --navy: #0f172a;
  --navy-bubble: #1c2740;
  --sky: #93c5fd;
  --white: #ffffff;
  --ink: #0f172a;
  --ink-soft: #46546d;
  --on-navy-soft: #c3d3ef;
  --day: #eef3fc;
  --line: #dce4f2;
  --whatsapp: #25d366;
  --telegram: #2aabee;
  --waiting: #f6b93b;
  --lost: #ff5a5a;
  --later: #dce7fb;
  --on-blue-meta: #e6eefe;
  --hot: #c81e1e;
  --hot-dot: #e02424;
  --typing: #0e7a40;
  --note: #fff6d6;
  --note-ink: #5c4a10;

  --font: "Mona Sans", ui-sans-serif, system-ui, sans-serif;
  --gutter: clamp(16px, 3vw, 56px);
  --sheet: clamp(28px, 3vw, 48px);
  --header: 76px;
  --composer: 76px;
  --bubble-shadow: 0 1px 1px rgba(15, 23, 42, 0.06), 0 8px 22px -14px rgba(15, 23, 42, 0.4);

  --step-hero: clamp(2.4rem, 0.6rem + 4.6vw, 6rem);
  --step-price: calc(var(--step-hero) * 0.78);
  --step-head: calc(var(--step-hero) * 0.62);
  --step-msg: clamp(1.125rem, 0.95rem + 0.75vw, 1.6rem);
  --step-small: 0.8125rem;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--day);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header) + 16px);
  scroll-padding-bottom: calc(var(--composer) + 16px);
}
html.canvas-end { background: var(--blue); }
body {
  margin: 0; background: var(--day); color: var(--ink);
  font-family: var(--font); font-size: 1.0625rem; font-weight: 420; line-height: 1.5;
  font-kerning: normal; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; }
img, svg { display: block; }
::selection { background: var(--sky); color: var(--navy); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 8px; }
.night :focus-visible, .close :focus-visible, .site-footer :focus-visible { outline-color: var(--sky); }

.wrap { width: 100%; padding: 0 var(--gutter); }
.skip {
  position: absolute; left: 12px; top: 12px; z-index: 40; transform: translateY(-200%);
  background: var(--navy); color: var(--white); padding: 10px 14px; border-radius: 10px; text-decoration: none;
}
.skip:focus { transform: none; }
/* Who is speaking, for a screen reader; the sides and colours say it to the eye. */
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Buttons */
.button {
  display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 22px 0 18px;
  background: var(--blue); color: var(--white); border-radius: 999px;
  font-weight: 640; font-size: 1.0625rem; line-height: 1.2; text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.14), 0 10px 22px -12px rgba(15, 23, 42, 0.5);
}
.button:hover { background: var(--blue-press); }
.button:active { background: var(--blue-deep); }
.button .wa { width: 20px; height: 20px; flex: none; }

/* The chat's own header: who you are talking to. */
.chat-head {
  position: sticky; top: 0; z-index: 30; background: var(--white);
  border-bottom: 1px solid var(--line);
}
.head-row { display: flex; align-items: center; gap: 12px; min-height: var(--header); padding: 0 var(--gutter); }
.who { display: flex; align-items: center; gap: 12px; margin-right: auto; text-decoration: none; min-width: 0; }
.who .brand-mark { width: 44px; height: 44px; flex: none; border-radius: 50%; }
.who-text { display: grid; min-width: 0; }
.who-name { font-weight: 760; font-size: 1.1875rem; letter-spacing: -0.02em; color: var(--navy); line-height: 1.2; }
.who-name span { color: var(--blue); }
/* The status reads "typing…" while RevoChat types (site.js). */
.status-typing { display: none; color: var(--typing); font-weight: 560; }
.who-status > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chat-head.is-typing .status-idle { display: none; }
.chat-head.is-typing .status-typing { display: inline; }
.who-status { display: flex; align-items: center; gap: 6px; font-size: var(--step-small); color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.online { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--whatsapp); }
.head-actions { display: flex; align-items: center; gap: 14px; }
.login { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; font-weight: 640; font-size: 0.9375rem; text-decoration: none; color: var(--navy); }
.login:hover { color: var(--blue); }

/* The thread: sheets by time of day, each sliding over the one before. */

.sheet {
  position: relative; padding: 40px 0 calc(var(--sheet) + 56px);
  border-radius: var(--sheet) var(--sheet) 0 0; margin-top: calc(-1 * var(--sheet));
  overflow-x: clip;
}
.sheet:first-child { margin-top: 0; border-radius: 0; padding-top: 4px; }
.sheet:first-child .divider { margin: 16px 0 14px; }
.day { background: url("../img/doodles-white.svg") 0 0 / 840px 840px, var(--day); --ground: var(--day); }
.night { background: url("../img/doodles-navy.svg") 0 0 / 840px 840px, var(--navy); color: var(--white); --ground: var(--navy); }
.later { background: url("../img/doodles-white.svg") 0 0 / 840px 840px, var(--later); --ground: var(--later); }
.close { background: url("../img/doodles-blue.svg") 0 0 / 840px 840px, var(--blue); color: var(--white); --ground: var(--blue); padding-bottom: 72px; }
#start { z-index: 1; }
#problem { z-index: 2; }
#how { z-index: 3; }
#questions { z-index: 4; }
#demo { z-index: 5; }

/* Dividers and system notes, as a chat shows them. */
.divider { display: flex; justify-content: center; margin: 28px 0 22px; }
.divider span {
  padding: 6px 14px; border-radius: 10px; background: var(--white); color: var(--ink-soft);
  font-size: var(--step-small); font-weight: 560; box-shadow: 0 1px 1px rgba(15, 23, 42, 0.08);
}
.night .divider span { background: var(--navy-bubble); color: var(--on-navy-soft); }
.close .divider span { background: var(--blue-deep); color: var(--white); }
.system {
  width: fit-content; max-width: 100%; margin: 0 auto 20px; padding: 8px 14px; border-radius: 10px;
  background: var(--note); color: var(--note-ink); font-size: var(--step-small); text-align: center;
}
@media (max-width: 639px) { .system span { display: block; } }

/* Messages */
.exchange { display: flex; flex-direction: column; gap: 10px; }
.exchange + .exchange, .exchange + .divider { margin-top: 44px; }
.msg { position: relative; display: flex; max-width: 100%; }
.msg:where(:not(.msg-card)) > :is(p, .say) {
  position: relative; padding: 0.5em 0.75em 0.45em; border-radius: 22px; box-shadow: var(--bubble-shadow);
  --fs: var(--step-msg); font-size: var(--fs); text-wrap: pretty;
}
.say > :is(h1, h2) { display: inline; font: inherit; letter-spacing: inherit; }
.msg-me { justify-content: flex-end; }
.msg-me > p {
  max-width: min(86%, 28em); background: var(--blue); color: var(--white);
  font-weight: 520; border-top-right-radius: 6px;
}
.msg-me + .msg-me > p { border-top-right-radius: 22px; }
.msg-them:where(:not(.msg-card)) > :is(p, .say) {
  max-width: min(92%, 34em); background: var(--white); color: var(--ink);
  font-weight: 460; border-top-left-radius: 6px;
}
.msg-them + .msg-them:where(:not(.msg-card)) > :is(p, .say), .msg-them + .typing-slot + .msg-them > :is(p, .say) { border-top-left-radius: 22px; }
.night .msg-them:where(:not(.msg-card)) > :is(p, .say) { background: var(--navy-bubble); color: var(--white); }

/* RevoChat's key lines are the page's headings, at headline size; the hero keeps its two sentences whole. */
.msg-hero .line { display: block; }
/* On the narrowest screens the field steps aside, so the labelled button always fits. */
@media (max-width: 359px) {
  .composer-field { display: none; }
  .composer .composer-send { flex: 1; justify-content: center; }
}

.msg-hero > .say {
  max-width: 100%; --fs: var(--step-hero); font-weight: 760; line-height: 1.02;
  letter-spacing: -0.038em; padding: 0.32em 0.42em 0.3em; border-radius: 0.34em; border-top-left-radius: 0.1em;
  text-wrap: balance;
}
.msg-lede > p { max-width: min(92%, 30em); }
.msg-head > .say {
  max-width: min(94%, 20em); --fs: var(--step-head); font-weight: 740; line-height: 1.08;
  letter-spacing: -0.03em; padding: 0.42em 0.55em 0.4em; border-radius: 0.5em; border-top-left-radius: 0.16em;
  text-wrap: balance;
}
.msg-price > .say { --fs: var(--step-price); font-weight: 760; line-height: 1.05; letter-spacing: -0.035em; padding: 0.3em 0.45em 0.28em; border-radius: 0.36em; border-top-left-radius: 0.12em; text-wrap: balance; }

/* Time and read ticks rest in the bubble's bottom right, as a chat sets them; a spacer on the last
   line keeps their room, so a time never drops onto a line of its own. */
:is(p, .say):has(> .meta)::after { content: ""; display: inline-block; width: var(--meta-w, 3.9rem); }
.msg-me p:has(> .meta)::after { --meta-w: 5.4rem; }
.meta {
  position: absolute; right: calc(var(--pr, 0.75) * var(--fs)); bottom: calc(var(--pb, 0.45) * var(--fs) + 1px);
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.75rem; font-weight: 420; line-height: 1.4; letter-spacing: 0; color: var(--ink-soft); white-space: nowrap;
}
.msg-head .say { --pr: 0.55; --pb: 0.4; }
.msg-price .say { --pr: 0.45; --pb: 0.28; }
.msg-head .meta, .msg-price .meta { font-size: 0.8125rem; }
.msg-hero .meta, .msg-hero .say::after { display: none; }
/* Times on blue stay at 5.3:1. */
.msg-me .meta { color: var(--on-blue-meta); }
.msg-me .ticks { width: 16px; height: 11px; color: var(--sky); }
.night .msg-them .meta { color: var(--on-navy-soft); }

/* Quick replies, as a chat offers them under a message. */
.replies { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 10px; }
.reply {
  display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 22px; border-radius: 999px;
  background: var(--white); color: var(--blue); font-weight: 640; text-decoration: none;
  box-shadow: var(--bubble-shadow); border: 1px solid var(--line);
}
.reply .wa { width: 20px; height: 20px; flex: none; }
.reply:hover { border-color: var(--blue); background: var(--day); }
#start .replies .button { background: var(--white); color: var(--blue); border: 1px solid var(--line); box-shadow: var(--bubble-shadow); }
#start .replies .button:hover { border-color: var(--blue); background: var(--day); }
@media (max-width: 639px) {
  /* On a phone the composer under the thumb is the demo action; the opening offers the way on. */
  #start .replies .button { display: none; }
  .replies { gap: 10px; }
  .replies :is(.button, .reply) { padding: 0 16px 0 14px; font-size: 1rem; }
}

/* Cards RevoChat sends: forwarded inboxes, files, slots, summaries. */
.msg-card {
  flex-direction: column; --fs: var(--step-msg); font-size: var(--fs); align-self: flex-start; width: min(92%, 34em); padding: 14px 16px;
  background: var(--white); border-radius: 22px; box-shadow: var(--bubble-shadow);
}
.night .msg-card { background: var(--navy-bubble); }
.forwarded { font-size: 0.8em; padding: 0; font-weight: 560; color: var(--ink-soft); font-style: italic; margin-bottom: 8px; }
.night .forwarded { color: var(--on-navy-soft); }
.card-foot { margin-top: 10px; font-size: 0.8em; color: var(--ink-soft); }
.card-foot a { color: var(--blue); font-weight: 560; }

/* The missed inbox, forwarded at night. */
.tile { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; color: var(--white); }
.tile svg { width: 22px; height: 22px; }
.tile-wa { background: var(--whatsapp); }
.tile-tg { background: var(--telegram); }
.tile-web { background: var(--blue); }
.missed li { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 4px 12px; padding: 12px 0; border-top: 1px solid rgba(147, 197, 253, 0.2); }
.missed li:first-child { border-top: 0; }
.missed .what { display: grid; gap: 2px; min-width: 0; }
.missed .what strong { font-weight: 560; }
.missed .what :is(strong, q) { overflow-wrap: anywhere; }
.missed q { color: var(--on-navy-soft); font-size: 0.82em; }
.missed .state { grid-column: 2; display: inline-flex; align-items: center; gap: 6px; font-size: 0.82em; font-weight: 560; white-space: nowrap; }
.missed .state svg { width: 16px; height: 16px; flex: none; }
.missed .is-waiting .state { color: var(--waiting); }
.missed .is-lost .state { color: var(--lost); }
.missed .tile { position: relative; }
.missed .tile::after { content: ""; position: absolute; top: -4px; right: -4px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--navy-bubble); }
.missed .is-waiting .tile::after { background: var(--waiting); }
.missed .is-lost .tile::after { background: var(--lost); }

/* A forwarded chat inside the chat: a customer answered at 11:48 PM. */
/* The forwarded chat is the bubble itself: a label, then its three messages. */
.mini { display: grid; gap: 8px; }
/* As on the page, whoever asks writes on the right in blue; RevoChat answers on the left. */
.mini p { position: relative; width: fit-content; max-width: 88%; padding: 0.45em 0.7em; border-radius: 16px; --pr: 0.7; }
.mini p.forwarded { padding: 0; border-radius: 0; background: none; }
.mini-in { justify-self: end; background: var(--blue); color: var(--white); border-top-right-radius: 4px; }
.mini-out { justify-self: start; background: var(--navy); color: var(--white); border-top-left-radius: 4px; }
.mini-in:has(> .meta)::after { --meta-w: 4.2rem; }
.night .mini .mini-in .meta { color: var(--on-blue-meta); }
.night .mini .mini-out .meta { color: var(--on-navy-soft); }


/* Knowledge files, sent as attachments. */
.files { display: grid; }
.files li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.files li:first-child { border-top: 0; padding-top: 2px; }
.files svg { width: 28px; height: 28px; flex: none; color: var(--blue); }
.files span { display: grid; min-width: 0; }
.files strong { font-weight: 600; overflow-wrap: anywhere; }
.files small { font-size: 0.8em; color: var(--ink-soft); }

/* Free slots, as quick replies the customer taps. */
.slots-title { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 10px; }
.slots-title svg { width: 20px; height: 20px; color: var(--blue); }
.slots { display: flex; flex-wrap: wrap; gap: 8px; }
.slots li { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); font-weight: 560; font-variant-numeric: tabular-nums; }
.slots .taken { background: var(--blue); border-color: var(--blue); color: var(--white); }
.slots .taken span { font-size: 0.8em; }

/* A chat summed up. */
.summary-who { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.summary-who strong { font-size: 1.1em; font-weight: 640; }
/* A state is a word with a dot, never a pastel pill. */
.hot { display: inline-flex; align-items: center; gap: 6px; color: var(--hot); font-size: 0.8em; font-weight: 640; }
.hot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--hot-dot); }
.summary dl { display: grid; gap: 8px; }
.summary dl div { display: grid; gap: 2px; padding-top: 8px; border-top: 1px solid var(--line); }
.summary dt { font-size: 0.8em; color: var(--ink-soft); }
.summary dd { font-weight: 560; }

/* The plans, as RevoChat would send them: one row a plan, the price where the eye lands. */
.plans li { display: grid; gap: 4px; padding: 12px 0; border-top: 1px solid var(--line); }
.plans li:first-child { border-top: 0; padding-top: 2px; }
.plans ul { min-width: 0; }
.plan-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 12px; }
.plan-head strong { font-weight: 700; }
.plan-price { font-weight: 760; font-size: 1.15em; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.plan-price small { font-size: 0.6em; font-weight: 520; letter-spacing: 0; color: var(--ink-soft); }
.plans li > p:not(.plan-head) { font-size: 0.82em; color: var(--ink-soft); }
.plans .plan-term { color: var(--ink); font-weight: 560; }

.channels p { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.channels .tiles { display: inline-flex; gap: 8px; }

/* The close: the real reply, then the ask. */
.close .msg-them:where(:not(.msg-card)) > :is(p, .say) { background: var(--white); color: var(--ink); }
.close .msg-me > p { background: var(--blue-deep); }
.close .msg-ghost > p { background: none; box-shadow: none; border: 1.5px dashed rgba(255, 255, 255, 0.7); }
.msg-real { flex-direction: column; align-items: flex-start; }
.msg-real > p:first-child { border-top-left-radius: 22px; }
.close .msg-real > .real-label {
  margin-top: 8px; padding: 0; max-width: none; border-radius: 0; box-shadow: none; background: none;
  font-size: var(--step-small); font-weight: 560; color: var(--white);
}
.replies-close { flex-direction: column; align-items: flex-start; margin: 18px 0 8px; }
.replies-close .button { background: var(--white); color: var(--blue); min-height: 60px; padding: 0 28px 0 22px; font-size: 1.1875rem; }
.replies-close .button:hover { color: var(--blue-press); background: var(--day); }
.replies-close .or-email { margin-top: 2px; color: var(--white); }
.replies-close .or-email a { color: var(--white); }
.note { font-size: var(--step-small); color: var(--white); }
/* The image message sizes to its picture and two lines, not to the bubbles' measure. */
.msg-card.qr-card { flex-direction: row; align-items: center; gap: 18px; width: fit-content; color: var(--ink); }
.qr { flex: none; width: 140px; height: 140px; padding: 12px; background: var(--white); border-radius: 12px; border: 1px solid var(--line); }
.qr-card p { font-size: 1rem; max-width: 20em; }
.or-email { display: inline-block; margin-top: 8px; font-size: var(--step-small); color: var(--ink-soft); }
.or-email a { color: var(--blue); font-weight: 560; overflow-wrap: anywhere; }

/* The composer: the prefilled demo message, waiting to be sent. */
.composer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px; min-height: var(--composer);
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
  background: var(--white); border-top: 1px solid var(--line); text-decoration: none; color: var(--ink);
}
.composer-field {
  flex: 1; min-width: 0; padding: 12px 18px; border-radius: 999px; background: var(--day);
  color: var(--ink-soft); font-size: 0.9375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.composer-send {
  display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 48px; padding: 0 18px 0 14px;
  border-radius: 999px; background: var(--blue); color: var(--white); font-weight: 640; font-size: 0.9375rem;
}
.composer-send .wa { width: 20px; height: 20px; }
.composer:hover .composer-send { background: var(--blue-press); }
.composer:focus-visible { outline: none; border-radius: 0; }
.composer:focus-visible .composer-send { outline: 3px solid var(--blue); outline-offset: 3px; }
@media (max-width: 639px) {
  .composer-field {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal;
    padding: 0 14px; border-block: 7px solid var(--day); border-radius: 16px; font-size: 0.8125rem; line-height: 1.3;
  }
}

.site-footer { background: var(--blue); color: var(--white); font-size: var(--step-small); padding-bottom: calc(var(--composer) + 8px); }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 24px; padding-top: 14px; padding-bottom: 22px; border-top: 1px solid rgba(255, 255, 255, 0.28); }
.footer-row nav { display: flex; gap: 20px; }
.footer-row a { display: inline-flex; align-items: center; min-height: 44px; color: var(--white); text-decoration: none; font-weight: 560; overflow-wrap: anywhere; }
.footer-row a:hover { text-decoration: underline; text-underline-offset: 4px; }


@media (max-width: 639px) {
  .who-role { display: none; }
  .msg-hero > h1 { max-width: 100%; }
  .qr-card { display: none; }
}

@media (min-width: 980px) {
  .tile { width: 48px; height: 48px; border-radius: 14px; }
  .tile svg { width: 26px; height: 26px; }
  .missed li { grid-template-columns: 48px minmax(0, 1fr); }
  .exchange { gap: 12px; }
  .typing-slot { margin-bottom: -12px; }
  .exchange + .exchange, .exchange + .divider { margin-top: 64px; }
  .sheet { padding-top: 56px; padding-bottom: calc(var(--sheet) + 88px); }
  .sheet.close { padding-bottom: 72px; }
  .msg-card { width: min(70%, 34em); }
}

/* Each exchange plays as it scrolls in: the visitor's message, typing dots, the reply.
   The dots sit in a zero-height slot where the reply will land, so nothing shifts. */
.typing-slot { position: relative; z-index: 1; height: 0; margin-bottom: -10px; }
.typing {
  position: absolute; left: 0; top: 0; display: none; gap: 5px; padding: 14px 16px;
  border-radius: 22px 22px 22px 6px; background: var(--white); box-shadow: var(--bubble-shadow);
}
.night .typing { background: var(--navy-bubble); }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-soft); }
.night .typing i { background: var(--on-navy-soft); }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .motion .exchange:not(.play) > * { opacity: 0; }
  @keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.96); } }
  @keyframes typing { 0% { opacity: 0; transform: scale(0.8); } 15%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }
  @keyframes dot { 0%, 60%, 100% { transform: none; opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }
  .motion .exchange.play > .msg-me { transform-origin: right top; animation: pop 380ms cubic-bezier(0.16, 1, 0.3, 1) var(--d, 0ms) both; }
  .motion .exchange.play > .msg-them, .motion .exchange.play > .replies, .motion .exchange.play > .msg-card { transform-origin: left top; animation: pop 420ms cubic-bezier(0.16, 1, 0.3, 1) var(--d, 0ms) both; }
  .motion .exchange.play:not(.quiet) .typing { display: inline-flex; animation: typing var(--t-len, 700ms) ease-out var(--t, 0ms) both; transform-origin: left top; }
  .motion .exchange.play .typing i { animation: dot 600ms ease-in-out var(--t, 0ms) 2; }
  .motion .exchange.play .typing i:nth-child(2) { animation-delay: calc(var(--t, 0ms) + 120ms); }
  .motion .exchange.play .typing i:nth-child(3) { animation-delay: calc(var(--t, 0ms) + 240ms); }
  .chat-head.is-typing .online { animation: online 1.2s ease-out infinite; }
  .motion .exchange.play.now > * { animation: none; opacity: 1; }
  .motion .exchange.play > .hurry { animation-delay: 0ms; }
  .motion .exchange.play > .typing-slot.hurry { display: none; }
  @keyframes online { 0%, 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); } 60% { box-shadow: 0 0 0 6px rgba(37, 211, 102, 0); } }
  .button, .reply, .composer-send { transition: background-color 160ms ease, border-color 160ms ease, transform 160ms cubic-bezier(0.16, 1, 0.3, 1); }
  .button:active, .reply:active, .composer:active .composer-send { transform: scale(0.97); }
}

/* The 404: one short exchange, no composer, the footer right under it. */
.lost { min-height: 100vh; display: flex; flex-direction: column; }
.lost .thread { flex: 1; display: flex; flex-direction: column; }
.lost .sheet { flex: 1; }
.lost .site-footer {
  position: relative; z-index: 2; padding-bottom: 0; padding-top: 8px;
  margin-top: calc(-1 * var(--sheet)); border-radius: var(--sheet) var(--sheet) 0 0;
}
.lost .sheet { padding-bottom: calc(var(--sheet) + 56px); }
.lost .footer-row { border-top: 0; }

/* On paper the whole conversation shows, and nothing is pinned. */
@media print {
  .chat-head, .composer { position: static; }
  .motion .exchange > * { opacity: 1 !important; animation: none !important; }
  .typing-slot { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  /* A missed chat that is still waiting pings, three times, once its exchange plays. */
  @keyframes ping { from { transform: scale(1); opacity: 0.7; } to { transform: scale(2.6); opacity: 0; } }
  .missed .is-waiting .tile::before {
    content: ""; position: absolute; top: -4px; right: -4px; width: 12px; height: 12px;
    border-radius: 50%; background: var(--waiting); opacity: 0;
  }
  .motion .exchange.play .missed .is-waiting .tile::before { animation: ping 1.6s ease-out var(--d, 0ms) 3; }
}
