@font-face {font-family: Vazirmatn; src: url("/font-bold.woff2") format("woff2"); font-weight: 700 900; font-display: swap;}
@font-face {
  font-family: Vazirmatn;
  src: url("/font.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #29201a;
  --muted: #6b5b52;
  --line: #e9ddd4;
  --orange: #b64212;
  --orange-dark: #96320e;
  --tint: #fff1e7;
  font: 14px Vazirmatn, Tahoma, sans-serif;
  color: var(--ink);
  background: #fffaf6;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; }
body.standalone {
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(ellipse at 45% 7%, #ffdfc7, #f8f0e9 48%, #f0e7e0);
}
.panel {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fffaf6;
}
.standalone .panel {
  width: min(100%, 438px);
  height: min(690px, calc(100dvh - 40px));
  border: 1px solid #f4ccb2;
  border-radius: 25px;
  box-shadow: 0 24px 70px #50261128;
}
.hero {
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 17px 18px;
  color: #fff;
  background: linear-gradient(118deg, #b83f11, #d35316);
}
.hero-icon {
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  border-radius: 15px;
  background: #ffffff25;
  border: 1px solid #ffffff50;
}
.hero-copy { flex: 1; }
h1, h2, p { margin: 0; }
.hero h1 { font-size: 1.25rem; line-height: 1.35; font-weight: 820; }
.hero p { margin-top: 3px; font-size: .85rem; color: #fff6ee; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid #c7511b;
  outline-offset: 2px;
}
.hero button:focus-visible { outline-color: white; }
.close {
  width: 39px;
  height: 39px;
  border: 0;
  border-radius: 12px;
  background: #ffffff22;
  color: #fff;
  font: 24px system-ui;
}
.bubble {
  position: relative;
  display: inline-block;
  width: 17px;
  height: 13px;
  border: 1.8px solid currentColor;
  border-radius: 5px;
}
.bubble::after {
  position: absolute;
  right: 3px;
  bottom: -4px;
  width: 4px;
  height: 4px;
  border-right: 1.8px solid currentColor;
  transform: skewY(-43deg);
  content: "";
}
.paper {
  width: 13px;
  height: 16px;
  border: 1.8px solid currentColor;
  border-radius: 3px;
  background: repeating-linear-gradient(to bottom, transparent 0 3px, currentColor 3px 4px, transparent 4px 6px) center / 6px 10px no-repeat;
}
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px;
  margin: 13px 15px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f6ede6;
}
.tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  padding: 5px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}
.tabs button[aria-selected="true"] {
  background: #fff;
  color: var(--orange-dark);
  box-shadow: 0 1px 4px #5f2c131b;
}
.chat { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
.stream { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 14px 16px; }
.welcome {
  margin: 10px auto;
  padding: 25px 12px;
  width: 100%;
  border: 1px solid #f0d8c8;
  border-radius: 17px;
  background: #fff4eb;
  text-align: center;
}
.welcome > .bubble { color: var(--orange); }
.welcome h2, .confirmation h2, .form-title h2 { margin-top: 8px; font-size: 1.14rem; font-weight: 810; }
.welcome p, .form-title p, .confirmation p { margin-top: 4px; color: var(--muted); font-size: .88rem; }
.message { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 12px; }
.message.operator { align-items: flex-end; }
.message.system { align-items: center; }
.message small { color: var(--muted); font-size: .75rem; padding-inline: 7px; }
.message p {
  max-width: 83%;
  padding: 9px 12px;
  border-radius: 14px;
  background: var(--tint);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  unicode-bidi: plaintext;
}
.message.operator p { border: 1px solid var(--line); background: #fff; }
.message.system p { color: var(--orange-dark); max-width: 100%; font-size: .85rem; }
.composer {
  display: flex;
  align-items: end;
  gap: 8px;
  margin: 0 14px 14px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.composer textarea { flex: 1; min-width: 0; border: 0; padding: 10px; min-height: 43px; max-height: 110px; }
.send, .primary {
  border: 0;
  background: var(--orange);
  color: white;
  font-weight: 760;
  border-radius: 12px;
}
.send { height: 43px; width: 45px; font-size: 22px; }
.send:hover, .primary:hover { background: var(--orange-dark); }
button:disabled { opacity: .55; cursor: wait; }
.intake { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px 16px; }
.form-title { margin: 0 0 12px; }
.form-title h2 { margin: 0; }
.intake form { display: grid; gap: 9px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
label { display: block; min-width: 0; font-size: .88rem; font-weight: 700; }
.optional { font-weight: 400; color: var(--muted); }
input, textarea, select {
  display: block;
  width: 100%;
  padding: 8px 10px;
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 400;
}
label > input, label > textarea, label > select { margin-top: 3px; min-height: 40px; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #77665b; }
.primary, .secondary { min-height: 42px; padding: 8px 13px; }
.primary span { float: left; }
.secondary { background: transparent; color: var(--orange-dark); border: 0; }
.error { margin: 4px 14px 8px; color: #ab231b; font-size: .85rem; }
.confirmation { display: grid; justify-items: center; gap: 12px; margin: 25px auto; text-align: center; }
.confirmation > span {
  display: grid; place-items: center; width: 54px; height: 54px;
  border-radius: 50%; background: #fbe4d4; color: var(--orange-dark); font-size: 25px;
}
#ticket-code { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--tint); }
@media (max-width: 380px) { .hero { padding: 13px; } .tabs { margin-inline: 11px; } .intake { padding-inline: 12px; } }
