.epb-public-alice {
  --epb-alice-bottom: 20px;
  position: fixed;
  right: 20px;
  bottom: var(--epb-alice-bottom);
  z-index: 2147482000;
  width: min(390px, calc(100vw - 28px));
  font-family: Inter, Arial, sans-serif;
  color: #0a174e;
  transition: bottom .24s ease;
}
.epb-public-alice .sr-only { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; border:0!important; }

.epb-alice-launcher {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  padding: 5px 16px 5px 5px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 999px;
  background: linear-gradient(135deg,#0759f2,#0789f4);
  color: #fff;
  box-shadow: 0 14px 38px rgba(7,65,166,.3);
  cursor: pointer;
  font: 800 14px/1.1 Inter,Arial,sans-serif;
}

.epb-alice-launcher:hover { transform: translateY(-2px); box-shadow: 0 18px 44px rgba(7,65,166,.36); }
.epb-alice-launcher:focus-visible { outline: 3px solid #f5b942; outline-offset: 3px; }
.epb-public-alice.is-open .epb-alice-launcher { display: none; }

.epb-alice-launcher__portrait {
  width: 52px;
  height: 52px;
  overflow: hidden;
  flex: 0 0 52px;
  border: 2px solid rgba(255,255,255,.92);
  border-radius: 50%;
  background: #dcecff;
}
.epb-alice-launcher__portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; transform: scale(1.32); transform-origin: 50% 20%; }
.epb-alice-launcher__label small { display: block; margin-top: 3px; color: #dcecff; font-size: 10px; font-weight: 650; }

.epb-alice-panel {
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(130px,1fr) auto auto auto;
  width: 100%;
  max-height: min(610px, calc(100dvh - var(--epb-alice-bottom) - 24px));
  border: 1px solid #d3e1f3;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 72px rgba(5,27,78,.3);
}
.epb-alice-panel[hidden] { display: none !important; }

.epb-alice-head { display:flex; align-items:center; gap:11px; min-height:74px; padding:10px 12px; background:linear-gradient(135deg,#08165b,#0759f2); color:#fff; }
.epb-alice-head__portrait { width:50px; height:50px; overflow:hidden; flex:0 0 50px; border:2px solid rgba(255,255,255,.88); border-radius:50%; background:#dcecff; }
.epb-alice-head__portrait img { width:100%; height:100%; object-fit:cover; object-position:50% 18%; transform:scale(1.3); transform-origin:50% 20%; }
.epb-alice-head strong { display:block; font-size:16px; letter-spacing:.02em; }
.epb-alice-head small { display:block; margin-top:2px; color:#d9e7ff; font-size:11px; }
.epb-alice-close { margin-left:auto; width:36px; height:36px; border:0; border-radius:50%; background:rgba(255,255,255,.14); color:#fff; cursor:pointer; font-size:24px; line-height:1; }

.epb-alice-messages { overflow:auto; padding:16px; background:linear-gradient(180deg,#f4f8ff,#fff); overscroll-behavior:contain; }
.epb-alice-message { width:fit-content; max-width:88%; margin:0 0 10px; padding:11px 13px; border-radius:15px; font-size:13.5px; line-height:1.48; white-space:pre-wrap; }
.epb-alice-message--ai { border:1px solid #d9e6f6; border-bottom-left-radius:5px; background:#fff; color:#33476c; }
.epb-alice-message--user { margin-left:auto; border-bottom-right-radius:5px; background:#0759f2; color:#fff; }
.epb-alice-message--typing { color:#6980a5; font-style:italic; }
.epb-alice-message a { display:block; width:fit-content; margin-top:8px; color:#0759f2; font-weight:800; text-decoration:none; }

.epb-alice-suggestions { display:flex; gap:7px; overflow-x:auto; padding:0 12px 10px; background:#fff; }
.epb-alice-suggestions button { flex:0 0 auto; border:1px solid #cfe0f4; border-radius:999px; padding:8px 10px; background:#f6f9ff; color:#173468; cursor:pointer; font:700 11px/1.2 Inter,Arial,sans-serif; }

.epb-alice-form { display:grid; grid-template-columns:1fr 42px; gap:8px; padding:10px 12px; border-top:1px solid #dbe6f4; background:#fff; }
.epb-alice-form textarea { min-height:42px; max-height:105px; resize:none; border:1px solid #c9d9ed; border-radius:12px; padding:10px 11px; color:#172a51; font:13px/1.35 Inter,Arial,sans-serif; }
.epb-alice-form textarea:focus { outline:2px solid #7fb2ff; border-color:#0759f2; }
.epb-alice-form button { border:0; border-radius:12px; background:#0759f2; color:#fff; cursor:pointer; font-size:18px; }
.epb-alice-form button:disabled,.epb-alice-form textarea:disabled { opacity:.58; cursor:not-allowed; }
.epb-alice-note { margin:0; padding:0 13px 12px; color:#6a7c99; background:#fff; font-size:9.5px; line-height:1.35; }
.epb-alice-note a { color:#0759f2; font-weight:750; }

@media (max-width: 600px) {
  .epb-public-alice { right:10px; --epb-alice-bottom:10px; width:calc(100vw - 20px); }
  .epb-alice-launcher { padding-right:12px; }
  .epb-alice-launcher__portrait { width:48px; height:48px; flex-basis:48px; }
  .epb-alice-panel { max-height:min(650px,calc(100dvh - var(--epb-alice-bottom) - 10px)); border-radius:18px; }
}

@media (prefers-reduced-motion: reduce) {
  .epb-public-alice,.epb-alice-launcher { transition:none !important; }
}
