@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');
:root {
  --chat-width: 335px;
}

.chat-window,
#chatWindow {
  width: var(--chat-width);
  min-width: 200px;
  max-width: min(96vw, 1200px);
  resize: both;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.chat-window {
  position: fixed;
  top: 80px;
  left: auto;
  right: 20px;
  height: 460px;
  min-height: 360px;
  max-height: 90vh;
  background: #fff;
  box-shadow: -2px 0 10px rgba(0,0,0,0.2);
  display: none;
  flex-direction: column;
  z-index: 1000;
  border-radius: 12px;
  font-family: 'Inter', serif !important;
  resize: both;
  overflow: hidden; 
}

.drag-handle {
  cursor: move;
  padding: 10px 12px;
  font-weight: bold;
  text-align: center;
  background: var(--chat-accent);
  color: #fff;
  border-radius: 12px 12px 0 0;
  user-select: none;
  background: linear-gradient(135deg, var(--chat-accent), color-mix(in srgb, var(--chat-accent) 80%, white 20%));
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.chat {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background-color: #f5f5f5;
  -webkit-overflow-scrolling: touch;
  overflow-anchor: auto;
  border-bottom: 1px solid #e5e7eb;
}

input[type="text"] {
  flex: 1;
  padding: 10px 14px;
  font-size: 16px;
  background: #f7fafc;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  outline: none;
  color: #111827;
  font-family: 'Inter', serif !important;
  box-sizing: border-box;
}

input[type="text"]:focus {
  border-color: #d1d5db;
  box-shadow: 0 0 0 0px rgba(76,175,80,0.12);
}


button {
  padding: 10px 16px;
  font-size: 16px;
  cursor: pointer;
  border: 0;
  background: var(--chat-accent);
  color: #fff;
  border-radius: 12px;
}

.bubble {
  max-width: 80%;
  margin-bottom: 10px;
  padding: 10px 14px;
  border-radius: 18px;
  line-height: 1.4;
  word-wrap: break-word;
  animation: fadeIn 0.25s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.bot-bubble {
  background-color: #eeeeee;
  color: #111827;
  align-self: flex-start;
  animation: fadeIn 0.25s ease-out;
}

.user-bubble {
  background-color: var(--chat-accent);
  color: white;
  align-self: flex-end;
  animation: fadeIn 0.25s ease-out;
}

.typing-bubble {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 18px;
  background-color: #eee;
  max-width: 120px;
}

.typing-bubble .dot {
  display: inline-block;
  width: 6px; height: 6px;
  margin: 0 2px; background-color: #888; border-radius: 50%;
  animation: blink 1.4s infinite;
}

.typing-bubble .dot.one { animation-delay: 0s; }
.typing-bubble .dot.two { animation-delay: 0.2s; }
.typing-bubble .dot.three { animation-delay: 0.4s; }
@keyframes blink { 0%,80%,100%{opacity:.2} 40%{opacity:1} }

#botToggle {
  position: fixed;
  bottom: 20px; right: 20px;
  width: 60px; height: 60px;
  cursor: pointer; z-index: 1001;
}

@keyframes slideInFromRight {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes slideInFromLeft {
  from { transform: translateX(-40px); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}

.slide-in-right { animation: slideInFromRight .45s ease-out; }
.slide-in-left  { animation: slideInFromLeft  .45s ease-out; }
.drag-handle { position: relative; background: linear-gradient(135deg, var(--chat-accent), color-mix(in srgb, var(--chat-accent) 80%, white 20%));}
.chat-close{
  position:absolute; right:8px; top:6px;
  width:28px; height:28px;
  border-radius:50%;
  border:0;
  cursor:pointer;
  background:rgba(255,255,255,.25);
  color:#fff !important;
  font-size:18px;
  font-weight:700;
  display:flex;
  align-items:center;
  justify-content:center;
  line-height:1;
  padding:0;
}

.chat-close:hover{ background:rgba(255,255,255,.4); }

#chatWindow .suggest-box{
  background:#fff; border:1px solid #e5e7eb; border-radius:10px;
  box-shadow:0 6px 20px rgba(0,0,0,.08);
  overflow:auto; display:none;
  cursor: default;
  z-index: 3000; 
}

#chatWindow .suggest-item{ padding:8px 12px; cursor: pointer; user-select: none;}
#chatWindow .suggest-item:hover{ background:#f3f4f6; cursor: pointer; user-select: none;}
#chatWindow .input-area.sugg-open #input{ caret-color: transparent; }

.order-btn { border:0; padding:8px 14px; border-radius:10px; cursor:pointer; background:#2563eb; color:#fff; font-weight:600; }
.order-btn:hover { filter:brightness(.96); }
.pb-embed html, .pb-embed body {
  margin: 0; padding: 0; background: transparent !important;
  overflow: hidden;
}

.pb-embed #botToggle,
.pb-embed .chat-window { pointer-events: auto; }

.pb-embed #botToggle {
  position: fixed;
  right: 20px; bottom: 20px;
  width: 64px; height: 64px;
  box-shadow: none; background: transparent;
  z-index: 2147483647;
}

.pb-embed .chat-window {
  position: fixed;
  right: 20px; bottom: calc(20px + 64px + 8px); 
  margin: 0; box-shadow: none;
}

.send-wrap {
  position: relative;
  width: 100%;
}

.send-wrap input#input {
  width: 100%;
  padding: 14px 64px 14px 16px;        
  font-size: 16px;
  background: #eef2ff;                  
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  outline: none;
  color: #111827;
}

.send-wrap input#input:focus {
  border-color: #d1d5db;
  box-shadow: 0 0 0 0px rgba(37,99,235,.12); 
}

.send-wrap .send-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--chat-accent);
  color: #fff;                          
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0,0,0,.12);
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}

.send-wrap .send-btn:hover { filter: brightness(.96); }
.send-wrap .send-btn:active { transform: translateY(-50%) scale(.98); }

.send-wrap .send-btn { font-size: 0; }
.send-wrap .send-btn svg {
  width: 18px; height: 18px; 
}

button#sendBtn { all: unset; } 
button#sendBtn { 
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--chat-accent); color:#fff; display:inline-flex;
  align-items:center; justify-content:center; box-shadow:0 6px 16px rgba(0,0,0,.12);
  cursor:pointer; transition: transform .12s ease, filter .12s ease; font-size:0;
}
button#sendBtn:hover { filter: brightness(.96); }
button#sendBtn:active { transform: translateY(-50%) scale(.98); }
button#sendBtn svg { width:18px; height:18px; color:#fff; }

.send-wrap{
  position: relative;
  width: 100%;
  margin: 0;                   
}

.send-wrap input#input{
  width: 100%;
  padding: 14px 60px 14px 16px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  color:#111827;
  font-size:16px;
}

.send-wrap .send-btn,
button#sendBtn{
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--chat-accent);
  color:#fff;
  display:inline-flex; align-items:center; justify-content:center;
  box-shadow: 0 6px 16px rgba(0,0,0,.12);
  cursor:pointer;
  font-size:0;
  z-index: 1;
}
button#sendBtn svg{ width:18px; height:18px; color:#fff; }

.composer {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid #e5e7eb;
  background: #f5f6f7;
  border-radius: 999px;
  padding: 4px 4px 4px 16px;
  height: 48px;
}

.composer > input[type="text"] {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 16px;
  color: #111827;
  height: 100%;
  line-height: 44px;
  padding-right: 44px;
  font-family: 'Inter', serif !important;
}

.send-btn {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: var(--chat-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  cursor: pointer;
  z-index: 2;
}

.send-btn svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
}

button:not(.send-btn){
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--chat-accent);
  color: #a8a8a8;
  border: 0;
  cursor: pointer;
  font-family: 'Inter', serif !important;
}

#chatWindow .input-area{
  position: relative;
  padding: 12px 14px;
  border-top: 1px solid #e5e7eb;
  background:#fff;

  --pad: 14px;
  --btn: 44px;
  --rail-h: 44px;
  --rail-top: 8px;
}

#chatWindow .input-area::before{
  content:"";
  position:absolute;
  left: var(--pad);
  right: calc(var(--pad) + var(--btn)/2);
  top: var(--rail-top);
  height: var(--rail-h);
  border-radius: 999px;
  background: #f3f4f6;
  box-shadow: inset 0 0 0 1px #e5e7eb;
  z-index: 0;
}

#chatWindow #input{
  position: relative;
  z-index: 1;
  width: 100%;
  height: var(--rail-h);
  line-height: var(--rail-h);
  padding: 0 18px;
  border: 0 !important;
  background: transparent !important;
  outline: none;
  font-size: 16px;
  color: #111827;
  box-sizing: border-box;
  webkit-appearance: none;
  appearance: none;
  transform: translateY(-0.5px);
}
#chatWindow #input::placeholder{ color:#6b7280; }

#chatWindow #sendBtn{
  position: absolute;
  right: var(--pad);
  top: calc(var(--rail-top) + var(--rail-h) / 2);
  transform: translateY(-50%);
  width: var(--btn);
  height: var(--btn);
  border: 0;
  border-radius: 50%;
  background: var(--chat-accent);
  box-shadow: 0 6px 18px rgba(0,0,0,.10);
  cursor: pointer;
  z-index: 2;

  font-size: 0 !important;
  color: transparent !important;
  background-image: none !important;
}
#chatWindow #sendBtn::before{ content:none !important; }

#chatWindow #sendBtn::after{
  content:"";
  width: 24px; height: 24px; display:block; margin-top: 1px; transform: translateX(-9px);
  background:#fff;
  -webkit-mask: url('data:image/svg+xml;utf8,\
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" \
fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\
<path d="M12 19V5"/><path d="M5 12l7-7 7 7"/>\
</svg>') center/contain no-repeat;
          mask: url('data:image/svg+xml;utf8,\
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" \
fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\
<path d="M12 19V5"/><path d="M5 12l7-7 7 7"/>\
</svg>') center/contain no-repeat;
}

#quickChips{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 8px;
  align-items: stretch;        
}


#quickChips .chip-quick{
  width: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  background: #f9fafb;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  box-sizing: border-box;
}

@media (min-width: 480px){
  #quickChips{
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}


#chatWindow .input-area{
  --rail-h: 44px;
  --baseline-nudge: -1px;
}

#chatWindow #input{
  box-sizing: border-box !important;
  display: block !important;
  height: var(--rail-h) !important;
  line-height: 1em !important;
  padding-top:  calc((var(--rail-h) - 1em)/2 + var(--baseline-nudge)) !important;
  padding-bottom: calc((var(--rail-h) - 1em)/2 - var(--baseline-nudge)) !important;
  padding-left: 18px !important;
  padding-right: 18px !important;

  border: 0 !important;
  background: transparent !important;
  outline: none !important;
  -webkit-appearance: none;
}

input[type="text"]{
  line-height: normal; 
}

