/* ============================================================
   HELP & DOCUMENTATION — Tabbed Interface
   Forced dark background, light text. Independent of theme.
   ============================================================ */

/* ---------- Force dark canvas regardless of theme ---------- */
.help-hero,
.help-wrap {
    background: #0A0A0A;
    color: #E8E8E8;
}

/* ---------- Hero ---------- */
.help-hero {
    padding: 3.5rem 0 2.5rem;
    border-bottom: 1px solid rgba(201, 162, 39, 0.15);
    background:
        radial-gradient(circle at 20% 30%, rgba(201,162,39,0.08) 0%, transparent 45%),
        radial-gradient(circle at 80% 70%, rgba(201,162,39,0.05) 0%, transparent 45%),
        #0A0A0A;
}
.help-hero__content {
    text-align: center;
    max-width: 780px;
    margin: 0 auto;
}
.help-hero h1 {
    font-family: var(--font-serif);
    font-size: clamp(1.9rem, 4vw, 2.6rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    background: linear-gradient(90deg, #ffffff 0%, #E8D48B 55%, #C9A227 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.75rem;
}
.help-hero p {
    color: #A8A8A8;
    font-size: 1rem;
    max-width: 60ch;
    margin: 0 auto 1.75rem;
    line-height: 1.6;
}

/* ---------- Search ---------- */
.help-search {
    position: relative;
    max-width: 620px;
    margin: 0 auto;
}
.help-search__icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #8a8a8a;
    pointer-events: none;
    z-index: 2;
}
.help-search input {
    width: 100%;
    padding: 1rem 3rem;
    background: #141414;
    border: 1px solid #2A2A2A;
    border-radius: 100px;
    color: #F5F5F5 !important;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.help-search input::placeholder { color: #666; }
.help-search input:focus {
    border-color: #C9A227;
    box-shadow: 0 0 0 4px rgba(201,162,39,0.18);
    background: #1a1a1a;
}
.help-search__clear {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #222;
    border: none;
    color: #A0A0A0;
    cursor: pointer;
    font-size: 1.15rem;
    line-height: 1;
    display: grid;
    place-items: center;
    transition: color 0.2s, background 0.2s;
    z-index: 2;
}
.help-search__clear:hover { color: #C9A227; background: #2a2a2a; }
.help-search__hint {
    text-align: center;
    font-size: 0.78rem;
    color: #666;
    margin-top: 0.75rem;
}
.help-search__hint kbd {
    background: #1a1a1a;
    border: 1px solid #2A2A2A;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-family: inherit;
    color: #A8A8A8;
    margin: 0 1px;
}

/* ---------- Tab wrapper ---------- */
.help-wrap {
    padding-top: 2rem;
    padding-bottom: 4rem;
    min-height: 60vh;
}

/* ---------- Tab navigation ---------- */
.help-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    border-bottom: 2px solid #1f1f1f;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.help-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.15rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #A0A0A0 !important;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    margin-bottom: -2px;
    white-space: nowrap;
    border-radius: 8px 8px 0 0;
}
.help-tab:hover {
    color: #F5F5F5 !important;
    background: rgba(201,162,39,0.05);
}
.help-tab.is-active {
    color: #E8D48B !important;
    border-bottom-color: #C9A227;
    background: linear-gradient(180deg, transparent, rgba(201,162,39,0.08));
}
.help-tab.has-match {
    color: #C9A227 !important;
}
.help-tab.has-match::after {
    content: '●';
    color: #C9A227;
    font-size: 0.6rem;
    margin-left: 0.25rem;
}
.help-tab__num {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #1f1f1f;
    color: #8a8a8a;
    font-size: 0.72rem;
    font-weight: 700;
    transition: background 0.2s, color 0.2s;
}
.help-tab.is-active .help-tab__num {
    background: linear-gradient(135deg, #E8D48B, #C9A227);
    color: #0A0A0A;
}
.help-tab--admin {
    margin-left: auto;
    color: #E8D48B !important;
}
.help-tab--admin .help-tab__num {
    background: linear-gradient(135deg, #E8D48B, #C9A227);
    color: #0A0A0A;
}
@media (max-width: 768px) {
    .help-tab {
        padding: 0.7rem 0.85rem;
        font-size: 0.78rem;
    }
    .help-tab__label { display: none; }
    .help-tab__num { width: 26px; height: 26px; font-size: 0.8rem; }
    .help-tab--admin { margin-left: 0; }
}

/* ---------- Panels ---------- */
.help-panel {
    animation: helpPanelIn 0.3s ease;
}
.help-panel.is-active { display: block !important; }
.help-panel[hidden] { display: none !important; }

@keyframes helpPanelIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Content typography (light text on dark) ---------- */
.help-panel {
    color: #D8D8D8;
}
.help-panel h2 {
    font-family: var(--font-serif);
    font-size: clamp(1.5rem, 3vw, 1.9rem);
    color: #F5F5F5 !important;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #C9A227;
    display: inline-block;
}
.help-panel h3 {
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    color: #E8D48B !important;
    margin: 2rem 0 0.75rem;
    letter-spacing: 0.01em;
}
.help-panel h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #F5F5F5 !important;
    margin-bottom: 0.4rem;
}
.help-panel p,
.help-panel ul,
.help-panel ol,
.help-panel dl {
    line-height: 1.75;
    color: #B8B8B8;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}
.help-panel .lead {
    font-size: 1.05rem;
    color: #E8E8E8 !important;
    line-height: 1.7;
    margin-bottom: 1.25rem;
}
.help-panel ul,
.help-panel ol { padding-left: 1.5rem; }
.help-panel li { margin-bottom: 0.4rem; }
.help-panel strong { color: #F5F5F5 !important; font-weight: 600; }
.help-panel em { color: #E8D48B; font-style: italic; }
.help-panel a {
    color: #C9A227 !important;
    text-decoration: none;
    border-bottom: 1px solid rgba(201,162,39,0.35);
    transition: color 0.2s, border-color 0.2s;
}
.help-panel a:hover {
    color: #E8D48B !important;
    border-bottom-color: #E8D48B;
}
.help-panel code {
    background: #1a1a1a;
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.88em;
    color: #E8D48B;
    font-family: 'Menlo', 'Consolas', monospace;
    border: 1px solid #2A2A2A;
}
.help-panel .text-muted { color: #8a8a8a !important; }

/* ---------- Steps ---------- */
.help-steps {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin: 1.5rem 0;
}
.help-step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.1rem 1.25rem;
    background: #141414;
    border: 1px solid #242424;
    border-radius: 12px;
    transition: border-color 0.25s, transform 0.25s;
}
.help-step:hover {
    border-color: rgba(201,162,39,0.45);
    transform: translateX(3px);
}
.help-step__num {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E8D48B, #C9A227);
    color: #0A0A0A;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.9rem;
}
.help-step strong {
    color: #F5F5F5 !important;
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}
.help-step p { margin: 0 !important; font-size: 0.9rem; color: #A8A8A8; }

/* ---------- Callouts ---------- */
.help-callout {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin: 1.25rem 0;
    font-size: 0.92rem;
    line-height: 1.6;
    border-left: 3px solid;
}
.help-callout--info {
    background: rgba(135,206,235,0.08);
    border-left-color: #87CEEB;
    color: #A8A8A8;
}
.help-callout--warn {
    background: rgba(250,204,21,0.08);
    border-left-color: #FACC15;
    color: #A8A8A8;
}
.help-callout strong { color: #F5F5F5 !important; }

/* ---------- Feature grid ---------- */
.help-features {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0 2rem;
}
.help-feature {
    background: #141414;
    border: 1px solid #242424;
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.25s ease;
}
.help-feature:hover {
    border-color: rgba(201,162,39,0.45);
    transform: translateY(-3px);
    box-shadow: 0 12px 28px -15px rgba(0,0,0,0.7);
}
.help-feature__icon {
    font-size: 1.7rem;
    margin-bottom: 0.6rem;
    line-height: 1;
}
.help-feature h4 {
    color: #C9A227 !important;
    font-size: 0.95rem !important;
    margin-bottom: 0.5rem !important;
}
.help-feature p {
    font-size: 0.85rem !important;
    margin: 0 !important;
    line-height: 1.6;
    color: #A8A8A8;
}

/* ---------- Tables ---------- */
.help-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
    font-size: 0.9rem;
    background: #141414;
    border: 1px solid #242424;
    border-radius: 10px;
    overflow: hidden;
}
.help-table th,
.help-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #242424;
    vertical-align: top;
}
.help-table th {
    background: #1a1a1a;
    color: #C9A227 !important;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}
.help-table tr:last-child td { border-bottom: none; }
.help-table tr:hover td { background: rgba(255,255,255,0.015); }
.help-table td { color: #B8B8B8; }
.help-table td strong { color: #F5F5F5 !important; }
.help-table td code {
    background: #0f0f0f;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    color: #E8D48B;
}

.help-table kbd {
    background: #1a1a1a;
    border: 1px solid #2A2A2A;
    border-bottom-width: 2px;
    border-radius: 5px;
    padding: 3px 8px;
    font-family: 'Menlo', 'Consolas', monospace;
    font-size: 0.8rem;
    color: #F5F5F5;
    margin: 0 2px;
    display: inline-block;
}

/* ---------- FAQ accordion ---------- */
.help-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 1.5rem 0;
}
.help-faq {
    background: #141414;
    border: 1px solid #242424;
    border-radius: 12px;
    transition: border-color 0.25s;
    overflow: hidden;
}
.help-faq:hover { border-color: rgba(201,162,39,0.45); }
.help-faq[open] { border-color: #C9A227; }
.help-faq summary {
    padding: 1.1rem 1.25rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: #F5F5F5;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: color 0.2s;
}
.help-faq summary::-webkit-details-marker { display: none; }
.help-faq summary::after {
    content: '+';
    font-size: 1.4rem;
    font-weight: 300;
    color: #C9A227;
    transition: transform 0.25s;
    line-height: 1;
    flex-shrink: 0;
}
.help-faq[open] summary::after { transform: rotate(45deg); }
.help-faq summary:hover { color: #C9A227; }
.help-faq__body {
    padding: 0 1.25rem 1.25rem;
    color: #A8A8A8;
    font-size: 0.92rem;
    line-height: 1.7;
    animation: helpFadeIn 0.25s ease;
}
@keyframes helpFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Glossary ---------- */
.help-glossary {
    display: grid;
    gap: 1rem;
    margin: 1.5rem 0;
}
.help-glossary dt {
    font-weight: 700;
    color: #C9A227 !important;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}
.help-glossary dd {
    color: #A8A8A8;
    font-size: 0.9rem;
    line-height: 1.65;
    padding-left: 1rem;
    border-left: 2px solid #242424;
    margin-left: 0;
}

/* ---------- Contact cards ---------- */
.help-contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}
.help-contact-card {
    background: #141414;
    border: 1px solid #242424;
    border-radius: 12px;
    padding: 1.5rem 1.25rem;
    transition: all 0.25s;
    text-align: center;
}
.help-contact-card:hover {
    border-color: #C9A227;
    transform: translateY(-3px);
}
.help-contact-card h4 {
    font-size: 1rem !important;
    color: #C9A227 !important;
    margin-bottom: 0.75rem !important;
}
.help-contact-card p {
    margin: 0.5rem 0 !important;
    font-size: 0.88rem;
    color: #A8A8A8;
}
.help-contact-card a {
    color: #E8D48B !important;
    font-weight: 600;
    font-size: 0.95rem;
    border: none !important;
}
.help-contact-card a:hover { color: #C9A227 !important; }
.help-contact-card p.text-muted {
    font-size: 0.78rem !important;
    margin: 0.5rem 0 0 !important;
    color: #8a8a8a !important;
}

/* ---------- Code blocks ---------- */
.help-code {
    background: #0f0f0f;
    border: 1px solid #242424;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    overflow-x: auto;
    font-size: 0.82rem;
    line-height: 1.6;
}
.help-code code {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    color: #E8D48B !important;
    font-family: 'Menlo', 'Consolas', monospace;
}

/* ---------- Changelog ---------- */
.help-changelog {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 1.5rem 0;
}
.help-changelog__item {
    position: relative;
    padding-left: 1.5rem;
    border-left: 2px solid #242424;
}
.help-changelog__item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 0.4rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #C9A227;
    box-shadow: 0 0 0 3px #0A0A0A;
}
.help-changelog__version {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    color: #C9A227 !important;
    font-weight: 600;
}
.help-changelog__date {
    font-size: 0.8rem;
    color: #666;
    margin-left: 0.75rem;
    letter-spacing: 0.05em;
}
.help-changelog__item ul {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
    font-size: 0.9rem;
    color: #A8A8A8;
}

/* ---------- Theme list ---------- */
.help-theme-list {
    columns: 2;
    column-gap: 2rem;
    font-size: 0.9rem;
    color: #A8A8A8;
}
@media (max-width: 600px) { .help-theme-list { columns: 1; } }
.help-theme-list li { break-inside: avoid; margin-bottom: 0.5rem; }
.help-theme-list strong { color: #F5F5F5 !important; }

/* ---------- No results ---------- */
.help-no-results {
    text-align: center;
    padding: 4rem 1rem;
    color: #A8A8A8;
}
.help-no-results svg { color: #C9A227; opacity: 0.5; margin-bottom: 1rem; }
.help-no-results p { font-size: 1rem; margin-bottom: 0.5rem; }
.help-no-results strong { color: #C9A227 !important; }

/* ---------- Search highlighting ---------- */
mark.help-highlight {
    background: #C9A227;
    color: #0A0A0A !important;
    padding: 0 2px;
    border-radius: 3px;
    font-weight: 600;
}

/* ---------- Print ---------- */
@media print {
    .site-header,
    .site-footer,
    .help-tabs,
    .help-search,
    .help-search__hint,
    .help-hero p,
    .lightbox { display: none !important; }
    body { background: white !important; color: black !important; }
    .help-hero,
    .help-wrap { background: white !important; color: black !important; }
    .help-panel { display: block !important; }
    .help-panel[hidden] { display: block !important; }
    .help-panel h2 { color: #000 !important; border-color: #000 !important; }
    .help-panel h3 { color: #333 !important; }
    .help-panel p,
    .help-panel li,
    .help-panel td { color: #333 !important; }
    .help-faq { border: 1px solid #ccc; }
    .help-faq__body { color: #333 !important; }
}