/* ============================================================
   Chat widget — matches the site: navy, teal accent, Work Sans.
   ============================================================ */
.agsc { --agsc: #048075; --agsc-ink: #102145; --agsc-bg: #fff; position: fixed; right: 20px; bottom: 20px; z-index: 2147483000; font-family: "Work Sans", "Segoe UI", system-ui, sans-serif; font-size: 14px; }
/* the panel is display:flex below, which would beat the hidden attribute — so say it twice */
.agsc__panel[hidden], .agsc:not(.is-open) .agsc__panel { display: none !important; }
.agsc--left { right: auto; left: 20px; }
.agsc__launcher { width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--agsc); color: #fff; box-shadow: 0 10px 28px rgba(4,128,117,.38); cursor: pointer; display: grid; place-items: center; position: relative; transition: transform .2s ease, box-shadow .2s ease; }
.agsc__launcher:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(4,128,117,.45); }
.agsc.is-open .agsc__launcher { background: var(--agsc-ink); box-shadow: 0 8px 20px rgba(16,33,69,.3); }
.agsc__badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #E85D2C; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.agsc__panel { position: absolute; bottom: 72px; right: 0; width: 370px; max-width: calc(100vw - 24px); height: 560px; max-height: calc(100vh - 110px); background: var(--agsc-bg); border-radius: 18px; box-shadow: 0 24px 64px rgba(16,33,69,.28); display: flex; flex-direction: column; overflow: hidden; animation: agscIn .22s ease; }
.agsc--left .agsc__panel { right: auto; left: 0; }
@keyframes agscIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.agsc__head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 12px; background: linear-gradient(135deg, #04203F, #0A3350); color: #fff; }
.agsc__avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--agsc); display: grid; place-items: center; font-weight: 700; font-size: 17px; flex: none; }
.agsc__title { flex: 1; min-width: 0; line-height: 1.25; }
.agsc__title b { display: block; font-size: 15px; }
.agsc__status { display: block; font-size: 12px; color: #B9CBE0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agsc__status::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #3DD68C; margin-right: 6px; vertical-align: 1px; }
.agsc__close { background: transparent; border: 0; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; opacity: .8; padding: 0 4px; }
.agsc__close:hover { opacity: 1; }
.agsc__body { flex: 1; overflow-y: auto; padding: 16px 14px 8px; background: #F4F7FA; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.agsc__row { display: flex; flex-direction: column; max-width: 86%; }
.agsc__row--me { align-self: flex-end; align-items: flex-end; }
.agsc__row--bot, .agsc__row--staff { align-self: flex-start; align-items: flex-start; }
.agsc__row--sys { align-self: center; max-width: 100%; }
.agsc__row--sys .agsc__bubble { background: transparent; color: #7A8699; font-size: 12px; box-shadow: none; padding: 2px 8px; }
.agsc__bubble { padding: 10px 13px; border-radius: 16px; line-height: 1.5; box-shadow: 0 1px 2px rgba(16,33,69,.06); word-wrap: break-word; color: #2E3A53; background: #fff; border-bottom-left-radius: 5px; }
.agsc__row--me .agsc__bubble { background: var(--agsc); color: #fff; border-bottom-left-radius: 16px; border-bottom-right-radius: 5px; }
.agsc__row--staff .agsc__bubble { background: #E9F6F4; border: 1px solid #CBE9E4; }
.agsc__bubble a { color: inherit; text-decoration: underline; }
.agsc__who { display: block; font-size: 11px; font-weight: 700; color: var(--agsc); margin-bottom: 3px; letter-spacing: .3px; }
.agsc__time { font-size: 10.5px; color: #97A3B6; margin: 3px 6px 0; }
.agsc__img { max-width: 220px; border-radius: 10px; display: block; margin-top: 6px; }
.agsc__file { display: inline-block; margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: #F0F3F7; font-size: 13px; text-decoration: none !important; }
.agsc__typing .agsc__bubble { display: flex; gap: 4px; padding: 12px 14px; }
.agsc__typing i { width: 7px; height: 7px; border-radius: 50%; background: #9CB0C6; animation: agscDot 1s infinite ease-in-out; }
.agsc__typing i:nth-child(2) { animation-delay: .15s; } .agsc__typing i:nth-child(3) { animation-delay: .3s; }
@keyframes agscDot { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-4px); opacity: 1; } }
.agsc__quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 12px 4px; background: #F4F7FA; }
.agsc__quick:empty { display: none; }
.agsc__chip { border: 1.5px solid var(--agsc); background: #fff; color: var(--agsc); border-radius: 20px; padding: 6px 13px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, color .15s; }
.agsc__chip:hover { background: var(--agsc); color: #fff; }
.agsc__form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid #E6EBF2; background: #fff; }
.agsc__input { flex: 1; resize: none; border: 1px solid #D9E0EA; border-radius: 12px; padding: 9px 12px; font: inherit; font-size: 14px; line-height: 1.4; max-height: 110px; outline: 0; }
.agsc__input:focus { border-color: var(--agsc); box-shadow: 0 0 0 3px rgba(4,128,117,.12); }
.agsc__send { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--agsc); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.agsc__send:hover { filter: brightness(1.08); }
.agsc__foot { text-align: center; font-size: 10.5px; color: #A7B2C3; padding: 4px 0 7px; background: #fff; letter-spacing: .3px; }
.agsc__card { display: flex; flex-direction: column; gap: 8px; min-width: 240px; }
.agsc__card b { color: var(--agsc-ink); }
.agsc__in { border: 1px solid #D9E0EA; border-radius: 9px; padding: 9px 11px; font: inherit; font-size: 14px; }
.agsc__in:focus { outline: 0; border-color: var(--agsc); }
.agsc__btn { border: 0; border-radius: 9px; padding: 10px; background: var(--agsc); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.agsc__btn[disabled] { opacity: .6; cursor: default; }
.agsc__err { color: #B42318; font-size: 12px; min-height: 1em; }
@media (max-width: 480px) {
  .agsc { right: 12px; bottom: 12px; }
  .agsc--left { left: 12px; }
  /* a bottom sheet, not the whole screen: the page stays visible above it
     and the close button is always within thumb reach */
  .agsc__panel { position: fixed; left: 8px; right: 8px; bottom: 8px; top: auto; width: auto; max-width: none; height: 78vh; max-height: calc(100vh - 16px); border-radius: 16px; }
  .agsc.is-open .agsc__launcher { display: none; }
  .agsc__close { width: 40px; height: 40px; font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) { .agsc__panel { animation: none; } .agsc__typing i { animation: none; } }
