/* Tuck, the design helper (assets/js/tuck/tuck.js.coffee). Bottom right;
   sits under the app's dialogs (2000). */
.tuck-root{position:fixed;right:0;bottom:0;z-index:1500;font-family:"Museo Sans","museo-sans",Helvetica,Arial,sans-serif;color:#465C65;-webkit-font-smoothing:antialiased}
.tuck-root *{box-sizing:border-box}
/* The header's "Chat with Tuck" link, kept in place but hidden until Tuck is up */
.tuck-header-chat{visibility:hidden}
body.tuck-on .tuck-header-chat{visibility:visible}
.tuck-root [hidden]{display:none !important}
/* :where keeps this reset below Tuck's own button classes */
.tuck-root :where(button){all:unset;box-sizing:border-box;cursor:pointer}
.tuck-root button:focus-visible{outline:2px solid #00A1F0;outline-offset:2px}

/* Tuck himself */
.tuck-walker{position:fixed;bottom:10px;bottom:calc(var(--tuck-floor,0px) + 10px);right:20px;width:92px}
.tuck-btn{display:block;border-radius:50%}
.tuck-face-dir{transform-origin:50% 92%;animation:tk-sway 6.4s ease-in-out infinite}
.tuck-walker:has(.is-sleep,.is-walk) .tuck-face-dir{animation:none}
/* A soft edge and shadow so the near-white tee stands out on white shirts and pages */
.tuck-walker .tk-bodyg,.tuck-perch .tk-bodyg{filter:drop-shadow(0 0 1px rgba(13,39,98,.30)) drop-shadow(0 3px 8px rgba(13,39,98,.18))}
.tuck-btn:focus-visible{outline-offset:4px}
/* On phones he rests half past the right edge (restSpot), leaning out */
.tuck-btn{transition:transform .4s ease}
.tuck-walker.is-peek .tuck-btn{transform:rotate(-10deg);transform-origin:70% 85%}
.tuck-fx{position:absolute;left:0;top:0;width:100%;height:0;pointer-events:none}
.tuck-zzz{position:absolute;font-weight:700;color:#61757F;opacity:0;animation:tuck-zz 2.4s ease-in infinite}
/* on hover, a thought bubble inviting the click */
.tuck-hint{position:absolute;right:58px;bottom:100px;width:max-content;max-width:180px;padding:8px 12px;background:#fff;border:1px solid #D5DEE3;border-radius:16px;box-shadow:0 4px 14px rgba(13,39,98,.10);font-size:13px;line-height:18px;color:#465C65;pointer-events:none;opacity:0;transform:translateY(4px) scale(.96);transform-origin:90% 100%;transition:opacity .2s ease,transform .25s ease}
.tuck-hint i{position:absolute;background:#fff;border:1px solid #D5DEE3;border-radius:50%;box-shadow:0 2px 6px rgba(13,39,98,.08)}
.tuck-hint i:nth-of-type(1){right:-2px;bottom:-13px;width:10px;height:10px}
.tuck-hint i:nth-of-type(2){right:-11px;bottom:-24px;width:6px;height:6px}
.tuck-btn:hover + .tuck-hint,.tuck-btn:focus-visible + .tuck-hint{opacity:1;transform:none;transition-delay:.15s}
/* An offer he makes on his own: one line to his left, with a field to reply in */
.tuck-nudge{position:absolute;right:102px;bottom:8px;width:max-content;min-width:240px;max-width:340px;max-width:min(340px, calc(100vw - 160px));display:flex;flex-direction:column;gap:8px;padding:10px 10px 10px 12px;background:#fff;border:1px solid #D5DEE3;border-radius:10px;box-shadow:0 4px 14px rgba(13,39,98,.10);transform-origin:100% 50%;animation:tuck-grow .3s cubic-bezier(.3,1.3,.6,1)}
.tuck-nudge p{margin:0;padding-right:22px;font-size:13px;line-height:18px;color:#1F2D33}
.tuck-nudge-field{display:flex;align-items:center;gap:4px;padding:3px 3px 3px 9px;background:#F2F5F7;border-radius:6px}
.tuck-nudge-field:focus-within{box-shadow:0 0 0 1px #0277B0}
.tuck-root .tuck-nudge-input{flex:1;min-width:0;height:20px;margin:0;padding:0;border:0;outline:0;box-shadow:none;background:transparent;-webkit-appearance:none;appearance:none;font:inherit;font-size:12px;line-height:16px;color:#1F2D33}
.tuck-nudge-input::placeholder{color:#8A9AA2;opacity:1}
.tuck-root .tuck-nudge-send{flex:none;width:20px;height:20px;border-radius:4px;display:flex;align-items:center;justify-content:center;color:#8A9AA2}
.tuck-root .tuck-nudge-send:hover,.tuck-nudge-field:focus-within .tuck-nudge-send{color:#0277B0}
.tuck-root .tuck-nudge-x{position:absolute;right:7px;top:8px;width:18px;height:18px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#9AA9B0}
.tuck-root .tuck-nudge-x:hover{background:#EEF6FA;color:#0277B0}
.tuck-walker.is-nudging .tuck-hint{opacity:0 !important}
.tuck-heart{position:absolute;top:-8px;opacity:0;animation:tuck-heart 1.6s ease-out forwards}

.tuck-icon{flex:none;width:26px;height:26px;border-radius:7px;display:flex; align-items:center;justify-content:center;color:#61757F}
.tuck-icon:hover{background:#F2FBFF;color:#0277B0}
.tuck-undo{color:#0277B0;font-size:13px;text-decoration:underline}
.tuck-undo:disabled{color:#61757F;cursor:default}

/* Chat */
.tuck-chat{position:fixed;right:20px;bottom:20px;bottom:calc(var(--tuck-floor,0px) + 20px);width:360px;height:560px;max-height:calc(100vh - 230px);max-height:calc(var(--tuck-vh,100vh) - var(--tuck-floor,0px) - 230px);min-height:320px;display:flex;flex-direction:column;background:#fff;border:1px solid #E1E6E9;border-radius:18px;box-shadow:0 16px 40px rgba(13,39,98,.14);animation:tuck-grow .32s cubic-bezier(.3,1.3,.6,1);transform-origin:80% 100%}
.tuck-perch{position:absolute;right:30px;top:-68px;width:74px}
.tuck-chat-h{display:flex;align-items:center;gap:4px;height:46px;padding:0 10px 0 18px;flex:none}
.tuck-title{flex:1}
.tuck-title b{font-size:15px;color:#475C66}
.tuck-log{flex:1;overflow:auto;padding:4px 16px 8px;display:flex;flex-direction:column;gap:10px}
.tuck-m{max-width:300px;padding:9px 12px;font-size:14px;line-height:20px;overflow-wrap:break-word}
.tuck-m-t{align-self:flex-start;background:#F2F5F7;border-radius:4px 16px 16px 16px;color:#465C65}
.tuck-m-t b{color:#475C66}
.tuck-m-u{align-self:flex-end;max-width:260px;background:#0277B0;color:#fff;border-radius:16px 4px 16px 16px}
.tuck-note{background:#fff;border:1px solid #E3E5E7;color:#61757F}
.tuck-undo-row{margin-top:6px}
.tuck-working{color:#61757F;font-size:13px;display:flex;align-items:center;gap:8px}
.tuck-dots{display:inline-flex;gap:3px}
.tuck-dots i{width:6px;height:6px;border-radius:50%;background:#00abff;animation:tuck-dot 1.2s ease-in-out infinite}
.tuck-dots i:nth-child(2){animation-delay:.15s}
.tuck-dots i:nth-child(3){animation-delay:.3s}
.tuck-chips{display:flex;gap:6px;flex-wrap:wrap;padding:6px 16px 0;flex:none}
.tuck-chip{font-size:12.5px;color:#0277B0;border:1px solid #D3E3EC; background:#fff;border-radius:14px;padding:4px 9px}
.tuck-chip:hover{background:#F2FBFF}
/* the field and its send button read as one pill */
.tuck-form{position:relative;display:flex;align-items:center;margin:0;padding:10px 12px 12px;flex:none}
.tuck-form input{flex:1;min-width:0;height:40px;margin:0;border:1px solid #DCE3E7;border-radius:20px;padding:0 46px 0 46px;font:inherit;font-size:14px;color:#465C65;background:#F7F9FA;outline:none;box-shadow:none}
.tuck-form input:focus{border-color:#00A1F0;background:#fff;box-shadow:0 0 0 3px rgba(0,161,240,.12)}
.tuck-send{position:absolute;right:17px;top:15px;width:30px;height:30px;border-radius:50%;background:#00abff;color:#fff;display:flex; align-items:center;justify-content:center;font-size:15px;font-weight:700}
.tuck-send.is-stop{font-size:12px}
.tuck-attach{position:absolute;left:17px;top:15px;width:30px;height:30px;border-radius:50%;color:#7A8C94;display:flex;align-items:center;justify-content:center;z-index:1}
.tuck-attach:hover{color:#0277B0;background:#EEF6FA}
.tuck-root.is-busy .tuck-attach{opacity:.4;pointer-events:none}
.tuck-chat.is-drop{outline:3px dashed #00A1F0;outline-offset:-8px}
.tuck-m-file img{display:block;max-width:160px;max-height:120px;border-radius:10px;margin-bottom:6px;background:#fff}
.tuck-file-name{word-break:break-all}

/* Tuck's drawing: stacked frames (assets/images/tuck), one showing at a time */
.tuck-root .tk{position:relative;display:block}
.tuck-root .tk::before{content:"";position:absolute;left:24%;right:24%;bottom:4%;height:6%;border-radius:50%;background:radial-gradient(closest-side,rgba(42,34,51,.16),rgba(42,34,51,0))}
.tk-bodyg{position:absolute;left:0;top:0;width:100%;height:100%;transform-origin:50% 92%;animation:tk-breathe 3.2s ease-in-out infinite}
.tk-f{position:absolute;left:0;top:0;width:100%;height:100%;background:no-repeat center/100% 100%;opacity:0}
.tk-f-idle{background-image:url("../images/tuck/idle.webp?v=3");opacity:1}
.tk-f-blink{background-image:url("../images/tuck/blink.webp?v=3");animation:tk-blink 4.6s infinite}
.tk-f-wave{background-image:url("../images/tuck/wave.webp?v=3")}
.tk-f-listen{background-image:url("../images/tuck/listen.webp?v=3")}
/* the laptop sticks out a little past his square */
.tk-f-work{background-image:url("../images/tuck/work.webp?v=3")}
.tk-f-oops{background-image:url("../images/tuck/oops.webp?v=3")}
.tk-f-happy{background-image:url("../images/tuck/happy.webp?v=3")}
.tk-f-sleep{background-image:url("../images/tuck/sleep.webp?v=3")}
.tk-f-stretch{background-image:url("../images/tuck/stretch.webp?v=3")}
.tk-over{position:absolute;left:0;top:0;width:100%;height:100%;overflow:visible;pointer-events:none}
.tk-over *{transform-box:fill-box}
.tk-x{display:none}

.tk.is-sleep .tk-f-sleep,.tk.is-listen .tk-f-listen,.tk.is-work .tk-f-work,
.tk.is-wave .tk-f-wave,.tk.is-oops .tk-f-oops,.tk.is-happy .tk-f-happy{opacity:1}
/* Moods can overlap; the later one in this list wins: sleep, listen, work, wave, oops, happy */
.tk:is(.is-sleep,.is-listen,.is-work,.is-wave,.is-oops,.is-happy) .tk-f-idle,
.tk:is(.is-sleep,.is-listen,.is-work,.is-wave,.is-oops,.is-happy) .tk-f-blink{opacity:0;animation:none}
.tk:is(.is-listen,.is-work,.is-wave,.is-oops,.is-happy) .tk-f-sleep,
.tk:is(.is-work,.is-wave,.is-oops,.is-happy) .tk-f-listen,
.tk:is(.is-wave,.is-oops,.is-happy) .tk-f-work,
.tk:is(.is-oops,.is-happy) .tk-f-wave,
.tk.is-happy .tk-f-oops{opacity:0}

/* fidgets: a wave, a look around, a head tilt, a double blink, a little bop,
   a wiggle, a stretch, an "oh!" at a sparkle, and nodding off when it's quiet */
.tk.is-wave .tk-bodyg{animation:tk-rock .5s ease-in-out infinite alternate}
.tk.is-glance .tk-bodyg{animation:tk-glance 2.4s ease-in-out}
.tk.is-tilt{transform-origin:50% 92%;animation:tk-tilt 1.8s ease-in-out}
.tk.is-blink2 .tk-f-blink{animation:tk-blink2 1.2s ease-in-out}
.tk.is-bop .tk-bodyg{animation:tk-bop 1.6s ease-in-out}
.tk.is-wiggle .tk-bodyg{animation:tk-wiggle 1.8s ease-in-out}
.tk.is-stretch .tk-bodyg{animation:tk-stretch 3.2s ease-in-out}
.tk.is-stretch .tk-f-stretch{animation:tk-reach 3.2s ease-in-out}
/* the frame underneath steps out while the fidget's own frame is fully in */
.tk.is-stretch .tk-f-idle{animation:tk-under-reach 3.2s linear}
.tk.is-twinkle .tk-f-idle{animation:tk-under-peek 2.6s linear}
.tk.is-doze .tk-f-idle{animation:tk-under-doze 4.4s linear}
.tk:is(.is-stretch,.is-twinkle,.is-doze) .tk-f-blink{animation:none}
.tk.is-twinkle .tk-f-listen{animation:tk-peek 2.6s ease-in-out}
.tk.is-twinkle .tk-sparks{display:inline}
.tk.is-twinkle .tk-sparks path{display:none}
.tk.is-twinkle .tk-sparks .tk-s2{display:inline;animation:tk-twinkle 2.2s ease-in-out}
.tk.is-doze .tk-f-sleep{animation:tk-doze 4.4s ease-in-out}
.tk.is-doze .tk-bodyg{animation:tk-nod 4.4s ease-in-out}
/* hovered: he lights up with a happy face and a soft little bounce */
.tk.is-hello .tk-f-happy{animation:tk-hello-face 1.6s ease-in-out}
.tk.is-hello .tk-f-idle{animation:tk-under-hello 1.6s linear}
.tk.is-hello .tk-f-blink{animation:none}
.tk.is-hello .tk-bodyg{animation:tk-hello 1.6s ease-in-out}
/* walking along the top of the open chat: a little waddle */
.tk.is-walk .tk-bodyg{animation:tk-walk .5s ease-in-out infinite alternate}
/* listening: leans in */
.tk.is-listen .tk-bodyg{animation:tk-lean 1.4s ease-in-out infinite}
/* working: typing away at his laptop */
.tk.is-work .tk-bodyg{animation:tk-busy .36s ease-in-out infinite alternate}
/* oops: a little shake (the sweat drop is in the frame) */
.tk.is-oops{animation:tk-shake .45s ease-in-out 2}
/* happy: hops, with sparkles; wins over everything else */
.tk.is-happy{animation:tk-hop .9s cubic-bezier(.3,0,.4,1) infinite}
.tk.is-happy .tk-sparks{display:inline}
.tk-sparks path{transform-origin:50% 50%;animation:tk-spark 1.4s ease-out infinite}
.tk-sparks .tk-s2{animation-delay:.45s}
.tk-sparks .tk-s3{animation-delay:.9s}
.tk.is-sleep .tk-bodyg{animation-duration:5s}

@keyframes tk-sway{0%,100%{transform:rotate(-.8deg)}50%{transform:translateY(-1px) rotate(.8deg)}}
@keyframes tk-walk{from{transform:rotate(-3deg)}50%{transform:translateY(-1.5px)}to{transform:rotate(3deg)}}
@keyframes tk-glance{0%,100%{transform:none}20%,42%{transform:translateX(-3px) rotate(-4deg)}58%,80%{transform:translateX(3px) rotate(4deg)}}
@keyframes tk-blink2{0%,10%,28%,56%,74%,100%{opacity:0}14%,24%,60%,70%{opacity:1}}
@keyframes tk-bop{0%,50%,100%{transform:translateY(0) scale(1,1)}12%,62%{transform:translateY(0) scale(1.015,.98)}28%,78%{transform:translateY(-1.5px) scale(.99,1.01)}}
@keyframes tk-wiggle{0%,100%{transform:none}20%,60%{transform:rotate(-1.5deg)}40%,80%{transform:rotate(1.5deg)}}
@keyframes tk-stretch{0%,100%{transform:scale(1,1)}12%{transform:scale(1.02,.975)}30%,66%{transform:translateY(-1px) scale(.995,1.01)}84%{transform:scale(1.015,.985)}}
@keyframes tk-reach{0%,14%{opacity:0}22%,72%{opacity:1}80%,100%{opacity:0}}
@keyframes tk-under-reach{0%,22%,72%,100%{opacity:1}22.5%,71.5%{opacity:0}}
@keyframes tk-under-peek{0%,18%,72%,100%{opacity:1}18.5%,71.5%{opacity:0}}
@keyframes tk-under-doze{0%,20%,82%,100%{opacity:1}20.5%,81.5%{opacity:0}}
@keyframes tk-hello-face{0%,100%{opacity:0}12%,80%{opacity:1}}
@keyframes tk-under-hello{0%,12%,80%,100%{opacity:1}12.5%,79.5%{opacity:0}}
@keyframes tk-hello{0%,100%{transform:none}14%{transform:scale(1.02,.97)}36%{transform:translateY(-3px) scale(.99,1.02)}58%{transform:translateY(0) scale(1.015,.985)}74%{transform:none}}
@keyframes tk-twinkle{0%,10%{transform:scale(0) rotate(0);opacity:0}45%{transform:scale(1.4) rotate(25deg);opacity:1}100%{transform:scale(.8) rotate(70deg);opacity:0}}
@keyframes tk-peek{0%,100%{opacity:0}18%,72%{opacity:1}}
@keyframes tk-doze{0%,100%{opacity:0}20%,82%{opacity:1}}
@keyframes tk-nod{0%,100%{transform:none}30%{transform:translateY(.5px) rotate(-1.2deg) scale(1.005,.99)}55%,78%{transform:translateY(1.5px) rotate(-2deg) scale(1.01,.985)}88%{transform:translateY(-.5px) rotate(.5deg)}}
@keyframes tk-tilt{0%,100%{transform:none}30%,70%{transform:rotate(-7deg)}}
@keyframes tk-breathe{0%,100%{transform:scale(1,1)}50%{transform:scale(1.025,.97)}}
@keyframes tk-blink{0%,93%,97%,100%{opacity:0}94%,96%{opacity:1}}
@keyframes tk-rock{from{transform:rotate(-3deg)}to{transform:rotate(3deg)}}
@keyframes tk-lean{0%,100%{transform:rotate(-3deg)}50%{transform:rotate(-5deg) scale(1.02,.98)}}
@keyframes tk-busy{from{transform:translateY(0) scale(1,1)}to{transform:translateY(-1.5px) scale(.985,1.02)}}
@keyframes tk-spark{0%{transform:scale(0) rotate(0);opacity:0}30%{transform:scale(1.15) rotate(30deg);opacity:1}100%{transform:scale(.6) rotate(90deg);opacity:0}}
@keyframes tk-shake{0%,100%{transform:none}25%{transform:translateX(-3px) rotate(-2deg)}75%{transform:translateX(3px) rotate(2deg)}}
@keyframes tk-hop{0%,100%{transform:translateY(0) scale(1,1)}15%{transform:translateY(0) scale(1.08,.9)}45%{transform:translateY(-22px) scale(.95,1.06)}75%{transform:translateY(0) scale(1.06,.93)}}
@keyframes tuck-pop{from{opacity:0;transform:translateY(8px) scale(.96)}to{opacity:1;transform:none}}
@keyframes tuck-grow{from{opacity:0;transform:scale(.6)}to{opacity:1;transform:none}}
@keyframes tuck-zz{0%{opacity:0;transform:translate(0,0) scale(.7)}20%{opacity:1}100%{opacity:0;transform:translate(14px,-34px) scale(1.2)}}
@keyframes tuck-heart{0%{opacity:0;transform:translateY(0) scale(.4)}20%{opacity:1;transform:translateY(-8px) scale(1.1)}100%{opacity:0;transform:translateY(-60px) scale(1)}}
@keyframes tuck-dot{0%,80%,100%{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}

@media (min-width:601px) and (max-width:1100px){
  .tuck-chat{width:320px}
}
@media (max-height:500px){
  .tuck-chat{min-height:0;max-height:calc(var(--tuck-vh,100vh) - var(--tuck-floor,0px) - 28px);max-height:max(180px, calc(var(--tuck-vh,100vh) - var(--tuck-floor,0px) - 160px))}
}
/* Tablets with the keyboard up: the chat sits right on it, short enough
   that Tuck keeps his perch in what's left of the screen */
.tuck-root.is-kb .tuck-chat{bottom:calc(var(--tuck-kb,0px) + 12px);min-height:0;max-height:calc(var(--tuck-kb-vh,100vh) - 96px);animation:none}
/* Phones: a short sheet on the price bar, so the shirt stays in view above it */
@media (max-width:600px){
  .tuck-chat{left:8px;right:8px;width:auto;bottom:8px;bottom:calc(var(--tuck-chat-floor,0px) + 8px);height:340px;height:clamp(240px, calc(var(--tuck-vh,100vh) * .42), 380px);max-height:calc(var(--tuck-vh,100vh) - var(--tuck-chat-floor,0px) - 150px);min-height:0}
  /* 16px stops iPhones zooming in on the field */
  .tuck-form input{font-size:16px}
  /* Smaller, so he doesn't crowd the shirt; his z's and hint scale with him */
  .tuck-walker{width:56px}
  .tuck-walker .tuck-big{width:56px !important;height:56px !important}
  .tuck-walker .tuck-fx{transform:scale(.6);transform-origin:0 0}
  .tuck-hint{right:36px;bottom:64px}
  /* Offers sit above him, with a field big enough to tap */
  .tuck-nudge{right:0;bottom:68px;max-width:calc(100vw - 40px);transform-origin:85% 100%}
  .tuck-root .tuck-nudge-input{height:32px;font-size:16px}
  .tuck-root .tuck-nudge-send{width:32px;height:32px}
  /* With the keyboard up there's little room left, so the chat takes all of
     it: Tuck steps off his perch and the starter chips go away */
  .tuck-root.is-kb .tuck-chat{bottom:calc(var(--tuck-kb,0px) + 6px);height:calc(var(--tuck-kb-vh,100vh) - 12px);max-height:420px;animation:none}
  .tuck-root.is-kb .tuck-perch,.tuck-root.is-kb .tuck-chips{display:none}
}
/* Tuck's cursor and the outline on what he's working on */
.tuck-cursor{position:fixed;left:0;top:0;z-index:1600;pointer-events:none;opacity:0;transition:opacity .25s;will-change:transform;font-family:"Museo Sans","museo-sans",Helvetica,Arial,sans-serif}
.tuck-cursor.is-on{opacity:1}
.tuck-cursor svg{position:absolute;left:-3px;top:-3px;display:block;filter:drop-shadow(0 1px 2px rgba(13,39,98,.35));transform-origin:3px 3px;transition:transform .1s}
.tuck-cursor.is-down svg{transform:scale(.8)}
.tuck-cursor-tag{position:absolute;left:15px;top:19px;padding:2px 8px 3px;border-radius:3px 9px 9px 9px;background:#01B0FF;color:#0D2762;font-size:12px;font-weight:700;line-height:15px;white-space:nowrap;box-shadow:0 0 0 1.5px #fff,0 2px 5px rgba(13,39,98,.25)}
.tuck-cursor-ring{position:absolute;left:-13px;top:-13px;width:26px;height:26px;border-radius:50%;border:2px solid #01B0FF;animation:tuck-ring .5s ease-out forwards}
@keyframes tuck-ring{from{transform:scale(.3);opacity:1}to{transform:scale(1.4);opacity:0}}
.tuck-cursor-sel{position:fixed;left:0;top:0;z-index:1490;pointer-events:none;border:2px solid #01B0FF;border-radius:3px;opacity:0;transition:opacity .2s}
.tuck-cursor-sel.is-on{opacity:1}
/* Save and Quote boxes open from the header; keep them above the chat (mobile.css pins the phone header at 100) */
body.tuck-chat-open.np-pop-open header{z-index:1501 !important}
/* and above the mascot, which otherwise covers Go to Checkout in short windows */
body.np-on.np-pop-open:not(.tuck-chat-open) .tuck-root{z-index:4}
@media (prefers-reduced-motion:reduce){
  .tuck-root .tk,.tuck-root .tk *,.tuck-face-dir,.tuck-chat,.tuck-nudge,.tuck-dots i{animation:none !important}
}
