/* ANB Lab — integrated chat skin. Only affects the existing #anb-site-chat widget. */
#anb-site-chat,
#anb-site-chat * { box-sizing: border-box; }
#anb-site-chat {
  position: fixed;
  right: 22px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 9999;
  font-family: inherit;
  color: #19345a;
  font-size: 13px;
  line-height: 1.5;
}
#anb-site-chat button,
#anb-site-chat textarea { font-family: inherit; }
#anb-site-chat button { cursor: pointer; }
#anb-site-chat .anb-chat-launch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  margin: 0;
  padding: 11px 17px;
  border: 1px solid #1755b5;
  border-radius: 999px;
  background: #1757b8;
  color: #fff;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: 0;
  box-shadow: 0 8px 22px rgba(18, 66, 135, .21);
  text-shadow: none;
  transition: background-color .18s, box-shadow .18s, transform .18s;
}
#anb-site-chat .anb-chat-launch:hover {
  background: #0e489d;
  box-shadow: 0 10px 28px rgba(18, 66, 135, .28);
  transform: translateY(-1px);
}
#anb-site-chat .anb-chat-launch svg { flex: none; }
#anb-site-chat button:focus-visible,
#anb-site-chat textarea:focus-visible {
  outline: 2px solid #75aceb;
  outline-offset: 3px;
}
#anb-site-chat .anb-chat-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 13px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: min(392px, calc(100vw - 24px));
  height: min(524px, calc(100vh - 110px));
  height: min(524px, calc(100dvh - 110px));
  min-height: 250px;
  margin: 0;
  border: 1px solid #dae6f6;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 65px rgba(25, 53, 91, .20), 0 5px 15px rgba(25, 53, 91, .06);
  isolation: isolate;
}
#anb-site-chat .anb-chat-panel[hidden],
#anb-site-chat .anb-chat-welcome[hidden] { display: none !important; }
#anb-site-chat .anb-chat-head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 11px;
  min-height: 78px;
  padding: 13px 16px;
  border-bottom: 1px solid #dce9f8;
  background: linear-gradient(115deg, #e9f3ff 0%, #f6faff 100%);
  color: #153b72;
}
#anb-site-chat .anb-chat-head-icon,
#anb-site-chat .anb-chat-welcome-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #1757b8;
  color: #fff;
}
#anb-site-chat .anb-chat-head-icon svg { width: 22px; height: 22px; }
#anb-site-chat .anb-chat-head-text { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; }
#anb-site-chat .anb-chat-head-text strong { font-size: 17px; line-height: 1.25; font-weight: 800; color: #133662; }
#anb-site-chat .anb-chat-head-text small { margin-top: 3px; font-size: 11px; color: #587393; }
#anb-site-chat .anb-chat-head .anb-chat-close {
  display: inline-flex;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border: 1px solid #d6e4f5;
  border-radius: 10px;
  background: #fff;
  color: #44668a;
  box-shadow: none;
}
#anb-site-chat .anb-chat-head .anb-chat-close:hover { background: #e3efff; color: #1555b0; }
#anb-site-chat .anb-chat-history {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 16px;
  overflow: auto;
  overscroll-behavior: contain;
  background: #f7faff;
  scrollbar-color: #c5d7ea transparent;
  scrollbar-width: thin;
}
#anb-site-chat .anb-chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: auto 0;
  padding: 12px 9px;
  text-align: center;
  color: #5f7590;
}
#anb-site-chat .anb-chat-welcome-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 5px;
  border-radius: 17px;
  background: #e4f0ff;
  color: #1757b8;
}
#anb-site-chat .anb-chat-welcome strong { font-size: 16px; color: #173b67; font-weight: 800; }
#anb-site-chat .anb-chat-welcome > span:last-child { max-width: 270px; font-size: 12px; line-height: 1.65; }
#anb-site-chat .anb-chat-line {
  flex: 0 0 auto;
  width: fit-content;
  max-width: 87%;
  margin: 0;
  padding: 10px 13px;
  border: 1px solid #e0eaf7;
  border-radius: 13px 13px 13px 4px;
  background: #fff;
  color: #264360;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: 0 3px 9px rgba(31, 66, 111, .04);
}
#anb-site-chat .anb-chat-line.visitor {
  align-self: flex-end;
  border-color: #1757b8;
  border-radius: 13px 13px 4px 13px;
  background: #1757b8;
  color: #fff;
}
#anb-site-chat .anb-chat-line.staff { align-self: flex-start; }
#anb-site-chat .anb-chat-form {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  gap: 9px;
  margin: 0;
  padding: 12px 13px 6px;
  border-top: 1px solid #e4ebf5;
  background: #fff;
}
#anb-site-chat .anb-chat-form textarea {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 46px;
  min-height: 46px;
  max-height: 120px;
  margin: 0;
  padding: 11px 12px;
  resize: vertical;
  border: 1px solid #d8e5f4;
  border-radius: 12px;
  background: #f8fbff;
  color: #1a3b60;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: none;
}
#anb-site-chat .anb-chat-form textarea::placeholder { color: #8a9aaf; }
#anb-site-chat .anb-chat-form textarea:focus { border-color: #82afe9; background: #fff; outline: none; box-shadow: 0 0 0 3px rgba(21, 84, 182, .10); }
#anb-site-chat .anb-chat-form button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  margin: 0;
  padding: 10px 13px;
  border: 1px solid #1757b8;
  border-radius: 12px;
  background: #1757b8;
  color: #fff;
  font-size: 12px;
  font-weight: 750;
  box-shadow: none;
}
#anb-site-chat .anb-chat-form button:hover { background: #0f489a; }
#anb-site-chat .anb-chat-status {
  display: block;
  flex: 0 0 auto;
  min-height: 25px;
  margin: 0;
  padding: 0 16px 10px;
  background: #fff;
  color: #778aa0;
  font-size: 11px;
  line-height: 1.3;
}
#anb-site-chat .anb-chat-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 480px) {
  #anb-site-chat {
    right: 11px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
  #anb-site-chat .anb-chat-launch { min-height: 45px; padding: 10px 14px; font-size: 12px; }
  #anb-site-chat .anb-chat-panel {
    width: calc(100vw - 22px);
    height: min(550px, calc(100vh - 95px));
    height: min(550px, calc(100dvh - 95px));
    min-height: 0;
    border-radius: 19px;
  }
  #anb-site-chat .anb-chat-form { padding: 10px 10px 5px; gap: 7px; }
  #anb-site-chat .anb-chat-form button { padding: 10px 12px; }
}
@media (max-width: 350px) {
  #anb-site-chat .anb-chat-form button span { display: none; }
  #anb-site-chat .anb-chat-form button { width: 46px; padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  #anb-site-chat .anb-chat-launch { transition: none; }
}
