/* ============================================
   SHARED_HELP — Reusable Help Center Styles
   Drop-in CSS for any OTROTL site.
   Override --help-accent in site CSS to brand.
   ALL values in rem. ZERO px.
   ============================================ */

/* --------------------------------------------------------------------------
   CSS Variables - Help Module
   -------------------------------------------------------------------------- */
:root {
    --help-accent: #f97316;
    --help-accent-light: rgba(249, 115, 22, 0.1);
    --help-accent-hover: #ea580c;

    --help-sidebar-left-w: 17.5rem;
    --help-sidebar-right-w: 16.25rem;
    --help-header-h: 3.75rem;
    --help-touch-min: 2.75rem;
    --help-transition: 0.25s ease;
    --help-radius: 0.5rem;
    --help-radius-lg: 0.75rem;
    --help-gap: 1rem;
    --help-gap-sm: 0.5rem;
    --help-gap-lg: 1.5rem;
    --help-gap-xl: 2rem;
    --help-font-xs: 0.75rem;
    --help-font-sm: 0.8125rem;
    --help-font-base: 0.9375rem;
    --help-font-lg: 1.125rem;
    --help-font-xl: 1.5rem;
    --help-font-2xl: 2rem;
}

/* --------------------------------------------------------------------------
   1. Layout Grid (.help-layout)
   -------------------------------------------------------------------------- */
body.help-body {
    padding-top: var(--help-header-h);
}

.help-layout {
    display: grid;
    grid-template-columns: var(--help-sidebar-left-w) 1fr 0;
    min-height: calc(100vh - var(--help-header-h));
    background: #ffffff;
    color: #1f2937;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: grid-template-columns var(--help-transition);
}

.help-layout.toc-open {
    grid-template-columns: var(--help-sidebar-left-w) 1fr var(--help-sidebar-right-w);
}

.dark .help-layout {
    background: #030712;
    color: #f3f4f6;
}

/* --------------------------------------------------------------------------
   2. Left Sidebar (.help-sidebar-left)
   -------------------------------------------------------------------------- */
.help-sidebar-left {
    position: sticky;
    top: var(--help-header-h);
    height: calc(100vh - var(--help-header-h));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f9fafb;
    border-right: 0.0625rem solid #e5e7eb;
    z-index: 20;
}

.dark .help-sidebar-left {
    background: #111827;
    border-right-color: #374151;
}

.help-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--help-gap);
    border-bottom: 0.0625rem solid #e5e7eb;
    min-height: var(--help-touch-min);
    flex-shrink: 0;
    background: linear-gradient(180deg, rgba(249, 115, 22, 0.04) 0%, transparent 100%);
    position: relative;
}

.dark .help-sidebar-header {
    border-bottom-color: #374151;
    background: linear-gradient(180deg, rgba(249, 115, 22, 0.06) 0%, transparent 100%);
}

.help-sidebar-title {
    font-size: var(--help-font-base);
    font-weight: 700;
    color: #111827;
}

.dark .help-sidebar-title {
    color: #f3f4f6;
}

.help-sidebar-close {
    display: none;
    align-items: center;
    justify-content: center;
    width: var(--help-touch-min);
    height: var(--help-touch-min);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    border-radius: var(--help-radius);
    transition: background var(--help-transition), color var(--help-transition);
}

.help-sidebar-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.dark .help-sidebar-close:hover {
    background: #1f2937;
    color: #f3f4f6;
}

/* Sidebar search */
.help-sidebar-search {
    padding: var(--help-gap-sm) var(--help-gap);
    flex-shrink: 0;
    position: relative;
}

.help-sidebar-search-wrap {
    position: relative;
}

.help-sidebar-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
    width: 1rem;
    height: 1rem;
}

.dark .help-sidebar-search-icon {
    color: #6b7280;
}

.help-sidebar-search-input {
    width: 100%;
    padding: 0.75rem 0.875rem 0.75rem 2.25rem;
    background: #ffffff;
    border: 0.0625rem solid #d1d5db;
    border-radius: var(--help-radius);
    color: #111827;
    font-size: var(--help-font-sm);
    outline: none;
    min-height: var(--help-touch-min);
    transition: border-color var(--help-transition), box-shadow var(--help-transition), background var(--help-transition);
}

.help-sidebar-search-input:focus {
    border-color: var(--help-accent);
    box-shadow: 0 0 0 0.1875rem rgba(249, 115, 22, 0.15), inset 0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.06);
    background: #fffbf7;
}

.help-sidebar-search-input::placeholder {
    color: #9ca3af;
}

.dark .help-sidebar-search-input {
    background: #1f2937;
    border-color: #374151;
    color: #f3f4f6;
}

.dark .help-sidebar-search-input:focus {
    border-color: var(--help-accent);
    box-shadow: 0 0 0 0.1875rem rgba(249, 115, 22, 0.2), inset 0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.2);
    background: #1a1a2e;
}

.dark .help-sidebar-search-input::placeholder {
    color: #6b7280;
}

/* Sidebar navigation scroll area */
.help-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--help-gap-sm) 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(156, 163, 175, 0.4) transparent;
}

.dark .help-sidebar-nav {
    scrollbar-color: rgba(55, 65, 81, 0.6) transparent;
}

.help-sidebar-nav::-webkit-scrollbar {
    width: 0.375rem;
}

.help-sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.help-sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.4);
    border-radius: 0.1875rem;
}

.help-sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.7);
}

.dark .help-sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(55, 65, 81, 0.6);
}

.dark .help-sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(75, 85, 99, 0.8);
}

/* Sidebar footer */
.help-sidebar-footer {
    padding: var(--help-gap-sm) var(--help-gap);
    border-top: 0.0625rem solid #e5e7eb;
    flex-shrink: 0;
}

.dark .help-sidebar-footer {
    border-top-color: #374151;
}

.help-sidebar-back {
    display: flex;
    align-items: center;
    gap: var(--help-gap-sm);
    color: #6b7280;
    text-decoration: none;
    font-size: var(--help-font-sm);
    min-height: var(--help-touch-min);
    padding: 0 var(--help-gap-sm);
    border-radius: var(--help-radius);
    transition: color var(--help-transition), background var(--help-transition);
}

.help-sidebar-back:hover {
    color: #111827;
    background: #f3f4f6;
}

.dark .help-sidebar-back {
    color: #9ca3af;
}

.dark .help-sidebar-back:hover {
    color: #f3f4f6;
    background: #1f2937;
}

/* --------------------------------------------------------------------------
   3. Center Content (.help-content-area)
   -------------------------------------------------------------------------- */
.help-content-area {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Breadcrumb header bar */
.help-content-header {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: var(--help-gap) var(--help-gap-xl);
    border-bottom: 0.0625rem solid #e5e7eb;
    font-size: var(--help-font-sm);
    flex-wrap: wrap;
    flex-shrink: 0;
    min-height: var(--help-touch-min);
}

.dark .help-content-header {
    border-bottom-color: #374151;
}

.help-breadcrumb-link {
    color: #6b7280;
    text-decoration: none;
    transition: color var(--help-transition);
}

.help-breadcrumb-link:hover {
    color: var(--help-accent);
}

.dark .help-breadcrumb-link {
    color: #9ca3af;
}

.dark .help-breadcrumb-link:hover {
    color: var(--help-accent);
}

.help-breadcrumb-sep {
    color: #d1d5db;
    font-size: 0.625rem;
}

.dark .help-breadcrumb-sep {
    color: #4b5563;
}

.help-breadcrumb-current {
    color: #111827;
    font-weight: 600;
}

.dark .help-breadcrumb-current {
    color: #f3f4f6;
}

/* Scrollable content body */
.help-content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: var(--help-gap-xl);
}

/* Previous / Next / Feedback footer bar */
.help-content-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--help-gap) var(--help-gap-xl);
    border-top: 0.0625rem solid #e5e7eb;
    flex-shrink: 0;
    gap: var(--help-gap);
    flex-wrap: wrap;
}

.dark .help-content-footer {
    border-top-color: #374151;
}

.help-content-footer-nav {
    display: flex;
    gap: var(--help-gap-sm);
}

.help-footer-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: #f3f4f6;
    border: 0.0625rem solid #e5e7eb;
    border-radius: var(--help-radius);
    color: #374151;
    font-size: var(--help-font-sm);
    cursor: pointer;
    min-height: var(--help-touch-min);
    text-decoration: none;
    transition: background var(--help-transition), border-color var(--help-transition), color var(--help-transition);
}

.help-footer-btn:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
    color: #111827;
}

.dark .help-footer-btn {
    background: #1f2937;
    border-color: #374151;
    color: #d1d5db;
}

.dark .help-footer-btn:hover {
    background: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
}

.help-footer-feedback {
    display: flex;
    align-items: center;
    gap: var(--help-gap-sm);
    font-size: var(--help-font-sm);
    color: #6b7280;
}

.dark .help-footer-feedback {
    color: #9ca3af;
}

.help-feedback-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--help-touch-min);
    height: var(--help-touch-min);
    background: none;
    border: 0.0625rem solid #e5e7eb;
    border-radius: var(--help-radius);
    color: #6b7280;
    cursor: pointer;
    transition: background var(--help-transition), color var(--help-transition), border-color var(--help-transition);
}

.help-feedback-btn:hover {
    background: #f3f4f6;
    color: var(--help-accent);
    border-color: var(--help-accent);
}

.dark .help-feedback-btn {
    border-color: #374151;
    color: #9ca3af;
}

.dark .help-feedback-btn:hover {
    background: #1f2937;
    color: var(--help-accent);
    border-color: var(--help-accent);
}

.help-feedback-btn.active {
    background: var(--help-accent-light);
    color: var(--help-accent);
    border-color: var(--help-accent);
}

/* --------------------------------------------------------------------------
   4. Right Sidebar / TOC (.help-sidebar-right)
   -------------------------------------------------------------------------- */
.help-sidebar-right {
    position: sticky;
    top: var(--help-header-h);
    height: calc(100vh - var(--help-header-h));
    width: 0;
    opacity: 0;
    overflow: hidden;
    background: #f9fafb;
    border-left: 0.0625rem solid #e5e7eb;
    transition: width var(--help-transition), opacity var(--help-transition);
    display: flex;
    flex-direction: column;
}

.dark .help-sidebar-right {
    background: #111827;
    border-left-color: #374151;
}

.toc-open .help-sidebar-right {
    width: var(--help-sidebar-right-w);
    opacity: 1;
}

.help-toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--help-gap);
    border-bottom: 0.0625rem solid #e5e7eb;
    min-height: var(--help-touch-min);
    flex-shrink: 0;
}

.dark .help-toc-header {
    border-bottom-color: #374151;
}

.help-toc-title {
    font-size: var(--help-font-sm);
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.03125rem;
}

.dark .help-toc-title {
    color: #9ca3af;
}

.help-toc-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--help-touch-min);
    height: var(--help-touch-min);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    border-radius: var(--help-radius);
    transition: background var(--help-transition), color var(--help-transition);
}

.help-toc-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.dark .help-toc-close:hover {
    background: #1f2937;
    color: #f3f4f6;
}

.help-toc-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--help-gap-sm) var(--help-gap);
    list-style: none;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

.dark .help-toc-list {
    scrollbar-color: #374151 transparent;
}

.help-toc-item {
    margin-bottom: 0.125rem;
}

.help-toc-item a {
    display: flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    color: #6b7280;
    text-decoration: none;
    font-size: var(--help-font-sm);
    border-left: 0.125rem solid transparent;
    border-radius: 0 var(--help-radius) var(--help-radius) 0;
    min-height: var(--help-touch-min);
    transition: color var(--help-transition), border-color var(--help-transition), background var(--help-transition);
}

.help-toc-item a:hover {
    color: #111827;
    background: #f3f4f6;
}

.dark .help-toc-item a {
    color: #9ca3af;
}

.dark .help-toc-item a:hover {
    color: #f3f4f6;
    background: #1f2937;
}

.help-toc-item.active a {
    color: var(--help-accent-hover);
    border-left-color: var(--help-accent);
    background: rgba(249, 115, 22, 0.06);
    font-weight: 600;
}

.dark .help-toc-item.active a {
    color: var(--help-accent);
    border-left-color: var(--help-accent);
    background: var(--help-accent-light);
}

.help-toc-item--h3 a {
    padding-left: 1.5rem;
    font-size: var(--help-font-xs);
}

/* --------------------------------------------------------------------------
   5. Tree Navigation
   -------------------------------------------------------------------------- */
.help-tree-category {
    margin: 0.25rem 0;
}

.help-tree-toggle {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.75rem var(--help-gap);
    background: none;
    border: none;
    border-left: 0.1875rem solid transparent;
    color: #374151;
    font-size: var(--help-font-sm);
    font-weight: 600;
    letter-spacing: 0.01em;
    text-align: left;
    cursor: pointer;
    min-height: var(--help-touch-min);
    border-radius: 0;
    transition: color 0.2s ease, background 0.2s ease, border-left-color 0.2s ease;
}

.help-tree-toggle:hover {
    color: #111827;
    background: #f3f4f6;
    border-left-color: var(--help-accent);
}

.dark .help-tree-toggle {
    color: #d1d5db;
}

.dark .help-tree-toggle:hover {
    color: #f3f4f6;
    background: #1f2937;
    border-left-color: var(--help-accent);
}

.help-tree-toggle.active {
    color: var(--help-accent-hover);
    border-left-color: var(--help-accent);
}

.dark .help-tree-toggle.active {
    color: var(--help-accent);
    border-left-color: var(--help-accent);
}

.help-tree-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    flex-shrink: 0;
    font-size: var(--help-font-sm);
    background: rgba(156, 163, 175, 0.1);
    border-radius: 0.375rem;
    transition: background 0.2s ease, color 0.2s ease;
}

.dark .help-tree-icon {
    background: rgba(75, 85, 99, 0.2);
}

.help-tree-category.expanded .help-tree-icon {
    background: rgba(249, 115, 22, 0.12);
    color: var(--help-accent-hover);
}

.dark .help-tree-category.expanded .help-tree-icon {
    background: rgba(249, 115, 22, 0.15);
    color: var(--help-accent);
}

.help-tree-toggle:hover .help-tree-icon {
    background: var(--help-accent-light);
}

.dark .help-tree-toggle:hover .help-tree-icon {
    background: rgba(249, 115, 22, 0.12);
}

.help-tree-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.help-tree-chevron {
    font-size: 0.625rem;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
    flex-shrink: 0;
    width: 1rem;
    text-align: center;
    color: #9ca3af;
}

.dark .help-tree-chevron {
    color: #6b7280;
}

.help-tree-category.expanded .help-tree-chevron {
    transform: rotate(90deg);
    color: var(--help-accent);
}

.dark .help-tree-category.expanded .help-tree-chevron {
    color: var(--help-accent);
}

.help-tree-children {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
    opacity: 0;
    position: relative;
    margin-left: 1.875rem;
    border-left: 0.0625rem solid #e5e7eb;
}

.dark .help-tree-children {
    border-left-color: #374151;
}

.help-tree-category.expanded .help-tree-children {
    max-height: 31.25rem;
    opacity: 1;
}

.help-tree-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5625rem var(--help-gap) 0.5625rem 1.5rem;
    color: #6b7280;
    text-decoration: none;
    font-size: var(--help-font-sm);
    min-height: var(--help-touch-min);
    position: relative;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

/* Small dot indicator on children */
.help-tree-link::before {
    content: '';
    position: absolute;
    left: -0.21875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
    background: transparent;
    transition: background 0.2s ease, transform 0.2s ease;
}

.dark .help-tree-link {
    color: #9ca3af;
}

.help-tree-link:hover {
    color: #111827;
    background: rgba(243, 244, 246, 0.7);
    transform: translateX(0.125rem);
}

.help-tree-link:hover::before {
    background: #9ca3af;
}

.dark .help-tree-link:hover {
    color: #f3f4f6;
    background: rgba(31, 41, 55, 0.7);
    transform: translateX(0.125rem);
}

.dark .help-tree-link:hover::before {
    background: #9ca3af;
}

/* Active state: accent left border + background glow + dot */
.help-tree-link.active {
    color: var(--help-accent-hover);
    background: rgba(249, 115, 22, 0.06);
    border-left: 0.1875rem solid var(--help-accent);
    padding-left: calc(1.5rem - 0.1875rem);
    font-weight: 500;
}

.help-tree-link.active::before {
    background: var(--help-accent);
    transform: translateY(-50%) scale(1.2);
}

.dark .help-tree-link.active {
    color: var(--help-accent);
    background: var(--help-accent-light);
    border-left-color: var(--help-accent);
}

.dark .help-tree-link.active::before {
    background: var(--help-accent);
    transform: translateY(-50%) scale(1.2);
}

/* --------------------------------------------------------------------------
   6. Article Typography (.help-article-content)
   -------------------------------------------------------------------------- */
.help-article-content h1 {
    font-size: var(--help-font-2xl);
    font-weight: 800;
    margin-bottom: var(--help-gap);
    color: #111827;
    line-height: 1.2;
}

.dark .help-article-content h1 {
    color: #f3f4f6;
}

.help-article-content h2 {
    font-size: var(--help-font-xl);
    font-weight: 700;
    margin-top: var(--help-gap-xl);
    margin-bottom: var(--help-gap);
    color: #111827;
    line-height: 1.3;
    padding-bottom: var(--help-gap-sm);
    border-bottom: 0.0625rem solid #e5e7eb;
}

.dark .help-article-content h2 {
    color: #f3f4f6;
    border-bottom-color: #374151;
}

.help-article-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: var(--help-gap-lg);
    margin-bottom: var(--help-gap-sm);
    color: #1f2937;
}

.dark .help-article-content h3 {
    color: #e5e7eb;
}

.help-article-content p {
    font-size: var(--help-font-base);
    line-height: 1.75;
    color: #4b5563;
    margin-bottom: var(--help-gap);
}

.dark .help-article-content p {
    color: #9ca3af;
}

.help-article-content a {
    color: var(--help-accent-hover);
    text-decoration: none;
    transition: color var(--help-transition);
}

.help-article-content a:hover {
    color: var(--help-accent);
    text-decoration: underline;
}

.dark .help-article-content a {
    color: var(--help-accent);
}

.dark .help-article-content a:hover {
    color: #fb923c;
}

.help-article-content ul,
.help-article-content ol {
    padding-left: 1.5rem;
    margin-bottom: var(--help-gap);
}

.help-article-content li {
    font-size: var(--help-font-base);
    line-height: 1.75;
    color: #4b5563;
    margin-bottom: 0.25rem;
}

.dark .help-article-content li {
    color: #9ca3af;
}

/* Inline code */
.help-article-content code {
    background: #f3f4f6;
    border: 0.0625rem solid #e5e7eb;
    border-radius: 0.25rem;
    padding: 0.125rem 0.375rem;
    font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
    font-size: 0.85em;
    color: var(--help-accent-hover);
}

.dark .help-article-content code {
    background: #1f2937;
    border-color: #374151;
    color: var(--help-accent);
}

/* Code blocks */
.help-article-content pre {
    background: #f9fafb;
    border: 0.0625rem solid #e5e7eb;
    border-radius: var(--help-radius);
    padding: var(--help-gap);
    margin-bottom: var(--help-gap);
    overflow-x: auto;
    font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
    font-size: var(--help-font-sm);
    line-height: 1.6;
    color: #1f2937;
}

.dark .help-article-content pre {
    background: #0f172a;
    border-color: #1e293b;
    color: #e2e8f0;
}

.help-article-content pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    color: inherit;
}

/* Tables */
.help-article-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--help-gap);
    font-size: var(--help-font-sm);
}

.help-article-content th {
    background: #f3f4f6;
    border: 0.0625rem solid #e5e7eb;
    padding: 0.625rem 0.875rem;
    text-align: left;
    font-weight: 600;
    color: #111827;
}

.dark .help-article-content th {
    background: #1f2937;
    border-color: #374151;
    color: #f3f4f6;
}

.help-article-content td {
    border: 0.0625rem solid #e5e7eb;
    padding: 0.625rem 0.875rem;
    color: #4b5563;
}

.dark .help-article-content td {
    border-color: #374151;
    color: #9ca3af;
}

.help-article-content tr:hover td {
    background: #f9fafb;
}

.dark .help-article-content tr:hover td {
    background: #111827;
}

/* Blockquote */
.help-article-content blockquote {
    border-left: 0.25rem solid var(--help-accent);
    padding: var(--help-gap) var(--help-gap-lg);
    margin: var(--help-gap) 0;
    background: rgba(249, 115, 22, 0.04);
    color: #4b5563;
    font-style: italic;
    border-radius: 0 var(--help-radius) var(--help-radius) 0;
}

.dark .help-article-content blockquote {
    background: rgba(249, 115, 22, 0.08);
    color: #9ca3af;
}

/* Images */
.help-article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--help-radius);
    margin: var(--help-gap) 0;
    border: 0.0625rem solid #e5e7eb;
}

.dark .help-article-content img {
    border-color: #374151;
}

/* Callout boxes — base layout */
.callout {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.callout > i {
    flex-shrink: 0;
    font-size: 1.125rem;
    margin-top: 0.125rem;
}

.callout ul {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
}

.callout ul li {
    margin-bottom: 0.25rem;
}

.callout code {
    background: rgba(0, 0, 0, 0.06);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.8125rem;
    font-family: 'Courier New', monospace;
}

.dark .callout code {
    background: rgba(255, 255, 255, 0.1);
}

/* Callout boxes — color variants */
.callout-info,
.callout-warning,
.callout-success,
.callout-danger,
.callout-tip {
    border-left: 0.25rem solid;
    border-radius: 0 var(--help-radius) var(--help-radius) 0;
    padding: var(--help-gap);
    margin: var(--help-gap) 0;
    font-size: var(--help-font-sm);
    line-height: 1.6;
}

.callout-info {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.06);
    color: #1e40af;
}

.dark .callout-info {
    background: rgba(59, 130, 246, 0.1);
    color: #93c5fd;
}

.callout-warning {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.06);
    color: #92400e;
}

.dark .callout-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #fcd34d;
}

.callout-success {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.06);
    color: #065f46;
}

.dark .callout-success {
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
}

.callout-danger {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.06);
    color: #991b1b;
}

.dark .callout-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

.callout-tip {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.06);
    color: #5b21b6;
}

.dark .callout-tip {
    background: rgba(139, 92, 246, 0.1);
    color: #c4b5fd;
}

.callout-tip > i {
    color: #8b5cf6;
}

.callout-info > i {
    color: #3b82f6;
}

.callout-warning > i {
    color: #f59e0b;
}

.callout-success > i {
    color: #10b981;
}

.callout-danger > i {
    color: #ef4444;
}

.callout-title {
    font-weight: 700;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* --------------------------------------------------------------------------
   7. Search Results (.help-search-results)
   -------------------------------------------------------------------------- */
.help-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 0.0625rem solid #d1d5db;
    border-radius: 0 0 var(--help-radius) var(--help-radius);
    max-height: 18.75rem;
    overflow-y: auto;
    z-index: 50;
    display: none;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
}

.dark .help-search-results {
    background: #1f2937;
    border-color: #374151;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.4);
}

.help-search-results.visible {
    display: block;
}

.help-search-results-item {
    display: flex;
    align-items: center;
    padding: 0.625rem 0.875rem;
    color: #4b5563;
    text-decoration: none;
    font-size: var(--help-font-sm);
    min-height: var(--help-touch-min);
    transition: background var(--help-transition), color var(--help-transition);
}

.help-search-results-item:hover,
.help-search-results-item.focused {
    background: #f3f4f6;
    color: #111827;
}

.dark .help-search-results-item {
    color: #9ca3af;
}

.dark .help-search-results-item:hover,
.dark .help-search-results-item.focused {
    background: #374151;
    color: #f3f4f6;
}

.help-search-results-empty {
    padding: var(--help-gap);
    text-align: center;
    color: #9ca3af;
    font-size: var(--help-font-sm);
}

.dark .help-search-results-empty {
    color: #6b7280;
}

.help-search-results-highlight {
    background: rgba(249, 115, 22, 0.15);
    color: var(--help-accent-hover);
    border-radius: 0.125rem;
    padding: 0 0.125rem;
}

.dark .help-search-results-highlight {
    background: rgba(249, 115, 22, 0.25);
    color: var(--help-accent);
}

/* --------------------------------------------------------------------------
   8. Scrollbar (.help-scrollbar)
   -------------------------------------------------------------------------- */
.help-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(156, 163, 175, 0.4) transparent;
}

.dark .help-scrollbar {
    scrollbar-color: rgba(55, 65, 81, 0.5) transparent;
}

.help-scrollbar::-webkit-scrollbar {
    width: 0.375rem;
}

.help-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.help-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.4);
    border-radius: 0.1875rem;
    transition: background 0.2s ease;
}

.help-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.7);
}

.dark .help-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(55, 65, 81, 0.5);
}

.dark .help-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(75, 85, 99, 0.8);
}

/* --------------------------------------------------------------------------
   Quick Links Grid (Home / Category Landing)
   -------------------------------------------------------------------------- */
.help-quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: var(--help-gap);
    margin-top: var(--help-gap-lg);
}

.help-quick-card {
    background: #ffffff;
    border: 0.0625rem solid #e5e7eb;
    border-radius: var(--help-radius-lg);
    padding: var(--help-gap-lg);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: var(--help-gap-sm);
    cursor: pointer;
    min-height: var(--help-touch-min);
    transition: border-color var(--help-transition), transform var(--help-transition), box-shadow var(--help-transition);
}

.help-quick-card:hover {
    border-color: var(--help-accent);
    transform: translateY(-0.125rem);
    box-shadow: 0 0.5rem 1.5rem rgba(249, 115, 22, 0.1);
}

.dark .help-quick-card {
    background: #111827;
    border-color: #374151;
}

.dark .help-quick-card:hover {
    border-color: var(--help-accent);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.3);
}

.help-quick-card-icon {
    font-size: var(--help-font-xl);
    color: var(--help-accent);
}

.help-quick-card-title {
    font-size: var(--help-font-base);
    font-weight: 700;
    color: #111827;
}

.dark .help-quick-card-title {
    color: #f3f4f6;
}

.help-quick-card-desc {
    font-size: var(--help-font-sm);
    color: #6b7280;
    line-height: 1.5;
}

.dark .help-quick-card-desc {
    color: #9ca3af;
}

.help-quick-card-count {
    font-size: var(--help-font-xs);
    color: #9ca3af;
    margin-top: auto;
}

.dark .help-quick-card-count {
    color: #6b7280;
}

/* --------------------------------------------------------------------------
   Step-by-Step Instructions
   -------------------------------------------------------------------------- */
.help-steps {
    counter-reset: help-step;
    list-style: none;
    padding: 0;
    margin: var(--help-gap) 0;
}

.help-steps-item {
    display: flex;
    align-items: flex-start;
    gap: var(--help-gap);
    margin-bottom: var(--help-gap);
    counter-increment: help-step;
    position: relative;
}

.help-steps-item::before {
    content: counter(help-step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: var(--help-accent);
    color: #ffffff;
    border-radius: 50%;
    font-size: var(--help-font-sm);
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.help-steps-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 0.96875rem;
    top: 2.25rem;
    bottom: -0.5rem;
    width: 0.125rem;
    background: #e5e7eb;
}

.dark .help-steps-item:not(:last-child)::after {
    background: #374151;
}

.help-steps-content {
    flex: 1;
    padding-top: 0.25rem;
}

/* --------------------------------------------------------------------------
   Keyboard Focus Styles
   -------------------------------------------------------------------------- */
.help-tree-toggle:focus-visible,
.help-tree-link:focus-visible,
.help-sidebar-search-input:focus-visible,
.help-sidebar-close:focus-visible,
.help-toc-close:focus-visible,
.help-footer-btn:focus-visible,
.help-feedback-btn:focus-visible,
.help-quick-card:focus-visible,
.help-mobile-toggle:focus-visible {
    outline: 0.125rem solid var(--help-accent);
    outline-offset: 0.125rem;
}

/* --------------------------------------------------------------------------
   Mobile Sidebar Overlay
   -------------------------------------------------------------------------- */
.help-sidebar-overlay {
    visibility: hidden;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 35;
    opacity: 0;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.help-sidebar-overlay.visible {
    visibility: visible;
    opacity: 1;
}

/* Mobile header bar (hidden on desktop) */
.help-mobile-header {
    display: none;
    position: sticky;
    top: var(--help-header-h);
    z-index: 30;
    background: #ffffff;
    border-bottom: 0.0625rem solid #e5e7eb;
    padding: 0 var(--help-gap);
    min-height: var(--help-touch-min);
    align-items: center;
    gap: var(--help-gap-sm);
}

.dark .help-mobile-header {
    background: #111827;
    border-bottom-color: #374151;
}

.help-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--help-touch-min);
    height: var(--help-touch-min);
    background: none;
    border: none;
    color: #374151;
    cursor: pointer;
    border-radius: var(--help-radius);
    transition: background var(--help-transition);
}

.help-mobile-toggle:hover {
    background: #f3f4f6;
}

.dark .help-mobile-toggle {
    color: #d1d5db;
}

.dark .help-mobile-toggle:hover {
    background: #1f2937;
}

.help-mobile-title {
    font-size: var(--help-font-base);
    font-weight: 700;
    color: #111827;
}

.dark .help-mobile-title {
    color: #f3f4f6;
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */
@keyframes helpFadeIn {
    from { opacity: 0; transform: translateY(0.5rem); }
    to   { opacity: 1; transform: translateY(0); }
}

.help-content-animate {
    animation: helpFadeIn 0.3s ease;
}

@keyframes helpPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.help-loading {
    animation: helpPulse 1.5s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   9. Responsive - Tablet (max-width: 79.9375rem / 1279px)
   -------------------------------------------------------------------------- */
@media (max-width: 79.9375rem) {
    .help-layout {
        grid-template-columns: var(--help-sidebar-left-w) 1fr;
    }

    .help-layout.toc-open {
        grid-template-columns: var(--help-sidebar-left-w) 1fr;
    }

    /* Right sidebar becomes overlay on tablet */
    .help-sidebar-right {
        position: fixed;
        top: var(--help-header-h);
        right: 0;
        height: calc(100vh - var(--help-header-h));
        z-index: 40;
        box-shadow: -0.5rem 0 1.5rem rgba(0, 0, 0, 0.1);
    }

    .dark .help-sidebar-right {
        box-shadow: -0.5rem 0 1.5rem rgba(0, 0, 0, 0.4);
    }

    .toc-open .help-sidebar-right {
        width: var(--help-sidebar-right-w);
        opacity: 1;
    }
}

/* --------------------------------------------------------------------------
   9b. Responsive - Mobile (max-width: 47.9375rem / 767px)
   -------------------------------------------------------------------------- */
@media (max-width: 47.9375rem) {
    .help-layout {
        grid-template-columns: 1fr;
    }

    .help-layout.toc-open {
        grid-template-columns: 1fr;
    }

    /* Left sidebar slides in from left */
    .help-sidebar-left {
        position: fixed;
        top: var(--help-header-h);
        left: 0;
        width: min(85vw, 20rem);
        height: calc(100vh - var(--help-header-h));
        z-index: 40;
        transform: translateX(-100%);
        transition: transform var(--help-transition);
        box-shadow: 0.5rem 0 1.5rem rgba(0, 0, 0, 0.1);
    }

    .dark .help-sidebar-left {
        box-shadow: 0.5rem 0 1.5rem rgba(0, 0, 0, 0.4);
    }

    .help-sidebar-left.open {
        transform: translateX(0);
    }

    .help-sidebar-close {
        display: flex;
    }

    .help-mobile-header {
        display: flex;
    }

    .help-content-scroll {
        padding: var(--help-gap);
    }

    .help-content-header {
        padding: var(--help-gap);
    }

    .help-content-footer {
        padding: var(--help-gap);
        flex-direction: column;
        align-items: flex-start;
    }

    .help-quick-links {
        grid-template-columns: 1fr;
    }

    .help-article-content h1 {
        font-size: var(--help-font-xl);
    }

    .help-article-content h2 {
        font-size: var(--help-font-lg);
    }
}

/* --------------------------------------------------------------------------
   10. Print Styles
   -------------------------------------------------------------------------- */
@media print {
    .help-sidebar-left,
    .help-sidebar-right,
    .help-sidebar-overlay,
    .help-mobile-header,
    .help-content-header,
    .help-content-footer,
    .help-sidebar-search {
        display: none !important;
    }

    .help-layout {
        display: block;
        background: white;
        color: black;
    }

    .help-content-scroll {
        padding: 0;
        overflow: visible;
    }

    .help-article-content h1,
    .help-article-content h2,
    .help-article-content h3 {
        color: black;
    }

    .help-article-content p,
    .help-article-content li,
    .help-article-content td {
        color: #333333;
    }

    .help-article-content pre {
        border: 0.0625rem solid #cccccc;
        background: #f5f5f5;
        color: #333333;
    }

    .help-article-content table {
        border-collapse: collapse;
    }

    .help-article-content th {
        background: #eeeeee;
        color: black;
    }

    .callout-info,
    .callout-warning,
    .callout-success,
    .callout-danger,
    .callout-tip {
        border-left-width: 0.1875rem;
    }

    .help-quick-card {
        break-inside: avoid;
        border: 0.0625rem solid #cccccc;
    }
}
