/* Light values stay at their call sites; dark surfaces share the KennisHub palette. */
html[data-theme="dark"] {
    --kh-surface: #172337;
    --kh-surface-muted: #111c2e;
    --kh-heading: #f1f5f9;
    --kh-text: #cbd5e1;
    --kh-muted: #a4b3c7;
    --kh-border: #34445b;
    --kh-accent: #5eead4;
    --kh-success-bg: #123b36;
    --kh-success-text: #99f6e4;
    --kh-warning-bg: #3b2d1b;
    --kh-warning-text: #fcd34d;
    --kh-danger-bg: #42232e;
    --kh-danger-text: #fda4af;
    --kh-info-bg: #123343;
    --kh-info-text: #67e8f9;
}

.kh-theme-toggle {
    align-items: center;
    align-self: center;
    background: #f7e4ad;
    border: 1px solid #e7c985;
    border-radius: 999px;
    box-shadow: inset 0 1px 2px rgb(66 39 0 / 8%);
    box-sizing: border-box;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 52px;
    height: 28px;
    padding: 2px;
    position: relative;
    transition: background-color .25s, border-color .25s;
    vertical-align: middle;
    width: 52px;
}
/* Enlarge the pointer target without enlarging the visual switch. */
.kh-theme-toggle::before { content: ""; position: absolute; inset: -8px 0; }
.kh-theme-toggle:focus-visible { outline: 3px solid #14b8a6; outline-offset: 4px; }
.kh-theme-toggle-thumb {
    align-items: center; background: #d99b32; border-radius: 50%;
    box-shadow: 0 2px 5px rgb(63 37 0 / 24%); display: flex; flex: 0 0 22px;
    height: 22px; justify-content: center; position: relative;
    transition: transform .25s, background-color .25s;
}
.kh-theme-icon { fill: none; height: 16px; position: absolute; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; width: 16px; }
.kh-theme-moon { opacity: 0; }
html[data-theme="dark"] .kh-theme-toggle { background: #123343; border-color: #287b88; }
html[data-theme="dark"] .kh-theme-toggle-thumb { background: #14b8a6; transform: translateX(24px); }
html[data-theme="dark"] .kh-theme-sun { opacity: 0; }
html[data-theme="dark"] .kh-theme-moon { opacity: 1; }
.kh-theme-actions { align-items: center; display: flex; gap: 16px; }
.page-login > .kh-theme-toggle { position: absolute; right: 24px; top: 24px; }
@media (min-width: 992px) { body .content-top .navbar-custom-menu { align-items: center; display: flex; gap: 16px; } }
.responsive-header > .kh-theme-toggle { margin-left: 12px; order: 2; }
.responsive-header > .user-menu-wrapper { order: 3; }
/* One shared control replaces EasyAdmin's independent colour preference. */
.dropdown-settings { display: none !important; }
@media (prefers-reduced-motion: reduce) {
    .kh-theme-toggle, .kh-theme-toggle-thumb { transition: none; }
}
html[data-theme="dark"] .kh-cookie-banner { color-scheme: dark; }
