/* KotaWorld Dark Mode 1.0.0 — targeted, image-safe, dependency-free */
:root {
  --kwdm-border: rgba(255,255,255,.11);
  --kwdm-border-strong: rgba(255,255,255,.18);
  --kwdm-shadow: 0 10px 30px rgba(0,0,0,.24);
}

html[data-kw-theme="dark"] {
  background: var(--kwdm-bg);
  color-scheme: dark;
}

html[data-kw-theme="dark"] body {
  background: var(--kwdm-bg);
  color: var(--kwdm-text);
}

/* Smooth only where useful; reduced-motion always wins. */
html[data-kw-theme] body,
html[data-kw-theme] #sp-main-body,
html[data-kw-theme] #sp-main-body .card,
html[data-kw-theme] #sp-main-body .article,
html[data-kw-theme] #sp-main-body input,
html[data-kw-theme] #sp-main-body textarea,
html[data-kw-theme] #sp-main-body select {
  transition: background-color var(--kwdm-transition) ease, color var(--kwdm-transition) ease, border-color var(--kwdm-transition) ease, box-shadow var(--kwdm-transition) ease;
}

@media (prefers-reduced-motion: reduce) {
  html[data-kw-theme] *, html[data-kw-theme] *::before, html[data-kw-theme] *::after {
    transition-duration: 0.001ms !important;
  }
}

/* Main Helix canvas — preserve KotaWorld's blue/gold branded bars and image-led sections. */
html[data-kw-theme="dark"] #sp-main-body,
html[data-kw-theme="dark"] #sp-main-body > .container,
html[data-kw-theme="dark"] #sp-main-body > .container > .container-inner,
html[data-kw-theme="dark"] #sp-component,
html[data-kw-theme="dark"] #sp-component > .sp-column {
  background-color: var(--kwdm-bg) !important;
  color: var(--kwdm-text) !important;
}

html[data-kw-theme="dark"] #sp-main-body h1,
html[data-kw-theme="dark"] #sp-main-body h2,
html[data-kw-theme="dark"] #sp-main-body h3,
html[data-kw-theme="dark"] #sp-main-body h4,
html[data-kw-theme="dark"] #sp-main-body h5,
html[data-kw-theme="dark"] #sp-main-body h6,
html[data-kw-theme="dark"] #sp-main-body p,
html[data-kw-theme="dark"] #sp-main-body li,
html[data-kw-theme="dark"] #sp-main-body dt,
html[data-kw-theme="dark"] #sp-main-body dd,
html[data-kw-theme="dark"] #sp-main-body label,
html[data-kw-theme="dark"] #sp-main-body .article-details,
html[data-kw-theme="dark"] #sp-main-body .article-details .article-info,
html[data-kw-theme="dark"] #sp-main-body .article-details .article-info > span {
  color: var(--kwdm-text);
}

html[data-kw-theme="dark"] #sp-main-body .text-muted,
html[data-kw-theme="dark"] #sp-main-body small,
html[data-kw-theme="dark"] #sp-main-body .article-info,
html[data-kw-theme="dark"] #sp-main-body .createdby,
html[data-kw-theme="dark"] #sp-main-body .published,
html[data-kw-theme="dark"] #sp-main-body .modified,
html[data-kw-theme="dark"] #sp-main-body .category-name {
  color: var(--kwdm-muted) !important;
}

html[data-kw-theme="dark"] #sp-main-body a:not(.btn):not(.kws-card__link) {
  color: #9CB7FF;
}
html[data-kw-theme="dark"] #sp-main-body a:not(.btn):not(.kws-card__link):hover,
html[data-kw-theme="dark"] #sp-main-body a:not(.btn):not(.kws-card__link):focus {
  color: var(--kwdm-gold);
}

/* Common Joomla / Bootstrap surfaces. */
html[data-kw-theme="dark"] #sp-main-body .card,
html[data-kw-theme="dark"] #sp-main-body .list-group-item,
html[data-kw-theme="dark"] #sp-main-body .dropdown-menu,
html[data-kw-theme="dark"] #sp-main-body .modal-content,
html[data-kw-theme="dark"] #sp-main-body .accordion-item,
html[data-kw-theme="dark"] #sp-main-body .accordion-button,
html[data-kw-theme="dark"] #sp-main-body .pagination .page-link,
html[data-kw-theme="dark"] #sp-main-body table,
html[data-kw-theme="dark"] #sp-main-body .table {
  background-color: var(--kwdm-surface) !important;
  color: var(--kwdm-text) !important;
  border-color: var(--kwdm-border) !important;
}

html[data-kw-theme="dark"] #sp-main-body .card-header,
html[data-kw-theme="dark"] #sp-main-body .card-footer,
html[data-kw-theme="dark"] #sp-main-body .accordion-button:not(.collapsed),
html[data-kw-theme="dark"] #sp-main-body thead,
html[data-kw-theme="dark"] #sp-main-body th {
  background-color: var(--kwdm-surface-alt) !important;
  color: var(--kwdm-text) !important;
  border-color: var(--kwdm-border) !important;
}

html[data-kw-theme="dark"] #sp-main-body hr,
html[data-kw-theme="dark"] #sp-main-body .border,
html[data-kw-theme="dark"] #sp-main-body [class*="border-"] {
  border-color: var(--kwdm-border) !important;
}

/* Search and forms. */
html[data-kw-theme="dark"] #sp-main-body input:not([type="checkbox"]):not([type="radio"]),
html[data-kw-theme="dark"] #sp-main-body textarea,
html[data-kw-theme="dark"] #sp-main-body select,
html[data-kw-theme="dark"] #sp-section-7 input:not([type="checkbox"]):not([type="radio"]),
html[data-kw-theme="dark"] #sp-section-7 textarea,
html[data-kw-theme="dark"] #sp-section-7 select {
  background: var(--kwdm-surface) !important;
  color: var(--kwdm-text) !important;
  border-color: var(--kwdm-border-strong) !important;
}

html[data-kw-theme="dark"] input::placeholder,
html[data-kw-theme="dark"] textarea::placeholder {
  color: var(--kwdm-muted) !important;
  opacity: .82;
}

html[data-kw-theme="dark"] #sp-main-body input:focus,
html[data-kw-theme="dark"] #sp-main-body textarea:focus,
html[data-kw-theme="dark"] #sp-main-body select:focus,
html[data-kw-theme="dark"] #sp-section-7 input:focus {
  border-color: var(--kwdm-gold) !important;
  box-shadow: 0 0 0 .2rem rgba(255,180,0,.16) !important;
}

/* Search section: harmonise its neutral contents while retaining layout. */
html[data-kw-theme="dark"] #sp-section-7 .sp-module-title,
html[data-kw-theme="dark"] #sp-section-7 label {
  color: var(--kwdm-text) !important;
}

/* Article images, covers, hero cards and media MUST retain their original colours. */
html[data-kw-theme="dark"] img,
html[data-kw-theme="dark"] picture,
html[data-kw-theme="dark"] video,
html[data-kw-theme="dark"] canvas,
html[data-kw-theme="dark"] iframe,
html[data-kw-theme="dark"] .kws-card,
html[data-kw-theme="dark"] .kws-card__media {
  color-scheme: normal;
}

/* Joomla notices. Keep semantic colours and only reduce glare. */
html[data-kw-theme="dark"] #system-message-container .alert {
  filter: saturate(.88) brightness(.92);
}

/* Offcanvas: dark surface without changing the branded desktop header. */
html[data-kw-theme="dark"] .offcanvas-menu,
html[data-kw-theme="dark"] .offcanvas-inner {
  background: var(--kwdm-surface) !important;
  color: var(--kwdm-text) !important;
}
html[data-kw-theme="dark"] .offcanvas-menu a,
html[data-kw-theme="dark"] .offcanvas-menu .menu-toggler,
html[data-kw-theme="dark"] .offcanvas-menu .menu-parent > a > .menu-toggler {
  color: var(--kwdm-text) !important;
}

/* Modern Ratings: preserve score colours; darken only neutral panels/text. */
html[data-kw-theme="dark"] .modern-ratings-custom-container {
  background-color: var(--kwdm-surface) !important;
  color: var(--kwdm-text) !important;
  border-color: var(--kwdm-border) !important;
}
html[data-kw-theme="dark"] .modern-ratings-custom-container .modern-ratings-custom-details,
html[data-kw-theme="dark"] .modern-ratings-custom-container .rating-custom-row,
html[data-kw-theme="dark"] .modern-ratings-custom-container .rating-custom-label,
html[data-kw-theme="dark"] .modern-ratings-custom-container .rating-custom-value,
html[data-kw-theme="dark"] .modern-ratings-custom-container p,
html[data-kw-theme="dark"] .modern-ratings-custom-container h2,
html[data-kw-theme="dark"] .modern-ratings-custom-container h3,
html[data-kw-theme="dark"] .modern-ratings-custom-container h4 {
  color: var(--kwdm-text) !important;
}

/* Generic article boxes often produced by Joomla/Helix. */
html[data-kw-theme="dark"] #sp-main-body .article-list .article,
html[data-kw-theme="dark"] #sp-main-body .blog .article,
html[data-kw-theme="dark"] #sp-main-body .blog-featured .article,
html[data-kw-theme="dark"] #sp-main-body .article-details .article-header,
html[data-kw-theme="dark"] #sp-main-body blockquote {
  background-color: var(--kwdm-surface) !important;
  color: var(--kwdm-text) !important;
  border-color: var(--kwdm-border) !important;
}

/* Toggle */
.kwdm-toggle {
  position: fixed;
  z-index: 99990;
  top: calc(var(--kwdm-top) + env(safe-area-inset-top, 0px));
  width: var(--kwdm-size);
  height: var(--kwdm-size);
  display: grid;
  place-items: center;
  padding: 0;
  margin: 0;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  background: rgba(4,1,71,.92);
  color: #fff;
  box-shadow: 0 5px 18px rgba(0,0,0,.20);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  cursor: pointer;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  transition: transform 150ms ease, background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.kwdm-toggle.kwdm-desktop-right { right: calc(var(--kwdm-side) + env(safe-area-inset-right, 0px)); }
.kwdm-toggle.kwdm-desktop-left  { left:  calc(var(--kwdm-side) + env(safe-area-inset-left, 0px)); }
.kwdm-toggle:hover { transform: translateY(-1px); border-color: rgba(255,180,0,.72); box-shadow: 0 7px 22px rgba(0,0,0,.27); }
.kwdm-toggle:active { transform: translateY(0) scale(.96); }
.kwdm-toggle:focus-visible { outline: 3px solid var(--kwdm-gold); outline-offset: 3px; }

.kwdm-icon { position: absolute; width: 52%; height: 52%; display: grid; place-items: center; transition: opacity 150ms ease, transform 180ms ease; }
.kwdm-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html[data-kw-theme="light"] .kwdm-icon-sun { opacity: 1; transform: scale(1) rotate(0); }
html[data-kw-theme="light"] .kwdm-icon-moon { opacity: 0; transform: scale(.65) rotate(-18deg); }
html[data-kw-theme="dark"] .kwdm-toggle { background: rgba(17,17,38,.94); color: var(--kwdm-gold); border-color: rgba(255,180,0,.30); }
html[data-kw-theme="dark"] .kwdm-icon-sun { opacity: 0; transform: scale(.65) rotate(18deg); }
html[data-kw-theme="dark"] .kwdm-icon-moon { opacity: 1; transform: scale(1) rotate(0); }

@media (max-width: 767.98px) {
  .kwdm-toggle.kwdm-desktop-right,
  .kwdm-toggle.kwdm-desktop-left { right: auto; left: auto; }
  .kwdm-toggle.kwdm-mobile-left { left: calc(var(--kwdm-side) + env(safe-area-inset-left, 0px)); }
  .kwdm-toggle.kwdm-mobile-right { right: calc(var(--kwdm-side) + env(safe-area-inset-right, 0px)); }
}

@media print {
  .kwdm-toggle { display: none !important; }
  html[data-kw-theme="dark"] { color-scheme: light; background: #fff !important; }
  html[data-kw-theme="dark"] body,
  html[data-kw-theme="dark"] #sp-main-body,
  html[data-kw-theme="dark"] #sp-main-body > .container,
  html[data-kw-theme="dark"] #sp-component,
  html[data-kw-theme="dark"] #sp-component > .sp-column {
    background: #fff !important;
    color: #111 !important;
  }
}

/* =========================================================
   KotaWorld Dark Mode 1.1.0 — integrations for Helix header,
   Ultime Recensioni, Modern Ratings and KotaWorld vCard.
   Component-owned semantic/accent colours are preserved.
   ========================================================= */

/* Helix desktop/sticky header and navigation */
html[data-kw-theme="dark"] #sp-header,
html[data-kw-theme="dark"] #sp-header.header-sticky,
html[data-kw-theme="dark"] .header-sticky #sp-header {
  background: rgba(12,12,31,.97) !important;
  color: var(--kwdm-text) !important;
  border-bottom: 1px solid var(--kwdm-border) !important;
  box-shadow: 0 8px 26px rgba(0,0,0,.22) !important;
}
html[data-kw-theme="dark"] #sp-header .sp-column,
html[data-kw-theme="dark"] #sp-header .sp-megamenu-wrapper,
html[data-kw-theme="dark"] #sp-header #sp-menu {
  background: transparent !important;
}
html[data-kw-theme="dark"] #sp-header .sp-megamenu-parent > li > a,
html[data-kw-theme="dark"] #sp-header .sp-megamenu-parent > li > span {
  color: var(--kwdm-text) !important;
}
html[data-kw-theme="dark"] #sp-header .sp-megamenu-parent > li:hover > a,
html[data-kw-theme="dark"] #sp-header .sp-megamenu-parent > li:hover > span,
html[data-kw-theme="dark"] #sp-header .sp-megamenu-parent > li.active > a,
html[data-kw-theme="dark"] #sp-header .sp-megamenu-parent > li.current-item > a {
  color: var(--kwdm-gold) !important;
}
html[data-kw-theme="dark"] #sp-header .sp-dropdown .sp-dropdown-inner,
html[data-kw-theme="dark"] #sp-header .sp-mega-group > li > ul,
html[data-kw-theme="dark"] #sp-header .sp-dropdown-items {
  background: var(--kwdm-surface) !important;
  color: var(--kwdm-text) !important;
  border: 1px solid var(--kwdm-border) !important;
  box-shadow: var(--kwdm-shadow) !important;
}
html[data-kw-theme="dark"] #sp-header .sp-dropdown li.sp-menu-item > a,
html[data-kw-theme="dark"] #sp-header .sp-dropdown li.sp-menu-item > span {
  color: var(--kwdm-text) !important;
}
html[data-kw-theme="dark"] #sp-header .sp-dropdown li.sp-menu-item:hover > a,
html[data-kw-theme="dark"] #sp-header .sp-dropdown li.sp-menu-item.active > a {
  color: var(--kwdm-gold) !important;
  background: rgba(255,255,255,.045) !important;
}
html[data-kw-theme="dark"] #offcanvas-toggler,
html[data-kw-theme="dark"] #offcanvas-toggler:hover,
html[data-kw-theme="dark"] #offcanvas-toggler:focus {
  color: var(--kwdm-text) !important;
}
html[data-kw-theme="dark"] #offcanvas-toggler .burger-icon > span {
  background-color: var(--kwdm-text) !important;
}
/* Ultime Recensioni v5 — switch the module's own design tokens. */
html[data-kw-theme="dark"] .kw-reviews {
  --kw-blue: #B8C6FF;
  --kw-yellow: var(--kwdm-gold);
  --kw-ink: var(--kwdm-text);
  --kw-muted: var(--kwdm-muted);
  --kw-line: rgba(255,255,255,.12);
  --kw-card: #14142D;
  --kw-bg: linear-gradient(145deg, #111126 0%, #0D0D20 100%);
  background: var(--kw-bg) !important;
  border-color: var(--kw-line) !important;
  color: var(--kwdm-text) !important;
  box-shadow: 0 18px 45px rgba(0,0,0,.22) !important;
}
html[data-kw-theme="dark"] .kw-reviews .kw-panel {
  background: rgba(21,21,44,.88) !important;
  border-color: var(--kw-line) !important;
  box-shadow: 0 10px 25px rgba(0,0,0,.12) !important;
}
html[data-kw-theme="dark"] .kw-reviews .kw-review-item,
html[data-kw-theme="dark"] .kw-reviews .kw-scoreboard-row,
html[data-kw-theme="dark"] .kw-reviews .kw-reviews-empty {
  background: var(--kw-card) !important;
  border-color: var(--kw-line) !important;
  color: var(--kwdm-text) !important;
}
html[data-kw-theme="dark"] .kw-reviews .kw-review-title,
html[data-kw-theme="dark"] .kw-reviews .kw-scoreboard-title,
html[data-kw-theme="dark"] .kw-reviews .kw-panel h4,
html[data-kw-theme="dark"] .kw-reviews .kw-reviews-title {
  color: var(--kwdm-text) !important;
}
html[data-kw-theme="dark"] .kw-reviews .kw-review-link:hover .kw-review-title,
html[data-kw-theme="dark"] .kw-reviews .kw-scoreboard-title:hover,
html[data-kw-theme="dark"] .kw-reviews .kw-review-category {
  color: #B8C6FF !important;
}
html[data-kw-theme="dark"] .kw-reviews .kw-review-meta,
html[data-kw-theme="dark"] .kw-reviews .kw-review-excerpt,
html[data-kw-theme="dark"] .kw-reviews .kw-reviews-empty {
  color: var(--kwdm-muted) !important;
}
html[data-kw-theme="dark"] .kw-reviews .kw-scoreboard-rank {
  color: var(--kwdm-text) !important;
  background: linear-gradient(145deg, #1B1B3A, #28213A) !important;
  border-color: var(--kw-line) !important;
}
html[data-kw-theme="dark"] .kw-reviews .kw-review-thumb {
  background: var(--kwdm-surface-alt) !important;
}

/* Modern Ratings 2.1.x — override shorthand backgrounds and its neutral subpanels. */
html[data-kw-theme="dark"] .modern-ratings-custom-container {
  background: linear-gradient(145deg, #14142D 0%, #0E0E22 100%) !important;
  color: var(--kwdm-text) !important;
  border-color: var(--kwdm-gold) !important;
  box-shadow: 14px 14px 38px rgba(0,0,0,.28), -8px -8px 28px rgba(255,255,255,.025) !important;
}
html[data-kw-theme="dark"] .modern-ratings-custom-container .score-custom-circle::before {
  background: var(--kwdm-surface) !important;
}
html[data-kw-theme="dark"] .modern-ratings-custom-container .score-custom-label,
html[data-kw-theme="dark"] .modern-ratings-custom-container .rating-custom-label,
html[data-kw-theme="dark"] .modern-ratings-custom-container .rating-custom-value,
html[data-kw-theme="dark"] .modern-ratings-custom-container .modern-ratings-pros-cons-title,
html[data-kw-theme="dark"] .modern-ratings-custom-container .modern-ratings-pros-cons-list li,
html[data-kw-theme="dark"] .modern-ratings-custom-container .modern-ratings-tested-on,
html[data-kw-theme="dark"] .modern-ratings-custom-container .modern-ratings-copy-source,
html[data-kw-theme="dark"] .modern-ratings-custom-container .modern-ratings-custom-summary,
html[data-kw-theme="dark"] .modern-ratings-custom-container dt,
html[data-kw-theme="dark"] .modern-ratings-custom-container dd {
  color: var(--kwdm-text) !important;
}
html[data-kw-theme="dark"] .modern-ratings-custom-container .modern-ratings-pros-cons-column,
html[data-kw-theme="dark"] .modern-ratings-custom-container .modern-ratings-tested-on,
html[data-kw-theme="dark"] .modern-ratings-custom-container .modern-ratings-tested-on-item,
html[data-kw-theme="dark"] .modern-ratings-custom-container .modern-ratings-copy-source {
  background: rgba(255,255,255,.035) !important;
  border-color: var(--kwdm-border) !important;
  box-shadow: none !important;
}
html[data-kw-theme="dark"] .modern-ratings-custom-container .rating-custom-bar-container {
  background: #2A2A42 !important;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.26) !important;
}
/* Keep semantic score/pro/con colours intact, but ensure icon disks are comfortable on dark surfaces. */
html[data-kw-theme="dark"] .modern-ratings-custom-container .modern-ratings-pros .modern-ratings-pros-cons-icon {
  background: rgba(47,143,91,.19) !important;
  color: #7AD9A6 !important;
}
html[data-kw-theme="dark"] .modern-ratings-custom-container .modern-ratings-cons .modern-ratings-pros-cons-icon {
  background: rgba(185,74,72,.20) !important;
  color: #F09A97 !important;
}

/* KotaWorld vCard 3.x — use its own CSS variables so all descendants follow coherently. */
html[data-kw-theme="dark"] .kvcard {
  --kv-primary: #B8C6FF;
  --kv-accent: var(--kwdm-gold);
  --kv-bg: linear-gradient(145deg, #14142D 0%, #0E0E22 100%);
  --kv-bg-secondary: rgba(255,255,255,.055);
  --kv-text: var(--kwdm-text);
  --kv-text-secondary: var(--kwdm-muted);
  --kv-border: rgba(255,255,255,.11);
  --kv-shadow: 0 8px 32px rgba(0,0,0,.28), 0 2px 8px rgba(0,0,0,.18);
  --kv-shadow-hover: 0 14px 44px rgba(0,0,0,.34), 0 4px 12px rgba(0,0,0,.20);
  background: var(--kv-bg) !important;
  color: var(--kv-text) !important;
  border-color: var(--kv-border) !important;
}
html[data-kw-theme="dark"] .kvcard .kvcard-description,
html[data-kw-theme="dark"] .kvcard .kvcard-contact-item,
html[data-kw-theme="dark"] .kvcard .kvcard-custom-link,
html[data-kw-theme="dark"] .kvcard .kvcard-social-link {
  background-color: var(--kv-bg-secondary) !important;
  color: var(--kv-text) !important;
  border-color: var(--kv-border) !important;
}
html[data-kw-theme="dark"] .kvcard .kvcard-description {
  background: linear-gradient(135deg, rgba(184,198,255,.055), rgba(255,180,0,.055)) !important;
}
html[data-kw-theme="dark"] .kvcard .kvcard-contact-item:hover,
html[data-kw-theme="dark"] .kvcard .kvcard-custom-link:hover {
  background: #1B1B37 !important;
  border-color: rgba(255,180,0,.48) !important;
  color: var(--kv-text) !important;
  box-shadow: 0 7px 20px rgba(0,0,0,.22) !important;
}
html[data-kw-theme="dark"] .kvcard .kvcard-contact-icon {
  background: linear-gradient(135deg, #292942, #1E1E35);
  color: var(--kwdm-text);
}
/* Social-specific icon backgrounds defined by vCard stay untouched. */
html[data-kw-theme="dark"] .kvcard .kvcard-contact-label,
html[data-kw-theme="dark"] .kvcard .kvcard-company,
html[data-kw-theme="dark"] .kvcard .kvcard-add-contact-hint {
  color: var(--kv-text-secondary) !important;
}
html[data-kw-theme="dark"] .kvcard .kvcard-tagline,
html[data-kw-theme="dark"] .kvcard .kvcard-description a,
html[data-kw-theme="dark"] .kvcard .kvcard-social-link {
  color: #B8C6FF !important;
}
html[data-kw-theme="dark"] .kvcard .kvcard-btn-secondary {
  background: #181832 !important;
  color: #DDE4FF !important;
  border-color: #7589E8 !important;
}
html[data-kw-theme="dark"] .kvcard .kvcard-btn-secondary:hover {
  background: #25306A !important;
  color: #fff !important;
}
html[data-kw-theme="dark"] .kvcard .kvcard-avatar-clip,
html[data-kw-theme="dark"] .kvcard .kvcard-avatar-logo {
  background-color: #fff !important;
}


/* Modern Ratings: score presentation with strong contrast but no excessive glow. */
html[data-kw-theme="dark"] .modern-ratings-custom-container .score-custom-circle {
  background: conic-gradient(from -35deg, #FFB400 0deg, #FFD45B 205deg, #FFB400 360deg) !important;
  color: var(--kwdm-gold) !important;
  box-shadow: 0 0 0 1px rgba(255,180,0,.10), 0 8px 24px rgba(0,0,0,.32), 0 0 18px rgba(255,180,0,.18) !important;
  animation: none !important;
}
html[data-kw-theme="dark"] .modern-ratings-custom-container .score-custom-circle::before {
  background: #101024 !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07) !important;
}
html[data-kw-theme="dark"] .modern-ratings-custom-container .score-custom-value {
  color: #FFD04A !important;
  text-shadow: 0 1px 0 rgba(0,0,0,.35) !important;
}
html[data-kw-theme="dark"] .modern-ratings-custom-container .score-custom-max {
  color: #F4F5FA !important;
  opacity: .88 !important;
}
html[data-kw-theme="dark"] .modern-ratings-custom-container .score-custom-label {
  color: #FFFFFF !important;
  letter-spacing: 1.25px !important;
  text-shadow: none !important;
}

/* Rating tracks: brighter fill and clearer neutral rail. */
html[data-kw-theme="dark"] .modern-ratings-custom-container .rating-custom-bar-container {
  height: 12px !important;
  background: rgba(255,255,255,.14) !important;
  border: 1px solid rgba(255,255,255,.055) !important;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.42) !important;
}
html[data-kw-theme="dark"] .modern-ratings-custom-container .rating-custom-bar-fill {
  background: linear-gradient(90deg, #4F5BFF 0%, #7467F0 52%, #8F6CFF 100%) !important;
  box-shadow: 0 0 9px rgba(107,98,255,.22) !important;
  filter: none !important;
}
html[data-kw-theme="dark"] .modern-ratings-custom-container .rating-custom-label {
  color: #F6F7FC !important;
  font-weight: 650 !important;
}
html[data-kw-theme="dark"] .modern-ratings-custom-container .rating-custom-value {
  color: #FFFFFF !important;
  font-weight: 800 !important;
}

/* Joomla article Previous / Next buttons: dedicated dark treatment. */
html[data-kw-theme="dark"] #sp-main-body .pagenavigation {
  margin-top: 34px !important;
  padding-top: 18px !important;
  border-top: 1px solid rgba(255,255,255,.10) !important;
}
html[data-kw-theme="dark"] #sp-main-body .pagenavigation .pagination {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  width: 100% !important;
}
html[data-kw-theme="dark"] #sp-main-body .pagenavigation .btn,
html[data-kw-theme="dark"] #sp-main-body .pagenavigation .btn-secondary,
html[data-kw-theme="dark"] #sp-main-body .pagenavigation a.prev,
html[data-kw-theme="dark"] #sp-main-body .pagenavigation a.next {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  min-height: 42px !important;
  padding: 9px 16px !important;
  border: 1px solid rgba(255,180,0,.52) !important;
  border-radius: 10px !important;
  background: linear-gradient(180deg, rgba(255,180,0,.10), rgba(255,180,0,.045)) !important;
  color: #FFD04A !important;
  box-shadow: 0 5px 16px rgba(0,0,0,.18) !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease !important;
}
html[data-kw-theme="dark"] #sp-main-body .pagenavigation .btn:hover,
html[data-kw-theme="dark"] #sp-main-body .pagenavigation .btn:focus-visible,
html[data-kw-theme="dark"] #sp-main-body .pagenavigation a.prev:hover,
html[data-kw-theme="dark"] #sp-main-body .pagenavigation a.next:hover {
  background: var(--kwdm-gold) !important;
  border-color: var(--kwdm-gold) !important;
  color: #080817 !important;
  box-shadow: 0 8px 22px rgba(255,180,0,.18) !important;
  transform: translateY(-1px) !important;
}
html[data-kw-theme="dark"] #sp-main-body .pagenavigation [class*="icon-chevron"] {
  color: currentColor !important;
  font-size: .88em !important;
}

@media (max-width: 575.98px) {
  html[data-kw-theme="dark"] #sp-main-body .pagenavigation .pagination {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }
  html[data-kw-theme="dark"] #sp-main-body .pagenavigation .btn,
  html[data-kw-theme="dark"] #sp-main-body .pagenavigation a.prev,
  html[data-kw-theme="dark"] #sp-main-body .pagenavigation a.next {
    width: 100% !important;
  }
}






/* v1.6.0 — FIXED THEME SWITCH
   The toggle is viewport-fixed on desktop, tablet and mobile.
   It never participates in Helix header/logo layout. */
.kwdm-toggle {
  position: fixed !important;
  top: var(--kwdm-top) !important;
  bottom: auto !important;
  z-index: 2147483000 !important;
}

.kwdm-toggle.kwdm-desktop-right {
  right: var(--kwdm-side) !important;
  left: auto !important;
}
.kwdm-toggle.kwdm-desktop-left {
  left: var(--kwdm-side) !important;
  right: auto !important;
}

/* v2.0.0 — MOBILE/TABLET SWITCH: SAFE FIXED ZONE LEFT OF HAMBURGER
   Horizontal placement no longer depends on Helix's offcanvas element box.
   We reserve a fixed safety zone at the right for the hamburger. */
@media (max-width: 991.98px) {
  .kwdm-toggle,
  .kwdm-toggle.kwdm-mobile-left,
  .kwdm-toggle.kwdm-mobile-right {
    position: fixed !important;
    left: auto !important;
    right: 82px !important;
    top: var(--kwdm-mobile-header-center, 50%) !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    width: var(--kwdm-size) !important;
    height: var(--kwdm-size) !important;
    min-width: var(--kwdm-size) !important;
    min-height: var(--kwdm-size) !important;
    z-index: 2147483000 !important;
  }
}

@media (max-width: 420px) {
  .kwdm-toggle,
  .kwdm-toggle.kwdm-mobile-left,
  .kwdm-toggle.kwdm-mobile-right {
    right: 76px !important;
  }
}
