/* Kohost persists the mode on the html element, including across guest pages. */
:root[data-bs-theme="dark"] {
    --gi-page: #101a2b;
    --gi-surface: #19283c;
    --gi-raised: #23354c;
    --gi-ink: #eff5ff;
    --gi-muted: #bbcadd;
    --gi-line: #41556e;
    --gi-link: #8dc7ff;
    --body-color: var(--gi-muted);
    --heading-color: var(--gi-ink);
    --border-color: var(--gi-line);
    --gray-light: var(--gi-raised);
    --dark: var(--gi-page);
}
[data-bs-theme="dark"] body.tt-body-wrapper,
[data-bs-theme="dark"] .tt-body-wrapper #main-body {
    color-scheme: dark;
    background-color: var(--gi-page) !important;
    color: var(--gi-ink);
}
[data-bs-theme="dark"] body.tt-body-wrapper a:not(.btn) { color: var(--gi-link); }
[data-bs-theme="dark"] body.tt-body-wrapper :is(.card,.panel,.modal-content,.dropdown-menu,.popover,.gi-section-results,.tt-color-switch,.card-footer,.panel-footer) {
    background-color: var(--gi-surface) !important;
    border-color: var(--gi-line);
    color: var(--gi-ink);
}
[data-bs-theme="dark"] body.tt-body-wrapper :is(.card-header,.panel-heading,.popover-header,.tiles .tile,.gi-header-search,.input-group-text,.btn-default,.table thead th) {
    background: var(--gi-raised) !important;
    border-color: var(--gi-line) !important;
    color: var(--gi-ink);
}
[data-bs-theme="dark"] body.tt-body-wrapper :is(.panel-body,.card-body,.popover-body,.list-group-item,.tiles .tile .title,.gi-section-results span,.gi-section-icon,.breadcrumb-item.active) { color: var(--gi-muted); }
[data-bs-theme="dark"] body.tt-body-wrapper :is(.card-title,.panel-title,.tiles .tile .stat,.form-control-label,.gi-login-card label,.gi-login-card h1) { color: var(--gi-ink); }
[data-bs-theme="dark"] body.tt-body-wrapper .tt-page-header {
    background: var(--gi-page) !important;
    border-color: var(--gi-line);
}
[data-bs-theme="dark"] body.tt-body-wrapper .tt-page-header h1 { color: var(--gi-ink) !important; }
[data-bs-theme="dark"] body.tt-body-wrapper .tt-breadcrumb ol { background: transparent !important; }
[data-bs-theme="dark"] body.tt-body-wrapper :is(.text-muted,.tiles .tile>i) { color: var(--gi-muted) !important; }
[data-bs-theme="dark"] body.tt-body-wrapper :is(.gi-header-search input,.form-control,.custom-select) {
    color: var(--gi-ink) !important;
    border-color: var(--gi-line);
}
[data-bs-theme="dark"] body.tt-body-wrapper ::placeholder { color: var(--gi-muted); opacity: 1; }
[data-bs-theme="dark"] body.tt-body-wrapper :is(.gi-section-results a,.dropdown-item,.list-group-item-action):is(:hover,:focus-visible) {
    background: #304864 !important;
    color: white !important;
}
[data-bs-theme="dark"] body.tt-body-wrapper :is(.verification-banner,.alert-warning) {
    background: #342c21;
    border-color: #826741;
    color: #ffe7b6;
}
[data-bs-theme="dark"] body.tt-body-wrapper .verification-banner :is(.text,.close) {color: inherit;}
[data-bs-theme="dark"] body.tt-body-wrapper header.tt-header .tt-toolbar-wrap :is(a,button,i,span) { color: var(--gi-ink) !important; }
[data-bs-theme="dark"] body.tt-body-wrapper .table { color: var(--gi-ink); }
[data-bs-theme="dark"] body.tt-body-wrapper :is(.badge-primary,.bg-primary) { color: white; background-color: #135bc6 !important; }
[data-bs-theme="dark"] body.tt-body-wrapper :is(.modal-header,.modal-footer,.table td,.table th,.gi-header-search) { border-color: var(--gi-line); }
[data-bs-theme="dark"] body.gi-login .gi-login-header { background: linear-gradient(90deg,#092d68 var(--split),var(--gi-page) var(--split)); }
[data-bs-theme="dark"] body.gi-login .gi-login-register { color: var(--gi-link); border-color: var(--gi-line); }
[data-bs-theme="dark"] body.gi-login .gi-login-register:hover { background: var(--gi-raised); }
@media (max-width:800px) {
    [data-bs-theme="dark"] body.gi-login .gi-login-header { background: #092d68; }
}
/* Pair the persistent white copyright strip with dark text in either mode. */
[data-bs-theme="dark"] #footer.gi-account-footer { color-scheme: light; }
[data-bs-theme="dark"] #footer.gi-account-footer :is(.copyright,.btn) { color: #111 !important; }
