/* ==========================================================================
   Shekinah Assistant - the site's help widget.
   Self-contained: no third-party script, no cookies, no network calls.
   Remove chat.css + chat.js and the site is unaffected.
   ========================================================================== */

.chat-launcher {
  position: fixed; right: 20px; bottom: 20px; z-index: 200;
  width: 60px; height: 60px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: var(--navy); color: #fff; border: 0;
  box-shadow: 0 6px 20px rgba(19,30,72,.32), 0 2px 6px rgba(19,30,72,.24);
  transition: transform .25s var(--ease), background .25s var(--ease);
}
.chat-launcher:hover { background: var(--navy-deep); transform: translateY(-2px) scale(1.04); }
.chat-launcher[aria-expanded="true"] .chat-ico-open,
.chat-launcher[aria-expanded="false"] .chat-ico-close { display: none; }

/* the small red dot that says "there's help here" on a first visit */
.chat-launcher .ping {
  position: absolute; top: 3px; right: 3px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--red); border: 2px solid var(--ground);
}
.chat-launcher[aria-expanded="true"] .ping,
.chat-launcher.is-seen .ping { display: none; }

.chat-panel {
  position: fixed; right: 20px; bottom: 92px; z-index: 200;
  width: min(384px, calc(100vw - 40px));
  height: min(560px, calc(100vh - 132px));
  height: min(560px, calc(100dvh - 132px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(12px) scale(.98);
  transform-origin: bottom right;
  transition: opacity .22s var(--ease), transform .22s var(--ease), visibility .22s;
}
.chat-panel.is-open { opacity: 1; visibility: visible; transform: none; }

.chat-head {
  display: flex; align-items: center; gap: .7rem;
  padding: .95rem 1rem; background: var(--navy-deep); color: #fff; flex: none;
}
.chat-head .plate {
  width: 38px; height: 38px; border-radius: 50%; background: #fff;
  display: grid; place-items: center; flex: none;
}
.chat-head .plate img { width: 24px; height: 25px; object-fit: contain; }
.chat-head .t { font-family: var(--display); font-weight: 600; font-size: 1rem; line-height: 1.2; }
.chat-head .s { font-size: .74rem; color: rgba(255,255,255,.72); }
.chat-close {
  margin-left: auto; width: 34px; height: 34px; flex: none;
  display: grid; place-items: center; cursor: pointer;
  background: rgba(255,255,255,.12); border: 0; border-radius: 50%; color: #fff;
  transition: background .2s var(--ease);
}
.chat-close:hover { background: rgba(255,255,255,.24); }

.chat-log {
  flex: 1; overflow-y: auto; padding: 1.1rem 1rem .5rem;
  background: var(--ground); display: flex; flex-direction: column; gap: .7rem;
  overscroll-behavior: contain;
}
.chat-msg { max-width: 86%; font-size: .93rem; line-height: 1.55; }
.chat-msg p { margin: 0 0 .6rem; }
.chat-msg p:last-child { margin: 0; }
.chat-msg a { color: var(--red-ink); font-weight: 500; }
.chat-msg.bot {
  align-self: flex-start; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-soft); border-radius: 12px 12px 12px 3px;
  padding: .75rem .9rem;
}
.chat-msg.me {
  align-self: flex-end; background: var(--navy); color: #fff;
  border-radius: 12px 12px 3px 12px; padding: .75rem .9rem;
}
.chat-msg.me a { color: #fff; }

/* typing indicator */
.chat-typing { align-self: flex-start; display: flex; gap: 4px; padding: .85rem .9rem;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 12px 12px 12px 3px; }
.chat-typing i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--muted);
  animation: chatdot 1.2s infinite ease-in-out;
}
.chat-typing i:nth-child(2) { animation-delay: .15s; }
.chat-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes chatdot { 0%,60%,100% { opacity: .28; transform: translateY(0) } 30% { opacity: 1; transform: translateY(-3px) } }

.chat-chips { display: flex; flex-wrap: wrap; gap: .4rem; padding: .35rem 1rem .85rem; background: var(--ground); flex: none; }
.chat-chip {
  padding: .45rem .8rem; border-radius: 100px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line);
  font-size: .82rem; font-weight: 500; color: var(--navy);
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}
.chat-chip:hover { background: var(--navy); border-color: var(--navy); color: #fff; }

.chat-form { display: flex; gap: .5rem; padding: .75rem; border-top: 1px solid var(--line); background: var(--surface); flex: none; }
.chat-form input {
  /* 16px minimum: anything smaller makes iOS Safari zoom the whole page
     when the field is tapped, and it does not zoom back out */
  flex: 1; min-width: 0; padding: .6rem .85rem; font-size: 16px;
  background: var(--ground); border: 1px solid var(--line); border-radius: 100px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.chat-form input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(37,57,131,.13); }
.chat-send {
  width: 42px; height: 42px; flex: none; border-radius: 50%; cursor: pointer;
  background: var(--red-ink); color: #fff; border: 0;
  display: grid; place-items: center;
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.chat-send:hover { background: var(--red-deep); transform: scale(1.05); }
.chat-send:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; transform: none; }

.chat-foot { padding: 0 1rem .7rem; background: var(--surface); flex: none;
  font-size: .72rem; color: var(--muted); text-align: center; }

/* --- scripture of the day ------------------------------------------------ */
.chat-msg .cv-date {
  font-size: .68rem; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: var(--red-ink); margin: 0 0 .5rem;
}
.chat-msg .cv-verse {
  margin: 0 0 .5rem; padding: 0 0 0 .8rem;
  border-left: 3px solid var(--red);
  font-family: var(--display); font-size: 1rem; line-height: 1.5;
  color: var(--navy-deep);
}
.chat-msg .cv-ref {
  margin: 0; font-size: .78rem; font-weight: 600;
  letter-spacing: .06em; color: var(--muted);
}

/* --- prayer request form -------------------------------------------------- */
.chat-prayer { max-width: 100%; width: 100%; }
.cp-field { margin-bottom: .6rem; }
.cp-field label {
  display: block; font-size: .74rem; font-weight: 700; letter-spacing: .04em;
  color: var(--navy-deep); margin-bottom: .25rem;
}
.cp-field label span { font-weight: 400; color: var(--muted); letter-spacing: 0; }
.cp-field input, .cp-field textarea {
  width: 100%; padding: .5rem .6rem; font-size: 16px; font-family: inherit;
  background: var(--ground); border: 1px solid var(--line); border-radius: 7px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.cp-field textarea { resize: vertical; min-height: 68px; }
.cp-field input:focus, .cp-field textarea:focus {
  outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(37,57,131,.13);
}
.cp-go {
  width: 100%; margin-top: .35rem; padding: .6rem 1rem; cursor: pointer;
  background: var(--red-ink); color: #fff; border: 0; border-radius: 7px;
  font-size: .88rem; font-weight: 600;
  transition: background .2s var(--ease);
}
.cp-go:hover { background: var(--red-deep); }
.cp-note { margin: .6rem 0 0; font-size: .74rem; line-height: 1.45; color: var(--muted); }
.cp-warn { color: var(--red-deep); font-weight: 600; }
.cp-mail {
  display: inline-block; margin-top: .2rem; padding: .55rem 1rem;
  background: var(--navy); color: #fff !important; border-radius: 7px;
  font-size: .88rem; font-weight: 600; text-decoration: none;
  transition: background .2s var(--ease);
}
.cp-mail:hover { background: var(--navy-deep); color: #fff !important; }

@media (max-width: 620px) {
  .chat-launcher { right: 16px; bottom: 16px; width: 54px; height: 54px; }
  .chat-panel {
    right: 0; left: 0; bottom: 0; width: 100%;
    height: min(88vh, 620px);
    height: min(88dvh, 620px);
    border-radius: 16px 16px 0 0;
    transform-origin: bottom center;
  }
  .chat-msg { max-width: 90%; }
}

@media (prefers-reduced-motion: reduce) {
  .chat-launcher:hover { transform: none; }
  .chat-send:hover { transform: none; }
  .chat-typing i { animation: none; opacity: .6; }
}

@media print { .chat-launcher, .chat-panel { display: none !important; } }
