/* Cella chat — palette taken from the pitch deck. */
:root {
  /* Brand tokens from .impeccable.md — soft purple + soft pink, nothing pure black. */
  --ink: #57575c;
  --ink-strong: #3a3352;
  --muted: #8a87a0;
  --ground: #fcfaff;
  --line: #ebe6f5;
  --lavender: #bdb3e3;
  --pink: #fac8c8;
  --pink-50: #fff5f5;
  --purple: #6f61ad;
  --purple-50: #f5f3fb;
  --ok: #4c9a63;
  --serif: "Bodoni Moda", "Playfair Display", Georgia, serif;
  --sans: "Gothic A1", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --radius: 1rem;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  background: linear-gradient(135deg, #4a4260, #6b5a70);
  color: var(--ink);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

.chat {
  width: 100%;
  max-width: 480px;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--ground);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.chat-header h1 { margin: 0; font-family: var(--serif); font-size: 21px; font-weight: 500; letter-spacing: 0.01em; color: var(--ink-strong); }
.chat-header p { margin: 0; font-size: 13px; color: var(--muted); }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--lavender), var(--pink));
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bubble {
  max-width: 84%;
  padding: 10px 14px;
  border-radius: 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bubble.cella { align-self: flex-start; background: #fff; border: 1px solid var(--line); }
.bubble.client { align-self: flex-end; background: linear-gradient(135deg, var(--lavender), var(--pink)); }
.bubble.error { align-self: flex-start; background: #fff4f4; border: 1px solid #f0c4c4; }

.activity { align-self: flex-start; font-size: 13px; color: var(--muted); padding-left: 4px; }

.card {
  align-self: flex-start;
  width: 84%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--lavender);
  background: linear-gradient(135deg, #f4f0fc, #fdf1f3);
  font-size: 14px;
}
.card h2 { margin: 0 0 8px; font-family: var(--serif); font-size: 16px; font-weight: 500; color: var(--ink-strong); }
.card { white-space: pre-wrap; }
.card p { margin: 2px 0; }
.card .status { margin-top: 8px; color: var(--ok); font-weight: 600; }
.card a { color: var(--purple); }
.card details { margin-top: 8px; }
.card summary { cursor: pointer; color: var(--purple); }
.card .line-cella, .card .line-clinic { margin: 4px 0; font-size: 13px; }
.card .line-clinic { color: var(--muted); }

.starters { display: flex; flex-direction: column; gap: 8px; }
.starters-title { margin: 0 0 4px; color: var(--muted); font-size: 14px; }
.chip {
  text-align: left;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--lavender);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.chip:hover { border-color: var(--purple); }

.composer {
  display: flex;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.composer input {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  border-radius: 22px;
  border: 1px solid var(--line);
  font: inherit;
  outline: none;
}
.composer input:focus { border-color: var(--purple); }
.composer button {
  padding: 0 18px;
  border: 0;
  border-radius: 22px;
  background: var(--purple);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.composer button:disabled { opacity: 0.5; cursor: default; }

/* --- test offer: a quiet product card, white on the chat ground (the gradient is
   for the page background only, per the brand guide) --- */
.offer {
  align-self: flex-start;
  width: 94%;
  padding: 18px 20px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 1px 2px rgba(58, 51, 82, 0.04);
}
.offer .eyebrow {
  margin: 0 0 14px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lavender);
}
.offer .option { display: block; padding: 0; border: 0; }
.offer .option + .option, .offer .bundle-option {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.offer .head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}
.offer .option-name {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink-strong);
}
.offer .price {
  flex-shrink: 0;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
  color: var(--ink-strong);
  font-variant-numeric: lining-nums;
}
.offer .price .was {
  display: block;
  font-family: var(--sans);
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  text-decoration: line-through;
}
.offer .option-reason {
  margin: 7px 0 14px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink);
}
.offer .buy {
  width: 100%;
  padding: 11px 16px;
  border: 1px solid var(--purple);
  border-radius: 999px;
  background: #fff;
  color: var(--purple);
  font: 600 13.5px/1 var(--sans);
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color 180ms cubic-bezier(0.22, 1, 0.36, 1), color 180ms;
}
.offer .buy:hover { background: var(--purple-50); }
.offer .buy.primary { background: var(--purple); border-color: var(--purple); color: #fff; }
.offer .buy.primary:hover { background: var(--ink-strong); border-color: var(--ink-strong); }
.offer .buy:disabled { opacity: 0.4; cursor: default; }
.offer .bundle-option .option-name { font-size: 20px; }
.offer .tag {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--pink-50);
  color: #a15b5b;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.offer .footnote {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
}
/* one calm entrance, staggered; transform + opacity only */
.offer .option { animation: rise 420ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.offer .option:nth-child(3) { animation-delay: 70ms; }
.offer .option:nth-child(4) { animation-delay: 140ms; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .offer .option { animation: none; } }

/* --- photos --- */
.bubble img.photo { display: block; max-width: 200px; border-radius: 10px; }
.photo-preview[hidden] { display: none; }  /* `hidden` must beat the display rule below */
.photo-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.photo-preview img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; }
.photo-preview button {
  margin-left: auto;
  border: 0;
  background: none;
  color: var(--purple);
  font: inherit;
  cursor: pointer;
}
.photo-button {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 22px;
  color: var(--purple);
  cursor: pointer;
  user-select: none;
}
.photo-button:hover { border-color: var(--purple); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
