/* Joy v2 widget — scoped under .joy2 */
.joy2{--j-accent:#12B5D8;--j-deep:#0B7FA0;--j-navy:#1E2F5F;--j-bg:#fff;--j-soft:#F2F8FB;--j-text:#1F2B4D;
  font:15px/1.5 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;color:var(--j-text);position:fixed;right:20px;bottom:20px;z-index:2147483000}
.joy2 *{box-sizing:border-box}
.joy2 button{font:inherit;cursor:pointer}
.joy2 :focus-visible{outline:3px solid var(--j-accent);outline-offset:2px}
.joy2-launcher{display:flex;align-items:center;gap:10px;border:0;border-radius:999px;padding:6px 18px 6px 6px;background:var(--j-navy);color:#fff;box-shadow:0 8px 24px rgba(30,47,95,.3)}
.joy2-launcher .joy2-face{border:2px solid var(--j-accent)}
.joy2-launcher strong{display:block;font-size:15px}.joy2-launcher span{font-size:12px;opacity:.85}
.joy2-panel{position:absolute;right:0;bottom:0;width:min(400px,calc(100vw - 24px));height:min(680px,calc(100vh - 40px));background:var(--j-bg);
  border-radius:20px;box-shadow:0 20px 60px rgba(30,47,95,.28);display:flex;flex-direction:column;overflow:hidden}
.joy2-panel[hidden]{display:none}
.joy2-head{display:flex;align-items:center;gap:12px;padding:14px 14px 12px;background:linear-gradient(135deg,var(--j-navy),var(--j-deep));color:#fff}
.joy2-head h2{margin:0;font-size:17px}.joy2-head p{margin:0;font-size:12.5px;opacity:.9}
.joy2-head .joy2-titles{flex:1;min-width:0}
.joy2-iconbtn{background:rgba(255,255,255,.14);border:0;color:#fff;width:34px;height:34px;border-radius:50%;display:inline-grid;place-items:center}
.joy2-iconbtn[aria-pressed="true"]{background:var(--j-accent)}
/* Avatar + state animation */
.joy2-avatar{position:relative;width:64px;height:64px;flex:none}
.joy2-face{border-radius:50%;overflow:hidden;flex:none;display:block}.joy2-face svg,.joy2-face img{display:block;border-radius:50%}
.joy2-avatar .joy2-face{border:2px solid rgba(255,255,255,.85);transform-origin:50% 70%}
.joy2-badge{display:inline-block;vertical-align:middle;font-size:10.5px;font-weight:700;letter-spacing:.06em;line-height:1;padding:3px 6px;border-radius:6px;background:#12B5D8;color:#06243a}
.joy2-face .j-mouth{transform-origin:100px 127px;transform-box:view-box}
.joy2-face .j-eyes{transform-origin:100px 98px;animation:joy2-blink 5.5s infinite}
@keyframes joy2-blink{0%,94%,100%{transform:scaleY(1)}96%{transform:scaleY(.1)}}
.joy2-ring{position:absolute;inset:-4px;border-radius:50%;border:2px solid transparent}
.joy2-state{display:inline-flex;align-items:center;gap:6px;font-size:12px;background:rgba(255,255,255,.16);padding:2px 9px;border-radius:999px;margin-top:3px}
.joy2-state::before{content:"";width:7px;height:7px;border-radius:50%;background:#9be7f7}
[data-state="idle"] .joy2-avatar .joy2-face{animation:joy2-breathe 5s ease-in-out infinite}
[data-state="listening"] .joy2-ring{border-color:var(--j-accent);animation:joy2-pulse 1.4s ease-out infinite}
[data-state="listening"] .joy2-state::before{background:#ff6b6b}
[data-state="thinking"] .joy2-avatar .joy2-face{animation:joy2-tilt 2.4s ease-in-out infinite}
[data-state="thinking"] .joy2-ring{border-color:rgba(255,255,255,.6);border-top-color:var(--j-accent);animation:joy2-spin 1.1s linear infinite}
[data-state="speaking"] .joy2-avatar .j-mouth{opacity:1;animation:joy2-talk .28s ease-in-out infinite alternate}[data-state="speaking"] .joy2-avatar .j-smile{opacity:0}
[data-state="speaking"] .joy2-ring{border-color:rgba(18,181,216,.7)}
@keyframes joy2-breathe{0%,100%{transform:scale(1)}50%{transform:scale(1.025)}}
@keyframes joy2-pulse{0%{transform:scale(1);opacity:1}100%{transform:scale(1.25);opacity:0}}
@keyframes joy2-spin{to{transform:rotate(360deg)}}
@keyframes joy2-tilt{0%,100%{transform:rotate(0)}50%{transform:rotate(-3deg)}}
@keyframes joy2-talk{0%{transform:scaleY(.4)}100%{transform:scaleY(1.5)}}
@media (prefers-reduced-motion:reduce){.joy2 *,.joy2 *::before{animation:none!important;transition:none!important}
  [data-state="speaking"] .joy2-avatar .j-mouth{opacity:0}[data-state="speaking"] .joy2-avatar .j-smile{opacity:1}}
/* Log */
.joy2-log{flex:1;overflow-y:auto;padding:14px;background:var(--j-soft);display:flex;flex-direction:column;gap:10px}
.joy2-msg{max-width:88%;padding:10px 12px;border-radius:14px;white-space:pre-wrap;word-wrap:break-word}
.joy2-msg.bot{background:#fff;align-self:flex-start;border-bottom-left-radius:4px;box-shadow:0 1px 2px rgba(0,0,0,.06)}
.joy2-msg.user{background:var(--j-navy);color:#fff;align-self:flex-end;border-bottom-right-radius:4px}
.joy2-msg.crisis{border-left:4px solid #D93B3B}
.joy2-msg .joy2-replay{margin-top:6px;background:none;border:1px solid #cfe3ea;border-radius:999px;font-size:12px;padding:2px 10px;color:var(--j-deep)}
.joy2-sources{margin:8px 0 0;padding:8px 0 0;border-top:1px solid #e4eef2;list-style:none;font-size:13px}
.joy2-sources li{margin:3px 0}.joy2-sources a{color:var(--j-deep)}
.joy2-sources .k{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:#6b7a90;margin-right:4px}
.joy2-prompts{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:10px 14px 0;background:#fff}
.joy2-prompts button{border:1px solid #cfe3ea;background:#fff;color:var(--j-navy);border-radius:12px;padding:8px 10px;text-align:left;font-size:13px;line-height:1.3}
.joy2-prompts button:hover{border-color:var(--j-accent);background:var(--j-soft)}
.joy2-form{display:flex;gap:8px;padding:10px 14px;background:#fff;align-items:center}
.joy2-form input{flex:1;min-width:0;border:1px solid #cdd9e3;border-radius:999px;padding:10px 14px;font:inherit}
.joy2-mic,.joy2-send{border:0;border-radius:50%;width:42px;height:42px;display:grid;place-items:center;background:var(--j-soft);color:var(--j-navy)}
.joy2-send{background:var(--j-accent);color:var(--j-navy)}
.joy2-mic[aria-pressed="true"]{background:#D93B3B;color:#fff}
.joy2-modal{position:absolute;inset:0;background:rgba(30,47,95,.45);display:grid;place-items:center;padding:20px;z-index:2}
.joy2-modal[hidden]{display:none}
.joy2-modal__box{background:#fff;border-radius:16px;padding:18px;max-width:330px;box-shadow:0 10px 30px rgba(0,0,0,.25);font-size:14px}
.joy2-modal__box p{margin:0 0 12px}
.joy2-modal__box button{margin:4px 8px 0 0;border-radius:999px;border:1px solid var(--j-navy);background:#fff;padding:7px 16px;color:var(--j-navy)}
.joy2-modal__box button.yes{background:var(--j-navy);color:#fff}
.joy2-collection{margin:0;padding:0 14px 8px;font-size:11.5px;line-height:1.4;color:#4a5872;background:#fff}
.joy2-collection a{color:var(--j-deep)}
.joy2-prompts[hidden]{display:none}
.joy2-safety{padding:9px 14px 11px;font-size:12.5px;background:#fff;border-top:1px solid #e4eef2;color:#33415c}
.joy2-safety a{color:var(--j-deep);font-weight:600}
.joy2-urgent{margin:0 14px 8px;padding:10px 12px;background:#FDECEC;border:1px solid #F3B4B4;border-radius:12px;font-size:13px}
.joy2-urgent[hidden]{display:none}.joy2-urgent ul{margin:4px 0;padding-left:18px}
.joy2-sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
@media (max-width:520px){.joy2{right:10px;bottom:10px}.joy2-panel{position:fixed;inset:0;width:auto;height:auto;border-radius:0}}
.joy2-disclosure{margin:0;padding:7px 14px;font-size:12.5px;background:#E8F6FA;color:#1E2F5F;border-bottom:1px solid #cfe3ea}
/* ---- DEMO photo avatar ---- */
.joy2--photo .joy2-head{align-items:flex-start}
.joy2--photo .joy2-avatar{width:150px;height:183px}
.joy2-photo{position:relative;width:150px;height:183px;border-radius:16px;overflow:hidden;background:#dfeef4;
  box-shadow:0 0 0 2px rgba(255,255,255,.85);transition:box-shadow .3s ease;transform-origin:50% 80%}
.joy2-photo canvas{width:100%;height:100%;display:block}
.joy2-photo__badge{position:absolute;top:6px;right:6px;box-shadow:0 1px 3px rgba(0,0,0,.25)}
.joy2--photo .joy2-ring{display:none}
.joy2--photo[data-state="idle"] .joy2-avatar .joy2-photo{animation:joy2-breathe 5s ease-in-out infinite}
.joy2--photo[data-state="idle"] .joy2-avatar .joy2-face{animation:none}
.joy2-photo[data-state="listening"]{box-shadow:0 0 0 3px #ff6b6b,0 0 18px 4px rgba(255,107,107,.6);animation:joy2-glow 1.4s ease-in-out infinite}
.joy2-photo[data-state="thinking"]{box-shadow:0 0 0 3px #f5c451,0 0 16px 3px rgba(245,196,81,.55);animation:joy2-glow 2s ease-in-out infinite}
.joy2-photo[data-state="speaking"]{box-shadow:0 0 0 3px #12B5D8,0 0 18px 5px rgba(18,181,216,.65)}
@keyframes joy2-glow{0%,100%{filter:brightness(1)}50%{filter:brightness(1.06)}}
.joy2-photo--error canvas{display:none}
@media (prefers-reduced-motion:reduce){.joy2-photo{animation:none!important}}
/* Crisis: numbers shown prominently */
.joy2-urgent.is-crisis{border-width:2px;border-color:#D93B3B;background:#FFF1F1;font-size:15px}
.joy2-urgent.is-crisis strong{font-size:16px;color:#A11}
.joy2-urgent.is-crisis a[href^="tel:"]{font-size:18px;font-weight:700;color:#8A0F0F}
.joy2-photo--static,.joy2--text-only .joy2-photo{animation:none!important;box-shadow:0 0 0 2px rgba(255,255,255,.85)!important;filter:none!important}
.joy2-iconbtn.joy2-textonly{font-size:13px;font-weight:700}
/* AI badge: always visible in every mode and size (mobile/full-screen included) */
.joy2-badge{display:inline-block!important;visibility:visible!important;opacity:1!important}
.joy2-photo__badge{z-index:3}
.joy2-urgent.is-crisis a{font-size:18px;font-weight:700;color:#8A0F0F}
/* Photo header layout: photo left, controls in a row, titles below the controls */
.joy2--photo .joy2-head{display:grid;grid-template-columns:150px repeat(5,auto) 1fr;grid-template-rows:auto 1fr;column-gap:6px;row-gap:6px;align-items:start}
.joy2--photo .joy2-avatar{grid-row:1 / span 2;grid-column:1}
.joy2--photo .joy2-titles{grid-row:2;grid-column:2 / span 6;min-width:0}
.joy2--photo .joy2-iconbtn{width:30px;height:30px;grid-row:1}
.joy2--photo[data-state="idle"] .joy2-avatar .joy2-photo--still{animation:none}
.joy2 [hidden]{display:none!important}
/* 2.1.1: stop long suggestion chips / messages overflowing the panel sideways */
.joy2-panel{overflow-x:hidden;max-width:100vw}
.joy2-log{overflow-x:hidden;overscroll-behavior:contain;min-width:0}
.joy2-log>*{max-width:100%;min-width:0;overflow-wrap:anywhere}
.joy2-prompts{grid-template-columns:repeat(2,minmax(0,1fr));overflow-x:hidden;min-width:0}
.joy2-prompts button{white-space:normal;max-width:100%;min-width:0;overflow-wrap:anywhere;word-break:normal}
/* ===== 2.1.2 ===== */
/* Header: only a plain, borderless close X (theme/Elementor kit button styles overridden) */
.joy2 .joy2-head .joy2-close{background:transparent!important;border:0!important;box-shadow:none!important;color:#fff!important;width:36px!important;height:36px!important;min-width:36px;padding:0!important;margin:0 0 0 auto!important;border-radius:8px!important;font-size:20px!important;line-height:1!important;display:inline-grid!important;place-items:center;opacity:.9}
.joy2 .joy2-head .joy2-close:hover{opacity:1;background:rgba(255,255,255,.12)!important}
.joy2 .joy2-head .joy2-close:focus-visible{outline:3px solid #9be7f7!important;outline-offset:1px}
.joy2--photo .joy2-head{grid-template-columns:150px 1fr auto auto auto!important}
.joy2--photo .joy2-head .joy2-close{grid-column:-2;grid-row:1;justify-self:end}
.joy2--photo .joy2-titles{grid-column:2 / -1!important}
/* Suggested prompts: compact, equal-height 2-col grid (Elementor kit 'button' typography was inflating them) */
.joy2 .joy2-prompts{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-auto-rows:1fr;gap:8px!important;padding:10px 14px 2px!important;align-items:stretch}
.joy2 .joy2-prompts > button{font:500 14px/1.35 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif!important;letter-spacing:0!important;text-transform:none!important;
  padding:8px 12px!important;margin:0!important;min-height:0!important;height:100%;border:1px solid #cfe3ea!important;border-radius:12px!important;background:#fff!important;color:var(--j-navy)!important;
  text-align:left!important;white-space:normal!important;box-shadow:none!important;display:-webkit-box!important;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;width:100%}
.joy2 .joy2-prompts > button:hover{border-color:var(--j-accent)!important;background:var(--j-soft)!important}
@media (max-width:420px){.joy2 .joy2-prompts{grid-template-columns:1fr!important;grid-auto-rows:auto}}
/* Composer row aligned */
.joy2 .joy2-form{align-items:center!important;gap:8px!important}
.joy2 .joy2-form input{height:44px;font-size:15px!important}
.joy2 .joy2-send,.joy2 .joy2-mic{padding:0!important;font-size:18px!important;flex:none}
/* Round face shot: launcher + homepage hero */
.joy2-photo--round{width:100%!important;height:100%!important;border-radius:50%!important;box-shadow:none!important;background:#DDEFF8}
.joy2-photo--round .joy2-photo__badge{display:none!important} /* launcher/hero already show the 'AI' label next to the photo */
.joy2-launcher .joy2-face{background:#DDEFF8}
.joy2 .joy2-launcher{font:inherit!important;padding:6px 18px 6px 6px!important;background:var(--j-navy)!important;color:#fff!important;border:0!important;border-radius:999px!important}
.joy-hero__avatar .joy2-hero-face{position:relative;width:100%;height:100%;border-radius:50%;overflow:hidden;border:4px solid #fff;background:#DDEFF8}
@media (max-width:767px){.joy-hero__avatar .joy2-hero-face{border-width:3px}}
@media (prefers-reduced-motion:reduce){.joy2-photo--round,.joy2-hero-face{animation:none!important}}
/* ===== 2.1.3 ===== */
/* Round face shot: canvas always fills the circle (fixes the dark, hair-only crop seen live) */
.joy2-face{position:relative}
.joy2-photo--round{position:absolute!important;inset:0!important;margin:0!important;transform:none}
.joy2-photo--round canvas{position:absolute!important;inset:0;width:100%!important;height:100%!important;max-width:none!important;border-radius:50%;object-fit:cover}
.joy2-hero-face{position:relative}
/* Compact launcher: photo only, keeps an accessible name */
.joy2--compact .joy2-launcher{padding:4px!important;gap:0!important}
.joy2--compact .joy2-launcher__text{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.joy2--compact .joy2-launcher .joy2-face{width:52px!important;height:52px!important}
.joy2--compact .joy2-launcher::after{content:"AI";position:absolute;right:-2px;top:-4px;font:700 10px/1 system-ui,sans-serif;background:#12B5D8;color:#06243a;padding:3px 5px;border-radius:6px}
.joy2--compact .joy2-launcher{position:relative}
/* ===== 2.1.4 ===== */
/* Old journal 'Ask Joy' footer pill (WPCode journal-nav snippet, .aj-joy) is replaced by Joy v2: hide it wherever v2 is loaded */
.aj-joy{display:none!important}
/* Logged-in admins: keep the launcher above Hostinger's bottom-right 'Agent' button */
body.admin-bar .joy2 .joy2-launcher{margin-bottom:64px}
.joy2 .joy2-launcher{display:flex!important;flex-direction:row!important;align-items:center!important;gap:10px;text-align:left!important;white-space:nowrap}
.joy2 .joy2-launcher[hidden]{display:none!important}
