:root{
  --brand:#00B7DC;
  --brand-dark:#0078A9;
  --ink:#333;
  --muted:#6B7280;
  --panel:#fff;
  --panel-subtle:#F4F6F8;
  --border:#E5E7EB;
  --aws-vvh: 100vh;
  --aws-vvoff: 0px;
}

body.aws-chat-locked{
  position: fixed;
  width: 100%;
  overflow: hidden;
  touch-action: none;
}

.aws-chat-fab{
  position:fixed;
  right:20px;
  bottom:20px;
  z-index:1000002;
  width:64px;
  height:64px;
  border-radius:16px;
  background:var(--brand);
  color:#fff;
  cursor:pointer;
  border:none;
  box-shadow:0 20px 40px rgba(0,0,0,.2);
  display:flex;
  align-items:center;
  justify-content:center;
}

.aws-robot-icon{
  width:28px;
  height:28px;
  display:block;
}

.aws-chat-fab-label{
  position:fixed;
  right:92px;
  bottom:36px;
  z-index:1000001;
  background:#111;
  color:#fff;
  padding:8px 12px;
  border-radius:12px;
  font-size:13px;
  line-height:1.3;
  box-shadow:0 12px 24px rgba(0,0,0,.25);
  white-space:nowrap;
  pointer-events:none;
}

.aws-chat-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.35);
  z-index:999997;
  display:none;
  pointer-events:none;
}
.aws-chat-overlay.open{
  display:block;
  pointer-events:auto;
}

.aws-chat-panel{
  position:fixed;
  right:20px;
  bottom:92px;
  z-index:999998;
  width:360px;
  max-width:92vw;
  height:520px;
  border-radius:16px;
  overflow:hidden;
  background:var(--panel);
  border:1px solid var(--border);
  box-shadow:0 24px 48px rgba(0,0,0,.25);
  display:none;
}
.aws-chat-panel.open{
  display:flex;
  flex-direction:column;
}

/* HEADER */
.aws-chat-header{
  padding:10px 10px;
  background:var(--brand);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex:0 0 auto;
}

.aws-chat-title{
  display:flex;
  flex-direction:column;
  line-height:1.05;
  font-weight:900;
  letter-spacing:0.2px;
  min-width:0;
  flex:1 1 auto;
}
.aws-chat-title .t1{
  font-size:14px;
  opacity:.95;
}
.aws-chat-title .t2{
  font-size:16px;
}

.aws-header-actions{
  display:flex;
  align-items:center;
  gap:6px;
  flex:0 0 auto;
}

/* Contact button */
.aws-contact-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  background:rgba(255,255,255,.14);
  color:#fff;
  border:1.5px solid rgba(255,255,255,.95);
  border-radius:12px;
  height:34px;
  padding:0 10px;
  font-size:12px;
  font-weight:900;
  cursor:pointer;
  white-space:nowrap;
  box-shadow:0 8px 14px rgba(0,0,0,.16);
}
.aws-contact-emoji{
  font-size:14px;
  line-height:1;
}
.aws-contact-text{
  font-size:12px;
}

/* Icon buttons: SMALL */
.aws-icon-btn{
  width:26px;
  height:26px;
  border-radius:9px;
  border:1px solid rgba(255,255,255,.65);
  background:rgba(255,255,255,.08);
  color:#fff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  font-weight:900;
  line-height:1;
  padding:0;
  box-shadow:none;
}
#aws-min-btn{
  font-size:18px;
  transform: translateY(-1px);
}
#aws-close-btn{
  font-size:16px;
}

.aws-chat-body{
  flex:1;
  min-height:0;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  padding:14px;
  background:var(--panel-subtle);
  font-size:15px;
  line-height:1.6;
  color:var(--ink);
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.aws-chat-footer{
  flex:0 0 auto;
  display:grid;
  grid-template-columns:1fr auto;
  gap:8px;
  padding:10px;
  border-top:1px solid var(--border);
  background:#fff;
  align-items:center;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}

.aws-chat-input{
  border:1px solid #D1D5DB;
  border-radius:12px;
  padding:10px 12px;
  font-size:16px;
  resize:none;
  height:42px;
  max-height:120px;
  overflow:auto;
  box-sizing:border-box;
}

.aws-chat-send{
  border:none;
  background:var(--brand);
  color:#fff;
  border-radius:12px;
  font-size:15px;
  font-weight:900;
  cursor:pointer;
  height:42px;
  padding:0 16px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.aws-msg{
  margin:10px 0;
  padding:10px 14px;
  border-radius:14px;
  font-size:15px;
  line-height:1.55;
  max-width:72ch;
}
.aws-user{
  background:var(--brand);
  color:#fff;
  margin-left:auto;
  border-bottom-right-radius:8px;
}
.aws-bot{
  background:#F8FAFC;
  color:var(--ink);
  border:1px solid var(--border);
  border-bottom-left-radius:8px;
}
.aws-bot a{
  color:inherit;
  text-decoration:underline;
}

.aws-typing{
  font-style:italic;
  color:var(--muted);
  font-size:14px;
}

/* HubSpot modal */
.aws-modal-backdrop{
  position:fixed;
  inset:0;
  z-index:1000003;
  background:rgba(0,0,0,.45);
  display:none;
  align-items:center;
  justify-content:center;
  padding:16px;
}
.aws-modal-backdrop.open{
  display:flex;
}
.aws-modal{
  width:min(720px, 96vw);
  height:min(720px, 90dvh);
  background:#fff;
  border-radius:16px;
  border:1px solid var(--border);
  box-shadow:0 24px 48px rgba(0,0,0,.25);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
.aws-modal-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 14px;
  border-bottom:1px solid var(--border);
  font-weight:800;
}
.aws-modal-close{
  border:none;
  background:transparent;
  cursor:pointer;
  font-size:18px;
  line-height:1;
  padding:6px 10px;
}
.aws-modal-body{
  flex:1;
  min-height:0;
  overflow:auto;
  padding:12px;
}

/* MOBILE: full screen */
@media (max-width:640px){
  .aws-chat-fab-label{ display:none; }

  .aws-chat-panel{
    left:0;
    right:0;
    top:0;
    bottom:0;
    width:auto;
    max-width:none;
    height: 100dvh;
    border-radius:0;
    border-left:none;
    border-right:none;
    border-bottom:none;
  }

  .aws-contact-text{ display:none; }
  .aws-contact-btn{ width:34px; padding:0; justify-content:center; }
}

/* =========================
   FORCE OVERRIDES (wins even if old CSS is loaded)
   ========================= */
.aws-header-actions{ gap:6px !important; }

.aws-icon-btn{
  width:26px !important;
  height:26px !important;
  border-radius:9px !important;
  padding:0 !important;
  box-shadow:none !important;
}

#aws-min-btn{ font-size:18px !important; }
#aws-close-btn{ font-size:16px !important; }