/* Everwood — on-site helper (assist.js). Everything is namespaced .ewa-*; colours and fonts follow shop.css tokens
   with literal fallbacks so the widget also works on a page that does not load shop.css. */
.ewa-launch, .ewa-panel, .ewa-shade {
  --ewa-bg: var(--bg, #f2ede4); --ewa-paper: var(--paper, #fbf8f2); --ewa-bone: var(--bone, #e9e2d5);
  --ewa-ink: var(--ink, #1d1a16); --ewa-ink-2: var(--ink-2, #5b5348); --ewa-ink-3: var(--ink-3, #8b8276);
  --ewa-line: var(--line, rgba(29, 26, 22, .12)); --ewa-line-2: var(--line-2, rgba(29, 26, 22, .2));
  --ewa-leaf: var(--leaf, #3d5a2c); --ewa-err: #9a3b2a;
  --ewa-serif: var(--serif, 'Noto Serif Display', Georgia, serif); --ewa-sans: var(--sans, 'Jost', system-ui, sans-serif);
  --ewa-ex: var(--ex, cubic-bezier(.16, 1, .3, 1));
  box-sizing: border-box;
}
.ewa-panel *, .ewa-launch * { box-sizing: border-box; }
.ewa-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ewa-ico { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* launcher: below the buy bar (55) and filter sheet (60+), above the tab bar (50) */
.ewa-launch { position: fixed; right: 20px; bottom: calc(20px + var(--ewa-lift, 0px) + env(safe-area-inset-bottom, 0px)); z-index: 52; display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 22px 0 18px; border-radius: 999px; border: 1px solid var(--ewa-leaf); background: var(--ewa-leaf); color: var(--ewa-paper); font: 500 .95rem var(--ewa-sans); cursor: pointer; box-shadow: 0 14px 34px rgba(29, 26, 22, .22); transition: transform .3s var(--ewa-ex), opacity .25s, bottom .35s var(--ewa-ex), background .3s; }
.ewa-launch:hover { background: #4a6a37; transform: translateY(-1px); }
.ewa-launch.ewa-hide { opacity: 0; pointer-events: none; transform: translateY(8px); visibility: hidden; }
.ewa-launch:focus-visible, .ewa-panel :focus-visible { outline: 2px solid var(--ewa-leaf); outline-offset: 2px; }
.ewa-launch:focus-visible { outline-color: var(--ewa-ink); }

.ewa-shade { display: none; }

/* panel */
.ewa-panel { position: fixed; right: 20px; bottom: 20px; z-index: 95; width: 400px; max-width: calc(100vw - 40px); height: min(640px, calc(100vh - 40px)); height: min(640px, calc(100dvh - 40px)); display: flex; flex-direction: column; overflow: hidden; border-radius: 22px; background: var(--ewa-paper); color: var(--ewa-ink); border: 1px solid var(--ewa-line); box-shadow: 0 30px 80px rgba(29, 26, 22, .24); font: 400 15px/1.5 var(--ewa-sans); opacity: 0; transform: translateY(14px); transition: opacity .25s, transform .4s var(--ewa-ex); }
.ewa-panel[hidden] { display: none; }
.ewa-panel.ewa-on { opacity: 1; transform: none; }
.ewa-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 12px 6px 22px; }
.ewa-title { margin: 0; font: 300 1.45rem/1.1 var(--ewa-serif); letter-spacing: -.005em; }
.ewa-x { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid transparent; background: transparent; color: var(--ewa-ink); cursor: pointer; transition: border-color .3s, background .3s; }
.ewa-x:hover { border-color: var(--ewa-line-2); background: var(--ewa-bg); }

.ewa-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 8px 16px 0; padding: 4px; border-radius: 999px; background: var(--ewa-bone); }
.ewa-tab { min-height: 44px; border: 0; border-radius: 999px; background: transparent; color: var(--ewa-ink-2); font: 500 .9rem var(--ewa-sans); cursor: pointer; transition: background .3s, color .3s; }
.ewa-tab[aria-selected=true] { background: var(--ewa-paper); color: var(--ewa-ink); box-shadow: 0 1px 3px rgba(29, 26, 22, .12); }

.ewa-pane { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.ewa-pane[hidden] { display: none; }
.ewa-note { margin: 12px 22px 0; font-size: .8rem; line-height: 1.4; color: var(--ewa-ink-3); }

/* chat */
.ewa-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 8px; display: flex; flex-direction: column; gap: 8px; }
.ewa-b { max-width: 86%; padding: 10px 14px; border-radius: 18px; overflow-wrap: anywhere; }
.ewa-b.ewa-assistant { align-self: flex-start; background: var(--ewa-bg); border: 1px solid var(--ewa-line); border-bottom-left-radius: 6px; }
.ewa-b.ewa-user { align-self: flex-end; background: var(--ewa-ink); color: var(--ewa-paper); border-bottom-right-radius: 6px; }
.ewa-b.ewa-sys { background: transparent; border: 1px solid var(--ewa-leaf); color: var(--ewa-leaf); font-weight: 500; font-size: .88rem; }
.ewa-typing { display: inline-flex; gap: 5px; align-items: center; min-height: 40px; }
.ewa-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ewa-ink-3); animation: ewa-dot 1.2s ease-in-out infinite; }
.ewa-typing i:nth-of-type(2) { animation-delay: .15s; } .ewa-typing i:nth-of-type(3) { animation-delay: .3s; }
@keyframes ewa-dot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.ewa-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 16px 10px; }
.ewa-chips[hidden], .ewa-send[hidden] { display: none; }
.ewa-chip { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--ewa-line-2); background: var(--ewa-paper); color: var(--ewa-ink); font: 400 .9rem var(--ewa-sans); cursor: pointer; transition: border-color .3s, background .3s; }
.ewa-chip:hover { border-color: var(--ewa-ink); }
.ewa-send { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--ewa-line); }
.ewa-send textarea { flex: 1 1 auto; min-height: 48px; max-height: 120px; resize: none; padding: 12px 16px; border-radius: 24px; border: 1px solid var(--ewa-line-2); background: var(--ewa-bg); color: var(--ewa-ink); font: 400 16px/1.4 var(--ewa-sans); }
.ewa-go { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 0; background: var(--ewa-leaf); color: var(--ewa-paper); cursor: pointer; transition: background .3s, opacity .3s; }
.ewa-go:hover { background: #4a6a37; } .ewa-go:disabled { opacity: .45; cursor: default; }

/* request */
.ewa-req, .ewa-contact { overflow-y: auto; overscroll-behavior: contain; padding: 14px 22px calc(22px + env(safe-area-inset-bottom, 0px)); }
.ewa-down { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; background: var(--ewa-bone); font-size: .9rem; }
.ewa-down[hidden], .ewa-form[hidden], .ewa-ok[hidden] { display: none; }
.ewa-form { display: grid; gap: 12px; }
.ewa-lead { margin: 0; color: var(--ewa-ink-2); font-size: .92rem; }
.ewa-f { display: grid; gap: 5px; font: 500 .8rem var(--ewa-sans); color: var(--ewa-ink-2); min-width: 0; }
.ewa-f input, .ewa-f select, .ewa-f textarea { width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--ewa-line-2); background: var(--ewa-bg); color: var(--ewa-ink); font: 400 16px/1.4 var(--ewa-sans); }
.ewa-f textarea { resize: vertical; min-height: 84px; }
.ewa-f [aria-invalid=true] { border-color: var(--ewa-err); }
.ewa-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ewa-hint { margin-top: -6px; font-size: .78rem; color: var(--ewa-ink-3); }
.ewa-err, .ewa-hint.ewa-bad, .ewa-msg { color: var(--ewa-err); font-weight: 400; font-size: .8rem; }
.ewa-err:empty, .ewa-msg:empty { display: none; }
.ewa-msg { margin: 0; }
.ewa-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.ewa-btn { min-height: 50px; padding: 0 24px; border-radius: 999px; border: 1px solid var(--ewa-leaf); background: var(--ewa-leaf); color: var(--ewa-paper); font: 500 .95rem var(--ewa-sans); cursor: pointer; transition: background .3s; }
.ewa-btn:hover { background: #4a6a37; } .ewa-btn:disabled { opacity: .6; cursor: default; }
.ewa-btn.ewa-ghost { background: transparent; color: var(--ewa-ink); border-color: var(--ewa-line-2); }
.ewa-btn.ewa-ghost:hover { border-color: var(--ewa-ink); background: transparent; }
.ewa-ok { display: grid; gap: 10px; justify-items: start; padding-top: 18px; outline: none; }
.ewa-ok h3 { margin: 0; font: 300 1.5rem/1.1 var(--ewa-serif); }
.ewa-ok p { margin: 0; color: var(--ewa-ink-2); }
.ewa-ok-i { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--ewa-leaf); color: var(--ewa-paper); }
.ewa-ref b { font-weight: 500; color: var(--ewa-ink); letter-spacing: .02em; }
.ewa-ok .ewa-btn { margin-top: 8px; }

/* contact */
.ewa-links { display: grid; gap: 8px; }
.ewa-link { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 10px 16px; border-radius: 16px; border: 1px solid var(--ewa-line); background: var(--ewa-bg); color: var(--ewa-ink); text-decoration: none; transition: border-color .3s; }
.ewa-link:hover { border-color: var(--ewa-ink); }
.ewa-link .ewa-ico { color: var(--ewa-leaf); }
.ewa-link span { display: grid; line-height: 1.3; min-width: 0; }
.ewa-link b { font-weight: 500; } .ewa-link small { color: var(--ewa-ink-2); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ewa-facts { display: grid; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--ewa-line); color: var(--ewa-ink-2); font-size: .92rem; }
.ewa-facts p { margin: 0; display: flex; gap: 12px; align-items: flex-start; }
.ewa-facts .ewa-ico { width: 20px; height: 20px; margin-top: 1px; color: var(--ewa-ink-3); }
.ewa-facts b { font-weight: 500; color: var(--ewa-ink); }

/* phones and tablets: bottom sheet, launcher clear of the trunk nav, tab bar and buy bar */
@media (max-width: 960px) {
  .ewa-launch { right: 12px; bottom: calc(12px + var(--ewa-lift, 0px) + env(safe-area-inset-bottom, 0px)); min-height: 48px; padding: 0 18px 0 14px; font-size: .9rem; }
  .ewa-shade { display: block; position: fixed; inset: 0; z-index: 94; background: rgba(29, 26, 22, .38); opacity: 0; pointer-events: none; transition: opacity .3s; }
  .ewa-shade.ewa-on { opacity: 1; pointer-events: auto; }
  .ewa-panel { left: 0; right: 0; bottom: 0; width: auto; max-width: none; height: min(88vh, 720px); height: min(88dvh, 720px); border-radius: 22px 22px 0 0; border-bottom: 0; transform: translateY(24px); }
  .ewa-head { padding-left: 18px; }
  .ewa-req, .ewa-contact { padding-left: 18px; padding-right: 18px; }
}
@media (max-width: 380px) { .ewa-two { grid-template-columns: 1fr; } .ewa-launch span { display: none; } .ewa-launch { width: 52px; padding: 0; justify-content: center; } }

@media (prefers-reduced-motion: reduce) {
  .ewa-launch, .ewa-panel, .ewa-shade, .ewa-tab, .ewa-chip, .ewa-btn, .ewa-go, .ewa-x, .ewa-link { transition: none; }
  .ewa-panel { transform: none; }
  .ewa-typing i { animation: none; opacity: .6; }
}
