/* Champ by DI House */
#champ-root {
  --cf: #1B3029; --cc: #1C2925; --cs: #3D594F; --cm: #5F7268; --cv: #F4F7F5; --cg: #D6BF9E;
  position: fixed; right: 22px; bottom: 22px; z-index: 99990;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px; line-height: 1.55; color: var(--cc);
}
#champ-root *, #champ-root *::before, #champ-root *::after { box-sizing: border-box; }
#champ-root button { font: inherit; cursor: pointer; }

/* ---------- launcher */
/* Champ stands free on the page: no frame, just him, floating, with a soft shadow below */
.champ-launch {
  position: relative; display: block; width: 124px; height: 124px; padding: 0;
  border: 0; background: none; box-shadow: none; transform-origin: 50% 90%;
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.champ-launch:hover { transform: scale(1.07) rotate(-3deg); }
.champ-launch:focus-visible { outline: 2px solid var(--cg); outline-offset: 4px; border-radius: 16px; }
.champ-launch img {
  position: relative; z-index: 1; width: 124px; height: 124px; object-fit: contain; display: block;
  filter: drop-shadow(0 10px 16px rgba(27,48,41,.28));
  animation: champ-bob 3.6s ease-in-out infinite;
}
.champ-launch::after { /* floor shadow that breathes with the bob */
  content: ""; position: absolute; left: 50%; bottom: -6px; width: 64px; height: 10px; margin-left: -18px;
  border-radius: 50%; background: radial-gradient(closest-side, rgba(27,48,41,.35), transparent);
  animation: champ-shadow 3.6s ease-in-out infinite;
}
@keyframes champ-shadow { 0%,100% { transform: scale(1); opacity: .9; } 50% { transform: scale(.78); opacity: .55; } }
.champ-ring { position: absolute; left: 50%; top: 50%; width: 110px; height: 110px; margin: -55px 0 0 -48px; border-radius: 50%;
  border: 2px solid var(--cg); opacity: 0; pointer-events: none; }
.champ-tag {
  position: absolute; right: 118px; top: 38%; transform: translateY(-50%);
  background: var(--cf); color: var(--cv); padding: 8px 14px; border-radius: 999px; white-space: nowrap;
  font-size: 13px; font-weight: 700; letter-spacing: .02em; box-shadow: 0 8px 22px rgba(27,48,41,.22);
  transition: opacity .3s ease;
}
#champ-root.is-open .champ-tag, #champ-root.has-fact .champ-tag { opacity: 0; pointer-events: none; }

@keyframes champ-bob { 0%,100% { translate: 0 0; } 50% { translate: 0 -6px; } }
@keyframes champ-ping { 0% { transform: scale(.85); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes champ-talk { 0%,100% { scale: 1; } 25% { scale: 1.06 .96; } 50% { scale: .97 1.04; } 75% { scale: 1.04 .98; } }
@keyframes champ-glow { 0%,100% { box-shadow: 0 0 0 2px var(--cg), 0 0 0 rgba(214,191,158,0); } 50% { box-shadow: 0 0 0 2px var(--cg), 0 0 26px rgba(214,191,158,.85); } }
@keyframes champ-aura { 0%,100% { filter: drop-shadow(0 10px 16px rgba(27,48,41,.28)); } 50% { filter: drop-shadow(0 10px 16px rgba(27,48,41,.28)) drop-shadow(0 0 18px rgba(214,191,158,.9)); } }

/* moods: thinking pulses, talking wobbles and glows */
#champ-root[data-mood="thinking"] .champ-ring { animation: champ-ping 1.1s ease-out infinite; }
#champ-root[data-mood="talking"] .champ-launch img { animation: champ-bob 3.6s ease-in-out infinite, champ-talk .5s ease-in-out infinite, champ-aura 1s ease-in-out infinite; }
#champ-root[data-mood="talking"] .champ-head-bot img { animation: champ-talk .5s ease-in-out infinite; }
#champ-root[data-mood="thinking"] .champ-head-bot img { animation: champ-aura 1.2s ease-in-out infinite; }

/* ---------- fact bubble */
.champ-fact {
  position: absolute; right: 0; bottom: 132px; width: min(330px, calc(100vw - 44px));
  background: #fff; border: 1px solid rgba(214,191,158,.9); border-radius: 20px 20px 6px 20px; padding: 18px 20px 16px;
  box-shadow: 0 20px 50px rgba(27,48,41,.22);
  opacity: 0; transform: translateY(14px) scale(.96); transform-origin: bottom right;
  transition: opacity .4s ease, transform .5s cubic-bezier(.2,.8,.2,1);
}
#champ-root.has-fact .champ-fact { opacity: 1; transform: none; }
.champ-fact-label { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--cs); margin-bottom: 6px; }
.champ-fact-text { color: var(--cc); font-size: 14.5px; }
.champ-fact-ask {
  margin-top: 12px; border: 0; border-radius: 999px; background: var(--cf); color: var(--cv);
  padding: 9px 16px; font-size: 13px; font-weight: 700; transition: background .25s ease;
}
.champ-fact-ask:hover { background: var(--cs); }
.champ-fact-x { position: absolute; top: 8px; right: 10px; border: 0; background: none; color: var(--cm); font-size: 20px; line-height: 1; padding: 4px; }

/* ---------- panel */
.champ-panel {
  position: absolute; right: 0; bottom: 132px; width: 380px; height: min(620px, calc(100vh - 176px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--cv); border-radius: 24px; box-shadow: 0 30px 70px rgba(27,48,41,.32);
  opacity: 0; visibility: hidden; transform: translateY(18px) scale(.97); transform-origin: bottom right;
  transition: opacity .35s ease, transform .45s cubic-bezier(.2,.8,.2,1), visibility 0s .45s;
}
#champ-root.is-open .champ-panel { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

.champ-head {
  display: flex; align-items: center; gap: 12px; padding: 16px 16px 16px 18px;
  background: linear-gradient(135deg, var(--cs), var(--cf)); color: var(--cv);
}
.champ-head-bot { flex: 0 0 auto; width: 64px; height: 64px; margin: -6px 0 -10px -4px; }
.champ-head-bot img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 6px 10px rgba(0,0,0,.3)); }
.champ-head-txt { flex: 1; display: flex; flex-direction: column; }
.champ-head-txt strong { font-family: Montserrat, "Plus Jakarta Sans", sans-serif; font-weight: 900; font-size: 20px; letter-spacing: -.01em; text-transform: uppercase; line-height: 1.1; }
.champ-head-txt span { font-size: 12.5px; opacity: .8; }
.champ-close, .champ-speak { border: 0; background: rgba(244,247,245,.12); color: var(--cv); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; line-height: 1; transition: background .25s ease; }
.champ-close:hover, .champ-speak:hover { background: rgba(244,247,245,.24); }
.champ-speak::before { content: ""; width: 18px; height: 18px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9v6h4l5 5V4L7 9H3z'/%3E%3Cpath d='M16 7l5 10M21 7l-5 10' stroke='black' stroke-width='2'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9v6h4l5 5V4L7 9H3z'/%3E%3Cpath d='M16 7l5 10M21 7l-5 10' stroke='black' stroke-width='2'/%3E%3C/svg%3E") center/contain no-repeat; }
.champ-speak[aria-pressed="true"] { background: var(--cg); color: var(--cf); }
.champ-speak[aria-pressed="true"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9v6h4l5 5V4L7 9H3z'/%3E%3Cpath d='M16 8a5 5 0 010 8M19 5a9 9 0 010 14' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9v6h4l5 5V4L7 9H3z'/%3E%3Cpath d='M16 8a5 5 0 010 8M19 5a9 9 0 010 14' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E"); }

.champ-log { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.champ-msg { max-width: 86%; padding: 11px 15px; border-radius: 18px; font-size: 14.5px; animation: champ-in .35s cubic-bezier(.2,.8,.2,1); }
.champ-msg p { margin: 0 0 6px; } .champ-msg p:last-child { margin: 0; }
.champ-bot { align-self: flex-start; background: #fff; border: 1px solid #DCE3DF; border-bottom-left-radius: 6px; color: var(--cc); }
.champ-user { align-self: flex-end; background: var(--cf); color: var(--cv); border-bottom-right-radius: 6px; }
.champ-msg a { color: var(--cs); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.champ-user a { color: var(--cg); }
@keyframes champ-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.champ-typing { display: flex; gap: 5px; padding: 14px 16px; }
.champ-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--cs); animation: champ-dot 1.1s infinite ease-in-out; }
.champ-typing span:nth-child(2) { animation-delay: .15s; } .champ-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes champ-dot { 0%,80%,100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

.champ-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 10px; }
.champ-chip { border: 1px solid var(--cs); background: transparent; color: var(--cf); border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 600; transition: background .2s ease, color .2s ease; }
.champ-chip:hover { background: var(--cf); color: var(--cv); }

.champ-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #DCE3DF; background: #fff; }
.champ-input { flex: 1; min-width: 0; border: 1px solid #DCE3DF; border-radius: 999px; padding: 11px 16px; font: inherit; font-size: 14.5px; color: var(--cc); background: var(--cv); outline: none; }
.champ-input:focus { border-color: var(--cs); box-shadow: 0 0 0 3px rgba(61,89,79,.15); }
.champ-send, .champ-mic { flex: 0 0 auto; width: 44px; height: 44px; border: 0; border-radius: 50%; display: grid; place-items: center; transition: background .2s ease, transform .2s ease; }
.champ-send { background: var(--cg); color: var(--cf); }
.champ-send:hover { transform: scale(1.06); }
.champ-mic { background: var(--cv); color: var(--cf); }
.champ-mic.is-on { background: #A75136; color: #fff; }
.champ-send::before, .champ-mic::before { content: ""; width: 18px; height: 18px; background: currentColor; }
.champ-send::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 11l18-8-8 18-2-8-8-2z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 11l18-8-8 18-2-8-8-2z'/%3E%3C/svg%3E") center/contain no-repeat; }
.champ-mic::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='9' y='2' width='6' height='12' rx='3'/%3E%3Cpath d='M5 11a7 7 0 0014 0M12 18v4' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='9' y='2' width='6' height='12' rx='3'/%3E%3Cpath d='M5 11a7 7 0 0014 0M12 18v4' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") center/contain no-repeat; }

.champ-foot { padding: 8px 14px 12px; background: #fff; font-size: 11.5px; color: var(--cm); text-align: center; }
.champ-foot a { color: var(--cs); }

/* ---------- phones: panel becomes a bottom sheet */
@media (max-width: 520px) {
  #champ-root { right: 14px; bottom: 14px; }
  .champ-launch, .champ-launch img { width: 92px; height: 92px; }
  .champ-ring { width: 82px; height: 82px; margin: -41px 0 0 -36px; }
  .champ-tag { display: none; }
  .champ-fact { bottom: 102px; }
  #champ-root.is-open .champ-launch { opacity: 0; pointer-events: none; }
  .champ-panel { position: fixed; left: 0; right: 0; bottom: 0; width: 100%; height: 88vh; height: 88dvh; border-radius: 22px 22px 0 0; transform-origin: bottom center; }
  .champ-form { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  #champ-root *, #champ-root *::before { animation: none !important; transition: none !important; }
}

/* Theme-proof the round icon buttons (some themes restyle every <button>) */
#champ-root .champ-close, #champ-root .champ-speak { color: #F4F7F5 !important; background: rgba(244,247,245,.14) !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; }
#champ-root .champ-close:hover, #champ-root .champ-speak:hover { background: rgba(244,247,245,.26) !important; }
#champ-root .champ-speak[aria-pressed="true"] { background: #D6BF9E !important; color: #1B3029 !important; }
#champ-root .champ-send { background: #D6BF9E !important; color: #1B3029 !important; border: 0 !important; padding: 0 !important; box-shadow: none !important; }
#champ-root .champ-mic { background: #F4F7F5 !important; color: #1B3029 !important; border: 0 !important; padding: 0 !important; box-shadow: none !important; }
#champ-root .champ-mic.is-on { background: #A75136 !important; color: #fff !important; }
#champ-root .champ-close { font-size: 24px !important; line-height: 1 !important; }
