/* ===== BARRY BOT: the launcher in the corner and the chat panel. Workings: bot.js. Answers: bot-answers.js ===== */
.bbot,.bbot-launch{--bb-sans:var(--sans,Barlow,system-ui,sans-serif);--bb-cond:var(--cond,'Barlow Condensed',Barlow,sans-serif);--bb-sea:#0e3a39;--bb-teal:#137b6c;--bb-text:#0f2a2d;--bb-line:rgba(15,42,45,.14);--bb-gold:#ffd97a;font-family:var(--bb-sans);text-align:left}
.bbot *,.bbot-launch *{box-sizing:border-box}
.bbot button,.bbot-launch button{font-family:inherit;border:0;margin:0;cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
.bbot-sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* ---------- launcher ---------- */
.bbot-launch{position:fixed;right:0;bottom:0;z-index:46;display:flex;flex-direction:column;align-items:flex-end;pointer-events:none;transform:translateX(130%);transition:transform .45s cubic-bezier(.2,.85,.25,1),bottom .3s ease,visibility 0s .45s;visibility:hidden}
.bbot-launch.in{transform:none;visibility:visible;transition:transform .45s cubic-bezier(.2,.85,.25,1),bottom .3s ease,visibility 0s}
.bbot-launch.typing{transform:translateX(130%);visibility:hidden;transition:transform .3s ease,bottom .3s ease,visibility 0s .3s}
/* words underneath: tucked in so just his wave shows */
.bbot-launch.peep .bbot-peek{transform:translateX(calc(100% - 30px))}
.bbot-launch.peep.key .bbot-peek{transform:none}
/* tucked away while a button is underneath (a keyboard can still reach him, and he comes back out) */
.bbot-launch.tuck:not(.key){transform:translateX(130%);transition:transform .25s ease,bottom .3s ease}
.bbot-launch.tuck:not(.key) *{pointer-events:none}
.bbot-peek{pointer-events:auto;display:block;width:74px;height:79px;padding:0;background:none;clip-path:inset(-24px 0 0 -24px);transform-origin:100% 100%;transition:transform .25s ease}
.bbot-peek img{display:block;width:74px;height:auto;max-width:none;filter:drop-shadow(0 4px 8px rgba(6,30,32,.28))}
.bbot-launch.in .bbot-peek img{animation:bbot-wave 1.1s .7s ease-in-out 1 both;transform-origin:90% 100%}
@keyframes bbot-wave{0%,100%{transform:none}25%{transform:rotate(-6deg)}55%{transform:rotate(4deg)}80%{transform:rotate(-3deg)}}
.bbot-bubble{order:-1;pointer-events:auto;display:flex;align-items:center;margin:0 8px 4px 0;border-radius:99px;background:#fff;box-shadow:0 8px 22px rgba(6,30,32,.24),inset 0 0 0 1px rgba(15,42,45,.08);transition:opacity .3s ease,transform .3s ease,visibility 0s}
.bbot-ask{min-height:44px;padding:0 2px 0 16px;background:none;color:#0f2a2d;font-weight:800;font-size:16px;line-height:1;white-space:nowrap}
.bbot-bye{width:44px;height:44px;padding:0;background:none;color:#5a6967;display:grid;place-items:center}
.bbot-bye span{display:block;font-size:22px;line-height:1;font-weight:600}
/* after a few seconds the bubble folds away and only Barry is left */
.bbot-launch.quiet .bbot-bubble{opacity:0;visibility:hidden;transform:translateY(8px) scale(.94);transition:opacity .3s ease,transform .3s ease,visibility 0s .3s}
.bbot-launch.fold:not(.key) .bbot-bubble{opacity:0;visibility:hidden}
.bbot-launch.quiet:not(.fold):hover .bbot-bubble,.bbot-launch.quiet.key .bbot-bubble{opacity:1;visibility:visible;transform:none;transition:opacity .2s ease,transform .2s ease,visibility 0s}
.bbot-peek:focus-visible,.bbot-ask:focus-visible,.bbot-bye:focus-visible{outline:3px solid var(--bb-gold);outline-offset:2px;border-radius:14px}
/* above the phone's bottom nav, or above the Christmas order bar when that's showing */
@media (max-width:999px){
  .quick.on~.bbot-launch{bottom:calc(80px + env(safe-area-inset-bottom))}
  body:not(.xm-orderbar) .quick.on~.bbot-launch .bbot-peek{-webkit-mask-image:linear-gradient(#000 84%,transparent);mask-image:linear-gradient(#000 84%,transparent)}
}
body.xm-orderbar .quick~.bbot-launch,body.xm-orderbar .bbot-launch{bottom:var(--xm-bar-h,104px)}
body.walking .bbot-launch,body.xm-checkout .bbot-launch,body.bb-open .bbot-launch{display:none}
@media (min-width:1000px){
  .bbot-peek{width:104px;height:108px}.bbot-peek img{width:104px}
  .bbot-launch:not(.peep) .bbot-peek:hover{transform:scale(1.05)}
  .bbot-bubble{margin-right:14px}
}
@media (max-height:480px) and (orientation:landscape){.bbot-peek{width:58px;height:60px}.bbot-peek img{width:58px}}

/* ---------- panel: a full sheet on phones, a 380px panel on computers ---------- */
.bbot{position:fixed;left:0;right:0;top:0;height:100vh;height:100dvh;z-index:95;display:flex;flex-direction:column;background:#eef4f2;color:var(--bb-text);font-size:16px;line-height:1.45;overflow:hidden;animation:bbot-up .28s ease both}
.bbot[hidden]{display:none}
@keyframes bbot-up{from{transform:translateY(24px);opacity:0}}
html.bbot-lock,html.bbot-lock body{overflow:hidden;overscroll-behavior:none}
.bbot-head{position:relative;flex:none;display:flex;align-items:flex-end;gap:10px;min-height:104px;padding:calc(10px + env(safe-area-inset-top)) 62px 0 14px;color:#fff;background:radial-gradient(120% 140% at 12% 100%,#1f8d95 0,rgba(31,141,149,0) 55%),linear-gradient(120deg,#0b3d5f,#0e3a39 70%)}
.bbot-head::after{content:"";position:absolute;left:0;right:0;bottom:0;height:3px;background:linear-gradient(90deg,var(--bb-gold),#e9b649 40%,rgba(233,182,73,0))}
.bbot-pose{flex:none;width:92px;height:92px;object-fit:contain;object-position:50% 100%;display:block}
.bbot-tt{min-width:0;align-self:center;padding-bottom:4px}
.bbot-tt h2{margin:0;font:800 23px/1.1 var(--bb-sans);letter-spacing:-.01em;color:#fff;outline:none;text-transform:none}
.bbot-tt p{margin:4px 0 0;font:600 16px/1.25 var(--bb-sans);color:#cfe6e4;text-wrap:balance}
.bbot-x{position:absolute;right:10px;top:calc(10px + env(safe-area-inset-top));width:46px;height:46px;padding:0;border-radius:50%;background:rgba(255,255,255,.14);color:#fff;display:grid;place-items:center}
.bbot-x span{font-size:27px;line-height:1;margin-top:-3px}
.bbot-log{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:16px 14px 10px;display:flex;flex-direction:column;gap:10px;outline-offset:-3px}
.bbot-log>:first-child{margin-top:auto}
.bbot-row{display:flex;max-width:100%}
.bbot-row.me{justify-content:flex-end}
.bbot-msg{max-width:86%;padding:11px 14px;border-radius:18px 18px 18px 5px;background:#fff;box-shadow:0 1px 2px rgba(15,42,45,.08),0 4px 14px rgba(15,42,45,.06);font:500 16.5px/1.45 var(--bb-sans);white-space:pre-line;overflow-wrap:anywhere}
.bbot-row.me .bbot-msg{border-radius:18px 18px 5px 18px;background:var(--bb-teal);color:#fff}
.bbot-msg a:not(.bbot-act){color:#0b6c5f;font-weight:700;white-space:nowrap;text-underline-offset:2px}
.bbot-msg b{font-weight:800;white-space:nowrap}
.bbot-opts{display:grid;gap:8px;margin-top:10px}
.bbot-opt,.bbot-act{display:flex;align-items:center;justify-content:center;width:100%;min-height:46px;padding:10px 14px;border-radius:12px;font:700 16px/1.25 var(--bb-sans);text-align:center;text-decoration:none;white-space:normal}
.bbot-opt{justify-content:flex-start;text-align:left;background:#e6f2ef;color:#0b5c51;box-shadow:inset 0 0 0 1.5px rgba(19,123,108,.28)}
.bbot .bbot-act{margin-top:12px}
.bbot-act{background:var(--bb-teal);color:#fff}
.bbot-act.gold{background:linear-gradient(180deg,#ffe4a0,#ffcf63);color:#2c1c00}
.bbot-dots{display:flex;gap:6px;padding:15px 16px}
.bbot-dots i{width:8px;height:8px;border-radius:50%;background:#7fa6a1;animation:bbot-dot 1s infinite ease-in-out}
.bbot-dots i:nth-child(2){animation-delay:.15s}.bbot-dots i:nth-child(3){animation-delay:.3s}
@keyframes bbot-dot{0%,60%,100%{transform:none;opacity:.5}30%{transform:translateY(-5px);opacity:1}}
.bbot-chips{flex:none;display:flex;flex-wrap:wrap;gap:8px;padding:4px 14px 10px}
.bbot-chips:empty{display:none}
.bbot-chips.row{flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;padding:6px 14px 8px}
.bbot-chips.row::-webkit-scrollbar{display:none}
.bbot-chip{flex:none;min-height:44px;padding:0 15px;border-radius:99px;background:#fff;color:#0b5c51;font:700 16px/1 var(--bb-sans);box-shadow:inset 0 0 0 1.5px rgba(19,123,108,.35);white-space:nowrap}
.bbot-form{flex:none;display:flex;gap:8px;padding:8px 12px;background:#fff;border-top:1px solid var(--bb-line)}
.bbot-in{flex:1 1 auto;min-width:0;height:50px;padding:0 15px;border:1.5px solid rgba(15,42,45,.24);border-radius:14px;background:#fff;color:var(--bb-text);font:500 17px/1.2 var(--bb-sans);-webkit-appearance:none;appearance:none}
.bbot-in::placeholder{color:#647573;opacity:1}
.bbot-send{flex:none;min-width:74px;height:50px;padding:0 16px;border-radius:14px;background:var(--bb-teal);color:#fff;font:800 16.5px/1 var(--bb-sans)}
.bbot-send:disabled{opacity:.55;cursor:default}
.bbot-foot{flex:none;margin:0;padding:0 12px calc(4px + env(safe-area-inset-bottom));background:#fff;color:#566765;font:500 14px/1.3 var(--bb-sans);display:flex;align-items:center;justify-content:space-between;gap:10px}
.bbot-off{flex:none;min-height:44px;padding:0 2px;background:none;color:#0b5c51;font:700 14px/1 var(--bb-sans)!important;text-decoration:underline;text-underline-offset:3px;white-space:nowrap}
.bbot button:focus-visible,.bbot a:focus-visible,.bbot-in:focus-visible,.bbot-log:focus-visible{outline:3px solid #e9b649;outline-offset:2px}
.bbot-log:focus-visible{outline-offset:-3px}
@media (hover:hover){.bbot-opt:hover{background:#d8ebe6}.bbot-chip:hover{background:#e6f2ef}.bbot-act:hover,.bbot-send:not(:disabled):hover{filter:brightness(1.06)}.bbot-x:hover{background:rgba(255,255,255,.24)}}
@media (min-width:700px) and (min-height:521px){
  .bbot{left:auto;right:24px;top:auto;bottom:24px;width:380px;height:min(640px,calc(100vh - 48px));border-radius:22px;box-shadow:0 24px 60px rgba(6,30,32,.36),0 0 0 1px rgba(15,42,45,.1)}
}
/* phones on their side: less header, more chat */
@media (max-height:520px){
  .bbot{left:0;right:0;width:auto}
  .bbot-head{min-height:56px;padding-top:calc(4px + env(safe-area-inset-top));padding-left:calc(14px + env(safe-area-inset-left))}
  .bbot-pose{width:50px;height:50px}.bbot-tt{padding:0;display:flex;align-items:baseline;gap:12px;flex-wrap:wrap}.bbot-tt h2{font-size:20px}.bbot-tt p{margin:0}
  .bbot-x{top:calc(5px + env(safe-area-inset-top))}
  .bbot-log{padding-top:10px}.bbot-msg{max-width:min(86%,560px)}
  .bbot-chips,.bbot-chips.row{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;padding:4px 14px 6px}
  .bbot-form{padding:5px 12px}.bbot-in,.bbot-send{height:46px}
  .bbot-foot{display:none}
}
@media (max-width:359px){.bbot-tt p{font-size:15px}.bbot-pose{width:78px;height:78px}}
@media (prefers-reduced-motion:reduce){
  .bbot,.bbot-launch.in .bbot-peek img,.bbot-dots i{animation:none!important}
  .bbot-launch,.bbot-launch.in,.bbot-launch.tuck,.bbot-launch.typing,.bbot-bubble,.bbot-launch.quiet .bbot-bubble,.bbot-peek{transition:none!important}
  .bbot-launch.tuck:not(.key){transform:none;opacity:0}.bbot-launch.typing{transform:none}
  .bbot-launch:not(.peep) .bbot-peek:hover{transform:none}
}
@media print{.bbot,.bbot-launch{display:none}}
/* help me choose */
.bbot-opts.two{grid-template-columns:1fr 1fr}
.bbot-opts.two .bbot-opt{justify-content:center;text-align:center}
.bbot-opts.soft .bbot-opt{min-height:44px;background:#fff;font-size:15.5px}
.bbot-count{display:block;margin:0 0 4px;font:700 14px/1.2 var(--bb-sans);color:#5a6967}
.bbot-after{margin:14px 0 0;padding-top:12px;border-top:1px solid var(--bb-line);font-weight:600}
.bbot-after+.bbot-opts{margin-top:8px}
.bbot-chip.lead{background:linear-gradient(180deg,#ffe4a0,#ffcf63);color:#2c1c00;box-shadow:0 2px 8px rgba(160,110,0,.22)}
