/* ==========================================================================
   Help Center & Knowledge Base Stylesheet
   SaaS: ПВЗ Учет.Онлайн
   ========================================================================== */

:root {
  --help-bg: #f8fafc;
  --help-card-bg: #ffffff;
  --help-sidebar-bg: #ffffff;
  --help-header-bg: rgba(255, 255, 255, 0.88);
  --help-border: #e2e8f0;
  --help-border-subtle: #f1f5f9;
  --help-text: #0f172a;
  --help-text-muted: #64748b;
  --help-text-subtle: #94a3b8;
  --help-primary: #0284c7;
  --help-primary-hover: #0369a1;
  --help-primary-light: #e0f2fe;
  --help-primary-text: #0369a1;
  --help-code-bg: #0f172a;
  --help-code-text: #e2e8f0;
  --help-inline-code-bg: #f1f5f9;
  --help-inline-code-text: #0284c7;
  --help-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --help-shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
  --help-shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
  --help-shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
  --help-header-height: 64px;
}

[data-theme="dark"] {
  --help-bg: #0b1120;
  --help-card-bg: #131d32;
  --help-sidebar-bg: #0f172a;
  --help-header-bg: rgba(15, 23, 42, 0.88);
  --help-border: #1e293b;
  --help-border-subtle: #1e293b;
  --help-text: #f1f5f9;
  --help-text-muted: #94a3b8;
  --help-text-subtle: #64748b;
  --help-primary: #38bdf8;
  --help-primary-hover: #7dd3fc;
  --help-primary-light: #082f49;
  --help-primary-text: #bae6fd;
  --help-code-bg: #020617;
  --help-code-text: #f8fafc;
  --help-inline-code-bg: #1e293b;
  --help-inline-code-text: #38bdf8;
  --help-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --help-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --help-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --help-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
}

/* Base resets & typography for help layout */
body.help-page-body {
  margin: 0;
  padding: 0;
  background-color: var(--help-bg);
  color: var(--help-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.help-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--help-header-height);
  background: var(--help-header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--help-border);
  display: flex;
  align-items: center;
}

.help-header-inner {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.help-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.help-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--help-text);
  font-weight: 700;
  font-size: 1.1rem;
}

.help-logo-icon {
  font-size: 1.35rem;
}

.help-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--help-primary-light);
  color: var(--help-primary-text);
  border: 1px solid var(--help-border);
}

/* Search bar trigger in header */
.help-search-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--help-card-bg);
  border: 1px solid var(--help-border);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 0.9rem;
  color: var(--help-text-muted);
  cursor: pointer;
  min-width: 260px;
  transition: all 0.2s ease;
  box-shadow: var(--help-shadow-sm);
}

.help-search-trigger:hover {
  border-color: var(--help-primary);
  color: var(--help-text);
}

.search-trigger-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--help-bg);
  border: 1px solid var(--help-border);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.72rem;
  font-family: inherit;
  color: var(--help-text-muted);
  font-weight: 600;
}

.help-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-help-icon {
  background: var(--help-card-bg);
  border: 1px solid var(--help-border);
  color: var(--help-text-muted);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s ease;
}

.btn-help-icon:hover {
  color: var(--help-text);
  border-color: var(--help-primary);
}

.btn-help-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  background: var(--help-primary);
  color: #ffffff;
  transition: all 0.2s ease;
}

.btn-help-link:hover {
  background: var(--help-primary-hover);
}

.btn-help-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 8px;
  text-decoration: none;
  color: var(--help-text-muted);
  border: 1px solid var(--help-border);
  background: var(--help-card-bg);
  transition: all 0.2s ease;
}

.btn-help-ghost:hover {
  color: var(--help-text);
  border-color: var(--help-primary);
}

/* Mobile sidebar toggle */
.help-mobile-nav-toggle {
  display: none;
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: var(--help-text);
  cursor: pointer;
  padding: 4px;
}

/* Main Layout Grid (Centered without sidebar) */
.help-layout-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  min-height: calc(100vh - var(--help-header-height));
}

.help-sidebar {
  display: none !important;
}

.help-nav-section {
  margin-bottom: 24px;
}

.help-nav-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--help-text-muted);
  padding: 6px 10px;
  margin-bottom: 6px;
  border-radius: 6px;
}

.help-nav-category-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.help-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.help-nav-item {
  margin-bottom: 2px;
}

.help-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--help-text-muted);
  text-decoration: none;
  transition: all 0.15s ease;
  line-height: 1.35;
}

.help-nav-link:hover {
  background: var(--help-bg);
  color: var(--help-text);
}

.help-nav-link.active {
  background: var(--help-primary-light);
  color: var(--help-primary-text);
  font-weight: 600;
}

/* Content Area */
.help-main-content {
  flex: 1;
  min-width: 0;
  padding: 36px 48px 80px;
  background: var(--help-bg);
}

.help-article-wrapper {
  max-width: 820px;
  margin: 0 auto;
}

/* Breadcrumbs */
.help-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--help-text-muted);
  margin-bottom: 20px;
}

.help-breadcrumbs a {
  color: var(--help-text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.help-breadcrumbs a:hover {
  color: var(--help-primary);
}

.help-breadcrumb-separator {
  color: var(--help-text-subtle);
}

.help-breadcrumb-current {
  color: var(--help-text);
  font-weight: 600;
}

/* Article Metadata Header */
.help-article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--help-card-bg);
  border: 1px solid var(--help-border);
  color: var(--help-text-muted);
}

/* Article Card Body */
.help-article-card {
  background: var(--help-card-bg);
  border: 1px solid var(--help-border);
  border-radius: 16px;
  box-shadow: var(--help-shadow-sm);
  padding: 40px 48px;
}

/* Right Rail (TOC) */
.help-toc-rail {
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  padding: 36px 20px;
  box-sizing: border-box;
  position: sticky;
  top: var(--help-header-height);
  height: calc(100vh - var(--help-header-height));
  overflow-y: auto;
}

.help-toc-container {
  border-left: 1px solid var(--help-border);
  padding-left: 16px;
}

.help-toc-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--help-text-muted);
  margin-bottom: 12px;
}

.help-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.help-toc-item {
  margin-bottom: 6px;
}

.help-toc-item.level-3 {
  padding-left: 12px;
}

.help-toc-link {
  font-size: 0.84rem;
  color: var(--help-text-muted);
  text-decoration: none;
  line-height: 1.4;
  display: block;
  transition: all 0.15s ease;
}

.help-toc-link:hover {
  color: var(--help-primary);
}

.help-toc-link.active {
  color: var(--help-primary);
  font-weight: 600;
}

/* Markdown Typography */
.markdown-body {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--help-text);
}

.markdown-body h1 {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-top: 0;
  margin-bottom: 20px;
  line-height: 1.25;
  color: var(--help-text);
}

.markdown-body h2 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-top: 36px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--help-border-subtle);
  scroll-margin-top: 80px;
}

.markdown-body h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 12px;
  scroll-margin-top: 80px;
}

.markdown-body h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 8px;
}

.markdown-body p {
  margin-top: 0;
  margin-bottom: 18px;
}

.markdown-body a {
  color: var(--help-primary);
  text-decoration: none;
  font-weight: 500;
}

.markdown-body a:hover {
  text-decoration: underline;
}

.markdown-body ul,
.markdown-body ol {
  margin-top: 0;
  margin-bottom: 18px;
  padding-left: 24px;
}

.markdown-body li {
  margin-bottom: 6px;
}

.markdown-body hr {
  height: 1px;
  background-color: var(--help-border);
  border: none;
  margin: 32px 0;
}

.markdown-body blockquote {
  margin: 18px 0;
  padding: 12px 18px;
  border-left: 4px solid var(--help-primary);
  background: var(--help-bg);
  border-radius: 0 8px 8px 0;
  color: var(--help-text-muted);
}

/* Tables in Markdown */
.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.92rem;
  background: var(--help-card-bg);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--help-border);
}

.markdown-body th,
.markdown-body td {
  padding: 10px 14px;
  border: 1px solid var(--help-border);
  text-align: left;
  vertical-align: top;
}

.markdown-body th {
  background: var(--help-bg);
  font-weight: 600;
  color: var(--help-text);
}

.markdown-body tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.015);
}

/* GitHub Alerts Callouts */
.help-alert {
  margin: 24px 0;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 16px 20px;
  font-size: 0.94rem;
}

.help-alert-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.help-alert-icon {
  font-size: 1.15rem;
}

.help-alert-content {
  margin: 0;
  line-height: 1.6;
}

.help-alert-content p:last-child {
  margin-bottom: 0;
}

.alert-note {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #0369a1;
}
[data-theme="dark"] .alert-note {
  background: #082f49;
  border-color: #0369a1;
  color: #e0f2fe;
}

.alert-tip {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}
[data-theme="dark"] .alert-tip {
  background: #052e16;
  border-color: #166534;
  color: #dcfce7;
}

.alert-important {
  background: #faf5ff;
  border-color: #e9d5ff;
  color: #7e22ce;
}
[data-theme="dark"] .alert-important {
  background: #3b0764;
  border-color: #6b21a8;
  color: #f3e8ff;
}

.alert-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}
[data-theme="dark"] .alert-warning {
  background: #451a03;
  border-color: #92400e;
  color: #fef3c7;
}

.alert-caution {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #be123c;
}
[data-theme="dark"] .alert-caution {
  background: #4c0519;
  border-color: #9f1239;
  color: #ffe4e6;
}

/* Code blocks & Copy Button */
.code-block-wrapper {
  position: relative;
  margin: 20px 0;
}

.code-copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(4px);
  transition: all 0.15s ease;
  z-index: 5;
}

.code-copy-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.code-copy-btn.copied {
  background: #10b981;
  border-color: #059669;
  color: #ffffff;
}

.markdown-body pre {
  background: var(--help-code-bg);
  color: var(--help-code-text);
  padding: 16px 20px;
  border-radius: 12px;
  overflow-x: auto;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

.markdown-body code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
  background: var(--help-inline-code-bg);
  color: var(--help-inline-code-text);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
}

.markdown-body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* Previous / Next Article Navigation */
.help-adjacent-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--help-border);
}

.help-adjacent-card {
  padding: 16px 20px;
  background: var(--help-bg);
  border: 1px solid var(--help-border);
  border-radius: 12px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.2s ease;
}

.help-adjacent-card:hover {
  border-color: var(--help-primary);
  background: var(--help-card-bg);
  box-shadow: var(--help-shadow-sm);
}

.help-adjacent-card.next {
  text-align: right;
  grid-column: 2;
}

.adjacent-label {
  font-size: 0.78rem;
  color: var(--help-text-muted);
  font-weight: 500;
}

.adjacent-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--help-text);
}

/* Feedback Widget */
.help-feedback-widget {
  margin-top: 40px;
  padding: 24px;
  background: var(--help-bg);
  border: 1px solid var(--help-border);
  border-radius: 12px;
  text-align: center;
}

.feedback-question {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--help-text);
  margin-bottom: 12px;
}

.feedback-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.btn-feedback {
  background: var(--help-card-bg);
  border: 1px solid var(--help-border);
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--help-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-feedback:hover {
  border-color: var(--help-primary);
  color: var(--help-primary);
}

.feedback-form-box {
  margin-top: 16px;
  display: none;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.feedback-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--help-border);
  background: var(--help-card-bg);
  color: var(--help-text);
  font-size: 0.88rem;
  resize: vertical;
  min-height: 70px;
  margin-bottom: 10px;
}

.feedback-submit-btn {
  background: var(--help-primary);
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.feedback-thanks-msg {
  display: none;
  font-size: 0.92rem;
  font-weight: 600;
  color: #10b981;
}

/* Home / Index Page Grid */
.help-hero-section {
  text-align: center;
  padding: 40px 20px;
}

.help-hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.help-hero-subtitle {
  font-size: 1.1rem;
  color: var(--help-text-muted);
  max-width: 600px;
  margin: 0 auto 28px;
}

.help-hero-search {
  max-width: 540px;
  margin: 0 auto;
}

.help-hero-support {
  max-width: 540px;
  margin: 16px auto 0;
}

.help-hero-support-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  background: var(--help-card-bg);
  border: 1px solid var(--help-border);
  border-radius: 12px;
  box-shadow: var(--help-shadow-sm);
  transition: all 0.2s ease;
}

.help-hero-support-card:hover {
  border-color: var(--help-primary);
  box-shadow: var(--help-shadow-md);
}

.help-hero-support-left {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.help-hero-support-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--help-primary-light);
  color: var(--help-primary-text);
  font-size: 1.25rem;
  flex-shrink: 0;
}

.help-hero-support-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.help-hero-support-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--help-text-muted);
}

.help-hero-support-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.92rem;
}

.help-hero-support-email {
  font-weight: 700;
  color: var(--help-primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.help-hero-support-email:hover {
  text-decoration: underline;
  color: var(--help-primary-hover);
}

.help-hero-support-dot {
  color: var(--help-text-subtle);
  font-size: 0.8rem;
}

.help-hero-support-hours {
  color: var(--help-text-muted);
  font-size: 0.82rem;
}

.help-hero-support-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: 8px;
  background: var(--help-primary-light);
  color: var(--help-primary-text);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.help-hero-support-btn:hover {
  background: var(--help-primary);
  color: #ffffff;
}

.help-categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin: 40px 0;
}

.help-category-card {
  background: var(--help-card-bg);
  border: 1px solid var(--help-border);
  border-radius: 14px;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  box-shadow: var(--help-shadow-sm);
}

.help-category-card:hover {
  transform: translateY(-2px);
  border-color: var(--help-primary);
  box-shadow: var(--help-shadow-md);
}

.category-card-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.category-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--help-text);
}

.category-card-desc {
  font-size: 0.88rem;
  color: var(--help-text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
  flex: 1;
}

.category-card-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--help-primary);
}

/* Quick Tasks Section */
.help-quick-tasks {
  margin: 48px 0;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--help-text);
}

.quick-tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.quick-task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--help-card-bg);
  border: 1px solid var(--help-border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--help-text);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.quick-task-item:hover {
  border-color: var(--help-primary);
  color: var(--help-primary);
  background: var(--help-bg);
}

/* Modal Search Palette (Ctrl+K) */
.search-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}

.search-modal-backdrop.open {
  display: flex;
}

.search-modal-dialog {
  width: 100%;
  max-width: 600px;
  background: var(--help-card-bg);
  border: 1px solid var(--help-border);
  border-radius: 16px;
  box-shadow: var(--help-shadow-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 75vh;
}

.search-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--help-border);
}

.search-modal-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1.05rem;
  color: var(--help-text);
  outline: none;
}

.search-modal-input::placeholder {
  color: var(--help-text-subtle);
}

.search-modal-close {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  color: var(--help-text-muted);
  cursor: pointer;
  padding: 4px;
}

.search-modal-body {
  overflow-y: auto;
  padding: 10px;
}

.search-modal-empty {
  text-align: center;
  padding: 36px 20px;
  color: var(--help-text-muted);
  font-size: 0.92rem;
}

.search-result-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
  cursor: pointer;
}

.search-result-item:hover,
.search-result-item.selected {
  background: var(--help-primary-light);
}

.search-result-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--help-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-result-snippet {
  font-size: 0.82rem;
  color: var(--help-text-muted);
  line-height: 1.4;
}

.search-result-snippet mark {
  background: #fef08a;
  color: #713f12;
  border-radius: 3px;
  padding: 0 2px;
}

.search-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: var(--help-bg);
  border-top: 1px solid var(--help-border);
  font-size: 0.78rem;
  color: var(--help-text-muted);
}

.search-shortcuts-tips {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ==========================================================================
   In-App Floating Button & Drawer Widget
   ========================================================================== */

.help-floating-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #0284c7;
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 80;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.help-floating-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.55);
}

.help-floating-fab:active {
  transform: scale(0.96);
}

/* Help Drawer */
.help-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.help-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.help-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 460px;
  max-width: calc(100vw - 20px);
  background: #ffffff;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  z-index: 95;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.help-drawer.open {
  transform: translateX(0);
}

.help-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.help-drawer-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.help-drawer-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.help-drawer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.help-drawer-btn {
  background: transparent;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.8rem;
  color: #475569;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.help-drawer-btn:hover {
  background: #f1f5f9;
  color: #0284c7;
  border-color: #0284c7;
}

.help-drawer-close {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: #64748b;
  cursor: pointer;
  padding: 4px 8px;
}

.help-drawer-search-box {
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}

.help-drawer-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 0.88rem;
  outline: none;
}

.help-drawer-search-input:focus {
  border-color: #0284c7;
}

.help-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.drawer-section-heading {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin: 12px 0 8px;
}

.drawer-article-card {
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  background: #ffffff;
  transition: all 0.15s ease;
}

.drawer-article-card:hover {
  border-color: #0284c7;
  background: #f0f9ff;
}

.drawer-article-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #0f172a;
}

.drawer-article-desc {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 4px;
  line-height: 1.35;
}

/* In-drawer article reader */
.drawer-reader-view {
  display: none;
}

.drawer-reader-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: #0284c7;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 16px;
  padding: 0;
}

.drawer-reader-back:hover {
  text-decoration: underline;
}

.drawer-reader-content {
  font-size: 0.92rem;
  line-height: 1.6;
  color: #1e293b;
}

.drawer-reader-content h1 {
  font-size: 1.4rem;
  margin-top: 0;
  margin-bottom: 12px;
}

.drawer-reader-content h2 {
  font-size: 1.15rem;
  margin-top: 20px;
  margin-bottom: 8px;
}

.drawer-reader-content table {
  width: 100%;
  font-size: 0.82rem;
}

/* Context Help Trigger Button (in-page icon) */
.context-help-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  margin-left: 6px;
  vertical-align: middle;
  transition: all 0.15s ease;
  line-height: 1;
}

.context-help-trigger:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  transform: scale(1.1);
}

/* Responsive Media Queries */
@media (max-width: 1200px) {
  .help-toc-rail {
    display: none;
  }
}

@media (max-width: 900px) {
  .help-sidebar {
    display: none;
    position: fixed;
    top: var(--help-header-height);
    left: 0;
    bottom: 0;
    z-index: 50;
    width: 300px;
    max-width: 85vw;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.1);
  }

  .help-sidebar.mobile-open {
    display: block;
  }

  .help-mobile-nav-toggle {
    display: block;
  }

  .help-main-content {
    padding: 24px 16px 60px;
  }

  .help-article-card {
    padding: 24px 20px;
  }

  .help-adjacent-nav {
    grid-template-columns: 1fr;
  }

  .help-adjacent-card.next {
    grid-column: 1;
  }
}

@media (max-width: 600px) {
  .help-search-trigger {
    min-width: unset;
    padding: 6px 10px;
  }

  .search-trigger-shortcut {
    display: none;
  }

  .help-floating-fab {
    bottom: 74px; /* avoid overlapping mobile PWA bottom navigation */
    right: 16px;
    width: 42px;
    height: 42px;
    font-size: 1.15rem;
  }

  .help-hero-support-card {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 14px;
    gap: 12px;
  }

  .help-hero-support-left {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }

  .help-hero-support-meta {
    justify-content: center;
  }

  .help-hero-support-btn {
    justify-content: center;
    width: 100%;
  }
}
