/* Groot chat widget */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.groot-widget { position: fixed; z-index: 20; right: 1.25rem; bottom: 1.25rem; font-family: inherit; }
.groot-launcher { display: inline-flex; align-items: center; gap: .6rem; min-height: 52px; padding: .7rem 1.1rem; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: var(--teal); color: #08231f; box-shadow: 0 12px 34px rgba(0,0,0,.28); font: inherit; font-size: .92rem; font-weight: 800; cursor: pointer; transition: transform .18s ease, background .18s ease; }
.groot-launcher:hover { transform: translateY(-2px); background: #42d9c6; }
.groot-launcher:focus-visible, .groot-panel button:focus-visible, .groot-panel input:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.groot-launcher-avatar { display: block; width: 28px; height: 28px; border: 1px solid rgba(8,35,31,.35); border-radius: 50%; object-fit: cover; object-position: 55% 40%; }
.groot-panel { position: absolute; right: 0; bottom: 4.25rem; display: flex; flex-direction: column; width: min(390px, calc(100vw - 2rem)); height: min(590px, calc(100dvh - 7rem)); overflow: hidden; border: 1px solid rgba(255,255,255,.15); border-radius: 20px; background: #0d172a; color: var(--white); box-shadow: 0 24px 80px rgba(0,0,0,.48); }
.groot-panel[hidden] { display: none; }
.groot-panel-header { display: flex; align-items: center; gap: .8rem; padding: 1rem 1.05rem; background: #14233d; border-bottom: 1px solid var(--line); }
.groot-avatar { display: grid; flex: 0 0 42px; place-items: center; width: 42px; height: 42px; overflow: hidden; border: 1px solid rgba(19,196,173,.42); border-radius: 50%; background: rgba(19,196,173,.14); }
.groot-avatar img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 55% 40%; }
.groot-heading { min-width: 0; }
.groot-kicker { margin: 0; color: var(--gold); font-size: .57rem; font-weight: 850; letter-spacing: .15em; }
.groot-heading h2 { margin: .02rem 0 0; color: #fff; font-size: 1.1rem; letter-spacing: 0; line-height: 1.25; }
.groot-mode { margin: .15rem 0 0; color: #aab8ca; font-size: .68rem; }
.groot-mode::before { display: inline-block; width: 6px; height: 6px; margin: 0 .4rem .08rem 0; border-radius: 50%; background: var(--gold); content: ""; }
.groot-mode[data-mode="api"]::before { background: var(--teal); }
.groot-close { display: grid; place-items: center; width: 36px; height: 36px; margin-left: auto; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #cbd5e3; font: inherit; font-size: 1.7rem; line-height: 1; cursor: pointer; }
.groot-close:hover { background: rgba(255,255,255,.08); color: #fff; }
.groot-messages { display: flex; flex: 1; flex-direction: column; gap: .75rem; overflow-y: auto; padding: 1rem; overscroll-behavior: contain; }
.groot-message { max-width: 88%; padding: .72rem .85rem; border: 1px solid rgba(255,255,255,.1); border-radius: 15px; font-size: .86rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.groot-assistant-message { align-self: flex-start; border-top-left-radius: 5px; background: #172641; color: #e8eef7; }
.groot-user-message { align-self: flex-end; border-top-right-radius: 5px; border-color: rgba(19,196,173,.28); background: rgba(19,196,173,.15); color: #f3fffd; }
.groot-typing { color: #aab8ca; font-style: italic; }
.groot-sources { align-self: flex-start; width: 90%; margin-top: -.25rem; padding-left: .1rem; }
.groot-sources-label { display: block; margin: 0 0 .25rem; color: #91a2b9; font-size: .65rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.groot-sources a { display: block; width: fit-content; max-width: 100%; overflow: hidden; color: #54deca; font-size: .75rem; text-decoration: underline; text-decoration-color: rgba(84,222,202,.45); text-overflow: ellipsis; white-space: nowrap; }
.groot-sources a:hover { color: #fff; }
.groot-credit-note, .groot-limit-note { align-self: flex-start; width: 90%; color: #91a2b9; font-size: .68rem; line-height: 1.45; }
.groot-limit-note { padding: .55rem .7rem; border: 1px solid rgba(243,183,80,.32); border-radius: 10px; background: rgba(243,183,80,.08); color: #f0d8a7; }
.groot-suggestions { display: flex; flex-wrap: wrap; gap: .45rem; padding: 0 1rem .7rem; }
.groot-suggestions button { padding: .4rem .65rem; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; background: transparent; color: #c6d3e3; font: inherit; font-size: .72rem; cursor: pointer; }
.groot-suggestions button:hover { border-color: var(--teal); color: var(--teal); }
.groot-form { display: flex; gap: .5rem; margin: 0 1rem; padding: .45rem; border: 1px solid rgba(255,255,255,.17); border-radius: 14px; background: #08111f; }
.groot-form input { flex: 1; min-width: 0; padding: .45rem; border: 0; outline: 0; background: transparent; color: #fff; font: inherit; font-size: .85rem; }
.groot-form input::placeholder { color: #8796aa; }
.groot-form button { padding: .55rem .8rem; border: 0; border-radius: 10px; background: var(--teal); color: #08231f; font: inherit; font-size: .78rem; font-weight: 850; cursor: pointer; }
.groot-form button:disabled { opacity: .65; cursor: wait; }
.groot-suggestions button:disabled { opacity: .45; cursor: not-allowed; }
.groot-footnote { margin: .55rem 1rem .8rem; color: #8494aa; font-size: .64rem; line-height: 1.4; }

@media (max-width: 540px) {
  .groot-widget { right: .75rem; bottom: .75rem; }
  .groot-panel { bottom: 4rem; height: min(590px, calc(100dvh - 5.5rem)); }
}
