.sage{--sg-forest:#061b0e;--sg-forest-2:#0c2f18;--sg-terra:#89511f;--sg-gold:#cba72f;--sg-gold-2:#e9c45a;--sg-cream:#fbf9f4;--sg-cream-2:#f4efe4;--sg-line:rgba(137,81,31,.18);--sg-muted:#4a4a44;position:fixed;right:clamp(14px,2vw,26px);bottom:clamp(14px,2vw,26px);z-index:99998;font-family:'Manrope',system-ui,-apple-system,sans-serif}
.sage *{box-sizing:border-box}

.sage__launch{display:flex;align-items:center;gap:11px;padding:13px 20px 13px 15px;border:0;border-radius:999px;cursor:pointer;background:linear-gradient(135deg,var(--sg-forest) 0%,var(--sg-forest-2) 100%);color:var(--sg-cream);box-shadow:0 16px 36px -14px rgba(6,27,14,.55);transition:transform .35s cubic-bezier(.2,.8,.2,1),box-shadow .35s ease;font-family:inherit}
.sage__launch:hover{transform:translateY(-3px);box-shadow:0 22px 44px -14px rgba(6,27,14,.62)}
.sage__launch:focus-visible{outline:2px solid var(--sg-gold);outline-offset:3px}
.sage__launch-icon{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:linear-gradient(135deg,var(--sg-gold) 0%,var(--sg-gold-2) 55%,#a87b1a 100%);flex:0 0 auto}
.sage__launch-icon svg{width:19px;height:19px;display:block}
.sage__launch-text{display:flex;flex-direction:column;align-items:flex-start;line-height:1.15}
.sage__launch-name{font-size:.95rem;font-weight:700;letter-spacing:.01em}
.sage__launch-sub{font-size:.7rem;font-weight:500;letter-spacing:.1em;text-transform:uppercase;color:rgba(251,249,244,.66);margin-top:2px}
.sage__dot{position:absolute;top:10px;right:14px;width:8px;height:8px;border-radius:50%;background:var(--sg-gold-2);box-shadow:0 0 0 0 rgba(233,196,90,.7);animation:sage-pulse 2.6s infinite}
@keyframes sage-pulse{0%{box-shadow:0 0 0 0 rgba(233,196,90,.6)}70%{box-shadow:0 0 0 10px rgba(233,196,90,0)}100%{box-shadow:0 0 0 0 rgba(233,196,90,0)}}
.sage.is-open .sage__launch{opacity:0;pointer-events:none;transform:scale(.85)}

.sage__panel{position:absolute;right:0;bottom:0;width:min(400px,calc(100vw - 28px));height:min(620px,calc(100vh - 110px));display:flex;flex-direction:column;background:var(--sg-cream);border:1px solid var(--sg-line);border-radius:14px;box-shadow:0 34px 70px -24px rgba(6,27,14,.5);overflow:hidden;opacity:0;visibility:hidden;transform:translateY(18px) scale(.97);transform-origin:bottom right;transition:opacity .32s ease,transform .32s cubic-bezier(.2,.8,.2,1),visibility .32s}
.sage.is-open .sage__panel{opacity:1;visibility:visible;transform:none}

.sage__head{display:flex;align-items:center;gap:12px;padding:16px 16px 15px;background:linear-gradient(135deg,var(--sg-forest) 0%,var(--sg-forest-2) 100%);border-bottom:2px solid var(--sg-gold);flex:0 0 auto}
.sage__avatar{display:grid;place-items:center;width:40px;height:40px;border-radius:50%;background:linear-gradient(135deg,var(--sg-gold) 0%,var(--sg-gold-2) 55%,#a87b1a 100%);flex:0 0 auto}
.sage__avatar svg{width:22px;height:22px;display:block}
.sage__id{flex:1 1 auto;min-width:0}
.sage__name{margin:0;font-size:1rem;font-weight:700;color:var(--sg-cream);line-height:1.2}
.sage__status{display:flex;align-items:center;gap:6px;font-size:.74rem;font-weight:500;color:rgba(251,249,244,.7);margin-top:3px}
.sage__status::before{content:'';width:6px;height:6px;border-radius:50%;background:#7ac77a;flex:0 0 auto}
.sage__close{width:34px;height:34px;display:grid;place-items:center;border:0;border-radius:50%;background:rgba(251,249,244,.1);color:var(--sg-cream);cursor:pointer;flex:0 0 auto;transition:background .25s ease,transform .25s ease;font-size:19px;line-height:1;font-family:inherit}
.sage__close:hover{background:rgba(251,249,244,.2);transform:rotate(90deg)}
.sage__close:focus-visible{outline:2px solid var(--sg-gold);outline-offset:2px}

.sage__log{flex:1 1 auto;overflow-y:auto;padding:18px 16px 8px;display:flex;flex-direction:column;gap:12px;scroll-behavior:smooth;overscroll-behavior:contain}
.sage__msg{max-width:88%;padding:12px 15px;border-radius:14px;font-size:.95rem;line-height:1.65;animation:sage-in .34s cubic-bezier(.2,.8,.2,1) both}
@keyframes sage-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.sage__msg--bot{align-self:flex-start;background:#fff;color:#2b302a;border:1px solid var(--sg-line);border-bottom-left-radius:5px}
.sage__msg--me{align-self:flex-end;background:var(--sg-forest);color:#fbf9f4;border-bottom-right-radius:5px}
.sage__msg strong{color:var(--sg-forest);font-weight:700}
.sage__msg--me strong{color:#fff}
.sage__msg a{color:var(--sg-terra);text-decoration:underline;text-underline-offset:2px}
.sage__msg a:hover{color:var(--sg-gold)}
.sage__src{display:inline-flex;align-items:center;gap:5px;margin-top:9px;font-size:.76rem;font-weight:600;letter-spacing:.04em;color:var(--sg-terra);text-decoration:none;border-bottom:1px solid rgba(137,81,31,.3);padding-bottom:1px}
.sage__src:hover{color:var(--sg-gold);border-bottom-color:var(--sg-gold)}

.sage__typing{align-self:flex-start;display:flex;gap:4px;padding:13px 16px;background:#fff;border:1px solid var(--sg-line);border-radius:14px;border-bottom-left-radius:5px}
.sage__typing span{width:6px;height:6px;border-radius:50%;background:var(--sg-terra);opacity:.45;animation:sage-bob 1.3s infinite}
.sage__typing span:nth-child(2){animation-delay:.18s}
.sage__typing span:nth-child(3){animation-delay:.36s}
@keyframes sage-bob{0%,60%,100%{transform:translateY(0);opacity:.4}30%{transform:translateY(-5px);opacity:1}}

.sage__chips{display:flex;flex-wrap:wrap;gap:7px;padding:4px 16px 12px;flex:0 0 auto}
.sage__chip{padding:8px 13px;border:1px solid var(--sg-line);border-radius:999px;background:var(--sg-cream-2);color:var(--sg-forest);font-family:inherit;font-size:.8rem;font-weight:600;cursor:pointer;transition:background .25s ease,border-color .25s ease,transform .25s ease}
.sage__chip:hover{background:var(--sg-gold);border-color:var(--sg-gold);transform:translateY(-1px)}
.sage__chip:focus-visible{outline:2px solid var(--sg-gold);outline-offset:2px}

.sage__form{display:flex;gap:8px;padding:12px 14px;border-top:1px solid var(--sg-line);background:#fff;flex:0 0 auto}
.sage__input{flex:1 1 auto;min-width:0;padding:12px 14px;border:1px solid var(--sg-line);border-radius:999px;background:var(--sg-cream);font-family:inherit;font-size:.92rem;color:var(--sg-forest)}
.sage__input::placeholder{color:rgba(74,74,68,.55)}
.sage__input:focus{outline:0;border-color:var(--sg-gold);box-shadow:0 0 0 3px rgba(203,167,47,.16)}
.sage__send{width:44px;height:44px;flex:0 0 auto;display:grid;place-items:center;border:0;border-radius:50%;background:var(--sg-forest);color:var(--sg-cream);cursor:pointer;transition:background .25s ease,transform .25s ease}
.sage__send:hover{background:var(--sg-terra);transform:scale(1.06)}
.sage__send:focus-visible{outline:2px solid var(--sg-gold);outline-offset:2px}
.sage__send svg{width:17px;height:17px;display:block}

.sage__enq{display:grid;gap:9px;margin-top:4px}
.sage__enq label{font-size:.76rem;font-weight:700;letter-spacing:.11em;text-transform:uppercase;color:var(--sg-terra)}
.sage__enq input,.sage__enq select,.sage__enq textarea{width:100%;padding:11px 13px;border:1px solid var(--sg-line);border-radius:7px;background:#fff;font-family:inherit;font-size:.92rem;color:#12200f}
.sage__enq textarea{min-height:74px;resize:vertical}
.sage__enq input:focus,.sage__enq select:focus,.sage__enq textarea:focus{outline:0;border-color:var(--sg-gold);box-shadow:0 0 0 3px rgba(203,167,47,.16)}
.sage__hp{position:absolute;left:-9999px;width:1px;height:1px;opacity:0}
.sage__enq-actions{display:flex;gap:8px;margin-top:3px}
.sage__btn{flex:1 1 auto;padding:12px 16px;border:1px solid var(--sg-forest);border-radius:4px;background:var(--sg-forest);color:var(--sg-cream);font-family:inherit;font-size:.84rem;font-weight:700;letter-spacing:.09em;text-transform:uppercase;cursor:pointer;transition:background .25s ease,color .25s ease}
.sage__btn:hover{background:var(--sg-terra);border-color:var(--sg-terra)}
.sage__btn--ghost{background:transparent;color:var(--sg-forest);flex:0 0 auto}
.sage__btn--ghost:hover{background:var(--sg-forest);color:var(--sg-cream)}
.sage__btn[disabled]{opacity:.6;cursor:progress}
.sage__err{font-size:.84rem;line-height:1.5;color:#8a2b2b;margin:2px 0 0}

.sage__note{padding:8px 16px 12px;font-size:.73rem;line-height:1.5;color:#5c6158;text-align:center;flex:0 0 auto}

@media (max-width:560px){
  .sage{right:0;bottom:0;left:0}
  .sage__launch{position:absolute;right:14px;bottom:14px}
  .sage__panel{width:100vw;height:100dvh;max-height:100dvh;border-radius:0;border:0;right:0;bottom:0}
  .sage__msg{max-width:92%}
}
@media (prefers-reduced-motion:reduce){
  .sage__panel,.sage__launch,.sage__msg,.sage__close,.sage__send,.sage__chip{transition:none;animation:none}
  .sage__dot,.sage__typing span{animation:none}
}
