/* Kakanj-X 2.4.49 — additional dark-theme coverage.
 * Intentionally scoped to the public portal body: light theme is unchanged.
 * Avoid altering images, embedded third-party iframes, branded badges and ad creatives.
 */
body.kx-theme-dark {
  color-scheme: dark;
  --kx49-bg: #0d1318;
  --kx49-panel: #172029;
  --kx49-panel-raised: #1d2934;
  --kx49-panel-soft: #121a22;
  --kx49-border: #33404d;
  --kx49-text: #edf3f7;
  --kx49-muted: #b2c1cc;
  --kx49-green: #6bdfa6;
  background-color: var(--kx49-bg);
  color: var(--kx49-text);
}
body.kx-theme-dark :is(.container,.kx-home-shell,.article-shell,.archive-grid,.kx-events-page-165,.kx-jobs-page,.kx-whistle,.kx-pist-164,.kx-demo-158-page) {
  color: var(--kx49-text);
}
/* Core content surfaces, lists, tiles and article columns. */
body.kx-theme-dark :is(
  .article,.article-sidebar,.article-aside,.article-meta,.article-content,.article-body,
  .kx-article-146,.kx-article-149,.kx-top-aside,.kx-aside-panel,.kx-aside-panel-161,
  .kx-aside-line-161,.kx-aside-tabs,.kx-aside-item,.kx-story,.kx-secondary-story,
  .kx-category-block,.kx-news-item-186,.kx-home .tile,.archive-grid .tile,
  .archive-grid .tile .body,.kx-jobs-row a,.kx-job-detail,.kx-job-detail-main,
  .kx-job-detail-side,.kx-job-facts,.kx-job-section,.kx-events-card-165,
  .kx-events-item-165,.kx-events-form-165,.kx-events-sidebar-165,
  .kx-whistle-card,.kx-pist-detail-164,.kx-pist-card-164,
  .kx-comments-panel,.comment,.comment-card,.comments-panel,
  .kx-reader-card,.kx-reader-panel,.kx-profile-card,.kx-profile-box,
  .kx-weather-card,.kx-weather-hour,.kx-weather-day,.kx-weather-detail,
  .kx-crossword-panel,.kx-crossword-card,
  .kx-gallery-panel,.kx-slider,.kx-slider-thumbs,
  .kx-pagination,.pager,.kx-latest-pager-187,
  .kx-air-panel,.kx-air-card,.kx-air-summary
) { background-color: var(--kx49-panel) !important; color:var(--kx49-text); border-color:var(--kx49-border) !important; }
/* Shared content blocks, headers, tables, and menus. */
body.kx-theme-dark :is(
  .panel,.card,.box,.widget,.sidebar-widget,.side-panel,
  .category-head,.kx-job-back,.kx-job-safety,.kx-jobs-empty,
  .kx-events-title-row-165,.kx-events-form-row-165,
  .kx-events-success-165,.kx-pist-status-164,
  .kx-aside-panel-header-161,.kx-aside-panel-161,
  .kx-tabs,.tab-panel,.tabs-content,
  .kx-gallery-caption,.kx-cover-caption,
  .kx-news-submenu-186,.kx-magazine-submenu-2432,
  .kx-comment-controls,.kx-comment-form,.kx-comment-list,
  .kx-ai-result-204,.kx-ai-editor-204
) { background-color:var(--kx49-panel) !important; color:var(--kx49-text) !important; border-color:var(--kx49-border) !important; }
body.kx-theme-dark :is(
  .kx-top-grid,.kx-home,.kx-top-news,.kx-jobs,.kx-job-prose,
  .kx-category-block .kx-section-title,.kx-article-layout-149,
  .kx-events-layout-165,.kx-pist-hero-164,.kx-pist-164 .kx-pist-actions-164
) { color:var(--kx49-text); }
body.kx-theme-dark :is(h1,h2,h3,h4,h5,h6,.article h1,.article h2,.article h3,.kx-story h2,.kx-story h3,.tile h3,.kx-side-link strong,.kx-job-detail h1,.kx-events-page-165 h1,.kx-events-page-165 h2,.kx-whistle h1,.kx-home h2,.kx-home h3) { color:var(--kx49-text); }
body.kx-theme-dark :is(p,li,dd,dt,.article-body,.article-body p,.kx-job-prose p,.kx-events-card-165 p,.kx-pist-164 p,.kx-pist-detail-164 p) { color:inherit; }
body.kx-theme-dark :is(.meta,.kx-meta,.kx-meta-240,.kx-relative-240,.kx-job-meta,.kx-job-chips,.kx-event-meta,.kx-aside-eyebrow-161,.kx-cover-caption,small,.muted) { color:var(--kx49-muted); }
body.kx-theme-dark :is(.kx-side-link,.kx-jobs-row a,.archive-grid .tile,.kx-news-link-186,.kx-primary-link,.kx-job-back,.kx-latest-prev-187,.kx-latest-next-187,.pager a) { color:var(--kx49-text); border-color:var(--kx49-border) !important; }
body.kx-theme-dark :is(.kx-side-link:hover,.kx-jobs-row a:hover,.archive-grid .tile:hover,.kx-news-link-186:hover,.kx-primary-link:hover) { background-color:var(--kx49-panel-raised) !important; }
/* Inputs and form-related colors. Do not recolor buttons carrying intentional brand colors. */
body.kx-theme-dark :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),textarea,select) {
  background-color:var(--kx49-panel-soft) !important;
  color:var(--kx49-text) !important;
  border-color:var(--kx49-border) !important;
  caret-color:var(--kx49-text);
}
body.kx-theme-dark :is(input,textarea)::placeholder{color:#9aabb9;opacity:1}
body.kx-theme-dark :is(input,textarea,select):focus-visible{outline:2px solid #62c98e;outline-offset:2px}
body.kx-theme-dark :is(label,legend,.kx-events-page-165 label,.kx-pist-164 label,.kx-whistle label){color:var(--kx49-text)}
body.kx-theme-dark :is(button:not(.kx-nav-action-171):not(.kx-pist-btn-primary-164),.pager a,.kx-latest-prev-187,.kx-latest-next-187){border-color:var(--kx49-border)}
body.kx-theme-dark button:not([class]):not([style]){background:var(--kx49-panel-raised);color:var(--kx49-text)}
body.kx-theme-dark :is(table,thead,tbody,tr,th,td){border-color:var(--kx49-border)}
body.kx-theme-dark table{background:var(--kx49-panel)}
body.kx-theme-dark :is(th,thead tr){background:var(--kx49-panel-raised);color:var(--kx49-text)}
body.kx-theme-dark :is(td,tbody tr){background:var(--kx49-panel);color:var(--kx49-text)}
body.kx-theme-dark tbody tr:nth-child(even) td{background:var(--kx49-panel-soft)}
body.kx-theme-dark :is(hr,.divider){border-color:var(--kx49-border)}
/* Avoid inherited white backgrounds from inline cards in newly-added public modules. */
body.kx-theme-dark :is(.container,.article-shell,.kx-home-shell,.archive-grid,.kx-events-page-165,.kx-pist-164,.kx-whistle) [style*="background:#fff"],
body.kx-theme-dark :is(.container,.article-shell,.kx-home-shell,.archive-grid,.kx-events-page-165,.kx-pist-164,.kx-whistle) [style*="background: #fff"],
body.kx-theme-dark :is(.container,.article-shell,.kx-home-shell,.archive-grid,.kx-events-page-165,.kx-pist-164,.kx-whistle) [style*="background:#ffffff"],
body.kx-theme-dark :is(.container,.article-shell,.kx-home-shell,.archive-grid,.kx-events-page-165,.kx-pist-164,.kx-whistle) [style*="background: #ffffff"],
body.kx-theme-dark :is(.container,.article-shell,.kx-home-shell,.archive-grid,.kx-events-page-165,.kx-pist-164,.kx-whistle) [style*="background-color:white"],
body.kx-theme-dark :is(.container,.article-shell,.kx-home-shell,.archive-grid,.kx-events-page-165,.kx-pist-164,.kx-whistle) [style*="background-color: white"] { background-color:var(--kx49-panel) !important; color:var(--kx49-text) !important; }
/* Pure white utility cards and sliders should not reintroduce bright patches. */
body.kx-theme-dark :is(.bg-white,.background-white,.white-card,.light-card,.card-white,.bg-light,.bg-gray-50,.bg-slate-50){background-color:var(--kx49-panel) !important;color:var(--kx49-text) !important}
body.kx-theme-dark :is(.text-black,.text-dark,.black-text){color:var(--kx49-text) !important}
body.kx-theme-dark :is(.text-muted,.text-secondary,.text-gray){color:var(--kx49-muted) !important}
/* For cases that use explicit light-colored backgrounds in core content (not advertisements). */
body.kx-theme-dark :is(.article,.article-shell,.kx-home,.kx-events-page-165,.kx-pist-164,.kx-whistle,.kx-job-detail) :is([style*="background:#f8"],[style*="background: #f8"],[style*="background:#f9"],[style*="background: #f9"],[style*="background:#faf"],[style*="background: #faf"]):not(.kx-promo-tag-196) {background-color:var(--kx49-panel-raised) !important;color:var(--kx49-text) !important}
/* Gallery: keep photographic content unchanged, but ensure its surrounding surfaces are dark. */
body.kx-theme-dark :is(.kx-slider,.kx-slider-stage,.kx-slider-thumbs,.kx-gallery-lightbox,.kx-gallery-viewer,.kx-gallery-214,.kx-gallery-modal,.kx-gallery-inner){background-color:var(--kx49-panel-soft) !important;border-color:var(--kx49-border) !important}
body.kx-theme-dark :is(.kx-slider-caption,.kx-gallery-credit,.kx-gallery-caption,.kx-cover-caption){color:var(--kx49-muted)}
/* Weather and air quality retain semantic AQI badges and their colors. */
body.kx-theme-dark :is(.kx-weather-page,.kx-weather-detail,.kx-air-page,.kx-air-panel,.kx-air-summary,.kx-weather-day,.kx-weather-hour){border-color:var(--kx49-border)}
/* Preserve original appearance of all uploaded media, embedded widgets and ad creatives. */
body.kx-theme-dark :is(img,video,canvas,iframe,svg,.kx-photo-ribbon-1100,.kx-media-icon-2445,.kx-ad-slot,.kx-ad-content,.kx-ad-unit){filter:none}
@media(max-width:780px){
 body.kx-theme-dark :is(.kx-nav-search,.kx-news-submenu-186,.kx-magazine-submenu-2432,.kx-home .kx-top-aside,.kx-aside-panel,.kx-aside-panel-161,.kx-jobs-row a,.archive-grid .tile,.kx-events-form-165,.kx-pist-164 .panel){background-color:var(--kx49-panel) !important;color:var(--kx49-text)}
 body.kx-theme-dark :is(.kx-nav-row,.kx-main-nav-186,.kx-global-nav){border-color:var(--kx49-border)}
}
