/* Basic page colors */
html[data-theme="dark"] body {
    background-color: var(--theme-bg);
    color: var(--theme-text);
}

/* Tailwind / Bootstrap background overrides used in the main layout */
html[data-theme="dark"] .bg-white {
    background-color: var(--theme-surface) !important;
}

html[data-theme="dark"] .bg-gray-700,
html[data-theme="dark"] .bg-dark {
    background-color: var(--theme-surface-strong) !important;
}

html[data-theme="dark"] .hover\:bg-gray-50:hover {
    background-color: #263449 !important;
}

/* Navbar text only */
html[data-theme="dark"] nav a,
html[data-theme="dark"] nav button:not(.theme-toggle-button) {
    color: #e5e7eb !important;
}

html[data-theme="dark"] nav a:hover,
html[data-theme="dark"] nav button:not(.theme-toggle-button):hover {
    color: var(--link-color-hover) !important;
}

/* Keep text readable inside light cards that are not converted yet */
html[data-theme="dark"] .card,
html[data-theme="dark"] .card h1,
html[data-theme="dark"] .card h2,
html[data-theme="dark"] .card h3,
html[data-theme="dark"] .card h4,
html[data-theme="dark"] .card h5,
html[data-theme="dark"] .card h6,
html[data-theme="dark"] .card p {
    color: #374151;
}

/* Navbar / dropdowns */
html[data-theme="dark"] nav {
    border-color: var(--theme-border);
}

html[data-theme="dark"] #packages-menu {
    background-color: var(--theme-surface) !important;
    border: 1px solid var(--theme-border);
    box-shadow: 0 16px 40px var(--theme-shadow);
}

html[data-theme="dark"] #packages-menu a {
    color: var(--theme-text-muted) !important;
}

html[data-theme="dark"] #packages-menu a:hover {
    background-color: #263449 !important;
    color: var(--link-color-hover) !important;
}

html[data-theme="dark"] #mobile-menu {
    background-color: var(--theme-surface);
}

/* Cookie banner */
html[data-theme="dark"] #cookies-banner {
    background-color: #111827 !important;
    border-top: 1px solid var(--theme-border);
}

html[data-theme="dark"] #accept-necessary-cookies {
    background-color: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
}

/* Cards and simple surfaces */
html[data-theme="dark"] .shadow-sm,
html[data-theme="dark"] .shadow-lg {
    box-shadow: 0 16px 40px var(--theme-shadow) !important;
}

/* Theme toggle button */
.theme-toggle-button {
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    min-height: 2rem;
    font-size: 0.8rem;
    line-height: 1.2;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    touch-action: manipulation;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.theme-toggle-button:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.65);
    transform: translateY(-1px);
}

html[data-theme="dark"] .theme-toggle-button {
    background: rgba(170, 214, 211, 0.16);
    border-color: rgba(170, 214, 211, 0.55);
}

#theme-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    font-size: 0.95rem;
    line-height: 1;
    transition:
        color 0.2s ease,
        transform 0.2s ease;
}

/* Moon icon: button will enable dark mode */
html[data-theme="light"] #theme-toggle-icon {
    color: #dbeafe;
}

/* Sun icon: button will enable light mode */
html[data-theme="dark"] #theme-toggle-icon {
    color: #facc15;
}

.theme-toggle-button:hover #theme-toggle-icon {
    transform: scale(1.1);
}

/* Dark theme readability for main content pages */
html[data-theme="dark"] main.text-gray-800 {
    color: var(--theme-text) !important;
}

html[data-theme="dark"] main.text-gray-800 h1,
html[data-theme="dark"] main.text-gray-800 h2 {
    color: var(--theme-text) !important;
}

html[data-theme="dark"] main.text-gray-800 > section > p {
    color: var(--theme-text-muted) !important;
}


/* Keep instruction cards readable when cards stay light */
html[data-theme="dark"] main.text-gray-800 .instruction-card {
    background: #ffffff !important;
    border-color: #e5e7eb !important;
    color: #111827 !important;
}

html[data-theme="dark"] main.text-gray-800 .instruction-card h1,
html[data-theme="dark"] main.text-gray-800 .instruction-card h2,
html[data-theme="dark"] main.text-gray-800 .instruction-card h3,
html[data-theme="dark"] main.text-gray-800 .instruction-card h4,
html[data-theme="dark"] main.text-gray-800 .instruction-card h5,
html[data-theme="dark"] main.text-gray-800 .instruction-card h6 {
    color: #111827 !important;
}

html[data-theme="dark"] main.text-gray-800 .instruction-card p {
    color: #4b5563 !important;
}

html[data-theme="dark"] main.text-gray-800 .instruction-card p.text-\[\#467886\] {
    color: #467886 !important;
}

html[data-theme="dark"] main.text-gray-800 .instruction-card a {
    color: #007bff !important;
}

/* Dark theme: public page headers, e.g. Blog */
html[data-theme="dark"] .container > .text-center h1.text-gray-800 {
    color: var(--theme-text) !important;
}

html[data-theme="dark"] .container > .text-center p.text-gray-600 {
    color: var(--theme-text-muted) !important;
}

/* Dark theme: Twoje potrzeby - kontakt page */
html[data-theme="dark"] .page-content {
    background: var(--theme-bg) !important;
    color: var(--theme-text) !important;
}

html[data-theme="dark"] .page-content .header,
html[data-theme="dark"] .page-content .card,
html[data-theme="dark"] .page-content .prompt-box,
html[data-theme="dark"] .page-content .prompt-replacements,
html[data-theme="dark"] .page-content .prompt-box .instructions {
    background: var(--theme-surface) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text) !important;
    box-shadow: 0 16px 40px var(--theme-shadow) !important;
}

html[data-theme="dark"] .page-content .card.prompt-card {
    background: var(--theme-bg-soft) !important;
    border-color: rgba(170, 214, 211, 0.55) !important;
}

html[data-theme="dark"] .page-content .header h1,
html[data-theme="dark"] .page-content .section-title,
html[data-theme="dark"] .page-content .card h3,
html[data-theme="dark"] .page-content .prompt-box h2,
html[data-theme="dark"] .page-content .prompt-replacements-label {
    color: var(--theme-text) !important;
}

html[data-theme="dark"] .page-content .header p,
html[data-theme="dark"] .page-content .card p,
html[data-theme="dark"] .page-content .prompt-box .instructions,
html[data-theme="dark"] .page-content .prompt-textarea {
    color: var(--theme-text-muted) !important;
}

html[data-theme="dark"] .page-content .card-icon {
    background: rgba(170, 214, 211, 0.12) !important;
    border-color: rgba(170, 214, 211, 0.35) !important;
    color: var(--link-color-hover) !important;
}

html[data-theme="dark"] .page-content .card-icon i,
html[data-theme="dark"] .page-content .prompt-title-icon,
html[data-theme="dark"] .page-content .btn-copy .icon i {
    color: var(--link-color-hover) !important;
}

html[data-theme="dark"] .page-content .prompt-textarea {
    background: #111827 !important;
    border-color: var(--theme-border) !important;
}

html[data-theme="dark"] .page-content .btn-close {
    background: #374151 !important;
    color: var(--theme-text) !important;
}

html[data-theme="dark"] .page-content a {
    color: var(--link-color-hover) !important;
}

/* Dark theme: homepage section headings readability */
html[data-theme="dark"] .bg-\[\#fafae7\].bg-opacity-40 > .max-w-7xl > h2.text-\[\#4f4f4f\] {
    color: #f3f4f6 !important;
}

html[data-theme="dark"] .bg-\[\#fafae7\].bg-opacity-40 > .max-w-7xl > p.text-\[\#95a5a6\] {
    color: #cbd5e1 !important;
}

/* Dark theme: homepage about section text */
html[data-theme="dark"] .bg-white > .max-w-7xl h2.text-\[\#4f4f4f\],
html[data-theme="dark"] .bg-white > .max-w-7xl h3.text-\[\#4f4f4f\] {
    color: #f3f4f6 !important;
}

html[data-theme="dark"] .bg-white > .max-w-7xl p.text-\[\#b9b9b9\] {
    color: #d1d5db !important;
}

/* Dark theme: homepage final about heading */
html[data-theme="dark"] .bg-white > h3.text-\[\#4f4f4f\] {
    color: #f3f4f6 !important;
}

/* Dark theme: updated homepage sections */

/* Company size section heading */
html[data-theme="dark"] #company-size-selection-header {
    color: #f3f4f6 !important;
}

/* BAP identity / about section headings */
html[data-theme="dark"] #bap-identity-section h2.text-\[\#4f4f4f\],
html[data-theme="dark"] #bap-identity-section h3.text-\[\#4f4f4f\],
html[data-theme="dark"] #bap-identity-section p.text-\[\#4f4f4f\] {
    color: #f3f4f6 !important;
}

/* BAP identity / about section body text */
html[data-theme="dark"] #bap-identity-section p.text-\[\#a6a6a6\] {
    color: #cbd5e1 !important;
}

/* Dark theme: login / auth forms should stay readable */
html[data-theme="dark"] .login-container {
    background: #ffffff !important;
    color: #111827 !important;
    box-shadow: 0 16px 40px var(--theme-shadow) !important;
}

html[data-theme="dark"] .login-container h1,
html[data-theme="dark"] .login-container h2,
html[data-theme="dark"] .login-container h3,
html[data-theme="dark"] .login-container label,
html[data-theme="dark"] .login-container p,
html[data-theme="dark"] .login-container div {
    color: #111827 !important;
}

html[data-theme="dark"] .login-container input,
html[data-theme="dark"] .login-container textarea,
html[data-theme="dark"] .login-container select {
    background: #ffffff !important;
    color: #111827 !important;
    border: 1px solid #d1d5db !important;
    color-scheme: light;
}

html[data-theme="dark"] .login-container input:focus,
html[data-theme="dark"] .login-container textarea:focus,
html[data-theme="dark"] .login-container select:focus {
    background: #ffffff !important;
    color: #111827 !important;
    border-color: #aad6d3 !important;
    box-shadow: 0 0 0 3px rgba(170, 214, 211, 0.35) !important;
    outline: none !important;
}

html[data-theme="dark"] .login-container a {
    color: #007bff !important;
}

html[data-theme="dark"] .login-container .google-signin-btn {
    background: #ffffff !important;
    color: #3c4043 !important;
    border-color: #dadce0 !important;
}

html[data-theme="dark"] .login-container .google-signin-btn:hover {
    background: #f8f9fa !important;
    color: #3c4043 !important;
}

/* Dark theme: keep homepage hero text readable on the light hero background */
html[data-theme="dark"] .relative.bg-white.overflow-hidden h2.text-\[\#4f4f4f\] {
    color: #4f4f4f !important;
}

html[data-theme="dark"] .relative.bg-white.overflow-hidden h1.text-\[\#b9b9b9\],
html[data-theme="dark"] .relative.bg-white.overflow-hidden p.text-\[\#b9b9b9\] {
    color: #b9b9b9 !important;
}

html[data-theme="dark"] .relative.bg-white.overflow-hidden p.text-\[\#aad6d3\] {
    color: #aad6d3 !important;
}

/* Dark theme: registration form */
html[data-theme="dark"] .auth-form-container .col-md-6 {
    background: #ffffff !important;
    color: #111827 !important;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 16px 40px var(--theme-shadow) !important;
}

html[data-theme="dark"] .auth-form-container h1,
html[data-theme="dark"] .auth-form-container h2,
html[data-theme="dark"] .auth-form-container h3,
html[data-theme="dark"] .auth-form-container label,
html[data-theme="dark"] .auth-form-container p {
    color: #111827 !important;
}

html[data-theme="dark"] .auth-form-container .text-muted {
    color: #6b7280 !important;
}

html[data-theme="dark"] .auth-form-container input,
html[data-theme="dark"] .auth-form-container textarea,
html[data-theme="dark"] .auth-form-container select {
    background: #ffffff !important;
    color: #111827 !important;
    border: 1px solid #d1d5db !important;
    color-scheme: light;
}

html[data-theme="dark"] .auth-form-container input:focus,
html[data-theme="dark"] .auth-form-container textarea:focus,
html[data-theme="dark"] .auth-form-container select:focus {
    background: #ffffff !important;
    color: #111827 !important;
    border-color: #aad6d3 !important;
    box-shadow: 0 0 0 3px rgba(170, 214, 211, 0.35) !important;
    outline: none !important;
}

/* Pricing table information rows */
html[data-theme="dark"] .pricing-table .pricing-info-cell {
    background-color: var(--theme-bg-soft) !important;
    color: var(--theme-text) !important;
    border-color: var(--theme-border) !important;
}

html[data-theme="dark"] .pricing-table .pricing-info-cell a {
    color: var(--link-color) !important;
}


/* Common application questions — dark mode */

html[data-theme="dark"] .content {
    color: var(--theme-text) !important;
}

html[data-theme="dark"] .content .input,
html[data-theme="dark"] .content .inputs-box {
    color: var(--theme-text) !important;
}

html[data-theme="dark"] .content .question,
html[data-theme="dark"] .content .questionHeader,
html[data-theme="dark"] .content .question i {
    color: var(--theme-text) !important;
}

html[data-theme="dark"] .content .inputs-box label,
html[data-theme="dark"] .content .inputs-box label i,
html[data-theme="dark"] .content .inputs-box label b {
    color: var(--theme-text) !important;
}

html[data-theme="dark"] .content .warning,
html[data-theme="dark"] .content .warning b {
    color: var(--theme-text-muted) !important;
}

html[data-theme="dark"] .content .page,
html[data-theme="dark"] .content .category {
    color: var(--theme-text) !important;
}

html[data-theme="dark"] .content label:hover {
    background-color: rgba(145, 202, 198, 0.18) !important;
}

html[data-theme="dark"] .content input:checked + label {
    background-color: rgba(145, 202, 198, 0.25) !important;
    border-radius: 8px;
}

html[data-theme="dark"] .content hr {
    border-color: var(--theme-border) !important;
}

/* Old application tooltips */

html[data-theme="dark"] .tooltip-underline:hover::after,
html[data-theme="dark"] .infoTab,
html[data-theme="dark"] .textDetails {
    background-color: var(--theme-surface) !important;
    color: var(--theme-text) !important;
    border-color: #91cac6 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35) !important;
}

/* Tippy tooltips */

html[data-theme="dark"] .tippy-box {
    background-color: #080d16 !important;
    color: #f8fafc !important;
    border: 1px solid var(--theme-border) !important;
}

html[data-theme="dark"] .tippy-box .tippy-content,
html[data-theme="dark"] .tippy-box .tippy-content span,
html[data-theme="dark"] .tippy-box .tippy-content b {
    color: #f8fafc !important;
}

/* Common application form controls — dark mode */

html[data-theme="dark"] .content input:not([type="submit"]):not([type="button"]):not([type="radio"]):not([type="checkbox"]):not([type="file"]),
html[data-theme="dark"] .content textarea,
html[data-theme="dark"] .content select {
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
    caret-color: #f8fafc !important;
    opacity: 1 !important;
}

html[data-theme="dark"] .content input::placeholder,
html[data-theme="dark"] .content textarea::placeholder {
    color: #9ca3af !important;
    -webkit-text-fill-color: #9ca3af !important;
    opacity: 1 !important;
}

html[data-theme="dark"] .content input:disabled,
html[data-theme="dark"] .content input[readonly],
html[data-theme="dark"] .content textarea:disabled,
html[data-theme="dark"] .content textarea[readonly],
html[data-theme="dark"] .content select:disabled {
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
    opacity: 1 !important;
}

/* Date value rendered internally by Chromium browsers */

html[data-theme="dark"] .content input[type="date"] {
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
    opacity: 1 !important;
}

html[data-theme="dark"] .content input[type="date"]::-webkit-datetime-edit,
html[data-theme="dark"] .content input[type="date"]::-webkit-datetime-edit-fields-wrapper,
html[data-theme="dark"] .content input[type="date"]::-webkit-datetime-edit-text,
html[data-theme="dark"] .content input[type="date"]::-webkit-datetime-edit-day-field,
html[data-theme="dark"] .content input[type="date"]::-webkit-datetime-edit-month-field,
html[data-theme="dark"] .content input[type="date"]::-webkit-datetime-edit-year-field {
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
    opacity: 1 !important;
}

/* Application card description — dark mode */
html[data-theme="dark"] .app-card-description {
    color: #cbd5e1 !important;
    opacity: 1 !important;
}

/* Tippy tooltip text — dark mode */
html[data-theme="dark"] .tippy-box .tippy-content,
html[data-theme="dark"] .tippy-box .tippy-content * {
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
    opacity: 1 !important;
}

/* App set descriptions and upcoming apps heading */
html[data-theme="dark"] .appset-description,
html[data-theme="dark"] .appset-description * {
    color: #cbd5e1 !important;
    -webkit-text-fill-color: currentColor !important;
}

/* Keep emphasized text clearly visible */
html[data-theme="dark"] .appset-description strong,
html[data-theme="dark"] .appset-description b {
    color: #f8fafc !important;
}

/* Preserve the turquoise accent used for links */
html[data-theme="dark"] .appset-description a,
html[data-theme="dark"] .appset-description a * {
    color: #aad6d3 !important;
}

/* Heading above applications that are coming soon */
html[data-theme="dark"] .appset-wip-heading {
    color: #f8fafc !important;
}

/* AI advisor bot messages */
html[data-theme="dark"] #ai-chat-widget .ai-chat-bot-message {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}

html[data-theme="dark"] #ai-chat-widget .ai-chat-bot-message strong {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

html[data-theme="dark"] #ai-chat-widget .ai-chat-bot-message a {
    color: #aad6d3 !important;
    -webkit-text-fill-color: #aad6d3 !important;
}
/* App detail sidebar */
html[data-theme="dark"] .app-detail-sidebar {
    border-color: #64748b !important;
}

html[data-theme="dark"] .app-detail-stats {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .app-detail-stats .text-slate-800 {
    color: #f1f5f9 !important;
    -webkit-text-fill-color: #f1f5f9 !important;
}

html[data-theme="dark"] .app-detail-stats > * + * {
    border-color: #475569 !important;
}

/* App detail descriptions - override hard-coded black editor text in dark mode */
html[data-theme="dark"] .app-detail-description [style*="color: rgb(0, 0, 0)"],
html[data-theme="dark"] .app-detail-description [style*="color: rgb(0,0,0)"],
html[data-theme="dark"] .app-detail-description [style*="color: #000"],
html[data-theme="dark"] .app-detail-description [style*="color:#000"],
html[data-theme="dark"] .app-detail-description [style*="color: black"] {
    color: var(--theme-text) !important;
    -webkit-text-fill-color: var(--theme-text) !important;
}

/* PDF/report generation modal */
html[data-theme="dark"] .generating-modal-panel {
    background-color: var(--theme-surface) !important;
    border: 1px solid var(--theme-border) !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .generating-modal-message {
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}

/* Blog / Knowledge Base article pages — dark mode */

/* Article header */
html[data-theme="dark"] .blog-detail-page > article > header h1 {
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}

html[data-theme="dark"] .blog-detail-page > article > header .text-gray-600,
html[data-theme="dark"] .blog-detail-page > article > header .text-gray-500 {
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
}

html[data-theme="dark"] .blog-detail-page > article > header .border-gray-200 {
    border-color: #475569 !important;
}

/* Main article surface */
html[data-theme="dark"] .blog-article-content {
    background: var(--theme-surface) !important;
    color: #cbd5e1 !important;
}

/* Standard articles imported from the editor */
html[data-theme="dark"] .blog-article-content .bap-standard-article,
html[data-theme="dark"] .blog-article-content .bap-standard-article .main {
    background: transparent !important;
    color: #cbd5e1 !important;
}

/* General article text */
html[data-theme="dark"] .blog-article-content .prose,
html[data-theme="dark"] .blog-article-content .prose p,
html[data-theme="dark"] .blog-article-content .prose li,
html[data-theme="dark"] .blog-article-content .prose dt,
html[data-theme="dark"] .blog-article-content .prose dd,
html[data-theme="dark"] .blog-article-content .bap-standard-article p,
html[data-theme="dark"] .blog-article-content .bap-standard-article li {
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
}

/* Article headings and emphasized text */
html[data-theme="dark"] .blog-article-content .prose h1,
html[data-theme="dark"] .blog-article-content .prose h2,
html[data-theme="dark"] .blog-article-content .prose h3,
html[data-theme="dark"] .blog-article-content .prose h4,
html[data-theme="dark"] .blog-article-content .prose h5,
html[data-theme="dark"] .blog-article-content .prose h6,
html[data-theme="dark"] .blog-article-content .prose strong,
html[data-theme="dark"] .blog-article-content .prose b,
html[data-theme="dark"] .blog-article-content .bap-standard-article h1,
html[data-theme="dark"] .blog-article-content .bap-standard-article h2,
html[data-theme="dark"] .blog-article-content .bap-standard-article h3,
html[data-theme="dark"] .blog-article-content .bap-standard-article h4,
html[data-theme="dark"] .blog-article-content .bap-standard-article h5,
html[data-theme="dark"] .blog-article-content .bap-standard-article h6,
html[data-theme="dark"] .blog-article-content .bap-standard-article strong,
html[data-theme="dark"] .blog-article-content .bap-standard-article b {
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}

/* Links inside articles */
html[data-theme="dark"] .blog-article-content .prose a,
html[data-theme="dark"] .blog-article-content .bap-standard-article a {
    color: #aad6d3 !important;
    -webkit-text-fill-color: #aad6d3 !important;
}

/* Table of contents */
html[data-theme="dark"] .blog-article-content .toc {
    background: #111827 !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28) !important;
}

html[data-theme="dark"] .blog-article-content .toc h1,
html[data-theme="dark"] .blog-article-content .toc h2,
html[data-theme="dark"] .blog-article-content .toc h3,
html[data-theme="dark"] .blog-article-content .toc p {
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}

html[data-theme="dark"] .blog-article-content .toc a {
    color: #aad6d3 !important;
    -webkit-text-fill-color: #aad6d3 !important;
}

/* Common content boxes */
html[data-theme="dark"] .blog-article-content .soft-box,
html[data-theme="dark"] .blog-article-content .inline-note,
html[data-theme="dark"] .blog-article-content .key-question,
html[data-theme="dark"] .blog-article-content .package-row {
    background-color: #111827 !important;
    border-color: #475569 !important;
    color: #cbd5e1 !important;
}

/* Blockquotes */
html[data-theme="dark"] .blog-article-content .prose blockquote {
    background-color: #111827 !important;
    border-color: #91cac6 !important;
    color: #cbd5e1 !important;
}

/* Inline black text coming from TinyMCE/editor content */
html[data-theme="dark"] .blog-article-content [style*="color: rgb(0, 0, 0)"],
html[data-theme="dark"] .blog-article-content [style*="color: rgb(0,0,0)"],
html[data-theme="dark"] .blog-article-content [style*="color: #000"],
html[data-theme="dark"] .blog-article-content [style*="color:#000"],
html[data-theme="dark"] .blog-article-content [style*="color: black"] {
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
}

/* Related posts */
html[data-theme="dark"] .blog-related-posts > h2 {
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}

html[data-theme="dark"] .blog-related-card {
    background: var(--theme-surface) !important;
    border: 1px solid var(--theme-border);
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .blog-related-card h3,
html[data-theme="dark"] .blog-related-card h3 a {
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}

html[data-theme="dark"] .blog-related-card .text-gray-600,
html[data-theme="dark"] .blog-related-card .text-gray-700 {
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
}

html[data-theme="dark"] .blog-related-card > a {
    color: #aad6d3 !important;
    -webkit-text-fill-color: #aad6d3 !important;
}

/* Blog / Knowledge Base — normalize editor content in dark mode */

/*
 * Some articles contain their own top-level white surfaces.
 * Keep the page dark without changing intentionally styled inner cards.
 */
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose > article,

html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose > main,

html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose > section,

html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose > div:not(.toc) {
    background-color: transparent !important;
    background-image: none !important;
}

/* Normal body text, including spans inserted by TinyMCE */
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose p,

html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose p *,

html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose li,

html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose li *,

html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose td,

html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose td *,

html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose th,

html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose th * {
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
}

/* Headings may also contain spans with inline colors */
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose h1,
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose h1 *,

html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose h2,
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose h2 *,

html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose h3,
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose h3 *,

html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose h4,
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose h4 *,

html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose h5,
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose h5 *,

html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose h6,
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose h6 * {
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}

/* Restore link/accent colour after normalizing nested spans */
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose a,
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose a * {
    color: #aad6d3 !important;
    -webkit-text-fill-color: #aad6d3 !important;
}

/* Blog / Knowledge Base — dark mode for embedded content boxes */

/* Informational / highlighted boxes that stay light in article HTML */
html[data-theme="dark"] .blog-article-content .note-box,
html[data-theme="dark"] .blog-article-content .info-box,
html[data-theme="dark"] .blog-article-content .contact-box,
html[data-theme="dark"] .blog-article-content .highlight,
html[data-theme="dark"] .blog-article-content .highlight-row,
html[data-theme="dark"] .blog-article-content .tooltip-box {
    background-color: #111827 !important;
    background-image: none !important;
    border-color: #475569 !important;
    color: #cbd5e1 !important;
}

/* Text inside those boxes */
html[data-theme="dark"] .blog-article-content .note-box *,
html[data-theme="dark"] .blog-article-content .info-box *,
html[data-theme="dark"] .blog-article-content .contact-box *,
html[data-theme="dark"] .blog-article-content .highlight *,
html[data-theme="dark"] .blog-article-content .highlight-row *,
html[data-theme="dark"] .blog-article-content .tooltip-box * {
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
}

/* Headings / labels inside content boxes */
html[data-theme="dark"] .blog-article-content .note-box h1,
html[data-theme="dark"] .blog-article-content .note-box h2,
html[data-theme="dark"] .blog-article-content .note-box h3,
html[data-theme="dark"] .blog-article-content .info-box h1,
html[data-theme="dark"] .blog-article-content .info-box h2,
html[data-theme="dark"] .blog-article-content .info-box h3,
html[data-theme="dark"] .blog-article-content .contact-box h1,
html[data-theme="dark"] .blog-article-content .contact-box h2,
html[data-theme="dark"] .blog-article-content .contact-box h3,
html[data-theme="dark"] .blog-article-content .info-box__label {
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}

/* Links inside these boxes */
html[data-theme="dark"] .blog-article-content .note-box a,
html[data-theme="dark"] .blog-article-content .info-box a,
html[data-theme="dark"] .blog-article-content .contact-box a,
html[data-theme="dark"] .blog-article-content .highlight a,
html[data-theme="dark"] .blog-article-content .tooltip-box a {
    color: #aad6d3 !important;
    -webkit-text-fill-color: #aad6d3 !important;
}

/* Tables embedded in Knowledge Base articles */
html[data-theme="dark"] .blog-article-content .table-wrap,
html[data-theme="dark"] .blog-article-content .cbam-comparison-table,
html[data-theme="dark"] .blog-article-content .cbam-ai-table {
    background-color: #111827 !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .blog-article-content table {
    background-color: #111827 !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .blog-article-content table thead,
html[data-theme="dark"] .blog-article-content table th {
    background-color: #172033 !important;
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .blog-article-content table tbody,
html[data-theme="dark"] .blog-article-content table tr,
html[data-theme="dark"] .blog-article-content table td {
    background-color: #111827 !important;
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .blog-article-content table tbody tr:nth-child(even) td {
    background-color: #172033 !important;
}

/* Some article tables/cells contain nested spans with their own colors */
html[data-theme="dark"] .blog-article-content table td *,
html[data-theme="dark"] .blog-article-content table th * {
    color: inherit !important;
    -webkit-text-fill-color: inherit !important;
}

/* Restore article link colour inside tables */
html[data-theme="dark"] .blog-article-content table a,
html[data-theme="dark"] .blog-article-content table a * {
    color: #aad6d3 !important;
    -webkit-text-fill-color: #aad6d3 !important;
}

/* Blog / Knowledge Base — final CTA and special-box contrast fixes */

/* White buttons inside standard article CTAs */
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose .bap-standard-article .cta .cta-links a,
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose .bap-standard-article .cta .cta-links a * {
    color: #123548 !important;
    -webkit-text-fill-color: #123548 !important;
}

/* Dark contact button in AI article */
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose .bap-ai-article
.contact-box .contact-actions > a,
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose .bap-ai-article
.contact-box .contact-actions > a * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Secondary contact panel next to the AI contact button */
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose .bap-ai-article
.contact-box .contact-actions .secondary {
    background: #172033 !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose .bap-ai-article
.contact-box .contact-actions .secondary .role {
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
}

html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose .bap-ai-article
.contact-box .contact-actions .secondary .phone {
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}

/* White button in the large AI CTA ("Dalsze kroki") */
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose .bap-ai-article .cta > a,
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose .bap-ai-article .cta > a * {
    color: #123548 !important;
    -webkit-text-fill-color: #123548 !important;
}

/* AI key-question box */
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose .bap-ai-article .key-question {
    background: #111827 !important;
    background-image: none !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose .bap-ai-article .key-question .label {
    color: #aad6d3 !important;
    -webkit-text-fill-color: #aad6d3 !important;
}

html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose .bap-ai-article .key-question .main {
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}

/* Blog / Knowledge Base — process cards */

html[data-theme="dark"] .blog-article-content .process-item {
    background: #111827 !important;
    border-color: #475569 !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .blog-article-content .process-item h1,
html[data-theme="dark"] .blog-article-content .process-item h2,
html[data-theme="dark"] .blog-article-content .process-item h3,
html[data-theme="dark"] .blog-article-content .process-item strong {
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}

html[data-theme="dark"] .blog-article-content .process-item p,
html[data-theme="dark"] .blog-article-content .process-item p * {
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
}

html[data-theme="dark"] .blog-article-content .process-item .process-price {
    background: #164e63 !important;
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}


/* =========================================================
   Blog / Knowledge Base — ROI article
   ========================================================= */

html[data-theme="dark"] .roi-article-page .blog-article-content {
    background: var(--theme-surface) !important;
    color: #cbd5e1 !important;
}

/* Main ROI article surfaces */
html[data-theme="dark"] .roi-article-page .bap-roi-article,
html[data-theme="dark"] .roi-article-page .bap-roi-article .article,
html[data-theme="dark"] .roi-article-page .bap-roi-article .section,
html[data-theme="dark"] .roi-article-page .bap-roi-article .container,
html[data-theme="dark"] .roi-article-page .bap-roi-article .content,
html[data-theme="dark"] .roi-article-page .bap-roi-article .build-layout,
html[data-theme="dark"] .roi-article-page .bap-roi-article .section-grid {
    background-color: transparent !important;
    color: #cbd5e1 !important;
}

/* Normal text */
html[data-theme="dark"] .roi-article-page .bap-roi-article p,
html[data-theme="dark"] .roi-article-page .bap-roi-article li,
html[data-theme="dark"] .roi-article-page .bap-roi-article td,
html[data-theme="dark"] .roi-article-page .bap-roi-article p *,
html[data-theme="dark"] .roi-article-page .bap-roi-article li * {
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
}

/* Headings */
html[data-theme="dark"] .roi-article-page .bap-roi-article h1,
html[data-theme="dark"] .roi-article-page .bap-roi-article h2,
html[data-theme="dark"] .roi-article-page .bap-roi-article h3,
html[data-theme="dark"] .roi-article-page .bap-roi-article h4,
html[data-theme="dark"] .roi-article-page .bap-roi-article h5,
html[data-theme="dark"] .roi-article-page .bap-roi-article h6,
html[data-theme="dark"] .roi-article-page .bap-roi-article strong {
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}

/* Links */
html[data-theme="dark"] .roi-article-page .bap-roi-article a {
    color: #aad6d3 !important;
    -webkit-text-fill-color: #aad6d3 !important;
}


/* ROI table of contents */
html[data-theme="dark"] .roi-article-page .bap-roi-article .toc,
html[data-theme="dark"] .roi-article-page .bap-roi-article .toc-wrap {
    background: #111827 !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .roi-article-page .bap-roi-article .toc h2 {
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}

/* Individual white TOC rows */
html[data-theme="dark"] .roi-article-page .bap-roi-article .toc a {
    background: #172033 !important;
    color: #aad6d3 !important;
    -webkit-text-fill-color: #aad6d3 !important;
    border-color: #475569 !important;
}


/* ROI informational cards */
html[data-theme="dark"] .roi-article-page .bap-roi-article .note-box,
html[data-theme="dark"] .roi-article-page .bap-roi-article .highlight,
html[data-theme="dark"] .roi-article-page .bap-roi-article .highlight-row,
html[data-theme="dark"] .roi-article-page .bap-roi-article .app-card,
html[data-theme="dark"] .roi-article-page .bap-roi-article .roi-live-card,
html[data-theme="dark"] .roi-article-page .bap-roi-article .roi-number-box,
html[data-theme="dark"] .roi-article-page .bap-roi-article .roi-switcher,
html[data-theme="dark"] .roi-article-page .bap-roi-article .table-wrap {
    background: #111827 !important;
    border-color: #475569 !important;
    color: #cbd5e1 !important;
}

/* Nested text inside ROI cards */
html[data-theme="dark"] .roi-article-page .bap-roi-article .app-card *,
html[data-theme="dark"] .roi-article-page .bap-roi-article .roi-live-card *,
html[data-theme="dark"] .roi-article-page .bap-roi-article .roi-number-box * {
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
}

html[data-theme="dark"] .roi-article-page .bap-roi-article .roi-number-value,
html[data-theme="dark"] .roi-article-page .bap-roi-article .roi-number-value * {
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}


/* ROI tables */
html[data-theme="dark"] .roi-article-page .bap-roi-article table {
    background: #111827 !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .roi-article-page .bap-roi-article table th {
    background: #172033 !important;
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .roi-article-page .bap-roi-article table td {
    background: #111827 !important;
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .roi-article-page .bap-roi-article table tr:nth-child(even) td {
    background: #172033 !important;
}


/* ROI calculator / slider */
html[data-theme="dark"] .roi-article-page .bap-roi-article .app-slider-shell,
html[data-theme="dark"] .roi-article-page .bap-roi-article .app-slider-wrap {
    background: #111827 !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .roi-article-page .bap-roi-article .app-slider-track {
    background: #334155 !important;
}

html[data-theme="dark"] .roi-article-page .bap-roi-article .app-slider-thumb-label,
html[data-theme="dark"] .roi-article-page .bap-roi-article .roi-pill {
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}


/* ROI final CTA */
html[data-theme="dark"] .roi-article-page .bap-roi-article .final-cta {
    background: #164e63 !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .roi-article-page .bap-roi-article .final-cta h2,
html[data-theme="dark"] .roi-article-page .bap-roi-article .final-cta p {
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}

/* =========================================================
   Knowledge Base ROI article — final dark-mode fixes
   ========================================================= */

/* Hero section */
html[data-theme="dark"] .roi-article-page
.blog-article-content .bap-roi-article .hero {
    background: #1f2937 !important;
    color: #cbd5e1 !important;
}

/*
 * The hero image itself is very light, therefore the title
 * placed directly over the image must remain dark.
 */
html[data-theme="dark"] .roi-article-page
.blog-article-content .bap-roi-article .hero-overlay h1 {
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
    opacity: 1 !important;
}

/* Intro text below the hero graphic */
html[data-theme="dark"] .roi-article-page
.blog-article-content .bap-roi-article .lead {
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
}


/* ROI calculator — remove remaining white surfaces */
html[data-theme="dark"] .roi-article-page
.blog-article-content .bap-roi-article .roi-live-main,
html[data-theme="dark"] .roi-article-page
.blog-article-content .bap-roi-article .roi-live-numbers {
    background: #111827 !important;
    border-color: #475569 !important;
    color: #cbd5e1 !important;
}

/* Selected application card */
html[data-theme="dark"] .roi-article-page
.blog-article-content .bap-roi-article .roi-live-main h4 {
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}

html[data-theme="dark"] .roi-article-page
.blog-article-content .bap-roi-article .roi-live-main p {
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
}

/* Formula underneath selected application */
html[data-theme="dark"] .roi-article-page
.blog-article-content .bap-roi-article .roi-formula {
    background: #172033 !important;
    border-color: #475569 !important;
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
}

/* Individual result boxes */
html[data-theme="dark"] .roi-article-page
.blog-article-content .bap-roi-article .roi-number-box {
    background: #172033 !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .roi-article-page
.blog-article-content .bap-roi-article .roi-number-label {
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
}

html[data-theme="dark"] .roi-article-page
.blog-article-content .bap-roi-article .roi-number-value,
html[data-theme="dark"] .roi-article-page
.blog-article-content .bap-roi-article .roi-number-value.highlight {
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}

/* Static application cards, if displayed elsewhere in this ROI article */
html[data-theme="dark"] .roi-article-page
.blog-article-content .bap-roi-article .app-card {
    background: #111827 !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .roi-article-page
.blog-article-content .bap-roi-article .app-card h3 {
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}

html[data-theme="dark"] .roi-article-page
.blog-article-content .bap-roi-article .app-card p {
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
}

/* ROI article — numeric highlights are text, not content boxes */
html[data-theme="dark"] .roi-article-page
.blog-article-content .bap-roi-article
.roi-number-value.highlight {
    background: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;

    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}

/* =========================================================
   Knowledge Base — override legacy article styles that
   explicitly force a light theme in dark mode
   ========================================================= */

/* Article canvas */
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content.bg-white,
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content.prose,
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose,
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .article,
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .content,
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .section {
    background-color: #1f2937 !important;
    background-image: none !important;
    color: #cbd5e1 !important;
}

/* Regular article text */
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose p,
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose li,
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .article p,
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .article li,
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .content p,
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .content li {
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
}

/* Headings and emphasized text */
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose h1,
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose h2,
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose h3,
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose h4,
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .article h1,
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .article h2,
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .article h3,
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .article h4 {
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
    opacity: 1 !important;
}

html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose strong,
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .article strong {
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}

/* Links */
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .prose a,
html[data-theme="dark"] .blog-detail-page:not(.roi-article-page)
.blog-article-content .article a {
    color: #aad6d3 !important;
    -webkit-text-fill-color: #aad6d3 !important;
}

/* Blog / Knowledge Base — prevent anchor offsets from overlapping previous content */
html[data-theme="dark"] .blog-article-content span[id][style*="margin-top: -90px"] {
    margin-top: 0 !important;
    padding-top: 0 !important;
    height: 0 !important;
    scroll-margin-top: 90px;
}

/* Knowledge Base — embedded BAP ROI-style blocks inside regular articles */
html[data-theme="dark"]
.blog-detail-page:not(.roi-article-page)
.blog-article-content .bap-roi-article {
    background-color: #1f2937 !important;
    background-image: none !important;
    color: #cbd5e1 !important;
}

/* Regular text inside the embedded block */
html[data-theme="dark"]
.blog-detail-page:not(.roi-article-page)
.blog-article-content .bap-roi-article p,
html[data-theme="dark"]
.blog-detail-page:not(.roi-article-page)
.blog-article-content .bap-roi-article em {
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
}

/* Emphasized text */
html[data-theme="dark"]
.blog-detail-page:not(.roi-article-page)
.blog-article-content .bap-roi-article strong {
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}

/* Blog / Knowledge Base — CBAM comparison table */
html[data-theme="dark"]
.blog-article-content
.bap-standard-article
.cbam-ai-table tbody tr:nth-child(odd) td {
    background-color: #111827 !important;
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
}

html[data-theme="dark"]
.blog-article-content
.bap-standard-article
.cbam-ai-table tbody tr:nth-child(even) td {
    background-color: #172033 !important;
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
}

html[data-theme="dark"]
.blog-article-content
.bap-standard-article
.cbam-ai-table tbody td strong {
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}

/* Knowledge Base — NIS2 audit CTA button */
html[data-theme="dark"]
.blog-detail-page:not(.roi-article-page)
.blog-article-content
.bap-ai-article
.cta
.btn-group
a[href*="/audyt-nis2/"] {
    color: #12343b !important;
    -webkit-text-fill-color: #12343b !important;
}

html[data-theme="dark"]
.blog-detail-page:not(.roi-article-page)
.blog-article-content
.bap-ai-article
.cta
.btn-group
a[href*="/audyt-nis2/"]:hover,
html[data-theme="dark"]
.blog-detail-page:not(.roi-article-page)
.blog-article-content
.bap-ai-article
.cta
.btn-group
a[href*="/audyt-nis2/"]:focus {
    color: #0f2b3a !important;
    -webkit-text-fill-color: #0f2b3a !important;
}

/* =========================================================
   Success Stories — dark mode
   ========================================================= */

html[data-theme="dark"] .success-story-content {
    color: #cbd5e1 !important;
}

/* Main article text */
html[data-theme="dark"] .success-story-content p,
html[data-theme="dark"] .success-story-content li,
html[data-theme="dark"] .success-story-content ul,
html[data-theme="dark"] .success-story-content ol,
html[data-theme="dark"] .success-story-content blockquote,
html[data-theme="dark"] .success-story-content figcaption {
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
}

/* Headings and emphasized text */
html[data-theme="dark"] .success-story-content h2,
html[data-theme="dark"] .success-story-content h3,
html[data-theme="dark"] .success-story-content h4,
html[data-theme="dark"] .success-story-content h5,
html[data-theme="dark"] .success-story-content h6,
html[data-theme="dark"] .success-story-content strong,
html[data-theme="dark"] .success-story-content b {
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}

/* Links inside article */
html[data-theme="dark"] .success-story-content a {
    color: #aad6d3 !important;
    -webkit-text-fill-color: #aad6d3 !important;
}

html[data-theme="dark"] .success-story-content a:hover,
html[data-theme="dark"] .success-story-content a:focus {
    color: #d5efed !important;
    -webkit-text-fill-color: #d5efed !important;
}

/* Tables — override TinyMCE / inline light-theme colors */
html[data-theme="dark"] .success-story-content table {
    background-color: #111827 !important;
    color: #cbd5e1 !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .success-story-content thead,
html[data-theme="dark"] .success-story-content th {
    background-color: #172033 !important;
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .success-story-content tbody,
html[data-theme="dark"] .success-story-content tr,
html[data-theme="dark"] .success-story-content td {
    background-color: #111827 !important;
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
    border-color: #475569 !important;
}

html[data-theme="dark"]
.success-story-content tbody tr:nth-child(even) td {
    background-color: #172033 !important;
}

/* Preserve readable text inside nested table elements */
html[data-theme="dark"] .success-story-content td *,
html[data-theme="dark"] .success-story-content th * {
    color: inherit !important;
    -webkit-text-fill-color: inherit !important;
}

/* Code / technical fragments */
html[data-theme="dark"] .success-story-content pre,
html[data-theme="dark"] .success-story-content code {
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
}

/* CTA button */
html[data-theme="dark"] .success-story-cta-link {
    background-color: #ffffff !important;
    color: #12343b !important;
    -webkit-text-fill-color: #12343b !important;
}

html[data-theme="dark"] .success-story-cta-link:hover,
html[data-theme="dark"] .success-story-cta-link:focus {
    background-color: #f8fafc !important;
    color: #0f2b3a !important;
    -webkit-text-fill-color: #0f2b3a !important;
}

/* =========================================================
   App opinions preview — dark mode
   ========================================================= */

html[data-theme="dark"] .app-opinions-preview {
    color: #cbd5e1;
}

html[data-theme="dark"] .app-opinions-preview h2 {
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}

html[data-theme="dark"] .app-opinions-preview > div:first-child p,
html[data-theme="dark"] .app-opinions-preview > p {
    color: #94a3b8 !important;
    -webkit-text-fill-color: #94a3b8 !important;
}

/* Opinion cards */
html[data-theme="dark"] .app-opinions-preview .app-opinion-card {
    background-color: #1e293b !important;
    border-color: #475569 !important;
    color: #cbd5e1 !important;
}

/* Opinion comments */
html[data-theme="dark"] .app-opinions-preview .app-opinion-card p {
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
}

/* Dates */
html[data-theme="dark"] .app-opinions-preview .app-opinion-card time {
    color: #94a3b8 !important;
    -webkit-text-fill-color: #94a3b8 !important;
}

/* Positive opinion */
html[data-theme="dark"] .app-opinions-preview .text-emerald-700 {
    color: #6ee7b7 !important;
    -webkit-text-fill-color: #6ee7b7 !important;
}

/* Negative opinion */
html[data-theme="dark"] .app-opinions-preview .text-red-700 {
    color: #fca5a5 !important;
    -webkit-text-fill-color: #fca5a5 !important;
}

/* Statistics pills */
html[data-theme="dark"] .app-opinions-preview .bg-emerald-50 {
    background-color: rgba(6, 78, 59, 0.45) !important;
}

html[data-theme="dark"] .app-opinions-preview .bg-red-50 {
    background-color: rgba(127, 29, 29, 0.45) !important;
}

/* Happy / unhappy SVG icons are dark by default */
html[data-theme="dark"] .app-opinions-preview img {
    filter: invert(1);
    opacity: 0.85;
}

html[data-theme="dark"] .app-opinions-preview .app-opinions-empty {
    background-color: #1e293b !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .app-opinions-preview .app-opinions-empty h3 {
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}

html[data-theme="dark"] .app-opinions-preview .app-opinions-empty p,
html[data-theme="dark"] .app-opinions-preview .app-opinions-empty i {
    color: #94a3b8 !important;
    -webkit-text-fill-color: #94a3b8 !important;
}

/* App opinions — show all / show less */

.app-opinions-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: fit-content;
    margin: 0 auto;
    padding: 0.65rem 1.25rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    background-color: #ffffff;
    color: #334155;
    font-weight: 600;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
    list-style: none;
}

.app-opinions-toggle::-webkit-details-marker {
    display: none;
}

.app-opinions-toggle:hover {
    background-color: #f8fafc;
    border-color: #94a3b8;
}

.app-opinions-more .hide-all-label {
    display: none;
}

.app-opinions-more[open] .show-all-label {
    display: none;
}

.app-opinions-more[open] .hide-all-label {
    display: inline;
}

.app-opinions-chevron {
    transition: transform 0.2s ease;
}

.app-opinions-more[open] .app-opinions-chevron {
    transform: rotate(180deg);
}

html[data-theme="dark"] .app-opinions-toggle {
    background-color: #1e293b !important;
    border-color: #475569 !important;
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
}

html[data-theme="dark"] .app-opinions-toggle:hover {
    background-color: #273449 !important;
    border-color: #64748b !important;
}

/* Pricing table */
html[data-theme="dark"] .pricing-table {
    border-color: #475569 !important;
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .pricing-table th,
html[data-theme="dark"] .pricing-table td {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .pricing-table strong {
    color: #f8fafc !important;
}

html[data-theme="dark"] .pricing-table a:not(.profitability-offer-button) {
    color: #aad6d3 !important;
}

html[data-theme="dark"] .pricing-table .pricing-info-cell {
    background-color: #172033 !important;
    color: #cbd5e1 !important;
}
