/* /help — FAQ accordion and the Ruby chat panel.
   Tokens (--ink, --bg, --card, --blue, --lime, --mono) come from the site
   stylesheet; nothing here defines a colour of its own. */

/* ── FAQ ─────────────────────────────────────────────────────────────── */
.hlp-faq { display: grid; gap: 12px; }

.hlp-q {
  border: 3px solid var(--ink);
  background: var(--card);
  box-shadow: 5px 5px 0 var(--ink);
}
.hlp-q > summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 18px;
  font-weight: 700;
  font-size: 17px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}
.hlp-q > summary::-webkit-details-marker { display: none; }
.hlp-q > summary::after {
  content: "+";
  font-family: var(--mono);
  font-size: 22px;
  line-height: 1;
  color: var(--blue);
}
.hlp-q[open] > summary::after { content: "\2013"; }
.hlp-q > summary:hover { background: var(--lime); }
.hlp-a { padding: 0 18px 18px; max-width: 62ch; line-height: 1.6; }
.hlp-a a { color: var(--blue); border-bottom: 2px solid var(--blue); }

/* ── chat panel ──────────────────────────────────────────────────────── */
.hlp-chat {
  border: 3px solid var(--ink);
  background: var(--card);
  box-shadow: 6px 6px 0 var(--ink);
  padding: 16px;
  margin-top: 14px;
  max-width: 760px;
}

.hlp-chat__log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* Tall enough to hold a real answer, capped so the page never jumps. */
  min-height: 170px;
  max-height: 46vh;
  overflow-y: auto;
  padding-right: 4px;
}

.hlp-msg { max-width: 88%; }
.hlp-msg p {
  margin: 0;
  padding: 10px 13px;
  line-height: 1.55;
  border: 2px solid var(--ink);
  white-space: pre-wrap;      /* the model's own line breaks, kept */
  overflow-wrap: anywhere;
}
.hlp-msg--bot { align-self: flex-start; }
.hlp-msg--bot p { background: #fff; }
.hlp-msg--me { align-self: flex-end; }
.hlp-msg--me p { background: var(--blue); color: #fff; border-color: var(--ink); }
.hlp-msg--err p { background: #f7ead9; }
.hlp-link { color: var(--blue); border-bottom: 2px solid currentColor; }
.hlp-msg--me .hlp-link { color: #fff; }

/* Three dots while the first token is still in flight. */
.hlp-msg p.is-typing::after {
  content: "•••";
  letter-spacing: 3px;
  animation: hlp-pulse 1.1s ease-in-out infinite;
}
@keyframes hlp-pulse { 0%, 100% { opacity: .25 } 50% { opacity: 1 } }
@media (prefers-reduced-motion: reduce) {
  .hlp-msg p.is-typing::after { animation: none; opacity: .6; }
}

/* ── suggestions ─────────────────────────────────────────────────────── */
.hlp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.hlp-chip {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .04em;
  padding: 7px 12px;
  border: 2px solid var(--ink);
  background: var(--bg);
  cursor: pointer;
}
.hlp-chip:hover { background: var(--lime); }

/* ── composer ────────────────────────────────────────────────────────── */
.hlp-chat__form { display: flex; gap: 8px; margin-top: 12px; }
.hlp-chat__input {
  flex: 1 1 auto;
  min-width: 0;
  font: inherit;
  padding: 11px 13px;
  border: 2.5px solid var(--ink);
  background: #fff;
}
.hlp-chat__input:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; }
.hlp-chat__send { flex: 0 0 auto; }
.hlp-chat__send[disabled], .hlp-chat__input[disabled] { opacity: .6; cursor: not-allowed; }

.hlp-note {
  font-size: 12.5px;
  line-height: 1.5;
  margin: 12px 0 0;
  opacity: .8;
  max-width: 62ch;
}
.hlp-offline {
  border-left: 5px solid var(--blue);
  background: #e6e5ff;
  padding: 12px 14px;
  max-width: 62ch;
  line-height: 1.55;
}
.hlp-offline code { font-family: var(--mono); font-size: 12.5px; }

.hlp-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

@media (max-width: 560px) {
  .hlp-msg { max-width: 96%; }
  .hlp-chat__form { flex-wrap: wrap; }
  .hlp-chat__send { width: 100%; }
}
