:root {
    --ctdm-bg: #141821;
    --ctdm-bg-soft: #181d27;
    --ctdm-surface: #202633;
    --ctdm-surface-raised: #273041;
    --ctdm-surface-soft: #1b202b;
    --ctdm-border: rgba(169, 187, 215, 0.24);
    --ctdm-border-strong: rgba(139, 108, 255, 0.55);
    --ctdm-text: #f3f6fc;
    --ctdm-heading: #ffffff;
    --ctdm-muted: #b8c3d4;
    --ctdm-link: #7dd7ff;
    --ctdm-link-hover: #ffffff;
    --ctdm-accent: #b249ff;
    --ctdm-accent-2: #6f7cff;
    --ctdm-blue: #2495d4;
    --ctdm-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
}

html.ctdm-dark,
html.ctdm-dark body {
    background: var(--ctdm-bg) !important;
    color: var(--ctdm-text) !important;
}

html.ctdm-dark body {
    color-scheme: dark;
}

html.ctdm-dark :where(#page, .site, .site-content, #content, #cm-content, .content-area, .site-main, #primary, #secondary, #cm-primary, #cm-secondary) {
    background: var(--ctdm-bg) !important;
    color: var(--ctdm-text) !important;
}

html.ctdm-dark :where(.cm-container, .container, .wrap, .cm-row) {
    background: transparent !important;
    color: var(--ctdm-text) !important;
}

html.ctdm-dark :where(a) {
    color: var(--ctdm-link);
}

html.ctdm-dark :where(a:hover, a:focus-visible) {
    color: var(--ctdm-link-hover);
}

html.ctdm-dark :where(.site-header, #masthead, #cm-header, .cm-header, .cm-main-header, .cm-top-row, .cm-header-top-row) {
    background: var(--ctdm-bg-soft) !important;
    border-color: var(--ctdm-border) !important;
    color: var(--ctdm-text) !important;
}

html.ctdm-dark :where(.cm-navigation-primary, .cm-header-nav, .main-navigation, #site-navigation) {
    background: #1d222d !important;
    border-top-color: var(--ctdm-border-strong) !important;
    border-bottom-color: rgba(255, 255, 255, 0.28) !important;
}

html.ctdm-dark :where(.main-navigation ul, .main-navigation li, .primary-menu, .secondary-menu, .nav-menu, .top-bar-menu, .sub-menu) {
    background: transparent !important;
}

html.ctdm-dark :where(.main-navigation a, .primary-menu a, .secondary-menu a, .cm-navigation-primary a, .cm-header-nav a, #site-navigation a, .nav-menu a, .top-bar-menu a) {
    color: var(--ctdm-text) !important;
}

html.ctdm-dark :where(.main-navigation a:hover, .main-navigation a:focus-visible, .primary-menu a:hover, .secondary-menu a:hover, .cm-navigation-primary a:hover, .cm-header-nav a:hover, #site-navigation a:hover, .nav-menu a:hover, .top-bar-menu a:hover) {
    background-color: var(--ctdm-blue) !important;
    color: #ffffff !important;
}

html.ctdm-dark :where(h1, h2, h3, h4, h5, h6, .page-title, .entry-title, .cm-entry-title, .site-title a, .widget-title, .block-title, .block-title h2, .block-title h3, .breaking-news-latest, #ez-toc-container .ez-toc-title) {
    color: var(--ctdm-heading) !important;
}

html.ctdm-dark :where(.entry-title a, .cm-entry-title a, .post-title a, article h2 a, article h3 a) {
    color: var(--ctdm-heading) !important;
}

html.ctdm-dark :where(.entry-title a:hover, .cm-entry-title a:hover, .post-title a:hover, article h2 a:hover, article h3 a:hover) {
    color: var(--ctdm-link-hover) !important;
}

html.ctdm-dark :where(article, .post, .page, .hentry, .cm-post, .cm-posts > div, .cm-posts > article, .wp-block-post, .archive-grid .grid-item, .grid-item, .card) {
    background: var(--ctdm-surface) !important;
    border: 1px solid var(--ctdm-border) !important;
    color: var(--ctdm-text) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

html.ctdm-dark :where(.cm-posts article, article.post, .cm-featured-posts .post, .cm-post) {
    border-radius: 6px;
    overflow: hidden;
}

html.ctdm-dark :where(.cm-featured-image, .post-thumbnail, .wp-post-image) {
    background: #0f131b !important;
}

html.ctdm-dark :where(article.post .cm-post-content, .cm-post-content, .entry-content, .entry-summary) {
    background: var(--ctdm-surface) !important;
    color: var(--ctdm-text) !important;
}

html.ctdm-dark :where(.entry-meta, .cm-entry-header-meta, .cm-below-entry-meta, .comment-meta, .posted-on, .byline, figcaption, .wp-block-latest-posts__post-date) {
    background: transparent !important;
    border-color: transparent !important;
    color: var(--ctdm-muted) !important;
}

html.ctdm-dark :where(.entry-meta a, .cm-entry-header-meta a, .cm-below-entry-meta a, .posted-on a, .byline a) {
    color: #d2d9e8 !important;
}

html.ctdm-dark :where(.cm-post-categories, .cat-links, .tags-links) {
    background: transparent !important;
    border-color: transparent !important;
    color: var(--ctdm-muted) !important;
}

html.ctdm-dark :where(.cm-post-categories a, .cat-links a, .tags-links a) {
    background: linear-gradient(135deg, var(--ctdm-accent), var(--ctdm-accent-2)) !important;
    border-color: transparent !important;
    color: #ffffff !important;
}

html.ctdm-dark :where(.widget, .widget_block, .rpwwt-widget, #ez-toc-container, #comments, .comments-area, .comment-respond) {
    background: var(--ctdm-surface-soft) !important;
    border: 1px solid var(--ctdm-border) !important;
    color: var(--ctdm-text) !important;
}

html.ctdm-dark :where(#secondary .widget, #cm-secondary .widget, .sidebar .widget, aside .widget) {
    background: var(--ctdm-surface) !important;
    border-color: rgba(125, 215, 255, 0.25) !important;
}

html.ctdm-dark :where(#secondary .widget-title, #cm-secondary .widget-title, .sidebar .widget-title, aside .widget-title, #secondary h2, #cm-secondary h2, aside h2, #secondary h3, #cm-secondary h3, aside h3) {
    color: #c46cff !important;
    border-bottom-color: var(--ctdm-blue) !important;
}

html.ctdm-dark :where(#secondary a, #cm-secondary a, .sidebar a, aside a) {
    color: var(--ctdm-link) !important;
}

html.ctdm-dark :where(.telegram-subscribe, .google-news-subscribe, .social-links, .social-links-wrapper, .wp-block-categories-list, .wp-block-social-links) {
    background: var(--ctdm-surface) !important;
    border-color: var(--ctdm-border-strong) !important;
    color: var(--ctdm-text) !important;
    box-shadow: var(--ctdm-shadow);
}

html.ctdm-dark :where(.google-news-subscribe, .google-news-subscribe *, .google-news-button, .google-news-button *, .social-links, .social-links *, .telegram-subscribe, .telegram-subscribe *) {
    color: inherit;
}

html.ctdm-dark :where(.google-news-subscribe, .google-news-subscribe .wp-block-group, .google-news-subscribe div:not([class*="button"]), .social-links, .social-links div) {
    background-color: var(--ctdm-surface) !important;
}

html.ctdm-dark :where(.google-news-subscribe strong, .google-news-subscribe p, .telegram-subscribe strong, .telegram-subscribe span, .social-links strong, .social-links span) {
    color: var(--ctdm-text) !important;
}

html.ctdm-dark :where(.telegram-subscribe a, .google-news-button, .google-news-subscribe a, .wp-block-button__link) {
    background: linear-gradient(135deg, var(--ctdm-accent), var(--ctdm-accent-2)) !important;
    border-color: transparent !important;
    color: #ffffff !important;
}

html.ctdm-dark :where(.social-links a) {
    background: #ffffff !important;
    color: #111827 !important;
}

html.ctdm-dark :where(input, textarea, select) {
    background-color: #151b25 !important;
    border-color: var(--ctdm-border) !important;
    color: var(--ctdm-text) !important;
}

html.ctdm-dark :where(input::placeholder, textarea::placeholder) {
    color: var(--ctdm-muted) !important;
}

html.ctdm-dark :where(button, input[type="button"], input[type="submit"], .button) {
    background-color: var(--ctdm-surface-raised) !important;
    border-color: var(--ctdm-border) !important;
    color: var(--ctdm-text) !important;
}

html.ctdm-dark :where(button:hover, input[type="button"]:hover, input[type="submit"]:hover, .button:hover) {
    background-color: #333c50 !important;
    color: #ffffff !important;
}

html.ctdm-dark :where(table, th, td) {
    border-color: var(--ctdm-border) !important;
}

html.ctdm-dark :where(th) {
    background-color: var(--ctdm-surface-raised) !important;
    color: #ffffff !important;
}

html.ctdm-dark :where(.custom-logo, .site-logo img, .cm-site-branding img) {
    filter: none !important;
    opacity: 1 !important;
}

html.ctdm-dark :where(.entry-content img, article img, .wp-post-image) {
    opacity: 1 !important;
    filter: none !important;
}

html.ctdm-dark :where(.fotorama) {
    background: linear-gradient(var(--ctdm-surface), var(--ctdm-surface)) padding-box,
        linear-gradient(135deg, var(--ctdm-accent), var(--ctdm-blue)) border-box !important;
    border-color: transparent !important;
    color: var(--ctdm-text) !important;
}

html.ctdm-dark :where(.fotorama__nav__frame--thumb) {
    border-color: var(--ctdm-accent) !important;
}

html.ctdm-dark :where(.fotorama__arr, .fotorama__video-close, .fotorama__video-play) {
    background-color: rgba(20, 24, 33, 0.82) !important;
    color: var(--ctdm-text) !important;
}

html.ctdm-dark :where(.site-footer, footer, .footer-widgets-wrapper, .footer-socket-wrapper, .footer-widgets-area) {
    background: var(--ctdm-surface-soft) !important;
    color: var(--ctdm-text) !important;
    border-color: var(--ctdm-border) !important;
}

html.ctdm-dark :where(.site-footer a, footer a) {
    color: var(--ctdm-link) !important;
}

.ctdm-toggle {
    position: fixed;
    left: max(18px, env(safe-area-inset-left));
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 9999;
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: #ffffff;
    color: #111827;
    box-shadow: 0 12px 30px rgba(17, 24, 39, 0.22);
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.ctdm-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 36px rgba(17, 24, 39, 0.28);
}

.ctdm-toggle:focus-visible {
    outline: 3px solid rgba(125, 215, 255, 0.78);
    outline-offset: 3px;
}

.ctdm-toggle__icon {
    position: relative;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: currentColor;
    transition: transform 180ms ease;
}

.ctdm-toggle__icon::after {
    content: "";
    position: absolute;
    top: -2px;
    right: -5px;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: #ffffff;
    transition: transform 180ms ease, background-color 180ms ease;
}

html.ctdm-dark .ctdm-toggle {
    background: linear-gradient(135deg, var(--ctdm-accent), var(--ctdm-blue)) !important;
    color: #ffffff !important;
    box-shadow: var(--ctdm-shadow);
}

html.ctdm-dark .ctdm-toggle__icon {
    transform: scale(0.86);
}

html.ctdm-dark .ctdm-toggle__icon::after {
    transform: translate(11px, -8px) scale(0.22);
    background: transparent;
}

@media (prefers-reduced-motion: reduce) {
    .ctdm-toggle,
    .ctdm-toggle__icon,
    .ctdm-toggle__icon::after {
        transition: none;
    }
}
/* 3.2 refinements: softer news layout, readable article blocks, fewer heavy islands. */
html.ctdm-dark {
    --ctdm-bg: #151a23;
    --ctdm-bg-soft: #171d27;
    --ctdm-surface: #1d2531;
    --ctdm-surface-raised: #243044;
    --ctdm-surface-soft: #1a202b;
    --ctdm-border: rgba(165, 184, 213, 0.16);
    --ctdm-border-strong: rgba(156, 105, 255, 0.42);
    --ctdm-text: #edf3fb;
    --ctdm-heading: #f8fbff;
    --ctdm-muted: #aeb9c9;
    --ctdm-link: #73d3ff;
}

html.ctdm-dark :where(#page, .site, .site-content, #content, #cm-content, .content-area, .site-main, #primary, #cm-primary) {
    background: var(--ctdm-bg) !important;
}

html.ctdm-dark :where(.cm-posts, .archive-grid, .wp-block-post-template) {
    background: transparent !important;
}

html.ctdm-dark :where(.home article, .archive article, .blog article, .cm-post, .cm-posts > article, .cm-posts > div, .wp-block-post, .archive-grid .grid-item, .grid-item) {
    background: var(--ctdm-surface) !important;
    border: 1px solid rgba(165, 184, 213, 0.13) !important;
    box-shadow: none !important;
}

html.ctdm-dark :where(.home article:hover, .archive article:hover, .blog article:hover, .cm-post:hover, .cm-posts > article:hover, .grid-item:hover) {
    border-color: rgba(125, 211, 255, 0.24) !important;
    background: #202938 !important;
}

html.ctdm-dark :where(.single article, .single .post, .single .hentry, .single .entry-content) {
    background: var(--ctdm-surface) !important;
    border-color: rgba(165, 184, 213, 0.12) !important;
    box-shadow: none !important;
}

html.ctdm-dark :where(.entry-content, .entry-summary, .cm-post-content) :where(p, li, dd, dt, span, div, strong, b, em, small, label, td, th) {
    color: var(--ctdm-text) !important;
}

html.ctdm-dark :where(.entry-content, .entry-summary, .cm-post-content) :where(a) {
    color: var(--ctdm-link) !important;
}

html.ctdm-dark :where(.entry-content, .entry-summary, .cm-post-content) :where(h1, h2, h3, h4, h5, h6) {
    color: var(--ctdm-heading) !important;
}

html.ctdm-dark :where(.entry-title a, .cm-entry-title a, .post-title a, article h2 a, article h3 a) {
    color: var(--ctdm-heading) !important;
}

html.ctdm-dark :where(.cm-entry-header-meta, .cm-below-entry-meta, .entry-meta, .posted-on, .byline) {
    color: var(--ctdm-muted) !important;
}

html.ctdm-dark :where(.entry-content .wp-block-group, .entry-content .wp-block-columns, .entry-content .wp-block-column, .entry-content .wp-block-media-text, .entry-content .wp-block-cover, .entry-content .wp-block-table, .entry-content .wp-block-quote, .entry-content .wp-block-pullquote, .entry-content .wp-block-details, .entry-content details, .entry-content .schema-faq-section, .entry-content .rank-math-list-item, .entry-content .yoast-faq__item, .entry-content .faq-item, .entry-content .accordion, .entry-content .accordion-item, .entry-content .su-spoiler, .entry-content .su-spoiler-content) {
    background: #202938 !important;
    border-color: rgba(165, 184, 213, 0.18) !important;
    color: var(--ctdm-text) !important;
}

html.ctdm-dark :where(.entry-content summary, .entry-content .schema-faq-question, .entry-content .rank-math-question, .entry-content .yoast-faq__question, .entry-content .accordion-header, .entry-content .accordion-button, .entry-content .su-spoiler-title) {
    background: #273244 !important;
    border-color: rgba(165, 184, 213, 0.2) !important;
    color: var(--ctdm-heading) !important;
}

html.ctdm-dark :where(.entry-content .schema-faq-answer, .entry-content .rank-math-answer, .entry-content .yoast-faq__answer, .entry-content .accordion-body) {
    background: #202938 !important;
    color: var(--ctdm-text) !important;
}

html.ctdm-dark :where(.entry-content [style*="background-color: #fff"], .entry-content [style*="background-color:#fff"], .entry-content [style*="background: #fff"], .entry-content [style*="background:#fff"], .entry-content [style*="background-color: white"], .entry-content [style*="background-color:white"], .entry-content [style*="background: white"], .entry-content [style*="background:white"], .entry-content .has-white-background-color) {
    background: #202938 !important;
    color: var(--ctdm-text) !important;
}

html.ctdm-dark :where(.entry-content .has-black-color, .entry-content .has-dark-gray-color, .entry-content [style*="color: #000"], .entry-content [style*="color:#000"], .entry-content [style*="color: black"], .entry-content [style*="color:black"]) {
    color: var(--ctdm-text) !important;
}

html.ctdm-dark :where(.entry-content table, .entry-content thead, .entry-content tbody, .entry-content tr, .entry-content td, .entry-content th) {
    background: #202938 !important;
    border-color: rgba(165, 184, 213, 0.18) !important;
    color: var(--ctdm-text) !important;
}

html.ctdm-dark :where(.entry-content th) {
    background: #273244 !important;
    color: var(--ctdm-heading) !important;
}

html.ctdm-dark :where(.entry-content .wp-block-button__link, .entry-content .button, .entry-content button, .entry-content input[type="submit"]) {
    background: linear-gradient(135deg, var(--ctdm-accent), var(--ctdm-accent-2)) !important;
    border-color: transparent !important;
    color: #ffffff !important;
}

html.ctdm-dark :where(.telegram-subscribe, .google-news-subscribe, .social-links, .social-links-wrapper) {
    background: #202938 !important;
    border: 1px solid var(--ctdm-border-strong) !important;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.2) !important;
}

html.ctdm-dark :where(.google-news-subscribe, .google-news-subscribe *, .telegram-subscribe, .telegram-subscribe *) {
    color: var(--ctdm-text) !important;
}

html.ctdm-dark :where(.google-news-subscribe img, .telegram-subscribe img, .social-links img, .social-links svg) {
    filter: none !important;
    opacity: 1 !important;
}

html.ctdm-dark :where(#secondary, #cm-secondary, .sidebar, aside) {
    background: transparent !important;
}

html.ctdm-dark :where(#secondary .widget, #cm-secondary .widget, .sidebar .widget, aside .widget) {
    background: #1c2430 !important;
    border: 1px solid rgba(125, 211, 255, 0.18) !important;
    box-shadow: none !important;
}

html.ctdm-dark :where(#secondary .widget + .widget, #cm-secondary .widget + .widget, .sidebar .widget + .widget, aside .widget + .widget) {
    margin-top: 18px;
}

html.ctdm-dark :where(#secondary .widget-title, #cm-secondary .widget-title, .sidebar .widget-title, aside .widget-title, #secondary h2, #cm-secondary h2, aside h2, #secondary h3, #cm-secondary h3, aside h3) {
    color: #c978ff !important;
    border-bottom-color: rgba(115, 211, 255, 0.72) !important;
}

html.ctdm-dark :where(#secondary li, #cm-secondary li, .sidebar li, aside li, #secondary p, #cm-secondary p, .sidebar p, aside p) {
    color: var(--ctdm-text) !important;
}

html.ctdm-dark :where(.site-footer, footer, .footer-widgets-wrapper, .footer-socket-wrapper, .footer-widgets-area) {
    background: #171c25 !important;
    border-color: rgba(165, 184, 213, 0.14) !important;
    color: var(--ctdm-text) !important;
}

html.ctdm-dark :where(.site-footer .widget, footer .widget) {
    background: #1c2430 !important;
    border-color: rgba(165, 184, 213, 0.14) !important;
    box-shadow: none !important;
}

html.ctdm-dark :where(.site-footer [style*="background"], footer [style*="background"]) {
    background-color: #1c2430 !important;
}
