/* ============================================================
   Restaurant Web — AI chat widget
   Palette/type matches index.html (green var(--green,#1f4d3a), cream var(--bg,#fbfaf7),
   Fraunces headings, Inter body). No dependencies.
   ============================================================ */

#rw-chat-launch{
  position:fixed;right:18px;bottom:18px;z-index:220;
  width:58px;height:58px;border-radius:50%;
  background:var(--green,#1f4d3a);color:#fff;border:none;cursor:pointer;
  box-shadow:0 12px 30px rgba(22,32,28,.32);
  display:grid;place-items:center;
  transition:transform .15s ease, box-shadow .15s ease;
}
#rw-chat-launch:hover{transform:translateY(-2px);box-shadow:0 16px 36px rgba(22,32,28,.38)}
#rw-chat-launch.rw-pulse{animation:rwpulse 1.6s ease 2}
@keyframes rwpulse{0%,100%{transform:none}30%{transform:translateY(-7px)}55%{transform:none}}
#rw-chat-launch svg{width:26px;height:26px;display:block}
#rw-chat-launch .ic-close{display:none}
#rw-chat-launch.open .ic-chat{display:none}
#rw-chat-launch.open .ic-close{display:block}

/* little "Questions?" nudge next to the launcher */
#rw-chat-hint{
  position:fixed;right:86px;bottom:28px;z-index:219;
  background:var(--card,#fff);border:1px solid var(--line,#dfe6e1);border-radius:12px;
  padding:9px 14px;font:500 .86rem/1.35 Inter,system-ui,sans-serif;color:var(--ink,#16201c);
  box-shadow:0 10px 26px rgba(22,32,28,.16);
  opacity:0;transform:translateY(6px);pointer-events:none;
  transition:opacity .25s ease, transform .25s ease;white-space:nowrap;
}
#rw-chat-hint.show{opacity:1;transform:none}

/* panel */
#rw-chat{
  position:fixed;right:18px;bottom:88px;z-index:230;padding:0;margin:0;
  width:min(392px,calc(100vw - 24px));
  height:min(78vh,620px);
  background:var(--bg,#fbfaf7);border:1px solid var(--line,#dfe6e1);border-radius:18px;
  box-shadow:0 30px 80px rgba(22,32,28,.35);
  display:flex;flex-direction:column;overflow:hidden;
  opacity:0;pointer-events:none;transform:translateY(14px) scale(.98);
  transition:opacity .18s ease, transform .18s ease;
  font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;
}
#rw-chat.open{opacity:1;pointer-events:auto;transform:none}

.rw-head{
  background:var(--green,#1f4d3a);color:#fff;padding:13px 16px;
  display:flex;align-items:center;gap:11px;flex:none;
}
.rw-head .dot{width:9px;height:9px;border-radius:50%;background:#7fd6a5;flex:none;
  box-shadow:0 0 0 3px rgba(127,214,165,.25)}
.rw-head b{font-family:var(--font-d,Fraunces,Georgia,serif);font-weight:600;font-size:1.02rem;letter-spacing:.01em}
.rw-head small{display:block;font-size:.72rem;color:#bcd6c6;font-weight:400;margin-top:1px}
.rw-head button{
  margin-left:auto;background:none;border:none;color:#cfe4d7;cursor:pointer;
  font-size:1.25rem;line-height:1;padding:4px 6px;border-radius:8px;
}
.rw-head button:hover{background:rgba(255,255,255,.12);color:#fff}

.rw-msgs{flex:1;overflow-y:auto;padding:16px 14px;display:flex;flex-direction:column;gap:10px;
  scrollbar-width:thin;overscroll-behavior:contain}

.rw-m{max-width:88%;padding:10px 14px;border-radius:14px;
  font-size:.92rem;line-height:1.5;white-space:pre-wrap;overflow-wrap:break-word}
.rw-m.user{align-self:flex-end;background:var(--green,#1f4d3a);color:#fff;border-bottom-right-radius:5px}
.rw-m.bot{align-self:flex-start;background:var(--card,#fff);border:1px solid var(--line,#dfe6e1);color:var(--ink,#16201c);
  border-bottom-left-radius:5px}
.rw-m.bot a{color:var(--brand-ink,#1f4d3a);font-weight:600}
.rw-m.err{border-left:3px solid #b8863b}

/* typing indicator */
.rw-typing{display:inline-flex;gap:5px;align-items:center;padding:13px 16px}
.rw-typing i{width:7px;height:7px;border-radius:50%;background:#9db1a6;animation:rwb 1.1s infinite}
.rw-typing i:nth-child(2){animation-delay:.18s}
.rw-typing i:nth-child(3){animation-delay:.36s}
@keyframes rwb{0%,60%,100%{opacity:.35;transform:none}30%{opacity:1;transform:translateY(-3px)}}

/* quick-question chips */
.rw-chips{display:flex;flex-wrap:wrap;gap:8px;padding:2px 14px 10px;flex:none}
.rw-chips button{
  background:var(--card,#fff);border:1px solid var(--line,#dfe6e1);border-radius:999px;
  padding:7px 13px;font:500 .8rem/1 Inter,sans-serif;color:var(--ink-2,#3d4d46);cursor:pointer;
}
.rw-chips button:hover{border-color:var(--brand-ink,#1f4d3a);color:var(--brand-ink,#1f4d3a)}

/* call-back card (rendered inside the message list) */
.rw-lead{width:88%}
.rw-lead b{font-family:var(--font-d,Fraunces,Georgia,serif);font-weight:600;font-size:.98rem;display:block;margin-bottom:8px}
.rw-lead input{
  width:100%;border:1px solid var(--line,#dfe6e1);border-radius:10px;padding:9px 11px;
  font:400 .88rem/1.3 Inter,sans-serif;margin-bottom:7px;background:var(--bg,#fbfaf7);color:var(--ink,#16201c);
}
.rw-lead input:focus{outline:2px solid var(--green-2,#2d6b50);outline-offset:0;border-color:var(--green-2,#2d6b50)}
.rw-lead .rw-go{
  width:100%;background:var(--green,#1f4d3a);color:#fff;border:none;border-radius:10px;
  padding:10px;font:600 .88rem/1 Inter,sans-serif;cursor:pointer;
}
.rw-lead .rw-go:hover{background:var(--green-2,#2d6b50)}
.rw-lead .rw-go:disabled{opacity:.55;cursor:default}
.rw-lead .rw-err-t{color:#9c3d1a;font-size:.78rem;margin-top:6px;display:none}

/* footer / composer */
.rw-foot{border-top:1px solid var(--line,#dfe6e1);background:var(--card,#fff);padding:10px 10px 6px;flex:none}
.rw-row{display:flex;gap:8px;align-items:flex-end}
.rw-input{
  flex:1;resize:none;border:1px solid var(--line,#dfe6e1);border-radius:12px;padding:10px 12px;
  font:400 .92rem/1.4 Inter,sans-serif;color:var(--ink,#16201c);background:var(--bg,#fbfaf7);
  max-height:110px;min-height:42px;
}
.rw-input:focus{outline:2px solid var(--green-2,#2d6b50);outline-offset:0;border-color:var(--green-2,#2d6b50)}
.rw-send{
  flex:none;width:42px;height:42px;border-radius:12px;border:none;cursor:pointer;
  background:var(--green,#1f4d3a);color:#fff;display:grid;place-items:center;
}
.rw-send:hover{background:var(--green-2,#2d6b50)}
.rw-send:disabled{opacity:.5;cursor:default}
.rw-send svg{width:18px;height:18px}
.rw-tools{display:flex;justify-content:space-between;align-items:center;padding:6px 4px 2px}
.rw-cb{background:none;border:none;color:var(--brand-ink,#1f4d3a);font:600 .78rem/1 Inter,sans-serif;
  cursor:pointer;padding:4px;text-decoration:underline;text-underline-offset:2px}
.rw-note{font-size:.7rem;color:#8a988f}

@media (max-width:480px){
  #rw-chat{right:8px;left:8px;bottom:82px;width:auto;height:min(78dvh,calc(100dvh - 100px))}
  #rw-chat-hint{display:none}
}
@media (prefers-reduced-motion:reduce){
  #rw-chat,#rw-chat-launch,#rw-chat-hint{transition:none}
  .rw-typing i{animation:none}
}
