/* helper chat of the public site (help.js) */
.hc-fab { position: fixed; right: 18px; bottom: 18px; z-index: 250; font: inherit; font-weight: 700; cursor: pointer; background: var(--blue); color: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 11px 18px; box-shadow: var(--hard); }
html[data-contrast="high"] .hc-fab { color: #000; }
.hc-fab:focus-visible, .hc-btn:focus-visible, .hc-link:focus-visible, .hc-form input:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.hc-box { position: fixed; right: 18px; bottom: 18px; z-index: 260; width: min(390px, calc(100vw - 24px)); height: min(580px, calc(100vh - 36px)); display: flex; flex-direction: column; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: var(--r); box-shadow: var(--hard); font-size: .95rem; }
.hc-box[hidden], .hc-fab[hidden] { display: none; }
.hc-box header { display: flex; align-items: center; gap: 6px; padding: 10px 12px; background: var(--navy); color: #fff; border-radius: 4px 4px 0 0; }
.hc-box header b { flex: 1; }
.hc-btn { font: inherit; font-size: .85rem; cursor: pointer; background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); padding: 5px 10px; text-align: left; }
.hc-btn:hover { border-color: var(--blue); }
.hc-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.hc-msg { background: var(--tint); border-radius: var(--r); padding: 9px 11px; max-width: 94%; align-self: flex-start; overflow-wrap: anywhere; }
.hc-msg.me { background: var(--blue); color: #fff; align-self: flex-end; }
html[data-contrast="high"] .hc-msg.me { color: #000; }
.hc-msg.err { border: 1px solid #b3261e; }
.hc-msg p { margin: 0 0 6px; }
.hc-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 9px 11px; margin-top: 6px; }
.hc-card.main { border-color: var(--blue); }
.hc-card p { margin: 4px 0 8px; color: var(--muted); font-size: .85rem; }
.hc-link { display: inline-block; margin-top: 6px; font-weight: 600; color: var(--blue); text-decoration: none; border: 1px solid var(--blue); border-radius: var(--r); padding: 4px 10px; }
.hc-link.hc-primary { background: var(--blue); color: #fff; }
html[data-contrast="high"] .hc-link.hc-primary { color: #000; }
.hc-sug { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; margin-top: 8px; }
.hc-sug small { color: var(--muted); }
.hc-form { display: flex; gap: 8px; padding: 10px 12px 4px; }
.hc-form input { flex: 1; min-width: 0; font: inherit; font-size: max(16px, 1em); padding: 8px 10px; border: 1px solid var(--ink); border-radius: var(--r); background: var(--paper); color: var(--ink); }
.hc-form .hc-primary { background: var(--blue); color: #fff; border-color: var(--ink); font-weight: 600; }
.hc-form .hc-primary:disabled { opacity: .6; cursor: default; }
.hc-hint { margin: 0; padding: 4px 12px 10px; font-size: .75rem; color: var(--muted); }
@media print { .hc-fab, .hc-box { display: none; } }
.hc-sub { margin: 10px 0 4px; font-size: .8rem; color: var(--muted); font-weight: 600; }
.hc-mini { display: flex; flex-direction: column; gap: 1px; padding: 6px 0; border-top: 1px solid var(--line); }
.hc-mlink { color: var(--blue); font-weight: 600; text-decoration: underline; overflow-wrap: anywhere; }
.hc-mini small { color: var(--muted); font-size: .78rem; }
.hc-msg > .hc-btn { margin-top: 6px; }
.hc-box header .hc-ico { display: inline-grid; place-items: center; padding: 5px 7px; }
.hc-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }
.hc-box:focus { outline: none; }
html.menu-open .hc-fab, html.mega-open .hc-fab { display: none; } /* the open site menu is not covered by the button */

/* touch screens: fingers need bigger targets than a mouse */
@media (pointer: coarse) {
  .hc-btn { min-height: 40px; padding: 8px 12px; }
  .hc-box header .hc-ico { min-width: 40px; }
  .hc-link { padding: 9px 14px; }
  .hc-mlink { display: inline-block; padding: 4px 0; }
  .hc-form input { min-height: 44px; }
}

/* phones: the chat takes the whole screen like a messenger; help.js keeps it inside the part left visible by the on-screen keyboard (--hc-top / --hc-h) */
@media (max-width: 640px) {
  .hc-fab { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); padding: 10px 16px; box-shadow: 3px 3px 0 var(--ink); }
  .hc-box { left: 0; right: 0; bottom: auto; top: var(--hc-top, 0); width: 100%; height: 100%; height: var(--hc-h, 100dvh); border: 0; border-radius: 0; box-shadow: none; font-size: 1rem; }
  .hc-box header { padding: calc(8px + env(safe-area-inset-top)) 8px 8px 16px; border-radius: 0; gap: 8px; }
  .hc-box header b { font-size: 1.05rem; }
  .hc-list { padding: 14px 16px; gap: 12px; }
  .hc-msg { max-width: 100%; }
  .hc-msg.me { max-width: 88%; }
  .hc-sug, .hc-sug .hc-btn { align-items: stretch; width: 100%; }
  .hc-form { padding: 10px 12px 6px; border-top: 1px solid var(--line); }
  .hc-hint { padding: 0 12px calc(8px + env(safe-area-inset-bottom)); }
  html.hc-open, html.hc-open body { overflow: hidden; } /* the page behind does not scroll under the finger */
  .foot-copy { padding-bottom: 76px; } /* the last footer line is not hidden under the button */
}
/* the keyboard is up and little room is left: keep the answers, drop the footnote */
@media (max-width: 640px) and (max-height: 480px) { .hc-hint { display: none; } }
