:root,:host{
  --surface:#fffaf4;--card:#fff;--persona-a:#4a4d52;--persona-b:#2b2d31;
  --ink:#2f2a26;--dim:#7d726a;--faint:#b3a89e;--line:#eadfd3;--line-strong:#dccdbd;
  --accent:#b5523b;--accent-soft:#f3dfd6;--on-accent:#fff;--error:#b0412c;--ok:#4f7d52;
  --radius:26px;
  --sans:'Avenir Next',Avenir,Inter,system-ui,-apple-system,'Segoe UI',sans-serif;
  font-synthesis:none;
}
/* The agent card: shared by AgentViewer (a page) and the embedded widget (a shadow root). */
.widget,.widget *{box-sizing:border-box}
.widget{color:var(--ink);font:400 15px/1.5 var(--sans);text-align:left;-webkit-tap-highlight-color:transparent}
.widget button{font:inherit;cursor:pointer}
.widget a{color:inherit}

/* Widget: persona on the left, conversation on the right. */
.widget{display:grid;grid-template-columns:minmax(260px,38%) minmax(0,1fr);
  background:var(--surface);border-radius:var(--radius);overflow:hidden;box-shadow:0 1px 0 rgba(255,255,255,.7) inset,0 24px 60px -24px rgba(70,45,25,.35),0 2px 8px rgba(70,45,25,.08)}

/* A soft pool of light behind the character, falling off to the floor and the edges. */
.persona{position:relative;display:flex;flex-direction:column;min-height:0;min-width:0;
  background:radial-gradient(55% 40% at 50% 44%,rgba(255,236,214,.16),transparent 70%),radial-gradient(90% 60% at 50% 100%,rgba(0,0,0,.28),transparent 70%),linear-gradient(180deg,var(--persona-a),var(--persona-b))}
/* The canvas fills the column; the mic floats over it, with no strip of its own. */
.stage{position:absolute;inset:0;display:grid;place-items:center}
/* Out of the flow: the drawing buffer must not size the stage, or the canvas never shrinks back. */
.stage canvas{position:absolute;inset:0;width:100%;height:100%;display:block;pointer-events:none}
.loading{position:absolute;font-size:13px;color:var(--dim)}
.loading[hidden]{display:none}
.controls{position:absolute;left:0;right:0;bottom:0;z-index:2;display:flex;justify-content:center;padding:0 0 26px;pointer-events:none}
.controls #mic{pointer-events:auto}

/* Quiet corner menu: three dots, opens on hover or focus. */
.corner-menu{position:absolute;top:14px;left:14px;z-index:3}
.corner-toggle{appearance:none;width:34px;height:34px;border-radius:50%;display:grid;place-items:center;border:0;background:transparent;color:rgba(255,255,255,.38);transition:color .2s,background .2s}
.corner-toggle svg{width:16px;height:4px;fill:currentColor}
.corner-menu:hover .corner-toggle,.corner-menu:focus-within .corner-toggle{color:rgba(255,255,255,.85);background:rgba(255,255,255,.08)}
.corner-menu{display:flex;align-items:center;gap:6px}
.corner-items{display:flex;padding:4px;border-radius:999px;background:var(--card);box-shadow:0 10px 26px -12px rgba(0,0,0,.5);white-space:nowrap;
  opacity:0;visibility:hidden;transform:translateX(-6px);transition:opacity .15s,transform .15s,visibility .15s}
.corner-menu:hover .corner-items,.corner-menu:focus-within .corner-items{opacity:1;visibility:visible;transform:none}
.corner-items button{appearance:none;border:0;background:none;color:var(--ink);font-size:13px;padding:6px 12px;border-radius:999px}
.corner-items button:hover,.corner-items button:focus-visible{background:#f6efe6;color:var(--error);outline:none}

#mic{appearance:none;width:64px;height:64px;border-radius:50%;display:grid;place-items:center;border:1px solid var(--line-strong);background:var(--card);color:var(--ink);
  box-shadow:0 6px 18px -8px rgba(70,45,25,.45);transition:background .25s,color .25s,border-color .25s,box-shadow .25s,transform .1s;
  touch-action:manipulation;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
#mic svg{width:24px;height:24px;display:block}
#mic:hover{border-color:var(--dim)}
#mic:active{transform:scale(.95)}
#mic:focus-visible{outline:2px solid var(--accent);outline-offset:4px}
#mic .slash{opacity:0;transition:opacity .2s}
#mic[aria-pressed=true]{background:var(--accent);border-color:var(--accent);color:var(--on-accent);animation:live 2.4s ease-out infinite}
#mic.muted{background:var(--accent-soft);border-color:var(--accent-soft);color:var(--accent)}
#mic.muted .slash{opacity:1}
#mic.connecting{animation:connecting 1.1s ease-in-out infinite}
#mic.holding{transform:scale(.94);animation:arming var(--hang,650ms) linear forwards}
#mic:disabled{opacity:.45;cursor:default}
@keyframes live{0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--accent) 40%,transparent)}70%,100%{box-shadow:0 0 0 14px color-mix(in srgb,var(--accent) 0%,transparent)}}
@keyframes connecting{50%{box-shadow:0 0 0 8px color-mix(in srgb,var(--accent) 22%,transparent)}}
@keyframes arming{from{box-shadow:0 0 0 0 color-mix(in srgb,var(--error) 55%,transparent)}to{box-shadow:0 0 0 9px color-mix(in srgb,var(--error) 55%,transparent)}}

/* Conversation */
.chat{min-height:0;min-width:0;display:flex;flex-direction:column;border-left:1px solid var(--line)}
.chat-list{flex:1;overflow-y:auto;overscroll-behavior:contain;padding:22px 22px 26px;display:flex;flex-direction:column;gap:10px;scrollbar-width:thin;scrollbar-color:var(--line-strong) transparent}
/* Items keep their size when the list overflows; an empty picture frame would collapse. */
.chat-list>*{flex-shrink:0}
.restored{animation:none!important}
.chat-empty{margin:auto 0;padding:0 8px;color:var(--dim);max-width:360px;align-self:center;text-align:center}
.chat-empty[hidden]{display:none}
.chat-empty strong{display:block;color:var(--ink);font-size:20px;font-weight:600;margin-bottom:6px}
.chat-empty p{margin:0;font-size:14px;text-wrap:pretty}

.msg{max-width:84%;padding:9px 14px;border-radius:18px;animation:rise .25s ease-out}
.msg .text{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;text-wrap:pretty}
.msg.user{align-self:flex-end;background:var(--ink);color:#fbf6ef;border-bottom-right-radius:6px}
.msg.user.pending .text{opacity:.55;letter-spacing:.2em}
.msg.assistant{align-self:flex-start;background:var(--card);border:1px solid var(--line);border-bottom-left-radius:6px}
.note{align-self:flex-start;font-size:13px;color:var(--dim);padding:2px 4px;max-width:90%}
.note.error{color:var(--error)}
.divider{align-self:stretch;display:flex;align-items:center;gap:10px;color:var(--faint);font-size:12px;margin:6px 0}
.divider::before,.divider::after{content:"";flex:1;height:1px;background:var(--line)}
@keyframes rise{from{opacity:0;transform:translateY(4px)}}

/* Cards */
.card{align-self:stretch;background:var(--card);border:1px solid var(--line);border-radius:18px;padding:12px;display:flex;flex-direction:column;gap:10px;animation:rise .3s ease-out;min-width:0}
.card-note{margin:0;font-size:13px;color:var(--dim)}
.tag{font-size:11px;color:var(--dim);background:#f6efe6;border-radius:999px;padding:2px 8px;white-space:nowrap}

.card-products{background:none;border:0;padding:0}
.carousel{display:flex;flex-direction:column;gap:8px}
.product{display:grid;grid-template-columns:104px minmax(0,1fr);grid-template-areas:"photo body" "photo actions";border:1px solid var(--line);border-radius:14px;overflow:hidden;background:var(--surface)}
.carousel.single .product{grid-template-columns:150px minmax(0,1fr)}
.product-photo{grid-area:photo;position:relative;display:block;min-height:118px;background:#f1e8dc}
.product-photo img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}
.stickers{position:absolute;left:6px;top:6px;display:flex;flex-direction:column;align-items:flex-start;gap:4px}
.sticker{font-size:10px;font-weight:600;background:var(--accent);color:#fff;border-radius:999px;padding:2px 8px}
.product-body{grid-area:body;padding:10px 12px 2px;display:flex;flex-direction:column;gap:4px;min-width:0}
.product-meta{font-size:11px;color:var(--dim);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.product-name{font-weight:600;font-size:14px;line-height:1.3;text-decoration:none;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
a.product-name:hover{color:var(--accent)}
.product-row{display:flex;align-items:center;gap:8px;min-width:0}
.swatches{display:flex}
.swatch{width:14px;height:14px;border-radius:50%;border:1.5px solid var(--surface);box-shadow:0 0 0 1px var(--line-strong);margin-right:-3px}
.sizes{font-size:11px;color:var(--dim);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-left:6px}
.product-summary{margin:2px 0 0;font-size:13px;color:var(--dim)}
.colorway{font-size:12px;color:var(--dim)}
.product-actions{grid-area:actions;align-self:end;display:flex;flex-wrap:wrap;gap:6px;padding:6px 12px 10px}
.product-actions .open,.buy{font-size:12px;text-decoration:none;border-radius:999px;padding:4px 10px;border:1px solid var(--line-strong);white-space:nowrap}
.product-actions .open{background:var(--ink);border-color:var(--ink);color:#fbf6ef}
a.buy:hover{border-color:var(--accent);color:var(--accent)}
.buy.muted{color:var(--dim)}

.facet{display:flex;flex-direction:column;gap:4px}
.facet-title{font-size:12px;font-weight:600;color:var(--dim)}
.facet-row{display:grid;grid-template-columns:minmax(90px,38%) 1fr 32px;align-items:center;gap:8px;font-size:13px}
.facet-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.facet-bar{height:8px;border-radius:99px;background:#f4ece2;overflow:hidden}
.facet-bar .bar{display:block;height:100%;width:var(--w);background:var(--c,var(--accent));border-radius:99px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.06)}
.facet-count{font-size:12px;color:var(--dim);text-align:right}

.chips{display:flex;flex-wrap:wrap;gap:6px}
.chip{display:inline-flex;align-items:center;gap:6px;font-size:13px;text-decoration:none;border:1px solid var(--line-strong);border-radius:999px;padding:4px 11px;background:var(--surface)}
.chip small{color:var(--faint);font-size:11px}
a.chip:hover{border-color:var(--accent)}
.filter-group{display:flex;flex-direction:column;gap:6px}
.links{display:flex;flex-direction:column}
.link-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 2px;text-decoration:none;border-bottom:1px solid var(--line)}
.link-row:last-child{border-bottom:0}
a.link-row:hover .link-title{color:var(--accent)}

.contact{display:flex;flex-direction:column;gap:3px;padding-bottom:10px;border-bottom:1px solid var(--line)}
.contact:last-of-type{border-bottom:0;padding-bottom:0}
.contact-name{font-weight:600;display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.contact-address,.contact-hours{font-size:13px;color:var(--dim)}
.contact-line{display:flex;align-items:baseline;gap:8px;font-size:14px}
.contact-line small{color:var(--faint);font-size:12px}
.phone,.email{color:var(--accent);text-decoration:none;font-weight:500}

.content-item{display:flex;gap:10px;text-decoration:none;padding:6px 0;border-bottom:1px solid var(--line)}
.content-item:last-child{border-bottom:0}
.content-photo{width:64px;height:64px;border-radius:10px;object-fit:cover;flex:none;background:#f1e8dc}
.content-body{min-width:0}
.content-meta{font-size:11px;color:var(--accent);text-transform:uppercase;letter-spacing:.06em}
.content-body strong{display:block;font-size:14px;line-height:1.3}
.content-body p{margin:3px 0 0;font-size:13px;color:var(--dim)}

.web-summary{margin:0;font-size:14px;text-wrap:pretty}
.web-result,.web-page{display:flex;flex-direction:column;gap:1px;padding:8px 0;text-decoration:none;border-top:1px solid var(--line)}
.web-page{border-top:0;padding:0}
.web-result strong,.web-page strong{font-size:14px;line-height:1.3}
a.web-result:hover strong{color:var(--accent)}
.web-result p,.web-page p{margin:2px 0 0;font-size:13px;color:var(--dim)}
.host{font-size:11px;color:var(--faint)}

.msg.picture{align-self:flex-start;display:block;padding:0;width:min(100%,440px);border-radius:18px;border-bottom-left-radius:6px;overflow:hidden;background:#efe6da;box-shadow:0 8px 24px -14px rgba(70,45,25,.45)}
.msg.picture .generated{display:block;width:100%;height:auto}
.msg.picture.drawing{background:linear-gradient(110deg,#efe6da 30%,#f8f1e8 50%,#efe6da 70%) 0 0/250% 100%;animation:rise .25s ease-out,shimmer 1.6s linear infinite}
@keyframes shimmer{to{background-position:-250% 0}}
.infographic{width:100%;border:0;border-radius:12px;background:#fffdf9;display:block}

.msg.user.with-picture{padding:4px;display:flex;flex-direction:column;gap:4px;max-width:min(84%,320px)}
.msg.user.with-picture .attached{display:block;width:100%;height:auto;border-radius:14px}
.msg.user.with-picture .text{padding:4px 10px 5px}

/* Composer: typing and pictures. It steps aside while a voice call is on. */
.composer{flex:none;margin:0 16px 16px;padding:6px;border-radius:22px;background:var(--card);border:1px solid var(--line-strong);
  box-shadow:0 8px 22px -16px rgba(70,45,25,.5);transition:opacity .2s,transform .2s,margin .2s,max-height .25s;max-height:260px}
.composer:focus-within{border-color:var(--dim)}
.chat.voice .composer{opacity:0;transform:translateY(8px);max-height:0;margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;border-width:0;overflow:hidden;pointer-events:none}
.composer-row{display:flex;align-items:flex-end;gap:6px}
.attach{flex:none;width:36px;height:36px;border-radius:50%;display:grid;place-items:center;color:var(--dim);cursor:pointer;transition:background .2s,color .2s}
.attach:hover{background:#f6efe6;color:var(--ink)}
.attach svg{width:20px;height:20px}
.attach:focus-within{outline:2px solid var(--accent);outline-offset:2px}
#prompt{flex:1;min-width:0;resize:none;border:0;background:none;color:var(--ink);font:400 15px/1.45 var(--sans);padding:8px 4px;max-height:132px;outline:none}
#prompt::placeholder{color:var(--faint)}
#send{flex:none;width:36px;height:36px;border-radius:50%;display:grid;place-items:center;border:0;background:var(--ink);color:#fbf6ef;transition:opacity .2s,transform .1s}
#send svg{width:15px;height:15px}
#send:disabled{opacity:.25;cursor:default}
#send:not(:disabled):active{transform:scale(.94)}
.attachment{position:relative;display:inline-block;margin:2px 2px 6px}
.attachment[hidden]{display:none}
.attachment img{display:block;height:64px;max-width:120px;object-fit:cover;border-radius:12px}
.attachment.uploading img{opacity:.5}
.attachment-remove{position:absolute;top:-6px;right:-6px;width:22px;height:22px;border-radius:50%;border:0;background:var(--ink);color:#fff;font-size:14px;line-height:1;display:grid;place-items:center}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* Phone: persona on top, conversation below. */
@media(max-width:760px){
  .widget{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(160px,36%) minmax(0,1fr)}
  .controls{justify-content:flex-end;padding:0 18px 16px}
  .chat{border-left:0;border-top:1px solid var(--line)}
  .chat-list{padding:16px 14px 12px}
  .composer{margin:0 10px calc(env(safe-area-inset-bottom) + 10px)}
  .msg{max-width:90%}
  .product,.carousel.single .product{grid-template-columns:88px minmax(0,1fr)}
}
@media(prefers-reduced-motion:reduce){.widget *{animation-duration:.01ms!important;transition-duration:.01ms!important}}
