/* RG-TPL-FIX-20261104
 * WhatsApp template / Email template windows (Lead 360 "Message" tiles, ids dm-tpl-ov / dm-tpl-preview).
 * Cause: the windows are built with inline styles that set a white card and a cream preview box (#FAFAF7) but NO text colour.
 * Under the New look (html.nl-on) the page text colour is the light cream --nl-fg (#F3EFE6), so the message inherited light text on a cream box.
 * Fix: pin dark text on every light surface of this window, in every look and theme. Scoped to #dm-tpl-ov only; no layout change. */
#dm-tpl-ov > div { background: #FFFFFF !important; color: #0A1628 !important; color-scheme: light; }
#dm-tpl-ov #dm-tpl-preview {
  background: #FAFAF7 !important;
  color: #0A1628 !important;
  -webkit-text-fill-color: #0A1628;
  border: 1px solid #C9CED8 !important;
  line-height: 1.55;
  scrollbar-color: #6B7690 #ECE9E0;
}
#dm-tpl-ov #dm-tpl-preview *:not(a) { color: inherit; }
#dm-tpl-ov #dm-tpl-preview a { color: #1A4FB4; text-decoration: underline; }
#dm-tpl-ov #dm-tpl-preview ::selection, #dm-tpl-ov #dm-tpl-preview::selection { background: #FFE9A8; color: #0A1628; }
#dm-tpl-ov #dm-tpl-preview::-webkit-scrollbar { width: 10px; }
#dm-tpl-ov #dm-tpl-preview::-webkit-scrollbar-track { background: #ECE9E0; }
#dm-tpl-ov #dm-tpl-preview::-webkit-scrollbar-thumb { background: #6B7690; border-radius: 6px; }
/* the "To:" line and the label above the chooser */
#dm-tpl-ov div[style*="color:#6B7280"] { color: #3F4A5E !important; }
#dm-tpl-ov .dm-lbl { color: #3F4A5E !important; }
/* the chooser: dark text on white, in every look */
#dm-tpl-ov select.dm-inp, #dm-tpl-ov #dm-tpl-sel {
  background: #FFFFFF !important; color: #0A1628 !important; -webkit-text-fill-color: #0A1628; border: 1px solid #C9CED8 !important;
}
#dm-tpl-ov #dm-tpl-sel option { background: #FFFFFF; color: #0A1628; }
/* buttons keep their own look; only make a disabled Send readable */
#dm-tpl-ov .dm-btn-p[disabled], #dm-tpl-ov .dm-btn[disabled] { opacity: .65; cursor: not-allowed; }
@media (max-width: 480px) {
  #dm-tpl-ov { padding: 10px !important; }
  #dm-tpl-ov #dm-tpl-preview { max-height: 46vh !important; }
}

/* RG-TPL-FIX-20261104 part 2: safety net for the same bug anywhere else.
 * An element with an inline LIGHT background and no inline text colour inherited the New look's light page text (dark theme only). Give it dark text.
 * Elements that set their own colour are untouched (the :not() lines). Does nothing in the Classic look or the light theme (dark text there already). */
html.nl-on:not([data-nl-theme="light"]) :is([style*="background:#fff;" i], [style$="background:#fff" i], [style*="background: #fff;" i], [style$="background: #fff" i], [style*="background:#FAFAF7;" i], [style$="background:#FAFAF7" i], [style*="background: #FAFAF7;" i], [style$="background: #FAFAF7" i], [style*="background:#F3F4F6;" i], [style$="background:#F3F4F6" i], [style*="background: #F3F4F6;" i], [style$="background: #F3F4F6" i], [style*="background:#F6F8FA;" i], [style$="background:#F6F8FA" i], [style*="background: #F6F8FA;" i], [style$="background: #F6F8FA" i], [style*="background:#FFFDF6;" i], [style$="background:#FFFDF6" i], [style*="background: #FFFDF6;" i], [style$="background: #FFFDF6" i], [style*="background:white;" i], [style$="background:white" i], [style*="background: white;" i], [style$="background: white" i], [style*="background-color:#fff;" i], [style$="background-color:#fff" i]):not([style^="color:" i]):not([style*=";color:" i]):not([style*="; color:" i]):not(.dm-btn-p):not(input):not(select):not(textarea):not(button) { color: #0A1628; }
/* Team Leader vacancies error line was 4.32:1 in the light theme */
html.nl-on[data-nl-theme="light"] .pv-error { color: #A8211A; }

/* RG-NL-DISPLAY-20261104: the "Aa" display control (js/rg-nl-display.js) */
.rg-disp-btn { min-width: 44px; min-height: 36px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.rg-disp-aa { font-weight: 800; font-size: 14px; letter-spacing: -.02em; line-height: 1; }
.rg-disp-pop { position: fixed; z-index: 99990; box-sizing: border-box; padding: 14px; border-radius: 14px; background: var(--nl-surface, #FFFFFF); color: var(--nl-fg, #0A1628); border: 1px solid var(--nl-line2, rgba(10,22,40,.18)); box-shadow: 0 18px 48px rgba(0,0,0,.28); font-family: inherit; }
.rg-disp-pop[hidden] { display: none; }
.rg-disp-h { font-size: 15px; font-weight: 800; margin-bottom: 10px; color: var(--nl-fg, #0A1628); }
.rg-disp-l { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--nl-muted, #53607A); margin: 10px 0 6px; }
.rg-disp-seg { display: flex; gap: 6px; }
.rg-disp-seg button { flex: 1 1 0; min-height: 44px; padding: 6px 4px; font-size: 14px; font-weight: 700; font-family: inherit; cursor: pointer; border-radius: 10px; border: 1px solid var(--nl-line2, rgba(10,22,40,.25)); background: var(--nl-surface2, #F0EDE4); color: var(--nl-fg, #0A1628); }
.rg-disp-seg button[aria-pressed="true"] { background: var(--nl-gold, #C9A227); color: var(--nl-gold-ink, #0A1628); border-color: var(--nl-gold, #C9A227); }
.rg-disp-seg button:focus-visible, .rg-disp-btn:focus-visible { outline: 3px solid var(--nl-gold, #C9A227); outline-offset: 2px; }
.rg-disp-note { margin-top: 10px; font-size: 12px; color: var(--nl-muted, #53607A); }
/* Larger text: the pages are built in pixels, so the main content area is scaled (zoom) instead of the root font size. Fixed bars, tabs and windows are not scaled. */
html[data-nl-size="l"] .content { zoom: 1.12; }
html[data-nl-size="xl"] .content { zoom: 1.25; }

/* RG-NL-DISPLAY-20261104 part 3: status colours on tinted chips were 3.57:1 in the light theme (overdue timer text on its red tint). Darker status text colours, light theme only. */
html.nl-on[data-nl-theme="light"] { --nl-bad: #A32920; --nl-good: #0B7350; }

/* RG-NL-DISPLAY-20261104 part 4: visibility sweep (owner: "make sure everything is visible").
 * Rules found by the audit: placeholders, status text on tinted chips, input borders, icon colours, phone text and input sizes, login screen. */

/* placeholders: readable in both themes (the browser default grey was 3.9:1) */
html.nl-on input::placeholder, html.nl-on textarea::placeholder { color: var(--nl-muted); opacity: 1; }
#loginView input::placeholder { color: #5B6572; opacity: 1; }

/* login screen (root page): small grey and gold lines on white were 2.5 to 3.1:1 */
#loginView div[style*="color:#9AA5B1" i] { color: #4B5563 !important; font-size: 12px !important; }
#loginView div[style*="color:#C9A227" i] { color: #7A5D00 !important; font-size: 12px !important; }
#loginView div[style*="color:#5b6672" i] { font-size: 13px !important; }
/* light theme: status greens on pale green chips were 4.36:1 */
html.nl-on[data-nl-theme="light"] :is(.adv-cal-ev.e-gr, .tl-cal-ev.e-gr, .badge.b-gr, .rgpc-pill.rgpc-t-ok) { color: #0A5F40 !important; }

/* input borders: at least 3:1 against the card they sit on (they were 1.3 to 2.2:1) */
html.nl-on[data-nl-theme="light"] :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="image"]):not(:focus):not([aria-invalid="true"]):not(#_) { border-color: #7C879B !important; }
html.nl-on:not([data-nl-theme="light"]) :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="image"]):not(:focus):not([aria-invalid="true"]):not(#_) { border-color: rgba(255, 255, 255, .4) !important; }

/* phones: inputs 16px (no iOS zoom on focus). Body text: the text size control defaults to Large (x1.12) on phones for people who never chose (js/rg-nl-display.js). */
@media (max-width: 640px) {
  html.nl-on :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="hidden"]):not(#_) { font-size: 16px !important; }
}

/* small text on tinted chips and avatars (both themes): 4.1 to 4.4:1 before */
html.nl-on .av[style*="#1D4ED8" i] { color: #1E3A8A !important; }
html.nl-on .tl-cal-more { color: var(--nl-muted); }
html.nl-on [style*="color:var(--t3)" i] { color: var(--nl-muted) !important; }
/* light theme: gold / amber / grey icons were 1.8 to 2.5:1 on white */
html.nl-on[data-nl-theme="light"] .lead360-card-k i, html.nl-on[data-nl-theme="light"] .lead360-tip > i { color: var(--nl-gold-text); }
html.nl-on[data-nl-theme="light"] .tl-dot i { color: #8A4B00; }
html.nl-on[data-nl-theme="light"] button > i.ti-x { color: #4B5563; }
html.nl-on[data-nl-theme="light"] .aiq-on.on { color: #065F3A !important; }
