/* Dark-mode hand rules — added 2026-09-29 (Joseph's Task Q). Companion to dark-mode.js, which re-maps the app's own
   stylesheet colours automatically. This file holds what cannot be derived: native controls and things the overlays own.
   Everything is scoped to body.dark, so light mode is untouched. Kill switch: localStorage 'dark-fix' = 'off' (script only). */

/* Native scrollbars, date/time pickers, <select> lists and autofill follow the dark scheme. */
html:has(body.dark) { color-scheme: dark; }

/* Overlay controls that use a fixed indigo. */
body.dark .hub-link { color: #a5b4fc; }
body.dark .hub-link:hover { color: #c7d2fe; }

/* Settings-panel ticker placeholder: lift the dim slate text on the dark strip. */
body.dark .hub-tape-msg { color: #94a3b8; }

/* Capital analysis: the app's own dark rule out-ranks its "active" rule, leaving the selected period dim on blue. */
body.dark .period-selector .period-btn.active { color: #fff !important; }

/* Bootstrap utility classes built from RGB triples (RGBA(var(--bs-*-rgb))): the automatic pass cannot re-map those. */
body.dark .bg-light, body.dark .bg-body-tertiary, body.dark .bg-body-secondary { background-color: #2c2c2e !important; }
body.dark .bg-white, body.dark .bg-body { background-color: #1c1c1e !important; }
body.dark .text-dark, body.dark .text-body { color: #f5f5f7 !important; }
body.dark .border-light { border-color: rgba(255, 255, 255, .14) !important; }

/* Browser autofill: the template paints a white inset shadow over it. */
body.dark input:-webkit-autofill, body.dark textarea:-webkit-autofill, body.dark select:-webkit-autofill {
  box-shadow: inset 0 0 0 50px #1c1c1e !important; -webkit-text-fill-color: #f5f5f7; caret-color: #f5f5f7;
}

/* Ticket group headers (overlay-owned, patched ticket page): the light-mode slate text is too dim on dark surfaces. */
body.dark .tg-type .tg-title, body.dark .tg-meta, body.dark .tg-chev { color: #a1a1a6; }
body.dark .tg-pause { color: #ff6961; border-color: rgba(255, 105, 97, .4); }

/* One dark surface family: the app's own navy (#1a202e) and the Apple layer's #1c1c1e sat side by side. */
body.dark .mat-mdc-card, body.dark .right-sidebar, body.dark .settingSidebar, body.dark .list-group-item, body.dark .modal .modal-content { background-color: var(--ap-surface, #1a202e); }

/* Focus borders of Bootstrap controls stay visible. */
body.dark .form-check-input:focus, body.dark button.account-header:focus { border-color: var(--ap-blue, #4da3ff); }
