/* ============================================================================
   LexiCore Help Center — the contextual side panel
   ============================================================================
   Injected on every page by middleware, so this file must assume nothing about
   the page under it: 122 page templates, several generations of layout, and no
   shared CSS reset between them. Every selector is namespaced `lxh-`, every
   value is explicit, and nothing here sets a style on an element the panel does
   not own.

   LAYOUT MODES
   ------------
   Overlay is the DEFAULT and does not move the page at all — no reflow, no
   re-render, no lost scroll position, no reset form. Pinning is opt-in and adds
   padding to <body>, which gives the true two-pane reading posture for people
   who want it while leaving everyone else's page untouched.

   Opening or closing help never navigates, so unsaved work, filters, editor
   state and scheduler view all survive by construction rather than by care.
   ============================================================================ */

:root {
  --lxh-blue: #1e40af;
  --lxh-blue-dark: #1e3a8a;
  --lxh-blue-soft: #eff6ff;
  --lxh-gold: #d97706;
  --lxh-ink: #0f172a;
  --lxh-ink-soft: #334155;
  --lxh-muted: #64748b;
  --lxh-line: #e2e8f0;
  --lxh-line-soft: #f1f5f9;
  --lxh-bg: #ffffff;
  --lxh-bg-soft: #f8fafc;
  --lxh-danger: #b91c1c;
  --lxh-amber-bg: #fffbeb;
  --lxh-amber-line: #fcd34d;
  --lxh-radius: 10px;
  --lxh-w: 420px;
  --lxh-z-panel: 10000;
  --lxh-z-launcher: 9997;
  --lxh-shadow: 0 10px 40px rgba(15, 23, 42, 0.18);
  --lxh-font:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ---------------------------------------------------------------------------
   Launcher
   --------------------------------------------------------------------------- */

#lxh-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: var(--lxh-z-launcher);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--lxh-line);
  border-radius: 22px;
  background: var(--lxh-bg);
  color: var(--lxh-blue);
  font: 600 14px/1 var(--lxh-font);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.14);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

/* The AI Copilot owns bottom-right on most pages. Stack above it rather than
   under it — two round buttons in the same 24px corner is how a product ends up
   with a help button nobody can click. */
#lxh-launcher.lxh-stacked {
  bottom: 104px;
}

#lxh-launcher:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.2);
}

#lxh-launcher:focus-visible {
  outline: 3px solid var(--lxh-blue);
  outline-offset: 2px;
}

#lxh-launcher .lxh-launcher-key {
  color: var(--lxh-muted);
  font-weight: 500;
  font-size: 12px;
  border: 1px solid var(--lxh-line);
  border-radius: 4px;
  padding: 2px 5px;
}

/* ---------------------------------------------------------------------------
   Panel shell
   --------------------------------------------------------------------------- */

#lxh-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--lxh-w);
  max-width: 100vw;
  z-index: var(--lxh-z-panel);
  display: flex;
  flex-direction: column;
  background: var(--lxh-bg);
  border-left: 1px solid var(--lxh-line);
  box-shadow: var(--lxh-shadow);
  font: 400 14px/1.55 var(--lxh-font);
  color: var(--lxh-ink);
  transform: translateX(100%);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  visibility: hidden;
}

#lxh-panel.lxh-open {
  transform: translateX(0);
  visibility: visible;
}

/* Respect a reader who has asked the operating system for less motion. */
@media (prefers-reduced-motion: reduce) {
  #lxh-panel,
  #lxh-launcher {
    transition: none;
  }
}

/* Pinned: the page makes room. Opt-in, remembered, and the only mode that
   touches the host page's box model.

   The padding goes on <html>, NOT on <body>. Padding a body is what a panel
   normally does, and it does not survive contact with this product: measured on
   the deployed billing page, `padding-right: 460px !important` set INLINE on
   body still computed to 0. Padding the root element is unaffected by whatever
   the page's own stylesheet says about body, and it is what actually narrows
   the content (body went 1272px -> 812px). Fixed-position elements are
   positioned against the viewport rather than this padding box, so the panel
   itself does not move — which is why pinning is opt-in: a page with its own
   fixed header will let that header run on underneath. */
html.lxh-pinned {
  padding-right: var(--lxh-w) !important;
  transition: padding-right 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------------------------------------------------------------------------
   Resize handle
   --------------------------------------------------------------------------- */

#lxh-resize {
  position: absolute;
  left: -3px;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: ew-resize;
  background: transparent;
  border: none;
  padding: 0;
}

#lxh-resize:hover,
#lxh-resize:focus-visible {
  background: rgba(30, 64, 175, 0.18);
  outline: none;
}

/* ---------------------------------------------------------------------------
   Header
   --------------------------------------------------------------------------- */

.lxh-head {
  flex: 0 0 auto;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--lxh-line);
  background: var(--lxh-bg);
}

.lxh-head-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lxh-title {
  flex: 1 1 auto;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--lxh-ink);
}

.lxh-iconbtn {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--lxh-muted);
  cursor: pointer;
  font-size: 14px;
}

.lxh-iconbtn:hover {
  background: var(--lxh-line-soft);
  color: var(--lxh-ink);
}

.lxh-iconbtn:focus-visible {
  outline: 2px solid var(--lxh-blue);
  outline-offset: 1px;
}

.lxh-iconbtn[aria-pressed='true'] {
  background: var(--lxh-blue-soft);
  border-color: #bfdbfe;
  color: var(--lxh-blue);
}

/* Search */
.lxh-searchwrap {
  position: relative;
  margin-top: 10px;
}

#lxh-search {
  width: 100%;
  height: 38px;
  padding: 0 32px 0 34px;
  border: 1px solid var(--lxh-line);
  border-radius: 8px;
  background: var(--lxh-bg-soft);
  font: 400 14px/1 var(--lxh-font);
  color: var(--lxh-ink);
  box-sizing: border-box;
}

#lxh-search:focus {
  outline: none;
  border-color: var(--lxh-blue);
  background: var(--lxh-bg);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.12);
}

/* Drawn, not typed: U+2315 is missing from common UI font stacks and fell back
   to a bare circle in Chrome. */
.lxh-searchwrap .lxh-searchicon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  color: var(--lxh-muted);
  pointer-events: none;
  display: block;
}

.lxh-searchwrap .lxh-searchicon svg {
  display: block;
  width: 13px;
  height: 13px;
}

#lxh-search-clear {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--lxh-muted);
  cursor: pointer;
}

/* Breadcrumb of the resolved feature — Practice > Page > Section > Feature */
.lxh-crumb {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--lxh-muted);
  letter-spacing: 0.01em;
}

.lxh-crumb span + span::before {
  content: ' › ';
  color: #cbd5e1;
}

/* ---------------------------------------------------------------------------
   Tabs
   --------------------------------------------------------------------------- */

.lxh-tabs {
  flex: 0 0 auto;
  display: flex;
  gap: 2px;
  padding: 0 10px;
  border-bottom: 1px solid var(--lxh-line);
  background: var(--lxh-bg);
  overflow-x: auto;
}

.lxh-tab {
  flex: 0 0 auto;
  padding: 9px 10px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--lxh-muted);
  font: 600 12.5px/1 var(--lxh-font);
  cursor: pointer;
  white-space: nowrap;
}

.lxh-tab:hover {
  color: var(--lxh-ink);
}

.lxh-tab[aria-selected='true'] {
  color: var(--lxh-blue);
  border-bottom-color: var(--lxh-blue);
}

.lxh-tab:focus-visible {
  outline: 2px solid var(--lxh-blue);
  outline-offset: -2px;
}

/* ---------------------------------------------------------------------------
   Body
   --------------------------------------------------------------------------- */

.lxh-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 16px 28px;
  -webkit-overflow-scrolling: touch;
}

.lxh-pane[hidden] {
  display: none;
}

.lxh-sec {
  margin: 0 0 18px;
}

.lxh-sec-h {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--lxh-muted);
}

/* Result / topic card */
.lxh-card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 11px;
  margin-bottom: 6px;
  border: 1px solid var(--lxh-line);
  border-radius: var(--lxh-radius);
  background: var(--lxh-bg);
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.lxh-card:hover {
  border-color: #bfdbfe;
  background: var(--lxh-blue-soft);
}

.lxh-card:focus-visible {
  outline: 2px solid var(--lxh-blue);
  outline-offset: 1px;
}

/* Both are <span> inside a <button> — a button may not contain block-level
   elements — so they need display:block explicitly. Without it they render on
   one run-together line ("BillingTime, prebills, invoices..."), which is how
   this shipped until it was seen in a real browser. */
.lxh-card-t {
  display: block;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--lxh-ink);
  margin-bottom: 2px;
}

.lxh-card-d {
  display: block;
  font-size: 12.5px;
  color: var(--lxh-muted);
  line-height: 1.45;
}

.lxh-card-meta {
  margin-top: 5px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 10.5px;
  color: var(--lxh-muted);
}

.lxh-pill {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--lxh-line);
  border-radius: 999px;
  background: var(--lxh-bg-soft);
  letter-spacing: 0.02em;
}

.lxh-pill-admin {
  border-color: var(--lxh-amber-line);
  background: var(--lxh-amber-bg);
  color: #92400e;
}

.lxh-card mark {
  background: #fef08a;
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
}

/* Empty and loading states */
.lxh-empty {
  padding: 26px 12px;
  text-align: center;
  color: var(--lxh-muted);
  font-size: 13px;
}

.lxh-empty strong {
  display: block;
  color: var(--lxh-ink-soft);
  font-size: 14px;
  margin-bottom: 4px;
}

.lxh-skel {
  height: 54px;
  margin-bottom: 6px;
  border-radius: var(--lxh-radius);
  background: linear-gradient(90deg, #f1f5f9 25%, #e7edf5 37%, #f1f5f9 63%);
  background-size: 400% 100%;
  animation: lxh-shimmer 1.3s ease infinite;
}

@keyframes lxh-shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lxh-skel {
    animation: none;
  }
}

/* ---------------------------------------------------------------------------
   Article
   --------------------------------------------------------------------------- */

.lxh-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 4px 8px 4px 4px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--lxh-blue);
  font: 600 12.5px/1 var(--lxh-font);
  cursor: pointer;
}

.lxh-back:hover {
  background: var(--lxh-blue-soft);
}

.lxh-art h1 {
  margin: 0 0 4px;
  font-size: 19px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--lxh-ink);
}

.lxh-art .lxh-art-sum {
  margin: 0 0 14px;
  color: var(--lxh-muted);
  font-size: 13px;
}

.lxh-art h2 {
  margin: 20px 0 7px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--lxh-blue);
}

.lxh-art h3 {
  margin: 15px 0 5px;
  font-size: 14px;
  font-weight: 700;
  color: var(--lxh-ink);
}

.lxh-art p {
  margin: 0 0 10px;
  color: var(--lxh-ink-soft);
}

/* list-style is restated because the host page's CSS reset strips markers from
   every list on the page. Numbered procedures rendered with no numbers, which
   for a step-by-step is most of the meaning. */
.lxh-art ul,
.lxh-art ol {
  margin: 0 0 12px;
  padding-left: 22px;
  color: var(--lxh-ink-soft);
}

.lxh-art ol {
  list-style: decimal outside;
}

.lxh-art ul {
  list-style: disc outside;
}

.lxh-art li::marker {
  color: var(--lxh-muted);
}

.lxh-art li {
  margin-bottom: 5px;
}

.lxh-art code {
  background: var(--lxh-line-soft);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
}

.lxh-art strong {
  color: var(--lxh-ink);
}

/* Callouts */
.lxh-note {
  margin: 0 0 12px;
  padding: 9px 12px;
  border-left: 3px solid var(--lxh-blue);
  border-radius: 0 6px 6px 0;
  background: var(--lxh-blue-soft);
  font-size: 13px;
  color: var(--lxh-ink-soft);
}

.lxh-warn {
  margin: 0 0 12px;
  padding: 9px 12px;
  border-left: 3px solid var(--lxh-amber-line);
  border-radius: 0 6px 6px 0;
  background: var(--lxh-amber-bg);
  font-size: 13px;
  color: #78350f;
}

/* Deep link into the application */
.lxh-go {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 2px 6px 8px 0;
  padding: 7px 12px;
  border: 1px solid var(--lxh-line);
  border-radius: 7px;
  background: var(--lxh-bg);
  color: var(--lxh-blue);
  font: 600 12.5px/1 var(--lxh-font);
  text-decoration: none;
  cursor: pointer;
}

.lxh-go:hover {
  border-color: #bfdbfe;
  background: var(--lxh-blue-soft);
}

.lxh-go:focus-visible {
  outline: 2px solid var(--lxh-blue);
  outline-offset: 1px;
}

/* Feedback footer */
.lxh-fb {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--lxh-line);
}

.lxh-fb-q {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--lxh-ink-soft);
  margin-bottom: 8px;
}

.lxh-fb-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.lxh-fb-btn {
  padding: 5px 14px;
  border: 1px solid var(--lxh-line);
  border-radius: 999px;
  background: var(--lxh-bg);
  color: var(--lxh-ink-soft);
  font: 600 12.5px/1.4 var(--lxh-font);
  cursor: pointer;
}

.lxh-fb-btn:hover {
  border-color: #bfdbfe;
  background: var(--lxh-blue-soft);
}

.lxh-fb-btn:focus-visible {
  outline: 2px solid var(--lxh-blue);
  outline-offset: 1px;
}

.lxh-fb-thanks {
  font-size: 12.5px;
  color: #047857;
  font-weight: 600;
}

/* ---------------------------------------------------------------------------
   Ask LexiCore
   --------------------------------------------------------------------------- */

.lxh-ask-log {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.lxh-ask-q {
  align-self: flex-end;
  max-width: 88%;
  padding: 8px 12px;
  border-radius: 12px 12px 3px 12px;
  background: var(--lxh-blue);
  color: #fff;
  font-size: 13px;
}

.lxh-ask-a {
  align-self: stretch;
  padding: 11px 12px;
  border: 1px solid var(--lxh-line);
  border-radius: 3px 12px 12px 12px;
  background: var(--lxh-bg-soft);
  font-size: 13px;
  color: var(--lxh-ink-soft);
}

.lxh-ask-a h4 {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lxh-blue);
}

.lxh-ask-a h4.lxh-practice {
  color: var(--lxh-gold);
  margin-top: 14px;
}

/* Provenance. Colour carries meaning here rather than decoration: product
   documentation is the authoritative half and reads as such; a practice
   explanation is deliberately marked as NOT documentation. */
.lxh-prov {
  margin-top: 10px;
  padding: 5px 9px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  display: inline-block;
}

.lxh-prov-product-documentation {
  background: var(--lxh-blue-soft);
  color: var(--lxh-blue);
  border: 1px solid #bfdbfe;
}

.lxh-prov-practice-specialist,
.lxh-prov-both {
  background: var(--lxh-amber-bg);
  color: #92400e;
  border: 1px solid var(--lxh-amber-line);
}

.lxh-prov-unanswered {
  background: var(--lxh-bg-soft);
  color: var(--lxh-muted);
  border: 1px solid var(--lxh-line);
}

.lxh-src {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--lxh-line);
  font-size: 11.5px;
  color: var(--lxh-muted);
}

.lxh-src a,
.lxh-src button {
  color: var(--lxh-blue);
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.lxh-ask-form {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}

#lxh-ask-input {
  flex: 1 1 auto;
  min-height: 38px;
  max-height: 120px;
  padding: 9px 11px;
  border: 1px solid var(--lxh-line);
  border-radius: 8px;
  font: 400 13px/1.4 var(--lxh-font);
  resize: vertical;
  box-sizing: border-box;
}

#lxh-ask-input:focus {
  outline: none;
  border-color: var(--lxh-blue);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.12);
}

.lxh-send {
  flex: 0 0 auto;
  height: 38px;
  padding: 0 14px;
  border: none;
  border-radius: 8px;
  background: var(--lxh-blue);
  color: #fff;
  font: 600 13px/1 var(--lxh-font);
  cursor: pointer;
}

.lxh-send:hover {
  background: var(--lxh-blue-dark);
}

.lxh-send:disabled {
  opacity: 0.5;
  cursor: default;
}

.lxh-send:focus-visible {
  outline: 3px solid var(--lxh-blue);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------------
   Guided mode ("Show me") highlight, drawn over the page
   --------------------------------------------------------------------------- */

.lxh-spot {
  position: absolute;
  z-index: 9996;
  border: 2px solid var(--lxh-gold);
  border-radius: 8px;
  box-shadow:
    0 0 0 4px rgba(217, 119, 6, 0.22),
    0 0 0 9999px rgba(15, 23, 42, 0.35);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.lxh-spot-label {
  position: absolute;
  z-index: 9996;
  max-width: 260px;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--lxh-ink);
  color: #fff;
  font: 500 12.5px/1.45 var(--lxh-font);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.3);
}

.lxh-spot-label .lxh-spot-step {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fbbf24;
  margin-bottom: 3px;
}

.lxh-spot-label button {
  margin: 8px 6px 0 0;
  padding: 4px 11px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font: 600 12px/1.3 var(--lxh-font);
  cursor: pointer;
  pointer-events: auto;
}

/* Screen-reader-only announcements */
.lxh-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------------- */

/* Tablet: a wider drawer, still overlaying so the work underneath is intact. */
@media (max-width: 1024px) {
  :root {
    --lxh-w: 380px;
  }

  html.lxh-pinned {
    padding-right: 0 !important;
  }
}

/* Mobile: a full-height sheet. The page beneath keeps its state — the sheet is
   a sibling of the content, never a navigation. */
@media (max-width: 640px) {
  #lxh-panel {
    width: 100vw;
    border-left: none;
  }

  #lxh-resize {
    display: none;
  }

  .lxh-body {
    padding-bottom: max(28px, env(safe-area-inset-bottom));
  }

  #lxh-launcher {
    right: 16px;
    bottom: 16px;
  }

  #lxh-launcher.lxh-stacked {
    bottom: 88px;
  }

  #lxh-launcher .lxh-launcher-key {
    display: none;
  }
}

/* High-contrast and forced-colours users get real borders, not shadows. */
@media (forced-colors: active) {
  #lxh-panel,
  .lxh-card,
  #lxh-launcher {
    border: 1px solid CanvasText;
  }
}
