/******************************************************
 * Help pages — sci-fi dark theme
 ******************************************************/

.help-welcome-banner {
    background: rgba(0, 255, 157, 0.08);
    border: 1px solid rgba(0, 255, 157, 0.45);
    border-radius: 6px;
    box-shadow: 0 0 18px rgba(0, 255, 157, 0.12);
    color: #9dffd4;
    margin: 0 0 16px;
    padding: 10px 14px;
}

.help-welcome-banner a {
    color: #c8fff0;
}

.main:has(.help-page) {
    background: #070b12;
}

.main:has(.help-page) .interface {
    background:
        radial-gradient(circle at top left, rgba(251, 191, 36, 0.1), transparent 28%),
        radial-gradient(circle at top right, rgba(0, 229, 255, 0.08), transparent 24%),
        linear-gradient(180deg, #070b12 0%, #0c1220 48%, #090e16 100%);
    color: #d7e0f0;
    min-height: calc(var(--app-viewport-height) - 120px);
    padding: 24px 16px 76px;
}

.help-page {
    --help-border: #2a3a5c;
    --help-text-muted: #8b9bb8;
    --help-accent: #fbbf24;
    color: #d7e0f0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    margin: 0 auto;
    max-width: 1100px;
}

.help-shell {
    display: grid;
    gap: 20px;
}

.help-header {
    margin-bottom: 4px;
}

.help-page-title {
    color: #e8f4ff;
    font-size: 1.5rem;
    letter-spacing: 0.05em;
    margin: 0 0 8px;
    text-shadow: 0 0 18px rgba(251, 191, 36, 0.22);
    text-transform: uppercase;
}

.help-page-subtitle {
    color: var(--help-text-muted);
    font-size: 0.92rem;
    margin: 0;
    max-width: 42rem;
}

.help-card-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.help-card {
    background: linear-gradient(180deg, rgba(24, 34, 53, 0.96) 0%, rgba(16, 24, 39, 0.98) 100%);
    border: 1px solid var(--help-border);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    color: inherit;
    display: grid;
    gap: 10px;
    padding: 18px 18px 16px;
    text-decoration: none;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.help-card:hover {
    border-color: rgba(251, 191, 36, 0.55);
    transform: translateY(-1px);
}

.help-card-tag {
    color: var(--help-accent);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.help-card-title {
    color: #e8f4ff;
    font-size: 1.05rem;
    margin: 0;
}

.help-card-summary {
    color: var(--help-text-muted);
    font-size: 0.88rem;
    line-height: 1.45;
    margin: 0;
}

.help-reader {
    align-items: start;
    gap: 24px;
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
}

.help-sidebar {
    position: sticky;
    top: 16px;
}

.help-nav {
    background: linear-gradient(180deg, rgba(24, 34, 53, 0.96) 0%, rgba(16, 24, 39, 0.98) 100%);
    border: 1px solid var(--help-border);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    padding: 16px;
}

.help-nav-home {
    color: var(--help-accent);
    display: inline-block;
    font-size: 0.84rem;
    margin-bottom: 12px;
    text-decoration: none;
}

.help-nav-home:hover {
    color: #fde68a;
}

.help-nav-list {
    display: grid;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.help-nav-item a {
    color: #e8f4ff;
    display: block;
    font-size: 0.92rem;
    text-decoration: none;
}

.help-nav-item a:hover {
    color: #fde68a;
}

.help-nav-item-active {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.35);
    border-radius: 8px;
    padding: 8px 10px;
}

.help-nav-item:not(.help-nav-item-active) {
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 8px 10px;
}

.help-nav-tag {
    color: var(--help-text-muted);
    display: block;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    margin-top: 4px;
    text-transform: uppercase;
}

.help-article {
    background: linear-gradient(180deg, rgba(24, 34, 53, 0.96) 0%, rgba(16, 24, 39, 0.98) 100%);
    border: 1px solid var(--help-border);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    min-width: 0;
    padding: 24px 22px;
}

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

.help-article-content h2[id] {
    scroll-margin-top: 20px;
}

.help-article-toc {
    background: rgba(10, 16, 26, 0.72);
    border: 1px solid rgba(42, 58, 92, 0.85);
    border-radius: 8px;
    margin: 0 0 20px;
    padding: 14px 16px;
}

.help-article-toc-title {
    color: #c5d4ea;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    margin: 0 0 10px;
    text-transform: uppercase;
}

.help-article-toc-list {
    display: grid;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.help-article-toc-list a {
    color: #fde68a;
    font-size: 0.9rem;
    text-decoration: none;
}

.help-article-toc-list a:hover {
    color: #fff3bf;
}

.help-article-content p.helptext,
.help-article-content li.helptext {
    color: #c5d4ea;
    line-height: 1.55;
    max-width: none;
}

.help-article-content a {
    color: #fde68a;
}

.help-article-content pre.help-code-block {
    background: rgba(10, 16, 26, 0.95);
    border: 1px solid rgba(42, 58, 92, 0.85);
    border-left: 3px solid rgba(251, 191, 36, 0.75);
    border-radius: 6px;
    color: #d8f3ff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.88rem;
    line-height: 1.45;
    margin: 12px 0;
    overflow-x: auto;
    padding: 12px 14px;
    white-space: pre;
}

.help-article-content pre.help-code-block code {
    font: inherit;
}

.help-table-wrap {
    margin: 16px 0;
    overflow-x: auto;
}

.help-article-content p.codeexample {
    background: rgba(10, 16, 26, 0.95);
    border: 1px solid rgba(42, 58, 92, 0.85);
    border-radius: 6px;
    color: #d8f3ff;
    font-family: monospace;
    margin: 12px 0;
    overflow-x: auto;
    padding: 12px 14px;
    white-space: pre;
}

.help-article-content table.helptable {
    border: 1px solid rgba(42, 58, 92, 0.85);
    border-collapse: collapse;
    margin: 0;
    min-width: 520px;
    width: 100%;
}

.help-article-content tbody tr:nth-child(even) td.helptable {
    background: rgba(20, 30, 48, 0.92);
}

.help-article-content th.helptable,
.help-article-content td.helptable {
    border: 1px solid rgba(42, 58, 92, 0.85);
    padding: 8px 10px;
    text-align: left;
}

.help-article-content th.helptable {
    background: rgba(10, 16, 26, 0.95);
    color: #e8f4ff;
}

.help-article-content td.helptable {
    background: rgba(16, 24, 39, 0.92);
    color: #c5d4ea;
}

.help-spoiler-banner {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.45);
    border-radius: 6px;
    color: #fde68a;
    margin: 0 0 16px;
    padding: 10px 14px;
}

.help-tutorial-header {
    margin-bottom: 16px;
}

.help-tutorial-progress {
    color: var(--help-text-muted);
    font-size: 0.88rem;
    letter-spacing: 0.06em;
    margin: 8px 0 0;
    text-transform: uppercase;
}

.help-tutorial-step h2 {
    color: #e8f4ff;
    font-size: 1.15rem;
    margin: 0 0 12px;
}

.help-tutorial-step code {
    background: rgba(10, 16, 26, 0.95);
    border-radius: 4px;
    color: #d8f3ff;
    padding: 1px 6px;
}

.help-action-link-wrap {
    margin: 14px 0 0;
}

.help-action-link {
    color: #111827;
    background: rgba(251, 191, 36, 0.92);
    border-radius: 999px;
    display: inline-block;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 8px 14px;
    text-decoration: none;
}

.help-action-link:hover {
    background: #fde68a;
}

.help-tutorial-nav {
    border-top: 1px solid rgba(42, 58, 92, 0.85);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 16px;
}

.help-tutorial-nav-link {
    color: #c5d4ea;
    font-size: 0.88rem;
    text-decoration: none;
}

.help-tutorial-nav-link:hover {
    color: #fde68a;
}

.help-tutorial-nav-link-primary {
    color: var(--help-accent);
    font-weight: 600;
}

.help-tutorial-nav-link-disabled {
    color: rgba(139, 155, 184, 0.55);
}

@media (max-width: 900px) {
    .help-reader {
        grid-template-columns: 1fr;
    }

    .help-sidebar {
        position: static;
    }
}
