.xora-chat-widget {
  --chat-teal: #064a63;
  --chat-teal-dark: #03394e;
  --chat-orange: #f97316;
  --chat-green: #20b83d;
  position: fixed;
  z-index: 10000;
  right: 24px;
  bottom: 24px;
  font-family: "Onest", "Segoe UI", sans-serif;
  color: #112a32;
}

.xora-chat-widget *, .xora-chat-widget *::before, .xora-chat-widget *::after { box-sizing: border-box; }
.xora-chat-widget [hidden] { display: none !important; }
.xora-chat-widget button, .xora-chat-widget input { font: inherit; }

.xora-chat-launcher {
  position: relative;
  display: grid;
  width: 68px;
  height: 68px;
  padding: 0;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #075a75, #033b52);
  border: 2px solid rgba(255,255,255,.92);
  border-radius: 50%;
  box-shadow: 0 10px 26px rgba(4,74,99,.32), 0 0 0 7px rgba(21,94,117,.09);
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease;
}

.xora-chat-launcher:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(4,74,99,.38), 0 0 0 8px rgba(21,94,117,.1); }
.xora-chat-launcher svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.xora-chat-launcher::after { position: absolute; right: 1px; bottom: 2px; width: 17px; height: 17px; content: ""; background: #26c943; border: 2px solid #fff; border-radius: 50%; }

.xora-chat-panel {
  position: absolute;
  right: 0;
  bottom: 84px;
  width: min(390px, calc(100vw - 32px));
  max-height: min(650px, calc(100vh - 128px));
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(8,66,84,.1);
  border-radius: 24px;
  box-shadow: 0 24px 65px rgba(5,47,61,.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(.97);
  transform-origin: right bottom;
  transition: opacity .22s ease, visibility .22s ease, transform .22s ease;
}

.xora-chat-widget.is-open .xora-chat-panel { opacity: 1; visibility: visible; transform: none; }
.xora-chat-widget.is-open .xora-chat-launcher { transform: scale(.94); }

.xora-chat-header {
  display: flex;
  min-height: 92px;
  padding: 21px 22px;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  background: linear-gradient(135deg, #03445d, #075f7c);
}

.xora-chat-brand strong { display: block; font-size: 1.35rem; letter-spacing: -.03em; }
.xora-chat-brand strong span { color: var(--chat-orange); }
.xora-chat-status { display: flex; gap: 7px; margin-top: 4px; align-items: center; font-size: .76rem; color: rgba(255,255,255,.78); }
.xora-chat-status i { width: 9px; height: 9px; background: #2bd34a; border-radius: 50%; }
.xora-chat-header-actions { display: flex; gap: 6px; }
.xora-chat-icon-button { display: grid; width: 38px; height: 38px; padding: 0; place-items: center; color: #fff; background: transparent; border: 0; border-radius: 50%; cursor: pointer; }
.xora-chat-icon-button:hover { background: rgba(255,255,255,.12); }
.xora-chat-icon-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.xora-chat-screen { min-height: 0; }
.xora-chat-welcome { position: relative; padding: 30px 30px 32px; color: #fff; background: radial-gradient(circle at 82% 18%, rgba(10,112,145,.5), transparent 32%), linear-gradient(150deg, #03445d, #075f7c); }
.xora-chat-welcome::after { position: absolute; top: 42px; right: 20px; width: 85px; height: 85px; content: ""; opacity: .2; background-image: radial-gradient(circle, #fff 2px, transparent 2.5px); background-size: 17px 17px; }
.xora-chat-welcome-icon { display: grid; width: 62px; height: 62px; margin-bottom: 24px; place-items: center; color: #fff; background: rgba(5,111,145,.65); border-radius: 50%; }
.xora-chat-welcome-icon svg { width: 31px; height: 31px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.xora-chat-welcome h2 { position: relative; z-index: 1; margin: 0; max-width: 295px; font-size: 1.7rem; line-height: 1.2; letter-spacing: -.035em; }
.xora-chat-welcome h2::after { display: block; width: 48px; height: 4px; margin-top: 18px; content: ""; background: var(--chat-orange); border-radius: 99px; }
.xora-chat-welcome > p { margin: 18px 0 24px; max-width: 300px; font-size: .94rem; line-height: 1.55; color: rgba(255,255,255,.78); }
.xora-chat-choice { display: flex; width: 100%; min-height: 58px; margin-top: 12px; padding: 10px 18px; align-items: center; gap: 12px; color: #fff; border: 0; border-radius: 999px; font-weight: 750; cursor: pointer; transition: transform .2s ease, filter .2s ease; }
.xora-chat-choice:hover { transform: translateY(-2px); filter: brightness(1.04); }
.xora-chat-choice svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.xora-chat-choice i { margin-left: auto; font-size: 1.4rem; font-style: normal; }
.xora-chat-choice-chat { background: linear-gradient(135deg, #ff6a10, #f97316); }
.xora-chat-choice-whatsapp { background: linear-gradient(135deg, #19a936, #29c741); }

.xora-chat-conversation { display: none; height: min(558px, calc(100vh - 220px)); min-height: 430px; background: #fff; }
.xora-chat-widget[data-screen="chat"] .xora-chat-welcome { display: none; }
.xora-chat-widget[data-screen="chat"] .xora-chat-conversation { display: flex; flex-direction: column; }
.xora-chat-messages { flex: 1; min-height: 0; padding: 20px 18px; overflow-y: auto; overscroll-behavior: contain; background: linear-gradient(#fff, #fbfcfd); }
.xora-chat-greeting { display: flex; gap: 11px; margin-bottom: 14px; align-items: flex-start; }
.xora-chat-avatar { flex: 0 0 auto; display: grid; width: 42px; height: 42px; place-items: center; color: #fff; background: linear-gradient(145deg, #087499, #03445d); border-radius: 50%; font-size: 1.25rem; }
.xora-chat-bubble { max-width: 82%; padding: 13px 15px; font-size: .88rem; line-height: 1.5; border-radius: 17px; }
.xora-chat-bubble.bot { background: #eef5fa; border-top-left-radius: 5px; }
.xora-chat-bubble.user { margin: 12px 0 12px auto; color: #fff; background: linear-gradient(135deg, #075c78, #03445d); border-bottom-right-radius: 5px; }
.xora-chat-bubble a { display: inline-flex; margin-top: 9px; padding: 7px 11px; color: #fff; background: #f97316; border-radius: 999px; font-size: .76rem; font-weight: 750; }
.xora-chat-quick-actions { display: grid; gap: 8px; margin: 12px 0 16px 53px; }
.xora-chat-quick-actions button { min-height: 43px; padding: 9px 13px; text-align: left; color: #123b49; background: #fff; border: 1px solid #d8e2e5; border-radius: 12px; cursor: pointer; }
.xora-chat-quick-actions button:hover { color: #f97316; border-color: #f97316; }
.xora-chat-profile { margin: 14px 0 18px 53px; padding: 16px; background: #f5f8f9; border: 1px solid #dfe8ea; border-radius: 16px; }
.xora-chat-profile > strong { display: block; font-size: .95rem; color: #123b49; }
.xora-chat-profile > p:not(.xora-chat-error) { margin: 3px 0 13px; font-size: .78rem; line-height: 1.4; color: #5c7077; }
.xora-chat-profile label { display: grid; gap: 5px; margin-top: 9px; color: #284a55; font-size: .76rem; font-weight: 700; }
.xora-chat-profile input { width: 100%; height: 42px; padding: 0 12px; background: #fff; border: 1px solid #cedcdf; border-radius: 10px; outline: none; }
.xora-chat-profile input:focus { border-color: #1680a3; box-shadow: 0 0 0 3px rgba(22,128,163,.1); }
.xora-chat-profile button { width: 100%; min-height: 42px; margin-top: 12px; color: #fff; background: var(--chat-orange); border: 0; border-radius: 999px; font-weight: 750; cursor: pointer; }
.xora-chat-error { min-height: 16px; margin: 6px 0 0; color: #b42318; font-size: .74rem; }
.xora-chat-connection { min-height: 20px; margin: 0; padding: 2px 18px; text-align: center; color: #60727a; background: #fff; font-size: .72rem; }
.xora-chat-connection[data-type="error"] { min-height: 30px; padding: 6px 18px; color: #a4251a; background: #fff2f0; }
.xora-chat-connection[data-type="success"] { color: #16752a; }
.xora-chat-typing { display: inline-flex; gap: 4px; margin: 4px 0 8px 53px; padding: 10px 14px; background: #eef3f5; border-radius: 16px; }
.xora-chat-typing i { width: 6px; height: 6px; background: #1680a3; border-radius: 50%; animation: xora-chat-dot 1s infinite alternate; }
.xora-chat-typing i:nth-child(2) { animation-delay: .18s; }.xora-chat-typing i:nth-child(3) { animation-delay: .36s; }
@keyframes xora-chat-dot { to { opacity: .35; transform: translateY(-3px); } }

.xora-chat-form { display: flex; gap: 9px; padding: 14px 16px 17px; border-top: 1px solid #e7edef; }
.xora-chat-form input { min-width: 0; flex: 1; height: 48px; padding: 0 16px; color: #163943; background: #fff; border: 1px solid #d7e1e4; border-radius: 999px; outline: none; }
.xora-chat-form input:focus { border-color: #1680a3; box-shadow: 0 0 0 3px rgba(22,128,163,.12); }
.xora-chat-send { display: grid; flex: 0 0 auto; width: 48px; height: 48px; padding: 0; place-items: center; color: #fff; background: #f97316; border: 0; border-radius: 50%; cursor: pointer; }
.xora-chat-send svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.xora-chat-form.is-sending { opacity: .7; }
.xora-chat-send:disabled { cursor: wait; }

.xora-chat-widget button:focus-visible, .xora-chat-widget a:focus-visible, .xora-chat-widget input:focus-visible { outline: 3px solid rgba(249,115,22,.55); outline-offset: 3px; }

@media (max-width: 600px) {
  .xora-chat-widget { right: 14px; bottom: 14px; }
  .xora-chat-launcher { width: 60px; height: 60px; }
  .xora-chat-panel { position: fixed; right: 10px; bottom: 84px; left: 10px; width: auto; max-height: calc(100dvh - 100px); border-radius: 20px; }
  .xora-chat-header { min-height: 76px; padding: 14px 17px; }
  .xora-chat-welcome { padding: 24px 22px 25px; }
  .xora-chat-welcome-icon { width: 52px; height: 52px; margin-bottom: 18px; }
  .xora-chat-welcome h2 { font-size: 1.45rem; }
  .xora-chat-choice { min-height: 53px; }
  .xora-chat-conversation { height: calc(100dvh - 176px); min-height: 390px; }
  .xora-chat-profile { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .xora-chat-panel, .xora-chat-launcher, .xora-chat-choice { transition: none; }
  .xora-chat-typing i { animation: none; }
}
