/* Follow the application's existing data-bs-theme switch. Light mode is unchanged. */
[data-bs-theme="dark"] {
    --mi-night-surface:#233334;
    --mi-night-raised:#2a3d3e;
    --mi-night-border:#435e5b;
    --mi-night-text:#e4efec;
    --mi-night-muted:#b8ccc6;
    --mi-night-accent:#82d8bf;
}
[data-bs-theme="dark"] .mi-home { color:var(--mi-night-text); }
[data-bs-theme="dark"] .mi-home-hero-inner { background:radial-gradient(ellipse at 12% 0%,#254b44,transparent 60%),radial-gradient(ellipse at 100% 100%,#244349,transparent 60%),#233334 !important; border-color:var(--mi-night-border); }
[data-bs-theme="dark"] .mi-home h1,
[data-bs-theme="dark"] .mi-home-section-heading h2,
[data-bs-theme="dark"] .mi-home-card h3,
[data-bs-theme="dark"] .mi-about h2,
[data-bs-theme="dark"] .mi-page h2,
[data-bs-theme="dark"] .mi-page h3,
[data-bs-theme="dark"] .mi-page h4,
[data-bs-theme="dark"] .mi-page h5 { color:var(--mi-night-text); }
[data-bs-theme="dark"] .mi-home-lead,
[data-bs-theme="dark"] .mi-home-section-heading p,
[data-bs-theme="dark"] .mi-home-card p,
[data-bs-theme="dark"] .mi-about p,
[data-bs-theme="dark"] .mi-home-search label,
[data-bs-theme="dark"] .mi-home-search-empty { color:var(--mi-night-muted); }
[data-bs-theme="dark"] .mi-home-card,
[data-bs-theme="dark"] .mi-about-story,
[data-bs-theme="dark"] .mi-about-card,
[data-bs-theme="dark"] .mi-page .mi-page-panel,
[data-bs-theme="dark"] .mi-page .card { background:var(--mi-night-surface) !important; border-color:var(--mi-night-border) !important; }
[data-bs-theme="dark"] .mi-home-blog,
[data-bs-theme="dark"] .mi-about-details { background:#1c2c2d; border-color:var(--mi-night-border); }
[data-bs-theme="dark"] .mi-about-image,
[data-bs-theme="dark"] .mi-home-card-image { background:linear-gradient(135deg,#29463e,#293f46); }
[data-bs-theme="dark"] .mi-about-icon { background:#29483f; border-color:var(--mi-night-border); color:var(--mi-night-accent); }
[data-bs-theme="dark"] .mi-home-badge { background:#203b35f5; border-color:#48695f; color:#b1ecd8; }
[data-bs-theme="dark"] .mi-home-card-action,
[data-bs-theme="dark"] .mi-home-about { color:var(--mi-night-accent); }
[data-bs-theme="dark"] .mi-home-search-field,
[data-bs-theme="dark"] .mi-home-search-results { background:var(--mi-night-surface); border-color:var(--mi-night-border); }
[data-bs-theme="dark"] .mi-home-search-field input,
[data-bs-theme="dark"] .mi-home-search-result { color:var(--mi-night-text); }
[data-bs-theme="dark"] .mi-home-search-field input::placeholder { color:var(--mi-night-muted); opacity:1; }
[data-bs-theme="dark"] .mi-home-search-field svg { color:var(--mi-night-accent); }
[data-bs-theme="dark"] .mi-home-search-result small { color:var(--mi-night-muted); }
[data-bs-theme="dark"] .mi-home-search-result:hover,
[data-bs-theme="dark"] .mi-home-search-result:focus-visible { background:#304d43; outline-color:var(--mi-night-accent); }
[data-bs-theme="dark"] .mi-home-search-result mark { background:#3d6858; color:#e7fff5; }
[data-bs-theme="dark"] .mi-home-pagination button { background:var(--mi-night-surface); border-color:var(--mi-night-border); color:var(--mi-night-text); }
[data-bs-theme="dark"] .mi-home-pagination button[aria-current="page"] { background:#08796e; color:#fff; }
[data-bs-theme="dark"] .mi-page p,
[data-bs-theme="dark"] .mi-page-prose,
[data-bs-theme="dark"] .mi-page .accordion-body { color:var(--mi-night-muted); }
[data-bs-theme="dark"] .mi-page .contact-info-box,
[data-bs-theme="dark"] .mi-page-news .list-group-item { background:#293d3b !important; border-color:var(--mi-night-border) !important; }
[data-bs-theme="dark"] .mi-page a:not(.btn):not(.dropdown-item):not(.nav-link):not(.page-link) { color:var(--mi-night-accent) !important; }
[data-bs-theme="dark"] .mi-page .form-control,
[data-bs-theme="dark"] .mi-page .form-select,
[data-bs-theme="dark"] .modal .form-control,
[data-bs-theme="dark"] .modal .form-select { background-color:#1c2c2d; border-color:var(--mi-night-border); color:var(--mi-night-text); color-scheme:dark; }
[data-bs-theme="dark"] .mi-page .form-control::placeholder { color:#a9bfba; }
[data-bs-theme="dark"] .mi-page .form-control:disabled,
[data-bs-theme="dark"] .mi-page .form-control[readonly],
[data-bs-theme="dark"] .mi-page .input-group-text { background:#304342; border-color:var(--mi-night-border); color:var(--mi-night-muted); }
[data-bs-theme="dark"] .mi-page .form-label { color:var(--mi-night-text); }
[data-bs-theme="dark"] .mi-page .alert-info,
[data-bs-theme="dark"] .mi-page .alert-primary { background:#28483e; border-color:#446b5b; color:#d5eee2; }
[data-bs-theme="dark"] .mi-page .table { --bs-table-color:#e4efec; --bs-table-bg:transparent; --bs-table-border-color:#435e5b; color:var(--mi-night-text); }
[data-bs-theme="dark"] .mi-page .table > thead { background:#304d43; color:var(--mi-night-text); }
[data-bs-theme="dark"] .mi-page .table-responsive { border-color:var(--mi-night-border); }
[data-bs-theme="dark"] .mi-page .nav-tabs { background:#1c2c2d; }
[data-bs-theme="dark"] .mi-page .nav-tabs .nav-link { color:var(--mi-night-muted); }
[data-bs-theme="dark"] .mi-page .nav-tabs .nav-link.active { background:var(--mi-night-raised); color:var(--mi-night-accent); }
[data-bs-theme="dark"] .mi-page .dropdown-menu { background:var(--mi-night-surface); border-color:var(--mi-night-border); }
[data-bs-theme="dark"] .mi-page .dropdown-item { color:var(--mi-night-text); }
[data-bs-theme="dark"] .mi-page .dropdown-item:hover { background:#304d43; }
[data-bs-theme="dark"] .mi-page .accordion { --bs-accordion-bg:#233334; --bs-accordion-color:#e4efec; --bs-accordion-btn-bg:#233334; --bs-accordion-active-bg:#304d43; --bs-accordion-active-color:#e4efec; }
[data-bs-theme="dark"] .mi-page .accordion-item { background:var(--mi-night-surface); border-color:var(--mi-night-border) !important; }
[data-bs-theme="dark"] .mi-page .accordion-button { background:var(--mi-night-surface); color:var(--mi-night-text); }
[data-bs-theme="dark"] .mi-page .accordion-button:not(.collapsed) { background:#304d43; color:#d2f5e8; }
[data-bs-theme="dark"] .mi-page .page-link { background:var(--mi-night-surface); border-color:var(--mi-night-border); color:var(--mi-night-accent); }
[data-bs-theme="dark"] .mi-page .active > .page-link { background:#08796e; color:#fff; }
[data-bs-theme="dark"] .mi-page .btn-outline-primary { color:var(--mi-night-accent); border-color:#618c7d; }
[data-bs-theme="dark"] .mi-page .btn-outline-primary:hover { color:#fff; }
[data-bs-theme="dark"] .modal { --bs-modal-bg:#233334; --bs-modal-color:#e4efec; }
[data-bs-theme="dark"] .modal .modal-content { background:var(--mi-night-surface); border-color:var(--mi-night-border); }
[data-bs-theme="dark"] .modal .modal-header { background:linear-gradient(115deg,#29483f,#233334); border-color:var(--mi-night-border); }
[data-bs-theme="dark"] .modal .modal-title { color:var(--mi-night-text); }
[data-bs-theme="dark"] .modal .modal-body { color:var(--mi-night-muted); }
[data-bs-theme="dark"] .modal .modal-footer { background:#1e302f; border-color:var(--mi-night-border); }
[data-bs-theme="dark"] .modal .btn-secondary,
[data-bs-theme="dark"] .modal .btn-outline-primary,
[data-bs-theme="dark"] .modal .btn-outline-secondary { background:var(--mi-night-raised); color:var(--mi-night-accent); border-color:#618c7d; }
[data-bs-theme="dark"] .modal .btn-close { background-color:#63867b; }
[data-bs-theme="dark"] .breadcrumb-rounded-xd.row { background:linear-gradient(110deg,#233334,#29413b) !important; border-color:var(--mi-night-border) !important; }
[data-bs-theme="dark"] .breadcrumb-rounded-xd .breadcrumb-item { color:var(--mi-night-muted); }
[data-bs-theme="dark"] .breadcrumb-rounded-xd .breadcrumb-item a { color:var(--mi-night-accent); }
[data-bs-theme="dark"] .breadcrumb-rounded-xd button[data-bs-target="#changeControllerLanguage"] { background:var(--mi-night-raised); color:var(--mi-night-text); border-color:#618c7d; }
[data-bs-theme="dark"] .breadcrumb-rounded-xd button[data-bs-target="#changeControllerLanguage"]:hover { background:#34594c; }
[data-bs-theme="dark"] .intro-div-test-start.h-cls { background:radial-gradient(ellipse at center,#28473e,#233334 70%) !important; }
[data-bs-theme="dark"] .mi-test-layout #main-quiz-screenshot > .row { background:var(--mi-night-surface) !important; border-color:var(--mi-night-border) !important; }
[data-bs-theme="dark"] .mi-test-layout #quiz_container { background:transparent !important; }
[data-bs-theme="dark"] #quiz-container .quiz_radiogroup input[type="radio"] + label { background:var(--mi-night-raised); color:var(--mi-night-text); border-color:var(--mi-night-border); }
[data-bs-theme="dark"] #quiz-container .quiz_radiogroup input[type="radio"] + label > span:first-child { background:#213230; border-color:#8fb7a8; }
[data-bs-theme="dark"] #quiz-container .quiz_radiogroup input[type="radio"]:checked + label { background:#305748; color:#e4fff2; border-color:#82d8bf; box-shadow:inset 0 0 0 1px #82d8bf; }
[data-bs-theme="dark"] #quiz-container .quiz_radiogroup input[type="radio"]:checked + label > span:first-child { background:#08796e; border-color:#82d8bf; }
[data-bs-theme="dark"] #quiz-container .quiz_radiogroup input[type="radio"] + label:hover { background:#345247; border-color:#82d8bf; }
[data-bs-theme="dark"] #quiz-container #quiz-buttons .quiz_btn { background:var(--mi-night-raised); color:var(--mi-night-text); border-color:#618c7d; }
[data-bs-theme="dark"] #quiz-container #quiz-buttons .quiz_btn:last-child { background:linear-gradient(110deg,#075e62,#08796e); color:#fff; }
[data-bs-theme="dark"] #quiz-container #quiz-progress .mi-progress-count { color:var(--mi-night-muted); }
[data-bs-theme="dark"] #quiz-container #quiz-progress::after { background:#435e5b; }
[data-bs-theme="dark"] .mi-test-layout .article-category article,
[data-bs-theme="dark"] .mi-test-layout .article-category .card { background:var(--mi-night-surface) !important; border-color:var(--mi-night-border); color:var(--mi-night-text); }
/* Bootstrap dark mode inverts the whole close button; use an explicit light X instead. */
[data-bs-theme="dark"] .btn-close {
    filter:none !important;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23effff8' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 6 12 12M18 6 6 18'/%3E%3C/svg%3E") !important;
    background-size:20px 20px !important;
    background-position:center !important;
    background-repeat:no-repeat !important;
    background-color:#34564a !important;
    opacity:1 !important;
}
[data-bs-theme="dark"] .btn-close:hover { background-color:#426c5c !important; }
[data-bs-theme="dark"] .btn-close:focus-visible { outline:3px solid #82d8bf !important; outline-offset:3px; }
