/* The help bot (help.js): a key at the bottom right and a chat panel above it. Built from
   candela.css's tokens, so it follows the room (dark or light) and the face. No colour is
   named here. */
.hb { position: fixed; inset-inline-end: 24px; bottom: 24px; z-index: 1000; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; font-family: var(--face); pointer-events: none; }
.hb > * { pointer-events: auto; }
.hb-open { background: var(--room); color: var(--light); border: 1px solid var(--line); font-family: var(--face); font-stretch: 75%; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; font-size: 15px; min-height: 48px; padding: 0 20px; cursor: pointer; box-shadow: 0 0 30px rgb(var(--glow-rgb) / .18); }
.hb-open:hover, .hb-on .hb-open { border-color: var(--light); }
.hb-panel { width: min(400px, calc(100vw - 48px)); max-height: min(640px, calc(100vh - 120px)); display: flex; flex-direction: column; background: var(--room); color: var(--light); border: 1px solid var(--line); box-shadow: var(--screen-shadow), 0 20px 60px rgb(var(--room-rgb) / .5); }
.hb-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.hb-titles { flex: 1 1 auto; min-width: 0; }
.hb-title { margin: 0; font-stretch: 75%; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: 15px; }
.hb-note { margin: 4px 0 0; font-size: 13px; line-height: 1.4; color: var(--light-70); }
.hb-close { background: none; border: 1px solid transparent; color: var(--light-70); font-family: var(--face); font-size: 24px; line-height: 1; width: 40px; height: 40px; cursor: pointer; flex: none; }
.hb-close:hover { color: var(--light); border-color: var(--line); }
.hb-log { flex: 1 1 auto; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; min-height: 120px; overscroll-behavior: contain; }
.hb-msg { font-size: 15px; line-height: 1.5; max-width: 92%; overflow-wrap: anywhere; }
.hb-bot { align-self: flex-start; color: var(--light-70); }
.hb-bot a { color: var(--light); text-decoration: underline; text-underline-offset: 2px; }
.hb-you { align-self: flex-end; color: var(--light); border: 1px solid var(--line); padding: 6px 12px; }
.hb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hb-chip { background: none; border: 1px solid var(--line); color: var(--light); font-family: var(--face); font-size: 14px; padding: 6px 10px; min-height: 36px; cursor: pointer; text-align: start; }
.hb-chip:hover { border-color: var(--light); }
.hb-ask { display: flex; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--line); }
.hb-input { flex: 1 1 auto; min-width: 0; background: transparent; color: var(--light); border: 1px solid var(--line); font-family: var(--face); font-size: 16px; padding: 10px 12px; min-height: 44px; }
.hb-input:focus { border-color: var(--light); outline: none; }
.hb-input::placeholder { color: var(--light-45); }
.hb-key { background: none; border: 1px solid var(--line); color: var(--light); font-family: var(--face); font-stretch: 75%; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; font-size: 14px; min-height: 44px; padding: 0 14px; cursor: pointer; }
.hb-key:hover { border-color: var(--light); }
.hb-key:disabled { opacity: .45; cursor: default; }
.hb-lit { background: var(--light); color: var(--room); border-color: var(--light); }
.hb-offer { display: block; margin-top: 10px; white-space: normal; text-align: start; padding: 10px 14px; line-height: 1.3; }
.hb-form { display: flex; flex-direction: column; gap: 10px; padding: 12px 16px 16px; border-top: 1px solid var(--line); overflow-y: auto; }
.hb-form-on .hb-log { flex: 0 1 auto; max-height: 112px; min-height: 0; }
.hb-form-on .hb-form { flex: 1 1 auto; min-height: 0; }
.hb-form-title { margin: 0; font-size: 16px; font-weight: 700; }
.hb-field { display: flex; flex-direction: column; gap: 4px; }
.hb-field label { font-size: 13px; color: var(--light-70); }
.hb-message { resize: vertical; min-height: 88px; line-height: 1.4; }
.hb-consent { margin: 0; font-size: 13px; line-height: 1.45; color: var(--light-70); }
.hb-consent a { color: var(--light); text-decoration: underline; }
.hb-error { margin: 0; font-size: 14px; color: var(--alarm); }
.hb-error:empty { display: none; }
.hb-keys { display: flex; flex-wrap: wrap; gap: 8px; }
.hb-trap { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.hb-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hb :focus-visible { outline: 1px solid var(--light); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .hb-panel:not([hidden]) { animation: hb-in .18s ease-out; }
  .hb-open, .hb-chip, .hb-key { transition: border-color .15s; }
}
@keyframes hb-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
  .hb { inset-inline-end: 16px; bottom: 16px; }
  .hb-panel { width: calc(100vw - 32px); max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px); }
}
@media print { .hb { display: none; } }
/* The key floats over the page: leave room under the last line so it never covers it. */
body:has(> .hb) { padding-bottom: 88px; }
@media (max-width: 600px) {
  /* A phone's key is a round "?" in the corner: it covers far less of the page than the
     word did. The word stays in the key for screen readers. */
  .hb-open { min-height: 44px; min-width: 44px; width: 44px; padding: 0; border-radius: 50%; font-size: 0; }
  .hb-open::before { content: "?"; font-size: 22px; line-height: 1; font-weight: 700; }
}
