/* ═══════════════════════════════════════════════════════════
   JSC CHATBOT — Jaya Sinha brand
   Emerald #0F4C3A · Rose Gold #B76E79 · Ivory #FAF7F2 · Charcoal #1C1C1E
   Fonts assumed already loaded sitewide: Cormorant Garamond + DM Sans
   ═══════════════════════════════════════════════════════════ */

#jsc-chat, #jsc-chat *, #jsc-chat *::before, #jsc-chat *::after { box-sizing: border-box; }
#jsc-chat {
  --jc-emerald: #0F4C3A;
  --jc-emerald-dark: #0A3528;
  --jc-emerald-deep: #06281E;
  --jc-rose: #B76E79;
  --jc-rose-light: #D4A5A5;
  --jc-ivory: #FAF7F2;
  --jc-ivory-fill: #F5F0E8;
  --jc-charcoal: #1C1C1E;
  --jc-border: #E8E0D4;
  position: fixed; right: 24px; bottom: 24px; z-index: 999999;
  font-family: 'DM Sans', -apple-system, sans-serif;
}

/* Greeting pill */
#jsc-chat-pill {
  position: absolute; right: 76px; bottom: 6px;
  background: var(--jc-charcoal); color: var(--jc-ivory);
  padding: 14px 18px; max-width: 240px; font-size: 12.5px; line-height: 1.55;
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .35s ease, transform .35s ease;
  cursor: pointer;
}
#jsc-chat-pill.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
#jsc-chat-pill b { display: block; font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 15px; color: var(--jc-rose-light); margin-bottom: 4px; }
#jsc-chat-win.open ~ #jsc-chat-pill, #jsc-chat-btn.open ~ #jsc-chat-pill { display: none; }

/* Launcher — hardened against sitewide `button{...!important}` rules
   (jaya-brand.css forces border-radius:0, padding:15px 32px, uppercase
   text, etc. on every native <button>; every button in this widget
   needs its own !important to survive that). */
#jsc-chat-btn {
  width: 60px !important; height: 60px !important; border-radius: 50% !important;
  background: var(--jc-emerald) !important; border: none !important; cursor: pointer !important;
  display: flex !important; align-items: center !important; justify-content: center !important; position: relative;
  box-shadow: 0 8px 28px rgba(15,76,58,0.35); padding: 0 !important;
  text-transform: none !important; letter-spacing: normal !important; font-size: inherit !important;
  transition: transform .2s ease, background .2s ease;
}
#jsc-chat-btn:hover { transform: translateY(-2px); background: var(--jc-emerald-dark) !important; }
.jsc-chat-mono { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 19px; color: var(--jc-rose-light); letter-spacing: .02em; }
.jsc-chat-close-x { display: none; color: var(--jc-ivory); font-size: 18px; }
#jsc-chat-btn.open .jsc-chat-mono { display: none; }
#jsc-chat-btn.open .jsc-chat-close-x { display: block; }
.jsc-chat-badge {
  position: absolute; top: -4px; right: -4px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--jc-rose); color: var(--jc-ivory); font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* Window */
#jsc-chat-win {
  position: absolute; right: 0; bottom: 76px; width: 360px; max-width: calc(100vw - 32px);
  height: 520px; max-height: 72vh; background: var(--jc-ivory);
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 24px 64px rgba(6,40,30,0.28);
  opacity: 0; transform: translateY(16px) scale(.98); pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
#jsc-chat-win.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.jsc-chat-hdr {
  background: linear-gradient(148deg, var(--jc-emerald-deep), var(--jc-emerald));
  padding: 16px 18px; display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
.jsc-chat-av { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; position: relative; border: 1.5px solid rgba(212,165,165,0.4); flex-shrink: 0; }
.jsc-chat-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jsc-chat-av-fallback { display: none; width: 100%; height: 100%; align-items: center; justify-content: center; font-family: 'Cormorant Garamond', serif; font-style: italic; color: var(--jc-rose-light); font-size: 15px; }
.jsc-chat-hdr-txt { flex: 1; min-width: 0; }
.jsc-chat-hdr-name { font-family: 'Cormorant Garamond', serif; font-size: 17px; color: var(--jc-ivory); line-height: 1.2; }
.jsc-chat-hdr-role { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: rgba(212,165,165,0.85); margin-top: 2px; }
.jsc-chat-hdr-close {
  background: none !important; border: none !important; cursor: pointer !important;
  padding: 6px !important; flex-shrink: 0; text-transform: none !important; box-shadow: none !important;
}

.jsc-chat-prog-wrap { height: 2px; background: var(--jc-border); flex-shrink: 0; }
.jsc-chat-prog { height: 100%; background: var(--jc-rose); transition: width .4s ease; }

#jsc-chat-msgs { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.jsc-chat-date { text-align: center; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #9A9A9A; margin-bottom: 6px; }

.jsc-chat-msg { max-width: 84%; padding: 11px 14px; font-size: 13.5px; line-height: 1.6; border-radius: 2px; }
.jsc-chat-msg-bot { background: #fff; border: 1px solid var(--jc-border); color: var(--jc-charcoal); align-self: flex-start; }
.jsc-chat-msg-user { background: var(--jc-emerald); color: var(--jc-ivory); align-self: flex-end; }

.jsc-chat-typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; background: #fff; border: 1px solid var(--jc-border); width: fit-content; }
.jsc-chat-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--jc-rose); animation: jc-bounce 1.1s infinite ease-in-out; }
.jsc-chat-typing span:nth-child(2) { animation-delay: .15s; }
.jsc-chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes jc-bounce { 0%,60%,100%{ transform: translateY(0); opacity:.5; } 30%{ transform: translateY(-4px); opacity:1; } }

.jsc-chat-qr { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.jsc-chat-qr-btn {
  background: #fff !important; border: 1px solid var(--jc-emerald) !important; color: var(--jc-emerald) !important;
  font-family: 'DM Sans', sans-serif !important; font-size: 11.5px !important; font-weight: 600 !important;
  letter-spacing: normal !important; text-transform: none !important;
  padding: 9px 14px !important; cursor: pointer !important; transition: all .2s ease; text-align: left;
  border-radius: 0 !important; box-shadow: none !important;
}
.jsc-chat-qr-btn:hover { background: var(--jc-emerald) !important; color: var(--jc-ivory) !important; }

.jsc-chat-pc-wrap { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.jsc-chat-pc {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--jc-ivory-fill); border: 1px solid var(--jc-border); border-left: 3px solid var(--jc-rose);
  padding: 11px 13px; text-decoration: none; transition: border-color .2s ease;
}
.jsc-chat-pc:hover { border-color: var(--jc-emerald); }
.jsc-chat-pc-title { font-family: 'Cormorant Garamond', serif; font-size: 15px; color: var(--jc-emerald); line-height: 1.3; }
.jsc-chat-pc-price { font-size: 11px; font-weight: 700; color: var(--jc-rose); white-space: nowrap; }

.jsc-chat-lead { display: flex; flex-direction: column; gap: 8px; background: #fff; border: 1px solid var(--jc-border); padding: 14px; margin-top: 2px; }
.jsc-chat-lead-in {
  padding: 10px 12px !important; border: 1px solid var(--jc-border) !important;
  font-family: 'DM Sans', sans-serif !important; font-size: 13px !important; font-weight: 400 !important;
  outline: none !important; border-radius: 0 !important; background: #fff !important; color: var(--jc-charcoal) !important;
}
.jsc-chat-lead-in:focus { border-color: var(--jc-rose) !important; }
.jsc-chat-lead-btn {
  background: var(--jc-emerald) !important; color: var(--jc-ivory) !important; border: none !important;
  padding: 11px !important; font-size: 11px !important; font-weight: 700 !important;
  letter-spacing: .12em !important; text-transform: uppercase !important; cursor: pointer !important;
  border-radius: 0 !important; box-shadow: none !important;
}
.jsc-chat-lead-btn:hover { background: var(--jc-emerald-dark) !important; }
.jsc-chat-lead-btn:disabled { opacity: .6; cursor: not-allowed !important; }
.jsc-chat-lead-err { font-size: 11.5px; color: var(--jc-rose); min-height: 14px; }

.jsc-chat-bar { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--jc-border); background: #fff; flex-shrink: 0; }
.jsc-chat-inp {
  flex: 1; border: 1px solid var(--jc-border) !important; padding: 10px 12px !important;
  font-family: 'DM Sans', sans-serif !important; font-size: 13px !important; font-weight: 400 !important;
  outline: none !important; border-radius: 0 !important; background: #fff !important; color: var(--jc-charcoal) !important;
}
.jsc-chat-inp:focus { border-color: var(--jc-rose) !important; }
.jsc-chat-send {
  width: 40px !important; height: 40px !important; background: var(--jc-emerald) !important; border: none !important;
  cursor: pointer !important; display: flex !important; align-items: center !important; justify-content: center !important;
  flex-shrink: 0; padding: 0 !important; border-radius: 0 !important; box-shadow: none !important;
}
.jsc-chat-send:hover { background: var(--jc-emerald-dark) !important; }

.jsc-chat-foot { text-align: center; font-size: 10px; color: #9A9A9A; padding: 8px 0 10px; flex-shrink: 0; }
.jsc-chat-foot a { color: var(--jc-emerald); text-decoration: none; }

@media (max-width: 420px) {
  #jsc-chat { right: 14px; bottom: 14px; }
  #jsc-chat-win { width: calc(100vw - 28px); right: -6px; }
  #jsc-chat-pill { display: none; }
}
