/*
 * SPACE Public AI Waiter V2
 * The launch FAB intentionally has NO selectors in this stylesheet.
 * This visual layer applies exclusively to the opened guest chat sheet.
 */
.aiWaiterSheet {
  --wai-bg:#101821;
  --wai-ink:#f3f8fc;
  --wai-muted:#9cabb9;
  --wai-card:#1c2937;
  --wai-card-raised:#253444;
  --wai-glass:rgba(28,41,55,.96);
  --wai-focus:#6bcfe8;
  --wai-accent:#83dff6;
  --wai-accent-ink:#062031;
  --wai-tint:rgba(131,223,246,.10);
  --wai-divider:rgba(184,209,229,.09);
  --wai-fade-mid:rgba(9,16,24,.20);
  --wai-fade-bottom:rgba(9,16,24,.78);
  font-family:Inter,system-ui,-apple-system,Segoe UI,sans-serif;
}
:root[data-space-editorial-theme="light"] .aiWaiterSheet,
:root[data-space-menu-ui-theme="light"] .aiWaiterSheet {
  --wai-bg:#f7fafe;
  --wai-ink:#142638;
  --wai-muted:#637689;
  --wai-card:#e9f1f8;
  --wai-card-raised:#dce9f3;
  --wai-glass:rgba(238,247,253,.97);
  --wai-focus:#149cc4;
  --wai-accent:#087da8;
  --wai-accent-ink:#ffffff;
  --wai-tint:rgba(7,125,168,.065);
  --wai-divider:rgba(35,72,103,.09);
  --wai-fade-mid:rgba(247,250,254,.20);
  --wai-fade-bottom:rgba(247,250,254,.80);
}
.aiWaiterSheet .aiWaiterSheetBackdrop {
  background:rgba(1,7,15,.68);
  backdrop-filter:blur(9px);
  -webkit-backdrop-filter:blur(9px);
  transition:opacity .25s ease;
}
.aiWaiterSheet .aiWaiterSheetPanel {
  width:min(calc(100% - 20px),880px);
  max-width:880px;
  height:min(91dvh,840px);
  max-height:calc(100dvh - env(safe-area-inset-top,0px) - 8px);
  overflow:hidden;
  min-height:0;
  isolation:isolate;
  display:flex;
  flex-direction:column;
  border:1px solid var(--wai-divider);
  border-radius:29px 29px 0 0;
  background:radial-gradient(ellipse at 0% 0%,rgba(64,202,230,.08),transparent 50%),var(--wai-bg);
  color:var(--wai-ink);
  box-shadow:0 26px 86px rgba(0,0,0,.34);
  will-change:transform,opacity;
  transition:transform .32s cubic-bezier(.2,1,.28,1),opacity .22s ease;
}
.aiWaiterSheet .aiWaiterSheetHandle {
  margin:12px auto 6px;
  width:42px;height:4px;
  background:var(--wai-muted);opacity:.35;
}
.aiWaiterSheet .aiWaiterHead {
  flex:0 0 auto;
  position:relative;
  padding:13px clamp(18px,4vw,34px) 14px;
  background:transparent;
  border:0;
}
.aiWaiterSheet .aiWaiterKicker {
  font-size:10px;
  letter-spacing:.12em;
  font-weight:770;
  color:var(--wai-accent);
  margin:0 0 5px;
}
.aiWaiterSheet .aiWaiterTitle {
  font-size:clamp(21px,3.2vw,29px);
  line-height:1.16;
  letter-spacing:-.045em;
  font-weight:760;
  color:var(--wai-ink);
}
.aiWaiterSheet .aiWaiterSub {
  font-size:12px;
  line-height:1.5;
  color:var(--wai-muted);
  margin:6px 28px 0 0;
  max-width:650px;
}
.aiWaiterSheet .aiWaiterCloseBtn {
  position:absolute;
  z-index:25;
  right:16px;top:18px;
  width:38px;height:38px;
  min-width:38px;min-height:38px;
  display:grid;place-items:center;
  padding:0;
  border:0;
  border-radius:50%;
  background:var(--wai-card-raised);
  color:var(--wai-ink);
  font-size:0;
  box-shadow:none;
  transition:background-color .17s ease,transform .17s ease;
}
.aiWaiterSheet .aiWaiterCloseBtn svg{display:block;width:18px;height:18px}
.aiWaiterSheet .aiWaiterCloseBtn:hover{background:var(--wai-tint);transform:scale(1.04)}
.aiWaiterSheet :is(button,a,textarea):focus-visible{outline:2px solid var(--wai-focus);outline-offset:3px}
.aiWaiterSheet .aiWaiterBody {
  flex:1 1 auto;
  min-height:0;
  padding:17px max(18px,calc((100% - 760px)/2)) 105px;
  margin:0 0 -73px;
  display:flex;
  flex-direction:column;
  gap:15px;
  overflow-y:auto;
  overflow-x:hidden;
  scroll-behavior:auto;
  scroll-padding-bottom:110px;
  overscroll-behavior-y:contain;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
  scrollbar-color:var(--wai-divider) transparent;
  color:var(--wai-ink);
}
.aiWaiterSheet .aiWaiterBody::-webkit-scrollbar{display:block;width:5px}
.aiWaiterSheet .aiWaiterBody::-webkit-scrollbar-thumb{background:var(--wai-divider);border-radius:99px}
.aiWaiterSheet .aiWaiterMsg{min-width:0;flex:0 0 auto;animation:waiMessageAppear .24s cubic-bezier(.2,.9,.25,1) both}
.aiWaiterSheet .aiWaiterBubble{
  max-width:min(82%,610px);
  padding:12px 16px;
  border:0;
  border-radius:22px;
  background:transparent;
  color:var(--wai-ink);
  font-size:14px;
  font-weight:440;
  line-height:1.72;
  letter-spacing:0;
  overflow-wrap:anywhere;
  word-break:normal;
  box-shadow:none;
}
.aiWaiterSheet .aiWaiterMsg.is-ai .aiWaiterBubble {
  max-width:100%;
  padding:4px 2px;
  border:0;
  border-radius:0;
  background:transparent;
  color:var(--wai-ink);
}
.aiWaiterSheet .aiWaiterMsg.is-user .aiWaiterBubble {
  border:0;
  border-radius:21px 21px 7px 21px;
  background:var(--wai-card-raised);
  color:var(--wai-ink);
  box-shadow:none;
}
.aiWaiterSheet .aiWaiterBubble.is-typing-text::after{
  width:2px;height:.94em;
  margin-left:4px;
  background:var(--wai-accent);
  animation:waiCaret 1.25s ease-in-out infinite;
}
.aiWaiterSheet .aiWaiterTyping{padding:3px 0;gap:10px}
.aiWaiterSheet .aiWaiterThinkingText{color:var(--wai-muted);font-size:12px;font-weight:520}
.aiWaiterSheet .aiWaiterDot{background:var(--wai-accent);animation-duration:1.7s}
.aiWaiterSheet .aiWaiterProductsBubble{width:min(100%,650px);max-width:100%}
.aiWaiterSheet .aiWaiterProductsIntro{font-size:11px;letter-spacing:0;color:var(--wai-muted);font-weight:640}
.aiWaiterSheet .aiWaiterProductsList{gap:9px}
.aiWaiterSheet .aiWaiterProductCard {
  grid-template-columns:70px minmax(0,1fr) auto;
  gap:12px;
  padding:10px;
  background:var(--wai-card);
  border:0;
  border-radius:17px;
  box-shadow:none;
  transition:background-color .18s ease,transform .18s ease;
}
.aiWaiterSheet .aiWaiterProductCard:hover{background:var(--wai-card-raised);transform:translateY(-1px)}
.aiWaiterSheet .aiWaiterProductImg{
  width:70px;height:70px;
  background:var(--wai-card-raised);
  border:0;border-radius:13px;
  color:var(--wai-muted);
}
.aiWaiterSheet .aiWaiterProductTitle{font-weight:720;color:var(--wai-ink);font-size:13px;line-height:1.35}
.aiWaiterSheet .aiWaiterProductPrice{font-size:12px;color:var(--wai-accent);font-weight:760}
.aiWaiterSheet .aiWaiterProductDesc{font-size:11px;color:var(--wai-muted);line-height:1.45}
.aiWaiterSheet .aiWaiterProductOpenBtn,
.aiWaiterSheet .aiWaiterSuggestedBtn{
  min-height:36px;
  padding:8px 13px;
  border:0;border-radius:999px;
  background:var(--wai-accent);
  color:var(--wai-accent-ink);
  font-size:11px;
  font-weight:740;
}
.aiWaiterSheet .aiWaiterQuickWrap {
  flex:0 0 auto;
  gap:7px;
  padding:9px max(18px,calc((100% - 760px)/2)) 7px;
  border:0;
  background:transparent;
  scrollbar-width:none;
}
.aiWaiterSheet .aiWaiterQuickBtn {
  min-height:33px;
  padding:7px 12px;
  border:0;
  border-radius:99px;
  background:var(--wai-card);
  color:var(--wai-ink);
  font-size:11px;
  font-weight:620;
  box-shadow:none;
  transition:background-color .17s ease,transform .17s ease;
}
.aiWaiterSheet .aiWaiterQuickBtn:hover{background:var(--wai-card-raised);color:var(--wai-ink);transform:none}
.aiWaiterSheet .aiWaiterActions{
  flex:0 0 auto;
  padding:5px max(18px,calc((100% - 760px)/2)) 9px;
  background:transparent;
}
.aiWaiterSheet .aiWaiterActionBtn{
  min-height:34px;
  border:0;border-radius:999px;
  color:var(--wai-ink);
  background:var(--wai-tint);
  font-weight:700;
  box-shadow:none;
}
.aiWaiterSheet .aiWaiterSuggestedCard{
  background:var(--wai-card);
  border:0;
  border-radius:16px;
  box-shadow:none;
}
.aiWaiterSheet .aiWaiterSuggestedTitle{color:var(--wai-ink)}
.aiWaiterSheet .aiWaiterSuggestedDesc{color:var(--wai-muted)}
.aiWaiterSheet .aiWaiterFoot{
  --wai-foot-height:73px;
  z-index:7;
  position:relative;
  flex:0 0 auto;
  padding:9px max(16px,calc((100% - 788px)/2)) calc(13px + env(safe-area-inset-bottom,0px));
  background:transparent;
  border:0;
  isolation:isolate;
}
.aiWaiterSheet .aiWaiterFoot::before{
  content:"";
  position:absolute;
  z-index:-1;
  pointer-events:none;
  inset:-70px 0 0;
  background:linear-gradient(to bottom,transparent 0%,var(--wai-fade-mid) 47%,var(--wai-fade-bottom) 100%);
}
.aiWaiterSheet .aiWaiterForm {
  display:flex;
  align-items:flex-end;
  width:100%;
  min-width:0;
  min-height:56px;
  padding:7px 8px 7px 15px;
  gap:7px;
  background:var(--wai-glass);
  border:0;
  border-radius:999px;
  box-shadow:0 10px 32px rgba(0,0,0,.14);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
  transition:box-shadow .18s ease,background-color .18s ease;
}
.aiWaiterSheet .aiWaiterForm:focus-within{box-shadow:0 0 0 2px var(--wai-focus),0 12px 32px rgba(0,0,0,.15)}
.aiWaiterSheet .aiWaiterInput{
  flex:1 1 0%;
  width:100%;
  min-width:0;
  min-height:38px;
  height:38px;
  max-height:185px;
  padding:8px 5px;
  margin:0;
  background:transparent;
  color:var(--wai-ink);
  border:0;
  border-radius:0;
  font-size:16px!important;
  line-height:1.45;
  resize:none;
  overflow-x:hidden;
  overflow-y:hidden;
  overscroll-behavior:contain;
  overflow-wrap:anywhere;
  white-space:pre-wrap;
  scrollbar-width:thin;
  scrollbar-color:var(--wai-divider) transparent;
  box-shadow:none;
  transition:none;
}
.aiWaiterSheet .aiWaiterInput:focus{outline:none;border:0;background:transparent;box-shadow:none}
.aiWaiterSheet .aiWaiterInput::placeholder{color:var(--wai-muted)}
.aiWaiterSheet .aiWaiterForm.is-expanded{
  display:grid;
  grid-template-columns:minmax(0,1fr) 43px;
  grid-template-rows:minmax(38px,auto) 43px;
  gap:4px 8px;
  padding:12px 10px 8px 14px;
  border-radius:29px;
}
.aiWaiterSheet .aiWaiterForm.is-expanded .aiWaiterInput{
  grid-row:1;grid-column:1/-1;
  min-width:0;width:100%;max-width:100%;align-self:stretch;
  padding:4px 5px 6px;
}
.aiWaiterSheet .aiWaiterSend{
  flex:0 0 43px;
  align-self:flex-end;
  justify-self:end;
  display:grid;place-items:center;
  width:43px;height:43px;min-width:43px;min-height:43px;
  padding:0;margin:0;
  border:0;border-radius:50%;
  background:var(--wai-accent);
  color:var(--wai-accent-ink);
  box-shadow:none;
  transition:transform .17s ease,opacity .17s ease;
}
.aiWaiterSheet .aiWaiterForm.is-expanded .aiWaiterSend{grid-row:2;grid-column:2}
.aiWaiterSheet .aiWaiterSend svg{width:20px;height:20px;margin:0}
.aiWaiterSheet .aiWaiterSend[disabled]{opacity:.48}
.aiWaiterSheet .aiWaiterSend:not(:disabled):active{transform:scale(.94)}
.aiWaiterSheet .aiWaiterComposerLabel{
  display:none;
  align-self:center;
  grid-row:2;grid-column:1;
  color:var(--wai-muted);
  font-size:10px;
  font-weight:700;
  letter-spacing:.06em;
  padding-left:5px;
}
.aiWaiterSheet .aiWaiterForm.is-expanded .aiWaiterComposerLabel{display:block}
.aiWaiterSheet .aiWaiterReturn{
  position:absolute;
  z-index:12;
  bottom:calc(126px + env(safe-area-inset-bottom,0px));
  left:50%;
  transform:translateX(-50%);
  min-height:38px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:8px 14px;
  border:0;border-radius:999px;
  color:var(--wai-ink);
  background:var(--wai-glass);
  box-shadow:0 9px 24px rgba(0,0,0,.2);
  backdrop-filter:blur(15px);
  -webkit-backdrop-filter:blur(15px);
  font-size:11px;
  font-weight:750;
  cursor:pointer;
  animation:waiReturnIn .20s ease both;
}
.aiWaiterSheet .aiWaiterReturn svg{width:16px;height:16px;color:var(--wai-accent)}
.aiWaiterSheet .aiWaiterReturn[hidden]{display:none!important}
.aiWaiterSheet .aiWaiterReturn.has-new::after{content:"";width:6px;height:6px;border-radius:50%;background:var(--wai-accent)}
.aiWaiterSheet .aiWaiterReturn:focus-visible{outline:2px solid var(--wai-focus)}
@keyframes waiMessageAppear{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:none}}
@keyframes waiReturnIn{from{opacity:0;transform:translate(-50%,7px)}to{opacity:1;transform:translate(-50%,0)}}
@keyframes waiCaret{0%,100%{opacity:.9}50%{opacity:.27}}
@media(min-width:768px){
  .aiWaiterSheet .aiWaiterSheetPanel{
    top:50%;bottom:auto;
    height:min(84dvh,760px);
    max-height:calc(100dvh - 32px);
    border-radius:27px;
    transform:translateY(calc(-50% + 18px)) scale(.985);
  }
  .aiWaiterSheet.is-open .aiWaiterSheetPanel{transform:translateY(-50%) scale(1)}
  .aiWaiterSheet .aiWaiterSheetHandle{display:none}
  .aiWaiterSheet .aiWaiterHead{padding-top:24px}
  .aiWaiterSheet .aiWaiterCloseBtn{top:18px}
}
@media(max-width:767px){
  .aiWaiterSheet .aiWaiterSheetPanel{
    left:0;right:0;bottom:0;top:auto;
    width:100%;max-width:none;
    height:min(94dvh,920px);
    max-height:calc(100dvh - env(safe-area-inset-top,0px));
    border-radius:25px 25px 0 0;
    border-bottom:0;
  }
  .aiWaiterSheet .aiWaiterHead{padding:10px 19px 13px}
  .aiWaiterSheet .aiWaiterCloseBtn{top:17px;right:14px;width:36px;height:36px}
  .aiWaiterSheet .aiWaiterBody{padding:14px 16px 95px;margin-bottom:-68px;gap:13px}
  .aiWaiterSheet .aiWaiterFoot{padding:8px 13px calc(10px + env(safe-area-inset-bottom,0px))}
  .aiWaiterSheet .aiWaiterForm{padding:6px 7px 6px 13px;min-height:54px;gap:4px}
  .aiWaiterSheet .aiWaiterForm.is-expanded{grid-template-columns:minmax(0,1fr) 40px;grid-template-rows:minmax(38px,auto) 40px;gap:3px 5px;padding:10px 8px 7px 12px;border-radius:27px}
  .aiWaiterSheet .aiWaiterSend{width:40px;height:40px;min-height:40px;min-width:40px;flex-basis:40px}
  .aiWaiterSheet .aiWaiterReturn{bottom:calc(117px + env(safe-area-inset-bottom,0px))}
  .aiWaiterSheet .aiWaiterQuickWrap{padding:7px 14px}
  .aiWaiterSheet .aiWaiterProductCard{grid-template-columns:55px minmax(0,1fr);gap:9px}
  .aiWaiterSheet .aiWaiterProductImg{width:55px;height:55px}
  .aiWaiterSheet .aiWaiterProductOpenBtn{grid-column:2;justify-self:start;min-height:32px}
}
@media(max-width:380px){
  .aiWaiterSheet .aiWaiterTitle{font-size:21px}
  .aiWaiterSheet .aiWaiterSub{font-size:11px}
  .aiWaiterSheet .aiWaiterBubble{font-size:13px}
  .aiWaiterSheet .aiWaiterQuickBtn{font-size:10px}
}
@media(prefers-reduced-motion:reduce){
  .aiWaiterSheet .aiWaiterMsg,
  .aiWaiterSheet .aiWaiterReturn,
  .aiWaiterSheet .aiWaiterBubble.is-typing-text::after{animation:none!important}
  .aiWaiterSheet .aiWaiterSheetPanel,
  .aiWaiterSheet .aiWaiterSheetBackdrop,
  .aiWaiterSheet .aiWaiterForm,
  .aiWaiterSheet .aiWaiterProductCard{transition:none!important}
}


/* The full composer remains inside the visible viewport with mobile IME. */
.aiWaiterSheet.is-keyboard-open .aiWaiterSheetPanel,
.aiWaiterSheet.is-keyboard-open.is-open .aiWaiterSheetPanel{
  transform:translateY(0) scale(1);
  transition:none;
}
.aiWaiterSheet.is-keyboard-open .aiWaiterHead{
  padding-top:8px;
  padding-bottom:8px;
}
.aiWaiterSheet.is-keyboard-open .aiWaiterSub{display:none}
.aiWaiterSheet.is-keyboard-open .aiWaiterQuickWrap{padding-top:4px;padding-bottom:4px}
.aiWaiterSheet.is-keyboard-open .aiWaiterBody{padding-top:8px}


/* Guest AI living backdrop. Keep the existing dark/light base untouched;
 * these translucent color fields float above it, below chat content. */
.aiWaiterSheet .aiWaiterSheetPanel{
  position:absolute;
  isolation:isolate;
}
.aiWaiterSheet .aiWaiterSheetPanel::before{
  content:"";
  position:absolute;
  z-index:0;
  pointer-events:none;
  inset:-26% -38%;
  border-radius:50%;
  background:
    radial-gradient(ellipse at 17% 28%,rgba(15,170,211,.22),transparent 36%),
    radial-gradient(ellipse at 77% 37%,rgba(67,92,220,.14),transparent 37%),
    radial-gradient(ellipse at 48% 83%,rgba(60,180,169,.10),transparent 38%);
  opacity:.55;
  transform:translate3d(0,0,0) scale(1);
  filter:blur(26px);
  animation:waiAmbientIdle 28s ease-in-out infinite alternate;
  will-change:transform,opacity;
}
:root[data-space-editorial-theme="light"] .aiWaiterSheet .aiWaiterSheetPanel::before,
:root[data-space-menu-ui-theme="light"] .aiWaiterSheet .aiWaiterSheetPanel::before{
  opacity:.30;
}
.aiWaiterSheet.is-processing .aiWaiterSheetPanel::before{
  opacity:.84;
  animation:waiAmbientThinking 6.5s ease-in-out infinite alternate;
}
.aiWaiterSheet .aiWaiterHead,
.aiWaiterSheet .aiWaiterSheetHandle{
  position:relative;
  z-index:1;
}
.aiWaiterSheet .aiWaiterBody{
  z-index:1;
}
.aiWaiterSheet .aiWaiterQuickWrap{
  position:relative;
  z-index:10;
  isolation:isolate;
  background:transparent;
}
.aiWaiterSheet .aiWaiterActions{
  position:relative;
  z-index:9;
}
.aiWaiterSheet .aiWaiterFoot{
  z-index:11;
}
.aiWaiterSheet .aiWaiterReturn{
  z-index:15;
}
.aiWaiterSheet .aiWaiterCloseBtn{
  z-index:25;
}
@keyframes waiAmbientIdle{
  0%{transform:translate3d(-2%,0,0) scale(1);opacity:.42}
  50%{transform:translate3d(2%,-2%,0) scale(1.055);opacity:.58}
  100%{transform:translate3d(-1%,3%,0) scale(1.01);opacity:.48}
}
@keyframes waiAmbientThinking{
  0%{transform:translate3d(-7%,1%,0) rotate(-3deg) scale(1.03);filter:blur(24px) hue-rotate(0deg)}
  33%{transform:translate3d(6%,-4%,0) rotate(3deg) scale(1.11);filter:blur(30px) hue-rotate(14deg)}
  66%{transform:translate3d(-3%,5%,0) rotate(-2deg) scale(1.15);filter:blur(24px) hue-rotate(-12deg)}
  100%{transform:translate3d(7%,1%,0) rotate(3deg) scale(1.06);filter:blur(30px) hue-rotate(8deg)}
}
@media(prefers-reduced-motion:reduce){
  .aiWaiterSheet .aiWaiterSheetPanel::before,
  .aiWaiterSheet.is-processing .aiWaiterSheetPanel::before{
    animation:none!important;
    transform:none;
    filter:blur(26px);
    will-change:auto;
  }
}

/* Read-only product context. Launcher and product modal geometry stay intact. */
.aiWaiterSheet .aiWaiterContext{
  position:relative;
  z-index:10;
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
  margin:0 15px 4px;
  padding:7px 9px 7px 13px;
  border:0;
  border-radius:999px;
  background:var(--wai-glass);
  color:var(--wai-ink);
  box-shadow:0 4px 15px rgba(0,0,0,.09);
  font-size:12px;
  font-weight:700;
}
.aiWaiterSheet .aiWaiterContext[hidden]{display:none!important}
.aiWaiterSheet .aiWaiterContextName{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;flex:1}
.aiWaiterSheet .aiWaiterContextClear{
  flex:0 0 26px;width:26px;height:26px;
  display:inline-flex;align-items:center;justify-content:center;
  padding:0;border:0;border-radius:50%;
  background:rgba(127,146,164,.14);
  color:inherit;font-size:20px;cursor:pointer;
}
.aiWaiterSheet .aiWaiterContextClear:focus-visible{outline:2px solid var(--wai-focus)}
