/* Jewar Nirman chat widget – v20261130h */
:root{
  --jn-chat-orange:#F15B26;
  --jn-chat-orange-dark:#d9471a;
  --jn-chat-navy:#0d3d74;
  --jn-chat-text:#3d4552;
  --jn-chat-muted:#6b7380;
  --jn-chat-bg:#fff;
  --jn-chat-panel-w:380px;
}

#jn-chat-root{font-family:"Red Hat Display",sans-serif;color:var(--jn-chat-text);box-sizing:border-box}
#jn-chat-root *,#jn-chat-root *::before,#jn-chat-root *::after{box-sizing:border-box}

/* Launcher sits above the theme back-to-top (40px at bottom:25px, right:0)
   and, on service pages, above the WhatsApp float. */
.jn-chat-launch{
  position:fixed;z-index:10020;
  right:22px;bottom:80px;
  width:58px;height:58px;border:0;border-radius:50%;
  background:var(--jn-chat-orange);color:#fff;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 8px 24px rgba(241,91,38,.4);
  transition:transform .2s, background .2s, bottom .2s;
}
.jn-chat-launch:hover,.jn-chat-launch:focus-visible{background:var(--jn-chat-orange-dark);transform:scale(1.05);outline:none}
.jn-chat-launch svg{width:28px;height:28px;fill:currentColor}
.jn-chat-launch[aria-expanded="true"]{display:none}

body:has(.jn-wa-float) .jn-chat-launch{bottom:160px}

.jn-chat-panel{
  position:fixed;z-index:10030;
  right:22px;bottom:80px;
  width:var(--jn-chat-panel-w);max-width:calc(100vw - 24px);
  height:min(560px, calc(100vh - 110px));
  background:var(--jn-chat-bg);border-radius:16px;
  box-shadow:0 16px 48px rgba(13,61,116,.22);
  display:flex;flex-direction:column;overflow:hidden;
}
.jn-chat-panel[hidden]{display:none !important}
body:has(.jn-wa-float) .jn-chat-panel{bottom:160px}

.jn-chat-head{
  background:var(--jn-chat-navy);color:#fff;
  padding:14px 16px;display:flex;align-items:center;gap:12px;flex-shrink:0;
  position:relative;z-index:2;
}
.jn-chat-head strong{display:block;font-size:16px;font-weight:700;line-height:1.2}
.jn-chat-head span{display:block;font-size:12px;opacity:.85;font-weight:500}
.jn-chat-avatar{
  width:36px;height:36px;border-radius:50%;background:var(--jn-chat-orange);
  display:flex;align-items:center;justify-content:center;flex-shrink:0;font-weight:700;font-size:14px;
}
.jn-chat-close{
  margin-left:auto;background:transparent;border:0;color:#fff;cursor:pointer;
  width:36px;height:36px;border-radius:8px;font-size:22px;line-height:1;
}
.jn-chat-close:hover,.jn-chat-close:focus-visible{background:rgba(255,255,255,.12);outline:none}

.jn-chat-log{
  flex:1 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;
  padding:16px 14px;background:#f7f8fb;
  display:flex;flex-direction:column;gap:10px;
}
.jn-chat-msg{max-width:88%;padding:10px 12px;border-radius:12px;font-size:14px;line-height:1.55;white-space:pre-wrap;word-wrap:break-word}
.jn-chat-msg.bot{background:#fff;color:var(--jn-chat-text);border-top-left-radius:4px;box-shadow:0 1px 3px rgba(0,0,0,.06);align-self:flex-start}
.jn-chat-msg.user{background:var(--jn-chat-orange);color:#fff;border-top-right-radius:4px;align-self:flex-end}
.jn-chat-msg.sys{align-self:center;background:transparent;color:var(--jn-chat-muted);font-size:12px;padding:4px}
.jn-chat-typing{align-self:flex-start;background:#fff;padding:10px 14px;border-radius:12px;box-shadow:0 1px 3px rgba(0,0,0,.06)}
.jn-chat-typing span{display:inline-block;width:7px;height:7px;margin:0 2px;border-radius:50%;background:var(--jn-chat-muted);animation:jn-chat-dot 1s infinite}
.jn-chat-typing span:nth-child(2){animation-delay:.15s}
.jn-chat-typing span:nth-child(3){animation-delay:.3s}
@keyframes jn-chat-dot{0%,80%,100%{opacity:.25}40%{opacity:1}}

/* Compact WhatsApp chip under the relevant message — not a full-width bar */
.jn-chat-wa-chip{
  align-self:flex-start;
  display:inline-flex;align-items:center;gap:6px;
  max-width:88%;
  background:#25D366;color:#fff;text-decoration:none;
  font-weight:600;font-size:13px;line-height:1.2;
  padding:6px 12px;border-radius:999px;
  margin-top:-2px;
}
.jn-chat-wa-chip:hover,.jn-chat-wa-chip:focus-visible{color:#fff;filter:brightness(.95);outline:none}
.jn-chat-wa-chip svg{width:14px;height:14px;fill:currentColor;flex-shrink:0}

.jn-chat-form{display:flex;gap:8px;padding:10px 12px 12px;border-top:1px solid #e8eaef;background:#fff;flex-shrink:0;position:relative;z-index:2}
.jn-chat-form input[type="text"]{
  flex:1;border:1px solid #d8dce3;border-radius:8px;padding:10px 12px;
  font-family:inherit;font-size:16px;color:var(--jn-chat-text);
}
.jn-chat-form input[type="text"]:focus{outline:2px solid var(--jn-chat-orange);border-color:transparent}
.jn-chat-form button[type="submit"]{
  background:var(--jn-chat-orange);color:#fff;border:0;border-radius:8px;
  padding:0 16px;font-family:inherit;font-weight:700;font-size:14px;cursor:pointer;
}
.jn-chat-form button[type="submit"]:disabled{opacity:.6;cursor:wait}
.jn-chat-form button[type="submit"]:hover:not(:disabled){background:var(--jn-chat-orange-dark)}

/* Mobile: full-screen sheet. Height is 100dvh (100vh fallback);
   JS further fits the panel to visualViewport when the keyboard is open. */
@media (max-width: 600px){
  .jn-chat-launch{right:16px;bottom:80px;width:54px;height:54px}
  body:has(.jn-wa-float) .jn-chat-launch{right:16px;bottom:86px}

  .jn-chat-panel,
  body:has(.jn-wa-float) .jn-chat-panel{
    top:0;left:0;right:0;bottom:auto;
    width:100%;max-width:none;
    height:100vh;height:100dvh;
    border-radius:0;
    box-shadow:none;
  }
  .jn-chat-head{
    padding-top:calc(12px + env(safe-area-inset-top, 0px));
    padding-left:calc(16px + env(safe-area-inset-left, 0px));
    padding-right:calc(16px + env(safe-area-inset-right, 0px));
  }
  .jn-chat-log{
    padding-left:calc(14px + env(safe-area-inset-left, 0px));
    padding-right:calc(14px + env(safe-area-inset-right, 0px));
  }
  .jn-chat-form{
    padding-left:calc(12px + env(safe-area-inset-left, 0px));
    padding-right:calc(12px + env(safe-area-inset-right, 0px));
    padding-bottom:calc(10px + env(safe-area-inset-bottom, 0px));
  }
}
