/* ============================================================
   BORG SITES, the Help Center (/help, /help/<slug>) and "Chat with us"

   Two parts, each scoped to its own class prefix so this sheet can sit on
   any page without touching anything else on it:

     .hc-*     the Help Center pages, on the public site's system
               (tokens, base, components, home, pages)
     .hchat*   the chat drawer, SELF CONTAINED: its own colors and type, so
               it looks the same on a public page and on a portal page.
               help-chat.js loads this sheet the first time the drawer opens
               on a page that does not already carry it.

   Measured contrast (WCAG AA):
     Help Center: ink #0B1031 on white 18.54;
     secondary #48527A on white 7.60 and on #F5F6FB 7.04; captions #606783
     on white 5.58; the link violet #6634BD on white 7.52; white on the deep
     brand gradient, lightest stop #C93E96, 4.55.
     The drawer: ink #0A0E27 on white 19.00 and on #F5F6FB 17.61;
     secondary #4A5072 on white 7.83 and on #F5F6FB 7.26; links #2668CC on
     white 5.34; white on the deep gradient 4.55; the error #B42318 on
     #FEF3F2 6.05. Non-text: the field border #858BA4 on white 3.37, the
     focus ring #2E7DF6 3.90.
   ============================================================ */

/* ============================================================
   THE HELP CENTER
   ============================================================ */
.hc-hero .section-lead { margin-inline: auto; max-width: 54ch; }
/* a .btn sets its own display, so a hidden one is hidden here on purpose
   (the chat buttons wait for help.js) */
[data-help-chat][hidden], .hc-item[hidden], .hc-cat[hidden] { display: none !important; }
.hc-search { position: relative; max-width: 620px; margin: clamp(1.6rem, 1.2rem + 1.5vw, 2.4rem) auto 0; }
.hc-search__icon { position: absolute; left: 1.15rem; top: 50%; width: 22px; height: 22px; transform: translateY(-50%); color: var(--text-dim); pointer-events: none; }
.hc-search__input {
  width: 100%; height: 62px; padding: 0 1.2rem 0 3.3rem;
  border: 1px solid var(--hairline-strong); border-radius: 18px; background: var(--ink-1);
  color: var(--text); font-size: 1.0625rem; box-shadow: var(--shadow);
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.hc-search__input::placeholder { color: var(--text-faint); opacity: 1; }
.hc-search__input:hover { border-color: rgba(11, 16, 49, .26); }
.hc-search__input:focus-visible { outline: none; border-color: var(--brand-1); box-shadow: 0 0 0 4px rgba(46, 125, 246, .16), var(--shadow); }
.hc-search__input::-webkit-search-cancel-button { cursor: pointer; }
.hc-count { min-height: 1.4em; margin-top: .9rem; color: var(--text-dim); font-size: var(--fs-sm); }

.hc-h2 { font-size: clamp(1.25rem, 1.1rem + .6vw, 1.6rem); font-weight: 800; letter-spacing: -.02em; margin-bottom: 1.1rem; }
.hc-popular { margin-bottom: clamp(2.6rem, 2rem + 2vw, 3.6rem); }
.hc-pop { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.hc-pop__card {
  position: relative; display: flex; flex-direction: column; gap: .35rem; height: 100%;
  padding: 1.35rem 1.4rem 1.2rem; border-radius: var(--radius); background: var(--ink-1);
  border: 1px solid var(--hairline); box-shadow: var(--shadow-sm); color: var(--text);
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease), border-color var(--dur-2) var(--ease);
}
.hc-pop__card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: var(--grad-brand); opacity: 0; transition: opacity var(--dur-2) var(--ease);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.hc-pop__card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.hc-pop__card:hover::before { opacity: .85; }
.hc-pop__cat { font: 700 .72rem/1 var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); }
.hc-pop__title { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em; }
.hc-pop__sum { color: var(--text-dim); font-size: var(--fs-sm); line-height: 1.55; flex: 1; }
.hc-pop__go { display: inline-flex; align-items: center; gap: .35rem; margin-top: .55rem; font: 600 .86rem/1 var(--font-display); color: #6634BD; }
.hc-pop__go svg { transition: transform var(--dur-2) var(--ease); }
.hc-pop__card:hover .hc-pop__go svg { transform: translateX(3px); }

.hc-cats { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); align-items: start; }
.hc-cat { padding: 1.4rem 1.5rem .6rem; border-radius: var(--radius); background: var(--ink-1); border: 1px solid var(--hairline); box-shadow: var(--shadow-sm); }
.hc-cat__title { font-size: 1.15rem; font-weight: 700; letter-spacing: -.015em; margin-bottom: .4rem; }
.hc-list { display: grid; }
.hc-item { padding: .8rem 0; }
.hc-item + .hc-item { border-top: 1px solid var(--hairline-soft); }
.hc-item__link { font-family: var(--font-display); font-weight: 600; color: var(--text); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: color var(--dur-1), text-decoration-color var(--dur-1); }
.hc-item__link:hover { color: #6634BD; text-decoration-color: currentColor; }
.hc-item__sum { margin-top: .2rem; color: var(--text-dim); font-size: var(--fs-sm); line-height: 1.5; }

.hc-empty { padding: 2.4rem 1rem; text-align: center; color: var(--text-dim); }
.hc-empty__title { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--text); }
.hc-empty .btn { margin-top: 1.1rem; }

.hc-still {
  display: flex; align-items: center; flex-wrap: wrap; gap: 1rem 1.4rem; margin-top: clamp(2.6rem, 2rem + 2vw, 3.6rem);
  padding: 1.5rem 1.6rem; border-radius: var(--radius-lg); border: 1px solid var(--hairline);
  background: radial-gradient(90% 160% at 0% 0%, rgba(46, 125, 246, .09), transparent 60%), radial-gradient(80% 160% at 100% 100%, rgba(224, 53, 158, .08), transparent 60%), var(--ink-1);
  box-shadow: var(--shadow-sm);
}
.hc-still__icon { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 14px; background: var(--grad-brand-deep); color: #FFFFFF; box-shadow: 0 10px 24px -12px rgba(123, 63, 228, .6); }
.hc-still__icon svg { width: 22px; height: 22px; }
.hc-still__text { flex: 1 1 18rem; min-width: 0; }
.hc-still__title { font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; }
.hc-still__text p { margin-top: .25rem; color: var(--text-dim); font-size: var(--fs-sm); }
.hc-still__actions { display: flex; flex-wrap: wrap; gap: .6rem; }

/* one article */
.hc-article-wrap { padding-top: clamp(2.5rem, 2rem + 3vw, 4.5rem); }
.hc-crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .55rem; font-size: var(--fs-sm); color: var(--text-dim); }
.hc-crumbs li { display: inline-flex; align-items: center; gap: .55rem; min-width: 0; }
.hc-crumbs li + li::before { content: "/"; color: var(--text-faint); }
.hc-crumbs a { color: var(--text-dim); text-decoration: underline; text-decoration-color: rgba(72, 82, 122, .35); text-underline-offset: 3px; }
.hc-crumbs a:hover { color: var(--text); }
.hc-crumbs [aria-current] { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.hc-article { margin-top: 1.4rem; }
.hc-article__title { font-size: clamp(2rem, 1.5rem + 2.2vw, 3rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.08; }
.hc-article__summary { margin-top: .9rem; font-size: clamp(1.05rem, 1rem + .3vw, 1.2rem); color: var(--text-dim); line-height: 1.6; }
.hc-article__body { margin-top: 1.8rem; padding-top: 1.8rem; border-top: 1px solid var(--hairline); }
.hc-article__body > * + * { margin-top: 1.05rem; }
.hc-article__body p { color: var(--text); line-height: 1.75; font-size: 1.04rem; max-width: 66ch; }
.hc-bullets { display: grid; gap: .7rem; max-width: 66ch; }
.hc-bullets li { position: relative; padding-left: 1.5rem; line-height: 1.7; font-size: 1.04rem; }
.hc-bullets li::before { content: ""; position: absolute; left: .2rem; top: .68em; width: 7px; height: 7px; border-radius: 50%; background: var(--grad-brand); }
.hc-steps { display: grid; gap: .8rem; counter-reset: hcstep; max-width: 66ch; }
.hc-steps li { position: relative; padding-left: 2.6rem; min-height: 1.9rem; line-height: 1.7; font-size: 1.04rem; counter-increment: hcstep; }
.hc-steps li::before {
  content: counter(hcstep); position: absolute; left: 0; top: .05rem; display: grid; place-items: center;
  width: 1.85rem; height: 1.85rem; border-radius: 50%; background: var(--grad-brand-deep); color: #FFFFFF;
  font: 700 .82rem/1 var(--font-display); box-shadow: 0 6px 16px -8px rgba(123, 63, 228, .7);
}
.hc-related { margin-top: clamp(2.4rem, 2rem + 2vw, 3.2rem); }
.hc-related__list { display: grid; gap: .5rem; }
.hc-related__list a {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .95rem 1.15rem;
  border-radius: var(--radius-xs); border: 1px solid var(--hairline); background: var(--ink-1);
  font-family: var(--font-display); font-weight: 600; color: var(--text);
  transition: border-color var(--dur-2) var(--ease), transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.hc-related__list a:hover { border-color: rgba(123, 63, 228, .45); transform: translateX(3px); box-shadow: var(--shadow-sm); }
.hc-related__list svg { flex: none; color: #6634BD; }

@media (max-width: 560px) {
  .hc-search__input { height: 56px; font-size: 1rem; }
  .hc-cat { padding: 1.2rem 1.1rem .4rem; }
  .hc-still { padding: 1.25rem 1.1rem; }
  .hc-still__actions, .hc-still__actions .btn { width: 100%; }
}

/* ============================================================
   "CHAT WITH US": the drawer (a native modal dialog, from the right)
   ============================================================ */
.hchat {
  --hc-ink: #0A0E27; --hc-ink-2: #4A5072; --hc-line: #E3E6F0; --hc-page: #F5F6FB; --hc-surface: #FFFFFF;
  --hc-link: #2668CC; --hc-control: #858BA4; --hc-focus: #2E7DF6; --hc-danger: #B42318; --hc-danger-tint: #FEF3F2;
  --hc-deep: linear-gradient(120deg, #2668CC 0%, #6634BD 42%, #BA2C83 78%, #C93E96 100%);
  position: fixed; inset: 0 0 0 auto; width: min(440px, 100%); height: 100%; max-width: 100%; max-height: 100%;
  margin: 0 0 0 auto; padding: 0; border: 0; overflow: hidden;
  background: var(--hc-surface); color: var(--hc-ink); box-shadow: -24px 0 60px -24px rgba(10, 14, 39, .35);
  font-family: var(--font-body, system-ui, sans-serif); font-size: 15px; line-height: 1.55; text-align: left;
}
.hchat[open] { display: flex; animation: hchat-in .34s cubic-bezier(.16, 1, .3, 1); }
.hchat::backdrop { background: rgba(10, 14, 39, .42); animation: hchat-fade .25s ease; }
html:has(.hchat[open]) { overflow: hidden; }
.hchat *, .hchat *::before, .hchat *::after { box-sizing: border-box; }
.hchat :focus { outline: none; }
.hchat :focus-visible { outline: 2px solid var(--hc-focus); outline-offset: 2px; }
.hchat__panel { display: flex; flex-direction: column; width: 100%; min-height: 0; }

.hchat__head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px 20px; border-bottom: 1px solid var(--hc-line); flex: none; }
.hchat__mark { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--hc-page); border: 1px solid var(--hc-line); }
.hchat__mark img { display: block; width: 26px; height: 26px; }
.hchat__who { flex: 1 1 auto; min-width: 0; }
.hchat__title { margin: 0; font-family: var(--font-display, system-ui, sans-serif); font-size: 17px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; color: var(--hc-ink); }
.hchat__sub { margin: 2px 0 0; font-size: 13px; color: var(--hc-ink-2); }
.hchat__close {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none; padding: 0; margin: 0;
  border: 0; border-radius: 10px; background: transparent; color: var(--hc-ink-2); cursor: pointer;
}
.hchat__close:hover { background: var(--hc-page); color: var(--hc-ink); }
.hchat__close svg { display: block; width: 20px; height: 20px; }

.hchat__log { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px 8px; background: var(--hc-page); display: flex; flex-direction: column; gap: 12px; }
.hchat__msg { max-width: 88%; margin: 0; padding: 10px 14px; border-radius: 16px; font-size: 15px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.hchat__msg.is-bot { align-self: flex-start; background: var(--hc-surface); color: var(--hc-ink); border: 1px solid var(--hc-line); border-bottom-left-radius: 6px; box-shadow: 0 1px 2px rgba(10, 14, 39, .04); }
.hchat__msg.is-user { align-self: flex-end; background: var(--hc-deep); color: #FFFFFF; border-bottom-right-radius: 6px; box-shadow: 0 8px 18px -12px rgba(102, 52, 189, .7); }
.hchat__msg.is-error { align-self: flex-start; background: var(--hc-danger-tint); color: var(--hc-danger); border: 1px solid #F3C7C1; }
.hchat__group { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.hchat__links { display: flex; flex-wrap: wrap; gap: 6px; max-width: 92%; }
.hchat__link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--hc-line); background: var(--hc-surface); color: var(--hc-link);
  font-size: 13px; font-weight: 600; line-height: 1.25; text-decoration: none; transition: border-color .16s ease, background-color .16s ease;
}
.hchat__link:hover { border-color: #B9C6EA; background: #F7F9FF; text-decoration: none; }
.hchat__link svg { display: block; width: 14px; height: 14px; flex: none; }
.hchat__team {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 8px 14px; margin: 0;
  border: 0; border-radius: 10px; background: var(--hc-deep); color: #FFFFFF; cursor: pointer;
  font-family: var(--font-display, system-ui, sans-serif); font-size: 14px; font-weight: 600; line-height: 1.2;
  box-shadow: 0 8px 18px -12px rgba(102, 52, 189, .8); transition: filter .16s ease;
}
.hchat__team:hover { filter: brightness(.93); }
.hchat__team[disabled] { opacity: .6; cursor: progress; }
.hchat__team svg { display: block; width: 16px; height: 16px; }

.hchat__typing { align-self: flex-start; display: inline-flex; gap: 5px; padding: 14px 16px; border-radius: 16px; border-bottom-left-radius: 6px; background: var(--hc-surface); border: 1px solid var(--hc-line); }
.hchat__typing span { width: 7px; height: 7px; border-radius: 50%; background: #9AA0B8; animation: hchat-dot 1.2s ease-in-out infinite; }
.hchat__typing span:nth-child(2) { animation-delay: .15s; }
.hchat__typing span:nth-child(3) { animation-delay: .3s; }

.hchat__foot { flex: none; padding: 12px 14px 14px; border-top: 1px solid var(--hc-line); background: var(--hc-surface); }
.hchat__composer { display: flex; align-items: flex-end; gap: 8px; margin: 0; }
.hchat__input {
  flex: 1 1 auto; min-width: 0; min-height: 46px; max-height: 140px; margin: 0; padding: 11px 14px; resize: none;
  border: 1px solid var(--hc-control); border-radius: 14px; background: var(--hc-surface); color: var(--hc-ink);
  font: inherit; font-size: 15px; line-height: 1.45; overflow-y: auto;
}
.hchat__input::placeholder { color: #646A88; opacity: 1; }
.hchat__input:focus-visible { outline: 2px solid var(--hc-focus); outline-offset: 1px; border-color: var(--hc-focus); }
.hchat__send {
  display: grid; place-items: center; width: 46px; height: 46px; flex: none; margin: 0; padding: 0;
  border: 0; border-radius: 14px; background: var(--hc-deep); color: #FFFFFF; cursor: pointer;
  box-shadow: 0 8px 18px -12px rgba(102, 52, 189, .8); transition: filter .16s ease, transform .16s ease;
}
.hchat__send:hover { filter: brightness(.93); }
.hchat__send:active { transform: translateY(1px); }
.hchat__send[disabled] { opacity: .55; cursor: not-allowed; }
.hchat__send svg { display: block; width: 20px; height: 20px; }
.hchat__fine { margin: 8px 2px 0; font-size: 12px; color: var(--hc-ink-2); }
.hchat__sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@keyframes hchat-in { from { transform: translateX(100%); } to { transform: none; } }
@keyframes hchat-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes hchat-dot { 0%, 80%, 100% { opacity: .35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

@media (max-width: 480px) {
  .hchat { width: 100%; box-shadow: none; }
  .hchat__msg { max-width: 92%; }
}

@media (prefers-reduced-motion: reduce) {
  .hchat[open], .hchat::backdrop { animation: none; }
  .hchat__typing span { animation: none; opacity: .7; }
  .hc-pop__card, .hc-pop__card:hover, .hc-related__list a:hover { transform: none; }
}
