:root{
  --mychat-primary:#b1002a;
  --mychat-accent:#111111;
  --mychat-bg:#ffffff;
  --mychat-soft:#f6f7f9;
  --mychat-border:#e8e8e8;
}

#mychatBtn{
  position:fixed;
  bottom:18px;
  inset-inline-end:18px;
  z-index:999999;
  background:var(--mychat-primary);
  color:#fff;
  font-weight:1000;
  border-radius:999px;
  padding:12px 16px;
  cursor:pointer;
  box-shadow:0 10px 24px rgba(0,0,0,.18);
  user-select:none;
}

#mychatBox{
  position:fixed;
  bottom:78px;
  inset-inline-end:18px;
  z-index:999999;
  width:360px;
  max-width: calc(100vw - 24px);
  height:520px;
  max-height: calc(100vh - 120px);
  background:var(--mychat-bg);
  border:1px solid var(--mychat-border);
  border-radius:16px;
  box-shadow:0 20px 50px rgba(0,0,0,.18);
  display:none;
  overflow:hidden;
}

#mychatHead{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:12px 14px;
  background:var(--mychat-primary);
  color:#fff;
}
#mychatHead .status{
  font-weight:900;
  opacity:.9;
  font-size:12px;
}
#mychatX{
  cursor:pointer;
  font-size:18px;
  font-weight:1000;
  opacity:.95;
}

#mychatBody{
  height: calc(100% - 54px);
  display:flex;
  flex-direction:column;
}

.mychat-form{
  padding:14px;
  overflow:auto;
}
.mychat-note{
  background:var(--mychat-soft);
  border:1px solid var(--mychat-border);
  border-radius:14px;
  padding:10px 12px;
  color:var(--mychat-accent);
  font-weight:800;
  margin-bottom:10px;
}
.mychat-note2{
  font-weight:1000;
  color:var(--mychat-accent);
  margin-bottom:10px;
}
.mychat-note3{
  margin-top:10px;
  font-weight:900;
  color:var(--mychat-accent);
  opacity:.85;
}

.mychat-form input,
.mychat-form textarea{
  width:100%;
  border:1px solid var(--mychat-border);
  border-radius:14px;
  padding:11px 12px;
  margin-bottom:10px;
  outline:none;
  background:#fff;
  color:var(--mychat-accent);
}
.mychat-form textarea{ resize:vertical; }

.mychat-row2{
  display:flex;
  gap:10px;
}
.mychat-row2 input:first-child{
  width:110px;
}

.mychat-btn{
  width:100%;
  border:none;
  border-radius:14px;
  padding:12px 12px;
  font-weight:1000;
  background:var(--mychat-primary);
  color:#fff;
  cursor:pointer;
}

#mychatMsgs{
  flex:1;
  padding:12px;
  overflow:auto;
  background:var(--mychat-soft);
}

.mychat-msg{
  display:flex;
  margin:10px 0;
}
.mychat-msg.visitor{ justify-content:flex-start; }
.mychat-msg.agent{ justify-content:flex-end; }

.mychat-bubble{
  max-width:78%;
  border-radius:14px;
  padding:10px 12px;
  border:1px solid var(--mychat-border);
  background:#fff;
  color: #000000;
  line-height:1.6;
  word-break:break-word;
}
.mychat-msg.agent .mychat-bubble{
  background:var(--mychat-accent);
  border-color:var(--mychat-accent);
  color:#000000;
}


.mychat-typing{
  font-size:12px;
  font-weight:1000;
  padding:6px 12px;
  color:var(--mychat-accent);
  opacity:.7;
  min-height:18px;
}

#mychatSend{
  display:flex;
  gap:8px;
  padding:10px;
  border-top:1px solid var(--mychat-border);
  background:#fff;
}
#mychatSend input{
  flex:1;
  border:1px solid var(--mychat-border);
  border-radius:14px;
  padding:10px 12px;
}
#mychatSend button{
  border:none;
  border-radius:14px;
  padding:10px 14px;
  background:var(--mychat-primary);
  color:#fff;
  font-weight:1000;
  cursor:pointer;
}

/* ✅ RTL/LTR support */
html[dir="rtl"] #mychatMsgs,
html[dir="rtl"] #mychatSend input,
html[dir="rtl"] .mychat-form input,
html[dir="rtl"] .mychat-form textarea{
  text-align:right;
}

.mychat-bubble a{
  color:#a72525 !important;
  text-decoration: underline;
  font-weight: 800;
}

