:root {
  --primary: #4f5e22;
  --secondary: #8a8d93;
  --on-primary: #ffffff;
  --bg: #f4f5f6;
  --surface: #ffffff;
  --text: #1d2023;
  --muted: #5d636a;
  --line: #dde0e3;
  --radius: 14px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", sans-serif;
  -webkit-text-size-adjust: 100%;
}
.bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 16px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: var(--surface);
  border-bottom: 3px solid var(--primary);
}
.logo { max-height: 36px; max-width: 160px; object-fit: contain; }
.brand { font-weight: 600; font-size: 17px; }
.view { flex: 1; width: 100%; max-width: 680px; margin: 0 auto; padding: 16px 12px 8px; }
.messages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: var(--radius); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-start-start-radius: 4px; }
.msg.customer { align-self: flex-end; background: var(--primary); color: var(--on-primary); border-start-end-radius: 4px; }
.card { align-self: stretch; background: var(--surface); border: 1px solid var(--line); border-inline-start: 5px solid var(--secondary); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.card.exit, .card.leave, .card.deferred_leave { border-inline-start-color: var(--primary); }
.card p { margin: 0; font-weight: 500; }
.card .number { display: flex; flex-direction: column; gap: 2px; }
.card .number small { color: var(--muted); font-size: 13px; }
.card .number strong { font-size: 26px; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.card a.pay { display: block; text-align: center; padding: 12px; border-radius: 10px; background: var(--primary); color: var(--on-primary); text-decoration: none; font-weight: 600; }
.card img { width: 100%; border-radius: 8px; }
.typing { align-self: flex-start; display: flex; gap: 5px; padding: 14px; }
.typing span { width: 8px; height: 8px; border-radius: 50%; background: var(--secondary); animation: blink 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .typing span { animation: none; opacity: 0.6; } }
.notice { margin: 16px 0 0; padding: 12px 14px; border-radius: 10px; background: #fff4e5; color: #6a4300; }
.composer {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 10px 12px;
  background: var(--bg);
}
.composer textarea {
  flex: 1;
  resize: none;
  min-height: 46px;
  max-height: 140px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 23px;
  font: inherit;
  background: var(--surface);
  color: var(--text);
}
.composer textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--secondary); outline-offset: 2px; }
.composer button {
  min-width: 46px;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 23px;
  background: var(--primary);
  color: var(--on-primary);
  font: inherit;
  font-weight: 600;
}
.composer button:disabled, .composer textarea:disabled { opacity: 0.5; }
.legal {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 6px 12px calc(10px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 14px;
}
.legal button, .back { background: none; border: 0; padding: 6px; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }
.info h1 { font-size: 20px; margin: 8px 0 12px; }
.info p, .info address { margin: 0 0 10px; font-style: normal; }
.info a { color: var(--primary); }
.back { padding-inline-start: 0; color: var(--primary); }
[hidden] { display: none !important; }
