.help-content-display,
body.mce-content-body {
    font-size: 0.95rem;
    line-height: 1.65;
    color: #212529;
}

body.mce-content-body {
    padding: 1rem 1.25rem;
    max-width: 1100px;
}

.help-content-display h1,
body.mce-content-body h1 {
    font-size: 1.85rem;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: -0.01em;
    margin: 0 0 0.35rem;
    padding-bottom: 0.6rem;
    border-bottom: 3px solid var(--main-color);
}

.help-content-display h2,
body.mce-content-body h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1f2937;
    margin-top: 2.75rem;
    margin-bottom: 0.9rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--main-color-subtle);
}

    .help-content-display h2::before,
    body.mce-content-body h2::before {
        content: "";
        display: inline-block;
        width: 6px;
        height: 1.05em;
        margin-right: 0.6rem;
        border-radius: 3px;
        background: var(--main-color);
        vertical-align: -0.14em;
    }

.help-content-display h3,
body.mce-content-body h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--main-color);
    margin-top: 1.9rem;
    margin-bottom: 0.6rem;
    padding-top: 0;
}

.help-content-display h4,
body.mce-content-body h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-top: 1.4rem;
    margin-bottom: 0.5rem;
}

.help-content-display h2 + hr,
body.mce-content-body h2 + hr {
    display: none;
}

.help-content-display hr,
body.mce-content-body hr {
    border: 0;
    border-top: 1px solid #e9ecef;
    margin: 1.75rem 0;
}

.help-content-display p,
body.mce-content-body p {
    margin: 0 0 0.8rem;
}

.help-lead {
    font-size: 1.02rem;
    color: #4b5563;
    margin-bottom: 1.5rem !important;
}

.help-content-display img.help-icon,
body.mce-content-body img.help-icon,
img.help-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    min-width: 1em;
    margin: 0 0.4rem 0 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    vertical-align: -0.14em;
    cursor: inherit;
    flex-shrink: 0;
}

.help-content-display ul,
.help-content-display ol,
body.mce-content-body ul,
body.mce-content-body ol {
    margin: 0 0 0.9rem;
    padding-left: 1.4rem;
}

    .help-content-display li,
    body.mce-content-body li {
        margin-bottom: 0.35rem;
    }

    .help-content-display li > ul,
    .help-content-display li > ol,
    body.mce-content-body li > ul,
    body.mce-content-body li > ol {
        margin-top: 0.35rem;
    }

.help-content-display strong,
body.mce-content-body strong {
    font-weight: 600;
    color: #111827;
}

.help-content-display a,
body.mce-content-body a {
    color: var(--main-color);
    text-decoration: none;
    border-bottom: 1px solid var(--main-color-subtle);
}

    .help-content-display a:hover,
    body.mce-content-body a:hover {
        color: var(--main-color-hover);
        border-bottom-color: var(--main-color-hover);
    }

.help-content-display img:not(.help-icon),
body.mce-content-body img:not(.help-icon) {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1.1rem 0 1.35rem;
    padding: 6px;
    background: #fff;
    border: 1px solid #dcdfe3;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
    cursor: zoom-in;
    transition: border-color 0.15s, box-shadow 0.15s;
}

    .help-content-display img:not(.help-icon):hover {
        border-color: var(--main-color-subtle);
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
    }

.help-table,
.help-content-display table,
body.mce-content-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.9rem 0 1.4rem;
    font-size: 0.92em;
}

    .help-table th,
    .help-table td,
    .help-content-display table th,
    .help-content-display table td,
    body.mce-content-body table th,
    body.mce-content-body table td {
        border: 1px solid #e5e7eb;
        padding: 0.5rem 0.7rem;
        text-align: left;
        vertical-align: top;
    }

    .help-table thead th,
    .help-content-display table thead th,
    body.mce-content-body table thead th {
        background: #f3f4f6;
        color: #374151;
        font-weight: 600;
        border-bottom-width: 2px;
    }

    .help-table tbody tr:nth-child(even),
    .help-content-display table tbody tr:nth-child(even) {
        background: #fbfbfc;
    }

    .help-table tbody tr:hover,
    .help-content-display table tbody tr:hover {
        background: #fdf6f1;
    }

.help-note,
.help-tip,
.help-shot {
    margin: 1rem 0 1.2rem;
    padding: 0.7rem 1rem;
    border-radius: 6px;
    line-height: 1.6;
}

.help-note {
    border-left: 4px solid var(--warning-color);
    background: #fffaf0;
}

.help-tip {
    border-left: 4px solid #0d6efd;
    background: #f2f7ff;
}

.help-shot {
    border: 1px dashed var(--main-color);
    background: #fdf6f1;
    color: #8a4b1d;
}

.help-content-display kbd,
body.mce-content-body kbd {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    font-family: inherit;
    font-size: 0.85em;
    font-weight: 600;
    color: #1f2937;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-bottom-width: 2px;
    border-radius: 4px;
}

.help-content-display > *:first-child,
body.mce-content-body > *:first-child {
    margin-top: 0;
}

@media (max-width: 768px) {
    .help-table,
    .help-content-display table {
        display: block;
        overflow-x: auto;
        white-space: normal;
    }
}

@media print {
    html, body {
        overflow: visible !important;
        height: auto !important;
    }

    .header-navbar,
    .okapi-sidebar,
    .help-page-toolbar,
    .help-toc-sidebar,
    .toc-toggle-button,
    .help-back-to-top,
    .hidden-order-bar,
    .content-background {
        display: none !important;
    }

    .page,
    .page-layout,
    .content,
    .layout-item {
        height: auto !important;
        overflow: visible !important;
        padding: 0 !important;
        background: none !important;
    }

    .help-content-display {
        border: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;
        max-width: none !important;
    }

        .help-content-display h1,
        .help-content-display h2,
        .help-content-display h3,
        .help-content-display h4 {
            break-before: auto;
            page-break-before: auto;
            break-after: avoid;
            page-break-after: avoid;
            margin-top: 1.2rem;
        }

        .help-content-display p,
        .help-content-display li {
            orphans: 3;
            widows: 3;
        }

        .help-content-display table {
            break-inside: auto;
            page-break-inside: auto;
        }

            .help-content-display table thead {
                display: table-header-group;
            }

            .help-content-display table tr {
                break-inside: avoid;
                page-break-inside: avoid;
            }

        .help-content-display img:not(.help-icon) {
            break-inside: avoid;
            page-break-inside: avoid;
            box-shadow: none;
            margin: 0.6rem 0 0.8rem;
        }

        .help-content-display .help-note,
        .help-content-display .help-tip {
            break-inside: avoid;
            page-break-inside: avoid;
        }
}

/* ---------------------------------------------------------------------------
   Motyw ciemny treści pomocy.

   Reguły obejmują dwa konteksty naraz: stronę pomocy (.help-content-display)
   oraz obszar edycji HugeRTE (body.mce-content-body), który jest osobnym
   dokumentem w iframe — atrybut data-bs-theme ustawia na nim handler „init”
   w Hugerte.Blazor.js, więc ten sam prefiks działa w obu miejscach.

   Powyższy arkusz ma kolory tekstu i jasne tła bloków wpisane na sztywno,
   dlatego samo przyciemnienie karty dałoby ciemny tekst na ciemnym tle —
   każdy taki blok ma tu swój odpowiednik.
   --------------------------------------------------------------------------- */

html[data-bs-theme="dark"] .help-content-display,
html[data-bs-theme="dark"] body.mce-content-body {
    background: var(--surface-color);
    border-color: var(--surface-border-color);
    color: var(--text-color);
}

/* Akapit wprowadzający ma zaszyty szary #4b5563 — na ciemnym tle gaśnie. */
html[data-bs-theme="dark"] .help-lead {
    color: var(--text-color);
}

/* Ikony pozycji menu i przycisków to czarne SVG wstawiane jako <img>.
   Ta sama inwersja co dla ikon aplikacji w theme-dark.css. */
html[data-bs-theme="dark"] .help-content-display img.help-icon,
html[data-bs-theme="dark"] body.mce-content-body img.help-icon,
html[data-bs-theme="dark"] img.help-icon {
    filter: invert(88%) brightness(105%);
}

html[data-bs-theme="dark"] .help-content-display h1,
html[data-bs-theme="dark"] body.mce-content-body h1,
html[data-bs-theme="dark"] .help-content-display h2,
html[data-bs-theme="dark"] body.mce-content-body h2,
html[data-bs-theme="dark"] .help-content-display h4,
html[data-bs-theme="dark"] body.mce-content-body h4,
html[data-bs-theme="dark"] .help-content-display strong,
html[data-bs-theme="dark"] body.mce-content-body strong {
    color: var(--text-color);
}

/* Nagłówki h3 i odnośniki biorą kolor odnośnika z palety ciemnej, a nie akcent
   firmowy — ten na ciemnym tle ma kontrast tuż przy progu czytelności. */
html[data-bs-theme="dark"] .help-content-display h3,
html[data-bs-theme="dark"] body.mce-content-body h3,
html[data-bs-theme="dark"] .help-content-display a,
html[data-bs-theme="dark"] body.mce-content-body a {
    color: var(--link-color);
}

html[data-bs-theme="dark"] .help-content-display a,
html[data-bs-theme="dark"] body.mce-content-body a {
    border-bottom-color: var(--main-color-subtle);
}

    html[data-bs-theme="dark"] .help-content-display a:hover,
    html[data-bs-theme="dark"] body.mce-content-body a:hover {
        color: #f0a06a;
        border-bottom-color: #f0a06a;
    }

/* Zrzuty ekranu przedstawiają jasny interfejs — podkład zostaje jasny,
   żeby grafiki nie „pływały” na ciemnym tle. Zmienia się tylko ramka. */
html[data-bs-theme="dark"] .help-content-display img:not(.help-icon),
html[data-bs-theme="dark"] body.mce-content-body img:not(.help-icon) {
    border-color: var(--surface-border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

html[data-bs-theme="dark"] .help-table th,
html[data-bs-theme="dark"] .help-table td,
html[data-bs-theme="dark"] .help-content-display table th,
html[data-bs-theme="dark"] .help-content-display table td,
html[data-bs-theme="dark"] body.mce-content-body table th,
html[data-bs-theme="dark"] body.mce-content-body table td {
    border-color: var(--surface-border-color);
}

html[data-bs-theme="dark"] .help-table thead th,
html[data-bs-theme="dark"] .help-content-display table thead th,
html[data-bs-theme="dark"] body.mce-content-body table thead th {
    background: var(--header-color);
    color: var(--text-color);
}

html[data-bs-theme="dark"] .help-table tbody tr:nth-child(even),
html[data-bs-theme="dark"] .help-content-display table tbody tr:nth-child(even) {
    background: var(--surface-color-2);
}

html[data-bs-theme="dark"] .help-table tbody tr:hover,
html[data-bs-theme="dark"] .help-content-display table tbody tr:hover {
    background: var(--main-color-subtle);
}

/* Bloki wyróżnione — jasne pastele zastąpione przygaszonymi odpowiednikami
   w tych samych barwach, żeby zachować ich rozróżnialność. */
html[data-bs-theme="dark"] .help-note {
    background: #2f2718;
}

html[data-bs-theme="dark"] .help-content-display hr,
html[data-bs-theme="dark"] body.mce-content-body hr {
    border-top-color: var(--surface-border-color);
}

html[data-bs-theme="dark"] .help-tip {
    background: #17263d;
}

html[data-bs-theme="dark"] .help-shot {
    background: #2c1d12;
    color: #e2ac83;
}

html[data-bs-theme="dark"] .help-content-display kbd,
html[data-bs-theme="dark"] body.mce-content-body kbd {
    color: var(--text-color);
    background: var(--surface-color-2);
    border-color: var(--surface-border-color);
}

/* Wydruk zawsze na biało, niezależnie od motywu ekranu. */
@media print {
    html[data-bs-theme="dark"] .help-content-display,
    html[data-bs-theme="dark"] .help-content-display * {
        background: #fff !important;
        color: #000 !important;
    }
}
