/* ═══════════════════════════════════════════════════════════════════════════
   MARKING DESK · DARK THEME · BASE (2026-09-21)
   Hand-written half of the dark theme: grounds, the top bar, Tabler primitives the skins never touched, the
   theme toggle. Loaded AFTER marking-desk-dark.css (the generated colour twins). Same boost selector so that
   these rules out-rank both the skins and the generated file.
   Dark tokens: ground #14201C · sheet #1C2723 · sheet-2 #212E29 · text #ECE9E1 · text-2 #C9CFCB · muted #97A59F
                marker #FF6A55 (on dark) · highlighter #F4E05A · correct #4CC9A3 · hairline rgba(246,244,238,.13)
   ═══════════════════════════════════════════════════════════════════════════ */

/* grounds */
html body.theme-dark:is(#qbd, body),
body.theme-dark:is(#qbd, body) .page,
body.theme-dark:is(#qbd, body) .page-wrapper,
body.theme-dark:is(#qbd, body) .page-body,
body.theme-dark:is(#qbd, body) .page-header,
body.theme-dark:is(#qbd, body) .content-wrapper {
    background-color: #14201C !important;
    background-image: none !important;
    color: #ECE9E1;
}
body.theme-dark:is(#qbd, body) .page-header { background: transparent !important; }
body.theme-dark:is(#qbd, body) { color-scheme: dark; }

/* the ambient orbs / shapes of the light page are noise on a dark ground */
body.theme-dark:is(#qbd, body) .md-orb,
body.theme-dark:is(#qbd, body) [class*="qb-orb"],
body.theme-dark:is(#qbd, body) .page-body::before,
body.theme-dark:is(#qbd, body) .page-body::after { opacity: 0.18 !important; }

/* top bar */
body.theme-dark:is(#qbd, body) header.navbar,
body.theme-dark:is(#qbd, body) .navbar-expand-md,
body.theme-dark:is(#qbd, body) header .navbar,
body.theme-dark:is(#qbd, body) .lqd-navbar-top { background: #14201C !important; border-color: rgba(246, 244, 238, 0.13) !important; }
body.theme-dark:is(#qbd, body) header .form-control,
body.theme-dark:is(#qbd, body) header input[type="search"],
body.theme-dark:is(#qbd, body) header .nav-link,
body.theme-dark:is(#qbd, body) header .btn,
body.theme-dark:is(#qbd, body) header a.btn,
body.theme-dark:is(#qbd, body) header .dropdown-toggle {
    background: #1C2723 !important;
    border-color: rgba(246, 244, 238, 0.16) !important;
    color: #ECE9E1 !important;
}
body.theme-dark:is(#qbd, body) header .form-control::placeholder { color: #7F8C87 !important; }
body.theme-dark:is(#qbd, body) header kbd,
body.theme-dark:is(#qbd, body) header .kbd { background: #212E29 !important; color: #97A59F !important; border-color: rgba(246, 244, 238, 0.16) !important; }
body.theme-dark:is(#qbd, body) header svg { stroke: #ECE9E1; }
body.theme-dark:is(#qbd, body) header .dropdown-menu,
body.theme-dark:is(#qbd, body) .dropdown-menu {
    background: #1C2723 !important;
    border: 1px solid rgba(246, 244, 238, 0.14) !important;
    color: #ECE9E1 !important;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5) !important;
}
body.theme-dark:is(#qbd, body) .dropdown-item,
body.theme-dark:is(#qbd, body) .dropdown-item span,
body.theme-dark:is(#qbd, body) .dropdown-header { color: #ECE9E1 !important; }
body.theme-dark:is(#qbd, body) .dropdown-item:hover,
body.theme-dark:is(#qbd, body) .dropdown-item:focus { background: #212E29 !important; color: #FF6A55 !important; }
body.theme-dark:is(#qbd, body) .dropdown-divider { border-color: rgba(246, 244, 238, 0.13) !important; }

/* Tabler primitives that skins left alone */
body.theme-dark:is(#qbd, body) .card,
body.theme-dark:is(#qbd, body) .card-body,
body.theme-dark:is(#qbd, body) .modal-content,
body.theme-dark:is(#qbd, body) .offcanvas,
body.theme-dark:is(#qbd, body) .accordion-item,
body.theme-dark:is(#qbd, body) .list-group-item,
body.theme-dark:is(#qbd, body) .toast,
body.theme-dark:is(#qbd, body) .popover { background-color: #1C2723; color: #ECE9E1; border-color: rgba(246, 244, 238, 0.13); }
body.theme-dark:is(#qbd, body) .card { background: #1C2723 !important; border-color: rgba(246, 244, 238, 0.13) !important; }
body.theme-dark:is(#qbd, body) .card-header,
body.theme-dark:is(#qbd, body) .card-footer,
body.theme-dark:is(#qbd, body) .modal-header,
body.theme-dark:is(#qbd, body) .modal-footer { background: #212E29 !important; border-color: rgba(246, 244, 238, 0.13) !important; color: #ECE9E1 !important; }
body.theme-dark:is(#qbd, body) .modal-content { background: #1C2723 !important; border-color: rgba(246, 244, 238, 0.14) !important; }
body.theme-dark:is(#qbd, body) .modal-backdrop { background: #000 !important; }
body.theme-dark:is(#qbd, body) .btn-close { filter: invert(1) grayscale(1); opacity: .7; }
body.theme-dark:is(#qbd, body) .form-control,
body.theme-dark:is(#qbd, body) .form-select,
body.theme-dark:is(#qbd, body) textarea,
body.theme-dark:is(#qbd, body) input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
body.theme-dark:is(#qbd, body) select,
body.theme-dark:is(#qbd, body) .input-group-text,
body.theme-dark:is(#qbd, body) .ts-control,
body.theme-dark:is(#qbd, body) .ts-dropdown {
    background-color: #1C2723 !important;
    border-color: rgba(246, 244, 238, 0.18) !important;
    color: #ECE9E1 !important;
}
body.theme-dark:is(#qbd, body) .form-control:focus,
body.theme-dark:is(#qbd, body) .form-select:focus,
body.theme-dark:is(#qbd, body) textarea:focus { border-color: #ECE9E1 !important; box-shadow: none !important; }
body.theme-dark:is(#qbd, body) ::placeholder { color: #7F8C87 !important; }
body.theme-dark:is(#qbd, body) .form-select { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ECE9E1' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important; }
body.theme-dark:is(#qbd, body) .form-check-input:not(:checked) { background-color: #1C2723 !important; border-color: rgba(246, 244, 238, 0.35) !important; }
body.theme-dark:is(#qbd, body) .form-check-input:checked { background-color: #ECE9E1 !important; border-color: #ECE9E1 !important; }
body.theme-dark:is(#qbd, body) .form-label,
body.theme-dark:is(#qbd, body) label,
body.theme-dark:is(#qbd, body) .form-hint,
body.theme-dark:is(#qbd, body) legend { color: #C9CFCB; }
body.theme-dark:is(#qbd, body) .text-heading,
body.theme-dark:is(#qbd, body) .text-dark,
body.theme-dark:is(#qbd, body) h1, body.theme-dark:is(#qbd, body) h2, body.theme-dark:is(#qbd, body) h3,
body.theme-dark:is(#qbd, body) h4, body.theme-dark:is(#qbd, body) h5, body.theme-dark:is(#qbd, body) h6 { color: #ECE9E1; }
body.theme-dark:is(#qbd, body) .text-muted,
body.theme-dark:is(#qbd, body) .text-secondary { color: #97A59F !important; }
body.theme-dark:is(#qbd, body) hr { border-color: rgba(246, 244, 238, 0.13) !important; opacity: 1; }
body.theme-dark:is(#qbd, body) .table,
body.theme-dark:is(#qbd, body) .table td,
body.theme-dark:is(#qbd, body) .table th,
body.theme-dark:is(#qbd, body) table td,
body.theme-dark:is(#qbd, body) table th { color: #ECE9E1 !important; border-color: rgba(246, 244, 238, 0.11) !important; background: transparent !important; }
body.theme-dark:is(#qbd, body) .table thead th,
body.theme-dark:is(#qbd, body) .table-responsive thead th { background: #212E29 !important; color: #97A59F !important; }
body.theme-dark:is(#qbd, body) .table tr:hover td,
body.theme-dark:is(#qbd, body) .card-table tr:hover td { background: #212E29 !important; }
body.theme-dark:is(#qbd, body) .badge.bg-secondary-lt,
body.theme-dark:is(#qbd, body) .bg-light,
body.theme-dark:is(#qbd, body) .bg-white,
body.theme-dark:is(#qbd, body) [class*="bg-\[\#f"],
body.theme-dark:is(#qbd, body) [class*="bg-\[\#F"],
body.theme-dark:is(#qbd, body) [class*="bg-gray-50"],
body.theme-dark:is(#qbd, body) [class*="bg-gray-100"],
body.theme-dark:is(#qbd, body) [class*="bg-zinc-50"] { background-color: #212E29 !important; color: #ECE9E1; }
body.theme-dark:is(#qbd, body) [class*="text-gray-"],
body.theme-dark:is(#qbd, body) [class*="text-zinc-"],
body.theme-dark:is(#qbd, body) [class*="text-slate-"],
body.theme-dark:is(#qbd, body) [class*="text-\[\#2D3136\]"] { color: #C9CFCB !important; }
body.theme-dark:is(#qbd, body) [class*="border-gray-"],
body.theme-dark:is(#qbd, body) [class*="border-zinc-"],
body.theme-dark:is(#qbd, body) [class*="border-\[var(--tblr-border-color)\]"] { border-color: rgba(246, 244, 238, 0.13) !important; }
body.theme-dark:is(#qbd, body) .alert { background: #212E29 !important; color: #ECE9E1 !important; border-color: rgba(246, 244, 238, 0.16) !important; }
body.theme-dark:is(#qbd, body) .alert-success { border-color: rgba(76, 201, 163, 0.4) !important; color: #4CC9A3 !important; }
body.theme-dark:is(#qbd, body) .alert-danger { border-color: rgba(255, 106, 85, 0.5) !important; color: #FF8A78 !important; }
body.theme-dark:is(#qbd, body) .progress { background: rgba(246, 244, 238, 0.12) !important; }
body.theme-dark:is(#qbd, body) .btn:not(.btn-primary):not([class*="bg-"]):not(.btn-danger):not(.btn-success) { background: #1C2723 !important; color: #ECE9E1 !important; border-color: rgba(246, 244, 238, 0.2) !important; }
body.theme-dark:is(#qbd, body) .btn-primary { background: #ECE9E1 !important; color: #14201C !important; border-color: transparent !important; }
body.theme-dark:is(#qbd, body) .btn-primary svg { stroke: #14201C !important; }
body.theme-dark:is(#qbd, body) .nav-tabs .nav-link { color: #97A59F !important; }
body.theme-dark:is(#qbd, body) .nav-tabs .nav-link.active { color: #ECE9E1 !important; background: #1C2723 !important; border-color: rgba(246, 244, 238, 0.16) rgba(246, 244, 238, 0.16) #1C2723 !important; }
body.theme-dark:is(#qbd, body) .tooltip-inner { background: #ECE9E1 !important; color: #14201C !important; }
body.theme-dark:is(#qbd, body) code, body.theme-dark:is(#qbd, body) pre { background: #212E29 !important; color: #ECE9E1 !important; }
body.theme-dark:is(#qbd, body) a:not(.btn):not(.nav-link):not(.dropdown-item) { color: #ECE9E1; }
body.theme-dark:is(#qbd, body) ::selection { background: #F4E05A; color: #14201C; }
body.theme-dark:is(#qbd, body) ::-webkit-scrollbar-thumb { background: rgba(246, 244, 238, 0.2); }

/* Marking-desk shared pieces whose colours the generator cannot infer */
body.theme-dark:is(#qbd, body) img.md-logo-ink,
body.theme-dark:is(#qbd, body) .md-logo-ink { filter: invert(1) hue-rotate(180deg); }
body.theme-dark:is(#qbd, body) .apexcharts-text,
body.theme-dark:is(#qbd, body) .apexcharts-legend-text,
body.theme-dark:is(#qbd, body) .apexcharts-datalabel-label,
body.theme-dark:is(#qbd, body) .apexcharts-datalabel-value { fill: #ECE9E1 !important; color: #ECE9E1 !important; }
body.theme-dark:is(#qbd, body) .apexcharts-gridline { stroke: rgba(246, 244, 238, 0.1) !important; }
body.theme-dark:is(#qbd, body) .apexcharts-tooltip { background: #1C2723 !important; color: #ECE9E1 !important; border-color: rgba(246, 244, 238, 0.16) !important; }
body.theme-dark:is(#qbd, body) .apexcharts-tooltip-title { background: #212E29 !important; border-color: rgba(246, 244, 238, 0.13) !important; }
/* the "Enjoying Quizbot?" follow card and the loading/AI dialog boxes */
body.theme-dark:is(#qbd, body) #qb-follow-card,
body.theme-dark:is(#qbd, body) [id*="follow-card"],
body.theme-dark:is(#qbd, body) .qb-dlg-box { background: #1C2723 !important; color: #ECE9E1 !important; border: 1px solid rgba(246, 244, 238, 0.14) !important; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5) !important; }
body.theme-dark:is(#qbd, body) #qb-follow-card *:not(a):not(svg):not(path),
body.theme-dark:is(#qbd, body) [id*="follow-card"] p,
body.theme-dark:is(#qbd, body) [id*="follow-card"] strong { color: #ECE9E1 !important; }
/* TinyMCE chrome (the editor body is styled by workbook-custom.js, left light on purpose: it is the "sheet") */
body.theme-dark:is(#qbd, body) .tox .tox-toolbar,
body.theme-dark:is(#qbd, body) .tox .tox-toolbar__primary,
body.theme-dark:is(#qbd, body) .tox .tox-toolbar-overlord,
body.theme-dark:is(#qbd, body) .tox .tox-menubar,
body.theme-dark:is(#qbd, body) .tox .tox-statusbar,
body.theme-dark:is(#qbd, body) .tox .tox-editor-header { background: #212E29 !important; border-color: rgba(246, 244, 238, 0.13) !important; }
body.theme-dark:is(#qbd, body) .tox .tox-tbtn,
body.theme-dark:is(#qbd, body) .tox .tox-tbtn__select-label,
body.theme-dark:is(#qbd, body) .tox .tox-statusbar__text-container { color: #ECE9E1 !important; }
body.theme-dark:is(#qbd, body) .tox .tox-tbtn svg { fill: #ECE9E1 !important; }
body.theme-dark:is(#qbd, body) .tox .tox-tbtn:hover { background: #2B3A35 !important; }
body.theme-dark:is(#qbd, body) .tox.tox-tinymce { border-color: rgba(246, 244, 238, 0.16) !important; }

/* the theme toggle in the top bar (was hidden; re-exposed 2026-09-21) */
body:is(#qbd, body) .qb-theme-toggle { display: flex !important; align-items: center; margin-inline-start: 6px; }
body:is(#qbd, body) .qb-theme-toggle .nav-link {
    width: 42px !important; height: 42px !important;
    border: 1px solid rgba(16, 28, 25, 0.16) !important;
    border-radius: 12px !important;
    background: #FFFFFF !important;
    color: #101C19 !important;
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
    padding: 0 !important;
}
body:is(#qbd, body) .qb-theme-toggle .nav-link svg { width: 19px; height: 19px; stroke: currentColor; }
body:is(#qbd, body) .qb-theme-toggle .nav-link:hover { border-color: #101C19 !important; color: #E2452F !important; }
body.theme-dark:is(#qbd, body) .qb-theme-toggle .nav-link { background: #1C2723 !important; border-color: rgba(246, 244, 238, 0.18) !important; color: #ECE9E1 !important; }
body.theme-dark:is(#qbd, body) .qb-theme-toggle .nav-link:hover { border-color: #ECE9E1 !important; color: #F4E05A !important; }
body.theme-light:is(#qbd, body) .hide-theme-light, body:not(.theme-dark):is(#qbd, body) .qb-theme-toggle .hide-theme-light { display: none !important; }
body.theme-dark:is(#qbd, body) .hide-theme-dark { display: none !important; }
@media (max-width: 991px) {
    body:is(#qbd, body) .qb-theme-toggle .nav-link { width: 38px !important; height: 38px !important; border-radius: 999px !important; }
}

/* fixes after the first dark sweep (2026-09-21) */
body.theme-dark:is(#qbd, body) #qbFollowCard,
body.theme-dark:is(#qbd, body) .qb-follow-card { background: #1C2723 !important; border: 1px solid rgba(246, 244, 238, 0.14) !important; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5) !important; }
body.theme-dark:is(#qbd, body) .qb-follow-card .qb-follow-title { color: #ECE9E1 !important; }
body.theme-dark:is(#qbd, body) .qb-follow-card p:not(.qb-follow-title) { color: #97A59F !important; }
body.theme-dark:is(#qbd, body) .qb-follow-card a:not([class*="icon"]) { color: #C9CFCB !important; }
body.theme-dark:is(#qbd, body) #yearlyBtn span[class*="bg-purple"] { background: #F4E05A !important; color: #14201C !important; }
body.theme-dark:is(#qbd, body) #payment-form #button-text img { filter: brightness(0) !important; opacity: .85; }
