/* Added: 2026-10-19 15:10 - Shared semantic colors keep Bootstrap, Sneat, and existing content on one compatible theme. */
:root,
:root[data-site-theme="neutral-light"] {
    color-scheme: light;
    --theme-canvas: #f4f4f5;
    --theme-canvas-rgb: 244, 244, 245;
    --theme-surface: #ffffff;
    --theme-surface-rgb: 255, 255, 255;
    --theme-subtle: #fafafa;
    --theme-border: #e4e4e7;
    --theme-ink: #18181b;
    --theme-ink-rgb: 24, 24, 27;
    --theme-muted: #52525b;
    --theme-muted-rgb: 82, 82, 91;
    --theme-primary: #18181b;
    --theme-primary-rgb: 24, 24, 27;
    --theme-primary-hover: #3f3f46;
    --theme-primary-hover-rgb: 63, 63, 70;
    --theme-primary-soft: #ededee;
    --theme-on-primary: #ffffff;
    --theme-shadow: 0 .125rem .625rem rgb(24 24 27 / 6%);
    --theme-focus: #52525b;
    --theme-danger: #a52b2b;
    --theme-danger-rgb: 165, 43, 43;
    --theme-success: #21663b;
    --theme-success-rgb: 33, 102, 59;
}

:root[data-site-theme="neutral-soft"] {
    color-scheme: light;
    --theme-canvas: #eeeeef;
    --theme-canvas-rgb: 238, 238, 239;
    --theme-surface: #fafafa;
    --theme-surface-rgb: 250, 250, 250;
    --theme-subtle: #f1f1f2;
    --theme-border: #d4d4d8;
    --theme-ink: #27272a;
    --theme-ink-rgb: 39, 39, 42;
    --theme-muted: #52525b;
    --theme-muted-rgb: 82, 82, 91;
    --theme-primary: #3f3f46;
    --theme-primary-rgb: 63, 63, 70;
    --theme-primary-hover: #18181b;
    --theme-primary-hover-rgb: 24, 24, 27;
    --theme-primary-soft: #e4e4e7;
    --theme-on-primary: #ffffff;
    --theme-shadow: none;
    --theme-focus: #3f3f46;
    --theme-danger: #a52b2b;
    --theme-danger-rgb: 165, 43, 43;
    --theme-success: #21663b;
    --theme-success-rgb: 33, 102, 59;
}

/* Added: 2026-10-19 15:10 - This site-owned dark preset extends the free light-only Sneat edition; no Pro theme assets are used. */
:root[data-site-theme="neutral-dark"] {
    color-scheme: dark;
    --theme-canvas: #151517;
    --theme-canvas-rgb: 21, 21, 23;
    --theme-surface: #202024;
    --theme-surface-rgb: 32, 32, 36;
    --theme-subtle: #28282d;
    --theme-border: #3f3f46;
    --theme-ink: #f4f4f5;
    --theme-ink-rgb: 244, 244, 245;
    --theme-muted: #b9b9c2;
    --theme-muted-rgb: 185, 185, 194;
    --theme-primary: #e4e4e7;
    --theme-primary-rgb: 228, 228, 231;
    --theme-primary-hover: #ffffff;
    --theme-primary-hover-rgb: 255, 255, 255;
    --theme-primary-soft: #34343b;
    --theme-on-primary: #18181b;
    --theme-shadow: 0 .125rem .625rem rgb(0 0 0 / 18%);
    --theme-focus: #d4d4d8;
    --theme-danger: #ffb4b4;
    --theme-danger-rgb: 255, 180, 180;
    --theme-success: #a0d9b2;
    --theme-success-rgb: 160, 217, 178;
}

/* Added: 2026-10-19 15:10 - Alias existing names while exposing Bootstrap and Sneat's native component variables. */
:root[data-site-theme],
:root:not([data-site-theme]) {
    --brand-primary: var(--theme-primary);
    --brand-primary-dark: var(--theme-primary-hover);
    --brand-primary-soft: var(--theme-primary-soft);
    --brand-accent: var(--theme-primary);
    --brand-accent-text: var(--theme-primary-hover);
    --color-canvas: var(--theme-canvas);
    --color-surface: var(--theme-surface);
    --color-surface-subtle: var(--theme-subtle);
    --color-border: var(--theme-border);
    --color-ink: var(--theme-ink);
    --color-muted: var(--theme-muted);
    --color-on-primary: var(--theme-on-primary);
    --color-green-dark: var(--theme-primary);
    --color-green: var(--theme-primary-hover);
    --color-sage: var(--theme-muted);
    --color-cream: var(--theme-canvas);
    --color-oat: var(--theme-border);
    --color-copper: var(--theme-primary-hover);
    --font-display: "Segoe UI", Arial, sans-serif;
    --font-body: "Segoe UI", Arial, sans-serif;
    --shadow-soft: var(--theme-shadow);
    --bs-body-bg: var(--theme-canvas);
    --bs-body-bg-rgb: var(--theme-canvas-rgb);
    --bs-body-color: var(--theme-ink);
    --bs-body-color-rgb: var(--theme-ink-rgb);
    --bs-heading-color: var(--theme-ink);
    --bs-emphasis-color: var(--theme-ink);
    --bs-emphasis-color-rgb: var(--theme-ink-rgb);
    --bs-secondary-color: var(--theme-muted);
    --bs-secondary-color-rgb: var(--theme-muted-rgb);
    --bs-secondary-bg: var(--theme-subtle);
    --bs-tertiary-color: var(--theme-muted);
    --bs-tertiary-bg: var(--theme-subtle);
    --bs-border-color: var(--theme-border);
    --bs-border-color-translucent: var(--theme-border);
    --bs-primary: var(--theme-primary);
    --bs-primary-rgb: var(--theme-primary-rgb);
    --bs-primary-contrast: var(--theme-on-primary);
    --bs-primary-text-emphasis: var(--theme-primary);
    --bs-primary-bg-subtle: var(--theme-primary-soft);
    --bs-primary-border-subtle: var(--theme-border);
    --bs-secondary: var(--theme-muted);
    --bs-secondary-rgb: var(--theme-muted-rgb);
    --bs-secondary-text-emphasis: var(--theme-muted);
    --bs-secondary-bg-subtle: var(--theme-subtle);
    --bs-secondary-border-subtle: var(--theme-border);
    --bs-link-color: var(--theme-primary);
    --bs-link-color-rgb: var(--theme-primary-rgb);
    --bs-link-hover-color: var(--theme-primary-hover);
    --bs-link-hover-color-rgb: var(--theme-primary-hover-rgb);
    --bs-custom-link-color: var(--theme-primary);
    --bs-paper-bg: var(--theme-surface);
    --bs-paper-bg-rgb: var(--theme-surface-rgb);
    --bs-base-color: var(--theme-ink);
    --bs-base-color-rgb: var(--theme-ink-rgb);
    --bs-gray-25: var(--theme-subtle);
    --bs-gray-60: var(--theme-subtle);
    --bs-gray-80: var(--theme-primary-soft);
    --bs-gray-100: var(--theme-subtle);
    --bs-gray-200: var(--theme-border);
    --bs-gray-300: var(--theme-border);
    --bs-gray-500: var(--theme-muted);
    --bs-gray-600: var(--theme-muted);
    --bs-gray-700: var(--theme-muted);
    --bs-gray-900: var(--theme-ink);
    --bs-font-sans-serif: var(--font-body);
    --bs-box-shadow: var(--theme-shadow);
    --bs-box-shadow-sm: var(--theme-shadow);
    --bs-box-shadow-lg: 0 .5rem 1.5rem rgb(0 0 0 / 12%);
    --bs-navbar-bg: var(--theme-surface);
    --bs-navbar-border-color: var(--theme-border);
    --bs-menu-bg: var(--theme-surface);
    --bs-menu-bg-rgb: var(--theme-surface-rgb);
    --bs-menu-color: var(--theme-ink);
    --bs-menu-color-rgb: var(--theme-ink-rgb);
    --bs-menu-header-color: var(--theme-muted);
    --bs-menu-hover-bg: var(--theme-subtle);
    --bs-menu-hover-color: var(--theme-ink);
    --bs-menu-active-bg: var(--theme-primary-soft);
    --bs-menu-active-color: var(--theme-primary);
    --bs-menu-active-toggle-bg: var(--theme-primary-soft);
    --bs-menu-sub-active-bg: var(--theme-primary-soft);
    --bs-menu-sub-active-color: var(--theme-primary);
    --bs-menu-divider-color: var(--theme-border);
    --bs-menu-box-shadow: none;
    --bs-menu-width: 15.75rem;
    --bs-focus-ring-color: rgb(var(--theme-primary-rgb) / 20%);
    --bs-success: var(--theme-success);
    --bs-success-rgb: var(--theme-success-rgb);
    --bs-success-text-emphasis: var(--theme-success);
    --bs-success-bg-subtle: color-mix(in srgb, var(--theme-success) 10%, var(--theme-surface));
    --bs-danger: var(--theme-danger);
    --bs-danger-rgb: var(--theme-danger-rgb);
    --bs-danger-text-emphasis: var(--theme-danger);
    --bs-danger-bg-subtle: color-mix(in srgb, var(--theme-danger) 10%, var(--theme-surface));
}

/* Added: 2026-10-19 15:10 - Components with local Bootstrap variables must inherit the selected preset as well. */
.btn-primary {
    --bs-btn-color: var(--theme-on-primary);
    --bs-btn-bg: var(--theme-primary);
    --bs-btn-border-color: var(--theme-primary);
    --bs-btn-hover-color: var(--theme-on-primary);
    --bs-btn-hover-bg: var(--theme-primary-hover);
    --bs-btn-hover-border-color: var(--theme-primary-hover);
    --bs-btn-active-color: var(--theme-on-primary);
    --bs-btn-active-bg: var(--theme-primary-hover);
    --bs-btn-active-border-color: var(--theme-primary-hover);
    --bs-btn-disabled-color: var(--theme-on-primary);
    --bs-btn-disabled-bg: var(--theme-primary);
    --bs-btn-disabled-border-color: var(--theme-primary);
    --bs-btn-shadow-color: var(--theme-primary-rgb);
    --bs-btn-focus-shadow-rgb: var(--theme-primary-rgb);
}

.btn-outline-primary {
    --bs-btn-color: var(--theme-primary);
    --bs-btn-border-color: var(--theme-primary);
    --bs-btn-hover-color: var(--theme-on-primary);
    --bs-btn-hover-bg: var(--theme-primary);
    --bs-btn-hover-border-color: var(--theme-primary);
    --bs-btn-active-color: var(--theme-on-primary);
    --bs-btn-active-bg: var(--theme-primary);
    --bs-btn-active-border-color: var(--theme-primary);
    --bs-btn-disabled-color: var(--theme-primary);
    --bs-btn-disabled-border-color: var(--theme-primary);
}

.btn-secondary,
.btn-outline-secondary {
    --bs-btn-color: var(--theme-ink);
    --bs-btn-bg: var(--theme-subtle);
    --bs-btn-border-color: var(--theme-border);
    --bs-btn-hover-color: var(--theme-ink);
    --bs-btn-hover-bg: var(--theme-primary-soft);
    --bs-btn-hover-border-color: var(--theme-muted);
    --bs-btn-active-color: var(--theme-ink);
    --bs-btn-active-bg: var(--theme-primary-soft);
    --bs-btn-active-border-color: var(--theme-muted);
}

.form-control,
.form-select {
    color: var(--theme-ink);
    background-color: var(--theme-surface);
    border-color: var(--theme-border);
    --bs-input-border-color: var(--theme-border);
}

.form-control:focus,
.form-select:focus {
    color: var(--theme-ink);
    background-color: var(--theme-surface);
    border-color: var(--theme-focus);
    box-shadow: 0 0 0 .15rem rgb(var(--theme-primary-rgb) / 15%);
}

.form-control:disabled,
.form-select:disabled,
.form-control[readonly] {
    color: var(--theme-muted);
    background-color: var(--theme-subtle);
}

.form-label,
.col-form-label,
.form-check-label {
    color: var(--theme-ink);
}

.form-text,
.form-control::placeholder {
    color: var(--theme-muted);
}

.form-check-input:checked {
    background-color: var(--theme-primary);
    border-color: var(--theme-primary);
}

.table {
    --bs-table-color: var(--theme-ink);
    --bs-table-bg: var(--theme-surface);
    --bs-table-border-color: var(--theme-border);
    --bs-table-striped-color: var(--theme-ink);
    --bs-table-striped-bg: var(--theme-subtle);
    --bs-table-hover-color: var(--theme-ink);
    --bs-table-hover-bg: var(--theme-subtle);
    --bs-table-active-color: var(--theme-ink);
    --bs-table-active-bg: var(--theme-primary-soft);
}

.dropdown-menu {
    --bs-dropdown-color: var(--theme-ink);
    --bs-dropdown-bg: var(--theme-surface);
    --bs-dropdown-border-color: var(--theme-border);
    --bs-dropdown-link-color: var(--theme-ink);
    --bs-dropdown-link-hover-color: var(--theme-ink);
    --bs-dropdown-link-hover-bg: var(--theme-subtle);
    --bs-dropdown-link-active-color: var(--theme-primary);
    --bs-dropdown-link-active-bg: var(--theme-primary-soft);
}

.card,
.modal-content,
.offcanvas,
.toast {
    color: var(--theme-ink);
    background-color: var(--theme-surface);
    border-color: var(--theme-border);
    --bs-card-bg: var(--theme-surface);
    --bs-card-color: var(--theme-ink);
    --bs-card-border-color: var(--theme-border);
    --bs-card-title-color: var(--theme-ink);
    --bs-card-cap-color: var(--theme-ink);
    --bs-card-cap-bg: var(--theme-surface);
}

.accordion {
    --bs-accordion-bg: var(--theme-surface);
    --bs-accordion-color: var(--theme-ink);
    --bs-accordion-btn-color: var(--theme-ink);
    --bs-accordion-active-color: var(--theme-ink);
    --bs-accordion-active-bg: var(--theme-subtle);
}

.nav,
.navbar {
    --bs-nav-link-color: var(--theme-muted);
    --bs-nav-link-hover-color: var(--theme-ink);
    --bs-navbar-color: var(--theme-muted);
    --bs-navbar-hover-color: var(--theme-ink);
    --bs-navbar-active-color: var(--theme-ink);
    --bs-nav-tabs-link-active-color: var(--theme-ink);
    --bs-nav-tabs-link-active-bg: var(--theme-surface);
    --bs-nav-pills-link-active-color: var(--theme-on-primary);
    --bs-nav-pills-link-active-bg: var(--theme-primary);
}

/* Added: 2026-10-19 15:10 - Replace Sneat's fixed light icon assets where a dark preset requires a contrasting glyph. */
:root[data-site-theme="neutral-dark"] .form-select {
    --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23e4e4e7' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

:root[data-site-theme="neutral-dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(150%);
}

:root[data-site-theme="neutral-dark"] .form-check-input:checked {
    background-color: #52525b;
    border-color: #a1a1aa;
}

@media (prefers-reduced-motion: reduce) {
    .btn,
    .form-control,
    .form-select,
    .menu-link {
        transition: none;
    }
}
