/* =========================================================================
   HemJyotish — Sahayak, the chat helper (helpdesk.js)

   Its own colours, so it looks the same on the landing page and on the
   register page whatever their stylesheets say. The landing page's indigo
   and gold; full screen on a phone.
   ========================================================================= */
.hd {
  --hd-bg: #ffffff;
  --hd-sunken: #f1f2f8;
  --hd-ink: #1c1f33;
  --hd-soft: #555a75;
  --hd-line: #d5d8e6;
  --hd-accent: #2f3886;
  --hd-accent-soft: #e3e5f7;
  --hd-gold: #d9a05f;
  --hd-gold-ink: #1d1409;
  --hd-err: #a3302a;
  --hd-shadow: 0 2px 6px rgba(28, 31, 51, 0.12), 0 18px 48px rgba(28, 31, 51, 0.22);
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  font: 15px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  color: var(--hd-ink);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
@media (prefers-color-scheme: dark) {
  .hd {
    --hd-bg: #1b1d29;
    --hd-sunken: #13141d;
    --hd-ink: #e7e8f1;
    --hd-soft: #a9acc2;
    --hd-line: #303349;
    --hd-accent: #9ba6f5;
    --hd-accent-soft: #262a4a;
    --hd-err: #ff9d94;
    --hd-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 18px 48px rgba(0, 0, 0, 0.55);
  }
}
.hd *,
.hd *::before,
.hd *::after {
  box-sizing: border-box;
}
.hd button {
  font: inherit;
  cursor: pointer;
}
.hd :focus-visible {
  outline: 2px solid var(--hd-gold);
  outline-offset: 2px;
}

/* ---------- the button in the corner ---------- */
.hd-launch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px 12px 14px;
  background: var(--hd-gold);
  color: var(--hd-gold-ink);
  font-weight: 650 !important;
  box-shadow: var(--hd-shadow);
  transition: transform 0.15s ease;
}
.hd-launch:hover {
  transform: translateY(-1px);
}
.hd-launch svg {
  width: 22px;
  height: 22px;
}
.hd.is-open .hd-launch-t {
  display: none;
}
.hd.is-open .hd-launch {
  padding: 12px;
}

.hd-nudge {
  display: flex;
  align-items: flex-start;
  max-width: 280px;
  background: var(--hd-bg);
  border: 1px solid var(--hd-line);
  border-radius: 14px 14px 4px 14px;
  box-shadow: var(--hd-shadow);
  animation: hd-in 0.25s ease;
}
.hd-nudge[hidden] {
  display: none;
}
.hd-nudge-t {
  flex: 1;
  text-align: left;
  background: none;
  border: 0;
  color: var(--hd-ink);
  padding: 12px 4px 12px 14px;
  font-size: 14px;
}
.hd-nudge-x {
  background: none;
  border: 0;
  color: var(--hd-soft);
  font-size: 18px;
  padding: 6px 10px;
}

/* ---------- the panel ---------- */
.hd-panel {
  width: 380px;
  height: min(620px, calc(100vh - 110px));
  display: flex;
  flex-direction: column;
  background: var(--hd-bg);
  border: 1px solid var(--hd-line);
  border-radius: 16px;
  box-shadow: var(--hd-shadow);
  overflow: hidden;
  animation: hd-in 0.2s ease;
}
.hd-panel[hidden] {
  display: none;
}
@keyframes hd-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
.hd-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px 12px 14px;
  background: linear-gradient(135deg, #12153a, #23296b);
  color: #eef0ff;
}
.hd-mark svg {
  width: 34px;
  height: 34px;
  display: block;
}
.hd-head-t {
  flex: 1;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.hd-head-t span {
  font-size: 12px;
  color: #b9bfe8;
}
.hd-icon {
  background: none;
  border: 0;
  color: #eef0ff;
  font-size: 20px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
}
.hd-icon:hover {
  background: rgba(255, 255, 255, 0.1);
}

.hd-log {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--hd-sunken);
}
.hd-msg {
  max-width: 86%;
  padding: 9px 12px;
  border-radius: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.hd-bot {
  align-self: flex-start;
  background: var(--hd-bg);
  border: 1px solid var(--hd-line);
  border-bottom-left-radius: 4px;
}
.hd-me {
  align-self: flex-end;
  background: var(--hd-accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
@media (prefers-color-scheme: dark) {
  .hd-me {
    color: #12153a;
  }
}
.hd-sum {
  align-self: stretch;
  margin: 2px 0;
  padding: 10px 12px;
  background: var(--hd-bg);
  border: 1px solid var(--hd-line);
  border-left: 3px solid var(--hd-gold);
  border-radius: 10px;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 12px;
  font-size: 14px;
}
.hd-sum dt {
  color: var(--hd-soft);
}
.hd-sum dd {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- the answer area ---------- */
.hd-ctl {
  padding: 10px 12px 4px;
  border-top: 1px solid var(--hd-line);
  max-height: 46%;
  overflow-y: auto;
}
.hd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.hd-chip {
  border: 1px solid var(--hd-accent);
  background: var(--hd-bg);
  color: var(--hd-accent);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
  text-align: left;
}
.hd-chip:hover,
.hd-chip[aria-pressed='true'] {
  background: var(--hd-accent-soft);
}
.hd-chip[aria-pressed='true']::before {
  content: '✓ ';
}
.hd-chips-main .hd-chip {
  background: var(--hd-accent);
  color: #fff;
  font-weight: 600;
}
@media (prefers-color-scheme: dark) {
  .hd-chips-main .hd-chip {
    color: #12153a;
  }
}
.hd-chips-faq .hd-chip {
  border-color: var(--hd-line);
  color: var(--hd-ink);
  font-size: 13px;
}
.hd-form {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}
.hd-in {
  flex: 1;
  min-width: 0;
  font: inherit;
  color: var(--hd-ink);
  background: var(--hd-bg);
  border: 1px solid var(--hd-line);
  border-radius: 10px;
  padding: 9px 11px;
  resize: none;
}
.hd-in:focus {
  outline: none;
  border-color: var(--hd-accent);
  box-shadow: 0 0 0 3px var(--hd-accent-soft);
}
.hd-send {
  border: 0;
  border-radius: 10px;
  padding: 9px 14px;
  background: var(--hd-gold);
  color: var(--hd-gold-ink);
  font-weight: 650 !important;
}
.hd-send:disabled {
  opacity: 0.5;
  cursor: default;
}
.hd-send-big {
  padding: 10px 18px;
}
.hd-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  margin: 6px 0;
}
.hd-link {
  background: none;
  border: 0;
  padding: 2px 0;
  color: var(--hd-accent);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.hd-err {
  margin: 4px 0 0;
  min-height: 0;
  color: var(--hd-err);
  font-size: 13px;
}
.hd-err:empty {
  display: none;
}
.hd-small {
  margin: 6px 0 4px;
  font-size: 13px;
  color: var(--hd-soft);
}
.hd-small:empty {
  display: none;
}
.hd-foot {
  margin: 0;
  padding: 6px 12px 9px;
  font-size: 11.5px;
  color: var(--hd-soft);
  text-align: center;
}
/* the honeypot: there for a robot, never seen or reached by a person */
.hd-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

@media (max-width: 520px) {
  .hd {
    right: 12px;
    bottom: 12px;
  }
  .hd.is-open {
    inset: 0;
    gap: 0;
  }
  .hd.is-open .hd-panel {
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: 0;
  }
  .hd.is-open .hd-launch {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hd-panel,
  .hd-nudge {
    animation: none;
  }
  .hd-launch {
    transition: none;
  }
}

/* the place picker's matches */
.hd-places { margin-top: 6px; }
.hd-places small { color: var(--hd-soft); font-size: 12px; }
.hd-ctl > .hd-in { width: 100%; }

/* questions to start from, at the question step */
.hd-chips-ideas .hd-chip {
  border-color: var(--hd-line);
  color: var(--hd-ink);
  font-size: 13px;
  border-radius: 12px;
}
.hd-chips-ideas .hd-chip::before {
  content: '“';
  color: var(--hd-gold);
  font-weight: 700;
}
.hd-ctl:has(.hd-chips-ideas) {
  max-height: 58%;
}
