/* "Ask Lupo" (src/lupo.js), only with PW_LUPO_URL: a launcher bottom-right and a compact chat window
   (a full-screen sheet on phones). The shop's own tokens (src/site.css): ink, paper and the brand vermilion for
   Lupo himself. The window is flat: no shadows, square corners like every shop control. The launcher is the one
   exception, a piece of glass (below), and Lupo is the one bold thing: he sits in it and leans out over the top
   edge of the window.
   Focus: one 2 px ring, at least 3:1 (WCAG) against whatever it sits on.
   - Launcher: the label's own colour, just outside the glass. The label already follows the page behind it
     (ink over paper, warm white over dark and over vermilion), so the ring does too.
   - Inside the window: a deeper vermilion, #C93A1F: 4.2:1 on paper, 3.8:1 on a Lupo bubble (5 % ink), 3.6:1 on a
     hovered icon (7 % ink), 3.7:1 on ink. The brand vermilion would be 2.9:1 on a bubble. */
.lupo{--lupo-body:var(--bg);--lupo-eye:var(--ink);--lupo-focus:#C93A1F;--lupo-base:20px;--lupo-side:20px;position:relative;z-index:55;font-family:Archivo,Arial,sans-serif;color:var(--ink)}
.lupo :focus-visible{outline:2px solid var(--lupo-focus);outline-offset:2px}
.lupo .lupo-launcher:focus-visible{outline:2px solid currentColor;outline-offset:3px}
/* Fields: the ring replaces their ink border instead of doubling it. */
.lupo textarea:focus-visible,.lupo input:focus-visible,.lupo textarea:focus,.lupo input:focus{outline:2px solid var(--lupo-focus);outline-offset:-1px}
.lupo [hidden],.lupo.is-covered{display:none!important}
.lupo-face{display:block;background:url('/assets/lupo/lupo.svg') center/contain no-repeat}
.lupo-face.is-alive{background:none}
.lupo-face svg{display:block;width:100%;height:100%}

/* Launcher: a clear piece of glass, a pill, with Lupo inside it (owner, 16 Nov; before: an ink box he leaned
   out of, where half of him vanished over a vermilion section). Nearly no wash and a 1 px blur, so the page
   shows through; what makes it glass is the rim. There src/lupo.js bends the page behind it and splits it a
   little into colours (an SVG filter, #lupo-lens, from the lens maps in /assets/lupo/, sized to the launcher):
   .has-lens, in browsers that take a filter there (Chromium). Elsewhere it is the same clear pill with its rim.
   The rim is drawn with inset shadows: a bright line on top, a faint one below, a hairline all round. They are
   the only shadows in the widget, and none of them falls outside the glass.
   One glass everywhere, nothing reads the page (owner, 17 Nov): the clear lens glass as designed, and a warm
   white label with its own soft ink halo, so it reads on paper, on pictures and on dark pages alike.
   --lupo-f, --lupo-fl and --lupo-fb are his size and his left and bottom offsets.
   src/lupo.js owns these too: --lupo-lift raises the launcher over the consent bar or the phone buy bar (with
   --lupo-safe 0: those bars pad for the home indicator already), and .is-compact folds it to a round glass
   with Lupo alone (the label stays the accessible name), while the buy bar is on, and on phones once the page
   has scrolled, on product pages and on the home page. */
.lupo-launcher{--lupo-f:34px;--lupo-fl:7px;--lupo-fb:6px;
 position:fixed;right:var(--lupo-side);bottom:calc(var(--lupo-base) + var(--lupo-lift,0px) + var(--lupo-safe,env(safe-area-inset-bottom)));
 display:flex;align-items:center;min-height:46px;min-width:46px;padding:0 20px 0 50px;border:0;border-radius:999px;color:var(--paper);
 background:linear-gradient(180deg,rgba(255,255,255,.07),rgba(255,255,255,0) 42%),rgba(26,15,10,.05);
 -webkit-backdrop-filter:blur(1px) saturate(1.15);backdrop-filter:blur(1px) saturate(1.15);
 box-shadow:inset 0 0 0 1px rgba(255,255,255,.2),inset 0 0 0 .5px rgba(26,15,10,.35),inset 0 1.5px 0 rgba(255,255,255,.5),inset 0 -1.5px 0 rgba(255,255,255,.14),inset 2px 0 2px -1px rgba(255,255,255,.25),inset -2px 0 2px -1px rgba(255,255,255,.16);
 font-size:13px;font-weight:600;line-height:1.2;transition:padding .25s ease,transform .25s cubic-bezier(.3,1.5,.5,1),color .2s}
.lupo.has-lens .lupo-launcher{backdrop-filter:url(#lupo-lens) blur(1px) saturate(1.15)}
/* The label reads on any page without reading the page (owner, 17 Nov): warm white with a soft ink halo of its own,
   the glass untouched. */
.lupo .lupo-launcher-text{text-shadow:0 0 6px rgba(26,15,10,.75),0 0 14px rgba(26,15,10,.55),0 1px 22px rgba(26,15,10,.35);
 padding:16px 22px;margin:-16px -22px}   /* room for the soft halo inside the label's own clip (it folds with overflow:hidden) */
.lupo.is-compact .lupo .lupo-launcher-text,.lupo.is-compact .lupo-launcher-text{padding:0;margin:0}
.lupo-launcher-text{display:block;max-width:16em;overflow:hidden;white-space:nowrap;transition:max-width .25s ease,opacity .2s}

.lupo-launcher .lupo-face{position:absolute;left:var(--lupo-fl);bottom:var(--lupo-fb);width:var(--lupo-f);height:var(--lupo-f)}
.lupo-launcher:hover{transform:scale(1.05)}
.lupo-launcher:active{transform:scale(.98)}
.lupo.is-compact .lupo-launcher{--lupo-fl:7px;--lupo-fb:7px;width:48px;height:48px;min-height:48px;min-width:48px;padding:0}
.lupo.is-compact .lupo-launcher-text{max-width:0;opacity:0}
.lupo-lens{position:absolute;width:0;height:0}
@media(prefers-reduced-motion:reduce){.lupo-launcher,.lupo-launcher-text{transition:none}.lupo-launcher:hover,.lupo-launcher:active{transform:none}}

/* Window */
.lupo-window{position:fixed;right:var(--lupo-side);bottom:calc(var(--lupo-base) + var(--lupo-lift,0px) + env(safe-area-inset-bottom));
 width:min(380px,calc(100vw - 2 * var(--lupo-side)));height:min(600px,calc(100dvh - var(--lupo-base) - var(--lupo-lift,0px) - 44px));
 display:flex;flex-direction:column;background:var(--paper);border:1px solid var(--ink);
 animation:lupo-rise .2s cubic-bezier(.2,.7,.3,1);
 /* Paper on dark pages too: the page's light-on-ink tokens do not apply in here. */
 --muted:rgba(26,15,10,.65);--line:rgba(26,15,10,.22);color-scheme:light}
@keyframes lupo-rise{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
.lupo-bar{position:relative;display:flex;align-items:center;gap:4px;min-height:58px;padding:6px 8px 6px 78px;border-bottom:1px solid var(--line)}
.lupo-mascot{position:absolute;left:10px;bottom:4px;width:62px;height:62px;color:var(--ink)}
.lupo .lupo-title{flex:1;margin:0;font-size:19px;font-weight:800;line-height:1.1;letter-spacing:-.03em;font-variation-settings:'wdth' 125;text-transform:none}
.lupo-icon{display:grid;place-items:center;width:38px;height:38px;flex:none;padding:0;border:0;background:transparent;color:var(--ink)}
.lupo-icon:hover{background:rgba(26,15,10,.07)}
.lupo-icon .lupo-off,.lupo-icon[aria-pressed=true] .lupo-on{display:none}
.lupo-icon[aria-pressed=true] .lupo-off{display:inline}
.lupo-body{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:18px 16px 8px}

/* Start-chat card: the acceptance */
.lupo-start{display:grid;gap:14px;justify-items:start}
.lupo .lupo-start-text{margin:0;font-size:14px;line-height:1.55;max-width:44ch}
.lupo-privacy{font-size:13px;text-decoration:underline;text-underline-offset:3px}
.lupo-begin{width:100%;margin-top:4px}

/* Conversation */
.lupo-log{display:flex;flex-direction:column;gap:12px}
.lupo-msg{display:flex;align-items:flex-start;gap:8px}
.lupo-msg.is-you{justify-content:flex-end}
/* Lupo's small face beside his lines: the newest one is the live rig (src/lupo.js), the older ones the drawing. */
.lupo-face-small{width:32px;height:32px;flex:none;color:var(--ink)}
.lupo .lupo-bubble{margin:0;max-width:86%;padding:9px 12px;font-size:14px;line-height:1.5;overflow-wrap:anywhere;background:rgba(26,15,10,.05);border:1px solid var(--line)}
.lupo .lupo-bubble p{margin:0}
.lupo .lupo-bubble p+p{margin-top:.65em}
.lupo .lupo-bubble strong{font-weight:700}
.lupo-msg.is-you .lupo-bubble{background:var(--ink);color:var(--paper);border-color:var(--ink)}
.lupo-msg.is-you .lupo-bubble p{white-space:pre-wrap}
.lupo-bubble p a{text-decoration:underline;text-underline-offset:3px}
/* Link cards: a page of the shop (or one of its accounts) as a small row: title, one line, price, arrow.
   The left edge takes the plugin's colour when the page has one. */
.lupo-links{display:grid;gap:6px;margin-top:10px}
.lupo-bubble .visually-hidden+.lupo-links{margin-top:0}
.lupo-link{display:flex;align-items:center;gap:10px;min-height:44px;padding:8px 10px 8px 11px;background:var(--paper);color:var(--ink);
 border:1px solid var(--line);border-left:3px solid var(--lupo-link,var(--ink));text-decoration:none;transition:border-color .15s}
.lupo-link:hover{text-decoration:none;border-color:var(--ink);border-left-color:var(--lupo-link,var(--ink))}
.lupo-link-text{display:grid;flex:1;min-width:0}
.lupo-link-title{font-size:13px;font-weight:700;line-height:1.25}
.lupo-link-line{font-size:12px;line-height:1.35;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lupo-link-price{flex:none;font-size:13px;font-weight:600;font-variant-numeric:tabular-nums}
.lupo-link-arrow{flex:none;transition:transform .15s}
.lupo-link:hover .lupo-link-arrow{transform:translate(2px,-2px)}
/* Lupo typing: three dots, right after the visitor sends */
.lupo .lupo-dots{display:flex;align-items:center;gap:5px;min-height:38px;padding:0 14px}
.lupo-dots span{width:6px;height:6px;border-radius:50%;background:var(--ink);opacity:.25;animation:lupo-dot 1.1s infinite ease-in-out}
.lupo-dots span:nth-child(2){animation-delay:.15s}
.lupo-dots span:nth-child(3){animation-delay:.3s}
@keyframes lupo-dot{0%,60%,100%{opacity:.25;transform:none}30%{opacity:.85;transform:translateY(-3px)}}
.lupo-word{animation:lupo-word .2s both}
@keyframes lupo-word{from{opacity:0}to{opacity:1}}
/* An action the server offers under Lupo's line (the team button): one press */
.lupo-offer{padding-left:40px}
.lupo-offer-button{min-height:38px;padding:0 14px;border:1px solid var(--ink);background:var(--paper);color:var(--ink);font-size:13px;font-weight:600;transition:background .15s,color .15s}
.lupo-offer-button:hover:not(:disabled){background:var(--ink);color:var(--paper)}
.lupo-offer-button:disabled{opacity:.45;cursor:default}
.lupo-offer-button.is-pressed{opacity:.6}
/* A link card (the WhatsApp chat): the button's look, as a link */
.lupo-offer-link{display:inline-flex;align-items:center;text-decoration:none}
.lupo-offer-link:hover{text-decoration:none}
/* The handoff email: a small form in Lupo's voice, in the list */
.lupo-card-body{display:grid;gap:7px;width:86%;white-space:normal}
.lupo-card-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.lupo-card-body label{font-size:12px;font-weight:600}
.lupo-card-skip{display:grid;place-items:center;width:28px;height:28px;margin:-6px -8px -6px 0;padding:0;border:0;background:transparent;color:var(--ink)}
.lupo-card-skip:hover{background:rgba(26,15,10,.07)}
.lupo-card-skip:disabled{opacity:.4}
.lupo-card-row{display:flex;gap:6px}
.lupo-card-row input{flex:1;min-width:0;font:inherit;font-size:14px;color:inherit;background:var(--paper);border:1px solid var(--ink);border-radius:0;padding:7px 9px}
.lupo-card-send{flex:none;border:1px solid var(--ink);background:var(--ink);color:var(--paper);font-size:13px;font-weight:600;padding:0 12px}
.lupo-closed{margin-top:14px;padding-top:12px;border-top:1px solid var(--line);font-size:13px}
.lupo-closed p{margin:0}
.lupo-closed ul{margin:6px 0 0;padding-left:18px;display:grid;gap:4px}
.lupo-closed a{text-decoration:underline;text-underline-offset:3px}
.lupo .lupo-status{margin:8px 0 0;min-height:1.4em;font-size:12px;color:var(--muted)}
.lupo-turnstile{margin-top:8px}

/* Compose */
.lupo-compose{border-top:1px solid var(--line);padding:10px 12px 8px}
.lupo-line{display:flex;align-items:flex-end;gap:8px}
.lupo-line textarea{flex:1;min-width:0;min-height:42px;max-height:9.5em;field-sizing:content;resize:none;font:inherit;font-size:14px;line-height:1.45;color:inherit;background:transparent;border:1px solid var(--ink);border-radius:0;padding:10px 11px}
.lupo-line textarea::placeholder{color:var(--muted)}
.lupo-line textarea:disabled{opacity:.5;cursor:not-allowed}
.lupo-send{flex:none;min-height:42px;padding:0 15px;border:1px solid var(--ink);background:var(--ink);color:var(--paper);font-size:13px;font-weight:600}
.lupo .lupo-foot{margin:7px 0 0;font-size:11px;line-height:1.3;color:var(--muted)}

/* The home film: stay clear of its sound and pause controls at the bottom right. */
.is-landing .lupo{--lupo-base:calc(clamp(25px,4vh,48px) + 58px)}
@media(max-width:760px){.is-landing .lupo{--lupo-base:128px}}

/* Phones: the launcher gets smaller, the window becomes a full-screen sheet. */
@media(max-width:479px){
 .lupo{--lupo-base:10px;--lupo-side:16px}
 /* Low: a third of the home-indicator inset is enough to clear it (about 22 px from the bottom on an iPhone). */
 body:not(.is-landing) .lupo{--lupo-safe:calc(env(safe-area-inset-bottom,0px) / 3)}
 /* The open sheet sits above the cookie consent bar (z-index 60), which is inert meanwhile (src/lupo.js). */
 html.lupo-is-open .lupo{z-index:61}
 /* The home page: folded (src/lupo.js), in the bottom row beside the video button, which makes room for it
    (src/home.css). No home-indicator inset: that row has none either. Hidden while the cookie bar lifts it. */
 .is-landing .lupo{--lupo-base:20px;--lupo-side:var(--pad);--lupo-safe:0px}
 .is-landing .lupo.is-lifted .lupo-launcher{display:none}
 .lupo-launcher{--lupo-f:30px;--lupo-fb:6px;min-height:42px;padding:0 16px 0 44px;font-size:12px}
 .lupo.is-compact .lupo-launcher{--lupo-f:34px}
 .lupo-window{inset:0;width:100%;height:100%;height:100dvh;border:0;box-shadow:none;padding-bottom:env(safe-area-inset-bottom)}
 .lupo-bar{padding-left:70px;min-height:60px}
 .lupo-mascot{bottom:6px;width:54px;height:54px}
 html.lupo-is-open{overflow:hidden}
}
@media print{.lupo{display:none}}
