/* Barvic chat box, matched to the LMS: brand blue #2285D9, gold #C6A43F, square corners. */
.bvc-launcher, .bvc-box { --bvc-brand: #2285D9; --bvc-gold: #C6A43F; font-family: inherit; }
.bvc-launcher { position: fixed; right: 20px; bottom: 120px; z-index: 9998; background: var(--bvc-brand); color: #fff;
  border: 0; border-bottom: 3px solid var(--bvc-gold); border-radius: 0; padding: 12px 18px; font-size: 15px; font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.2); cursor: pointer; }
.bvc-box { position: fixed; right: 20px; bottom: 20px; z-index: 9999; width: 360px; max-width: calc(100vw - 24px);
  height: 520px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: #fff;
  border-radius: 0; box-shadow: 0 10px 30px rgba(0,0,0,.25); overflow: hidden; }
.bvc-box[hidden], .bvc-launcher[hidden], .bvc-chips[hidden] { display: none; }
.bvc-header { background: linear-gradient(135deg, var(--bvc-brand), #1a6bb8); border-bottom: 3px solid var(--bvc-gold); color: #fff; padding: 12px 44px 12px 14px; position: relative;
  display: flex; align-items: center; gap: 10px; }
.bvc-logo { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; border: 2px solid #fff; object-fit: cover; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.bvc-title { min-width: 0; }
.bvc-header strong { display: block; font-size: 15px; color: #fff !important; }
.bvc-sub { font-size: 12px; opacity: .85; }
.bvc-close { position: absolute; right: 10px; top: 8px; background: none; border: 0; color: #fff; font-size: 24px; cursor: pointer; }
.bvc-log { flex: 1; overflow-y: auto; padding: 12px; background: #f6f7fb; }
.bvc-msg { max-width: 85%; margin: 6px 0; padding: 9px 12px; border-radius: 0; font-size: 14px; line-height: 1.4; white-space: pre-wrap; word-wrap: break-word; }
.bvc-bot { background: #fff; border: 1px solid #e3e6ee; border-left: 3px solid var(--bvc-gold); }
.bvc-user { background: var(--bvc-brand); color: #fff; margin-left: auto; }
.bvc-msg a { color: inherit; text-decoration: underline; }
.bvc-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; background: #f6f7fb; }
.bvc-chip { border: 1px solid var(--bvc-brand); color: var(--bvc-brand); background: #fff; border-radius: 0; padding: 6px 10px; font-size: 13px; cursor: pointer; }
.bvc-form { display: flex; border-top: 1px solid #e3e6ee; }
.bvc-form input { flex: 1; border: 0; padding: 12px; font-size: 14px; outline: none; }
.bvc-send { border: 0; background: var(--bvc-brand); color: #fff; padding: 0 16px; font-weight: 600; cursor: pointer; }
.bvc-human { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 600; padding: 9px; color: #128c4a; background: #eefaf2; text-decoration: none; }
.bvc-human:hover { background: #dcf5e5; text-decoration: none; }
.bvc-human:hover .bvc-wa-text { text-decoration: underline; }
.bvc-wa-icon { color: #25D366; font-size: 20px; }
.bvc-icon { margin-right: 8px; }
.bvc-launcher { display: inline-flex; align-items: center; }
.bvc-launch-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; text-align: left; }
.bvc-launch-sub { font-size: 11px; font-weight: 500; opacity: .9; letter-spacing: .3px; }
@media (max-width: 480px) {
  /* Fill exactly the visible screen. 100dvh ignores Safari's toolbars, which 100vh does not. */
  .bvc-box { top: 0; left: 0; right: 0; bottom: 0; width: auto; max-width: none; height: 100%; height: 100dvh; max-height: none; }
}
/* Phones: 16px text in the input stops iPhone zooming in when you tap it (the cause of the cut-off, stuck view). */
@media (max-width: 768px) {
  .bvc-form input { font-size: 16px; }
  .bvc-log { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
}
.bvc-typing { color: #64748b; font-style: italic; }
.bvc-dots { display: inline-block; margin-left: 4px; }
.bvc-dots span { display: inline-block; width: 5px; height: 5px; margin: 0 1px; background: var(--bvc-brand); border-radius: 50%; animation: bvc-blink 1.2s infinite both; }
.bvc-dots span:nth-child(2) { animation-delay: .2s; }
.bvc-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes bvc-blink { 0%, 80%, 100% { opacity: .2; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .bvc-dots span { animation: none; opacity: .6; } }

/* Keep chat text left-aligned and let long links wrap instead of stretching the line above. */
.bvc-box .bvc-msg,
.bvc-box .bvc-msg * {
  text-align: left !important;
  text-align-last: left !important;
  text-justify: none !important;
  word-spacing: normal !important;
}
.bvc-box .bvc-msg a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* No browser focus box on mouse click; keep a gold ring for keyboard users. */
.bvc-launcher:focus, .bvc-box button:focus, .bvc-human:focus { outline: none; }
.bvc-launcher:focus-visible, .bvc-box button:focus-visible, .bvc-human:focus-visible { outline: 2px solid var(--bvc-gold); outline-offset: 2px; }

/* Phones and small tablets: smaller button with a clear gap above the scroll-to-top arrow. */
@media (max-width: 768px) {
  .bvc-launcher { right: 12px; bottom: 160px; padding: 9px 14px; font-size: 14px; }
  .bvc-launch-sub { font-size: 10px; }
  .bvc-icon { margin-right: 6px; }
}
/* Phones, chat open: lock the page behind the chat and hide the scroll-to-top arrow. */
html.bvc-open, html.bvc-open body { overflow: hidden !important; height: 100%; }
html.bvc-open #scrollToTop { display: none !important; }
/* Any screen: hide the scroll-to-top arrow while the chat is open. */
html.bvc-chat-open #scrollToTop { display: none !important; }
/* Chat background: very subtle tech icons (</>, AI, shield, cloud, design pen, Barvic V) that scroll with the messages,
   and a very faint "Build Your Digital Future!" watermark that stays at the bottom of the chat. */
.bvc-log {
  background-color: #f6f7fb;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='340' height='48' viewBox='0 0 340 48'%3E%3Crect width='340' height='48' fill='%23f6f7fb'/%3E%3Ctext x='170' y='30' text-anchor='middle' font-family='Arial,sans-serif' font-weight='600' font-size='19' letter-spacing='0.5' fill='%232285D9' opacity='0.04'%3EBuild Your Digital Future%21%3C/text%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'%3E%3Cg fill='none' stroke='%232285D9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' opacity='0.035'%3E%3Cpath d='M28 30l-10 10 10 10M52 30l10 10-10 10M44 26l-8 28'/%3E%3Cpath d='M150 22l14 5v11c0 9-6 15-14 18-8-3-14-9-14-18V27z'/%3E%3Cpath d='M146 39l3 3 6-7'/%3E%3Cpath d='M40 150h34a10 10 0 0 0 0-20 14 14 0 0 0-27-3 9 9 0 0 0-7 23z'/%3E%3Cpath d='M178 140l14-14 8 8-14 14-10 2z'/%3E%3Cpath d='M188 130l8 8'/%3E%3C/g%3E%3Ctext x='96' y='108' font-family='Arial,sans-serif' font-size='18' font-weight='700' fill='%232285D9' opacity='0.035'%3EAI%3C/text%3E%3Cg opacity='0.05'%3E%3Cpath d='M104 196l10 20 10-20' fill='none' stroke='%232285D9' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='114' cy='189' r='3' fill='%23C6A43F'/%3E%3C/g%3E%3C/svg%3E");
  background-position: center bottom 10px, 0 0;
  background-size: 80% auto, 240px 240px;
  background-repeat: no-repeat, repeat;
  background-attachment: scroll, local;
}

/* "Ask Barvic" as a rounded chat bubble: logo avatar, online dot, white outline and a tail. */
.bvc-launcher { border-radius: 14px; padding: 8px 18px 8px 8px; gap: 10px; margin: 0; overflow: visible;
  box-shadow: 0 6px 18px rgba(0,0,0,.3), 0 0 0 3px rgba(255,255,255,.95); }
.bvc-launcher::before { content: ""; position: absolute; right: 20px; bottom: -23px;
  border-left: 23px solid transparent; border-top: 23px solid rgba(255,255,255,.95); }
.bvc-launcher::after { content: ""; position: absolute; right: 23px; bottom: -18px; z-index: 1;
  border-left: 18px solid transparent; border-top: 18px solid var(--bvc-brand); }
.bvc-av { position: relative; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%;
  border: 2px solid var(--bvc-gold); background: #fff; }
.bvc-av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.bvc-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%;
  background: #22c55e; border: 2px solid #fff; }
.bvc-launch-sub { font-size: 11px; opacity: 1; }
@media (max-width: 768px) {
  .bvc-launcher { padding: 6px 14px 6px 6px; gap: 8px; }
  .bvc-av { flex-basis: 32px; width: 32px; height: 32px; }
}
/* Whole bubble responds to a click or tap: logo, text and tail all open the chat. */
.bvc-launcher { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none; }
.bvc-launcher * { pointer-events: none; }
@media (hover: hover) { .bvc-launcher:hover { filter: brightness(1.06); } }
.bvc-launcher:active { transform: scale(.97); }
