/**
 * RC CONTRAST LOCK — load LAST after app.css + a11y.css
 * Version: 20260928.07
 * Purpose: permanent high-contrast text vs backgrounds (light + dark).
 * Do not dilute these rules in feature CSS; extend this file only.
 */

/* ── Tokens (locked) ─────────────────────────────────────────── */
:root,
html[data-theme="light"],
html:not([data-theme="dark"]):not(.dark) {
  --rc-ink: #0f172a;
  --rc-ink-soft: #1e293b;
  --rc-ink-muted: #334155;
  --rc-ink-faint: #475569;
  --rc-paper: #f8fafc;
  --rc-card: #ffffff;
  --rc-border: #e2e8f0;
  color-scheme: light;
}

html[data-theme="dark"],
html.dark {
  --rc-ink: #f8fafc;
  --rc-ink-soft: #e2e8f0;
  --rc-ink-muted: #cbd5e1;
  --rc-ink-faint: #94a3b8;
  --rc-paper: #0b1220;
  --rc-card: #111827;
  --rc-border: #334155;
  color-scheme: dark;
}

/* ── Base canvas ─────────────────────────────────────────────── */
html[data-theme="light"] body,
html:not([data-theme="dark"]):not(.dark) body {
  color: var(--rc-ink) !important;
  background-color: var(--rc-paper) !important;
  background-image: none !important;
}

html[data-theme="dark"] body,
html.dark body {
  color: var(--rc-ink) !important;
  background-color: var(--rc-paper) !important;
}

/* Main content surfaces */
html[data-theme="light"] main,
html[data-theme="light"] .main-scroll,
html[data-theme="light"] #content-area,
html[data-theme="light"] .rc-main,
html[data-theme="light"] #rc-main-content {
  color: var(--rc-ink) !important;
  background-color: transparent;
}

html[data-theme="dark"] main,
html[data-theme="dark"] .main-scroll,
html[data-theme="dark"] #content-area,
html[data-theme="dark"] .rc-main {
  color: var(--rc-ink) !important;
}

/* Cards / panels on light */
html[data-theme="light"] .bg-white,
html[data-theme="light"] .bg-slate-50,
html[data-theme="light"] .bg-slate-100,
html[data-theme="light"] .bg-gray-50,
html[data-theme="light"] .bg-gray-100,
html[data-theme="light"] [class*="rounded"][class*="bg-white"],
html[data-theme="light"] .rc-card,
html[data-theme="light"] article.bg-white {
  color: var(--rc-ink) !important;
  background-color: var(--rc-card) !important;
}

/* Kill translucent glass that washes out type on light */
html[data-theme="light"] .bg-white\/50,
html[data-theme="light"] .bg-white\/60,
html[data-theme="light"] .bg-white\/70,
html[data-theme="light"] .bg-white\/80,
html[data-theme="light"] .bg-slate-50\/50,
html[data-theme="light"] .bg-slate-50\/80,
html[data-theme="light"] [class*="backdrop-blur"] {
  background-color: #ffffff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  color: var(--rc-ink) !important;
}

/* Light: never pure white / near-white text on paper */
html[data-theme="light"] main .text-white:not([class*="bg-slate-9"]):not([class*="bg-gray-9"]):not([class*="bg-blue-"]):not([class*="bg-indigo-"]):not([class*="bg-emerald-"]):not([class*="bg-rose-"]):not([class*="bg-amber-"]):not([class*="bg-black"]):not([class*="from-"]):not(.sidebar *):not(#rc-role-switch *):not([class*="bg-gradient"]),
html[data-theme="light"] main .text-slate-50,
html[data-theme="light"] main .text-slate-100,
html[data-theme="light"] main .text-slate-200,
html[data-theme="light"] #content-area .text-white:not([class*="bg-"]) {
  color: var(--rc-ink) !important;
}

html[data-theme="light"] main .text-slate-300,
html[data-theme="light"] main .text-slate-400 {
  color: var(--rc-ink-faint) !important;
}

html[data-theme="light"] .text-slate-500,
html[data-theme="light"] .text-slate-600 {
  color: var(--rc-ink-muted) !important;
}

html[data-theme="light"] .text-slate-700,
html[data-theme="light"] .text-slate-800,
html[data-theme="light"] .text-slate-900,
html[data-theme="light"] .text-gray-900,
html[data-theme="light"] .text-black {
  color: var(--rc-ink) !important;
}

/* Forms on light */
html[data-theme="light"] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  color: #0f172a !important;
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
}
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
  color: #64748b !important;
  opacity: 1 !important;
}

/* Dark mode: bright ink on dark paper */
html[data-theme="dark"] .text-slate-900,
html[data-theme="dark"] .text-slate-800,
html[data-theme="dark"] .text-slate-700,
html[data-theme="dark"] .text-gray-900,
html[data-theme="dark"] .text-black {
  color: #f1f5f9 !important;
}

html[data-theme="dark"] .text-slate-600,
html[data-theme="dark"] .text-slate-500,
html[data-theme="dark"] .text-slate-400 {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .text-slate-300,
html[data-theme="dark"] .text-slate-200,
html[data-theme="dark"] .text-slate-100,
html[data-theme="dark"] .text-white {
  color: #f8fafc !important;
}

html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .bg-slate-50,
html[data-theme="dark"] .bg-slate-100 {
  background-color: #1e293b !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  color: #f8fafc !important;
  background-color: #0f172a !important;
  border-color: #475569 !important;
}


/* (removed permanent sidebar lock — themes control sidebar) */


/* Role rail */
#rc-role-switch {
  background: #0f172a !important;
  color: #e2e8f0 !important;
}
#rc-role-switch .rc-role-btn {
  color: #e2e8f0 !important;
}

/* Headers / sticky bars on light */
html[data-theme="light"] header,
html[data-theme="light"] .sticky.bg-white,
html[data-theme="light"] .sticky.bg-slate-50 {
  color: #0f172a !important;
  background-color: #ffffff !important;
}

/* Tables */
html[data-theme="light"] table,
html[data-theme="light"] th,
html[data-theme="light"] td {
  color: #0f172a !important;
}
html[data-theme="dark"] table,
html[data-theme="dark"] th,
html[data-theme="dark"] td {
  color: #e2e8f0 !important;
}

/* Changelog / modals */
html[data-theme="light"] [role="dialog"],
html[data-theme="light"] .rc-ed-panel,
html[data-theme="light"] #enterprise-editor-root .rc-ed-panel {
  color: #0f172a !important;
  background: #ffffff !important;
}
html[data-theme="dark"] [role="dialog"],
html[data-theme="dark"] .rc-ed-panel {
  color: #f8fafc !important;
  background: #0f172a !important;
}

/* Numerology report — force legible paper when not print-dedicated */
html[data-theme="light"] #report-container,
html[data-theme="light"] #report-container.nr-manuscript,
html[data-theme="light"] body.nr-sacred {
  color: #0f172a !important;
  background: #f1f5f9 !important;
  background-image: none !important;
}
html[data-theme="light"] #report-container .nr-card,
html[data-theme="light"] #report-container section.nr-card {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #e2e8f0 !important;
  backdrop-filter: none !important;
}
html[data-theme="light"] #report-container p,
html[data-theme="light"] #report-container li,
html[data-theme="light"] #report-container td,
html[data-theme="light"] #report-container th,
html[data-theme="light"] #report-container h1,
html[data-theme="light"] #report-container h2,
html[data-theme="light"] #report-container h3,
html[data-theme="light"] #report-container span:not(.nr-pill) {
  color: #0f172a !important;
  text-shadow: none !important;
}

html[data-theme="dark"] #report-container .nr-card {
  background: rgba(15, 23, 42, 0.92) !important;
  color: #f8fafc !important;
}
html[data-theme="dark"] #report-container p,
html[data-theme="dark"] #report-container li,
html[data-theme="dark"] #report-container h1,
html[data-theme="dark"] #report-container h2,
html[data-theme="dark"] #report-container h3 {
  color: #f1f5f9 !important;
}

/* Buttons with solid dark fills keep white text */
html[data-theme="light"] .bg-slate-900,
html[data-theme="light"] .bg-slate-800,
html[data-theme="light"] .bg-gray-900,
html[data-theme="light"] .bg-black,
html[data-theme="light"] .bg-blue-600,
html[data-theme="light"] .bg-blue-700,
html[data-theme="light"] .bg-indigo-600,
html[data-theme="light"] .bg-emerald-600,
html[data-theme="light"] .bg-rose-600 {
  color: #ffffff !important;
}

/* Monitor / opt panels */
html[data-theme="light"] .font-mono,
html[data-theme="light"] pre,
html[data-theme="light"] code {
  color: #0f172a !important;
}
html[data-theme="dark"] .font-mono,
html[data-theme="dark"] pre {
  color: #e2e8f0 !important;
}

/* Print always black on white */
@media print {
  html, body, main, .nr-card, #report-container, #report-container * {
    color: #000 !important;
    background: #fff !important;
    background-image: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
}



/* (removed permanent sidebar lock — themes control sidebar) */




/* (removed permanent sidebar lock — themes control sidebar) */

/* ── Header count badge + IST clock — locked readable in light & dark ── */
.rc-count-badge {
  background: #0f172a !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}
html[data-theme="dark"] .rc-count-badge,
html.dark .rc-count-badge {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}
.rc-header-clock {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}
html[data-theme="dark"] .rc-header-clock,
html.dark .rc-header-clock {
  background: #1e293b !important;
  color: #f1f5f9 !important;
  border-color: #475569 !important;
}
/* Exempt badge from light-mode "force dark ink on slate-100" rule */
html[data-theme="light"] main .rc-count-badge,
html[data-theme="light"] main .rc-count-badge.text-slate-100 {
  color: #f8fafc !important;
}

header .rc-count-badge,
main header .rc-count-badge,
#rc-main-content header .rc-count-badge {
  background: #0f172a !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}
html[data-theme="dark"] header .rc-count-badge,
html.dark header .rc-count-badge {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}


/* Insights single-row icon strip (sidebar) */
.rc-insights-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.35rem;
}
.rc-insights-icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.55rem;
  color: #cbd5e1 !important;
  background: rgba(30, 41, 59, 0.85) !important;
  border: 1px solid #334155;
  text-decoration: none !important;
  flex-shrink: 0;
}
.rc-insights-icon:hover,
.rc-insights-icon.is-active {
  color: #fff !important;
  background: #2563eb !important;
  border-color: #60a5fa;
}
.rc-insights-icon i { font-size: 0.85rem; margin: 0 !important; }

/* Team toolbar: primary card icons stay one row */
.rc-team-card-actions {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 0.25rem;
}


/* ═══ 20260929.37 Universal readability (Light / Dark / Luxury) ═══ */
html[data-theme="light"] h1, html[data-theme="light"] h2, html[data-theme="light"] h3,
html[data-theme="light"] p, html[data-theme="light"] li, html[data-theme="light"] td,
html[data-theme="light"] th, html[data-theme="light"] label, html[data-theme="light"] span,
html[data-theme="light"] .text-slate-800, html[data-theme="light"] .text-slate-900,
html[data-theme="light"] .text-gray-800, html[data-theme="light"] .text-gray-900 {
  color: #0f172a !important;
}
html[data-theme="light"] .text-slate-500, html[data-theme="light"] .text-slate-600,
html[data-theme="light"] .text-slate-400, html[data-theme="light"] .text-gray-500 {
  color: #334155 !important;
}
html[data-theme="light"] aside, html[data-theme="light"] aside a,
html[data-theme="light"] #rc-sidebar, html[data-theme="light"] #rc-sidebar a {
  color: #0f172a !important;
}
html[data-theme="light"] .rc-count-badge {
  background: #1e293b !important; color: #f8fafc !important;
}

html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3,
html[data-theme="dark"] p, html[data-theme="dark"] li, html[data-theme="dark"] td,
html[data-theme="dark"] th, html[data-theme="dark"] label,
html[data-theme="dark"] .text-slate-800, html[data-theme="dark"] .text-slate-900 {
  color: #f8fafc !important;
}
html[data-theme="dark"] .text-slate-500, html[data-theme="dark"] .text-slate-600,
html[data-theme="dark"] .text-slate-400 {
  color: #cbd5e1 !important;
}
html[data-theme="dark"] aside a, html[data-theme="dark"] #rc-sidebar a {
  color: #e2e8f0 !important;
}

/* Luxury / Reserve */
html[data-theme="reserve"] h1, html[data-theme="reserve"] h2, html[data-theme="reserve"] h3,
html[data-theme="reserve"] p, html[data-theme="reserve"] li, html[data-theme="reserve"] td,
html[data-theme="reserve"] th, html[data-theme="reserve"] label,
html[data-theme="reserve"] .text-slate-800, html[data-theme="reserve"] .text-slate-900 {
  color: #f5efe6 !important;
}
html[data-theme="reserve"] .text-slate-500, html[data-theme="reserve"] .text-slate-600,
html[data-theme="reserve"] .text-slate-400 {
  color: #d4c4a8 !important;
}
html[data-theme="reserve"] aside a, html[data-theme="reserve"] #rc-sidebar a {
  color: #ebe0d0 !important;
}
html[data-theme="reserve"] .rc-count-badge {
  background: #d4af6a !important; color: #2a1810 !important;
}

/* Tables */
html[data-theme="light"] table th { color: #0f172a !important; background: #f1f5f9 !important; }
html[data-theme="dark"] table th { color: #f8fafc !important; background: #1e293b !important; }
html[data-theme="reserve"] table th { color: #f5efe6 !important; background: #2a1216 !important; }

/* RC theme contrast lock — 20261001.12
   Permanent light / dark / reserve readability for team cards, widgets, celebrations.
   Load AFTER Tailwind / theme-global / theme-reserve.
*/

/* ── Live widgets ─────────────────────────────────────────── */
html[data-theme="light"] #rc-live-strip > .rc-live-cell {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
}
html[data-theme="light"] #rc-live-strip > .rc-live-cell #rc-wall-clock,
html[data-theme="light"] #rc-live-strip > .rc-live-cell #rc-wx-temp,
html[data-theme="light"] #rc-live-strip > .rc-live-cell #rc-aqi-val {
  color: #0f172a !important;
}
html[data-theme="light"] #rc-live-strip > .rc-live-cell #rc-wall-date,
html[data-theme="light"] #rc-live-strip > .rc-live-cell #rc-wx-desc,
html[data-theme="light"] #rc-live-strip > .rc-live-cell #rc-aqi-detail {
  color: #475569 !important;
}

html[data-theme="dark"] #rc-live-strip > .rc-live-cell {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] #rc-live-strip > .rc-live-cell #rc-wall-clock,
html[data-theme="dark"] #rc-live-strip > .rc-live-cell #rc-wx-temp,
html[data-theme="dark"] #rc-live-strip > .rc-live-cell #rc-aqi-val {
  color: #f8fafc !important;
}
html[data-theme="dark"] #rc-live-strip > .rc-live-cell #rc-wall-date,
html[data-theme="dark"] #rc-live-strip > .rc-live-cell #rc-wx-desc,
html[data-theme="dark"] #rc-live-strip > .rc-live-cell #rc-aqi-detail,
html[data-theme="dark"] #rc-live-strip > .rc-live-cell .text-slate-500,
html[data-theme="dark"] #rc-live-strip > .rc-live-cell .text-slate-600,
html[data-theme="dark"] #rc-live-strip > .rc-live-cell .text-slate-400 {
  color: #94a3b8 !important;
}

html[data-theme="reserve"] #rc-live-strip > .rc-live-cell {
  background: #2a1216 !important;
  border-color: #5c3038 !important;
  color: #f5efe6 !important;
}
html[data-theme="reserve"] #rc-live-strip > .rc-live-cell #rc-wall-clock,
html[data-theme="reserve"] #rc-live-strip > .rc-live-cell #rc-wx-temp,
html[data-theme="reserve"] #rc-live-strip > .rc-live-cell #rc-aqi-val {
  color: #f0e2c4 !important;
}
html[data-theme="reserve"] #rc-live-strip > .rc-live-cell #rc-wall-date,
html[data-theme="reserve"] #rc-live-strip > .rc-live-cell #rc-wx-desc,
html[data-theme="reserve"] #rc-live-strip > .rc-live-cell #rc-aqi-detail,
html[data-theme="reserve"] #rc-live-strip > .rc-live-cell .text-slate-500,
html[data-theme="reserve"] #rc-live-strip > .rc-live-cell .text-slate-600,
html[data-theme="reserve"] #rc-live-strip > .rc-live-cell .text-slate-400 {
  color: #d4c4a8 !important;
}

/* ── Celebrations strip ───────────────────────────────────── */
html[data-theme="light"] #rc-bday-strip {
  background: linear-gradient(90deg, #fffbeb, #ffffff, #fff1f2) !important;
  border-color: #fde68a !important;
}
html[data-theme="light"] #rc-bday-strip .rc-bday-head,
html[data-theme="light"] #rc-bday-strip span {
  color: #92400e !important;
}

html[data-theme="dark"] #rc-bday-strip {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 50%, #1e1b4b 100%) !important;
  border-color: #475569 !important;
}
html[data-theme="dark"] #rc-bday-strip .rc-bday-head {
  border-bottom-color: #334155 !important;
}
html[data-theme="dark"] #rc-bday-strip,
html[data-theme="dark"] #rc-bday-strip span,
html[data-theme="dark"] #rc-bday-strip .text-amber-800\/90,
html[data-theme="dark"] #rc-bday-strip .text-slate-600,
html[data-theme="dark"] #rc-bday-strip .text-slate-700 {
  color: #e2e8f0 !important;
}
html[data-theme="dark"] #rc-bday-strip a {
  color: #93c5fd !important;
}

html[data-theme="reserve"] #rc-bday-strip {
  background: linear-gradient(135deg, #3a181c 0%, #2a1216 50%, #3d1f18 100%) !important;
  border-color: rgba(212, 175, 106, 0.4) !important;
}
html[data-theme="reserve"] #rc-bday-strip .rc-bday-head {
  border-bottom-color: rgba(212, 175, 106, 0.25) !important;
}
html[data-theme="reserve"] #rc-bday-strip,
html[data-theme="reserve"] #rc-bday-strip span,
html[data-theme="reserve"] #rc-bday-strip .text-amber-800\/90 {
  color: #f0e2c4 !important;
}
html[data-theme="reserve"] #rc-bday-strip a {
  color: #d4af6a !important;
}

/* ── Team meta pills global (belt-and-suspenders with tab_team) ── */
html[data-theme="dark"] .rc-vcard-pill {
  background: #334155 !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}
html[data-theme="reserve"] .rc-vcard-pill {
  background: rgba(212, 175, 106, 0.14) !important;
  border-color: rgba(212, 175, 106, 0.45) !important;
  color: #f5efe6 !important;
}
html[data-theme="dark"] .rc-vcard-foot {
  background: #0f172a !important;
  border-color: #334155 !important;
}
html[data-theme="reserve"] .rc-vcard-foot {
  background: #1a0a0c !important;
  border-color: #5c3038 !important;
}

/* Count badges in header */
html[data-theme="dark"] .rc-count-badge,
html[data-theme="dark"] .bg-slate-100.text-slate-600 {
  background: #334155 !important;
  color: #e2e8f0 !important;
}
html[data-theme="reserve"] .rc-count-badge,
html[data-theme="reserve"] .bg-slate-100.text-slate-600 {
  background: rgba(212, 175, 106, 0.15) !important;
  color: #f5efe6 !important;
}

/* Kill hardcoded white on fav in any theme */
html[data-theme="dark"] .rc-fav-btn,
html[data-theme="reserve"] .rc-fav-btn {
  background-color: transparent !important;
}
html[data-theme="dark"] .rc-fav-btn {
  background: #1e293b !important;
  border-color: #475569 !important;
}
html[data-theme="reserve"] .rc-fav-btn {
  background: #2a1216 !important;
  border-color: #5c3038 !important;
}


/* 20261001.16 — Celebrations strip must follow theme (kill Tailwind amber gradient) */
html[data-theme="dark"] #rc-bday-strip,
html[data-theme="dark"] #rc-live-strip > #rc-bday-strip {
  background: #1e293b !important;
  background-image: none !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] #rc-bday-strip .rc-bday-kicker,
html[data-theme="dark"] #rc-bday-strip .rc-bday-count,
html[data-theme="dark"] #rc-bday-strip .rc-bday-date,
html[data-theme="dark"] #rc-bday-strip .rc-bday-head,
html[data-theme="dark"] #rc-bday-strip p,
html[data-theme="dark"] #rc-bday-strip span {
  color: #e2e8f0 !important;
}
html[data-theme="reserve"] #rc-bday-strip,
html[data-theme="reserve"] #rc-live-strip > #rc-bday-strip {
  background: #2a1216 !important;
  background-image: none !important;
  border-color: #5c3038 !important;
  color: #f5efe6 !important;
}
html[data-theme="reserve"] #rc-bday-strip .rc-bday-kicker {
  color: #d4af6a !important;
}
html[data-theme="reserve"] #rc-bday-strip .rc-bday-count,
html[data-theme="reserve"] #rc-bday-strip .rc-bday-date,
html[data-theme="reserve"] #rc-bday-strip .rc-bday-head,
html[data-theme="reserve"] #rc-bday-strip p,
html[data-theme="reserve"] #rc-bday-strip span {
  color: #f5efe6 !important;
}
html[data-theme="reserve"] #rc-bday-strip a {
  color: #d4af6a !important;
}
