/*
 * The help centre: the public knowledge base at /kb and the signed-in one at /portal/help.
 *
 * Layout only. The guide components inside an article are kb-guide.css, which the agent
 * workspace loads as well.
 *
 * Two hosts, one set of components. The portal (.hc-page) is light-only and keeps the palette
 * below. The public site draws the same components inside the shared layout (.ps-page), which
 * themes itself light or dark -- so there the --hc- tokens are answered by the --ps- ones rather
 * than by a second, fixed palette. That bridge is the block after this one: it is why an article
 * at /article/... goes dark with the rest of the site and the same markup at /portal/help does
 * not, without either page owning a copy of these rules.
 */
.hc-page {
  --hc-ink: #1d2128;
  --hc-text: #3a414c;
  --hc-muted: #697180;
  --hc-line: #e4e8ef;
  --hc-paper: #ffffff;
  --hc-wash: #f5f7fb;
  --hc-orange: #ff751a;
  --hc-orange-deep: #e5590c;
  --hc-gradient: linear-gradient(120deg, #ff8a1c 0%, #ff6a1f 45%, #f9483a 100%);
  min-height: 100vh;
  color: var(--hc-text);
  background: var(--hc-wash);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}
/* The public site's palette, answering the same tokens. Both themes come from public-site.css. */
.ps-page {
  --hc-ink: var(--ps-ink);
  --hc-text: var(--ps-text);
  --hc-muted: var(--ps-muted);
  --hc-line: var(--ps-line);
  --hc-paper: var(--ps-paper);
  --hc-wash: var(--ps-wash);
  --hc-orange: var(--ps-orange);
  --hc-orange-deep: var(--ps-orange-deep);
  --hc-gradient: linear-gradient(135deg, var(--ps-coral) 0%, var(--ps-orange) 100%);
}
/* The handful of surfaces these components paint by hand rather than from a token. */
.ps-page .hc-folder-articles li { border-top-color: var(--ps-line-soft); }
.ps-page .hc-folder-card:hover,
.ps-page .hc-result:hover { border-color: var(--ps-orange); }
.ps-page .hc-folder-icon,
.ps-page .hc-pill { color: var(--ps-orange-deep); background: var(--ps-orange-wash); }
.ps-page .hc-link svg { stroke: var(--ps-muted); }
.ps-page .hc-result small { color: var(--ps-muted); }
.ps-page .hc-search input::placeholder { color: var(--ps-muted); }
.ps-page .hc-empty { border-color: var(--ps-line); }
.ps-page .hc-button:hover { border-color: var(--ps-orange); background: var(--ps-orange-wash); }
.ps-page .hc-button.is-chosen { border-color: var(--ps-orange); color: var(--ps-orange-deep); background: var(--ps-orange-wash); }
.ps-page .hc-button.is-primary { border-color: var(--ps-orange); color: #fff; background: var(--ps-orange); }
.ps-page .hc-button.is-primary:hover { background: #ff5f07; }
.ps-page .hc-prose pre,
.ps-page .hc-prose code { background: var(--ps-wash); }
.ps-page .hc-prose blockquote { border-left-color: var(--ps-orange); background: var(--ps-orange-wash); }
.ps-page .hc-prose table:not(.kb-table) th { background: var(--ps-dark-band); }
.ps-page .hc-crumbs span[aria-hidden] { color: var(--ps-muted); }
/* The shared layout owns the page's background and the header above it; here the knowledge base
   is simply a block in <main>, with the footer's air beneath it. */
.ps-page #kbRoot { display: block; padding: 0 0 64px; }
/* Every public view of the knowledge base ends with the shared "Still stuck?" band, and that band
   already carries the gap to the footer. The root's own padding was a second one underneath it,
   so an article finished with 120px of nothing. Where the band is last, the band answers for it. */
.ps-page #kbRoot:has(> .ps-wrap > .ps-cta:last-child),
.ps-page #kbRoot:has(> .ps-cta:last-child) { padding-bottom: 0; }
.ps-page .hc-crumbs { margin-top: 22px; }

.hc-page .portal-shell { max-width: none; margin: 0; padding: 0 0 72px; }
.hc-wrap { width: min(1140px, calc(100% - 40px)); margin: 0 auto; }
.hc-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---- Hero and search ---- */
.hc-hero { position: relative; overflow: hidden; color: #fff; background: var(--hc-gradient); }
.hc-hero::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -160px;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  pointer-events: none;
}
.hc-hero-inner { position: relative; z-index: 1; padding: 54px 0 58px; }
.hc-hero.is-compact .hc-hero-inner { padding: 30px 0 32px; }
.hc-eyebrow { margin: 0 0 10px; font-size: 12px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; opacity: .92; }
.hc-hero h1 { margin: 0 0 8px; font-size: clamp(30px, 4.4vw, 44px); font-weight: 800; letter-spacing: -.025em; line-height: 1.1; }
.hc-hero.is-compact h1 { font-size: clamp(24px, 3vw, 30px); }
.hc-hero-lead { max-width: 560px; margin: 0 0 24px; font-size: 17px; opacity: .95; }
.hc-search {
  width: min(640px, 100%);
  height: 58px;
  padding: 0 8px 0 20px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(120, 30, 0, .22);
}
.hc-hero.is-compact .hc-search { height: 50px; box-shadow: 0 10px 26px rgba(120, 30, 0, .18); }
.hc-search svg { width: 21px; height: 21px; flex: none; fill: none; stroke: var(--hc-muted); stroke-width: 2; stroke-linecap: round; }
.hc-search input { min-width: 0; height: 100%; flex: 1; border: 0; outline: 0; color: var(--hc-ink); background: transparent; font: inherit; font-size: 16.5px; }
.hc-search input::placeholder { color: #8b929e; }
.hc-search:focus-within { box-shadow: 0 0 0 3px rgba(255, 255, 255, .55), 0 18px 40px rgba(120, 30, 0, .22); }
.hc-topics { margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hc-topics button {
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
}
.hc-topics button:hover { background: rgba(255, 255, 255, .24); }

/* ---- Home: categories and folders ---- */
.hc-category { margin: 44px 0 0; }
.hc-category-head { margin: 0 0 16px; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.hc-category-head h2 { margin: 0; color: var(--hc-ink); font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.hc-category-head p { margin: 4px 0 0; color: var(--hc-muted); font-size: 14.5px; }
.hc-count { color: var(--hc-muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.hc-folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.hc-folder-card {
  padding: 22px 22px 18px;
  border: 1px solid var(--hc-line);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  background: var(--hc-paper);
  box-shadow: 0 6px 20px rgba(30, 38, 52, .045);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.hc-folder-card:hover { border-color: #ffc9a3; box-shadow: 0 14px 34px rgba(30, 38, 52, .09); transform: translateY(-2px); }
.hc-folder-icon {
  width: 44px;
  height: 44px;
  margin: 0 0 14px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: var(--hc-orange-deep);
  background: #fff1e6;
}
.hc-folder-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hc-folder-card h3 { margin: 0 0 4px; font-size: 17px; font-weight: 750; }
.hc-folder-card h3 button { padding: 0; border: 0; color: var(--hc-ink); background: none; cursor: pointer; font: inherit; text-align: left; }
.hc-folder-card h3 button:hover { color: var(--hc-orange-deep); }
.hc-folder-card > p { margin: 0 0 12px; color: var(--hc-muted); font-size: 14px; line-height: 1.5; }
.hc-folder-articles { margin: 6px 0 0; padding: 0; list-style: none; flex: 1; }
.hc-folder-articles li { border-top: 1px solid #eef1f5; }
.hc-link {
  width: 100%;
  padding: 9px 0;
  border: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--hc-text);
  background: none;
  cursor: pointer;
  font: inherit;
  font-size: 14.5px;
  text-align: left;
  text-decoration: none;
}
.hc-link:hover { color: var(--hc-orange-deep); }
.hc-link svg { width: 15px; height: 15px; flex: none; fill: none; stroke: #a3a9b4; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.hc-link:hover svg { stroke: var(--hc-orange); }
.hc-view-all {
  margin: 10px 0 0;
  padding: 0;
  border: 0;
  align-self: flex-start;
  color: var(--hc-orange-deep);
  background: none;
  cursor: pointer;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
}
.hc-view-all:hover { text-decoration: underline; }
.hc-pill {
  padding: 2px 8px;
  border-radius: 999px;
  color: #b4510c;
  background: #fff1e6;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  flex: none;
}

/* ---- Lists: a folder, or search results ---- */
.hc-crumbs { margin: 26px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--hc-muted); font-size: 13.5px; }
.hc-crumbs a, .hc-crumbs button { padding: 0; border: 0; color: var(--hc-muted); background: none; cursor: pointer; font: inherit; text-decoration: none; }
.hc-crumbs a:hover, .hc-crumbs button:hover { color: var(--hc-orange-deep); text-decoration: underline; }
.hc-crumbs span[aria-hidden] { color: #b9bec7; }
.hc-list-head { margin: 14px 0 20px; }
.hc-list-head h1 { margin: 0 0 6px; color: var(--hc-ink); font-size: clamp(26px, 3vw, 32px); font-weight: 800; letter-spacing: -.02em; }
.hc-list-head p { margin: 0; color: var(--hc-muted); font-size: 15.5px; }
.hc-results { display: grid; gap: 12px; }
.hc-result {
  width: 100%;
  padding: 20px 22px;
  border: 1px solid var(--hc-line);
  border-radius: 16px;
  display: block;
  color: inherit;
  background: var(--hc-paper);
  cursor: pointer;
  font: inherit;
  text-align: left;
  text-decoration: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.hc-result:hover { border-color: #ffc9a3; box-shadow: 0 12px 28px rgba(30, 38, 52, .07); }
.hc-result-title { margin: 0 0 6px; display: flex; align-items: center; gap: 10px; color: var(--hc-ink); font-size: 17.5px; font-weight: 750; }
.hc-result p { margin: 0; color: var(--hc-muted); font-size: 14.5px; line-height: 1.55; }
.hc-result small { display: block; margin-top: 8px; color: #8b929e; font-size: 12.5px; }
.hc-empty {
  margin: 30px 0;
  padding: 34px 24px;
  border: 1px dashed #d6dbe4;
  border-radius: 18px;
  color: var(--hc-muted);
  background: var(--hc-paper);
  font-size: 15.5px;
  text-align: center;
}
.hc-empty a, .hc-empty button { margin-top: 12px; }

/* ---- Article ---- */
.hc-article-layout { margin: 22px 0 0; display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 44px; align-items: start; }
.hc-article { min-width: 0; }
.hc-article-head { margin: 0 0 28px; }
.hc-article-head h1 { margin: 0 0 10px; color: var(--hc-ink); font-size: clamp(30px, 4vw, 40px); font-weight: 800; letter-spacing: -.025em; line-height: 1.12; }
.hc-article-summary { margin: 0 0 14px; color: var(--hc-text); font-size: 18.5px; line-height: 1.6; }
.hc-article-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--hc-muted); font-size: 13.5px; }
/* A guide's header is its cover: the orange banner of the PDF guides. */
.hc-article-head.is-guide {
  position: relative;
  overflow: hidden;
  padding: 40px 40px 36px;
  border-radius: 22px;
  color: #fff;
  background: var(--hc-gradient);
}
.hc-article-head.is-guide::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -190px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
}
.hc-article-head.is-guide > * { position: relative; z-index: 1; }
.hc-article-head.is-guide h1 { color: #fff; }
.hc-article-head.is-guide .hc-article-summary { color: #fff; opacity: .96; max-width: 640px; }
.hc-article-head.is-guide .hc-article-meta { color: #fff; opacity: .85; }
/*
 * A guide that carries its own cover band draws its title there, so the page does not draw one
 * too. Matthew asked for the band to stay: it is the one thing on the page that says "this is a
 * Triniteq guide", and the heading above it was the same words a second time.
 *
 * Keyed on the body having a cover, not on the article record's is-guide flag. That flag and the
 * body can disagree -- an article whose flag says "not a guide" can still hold guide HTML, which
 * is how the title came to show twice on helpdesk.triniteq.com. Keyed on #kbRoot too, because
 * this is about a page that has a heading of its own: the wizard previews into .kbw-preview-body
 * and has none.
 *
 * What stays above the band is what the band does not say: the breadcrumb, the section eyebrow
 * and the meta line. What goes is the heading and the summary, which the cover and its subtitle
 * carry. Where the flag IS set the head is itself an orange banner, so it is stripped back to a
 * plain block first -- two gradients, one under the other, was never the ask.
 */
#kbRoot .hc-article:has(.kb-guide-cover) .hc-article-head.is-guide {
  padding: 0;
  border-radius: 0;
  overflow: visible;
  color: inherit;
  background: none;
}
#kbRoot .hc-article:has(.kb-guide-cover) .hc-article-head.is-guide::after { content: none; }
#kbRoot .hc-article:has(.kb-guide-cover) .hc-article-head.is-guide .hc-article-meta {
  color: var(--hc-muted);
  opacity: 1;
}
#kbRoot .hc-article:has(.kb-guide-cover) .hc-article-head h1,
#kbRoot .hc-article:has(.kb-guide-cover) .hc-article-head .hc-article-summary { display: none; }

/* With no heading above it, the band is what the eye lands on: it sits up where one was. */
#kbRoot .hc-article:has(.kb-guide-cover) .hc-article-head { margin-bottom: 18px; }
#kbRoot .hc-article .kb-guide-cover { margin-top: 0; }

/* An ordinary article's body: readable prose for whatever the editor or the import wrote. */
.hc-prose { color: var(--hc-text); font-size: 16.5px; line-height: 1.75; overflow-wrap: anywhere; }
.hc-prose > :first-child { margin-top: 0; }
.hc-prose h1, .hc-prose h2 { margin: 38px 0 12px; color: var(--hc-ink); font-size: 24px; font-weight: 800; line-height: 1.25; letter-spacing: -.01em; scroll-margin-top: 96px; }
.hc-prose h3 { margin: 28px 0 8px; color: var(--hc-ink); font-size: 19px; font-weight: 750; line-height: 1.3; scroll-margin-top: 96px; }
.hc-prose h4 { margin: 22px 0 6px; color: var(--hc-ink); font-size: 16.5px; font-weight: 750; }
.hc-prose p { margin: 0 0 16px; }
.hc-prose ul, .hc-prose ol { margin: 0 0 18px; padding-left: 26px; }
.hc-prose li { margin-bottom: 7px; }
.hc-prose a { color: var(--hc-orange-deep); font-weight: 600; }
.hc-prose img { max-width: 100%; height: auto; border: 1px solid var(--hc-line); border-radius: 12px; }
.hc-prose figure { margin: 22px 0; }
.hc-prose figcaption { margin-top: 8px; color: var(--hc-muted); font-size: 13.5px; text-align: center; }
.hc-prose blockquote { margin: 0 0 18px; padding: 12px 18px; border-left: 4px solid #ffb37d; border-radius: 0 10px 10px 0; background: #fff8f2; }
.hc-prose pre { margin: 0 0 18px; padding: 14px 16px; overflow-x: auto; border-radius: 10px; background: #f1f3f7; font-size: 14px; }
.hc-prose code { padding: 1px 5px; border-radius: 4px; background: #f1f3f7; font-size: .9em; }
.hc-prose pre code { padding: 0; background: none; }
.hc-prose table:not(.kb-table) { width: 100%; margin: 0 0 18px; border-collapse: collapse; display: block; overflow-x: auto; font-size: 15px; }
.hc-prose table:not(.kb-table) th, .hc-prose table:not(.kb-table) td { padding: 10px 14px; border: 1px solid var(--hc-line); text-align: left; }
.hc-prose table:not(.kb-table) th { color: #fff; background: #2b2f36; }
.hc-prose hr { margin: 30px 0; border: 0; border-top: 1px solid var(--hc-line); }
.hc-prose .kb-guide { font-size: inherit; }

/* Feedback, next steps, related */
.hc-feedback {
  margin: 40px 0 0;
  padding: 22px 24px;
  border: 1px solid var(--hc-line);
  border-radius: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  background: var(--hc-paper);
}
.hc-feedback b { color: var(--hc-ink); font-size: 16px; }
.hc-feedback-actions { display: flex; gap: 8px; }
.hc-button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--hc-line);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--hc-ink);
  background: var(--hc-paper);
  cursor: pointer;
  font: inherit;
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
}
.hc-button:hover { border-color: #c9ced7; background: #fafbfd; }
.hc-button:disabled { opacity: .55; cursor: default; }
.hc-button.is-chosen { border-color: #ffb37d; color: #b4510c; background: #fff5ec; }
.hc-button.is-primary { border-color: #1d2128; color: #fff; background: #1d2128; }
.hc-button.is-primary:hover { background: #343a45; }
.hc-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
/* A button that is working. The guide's PDF is drawn when it is asked for, which takes a few
   seconds, and the button says so rather than leaving the reader to press it again. */
.hc-button[aria-busy="true"],
.hc-button[aria-disabled="true"] { color: var(--hc-muted); cursor: default; }
.hc-spinner {
  /* The size of the icon it stands in for, so the button does not change width as it starts. */
  box-sizing: border-box;
  width: 17px;
  height: 17px;
  flex: none;
  border: 2px solid var(--hc-line);
  border-top-color: var(--hc-orange);
  border-radius: 50%;
  animation: hc-spin .7s linear infinite;
}
@keyframes hc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  /* Still a mark that something is happening, just not a turning one. */
  .hc-spinner { animation-duration: 2.4s; }
}
.hc-feedback-message { color: var(--hc-muted); font-size: 14px; }
.hc-related { margin: 36px 0 0; }
.hc-related h2 { margin: 0 0 12px; color: var(--hc-ink); font-size: 19px; font-weight: 800; }
.hc-related ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--hc-line); }
.hc-related li { border-bottom: 1px solid var(--hc-line); }
.hc-related .hc-link { padding: 12px 2px; font-size: 15.5px; }

/* Aside: on this page, actions, help */
.hc-aside { position: sticky; top: 24px; display: grid; gap: 16px; }
.hc-aside-card { padding: 18px 20px; border: 1px solid var(--hc-line); border-radius: 16px; background: var(--hc-paper); }
.hc-aside-label { margin: 0 0 10px; color: var(--hc-orange-deep); font-size: 11.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.hc-toc { margin: 0; padding: 0; list-style: none; }
.hc-toc a {
  margin: 0 0 0 -10px;
  padding: 6px 10px;
  border-left: 2px solid transparent;
  display: block;
  color: var(--hc-text);
  font-size: 14px;
  line-height: 1.4;
  text-decoration: none;
}
.hc-toc a:hover { color: var(--hc-orange-deep); }
.hc-toc a.is-current { border-left-color: var(--hc-orange); color: var(--hc-ink); font-weight: 700; }
.hc-actions { display: grid; gap: 8px; }
.hc-actions .hc-button { width: 100%; justify-content: flex-start; }
.hc-aside-card p { margin: 0 0 12px; color: var(--hc-muted); font-size: 14px; line-height: 1.5; }

/* "Still need help?" */
.hc-cta {
  margin: 56px 0 0;
  padding: 34px 36px;
  border-radius: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #fff;
  background: #1d2128;
}
.hc-cta h2 { margin: 0 0 6px; font-size: 22px; font-weight: 800; }
.hc-cta p { margin: 0; color: #c5cad3; font-size: 15.5px; }
.hc-cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hc-cta .hc-button { border-color: transparent; }
.hc-cta .hc-button.is-orange { color: #fff; background: var(--hc-orange-deep); }
.hc-cta .hc-button.is-orange:hover { background: #cc4f0a; }
.hc-cta .hc-button.is-ghost { border-color: rgba(255, 255, 255, .3); color: #fff; background: transparent; }

.hc-loading { margin: 40px 0; color: var(--hc-muted); text-align: center; }

@media (max-width: 960px) {
  .hc-article-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hc-aside { position: static; order: -1; margin: 0 0 22px; }
  .hc-aside .hc-toc-card { display: none; }
  .hc-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hc-aside-help { display: none; }
}
@media (max-width: 640px) {
  .hc-wrap { width: calc(100% - 28px); }
  .hc-hero-inner { padding: 36px 0 38px; }
  .hc-hero-lead { font-size: 15.5px; }
  .hc-search { height: 52px; }
  .hc-folder-grid { grid-template-columns: minmax(0, 1fr); }
  .hc-article-head.is-guide { padding: 28px 22px 26px; border-radius: 16px; }
  .hc-prose { font-size: 16px; }
  .hc-cta { padding: 26px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .hc-folder-card, .hc-result { transition: none; }
  .hc-folder-card:hover { transform: none; }
}

/* Print, and Save as PDF: the article alone, without the site around it. */
@media print {
  .hc-page, .ps-page { background: #fff; }
  .hc-page .portal-header, .ps-header, .ps-footer, .ps-hero, .hc-crumbs, .hc-aside, .hc-feedback, .hc-related, .hc-cta, .hc-no-print { display: none !important; }
  .hc-article-layout { margin: 0; display: block; }
  .hc-wrap { width: 100%; }
  .hc-article.is-guide .hc-article-head { display: none; }
  .hc-article-head { break-after: avoid; }
}
