:root { color-scheme:light; }
.gin-theme-picker { display:flex; align-items:center; gap:.5rem; min-width:0; }
.gin-theme-picker > i { color:var(--gin-muted); }
.gin-mobile-support { display:none; }
body .gin-theme-picker .form-select { width:auto; min-width:110px; min-height:36px; font-size:.8125rem; padding-block:.35rem; }
.gin-public-toolbar { display:flex; justify-content:flex-end; max-width:1100px; margin:16px auto 0; padding-inline:16px; }
.gin-auth-toolbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:1rem; margin-bottom:1rem; }
body .gin-auth-toolbar .gin-auth-languages { margin:0; }
body :is(.warning-color,.warning-color-dark) a:not(.btn) { color:#48390b!important; }
@media(max-width:575px) {
    .gin-theme-picker { gap:.25rem; }
    body .gin-theme-picker .form-select { min-height:44px; }
    body.fixed-sn .double-nav { padding-inline:8px; }
    body .double-nav .gin-theme-picker > i { display:none; }
    body .double-nav .navbar-nav { flex-wrap:nowrap; }
    body .double-nav .nav-link, body .double-nav .button-collapse { min-width:44px; min-height:44px; }
    body .double-nav .gin-theme-picker .form-select { min-width:90px; min-height:44px; padding-left:.5rem; padding-right:1.75rem; }
    body .double-nav #navbarLanguage, body .double-nav #navbarDropdownMenuLink { padding-inline:4px; }
    body .double-nav #navbarLanguage img { height:16px; width:auto; }
}
@media(max-width:359px) {
    body .double-nav .gin-header-support { display:none; }
    body .gin-mobile-support { display:block; }
}

html[data-bs-theme=dark] { color-scheme:dark; }
html[data-bs-theme=dark] body.fixed-sn { background:var(--gin-canvas)!important; }
html[data-bs-theme=dark] body :is(.navbar,.side-nav,.gin-metric,.timeline .step-content,.gin-error-summary,.gin-empty-state,trix-editor) { background:var(--gin-surface); }
html[data-bs-theme=dark] body .card { box-shadow:0 4px 20px #0002; }
html[data-bs-theme=dark] body :is(.timeline,.timeline .step-content) { border-color:var(--gin-line); }
html[data-bs-theme=dark] body :is(.gin-nav-toggle:hover,.side-nav .gin-nav-link:hover,.side-nav .collapsible > li a.collapsible-header:hover) { background:var(--gin-hover); }
html[data-bs-theme=dark] body :is(.side-nav a.active,.side-nav .gin-nav-link[aria-current=page],.md-tabs .nav-link.active,.nav-tabs .nav-link.active,.gin-selection-status) { background:var(--gin-active); color:var(--gin-active-ink); }
html[data-bs-theme=dark] body .side-nav .gin-nav-link[aria-current=page] { box-shadow:inset 3px 0 var(--gin-primary); }
html[data-bs-theme=dark] body :is(.gin-nav-toggle.active,.gin-breadcrumb a) { color:var(--gin-active-ink); }
html[data-bs-theme=dark] body :is(.side-nav .gin-nav-section,.gin-breadcrumb ol,.gin-breadcrumb li + li::before) { color:var(--gin-muted); }
html[data-bs-theme=dark] body :is(.nav-tabs,.md-tabs) { background:var(--gin-surface)!important; }
html[data-bs-theme=dark] body .gin-skip-link { background:var(--gin-surface); color:var(--gin-primary); border-color:var(--gin-primary); }
html[data-bs-theme=dark] body .gin-sandbox { background:var(--gin-subtle); color:var(--gin-primary); border-color:var(--gin-line); }
html[data-bs-theme=dark] body :focus-visible { outline-color:var(--gin-primary)!important; }

/* Native controls, including the HTML controls used in business grids. */
html[data-bs-theme=dark] body textarea { color:var(--gin-ink); }
html[data-bs-theme=dark] body :is(.form-control:disabled,.form-control[readonly],.form-select:disabled) { background:var(--gin-subtle); color:var(--gin-muted); }
html[data-bs-theme=dark] body .form-control::placeholder { color:var(--gin-muted); opacity:1; }
html[data-bs-theme=dark] body .form-control:focus, html[data-bs-theme=dark] body .form-select:focus { box-shadow:0 0 0 3px var(--gin-focus-ring); }
html[data-bs-theme=dark] body .form-check-input:checked { background-color:var(--gin-primary); border-color:var(--gin-primary); }
html[data-bs-theme=dark] body .form-check-input:focus { border-color:var(--gin-primary); box-shadow:0 0 0 3px var(--gin-focus-ring); }
html[data-bs-theme=dark] body :is(.gin-error-summary a,.gin-field-errors,.red-text) { color:var(--gin-danger-ink); }
html[data-bs-theme=dark] body :is(.gin-error-summary,[aria-invalid=true]:not(form)) { border-color:var(--gin-danger-ink); }
html[data-bs-theme=dark] body :is(.text-info,.text-primary,.blue-text,.indigo-text) { color:var(--gin-primary)!important; }
html[data-bs-theme=dark] body .text-danger { color:var(--gin-danger-ink)!important; }
html[data-bs-theme=dark] body .text-dark:not(.badge):not(.btn) { color:var(--gin-ink)!important; }
html[data-bs-theme=dark] body :is(.bg-white,.bg-light,.white,.grey.lighten-4) { background-color:var(--gin-subtle)!important; }
html[data-bs-theme=dark] body .btn-outline-primary { --bs-btn-color:var(--gin-primary); --bs-btn-border-color:var(--gin-primary); --bs-btn-hover-color:var(--gin-on-primary); }
html[data-bs-theme=dark] body :is(.btn-outline-secondary,.btn-light) {
    --bs-btn-color:var(--gin-ink); --bs-btn-border-color:var(--gin-control-border);
    --bs-btn-hover-bg:var(--gin-hover); --bs-btn-hover-color:var(--gin-ink); --bs-btn-hover-border-color:var(--gin-primary);
    --bs-btn-active-bg:var(--gin-active); --bs-btn-active-color:var(--gin-ink);
}
html[data-bs-theme=dark] body .btn-light { --bs-btn-bg:var(--gin-subtle); }

/* Readable tables, tabs and dynamically inserted Ajax rows. */
html[data-bs-theme=dark] body .table { --bs-table-color:var(--gin-ink); --bs-table-bg:transparent; --bs-table-striped-color:var(--gin-ink); --bs-table-striped-bg:#ffffff05; --bs-table-hover-color:var(--gin-ink); --bs-table-hover-bg:var(--gin-hover); --bs-table-border-color:var(--gin-line); }
html[data-bs-theme=dark] body table.table thead th { background:var(--gin-subtle); color:var(--gin-muted); }
html[data-bs-theme=dark] body table.table td { border-color:var(--gin-line); }
html[data-bs-theme=dark] body table.table tbody tr:hover { background:var(--gin-hover); }
html[data-bs-theme=dark] body .table .gin-current-position > td { background:var(--gin-active); color:var(--gin-ink); }
html[data-bs-theme=dark] body .dt-processing { background:var(--gin-surface); color:var(--gin-ink); }
html[data-bs-theme=dark] body .pagination { --bs-pagination-color:var(--gin-primary); --bs-pagination-bg:var(--gin-surface); --bs-pagination-border-color:var(--gin-line); --bs-pagination-hover-color:var(--gin-primary); --bs-pagination-hover-bg:var(--gin-hover); --bs-pagination-focus-color:var(--gin-primary); --bs-pagination-focus-bg:var(--gin-hover); --bs-pagination-disabled-bg:var(--gin-subtle); }
html[data-bs-theme=dark] body .list-group { --bs-list-group-bg:var(--gin-surface); --bs-list-group-color:var(--gin-ink); --bs-list-group-action-color:var(--gin-ink); --bs-list-group-action-hover-bg:var(--gin-hover); --bs-list-group-action-active-bg:var(--gin-active); --bs-list-group-action-active-color:var(--gin-ink); }
html[data-bs-theme=dark] body .dropdown-menu { --bs-dropdown-bg:var(--gin-surface); --bs-dropdown-color:var(--gin-ink); --bs-dropdown-link-color:var(--gin-ink); --bs-dropdown-link-hover-color:var(--gin-ink); --bs-dropdown-link-hover-bg:var(--gin-hover); --bs-dropdown-border-color:var(--gin-line); }

/* Select2, Flatpickr and Trix do not inherit Bootstrap's color modes. */
html[data-bs-theme=dark] body :is(.select2-container .select2-selection--single,.select2-container .select2-selection--multiple,.select2-dropdown,.select2-search__field) { background:var(--gin-surface); color:var(--gin-ink); border-color:var(--gin-control-border); }
html[data-bs-theme=dark] body :is(.select2-container--default .select2-selection--single .select2-selection__rendered,.select2-container--default .select2-selection--multiple .select2-selection__rendered) { color:var(--gin-ink); }
html[data-bs-theme=dark] body :is(.select2-selection__placeholder,.select2-selection__clear) { color:var(--gin-muted); }
html[data-bs-theme=dark] body .select2-container--default .select2-selection--multiple .select2-selection__choice { background:var(--gin-subtle); border-color:var(--gin-line); }
html[data-bs-theme=dark] body .select2-container--default .select2-selection__choice__remove { color:var(--gin-ink); border-color:var(--gin-line); }
html[data-bs-theme=dark] body .select2-container--default .select2-results__option--selected { background:var(--gin-active); }
html[data-bs-theme=dark] body .select2-container--default .select2-results__option--highlighted { background:var(--gin-primary); color:var(--gin-on-primary); }
html[data-bs-theme=dark] body .flatpickr-calendar { background:var(--gin-surface); color:var(--gin-ink); box-shadow:0 4px 24px #0006; border:1px solid var(--gin-line); }
html[data-bs-theme=dark] body .flatpickr-calendar.arrowTop::before { border-bottom-color:var(--gin-line); }
html[data-bs-theme=dark] body .flatpickr-calendar.arrowTop::after { border-bottom-color:var(--gin-subtle); }
html[data-bs-theme=dark] body .flatpickr-calendar.arrowBottom::before { border-top-color:var(--gin-line); }
html[data-bs-theme=dark] body .flatpickr-calendar.arrowBottom::after { border-top-color:var(--gin-surface); }
html[data-bs-theme=dark] body :is(.flatpickr-months .flatpickr-month,.flatpickr-current-month .flatpickr-monthDropdown-months,span.flatpickr-weekday,.flatpickr-weekdays) { background:var(--gin-subtle); color:var(--gin-ink); fill:var(--gin-ink); }
html[data-bs-theme=dark] body :is(.flatpickr-prev-month,.flatpickr-next-month) { color:var(--gin-ink); fill:var(--gin-ink); }
html[data-bs-theme=dark] body .flatpickr-monthDropdown-month { background:var(--gin-surface); }
html[data-bs-theme=dark] body .numInputWrapper span.arrowUp::after { border-bottom-color:var(--gin-ink); }
html[data-bs-theme=dark] body .numInputWrapper span.arrowDown::after { border-top-color:var(--gin-ink); }
html[data-bs-theme=dark] body .flatpickr-day { color:var(--gin-ink); }
html[data-bs-theme=dark] body .flatpickr-day:not(.selected):not(.flatpickr-disabled):hover { background:var(--gin-hover); border-color:var(--gin-line); }
html[data-bs-theme=dark] body .flatpickr-day.today { border-color:var(--gin-primary); }
html[data-bs-theme=dark] body :is(.flatpickr-day.flatpickr-disabled,.flatpickr-day.prevMonthDay,.flatpickr-day.nextMonthDay) { color:var(--gin-muted); opacity:.65; }
html[data-bs-theme=dark] body .flatpickr-day.selected { color:var(--gin-on-primary); opacity:1; }
html[data-bs-theme=dark] body trix-toolbar .trix-button-group { background:var(--gin-subtle); border-color:var(--gin-control-border); }
html[data-bs-theme=dark] body trix-toolbar .trix-button { color:var(--gin-ink); border-color:var(--gin-control-border); }
html[data-bs-theme=dark] body trix-toolbar .trix-button::before { filter:invert(1); }
html[data-bs-theme=dark] body trix-toolbar .trix-button.trix-active { background:var(--gin-active); }
html[data-bs-theme=dark] body trix-toolbar .trix-dialog { background:var(--gin-surface); color:var(--gin-ink); border-color:var(--gin-line); }

/* Preserve partner status colors and the original document/signature surfaces. */
html[data-bs-theme=dark] body tr[style*="#ffff0030"] { background:#514621!important; }
html[data-bs-theme=dark] body .gin-org-node[style*="#fe938e"] { background:#4c2632!important; color:#ffd2d9!important; }
html[data-bs-theme=dark] body :is(.gin-brand img,.gin-auth-logo) { background:var(--gin-brand-dark); }
body :is(canvas.signature-pad,.gin-pdf-viewer,iframe[title][sandbox]) { color-scheme:light; }
@media print {
    .gin-theme-picker,.gin-public-toolbar { display:none!important; }
}

html[data-bs-theme=dark] body .btn-primary { --bs-btn-bg:var(--gin-primary); --bs-btn-border-color:var(--gin-primary); --bs-btn-color:var(--gin-on-primary); --bs-btn-hover-bg:var(--gin-primary-hover); --bs-btn-hover-border-color:var(--gin-primary-hover); --bs-btn-hover-color:var(--gin-on-primary); --bs-btn-active-color:var(--gin-on-primary); }

/* Bootstrap uses white glyphs by default; champagne controls need charcoal glyphs. */
html[data-bs-theme=dark] body .form-check-input:checked[type=checkbox] { --bs-form-check-bg-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23232c2e' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e"); }
html[data-bs-theme=dark] body .form-check-input:checked[type=radio] { --bs-form-check-bg-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23232c2e'/%3e%3c/svg%3e"); }
