
.eg {
--eg-cream: #F6F6F6; --eg-ivory: #FFFFFF; --eg-green: #1F4D3A; --eg-green-2: #2C6B50;
--eg-gold: #145C3D; --eg-gold-soft: #EAEAEA; --eg-ink: #24302A; --eg-muted: #66705F;
--eg-line: rgba(20, 92, 61, .3); --eg-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
--eg-ease: cubic-bezier(.22, 1, .36, 1);
font-family: 'Work Sans', -apple-system, sans-serif;
}
.eg *, .eg *::before, .eg *::after { box-sizing: border-box; }
.eg-fab {
position: fixed; right: 18px; bottom: 164px; z-index: 61;
display: flex; align-items: center; gap: .55rem; padding: 6px 14px 6px 6px;
border: 1px solid var(--eg-line); border-radius: 999px; cursor: pointer;
background: rgba(255, 255, 255, .96); color: var(--eg-green); font: 600 .85rem/1 'Work Sans', sans-serif;
box-shadow: 0 14px 30px -14px rgba(31, 77, 58, .55); backdrop-filter: blur(8px);
transition: transform .4s var(--eg-ease), box-shadow .4s var(--eg-ease), opacity .3s;
}
.eg-fab:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -16px rgba(31, 77, 58, .6); }
.eg-fab:focus-visible { outline: 3px solid var(--eg-gold); outline-offset: 3px; }
.eg-fab__orb { position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--eg-green); color: var(--eg-gold-soft); box-shadow: inset 0 0 0 2px var(--eg-gold-soft); }
.eg-fab__orb::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1px solid var(--eg-gold); opacity: .6; animation: egRing 2.6s ease-out infinite; }
.eg-fab svg { width: 20px; height: 20px; }
.eg.is-open .eg-fab { opacity: 0; pointer-events: none; transform: scale(.8); }
@keyframes egRing { 0% { transform: scale(.9); opacity: .7; } 100% { transform: scale(1.35); opacity: 0; } }
.eg-panel {
position: fixed; right: 18px; bottom: 18px; z-index: 1000; width: min(400px, calc(100vw - 36px));
height: min(640px, calc(100vh - 36px)); display: flex; flex-direction: column;
background: var(--eg-ivory); color: var(--eg-ink); border: 1px solid var(--eg-line); border-radius: 26px;
box-shadow: 0 40px 80px -30px rgba(31, 77, 58, .5), 0 0 0 6px rgba(20, 92, 61, .06);
overflow: hidden; opacity: 0; visibility: hidden; transform: translateY(24px) scale(.97); transform-origin: bottom right;
transition: opacity .45s var(--eg-ease), transform .45s var(--eg-ease), visibility 0s .45s;
}
.eg.is-open .eg-panel { opacity: 1; visibility: visible; transform: none; transition: opacity .45s var(--eg-ease), transform .45s var(--eg-ease), visibility 0s; }
.eg-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: 14px 14px 10px 18px; border-bottom: 1px solid var(--eg-line); background: linear-gradient(180deg, #fff 0%, var(--eg-ivory) 100%); }
.eg-head__title { font-family: var(--eg-serif); font-size: 1.3rem; font-weight: 600; color: var(--eg-green); line-height: 1.1; margin: 0; }
.eg-head__title small { display: block; font-family: 'Work Sans', sans-serif; font-size: .7rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--eg-gold); margin-top: 3px; }
.eg-head__tools { display: flex; gap: 6px; }
.eg-ib {
width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
background: #fff; color: var(--eg-green); border: 1px solid var(--eg-line); transition: background .25s, color .25s, transform .25s;
}
.eg-ib:hover { background: var(--eg-green); color: #fff; }
.eg-ib:focus-visible, .eg-chip:focus-visible, .eg-send:focus-visible, .eg-mic:focus-visible { outline: 3px solid var(--eg-gold); outline-offset: 2px; }
.eg-ib svg { width: 18px; height: 18px; }
.eg-ib[aria-pressed="true"] { background: var(--eg-cream); color: var(--eg-gold); }
.eg-settings { display: none; gap: .7rem; padding: 12px 18px; border-bottom: 1px solid var(--eg-line); background: #fff; font-size: .85rem; }
.eg.show-settings .eg-settings { display: grid; }
.eg-settings label { display: grid; gap: .3rem; color: var(--eg-muted); }
.eg-settings select, .eg-settings input[type=range] { width: 100%; }
.eg-settings select { padding: .45rem .6rem; border: 1px solid var(--eg-line); border-radius: 10px; background: var(--eg-ivory); color: var(--eg-ink); font: inherit; }
.eg-settings input[type=range] { accent-color: var(--eg-green); }
.eg-stage { display: grid; justify-items: center; gap: 8px; padding: 18px 16px 10px; }
.eg-orb { position: relative; width: 86px; height: 86px; }
.eg-orb__core {
position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center;
background: radial-gradient(circle at 35% 30%, #3C7A5E 0%, var(--eg-green) 60%, #173C2D 100%);
color: var(--eg-gold-soft); box-shadow: inset 0 0 0 3px var(--eg-gold-soft), 0 18px 36px -16px rgba(31, 77, 58, .7);
transition: transform .5s var(--eg-ease);
}
.eg-orb__core svg { width: 34px; height: 34px; }
.eg-orb__halo { position: absolute; inset: -10px; border-radius: 50%; border: 1px solid var(--eg-gold); opacity: 0; }
.eg-orb__halo--2 { inset: -22px; }
.eg[data-state="idle"] .eg-orb__core { animation: egBreathe 4s ease-in-out infinite; }
.eg[data-state="speaking"] .eg-orb__halo { animation: egHalo 1.6s ease-out infinite; }
.eg[data-state="speaking"] .eg-orb__halo--2 { animation-delay: .5s; }
.eg[data-state="listening"] .eg-orb__core { background: radial-gradient(circle at 35% 30%, #EAEAEA 0%, var(--eg-gold) 60%, #145C3D 100%); color: #fff; animation: egBreathe 1.1s ease-in-out infinite; }
.eg[data-state="listening"] .eg-orb__halo { border-color: var(--eg-gold); animation: egHalo 1.2s ease-out infinite; }
.eg[data-state="thinking"] .eg-orb__halo { opacity: 1; border-style: dashed; animation: egSpin 1.6s linear infinite; }
@keyframes egBreathe { 50% { transform: scale(1.05); } }
@keyframes egHalo { 0% { transform: scale(.85); opacity: .9; } 100% { transform: scale(1.25); opacity: 0; } }
@keyframes egSpin { to { transform: rotate(360deg); } }
.eg-wave { display: flex; align-items: center; justify-content: center; gap: 4px; height: 26px; }
.eg-wave span { width: 4px; height: 4px; border-radius: 3px; background: var(--eg-gold); opacity: .45; transition: height .2s, opacity .2s; }
.eg[data-state="speaking"] .eg-wave span, .eg[data-state="listening"] .eg-wave span { opacity: 1; animation: egWave 1s ease-in-out infinite; }
.eg[data-state="listening"] .eg-wave span { background: var(--eg-green); }
.eg-wave span:nth-child(2) { animation-delay: .1s !important; } .eg-wave span:nth-child(3) { animation-delay: .2s !important; }
.eg-wave span:nth-child(4) { animation-delay: .3s !important; } .eg-wave span:nth-child(5) { animation-delay: .4s !important; }
.eg-wave span:nth-child(6) { animation-delay: .3s !important; } .eg-wave span:nth-child(7) { animation-delay: .2s !important; }
.eg-wave span:nth-child(8) { animation-delay: .1s !important; }
@keyframes egWave { 0%, 100% { height: 5px; } 50% { height: 24px; } }
.eg-status { margin: 0; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--eg-gold); min-height: 1em; }
.eg-log { flex: 1; overflow-y: auto; padding: 6px 16px 10px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; overscroll-behavior: contain; }
.eg-msg { max-width: 90%; padding: .7rem .9rem; border-radius: 16px; font-size: .92rem; line-height: 1.5; animation: egIn .45s var(--eg-ease) both; }
.eg-msg p { margin: 0 0 .4rem; } .eg-msg p:last-child { margin: 0; }
.eg-msg ul { margin: .3rem 0 .4rem; padding-left: 1.1rem; }
.eg-msg--bot { align-self: flex-start; background: #fff; border: 1px solid var(--eg-line); border-bottom-left-radius: 6px; }
.eg-msg--me { align-self: flex-end; background: var(--eg-green); color: #fff; border-bottom-right-radius: 6px; }
.eg-msg strong { color: var(--eg-green); }
.eg-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: .55rem; }
.eg-action { display: inline-flex; align-items: center; gap: .3rem; padding: .4rem .75rem; border-radius: 999px; font-size: .8rem; font-weight: 600; text-decoration: none; background: var(--eg-green); color: #fff !important; transition: background .25s; }
.eg-action:hover { background: var(--eg-gold); }
.eg-action--wa { background: #25D366; color: #0b3d20 !important; }
.eg-action--ghost { background: transparent; color: var(--eg-green) !important; border: 1px solid var(--eg-gold); }
@keyframes egIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.eg-typing { display: inline-flex; gap: 4px; }
.eg-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--eg-gold); animation: egDot 1s infinite; }
.eg-typing i:nth-child(2) { animation-delay: .15s; } .eg-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes egDot { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
.eg-chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 16px 10px; scrollbar-width: none; }
.eg-chips::-webkit-scrollbar { display: none; }
.eg-chip { flex: none; padding: .45rem .8rem; border-radius: 999px; border: 1px solid var(--eg-line); background: #fff; color: var(--eg-green); font: 500 .8rem 'Work Sans', sans-serif; cursor: pointer; transition: border-color .25s, background .25s; }
.eg-chip:hover { border-color: var(--eg-gold); background: var(--eg-cream); }
.eg-input { display: flex; align-items: center; gap: 8px; padding: 10px 12px 14px; border-top: 1px solid var(--eg-line); background: #fff; }
.eg-input input { flex: 1; min-width: 0; height: 44px; padding: 0 16px; border: 1px solid var(--eg-line); border-radius: 999px; background: var(--eg-ivory); color: var(--eg-ink); font: 400 .95rem 'Work Sans', sans-serif; }
.eg-input input:focus { outline: 0; border-color: var(--eg-green); box-shadow: 0 0 0 3px rgba(31, 77, 58, .12); }
.eg-send, .eg-mic { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; cursor: pointer; border: 0; transition: background .25s, transform .25s; }
.eg-send { background: var(--eg-cream); color: var(--eg-green); }
.eg-send:hover { background: var(--eg-gold-soft); }
.eg-mic { background: var(--eg-green); color: #fff; }
.eg-mic:hover { background: var(--eg-gold); }
.eg-mic[aria-pressed="true"] { background: var(--eg-gold); animation: egBreathe 1s ease-in-out infinite; }
.eg-mic[hidden] { display: none; }
.eg-send svg, .eg-mic svg { width: 20px; height: 20px; }
.eg-consent { position: absolute; inset: 0; z-index: 3; display: none; place-items: center; padding: 22px; background: rgba(255, 255, 255, .97); }
.eg.show-consent .eg-consent { display: grid; }
.eg-consent__box { text-align: center; max-width: 320px; }
.eg-consent h3 { font-family: var(--eg-serif); font-size: 1.5rem; color: var(--eg-green); margin: 0 0 .6rem; }
.eg-consent p { font-size: .88rem; color: var(--eg-muted); margin: 0 0 .8rem; line-height: 1.5; }
.eg-consent__btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }
.eg-btn { padding: .7rem 1.2rem; border-radius: 999px; border: 1px solid var(--eg-green); background: var(--eg-green); color: #fff; font: 600 .88rem 'Work Sans', sans-serif; cursor: pointer; }
.eg-btn--ghost { background: transparent; color: var(--eg-green); border-color: var(--eg-gold); }
.eg-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 640px) {
.eg-fab { right: 14px; bottom: 160px; padding: 5px; }
.eg-fab__label { display: none; }
.eg-panel { inset: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; border: 0; transform: translateY(30px); }
.eg-stage { padding-top: 22px; }
.eg-orb { width: 104px; height: 104px; }
.eg-input { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
}
@media (max-width: 640px) and (max-height: 760px) {
.eg-stage { padding: 10px 16px 4px; gap: 4px; }
.eg-orb { width: 70px; height: 70px; }
.eg-orb__core svg { width: 28px; height: 28px; }
.eg-head { padding: 10px 12px 8px 16px; }
}
@media (prefers-reduced-motion: reduce) {
.eg *, .eg *::after { animation: none !important; transition: none !important; }
}
.eg-fab__orb, .eg-orb__core { overflow: hidden; }
.eg-fab__orb img, .eg-orb__core img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; border-radius: 50%; display: block; }
.eg-fab__orb { box-shadow: 0 0 0 2px var(--eg-gold-soft); background: var(--eg-cream); }
.eg-orb__core { background: var(--eg-cream); box-shadow: 0 0 0 3px var(--eg-gold-soft), 0 18px 36px -16px rgba(31, 77, 58, .7); }
.eg[data-state="listening"] .eg-orb__core { background: var(--eg-gold); box-shadow: 0 0 0 4px var(--eg-gold), 0 18px 36px -16px rgba(138, 100, 48, .7); }
.eg[data-state="listening"] .eg-orb__core img { filter: saturate(1.05); }
