.help-center-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.help-center-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.help-center-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 1rem;
}

.help-center-sidebar,
.help-center-reader {
  border: 1px solid rgba(var(--bs-body-color-rgb), 0.08);
  border-radius: 0.75rem;
  background: var(--bs-card-bg, #fff);
}

.help-center-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 70vh;
  overflow: hidden;
}

.help-sidebar-controls {
  padding: 1rem;
  border-bottom: 1px solid rgba(var(--bs-body-color-rgb), 0.08);
}

.help-category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.help-category-chip {
  border: 1px solid rgba(var(--bs-body-color-rgb), 0.18);
  border-radius: 999px;
  background: transparent;
  color: var(--bs-body-color);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.help-category-chip.is-active {
  background: rgba(var(--bs-primary-rgb), 0.12);
  border-color: rgba(var(--bs-primary-rgb), 0.35);
  color: var(--bs-primary);
}

.help-category-count {
  font-variant-numeric: tabular-nums;
  opacity: 0.8;
}

.help-article-list-wrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.help-article-list-title {
  padding: 0.8rem 1rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bs-secondary-color);
}

.help-article-list {
  overflow: auto;
  padding: 0 0.6rem 0.8rem;
}

.help-article-item {
  display: block;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 0.55rem;
  text-align: start;
  padding: 0.65rem 0.7rem;
  background: transparent;
  color: inherit;
}

.help-article-item + .help-article-item {
  margin-top: 0.4rem;
}

.help-article-item:hover {
  background: rgba(var(--bs-body-color-rgb), 0.05);
}

.help-article-item.is-active {
  border-color: rgba(var(--bs-primary-rgb), 0.3);
  background: rgba(var(--bs-primary-rgb), 0.09);
}

.help-article-item-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.help-article-item-desc {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--bs-secondary-color);
}

.help-center-reader {
  min-height: 70vh;
  padding: 1rem 1.2rem;
  overflow: auto;
}

.help-reader-placeholder {
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  color: var(--bs-secondary-color);
}

.help-reader-placeholder i {
  font-size: 2rem;
}

.help-reader-head {
  padding-bottom: 0.9rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(var(--bs-body-color-rgb), 0.08);
}

.help-markdown h1,
.help-markdown h2,
.help-markdown h3,
.help-markdown h4,
.help-markdown h5,
.help-markdown h6 {
  margin-top: 1.2rem;
  margin-bottom: 0.6rem;
}

.help-markdown p,
.help-markdown ul,
.help-markdown ol,
.help-markdown pre {
  margin-bottom: 0.85rem;
}

.help-markdown img {
  max-width: 100%;
  border-radius: 0.5rem;
  border: 1px solid rgba(var(--bs-body-color-rgb), 0.1);
  margin: 0.6rem 0;
}

.help-markdown pre {
  background: rgba(var(--bs-dark-rgb), 0.9);
  color: #f2f4f8;
  border-radius: 0.5rem;
  padding: 0.85rem;
  overflow: auto;
}

.help-markdown code {
  background: rgba(var(--bs-body-color-rgb), 0.08);
  padding: 0.1rem 0.35rem;
  border-radius: 0.3rem;
}

.help-markdown pre code {
  background: transparent;
  padding: 0;
}

.help-markdown-table-wrap {
  overflow: auto;
  margin-bottom: 1rem;
}

.help-markdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.help-markdown-table th,
.help-markdown-table td {
  border: 1px solid rgba(var(--bs-body-color-rgb), 0.18);
  padding: 0.45rem 0.55rem;
}

.help-markdown-table th {
  background: rgba(var(--bs-body-color-rgb), 0.07);
}

.help-empty-state {
  padding: 0.8rem;
  font-size: 0.9rem;
  color: var(--bs-secondary-color);
}

.help-widget {
  position: fixed;
  inset-inline-start: 1.2rem;
  bottom: 1.2rem;
  z-index: 1085;
}

[dir="rtl"] .help-widget {
  inset-inline-start: auto;
  inset-inline-end: 1.2rem;
}

.help-widget.is-hidden {
  display: none;
}

.help-widget-toggle {
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: var(--bs-primary, #696cff);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 28px rgba(var(--bs-primary-rgb), 0.35);
  position: relative;
}

.help-widget-toggle i {
  font-size: 1.05rem;
  opacity: 0.95;
}

.help-widget-toggle span {
  font-size: 1rem;
  font-weight: 700;
  position: absolute;
  line-height: 1;
}

.help-widget-panel {
  position: absolute;
  bottom: 64px;
  inset-inline-start: 0;
  width: min(360px, calc(100vw - 2rem));
  background: var(--bs-card-bg, #fff);
  border: 1px solid rgba(var(--bs-body-color-rgb), 0.1);
  border-radius: 0.75rem;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.16);
  overflow: hidden;
  transform: translateY(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

[dir="rtl"] .help-widget-panel {
  inset-inline-start: auto;
  inset-inline-end: 0;
}

.help-widget.is-open .help-widget-panel {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.help-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid rgba(var(--bs-body-color-rgb), 0.1);
}

.help-widget-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0.35rem;
  gap: 0.35rem;
  border-bottom: 1px solid rgba(var(--bs-body-color-rgb), 0.08);
}

.help-widget-tab {
  border: 1px solid transparent;
  border-radius: 0.45rem;
  background: transparent;
  padding: 0.45rem 0.4rem;
  font-size: 0.82rem;
  color: inherit;
}

.help-widget-tab.is-active {
  background: rgba(var(--bs-primary-rgb), 0.1);
  border-color: rgba(var(--bs-primary-rgb), 0.35);
  color: var(--bs-primary);
}

.help-widget-body {
  padding: 0.75rem;
  max-height: min(70vh, 620px);
  overflow: auto;
}

.help-widget-tab-panel {
  display: none;
}

.help-widget-tab-panel.is-active {
  display: block;
}

.help-widget-route-pill {
  display: inline-flex;
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
  background: rgba(var(--bs-body-color-rgb), 0.08);
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  margin-bottom: 0.6rem;
}

.help-widget-article {
  width: 100%;
  border: 1px solid rgba(var(--bs-body-color-rgb), 0.12);
  border-radius: 0.45rem;
  padding: 0.5rem 0.55rem;
  text-align: start;
  background: transparent;
}

.help-widget-article + .help-widget-article {
  margin-top: 0.45rem;
}

.help-widget-article:hover {
  border-color: rgba(var(--bs-primary-rgb), 0.32);
  background: rgba(var(--bs-primary-rgb), 0.05);
}

.help-widget-article-title {
  font-size: 0.86rem;
  font-weight: 600;
}

.help-widget-article-desc {
  margin-top: 0.22rem;
  font-size: 0.78rem;
  color: var(--bs-secondary-color);
}

.help-widget-ask-result {
  margin-top: 0.75rem;
}

.help-widget-answer {
  font-size: 0.86rem;
  line-height: 1.5;
  padding: 0.55rem;
  border: 1px solid rgba(var(--bs-body-color-rgb), 0.12);
  border-radius: 0.45rem;
}

.help-widget-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--bs-secondary-color);
}

.help-widget-refs {
  margin-top: 0.6rem;
  font-size: 0.8rem;
}

.help-widget-refs-title {
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.help-widget-refs ul {
  margin: 0;
  padding-inline-start: 1rem;
}

@media (max-width: 991.98px) {
  .help-center-layout {
    grid-template-columns: 1fr;
  }

  .help-center-sidebar,
  .help-center-reader {
    min-height: auto;
  }

  .help-center-reader {
    min-height: 55vh;
  }
}

@media (max-width: 575.98px) {
  .help-widget {
    inset-inline-start: 0.75rem;
    bottom: 0.75rem;
  }

  [dir="rtl"] .help-widget {
    inset-inline-end: 0.75rem;
  }

  .help-widget-panel {
    width: min(340px, calc(100vw - 1.5rem));
  }
}
